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 checkDisplay(show)
{
	//alert(show);
	if (isNav) {
		style = "table-row";
		style1 = "table";
	}
	else {
		style = "inline";
		style1 = "inline";
	}

//aler

	if(show!='1')
	{
		if(show=='2'){
			document.getElementById("spouseLastName").value=document.getElementById("primaryPurchaserLastName").value;
			document.getElementById("spouseAddress").value=document.getElementById("primaryPurchaserAddress").value;
			document.getElementById("spouseCity").value=document.getElementById("primaryPurchaserCity").value;
			document.getElementById("spouseZip").value=document.getElementById("primaryPurchaserZip").value;
			//document.getElementById("spouseState").value=document.getElementById("primaryPurchaserState").value;				
			document.getElementById("spouseCountry").value=document.getElementById("countryid").value;	
		}else{
			document.getElementById("spouseLastName").value='';
			document.getElementById("spouseAddress").value='';
			document.getElementById("spouseCity").value='';
			document.getElementById("spouseZip").value='';
			//document.getElementById("spouseState").value='';
		}
		
		
		document.getElementById("spouseTable").style.display = style1;
		
	if(document.getElementById('ssnStatus').value=='1') 
	{
		if(show=='2'){
		document.getElementById("s00").style.display = style1;
		document.getElementById("c00").style.display = 'none';
		}
		if(show=='3')
		{
		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 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='#F9F3C1';
	}
	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='#F9F3C1';
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	if(myform.countryid.value=="0") { visitor +=  "\n- Country is required."; 
		document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2123').style.backgroundColor='';
	}

	if(myform.primaryPurchaserAddress.value==""){   
		visitor +=  "\n- Please enter primary purchaser address.";
		document.getElementById('r_3').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserCity.value==""){
		visitor +=  "\n- Please enter primary purchaser city."; 
		document.getElementById('r_4').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';		
	}
	

	if(document.register_frm.countryid.value=='71' || document.register_frm.countryid.value=='145')
	{
		if(myform.primaryPurchaserZip.value=="" ||  myform.primaryPurchaserZip.value.length < 5){
			visitor +=  "\n- Please enter primary purcharser zip.(Minimum 5 digits.)";
			document.getElementById('r_6').style.backgroundColor='#F9F3C1';		
		}
		else
		{
			document.getElementById('r_6').style.backgroundColor='';		
		}
	}
	else
	{
		if(myform.primaryPurchaserZip.value=="" ||  myform.primaryPurchaserZip.value.length < 5){
			visitor +=  "\n- Please enter primary purcharser zip.";
			document.getElementById('r_6').style.backgroundColor='#F9F3C1';		
		}
		else
		{
			document.getElementById('r_6').style.backgroundColor='';		
		}
	}
	if(myform.signFirstName.value==""){   
		visitor +=  "\n- Please enter first name."; 
		document.getElementById('r_40').style.backgroundColor='#F9F3C1';
		document.getElementById('r_41').style.backgroundColor='#F9F3C1';
		}
	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='#F9F3C1';
		document.getElementById('r_43').style.backgroundColor='#F9F3C1';
		}
	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='#F9F3C1';
		document.getElementById('r_45').style.backgroundColor='#F9F3C1';	
		}
	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_40').style.backgroundColor='#F9F3C1';
			}
		document.getElementById('r_44').style.backgroundColor='';		
		document.getElementById('r_45').style.backgroundColor='';		
	}
	
	if(!myform.agree.checked){   visitor +=  "\n- You must acknowledge that you have read the Terms and Conditions.";
			document.getElementById('r_39').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_39').style.backgroundColor='';		
	}
	if(myform.countryid.value!="0"){
		if(myform.countryid.value=="296")
		{
			if(document.getElementById('countyCombo'))
			{
			if(document.getElementById('countyCombo').value=="0")
				{
				visitor +=  "\n- County is required."; 
				document.getElementById('r_5').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('r_5').style.backgroundColor='';
				}	
			}
		}
		else if(myform.countryid.value!="296")
		{
		if(document.getElementById('stateCombo'))
			{
			if(document.getElementById('stateCombo').value=="")
				{
				visitor +=  "\n- State is required."; 
				document.getElementById('r_5').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('r_5').style.backgroundColor='';
				}
			}
		}
			
			
	}

///////////// phone	and mobile validation BOC /////////////
	if(myform.countryid.value!="0")
		{
		//if(document.getElementById('stateCombo').value=='others')
		//{
			switch(myform.countryid.value){

				case"296"://UK

						if(document.getElementById('PhoneNum').value!=''){	
						var num=document.getElementById('PhoneNum').value;
						var totalspace=num.split(" ").length-1;
						var totalhyphen=num.split("-").length-1;
						var totalplus=num.split("+").length-1;

						if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
						{
							var phonenum=num.toString().replace(/\+|\-|\s/g,'');
							
							if(isNaN(phonenum) || (phonenum.length=='')){
								visitor +=  "\n- Please enter valid  primary purchaser phone. for ex. +44 020 1234 5678"; 
								document.getElementById('r_7').style.backgroundColor='#F9F3C1';
							}
							else if(phonenum.length>14)
							{
								visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
								document.getElementById('r_7').style.backgroundColor='#F9F3C1';
							}
							else
							{
								document.getElementById('r_7').style.backgroundColor='';
							}
							//document.getElementById('c_8').style.backgroundColor='';
						}
						else
						{
							visitor +=  "\n- Please enter valid  primary purchaser phone. for ex. +44 020 1234 5678"; 
							document.getElementById('r_7').style.backgroundColor='#F9F3C1';

						}
						
					}
					else
					{
						visitor +=  "\n- Please enter valid  primary purchaser phone. for ex. +44 020 1234 5678"; 
						document.getElementById('r_7').style.backgroundColor='#F9F3C1';
					}

		if(document.getElementById('mobileNum').value!='')
		{
				var monum=document.getElementById('mobileNum').value;
				var totalspace=monum.split(" ").length-1;
				var totalhyphen=monum.split("-").length-1;
				var totalplus=monum.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var mobilenum=monum.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(mobilenum) || (mobilenum.length=='')){
						visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678"; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else if(mobilenum.length>14)
					{
						visitor +=  "\n- Mobile number can only have a maximum of 14 digits."; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678."; 
					document.getElementById('r_8').style.backgroundColor='#F9F3C1';

				}
				
		}

			break;

			case"71"://US
			case"145"://Canada
			var PhoneNumber=myform.Phone1.value+'-'+myform.Phone2.value+'-'+myform.Phone3.value;

					if(myform.Phone1.value=='' && myform.Phone2.value=='' && myform.Phone3.value=='') 
					{
						 visitor +="\n- Please enter valid  primary purchaser phone. For eg:- 123-456-7890";
						
						 document.getElementById('r_7').style.backgroundColor='#F9F3C1';				
					}
					else if(myform.Phone1.value!='' || myform.Phone2.value!='' || myform.Phone3.value!='')
					{
						
						if(!isPhone_new(PhoneNumber))
						{    visitor +="\n- Please enter valid  primary purchaser phone. For eg:- 123-456-7890"; 
							document.getElementById('r_7').style.backgroundColor='#F9F3C1';
						}
					}
					else
					{
						document.getElementById('r_7').style.backgroundColor='';		
					}
					///////////

					var primaryPurchaserCell=myform.mobile1.value+'-'+myform.mobile2.value+'-'+myform.mobile3.value;
		
			if(myform.mobile1.value!='' || myform.mobile2.value!='' || myform.mobile3.value!='')
			{
				if(!isPhone_new(primaryPurchaserCell))
				{  visitor +="\n- Please enter valid  primary purchaser cell. For eg:- 123-456-7890"; 
				  document.getElementById('r_8').style.backgroundColor='#F9F3C1';	
				}
				else
				{
				  document.getElementById('r_8').style.backgroundColor='';		
				}
			}
					
			break;

			default:
				if(myform.PhoneNum.value=='')
				{  
					visitor +=  "\n- Please enter primary purchaser phone.";
					document.getElementById('r_7').style.backgroundColor='#F9F3C1';
				}
				else
				{
					document.getElementById('r_7').style.backgroundColor='';		
				}

			}
	}
