function http_val(val)
{
	if(val.length<7)
	{
		document.getElementById('S_website').value='http://';
	}
}
function check()
{
	if(document.enq_form.Description.value == "" || document.enq_form.Description.value == " ") {
		alert ("Kindly describe your requirement.");
		document.enq_form.Description.focus();
		return false;
	}
	if(document.enq_form.Description.value)
	{
		var val=document.enq_form.Description.value;
		val=val.replace(/\s/g, "");
		if (val.length == 0)
		{
			alert("Kindly describe your requirement.");
			document.enq_form.Description.focus();
			return false;
		}
	}
	var char_length = document.getElementById('charUpdate').innerHTML;
	if(char_length < 0){
			alert("You cannot enter more than 2000 characters.");
			document.getElementById('txt_descptn2').focus();
	}
	else
	{	
		document.getElementById('description_column').style.display="none";
		document.getElementById('registered_form').style.display="block";
		var formname = document.getElementById('form_name').value;
		if(formname == 'new_member')
		{
			document.getElementById('captcha_text').value ="";
			aa(); //function to call autocomplete 
		}
	}
}
function exm(){
	document.getElementById('ex_act').style.display="block";
	document.getElementById('nu_link').style.display="block";
	document.getElementById('ex_frm').style.display="block";
	document.getElementById('nu_act').style.display="none";	
	document.getElementById('nu_frm').style.display="none";
	document.getElementById('ex_link').style.display="none";
	document.exis_login.S_username.focus();
	}
	
function nufrm(){
	document.getElementById('ex_act').style.display="none";
	document.getElementById('nu_link').style.display="none";
	document.getElementById('ex_frm').style.display="none";
	document.getElementById('nu_act').style.display="block";	
	document.getElementById('nu_frm').style.display="block";
	document.getElementById('ex_link').style.display="block";
	document.dataform.S_first_name.focus();
	}
function check_data(){

		document.getElementById('which_submit').value = 'quick_visitor';
		document.dataform.Description.value=document.enq_form.Description.value;
		if(document.enq_form.Is_Cc.checked==true)
		{
			document.dataform.Is_Cc2.value='yes';
		}
		else{
			document.dataform.Is_Cc2.value='no';
		}
		if ((document.dataform.S_first_name.value.length) == 0 || (document.dataform.S_first_name.value == 'First Name'))   {
			alert ("Kindly enter your name.");
			document.dataform.S_first_name.focus();
			return false;
		}
		if(document.dataform.S_first_name.value)
		{
			
			var val=document.dataform.S_first_name.value;
			val=val.replace(/\s/g, "");
			if (val.length == 0)
 			{
				alert("Kindly enter your name.");
				document.dataform.S_first_name.focus();
				return false;
			}
		}
		if(document.dataform.S_email.value == "") {
			alert ("Kindly enter your Email-id.");
			document.dataform.S_email.focus();
			return false;
		}
		if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.dataform.S_email.value))) {
				alert("Invalid Email ID. Kindly enter correct Email ID.");
				document.dataform.S_email.focus();
				return (false);
		}

		var website_val = document.dataform.S_website.value;
		website_val = website_val.replace('http://', "");	
		document.dataform.S_website.value = website_val;

		if (document.dataform.S_website.value.length != 0)
		{
			if(document.dataform.S_website.value.indexOf(" ") != -1)	{
				alert("Kindly enter correct URL without any spaces in it.");
				document.dataform.S_website.focus();
				return false;
			}
			if(document.dataform.S_website.value.indexOf("@") != -1)	{
				alert("Invalid Website address. Kindly enter correct Website URL.");
				document.dataform.S_website.focus();
				return false;
			}
			if(document.dataform.S_website.value.indexOf(".") == -1)	{
				alert("Invalid Website address. Kindly enter correct Website URL.");
				document.dataform.S_website.focus();
				return false;
			}
			validarr = document.dataform.S_website.value.split(".");
		
			if(validarr[0].length<2)   	{
			alert("Invalid Website address. Kindly enter correct Website URL.");
			document.dataform.S_website.focus();
			return false;
			}
			if(validarr[1].length<2)   	{
			alert("Invalid Website address. Kindly enter correct Website URL.");
			document.dataform.S_website.focus();
			return false;
			}
		}
		if(document.dataform.S_countryname.value == "")
		{
			alert ("Kindly select your country.");
			document.dataform.S_countryname.focus();
			return false;
		}
		if (((document.dataform.S_phone.value =='Phone Number') || (document.dataform.S_phone.value.length == 0 )) && ((document.dataform.S_mobile.value == 'Mobile Number') || (document.dataform.S_mobile.value.length == 0)))
		{
			alert ("Kindly enter either Phone Number or Mobile Number.");
			document.dataform.S_phone.focus();
			return false;
		}
			
		if(/^\s+$/.test(document.dataform.S_acode.value))
		{
			alert ("Kindly enter correct Phone (Area Code).");
			document.dataform.S_acode.focus();
			return false;
		}
		
		if(!(/^\d+$/.test(document.dataform.S_phone.value)) && (document.dataform.S_phone.value != 'Phone Number'))
		{
			alert ("Kindly enter correct Phone Number.");
			document.dataform.S_phone.focus();
			return false;
		}
		
		if(!(/^\d+$/.test(document.dataform.S_mobile.value)) && (document.dataform.S_mobile.value != 'Mobile Number'))
		{
			alert ("Kindly enter correct Mobile Number.");
			document.dataform.S_mobile.focus();
			return false;
		}	
		if (document.dataform.captcha_text.value.length == 0)  {
			alert ("Kindly enter the code as appearing in the Image.");
			document.dataform.captcha_text.focus();
			return false;
		}else{
			document.getElementById('indicator1').style.display='block';
		}

		sendReply(); //ajax function calling

		setGlobalCookie('ImeshVisitor', makeCookie('dataform'));
}
function RegValue() {

	if(document.dataform.S_first_name.value == 'First Name')
	{
		document.dataform.S_first_name.value = '';
		document.dataform.S_first_name.className='nef13';
	}
	
	else if(document.dataform.S_first_name.value == '') 
	{
		document.dataform.S_first_name.value = 'First Name';
		document.dataform.S_first_name.className='txtfa';
	}
	
	else
	{
		document.dataform.S_first_name.className='nef13';
	}
}

