function getblank(this1)  
{
	if (this1.value = "Your e-mail here") 
	{
		this1.value = "";
	}
    return true;	
}
function check_advanced_search(kw)  
{  
	error = 0;
	if (kw.length < 3) 
	{
		error_message = "Please enter atleast 3 characters for search";
		error = 1;
  	}
	if (kw == "Enter Product / Company Name")
  	{
 		error_message = "Please enter correct string for search";
    	error = 2;
  	}
	if (error == 1) 
	{
    	alert(error_message);
		document.quick_find.ss.focus();
    	return false;
  	} 
  	if (error == 2) 
	{
	    alert(error_message);
	    document.quick_find.ss.focus();
	    return false;
  	} 
  	else 
	{
	    return true;
  	}
} 
function settext()
{
	if (document.quick_find.ss.value=='')  
	{
		document.quick_find.ss.value='Enter Product / Company Name';
	}    
}
function emailsh(d) 
{
	if(d=="emaildiv")
	{
		document.getElementById('emaildiv').style.display = "none";
		document.getElementById('emaildiv2').style.display = "block";
	}
	else
	{
		document.getElementById('emaildiv2').style.display = "none";
		document.getElementById('emaildiv').style.display = "block";
	}
}
function phone1(d)
{
	if(d=="phone1")
	{
		document.getElementById('phone1').style.display = "none";
		document.getElementById('phone2').style.display = "block";
	}
	else
	{
		document.getElementById('phone2').style.display = "none";
		document.getElementById('phone1').style.display = "block";
	}
}
function fax1(d)
{
	if(d=="fax1")
	{
		document.getElementById('fax1').style.display = "none";
		document.getElementById('fax2').style.display = "block";
	}
	else
	{
		document.getElementById('fax2').style.display = "none";
		document.getElementById('fax1').style.display = "block";
	}
}

function mobile(d)
{
	if(d=="mmobile")
	{
		document.getElementById('mmobile').style.display = "none";
		document.getElementById('mmobile2').style.display = "block";
	}
	else
	{
		document.getElementById('mmobile2').style.display = "none";
		document.getElementById('mmobile').style.display = "block";
	}
}
function productservices(d) 
{ 
	if(d=="proserv")
	{
		document.getElementById('proserv').style.display = "block";
		document.getElementById('moreproser').style.display = "none";
	}
	else
	{
		document.getElementById('moreproser').style.display = "block";
		document.getElementById('proserv').style.display = "none";
	}
}
function addInfo(d)
{
	if(d == "addinform")
	{
		document.getElementById('addinform').style.display = "none";
		document.getElementById('mnsinform').style.display = "block";
		document.getElementById('showAddInfo').style.display = "block";
	}
	else if (d == "mnsinform")
	{
		document.getElementById('mnsinform').style.display = "none";
		document.getElementById('addinform').style.display = "block";
		document.getElementById('showAddInfo').style.display = "none";
	}
}


