//validation
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;

var iChars = "'\<>";
var iChars1 = "'\<>";
//var iChars1 = "!@$^*()=[]\';{}|\"<>";

// JavaScript Document for ARC

// Check Text or Not
			function isText(str)
			{
			var i=0;
			if(str.charAt(0)==' ')i++;
			while(i<str.length)
			{
			if (str.charAt(i)>='0' && str.charAt(i)<= '9' || str.charAt(i)=='+' || str.charAt(i)=='-' || str.charAt(i)=='*' || str.charAt(i)=='/' || str.charAt(i)=='\\' || str.charAt(i)=='\'' || str.charAt(i)=='@' || str.charAt(i)=='!' || str.charAt(i)=='~' || str.charAt(i)=='`' || str.charAt(i)=='#' || str.charAt(i)=='$' || str.charAt(i)=='%' || str.charAt(i)=='^' || str.charAt(i)=='&' || str.charAt(i)=='(' || str.charAt(i)==')' || str.charAt(i)=='_' || str.charAt(i)=='=' || str.charAt(i)=='?' || str.charAt(i)=='.' || str.charAt(i)==',' || str.charAt(i)==';' || str.charAt(i)==':' || str.charAt(i)=='"' || str.charAt(i)=='{' || str.charAt(i)=='}' || str.charAt(i)=='[' || str.charAt(i)==']' || str.charAt(i)=='<' || str.charAt(i)=='>' || str.charAt(i)=='|')
			return false;
			i++;
			}
			return true;
			}

//Check city or not
			function isCity(str)
			{
			var i=0;
			while(i<str.length)
			{
			if (str.charAt(i)=='+' || str.charAt(i)=='-' || str.charAt(i)=='*' || str.charAt(i)=='/' || str.charAt(i)=='\\' || str.charAt(i)=='\'' || str.charAt(i)=='@' || str.charAt(i)=='!' || str.charAt(i)=='~' || str.charAt(i)=='`' || str.charAt(i)=='#' || str.charAt(i)=='$' || str.charAt(i)=='%' || str.charAt(i)=='^' || str.charAt(i)=='&' || str.charAt(i)=='(' || str.charAt(i)==')' || str.charAt(i)=='_' || str.charAt(i)=='=' || str.charAt(i)=='?' || str.charAt(i)=='.' || str.charAt(i)==',' || str.charAt(i)==';' || str.charAt(i)==':' || str.charAt(i)=='"' || str.charAt(i)=='{' || str.charAt(i)=='}' || str.charAt(i)=='[' || str.charAt(i)==']' || str.charAt(i)=='<' || str.charAt(i)=='>' || str.charAt(i)=='|')
			{
			return false;
			}
			i++;
			}
			return true;
			}
			
// Check Phone Number or not
			function isTelephoneNumber(str)
			{
			var i=0;
			if(str.charAt(0)=='+')i++;
			while(i<str.length)
			{
			if (!(str.charAt(i)>='0' && str.charAt(i)<= '9' || str.charAt(i)==' ' || str.charAt(i)=='-' || str.charAt(i)=='(' || str.charAt(i)==')') )
			return false;
			i++;
			}
			return true;
			}
// Check Phone Number length
			function isLength(str)
			{
			var len=str.length;
			if(len<10)
			{
			return false;
			}
			return true;
			}
// Check Number or Not
			function isNumeric(str)
			{
			var i=0;
			while(i<str.length)
			{
			if (!(str.charAt(i)>='0' && str.charAt(i)<= '9' || str.charAt(i)==' '))
			return false;
			i++;
			}
			return true;
			}
			
// Remove the empty space
			function trim(String)
			{
			if (String == null)
			{   
			return ("");
			}
			return String.replace(/(^\s+)|(\s+$)/g,"");
			}

