var isNav, isIE;
//Browser checking
if(parseInt(navigator.appVersion)>=4)
{
	if(navigator.appName=="Netscape") {
      isNav=true;
   	}
   else {
      isIE=true;
	}
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
function isCheckedRadio(radioObj) { 
	var radioLength = radioObj.length;
	var flg=false;
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			flg=true;
			break;
		}
	}
	return flg;
}


function checkDisplay(show)
{
	//alert(show);
	if (isNav) {
		style = "table-row";
		style1 = "table";
	}
	else {
		style = "inline";
		style1 = "inline";
	}

	if(show!='1')
	{
		document.getElementById("spouseTable").style.display = style1;
		if(show=='2'){
		//
		if(document.getElementById('auctionCombo').value!='')
		{
		if(document.getElementById("ssnStatus").value=='1')
		{
		//
		document.getElementById("s00").style.display = style1;
		document.getElementById("c00").style.display = 'none';
		}
		}
		}
		if(show=='3')
		{
		if(document.getElementById('auctionCombo').value!='')
		{
		if(document.getElementById("ssnStatus").value=='1')
		{
		document.getElementById("s00").style.display = 'none';
		document.getElementById("c00").style.display = style1;
		}
		}
		 }
	}
	else
	{
		document.getElementById("spouseTable").style.display = 'none';
		document.getElementById("s00").style.display = 'none';
		document.getElementById("c00").style.display = 'none';
	}
}

