function excelDownload(path,lastViewed)
	{
	location.href=path;
	}
//var totalSecWaitForAutoLoadBidGlobal=4;

if(totalSecWaitForAutoLoadBidGlobal!=undefined)
  var totalSecWaitForAutoLoadBid=totalSecWaitForAutoLoadBidGlobal;
  
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 (SITE_PATH_SSL+"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';
var isBiddingProcessCompleted=0;
function bidLoginCheck(userid_bid,propertyId_bid,auctionNumber_bid,counter_bid,targetDate_bid,startDate_bid,auto_bid_alert_login,address)
	{
//alert(timeOutRequestCalls);alert(isBiddingProcessCompleted);
	if(timeOutRequestCalls)
		return false;
	if(isBiddingProcessCompleted)
		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='';
				}
			}
		}
		if(document.getElementById("proxy_normal_bid"+counter_bid)) 
	      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=='')
	    userid_bid=document.getElementById("LoggedInId").value ;
	
	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="font12Rd">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="font12Rd">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", "");
	
	// Code addedd for running popup on https
	
 /* 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)+"&height=315&width=670", ""); 
  * 
  */ 
  
  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=='Sold Subject To!!!' ||  document.getElementById("remain"+counter_bid).innerHTML=='FINALIZING...' || document.getElementById("remain"+counter_bid).innerHTML=='GONE!!!')
				{
				document.getElementById("hiddenMessageBox").innerHTML='<table width="100%"  bgcolor="#FFFFFF" class="border-imgNew pad8"><tr><td width="80%" align="center" class="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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="font12Rd">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='';
	isBiddingProcessCompleted=1;

	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=='Sold Subject To!!!' || document.getElementById("remain"+counter_bid).innerHTML=='FINALIZING...' || document.getElementById("remain"+counter_bid).innerHTML=='GONE!!!')
			return false;
		}
		
	var url=SITE_PATH+"ajaxOnlineCommercialFile.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")
		{	
		
		//alert(xmlHttp.responseText);
		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("~~");
				
				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", "");
				}
			}
			isBiddingProcessCompleted=0;
		}
	}
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 Subject To!!!' || document.getElementById("remain"+allPropIndexFlash[i]).innerHTML=='SOLD!!!' || document.getElementById("remain"+allPropIndexFlash[i]).innerHTML=='FINALIZING...' || document.getElementById("remain"+allPropIndexFlash[i]).innerHTML=='GONE!!!')
				{
				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=SITE_PATH+"ajaxOnlineCommercialFile.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'){
          //alert($arr_auto);
				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
						{//alert('closingTime for '+i+': '+closingTimeRemaining[i]);alert($arr_auto_blink[0]);
						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 Subject To!!!' || $arr_auto_blink[0]=='SOLD!!!' || $arr_auto_blink[0]=='FINALIZING...' || $arr_auto_blink[0]=='GONE!!!') && !linkDisabled[i])
						{//alert('inside');
						linkDisabled[i]=1;
            if(document.getElementById("button_bid_now_div"+i) && document.getElementById("button_bid_now_div_hidden_disable"+i))
						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 Subject To!!!' && $arr_auto_blink[0]!='SOLD!!!' && $arr_auto_blink[0]!='FINALIZING...' && $arr_auto_blink[0]!='GONE!!!')
						{
						linkDisabled[i]=0;
						document.getElementById("button_bid_now_div"+i).innerHTML=document.getElementById("button_bid_now_div_hidden"+i).innerHTML;
						}
					
					}
					
				}
				}
		  totalSecWaitAllProperty=totalSecWaitForAutoLoadBidGlobal;
			request_start_timer_javascript=0;
			request_complete_timer=0;
			timerFunctionAllProperty();
			}
		}		
		
	}
var totalSecWaitAllProperty=totalSecWaitForAutoLoadBidGlobal;
var closingTimeRemaining = new Array();

function timerFunctionAllProperty()
{

if(totalSecWaitAllProperty==0)
	{
	bid_auto_box_load_timer();
  //totalSecWaitAllProperty=totalSecWaitForAutoLoadBidGlobal;
	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 Subject To!!!')
			continue;
		if(document.getElementById("remain"+i).innerHTML=='SOLD!!!')
			continue;
		if(document.getElementById("remain"+i).innerHTML=='GONE!!!')
			continue;

		if(document.getElementById("remain"+i).innerHTML=='FINALIZING...')
			{//alert('closingTime for '+i+': '+closingTimeRemaining[i]);
      if(isNaN(closingTimeRemaining[i]) || closingTimeRemaining[i]=='undefined')closingTimeRemaining[i]=0;
			if(closingTimeRemaining[i]==3)
				{
				totalSecWaitAllProperty=0;
				//document.getElementById("remain"+i).innerHTML='SOLD!!!';
				continue;
				}
			else
				{
				closingTimeRemaining[i]=parseInt(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;

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=SITE_PATH+"ajaxOnlineCommercialFile.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=totalSecWaitForAutoLoadBidGlobal;
				waitCallAutoLoadBid();
				return false;
				}
			$arr_first=xmlHttp5.responseText.split("@@@");
			if($arr_first[1])
				{
				document.getElementById("totalBidsAuction").value=$arr_first[1];
				request_complete=0;
				totalSecWaitForAutoLoadBid=totalSecWaitForAutoLoadBidGlobal;
				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++)
				{				//alert(i);
				if($arr_auto[0]==i)
					{//alert(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];
            //alert(counterfunction);
            counterfunction=parseInt(counterfunction);
						document.getElementById("totalBidsAuction").value=$arr_auto[8];
						//alert('arr_auto= '+$arr_auto[8]);
						if($arr_auto[2])
							{
							if($arr_auto[3])
								{								//alert($arr_auto[3]);
								$arr_bid_details=$arr_auto[7].split("~~~");
								if($arr_bid_details[0])
									{//alert($arr_bid_details[0]);
                  document.getElementById("myBidDetailsDiv").innerHTML=$arr_bid_details[1];
                  document.getElementById("myBidLowerDetailsDiv").innerHTML=$arr_bid_details[0];
									}//alert($arr_auto[5]);
								document.getElementById("total_his_bid_till_now").value=$arr_auto[5];
                //alert("td3_"+counterfunction);
								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("~!~!~!");
            //alert($arr_auto_more_details[1]);
								if($arr_auto_more_details[1])
									{
									$arr_auto_more_details_class=$arr_auto_more_details[1].split("-!-!-!");
                  //alert(document.getElementById("td3_"+counterfunction));
									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';
                    
                  //alert("td2_"+$arr_auto_more_details_class[1]);
									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];
									}
                //alert("bid_box_div_"+propertyId[counterfunction-1]);
								document.getElementById("bid_box_div_"+propertyId[counterfunction]).innerHTML=$arr_auto_more_details[0];
                //alert("bid_box_div_"+propertyId[counterfunction]);
								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];
									}
                timeOutRequestCalls=0;
								}
							}						
						}
					if($arr_first[indexvar])
						{
						$arr_auto=$arr_first[indexvar].split("___");
						}
					}				
				}      
			}
    request_complete=0;
    totalSecWaitForAutoLoadBid=totalSecWaitForAutoLoadBidGlobal;
    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";
		//alert(str_to_send);
		var url=SITE_PATH+"ajaxOnlineCommercialFile.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=parseInt(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=SITE_PATH_SSL+"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=SITE_PATH+"ajaxOnlineCommercialFile.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="";
//alert(myform.email.value) ; 
	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 = SITE_PATH+"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=SITE_PATH+"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;
var venueIdsTimerOnline;

function timerAjax(auctionId,venueIdsTimer)
	{
	auctionIdOnline=auctionId;
	venueIdsTimerOnline=venueIdsTimer;
	
	var rand = Math.random();
	var str_to_send="rand="+rand;
	str_to_send+="&auctionIdOnline="+auctionIdOnline;
	str_to_send+="&venueIdsTimer="+venueIdsTimer;

	str_to_send+="&type_reload=yes&type_reload_url=auction_online&task=proxyTimerOnline";
	var url=SITE_PATH+"ajaxOnlineCommercialFile.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='';
var venueIdsTimers = new Array();
function timerAjaxFunction()
	{
	if(xmlHttp100.readyState==4 ||  xmlHttp100.readyState=="complete")
		{
		
		if(xmlHttp100.responseText!='')
			{
			//alert(xmlHttp100.responseText);
			countervenueIdsTimers=0;
			$arr_auto_type=xmlHttp100.responseText.split("####");
			if($arr_auto_type[1]=='Event')
				{
				$arr_auto=$arr_auto_type[0].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'];
					
					}
				venueIdsTimers[countervenueIdsTimers]='Blank';
				}
			else
				{
				$arr_auto_times=$arr_auto_type[0].split("_!_!_!");
				counterTotalTimers=0;
				
				while($arr_auto_times[counterTotalTimers])
					{
					
					$arr_auto_ids=$arr_auto_times[counterTotalTimers].split("_~_~_~_");
					var venueId=$arr_auto_ids[1];
					
					venueIdsTimers[countervenueIdsTimers]=venueId;
					
					$arr_auto=$arr_auto_ids[0].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"+venueId).innerHTML=$arr_auto['0'];
						document.getElementById("tmrDays"+venueId).innerHTML=$arr_auto_time_vars['0'];
						document.getElementById("tmrHrs"+venueId).innerHTML=$arr_auto_time_vars['1'];
						document.getElementById("tmrMins"+venueId).innerHTML=$arr_auto_time_vars['2'];
						document.getElementById("tmrSecs"+venueId).innerHTML=$arr_auto_time_vars['3'];
						if($arr_auto_ids[2]=='MainTimer')
							{
							venueId='';
							document.getElementById("remain_type"+venueId).innerHTML=$arr_auto['0'];
							document.getElementById("tmrDays"+venueId).innerHTML=$arr_auto_time_vars['0'];
							document.getElementById("tmrHrs"+venueId).innerHTML=$arr_auto_time_vars['1'];
							document.getElementById("tmrMins"+venueId).innerHTML=$arr_auto_time_vars['2'];
							document.getElementById("tmrSecs"+venueId).innerHTML=$arr_auto_time_vars['3'];
							countervenueIdsTimers++;
							venueIdsTimers[countervenueIdsTimers]='Blank';	
							}
						
						countervenueIdsTimers++;
						}
					counterTotalTimers++;
					}
				}
			totalSecWait=40;
			timerFunction();

			
			
			}
		}		
		
	}