function RegValue1() {

	if(document.dataform.S_first_name.value == 'First Name')
	{
		document.dataform.S_first_name.value = '';
		document.dataform.S_first_name.className='nef13';
	}
	
	else if(document.dataform.S_first_name.value == '') 
	{
		document.dataform.S_first_name.value = 'First Name';
		document.dataform.S_first_name.className='txtfa';
	}
	
	else
	{
		document.dataform.S_first_name.className='nef13';
	}
	
}

function RegeValue() {

	if(document.dataform.S_last_name.value == 'Last Name')
	{
		document.dataform.S_last_name.value = '';
		document.dataform.S_last_name.className='nef13';
	}

	else if(document.dataform.S_last_name.value == '')
	{
		document.dataform.S_last_name.value = 'Last Name';
		document.dataform.S_last_name.className='txtfa';
	}

	else
	{
		document.dataform.S_last_name.className='nef13';
	}
}

function txt1()
{
	if(document.dataform.S_phone.value == 'Phone Number')
	{
		document.dataform.S_phone.value = '';
		document.dataform.S_phone.className='nef13';
	}
	
	else if(document.dataform.S_phone.value == '') 
	{
		document.dataform.S_phone.value = 'Phone Number';
		document.dataform.S_phone.className='txtfa';
	}
	else
	{
		document.dataform.S_phone.className='nef13';
	}
}

function txt3()
{
	if(document.dataform.S_phone.value == 'Phone Number')
	{
		document.dataform.S_phone.value = '';
		document.dataform.S_phone.className='nef13';
	}
	
	else if(document.dataform.S_phone.value == '') 
	{
		document.dataform.S_phone.value = 'Phone Number';
		document.dataform.S_phone.className='txtfa';
	}
	
	else
	{
		document.dataform.S_phone.className='nef13';
	}
}

function txt()
{
	if(document.dataform.S_acode.value == 'Area Code')
	{
		document.dataform.S_acode.value = '';
		document.dataform.S_acode.className='nef13';
	}
	
	else if(document.dataform.S_acode.value == '') 
	{
		document.dataform.S_acode.value = 'Area Code';
		document.dataform.S_acode.className='txtfa';
	}
	else
	{
		document.dataform.S_acode.className='nef13';
	}
}

function txt4()
{
	if(document.dataform.S_acode.value == 'Area Code')
	{
		document.dataform.S_acode.value = '';
		document.dataform.S_acode.className='nef13';
	}
	
	else if(document.dataform.S_acode.value == '') 
	{
		document.dataform.S_acode.value = 'Area Code';
		document.dataform.S_acode.className='txtfa';
	}
	else
	{
		document.dataform.S_acode.className='nef13';
	}	
}
    
