	function TermsCond(){
		mypopup=window.open('free-online-dating/asp/rules.asp','popup','toolbar=no,location=no,directories=no,status=no,' + 
		'menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,top=0,left=0,width=420,height=440');
	}

	function memberslogin(){
		document.entry.ENTER.value="ENTER";
		document.entry.submit();
	}
	
	function onEnter( evt, frm ) {
		var keyCode = null;
		if( evt.which ) {			//for Netscape,Firefox,Opera
			keyCode = evt.which;
		} else if( evt.keyCode ) {	//for IE
			keyCode = evt.keyCode;
		}
		
		if( 13 == keyCode ) {
			frm.ENTER.value="ENTER";
			frm.submit();
		return false;
		}
		return true;
	}	
	
	var xmlHttp;
	function CountryListOnChange() 
	{
		var countryList = document.JoinForm.Country;
		var countryName = countryList.options[countryList.selectedIndex].value;
		var locations="";

		//if(document.all["locations"] != null)
		if(document.JoinForm.locations != null)		
			locations=document.JoinForm.locations[document.JoinForm.locations.selectedIndex].value;		
		else
			locations="Choose";

		if(countryName!=165){
			if(countryName!=75){
				document.getElementById("locid").innerHTML=""
			}
			document.getElementById("sublocid").innerHTML=""		
		}else{
				document.getElementById("locid").innerHTML="";	
				createSelect("locid");
				document.getElementById("sublocid").innerHTML=""						
				createSelect("sublocid");				
		}

		if(countryName!="Choose"){
			if(countryName==7 || countryName==25 || countryName==54 ||
				countryName==58 || countryName==75 || countryName==77 ||
				countryName==79|| countryName==112 || countryName==113 ||
				countryName==125 || countryName==129 || countryName==130 ||
				countryName==143 || countryName==145 || countryName==151 ||
				countryName==165 || countryName==166){
				
				//	submit down as it is with level one passed to indicate that the next level down from the country	
				//	has been selected. Also pass country through
				
					document.JoinForm.countryLevel.value=1;
				}
				else{
					if(document.JoinForm.countryLevel.value!=0){
						document.JoinForm.countryLevel.value=0;
				}
			}
		}
	    CreateXmlHttp();
    	if(xmlHttp)
    	{	
        	xmlHttp.onreadystatechange = HandleResponse;
        	if(locations!="" || locations.length!=0){
        		xmlHttp.open("GET", "displayLocation.asp?countryName="+ encodeURIComponent(countryName)+"&countryLevel="+encodeURIComponent(document.JoinForm.countryLevel.value)+"&locations="+locations,  true);
        	}else{
				xmlHttp.open("GET", "displayLocation.asp?countryName="+ encodeURIComponent(countryName)+"&countryLevel="+encodeURIComponent(document.JoinForm.countryLevel.value)+"&locations=Choose",  true);        			
			}	
        	xmlHttp.send(null);           
    	}
	}

//Browser Support Code	
	function CreateXmlHttp()
	{
		if(window.XMLHttpRequest){ 
			xmlHttp = new XMLHttpRequest(); 
		} 
		else if (window.ActiveXObject){ 
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			if (!xmlHttp){ 
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
			}	
		} 
		return xmlHttp; 			
	}

	function HandleResponse()
	{
		if(xmlHttp.readyState == 4)
		{
        		if(xmlHttp.status == 200)
        		{
					document.getElementById("locid").innerHTML=xmlHttp.responseText;
        		}
        		else
        		{
            			alert("There was a problem retrieving data from the server. "+xmlHttp.statusText );
        		}
    		}
	}
	function HandleResponse_Sub()
	{
		if(xmlHttp.readyState == 4)
		{
        		if(xmlHttp.status == 200)
        		{
					document.getElementById("sublocid").innerHTML=xmlHttp.responseText;
        		}
        		else
        		{
            			alert("There was a problem retrieving data from the server. "+xmlHttp.statusText );
        		}
    		}
	}
	function getSublocations1(){
			var countryList = document.JoinForm.Country;
			var countryName = countryList.options[countryList.selectedIndex].value;	
			var locations;
			if(document.JoinForm.locations[document.JoinForm.locations.selectedIndex].value!="Choose"){
				locations=document.JoinForm.locations[document.JoinForm.locations.selectedIndex].value;
				document.JoinForm.locations_new.value=locations;
				document.JoinForm.countryLevel.value=2;
	    		CreateXmlHttp();
   				if(xmlHttp)
   				{	
       				xmlHttp.onreadystatechange = HandleResponse_Sub;
   					xmlHttp.open("GET", "displaySubLocation.asp?countryName="+ encodeURIComponent(countryName)+"&countryLevel="+encodeURIComponent(document.JoinForm.countryLevel.value)+"&locations="+locations,  true);
       				xmlHttp.send(null);           
   				}		
			}else{
					locations=document.JoinForm.locations[document.JoinForm.locations.selectedIndex].value;
					document.JoinForm.locations_new.value=locations;
					document.getElementById("sublocid").innerHTML=""			
					if(countryName=="165")
						createSelect("sublocid");				
			}
	}
	
	function createSelect(divId){
		var locDiv=document.getElementById(divId);
		var mySelect=document.createElement("select");
		var theOption=document.createElement("OPTION");
		var theText=document.createTextNode("Choose");
		theOption.appendChild(theText);
		theOption.setAttribute("value","Choose");
		mySelect.appendChild(theOption);
		locDiv.appendChild(mySelect); 	
	/*	if(divId=="sublocid"){
			locDiv.appendChild(document.createElement('br'));
			locDiv.appendChild(document.createElement('br'));		
		}
	*/	
	}	
	
	function usernameCheck(x){
		if(x){
			if(document.JoinForm.username.value=="Choose a username")document.JoinForm.username.value="";
		}
		else{
			if(document.JoinForm.username.value=="")document.JoinForm.username.value="Choose a username";
		}
	}
	function emailCheck(x){
		if(x){
			if(document.JoinForm.email.value=="Your email address")document.JoinForm.email.value="";
		}
		else{
			if(document.JoinForm.email.value=="")document.JoinForm.email.value="Your email address";
		}
	}

	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"=stored_"+value+expires+"; path=/";
	}
	
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	
	var allCookies=document.cookie;
	var pos=allCookies.indexOf("referrer=stored_");
	if(pos==-1){
		createCookie("referrer",escape(document.referrer),1000)
	}
	
	
	
	
	function procForm(){
		
		var dateLocal=new Date();
		
		document.JoinForm.localYea.value=dateLocal.getFullYear()+"";
		document.JoinForm.localMon.value=dateLocal.getMonth()+"";
		document.JoinForm.localDay.value=dateLocal.getDate()+"";
		document.JoinForm.localHou.value=dateLocal.getHours()+"";
		document.JoinForm.localMin.value=dateLocal.getMinutes()+"";
		document.JoinForm.localSec.value=dateLocal.getSeconds()+"";
		
		var refCookie = readCookie('referrer');
		if (refCookie) {
			refCookie=refCookie.replace(/stored_/,"");
			document.JoinForm.Referer.value=unescape(refCookie);
		}
		else{
			document.JoinForm.Referer.value="not found";
		}
		
		
	}	