function submitit()
{
//Mainfield-Appointment
if (document.getElementById("cmbtype").value=='Appointment')
{
	if (document.getElementById("hospital1").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital1").focus();
		return false;}
	if (document.getElementById("txtdocname").value==0){
		alert ("Enter your Name doctor/Speciality");
		document.getElementById("txtdocname").focus();
		return false;}
	else if(!isText(document.getElementById("txtdocname").value))
				{
				alert("Doctor name will only accept alphabetic values");
				document.getElementById("txtdocname").focus();
				return false;
				}
		
	if (document.getElementById("app_date").value==""){
		alert ("Please select date");
		document.getElementById("app_date").focus();
		return false;}
	if (document.getElementById("patientname").value==0){
		alert ("Please enter patientname");
		document.getElementById("patientname").focus();
		return false;}
		else if(!isText(document.getElementById("patientname").value))
				{
				alert("Patient name will only accept alphabetic values");
				document.getElementById("patientname").focus();
				return false;
				}
for (var i = 0; i < document.getElementById("regno").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("regno").value.charAt(i)) != -1) {
  	alert ("Your regno has special characters. \nThese are not allowed.");
  	return false;
  	}
  }
        return common();
}
//Mainfield-Preventive Health Programme
else if (document.getElementById("cmbtype").value=='Preventive Health Programme')
{
	if (document.getElementById("sub_cmbtype").value==""){
		alert ("Plese select sub query type");
		document.getElementById("sub_cmbtype").focus();
		return false;}
		
	//Directorate General of Civil Aviation
 if (document.getElementById("sub_cmbtype").value=='Directorate General of Civil Aviation')
      {
	if (document.getElementById("hospital2").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital2").focus();
		return false;}
	
   if (document.getElementById("txtfile").value==0){
		alert ("Please enter file no.");
		document.getElementById("txtfile").focus();
		return false;}
for (var i = 0; i < document.getElementById("txtfile").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("txtfile").value.charAt(i)) != -1) {
  	alert ("Your file no. has special characters. \nThese are not allowed.");
  	return false;
  	}
}
	
	if (document.getElementById("txtcname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtcname").focus();
		return false;}
		else if(!isText(document.getElementById("txtcname").value))
				{
				alert("Name will only accept alphabetic values");
				document.getElementById("txtcname").focus();
				return false;
				}

	if (document.getElementById("txtage").value==0){
		alert ("Please enter your age");
		document.getElementById("txtage").focus();
		return false;}
		if (document.getElementById("txtage").value!="") {
		if(isNaN(document.getElementById("txtage").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtage").focus();
		return false;}
	   }
  if (document.getElementById("dob").value==""){
		alert ("Please enter your birth");
		document.getElementById("dob").focus();
		return false;}
      }
	 
	//Preventive Health Packages
	if (document.getElementById("sub_cmbtype").value=='Preventive Health Packages')      																										   
      {
		if (document.getElementById("hospital3").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital3").focus();
		return false;}
			if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;} 
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("Name will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	  }
	//Corporate preventive health Packages
	if (document.getElementById("sub_cmbtype").value=='Corporate preventive health Packages')
      {
	if (document.getElementById("hospital4").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital4").focus();
		return false;}
			
		if (document.getElementById("txtcompanyname").value==0){
		alert ("Please enter your company name");
		document.getElementById("txtcompanyname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtcompanyname").value))
				{
				alert("Company name will only accept alphabetic values");
				document.getElementById("txtcompanyname").focus();
				return false;
				}
for (var i = 0; i < document.getElementById("companyaddress").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("companyaddress").value.charAt(i)) != -1) {
  	alert ("Your company address has special characters. \nThese are not allowed.");
  	return false;
  	}
}
		
		if (document.getElementById("txtcomname").value==0){
		alert ("Please enter your contact name");
		document.getElementById("txtcomname").focus();
		return false;} 
		else if(!isText(document.getElementById("txtcomname").value))
				{
				alert("Contact person will only accept alphabetic values");
				document.getElementById("txtcomname").focus();
				return false;
				}
	  }
	  if (document.getElementById("sub_cmbtype").value=='Cardiac Preventive Health Packages')     																	   
         {
		if (document.getElementById("hospital5").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital5").focus();
		return false;}
	 if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("Name field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	  }
	  if(document.getElementById("sub_cmbtype").value=='Platinum PHP')																											   
      {
	 if (document.getElementById("hospital6").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital6").focus();
		return false;}
	  if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("Name field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	  }
	  return common();
}
//International
else if(document.getElementById("cmbtype").value=='International')																											   
  {
	 if (document.getElementById("sub_cmbtype1").value.replace(/^\s*|\s*$/g,"")==""){
		alert ("Please select sub query type");
		document.getElementById("sub_cmbtype1").focus();
		return false;}  
		 if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("Name field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	return common1();
 }
 //Disease Specific

 else if(document.getElementById("cmbtype").value=='Disease Specific')																											   
  {
	   if (document.getElementById("sub_cmbtype2").value.replace(/^\s*|\s*$/g,"")==""){
		alert ("Please select sub query type");
		document.getElementById("sub_cmbtype2").focus();
		return false;}  
	 if (document.getElementById("sub_cmbtype2").value=="Cardiac Care"){
	  if (document.getElementById("hospital7").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital7").focus();
		return false;}
	 }
	 if (document.getElementById("sub_cmbtype2").value=="Cancer Care"){
	  if (document.getElementById("hospital21").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital21").focus();
		return false;}
	 }
	  if (document.getElementById("sub_cmbtype2").value=="Orthopaedics"){
	  if (document.getElementById("hospital8").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital8").focus();
		return false;}
	 }
	  if (document.getElementById("sub_cmbtype2").value=="Obstetrics & Gynaecology"){
	  if (document.getElementById("hospital9").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital9").focus();
		return false;}
	 }
	  if (document.getElementById("sub_cmbtype2").value=="Neurology/Neuro Surgery"){
	  if (document.getElementById("hospital10").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital10").focus();
		return false;}
	 }
  if (document.getElementById("sub_cmbtype2").value=="Bariatric Surgery"){
	  if (document.getElementById("hospital20").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital20").focus();
		return false;}
	 }
	  if (document.getElementById("sub_cmbtype2").value=="Eye"){
	  if (document.getElementById("hospital11").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital11").focus();
		return false;}
	 }
	  if (document.getElementById("sub_cmbtype2").value=="Dental"){
	  if (document.getElementById("hospital12").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital12").focus();
		return false;}
	 }
	   if (document.getElementById("sub_cmbtype2").value=="Aesthetic & Reconstructive Surgery"){
	  if (document.getElementById("hospital13").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital13").focus();
		return false;}
	 }
	 if (document.getElementById("sub_cmbtype2").value=="General Surgery"){
	  if (document.getElementById("hospital14").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital14").focus();
		return false;}
	 }
	 if (document.getElementById("sub_cmbtype2").value=="Internal Medicine"){
	  if (document.getElementById("hospital15").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital15").focus();
		return false;}
	 }
	 if (document.getElementById("sub_cmbtype2").value=="Mental Health"){
	  if (document.getElementById("hospital19").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital19").focus();
		return false;}
	 }
 if (document.getElementById("sub_cmbtype2").value=="Others"){
	  if (document.getElementById("hospital16").value==""){
		alert ("Plese select hospital");
		document.getElementById("hospital16").focus();
		return false;}
	 }
	 if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("Name field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	return common1();
 }
 //job Search
  else if(document.getElementById("cmbtype").value=='Job Search')																											   
  {
	 if (document.getElementById("txthospital").value.replace(/^\s*|\s*$/g,"")==""){
		alert ("Please enter hospital name");
		document.getElementById("txthospital").focus();
		return false;}  
		for (var i = 0; i < document.getElementById("txthospital").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("txthospital").value.charAt(i)) != -1) {
  	alert ("Your hospital name has special characters. \nThese are not allowed.");
  	return false;
  	}
}
		 if (document.getElementById("txtdepart").value==0){
		alert ("Please enter department");
		document.getElementById("txtdepart").focus();
		return false;}  
		else if(!isText(document.getElementById("txtdepart").value))
				{
				alert("Department will only accept alphabetic values");
				document.getElementById("txtdepart").focus();
				return false;
				}
		 if (document.getElementById("jobname").value==0){
		alert ("Please enter your name");
		document.getElementById("jobname").focus();
		return false;}  
		else if(!isText(document.getElementById("jobname").value))
				{
				alert("Job name will only accept alphabetic values");
				document.getElementById("jobname").focus();
				return false;
				}
		 if (document.getElementById("qualification").value==0){
		alert ("Please enter your qualification");
		document.getElementById("qualification").focus();
		return false;}  
	  //return common();
	   if (document.getElementById("txtcity2").value==0){
		alert ("Please enter your city");
		document.getElementById("txtcity2").focus();
		return false;}
		else if(!isText(document.getElementById("txtcity2").value))
				{
				alert("City will only accept alphabetic values");
				document.getElementById("txtcity2").focus();
				return false;
				}
      if (document.getElementById("country2").value==""){
		alert ("Please select your country");
		document.getElementById("country2").focus();
		return false;}
	if (document.getElementById("txtcontactno2").value!="") {
		if(isNaN(document.getElementById("txtcontactno2").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtcontactno2").focus();
		return false;}
	   }
	if (emailfilter.test(document.getElementById("email2").value)==false) {
		alert ("Please enter valid e-mail id");
		document.getElementById("email2").focus();
		return false;}
    if (document.getElementById("txtcomments2").value==0){
		alert ("Please enter your comments");
		document.getElementById("txtcomments2").focus();
		return false;	}
		 for (var i = 0; i < document.getElementById("txtcomments2").value.length; i++) {
		if (iChars1.indexOf(document.getElementById("txtcomments2").value.charAt(i)) != -1) {
		alert ("Your comments has special characters. \nThese are not allowed.");
		return false;
		}
	}

	 if (document.getElementById("attachfile").value==""){
		alert ("Please Browse your attach file");
		document.getElementById("attachfile").focus();
		return false;}  
	     var aa=document.getElementById("attachfile").value;
		 var bb=aa.indexOf(".doc");
		 if(bb==-1){
		alert ("Please attach document file only");
		document.getElementById("attachfile").focus();
		return false;} 
		
		var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
//document.frm.submit();
//return true;
}
else {
alert("Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
}
 }
 //Care programme
 
  else if(document.getElementById("cmbtype").value=='Care Programme')																											   
  { 
   if (document.getElementById("sub_cmbtype4").value==""){
		alert ("Please select sub query type");
		document.getElementById("sub_cmbtype4").focus();
		return false;}  
		
   if(document.getElementById("sub_cmbtype4").value=='Healthy Neighbourhood Programme')																											   
     {  
	  if (document.getElementById("txtnamerwa").value==0){
		alert ("Please enter your name(RWA)");
		document.getElementById("txtnamerwa").focus();
		return false;}
		
	for (var i = 0; i < document.getElementById("txtnamerwa").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("txtnamerwa").value.charAt(i)) != -1) {
  	alert ("Your nameRWA has special characters. \nThese are not allowed.");
  	return false;
  	 }
   }

		if (document.getElementById("txtneiname").value==0){
		alert ("Please enter your contact person");
		document.getElementById("txtneiname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtneiname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtneiname").focus();
				return false;
				}
	 for (var i = 0; i < document.getElementById("address").value.length; i++) {
		if (iChars1.indexOf(document.getElementById("address").value.charAt(i)) != -1) {
		alert ("Your address has special characters. \nThese are not allowed.");
		return false;
		}
	}
	 if (document.getElementById("txtcity1").value==0){
		alert ("Please enter your city");
		document.getElementById("txtcity1").focus();
		return false;}
		else if(!isText(document.getElementById("txtcity1").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtcity1").focus();
				return false;
				}
    	if (document.getElementById("txtcontactno1").value!="") {
		if(isNaN(document.getElementById("txtcontactno1").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtcontactno1").focus();
		return false;}
	}
	if (emailfilter.test(document.getElementById("email1").value)==false) {
		alert ("Please enter valid e-mail id");
		document.getElementById("email1").focus();
		return false;}
    if (document.getElementById("txtcomments1").value==0){
		alert ("Please enter your comments");
		document.getElementById("txtcomments1").focus();
		return false;	}
   if (document.getElementById("txtcomments1").value!=""){
    var cou=document.getElementById("txtcomments1").value.length;		
        if(cou>1500)
         {    
        alert ("Please enter your comments maxium 1500");
		document.getElementById("txtcomments1").focus();
		return false;	}
       }
    for (var i = 0; i < document.getElementById("txtcomments1").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("txtcomments1").value.charAt(i)) != -1) {
  	alert ("Your comments has special characters. \nThese are not allowed.");
  	return false;
  	}
   }
var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
//ggg
}
else {
alert("Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
 }
}
  
//Home Care
 
else if(document.getElementById("sub_cmbtype4").value=='Home Care')																											   
  {
	  if (document.getElementById("txtname").value==""){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;} 
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	for (var i = 0; i < document.getElementById("address").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("address").value.charAt(i)) != -1) {
  	alert ("Your address has special characters. \nThese are not allowed.");
  	return false;
  	}
  }

	if (document.getElementById("txtcity1").value==0){
		alert ("Please enter your city");
		document.getElementById("txtcity1").focus();
		return false;}
		else if(!isText(document.getElementById("txtcity1").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtcity1").focus();
				return false;
				}
    	if (document.getElementById("txtcontactno1").value!="") {
		if(isNaN(document.getElementById("txtcontactno1").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtcontactno1").focus();
		return false;}
	}
	if (emailfilter.test(document.getElementById("email1").value)==false) {
		alert ("Please enter valid e-mail id");
		document.getElementById("email1").focus();
		return false;}
    if (document.getElementById("txtcomments1").value==0){
		alert ("Please enter your comments");
		document.getElementById("txtcomments1").focus();
		return false;	}
   if (document.getElementById("txtcomments1").value!=""){
    var cou=document.getElementById("txtcomments1").value.length;		
        if(cou>1500)
         {    
        alert ("Please enter your comments maxium 1500");
		document.getElementById("txtcomments1").focus();
		return false;	
        }
     }
	for (var i = 0; i < document.getElementById("txtcomments1").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("txtcomments1").value.charAt(i)) != -1) {
  	alert ("Your comments has special characters. \nThese are not allowed.");
  	return false;
  	}
   } 
var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
//document.frm.submit();
//return true;
}
else {
alert("Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
 }
 }
 //Max Family
if(document.getElementById("sub_cmbtype4").value=='Max Happy Family')																											   
  {
		 if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	return common();
 }

//Maximum
if(document.getElementById("sub_cmbtype4").value=='NURTURE')																											   
     {
	 if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}  
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}
	return common();
 }