function settext()
{
	if (document.dataform.S_acode.value=='')
	{
		document.dataform.S_acode.value='Area Code';
		document.dataform.S_acode.className='txtfa';
	}
}	


function settext1()
{
	if(document.dataform.S_phone.value=='')  
	{
		document.dataform.S_phone.value='Phone Number';
		document.dataform.S_phone.className='txtfa';

	}
}

function txt2()
{
	if(document.dataform.S_mobile.value=='Mobile Number')
	{
		document.dataform.S_mobile.value='';
		document.dataform.S_mobile.className='nef13';

	}
}
    
function settext2()
{
	if(document.dataform.S_mobile.value=='')  
	{
	
		document.dataform.S_mobile.value='Mobile Number';
		document.dataform.S_mobile.className='txtfa';

	}
}

function set()
{
		document.getElementById('which_submit').value = 'submit_member';
		document.exis_login.Description.value=document.enq_form.Description.value;
		if (document.enq_form.Is_Cc.checked==true)
		{
			document.exis_login.Is_Cc1.value='yes';
		}
		else{
			document.exis_login.Is_Cc1.value='no';
		}
		 if (document.exis_login.S_username.value == "") {
			alert ("Kindly enter the E-mail Id");
			document.exis_login.S_username.focus();
		}
		else if (document.exis_login.S_username.value.length < 4) {
			alert ("Kindly enter the E-mail ID of at least 4 characters.");
			document.exis_login.S_username.focus();
		}
		else if (document.exis_login.S_password.value == "") {
			alert ("Kindly enter the password");
			document.exis_login.S_password.focus();
		}
		else if (document.exis_login.S_password.value.length < 4) {
			alert ("Kindly enter the password  of at least 4 characters.");
			document.exis_login.S_password.focus();
		}
		else {
			document.getElementById('indicator1').style.display='block';
			sendReply(); //ajax calling
		}
}

function set2(){

		if(document.login_form.Is_Cc.checked==true)
		{
			document.login_form.Is_Cc3.value='yes';
		}
		else{
			document.login_form.Is_Cc3.value='no';
		}

		var char_length = document.getElementById('charUpdate1').innerHTML;
		if(char_length < 0){
			alert("You cannot enter more than 2000 characters.");
			document.getElementById('txt_descptn1').focus();
		}
		else if(document.getElementById('txt_descptn1').value == "") {
			alert ("Kindly describe your requirement.");
			document.getElementById('txt_descptn1').focus();
		}
		else{
        		document.getElementById('indicator').style.display='block';
			sendReply(); //ajax calling
		}
}

function style1()
{
	if (document.dataform.S_acode.value != 'Area Code')
	{
		document.dataform.S_acode.className = 'nef13';
	}
	if(document.dataform.S_acode.value == '')
	{
		document.dataform.S_acode.value ='Area Code';
		document.dataform.S_acode.className = 'txtfa';
	}
	if(document.dataform.S_acode.value == 'Area Code')
	{
		document.dataform.S_acode.className = 'txtfa';
	}
	if (document.dataform.S_phone.value != 'Phone Number')
	{
		document.dataform.S_phone.className = 'nef13';
	}
	if (document.dataform.S_phone.value == 'Phone Number')
	{
		document.dataform.S_phone.className = 'txtfa';
	}
	if(document.dataform.S_phone.value == '')
	{
		document.dataform.S_phone.value ='Phone Number';
		document.dataform.S_phone.className = 'txtfa';
	}
	if (document.dataform.S_mobile.value != 'Mobile Number')
	{
		document.dataform.S_mobile.className = 'nef13';
	}
	if (document.dataform.S_mobile.value == 'Mobile Number')
	{
		document.dataform.S_mobile.className = 'txtfa';
	}
	if(document.dataform.S_mobile.value == '')
	{
		document.dataform.S_mobile.value ='Mobile Number';
		document.dataform.S_mobile.className = 'txtfa';
	}
	if (document.dataform.S_first_name.value != 'First Name')
	{
		document.dataform.S_first_name.className = 'nef13';
	}
	if(document.dataform.S_first_name.value == '')
	{
		document.dataform.S_first_name.value ='First Name';
		document.dataform.S_first_name.className = 'txtfa';
	}
	if (document.dataform.S_first_name.value == 'First Name')
	{
		document.dataform.S_first_name.className = 'txtfa';
	}
	if (document.dataform.S_last_name.value == 'Last Name')
	{
		document.dataform.S_last_name.className = 'txtfa';
	}
	if (document.dataform.S_last_name.value != 'Last Name')
	{
		document.dataform.S_last_name.className = 'nef13';
	}
	if(document.dataform.S_last_name.value == '')
	{
		document.dataform.S_last_name.value ='Last Name';
		document.dataform.S_last_name.className = 'txtfa';
	}
}
function open_form(Rank,Glusr_id)
{
	var value = "";
	value = readCookie('v4iilex');
	
	if(value == null || value == "")
	{
		document.getElementById('outermostdiv').style.display="block";
		document.getElementById('description_column').style.display="block";
		document.getElementById('registered_form').style.display="none";
		document.getElementById('thank_msg').style.display="none";
		document.getElementById('captcha_text').value="";
		document.getElementById('indicator1').style.display='none';
                document.getElementById('txt_descptn2').value="";
		document.getElementById('txt_descptn2').focus();
		recordOutboundLink2('Enquiry Submission - Inline Form (FCP)', 'Rank'+Rank+' - AboutUs - LogOut Send Another Enquiry', Glusr_id);
		
	}
	else{
		document.getElementById('outermostdiv').style.display="none";
		document.getElementById('loginform').style.display="block";
		document.getElementById('thank_msg').style.display="none";
		document.getElementById('indicator1').style.display='none';
		document.getElementById('indicator').style.display='none';
		document.getElementById('txt_descptn1').value="";
		document.getElementById('txt_descptn1').focus();
		recordOutboundLink2('Enquiry Submission - Inline Form (FCP)', 'Rank'+Rank+' - AboutUs - LogIn Send Another Enquiry', Glusr_id);
		
	}
	

}
function back_form()
{
	document.getElementById('outermostdiv').style.display="block";
	document.getElementById('description_column').style.display="block";
	document.getElementById('registered_form').style.display="none";
	document.getElementById('thank_msg').style.display="none";
	document.getElementById('form_name').value = 'new_member';
	document.getElementById('txt_descptn2').focus();
}