var totalSecWait=40;
function timerFunction()
{
if(!totalSecWait)
	{
	totalSecWait=0;
	timerAjax(auctionIdOnline,venueIdsTimerOnline);
	return false;
	}
totalSecWait=totalSecWait-1;
icounter=0;
while(venueIdsTimers[icounter])
	{
	if(venueIdsTimers[icounter]=='Blank')
		var venueId='';
	else
	var venueId=venueIdsTimers[icounter];

	var days=document.getElementById("tmrDays"+venueId).innerHTML;
	var hrs=document.getElementById("tmrHrs"+venueId).innerHTML;
	var mins=document.getElementById("tmrMins"+venueId).innerHTML;
	var secs=document.getElementById("tmrSecs"+venueId).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,venueIdsTimerOnline);
		return false;
		}
	if(secs<=9)
		secs="0"+secs;
	document.getElementById("tmrDays"+venueId).innerHTML=days;
	document.getElementById("tmrHrs"+venueId).innerHTML=hrs;
	document.getElementById("tmrMins"+venueId).innerHTML=mins;
	document.getElementById("tmrSecs"+venueId).innerHTML=secs;
	icounter++;
	}
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=SITE_PATH+"ajaxOnlineCommercialFile.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", "");
		//		tb_show("",SITE_PATH_SSL+"loginBoxCommon.inc.php?height=315&width=670", ""); 
		
		    var   urlLogin=document.getElementById("urlLogin").value ;
		    tb_show("",SITE_PATH_SSL+"loginBoxCommon.inc.php?Url="+escape(urlLogin)+thickboxLogin, ""); 
		
		
		}
		else
			{
			document.getElementById("property_saved_td"+$arr[2]).innerHTML=$arr[0];
			}
		}
	}
function openWin(itemID,auctionNumber)
	{
    
	var start=document.getElementById('start').value;

	newwin=window.open (SITE_PATH+"property_detail_online_commercial.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,srch)
{	
	var left = (screen.width/2)-(WinWidth/2);
	var top = (screen.height/2)-(WinHeight/2);
	if(srch==undefined)
	var scrh ='';
	if(document.getElementById('imagePath').value==""){
		FileName=FileName;
	}
	else
	{
		// Site Path is addedd by sachendra
		FileName=SITE_PATH+"viewPicComm.php?name="+document.getElementById('imagePath').value+"&itemID="+document.getElementById('itemID').value+"&auctionID="+document.getElementById('auctionID').value+"&imageID="+document.getElementById('imageID').value+"&srch="+srch;
	}
	
		new_window=window.open(FileName,WinName,"'toolbar=no, directories=no, menubar=no, resizable=yes, scrollbars="+ScrollVal+", width="+WinWidth+", height="+WinHeight+", top="+top+" left="+left+"");
		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", "");
}

function setVenueIDs(vval,typ)
	{
	if(typ=='show')
		{
		document.getElementById("showHideIMG_"+vval).src="images/single-orange-down-arrow.gif";
		document.getElementById("venueBoxTR_"+vval).style.display="";
		document.getElementById("showHideTxt_"+vval).innerHTML='<a onclick="setVenueIDs('+vval+',\'hide\');" id="aHrefId'+vval+'" style="text-decoration: none; cursor:pointer;"><strong>Hide Venue Details</strong></a>';
		document.getElementById("aHrefId"+vval).className="txt11blue";
		}
	else
		{
		document.getElementById("showHideIMG_"+vval).src="images/single-orange-arrow.gif";
		document.getElementById("venueBoxTR_"+vval).style.display="none";
		document.getElementById("showHideTxt_"+vval).innerHTML='<a onclick="setVenueIDs('+vval+',\'show\');" id="aHrefId'+vval+'" style="text-decoration: none; cursor:pointer;"><strong>Show Venue Details</strong></a>';
		document.getElementById("aHrefId"+vval).className="txt11blue";
		}
	}
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 displayLoginDivOnline(divId,rightInd,backUrl,auctionID,itemId,e,$_SITE_PATH_SSL,$imgPathVar)
	{
		document.getElementById("loginBox").style.display="";
		document.getElementById("propertyId").value=itemId;

	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);
			 document.getElementById("loginBox").style.left = x + 20 +'px';
			 document.getElementById("loginBox").style.top = y  +'px';
	}else{
 		 x=mouseX(e);
		 y=mouseY(e);
			 document.getElementById("loginBox").style.left = x + 20 +'px';
			 document.getElementById("loginBox").style.top = y  +'px';
	 }

		if(backUrl=='bidNow')
		{
			document.getElementById('loginLink').innerHTML='';
			var qryStr="?bidStatus=1&auctionID="+auctionID+"&item="+itemId;
		
			var str="You need to create a 100% Free Account in order to make offer for this property <a href='"+$_SITE_PATH_SSL+"login.php"+qryStr+"'><img src='"+$imgPathVar+"register-now.gif' width='103' height='20' vspace='3' border='0' align='absmiddle' title='Loading..'   /></a>";

			document.getElementById('loginLink').innerHTML=str;
		}
		else
		{
			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>";
			document.getElementById('loginLink').innerHTML=str;
		}

		var divIdOld=document.getElementById('div_Hid').value;
		if(divIdOld)
		{
			document.getElementById(divIdOld).innerHTML='';
		}
		document.getElementById('div_Hid').value=divId;
		document.getElementById(divId).style.right=rightInd+'px';
		//var logText=document.getElementById('loginBox').innerHTML;
		//document.getElementById(divId).innerHTML=logText;
	
		document.getElementById('backUrl').value=backUrl;
		document.getElementById('auctionIdBack').value="<?php echo $auctionID;?>";
		document.getElementById('itemIdBack').value=itemId;
	}

	function closeLoginBox()
	{
		document.getElementById('loginBox').style.display="none";
		//var divIdOld=document.getElementById('div_Hid').value;
		//if(divIdOld){
		//	document.getElementById(divIdOld).innerHTML='';
		//}	
		//document.getElementById('div_Hid').value='';
	}
function getAgentInfo()
{	
	var rightInd=600;
	//var leftInd=150;
	var topInd=260;
	
	document.getElementById("agentInfoBox").style.right=rightInd+'px';
	//document.getElementById("agentInfoBox").style.left=leftInd+'px';
	document.getElementById("agentInfoBox").style.top=topInd+'px';
	document.getElementById("agentInfoBox").style.display="";
	if(document.getElementById('divAgent').style.display=='none')
	{
		document.getElementById('divAgent').style.display='';
	}
	document.getElementById('divAgent').innerHTML=document.getElementById('agentInfoBox').innerHTML;
	document.getElementById("mainContainer").style.display='none';
}
function getAgentInfoSubmit()
{	
	var fname=document.getElementById("fName").value;
	var lname=document.getElementById("lName").value;
	var AIEmail=document.getElementById("AIEmail").value;
	var auctionID=document.getElementById("auctionID").value;
	var itemId=document.getElementById("itemID").value;
	
	
	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(document.getElementById("fName").value=='')
	{
		
		visitor +=  "\n- Please enter first name."; 
		document.getElementById('c_011').style.backgroundColor='#F9F3C1';	
	}
	if(document.getElementById("lName").value=='')
	{
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('c_012').style.backgroundColor='#F9F3C1';	
	}
	if (!IsEmailAddress(document.getElementById("AIEmail").value,'')) 
	{
		visitor += "\n- Please enter a valid email address.";
		document.getElementById('c_012').style.backgroundColor='#F9F3C1';
	}

	if(visitor != "")
	{
		MasterString = MasterString + visitor;
		
		flag=true;
	}
		
	if (flag == true)
	{
		alert(MasterString);
		return false;
	}
	else
	{
		var strSubmit = "action=getAgentInfo&auctionID="+auctionID+"&propertyId="+itemId+"&fname="+fname+"&lname="+lname+"&AIEmail="+AIEmail;	
		
		var strURL = SITE_PATH+"getAjax.php";
		var strResultFunc = "show_message_presale";
		xmlhttpPost(strURL, strSubmit, strResultFunc);

	}
	
}
function closeAgentBox(){
	
	document.getElementById('divAgent').style.display="none";
}
function show_message_presale(result)
{

	document.getElementById("mainContainer").style.display='none';
	document.getElementById("outerContainer").style.display='';
	document.getElementById("innerConainer1").style.display='';
	
	document.getElementById("content123").innerHTML="Thank you for your request, an email has been sent with the Property Information to your email account.<br/>"+result; 

	document.getElementById('divAgent').innerHTML=document.getElementById("innerConainer1").innerHTML;
	
}
function closeDiv(divId)
{
   document.getElementById(divId).style.display="none";
}