function Check_ModReg(joinform) 
{
	if(joinform.comp_name.value == "" ) 
	{
		alert("Kindly enter your Company Name.");
		joinform.comp_name.focus();
		return false;
	}
	else if(joinform.comp_name.value.lengths > 100 ) 
	{
		alert("Company Name should not exceed 100 characters.");
		joinform.comp_name.focus();
		return false;
	}
	if(joinform.company_description.value == "" ) 
	{
		alert("Kindly enter your Company Profile.");
		joinform.company_description.focus();
		return false;
	}
	else if(joinform.company_description.value.length > 2000) 
	{
		alert("Company profile should not exceed 2000 characters.");
		joinform.company_description.focus();
		return false;
	}
	
	var chkname = document.getElementsByName('biz');	
	var len = chkname.length;
	var checkedCount=0;
	for (var i=0; i<len; i++)
	{
		if (chkname[i].checked)
		{
			checkedCount++;
		}
	}
	
	if (checkedCount == 0)
	{
		alert("Please select your Business type");
		return false;
	}

	if(joinform.product1.value == "")
	{
		alert ("Please select First Product");
		joinform.product1.focus();
		return false;
	}
	else if(joinform.product1.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product1.focus();
		return false;
	}
	if(joinform.product2.value == "")
	{
		alert ("Please select Second Product");
		joinform.product2.focus();
		return false;
	}
	else if(joinform.product2.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product2.focus();
		return false;
	}
	if(joinform.product3.value == "")
	{
		alert ("Please select Third Product");
		joinform.product3.focus();
		return false;
	}
	else if(joinform.product3.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product3.focus();
		return false;
	}
	if(joinform.product4.value == "")
	{
		alert ("Please select Fourth Product");
		joinform.product4.focus();
		return false;
	}
	else if(joinform.product4.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product4.focus();
		return false;
	}
	if(joinform.product5.value == "")
	{
		alert ("Please select Fifth Product");
		joinform.product5.focus();
		return false;
	}
	else if(joinform.product5.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product5.focus();
		return false;
	}
	if(joinform.product6.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product6.focus();
		return false;
	}
	if(joinform.product7.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product7.focus();
		return false;
	}
	if(joinform.product8.value.length > 60)
	{
		alert ("Your Product Descreption cannot exceed 60 characters.");
		joinform.product8.focus();
		return false;
	}
	if(joinform.cfirst_name.value.length > 30) 
	{
		alert("First Name of CEO/ MD/ Owner should not exceed 30 characters.");
		joinform.cfirst_name.focus();
		return false;
	}
	else if(joinform.clast_name.value.length > 30) 
	{
		alert("Last Name of CEO/ MD/ Owner should not exceed 30 characters.");
		joinform.clast_name.focus();
		return false;
	}
	if (document.getElementById ('year_estb').value !="")
	{
		var cc=parseInt(document.getElementById ('year_estb').value);
		if(isNaN(document.getElementById ('year_estb').value))
		{
			alert("Kindly enter a numeric value for the Year of Establishment.");
			joinform.year_estb.focus();
			return false;
		}
		else if (document.getElementById ('year_estb').value.length != 4)
		{
			alert("Kindly enter the Year of Establishment in YYYY format.");
			joinform.year_estb.focus();
			return false;
		}
		else if (cc > 2009)
		{
			alert("The Year of Establishment of your company cannot be greater than the current year.");
			joinform.year_estb.focus();
			return false;
		}
		else if (cc < 1000)
		{
			alert("Year of Establishment cannot be prior to 1000.");
			joinform.year_estb.focus();
			return false;
		}	
	}
	if (!(joinform.website.value.match(/^http:\/\/$/)) && joinform.website.value.length != 0)
	{
		if(joinform.website.value.indexOf(" ") != -1)	
		{
			alert("Kindly enter correct WebSite/URL without any spaces in it.");
			joinform.website.focus();
			return false;
		}
		if(joinform.website.value.indexOf("@") != -1)	
		{
			alert("Invalid Website! Kindly enter correct website.");
			joinform.website.focus();
			return false;
		}
		if(joinform.website.value.indexOf(".") == -1)	
		{
			alert("Invalid Website! Kindly enter correct website.");
			joinform.website.focus();
			return false;
		}
		validarr = joinform.website.value.split(".");
		if(validarr[0].length<2)   	
		{
			alert("Invalid Website! Kindly enter correct website.");
			joinform.website.focus();
			return false;
		}
		if(validarr[1].length<2)   	
		{
			alert("Invalid Website! Kindly enter correct website.");
			joinform.website.focus();
			return false;
		}
	}	
	if(joinform.website.value.length > 100) 
	{
		alert("Website should not exceed 100 characters.");
		joinform.website.focus();
		return false;
	}
	if(joinform.first_name.value == "" || joinform.first_name.value == "First" ) 
	{
		alert("Kindly enter Your First Name.");
		joinform.first_name.focus();
		return false;
	}
	else if(joinform.first_name.value.length > 30)
	{
		alert("First Name should not exceed 30 characters.");
		joinform.first_name.focus();
		return false;
	}
	else if(joinform.last_name.value.length > 30)
	{
		alert("Last Name should not exceed 30 characters.");
		joinform.last_name.focus();
		return false;
	}
	if(joinform.designation.value.length > 30)
	{
		alert("Designation should not exceed 30 characters.");
		joinform.designation.focus();
		return false;
	}
	if(joinform.str_add1.value == "" ) 
	{
		alert("Kindly enter Your Address.");
		joinform.str_add1.focus();
		return false;
	}
	else if(joinform.str_add1.value.length > 60)
	{
		alert("Street Address should not exceed 60 characters.");
		joinform.str_add1.focus();
		return false;
	}
	if(joinform.str_add2.value.length > 60)
	{
		alert("Street Address should not exceed 60 characters.");
		joinform.str_add2.focus();
		return false;
	}
	if(joinform.country.value == "") 
	{
		alert("Kindly Select The Country.");
		joinform.country.focus();
		return false;
	}
	else if(joinform.country.value.length > 40)
	{
		alert("Country Name should not exceed 40 characters.");
		joinform.country.focus();
		return false;
	}
	if(joinform.city_others.value == "" ) 
	{
		alert("Kindly enter Your City Name.");
		joinform.city_others.focus();
		return false;
	}
	else if(joinform.city_others.value.length > 30) 
	{
		alert("City should not exceed 30 characters.");
		joinform.city_others.focus();
		return false;
	}
	if(joinform.state_others.value.length > 30) 
	{
		alert("State should not exceed 30 characters.");
		joinform.state_others.focus();
		return false;
	}
// 	if(joinform.zip.value == "" ) 
// 	{
// 		alert("Kindly enter The Zip/Pin Code.");
// 		joinform.zip.focus();
// 		return false;
// 	}
	if(joinform.zip.value.length > 11) 
	{
		alert("Zip / Pin Code should not exceed 11 characters.");
		joinform.zip.focus();
		return false;
	}
	if(joinform.ph_country.value == "") 
	{
		alert("Kindly enter Country Code for Phone Number.");
		joinform.ph_country.focus();
		return false;
	}
	else if(joinform.ph_country.value != '')
	{
		if(isNaN(joinform.ph_country.value)) 
		{
			var scode = joinform.ph_country.value;
			var underscore = scode.match(/-/g);
			if(!underscore)
			{
				alert("Telephone (Country Code) should be a numeric value.");
				joinform.ph_country.focus();
				return false;
			}			
		}
	}
	else if (joinform.ph_country.value.length > 6)
	{
		alert ("Telephone (Country Code) should not exceed 6 characters.");
		joinform.ph_country.focus();
		return false;
	}
	if(joinform.ph_area.value != '') 
	{
		if(isNaN(joinform.ph_area.value)) 
		{
			alert("Telephone (Area Code) should be a numeric value.");
			joinform.ph_area.focus();
			return false;
		}
		else if(joinform.ph_area.value.length > 6) 
		{
			alert ("Telephone (Area Code) should not exceed 6 characters.");
			joinform.ph_area.focus();
			return false;
		}		
	}
	if(joinform.ph_no.value == "" && joinform.mobile.value == "") 
	{
		alert("Kindly enter Your Phone Number or Mobile Number");
		joinform.ph_no.focus();
		return false;
	}
	else if (joinform.ph_no.value != '')
	{
		if(isNaN(joinform.ph_no.value)) 
		{
			alert("Telephone (Number) should be a numeric value.");
			joinform.ph_no.focus();
			return false;
		}
		if (joinform.ph_no.value.length > 35)  
		{
			alert ("Telephone (Number) should not exceed 35 characters.");
			joinform.ph_no.focus();
			return false;
		}
	}
	if(joinform.ph_country2.value != '')
	{
		if(isNaN(joinform.ph_country2.value)) 
		{
			var scode = joinform.ph_country2.value;
			var underscore = scode.match(/-/g);
			if(!underscore)
			{
				alert("Telephone (Country Code) should be a numeric value.");
				joinform.ph_country2.focus();
				return false;
			}			
		}
	}
	else if (joinform.ph_country2.value.length > 6)
	{
		alert ("Telephone (Country Code) should not exceed 6 characters.");
		joinform.ph_country2.focus();
		return false;
	}
	if(joinform.ph_area2.value != '') 
	{
		if(isNaN(joinform.ph_area2.value)) 
		{
			alert("Telephone (Area Code) should be a numeric value.");
			joinform.ph_area2.focus();
			return false;
		}
		else if(joinform.ph_area2.value.length > 6) 
		{
			alert ("Telephone (Area Code) should not exceed 6 characters.");
			joinform.ph_area2.focus();
			return false;
		}		
	}
	if (joinform.ph_no2.value != '')
	{
		if(isNaN(joinform.ph_no2.value)) 
		{
			alert("Telephone (Number) should be a numeric value.");
			joinform.ph_no2.focus();
			return false;
		}
		if (joinform.ph_no2.value.length > 35)  
		{
			alert ("Telephone (Number) should not exceed 35 characters.");
			joinform.ph_no2.focus();
			return false;
		}
	}
	if(joinform.fax_country.value != '')
	{
		if(isNaN(joinform.fax_country.value)) 
		{
			var scode = joinform.fax_country.value;
			var underscore = scode.match(/-/g);
			if(!underscore)
			{
				alert("Fax (Country Code) should be a numeric value.");
				joinform.fax_country.focus();
				return false;
			}			
		}
	}
	else if (joinform.fax_country.value.length > 6)
	{
		alert ("Fax (Country Code) should not exceed 6 characters.");
		joinform.fax_country.focus();
		return false;
	}
	if(joinform.fax_area.value != '') 
	{
		if(isNaN(joinform.fax_area.value)) 
		{
			alert("Fax (Area Code) should be a numeric value.");
			joinform.fax_area.focus();
			return false;
		}
		else if(joinform.fax_area.value.length > 6) 
		{
			alert ("Fax (Area Code) should not exceed 6 characters.");
			joinform.fax_area.focus();
			return false;
		}		
	}
	if (joinform.fax_no.value != '')
	{
		if(isNaN(joinform.fax_no.value)) 
		{
			alert("Fax (Number) should be a numeric value.");
			joinform.fax_no.focus();
			return false;
		}
		if (joinform.fax_no.value.length > 35)  
		{
			alert ("Fax (Number) should not exceed 35 characters.");
			joinform.fax_no.focus();
			return false;
		}
	}
	if(joinform.fax_country2.value != '')
	{
		if(isNaN(joinform.fax_country2.value)) 
		{
			var scode = joinform.fax_country2.value;
			var underscore = scode.match(/-/g);
			if(!underscore)
			{
				alert("Fax (Country Code) should be a numeric value.");
				joinform.fax_country2.focus();
				return false;
			}			
		}
	}
	else if (joinform.fax_country2.value.length > 6)
	{
		alert ("Fax (Country Code) should not exceed 6 characters.");
		joinform.fax_country2.focus();
		return false;
	}
	if(joinform.fax_area2.value != '') 
	{
		if(isNaN(joinform.fax_area2.value)) 
		{
			alert("Fax (Area Code) should be a numeric value.");
			joinform.fax_area2.focus();
			return false;
		}
		else if(joinform.fax_area2.value.length > 6) 
		{
			alert ("Fax (Area Code) should not exceed 6 characters.");
			joinform.fax_area2.focus();
			return false;
		}		
	}
	if (joinform.fax_no2.value != '')
	{
		if(isNaN(joinform.fax_no2.value)) 
		{
			alert("Fax (Number) should be a numeric value.");
			joinform.fax_no2.focus();
			return false;
		}
		if (joinform.fax_no2.value.length > 35)  
		{
			alert ("Fax (Number) should not exceed 35 characters.");
			joinform.fax_no2.focus();
			return false;
		}
	}	
			
	if (joinform.mobile.value.length > 40)  
	{
		alert ("Mobile should not exceed 40 characters.");
		joinform.mobile.focus();
		return false;
	}
	if (joinform.mobile2.value.length > 40)  
	{
		alert ("Mobile should not exceed 40 characters.");
		joinform.mobile2.focus();
		return false;
	}
	if(joinform.email.value == "" ) 
	{
		alert("Kindly Enter Your E-mail ID.");
		joinform.email.focus();
		return false;
	}
	else if (joinform.email.value.length != 0)
	{
//		var e_check  = joinform.email.value;
		if(joinform.email.value.indexOf(" ") != -1)	
		{
			alert("Kindly enter correct E-Mail ID without any spaces in it.");
			joinform.email.focus();
			return false;
		}
		if(joinform.email.value.indexOf("@") == -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email.focus();
			return false;
		}
		if(joinform.email.value.indexOf(",") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email.focus();
			return false;
		}
		if(joinform.email.value.indexOf("'") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email.focus();
			return false;
		}
		if(joinform.email.value.indexOf(")") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email.focus();
			return false;
		}
		if(joinform.email.value.indexOf("(") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email.focus();
			return false;
		}		
		validarr = joinform.email.value.split("@");
		
		if(validarr[0].length==0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email.focus();
			return false;
		}
		if(validarr[0].length != 0)   	
		{
			if(validarr[0].indexOf(".") != -1)     	
			{
				validemail = validarr[0].split(".");
				if(validemail[0].length<2)   		
				{
					alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
					joinform.email.focus();
					return false;
				}
				if(validemail[1].length<2)  		
				{
					alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
					joinform.email.focus();
					return false;
				}
			}
		}   // end of of validemail		
		if(validarr[1].indexOf("@") >=0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email.focus();
			return false;
		}
   		if(validarr[1].length==0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email.focus();
			return false;
		}
		if(validarr[1].length != 0)   	
		{
			if(validarr[1].indexOf(".") == -1)     	
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email.focus();
				return false;
			}
			validemail = validarr[1].split(".");
			if(validemail[0].length<2)   		
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email.focus();
				return false;
			}
			if(validemail[1].length<2)  		
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email.focus();
				return false;
			}
		}   // end of of validemail
	} // end of valid email-id check
	if(joinform.email.value.length > 100)	
	{
		alert("Email should not exceed 100 characters.");
		joinform.email.focus();
		return false;
	}
	if (joinform.email2.value.length != 0)
	{
//		var e_check  = joinform.email.value;
		if(joinform.email2.value.indexOf(" ") != -1)	
		{
			alert("Kindly enter correct E-Mail ID without any spaces in it.");
			joinform.email2.focus();
			return false;
		}
		if(joinform.email2.value.indexOf("@") == -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(joinform.email2.value.indexOf(",") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(joinform.email2.value.indexOf("'") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(joinform.email2.value.indexOf(")") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(joinform.email2.value.indexOf("(") != -1)	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-Mail ID.");
			joinform.email2.focus();
			return false;
		}		
		validarr = joinform.email2.value.split("@");
		
		if(validarr[0].length==0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(validarr[0].length != 0)   	
		{
			if(validarr[0].indexOf(".") != -1)     	
			{
				validemail = validarr[0].split(".");
				if(validemail[0].length<2)   		
				{
					alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
					joinform.email2.focus();
					return false;
				}
				if(validemail[1].length<2)  		
				{
					alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
					joinform.email2.focus();
					return false;
				}
			}
		}   // end of of validemail		
		if(validarr[1].indexOf("@") >=0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email2.focus();
			return false;
		}
   		if(validarr[1].length==0)   	
		{
			alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
			joinform.email2.focus();
			return false;
		}
		if(validarr[1].length != 0)   	
		{
			if(validarr[1].indexOf(".") == -1)     	
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email2.focus();
				return false;
			}
			validemail = validarr[1].split(".");
			if(validemail[0].length<2)   		
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email2.focus();
				return false;
			}
			if(validemail[1].length<2)  		
			{
				alert("Invalid E-Mail ID! Kindly enter the correct E-mail ID.");
				joinform.email2.focus();
				return false;
			}
		}   // end of of validemail
	} // end of valid email-id check
	if(joinform.email2.value.length > 100)	
	{
		alert("Email2 should not exceed 100 characters.");
		joinform.email2.focus();
		return false;
	}			
}












var data = ['Aceh','#ID','62','Afghanistan','#AF','93','Aland','#FI','358','Albania','#AL','355','Algeria','#DZ','213','America','#US','1','American Samoa','#AS','1-684','Andorra','#AD','376','Angola','#AO','244','Anguilla','#AI','1-264','Antarctica','#AQ','672','Antigua And Barbuda','#AG','1-268','Argentina','#AR','54','Armenia','#AM','7','Aruba','#AW','297','Aryavarta','#IN','91','Aussi','#AU','61','Australia','#AU','61','Austria','#AT','43','Azerbaijan','#AZ','994','BRD','#DE','49','Bahamas','#BS','1-242','Bahrain','#BH','973','Bangladesh','#BD','880','Barbados','#BB','1-246','Basutoland','#LS','266','Batavian Republic','#NL','31','Bechuanaland','#BW','267','Belarus','#BY','375','Belau','#PW','680','Belgian Congo','#CD','243','Belgium','#BE','32','Belize','#BZ','501','Benin','#BJ','229','Bermuda','#BM','1-441','Bharat','#IN','91','Bhutan','#BT','975','Bolivia','#BO','591','Bosnia And Herzegovina','#BA','387','Botswana','#BW','267','Bourkina-Fasso','#BF','226','Brazil','#BR','55','Britain','#UK','44','British Indian Ocean Territory','#IO','246','Brunei','#BN','673','Bulgaria','#BG','359','Burkina Faso','#BF','226','Burma','#MM','95','Burundi','#BI','257','Cambodia','#KH','855','Cameroon','#CM','237','Canada','#CA','1','Cape Verde','#CV','238','Catalonia','#ES','34','Cayman Islands','#KY','1-453','Central African Republic','#CF','236','Cesko','#CZ','420','Ceylon','#LK','94','Chad','#TD','235','Chechnya','#RU','7','Chile','#CL','56','Chili','#CL','56','Chilli','#CL','56','China','#CN','86','China (Hong Kong S.A.R.)','#HK','852','China (Macau S.A.R.)','#MO','853','Christmas Islands','#CX','61','Cocos Islands','#CC','672','Colchis','#GE','995','Colombia','#CO','57','Commonwealth of Australia','#AU','61','Comoros','#KM','269','Congo','#CG','242','Congo Belge','#CD','243','Congo Brazzaville','#CG','242','Congo Kinshasa','#CD','243','Cook Islands','#CK','682','Costa Rica','#CR','506','Cote D Ivoire','#CI','225','Crna Gora','#ME','382','Croatia','#HR','385','Cuba','#CU','53','Cyprus','#CY','357','Czech Republic','#CZ','420','Czechia','#CZ','420','DRC','#CD','243','Dahomey','#BJ','229','Democractic Republic Of Congo','#CD','243','Denmark','#DK','45','Deutschland','#DE','49','Djibouti','#DJ','253','Dominica','#DM','1-767','Dominican Republic','#DO','1-809','Dominion of Canada','#CA','1','Down Under','#AU','61','Dutch Guiana','#SR','597','Dutch Republic','#NL','31','East Bengal','#BD','880','East Timor','#TL','670','Easter Island','#CL','56','Ecuador','#EC','593','Egypt','#EG','20','Eire','#IE','353','El Salvador','#SV','503','Ellice Islands','#TV','688','England','#UK','44','Equatorial Guinea','#GQ','240','Eritrea','#ER','291','Espana','#ES','34','Estonia','#EE','372','Ethiopia','#ET','251','Faeroe Islands','#FO','298','Falkland Islands','#FK','500','Federal Republic of Germany','#DE','49','Federative Republic of Brazil','#BR','55','Fiji Islands','#FJ','679','Finland','#FI','358','France','#FR','33','French Congo','#CG','242','French Guiana','#GF','594','French Polynesia','#PF','689','French Republic','#FR','33','French Somaliland','#DJ','253','French Southern Territories','#TF','262','Gabon','#GA','241','Gambia','#GM','220','Gandhar','#AF','93','Gaul','#FR','33','Georgia','#GE','995','Germany','#DE','49','Ghana','#GH','233','Gibraltar','#GI','350','Great Britain','#UK','44','Greece','#GR','30','Greenland','#GL','299','Grenada','#GD','1-473','Guadeloupe','#GP','590','Guam','#GU','1-671','Guatemala','#GT','502','Guinea','#GN','224','Guinea','#GW','245','Guinea-Bissau','#GW','245','Guyana','#GY','592','Haiti','#HT','509','Haute-Volta','#BF','226','Heard And Mcdonald Islands','#HM','672','Hellas','#GR','30','Hellenic Republic','#GR','30','Hind','#IN','91','Hindustan','#IN','91','Holland','#NL','31','Holy See','#VA','379','Honduras','#HN','504','Hong Kong','#HK','852','Hrvatska','#HR','385','Hungary','#HU','36','Iberia','#GE','995','Iceland','#IS','354','India','#IN','91','Indonesia','#ID','62','Iran','#IR','98','Iraq','#IQ','964','Ireland','#IE','353','Islamic Republic of Pakistan','#PK','92','Island','#IS','354','Islas Malvin','#FK','500','Israel','#IL','972','Italy','#IT','39','Iveria','#GE','995','Ivory Coast','#CI','225','Jamaica','#JM','1-876','Japan','#JP','81','Jordan','#JO','962','KSA','#SA','966','Kampuchea','#KH','855','Kazakhstan','#KZ','7','Keeling Islands','#CC','672','Kenya','#KE','254','Khmer','#KH','855','Khmer Republic','#KH','855','Kingdom of Cambodia','#KH','855','Kingdom of Lesotho','#LS','266','Kingdom of Romania','#RO','40','Kingdom of Saudi Arabia','#SA','966','Kingdom of Thailand','#TH','66','Kiribati','#KI','686','Kiwi','#NZ','64','Korea','#KR','82','Korea, North','#KP','850','Kroatien','#HR','385','Kuwait','#KW','965','Kyrgyzstan','#KG','996','Lao','#LA','856','Lao Peoples Democratic Republic','#LA','856','Latvia','#LV','371','Lebanon','#LB','961','Lesotho','#LS','266','Liberia','#LR','231','Libya','#LY','218','Liechtenstein','#LI','423','Lithuania','#LT','370','Luxembourg','#LU','352','MEX','#MX','52','MX','#MX','52','Macau','#MO','853','Macedonia','#MK','389','Madagascar','#MG','261','Mainland China','#CN','86','Malawi','#MW','265','Malaysia','#MY','60','Maldives','#MV','960','Mali','#ML','223','Malta','#MT','356','Marshall Islands','#MH','692','Martinique','#MQ','596','Mauritania','#MR','222','Mauritius','#MU','230','Mayotte','#YT','269','Mesopotamia','#IQ','964','Mexico','#MX','52','Micronesia','#FM','691','Moldova','#MD','373','Monaco','#MC','377','Mongolia','#MN','976','Montenegro','#ME','382','Montserrat','#MS','1-664','Morocco','#MA','212','Mount Athos','#GR','30','Mozambique','#MZ','258','Myanmar','#MM','95','Namibia','#NA','264','Nauru','#NR','674','Nepal','#NP','977','Netherlands','#NL','31','Netherlands Antilles','#AN','599','Netherlands Guiana','#SR','597','New Caledonia','#NC','687','New Zealand','#NZ','64','Nicaragua','#NI','505','Niger','#NE','227','Nigeria','#NG','234','Niue','#NU','683','Norfolk Island','#NF','672','North Korea','#KP','850','Northern Ireland','#UK','44','Northern Mariana Islands','#MP','1-670','Northern Rhodesia','#ZM','260','Norway','#NO','47','Nyasaland','#MW','265','Oman','#OM','968','Oubangui-Chari','#CF','236','Oz','#AU','61','PRC','#CN','86','Pakistan','#PK','92','Palau','#PW','680','Panama','#PA','507','Papua New Guinea','#PG','675','Paraguay','#PY','595','Peoples Republic of Bangladesh','#BD','880','Peoples Republic of China','#CN','86','Peoples Republic of Kampuchea','#KH','855','Persia','#IR','98','Peru','#PE','51','Philippines','#PH','63','Pindorama','#BR','55','Pitcairn Island','#PN','872','Poland','#PL','48','Polska','#PL','48','Porto Rico','#PR','1','Portugal','#PT','351','Portugese Guinea','#GW','245','Puerto Rico','#PR','1','Qatar','#QA','974','Qazaqstan','#KZ','7','RF','#RU','7','Republic of Benin','#BJ','229','Republic of Botswana','#BW','267','Republic of Dijbouti','#DJ','253','Republic of Hungry','#HU','36','Republic of India','#IN','91','Republic of Ireland','#IE','353','Republic of Kazakhstan','#KZ','7','Republic of Malawi','#MW','265','Republic of Moldova','#MD','373','Republic of Palau','#PW','680','Republic of Poland','#PL','48','Republic of Rwanda','#RW','250','Republic of Serbia','#RS','381','Republic of Singapore','#SG','65','Republic of Sudan','#SD','249','Reunion','#RE','262','Rhodesia','#ZW','263','Romania','#RO','40','Roos','#RU','7','Rumania','#RO','40','Russia','#RU','7','Russian Federation','#RU','7','Rwanda','#RW','250','SGSSI','#GS','995','Saint Helena','#SH','290','Saint Kitts And Nevis','#KN','1-869','Saint Lucia','#LC','1-758','Saint Pierre And Miquelon','#PM','508','Saint Vincent And The Grenadin','#VC','1-784','Samoa','#WS','685','San Marino','#SM','378','Sao Tome And Principe','#ST','239','Saudi Arabia','#SA','966','Saudia','#SA','966','Scotland','#UK','44','Senegal','#SN','221','Serbia','#RS','381','Serbia And Montenegro','#CS','381','Seychelles','#SC','248','Shqiperia','#AL','355','Shri Vijaya','#PH','63','Siam','#TH','66','Sierra Leone','#SL','232','Singapore','#SG','65','Slovakia','#SK','421','Slovenia','#SI','386','Solomon Islands','#SB','677','Somalia','#SO','252','South Africa','#ZA','27','South Georgia','#GS','995','South Sandwich Islands','#GS','995','Spain','#ES','34','Sri Lanka','#LK','94','St Helena','#SH','290','St Kitts And Nevis','#KN','1-869','St Lucia','#LC','1-758','St Pierre And Miquelon','#PM','508','St Vincent And The Grenadin','#VC','1-784','St. Helena','#SH','290','St. Kitts And Nevis','#KN','1-869','St. Lucia','#LC','1-758','St. Pierre And Miquelon','#PM','508','St. Vincent And The Grenadin','#VC','1-784','Sudan','#SD','249','Suriname','#SR','597','Svalbard And Jan Mayen Islands','#SJ','47','Swaziland','#SZ','268','Sweden','#SE','46','Swiss Confederation','#CH','41','Switzerland','#CH','41','Syria','#SY','963','Taiwan','#TW','886','Tajikistan','#TJ','992','Tanganyika and Zanzibar','#TZ','255','Tanzania','#TZ','255','Thailand','#TH','66','The Bahamas','#BS','1-242','The Gambia','#GM','220','The Netherlands','#NL','31','The States','#US','1','Tibet','#CN','86','Togo','#TG','228','Tokelau','#TK','690','Tonga','#TO','676','Trinidad And Tobago','#TT','1-868','Tunisia','#TN','216','Turkey','#TR','90','Turkmenistan','#TM','993','Turks And Caicos Islands','#TC','1-649','Tuvalu','#TV','688','UAE','#AE','971','UK','#UK','44','US','#US','1','USA','#US','1','Ubangi-Shari','#CF','236','Uganda','#UG','256','Ukraine','#UA','380','Ungarn','#HU','36','United Arab Emirates','#AE','971','United Kingdom','#UK','44','United Mexican States','#MX','52','United States','#US','1','United States Minor Outlying I','#UM','1','United States Of America','#US','1','United States of Brazil','#BR','55','Upper Volta','#BF','226','Uruguay','#UY','598','Uzbekistan','#UZ','998','Vanuatu','#VU','678','Vatican City','#VA','379','Venezuela','#VE','58','Vietnam','#VN','84','Virgin Islands (British)','#VG','1-284','Virgin Islands (Us)','#VI','1-340','Wales','#UK','44','Wallis And Futuna Islands','#WF','681','West Germany','#DE','49','Western Sahara','#EH','212','Xile','#CL','56','Yemen','#YE','967','Yugoslavia','#YU','38','Zaire','#CD','243','Zambia','#ZM','260','Zanzibar','#TZ','255','Zimbabwe','#ZW','263'];
var data1 = ['Aceh','Afghanistan','Aland','Albania','Algeria','America','American Samoa','Andorra','Angola','Anguilla','Antarctica','Antigua And Barbuda','Argentina','Armenia','Aruba','Aryavarta','Aussi','Australia','Austria','Azerbaijan','BRD','Bahamas','Bahrain','Bangladesh','Barbados','Basutoland','Batavian Republic','Bechuanaland','Belarus','Belau','Belgian Congo','Belgium','Belize','Benin','Bermuda','Bharat','Bhutan','Bolivia','Bosnia And Herzegovina','Botswana','Bourkina-Fasso','Brazil','Britain','British Indian Ocean Territory','Brunei','Bulgaria','Burkina Faso','Burma','Burundi','Cambodia','Cameroon','Canada','Cape Verde','Catalonia','Cayman Islands','Central African Republic','Cesko','Ceylon','Chad','Chechnya','Chile','Chili','Chilli','China','China (Hong Kong S.A.R.)','China (Macau S.A.R.)','Christmas Islands','Cocos Islands','Colchis','Colombia','Commonwealth of Australia','Comoros','Congo','Congo Belge','Congo Brazzaville','Congo Kinshasa','Cook Islands','Costa Rica','Cote D Ivoire','Crna Gora','Croatia','Cuba','Cyprus','Czech Republic','Czechia','DRC','Dahomey','Democractic Republic Of Congo','Denmark','Deutschland','Djibouti','Dominica','Dominican Republic','Dominion of Canada','Down Under','Dutch Guiana','Dutch Republic','East Bengal','East Timor','Easter Island','Ecuador','Egypt','Eire','El Salvador','Ellice Islands','England','Equatorial Guinea','Eritrea','Espana','Estonia','Ethiopia','Faeroe Islands','Falkland Islands','Federal Republic of Germany','Federative Republic of Brazil','Fiji Islands','Finland','France','French Congo','French Guiana','French Polynesia','French Republic','French Somaliland','French Southern Territories','Gabon','Gambia','Gandhar','Gaul','Georgia','Germany','Ghana','Gibraltar','Great Britain','Greece','Greenland','Grenada','Guadeloupe','Guam','Guatemala','Guinea','Guinea','Guinea-Bissau','Guyana','Haiti','Haute-Volta','Heard And Mcdonald Islands','Hellas','Hellenic Republic','Hind','Hindustan','Holland','Holy See','Honduras','Hong Kong','Hrvatska','Hungary','Iberia','Iceland','India','Indonesia','Iran','Iraq','Ireland','Islamic Republic of Pakistan','Island','Islas Malvin','Israel','Italy','Iveria','Ivory Coast','Jamaica','Japan','Jordan','KSA','Kampuchea','Kazakhstan','Keeling Islands','Kenya','Khmer','Khmer Republic','Kingdom of Cambodia','Kingdom of Lesotho','Kingdom of Romania','Kingdom of Saudi Arabia','Kingdom of Thailand','Kiribati','Kiwi','Korea','Korea, North','Kroatien','Kuwait','Kyrgyzstan','Lao','Lao Peoples Democratic Republic','Latvia','Lebanon','Lesotho','Liberia','Libya','Liechtenstein','Lithuania','Luxembourg','MEX','MX','Macau','Macedonia','Madagascar','Mainland China','Malawi','Malaysia','Maldives','Mali','Malta','Marshall Islands','Martinique','Mauritania','Mauritius','Mayotte','Mesopotamia','Mexico','Micronesia','Moldova','Monaco','Mongolia','Montenegro','Montserrat','Morocco','Mount Athos','Mozambique','Myanmar','Namibia','Nauru','Nepal','Netherlands','Netherlands Antilles','Netherlands Guiana','New Caledonia','New Zealand','Nicaragua','Niger','Nigeria','Niue','Norfolk Island','North Korea','Northern Ireland','Northern Mariana Islands','Northern Rhodesia','Norway','Nyasaland','Oman','Oubangui-Chari','Oz','PRC','Pakistan','Palau','Panama','Papua New Guinea','Paraguay','Peoples Republic of Bangladesh','Peoples Republic of China','Peoples Republic of Kampuchea','Persia','Peru','Philippines','Pindorama','Pitcairn Island','Poland','Polska','Porto Rico','Portugal','Portugese Guinea','Puerto Rico','Qatar','Qazaqstan','RF','Republic of Benin','Republic of Botswana','Republic of Dijbouti','Republic of Hungry','Republic of India','Republic of Ireland','Republic of Kazakhstan','Republic of Malawi','Republic of Moldova','Republic of Palau','Republic of Poland','Republic of Rwanda','Republic of Serbia','Republic of Singapore','Republic of Sudan','Reunion','Rhodesia','Romania','Roos','Rumania','Russia','Russian Federation','Rwanda','SGSSI','Saint Helena','Saint Kitts And Nevis','Saint Lucia','Saint Pierre And Miquelon','Saint Vincent And The Grenadin','Samoa','San Marino','Sao Tome And Principe','Saudi Arabia','Saudia','Scotland','Senegal','Serbia','Serbia And Montenegro','Seychelles','Shqiperia','Shri Vijaya','Siam','Sierra Leone','Singapore','Slovakia','Slovenia','Solomon Islands','Somalia','South Africa','South Georgia','South Sandwich Islands','Spain','Sri Lanka','St Helena','St Kitts And Nevis','St Lucia','St Pierre And Miquelon','St Vincent And The Grenadin','St. Helena','St. Kitts And Nevis','St. Lucia','St. Pierre And Miquelon','St. Vincent And The Grenadin','Sudan','Suriname','Svalbard And Jan Mayen Islands','Swaziland','Sweden','Swiss Confederation','Switzerland','Syria','Taiwan','Tajikistan','Tanganyika and Zanzibar','Tanzania','Thailand','The Bahamas','The Gambia','The Netherlands','The States','Tibet','Togo','Tokelau','Tonga','Trinidad And Tobago','Tunisia','Turkey','Turkmenistan','Turks And Caicos Islands','Tuvalu','UAE','UK','US','USA','Ubangi-Shari','Uganda','Ukraine','Ungarn','United Arab Emirates','United Kingdom','United Mexican States','United States','United States Minor Outlying I','United States Of America','United States of Brazil','Upper Volta','Uruguay','Uzbekistan','Vanuatu','Vatican City','Venezuela','Vietnam','Virgin Islands (British)','Virgin Islands (Us)','Wales','Wallis And Futuna Islands','West Germany','Western Sahara','Xile','Yemen','Yugoslavia','Zaire','Zambia','Zanzibar','Zimbabwe'];

function Showonblur(id,val)
{
	var lower = val.toLowerCase();
	val=lower.substr(0,1).toUpperCase() + lower.substr(1);
	if (__AutoComplete[id]['highlighted'] == null) {
            if(__AutoComplete[id]['dropdown'].childNodes[0])
		{
            __AutoComplete[id]['dropdown'].childNodes[0].className = 'autocomplete_item_highlighted';
	    	}
            __AutoComplete[id]['highlighted'] = 0;

        }
	if (__AutoComplete[id]['highlighted'] == null && val=='') {
		AutoComplete_HideDropdown(id);
		
		document.getElementById("cntryname_autocomplete").value='';
		document.getElementById("cntryiso_autocomplete").value='';
		document.getElementById("ph_country_autocomplete").value='';
		document.getElementById("ph_country2_autocomplete").value='';
// 		document.getElementById("fax_country_autocomplete").value='';
// 		document.getElementById("fax_country2_autocomplete").value='';
		document.getElementById("mob_country_autocomplete").value='';
		document.getElementById("mob_country2_autocomplete").value='';
	}
	Show(val);

}
function Show(populate)
{
    var len =data.length;
    var i=0;
    var j=0;
    var k=0;
    var code=0;
    len=len+1;
    var count=0;
	for(i=0;i<=len;i++)
	{
		if(data[i]!=undefined)
		{
			var data1=data[i].toString();
			if(isNaN(data1))
			{
				data1=data1.replace(/[^0-9A-Za-z\#]/g,"");
				data1 = data1.toLowerCase();
				populate=populate.replace(/[^0-9A-Za-z\#]/g,"");
				var value=populate.toLowerCase();
				
				if (data1 == value) 
				{
					//alert(myvalue);
					count=1;
					j=i+1;
					k=i+2;
					code=data[i];
					var iso=data[j].replace('#',"");
					var ccode=new Array();
					if(data[k].match(/\-/))
					{
						ccode=data[k].split(/\-/);
					}
					else
					{
						ccode[0]=data[k];
						ccode[1]='';
					}
		
					document.getElementById("cntryname_autocomplete").value=code;
					document.getElementById("cntryiso_autocomplete").value=iso;
					document.getElementById("ph_country_autocomplete").value='+'+ccode[0];
					document.getElementById("ph_area_autocomplete").value=ccode[1];
					document.getElementById("ph_country2_autocomplete").value='+'+ccode[0];
					document.getElementById("ph_area2_autocomplete").value=ccode[1];

// 					document.getElementById("fax_country_autocomplete").value='+'+ccode[0];
// 					document.getElementById("fax_area_autocomplete").value=ccode[1];
// 					document.getElementById("fax_country2_autocomplete").value='+'+ccode[0];
// 					document.getElementById("fax_area2_autocomplete").value=ccode[1];

					document.getElementById("mob_country_autocomplete").value='+'+ccode[0];
					document.getElementById("mob_country2_autocomplete").value='+'+ccode[0];
					
					AutoComplete_HideDropdown('cntryname_autocomplete');
					break;
				}
			}
		}
		if(i==len-2)
		{
			if(count==0)
			{
				document.getElementById("cntryname_autocomplete").value='';
				document.getElementById("cntryiso_autocomplete").value='';
				document.getElementById("ph_country_autocomplete").value='';
				document.getElementById("ph_area_autocomplete").value='';
				document.getElementById("ph_country2_autocomplete").value='';
				document.getElementById("ph_area2_autocomplete").value='';
// 				document.getElementById("fax_country_autocomplete").value='';
// 				document.getElementById("fax_area_autocomplete").value='';
// 				document.getElementById("fax_country2_autocomplete").value='';
// 				document.getElementById("fax_area2_autocomplete").value='';
				document.getElementById("mob_country_autocomplete").value='';
				document.getElementById("mob_country2_autocomplete").value='';
			}
		}
	}
}