///////////// phone	and mobile validation EOC /////////////
	

	
	
	
	//if(myform.primaryPurchaserEmail.value!='')
	//{
		if (!IsEmailAddress(myform.primaryPurchaserEmail.value,'')) 
		{
			visitor +=  '\n- Please enter primary purchaser email address';
			document.getElementById('r_9').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_9').style.backgroundColor='';		
		}

	//}

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

	if(document.getElementById("online_hidden_var") && (document.getElementById('online_hidden_var').value=='NormalEvent' || document.getElementById('online_hidden_var').value=='OnlineEvent'))
	{
		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='#F9F3C1';
			}
			else
			{
					for (var i = 0; i < myform.elements.length; i++){
						var e = myform.elements[i];
						if(e.type=="checkbox" && e.className == "chkParentVenue")
						{
							if(e.checked){
								var flagSimulcheck33=false;
								var thisVal=e.value;
								var childClassNm="chkChildVenue"+thisVal;
								for (var jk = 0; jk < myform.elements.length; jk++){
									var el = myform.elements[jk];
									if(el.type=="checkbox" && el.className == childClassNm){
										if(el.checked){
											flagSimulcheck33=true;
											break;
										}
									}
								}
								
							if(!flagSimulcheck33)
							{
								var errorSimul =  "\n- Please Select if you are attending the Main Venue or a Remote Location."; 
								document.getElementById('r_9_1').style.backgroundColor='#F9F3C1';
							}
							else
							{
								document.getElementById('r_9_1').style.backgroundColor='';	
							}

							}
						}
					}
					if(errorSimul){
						visitor +=errorSimul;
					}
			}
		}
	}
	
	//alert(flag);return false;
	/*if(myform.spouseOrCobuyer.value!=1)
	{
		if(myform.spouseFirstName.value==""){   
			visitor +=  "\n- Please enter co-buyer first name."; 
			document.getElementById('r_11').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_11').style.backgroundColor='';		
		}
		
		if(myform.spouseLastName.value==""){   
			visitor +=  "\n- Please enter co-buyer last name."; 
			document.getElementById('r_12').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_12').style.backgroundColor='';		
		}
		
		if(myform.spouseAddress.value==""){  
			visitor +=  "\n- Please enter co-buyer address."; 
			document.getElementById('r_13').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_13').style.backgroundColor='';		
		}
		
		if(myform.spouseCity.value==""){   
			visitor +=  "\n- Please enter co-buyer city."; 
			document.getElementById('r_14').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_14').style.backgroundColor='';		
		}
		

	if(myform.spouseCountry.value=="0"){	
			visitor +=  "\n- Please enter co-buyer country.";
				document.getElementById('r_121').style.backgroundColor='#F9F3C1';
			}else{
				document.getElementById('r_121').style.backgroundColor='';
			}
		
		



		if(myform.spouseCountry.value!="0"){
			
			if(myform.spouseCountry.value=="71" || myform.spouseCountry.value=="145")
			{
			
				if(myform.spouseWork1.value!='' && myform.spouseWork2.value!='' && myform.spouseWork3.value!='') 
				{
					var spousePhoneNumber=myform.spouseWork1.value+'-'+myform.spouseWork2.value+'-'+myform.spouseWork3.value;
					if(!isPhone_new(spousePhoneNumber))
					{
						visitor +=  "\n- Please enter  valid co-buyer phone.";
						document.getElementById('r_17').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_17').style.backgroundColor='';
					}
				}
				else
				{
					visitor +=  "\n- Please enter co-buyer phone.";
					document.getElementById('r_17').style.backgroundColor='#F9F3C1';
				}
			}
			
	else if(myform.spouseCountry.value=="296")
	{
		 
		 if(document.getElementById('spouseWork').value!='')
			{	
				var num=document.getElementById('spouseWork').value;
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid  co-buyer Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('r_17').style.backgroundColor='#F9F3C1';;
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- co-buyer Phone number can only have a maximum of 14 digits."; 
						document.getElementById('r_17').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_17').style.backgroundColor='';
					}
					
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid  co-buyer Phone no. For Ex. +44 020 1234 5678"; 
					document.getElementById('r_17').style.backgroundColor='#F9F3C1';;

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter co-buyer phone no. For Ex. +44 020 1234 5678"; 
				document.getElementById('r_17').style.backgroundColor='#F9F3C1';
			}	
		}
		
			else
			{
				if(myform.spouseWork.value==''){
					visitor +=  "\n- Please enter co-buyer phone.";
					document.getElementById('r_17').style.backgroundColor='#F9F3C1';
				}else{
					document.getElementById('r_17').style.backgroundColor='';
				}
			}
		}
 if(myform.spouseCountry.value!="0"){
if(document.getElementById('spouseCell').value!='')
		{
				if(isNaN(document.getElementById('mobileNum').value))
				{
					visitor +=  "\n- Please enter valid Mobile no. For Ex. 123456"; 
					document.getElementById('c_111').style.backgroundColor='#F9F3C1';
				}*/
			/*	var monum=document.getElementById('spouseCell').value;
				var totalspace=monum.split(" ").length-1;
				var totalhyphen=monum.split("-").length-1;
				var totalplus=monum.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var mobilenum=monum.toString().replace(/\+|\-|\s/g,'');
					
					//if(isNaN(phonenum) || (phonenum.length>14 || phonenum.length=='')){
					if(isNaN(mobilenum) || (mobilenum.length=='')){
						visitor +=  "\n- Please enter valid co-buyer Mobile no. for ex. +44 020 1234 5678"; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else if(mobilenum.length>14)
					{
						visitor +=  "\n- co-buyer Mobile number can only have a maximum of 14 digits."; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid co-buyer Mobile no. for ex. +44 020 1234 5678."; 
					document.getElementById('r_8').style.backgroundColor='#F9F3C1';

				}
				
		}
 }
		if(myform.spouseCountry.value=="296"){
			if(myform.spouseCounty){
				if(myform.spouseCounty.value=="0"){   
					visitor +=  "\n- Please select co-buyer county.";
					document.getElementById('r_15').style.backgroundColor='#F9F3C1';
				}
				else
				{
					document.getElementById('r_15').style.backgroundColor='';		
				}
			}	
		}
		else if(myform.spouseCountry.value!="296")
		{
			if(myform.spouseState){
				if(myform.spouseState.value==""){   
					visitor +=  "\n- Please select co-buyer state.";
					document.getElementById('r_15').style.backgroundColor='#F9F3C1';
				}
				else
				{
					document.getElementById('r_15').style.backgroundColor='';		
				}
			}
		}
		
		if(myform.spouseCountry.value=="71"){
			if(myform.spouseZip.value=="" ||  myform.spouseZip.value.length < 5){
				visitor +=  "\n- Please enter co-buyer zip. (Minimum 5 digit zip)"; 
				document.getElementById('r_16').style.backgroundColor='#F9F3C1';
			}
			else
			{
				document.getElementById('r_16').style.backgroundColor='';		
			}
		 }else{
			if(myform.spouseZip.value==""){
				visitor +=  "\n- Please enter co-buyer zip."; 
				document.getElementById('r_16').style.backgroundColor='#F9F3C1';
			}
			else
			{
				document.getElementById('r_16').style.backgroundColor='';		
			}
		}
		
	}
	*/
	
	/*if(!isCheckedRadio(myform.financing)){  
		visitor +=  "\n- Please select option for 'We plan to use Financing'."; 
			document.getElementById('r_new0').style.backgroundColor='#F9F3C1';	
	}
	
	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='#F9F3C1';	
		}
		else{document.getElementById('r_new2').style.backgroundColor='';}
		
		if(getCheckedValue(myform.financing)==2 && (myform.lenderContactPhone.value=='')){
			visitor +=  "\n- Please enter lender contact no."; 
			document.getElementById('r_new3').style.backgroundColor='#F9F3C1';	
		}
	}// end if radio financing is checked
	
	*/
	
	/*
	 if(myform.spouseEmail.value!='')
	{
		if (!IsEmailAddress(myform.spouseEmail.value,"")) 
		{
			visitor += '\n- Please enter spouse email address';
			document.getElementById('r_19').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_19').style.backgroundColor='';		
		}
		
	}
	

	if(getCheckedValue(myform.qualified)==''){   
		visitor +=  "\n- Please select if you would like to be pre-qualified or not."; 
		document.getElementById('r_31').style.backgroundColor='#F9F3C1';
		document.getElementById('r_31').style.color='#677384';
		}
	else
	{
		document.getElementById('r_31').style.backgroundColor='';	
		document.getElementById('r_31').style.color='';
	}
	
	if(getCheckedValue(myform.qualified)=="yes" && document.getElementById('auctionCombo').value!="")
	{  
	
	    if(myform.Employer.value==""){   
		visitor +=  "\n- Please enter employer."; 
		document.getElementById('r_20').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_20').style.backgroundColor='';		
		}
		
		
	if(myform.jobTitle.value==""){   
		visitor +=  "\n- Please enter job title."; 
		document.getElementById('r_21').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_21').style.backgroundColor='';		
	}
	
		
	if(myform.YearsAtJob.value=="" ||(isNaN(myform.YearsAtJob.value))){   
		visitor +=  "\n- Please enter years at job.For eg.10"; 
		document.getElementById('r_22').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_22').style.backgroundColor='';		
	}
	
	if(myform.grossAnnualIncome.value==""){   
		visitor +=  "\n- Please select annual household income.";
	    document.getElementById('r_25').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_25').style.backgroundColor='';		
	}
	
		
	if(myform.downPaymentAtPurchase.value==""){   
		visitor +=  "\n- Please select total down payment be at purchase."; 
	    document.getElementById('r_27').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_27').style.backgroundColor='';		
	}
		
		
	if(myform.sourceOfDownPayment.value==""){   
		visitor +=  "\n- Please select source of down payment funds."; 
	    document.getElementById('r_29').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_29').style.backgroundColor='';		
	}
		
	
	if(myform.creditHistory.value==""){   
		visitor +=  "\n- Please select describe your credit history."; 
	    document.getElementById('r_30').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_30').style.backgroundColor='';		
	}
		
	

	
	if(myform.firstTimeBuyer.value==""){   
		visitor +=  "\n- Please select first time buyer."; 
		document.getElementById('r_32').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_32').style.backgroundColor='';		
	}

	if(myform.occupyHomeOnPurchase.value==""){   
		visitor +=  "\n- Please select occupying the home you purchase."; 
		document.getElementById('r_34').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_34').style.backgroundColor='';		
	}
		
	
	if(myform.investor.value==""){   
		visitor +=  "\n- Please select  an investor."; 
		document.getElementById('r_35').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_35').style.backgroundColor='';		
	}
	
	if(myform.purchasePriceRange.value==""){   
		visitor +=  "\n- Please select purchase price range is."; 
		document.getElementById('r_37').style.backgroundColor='#F9F3C1';

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


	
	}
	

	if(getCheckedValue(myform.qualified)!=''){
		if(!myform.agree.checked){   visitor +=  "\n- You must acknowledge that you have read the Terms and Conditions.";
				document.getElementById('r_39').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_39').style.backgroundColor='';		
		}*/
		/*if(!myform.cwconsent.checked) { visitor +=  "\n- Please confirm your consent in the event your bid is successfully accepted.";
			document.getElementById('r_46').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_46').style.backgroundColor='';			
		}
		
		if(myform.signFirstName.value==""){   
			visitor +=  "\n- Please enter first name."; 
			document.getElementById('r_40').style.backgroundColor='#F9F3C1';
			document.getElementById('r_41').style.backgroundColor='#F9F3C1';
			}
		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='#F9F3C1';
			document.getElementById('r_43').style.backgroundColor='#F9F3C1';
			}
		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='#F9F3C1';
			document.getElementById('r_45').style.backgroundColor='#F9F3C1';	
			}
		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_40').style.backgroundColor='#F9F3C1';
				}
			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 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 = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	if(myform.firstName.value==""){  
	visitor +=  "\n- Please enter first name."; 
	document.getElementById('r_1').style.backgroundColor='#F9F3C1';
	
	}
	else
	{
	document.getElementById('r_1').style.backgroundColor='';
	
	}
	
	if(myform.lastName.value==""){ 
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_2').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	
	if(myform.companyName.value==""){   
		visitor +=  "\n- Please enter company name."; 
		document.getElementById('r_3').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';
	}

	if(myform.address.value==""){   
		visitor +=  "\n- Please enter address."; 
		document.getElementById('r_4').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';
	}
	
	if(myform.city.value==""){   visitor +=  "\n- Please enter city."; 
		document.getElementById('r_5').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_5').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='#F9F3C1';	
	}
	else
	{
		document.getElementById('r_7').style.backgroundColor='';
	}
	
		
	if(myform.stateCombo){
		if(myform.stateCombo.value=="" || myform.stateCombo.value==undefined){   visitor +=  "\n- State is required."; 
		document.getElementById('r_1111').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_1111').style.backgroundColor='';
		}
	}
	
	if(document.getElementById('stateCombo').value=='others')
	{
		if(document.getElementById('PhoneNum').value=='')
		{
			visitor +=  "\n- Please enter valid Phone no."; 
			document.getElementById('r_8').style.backgroundColor='#F9F3C1';
		}
		else if(document.getElementById('PhoneNum').value!='')
		{
			if(isNaN(document.getElementById('PhoneNum').value))
			{
				visitor +=  "\n- Please enter valid Phone no. For Ex. 123456"; 
				document.getElementById('r_8').style.backgroundColor='#F9F3C1';
			}
		}
		else
		{
			document.getElementById('r_8').style.backgroundColor='';		
		}

		if(document.getElementById('mobileNum').value!='')
		{
			if(isNaN(document.getElementById('mobileNum').value))
			{
				visitor +=  "\n- Please enter valid Mobile no. For Ex. 123456"; 
				document.getElementById('r_9').style.backgroundColor='#F9F3C1';
			}
		}
	}else {
		
		var office=myform.office1.value+'-'+myform.office2.value+'-'+myform.office3.value;
		if(myform.office1.value=='' && myform.office2.value=='' && myform.office3.value==''){
			visitor +=  "\n- Please enter valid office phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_8').style.backgroundColor='#F9F3C1';
		}
		else if(myform.office1.value=='' || myform.office2.value=='' || myform.office3.value==''){
			visitor +=  "\n- Incomplete office phone number. Please enter valid Phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_8').style.backgroundColor='#F9F3C1';
		}
		else if(!isPhone_new(office)){   
			visitor +=  "\n- Please enter valid office phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_8').style.backgroundColor='#F9F3C1';
		}
		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==''){
			visitor +=  "\n- Please enter valid cell phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_9').style.backgroundColor='#F9F3C1';
		}
		else if(myform.cell1.value=='' || myform.cell2.value=='' || myform.cell3.value==''){
			visitor +=  "\n- Incomplete cell phone number. Please enter valid cell phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_9').style.backgroundColor='#F9F3C1';
		}
		else if(!isPhone_new(cell)){   
			visitor +=  "\n- Please enter valid cell phone no. For eg:- 123-456-7890"; 
			document.getElementById('r_9').style.backgroundColor='#F9F3C1';
		}
		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==''){
		visitor +=  "\n- Please enter valid fax no. For eg:- 123-456-7890"; 
		document.getElementById('r_10').style.backgroundColor='#F9F3C1';
	}
	else if(myform.fax1.value=='' || myform.fax2.value=='' || myform.fax3.value==''){
		visitor +=  "\n- Incomplete fax number. Please enter valid fax no. For eg:- 123-456-7890"; 
		document.getElementById('r_10').style.backgroundColor='#F9F3C1';
	}
	else if(!isPhone_new(fax)){   
		visitor +=  "\n- Please enter valid fax no. For eg:- 123-456-7890"; 
		document.getElementById('r_10').style.backgroundColor='#F9F3C1';
	}
	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='#F9F3C1';
	}
	else
	{
		document.getElementById('r_11').style.backgroundColor='';
	}
	
	if(myform.brokerLicenceNumber.value==""){   
		visitor +=  "\n- Please enter broker licence number."; 
		document.getElementById('r_12').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_12').style.backgroundColor='';
	}
	
	
	if(myform.clientName.value=="" || myform.clientName1.value==""){   
		visitor +=  "\n- Please enter clients name."; 
		document.getElementById('ClientDetails').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('ClientDetails').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('ClientDetails').style.backgroundColor='#F9F3C1';
		if(myform.clientName.value!="" || myform.clientName1.value!="")
	  visitor +=  "\n- Please enter clients name.";
	}
	else if(myform.clientName.value!="" && myform.clientName1.value!="")
	{
		document.getElementById('ClientDetails').style.backgroundColor='';
	}
	
	
	if(myform.auctionCombo){
		if(myform.auctionCombo.value==""){
			visitor +=  "\n- Please select auction."; 
			document.getElementById('r_12_1').style.backgroundColor='#F9F3C1';
		}
		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='#F9F3C1';
			}
			else
			{
				document.getElementById('r_12_2').style.backgroundColor='';	
			}
		}
	}
	
	
	if(!myform.agree.checked){   visitor +=  "\n- You must acknowledge that you have read the Terms and Conditions.";
	document.getElementById('r_13').style.backgroundColor='#F9F3C1';
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
		visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in first name."; 
		document.getElementById('r_1').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in last name."; 
			 document.getElementById('r_2').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in company name."; 
			 document.getElementById('r_3').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in address."; 
			 document.getElementById('r_4').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in city."; 
			 document.getElementById('r_5').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in licence number."; 
			 document.getElementById('r_12').style.backgroundColor='#F9F3C1';}
	}*/
	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="";
	if(myform.department.value==""){   visitor +=  "\n- Please select a department."; 
	document.getElementById('c_1_1').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1_1').style.backgroundColor='';
	}
	if(myform.contactFirstName.value==""){   visitor +=  "\n- Please enter first name."; 
	document.getElementById('c_1').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1').style.backgroundColor='';
	}
	if(myform.contactLastName.value==""){   visitor +=  "\n- Please enter last Name."; 
	document.getElementById('c_2').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2').style.backgroundColor='';
	}
	if(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.stateCombo){
		if(myform.stateCombo.value=="" || myform.stateCombo.value==undefined){   visitor +=  "\n- State is required."; 
		document.getElementById('r_1111').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_1111').style.backgroundColor='';
		}
	}
	
	
	

				if(document.getElementById('countryid').value==71 || document.getElementById('countryid').value==145)
	{
		
		
		if((document.getElementById('Phone1').value=='') || (document.getElementById('Phone2').value=='' || document.getElementById('Phone3').value==''))
		{
			visitor +=  "\n- Please enter valid Phone no.For eg:- 123-456-7890"; 
			document.getElementById('c_8').style.backgroundColor='#F9F3C1';
		}
		else
		{
		var workNumber=document.getElementById('Phone1').value+'-'+document.getElementById('Phone2').value+'-'+document.getElementById('Phone3').value;
		
		
		
				if(!isPhone_new(workNumber))
			{
				
				visitor +=  "\n- Please enter valid office phone. For eg:- 123-456-7890";
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';

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

			}
		
		}
	}

	else if(document.getElementById('countryid').value==296) 
	{
	
			if(document.getElementById('PhoneNum').value!='')
			{	
				var num=document.getElementById('PhoneNum').value;
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('c_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
			}
	}

	else
	{
			 if(document.getElementById('PhoneNum').value!='')
			{
				if(isNaN(document.getElementById('PhoneNum').value))
					{
					visitor +=  "\n- Please enter valid Phone no. For Ex. 123456"; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
				else
					{
					document.getElementById('c_8').style.backgroundColor='';
					}

			}
		else
			{
				visitor +=  "\n- Please enter Phone no. For Ex. 123456"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
			}
	
	}


				
		if(document.getElementById('countryid').value==296)
		{

			if(document.getElementById('countyid').value =='0')
			{
				visitor +=  "\n- County is required"; 
				document.getElementById('co_1002').style.backgroundColor='#F9F3C1';
			}
		}
		
	if (!IsEmailAddress(myform.contactEmailAddress.value,'')) 
	{   visitor +=  "\n- Please enter valid email address.";
	document.getElementById('c_11').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_11').style.backgroundColor='';
	}
	
	if(myform.contactMessage.value==""){   visitor +=  "\n- Please enter message.";
	document.getElementById('c_10').style.backgroundColor='#F9F3C1';
	}
	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='#F9F3C1';
		}
		else
		{
			document.getElementById('c_12').style.backgroundColor='';
		}
		
		if(myform.contactTitle.value==""){   visitor +=  "\n- Please enter title.";
		document.getElementById('c_13').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('c_13').style.backgroundColor='';
		}
		if(myform.contactBusinessPhone.value==""){   visitor +=  "\n- Please enter business phone .";
		document.getElementById('c_14').style.backgroundColor='#F9F3C1';
		}
		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="";
	
	if (!IsEmailAddress(myform.email.value,'')) 
	{   visitor +=  "\n- Please enter a valid email address.";
	document.getElementById('c_100').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_100').style.backgroundColor='';
	}
	
	if(myform.password1.value=="")
	{   
	
	visitor +=  "\n- Please enter a password."; 
	document.getElementById('c_12').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_12').style.backgroundColor='';
	}
	
	if(myform.password1.value.length<8)
	{
		visitor +=  "\n- Password must be at least 8 characters."; 
		document.getElementById('c_12').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_12').style.backgroundColor='';
	}
	
	if(myform.confirmPassword.value=="")
	{   
	
	visitor +=  "\n- Please confirm your password."; 
	document.getElementById('c_13').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_13').style.backgroundColor='';
	}
	
	
	if(myform.password1.value!=myform.confirmPassword.value){   visitor +=  "\n- Password and  confirm password do not match."; 
	document.getElementById('c_13').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_13').style.backgroundColor='';
	}
	
	
	if(myform.firstName.value==""){   visitor +=  "\n- First name is required."; 
		document.getElementById('c_1').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1').style.backgroundColor='';
	}

	if(myform.lastName.value==""){   visitor +=  "\n- Last name is required."; 
	document.getElementById('c_2').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2').style.backgroundColor='';
	}

	if(myform.dateOfBirth.value=='' || myform.monthOfBirth.value=='' || myform.yearOfBirth.value=='') {  visitor +=  "\n- Day/Month/Year of birth is required."; 
	document.getElementById('c_2-123').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2-123').style.backgroundColor='';
	}













	if(myform.countryid.value=="0") { visitor +=  "\n- Country is required."; 
	document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
	}
	else
	{
	document.getElementById('c_2123').style.backgroundColor='';
	}

	if(myform.address.value==""){   visitor +=  "\n- Address is required."; 
	document.getElementById('c_1001').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1001').style.backgroundColor='';
	}

	if(myform.city.value==""){visitor +=  "\n- City is required."; 
	document.getElementById('c_1002').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1002').style.backgroundColor='';
	}



if(document.getElementById('countryid').value==296)// for country = UK 
	{
	
		if(myform.countyid.value=="" || myform.countyid.value=="0")
			{
			visitor +=  "\n- County is required."; 
			document.getElementById('co_1002').style.backgroundColor='#F9F3C1';
			}
		else
			{
			document.getElementById('co_1002').style.backgroundColor='';
			}
		
	
	}
	if(myform.stateCombo)
		{
		if(myform.stateCombo.value=="" || myform.stateCombo.value==undefined)
			{
			visitor +=  "\n- State is required."; 
			document.getElementById('r_1111').style.backgroundColor='#F9F3C1';
			}
		else
			{
			document.getElementById('r_1111').style.backgroundColor='';
			}
		}

//		if(document.getElementById('countryid').value==296)
//		{
//			if((document.getElementById('Phone1a').value=='') || (document.getElementById('Phone2a').value=='') || isNaN(document.getElementById('Phone1a').value)|| isNaN(document.getElementById('Phone2a').value))
//			{
//				visitor +=  "\n- Please enter valid Phone no.For eg:- 123-45678920"; 
//				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
//			}
//
//			if(document.getElementById('cellNumberUK').value!='')
//			{
//				if(isNaN(document.getElementById('mobile1a').value) || isNaN(document.getElementById('mobile2a').value))
//				{
//					visitor +=  "\n- Please enter valid Mobile no. For Ex. 123-45678920"; 
//					document.getElementById('c_111').style.backgroundColor='#F9F3C1';
//				}
//			}
//			
//			
//			if(document.getElementById('countyid').value =='0')
//			{
//				visitor +=  "\n- County is required"; 
//				document.getElementById('co_1002').style.backgroundColor='#F9F3C1';
//			}
//		}
//	
//		else if(document.getElementById('stateCombo').value=='others')
//		{
//			/*if((document.getElementById('Phone1a').value=='') || (document.getElementById('Phone2a').value==''))
//			{
//				visitor +=  "\n- Please enter valid Phone no.For eg:- 123-45678920"; 
//				document.getElementById('phoneNumber2').style.backgroundColor='#F9F3C1';
//			}*/
//			 if(document.getElementById('PhoneNum').value!='')
//			{
//				if(isNaN(document.getElementById('PhoneNum').value))
//				{
//					visitor +=  "\n- Please enter valid Phone no. For Ex. 123456"; 
//					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
//				}
//			}
//			else
//			{
//				document.getElementById('phoneNumber2').style.backgroundColor='';		
//			}
//
//			if(document.getElementById('mobileNum').value!='')
//			{
//				if(isNaN(document.getElementById('mobileNum').value))
//				{
//					visitor +=  "\n- Please enter valid Mobile no. For Ex. 123456"; 
//					document.getElementById('c_111').style.backgroundColor='#F9F3C1';
//				}
//			}
//		}else {
//				var contactMobile=myform.Phone1.value+'-'+myform.Phone2.value+'-'+myform.Phone3.value;
//				if(myform.Phone1.value=='' && myform.Phone2.value=='' && myform.Phone3.value=='')
//				{
//						
//						visitor +=  "\n- Please enter valid Phone no. For eg:- 123-456-7890"; 
//						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
//				}
//				/*if(myform.Phone1.value=='' || myform.Phone2.value=='' )
//				{
//					visitor +=  "\n- Incomplete Phone number. Please enter valid Phone no. For eg:- 123-456-7890"; 
//					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
//				}
//				else
//				{
//					document.getElementById('c_8').style.backgroundColor='';		
//				}*/
//		}

if(myform.zip.value=="")
			{  
			visitor +=  "\n- Postcode is required."; 
			document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
			}
		else if(myform.zip.value!='' && myform.countryid.value=="71")
			{
			if(isNaN(myform.zip.value))
				{
				visitor +=  "\n- Please enter valid zip code. For eg:- 12345"; 
				document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
				}
			else if(myform.zip.value.length < 5)
				{
					visitor +=  "\n- Please enter valid zip code.(Minimum 5 digits.)"; 
				document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('c_1004').style.backgroundColor='';
				}
			}
		else
			{
			document.getElementById('c_1004').style.backgroundColor='';
			}
///////////// phone	and mobile validation BOC /////////////
	
			switch(myform.countryid.value){
				case"296"://UK

						if(document.getElementById('PhoneNum').value!=''){	
						var num=document.getElementById('PhoneNum').value;
						var totalspace=num.split(" ").length-1;
						var totalhyphen=num.split("-").length-1;
						var totalplus=num.split("+").length-1;

						if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
						{
							var phonenum=num.toString().replace(/\+|\-|\s/g,'');
							
							if(isNaN(phonenum) || (phonenum.length=='')){
								visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
								document.getElementById('c_8').style.backgroundColor='#F9F3C1';
							}
							else if(phonenum.length>14)
							{
								visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
								document.getElementById('c_8').style.backgroundColor='#F9F3C1';
							}
							else
							{
								document.getElementById('c_8').style.backgroundColor='';
							}
							//document.getElementById('c_8').style.backgroundColor='';
						}
						else
						{
							visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
							document.getElementById('c_8').style.backgroundColor='#F9F3C1';

						}
						
					}
					else
					{
						visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
		///// Mobile check for login page BOC /////////////////////	

				if(document.getElementById('mobileNum').value!='')
		{
				var monum=document.getElementById('mobileNum').value;
				var totalspace=monum.split(" ").length-1;
				var totalhyphen=monum.split("-").length-1;
				var totalplus=monum.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var mobilenum=monum.toString().replace(/\+|\-|\s/g,'');
					
					//if(isNaN(phonenum) || (phonenum.length>14 || phonenum.length=='')){
					if(isNaN(mobilenum) || (mobilenum.length=='')){
						visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_111').style.backgroundColor='#F9F3C1';
					}
					else if(mobilenum.length>14)
					{
						visitor +=  "\n- Mobile number can only have a maximum of 14 digits."; 
						document.getElementById('c_111').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('c_111').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678."; 
					document.getElementById('c_111').style.backgroundColor='#F9F3C1';

				}
				
		}
		///// Mobile check for login page EOC /////////////////////	

			break;

			case"71"://US
			case"145"://Canada
					if(myform.Phone1.value=='' && myform.Phone2.value=='' && myform.Phone3.value=='') 
					{
						 visitor +=  "\n- Please enter valid contact phone. For eg:- 123-456-7890"; 
						 document.getElementById('c_8').style.backgroundColor='#F9F3C1';				
					}
					else if(myform.Phone1.value!='' || myform.Phone2.value!='' || myform.Phone3.value=='')
					{
						var contactPhone=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='#F9F3C1';
						}
					}
					else
					{
						document.getElementById('c_8').style.backgroundColor='';		
					}
					///////////
					var contactMobile=myform.mobile1.value+'-'+myform.mobile2.value+'-'+myform.mobile3.value;
				
					if(myform.mobile1.value!='' || myform.mobile2.value!='' || myform.mobile3.value!='')
					{
						if(!isPhone_new(contactMobile))
						{  visitor +="\n- Please enter valid  mobile. For eg:- 123-456-7890"; 
						  document.getElementById('c_111').style.backgroundColor='#F9F3C1';	
						}
						else
						{
						  document.getElementById('c_111').style.backgroundColor='';		
						}
					}
			break;

			default:
				if(myform.PhoneNum.value=='')
				{  
					visitor +=  "\n- Please enter valid contact phone."; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
				}
				else
				{
					document.getElementById('c_8').style.backgroundColor='';		
				}

			}

///////////// phone	and mobile validation EOC /////////////



/////////// Phone Number Check for login page BOC /////////////
/*if(document.getElementById('countryid').value==71 || document.getElementById('countryid').value==145)
	{// for country=US or Canada
		
		
		if((document.getElementById('Phone1').value=='') || (document.getElementById('Phone2').value=='' || document.getElementById('Phone3').value==''))
		{
			visitor +=  "\n- Please enter valid Phone no.For eg:- 123-456-7890"; 
			document.getElementById('c_8').style.backgroundColor='#F9F3C1';
		}
		else
		{
		var workNumber=document.getElementById('Phone1').value+'-'+document.getElementById('Phone2').value+'-'+document.getElementById('Phone3').value;
		
		
		
				if(!isPhone_new(workNumber))
			{
				
				visitor +=  "\n- Please enter valid office phone. For eg:- 123-456-7890";
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';

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

			}
		
		}
	}
	else if(document.getElementById('countryid').value==296)
	{// for country=UK
			 if(document.getElementById('PhoneNum').value!='')
			{	
				var num=document.getElementById('PhoneNum').value;
				
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					//if(isNaN(phonenum) || (phonenum.length>14 || phonenum.length=='')){
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('c_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678."; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
			}
	
	}
	else
	{
		 if(document.getElementById('PhoneNum').value!='')
			{
				document.getElementById('c_8').style.backgroundColor='';	
			}
			else
			{
				visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';

			}
		
	}*/
/////////// Phone Number Check for login page EOC /////////////

/*		 if(document.getElementById('PhoneNum').value!='')
			{
				if(isNaN(document.getElementById('PhoneNum').value))
					{
					visitor +=  "\n- Please enter valid Phone no. For Ex. 123456"; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
				else
					{
					document.getElementById('c_8').style.backgroundColor='';
					}

			}
		else
			{
				visitor +=  "\n- Please enter Phone no. For Ex. 123456"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
			}
		*/	
	

		
		

		
		
		if(myform.name.value==0)
		{ visitor+=" \n- Please select a hint question.";
			document.getElementById('c_20').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('c_20').style.backgroundColor='';
		}
	
	if(myform.hintAnswer.value==""){   visitor +=  "\n- Please provide an answer to the hint question."; 
	document.getElementById('c_30').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_30').style.backgroundColor='';
	}	
	
	if(myform.heardAboutUs.value=="")
	{
		visitor +=  "\n- Please let us know how you heard about us.";
		document.getElementById('c_30_0123').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('c_30_0123').style.backgroundColor='';	
	}	
		
	if(myform.imagecode.value==""){
		visitor +=  "\n- Please enter Verification Code.";
		document.getElementById('c_31').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_31').style.backgroundColor='';
	}	

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

//update profile validations
function validateUpdateProfile(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 a valid email address.";
		document.getElementById('c_100').style.backgroundColor='#F9F3C1';
	}
	else{
		document.getElementById('c_100').style.backgroundColor='';
	}
	
	
	if(myform.firstName.value==""){   visitor +=  "\n- First name is required."; 
		document.getElementById('c_1').style.backgroundColor='#F9F3C1';
	}
	else{
		document.getElementById('c_1').style.backgroundColor='';
	}

	if(myform.lastName.value==""){   visitor +=  "\n- Last name is required."; 
		document.getElementById('c_2').style.backgroundColor='#F9F3C1';
	}
	else{
		document.getElementById('c_2').style.backgroundColor='';
	}

	if(myform.dateOfBirth.value=='' || myform.monthOfBirth.value=='' || myform.yearOfBirth.value=='') {  visitor +=  "\n- Day/Month/Year of birth is required."; 
	document.getElementById('c_2-123').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2-123').style.backgroundColor='';
	}



	if(myform.countryid.value=="0") { 
		visitor +=  "\n- Country is required."; 
		document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
	}
	else{
		document.getElementById('c_2123').style.backgroundColor='';
	}

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


	if(myform.stateCombo)
		{
		if(myform.stateCombo.value=="" || myform.stateCombo.value==undefined)
			{
			visitor +=  "\n- State is required."; 
			document.getElementById('r_1111').style.backgroundColor='#F9F3C1';
			}
		else
			{
			document.getElementById('r_1111').style.backgroundColor='';
			}
		}

	if(myform.city.value==""){visitor +=  "\n- City is required."; 
	document.getElementById('c_1002').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_1002').style.backgroundColor='';
	}

	if(myform.zip.value=="")
		{  
		visitor +=  "\n- Post Code is required."; 
		document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
		}
	else if(myform.zip.value!='' && myform.countryid.value=="71")
		{
			if(isNaN(myform.zip.value))
			{
				visitor +=  "\n- Please enter valid zip code. For eg:- 123456"; 
				document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
			}
		
			else if(myform.zip.value.length < 5)
				{
					visitor +=  "\n- Please enter valid zip code.(Minimum 5 digits.)"; 
				document.getElementById('c_1004').style.backgroundColor='#F9F3C1';
				}
		else
			{
			document.getElementById('c_1004').style.backgroundColor='';
			}
		}
	else
		{
		document.getElementById('c_1004').style.backgroundColor='';
		}
///////////// phone	and mobile validation BOC /////////////
	switch(myform.countryid.value){

			case"296"://UK
			/////// UK 	
		 if(document.getElementById('PhoneNum').value!='')
			{	
				var num=document.getElementById('PhoneNum').value;
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('c_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
			}
			
			///// Mobile check for login page BOC /////////////////////	

				if(document.getElementById('mobileNum').value!='')
		{
				var monum=document.getElementById('mobileNum').value;
				var totalspace=monum.split(" ").length-1;
				var totalhyphen=monum.split("-").length-1;
				var totalplus=monum.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var mobilenum=monum.toString().replace(/\+|\-|\s/g,'');
					
					//if(isNaN(phonenum) || (phonenum.length>14 || phonenum.length=='')){
					if(isNaN(mobilenum) || (mobilenum.length=='')){
						visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678"; 
						document.getElementById('c_111').style.backgroundColor='#F9F3C1';
					}
					else if(mobilenum.length>14)
					{
						visitor +=  "\n- Mobile number can only have a maximum of 14 digits."; 
						document.getElementById('c_111').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('c_111').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678."; 
					document.getElementById('c_111').style.backgroundColor='#F9F3C1';

				}
				
		}
		///// Mobile check for login page EOC /////////////////////	
			break;

			case"71":// US
			case"145"://Canada
				PhoneNum=myform.Phone1.value+'-'+myform.Phone2.value+'-'+myform.Phone3.value;
				if(myform.Phone1.value=='' || myform.Phone2.value=='' || myform.Phone3.value=='')
				{  
					visitor +=  "\n- Please enter valid contact phone. For eg:- 123-456-7890";
				document.getElementById('c_8').style.backgroundColor='#F9F3C1';
				}
				else if(PhoneNum!=''){
				if(!isPhone_new(PhoneNum))
				{
					 visitor +=  "\n- Please enter valid contact phone. For eg:- 123-456-7890"; 
					document.getElementById('c_8').style.backgroundColor='#F9F3C1';
				}
				else
				{
					document.getElementById('c_8').style.backgroundColor='';		
				}	
				}

				///////////
					var contactMobile=myform.mobile1.value+'-'+myform.mobile2.value+'-'+myform.mobile3.value;

					if(myform.mobile1.value!='' || myform.mobile2.value!='' || myform.mobile3.value!='')
					{
						if(!isPhone_new(contactMobile))
						{  visitor +="\n- Please enter valid  mobile. For eg:- 123-456-7890"; 
						  document.getElementById('c_111').style.backgroundColor='#F9F3C1';	
						}
						else
						{
						  document.getElementById('c_111').style.backgroundColor='';		
						}
					}
					/////////////
				break;
				default:
					if(myform.PhoneNum.value=='')
						{  
						visitor +=  "\n- Please enter valid contact phone."; 
						document.getElementById('c_8').style.backgroundColor='#F9F3C1';
						}
					else
						{
						document.getElementById('c_8').style.backgroundColor='';		
						}
	}
///////////// phone	and mobile validation EOC /////////////

	
	
		
	if(myform.name.value==0){ 
		visitor+=" \n- Please select a hint question.";
		document.getElementById('c_20').style.backgroundColor='#F9F3C1';
	}
	else{
		document.getElementById('c_20').style.backgroundColor='';
	}
	
	if(myform.hintAnswer.value==""){
		visitor +=  "\n- Please provide an answer to the hint question."; 
		document.getElementById('c_30').style.backgroundColor='#F9F3C1';
	}
	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.EmailAddress.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 isPhone_uk(string) {
	if (string.search(/^([0-9]){3}-[0-9]{8}$/) != -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 = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	if(myform.primaryPurchaserFirstName.value==""){   
		visitor +=  "\n- Please enter primary purcharser first name."; 
		document.getElementById('r_1').style.backgroundColor='#F9F3C1';
	}
	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='#F9F3C1';
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	if(myform.countryid.value=="0") { visitor +=  "\n- Country is required."; 
		document.getElementById('c_2123').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('c_2123').style.backgroundColor='';
	}

	if(myform.primaryPurchaserAddress.value==""){   
		visitor +=  "\n- Please enter primary purchaser address.";
		document.getElementById('r_3').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('r_3').style.backgroundColor='';		
	}
	if(myform.primaryPurchaserCity.value==""){
		visitor +=  "\n- Please enter primary purchaser city."; 
		document.getElementById('r_4').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';		
	}
	
	



if(myform.primaryPurchaserZip.value=="")
			{  
			visitor +=  "\n- Zip is required."; 
			document.getElementById('r_6').style.backgroundColor='#F9F3C1';
			}
		else if(myform.primaryPurchaserZip.value!='' && myform.countryid.value=="71")
			{
			if(isNaN(myform.primaryPurchaserZip.value))
				{
				visitor +=  "\n- Please enter valid zip code. For eg:- 12345"; 
				document.getElementById('r_6').style.backgroundColor='#F9F3C1';
				}
			else if(myform.primaryPurchaserZip.value.length < 5)
				{
					visitor +=  "\n- Please enter valid zip code.(Minimum 5 digits.)"; 
				document.getElementById('r_6').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('r_6').style.backgroundColor='';
				}
			}
		else
			{
			document.getElementById('r_6').style.backgroundColor='';
			}







/*	if(myform.primaryPurchaserZip.value=="" ||  myform.primaryPurchaserZip.value.length < 5){
		visitor +=  "\n- Please enter primary purcharser zip. (Minimum 5 digit zip).";
		document.getElementById('r_6').style.backgroundColor='#F9F3C1';		
	}
	else
	{
		document.getElementById('r_6').style.backgroundColor='';		
	}

*/
	if(myform.countryid.value!="0"){

		if(myform.countryid.value=="296")
		{
			if(document.getElementById('countyCombo'))
			{
			if(document.getElementById('countyCombo').value=="0")
				{
				visitor +=  "\n- County is required."; 
				document.getElementById('r_5').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('r_5').style.backgroundColor='';
				}	
			}
		}
		else if(myform.countryid.value!="296")
		{
		if(document.getElementById('stateCombo'))
			{
			if(document.getElementById('stateCombo').value=="")
				{
				visitor +=  "\n- State is required."; 
				document.getElementById('r_5').style.backgroundColor='#F9F3C1';
				}
			else
				{
				document.getElementById('r_5').style.backgroundColor='';
				}
			}
		}
			
	}

	if(myform.countryid.value!="0"){
		
		if(myform.countryid.value=="71" || myform.countryid.value=="145")
			{
				if(myform.Phone1.value!='')
				{
					PhoneNumber=myform.Phone1.value+'-'+myform.Phone2.value+'-'+myform.Phone3.value;
				
						if(!isPhone_new(PhoneNumber)){
						visitor +=  "\n- Please enter valid primary purchaser phone.";
						document.getElementById('r_7').style.backgroundColor='#F9F3C1';
						}
					else{
						document.getElementById('r_7').style.backgroundColor='';
						}
				}
				else
				{
					visitor +=  "\n- Please enter primary purchaser phone.";
				document.getElementById('r_7').style.backgroundColor='#F9F3C1';
				}
			}
		else if(myform.countryid.value=="296")
		{
			 if(document.getElementById('PhoneNum').value!='')
			{	
				var num=document.getElementById('PhoneNum').value;
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((num.charAt(0)=='+' && totalplus<=1) || (num.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
						document.getElementById('r_7').style.backgroundColor='#F9F3C1';;
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- Phone number can only have a maximum of 14 digits."; 
						document.getElementById('r_7').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_7').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
					document.getElementById('r_7').style.backgroundColor='#F9F3C1';

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter valid Phone no. for ex. +44 020 1234 5678"; 
				document.getElementById('r_7').style.backgroundColor='#F9F3C1';
			}
			
		if(document.getElementById('mobileNum').value!='')
		{
				var monum=document.getElementById('mobileNum').value;
				var totalspace=monum.split(" ").length-1;
				var totalhyphen=monum.split("-").length-1;
				var totalplus=monum.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var mobilenum=monum.toString().replace(/\+|\-|\s/g,'');
					
					//if(isNaN(phonenum) || (phonenum.length>14 || phonenum.length=='')){
					if(isNaN(mobilenum) || (mobilenum.length=='')){
						visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678"; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else if(mobilenum.length>14)
					{
						visitor +=  "\n- Mobile number can only have a maximum of 14 digits."; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_8').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid Mobile no. for ex. +44 020 1234 5678."; 
					document.getElementById('r_8').style.backgroundColor='#F9F3C1';

				}
				
		}
			
			
		}
		else
			{
				if(myform.PhoneNum.value==''){
				visitor +=  "\n- Please enter primary purchaser phone.";
				document.getElementById('r_7').style.backgroundColor='#F9F3C1';
				}
				else{
					document.getElementById('r_7').style.backgroundColor='';
					}
			}
	}

	if(myform.frm.value=='brochure')
	{
		if (!IsEmailAddress(myform.primaryPurchaserEmail.value,'')) 
		{
			visitor +=  '\n- Please enter primary purchaser email address';
			document.getElementById('r_9').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_9').style.backgroundColor='';		
		}
		
	}
//	else if(myform.frm.value=='internal_frm')
//	{
//		if(myform.primaryPurchaserEmail.value!='')
//		{
//			if (!IsEmailAddress(myform.primaryPurchaserEmail.value,'')) 
//			{
//				visitor +=  '\n- Invalid primary purchaser email address';
//				document.getElementById('r_9').style.backgroundColor='#F9F3C1';
//			}
//			else
//			{
//				document.getElementById('r_9').style.backgroundColor='';		
//			}
//		}
//	}

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

	if(document.getElementById("online_hidden_var") && (document.getElementById('online_hidden_var').value=='NormalEvent' || document.getElementById('online_hidden_var').value=='OnlineEvent'))
	{
		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='#F9F3C1';
			}
			else
			{
					for (var i = 0; i < myform.elements.length; i++){
						var e = myform.elements[i];
						if(e.type=="checkbox" && e.className == "chkParentVenue")
						{
							if(e.checked){
								var flagSimulcheck33=false;
								var thisVal=e.value;
								var childClassNm="chkChildVenue"+thisVal;
								for (var jk = 0; jk < myform.elements.length; jk++){
									var el = myform.elements[jk];
									if(el.type=="checkbox" && el.className == childClassNm){
										if(el.checked){
											flagSimulcheck33=true;
											break;
										}
									}
								}
								
							if(!flagSimulcheck33)
							{
								var errorSimul =  "\n- Please Select if you are attending the Main Venue or a Remote Location."; 
								document.getElementById('r_9_1').style.backgroundColor='#F9F3C1';
							}
							else
							{
								document.getElementById('r_9_1').style.backgroundColor='';	
							}

							}
						}
					}
					if(errorSimul){
						visitor +=errorSimul;
					}
			}
		}
	}
	
	
	if(myform.spouseOrCobuyer.value!=1)
	{
		if(myform.spouseFirstName.value==""){   
			visitor +=  "\n- Please enter co-buyer first name."; 
			document.getElementById('r_11').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_11').style.backgroundColor='';		
		}
		
		if(myform.spouseLastName.value==""){   
			visitor +=  "\n- Please enter co-buyer last name."; 
			document.getElementById('r_12').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_12').style.backgroundColor='';		
		}
		
		if(myform.spouseAddress.value==""){  
			visitor +=  "\n- Please enter co-buyer address."; 
			document.getElementById('r_13').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_13').style.backgroundColor='';		
		}
		
		if(myform.spouseCity.value==""){   
			visitor +=  "\n- Please enter co-buyer city."; 
			document.getElementById('r_14').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_14').style.backgroundColor='';		
		}
		
		
			



if(myform.spouseCountry.value!="0"){
		
		if(myform.spouseCountry.value=="71" || myform.spouseCountry.value=="145")
			{
				if(myform.spouseWork1.value!='')
				{
					PhoneNumber=myform.spouseWork1.value+'-'+myform.spouseWork2.value+'-'+myform.spouseWork3.value;
				
						if(!isPhone_new(PhoneNumber)){
						visitor +=  "\n- Please enter valid co-buyer phone.";
						document.getElementById('r_17').style.backgroundColor='#F9F3C1';
						}
					else{
						document.getElementById('r_17').style.backgroundColor='';
						}
				}
				else
				{
					visitor +=  "\n- Please enter co-buyer phone.";
				document.getElementById('r_17').style.backgroundColor='#F9F3C1';
				}
			}
else if(myform.spouseCountry.value=="296")
	{
		  
		 if(document.getElementById('spouseWork').value!='')
			{	
				var num=document.getElementById('spouseWork').value;
				var totalspace=num.split(" ").length-1;
				var totalhyphen=num.split("-").length-1;
				var totalplus=num.split("+").length-1;
			
				if((((monum.charAt(0)=='+' && totalplus<=1) || (monum.charAt(0)!='+' && totalplus==0)) && (totalspace<=1 && totalhyphen>=0) || (totalspace>=1)))
				{
					var phonenum=num.toString().replace(/\+|\-|\s/g,'');
					
					if(isNaN(phonenum) || (phonenum.length=='')){
						visitor +=  "\n- Please enter valid co-buyer Phone no. For Ex. +44 020 1234 5678"; 
						document.getElementById('r_17').style.backgroundColor='#F9F3C1';;
					}
					else if(phonenum.length>14)
					{
						visitor +=  "\n- co-buyer Phone no. can only have a maximum of 14 digits."; 
						document.getElementById('r_8').style.backgroundColor='#F9F3C1';
					}
					else
					{
						document.getElementById('r_17').style.backgroundColor='';
					}
					//document.getElementById('c_8').style.backgroundColor='';
				}
				else
				{
					visitor +=  "\n- Please enter valid  co-buyer Phone no. For Ex. +44 020 1234 5678"; 
					document.getElementById('r_17').style.backgroundColor='#F9F3C1';

				}
				
			}
		else
			{
				visitor +=  "\n- Please enter co-buyer phone no. For Ex. +44 020 1234 5678"; 
				document.getElementById('r_17').style.backgroundColor='#F9F3C1';
			}

	}
		else
			{
				if(myform.spouseWork.value==''){
				visitor +=  "\n- Please enter co-buyer phone.";
				document.getElementById('r_17').style.backgroundColor='#F9F3C1';
				}
				else{
					document.getElementById('r_17').style.backgroundColor='';
					}
			}
	}



		if(myform.spouseCountry.value=="296")
		{
			if(myform.spouseCounty){
			if(myform.spouseCounty.value=="0"){   
				visitor +=  "\n- Please select co-buyer county.";
				document.getElementById('r_15').style.backgroundColor='#F9F3C1';
			}
			else
			{
				document.getElementById('r_15').style.backgroundColor='';		
			}
		}	
		}
		else if(myform.spouseCountry.value!="296")
		{
		if(myform.spouseState){
			if(myform.spouseState.value==""){   
				visitor +=  "\n- Please select co-buyer state.";
				document.getElementById('r_15').style.backgroundColor='#F9F3C1';
			}
			else
			{
				document.getElementById('r_15').style.backgroundColor='';		
			}
		}
		}
	
		if(myform.spouseZip.value=="" ||  myform.spouseZip.value.length < 5){
			visitor +=  "\n- Please enter co-buyer zip. (Minimum 5 digit zip)"; 
			document.getElementById('r_16').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_16').style.backgroundColor='';		
		}	
	}

	if(myform.registerForAuction.checked)
	{
		
		if(!isCheckedRadio(myform.financing)){  
		visitor +=  "\n- Please select option for 'We plan to use Financing'."; 
			document.getElementById('r_new0').style.backgroundColor='#F9F3C1';	
	}
	
	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='#F9F3C1';	
		}
		else{document.getElementById('r_new2').style.backgroundColor='';}
		
		if(getCheckedValue(myform.financing)==2 && (myform.lenderContactPhone.value=='')){
			visitor +=  "\n- Please complete lender contact no."; 
			document.getElementById('r_new3').style.backgroundColor='#F9F3C1';	
		}
	}// end if radio financing is checked
	
	
	
	/*
	 if(myform.spouseEmail.value!='')
	{
		if (!IsEmailAddress(myform.spouseEmail.value,"")) 
		{
			visitor += '\n- Please enter spouse email address';
			document.getElementById('r_19').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_19').style.backgroundColor='';		
		}
		
	}
	*/

	if(getCheckedValue(myform.qualified)==''){   
		visitor +=  "\n- Please select if you would like to be pre-qualified or not."; 
		document.getElementById('r_31').style.backgroundColor='#F9F3C1';
		document.getElementById('r_31').style.color='#677384';
		}
	else
	{
		document.getElementById('r_31').style.backgroundColor='';	
		document.getElementById('r_31').style.color='';
	}
	
	if(getCheckedValue(myform.qualified)=="yes" && document.getElementById('auctionCombo').value!="")
	{  
	
	    if(myform.Employer.value==""){   
		visitor +=  "\n- Please enter employer."; 
		document.getElementById('r_20').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_20').style.backgroundColor='';		
		}
		
		
	if(myform.jobTitle.value==""){   
		visitor +=  "\n- Please enter job title."; 
		document.getElementById('r_21').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_21').style.backgroundColor='';		
	}
	
		
	if(myform.YearsAtJob.value=="" ||(isNaN(myform.YearsAtJob.value))){   
		visitor +=  "\n- Please enter years at job.For eg.10"; 
		document.getElementById('r_22').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_22').style.backgroundColor='';		
	}
	
	if(myform.grossAnnualIncome.value==""){   
		visitor +=  "\n- Please select annual household income.";
	    document.getElementById('r_25').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_25').style.backgroundColor='';		
	}
	
		
	if(myform.downPaymentAtPurchase.value==""){   
		visitor +=  "\n- Please select total down payment be at purchase."; 
	    document.getElementById('r_27').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_27').style.backgroundColor='';		
	}
		
		
	if(myform.sourceOfDownPayment.value==""){   
		visitor +=  "\n- Please select source of down payment funds."; 
	    document.getElementById('r_29').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_29').style.backgroundColor='';		
	}
		
	
	if(myform.creditHistory.value==""){   
		visitor +=  "\n- Please select describe your credit history."; 
	    document.getElementById('r_30').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_30').style.backgroundColor='';		
	}
		
	

	
	if(myform.firstTimeBuyer.value==""){   
		visitor +=  "\n- Please select first time buyer."; 
		document.getElementById('r_32').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_32').style.backgroundColor='';		
	}

	if(myform.occupyHomeOnPurchase.value==""){   
		visitor +=  "\n- Please select occupying the home you purchase."; 
		document.getElementById('r_34').style.backgroundColor='#F9F3C1';
		}
	else
	{
		document.getElementById('r_34').style.backgroundColor='';		
	}
		
	
	if(myform.investor.value==""){   
		visitor +=  "\n- Please select  an investor."; 
		document.getElementById('r_35').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_35').style.backgroundColor='';		
	}
	
	if(myform.purchasePriceRange.value==""){   
		visitor +=  "\n- Please select purchase price range is."; 
		document.getElementById('r_37').style.backgroundColor='#F9F3C1';

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


	
	}
	

	if(getCheckedValue(myform.qualified)!=''){
		if(!myform.agree.checked){   visitor +=  "\n- You must acknowledge that you have read the Terms and Conditions.";
				document.getElementById('r_39').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_39').style.backgroundColor='';		
		}
		/*if(!myform.cwconsent.checked) { visitor +=  "\n- Please confirm your consent in the event your bid is successfully accepted.";
			document.getElementById('r_46').style.backgroundColor='#F9F3C1';
		}
		else
		{
			document.getElementById('r_46').style.backgroundColor='';			
		}*/
		
		if(myform.signFirstName.value==""){   
			visitor +=  "\n- Please enter first name."; 
			document.getElementById('r_40').style.backgroundColor='#F9F3C1';
			document.getElementById('r_41').style.backgroundColor='#F9F3C1';
			}
		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='#F9F3C1';
			document.getElementById('r_43').style.backgroundColor='#F9F3C1';
			}
		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='#F9F3C1';
			document.getElementById('r_45').style.backgroundColor='#F9F3C1';	
			}
		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_40').style.backgroundColor='#F9F3C1';
				}
			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('r_finan').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('r_finan').style.display='none';
				document.getElementById('show_2').style.display='none';
		}
}

var count=0;
var count1=0;
var toBeView=4;
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 = "!@#$%^&*()+=-[]\';,./{}|\":<>?";
	if(myform.firstName.value==""){  
	visitor +=  "\n- Please enter first name."; 
	document.getElementById('r_1').style.backgroundColor='#F9F3C1';
	
	}
	else
	{
	document.getElementById('r_1').style.backgroundColor='';
	
	}
	
	if(myform.lastName.value==""){ 
		visitor +=  "\n- Please enter last name."; 
		document.getElementById('r_2').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_2').style.backgroundColor='';
	}
	
	

	if(myform.address.value==""){   
		visitor +=  "\n- Please enter address."; 
		document.getElementById('r_4').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_4').style.backgroundColor='';
	}
	
	if(myform.city.value==""){   visitor +=  "\n- Please enter city."; 
		document.getElementById('r_5').style.backgroundColor='#F9F3C1';
	}
	else
	{
		document.getElementById('r_5').style.backgroundColor='';
	}
	
	if(myform.state.value==""){   visitor +=  "\n- Please select state."; 
		document.getElementById('r_6').style.backgroundColor='#F9F3C1';	
	}
	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='#F9F3C1';	
	}
	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='#F9F3C1';
	}
	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='#F9F3C1';
	}
	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='#F9F3C1';
	}
	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='#F9F3C1';
	}
	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='#F9F3C1';
		}
	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='#F9F3C1';
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
		visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in first name."; 
		document.getElementById('r_1').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in last name."; 
			 document.getElementById('r_2').style.backgroundColor='#F9F3C1';}
	}
	
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in address."; 
			 document.getElementById('r_4').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in city."; 
			 document.getElementById('r_5').style.backgroundColor='#F9F3C1';}
	}
	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='#F9F3C1';
		cntCheck++;

  		}
		 }	
		 if(cntCheck>0){
			 visitor +=  "\n- You have used "+cntCheck+" special chars inlist (!@#$%^&*()+=-[]\';,./{}|\":<>?) in offer amount."; 
			 document.getElementById('r_12').style.backgroundColor='#F9F3C1';}
	}*/
	
	if(visitor!="")
	{
		MasterString=MasterString + visitor;
		flag=true;
	}
	if(flag==true)
	{
		alert(MasterString);
		return false;
	}
	return true;
}


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 tabForward(field1Name,field2Name,len){
	var length=document.getElementById(field1Name).value.length;
	if(len==length)
		document.getElementById(field2Name).focus();
	
}
function validateSearch()
{
	var flag_fill=0;
	if(document.getElementById('location').value!='' 
	&& document.getElementById('location').value!='Enter place name or area') {
		flag_fill=1;
	}

/*	var myFields=new Array();
	myFields[0]="postalCode";
	myFields[1]="location";
	myFields[2]="previouslyValuedToBox";
	myFields[3]="propertyCounty";
	for (x in myFields)
	{
		if(document.getElementById(myFields[x]).value!='' 
		&& document.getElementById(myFields[x]).value!='Enter Post Code'
		&& document.getElementById(myFields[x]).value!='Enter City or Town'
		&& document.getElementById(myFields[x]).value!='Enter place name or area')
		{
			var flag_fill=1;
			break;
		}
	}
	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 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(flag_fill==0)
	{
		visitor +=  "\n- Please input at least one search criteria."; 
	}
	
	if(visitor != "")
	{
		MasterString = MasterString + visitor;
		
		flag=true;
	}
		
	if (flag == true)
	{
		alert(MasterString);
		return false;
	}
		
}

function set_text(div_name)
{	//alert(div_name);
	document.getElementById('main_text').innerHTML=document.getElementById(div_name).innerHTML;
}
function set_href(regionName)
{	
	window.location.href="inter-global-search.php?location="+regionName+"&search_filter=1";
}

function clearr(val)
{	
	if(document.getElementById(val).value=="Enter ZIP, city or state"){
		document.getElementById(val).value="";
	}
}

function insertr(val)
{	
	if(document.getElementById(val).value==""){
		document.getElementById(val).value="Enter ZIP, city or state";
	}
}

function showSimulVenue(venueDiv,myform)
{
	var elmnt='venuesDiv'+venueDiv;
	
	//alert(elmnt);
	if(document.getElementById(elmnt).style.display=='none')
	{
		document.getElementById(elmnt).style.display='';
	}
	else
	{
		var childClassNm="chkChildVenue"+venueDiv;
		for (var jk = 0; jk < myform.elements.length; jk++){
			var el = myform.elements[jk];
			if(el.type=="checkbox" && el.className == childClassNm){
				el.checked=false;
			}
		}							
		document.getElementById(elmnt).style.display='none';
	}
}