function HelpMsg(MSG , e)
{
	if (typeof window.event != "undefined")
	{
	  xcoord=event.clientX;
	  ycoord=event.clientY;
	}
	else
	{
	   xcoord=e.pageX;
	   ycoord=e.pageY;
	}


	ycoord = 320;
	document.getElementById('msg').innerHTML=MSG;
	//alert(MSG);
	//alert(document.getElementById('msg').innerHTML);
	//alert(document.getElementById('MessageBox').innerHTML);
	document.getElementById("MessageBox").style.left=xcoord - 400+"px";
	document.getElementById("MessageBox").style.top=ycoord+20+"px";
	document.getElementById('MessageBox').style.display='block';
	//$('#msg').html(MSG);	
}


function openWindow(userID,propertyID,auctionID,e)
{		
//alert(userID);	alert(propertyID); alert(auctionID);
	
	if (typeof window.event != "undefined")
	{
	  xcoord=event.clientX;
	  ycoord=event.clientY;
	}
	else
	{
	  xcoord=e.pageX;
	  ycoord=e.pageY;
	}
	if(ycoord<250)
	ycoord=250;	
	
	if(userID=="")
	{
		userID = document.getElementById("LoggedInId").value;
	}
		
	if(!userID)
	{	
		document.getElementById("loginBoxVault").style.left=xcoord - 400+"px";
		document.getElementById("loginBoxVault").style.top=ycoord+"px";
		document.getElementById('loginBoxVault').style.display='block';
		if(document.getElementById('AuctionId_CC'))
		{
			document.getElementById('AuctionId_CC').value=auctionID;
		}

		if(document.getElementById('AuctionIDInf'))
		{
			document.getElementById('AuctionIDInf').value=auctionID;
		}
		if(document.getElementById('AuctionId_LL'))
		{
			document.getElementById('AuctionId_LL').value=auctionID;
		}
		//document.getElementById('AuctionId_CC').value=auctionID;
		//document.getElementById('AuctionId_LL').value=auctionID;

	}
	else
	{
		
		document.getElementById('loginBoxVault').style.display='none';
		var Authtype = document.getElementById("AType").value;
		showFolders();
		/*
		var str_to_send="";
		str_to_send="propertyID="+propertyID;
		str_to_send+="&auctionID="+auctionID;
		str_to_send+="&userID="+userID;
		str_to_send+="&Authtype="+Authtype;
		
		
		str_to_send+="&task=checkVaultStatus";
        
		var url="ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=VaultResponseFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);*/
	}
}

function VaultResponseFunction()
{
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var VaultResponse = xmlHttp2.responseText;
		var VaultResponse1 = VaultResponse.split('|');
       
		
		var Authtype = document.getElementById("AType").value;
		
		
		

		if( VaultResponse1[0] == 1 && VaultResponse1[3] == 1)
		{
			var AssetID=document.getElementById('propID').value;
			//alert(AssetID+'-4');
			var resForDocPop=getDocPop(AssetID);
         //window.open('https://REDC.onbaseonline.com/AppNet/docpop/docpop.aspx?KT104_0_0_0=10&clienttype=html&keytype=&chksum=c8685ce0a2227ec850c99b63d094a17e','mywindow','status=0,toolbar=0, menubar=0,resizable=0,height=500,width=450');
			//showFolders();
		}
		else
		{
			
			if(Authtype =='CC' && VaultResponse1[0] == 0)
			{
				document.getElementById("CreditCardDetailsDiv").style.left=xcoord - 400+"px";
				document.getElementById("CreditCardDetailsDiv").style.top=ycoord+"px";
				document.getElementById('CreditCardDetailsDiv').style.display='block';
				document.getElementById('UserID').value=VaultResponse1[1];
				document.creditcard.AuctionID_CC.value=VaultResponse1[2];
				AssignAddValues('CC');
			}
			else if(Authtype =='DL' && VaultResponse1[0] == 0)
			{
				document.getElementById("DrivingLicenceDiv").style.left=xcoord - 400+"px";
				document.getElementById("DrivingLicenceDiv").style.top=ycoord+"px";
				document.getElementById('DrivingLicenceDiv').style.display='block';
				document.getElementById('UserIDd').value=VaultResponse1[1];
				document.getElementById('AuctionIDd').value=VaultResponse1[2];
				AssignAddValues('DL');
			}
			else if(Authtype =='INFO' && VaultResponse1[0] == 0)
			{
				
				document.getElementById("InfoOnlyDiv").style.left=150+"px";
				document.getElementById("InfoOnlyDiv").style.top=ycoord+350+"px";
				document.getElementById('InfoOnlyDiv').style.display='block';
				
				document.getElementById('UserIDInf').value=VaultResponse1[1];
				document.getElementById('AuctionIDInf').value=VaultResponse1[2];
				//AssignAddValues('INFO');
			}
			else if ((Authtype =='INFO' || Authtype =='DL' || Authtype =='CC') && VaultResponse1[3] == 1)
			{
				var AssetID=document.getElementById('propID').value;
			//alert(AssetID+'-4');
			var resForDocPop=getDocPop(AssetID);
				//window.open('https://REDC.onbaseonline.com/AppNet/docpop/docpop.aspx?KT104_0_0_0=161616&clienttype=html&keytype=&chksum=c8685ce0a2227ec850c99b63d094a17e','mywindow','status=0,toolbar=0, menubar=0,resizable=0,height=500,width=450');
			}
			else
            {
			showFolders();
			
			}
		}
	}		
}
function register(authorizeType, Auctionid)
{
	document.getElementById('loginBoxVault').style.display='none';
	

	/*if(authorizeType!='INFO')
	{
		document.getElementById("registerationBox").style.left=150+"px";
		document.getElementById("registerationBox").style.top=350+"px";	
		document.getElementById('registerationBox').style.display='';

		document.getElementById('RauthType').value = authorizeType;
		document.getElementById('RAutionid').value = Auctionid;

		if(authorizeType=='CC')
		{
			document.getElementById('CC').style.display='';
		}	
		else
		{	
			document.getElementById('DL').style.display='';
		}
	}
	else
	{*/

		document.getElementById("registerationBoxINFO").style.left=150+"px";
		document.getElementById("registerationBoxINFO").style.top=350+"px";	
		document.getElementById('registerationBoxINFO').style.display='';

		document.getElementById('RInfauthType').value = authorizeType;
		document.getElementById('RInfAutionid').value = Auctionid;
	//}
}
function SetAuthTypeOnLoad(atype)
{
	document.getElementById('AType').value=atype;
}