function validate(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 check=1;
	var validationBg=myform.validationBg.value;
	//var iChars = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	//if(myform.myform.primaryPurchaserFirstName.value)

	
	//if (!IsValid(myform.primaryPurchaserFirstName.value,'')) {
	if(myform.primaryPurchaserFirstName.value==""){   
		visitor +=  "\n- Please enter primary purcharser first name."; 
		document.getElementById('r_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_1').style.backgroundColor='';
	}
	
	if(myform.primaryPurchaserLastName.value==""){   
		visitor +=  "\n- Please enter primary purcharser last name."; 
		document.getElementById('r_2').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	if(myform.primaryPurchaserAddress.value==""){   
		visitor +=  "\n- Please enter primary purchaser address.";
		document.getElementById('r_3').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserCity.value==""){
		visitor +=  "\n- Please enter primary purchaser city."; 
		document.getElementById('r_4').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserState.value==""){
		visitor +=  "\n- Please select primary purchaser state."; 
		document.getElementById('r_5').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_5').style.backgroundColor='';		
	}
	
	if(myform.primaryPurchaserZip.value=="" || myform.primaryPurchaserZip.value.length < 5){
		visitor +=  "\n- Please enter primary purcharser zip. ( Minimum 5 digit zip / postal code).";
		document.getElementById('r_6').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_6').style.backgroundColor='';		
	}
	
	var primaryPurchaserCell = myform.primaryPurchaserCell1.value+'-'+myform.primaryPurchaserCell2.value+'-'+myform.primaryPurchaserCell3.value;

	if(!isPhone_new(primaryPurchaserCell))
	{   
		visitor +=  "\n- Please enter valid primary purchaser cell phone. For eg:- 123-456-7890 ";
		document.getElementById('r_8').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_8').style.backgroundColor='';		
	}
	
	
	var primaryPurchaserWork=myform.primaryPurchaserWork1.value+'-'+myform.primaryPurchaserWork2.value+'-'+myform.primaryPurchaserWork3.value;
	if(myform.primaryPurchaserWork1.value!='' || myform.primaryPurchaserWork2.value!='' || myform.primaryPurchaserWork3.value!='')
	{
		if(!isPhone_new(primaryPurchaserWork))
		{  visitor +="\n- Please enter valid  primary purchaser work phone. For eg:- 123-456-7890"; 
		  document.getElementById('r_7').style.backgroundColor=validationBg;	
		}
		else
		{
		  document.getElementById('r_7').style.backgroundColor='';		
		}
	
	}
	
	
	//if(myform.primaryPurchaserEmail.value!='')
	//{
		if (!IsEmailAddress(myform.primaryPurchaserEmail.value,'')) 
		{
			visitor +=  '\n- Please enter primary purchaser email address';
			document.getElementById('r_9').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_9').style.backgroundColor='';		
		}

	//}

	if(myform.auctionCombo.value==""){   
		visitor +=  "\n- Please select auction";
		document.getElementById('r_9_2').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_9_2').style.backgroundColor='';		
	}	

	if(myform.auctionCombo.value!="")
	{
	var flagcheck=false; 
	if(myform.registrationStatus.value=='1')
	{
		for (var i = 0; i < myform.elements.length; i++)
		{
			var e = myform.elements[i];
			if(e.type=="checkbox" && e.name == "User_ids[]")
			{
				if(e.checked)
				{
					flagcheck=true;
					break;
					
				}
				
			}
		}	
	}

	if(!flagcheck)
	{

		visitor +=  "\n- Please choose the venue you like to attend."; 
		document.getElementById('r_9_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_9_1').style.backgroundColor='';	
	}
	}

	
	
	if(myform.spouseOrCobuyer.value!=1)
	{
		if(myform.spouseFirstName.value==""){   
			visitor +=  "\n- Please enter spouse first name."; 
			document.getElementById('r_11').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11').style.backgroundColor='';		
		}
		
		if(myform.spouseLastName.value==""){   
			visitor +=  "\n- Please enter spouse last name."; 
			document.getElementById('r_12').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_12').style.backgroundColor='';		
		}
		
		if(myform.spouseAddress.value==""){  
			visitor +=  "\n- Please enter spouse address."; 
			document.getElementById('r_13').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_13').style.backgroundColor='';		
		}
		
		if(myform.spouseCity.value==""){   
			visitor +=  "\n- Please enter spouse city."; 
			document.getElementById('r_14').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_14').style.backgroundColor='';		
		}
		
		if(myform.spouseState.value==""){   
			visitor +=  "\n- Please select spouse state.";
			document.getElementById('r_15').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_15').style.backgroundColor='';		
		}
	
		if(myform.spouseZip.value=="" || myform.spouseZip.value.length < 5){
			visitor +=  "\n- Please enter spouse zip. (Minimum 5 digit zip / postal code)"; 
			document.getElementById('r_16').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_16').style.backgroundColor='';		
		}
		
		
		var spouseCell=myform.spouseCell1.value+'-'+myform.spouseCell2.value+'-'+myform.spouseCell3.value;		
		
		if(!isPhone_new(spouseCell)){   
			visitor +=  "\n- Please enter valid spouse cell. For eg:- 123-456-7890";
			document.getElementById('r_18').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_18').style.backgroundColor='';		
		}
			
		var spouseWork=myform.spouseWork1.value+'-'+myform.spouseWork2.value+'-'+myform.spouseWork3.value;
		if(myform.spouseWork1.value!='' || myform.spouseWork2.value!='' || myform.spouseWork3.value!='') 
		{
			if(!isPhone_new(spouseWork))
			{   visitor +=  "\n- Please enter valid spouse work phone. For eg:- 123-456-7890"; 
				document.getElementById('r_17').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('r_17').style.backgroundColor='';		
			}
			
		}
		
	}
	
	/*
	 if(myform.spouseEmail.value!='')
	{
		if (!IsEmailAddress(myform.spouseEmail.value,"")) 
		{
			visitor += '\n- Please enter spouse email address';
			document.getElementById('r_19').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_19').style.backgroundColor='';		
		}
		
	}
	*/

if(flagcheck){
	  if(myform.communityStatus.value==1){
		var communitycheck=false; 
	
		for (var i = 0; i < myform.elements.length; i++)
		{
			var comm = myform.elements[i];
			if(comm.type=="checkbox" && comm.name == "chkCommunity[]")
			{
				if(comm.checked)
				{
					communitycheck=true;
					break;
					
				}
				
			}
		}	
	

	if(!communitycheck)
	{

		visitor +=  "\n- Please choose the community"; 
		document.getElementById('r_9_1_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_9_1_1').style.backgroundColor='';	
	}
 }
}

	if(!isCheckedRadio(myform.financing)){  
		visitor +=  "\n- Please Check We plan to use financing."; 
			document.getElementById('r_new0').style.backgroundColor=validationBg;	
	}
	else
	{  document.getElementById('r_new0').style.backgroundColor='';
		if(getCheckedValue(myform.financing)==1 ){
			document.getElementById('r_new2').style.backgroundColor='';	
			document.getElementById('r_new3').style.backgroundColor='';	
		}
		if(getCheckedValue(myform.financing)==2 && myform.lenderContactName.value=="")
		{
			visitor +=  "\n- Please Enter lender contact Name."; 
			document.getElementById('r_new2').style.backgroundColor=validationBg;	
		}
		else{document.getElementById('r_new2').style.backgroundColor='';}
		
		if(getCheckedValue(myform.financing)==2 && (myform.lenderContactPhone1.value=='' || myform.lenderContactPhone2.value=='' || myform.lenderContactPhone3.value==''))
		{
			visitor +=  "\n- Please complete lender contact no."; 
			document.getElementById('r_new3').style.backgroundColor=validationBg;	
		}
		else if(getCheckedValue(myform.financing)==3){
			/*var lenderContactPhone=myform.lenderContactPhone1.value+'-'+myform.lenderContactPhone2.value+'-'+myform.lenderContactPhone3.value;
			if(!isPhone_new(lenderContactPhone)){  
			visitor +="\n- Please enter valid  lender contact phone. For eg:- 123-456-7890"; 
		  	document.getElementById('r_new3').style.backgroundColor=validationBg;	
			}else{ document.getElementById('r_new3').style.backgroundColor='';	}
			*/
		}
	}// end if radio financing is checked


	if(getCheckedValue(myform.qualified)==''){   
		visitor +=  "\n- Please select if would like to be pre-qualified."; 
		document.getElementById('r_31').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_31').style.backgroundColor='';		
	}	

	/////////////bidder registration prequalified BOC ///////////////
	if(getCheckedValue(myform.qualified)=="yes")
	{
	
	/*if(myform.totalPurchases.value==""){
		visitor +=  "\n- Please select a purchase option."; 
    	document.getElementById('r_new00').style.backgroundColor=validationBg;	
	}else{
    	document.getElementById('r_new00').style.backgroundColor='';	
	}*/	
	if(myform.auctionCombo.value!='')
	{

	if(myform.Employer){
	if(myform.Employer.value==""){   
		visitor +=  "\n- Please enter employer."; 
		document.getElementById('r_20').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_20').style.backgroundColor='';		
		}
	}
	
if(myform.jobTitle){		
	if(myform.jobTitle.value==""){   
		visitor +=  "\n- Please enter job title."; 
		document.getElementById('r_21').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_21').style.backgroundColor='';		
	}
}
	
if(myform.YearsAtJob){		
	if(myform.YearsAtJob.value=="" ||(isNaN(myform.YearsAtJob.value))){   
		visitor +=  "\n- Please enter years at job.For eg.10"; 
		document.getElementById('r_22').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_22').style.backgroundColor='';		
	}
}
	
	/*if(myform.selfEmployed.value==""){   
		visitor +=  "\n- Please select self employed.";
			document.getElementById('r_23').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_23').style.backgroundColor='';		
	}
		
	if(myform.selfEmployed.value==1)
	{
		if(myform.incomeVerified.value==""){   
			visitor +=  "\n- Please select can your stated income be verified.";
			document.getElementById('r_24').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_24').style.backgroundColor='';		
		}
		
	}*/
	
if(myform.grossAnnualIncome){
	if(myform.grossAnnualIncome.value==""){   
		visitor +=  "\n- Please select annual household income.";
	    document.getElementById('r_25').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_25').style.backgroundColor='';		
	}
}	
			
	/*if(myform.fundsAvailable.value==""){   
		visitor +=  "\n- Please select funds available for down payment."; 
		document.getElementById('r_26').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_26').style.backgroundColor='';		
	}*/
	
if(myform.downPaymentAtPurchase){ 		
	if(myform.downPaymentAtPurchase.value==""){   
		visitor +=  "\n- Please select total down payment be at purchase."; 
	    document.getElementById('r_27').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_27').style.backgroundColor='';		
	}
}
		
if(myform.sourceOfDownPayment){		
	if(myform.sourceOfDownPayment.value==""){   
		visitor +=  "\n- Please select source of down payment funds."; 
	    document.getElementById('r_29').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_29').style.backgroundColor='';		
	}
}
		
	
	/*if(myform.ownYourHome.value==""){   
		visitor +=  "\n- Please select currently own your home."; 
	    document.getElementById('r_28').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_28').style.backgroundColor='';		
	}*/
	
if(myform.creditHistory){  	
	if(myform.creditHistory.value==""){   
		visitor +=  "\n- Please select describe your credit history."; 
	    document.getElementById('r_30').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_30').style.backgroundColor='';		
	}
}
		
	
	//if(!myform.qualified.checked){   visitor +=  "\n- Please Check I Would Like To Be Pre-Qualified For the Auction At No Cost Or Obligation."; }
	//if(getCheckedValue(myform.qualified)=="yes"){    
	
	/*if(myform.Callclientbetween.value==""){   
		visitor +=  "\n- Please enter best time to contact."; 
		document.getElementById('Callclientbetween').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('Callclientbetween').style.backgroundColor='';
	}*/
		if(myform.ssnStatus.value=='1')
		{

		if((myform.socialSecurityNumber1.value=='' || myform.socialSecurityNumber2.value=='' || myform.socialSecurityNumber3.value=='') && (myform.socialSecurityNumber1.value!='' || myform.socialSecurityNumber2.value!='' || myform.socialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
	document.getElementById('show_secure').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}


/////
if(myform.spouseOrCobuyer.value!=2 && myform.spouseOrCobuyer.value!=3){
	if(myform.socialSecurityNumber1.value!='' && myform.socialSecurityNumber2.value!='' && myform.socialSecurityNumber3.value!='')
	{ 
		var socialSecurityNumber=myform.socialSecurityNumber1.value+'-'+myform.socialSecurityNumber2.value+'-'+myform.socialSecurityNumber3.value;
		if(!isSSN_new(socialSecurityNumber))
		{   visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
			document.getElementById('show_secure').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('show_secure').style.backgroundColor='';		
		}
	}
}
/////
			
	if(myform.spouseOrCobuyer.value==2){
	if((myform.spousesocialSecurityNumber1.value=='' || myform.spousesocialSecurityNumber2.value=='' || myform.spousesocialSecurityNumber3.value=='') && (myform.spousesocialSecurityNumber1.value!='' || myform.spousesocialSecurityNumber2.value!='' || myform.spousesocialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid spouse ssn. For eg:- 123-45-7890"; 
	document.getElementById('s00').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('s00').style.backgroundColor='';		
			}

	
	if(myform.socialSecurityNumber1.value!='' && myform.socialSecurityNumber2.value!='' && myform.socialSecurityNumber3.value!='')
	{ 
	var socialSecurityNumber=myform.socialSecurityNumber1.value+'-'+myform.socialSecurityNumber2.value+'-'+myform.socialSecurityNumber3.value;
	if(!isSSN_new(socialSecurityNumber))
			{   visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
				document.getElementById('show_secure').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	
	
	
	
	if(myform.spousesocialSecurityNumber1.value=='' || myform.spousesocialSecurityNumber2.value=='' || myform.spousesocialSecurityNumber3.value==''){   
		visitor +=  "\n- Please enter spouse ssn."; 
		document.getElementById('s00').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('s00').style.backgroundColor='';
	}
	
	
	
	var spousesocialSecurityNumber=myform.spousesocialSecurityNumber1.value+'-'+myform.spousesocialSecurityNumber2.value+'-'+myform.spousesocialSecurityNumber3.value;
		if(myform.spousesocialSecurityNumber1.value!='' || myform.spousesocialSecurityNumber2.value!='' || myform.spousesocialSecurityNumber3.value!='') 
		{
			if(!isSSN_new(spousesocialSecurityNumber))
			{   visitor +=  "\n- Please enter valid spouse ssn. For eg:- 123-45-7890"; 
				document.getElementById('s00').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('s00').style.backgroundColor='';		
			}
			
		}
		}
		
		}
		if(myform.spouseOrCobuyer.value==3){
			if((myform.cobuyersocialSecurityNumber1.value=='' || myform.cobuyersocialSecurityNumber2.value=='' || myform.cobuyersocialSecurityNumber3.value=='') && (myform.cobuyersocialSecurityNumber1.value!='' || myform.cobuyersocialSecurityNumber2.value!='' || myform.cobuyersocialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid cobuyer ssn. For eg:- 123-45-7890"; 
	document.getElementById('c00').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('c00').style.backgroundColor='';		
			}
	
	if(myform.socialSecurityNumber1.value!='' && myform.socialSecurityNumber2.value!='' && myform.socialSecurityNumber3.value!='')
	{ 
	var socialSecurityNumber=myform.socialSecurityNumber1.value+'-'+myform.socialSecurityNumber2.value+'-'+myform.socialSecurityNumber3.value;
	if(!isSSN_new(socialSecurityNumber))
			{   visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
				document.getElementById('show_secure').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	
	if(myform.cobuyersocialSecurityNumber1.value=='' || myform.cobuyersocialSecurityNumber2.value=='' || myform.cobuyersocialSecurityNumber3.value==''){   
		visitor +=  "\n- Please enter cobuyer ssn."; 
		document.getElementById('c00').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c00').style.backgroundColor='';
	}
	
	
	
	var cobuyersocialSecurityNumber=myform.cobuyersocialSecurityNumber1.value+'-'+myform.cobuyersocialSecurityNumber2.value+'-'+myform.cobuyersocialSecurityNumber3.value;
		if(myform.cobuyersocialSecurityNumber1.value!='' || myform.cobuyersocialSecurityNumber2.value!='' || myform.cobuyersocialSecurityNumber3.value!='') 
		{
			if(!isSSN_new(cobuyersocialSecurityNumber))
			{   visitor +=  "\n- Please enter valid co-buyer ssn. For eg:- 123-45-7890"; 
				document.getElementById('c00').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('c00').style.backgroundColor='';		
			}
			
		}
		}
		
		}
		}
	

	//}
	
	
	/*if(getCheckedValue(myform.qualified)==''){   
		visitor +=  "\n- Please select if would like to be pre-qualified."; 
		document.getElementById('r_31').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_31').style.backgroundColor='';		
	}*/

if(myform.firstTimeBuyer){	
	if(myform.firstTimeBuyer.value==""){   
		visitor +=  "\n- Please select first time buyer."; 
		document.getElementById('r_32').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_32').style.backgroundColor='';		
	}
}
		
		
	/*if(myform.coSigner.value==""){   
		visitor +=  "\n- Please select a co-signer.";
		document.getElementById('r_33').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_33').style.backgroundColor='';		
	}*/
		
if(myform.occupyHomeOnPurchase){  		
	if(myform.occupyHomeOnPurchase.value==""){   
		visitor +=  "\n- Please select occupying the home you purchase."; 
		document.getElementById('r_34').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_34').style.backgroundColor='';		
	}
}
		
if(myform.investor){	
	if(myform.investor.value==""){   
		visitor +=  "\n- Please select  an investor."; 
		document.getElementById('r_35').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_35').style.backgroundColor='';		
	}
}
	
		
	/*if(myform.secondHome.value==""){   
		visitor +=  "\n- Please select 2nd home."; 
		document.getElementById('r_360').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_360').style.backgroundColor='';		
	}
	
		
	if(myform.purchasePriceRange.value==""){   
		visitor +=  "\n- Please select purchase price range is."; 
		document.getElementById('r_37').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_37').style.backgroundColor='';		
	}*/

	
    }
   
  }
 /////////////bidder registration prequalified EOC ///////////////
 
	if(!myform.agree.checked){   visitor +=  "\n- Please check the I hereby... checkbox.";
			document.getElementById('r_39').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_39').style.backgroundColor='';		
	}

	
	if(myform.signFirstName.value==""){   
		visitor +=  "\n- Please enter first name."; 
		document.getElementById('r_40').style.backgroundColor=validationBg;
		document.getElementById('r_41').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_40').style.backgroundColor='';		
		document.getElementById('r_41').style.backgroundColor='';		
	}
		
		
	if(myform.signLastName.value==""){
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_42').style.backgroundColor=validationBg;
		document.getElementById('r_43').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_42').style.backgroundColor='';		
		document.getElementById('r_43').style.backgroundColor='';		
	}
		
		
	if(myform.signDate.value==""){   
		visitor +=  "\n- Please enter date."; 
		document.getElementById('r_44').style.backgroundColor=validationBg;
		document.getElementById('r_45').style.backgroundColor=validationBg;	
		}
	else
	{
		
			var signdate=myform.signDate.value;
     
			var val=signdate.split('-');
    
       
       if(val.length==3)
    {
         
			if(parseInt(val[0].lenght)<2 || parseInt(val[1].lenght)<2 || parseInt(val[2].lenght)<4 )
			{   
				visitor +=  "\n- Please enter valid date (mm-dd-yyy)."; 
				document.getElementById('r_40').style.backgroundColor=validationBg;
			}
    }
    else
    {
    visitor +=  "\n- Please enter valid date (mm-dd-yyy)."; 
		document.getElementById('r_40').style.backgroundColor=validationBg;
    }

		document.getElementById('r_44').style.backgroundColor='';		
		document.getElementById('r_45').style.backgroundColor='';		
	 }
	/*if(myform.primaryPurchaserFirstName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.primaryPurchaserFirstName.value.length; i++) {
  		if (iChars.indexOf(myform.primaryPurchaserFirstName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_1').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in primary purcharser first name."; 
			 document.getElementById('r_1').style.backgroundColor=validationBg;}
	}
	if(myform.primaryPurchaserLastName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.primaryPurchaserLastName.value.length; i++) {
  		if (iChars.indexOf(myform.primaryPurchaserLastName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_2').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in primary purcharser last name."; 
			 document.getElementById('r_2').style.backgroundColor=validationBg;}
	}
	
		if(myform.primaryPurchaserAddress.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.primaryPurchaserAddress.value.length; i++) {
  		if (iChars.indexOf(myform.primaryPurchaserAddress.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_3').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in primary purcharser address."; 
			 document.getElementById('r_3').style.backgroundColor=validationBg;}
	}
	if(myform.primaryPurchaserCity.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.primaryPurchaserCity.value.length; i++) {
  		if (iChars.indexOf(myform.primaryPurchaserCity.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_4').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in primary purcharser city."; 
			 document.getElementById('r_4').style.backgroundColor=validationBg;}
	}
	if(myform.Employer.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.Employer.value.length; i++) {
  		if (iChars.indexOf(myform.Employer.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_20').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in  employer."; 
			 document.getElementById('r_20').style.backgroundColor=validationBg;}
	}
	if(myform.jobTitle.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.jobTitle.value.length; i++) {
  		if (iChars.indexOf(myform.jobTitle.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_21').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in job title."; 
			 document.getElementById('r_21').style.backgroundColor=validationBg;}
	}
	if(myform.signFirstName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.signFirstName.value.length; i++) {
  		if (iChars.indexOf(myform.signFirstName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_40').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in first name."; 
			 document.getElementById('r_40').style.backgroundColor=validationBg;}
	}
		if(myform.signLastName.value!=""){  
		cntCheck=0;
		for (var i = 0; i < myform.signLastName.value.length; i++) {
  		if (iChars.indexOf(myform.signLastName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_42').style.backgroundColor=validationBg;
		cntCheck++;
	 // return false;
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in last name."; 
			 document.getElementById('r_42').style.backgroundColor=validationBg;}
	}
	if(myform.spouseFirstName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.spouseFirstName.value.length; i++) {
  		if (iChars.indexOf(myform.spouseFirstName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_11').style.backgroundColor=validationBg;
		cntCheck++;
	
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in spouse first name."; 
			 document.getElementById('r_11').style.backgroundColor=validationBg;}
	}
	if(myform.spouseLastName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.spouseLastName.value.length; i++) {
  		if (iChars.indexOf(myform.spouseLastName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_12').style.backgroundColor=validationBg;
		cntCheck++;
	
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in spouse last name."; 
			 document.getElementById('r_12').style.backgroundColor=validationBg;}
	}
	if(myform.spouseAddress.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.spouseAddress.value.length; i++) {
  		if (iChars.indexOf(myform.spouseAddress.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_13').style.backgroundColor=validationBg;
		cntCheck++;
	
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in spouse address."; 
			 document.getElementById('r_13').style.backgroundColor=validationBg;}
	}
	if(myform.spouseCity.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.spouseCity.value.length; i++) {
  		if (iChars.indexOf(myform.spouseCity.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_14').style.backgroundColor=validationBg;
		cntCheck++;
	
  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in spouse city."; 
			 document.getElementById('r_14').style.backgroundColor=validationBg;}
	}*/
	if(visitor != "")
	{
		MasterString = MasterString + visitor;
		flag=true;
	}
		
	if (flag == true)
	{
		alert(MasterString);
		return false;
	}
		
	return true;
}

function validateBroker(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 check=1;
	var iChars = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	var validationBg=myform.validationBg.value;
	
	if(myform.firstName.value==""){  
	visitor +=  "\n- Please enter first name."; 
	document.getElementById('r_1').style.backgroundColor=validationBg;
	
	}
	else
	{
	document.getElementById('r_1').style.backgroundColor='';
	
	}

	if(myform.lastName.value==""){ 
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_2').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	
	if(myform.companyName.value==""){   
		visitor +=  "\n- Please enter company name."; 
		document.getElementById('r_3').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';
	}

	if(myform.address.value==""){   
		visitor +=  "\n- Please enter address."; 
		document.getElementById('r_4').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';
	}

	if(myform.city.value==""){   visitor +=  "\n- Please enter city."; 
		document.getElementById('r_5').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_5').style.backgroundColor='';
	}
	
	if(myform.state.value==""){   visitor +=  "\n- Please select state."; 
		document.getElementById('r_6').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_6').style.backgroundColor='';
	}
	
	if(myform.zip.value=="" ||myform.zip.value.length<5){   visitor +=  "\n- Please enter zip. (Minimum 5 digit zip / postal code)"; 
		document.getElementById('r_7').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_7').style.backgroundColor='';
	}
	
	
	var cell=myform.cell1.value+'-'+myform.cell2.value+'-'+myform.cell3.value;
		
	if(!isPhone_new(cell)){   
		visitor +=  "\n- Please enter valid cell phone. For eg:- 123-456-7890";
		document.getElementById('r_9').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_9').style.backgroundColor='';
	}
	
	var office=myform.office1.value+'-'+myform.office2.value+'-'+myform.office3.value;
	
if(myform.office1.value!=''||myform.office2.value!=''||myform.office3.value!='')
{
	if(!isPhone_new(office)){   
		visitor +=  "\n- Please enter valid office phone. For eg:- 123-456-7890";
		document.getElementById('r_8').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_8').style.backgroundColor='';
	}
}
	var fax=myform.fax1.value+'-'+myform.fax2.value+'-'+myform.fax3.value;
if(myform.fax1.value!=''||myform.fax2.value!=''||myform.fax3.value!='')
{
	if(!isPhone_new(fax)){   
		visitor +=  "\n- Please enter valid fax number. For eg:- 123-456-7890";
		document.getElementById('r_10').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_10').style.backgroundColor='';
	}
}				
	if (!IsEmailAddress(myform.email.value,'')) 
	{   visitor +=  "\n- Please enter valid email address.";
	  document.getElementById('r_11').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_11').style.backgroundColor='';
	}
	
	if(myform.brokerLicenceNumber.value==""){   
		visitor +=  "\n- Please enter broker licence number."; 
		document.getElementById('r_12').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_12').style.backgroundColor='';
	}
	
	
	if(myform.clientName.value=="" || myform.clientName1.value==""){   
		visitor +=  "\n- Please enter clients name."; 
		document.getElementById('test').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('test').style.backgroundColor='';
	}	
var tbl = document.getElementById('lines');
var cnt1=1;
//alert(tbl.rows.length);
var istext=true;
var cnt2=tbl.rows.length;

while(cnt1<cnt2-1)
{
	//alert(document.getElementById('txtrowL2').value);

	cnt1++;
if(document.getElementById("txtrow"+cnt1).value=='' || document.getElementById("txtrowL"+cnt1).value=='')
	{
		
		istext=false;
	}

}

	if(istext==false)
	{
		document.getElementById('test').style.backgroundColor=validationBg;
		if(myform.clientName.value!="" || myform.clientName1.value!="")
	  visitor +=  "\n- Please enter clients name.";
	}
	else if(myform.clientName.value!="" && myform.clientName1.value!="")
	{
		document.getElementById('test').style.backgroundColor='';
	}
	
	
	if(myform.auctionCombo.value==""){   
		visitor +=  "\n- Please select auction."; 
		document.getElementById('r_12_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_12_1').style.backgroundColor='';
	}	
	
	if(myform.auctionCombo.value!=""){
    var flagcheck=false;
	for (var i = 0; i < myform.elements.length; i++){
		var e = myform.elements[i];
		if(e.type=="checkbox" && e.name == "User_ids[]"){
			if(e.checked){
				flagcheck=true;
				break;				
			}			
		}
	}

	if(!flagcheck){
		visitor +=  "\n- Please choose the venue you like to attend."; 
		document.getElementById('r_12_2').style.backgroundColor=validationBg;
	}else{
		document.getElementById('r_12_2').style.backgroundColor='';	
	}
}
	
if(flagcheck){
	if(myform.communityStatu){
	if(myform.communityStatus.value==1){
		var communitycheck=false; 	
		for (var i = 0; i < myform.elements.length; i++){
			var comm = myform.elements[i];
			if(comm.type=="checkbox" && comm.name == "chkCommunity[]"){
				if(comm.checked){
					communitycheck=true;
					break;					
				}				
			}
		}
	
	
	if(!communitycheck){
		visitor +=  "\n- Please choose the community"; 
		document.getElementById('r_9_1_1').style.backgroundColor=validationBg;
	}else{
		document.getElementById('r_9_1_1').style.backgroundColor='';	
	}
 }
	}
}
	
	if(!myform.agree.checked){   visitor +=  "\n- Please check the I have read,... auction.";
	document.getElementById('r_13').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_13').style.backgroundColor='';
	}

	/*if(myform.firstName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.firstName.value.length; i++) {
  		if (iChars.indexOf(myform.firstName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_1').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
		visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in first name."; 
		document.getElementById('r_1').style.backgroundColor=validationBg;}
	}
	if(myform.lastName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.lastName.value.length; i++) {
  		if (iChars.indexOf(myform.lastName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_2').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in last name."; 
			 document.getElementById('r_2').style.backgroundColor=validationBg;}
	}
	if(myform.companyName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.companyName.value.length; i++) {
  		if (iChars.indexOf(myform.companyName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_3').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in company name."; 
			 document.getElementById('r_3').style.backgroundColor=validationBg;}
	}
	if(myform.address.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.address.value.length; i++) {
  		if (iChars.indexOf(myform.address.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_4').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in address."; 
			 document.getElementById('r_4').style.backgroundColor=validationBg;}
	}
	if(myform.city.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.city.value.length; i++) {
  		if (iChars.indexOf(myform.city.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_5').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in city."; 
			 document.getElementById('r_5').style.backgroundColor=validationBg;}
	}
	if(myform.brokerLicenceNumber.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.brokerLicenceNumber.value.length; i++) {
  		if (iChars.indexOf(myform.brokerLicenceNumber.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_12').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in licence number."; 
			 document.getElementById('r_12').style.backgroundColor=validationBg;}
	}*/
	if(visitor!="")
	{
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{
		alert(MasterString);
		return false;
	}
	return true;
}
function validateContactForm(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 validationBg=myform.validationBg.value;
	if(myform.department.value==""){   visitor +=  "\n- Please select a department."; 
	document.getElementById('c_1_1').style.backgroundColor=validationBg;
	}
	else
	{	
		document.getElementById('c_1_1').style.backgroundColor='';
	}
	if(myform.contactFirstName.value==""){   visitor +=  "\n- Please enter first name."; 
	document.getElementById('c_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_1').style.backgroundColor='';
	}
	if(myform.contactLastName.value==""){   visitor +=  "\n- Please enter last Name."; 
	document.getElementById('c_2').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_2').style.backgroundColor='';
	}

	
	/*if(myform.contactZip.value!="" &&((isNaN(myform.contactZip.value)) ||myform.contactZip.value.length<5)){
			visitor +=  "\n- Please enter zip. (5 digit number)"; 
			
		}
	*/	
		
		var contactPhone=myform.contactPhone1.value+'-'+myform.contactPhone2.value+'-'+myform.contactPhone3.value;
		
		if(myform.contactPhone1.value!='' || myform.contactPhone2.value!='' || myform.contactPhone3.value!='') 
		{
			if(!isPhone_new(contactPhone))
			{   visitor +=  "\n- Please enter valid contact phone. For eg:- 123-456-7890"; 
				document.getElementById('c_8').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('c_8').style.backgroundColor='';		
			}
			
		}	
		
		
	if (!IsEmailAddress(myform.contactEmailAddress.value,'')) 
	{   visitor +=  "\n- Please enter valid email address.";
	document.getElementById('c_11').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_11').style.backgroundColor='';
	}
	
	if(myform.contactMessage.value==""){   visitor +=  "\n- Please enter message.";
	document.getElementById('c_10').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_10').style.backgroundColor='';
	}

/*	if(myform.department.value==2)
	{
		if(myform.contactCompanyName.value==""){   visitor +=  "\n- Please enter company name.";
		document.getElementById('c_12').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('c_12').style.backgroundColor='';
		}
		
		if(myform.contactTitle.value==""){   visitor +=  "\n- Please enter title.";
		document.getElementById('c_13').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('c_13').style.backgroundColor='';
		}
		if(myform.contactBusinessPhone.value==""){   visitor +=  "\n- Please enter business phone .";
		document.getElementById('c_14').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('c_14').style.backgroundColor='';
		}
  }
*/
	if(visitor!="")
	{ 
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{ 
		alert(MasterString);
		return false;
	}
	return true;
}
function validateSignupForm(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="";
	validationBg=document.myform.validationBg.value

	if (!IsEmailAddress(myform.email.value,'')) 
	{   visitor +=  "\n- Please enter valid email address.";
	document.getElementById('c_100').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_100').style.backgroundColor='';
	}
	
	if(myform.password.value==""){   visitor +=  "\n- Please enter password."; 
	document.getElementById('c_12').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_12').style.backgroundColor='';
	}
	if(myform.password.value!=myform.confirmPassword.value){   visitor +=  "\n- Password and  confirm password do not match."; 
	document.getElementById('c_13').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_13').style.backgroundColor='';
	}
	
if(myform.firstName.value==""){   visitor +=  "\n- Please enter first name."; 
	document.getElementById('c_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_1').style.backgroundColor='';
	}

	if(myform.lastName.value==""){   visitor +=  "\n- Please enter last Name."; 
	document.getElementById('c_2').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_2').style.backgroundColor='';
	}
	
	
		var contactPhone=myform.Phone1.value+'-'+myform.Phone2.value+'-'+myform.Phone3.value;
		
		if(myform.Phone1.value!='' || myform.Phone2.value!='' || myform.Phone3.value!='') 
		{
			if(!isPhone_new(contactPhone))
			{   visitor +=  "\n- Please enter valid contact phone. For eg:- 123-456-7890"; 
				document.getElementById('c_8').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('c_8').style.backgroundColor='';		
			}
			
		}	
		if(myform.name.value==0){ visitor+=" \n - Please select hint question.";
	document.getElementById('c_20').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_20').style.backgroundColor='';
	}
	
	if(myform.hintAnswer.value==""){   visitor +=  "\n- Please enter hint answer."; 
	document.getElementById('c_30').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c_30').style.backgroundColor='';
	}
		
	
	
 
	
	
	if(visitor!="")
	{
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{
		alert(MasterString);
		return false;
	}
	return true;
}

function validateEmailNotification(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(myform.EmailAddress.value!="")
	{
		arrEmail=myform.EmailAddress.value.split(',');
		var strCheck=false;
		for(i=0;i<=arrEmail.length;i++)
		{
			if (!IsEmailAddress(arrEmail[i],''))
			{
			strCheck=true;
			break;
			}
		}
	  
		if(strCheck==true)
		{
		visitor +=  "\n- Email Address "+(i+1)+" is in improper format";
		//if (!IsEmailAddress(myform.EmailAddress.value,'')) 
		//{   visitor +=  "\n- Please enter email address."; 
		}
	 }
	  else
	  {
	  	visitor +=  "\n- Please enter email address."; 
	  }
	
	
	if(visitor!="")
	{
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{
		alert(MasterString);
		return false;
	}
	return true;
}

function changeVal(myform) {
//s1 = new String(frmHome.UserName.value)
   s1 = "";
myform.email.value = s1.toUpperCase();
}
function isPhone_new(string) {
	if (string.search(/^([0-9]){3}-[0-9]{3}-[0-9]{4}$/) != -1)
		return true;
	else
		return false;
}
function isSSN_new(string) {
	if (string.search(/^([0-9]){3}-[0-9]{2}-[0-9]{4}$/) != -1)
		return true;
	else
		return false;
}
function validate_brochure(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 check=1;
	var iChars = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	var validationBg=myform.validationBg.value;
	if(myform.primaryPurchaserFirstName.value==""){   
		visitor +=  "\n- Please enter primary purcharser first name."; 
		document.getElementById('r_1_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_1_1').style.backgroundColor='';
	}
	if(myform.primaryPurchaserLastName.value==""){   
		visitor +=  "\n- Please enter primary purcharser last name."; 
		document.getElementById('r_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_1').style.backgroundColor='';
	}
	if(myform.primaryPurchaserAddress.value==""){   
		visitor +=  "\n- Please enter primary purchaser address.";
		document.getElementById('r_2').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserCity.value==""){
		visitor +=  "\n- Please enter primary purchaser city."; 
		document.getElementById('r_3').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserState.value==""){
		visitor +=  "\n- Please select primary purchaser state."; 
		document.getElementById('r_4').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';		
	}
	
	if(myform.primaryPurchaserZip.value=="" || myform.primaryPurchaserZip.value.length<5){
		visitor +=  "\n- Please enter primary purcharser zip. (Minimum 5 digit zip / postal code)";
		document.getElementById('r_5').style.backgroundColor=validationBg;		
	}
	else
	{
		document.getElementById('r_5').style.backgroundColor='';		
	}
	
	var primaryPurchaserWork=myform.primaryPurchaserWork1.value+'-'+myform.primaryPurchaserWork2.value+'-'+myform.primaryPurchaserWork3.value;
	
	if(myform.primaryPurchaserWork1.value!='' || myform.primaryPurchaserWork2.value!='' || myform.primaryPurchaserWork3.value!='')
	{
		if(!isPhone_new(primaryPurchaserWork))
		{  visitor +="\n- Please enter valid  primary purchaser work phone. For eg:- 123-456-7890"; 
		  document.getElementById('r_7').style.backgroundColor=validationBg;	
		}
		else
		{
		  document.getElementById('r_7').style.backgroundColor='';		
		}
	
	}
	
	
	var primaryPurchaserCell=myform.primaryPurchaserCell1.value+'-'+myform.primaryPurchaserCell2.value+'-'+myform.primaryPurchaserCell3.value;
	if(!isPhone_new(primaryPurchaserCell))
	{   
		visitor +=  "\n- Please enter valid primary purchaser cell. For eg:- 123-456-7890 ";
		document.getElementById('r_6').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_6').style.backgroundColor='';		
	}
		if (!IsEmailAddress(myform.primaryPurchaserEmail.value,'')) 
		{
			visitor +=  '\n- Please enter primary purchaser email address';
			document.getElementById('r_8').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_8').style.backgroundColor='';		
		}
		if(myform.auctionCombo.value==""){   
		visitor +=  "\n- Please select auction";
		document.getElementById('r_9_2').style.backgroundColor=validationBg;		
		}
		else
		{
		document.getElementById('r_9_2').style.backgroundColor='';		
		}	

	if(myform.auctionCombo.value!="")
	{
	var flagcheck=false;
	for (var i = 0; i < myform.elements.length; i++)
	{
		var e = myform.elements[i];
		if(e.type=="checkbox" && e.name == "User_ids[]")
		{
			if(e.checked)
			{
				flagcheck=true;
				break;
				
			}
			
		}
	}
	if(!flagcheck)
	{
		visitor +=  "\n- Please choose the venue you like to attend."; 
		document.getElementById('r_9_1').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_9_1').style.backgroundColor='';	
	}
	}
	
	if(flagcheck){
	if(myform.communityStatus.value==1){
		var communitycheck=false; 
	
		for (var i = 0; i < myform.elements.length; i++)
		{
			var comm = myform.elements[i];
			if(comm.type=="checkbox" && comm.name == "chkCommunity[]")
			{
				if(comm.checked)
				{
					communitycheck=true;
					break;
					
				}
				
			}
		}	
	

	if(!communitycheck)	{
		visitor +=  "\n- Please choose the community"; 
		document.getElementById('r_9_1_1').style.backgroundColor=validationBg;
	}else{
		document.getElementById('r_9_1_1').style.backgroundColor='';	
	}
  }
}
	
	
	
	if(myform.registerForAuction.checked)
	{
		
		if(!isCheckedRadio(myform.financing)){  
		visitor +=  "\n- Please Check We plan to use financing."; 
			document.getElementById('r_new0').style.backgroundColor=validationBg;	
	}
	else
	{  document.getElementById('r_new0').style.backgroundColor='';	
		if(getCheckedValue(myform.financing)==1 ){
			document.getElementById('r_new2').style.backgroundColor='';	
			document.getElementById('r_new3').style.backgroundColor='';	
		}
		if(getCheckedValue(myform.financing)==2 && myform.lenderContactName.value=="")
		{
			visitor +=  "\n- Please Enter lender contact Name."; 
			document.getElementById('r_new2').style.backgroundColor=validationBg;	
		}
		else{document.getElementById('r_new2').style.backgroundColor='';}
		
		if(getCheckedValue(myform.financing)==2 && (myform.lenderContactPhone1.value=='' || myform.lenderContactPhone2.value=='' || myform.lenderContactPhone3.value==''))
		{
			visitor +=  "\n- Please complete lender contact no."; 
			document.getElementById('r_new3').style.backgroundColor=validationBg;	
		}
		else if(getCheckedValue(myform.financing)==3){
			/*var lenderContactPhone=myform.lenderContactPhone1.value+'-'+myform.lenderContactPhone2.value+'-'+myform.lenderContactPhone3.value;
			if(!isPhone_new(lenderContactPhone)){  
			visitor +="\n- Please enter valid  lender contact phone. For eg:- 123-456-7890"; 
		  	document.getElementById('r_new3').style.backgroundColor=validationBg;	
			}else{ document.getElementById('r_new3').style.backgroundColor='';	}	
			*/
		}
	}// end if radio financing is checked
	
if(myform.spouseOrCobuyer.value!=1)
	{
		if(myform.spouseFirstName.value==""){   
			visitor +=  "\n- Please enter spouse first name."; 
			document.getElementById('r_11_1').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_1').style.backgroundColor='';		
		}
		
		if(myform.spouseLastName.value==""){   
			visitor +=  "\n- Please enter spouse last name."; 
			document.getElementById('r_11_2').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_2').style.backgroundColor='';		
		}
		
		if(myform.spouseAddress.value==""){  
			visitor +=  "\n- Please enter spouse address."; 
			document.getElementById('r_11_3').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_3').style.backgroundColor='';		
		}
		
		if(myform.spouseCity.value==""){   
			visitor +=  "\n- Please enter spouse city."; 
			document.getElementById('r_11_4').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_4').style.backgroundColor='';		
		}
		
		if(myform.spouseState.value==""){   
			visitor +=  "\n- Please select spouse state.";
			document.getElementById('r_11_5').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_5').style.backgroundColor='';		
		}
	
		if(myform.spouseZip.value=="" || myform.spouseZip.value.length<5){
			visitor +=  "\n- Please enter spouse zip. (Minimum 5 digit zip / postal code)"; 
			document.getElementById('r_11_6').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_6').style.backgroundColor='';		
		}
		
		
		var spouseCell=myform.spouseCell1.value+'-'+myform.spouseCell2.value+'-'+myform.spouseCell3.value;
		
		if(!isPhone_new(spouseCell)){   
			visitor +=  "\n- Please enter valid spouse home phone. For eg:- 123-456-7890";
			document.getElementById('r_11_8').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_11_8').style.backgroundColor='';		
		}
			
		var spouseCell=myform.spouseCell1.value+'-'+myform.spouseCell2.value+'-'+myform.spouseCell3.value;
		if(myform.spouseCell1.value!='' || myform.spouseCell2.value!='' || myform.spouseCell3.value!='') 
		{
			if(!isPhone_new(spouseCell))
			{   visitor +=  "\n- Please enter valid spouse cell. For eg:- 123-456-7890"; 
				document.getElementById('r_11_8').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('r_11_8').style.backgroundColor='';		
			}
			
		}
		
	}			
	

	


//////// brochoure:qualified check box BOC ////////////////	
if(getCheckedValue(myform.qualified)=="yes"){ 
	
	if(myform.Employer.value==""){   
		visitor +=  "\n- Please enter employer."; 
		document.getElementById('r_10').style.backgroundColor=validationBg;
		}
		else
		{
			document.getElementById('r_10').style.backgroundColor='';		
		}
	
		if(myform.jobTitle.value==""){   
		visitor +=  "\n- Please enter job title."; 
		document.getElementById('r_10_2').style.backgroundColor=validationBg;
		}
		else
		{
		document.getElementById('r_10_2').style.backgroundColor='';		
		}

	if(myform.YearsAtJob.value=="" ||(isNaN(myform.YearsAtJob.value))){   
		visitor +=  "\n- Please enter years at job.For eg.10"; 
		document.getElementById('r_10_1').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_10_1').style.backgroundColor='';		
	}
	
if(myform.grossAnnualIncome.value==""){   
		visitor +=  "\n- Please select annual household income.";
	    document.getElementById('r_19').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_19').style.backgroundColor='';		
	}
	
	
	if(myform.downPaymentAtPurchase){
		if(myform.downPaymentAtPurchase.value==""){   
			visitor +=  "\n- Please select total down payment be at purchase."; 
			document.getElementById('r_21').style.backgroundColor=validationBg;
			}
		else
		{
			document.getElementById('r_21').style.backgroundColor='';		
		}
	}


	
if(myform.sourceOfDownPayment){
		if(myform.sourceOfDownPayment.value==""){   
			visitor +=  "\n- Please select source of down payment funds."; 
			document.getElementById('r_24').style.backgroundColor=validationBg;
			}
		else
		{
			document.getElementById('r_24').style.backgroundColor='';		
		}
}

if(myform.creditHistory){	
	if(myform.creditHistory.value==""){   
		visitor +=  "\n- Please select describe your credit history."; 
	    document.getElementById('r_26').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_26').style.backgroundColor='';		
	}
}
			if((myform.socialSecurityNumber1.value=='' || myform.socialSecurityNumber2.value=='' || myform.socialSecurityNumber3.value=='') && (myform.socialSecurityNumber1.value!='' || myform.socialSecurityNumber2.value!='' || myform.socialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
	document.getElementById('show_secure').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	
		if((myform.socialSecurityNumber1.value=='' || myform.socialSecurityNumber2.value=='' || myform.socialSecurityNumber3.value=='') && (myform.socialSecurityNumber1.value!='' || myform.socialSecurityNumber2.value!='' || myform.socialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
	document.getElementById('show_secure').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	if(myform.spouseOrCobuyer.value==2){
	if((myform.spousesocialSecurityNumber1.value=='' || myform.spousesocialSecurityNumber2.value=='' || myform.spousesocialSecurityNumber3.value=='') && (myform.spousesocialSecurityNumber1.value!='' || myform.spousesocialSecurityNumber2.value!='' || myform.spousesocialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid spouse ssn. For eg:- 123-45-7890"; 
	document.getElementById('show_secure').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}

	
	if(myform.socialSecurityNumber1.value!='' && myform.socialSecurityNumber2.value!='' && myform.socialSecurityNumber3.value!='')
	{ 
	var socialSecurityNumber=myform.socialSecurityNumber1.value+'-'+myform.socialSecurityNumber2.value+'-'+myform.socialSecurityNumber3.value;
	if(!isSSN_new(socialSecurityNumber))
			{   visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
				document.getElementById('show_secure').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	
	
	
	
	if(myform.spousesocialSecurityNumber1.value=='' || myform.spousesocialSecurityNumber2.value=='' || myform.spousesocialSecurityNumber3.value==''){   
		visitor +=  "\n- Please enter spouse ssn."; 
		document.getElementById('s00').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('s00').style.backgroundColor='';
	}
	
	
	
	var spousesocialSecurityNumber=myform.spousesocialSecurityNumber1.value+'-'+myform.spousesocialSecurityNumber2.value+'-'+myform.spousesocialSecurityNumber3.value;
		if(myform.spousesocialSecurityNumber1.value!='' || myform.spousesocialSecurityNumber2.value!='' || myform.spousesocialSecurityNumber3.value!='') 
		{
			if(!isSSN_new(spousesocialSecurityNumber))
			{   visitor +=  "\n- Please enter valid spouse ssn. For eg:- 123-45-7890"; 
				document.getElementById('s00').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('s00').style.backgroundColor='';		
			}
			
		}
		}
		
		}
		if(myform.spouseOrCobuyer.value==3){
			if((myform.cobuyersocialSecurityNumber1.value=='' || myform.cobuyersocialSecurityNumber2.value=='' || myform.cobuyersocialSecurityNumber3.value=='') && (myform.cobuyersocialSecurityNumber1.value!='' || myform.cobuyersocialSecurityNumber2.value!='' || myform.cobuyersocialSecurityNumber3.value!=''))
	{ visitor +=  "\n- Please enter valid cobuyer ssn. For eg:- 123-45-7890"; 
	document.getElementById('c00').style.backgroundColor=validationBg;
	}
			else
			{
				document.getElementById('c00').style.backgroundColor='';		
			}
			
	
	if(myform.socialSecurityNumber1.value!='' && myform.socialSecurityNumber2.value!='' && myform.socialSecurityNumber3.value!='')
	{ 
	var socialSecurityNumber=myform.socialSecurityNumber1.value+'-'+myform.socialSecurityNumber2.value+'-'+myform.socialSecurityNumber3.value;
	if(!isSSN_new(socialSecurityNumber))
			{   visitor +=  "\n- Please enter valid primary buyer's ssn. For eg:- 123-45-7890"; 
				document.getElementById('show_secure').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('show_secure').style.backgroundColor='';		
			}
	
	if(myform.cobuyersocialSecurityNumber1.value=='' || myform.cobuyersocialSecurityNumber2.value=='' || myform.cobuyersocialSecurityNumber3.value==''){   
		visitor +=  "\n- Please enter cobuyer ssn."; 
		document.getElementById('c00').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('c00').style.backgroundColor='';
	}
	
	

	
	var cobuyersocialSecurityNumber=myform.cobuyersocialSecurityNumber1.value+'-'+myform.cobuyersocialSecurityNumber2.value+'-'+myform.cobuyersocialSecurityNumber3.value;
		if(myform.cobuyersocialSecurityNumber1.value!='' || myform.cobuyersocialSecurityNumber2.value!='' || myform.cobuyersocialSecurityNumber3.value!='') 
		{
			if(!isSSN_new(cobuyersocialSecurityNumber))
			{   visitor +=  "\n- Please enter valid co-buyer ssn. For eg:- 123-45-7890"; 
				document.getElementById('c00').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('c00').style.backgroundColor='';		
			}
			
		}
		}
		
		}
	
	}		
//////// brochoure:qualified check box EOC ////////////////	

if(myform.firstTimeBuyer){ 
	if(myform.firstTimeBuyer.value==""){   
		visitor +=  "\n- Please select first time buyer."; 
		document.getElementById('r_34').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_34').style.backgroundColor='';		
	}
}
		

if(myform.occupyHomeOnPurchase){  
	if(myform.occupyHomeOnPurchase.value==""){   
		visitor +=  "\n- Please select occupying the home you purchase."; 
		document.getElementById('r_37').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_37').style.backgroundColor='';		
	}
}
		

if(myform.investor){ 
	if(myform.investor.value==""){   
		visitor +=  "\n- Please select  an investor."; 
		document.getElementById('r_39').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_39').style.backgroundColor='';		
	}
}
	if(!myform.agree.checked){   visitor +=  "\n- Please check the I hereby... checkbox.";
			document.getElementById('r_44').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_44').style.backgroundColor='';		
	}

	
	if(myform.signFirstName.value==""){   
		visitor +=  "\n- Please enter first name."; 
		document.getElementById('r_47').style.backgroundColor=validationBg;
		document.getElementById('r_48').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_47').style.backgroundColor='';		
		document.getElementById('r_48').style.backgroundColor='';		
	}
		
		
	if(myform.signLastName.value==""){
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_49').style.backgroundColor=validationBg;
		document.getElementById('r_50').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_49').style.backgroundColor='';		
		document.getElementById('r_50').style.backgroundColor='';		
	}

	if(myform.signDate.value==""){   
		visitor +=  "\n- Please enter date."; 
		document.getElementById('r_51').style.backgroundColor=validationBg;
		document.getElementById('r_52').style.backgroundColor=validationBg;	
		}
	else
	{
		
			var signdate=myform.signDate.value;
			var val=signdate.split('-');
			if(parseInt(val[0].lenght)<2 || parseInt(val[1].lenght)<2 || parseInt(val[2].lenght)<4 )
			{   
				visitor +=  "\n- Please enter valid date (mm-dd-yyy)."; 
				document.getElementById('r_51').style.backgroundColor=validationBg;
				document.getElementById('r_52').style.backgroundColor=validationBg;
			}
			else
			{
				document.getElementById('r_44').style.backgroundColor='';		
				document.getElementById('r_45').style.backgroundColor='';		
			}
	}
	}
	
	if(visitor != "")
	{
		MasterString = MasterString + visitor;
		flag=true;
	}
		
	if (flag == true)
	{
		alert(MasterString);
		return false;
	}
		
	return true;
}

function showForm()
{
		if(document.register_frm.registerForAuction.checked)
		{
				document.getElementById('r_10').style.display='';
				document.getElementById('r_10_1').style.display='';
				document.getElementById('r_10_2').style.display='';
				document.getElementById('r_11').style.display='';
				document.getElementById('show_2').style.display='';
					
		}
		else
		{
				document.getElementById('r_10').style.display='none';
				document.getElementById('r_10_1').style.display='none';
				document.getElementById('r_10_2').style.display='';
				document.getElementById('r_11').style.display='none';
				document.getElementById('show_2').style.display='none';
					
		}
}
function showStar()
{  //  || document.register_frm.orderForBrochure.checked
		if(document.register_frm.registerForAuction.checked )
		{
				
					document.getElementById('SpanAddressId').style.display='';
					document.getElementById('SpanCityId').style.display='';
					document.getElementById('SpanStateId').style.display='';
					document.getElementById('SpanZipId').style.display='';
		}
		else
		{
		
					document.getElementById('SpanAddressId').style.display='none';
					document.getElementById('SpanCityId').style.display='none';
					document.getElementById('SpanStateId').style.display='none';
					document.getElementById('SpanZipId').style.display='none';
		}
}
var count=0;
var count1=0;
var toBeView=3;
function scrollImageLeft(totalImage)
{

	
	count1=0;

	count++;
	startAt=count;

	var current=0;
  	var visible_counter=0;
  	// iterate over all setting visibility
  	for (var i=1; i<= totalImage; i++)
	{
  		var obj = document.getElementById("imageId"+i);
		if (current++ >= startAt)
		{
			if (visible_counter++ < toBeView)
			{
				//alert(visible_counter);
				obj.style.visibility="";
				obj.style.display="";
			}
			else
			{
				//alert(visible_counter);
				obj.style.visibility="hidden";
				obj.style.display="none";
			}
		}
		else 
		{
			//alert(startAt);
			if(totalImage>=(startAt + toBeView))
			{
				obj.style.visibility="hidden";
				obj.style.display="none";
			}
		}
  	}
	return true;
}

function scrollImageRight(totalImage)
{

	count=0;
	count1++;
	startAt=count1;

	var current=0;
  	var visible_counter=0;
  	// iterate over all setting visibility
  	for (var i=totalImage; i>=1 ; i--)
	{
  		var obj = document.getElementById("imageId"+i);
		

		

		if (current++ >= startAt)
		{
			if (visible_counter++ < toBeView)
			{
				//alert(visible_counter);
				obj.style.visibility="";
				obj.style.display="";
			}
			else
			{
				//alert(visible_counter);
				obj.style.visibility="hidden";
				obj.style.display="none";
			}
		}
		else 
		{
			//alert(startAt);
			if(totalImage>=(startAt+toBeView))
			{
				obj.style.visibility="hidden";
				obj.style.display="none";
			}
		}
  	}
	return true;
}

function displayImage(imageName,imageID,auctionID,itemID)
{
document.getElementById('mainImage').src=imageName;
document.getElementById('imagePath').value=imageName;
document.getElementById('imageID').value=imageID;
document.getElementById('itemID').value=itemID;
document.getElementById('auctionID').value=auctionID;
}

function displayImagePostAuction(imageName,imageID,auctionID,itemID)
{
//document.getElementById('mainImage').src=imageName; 
document.getElementById('mainImage').background=imageName;
document.getElementById('imagePath').value=imageName;
document.getElementById('imageID').value=imageID;
document.getElementById('itemID').value=itemID;
document.getElementById('auctionID').value=auctionID;
}

function validateMakeOffer(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 check=1;
	var iChars = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	var validationBg=document.myform.validationBg.value;
	if(myform.firstName.value==""){  
	visitor +=  "\n- Please enter first name."; 
	document.getElementById('r_1').style.backgroundColor=validationBg;
	
	}
	else
	{
	document.getElementById('r_1').style.backgroundColor='';
	
	}
	
	if(myform.lastName.value==""){ 
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_2').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	
	

	if(myform.address.value==""){   
		visitor +=  "\n- Please enter address."; 
		document.getElementById('r_4').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';
	}
	
	if(myform.city.value==""){   visitor +=  "\n- Please enter city."; 
		document.getElementById('r_5').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_5').style.backgroundColor='';
	}
	
	if(myform.state.value==""){   visitor +=  "\n- Please select state."; 
		document.getElementById('r_6').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_6').style.backgroundColor='';
	}
	
	if(myform.zip.value=="" ||(isNaN(myform.zip.value)) ||myform.zip.value.length<5){   visitor +=  "\n- Please enter zip. ( 5 digit number)"; 
		document.getElementById('r_7').style.backgroundColor=validationBg;	
	}
	else
	{
		document.getElementById('r_7').style.backgroundColor='';
	}
	
	
	var office=myform.office1.value+'-'+myform.office2.value+'-'+myform.office3.value;
		
	if(!isPhone_new(office)){   
		visitor +=  "\n- Please enter valid office phone. For eg:- 123-456-7890";
		document.getElementById('r_8').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_8').style.backgroundColor='';
	}
	
	var cell=myform.cell1.value+'-'+myform.cell2.value+'-'+myform.cell3.value;
		
if(myform.cell1.value!=''||myform.cell2.value!=''||myform.cell3.value!='')
{
	if(!isPhone_new(cell)){   
		visitor +=  "\n- Please enter valid cell phone. For eg:- 123-456-7890";
		document.getElementById('r_9').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_9').style.backgroundColor='';
	}
}
	var fax=myform.fax1.value+'-'+myform.fax2.value+'-'+myform.fax3.value;
if(myform.fax1.value!=''||myform.fax2.value!=''||myform.fax3.value!='')
{
	if(!isPhone_new(fax)){   
		visitor +=  "\n- Please enter valid fax number. For eg:- 123-456-7890";
		document.getElementById('r_10').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_10').style.backgroundColor='';
	}
}
	if (!IsEmailAddress(myform.email.value,'')) 
	{   visitor +=  "\n- Please enter valid email address.";
	  document.getElementById('r_11').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_11').style.backgroundColor='';
	}
	

	//if(myform.purchasePriceRange.value==""){   
		if(myform.purchasePriceRange.value==""){
		visitor +=  "\n- Please enter offer amount"; 
		document.getElementById('r_12').style.backgroundColor=validationBg;
		}
	else
	{
		document.getElementById('r_12').style.backgroundColor='';		
	}

	if(!myform.agree.checked){   visitor +=  "\n- Please check the I have read,... auction.";
	document.getElementById('r_13').style.backgroundColor=validationBg;
	}
	else
	{
		document.getElementById('r_13').style.backgroundColor='';
	}
	/*if(myform.firstName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.firstName.value.length; i++) {
  		if (iChars.indexOf(myform.firstName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_1').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
		visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in first name."; 
		document.getElementById('r_1').style.backgroundColor=validationBg;}
	}
	if(myform.lastName.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.lastName.value.length; i++) {
  		if (iChars.indexOf(myform.lastName.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_2').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in last name."; 
			 document.getElementById('r_2').style.backgroundColor=validationBg;}
	}
	
	if(myform.address.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.address.value.length; i++) {
  		if (iChars.indexOf(myform.address.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_4').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in address."; 
			 document.getElementById('r_4').style.backgroundColor=validationBg;}
	}
	if(myform.city.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.city.value.length; i++) {
  		if (iChars.indexOf(myform.city.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_5').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in city."; 
			 document.getElementById('r_5').style.backgroundColor=validationBg;}
	}
	if(myform.purchasePriceRange.value!=""){  
	cntCheck=0;
	for (var i = 0; i < myform.purchasePriceRange.value.length; i++) {
  		if (iChars.indexOf(myform.purchasePriceRange.value.charAt(i)) != -1) 
	  	{
 		document.getElementById('r_12').style.backgroundColor=validationBg;
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in offer amount."; 
			 document.getElementById('r_12').style.backgroundColor=validationBg;}
	}*/
	
	if(visitor!="")
	{
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{
		alert(MasterString);
		return false;
	}
	return true;
}