//Corporate Programming
 if(document.getElementById("sub_cmbtype4").value=='Corporate Programme')																											   
  {
	  if (document.getElementById("cpname").value==0){
		alert ("Please enter your name/organization");
		document.getElementById("cpname").focus();
		return false;}  
		for (var i = 0; i < document.getElementById("cpname").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("cpname").value.charAt(i)) != -1) {
  	alert ("Your organization/person name has special characters. \nThese are not allowed.");
  	return false;
  	}
}
	return common();
 }
 //School Programming
 if(document.getElementById("sub_cmbtype4").value=='School Programme')																											   
  {
	 if (document.getElementById("spname").value==""){
		alert ("Please enter your scholl name/person");
		document.getElementById("spname").focus();
		return false;}  
		else if(!isText(document.getElementById("spname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("spname").focus();
				return false;
				}
	return common();
 }
 }

 //Business tie up
 else if(document.getElementById("cmbtype").value=='Business tie up')																											   
  {
	if (document.getElementById("naturetieup").value==0){
		alert ("Please enter your nature tie up");
		document.getElementById("naturetieup").focus();
		return false;}
		else if(!isText(document.getElementById("naturetieup").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("naturetieup").focus();
				return false;
				}
	if (document.getElementById("txtnameCHNP").value==0){
		alert ("Please enter your category");
		document.getElementById("txtnameCHNP").focus();
		return false;}  
		else if(!isText(document.getElementById("txtnameCHNP").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtnameCHNP").focus();
				return false;
				}
	return common1();
 }

//General 
 if(document.getElementById("cmbtype").value=='General')																											   
  {
   if (document.getElementById("sub_cmbtype3").value.replace(/^\s*|\s*$/g,"")==""){
	alert ("Please select sub query type");
	document.getElementById("sub_cmbtype3").focus();
	return false;}  
		
	//Insurance/TPA
  if (document.getElementById("sub_cmbtype3").value=='Insurance/TPA')
      {
 	if (document.getElementById("txtname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtname").focus();
		return false;}
		else if(!isText(document.getElementById("txtname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtname").focus();
				return false;
				}

	  }

	  //Complaints-Compliment
  if ((document.getElementById("sub_cmbtype3").value=='Complaints')||(document.getElementById("sub_cmbtype3").value=='Compliment'))
      {
	if (document.getElementById("hospital18").value==""){
		alert ("Please select hospital");
		document.getElementById("hospital18").focus();
		return false;}
 	if (document.getElementById("department").value==0){
		alert ("Please enter your department");
		document.getElementById("department").focus();
		return false;}
		else if(!isText(document.getElementById("department").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("department").focus();
				return false;
				}
	
	if (document.getElementById("gname").value==0){
		alert ("Please enter your name");
		document.getElementById("gname").focus();
		return false;}
		else if(!isText(document.getElementById("gname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("gname").focus();
				return false;
				}

	  }
	  //Subscribe to Newsletter
if (document.getElementById("sub_cmbtype3").value=='Subscribe to Newsletter')
      {
 	if (document.getElementById("newsname").value.replace(/^\s*|\s*$/g,"")==""){
		alert ("Please enter your name");
		document.getElementById("newsname").focus();
		return false;}
		else if(!isText(document.getElementById("newsname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("newsname").focus();
				return false;
				}

		if (document.getElementById("interest").value==0){
		alert ("Please enter your interest");
		document.getElementById("interest").focus();
		return false;}
		else if(!isText(document.getElementById("interest").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("interest").focus();
				return false;
				}
	  }
	
//Feedback About Hospital-Others
  if ((document.getElementById("sub_cmbtype3").value=='Feedback About Hospital')||(document.getElementById("sub_cmbtype3").value=='Others'))
      {
 	if (document.getElementById("feedfacility").value==0){
		alert ("Please enter your facility");
		document.getElementById("feedfacility").focus();
		return false;}
		if (document.getElementById("txtfeedname").value==0){
		alert ("Please enter your name");
		document.getElementById("txtfeedname").focus();
		return false;}
		else if(!isText(document.getElementById("txtfeedname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtfeedname").focus();
				return false;
				}
	  }
	
//feedback about website
if(document.getElementById("sub_cmbtype3").value=='Feedback about the Website')
      {
 		if (document.getElementById("webname").value==0){
		alert ("Please enter your contact name");
		document.getElementById("webname").focus();
		return false;}
		else if(!isText(document.getElementById("webname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("webname").focus();
				return false;}
	  }
	return common1();
  }


 if(document.getElementById("cmbtype").value=='PR/Media Queries')																											   
  {
	if (document.getElementById("org_name").value==0){
		alert ("Please enter your organization name");
		document.getElementById("org_name").focus();
		return false;}
		for (var i = 0; i < document.getElementById("org_name").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("org_name").value.charAt(i)) != -1) {
  	alert ("Your organization name has special characters. \nThese are not allowed.");
  	return false;
  	}
}
		if (document.getElementById("coname").value==0){
		alert ("Please enter your contact name");
		document.getElementById("coname").focus();
		return false;}
		
		else if(!isText(document.getElementById("coname").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("coname").focus();
				return false;
				}
		return common1();
  }
 return true;
 }

 

function common()
{
	
for (var i = 0; i < document.getElementById("address").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("address").value.charAt(i)) != -1) {
  	alert ("Your address has special characters. \nThese are not allowed.");
  	return false;
  	}
}
 if (document.getElementById("txtcity").value==0){
		alert ("Please enter your city");
		document.getElementById("txtcity").focus();
		return false;}
		else if(!isText(document.getElementById("txtcity").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtcity").focus();
				return false;
				}
      if (document.getElementById("country").value==""){
		alert ("Please select your country");
		document.getElementById("country").focus();
		return false;
		}
			
      if (document.getElementById("txtcontactno").value==""){
		alert ("Please enter your contactno");
		document.getElementById("txtcontactno").focus();
		return false;}
		
	if (document.getElementById("txtcontactno").value!="") {
		if(isNaN(document.getElementById("txtcontactno").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtcontactno").focus();
		return false;}
	}
	if (emailfilter.test(document.getElementById("email").value)==false) {
		alert ("Please enter valid e-mail id");
		document.getElementById("email").focus();
		return false;}
    if (document.getElementById("txtcomments").value==0){
		alert ("Please enter your comments");
		document.getElementById("txtcomments").focus();
		return false;	}
  if (document.getElementById("txtcomments").value!=""){
  var cou=document.getElementById("txtcomments").value.length;		
     if(cou>1500)
      {    
        alert ("Please enter your comments maxium 1500");
		document.getElementById("txtcomments").focus();
		return false;	
      }
   }
for (var i = 0; i < document.getElementById("txtcomments").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("txtcomments").value.charAt(i)) != -1) {
  	alert ("Your comments has special characters. \nThese are not allowed.");
  	return false;
  	}
}
var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
	//sdfsafasd
}
else {
alert("Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
}
}

function common1()
{
for (var i = 0; i < document.getElementById("address").value.length; i++) {
  	if (iChars1.indexOf(document.getElementById("address").value.charAt(i)) != -1) {
  	alert ("Your address has special characters. \nThese are not allowed.");
  	return false;
  	}
}
 if (document.getElementById("txtcity2").value==0){
		alert ("Please enter your city");
		document.getElementById("txtcity2").focus();
		return false;}
		else if(!isText(document.getElementById("txtcity2").value))
				{
				alert("This field will only accept alphabetic values");
				document.getElementById("txtcity2").focus();
				return false;
				}
      if (document.getElementById("country2").value==""){
		alert ("Please select your country");
		document.getElementById("country2").focus();
		return false;}
	if (document.getElementById("txtcontactno2").value!="") {
		if(isNaN(document.getElementById("txtcontactno2").value))
		{
		alert ("Please enter numeric");
		document.getElementById("txtcontactno2").focus();
		return false;}
	}
	if (emailfilter.test(document.getElementById("email2").value)==false) {
		alert ("Please enter valid e-mail id");
		document.getElementById("email2").focus();
		return false;}
    if (document.getElementById("txtcomments2").value==0){
		alert ("Please enter your comments");
		document.getElementById("txtcomments2").focus();
		return false;	}
  if (document.getElementById("txtcomments2").value!=""){
  var cou=document.getElementById("txtcomments2").value.length;		
     if(cou>1500)
      {    
        alert ("Please enter your comments maxium 1500");
		document.getElementById("txtcomments2").focus();
		return false;	
      }
   }
for (var i = 0; i < document.getElementById("txtcomments2").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("txtcomments2").value.charAt(i)) != -1) {
  	alert ("Your comments has special characters. \nThese are not allowed.");
  	return false;
  	}
}
var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
//dfsf
}
else {
alert("Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
}
}