function AssignValuesonLoad(Add,City,State,Zip,Cntry,Fname,Lname)
{
	document.getElementById('add_common').value=Add;
	document.getElementById('city_common').value=City;
	document.getElementById('state_common').value=State
	document.getElementById('zip_common').value=Zip;
	document.getElementById('country_common').value=Cntry;
	document.getElementById('firstname_common').value=Fname;
	document.getElementById('lastname_common').value=Lname;
}
function validateRegisterForm(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="";
	var authorizeType = document.getElementById('RauthType').value;

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

	if (myform.password.value==""){   
		visitor +=  "\n- Please enter password"; 
		document.getElementById('r_02').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_02').style.backgroundColor='';
	}
	
	if (myform.password.value!="")
	{
		if (myform.password.value.length<8){   
			visitor +=  "\n- Password must be at least 8 characters."; 
			document.getElementById('r_02').style.backgroundColor='#F9F3C1';
		}else{
			document.getElementById('r_02').style.backgroundColor='';
		}
	}
		
	if (myform.password.value != myform.confirmPassword.value){   
		visitor +=  "\n- Please confirm your password"; 
		document.getElementById('r_03').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_03').style.backgroundColor='';
	}

	if (myform.firstName.value==""){   
		visitor +=  "\n- Please enter first name"; 
		document.getElementById('r_04').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_04').style.backgroundColor='';
	}

	if (myform.lastName.value==""){   
		visitor +=  "\n- Please enter last name"; 
		document.getElementById('r_05').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_05').style.backgroundColor='';
	}


	var Phone_CC = myform.Phone1_CC.value+'-'+myform.Phone2_CC.value+'-'+myform.Phone3_CC.value;

	if(myform.Phone1_CC.value=='' && myform.Phone2_CC.value=='' && myform.Phone3_CC.value=='')
	{
		 visitor +="\n- Please enter valid phone number. For eg:- 123-456-7890";

		 document.getElementById('r_7CC_1').style.backgroundColor='#F9F3C1';
	}
	else if(myform.Phone1_CC.value!='' || myform.Phone2_CC.value!='' || myform.Phone3_CC.value!='')
	{

		if(!isPhone_new(Phone_CC))
		{    visitor +="\n- Please enter valid phone number. For eg:- 123-456-7890";
			document.getElementById('r_7CC_1').style.backgroundColor='#F9F3C1';
		}
	}
	else
	{
		document.getElementById('r_7CC_1').style.backgroundColor='';
	}
	///////////

	var mobile_CC=myform.mobile1_CC.value+'-'+myform.mobile2_CC.value+'-'+myform.mobile3_CC.value;

	if(myform.mobile1_CC.value!='' || myform.mobile2_CC.value!='' || myform.mobile3_CC.value!='')
	{
		if(!isPhone_new(mobile_CC))
		{  visitor +="\n- Please enter valid mobile number. For eg:- 123-456-7890";
		  document.getElementById('r_8CC_1').style.backgroundColor='#F9F3C1';
		}
		else
		{
		  document.getElementById('r_8CC_1').style.backgroundColor='';
		}
	}




	if (myform.name.value==0){   
		visitor +=  "\n- Please enter hint question"; 
		document.getElementById('r_06').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_06').style.backgroundColor='';
	}

	if (myform.hintAnswer.value==""){   
		visitor +=  "\n- Please enter hint answer"; 
		document.getElementById('r_07').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('r_07').style.backgroundColor='';
	}
	
	if(authorizeType=='CC')
	{
			if(myform.expmonth.disabled)
			{
			myform.expmonth.disabled=false;
			}
		
			if(myform.cctype1.disabled)
			{
			myform.cctype1.disabled=false;
			}
			if(myform.expyear.disabled)
			{
			myform.expyear.disabled=false;
			}

 			if(trim(myform.cctype1.value)=="")
			{	visitor +="- Please select card type.\n";
				document.getElementById('r_13').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_13').style.backgroundColor='';
			}  
			
			
			if(trim(myform.expmonth.value)=="" || trim(myform.expyear.value)=="")
			{	
				visitor +="- Please enter expiry date.\n";
				document.getElementById('r_15').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_15').style.backgroundColor='';
			}  
			
			if(trim(myform.ccnumber.value)=="")
			{	visitor +="- Please enter card number.\n";
				document.getElementById('r_14').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_14').style.backgroundColor='';
			}

			if(trim(myform.address.value)=="")
			{	visitor +="- Please enter Address.\n";
				document.getElementById('r_08').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_08').style.backgroundColor='';
			}


			if(trim(myform.city.value)=="")
			{	visitor +="- Please enter City.\n";
				document.getElementById('r_09').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_09').style.backgroundColor='';
			}

			
			
			if(document.getElementById('d_10_1').style.display!='none')
		    {
				if(document.registerForm.stateCombo_CC.value=="" || document.registerForm.stateCombo_CC.value=='0')
				{	
					visitor +="- Please enter State.\n";
					document.getElementById('d_10_1').style.backgroundColor='#F9F3C1';
				}else{
					document.getElementById('d_10_1').style.backgroundColor='';
				}
			}

				if(document.registerForm.countryid_CC.value=="" || document.registerForm.countryid_CC.value=='0')
				{	
					visitor +="- Please select country.\n";
					document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
				}else{
					document.getElementById('c_2123').style.backgroundColor='';
				}
			

			if(trim(myform.zip.value)=="")
			{	visitor +="- Please enter Zip.\n";
				document.getElementById('r_11').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_11').style.backgroundColor='';
			}
					
			n1 = trim(myform.ccnumber.value);
			lenn = n1.length;
			if(myform.ccnumber.value!='')
			{	
				if(lenn < 14 || lenn > 20 )
				{
				  visitor +="- Please enter valid card number.\n";
				  document.getElementById('r_14').style.backgroundColor='#F9F3C1';
				}else{
				document.getElementById('r_14').style.backgroundColor='';
				}
			} 
			
			if(trim(myform.cvvcode.value)=="")
			{
				visitor +="- Please enter cvv code. \n";
				document.getElementById('r_16').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_16').style.backgroundColor='';
			}

			if(isNaN(myform.cvvcode.value))
			{
				visitor +="- Please enter valid cvv code. \n";
				document.getElementById('r_16').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_16').style.backgroundColor='';
				
			}

			c1 = myform.cvvcode.value;
			lenC = c1.length;
			if(myform.cvvcode.value!='')
			{
				if(lenC < 3 || lenC > 4 )
				{
				 visitor +="- Please enter valid cvv code. \n";
				 document.getElementById('r_16').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_16').style.backgroundColor='';
				}
			}
	}
	else
	{
	
			if(myform.dladdress.value=="")
			{	visitor +="\n- Please enter Address.\n";
				document.getElementById('d_08').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('d_08').style.backgroundColor='';
			}


			if(myform.dlcity.value=="")
			{	visitor +="- Please enter City.\n";
				document.getElementById('d_09').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('d_09').style.backgroundColor='';
			}

			if(document.getElementById('d_10_2').style.display!='none')
			{
				if(myform.stateCombo_DL.value=="" || myform.stateCombo_DL.value=="0")
				{	
					visitor +="- Please enter State.\n";
					document.getElementById('d_10_2').style.backgroundColor='#F9F3C1';
				}else{
					document.getElementById('d_10_2').style.backgroundColor='';
				}
			}

			if(myform.dlzip.value=="")
			{	visitor +="- Please enter Zip.\n";
				document.getElementById('d_11').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('d_11').style.backgroundColor='';
			}

			if(myform.licenceno.value=="")
			{	visitor +="- Please enter licence number.";
				document.getElementById('d_12').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('d_12').style.backgroundColor='';
			}
	}

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


	if(flag==true)	{
		alert(MasterString);
		return false;
	}
	else
	{	
		var str_to_send="";
		var regform = document.registerForm;

		str_to_send="email="+regform.email.value;
		str_to_send+="&password="+regform.password.value;
		str_to_send+="&firstName="+regform.firstName.value;
		str_to_send+="&lastName="+regform.lastName.value;

		var phoneCC=regform.Phone1_CC.value+"-"+regform.Phone2_CC.value+"-"+regform.Phone3_CC.value;
		var mobileCC=regform.mobile1_CC.value+"-"+regform.mobile2_CC.value+"-"+regform.mobile3_CC.value;
	

		str_to_send+="&phoneCC="+phoneCC;
		str_to_send+="&mobileCC="+mobileCC;

		str_to_send+="&hintQues="+regform.name.value;
		str_to_send+="&hintAnswer="+regform.hintAnswer.value;	
		

if(authorizeType=='CC')
{
		str_to_send+="&address="+regform.address.value;
		str_to_send+="&city="+regform.city.value;
        str_to_send+="&country="+regform.countryid_CC.value;
		str_to_send+="&state="+regform.stateCombo_CC.value;
		
		str_to_send+="&zip="+regform.zip.value;
		str_to_send+="&cctype="+regform.cctype1.value;

		str_to_send+="&ccnumber="+regform.ccnumber.value;
		str_to_send+="&expmonth="+regform.expmonth.value;
		str_to_send+="&expyear="+regform.expyear.value;
		str_to_send+="&cvvcode="+regform.cvvcode.value;
		str_to_send+="&amount="+regform.amount.value;

}
else
{

		str_to_send+="&dladdress="+regform.dladdress.value;
		str_to_send+="&dlcity="+regform.dlcity.value;

		str_to_send+="&itemID="+document.getElementById('itemID').value;

		str_to_send+="&dlstate="+regform.stateCombo_DL.value;

		str_to_send+="&dlzip="+regform.dlzip.value;
		str_to_send+="&licenceno="+regform.licenceno.value;

}
		str_to_send+="&authType="+regform.RauthType.value;
		str_to_send+="&auctionId="+regform.RAutionid.value;

		str_to_send+="&task=submitRegisterationForm";

		
		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=submitRegisterationFormFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
	}
}

function submitRegisterationFormFunction()
{		
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var RegisterResponse = xmlHttp2.responseText;
		var Result = RegisterResponse.split("|");

		if( Result[0] == 'ERROR')
		{
			//document.getElementById('reg').style.display='';
			//document.getElementById('reg').innerHTML='ERROR:'+Result[1];
			alert(Result[1]);
		}
		else
		{
			//document.getElementById('c_009').style.display='none';
			//document.getElementById('c_01').style.display='none';//-- header(login.inc.php)

			//document.getElementById('c_0001').style.display='';		
			//document.getElementById("loggedInUserInfo1").innerHTML='';
			//document.getElementById("loggedInUserInfo1").innerHTML = Result[3];

			document.getElementById('registerationBox').style.display='none';			
			if(Result[1] != 'VERIFIED')
			{	
				alert(Result[1]);
			}
			else
			{
				showFolders();
				document.getElementById("LoggedInId").value = Result[2];
			}
		}	
	}
}

