// JavaScript Document
 var xmlHttp
	
	//############################################[ CHECK  VALIDATION]#####################################################
function CheckRegistration(code,email)
	{ 
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		
			missinginfo = "";

			if ((document.form.email==null)||(document.form.email.value==""))
				missinginfo += "\n - Email Address";
			
			if ((document.form.password==null)||(document.form.password.value=="")) 
				missinginfo += "\n - Password";
			
			if ((document.form.cpassword==null)||(document.form.cpassword.value==""))
				missinginfo += "\n - Confirm Password";
			
			if ((document.form.cpassword.value!="") && (document.form.password.value!=""))
			{
				if(document.form.password.value!=document.form.cpassword.value)	
					missinginfo += "\n - Password Mismatch";
			}


	if ((document.form.clubName1.value=="") && (document.form.clubName2.value==""))
			{
					missinginfo += "\n - Please select a club from the list or enter a new club";
			}			
			
			if ((document.form.clubName1.value!="") && (document.form.clubName2.value!=""))
			{
					missinginfo += "\n - Fill only one club name Field";
			}			

				
			
			if ((document.form.forename==null)||(document.form.forename.value==""))
				missinginfo += "\n - Forename(s)";
				
			if ((document.form.surname==null)||(document.form.surname.value=="")) 
				missinginfo += "\n - Surname";
				
        /*	if ((document.form.postCode.value==null)||(document.form.postCode.value=="")) 
				  missinginfo += "\n - Postcode ";*/
				  
			/*if ((document.form.postCode.value!=null)||(document.form.postCode.value!=""))
			{
				  if(isNaN(document.form.postCode.value))
				  missinginfo += "\n - Postcode must be numeric";	  
			}*/
			
/*		    if (document.form.postCode.value!=='') 
			 {
			    if(isNaN(document.form.postCode.value))	
				  missinginfo += "\n -Invalid Postcode ";
			 }
*/		
			/*if ((document.form.telephone_dayTime==null)||(document.form.telephone_dayTime.value=="")) 
				missinginfo += "\n - Telephone";*/
				
			/*if ((document.form.city==null)||(document.form.city.value=="")) 
				missinginfo += "\n - City";	*/
				
			/*if ((document.form.address==null)||(document.form.address.value=="")) 
				missinginfo += "\n - Address";*/
				
			/*if ((document.form.countryId==null)||(document.form.countryId.value=="")) 
				missinginfo += "\n - Country Name";*/
					
			/*if(document.form.telephone_dayTime.value!=""){
			if(isNaN(document.form.telephone_dayTime.value)){
				missinginfo += "\n - Day Time Telephone Number should be Numeric";
			}}*/
			
			/*if(document.form.telephone_evening.value!=""){
			if(isNaN(document.form.telephone_evening.value)){
				missinginfo += "\n - Evening Telephone Number should be Numeric";
			}}*/
			/*if(document.form.mobile.value!=""){
			if(isNaN(document.form.mobile.value)){
				missinginfo += "\n - Mobile Number should be Numeric";
			}}*/
		
			/////////////// Shipping Form Validation ////////////////////////////////
			
			if ((document.form.s_firstName==null)||(document.form.s_firstName.value==""))
				missinginfo += "\n Shipping Address - Forename";
			
			if ((document.form.s_lastName==null)||(document.form.s_lastName.value==""))
				missinginfo += "\n Shipping Address - Surname";
			
			if ((document.form.s_streetAddress==null)||(document.form.s_streetAddress.value==""))
				missinginfo += "\n Shipping Address - Street Address(s)";
			
			if ((document.form.s_city==null)||(document.form.s_city.value=="")) 
				missinginfo += "\n Shipping Address - City";
			
			if ((document.form.s_telephone==null)||(document.form.s_telephone.value=="")) 
				missinginfo += "\n Shipping Address - Telephone";
			
			if ((document.form.s_postCode==null)||(document.form.s_postCode.value=="")) 
				missinginfo += "\n Shipping Address - Post Code";
			
			if ((document.form.s_countryId==null)||(document.form.s_countryId.value=="")) 
				missinginfo += "\n Shipping Address - Country Name";
		
		///////////// billing form validation /////////////////////////
		/*if ((document.form.b_email==null)||(document.form.b_email.value==""))
			missinginfo += "\n Billing Address - Email Address";
	
		if ((document.form.b_streetAddress==null)||(document.form.b_streetAddress.value==""))
			missinginfo += "\n Billing Address - Street Address(s)";
			
		if ((document.form.b_suburb==null)||(document.form.b_suburb.value=="")) 
			missinginfo += "\n Billing Address - Sub Urb";
		
		if ((document.form.b_city==null)||(document.form.b_city.value=="")) 
			missinginfo += "\n Billing Address - City";
		
		if ((document.form.b_postCode==null)||(document.form.b_postCode.value=="")) 
			missinginfo += "\n Billing Address - Post Code";
		
		if ((document.form.b_countryId==null)||(document.form.b_countryId.value=="")) 
			missinginfo += "\n Billing Address - Country Name";*/
		
		
	
		if(document.getElementById("Turing").value=='')
			missinginfo += "\n - Security Code";
		
		
		if (missinginfo != "") 
		{
			missinginfo ="__________________________________\n" +
			"Required information is missing: \n" +
			missinginfo + "\n__________________________________" +
			"\nPlease check and resubmit.";
			alert(missinginfo);
			return false;
		}
		
		if (document.form.email.value!=""){
			if (echeck(document.form.email.value)==false){
				document.form.email.value="";
				return false;
			}
		}	
		
		/*if (document.form.s_email.value!=""){
			if (echeck(document.form.s_email.value)==false){
				document.form.s_email.value="";
				return false;
			}
		}	*/
		
		if(document.getElementById("Turing").value!="")
		{
			var url="check_securitycode.php?code="+code+"&email="+email;

			xmlHttp.onreadystatechange=stateregistervalidation
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
		}
	}
			
	function stateregistervalidation() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		   //xmlHttp.responseText;
		
			if(xmlHttp.responseText!=1)
			{
				 alert(xmlHttp.responseText);
				 document.getElementById('captcha').src = document.getElementById('captcha').src + '?' + (new Date()).getMilliseconds();
				 return false;
			}
			else
			{
			     document.form.action="registration.php?Submit=Sign_up";	
				  document.form.submit();
			}
		}
	}
	/////////////////////////////////////////////////
	function updateDeliveryArea(shipCountry,weight)
	{ 
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		else
		{
			var url="updateDeliveryCost.php?shipCountry="+shipCountry+"&weight="+weight;
			xmlHttp.onreadystatechange=stateUpdateDeliveryCost
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
		}
	}
	
	function stateUpdateDeliveryCost()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	
			// alert(xmlHttp.responseText);
			 
			document.getElementById('form').submit();	
		}
	}
	
 //########################################################################################
 
	//display subcategory .................................
	function showsubcategory(val)
	{		
		//alert(val)
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="../getSubcategory.php?catId="+val;	
		xmlHttp.onreadystatechange=statechanged
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	function setdefault()
	{
		//alert(saddasdasd)
	}
	function statechanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			
			results = xmlHttp.responseText.split("<br>");    							
			document.form.subCategoryId.options.length =0 ;
			document.form.subCategoryId.options[document.form.subCategoryId.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.form.subCategoryId.options[document.form.subCategoryId.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	//--------------end here --------------------
	
	
	//-----------show country state ---------------------	
	
	function showCountryStates(cid)
	{		
		//alert(cid)
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="getCountryStates.php?cId="+cid;			

		xmlHttp.onreadystatechange=countryStates
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}		
	function countryStates() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			
			//alert(results)
			document.form.regionName.options.length =0 ;
			document.form.regionName.options[document.form.regionName.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.form.regionName.options[document.form.regionName.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	
	function populateClubList(clubCountryId,clubType,clubRegion)
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="populateClubList.php?clubCountryId="+clubCountryId+"&clubType="+clubType+"&clubRegion="+clubRegion;			
		//alert(url);
		xmlHttp.onreadystatechange=clubList
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	
	function clubList() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			
			//alert(results)
			document.form.clubName1.options.length =0 ;
			document.form.clubName1.options[document.form.clubName1.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.form.clubName1.options[document.form.clubName1.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	
	function showCountryStates1(cid)
	{		
		//alert(cid)
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="getCountryStates.php?cId="+cid;				
		xmlHttp.onreadystatechange=countryStates1
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}		
	function countryStates1() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			
			//alert(results)
			document.form.regionName.options.length =0 ;
			document.form.regionName.options[document.form.regionName.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.form.regionName.options[document.form.regionName.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	///////------------end here ----------------
	
	
	function showsubterritory(id)
	{		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="subterritory.php?id="+id;				
		xmlHttp.onreadystatechange=displaystates
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
		
	function displaystates() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			document.frmvideo.regionName.options.length =0 ;
			document.frmvideo.regionName.options[document.frmvideo.regionName.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.frmvideo.regionName.options[document.frmvideo.regionName.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	
	
	function showsubter(val)
	{		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="subterritory.php?id="+val;				
		xmlHttp.onreadystatechange=statesubter
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
		
	function statesubter() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			document.frmwish.sub_territory.options.length =0 ;
			document.frmwish.sub_territory.options[document.frmwish.sub_territory.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.frmwish.sub_territory.options[document.frmwish.sub_territory.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	
	
	function showvideo(val)
	{			
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="showvideo.php?id="+val;		
		xmlHttp.onreadystatechange=videochanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function videochanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("<br>");    							
			document.frmdeal.video.options.length =0 ;			
			document.frmdeal.video.options[document.frmdeal.video.options.length]= new Option("Select","");
			for(i=0;i < results.length-1;i++)
			{
				optionsval = results[i].split(",");
				document.frmdeal.video.options[document.frmdeal.video.options.length]= new Option(optionsval[1],optionsval[0]);
			}    
		} 
	}
	
	function showplat_ter(val)
	{		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}				
		var url="showplat_terr.php?id="+val;		
		xmlHttp.onreadystatechange=plat_ter
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
	
	function plat_ter() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			results = xmlHttp.responseText.split("DIFF");			
			if(results[0]==null || results[1]==null)
			{
				document.frmdeal.platform.options.length =0 ;						
				document.frmdeal.territory.options.length =0 ;						
				document.frmdeal.SUB_territory.options.length =0 ;						
			}
			else
			{
				results1 = results[0].split("<br>");    							
				results2 = results[1].split("<br>");
				results3 = results[2].split("<br>");
				document.frmdeal.platform.options.length =0 ;						
				for(i=0;i < results1.length-1;i++)
				{
					optionsval = results1[i].split(",");
					document.frmdeal.platform.options[document.frmdeal.platform.options.length]= new Option(optionsval[1],optionsval[0]);
				}
				document.frmdeal.territory.options.length =0 ;						
				for(i=0;i < results2.length-1;i++)
				{
					optionsval = results2[i].split(",");
					document.frmdeal.territory.options[document.frmdeal.territory.options.length]= new Option(optionsval[1],optionsval[0]);
				}
				document.frmdeal.sub_territory.options.length =0 ;						
				for(i=0;i < results3.length-1;i++)
				{
					optionsval = results3[i].split(",");
					document.frmdeal.sub_territory.options[document.frmdeal.sub_territory.options.length]= new Option(optionsval[1],optionsval[0]);
				}
			}
		} 
	}
	
	
	function showrunvideo(val)
	{		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="runningvideo.php?id="+val;				
		xmlHttp.onreadystatechange=staterunvideo
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
		
	function staterunvideo() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			document.getElementById('runningvideo').innerHTML= xmlHttp.responseText;			   
		} 
	}
	
	
	function showindexinformation(val)
	{		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		var url="index_"+val+".php";				
		xmlHttp.onreadystatechange=stateindexinformation
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
		
	function stateindexinformation() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			document.getElementById('indexinformation').innerHTML= xmlHttp.responseText;			   
		} 
	}
	var type;
	function checkexists(obj)
	{				
		val=obj.value;
		type=obj.id;
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}		
		if(val=="")
		{
			alert("Please enter the information");
			document.getElementById(type).focus();
			return true;
		}
		var url="checkexists.php?val="+val;				
		xmlHttp.onreadystatechange=statecheckexists
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}	
		
		
	function statecheckexists() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{			
			if(xmlHttp.responseText!="")
			{				
				document.getElementById(type).className='RedBut';
				document.getElementById('checkavailable').innerHTML= xmlHttp.responseText;
				document.getElementById(type).focus();				
			}
			else
			{
				document.getElementById(type).className='But1';
				document.getElementById('checkavailable').innerHTML="";				
			}
		} 
	}
	
	function GetXmlHttpObject()
	{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
			objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp
	}
	

 var SPUID;
 var pgname;
 
 function add2hotlist_snddig(id,loginstatus,memberId,action,receiverId)
	{     
		SPUID=id;
		login=loginstatus;
		mid=memberId;
		action=action;
		receiverId=receiverId;
		
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="template/popUpPage.php?login="+login+"&mid="+mid+"&action="+action+"&receiverId="+receiverId;
		
		xmlHttp.onreadystatechange=stategetpopup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function submitRating(id,loginstatus,ratingNumber,rateBy,rateTo)
	{     
		SPUID=id;
		login=loginstatus;
		ratingNumber=ratingNumber;
		rateBy=rateBy;
		rateTo=rateTo;
		action='rating';
		
	    xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		var url="template/popUpPage.php?login="+login+"&ratingNumber="+ratingNumber+"&rateBy="+rateBy+"&action="+action+"&rateTo="+rateTo;
		
		xmlHttp.onreadystatechange=stategetpopup
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
	}	
	function stategetpopup() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{   
		    m=xmlHttp.responseText;
			document.getElementById(SPUID).innerHTML=m;	
			scrollleft=document.all?document.documentElement.scrollLeft:window.pageXOffset;
		    scrolltop=document.all?document.documentElement.scrollTop:window.pageYOffset;	
			//document.getElementById(SPUID).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(SPUID).style.width)/2)+"px";
		    //document.getElementById(SPUID).style.top=(((parseInt(document.body.clientHeight)+parseInt(scrolltop))/2-parseInt(document.getElementById(SPUID).style.width)/2))+"px";
			document.getElementById(SPUID).style.left=((parseInt(document.body.clientWidth)+parseInt(scrollleft))/2-parseInt(document.getElementById(SPUID).style.width)/2)+"px";
		    document.getElementById(SPUID).style.top=(scrolltop+150)+"px";
			
			if(pgname=='privacy')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='notification')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='vote')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
			if(pgname=='invite')
			{
			  document.getElementById(SPUID).style.width='700px';	
			}
		}
	}



function validateFormOnSubmit(theForm) {

var reason = "";


  reason += validateUsername(theForm.Name);
  reason += validateSurname(theForm.Surname);
  reason += validatePhone(theForm.Telephone);
  reason += validateEmail(theForm.email);
  reason += validateEmpty(theForm.teamname);
  reason += validateEmptySelect(theForm.Country);
  reason += validateEmpty(theForm.supplier);
  reason += validateEmpty(theForm.message);

      
  if (reason != "") {
    alert("Some fields need correction:\n" + reason);
    return false;
  }

  return true;
}

function validateEmpty(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = "The required field has not been filled in.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateUsername(fld) {
    var error = "";
    	
	var illegalChars = /\W/; // allow letters, numbers, and underscores
    if (fld.value == "") {
        fld.style.background = 'Yellow'; 
        error = "You didn't enter your name.\n";
    } else if (illegalChars.test(fld.value)) {
        fld.style.background = 'Yellow'; 
        error = "The name contains illegal characters.\n";
    } else {
        fld.style.background = 'White';
    }
	return error;
}

function validateSurname(fld) {
    var error = "";
    	
	var illegalChars = /\W/; // allow letters, numbers, and underscores
    if (fld.value == "") {
        fld.style.background = 'Yellow'; 
        error = "You didn't enter your surname.\n";
    } else if (illegalChars.test(fld.value)) {
        fld.style.background = 'Yellow'; 
        error = "The surname contains illegal characters.\n";
    } else {
        fld.style.background = 'White';
    }
	return error;
}



function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}

function validateEmail(fld) {
    var error="";
    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
   
    if (fld.value == "") {
        fld.style.background = 'Yellow';
        error = "You didn't enter an email address.\n";
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
        fld.style.background = 'Yellow';
        error = "Please enter a valid email address.\n";
    } else if (fld.value.match(illegalChars)) {
        fld.style.background = 'Yellow';
        error = "The email address contains illegal characters.\n";
    } else {
        fld.style.background = 'White';
    }
    return error;
}

function validatePhone(fld) {
    var error = "";
    var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    

   if (fld.value == "") {
        error = "You didn't enter a phone number.\n";
        fld.style.background = 'Yellow';
    } else if (isNaN(parseInt(stripped))) {
        error = "The phone number contains illegal characters.\n";
        fld.style.background = 'Yellow';
    } 
	
//	else if (!(stripped.length == 10)) {
//        error = "The phone number is the wrong length. Make sure you included an area code.\n";
//        fld.style.background = 'Yellow';
//    }
    return error;
}


function validateEmptySelect(fld)
{
    var error = "";
	 if (fld.value == "-1") {
        error = "You din't Select your country name.\n";
        fld.style.background = 'Yellow';
    }   return error;
}  