

// JavaScript Document
function chkGreaterYear(){
	var startYear = parseInt(document.getElementById("startYear").value);
	var endYear = parseInt(document.getElementById("endYear").value);
	var swapVal = '';
	if(parseInt(startYear) >= parseInt(endYear)){
		alert("Year value cannot be greater than previous year value.");
       swapVal = document.getElementById("endYear").value;
		document.getElementById("endYear").value = document.getElementById("startYear").value;
		document.getElementById("startYear").value = swapVal;

		return false;
	}
	else{
		return true;
	}
}

function checkIt(evt) {
  var evt = (evt) ? evt : window.event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		var status = "Numeric Only field: Please enter in a numeric value";
		alert(status);
	 return false;
	}
  else{
      status = "";
  	  return true;
    }
  }

	var srchString="<?php echo $auctTitle;?>";

	//function used to reset the combo boxes values for city and county
	function resetBoxes(typID)
	{
	   document.getElementById(typID).value="";
	}

	function resetPageVars()
	{
		$("#pageNum").attr("value","");
		$("#pageGroup").attr("value","");
	}

	function enterkey_submit(evt)
	{
	  var evt = (evt) ? evt : event
	  var charCode = (evt.which) ? evt.which : evt.keyCode
	  if (charCode == 13)
	  {
		openLoadingDiv();
		//update_contents('');
	  }
	}

	function lateAddition()
	{
		resetPageVars();
		document.getElementById("lateAdditions").value="yes";
		var auctionID=document.getElementById('auctionID').value;
		update_contents(auctionID);
	}

	function viewUpdatedProperties()
	{
		resetPageVars();
		document.getElementById("viewUpdatedProperties").value="yes";
		var auctionID=document.getElementById('auctionID').value;
		update_contents(auctionID);
	}

	function mouseX(evt)
	{
		if (evt.pageX) return evt.pageX;
		else if (evt.clientX)
		   return evt.clientX + (document.documentElement.scrollLeft ?
		   document.documentElement.scrollLeft :
		   document.body.scrollLeft);
		else return null;
	}

	function mouseY(evt)
	{
		if (evt.pageY) return evt.pageY;
		else if (evt.clientY)
		   return evt.clientY + (document.documentElement.scrollTop ?
		   document.documentElement.scrollTop :
		   document.body.scrollTop);
		else return null;
	}

	function displayLoginDiv(divId,rightInd,backUrl,auctionID,itemId,e)
	{
		var viewType=document.getElementById("viewType").value;
	    previousPageUrl=backUrl;
		qryStr='';
		if(backUrl=='bidNow')
		{
			if(document.getElementById('loginLink'))
			 document.getElementById('loginLink').innerHTML='';

			var qryStr="bidStatus=1&auctionID="+auctionID+"&item="+itemId;
			previousPageUrl="";
			var str="You need to create a 100% Free Account in order to make offer for this property <a href='<?php echo $_SITE_PATH_SSL;?>login.php"+qryStr+"'><img src='<?php echo $imgPathVar;?>register-now.gif' width='103' height='20' vspace='3' border='0' align='absmiddle' title='Loading..'   /></a>";
			if(document.getElementById('loginLink'))
				document.getElementById('loginLink').innerHTML=str;
		}
		else
		{	if(document.getElementById('loginLink'))
			  document.getElementById('loginLink').innerHTML='';

			var str="You need to create a 100% Free Account in order to save this listing <a href='<?php echo $_SITE_PATH_SSL;?>login.php'><img src='<?php echo $imgPathVar;?>register-now.gif' width='103' height='20' vspace='3' border='0' align='absmiddle' title='Loading..'   /></a>";

			if(document.getElementById('loginLink'))
			  document.getElementById('loginLink').innerHTML=str;
		}

		if(document.getElementById('div_Hid'))
		var divIdOld=document.getElementById('div_Hid').value;

		if(divIdOld && document.getElementById(divIdOld))
		{
			document.getElementById(divIdOld).innerHTML='';
		}
		document.getElementById('div_Hid').value=divId;
		document.getElementById(divId).style.right=rightInd+'px';
		tb_show("",SITE_PATH_SSL+"component/global-search-allAssetTypeLoginBox.inc.php?propertyId="+itemId+"&itemIdBack="+itemId+"&auctionIdBack="+auctionID+"&backUrl="+backUrl+"&previousPageUrl="+previousPageUrl+"&viewType="+viewType+"&qryStrng="+escape(qryStr)+thickboxLoginDimensions,"");
	}

	function closeLoginBox()
	{
		document.getElementById('loginBox').style.display="none";
	}

	//function for Email Checking
	function IsEmailAddressValid(objEmail,strErrorMesg)
	{
		var blnIsEmailAddress = true;
		var blnObjectPrm=false;
		var i=0;
		var strEmail='';
		var objThis;

		if (isIE)
			blnObjectPrm = (typeof(objEmail)=='object'?true:false) ;

		if (blnObjectPrm) {
			objThis = objEmail;
			strEmail=objEmail.value;
		}
		else
		{
			if (objEmail.substring(0,8)=='document')
			{
				objThis =eval(objEmail);
				strEmail=objThis.value;
				blnObjectPrm = true;
			}
			else
			strEmail=objEmail;
		}
		blnIsEmailAddress=(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);
		if (!blnIsEmailAddress && strErrorMesg!='')
		{
			//alert(strErrorMesg);
			if (blnObjectPrm)
			{
				//objThis.select();
				objThis.focus();
			}
		}
		return blnIsEmailAddress;
	}

	function validateLoginForm(myform)
	{
		var MasterString="Sorry, we cannot complete your request. Kindly provide us the missing or incorrect information enclosed below.";
		var flag=false;
		var visitor="";
		var strEmail=myform.email.value;

		//blnIsEmailAddress=(strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);
		//if (!blnIsEmailAddress)
		if (!IsEmailAddressValid(myform.email.value,''))
		{
			visitor +=  "\n- Please enter valid email address.";
			document.getElementById('email').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('email').style.backgroundColor='';
		}

		if (myform.password.value=="")
		{
			visitor +=  "\n- Please enter password.";
			document.getElementById('password').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('password').style.backgroundColor='';
		}

		if (visitor!="")
		{
			MasterString=MasterString + visitor;
			flag=true;
		}

		if(flag==true)
		{
			alert(MasterString);
			return false;
		}
		return true;
	}



	function update_contents(pageID,tabFlag)
	{
            if(document.getElementById('shutOffMsg')) document.getElementById('shutOffMsg').style.display="none";
                var pageID_b = pageID;
                var tagFlag_b = tabFlag;
		var srchJoin=" > ";
		var srchParas="";
		window.location.hash = '#;';
		 if (objHttpFileRequest !=null ) // abort request to call ajax multiple time when zoom or move
		{
		    // Abort the AJAX Search request.
		objHttpFileRequest.abort();
		}

	       objHttpFileRequest=null;

		   $('#dvMainContainer').show();
			

		   var para="task=loadAuctionDetails";
			//if venues checked
		   var chkdVenues=$("#venueIDs").attr("value");
		   if(chkdVenues!=undefined){
			   para+="&venueIDs="+chkdVenues;
		   }

			//view only removed properties
		   var chkRemovedVal=$("#chkRemoved").attr("value");
		   if(chkRemovedVal!=undefined && chkRemovedVal==1){
			 para+="&chkRemovedVal="+chkRemovedVal;
		   }

		   //view only escrow properties
		   var chkEscrowPropVal=$("#chkEscrowProp").attr("value");
		   if(chkEscrowPropVal!=undefined && chkEscrowPropVal==1){
			   para+="&chkEscrowPropVal="+chkEscrowPropVal;
		   }

		   var locate="";
			//page number
		   var pageNum=$("#pageNum").attr("value");

		   if(pageNum!=undefined){
			   para+="&page="+pageNum;
			   locate+="&page="+pageNum;
		   }

		   var pageGroup=$("#pageGroup").attr("value");
		   if(pageGroup!=undefined){
			   para+="&pagegroup="+pageGroup;
			   locate+="&pagegroup="+pageGroup;
		   }

		   var getVenueId=$("#getVenueId").attr("value");
		   if(getVenueId!=undefined){
			   para+="&getVenueId="+getVenueId;
		   }

			//show records per page
		   var recsPerPage=$("#recsPerPage").attr("value");
		   if(recsPerPage!=undefined){
			   resetPageVars();
			   para+="&listPaging="+recsPerPage;
			   locate+="&listPaging="+recsPerPage;
		   }

		   	//listing view type list or grid
		   var viewType=$("#viewType").attr("value");
		   if(viewType!=undefined){
			   para+="&view="+viewType;
			   locate+="&view="+viewType;
		   }

		    var propertyAddress=$("#propertyAddress").attr("value");
		   if(propertyAddress!=undefined){
			   para+="&propertyAddress="+propertyAddress;
		   }

		    if(tabFlag=="3" ||  $("#featured").attr('checked') )
	           para+="&tab=3&featured=Yes&&chkViewPresaleProp=";
	        else if(tabFlag=="2"  || $("#chkViewPresaleProp").attr('checked'))
	           para+="&tab=2&chkViewPresaleProp=Yes";
	        else
		    {
				  para+="&tab=1";
				  if(document.getElementById("featured"))
				  document.getElementById("featured").checked= false ;
		    }

		   	var presale='';
			if(document.getElementById('chkViewPresaleProp') && document.getElementById('chkViewPresaleProp').checked==true)
			{
				presale='Yes';
				document.getElementById('chkViewPresaleProp').value="1";
				para+="&chkViewPresaleProp="+presale;
			}


		   //listing view type list or grid
		  if(document.getElementById('featured') && document.getElementById('featured').checked==true)
		  {
			   var featured=document.getElementById('featured').value;
			   if(featured!=undefined){
				   para+="&featured="+featured;
			   }
	      }
		   //show late addition properties
		   var lateAdditions=$("#lateAdditions").attr("value");
		   if(lateAdditions!=undefined){
			   para+="&lateAdditions="+lateAdditions;
		   }

			//viewUpdatedProperties
		   var viewUpdatedProperties=$("#viewUpdatedProperties").attr("value");
		   if(viewUpdatedProperties!=undefined){
			   para+="&viewUpdatedProperties="+viewUpdatedProperties;
		   }


		   //show State
		   var aucTState=$("#auctionState").attr("value");
		   var State=$("#State").attr("value");




		   if(aucTState!=undefined)
		   {
			   para+="&propertyState="+aucTState;
			   if(srchParas!=""){
				   srchParas+=" > ";
			   }
			   if($("#countyName").attr("value"))
			   {
			   	srchParas+="<a href='"+SITE_PATH+State.replace(" ","-")+"/auction.html'>"+State+"</a>";
			   }
			   else
			   {
			   	srchParas+=State;
			   }

		   }

		  var hiddenState = $("#hiddenState").attr("value")	;
		   if(hiddenState!="" && hiddenState!=undefined)
			   para+="&propertyState="+hiddenState;


			//show State
		   var countyName=$("#countyName").attr("value");
		   if(countyName!=undefined){
			   para+="&propertyCounty="+countyName;
			   if(countyName!=""){
				   srchParas+=" > ";
			   }
			   if($("#cityName").attr("value"))
			   {
			   	srchParas+="<a href='"+SITE_PATH+State.replace(" ","-")+"/"+countyName.replace(" ","-")+"-County/auction.html'>"+countyName+"</a>";
			   }
			   else
			   {
			   	srchParas+=countyName;
			   }
		   }


		   //show city
		   var cityVal=$("#cityName").attr("value");
		   if(cityVal!=undefined){
			   para+="&cityVal="+cityVal;
				if(cityVal!=""){
				srchParas+=" > ";
		   }
		   srchParas+=cityVal;
		  }

		  //show city
		   var cityVal=$("#stateIDLeft").attr("value");
		   if(cityVal!=undefined){
			   para+="&cityVal="+cityVal;
				if(srchParas!=""){
				 //  srchParas+=" > ";
		   }
		   //srchParas+=cityVal;
		  }

      	//show county
		var countyVal=$("#propertyCounty").attr("value");
		if(countyVal!=undefined){
		   para+="&propertyCounty="+countyVal;
		   if(srchParas!=""){
			   //srchParas+=" > ";
		   }
		  // srchParas+=countyVal;
	  }
		//show Zip Code
		var propertyZip=$("#propertyZip").attr("value");
		if(propertyZip!=undefined)
		{
		para+="&propertyZip="+propertyZip;
		}
		//beds crieteria
	   var beds=$("#beds").attr("value");
	   if(beds!=undefined){
		   para+="&beds="+beds;
			//prepare the search result string to display
		   if(srchParas!=""){
			  // srchParas+=" > ";
		}
		   //srchParas+=beds+" beds";
	   }

	   //baths crieteria
	   var baths=$("#baths").attr("value");
	   if(baths!=undefined){
		   para+="&baths="+baths;
		   var bths=$('#bathsBox option:selected').text()
		   //prepare the search result string to display
		   if(srchParas!=""){
			  // srchParas+=" > ";
		}
	   //srchParas+=bths+" baths";
	}

	//nrDate
	var nrDt=$("#nrDt").attr("value");
	if(nrDt!=undefined){
	   para+="&nrDt="+nrDt;
	}

	var alertType=$("#alertType").attr("value");
	if(alertType!=undefined){
	   para+="&alertType="+alertType;
	}

	// residential property type
	/*var total=Array();
	var j=0;
	var el = document.getElementsByName('propertyType_Res[]');
	if(el.length>0)
	{
	  for(var i=0; i < el.length; i++){
		if(el[i].checked){
			total[j]=""+el[i].value+"";
			j++;
		}
	  }
	   if(total.length>0)
	 {
	var propertyType_Res=total.join(",");
  	para+="&propertyType_Res="+propertyType_Res;
	}
	}

	// commercial property type
	var total=Array();
	var j=0;
	var el = document.getElementsByName('propertyType_Com[]');
	if(el.length>0)
	{
	  for(var i=0; i < el.length; i++){
		if(el[i].checked){
			total[j]=""+el[i].value+"";
			j++;
		}
	  }
	 if(total.length>0)
	 {
	var propertyType_Com=total.join(",");
  	para+="&propertyType_Com="+propertyType_Com;
	}
	}

	// notes property type
	var total=Array();
	var j=0;
	var el = document.getElementsByName('propertyType_Notes[]');
	if(el.length>0)
	{
	  for(var i=0; i < el.length; i++){
		if(el[i].checked){
			total[j]=""+el[i].value+"";
			j++;
		}
	  }
	   if(total.length>0)
	 {
	var propertyType_Notes=total.join(",");
  	para+="&propertyType_Notes="+propertyType_Notes;
	}
	} */

          var propertyType_Res=$("#globalMap_propertyType_Res").attr("value");
	   if(propertyType_Res!=undefined && propertyType_Res!=''){
		   para+="&propertyType_Res="+propertyType_Res;	  
		}	  
	
        
         var propertyType_Com=$("#globalMap_propertyType_Com").attr("value");
	   if(propertyType_Com!=undefined && propertyType_Com!=''){
		   para+="&propertyType_Com="+propertyType_Com;	  
		}	  
	
        
         var propertyType_Notes=$("#globalMap_propertyType_Notes").attr("value");
	   if(propertyType_Notes!=undefined && propertyType_Notes!=''){
		   para+="&propertyType_Notes="+propertyType_Notes;	  
		}	  
	
      

	 //Auction Type condition
	   var auctType=$("#auctType").attr("value");
	   if(auctType!=undefined){
		   para+="&auctType="+auctType;
		   var auctType=$('#auctType option:selected').text()
		   //prepare the search result string to display
		   if(srchParas!=""){
			 //  srchParas+=" > ";
		}
	  // srchParas+="Auction Type "+auctType;
	}



   //venueCode crieteria
   var venueCode=$("#venueCode").attr("value");
   if(venueCode!=undefined){
	   para+="&venueCode="+venueCode;
	   //prepare the search result string to display
	  if(srchParas!=""){
		   //srchParas+=" > ";
	   }
	   //srchParas+="Item# "+venueCode;
   }
   //propertyID crieteria
   var propertyID=$("#propertyID").attr("value");
   if(propertyID!=undefined){
	   para+="&propertyID="+propertyID;
	      //prepare the search result string to display
	   if(srchParas!=""){
		  // srchParas+=" > ";
	   }
	   //srchParas+="Property ID "+propertyID;
   }
	 var pageNum=$("#pageNum").attr("value");
   if(pageNum!=undefined){
	   para+="&page="+pageNum;
	   locate+="&page="+pageNum;
   }
   var pageGroup=$("#pageGroup").attr("value");
   if(pageGroup!=undefined){
	   para+="&pagegroup="+pageGroup;
	   locate+="&pagegroup="+pageGroup;
   }

   var getVenueId=$("#getVenueId").attr("value");
   if(getVenueId!=undefined){
	   para+="&getVenueId="+getVenueId;
   }

	//show records per page
   var recsPerPage=$("#recsPerPage").attr("value");
   if(recsPerPage!=undefined){
	   resetPageVars();
	   para+="&listPaging="+recsPerPage;
	   locate+="&listPaging="+recsPerPage;
   }

	//show property type(commercial)
	var propTypeComm=$("#propertyTypeC").attr("value");
	if(propTypeComm!=undefined){
	   para+="&propTypeCommVal="+propTypeComm;
		if(srchParas!=""){
		   //srchParas+=" > ";
	  }
	 // srchParas+=propTypeComm;
	 }

	 //show property region(commercial)
	var propRegionComm=$("#propertyRegionC").attr("value");
	if(propRegionComm!=undefined){
	   para+="&propRegionCommVal="+propRegionComm;
		if(srchParas!=""){
		   //srchParas+=" > ";
	  }
	  //srchParas+=propRegionComm;
	 }

	var sortBy=$("#sortByValue").attr("value");
	if(sortBy!=undefined)
	{
	   para+="&sortBy="+sortBy;
	}
	var sortByOrder=$("#sortByOrder").attr("value");
	if(sortByOrder!=undefined)
	{
	   para+="&sortByOrder="+sortByOrder;
	}


	var SeoTitleMeta=$("#SeoTitleMeta").attr("value");
	if(SeoTitleMeta!=undefined)
	{
	   para+="&SeoTitleMeta="+SeoTitleMeta;
	}

   if(srchParas!="")
   {
	 var srchStr=srchParas;
	 para+="&srchString="+srchStr;
	// $("#featheringStr").html("");
	// $("#featheringStr").html("<a href='<?php echo $_SITE_PATH;?>auction-calendar.php'><strong>Real Estate Auctions</strong></a> &gt;&nbsp;"+srchParas+"  Real Estate Auctions");
   }
   else
   {
	   //var srchStr="";
	   //para+="&srchString="+srchStr;
	   //$("#featheringStr").html("");
	   //$("#featheringStr").html("<a href='"+SITE_PATH+"'><strong>Auctions</strong></a>");
   }

	// added by mayank ***********
	var area=$("#area").val() ;

	if(area!=undefined)
	{
	    para+="&area="+area;
	}
	if(document.getElementById('minPrice'))
	{
		if(document.getElementById('minPrice').value!="")
		{
			var minPrice=document.getElementById('minPrice').value;
			minPrice=minPrice.replace(/\,/g,'');
		}
		else
		{
			var minPrice='';
		}
	}

	if(minPrice)
	{
		if(minPrice!=undefined){
			   para+="&minPrice="+minPrice;
		}
	}
	if(document.getElementById('maxPrice'))
	{
		if(document.getElementById('maxPrice').value!="")
		{
			var maxPrice=document.getElementById('maxPrice').value;
			maxPrice=maxPrice.replace(/\,/g,'');
		}
		else
		{
			var maxPrice='';
		}
	}
	if(maxPrice)
	{
		if(maxPrice!=undefined){
			   para+="&maxPrice="+maxPrice;
		}
	}

	var YearBuilt=$("#YearBuilt").val() ;
	if(YearBuilt!=undefined)
	{
	    para+="&YearBuilt="+YearBuilt;
	}
	// *** end here******
  //-----SEARCH CRITERIA ENDS---//

	$('#loddivcont').show();

   //$("#loddivcont").ajaxStart(function()
   //{
	  // $(this).show();
   //});

	if(pageID)
	{
		var pgArr=pageID.split("|");
		$("#pageNum").attr("value",pgArr[0]);
		$("#pageGroup").attr("value",pgArr[1]);
		//window.location.hash="page="+pgArr[0]+"&pagegroup="+pgArr[1];
		if(pgArr[0]!=undefined){
	   para+="&page="+pgArr[0];
	   locate+="&page="+pgArr[0];
	   }
	   if(pgArr[1]!=undefined){
		   para+="&pagegroup="+pgArr[1];
		   locate+="&pagegroup="+pgArr[1];
	   }
	}

	// show map result as a list code: added by mayank
	if(document.getElementById('globalMap_mapzipcodelist') && document.getElementById('globalMap_mapzipcodelist').value != "")
	 para+="&mapzipcodelist="+escape(document.getElementById('globalMap_mapzipcodelist').value);

	 if(document.getElementById('globalMap_southWest_lat') && document.getElementById('globalMap_southWest_lat').value != "")
	 para+="&southWest_lat="+document.getElementById('globalMap_southWest_lat').value;
	  if(document.getElementById('globalMap_southWest_lng') && document.getElementById('globalMap_southWest_lng').value != "")
	 para+="&southWest_lng="+document.getElementById('globalMap_southWest_lng').value;
	  if(document.getElementById('globalMap_northEast_lat') && document.getElementById('globalMap_northEast_lat').value != "")
	 para+="&northEast_lat="+document.getElementById('globalMap_northEast_lat').value;
	  if(document.getElementById('globalMap_northEast_lng') && document.getElementById('globalMap_northEast_lng').value != "")
	 para+="&northEast_lng="+document.getElementById('globalMap_northEast_lng').value+"&mapSearch="+true;
	 // end here
            
         var mapAuctionTypeCheckList=$("#mapAuctionTypeCheckList").attr("value");
       if(mapAuctionTypeCheckList!=undefined){
               para+="&mapAuctionTypeCheckList="+mapAuctionTypeCheckList;

       }
         var trusteeSale=$("#trusteeSale").attr("value");
       if(trusteeSale!=undefined){
               para+="&trusteeSale="+trusteeSale;
             
       }
       
           var mapSearchAuctionTypes=$("#mapSearchAuctionTypes").attr("value");
       if(mapSearchAuctionTypes!=undefined){
               para+="&mapSearchCheckBoxHeader="+mapSearchAuctionTypes;
            
       }
       
        var srchdist=$("#srchdist").attr("value");
       
	if(srchdist!=undefined)
	{
            para+="&srchdist="+srchdist;

	}
    $('#totalresult').remove();	

	document.getElementById("dvMainContainer").innerHTML ='<div align="center"><img src="'+SITE_PATH+'images/loading1.gif" style="padding:100px;"></div>' ;

	objHttpFileRequest=$.ajax({
		 type: "POST",
		 url: SITE_PATH+"ajax/global-search-ajax-allAssetType.php",
		 async: true,
		 global: true,
		 timeout: 30000,
		 data: para,
		 success: function(result){

		   if(result==0)
			  {
				showhideAlertdiv(); //--- email alert
				$('#dvMainContainer').hide();
			   if(document.getElementById('emailalert'))
			   document.getElementById('emailalert').innerHTML=result;
                         if(document.getElementById('noResultDiv'))
			   document.getElementById('noResultDiv').style.display='';
			    document.getElementById("searchCnt").innerHTML='0';
			  }
			  else
			  {
                                if(document.getElementById('noResultDiv'))
			            document.getElementById('noResultDiv').style.display='none';
					   $('#loddivcont').hide();
					   //$('#loddivcont').html('');
					    $('#alert').show();
				       $('#outer').show();
				       $('#emailalert').hide();
				       $('#emailalertsuccess').hide();
				       $('#emailalertsave').hide();
					   $('#dvMainContainer').show();
					   $('#dvMainContainer').html(result);
					   document.getElementById("searchCnt").innerHTML=document.getElementById("totalresult").value;
					   //document.getElementById('pageNum').value='1';

						$("a.pageLnk").click(function(){
					   $("a.pageLnk").each(function(){
					   $(this).removeClass();
					   $(this).addClass("page-off pageLnk");
					});
						$(this).removeClass();
						$(this).addClass("page-on");

						var pgID=$(this).attr("id");
						//alert(pgID);
						var pgArr=pgID.split("|");

						$("#pageNum").attr("value",pgArr[0]);
						$("#pageGroup").attr("value",pgArr[1]);
						var auctionID=$("#auctionID").attr("value");
						document.getElementById('pageNum').value=pgArr[0];
						//window.location.hash="page="+pgArr[0]+"&pagegroup="+pgArr[1];
						//update_contents(pgID);
					});
				   return false;
			  }
		 },
		 error: function(request, settings, execp)
		 {
			 $('#dvMainContainer').empty();
                          var ff = "update_contents('"+pageID_b+"');";
                         var te = "<br><b>Request time out, <a href='javascript:void(0);' onclick=\""+ff+"\" >click here</a> to please try again.</b>";
                          $('#dvMainContainer').html(te);
			// $('#dvMainContainer').html("<br><b>An error occurred, please try again.</b>");
			// window.location = "auction-details.php?auctionID=<?php echo $_REQUEST['auctionID']?>";
		 }
	});
   }



	function presaleShutOff(e,auctionNum,presaleStartDate,preSaleEndDate){
	document.getElementById("shutOffMsg").style.display="";
	var viewType=document.getElementById("viewType").value;
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
	var is_minor = parseFloat(navigator.appVersion);
	var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
	 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
	 && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	 var is_nav4 = (is_nav && (is_major == 4));
	 var is_nav6 = (is_nav && (is_major == 5));
	 var is_nav6up = (is_nav && (is_major >= 5));

	 var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	if(!is_ie)
	{
		 x=mouseX(e);
		 y=mouseY(e);
		 if(viewType!=2){
			document.getElementById("shutOffMsg").style.left = x - 400 +'px';
			document.getElementById("shutOffMsg").style.top = y  +'px';
		 }
		 else
		{
			 document.getElementById("shutOffMsg").style.left = x + 20 +'px';
			 document.getElementById("shutOffMsg").style.top = y  +'px';
		}
	}
	else
	{
		 x=mouseX(e);
		 y=mouseY(e);
		 if(viewType!=2)
		 {
			document.getElementById("shutOffMsg").style.left = x - 400 +'px';
			 document.getElementById("shutOffMsg").style.top = y  +'px';
		 }
		 else
		 {
			document.getElementById("shutOffMsg").style.left = x + 20 +'px';
			 document.getElementById("shutOffMsg").style.top = y  +'px';
		 }
	}
	var lnk='<a href="'+SITE_PATH_SSL+'EventRegistration/event-registration/confirm-account/auctionNumber/'+auctionNum+'">Auction Registration</a>';

	//document.getElementById('preSaleStartDate').innerHTML="Pre-Auction Start Date: "+presaleStartDate;
	//document.getElementById('preSaleEndDate').innerHTML="Pre-Auction End Date: "+preSaleEndDate;
	document.getElementById('preSaleEndDate').innerHTML=preSaleEndDate;
	document.getElementById('auctionRegistration').innerHTML=lnk;

   }

/******************* DONT DELETE THESE FUNCTIONS RELATED TO PRESALE (SWETA)*************************/


function closePresaleMsgBox()
{
	document.getElementById('shutOffMsg').style.display="none";
}