function validateRegisterFormINFO(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="";
	var authorizeType = document.getElementById('RInfauthType').value;

	if (!IsEmailAddress(myform.emailinfo.value,'')) {
		visitor +=  "\n- Please enter valid email address";
		document.getElementById('ri_01').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_01').style.backgroundColor='';
	}

	if (myform.passwordinfo.value==""){   
		visitor +=  "\n- Please enter password"; 
		document.getElementById('ri_02').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_02').style.backgroundColor='';
	}
	
	if (myform.passwordinfo.value!="")
	{
		if (myform.passwordinfo.value.length< 8){ 		
			visitor +=  "\n- Password must be at least 8 characters."; 
			document.getElementById('ri_02').style.backgroundColor='#F9F3C1';
		}else{
			document.getElementById('ri_02').style.backgroundColor='';
		}
	}
		
	if (myform.passwordinfo.value != myform.confirmPasswordinfo.value){   
		visitor +=  "\n- Please confirm your password"; 
		document.getElementById('ri_03').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_03').style.backgroundColor='';
	}

	if (myform.firstNameinfo.value==""){   
		visitor +=  "\n- Please enter first name"; 
		document.getElementById('ri_04').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_04').style.backgroundColor='';
	}

	if (myform.lastNameinfo.value==""){   
		visitor +=  "\n- Please enter last name"; 
		document.getElementById('ri_05').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_05').style.backgroundColor='';
	}

	if (myform.addressinfo.value==""){   
		visitor +=  "\n- Please enter address"; 
		document.getElementById('ri_06').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_06').style.backgroundColor='';
	}

	if (myform.countryid.value=="" || myform.countryid.value=="0"){   
		visitor +=  "\n- Please select country"; 
		document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('c_2123').style.backgroundColor='';
	}

	if (myform.cityinfo.value==""){   
		visitor +=  "\n- Please enter city name"; 
		document.getElementById('ri_08').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_08').style.backgroundColor='';
	}

	
	if(document.getElementById('d_10_3').style.display!='none')
	{
		if (document.registerFormInfo.stateCombo.value=="" || document.registerFormInfo.stateCombo.value=='0'){   
			visitor +=  "\n- Please enter state name"; 
			document.getElementById('d_10_3').style.backgroundColor='#F9F3C1';
		}else{
			document.getElementById('d_10_3').style.backgroundColor='';
		}
	}

	if (myform.zipinfo.value==""){   
		visitor +=  "\n- Please enter zipcode"; 
		document.getElementById('ri_10').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_10').style.backgroundColor='';
	}


	var Phone = myform.Phone1info.value+'-'+myform.Phone2info.value+'-'+myform.Phone3info.value;

	if(myform.Phone1info.value=='' && myform.Phone2info.value=='' && myform.Phone3info.value=='')
	{
		 visitor +="\n- Please enter valid phone number. For eg:- 123-456-7890";

		 document.getElementById('ri_9').style.backgroundColor='#F9F3C1';
	}
	else if(myform.Phone1info.value!='' || myform.Phone2info.value!='' || myform.Phone3info.value!='')
	{

		if(!isPhone_new(Phone))
		{   
			visitor +="\n- Please enter valid phone number. For eg:- 123-456-7890";
			document.getElementById('ri_9').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('ri_9').style.backgroundColor='';
		}

	}
	else
	{
		document.getElementById('ri_9').style.backgroundColor='';
	}
	///////////

	var mobile=myform.mobile1info.value+'-'+myform.mobile2info.value+'-'+myform.mobile3info.value;

	if(myform.mobile1info.value!='' || myform.mobile2info.value!='' || myform.mobile3info.value!='')
	{
		if(!isPhone_new(mobile))
		{  visitor +="\n- Please enter valid mobile number. For eg:- 123-456-7890";
		  document.getElementById('ri_9_1').style.backgroundColor='#F9F3C1';
		}
		else
		{
		  document.getElementById('ri_9_1').style.backgroundColor='';
		}
	}


	if (myform.name.value==0 || myform.name.value==''){   
		visitor +=  "\n- Please enter hint question"; 
		document.getElementById('ri_11').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_11').style.backgroundColor='';
	}

	if (myform.hintAnswerinfo.value==""){   
		visitor +=  "\n- Please enter hint answer"; 
		document.getElementById('ri_12').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_12').style.backgroundColor='';
	}

	/*
	if (myform.commPropinfo.value==""){   
		visitor +=  "\n- Please enter value for commercial properties"; 
		document.getElementById('ri_13').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_13').style.backgroundColor='';
	}

	if (myform.portfolio.value==""){   
		visitor +=  "\n- Please enter value for commercial real estate portfolio"; 
		document.getElementById('ri_14').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_14').style.backgroundColor='';
	}
*/
	/*if (myform.preferences1.checked==false && 
		myform.preferences2.checked==false && 
		myform.preferences3.checked==false && 
		myform.preferences4.checked==false &&
		myform.preferences5.checked==false &&
		myform.preferences6.checked==false && 
		myform.preferences7.checked==false && 
		myform.preferences8.checked==false && 
		myform.preferences9.checked==false
	)

	if(myform.preferences.value=="")
	{   
		visitor +=  "\n- Please enter value for property preferences"; 
		document.getElementById('ri_15').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_15').style.backgroundColor='';
	}

	if (myform.transaction.value==""){   
		visitor +=  "\n- Please enter value for transaction size"; 
		document.getElementById('ri_16').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_16').style.backgroundColor='';
	}


	if (myform.location1.checked==false &&
		myform.location2.checked==false && 
		myform.location3.checked==false && 
		myform.location4.checked==false &&
		myform.location5.checked==false &&
		myform.location6.checked==false &&
		myform.location7.checked==false
		
	)
	{   
		visitor +=  "\n- Please enter value for location preferences"; 
		document.getElementById('ri_17').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_17').style.backgroundColor='';
	}


	if (myform.preapproved.value==""){   
		visitor +=  "\n- Please enter value for preapproved by a lender"; 
		document.getElementById('ri_18').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_18').style.backgroundColor='';
	}

	if (myform.buying.value==""){   
		visitor +=  "\n- Please enter value for buying preferences"; 
		document.getElementById('ri_19').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri_19').style.backgroundColor='';
	}

	if(myform.purposeOfUse[0].checked==false && myform.purposeOfUse[1].checked==false)
	{
		visitor +=  "\n- Please select value for purpose of use.";
		document.getElementById('ri_20').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri_20').style.backgroundColor='';
	}


	if(myform.industry.value=='')
	{
		visitor +=  "\n- Please select value for industry.";
		document.getElementById('ri_21').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri_21').style.backgroundColor='';
	}

	if(myform.hearAbtUs.value=='')
	{
		visitor +=  "\n- Please select value for how did you hear about us?.";
		document.getElementById('ri_22').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri_22').style.backgroundColor='';
	}


	if(myform.occupanceReq.value=='')
	{
		visitor +=  "\n- Please select value for occupancy requirement.";
		document.getElementById('ri_23').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri_23').style.backgroundColor='';
	}

	*/


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

	if(flag==true)	{
		alert(MasterString);
		return false;
	}
	else
	{	
		
		
		var str_to_send="";
		var regforminfo = document.registerFormInfo;
		//var preferences='';
		//var locations='';

		str_to_send="email="+regforminfo.emailinfo.value;
		str_to_send+="&password="+regforminfo.passwordinfo.value;		
		str_to_send+="&titleinfo="+regforminfo.titleinfo.value;

	

		str_to_send+="&firstName="+regforminfo.firstNameinfo.value;
		str_to_send+="&lastName="+regforminfo.lastNameinfo.value;
		str_to_send+="&address="+regforminfo.addressinfo.value;
		str_to_send+="&companyName="+regforminfo.companyName.value;
		str_to_send+="&cntry="+regforminfo.countryid.value;
		str_to_send+="&city="+regforminfo.cityinfo.value;
		str_to_send+="&state="+regforminfo.stateCombo.value;
		str_to_send+="&zip="+regforminfo.zipinfo.value;



		var Phone = regforminfo.Phone1info.value+'-'+regforminfo.Phone2info.value+'-'+regforminfo.Phone3info.value;

		var mobile = regforminfo.mobile1info.value+'-'+regforminfo.mobile2info.value+'-'+regforminfo.mobile3info.value;


		str_to_send+="&phone="+Phone;
		str_to_send+="&mobile="+mobile;
		str_to_send+="&hintQues="+regforminfo.name.value;
		str_to_send+="&hintAnswer="+regforminfo.hintAnswerinfo.value;		
		
		/*
		str_to_send+="&commPropinfo="+regforminfo.commPropinfo.value;		
		str_to_send+="&portfolio="+regforminfo.portfolio.value;		
		
		/*if(regforminfo.preferences1.checked==true)
		{
			preferences+=regforminfo.preferences1.value;
		}

		if(regforminfo.preferences2.checked==true)
		{
			preferences+=','+regforminfo.preferences2.value;
		}
		if(regforminfo.preferences3.checked==true)
		{
			preferences+=','+regforminfo.preferences3.value;
		}
		if(regforminfo.preferences4.checked==true)
		{
			preferences+=','+regforminfo.preferences4.value;
		}
		if(regforminfo.preferences5.checked==true)
		{
			preferences+=','+regforminfo.preferences5.value;
		}
		if(regforminfo.preferences6.checked==true)
		{
			preferences+=','+regforminfo.preferences6.value;
		}
		if(regforminfo.preferences7.checked==true)
		{
			preferences+=','+regforminfo.preferences7.value;
		}
		if(regforminfo.preferences8.checked==true)
		{
			preferences+=','+regforminfo.preferences8.value;
		}
		else if(regforminfo.preferences9.checked==true)
		{
			preferences+=','+regforminfo.preferences9.value;
		}*
		
		str_to_send+="&preferences="+regforminfo.preferences.value;	


		if(regforminfo.location1.checked==true)
		{
			locations+=regforminfo.location1.value;
		}
		if(regforminfo.location2.checked==true)
		{
			locations+=','+regforminfo.location2.value;
		}
		if(regforminfo.location3.checked==true)
		{
			locations+=','+regforminfo.location3.value;
		}
		if(regforminfo.location4.checked==true)
		{
			locations+=','+regforminfo.location4.value;
		}
		if(regforminfo.location5.checked==true)
		{
			locations+=','+regforminfo.location5.value;
		}
		if(regforminfo.location6.checked==true)
		{
			locations+=','+regforminfo.location6.value;
		}
		if(regforminfo.location7.checked==true)
		{
			locations+=','+regforminfo.location7.value;
		}
	
		
		str_to_send+="&locations="+locations;	
		str_to_send+="&transaction="+regforminfo.transaction.value;		
		str_to_send+="&preapproved="+regforminfo.preapproved.value;		
		str_to_send+="&buying="+regforminfo.buying.value;


		if(regforminfo.purposeOfUse[0].checked==true)
		{
			var purpose='U';
		}
		else
		{
			var purpose='I';
		}
		
		str_to_send+="&purposeOfUse="+purpose;
		str_to_send+="&industry="+regforminfo.industry.value;
		str_to_send+="&hearAbtUs="+regforminfo.hearAbtUs.value;
		str_to_send+="&occupanceReq="+regforminfo.occupanceReq.value;
		*/


		//str_to_send+="&companyName="+regforminfo.companyName.value;



		str_to_send+="&authType="+regforminfo.RInfauthType.value;
		str_to_send+="&auctionId="+regforminfo.RInfAutionid.value;
		str_to_send+="&itemID="+document.getElementById('itemID').value;

//alert(str_to_send);
//return false;
		str_to_send+="&task=submitRegisterationFormINFO";

		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=submitRegisterationFormINFOFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
	}
}

