function excelDownload(path,lastViewed)
	{
	location.href=path;
	}
var request_complete_instant=0;
function validateLoginForm(myform)
	{
		
	var MasterString="Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	var flag=false;
	var visitor="";
	if (!IsEmailAddress(myform.email.value,'')) 
		{   
		visitor +=  "\n- Please enter valid email address.";
		document.getElementById('c_01').style.backgroundColor='#F9F3C1';
		}
	else
		{
		document.getElementById('c_01').style.backgroundColor='';
		}
	if(myform.password.value=="")
		{   visitor +=  "\n- Please enter password."; 
		document.getElementById('c_012').style.backgroundColor='#F9F3C1';
		}
	else
		{
		document.getElementById('c_012').style.backgroundColor='';
		}
	
	if(visitor!="")
		{
		MasterString=MasterString + visitor;
		flag=true;
		}
	if(flag==true)
		{
		alert(MasterString);
		return false;
		}
	return true;
	}
function showPopUp(auctionNumber)
	{
	newwin=window.open ("user_registration_status.php?auctionNumber="+auctionNumber,"mywindow","status=1,scrollbars=yes,toolbar=0,width=900,height=600,left=10,top=10"); 
	newwin.focus();
	}


function formatCurrency(num) 
	{
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	signt = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((signt)?'':'-') + '$' + num + '.' + cents);
	}
function formatCurrencyWithoutDecimal(num) 
	{
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	signt = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((signt)?'':'-') + '$' + num);
	}
function moneyFormat(money,propertyId)
	{
	var dollarVal=formatCurrency(money);
	document.getElementById('amount_win_div_'+propertyId).innerHTML=dollarVal;
	}
var total_counter = 0;
function LTrim( value ) 
	{
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	}
  // Removes ending whitespaces
function RTrim( value ) 
	{
	var re = /((\s*\S+)*)\s*/;
  	return value.replace(re, "$1");
	}
  
  // Removes leading and ending whitespaces
  function trim( value ) {
  	
  	return LTrim(RTrim(value));
  	
  }
var bid_box_id_bid='';
var type='inc';
function bidLoginCheck(userid_bid,propertyId_bid,auctionNumber_bid,counter_bid,targetDate_bid,startDate_bid,auto_bid_alert_login,address)
	{
	if(timeOutRequestCalls)
		return false;
	document.getElementById("hiddenMessageBox").innerHTML='';
	document.getElementById('bid_div_msg_show_extra').innerHTML="";
	document.getElementById('bid_div_msg_show_extra').style.display="none";
	
	for(var i=1;i<=total_counter;i++)
		{
		var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
		if(propertyId[i] && proxy_normal_bid=='normal')
			{
			
			var div_inner_html=document.getElementById("bid_history_div_"+propertyId[i]).innerHTML;
			if(div_inner_html!='')
				{
				div_inner_html=document.getElementById("bid_history_div_"+propertyId[i]).innerHTML='';
				}
			}
		}
	proxy_normal_bid=document.getElementById("proxy_normal_bid"+counter_bid).value;
	addressGlobal=address;
	if(auto_bid_alert_login)
		auto_bid_alert_login_global=auto_bid_alert_login;
	else
		auto_bid_alert_login_global=0;
if(propertyId[counter_bid])
	{
	if(targetDate[counter_bid]!=targetDate_bid)
		targetDate_bid=targetDate[counter_bid];
	}

	var back_u=document.getElementById('back_u').value;	
	bid_box_id_bid=propertyId_bid;
	if(userid_bid=='')
		{
		var bid_amt_bid=document.getElementById('bid_amt_'+bid_box_id_bid).value;
		
		var array_bid_amt=bid_amt_bid.split("$");
		if(array_bid_amt.length>2 || (array_bid_amt[0]!='' && array_bid_amt.length>=2))
			{
			document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please input a proper bid amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
			tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");

			return false;
			}
		
		bid_amt_bid=bid_amt_bid.replace("$", "");
		bid_amt_bid=bid_amt_bid.replace(/,/g, "");
		arr_bid=bid_amt_bid.split('.');
		bid_amt_bid=arr_bid[0];
		if(isNaN(bid_amt_bid))
			{
			document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please input a proxy bid amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
			tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");

			return false;
			}
/*
		document.getElementById("propertyId_bid_back").value=propertyId_bid;
		document.getElementById("bid_amt_bid_back").value=bid_amt_bid;
		document.getElementById("auctionNumber_bid_back").value=auctionNumber_bid;
		document.getElementById("counter_bid_back").value=counter_bid;
		document.getElementById("targetDate_bid_back").value=targetDate_bid;
		document.getElementById("startDate_bid_back").value=startDate_bid;
		document.getElementById("auto_bid_address").value=address;
		document.getElementById("auto_bid_alert_login").value=1;
		document.getElementById('signupFormMainDiv').style.display='block';
		tb_show("", "#TB_inline?height=80&height=280&width=600&inlineId=hiddenSearchBox", "");
		*/
		  var	urlLogin=document.getElementById("urlLogin").value ;
		 tb_show("",SITE_PATH_SSL+"loginBoxCommon.inc.php?auctionID="+document.getElementById("auctionID").value+"&propertyId_bid_back="+propertyId_bid+"&bid_amt_bid_back="+bid_amt_bid+"&auctionNumber_bid_back="+auctionNumber_bid+"&counter_bid_back="+counter_bid+"&targetDate_bid_back="+targetDate_bid+"&startDate_bid_back="+startDate_bid+"&auto_bid_address="+escape(address)+"&Url="+escape(urlLogin)+thickboxLogin, ""); 
  
		
		
		
		
		
		}
	else
		{
		var proxy_normal_bid=document.getElementById("proxy_normal_bid"+counter_bid).value;
	
		if(proxy_normal_bid=='normal')
			{
			if(document.getElementById("remain"+counter_bid).innerHTML=='Bidding Time Over' || document.getElementById("remain"+counter_bid).innerHTML=='SOLD!!!' || document.getElementById("remain"+counter_bid).innerHTML=='FINALIZING...')
				{
				document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Bidding Time Over</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
				tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");
				}
			else if(document.getElementById("remain"+counter_bid).innerHTML=='Bidding Not Started')
				{
				document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Bidding Time Over</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
				tb_show("", "#TB_inline?height=85&height=85&width=500&inlineId=hiddenMessageBox", "");
				}
			else
				bidAjax_bid(propertyId_bid,auctionNumber_bid,counter_bid,targetDate_bid,startDate_bid);
			}
		else
			{
			bidAjax_bid(propertyId_bid,auctionNumber_bid,counter_bid,targetDate_bid,startDate_bid);
			}
		}
	}
	var proxy_normal_bid_bidding='';