function back_form1()
{
	document.getElementById('outermostdiv').style.display="block";
	document.getElementById('description_column').style.display="block";
	document.getElementById('registered_form').style.display="none";
	document.getElementById('thank_msg').style.display="none";
	document.getElementById('form_name').value = 'existing_member';
}

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

function characterLimit(txt, chr){ 
	if(document.getElementById(txt)){
		var characters = document.getElementById(txt).value;
		document.getElementById(chr).innerHTML = 2000-characters.length;		
	}
}

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=new Array();
var j=0;
for(var i=0;i<data.length;i+=3)
{
	data1[j] = data[i];
	j++;
}

function aa()
{
	S_countryname = document.getElementById('S_countryname').value;
	AutoComplete_Create('S_countryname', data1);
	
}

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("S_ccode").value='';
			document.getElementById("S_cmobile").value='';
			document.getElementById("S_countryname").value='';
			document.getElementById("S_country_name").value='';
		}
		Show(val);
	}
	function Show(populate){
	var len =data.length;
	var i=0;
	var j=0;
	var k=0;
	len=len+1;
	var count=0;
	for(i=0;i<=len;i++)
	{
		
		var data1='';
		if(data[i])
		{
			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("S_countryname").value=code;
			document.getElementById("S_country_name").value=iso;
			document.getElementById("S_ccode").value='+'+ccode[0];
			document.getElementById("S_cmobile").value='+'+ccode[0];
			if(ccode[1] !='')
			{
				document.getElementById("S_acode").value=ccode[1];
			}
			document.getElementById("S_ccode").focus();
			AutoComplete_HideDropdown('S_countryname');
		}
		}
		if(i==len-2)
		{
			if(count==0)
			{
			document.getElementById("S_ccode").value='';
			document.getElementById("S_acode").value='';
			document.getElementById("S_acode").value='Area Code';
			document.getElementById("S_acode").className='txtfa';
			document.getElementById("S_cmobile").value='';
			document.getElementById("S_countryname").value='';
			document.getElementById("S_country_name").value='';
			}
		}

	}
}
//Captcha code Starts
function setCaptchaRef()
{
	var d = new Date();
	var epoch_time =(d.getTime()-d.getMilliseconds())/1000;
	var randomnumber=Math.floor(Math.random()*9999);
	var randomnumber1=Math.floor(Math.random()*9999);
	var ran_num=randomnumber+"."+epoch_time+"."+randomnumber1;
	var captcha_url="/cgi/get_captcha.cgi?cref="+ran_num+"&style=2";


    	document.getElementById('captcha_ref').value = ran_num;
	document.getElementById('new_captcha').src = captcha_url;

}
//Captcha code Ends