function submitRegisterationFormINFOFunction()
{		
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var RegisterResponse = xmlHttp2.responseText;
		var Result = RegisterResponse.split("|");

		if( Result[0] == 'ERROR')
		{
			//document.getElementById('reginfo').style.display='';
			//document.getElementById('reginfo').innerHTML='ERROR:'+Result[1];
			alert(Result[1]);
		}
		else
		{
			//document.getElementById('c_009').style.display='none';
			//document.getElementById('c_01').style.display='none';//-- header(login.inc.php)

			//document.getElementById('c_0001').style.display='';		
			//document.getElementById("loggedInUserInfo1").innerHTML='';
			///document.getElementById("loggedInUserInfo1").innerHTML = Result[3]; 
			
			document.getElementById('registerationBoxINFO').style.display='none';
			
			document.getElementById('c_009').style.display='none';
			document.getElementById('c_01').style.display='none';//-- header(login.inc.php)

			document.getElementById('c_0001').style.display='';		
			document.getElementById("loggedInUserInfo1").innerHTML='';
			document.getElementById("loggedInUserInfo1").innerHTML = Result[3]; 			
			document.getElementById('registerationBoxINFO').style.display='none';			

			if(Result[1] != 'VERIFIED')
			{	
				alert(Result[1]);
			}
			else
			{
				showFolders();
				document.getElementById("LoggedInId").value = Result[2];
			}
		}	
	}
}

function validateInfoFormINFO(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="";
	//var authorizeType = document.getElementById('RInfauthType').value;
	
	if (myform.commPropinfo1.value==""){   
		visitor +=  "\n- Please enter value for commercial properties"; 
		document.getElementById('ri1_13').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_13').style.backgroundColor='';
	}

	if (myform.portfolio1.value==""){   
		visitor +=  "\n- Please enter value for commercial real estate portfolio"; 
		document.getElementById('ri1_14').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_14').style.backgroundColor='';
	}

	/*if (myform.preferences11.checked==false && 
		myform.preferences21.checked==false && 
		myform.preferences31.checked==false && 
		myform.preferences41.checked==false &&
		myform.preferences51.checked==false &&
		myform.preferences61.checked==false &&
		myform.preferences71.checked==false &&
		myform.preferences81.checked==false &&
		myform.preferences91.checked==false)*/

	if (myform.preferences1.value=="")
	{   
		visitor +=  "\n- Please enter value for property preferences"; 
		document.getElementById('ri1_15').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_15').style.backgroundColor='';
	}

	if (myform.transaction1.value==""){   
		visitor +=  "\n- Please enter value for transaction size"; 
		document.getElementById('ri1_16').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_16').style.backgroundColor='';
	}


	if (myform.location11.checked==false && 		
		myform.location21.checked==false && 
		myform.location31.checked==false &&
		myform.location41.checked==false &&
		myform.location51.checked==false &&
		myform.location61.checked==false &&
		myform.location71.checked==false 
	)
	{   
		visitor +=  "\n- Please enter value for location preferences"; 
		document.getElementById('ri1_17').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_17').style.backgroundColor='';
	}


	if (myform.preapproved1.value==""){   
		visitor +=  "\n- Please enter value for preapproved by a lender"; 
		document.getElementById('ri1_18').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_18').style.backgroundColor='';
	}

	if (myform.buying1.value==""){   
		visitor +=  "\n- Please enter value for buying preferences"; 
		document.getElementById('ri1_19').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('ri1_19').style.backgroundColor='';
	}


	if(myform.purposeOfUse1[0].checked==false && myform.purposeOfUse1[1].checked==false)
	{
		visitor +=  "\n- Please select value for purpose of use.";
		document.getElementById('ri1_20').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri1_20').style.backgroundColor='';
	}


	if(myform.industry1.value=='')
	{
		visitor +=  "\n- Please select value for industry.";
		document.getElementById('ri1_21').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri1_21').style.backgroundColor='';
	}

	if(myform.hearAbtUs1.value=='')
	{
		visitor +=  "\n- Please select value for how did you hear about us?.";
		document.getElementById('ri1_22').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri1_22').style.backgroundColor='';
	}


	if(myform.occupanceReq1.value=='')
	{
		visitor +=  "\n- Please select value for occupancy requirement.";
		document.getElementById('ri1_23').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ri1_23').style.backgroundColor='';
	}



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

	if(flag==true)	{
		alert(MasterString);
		return false;
	}
	else
	{	
		//document.getElementById('InfoOnlyDiv').style.display='none';
		var Infoform=document.infoOnlyForm;
		var preferences='';
		var locations='';

		str_to_send="UserID="+Infoform.UserIDInf.value;
		str_to_send+="&AuctionID="+Infoform.AuctionIDInf.value;	
		str_to_send+="&itemID="+document.getElementById('itemID').value;
		str_to_send+="&commPropinfo="+Infoform.commPropinfo1.value;
		str_to_send+="&portfolio="+Infoform.portfolio1.value;

		/*if(Infoform.preferences11.checked==true)
		{
			preferences+=Infoform.preferences11.value;
		}

		if(Infoform.preferences21.checked==true)
		{
			preferences+=','+Infoform.preferences21.value;
		}
		if(Infoform.preferences31.checked==true)
		{
			preferences+=','+Infoform.preferences31.value;
		}
		if(Infoform.preferences41.checked==true)
		{
			preferences+=','+Infoform.preferences41.value;
		}
		if(Infoform.preferences51.checked==true)
		{
			preferences+=','+Infoform.preferences51.value;
		}
		if(Infoform.preferences61.checked==true)
		{
			preferences+=','+Infoform.preferences61.value;
		}
		if(Infoform.preferences71.checked==true)
		{
			preferences+=','+Infoform.preferences71.value;
		}
		if(Infoform.preferences81.checked==true)
		{
			preferences+=','+Infoform.preferences81.value;
		}
		else if(Infoform.preferences91.checked==true)
		{
			preferences+=','+Infoform.preferences91.value;
		}*/
		
		str_to_send+="&preferences="+Infoform.preferences1.value;	


		if(Infoform.location11.checked==true)
		{
			locations+=Infoform.location11.value;
		}
		if(Infoform.location21.checked==true)
		{
			locations+=','+Infoform.location21.value;
		}
		if(Infoform.location31.checked==true)
		{
			locations+=','+Infoform.location31.value;
		}
		if(Infoform.location41.checked==true)
		{
			locations+=','+Infoform.location41.value;
		}
		if(Infoform.location51.checked==true)
		{
			locations+=','+Infoform.location51.value;
		}
		if(Infoform.location61.checked==true)
		{
			locations+=','+Infoform.location61.value;
		}
		if(Infoform.location71.checked==true)
		{
			locations+=','+Infoform.location71.value;
		}
	
		
		str_to_send+="&locations="+locations;			
        str_to_send+="&transaction="+Infoform.transaction1.value;
		str_to_send+="&preapproved="+Infoform.preapproved1.value;
		str_to_send+="&buying="+Infoform.buying1.value;

		if(Infoform.purposeOfUse1[0].checked==true)
		{
			var purpose='U';
		}
		else
		{
			var purpose='I';
		}
		
		str_to_send+="&purposeOfUse="+purpose;


		str_to_send+="&industry="+Infoform.industry1.value;
		str_to_send+="&hearAbtUs="+Infoform.hearAbtUs1.value;
		str_to_send+="&occupanceReq="+Infoform.occupanceReq1.value;
		str_to_send+="&companyName="+Infoform.companyName1.value;


		str_to_send+="&task=submitInfoOnlyInfo";


		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=submitInfoOnlyFormFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
	}
}

function submitInfoOnlyFormFunction()
{
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var VaultResponse = xmlHttp2.responseText;
        var VaultResponse1 = VaultResponse.split('|');
	
		
		document.getElementById('InfoOnlyDiv').style.display='none';
		
		if( VaultResponse1[0] == 'VERIFIED' && VaultResponse1[1]=='1')
		{
			var AssetID=document.getElementById('propID').value;
			//alert(AssetID+'-4');
			var resForDocPop=getDocPop(AssetID);
			//window.open('https://REDC.onbaseonline.com/AppNet/docpop/docpop.aspx?KT104_0_0_0=161616&clienttype=html&keytype=&chksum=c8685ce0a2227ec850c99b63d094a17e','mywindow','status=0,toolbar=0, menubar=0,resizable=0,height=500,width=450');
			
		}
         else if( VaultResponse1[0] == 'VERIFIED' && VaultResponse1[1]=='0')
		{
			
			showFolders();
		}
		else
		{
			alert(VaultResponse);
		}
	}	
}

