function check()
{
	var cntry,name1,phno,srno,error="null",mtext="";	 
	var txt="The following fields are mandatory"+"\n";
	var sendno;
	txt +="......................................................."+"\n";
	cntry=document.getElementById('country').value;
	name1=document.getElementById('name1').value;
	phno=document.getElementById('phno').value;
	srno=document.getElementById('srno').value;	
	if(cntry==0)
	{
		error="yes";
		txt +="Country:"+"\n";
	}
	if(name1=="")
	{
		error="yes";
		txt +="Contact Name:"+"\n";
	}
	if(phno=="")
	{
		error="yes";
		txt +="Contact Number:"+"\n";
	}
	if(srno=="")
	{
		error="yes";
		txt +="Serial Number:"+"\n";
	}
	if(error=="yes")
	{
		alert(txt);
		return false;
	}
	else
	{
	if(checkNumeric(phno,'Contact Number'))
	{
		if(confirm("Do you really want to send these details"))
		{
			if(cntry=="KSA")
			{
				//sendno="966505533683";
				sendno="919744663973";
			}
			else
			if(cntry=="QATAR")
			{
				//sendno="9745445803";
				sendno="919048219007";
			}
			mtext +="Contact Name:"+name1+"+";
			mtext +="+"+"Contact Number:"+phno+"+";
			mtext +="+"+"Serial No:"+srno;
			/*var req9 = newXMLHttpRequest();
			req9.onreadystatechange = getReadyStateHandler(req9, serverRese9);
			str="";			
			//req9.open("POST",);		
			req9.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			req9.send(str);
			document.frmsend.action='https://api.clickatell.com/http/sendmsg?user=quizent&password=2dRcOi39&api_id=3139601&to='+sendno+'&text='+mtext;
			document.frmsend.submit();*/
			return true;
		}
		else
		{
		return false;
		}
	}
	else
	{
		return false;
	}
	}
	
}
function checkNumeric(number,msg)
{
   
	if(isNaN(number))
	{
		number.value = "";		
		alert("Please enter only numeric value for"+"  " +msg);				;
		return false;	
	}
	else
	{		
		 if (number.value < 0)
		{
		    	number.value = "";
			alert("Please do not enter negative value for"+"  " +msg);			
			return false;
		}  
		else
		{
			return true;
		} 		
	}
}

function serverRese9(_var) {
	alert(_var);
}
function lnk(link)
{
	window.location.href=link;
}