function waitForSomeTime(proxy_normal_bid_bidding,counter_bid,total_his_bid_till_now,auctionSellerReservevar,startDate_bid,targetDate_bid,propertyId_bid,bid_amt_bid,auctionNumber_bid,proxy_normal_bid_bidding)
{
document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Are you sure you want to bid '+formatCurrency(bid_amt_bid)+' on '+addressGlobal+'</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-orange"><b><a style="cursor:pointer;" onclick="bidFurtherSteps(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\');">Confirm Bid</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
tb_show("", "#TB_inline?height=85&height=85&width=500&inlineId=hiddenMessageBox", "");

}
function waitForSomeTimeProxy(proxy_normal_bid_bidding,counter_bid,total_his_bid_till_now,auctionSellerReservevar,startDate_bid,targetDate_bid,propertyId_bid,bid_amt_bid,auctionNumber_bid,proxy_normal_bid_bidding)
{
document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Are you sure you want to proxy bid '+formatCurrency(bid_amt_bid)+' on '+addressGlobal+'</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-orange"><b><a style="cursor:pointer;" onclick="callNextFunctionAfterWaiting(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\');">Confirm Bid</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
tb_show("", "#TB_inline?height=85&height=85&width=500&inlineId=hiddenMessageBox", "");
}
function callNextFunctionAfterWaiting(proxy_normal_bid_bidding,counter_bid,total_his_bid_till_now,auctionSellerReservevar,startDate_bid,targetDate_bid,propertyId_bid,bid_amt_bid,auctionNumber_bid,proxy_normal_bid_bidding)
{

tb_remove();
setTimeout('bidFurtherSteps(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\')',100);
}
function bidAjax_bid(propertyId_bid,auctionNumber_bid,counter_bid,targetDate_bid,startDate_bid)
	{

	var total_his_bid_till_now=document.getElementById("total_his_bid_till_now").value;
	
	proxy_normal_bid_bidding=document.getElementById("proxy_normal_bid"+counter_bid).value;
	var auctionSellerReservevar=auctionSellerReserve[counter_bid];
	
	
	var bid_amt_bid=document.getElementById('bid_amt_'+bid_box_id_bid).value;
	var array_bid_amt=bid_amt_bid.split("$");

	if(array_bid_amt.length>2 || (array_bid_amt[0]!='' && array_bid_amt.length>=2))
		{
		document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please input a proper bid amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
		tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");
		return false;
		}
	
	bid_amt_bid=bid_amt_bid.replace("$", "");
	bid_amt_bid=bid_amt_bid.replace(/,/g, "");
	arr_bid=bid_amt_bid.split('.');

	bid_amt_bid=arr_bid[0];
	
	if(bid_amt_bid=='')
		{
		document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please fill Bidding Amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
		tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");
		return false;
		}
	else if(isNaN(bid_amt_bid))
		{
		document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please input a proxy bid amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
		tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");
		return false;
		}
	else if(trim(bid_amt_bid)=='')
		{
		document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Please fill Bidding Amount</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Ok</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
		tb_show("", "#TB_inline?height=85&height=85&width=490&inlineId=hiddenMessageBox", "");
		return false;
		}

	if(lineConfirmation[counter_bid] || auto_bid_alert_login_global)
		{
		if(proxy_normal_bid_bidding=='normal')
			{
			if(auto_bid_alert_login_global)
				{
				setTimeout('waitForSomeTime(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\')',500);
				}
			else
				{
				document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Are you sure you want to bid '+formatCurrency(bid_amt_bid)+' on '+addressGlobal+'</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-orange"><b><a style="cursor:pointer;" onclick="bidFurtherSteps(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\');">Confirm Bid</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
				tb_show("", "#TB_inline?height=85&height=85&width=500&inlineId=hiddenMessageBox", "");
				}
			}
		else
			{
			if(auto_bid_alert_login_global)
				{
				setTimeout('waitForSomeTimeProxy(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\')',500);
				}
			else
				{
				document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="blu12">Are you sure you want to proxy bid '+formatCurrency(bid_amt_bid)+' on '+addressGlobal+'</td></tr><tr><td align="center"><table width="30%"><tr><td align="center"><div class="tab-orange"><b><a style="cursor:pointer;" onclick="callNextFunctionAfterWaiting(\''+proxy_normal_bid_bidding+'\',\''+counter_bid+'\',\''+total_his_bid_till_now+'\',\''+auctionSellerReservevar+'\',\''+startDate_bid+'\',\''+targetDate_bid+'\',\''+propertyId_bid+'\',\''+bid_amt_bid+'\',\''+auctionNumber_bid+'\',\''+proxy_normal_bid_bidding+'\');">Confirm Bid</a></b></div></td><td><div class="tab-blue"><b><a style="cursor:pointer;" onclick="tb_remove();">Cancel</a></b></div></td></tr></table></td></tr></table>';
				tb_show("", "#TB_inline?height=85&height=85&width=500&inlineId=hiddenMessageBox", "");
				}
			}
		}
	else
		{
		bidFurtherSteps(proxy_normal_bid_bidding,counter_bid,total_his_bid_till_now,auctionSellerReservevar,startDate_bid,targetDate_bid,propertyId_bid,bid_amt_bid,auctionNumber_bid,proxy_normal_bid_bidding);
		}
	
	}
function bidFurtherSteps(proxy_normal_bid_bidding,counter_bid,total_his_bid_till_now,auctionSellerReservevar,startDate_bid,targetDate_bid,propertyId_bid,bid_amt_bid,auctionNumber_bid,proxy_normal_bid_bidding)
{	
	tb_remove();
	document.getElementById("hiddenMessageBox").innerHTML='';
	

	var rand = Math.random();
	if(proxy_normal_bid_bidding=='normal')
		{
		if(document.getElementById("remain"+counter_bid).innerHTML=='Bidding Time Over' || document.getElementById("remain"+counter_bid).innerHTML=='SOLD!!!' || document.getElementById("remain"+counter_bid).innerHTML=='FINALIZING...')
			return false;
		}
		
	var url="ajaxOnlineFileDemo.php?"+"rand="+rand+"&total_his_bid_till_now="+total_his_bid_till_now+"&auctionSellerReservevar="+auctionSellerReservevar+"&startDate="+startDate_bid+"&targetDate="+targetDate_bid+"&counter="+counter_bid+"&propertyId="+propertyId_bid+"&proxy_normal_bid="+escape(proxy_normal_bid_bidding)+"&auctionNumber="+escape(auctionNumber_bid)+"&bid_amt="+escape(bid_amt_bid)+"&action_state=edit_form&task=bidding_box_ajax";
	
	xmlHttp=getobject_common();
	xmlHttp.onreadystatechange=AddNewCapAmountFormFunction;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function AddNewCapAmountFormFunction()
	{
	
	if(xmlHttp.readyState==4 ||  xmlHttp.readyState=="complete")
		{	
		if(proxy_normal_bid_bidding=='normal')
			{
			$arr=xmlHttp.responseText.split("___");
			if($arr[0]!='')
				{
				timeOutRequestCalls=1;
				setTimeout('showMessageTbRemove(\''+$arr[0]+'\')',1000);
				}
			else
				{
				if(totalSecWaitForAutoLoadBid>=1 && !request_complete)
					{
					totalSecWaitForAutoLoadBid=0;
					}
				}
			}
		else
			{
			
			$arr=xmlHttp.responseText.split("____");
			if(!$arr[1])
				{
				document.getElementById("hiddenMessageBox").innerHTML=$arr[0];
				tb_show("", "#TB_inline?height=140&height=140&width=450&inlineId=hiddenMessageBox", "");
				}
			else
				{
				$arr_bid_details=$arr[1].split("~~~");
				
				$arr_bid_details_more=$arr_bid_details[1].split("~~");
				if(document.getElementById("myBidDetailsDiv")){
				  document.getElementById("myBidDetailsDiv").innerHTML=$arr_bid_details_more[0];
        }
				document.getElementById("total_his_bid_till_now").value=$arr_bid_details_more[1];
				
				document.getElementById("myBidLowerDetailsDiv").innerHTML=$arr_bid_details[0];
				document.getElementById("hiddenMessageBox").innerHTML=$arr[0];
				tb_show("", "#TB_inline?height=140&height=140&width=450&inlineId=hiddenMessageBox", "");
				}
			}
		}
	}
var timeOutRequestCalls=0;
function showMessageTbRemove(mess)
	{
	if(mess.length>100)
		{
		document.getElementById("hiddenMessageBox").innerHTML=mess;
		tb_show("", "#TB_inline?height=140&height=140&width=450&inlineId=hiddenMessageBox", "");
		}
	else
		{
		document.getElementById("hiddenMessageBox").innerHTML=$arr[0];
		tb_show("", "#TB_inline?height=140&height=140&width=450&inlineId=hiddenMessageBox", "");
		}
	timeOutRequestCalls=0;
	}
function setVariables(counter1)
{
seconds[counter1]+=addSeconds[counter1];
targetDate[counter1]+=addSeconds[counter1]
}

function getobject_common()
	{
	var xmlHttp;
	try
  		{
	  	// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  		}
	catch (e)
  		{
		// Internet Explorer
  		try
    		{
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  		catch (e)
    		{
    		try
      			{
      			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      			}
    		catch (e)
      			{
      			alert("Your browser does not support AJAX!");
      			return false;
      			}
    		}
  		}
  	return xmlHttp;
	}


function getobject_common3()
	{
	var xmlHttp;
	try
  		{
	  	// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  		}
	catch (e)
  		{
		// Internet Explorer
  		try
    		{
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  		catch (e)
    		{
    		try
      			{
      			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      			}
    		catch (e)
      			{
      			alert("Your browser does not support AJAX!");
      			return false;
      			}
    		}
  		}
  	return xmlHttp;
	}


function getobject_common1()
	{
	var xmlHttp5;
	try
  		{
	  	// Firefox, Opera 8.0+, Safari
  		xmlHttp5=new XMLHttpRequest();
  		}
	catch (e)
  		{
		// Internet Explorer
  		try
    		{
    		xmlHttp5=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  		catch (e)
    		{
    		try
      			{
      			xmlHttp5=new ActiveXObject("Microsoft.XMLHTTP");
      			}
    		catch (e)
      			{
      			alert("Your browser does not support AJAX!");
      			return false;
      			}
    		}
  		}
  	return xmlHttp5;
	}
function getobject_common2()
	{
	var xmlHttp2;
	try
  		{
	  	// Firefox, Opera 8.0+, Safari
  		xmlHttp2=new XMLHttpRequest();
  		}
	catch (e)
  		{
		// Internet Explorer
  		try
    		{
    		xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  		catch (e)
    		{
    		try
      			{
      			xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");
      			}
    		catch (e)
      			{
      			alert("Your browser does not support AJAX!");
      			return false;
      			}
    		}
  		}
  	return xmlHttp2;
	}


var setCountDown = new Array();
var secondsDiff = new Array();
var remsec = new Array();
var remmin = new Array();
var auctionSellerReserve = new Array();
var lineConfirmation = new Array();
var startBlinking=0;
var addSeconds=new Array();
var secondsDiff=new Array();
var targetDate=new Array();
var propertyId=new Array();
var auctionNumber=new Array();
var total_bids=new Array();
var bid_auto_box_id=new Array();
var bid_auto_box_id_extra=new Array();
var bidAjaxAutoFunction=new Array();
var time_gap_green=new Array();
var xmlHttp_array=new Array();

var counter_ajax_new_more=new Array();
var previous_counter='';
var isChanged=false;


var ccccc='';
var ddddd=1;
var counter_total='';
var waitVar=true;


//--------Start for flashing functions-----------
var allPropIndexFlash=new Array();
var functioncalled=0;
function flashingNew() 
	{
	for(var i=0;i<allPropIndexFlash.length;i++)
		{
		if(allPropIndexFlash[i])
			{
			document.getElementById("remain_td"+allPropIndexFlash[i]).style.background = "#00CC99";
			if(document.getElementById("remain"+allPropIndexFlash[i]).innerHTML=='SOLD!!!' || document.getElementById("remain"+allPropIndexFlash[i]).innerHTML=='FINALIZING...')
				{
				document.getElementById("remain_td"+allPropIndexFlash[i]).style.background = "#000000";
				//allPropIndexFlash[i]='';
				}
			}
		}
	if(i>0)
		setTimeout("flashingNewSecond()",500);
	}
function flashingNewSecond() 
	{
	for(var i=0;i<allPropIndexFlash.length;i++)
		{
		document.getElementById("remain_td"+allPropIndexFlash[i]).style.background = "#000000";
		}
	if(i>0)
		setTimeout("flashingNew()",500);
	}
//--------End for flashing functions-----------
var request_complete_timer=0;
function bid_auto_box_load_timer()
	{
	totalSecWaitAllProperty=0;
	if(request_complete_timer)
		{
		return false;
		}
	request_complete_timer=1;
	var rand = Math.random();
	var str_to_send="rand="+rand;
	var propertypage=document.getElementById("propertypage").value;
	for(var i=1;i<=total_counter;i++)
		{
		if(document.getElementById("proxy_normal_bid"+i))
			var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
		else
			var proxy_normal_bid='';
		
		if(propertyId[i])
			{
			if(proxy_normal_bid=='normal' || propertypage=='propertypage')
				{
				str_to_send+="&propertyId"+i+"="+propertyId[i];
				str_to_send+="&auctionNumber"+i+"="+auctionNumber[i];
				}
			}
		}
		
	
	str_to_send+="&propertypage="+propertypage;
	str_to_send+="&total_counter="+total_counter;
	str_to_send+="&action_state=property_auto_load";
	str_to_send+="&task=bidding_box_ajax_timer";
	
	var url="ajaxOnlineFileDemo.php";
	xmlHttp555=getobject_common1();
	xmlHttp555.onreadystatechange=bid_auto_box_load_timer_function;
	xmlHttp555.open("POST",url,true);
	xmlHttp555.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp555.send(str_to_send);
	}


var autoReloadVar=0;
var linkDisabled = new Array();
function reloadPage()
{
history.go(0);
}
function bid_auto_box_load_timer_function()
	{
	if(xmlHttp555.readyState==4 ||  xmlHttp555.readyState=="complete")
		{
		if(xmlHttp555.responseText!='')
			{
			$arr_auto=xmlHttp555.responseText.split("___");

			indexFlash=0;//For flashing new function
			
			for(var i=1;i<=total_counter;i++)
				{
				if(document.getElementById("proxy_normal_bid"+i))
					var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
				else
					var proxy_normal_bid='';
				
				var propertypage=document.getElementById("propertypage").value;
				if(propertypage=='propertypage')
					{
					$arr_auto_msg=$arr_auto[(total_counter+1)].split("!!");
					
					if($arr_auto_msg['1']=='1')
						{
						autoReloadVar=1;
						}
					if(autoReloadVar && ($arr_auto_msg['1']=='0'))
						{
						autoReloadVar=0;
						setTimeout("reloadPage()",1000);
						
						return false;
						}
					document.getElementById('auction_timer_type_id').innerHTML=$arr_auto_msg['0'];	
					}
				if(proxy_normal_bid=='normal' || propertypage=='propertypage'){
				if($arr_auto[total_counter]=='nothing_happened')
					{
					
					if(i==1)
						{
						allPropIndexFlash=new Array();//For flashing new function
						}
					$arr_auto_blink=$arr_auto[i-1].split("__");
					
					if($arr_auto_blink[1]=='yes')
						{
						secondsDiff[i]=0;
						allPropIndexFlash[indexFlash]=i;//For flashing new function
						indexFlash++;//For flashing new function
						}
					else
						{
						if($arr_auto_blink[1]!='no')
							secondsDiff[i]=$arr_auto_blink[1];
						}
					if(i==total_counter && indexFlash==0)//For flashing new function
						{//For flashing new function
						functioncalled=1;//For flashing new function
						}//For flashing new function

					if(i==total_counter && (indexFlash>indexFlashPrev || indexFlash<indexFlashPrev))//For flashing new function
						{//For flashing new function
						functioncalled=0;//For flashing new function
						}//For flashing new function
					if(i==total_counter && !functioncalled)//For flashing new function
						{//For flashing new function
						for(var j=1;j<=total_counter;j++)
							{
							document.getElementById("remain_td"+j).style.background = "#000000";
							}
						indexFlashPrev=indexFlash;//For flashing new function
						flashingNew();//For flashing new function
						functioncalled=1;//For flashing new function
						}//For flashing new function

					$arr_auto_blink_time=$arr_auto_blink[0].split("~~~");
					
					document.getElementById("tmrDaysAll"+i).value=$arr_auto_blink_time[0];
					document.getElementById("tmrHrsAll"+i).value=$arr_auto_blink_time[1];
					document.getElementById("tmrMinsAll"+i).value=$arr_auto_blink_time[2];
					document.getElementById("tmrSecsAll"+i).value=$arr_auto_blink_time[3];
					if($arr_auto_blink_time[0]>0)
						{
						
						document.getElementById("remain"+i).innerHTML=$arr_auto_blink_time[0]+" Days "+$arr_auto_blink_time[1] +" Hours Left";
						}

					else if($arr_auto_blink_time[1]>0)
						{
						
						document.getElementById("remain"+i).innerHTML=$arr_auto_blink_time[1]+" Hours "+$arr_auto_blink_time[2] +" Min";
						}
					
					else if($arr_auto_blink_time[2]>0)
						document.getElementById("remain"+i).innerHTML=$arr_auto_blink_time[2]+" Min "+$arr_auto_blink_time[3] +" sec";

					else if($arr_auto_blink_time[3]>0)
						{
						if($arr_auto_blink_time[3]>12)
							document.getElementById("remain"+i).innerHTML=$arr_auto_blink_time[3]+" sec ";
						else if($arr_auto_blink_time[3]>6)
							document.getElementById("remain"+i).innerHTML="GOING ONCE - "+$arr_auto_blink_time[3]+" sec ";
						else if($arr_auto_blink_time[3]>0)
							document.getElementById("remain"+i).innerHTML="GOING TWICE - "+$arr_auto_blink_time[3]+" sec ";
						}
					else
						{
						if(closingTimeRemaining[i]=='3')
							document.getElementById("remain"+i).innerHTML=$arr_auto_blink[0];
						else
							document.getElementById("remain"+i).innerHTML='FINALIZING...';
						}


					if(($arr_auto_blink[0]=='SOLD!!!' || $arr_auto_blink[0]=='FINALIZING...') && !linkDisabled[i])
						{
						linkDisabled[i]=1;
						document.getElementById("button_bid_now_div"+i).innerHTML=document.getElementById("button_bid_now_div_hidden_disable"+i).innerHTML;
						}
					else if(linkDisabled[i] && $arr_auto_blink[0]!='SOLD!!!' && $arr_auto_blink[0]!='FINALIZING...')
						{
						linkDisabled[i]=0;
						document.getElementById("button_bid_now_div"+i).innerHTML=document.getElementById("button_bid_now_div_hidden"+i).innerHTML;
						}
					
					}
					
				}
				}
		    totalSecWaitAllProperty=28;
			request_start_timer_javascript=0;
			request_complete_timer=0;
			timerFunctionAllProperty();
			}
		}		
		
	}
var totalSecWaitAllProperty=28;
var closingTimeRemaining = new Array();

function timerFunctionAllProperty()
{

if(!totalSecWaitAllProperty)
	{
	bid_auto_box_load_timer();
	return false;
	}
totalSecWaitAllProperty=totalSecWaitAllProperty-1;

var propertypage=document.getElementById("propertypage").value;
for(var i=1;i<=total_counter;i++)
	{
	if(document.getElementById("proxy_normal_bid"+i))
		var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
	else
		var proxy_normal_bid='';
		
	if(proxy_normal_bid=='normal'  || propertypage=='propertypage')
		{
		if(document.getElementById("remain"+i).innerHTML=='SOLD!!!')
			continue;
		if(document.getElementById("remain"+i).innerHTML=='FINALIZING...')
			{
			if(closingTimeRemaining[i]=='3')
				{
				totalSecWaitAllProperty=0;
				//document.getElementById("remain"+i).innerHTML='SOLD!!!';
				continue;
				}
			else
				{
				closingTimeRemaining[i]=closingTimeRemaining[i]+1;
				continue;
				}
			}
		else
			{
			closingTimeRemaining[i]=0;
			}
		var days=document.getElementById("tmrDaysAll"+i).value;
		var hrs=document.getElementById("tmrHrsAll"+i).value;
		var mins=document.getElementById("tmrMinsAll"+i).value;
		var secs=document.getElementById("tmrSecsAll"+i).value;
		secs=secs-1;
		if(secs<0)
			{
			if(mins>0)
				{
				mins=mins-1;
				secs=59;
				}
			}
		if(mins<0)
			{
			if(hrs>0)
				{
				hrs=hrs-1;
				mins=59;
				}
			}
		if(hrs<0)
			{
			if(days>0)
				{
				days=days-1;
				hrs=24;
				}
			}
		if(secs<=9)
			secs="0"+secs;

		if(days>0)
			document.getElementById("remain"+i).innerHTML=days+" Days "+hrs +" Hours Left";

		else if(hrs>0)
			document.getElementById("remain"+i).innerHTML=hrs+" Hours "+mins +" Min";

		else if(mins>0)
			document.getElementById("remain"+i).innerHTML=mins+" Min "+secs +" sec";

		else if(secs>0)
			{
			if(secs>12)
				document.getElementById("remain"+i).innerHTML=secs+" sec ";
			else if(secs>6)
				{
				document.getElementById("remain"+i).innerHTML="GOING ONCE - "+secs+" sec ";
				if(secs==7)
					totalSecWaitAllProperty=1;
				}
			else if(secs>0)
				{
				document.getElementById("remain"+i).innerHTML="GOING TWICE - "+secs+" sec ";
				
				}
		
			}
		else
			{
			if(autoReloadVar)
				{
				autoReloadVar=0;
				setTimeout("reloadPage()",2000);
				return false;
				}
			if(closingTimeRemaining[i]=='3')
				document.getElementById("remain"+i).innerHTML='SOLD!!!';
			else
				document.getElementById("remain"+i).innerHTML='FINALIZING...';
			
			}

		document.getElementById("tmrDaysAll"+i).value=days;
		document.getElementById("tmrHrsAll"+i).value=hrs;
		document.getElementById("tmrMinsAll"+i).value=mins;
		document.getElementById("tmrSecsAll"+i).value=secs;

		if(secondsDiff[i])
			{
			
			secondsDiff[i]=secondsDiff[i]-1;
			if(secondsDiff[i]==(startBlinking+1))
				{
				if(totalSecWaitAllProperty>1)
					totalSecWaitAllProperty=1;
				}

			}
		}
	}

setTimeout("timerFunctionAllProperty()",1000);

}
function changeRequest()
{
	if(request_start_timer_javascript)
		{
		request_start_timer_javascript=0;
		timerFunctionAllProperty();
		}
}

function waitCallAutoLoadBid()
{
if(!totalSecWaitForAutoLoadBid)
	{
	auto_load_bid_ajax();
	return false;
	}
totalSecWaitForAutoLoadBid=totalSecWaitForAutoLoadBid-1;
setTimeout("waitCallAutoLoadBid()",1000);
}

var request_complete=0;
var totalSecWaitForAutoLoadBid=4;
function auto_load_bid_ajax()
	{
	if(request_complete)
		{
		return false;
		}
	request_complete=1;
	var rand = Math.random();
	var str_to_send="rand="+rand;
	
	for(var i=1;i<=total_counter;i++)
		{
		if(document.getElementById("proxy_normal_bid"+i))
			var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
		else
			var proxy_normal_bid='';
		
		if(propertyId[i])
			{
			if(proxy_normal_bid=='normal')
				{
				str_to_send+="&auctionSellerReservevar"+i+"="+auctionSellerReserve[i];
				str_to_send+="&targetDate"+i+"="+targetDate[i];
				str_to_send+="&propertyId"+i+"="+propertyId[i];
				str_to_send+="&auctionNumber"+i+"="+auctionNumber[i];
				str_to_send+="&total_bids"+i+"="+total_bids[i];
				}
			}
		}
	var totalBidsAuction=document.getElementById("totalBidsAuction").value;
	var propertypage=document.getElementById("propertypage").value;
	str_to_send+="&total_counter="+total_counter;
	str_to_send+="&propertypage="+propertypage;
	str_to_send+="&totalBidsAuction="+totalBidsAuction;
	str_to_send+="&action_state=property_auto_load";
	str_to_send+="&task=bid_auto_load";
	
	var url="ajaxOnlineFileDemo.php";
	
	xmlHttp5=getobject_common1();
	xmlHttp5.onreadystatechange=bidAjaxAutoFunctionNew1;
	xmlHttp5.open("POST",url,true);
	xmlHttp5.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp5.send(str_to_send);
	}
var wait_var='';
var indexFlash=0;//For flashing new function
var indexFlashPrev=0;//For flashing new function




function bidAjaxAutoFunctionNew1()
	{
	if(xmlHttp5.readyState==4 ||  xmlHttp5.readyState=="complete")
		{
		if(xmlHttp5.responseText!='')
			{
			

			if(xmlHttp5.responseText=='nothing_happened')
				{
				request_complete=0;
				totalSecWaitForAutoLoadBid=4;
				waitCallAutoLoadBid();
				return false;
				}
			
			$arr_first=xmlHttp5.responseText.split("@@@");
			if($arr_first[1])
				{
				document.getElementById("totalBidsAuction").value=$arr_first[1];
				request_complete=0;
				totalSecWaitForAutoLoadBid=4;
				waitCallAutoLoadBid();
				return false;
				}
			var indexvar=0;

			$arr_first=xmlHttp5.responseText.split("_~_~_~_~");
			$arr_auto=$arr_first[indexvar].split("___");
			indexFlash=0;//For flashing new function
			for(var i=1;i<=total_counter;i++)
				{
				
				if($arr_auto[0]==i)
					{
					indexvar=indexvar+1;
					$arr_first=xmlHttp5.responseText.split("_~_~_~_~");
					if(document.getElementById("proxy_normal_bid"+i))
						var proxy_normal_bid=document.getElementById("proxy_normal_bid"+i).value;
					else
						var proxy_normal_bid='';
					if(proxy_normal_bid=='normal')
						{
					
						var counterfunction=$arr_auto[0];
						document.getElementById("totalBidsAuction").value=$arr_auto[8];
						
						if($arr_auto[2])
							{
							if($arr_auto[3])
								{
								$arr_bid_details=$arr_auto[7].split("~~~");
								if($arr_bid_details[0])
									{
                  if(document.getElementById("myBidDetailsDiv")){
								    document.getElementById("myBidDetailsDiv").innerHTML=$arr_bid_details[1];
                  }
                  if(document.getElementById("myBidLowerDetailsDiv")){
								      document.getElementById("myBidLowerDetailsDiv").innerHTML=$arr_bid_details[0];
                  }
									}
								document.getElementById("total_his_bid_till_now").value=$arr_auto[5];
								document.getElementById("td3_"+counterfunction).style.background='#00CC99';
								setTimeout("changeColor("+counterfunction+")",1000);

								totalSecWaitAllProperty=0;
								
								total_bids[counterfunction]=$arr_auto[2];
								$arr_auto_more_details=$arr_auto[6].split("~!~!~!");
								if($arr_auto_more_details[1])
									{
									$arr_auto_more_details_class=$arr_auto_more_details[1].split("-!-!-!");
									
									if($arr_auto_more_details_class[7]=='property_details_page')
										document.getElementById("td3_"+counterfunction).className=$arr_auto_more_details_class[0]+' padboth10';
									else
										document.getElementById("td2_"+counterfunction).className=$arr_auto_more_details_class[0]+' padboth10';
									document.getElementById("tdTopLt_"+counterfunction).innerHTML=$arr_auto_more_details_class[1];
									document.getElementById("tdTopMt_"+counterfunction).className=$arr_auto_more_details_class[2];
									document.getElementById("tdTopRt_"+counterfunction).innerHTML=$arr_auto_more_details_class[3];
									document.getElementById("tdBottomLt_"+counterfunction).innerHTML=$arr_auto_more_details_class[4];
									document.getElementById("tdBottomMt_"+counterfunction).className=$arr_auto_more_details_class[5];
									document.getElementById("tdBottomRt_"+counterfunction).innerHTML=$arr_auto_more_details_class[6];
									}	
								
								document.getElementById("bid_box_div_"+propertyId[counterfunction]).innerHTML=$arr_auto_more_details[0];
								if($arr_auto[1]!=document.getElementById("bid_amt_"+propertyId[counterfunction]).value)
									{
									document.getElementById("bid_amt_"+propertyId[counterfunction]).value=$arr_auto[1];
									document.getElementById("bid_amt_hidden_"+propertyId[counterfunction]).value=$arr_auto[1];
									}
								}
							}
						
						}
					if($arr_first[indexvar])
						{
						$arr_auto=$arr_first[indexvar].split("___");
						}
					}
				
				}
				request_complete=0;
				totalSecWaitForAutoLoadBid=4;
				waitCallAutoLoadBid();
			}
		}		
		
	}
var shouldCallFunction=0;
function auto_load_bid_ajaxReference()
{
if(!request_complete_instant)
	auto_load_bid_ajax();
else
	shouldCallFunction=1;
}
function callThisFunctionInstant()
{
request_complete_instant=0;
auto_load_bid_ajax();
}
function changeColor(i)
{
document.getElementById("td3_"+i).style.background='';
}
var propertyIdHistoryGlobal='';

function showHistory(propertyIdHistory,auctionIDHistory)
	{
	propertyIdHistoryGlobal=propertyIdHistory;
	
	var div_inner_html=document.getElementById("bid_history_div_"+propertyIdHistory).innerHTML;
	if(div_inner_html!='')
		{
		div_inner_html=document.getElementById("bid_history_div_"+propertyIdHistory).innerHTML='';
		return false;
		}
	else
		{
		var rand = Math.random();
		var str_to_send="rand="+rand;
		str_to_send+="&propertyId="+propertyIdHistory;
		str_to_send+="&auctionID="+auctionIDHistory;
		str_to_send+="&action_state=property_auto_load";
		str_to_send+="&task=getBidHistory";
	
		var url="ajaxOnlineFileDemo.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=showHistoryFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
		}
	}
function showHistoryFunction()
	{
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
		{
		var arr=xmlHttp2.responseText.split("___");
		var propertyIdHistory=arr[0];
		document.getElementById("bid_history_div_"+propertyIdHistory).style.display="block";
		newHTML = arr[1];
		document.getElementById("bid_history_div_"+propertyIdHistory).innerHTML=newHTML;
		}		
	}
function followmouseBidHistory(e)
	{
	var div_inner_html=document.getElementById("bid_history_div_"+propertyIdHistoryGlobal).innerHTML;
	if(div_inner_html!='')
		{
		return false;
		}
	var offsetfrommouse=[15,25];
	var defaultimageheight = 150;	// maximum image size.
	var defaultimagewidth = 100;	// maximum image size.

	var xcoord=offsetfrommouse[0];
	var ycoord=offsetfrommouse[1];

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-10;
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight);

	if (typeof e != "undefined"){
		
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

		} 
	else if (typeof window.event != "undefined")
		{
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0])
			{
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
			} 
		else 
			{
			xcoord += truebody().scrollLeft+event.clientX
			}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1]))
			{
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
			} 
		else 
			{
			ycoord += truebody().scrollTop + event.clientY;
			}
		}
	document.getElementById("bid_history_div_"+propertyIdHistoryGlobal).style.left=xcoord+"px";
	document.getElementById("bid_history_div_"+propertyIdHistoryGlobal).style.top=ycoord+"px";
	}

function checkUserEntry(e)
	{
	var KeyID = (window.event) ? event.charCode : e.charCode;
	if(KeyID<48 || KeyID>57 || KeyID==0)
		{
		return false;
		}
	}


function showPrevValueFilter(min_prev_val,max_prev_val)
	{
		var rand = Math.random();
		var url="prev_value_load_ajax.php?"+"rand="+rand+"&min_prev_val="+min_prev_val+"&max_prev_val="+max_prev_val;
		xmlHttp31=getobject_common3();
		xmlHttp31.onreadystatechange=showPrevValueFilterFunction;
		xmlHttp31.open("GET",url,true);
		xmlHttp31.send(null);
	}

function showPrevValueFilterFunction()
	{
	document.getElementById('load_prev_value').innerHTML='<img src="images/indicator_002.gif">';
	if(xmlHttp31.readyState==4 ||  xmlHttp31.readyState=="complete")
		{	
		document.getElementById('load_prev_value').innerHTML=xmlHttp31.responseText;
		}
	}

var FTP_path;
var width;
var height;
var propertyId_hover;

function showHoverImage(FTP_path_full,width1,height1,propertyId)
	{
	FTP_path=FTP_path_full;
	width=width1;
	height=height1;
	propertyId_hover=propertyId;
	var rand = Math.random();
	var url="ajaxOnlineFileDemo.php?"+"rand="+rand+"&propertyId="+propertyId+"&task=getPropDetails";
	xmlHttp8=getobject_common();
	xmlHttp8.onreadystatechange=showHoverImageFunction;
	xmlHttp8.open("GET",url,true);
	xmlHttp8.send(null);
	}

function showHoverImageFunction()
	{
	if(xmlHttp8.readyState==4 ||  xmlHttp8.readyState=="complete")
		{	
		var str=xmlHttp8.responseText;
		if(propertyId_hover)
			{
			showimage(FTP_path,str,width,height);
			}
		}
	
	}




function uncheckOthers(id,sess_userid)
	{
		if(sess_userid=='')
			{
			if(id!='allListingChecked')
			document.getElementById(id).checked=false;
			tb_show("", "#TB_inline?height=280&width=600&inlineId=hiddenSearchBox", "");
			return false;
			}
		else
			{
			if(id=='savedListingsChecked')
				{
				document.getElementById('currentBidsChecked').checked=false;
				document.getElementById('soldPropertiesChecked').checked=false;
				}
			if(id=='currentBidsChecked')
				{
				document.getElementById('savedListingsChecked').checked=false;
				document.getElementById('soldPropertiesChecked').checked=false;
				}
			if(id=='soldPropertiesChecked')
				{
				document.getElementById('currentBidsChecked').checked=false;
				document.getElementById('savedListingsChecked').checked=false;
				}

			return true;
			}
	}
function submitPageNumber(url,auctionNumber,total_pages)
	{
	var page=document.getElementById('page_number_direct').value;
	if(page<1)
		{
		
		}
	if(page>total_pages)
		{
		alert('There is currently only '+total_pages+' page');
		}
	else if(page>0)
		{
		window.location = url+"?page="+page+"&auctionID="+auctionNumber;
		}
	}

function validateLoginForm(myform,missIncrctInfoSpn,entVldEmailAddSpn,entPswrdSpn){
	var MasterString=missIncrctInfoSpn;
	var flag=false;
	var visitor="";

	if (!IsEmailAddress(myform.email.value,'')) {
		visitor +=  "\n- "+entVldEmailAddSpn;
		document.getElementById('c_011').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('c_011').style.backgroundColor='';
	}

	if (myform.password.value==""){   
		visitor +=  "\n-"+entPswrdSpn; 
		document.getElementById('c_012').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('c_012').style.backgroundColor='';
	}			

	if (visitor!=""){
		MasterString=MasterString + visitor;
		flag=true;
	}

	if(flag==true)	{
		alert(MasterString);
		return false;
	}
	return true;
}
function vis()
{
	
	document.getElementById('register_form_tr_id').style.display = '';
	document.getElementById('register_form_tr_id').style.visibility = 'visible';
	document.getElementById('why_register_tr1_id').style.display = 'none';
	document.getElementById('why_register_tr1_id').style.visibility = 'hidden';
	document.getElementById('why_register_tr2_id').style.display = 'none';
	document.getElementById('why_register_tr2_id').style.visibility = 'hidden';
}
function invis()
{
	document.getElementById('register_form_tr_id').style.display = 'none';
	document.getElementById('register_form_tr_id').style.visibility = 'hidden';
	document.getElementById('why_register_tr1_id').style.display = '';
	document.getElementById('why_register_tr1_id').style.visibility = 'visible';
	document.getElementById('why_register_tr2_id').style.display = '';
	document.getElementById('why_register_tr2_id').style.visibility = 'visible';
}

function selCounties(countryId,typ1)
{
	typ=typ1;
	countryIdGlobal=countryId;
	if(document.getElementById("stateExist"))
	{
		var state=document.getElementById("stateExist").value;
	}
	else
	{
		var state='';
	}
	
	var strSubmit = "action=getCounties&countryId="+countryId+"&state="+state;	
	var strURL = "getAjax.php";
	var strResultFunc = "show_message";
	xmlhttpPost(strURL, strSubmit, strResultFunc);
}

function show_message(result){
	document.getElementById("r_123").style.display="";
	document.getElementById("r_123").innerHTML=result;
	if(result==""){
		document.getElementById("r_1111").style.display="none";
	}

	else if(document.getElementById('stateCombo').value=="others"){
		document.getElementById("r_1111").style.display="none";
		document.getElementById("phoneNumber1").style.display="none";
		document.getElementById("phoneNumber2").style.display="";

		document.getElementById("cellNumber1").style.display="none";
		document.getElementById("cellNumber2").style.display="";
		document.regfrm.zip.maxLength ="30";
		if(typ){
			document.regfrm.zip.value='';
		}
	}
	else{
		document.getElementById("r_1111").style.display="";
		document.getElementById("phoneNumber1").style.display="";
		document.getElementById("phoneNumber2").style.display="none";

		document.getElementById("cellNumber1").style.display="";
		document.getElementById("cellNumber2").style.display="none";
		if(countryIdGlobal==71)
			document.regfrm.zip.maxLength ="5";
		else
			document.regfrm.zip.maxLength ="30";
		if(typ)
			{
			document.regfrm.zip.value='';
			}
	}
}
function signupAjax(regfrm,auctionNumber)
	{
	var login=document.getElementById("login").value;
	var stateCombo=document.getElementById("stateCombo").value;
	var PhoneNum=document.getElementById("PhoneNum").value;
	var Phone1=document.getElementById("Phone1").value;
	var Phone2=document.getElementById("Phone2").value;
	var Phone3=document.getElementById("Phone3").value;
	var mobileNum=document.getElementById("mobileNum").value;
	var mobile1=document.getElementById("mobile1").value;
	var mobile2=document.getElementById("mobile2").value;
	var mobile3=document.getElementById("mobile3").value;
	var email=regfrm.email.value;
	var imagecode=document.getElementById("imagecode").value;
	var firstName=document.getElementById("firstName").value;
	var lastName=document.getElementById("lastName").value;
	var address=document.getElementById("address").value;
	var city=document.getElementById("city").value;
	var stateCombo=document.getElementById("stateCombo").value;
	var countryid=document.getElementById("countryid").value;
	var zip=document.getElementById("zip").value;
	var password1=document.getElementById("password1").value;
	var name=document.getElementById("name").value;
	var hintAnswer=document.getElementById("hintAnswer").value;
	var propertyId_bid_back=document.getElementById("propertyId_bid_back").value;
	var counter_bid_back=document.getElementById("counter_bid_back").value;
	var bid_amt_bid_back=document.getElementById("bid_amt_bid_back").value;
	
	var rand = Math.random();
		
	var url="signupAjaxOnlineBidding.php?"+"rand="+rand+"&login="+login+"&stateCombo="+stateCombo+"&PhoneNum="+PhoneNum
		+"&Phone1="+Phone1+"&Phone2="+Phone2+"&Phone3="+Phone3+"&mobileNum="+mobileNum+"&mobile1="+mobile1
		+"&mobile2="+mobile2+"&mobile3="+mobile3+"&email="+email+"&imagecode="+imagecode+"&firstName="+firstName
		+"&lastName="+lastName+"&address="+address+"&city="+city+"&stateCombo="+stateCombo+"&propertyId_bid_back="+propertyId_bid_back
		+"&countryid="+countryid+"&zip="+zip+"&password1="+password1+"&auctionNumber="+auctionNumber
		+"&name="+name+"&hintAnswer="+hintAnswer+"&counter_bid_back="+counter_bid_back+"&bid_amt_bid_back="+bid_amt_bid_back+"&action_state=signup_form";
	xmlHttp=getobject_common();
	xmlHttp.onreadystatechange=signupAjaxFunction;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}

function signupAjaxFunction()
	{
	document.getElementById('thankyouSignUpDiv').style.display='block';
	document.getElementById('thankyouSignUpDiv').innerHTML='<img src="indicator_002.gif">';
	if(xmlHttp.readyState==4 ||  xmlHttp.readyState=="complete")
		{	
		document.getElementById('thankyouSignUpDiv').style.display='none';
		
		$arr=xmlHttp.responseText.split("~~~");
		if($arr[1]==0)
			{
			document.getElementById('spanSessionMsg').style.display='block';
			document.getElementById('spanSessionMsg').innerHTML=$arr[0];
			}
		else
			{
			document.getElementById('signupFormMainDiv').style.display='none';
			}
		}
	}
function getobject_common100()
	{
	var xmlHttp5;
	try
  		{
	  	// Firefox, Opera 8.0+, Safari
  		xmlHttp5=new XMLHttpRequest();
  		}
	catch (e)
  		{
		// Internet Explorer
  		try
    		{
    		xmlHttp5=new ActiveXObject("Msxml2.XMLHTTP");
    		}
  		catch (e)
    		{
    		try
      			{
      			xmlHttp5=new ActiveXObject("Microsoft.XMLHTTP");
      			}
    		catch (e)
      			{
      			alert("Your browser does not support AJAX!");
      			return false;
      			}
    		}
  		}
  	return xmlHttp5;
	}

var auctionIdOnline;

function timerAjax(auctionId)
	{
	auctionIdOnline=auctionId;
	
	var rand = Math.random();
	var str_to_send="rand="+rand;
	str_to_send+="&auctionIdOnline="+auctionIdOnline;
	str_to_send+="&type_reload=yes&type_reload_url=auction_online&task=proxyTimerOnline";
	var url="ajaxOnlineFileDemo.php";
	xmlHttp100=getobject_common100();
	xmlHttp100.onreadystatechange=timerAjaxFunction;
	xmlHttp100.open("POST",url,true);
	xmlHttp100.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp100.send(str_to_send);
	}
var wait_var='';

function timerAjaxFunction()
	{
	if(xmlHttp100.readyState==4 ||  xmlHttp100.readyState=="complete")
		{
		if(xmlHttp100.responseText!='')
			{
			$arr_auto=xmlHttp100.responseText.split("__");
			if($arr_auto[1])
				{
				if($arr_auto['0']=='auction_online')
					{
					history.go(0);
					return false;
					}
				$arr_auto_time_vars=$arr_auto[1].split(":");
				document.getElementById("remain_type").innerHTML=$arr_auto['0'];
				document.getElementById("tmrDays").innerHTML=$arr_auto_time_vars['0'];
				document.getElementById("tmrHrs").innerHTML=$arr_auto_time_vars['1'];
				document.getElementById("tmrMins").innerHTML=$arr_auto_time_vars['2'];
				document.getElementById("tmrSecs").innerHTML=$arr_auto_time_vars['3'];
				
				}
			totalSecWait=30;
			timerFunction();
			
			}
		}		
		
	}
var totalSecWait=30;
function timerFunction()
{
if(!totalSecWait)
	{
	totalSecWait=0;
	timerAjax(auctionIdOnline);
	return false;
	}
totalSecWait=totalSecWait-1;

var days=document.getElementById("tmrDays").innerHTML;
var hrs=document.getElementById("tmrHrs").innerHTML;
var mins=document.getElementById("tmrMins").innerHTML;
var secs=document.getElementById("tmrSecs").innerHTML;
secs=secs-1;
if(secs<0)
	{
	if(mins>0)
		{
		mins=mins-1;
		secs=59;
		}
	}
if(mins<0)
	{
	if(hrs>0)
		{
		hrs=hrs-1;
		mins=59;
		}
	}
if(hrs<0)
	{
	if(days>0)
		{
		days=days-1;
		hrs=24;
		}
	}

if(days==0 && secs<0 && mins==0 && hrs==0)
	{
	totalSecWait=0;
	timerAjax(auctionIdOnline);
	return false;
	}
if(secs<=9)
	secs="0"+secs;
document.getElementById("tmrDays").innerHTML=days;
document.getElementById("tmrHrs").innerHTML=hrs;
document.getElementById("tmrMins").innerHTML=mins;
document.getElementById("tmrSecs").innerHTML=secs;
setTimeout("timerFunction()",1000);
}
function savePropertyAjax(propertyId,auctionid)
	{
	document.getElementById("propertyId_bid_back").value='';
	document.getElementById("bid_amt_bid_back").value='';
	document.getElementById("auctionNumber_bid_back").value='';
	document.getElementById("counter_bid_back").value='';
	document.getElementById("targetDate_bid_back").value='';
	document.getElementById("startDate_bid_back").value='';
	document.getElementById("auto_bid_address").value='';
	document.getElementById("auto_bid_alert_login").value=0;
	var rand = Math.random();

	var propertypage=document.getElementById("propertypage").value;
	if(propertypage=='propertypage')
		var action_state='property_save_propertyPage';
	else
		var action_state='edit_form';

	var url="ajaxOnlineFileDemo.php?"+"rand="+rand+"&propertyId="+propertyId+"&auctionID="+auctionid+"&action_state="+action_state+"&task=saveListing";
	xmlHttp=getobject_common();
	xmlHttp.onreadystatechange=savePropertyAjaxFunction;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}

function savePropertyAjaxFunction()
	{
	
	if(xmlHttp.readyState==4 ||  xmlHttp.readyState=="complete")
		{	

		$arr=xmlHttp.responseText.split("~~~");

		if($arr[0]=='alreadysaved')
			{
			document.getElementById("property_saved_td"+$arr[2]).innerHTML=$arr[3];
			}
		else if($arr[0]=='loginrequired')
			tb_show("", "#TB_inline?height=80&height=280&width=600&inlineId=hiddenSearchBox", "");
		else
			{
			document.getElementById("property_saved_td"+$arr[2]).innerHTML=$arr[0];
			}
		}
	}
function openWin(itemID,auctionNumber)
	{
	start=document.getElementById('start').value;

	newwin=window.open ("property_detail_online.php?itemID="+itemID+"&auctionID="+auctionNumber+"&start="+start,
	"mywindow","status=1,scrollbars=1,toolbar=1,width=800,height=600,top=0"); 
	newwin.focus();
	}
function validate_ques(frm)
	{	

	var counter;
	var message='';			
	
	var radio_choice1= false;	
	for (counter = 0; counter < frm.houseOpen.length; counter++)
		{ 
		if (frm.houseOpen[counter].checked)
			{
			var radio_choice1 = true; 
			}
		}
	
	if(radio_choice1)
		{
		if(frm.timeArrive.value=='')
			{
			message += '- Please select Arrival time at the property.\n';
			}
		}	
	if(message!='')
		{
		alert(message);
		return false;
		}
	else
		{
		return true;
		}
	}
function OpenWindow1(FileName, WinName, WinWidth, WinHeight, ScrollVal)
{	
		
	if(document.getElementById('imagePath').value==""){
		FileName=FileName;
	}
	else
	{
		FileName="viewPic.php?name="+document.getElementById('imagePath').value+"&itemID="+document.getElementById('itemID').value+"&auctionID="+document.getElementById('auctionID').value+"&imageID="+document.getElementById('imageID').value;
	}
	
		new_window=window.open(FileName,WinName,"'toolbar=no, directories=no, menubar=no, resizable=yes, scrollbars="+ScrollVal+", width="+WinWidth+", height="+WinHeight+", top='0' ");
		new_window.blur();
		new_window.focus();
}
function changeClassTd(imageTd,count)
	{
	var newcount=count;
	while(document.getElementById("ahrefId"+count))
		{
		document.getElementById("ahrefId"+count).className="thumbsml";
		count++;
		}
	while(document.getElementById("ahrefId"+newcount))
		{
		document.getElementById("ahrefId"+newcount).className="thumbsml";
		newcount--;
		}
	document.getElementById(imageTd).className="thumbact";
	}
function showInThickbox()
{
tb_show("", "#TB_inline?height=280&width=600&inlineId=bidDivMsgReservePrice", "");
}