function AssignAddValues(authType)
{
    var ADD	= document.getElementById('add_common').value;
	var CITY = document.getElementById('city_common').value;
	var STATE = document.getElementById('state_common').value;
	var ZIP = document.getElementById('zip_common').value;
	var COUNTRY = document.getElementById('country_common').value;
	var FNAME = document.getElementById('firstname_common').value;
	var LNAME = document.getElementById('lastname_common').value;

	//alert(STATE);
	if(authType=='CC')
	{
		document.getElementById('ccfname').value=FNAME;
		document.getElementById('cclname').value=LNAME;
		document.getElementById('address').value=ADD;
		document.getElementById('city').value=CITY;
		document.getElementById('stateCombo_CC').value=STATE;
		//alert(document.getElementById('stateCombo_CC').value);
		document.getElementById('zip').value=ZIP;
	}
	else
	{
		document.getElementById('dladdress').value=ADD;
		document.getElementById('dlcity').value=CITY;
		document.getElementById('dlstate').value=STATE;
		document.getElementById('dlzip').value=ZIP;
		document.getElementById('dlcountry').value=COUNTRY;
	}
}

function checkAllPref()
{
	if(document.getElementById('preferences1').checked==true)
	{
		document.getElementById('preferences2').checked=true;
		document.getElementById('preferences3').checked=true;
		document.getElementById('preferences4').checked=true;
		document.getElementById('preferences5').checked=true;
		document.getElementById('preferences6').checked=true;
		document.getElementById('preferences7').checked=true;
		document.getElementById('preferences8').checked=true;
		document.getElementById('preferences9').checked=true;
	}
	else
	{
		document.getElementById('preferences2').checked=false;
		document.getElementById('preferences3').checked=false;
		document.getElementById('preferences4').checked=false;
		document.getElementById('preferences5').checked=false;
		document.getElementById('preferences6').checked=false;
		document.getElementById('preferences7').checked=false;
		document.getElementById('preferences8').checked=false;
		document.getElementById('preferences9').checked=false;
	}
}

function checkAllLoc()
{
	
	if(document.getElementById('location1').checked==true)
	{
		
		document.getElementById('location2').checked=true;
		document.getElementById('location3').checked=true;
		document.getElementById('location4').checked=true;
		document.getElementById('location5').checked=true;
		document.getElementById('location6').checked=true;
		document.getElementById('location7').checked=true;
		
	}
	else
	{
		document.getElementById('location2').checked=false;
		document.getElementById('location3').checked=false;
		document.getElementById('location4').checked=false;
		document.getElementById('location5').checked=false;
		document.getElementById('location6').checked=false;
		document.getElementById('location7').checked=false;
		
	}
}

function checkAllPref1()
{
	
	if(document.getElementById('preferences11').checked==true)
	{
		document.getElementById('preferences21').checked=true;
		document.getElementById('preferences31').checked=true;
		document.getElementById('preferences41').checked=true;
		document.getElementById('preferences51').checked=true;
		document.getElementById('preferences61').checked=true;
		document.getElementById('preferences71').checked=true;
		document.getElementById('preferences81').checked=true;
		document.getElementById('preferences91').checked=true;
	}
	else
	{
		document.getElementById('preferences21').checked=false;
		document.getElementById('preferences31').checked=false;
		document.getElementById('preferences41').checked=false;
		document.getElementById('preferences51').checked=false;
		document.getElementById('preferences61').checked=false;
		document.getElementById('preferences71').checked=false;
		document.getElementById('preferences81').checked=false;
		document.getElementById('preferences91').checked=false;
	}
}

function checkAllLoc1()
{
	if(document.getElementById('location11').checked==true)
	{
		document.getElementById('location21').checked=true;
		document.getElementById('location31').checked=true;
		document.getElementById('location41').checked=true;
		document.getElementById('location51').checked=true;
		document.getElementById('location61').checked=true;
		document.getElementById('location71').checked=true;
	}
	else
	{
		document.getElementById('location21').checked=false;
		document.getElementById('location31').checked=false;
		document.getElementById('location41').checked=false;
		document.getElementById('location51').checked=false;
		document.getElementById('location61').checked=false;
		document.getElementById('location71').checked=false;
	}
}

function validateLoginFormVault(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 your email";
		document.getElementById('c_011').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('c_011').style.backgroundColor='';
	}

	if (myform.password.value==""){   
		visitor +=  "\n- Please enter your 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;
	}
	else
	{

		var emailId		= myform.email.value;
		var pwd			= myform.password.value;
		var auctionid	= myform.AuctionId_LL.value;
		var remember ="";

		if(myform.remember.checked==true)
		{
			remember ='Y'
		}
        var AuthType = document.getElementById("AType").value;
		var str_to_send ="EMAILID="+emailId;
		str_to_send+="&PWD="+pwd;
		str_to_send+="&REMEMBER="+remember;
		str_to_send+="&AUCTIONID="+auctionid;
		str_to_send+="&AuthType="+AuthType;
		str_to_send+="&task=checkLoginDetails";

		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=checkLoginDetailFunctionVault;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
	}
}

function checkLoginDetailFunctionVault()
{
	
	//alert(xmlHttp2.responseText);

	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var LoginResponse = xmlHttp2.responseText;
		var Result = LoginResponse.split("|");
		
		//alert(LoginResponse);


        var AuthType = document.getElementById("AType").value;
		if( Result[0] == 'ERROR')
		{ 
			
			alert(Result[1]);
		}
		else
		{
			document.getElementById('loginBoxVault').style.display='none';			
			document.getElementById('c_009').style.display='none';
			document.getElementById('c_01').style.display='none';//-- header(login.inc.php)

			document.getElementById('c_0001').style.display='';		
			document.getElementById("loggedInUserInfo1").innerHTML='';
			document.getElementById("loggedInUserInfo1").innerHTML = Result[6]; 

			//document.getElementById("signupcontainer").style.display ='none';
			document.getElementById("LoggedInId").value = Result[2];
            
			if(Result[1] == '1' && Result[5] == '0')
			{
				
				showFolders();
			}
			else
			{
				
				showFolders();
			/*	
				GetAddressValues(Result[4]);
				
				AssignAddValues(document.getElementById("AType").value);


				if(AuthType =='CC' && Result[1] == '0')
				{
					document.getElementById("CreditCardDetailsDiv").style.left=xcoord - 400+"px";
					document.getElementById("CreditCardDetailsDiv").style.top=ycoord+"px";
					document.getElementById('CreditCardDetailsDiv').style.display='block';

					document.getElementById('UserID').value=Result[2];
					document.getElementById('AuctionID_CC').value=Result[3];
			   }
			   else if(AuthType =='DL' && Result[1] == '0')
			   {
				    document.getElementById("DrivingLicenceDiv").style.left=xcoord - 400+"px";
					document.getElementById("DrivingLicenceDiv").style.top=ycoord+"px";
					document.getElementById('DrivingLicenceDiv').style.display='block';
			
					document.getElementById('UserIDd').value=Result[2];
					document.getElementById('AuctionIDd').value=Result[3];
			   }
			  else if(AuthType =='INFO' && Result[1] == '0')
			  {
				
				document.getElementById("InfoOnlyDiv").style.left=xcoord - 600+"px";
				document.getElementById("InfoOnlyDiv").style.top=ycoord+"px";
				document.getElementById('InfoOnlyDiv').style.display='block';
				
				document.getElementById('UserIDInf').value=Result[2];
				document.getElementById('AuctionIDInf').value=Result[3];
				
			  }
			
			  else if ((AuthType =='INFO' || AuthType =='DL' || AuthType =='CC') && Result[5] == 1)
			  {
				var AssetID=document.getElementById('propID').value;
			//alert(AssetID+'-4');
			var resForDocPop=getDocPop(AssetID);  
				//window.open('https://REDC.onbaseonline.com/AppNet/docpop/docpop.aspx?KT104_0_0_0=161616&clienttype=html&keytype=&chksum=c8685ce0a2227ec850c99b63d094a17e','mywindow','status=0,toolbar=0, menubar=0,resizable=0,height=500,width=450');
			  }
			  else
              {
			 showFolders();
			
			  }
			*/
			}
		}
	}
}
/*
function showFolders()
	{
	
	
	document.getElementById("NDPDiv").style.left=150+"px";
	document.getElementById("NDPDiv").style.top=ycoord+"px";
	document.getElementById('NDPDiv').style.display='block';
	}

function showFoldersNew(request,auctionID,userID,itemID)
{
	 if(userID=="")
      {
	   userID = document.getElementById("LoggedInId").value;
	  }
	    document.getElementById('NDPDiv').style.display='none';
    
	    var str_to_send="";
		str_to_send="Request="+request;
		str_to_send+="&auctionID="+auctionID;
		str_to_send+="&userID="+userID;
		str_to_send+="&itemID="+itemID;
		str_to_send+="&task=updateacceptordeny";

		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		
		xmlHttp2.onreadystatechange=UpdateAcceptFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		
		xmlHttp2.send(str_to_send);
}

function UpdateAcceptFunction()
{
if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var UpdateResponse = xmlHttp2.responseText;
		
	
		if( UpdateResponse == '1')
		{
			
			var AssetID=document.getElementById('propID').value;
			//alert(AssetID+'-3');
			var resForDocPop=getDocPop(AssetID);


			//window.open('https://onbase.landstaff.com/onbase/DocPopURL_Service.asmx','mywindow','status=0,toolbar=0, menubar=0,resizable=0,height=500,width=450');
		}
    }
}
*/
function validateDrivingForm(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(trim(myform.dladdress.value)=="")
	{	visitor +="\n- Please enter Address.\n";
		document.getElementById('d_08').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('d_08').style.backgroundColor='';
	}
    
	if(trim(myform.dlcity.value)=="")
	{	visitor +="- Please enter City.\n";
		document.getElementById('d_09').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('d_09').style.backgroundColor='';
	}

	if(document.getElementById('d_10').style.display!='none')
	{
		if(trim(myform.dlstate.value)=="")
		{	
			visitor +="- Please enter State.\n";
			document.getElementById('d_10').style.backgroundColor='#F9F3C1';
		}else{
			document.getElementById('d_10').style.backgroundColor='';
		}
	}

	if(trim(myform.dlzip.value)=="")
	{	visitor +="- Please enter Zip.\n";
		document.getElementById('d_11').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('d_11').style.backgroundColor='';
	}

	if(trim(myform.licenceno.value)=="")
	{	visitor +="- Please enter licence number.";
		document.getElementById('d_12').style.backgroundColor='#F9F3C1';
	}else{
		document.getElementById('d_12').style.backgroundColor='';
	}

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

	if(flag==true)	{
		alert(MasterString);
		return false;
	}
	else
	{
		var drivingform=document.drivingForm;

		str_to_send="UserID="+drivingform.UserIDd.value;
		str_to_send+="&AuctionID="+drivingform.AuctionIDd.value;	
		str_to_send+="&dladdress="+drivingform.dladdress.value;
		str_to_send+="&dlcity="+drivingform.dlcity.value;
		str_to_send+="&dlstate="+drivingform.dlstate.value;
		str_to_send+="&dlzip="+drivingform.dlzip.value;
		str_to_send+="&licenceno="+drivingform.licenceno.value;
		str_to_send+="&dlcountry="+drivingform.dlcountry.value;
		str_to_send+="&itemID="+document.getElementById('itemID').value;

		str_to_send+="&task=submitDrivingLinceInfo";

		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=submitDrivingLinceFormFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
	}
}

function submitDrivingLinceFormFunction()
{
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var VaultResponse = xmlHttp2.responseText;
		if( VaultResponse == 'VERIFIED')
		{
			document.getElementById('DrivingLicenceDiv').style.display='none';
			showFolders();
		}
		else
		{
			document.getElementById('DrivingLicenceDiv').style.display='none';
			alert(VaultResponse);
		}
	}	
}

function validateCreditCard(frm) 
{
	var errorstr = '';
 	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
		
	if(frm.expmonth.disabled)
	{
		frm.expmonth.disabled=false;
	}

	if(frm.cctype.disabled)
	{
		frm.cctype.disabled=false;
	}
	if(frm.expyear.disabled)
	{
		frm.expyear.disabled=false;
	}
	
	if(trim(frm.cctype.value)=="")
	{	
		errorstr +="- Please select card type.\n";
	}
	if(trim(frm.ccfname.value)=="")
	{	
		errorstr +="- Please enter card holder first name.\n";
	}
	if(trim(frm.cclname.value)=="")
	{	
		errorstr +="- Please enter card holder last name.\n";
	}
	if(trim(frm.expmonth.value)=="" || trim(frm.expyear.value)=="")
	{	
		errorstr +="- Please enter expiry date.\n";
	}
	if(trim(frm.ccnumber.value)=="")
	{	
		errorstr +="- Please enter card number.\n";
	}
	if(trim(frm.address.value)=="")
	{	
		errorstr +="- Please enter Address.\n";
	}
	if(trim(frm.city.value)=="")
	{	
		errorstr +="- Please enter City.\n";
	}

	if(document.getElementById('CC123').style.display!='none')
	{
		if(trim(frm.stateCombo_CC.value)=="" || frm.stateCombo_CC.value=='0')
		{	
			errorstr +="- Please select state.\n";
		}
	}

	if(trim(frm.countryid_CC.value)=="" || frm.countryid_CC.value=='0')
	{	
			errorstr +="- Please select country.\n";
	}

	if(trim(frm.zip.value)=="")
	{	
		errorstr +="- Please enter Zip.\n";
	}
			
	n1 = trim(frm.ccnumber.value);
	lenn = n1.length;
	if(frm.ccnumber.value!='')
	{	
		if(lenn < 14 || lenn > 20 )
		{
		  errorstr +="- Please enter valid card number.\n";
		}
	} 
	
	if(trim(frm.cvvcode.value)=="")
	{
		errorstr +="- Please enter cvv code. \n";
	}
	if(isNaN(frm.cvvcode.value))
	{
		errorstr +="- Please enter valid cvv code. \n";
	}
	c1 = frm.cvvcode.value;
	lenC = c1.length;
	if(frm.cvvcode.value!='')
	{
		if(lenC < 3 || lenC > 4 )
		{
		 errorstr +="- Please enter valid cvv code. \n";
		}
	}
 	if (errorstr != '') 
	{	msgstr = msgstr + errorstr;
  		alert(msgstr);
  		return false;
 	}
 	else 
	{	
		var str_to_send="";		
		var cc = document.creditcard;

		str_to_send="UserID="+cc.UserID.value;
		str_to_send+="&AuctionID="+cc.AuctionID_CC.value;
		
		str_to_send+="&amount="+cc.amount.value;
		str_to_send+="&ccnumber="+cc.ccnumber.value;
		str_to_send+="&expmonth="+cc.expmonth.value;
		str_to_send+="&expyear="+cc.expyear.value;
		str_to_send+="&cvvcode="+cc.cvvcode.value;
		str_to_send+="&cctype="+cc.cctype.value;
		str_to_send+="&ccfname="+cc.ccfname.value;
		str_to_send+="&cclname="+cc.cclname.value;
		str_to_send+="&address="+cc.address.value;
		str_to_send+="&city="+cc.city.value;
		str_to_send+="&state="+cc.stateCombo_CC.value;
		str_to_send+="&country="+cc.countryid_CC.value;
		str_to_send+="&zip="+cc.zip.value;

		str_to_send+="&itemID="+document.getElementById('itemID').value;

		str_to_send+="&task=submitCreditCardInfo";

		var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
		xmlHttp2=getobject_common2();
		xmlHttp2.onreadystatechange=submitCreditCardInfoFunction;
		xmlHttp2.open("POST",url,true);
		xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp2.send(str_to_send);
 	} 	
}

function submitCreditCardInfoFunction()
{
	if(xmlHttp2.readyState==4 ||  xmlHttp2.readyState=="complete")
	{
		var VaultResponse = xmlHttp2.responseText;
		if( VaultResponse == 'VERIFIED')
		{
			document.getElementById('CreditCardDetailsDiv').style.display='none';
			showFolders();
		}
		else
		{
			document.getElementById('CreditCardDetailsDiv').style.display='none';
			VaultResponse = VaultResponse.split('|~|~|~|~1');
			alert(VaultResponse);
		}
	}	
}

function GetAddressValues(addvalues)
{
	var addDet = addvalues.split('~');
	document.getElementById('add_common').value=addDet[0];
	document.getElementById('city_common').value=addDet[1];
	document.getElementById('state_common').value=addDet[2];
	document.getElementById('zip_common').value=addDet[3];
	document.getElementById('country_common').value=addDet[4];
	document.getElementById('firstname_common').value=addDet[5];
	document.getElementById('lastname_common').value=addDet[6];
}

function getDocPop(AssetID)
{
	str_to_send="AssetID="+AssetID;
	str_to_send+="&task=docPopUrl";

	var url=SITE_PATH+"ajaxOnlineCommercialFile.php";
	xmlHttp2=getobject_common2();
	xmlHttp2.onreadystatechange=docPopResultFunction;
	xmlHttp2.open("POST",url,true);
	xmlHttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp2.send(str_to_send);
}

function docPopResultFunction()
{

	var VaultResponse = xmlHttp2.responseText;
	window.open(VaultResponse,'mywindow','status=0,toolbar=0, menubar=0,resizable=1,height=500,width=750');
}
function closeRegBoxes(divId)
{
	document.getElementById(divId).style.display="none";
}
function HelpMsgPropOnlineComm(MSG , e)
{
		
	if (typeof window.event != "undefined")
	{
	  xcoord=event.clientX;
	  ycoord=event.clientY;
	}
	else
	{
	   xcoord=e.pageX;
	   ycoord=e.pageY;
	}

//alert(ycoord);
	ycoord = 520;
	document.getElementById('msg').innerHTML=MSG;
	//alert(MSG);
	//alert(document.getElementById('msg').innerHTML);
	//alert(document.getElementById('MessageBox').innerHTML);
	document.getElementById("MessageBox").style.left=370+"px";
	document.getElementById("MessageBox").style.top=ycoord+20+"px";
	document.getElementById('MessageBox').style.display='block';
	//$('#msg').html(MSG);	
}

var auctID='';
var UID='';
var auctNum='';
function openSealBid(userID,auctionID){
	
		var sealPass=document.getElementById('sealBidPass').value;
		auctNum=document.getElementById("auctionID").value;
		var item=document.getElementById("itemnum").value;
		UID=userID;
		auctID=auctionID;		
		var strSubmit = "action=validateSealPass&auctionID="+auctNum+"&sealPass="+sealPass+"&itemID="+item;		
		var strURL =SITE_PATH+"getAjax.php";
		var strResultFunc = "sealBidResult";
		xmlhttpPost(strURL, strSubmit, strResultFunc);
		return false;
	}

	function sealBidResult(result){
		if(result!=0){
			document.getElementById('invalidPwd').innerHTML='';		
			if(auctID!='')
				validateSealBid(auctID,UID);
			else{
				if(auctNum=='N-003'){
					document.location.href="auction_details_notes_online.php"+result+"&authSealBid=MTY5NDA=";			
				}else{
					document.location.href="sealBid/auction_details_online_commercial.php"+result;			
				}
			}
		}else{
			document.getElementById('invalidPwd').innerHTML='Invalid Password';	
			
		}
		return false;
		
	}
