function validate_couneslor() 
{
	var x=document.frm01;
	var error='';
	var  flag=1;	
		 
	if( x.sch_name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 } else {
	   var sText=x.sch_name.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Name is not in pure Alphabet.";
					flag=0;
		}
    }
	 			 		 
	 if( x.sch_mobile.value == "" ) {
	 error +="\n" + "- Please Enter  Mobile No.";
	 flag=0;
	 } else {
	   var sText=x.sch_mobile.value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsNumber = false;
						}
					
				}
		if( !IsNumber ) {
					error +="\n" + "- Mobile No.  is not a complete numeric.";
					flag=0;
		}
 }
	//
	if( x.sch_email.value == "" ) {
	error +="\n" + "- Please Enter  E-mail";
	flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.sch_email.value))
	{
	/* return (true) */
	} else 
	{
	flag=0;
	error +="\n" + "- Invalid E-mail Address! Please re-enter.";
	}
	
	 if(x.sch_country.selectedIndex == "") {
	 error +="\n" + "- Please select Your Country";
	 flag=0;
	 }	
	 
	 if(x.sch_topic.selectedIndex == "") {
	 error +="\n" + "- Please select Your Topic";
	 flag=0;
	 }	
	 
 
 	
	 ///////////////////////////////

	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 
 function validate_postqur() 
{
	var x=document.frm098;
	var error='';
	var  flag=1;
	
		
	if( x.en_name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 } else {
	   var sText=x.en_name.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Name is not in pure Alphabet.";
					flag=0;
		}
    }	 
	if( x.en_email.value == "" ) {
	error +="\n" + "- Please Enter  E-mail";
	flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.en_email.value))
	{
	/* return (true) */
	} else {
		flag=0;
		error +="\n" + "- Invalid E-mail Address! Please re-enter.";
	}
	
	if( x.mobile.value == "" ) {
	 error +="\n" + "- Please Enter  Mobile No.";
	 flag=0;
	 } else {
	   var sText=x.mobile.value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsNumber = false;
						}
					
				}
		if( !IsNumber ) {
					error +="\n" + "- Mobile No.  is not a complete numeric.";
					flag=0;
		}
     }
	 
	 if(x.cat.selectedIndex == "") {
	 error +="\n" + "- Please Select Your Category";
	 flag=0;
	 }	
	 if( x.comment.value == "" ) {
	 error +="\n" + "- Please Enter Question";
	 flag=0;
	 }

	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 
 function validate_ads() 
{
	var x=document.frm098;
	var error='';
	var  flag=1;
	
	var totalChecked = 0;
   	var totalcourse_ids = 0;
	//alert(x.country_ids.options.length);
 	
				 
			   
	if( x.noCountry.value >0 ){
			   for (i = 0; i < x.country_ids.options.length; i++) {
				  if (x.country_ids.options[i].selected) {
					 totalChecked++;
				  }
			   }
			   // course selection
			   for (i = 0; i < x.course_ids.options.length; i++) {
				  if (x.course_ids.options[i].selected) {
					 totalcourse_ids++;
				  }
			   }
			  
			   if (totalChecked > x.noCountry.value) {
				  //alert("You can't check more than "+x.noCountry.value+" Country");
				   error +="\n" + "- You can't check more than "+x.noCountry.value+" Country";
				   flag=0;
				 
			   } 
			   
			   if (totalChecked < x.noCountry.value) {
				  //alert("You can't check more than "+x.noCountry.value+" Country");
				   error +="\n" + "- You can't check less than "+x.noCountry.value+" Country";
				   flag=0;
				 
			   } 
			   if (totalcourse_ids > x.noCourse.value) {
				  //alert("You can't check more than "+x.noCourse.value+" Course");
				  error +="\n" + "- You can't check more than "+x.noCourse.value+" Course";
				  flag=0;
			   } 
			   if (totalcourse_ids < x.noCourse.value) {
				  //alert("You can't check more than "+x.noCourse.value+" Course");
				  error +="\n" + "- You can't check less than "+x.noCourse.value+" Course";
				  flag=0;
			   }
			   if (x.course_ids.options.length <1 ) {
					  	error +="\n" + "- You can't check less than "+x.noCountry.value+" Country";
				   		flag=0;
	 			}
				if (x.country_ids.options.length <1 ) {
					  	error +="\n" + "- You can't check less than "+x.noCourse.value+" Course";
				   		flag=0;
	 			}
	} 
	 	
	
	if( x.en_name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 }
	 
	if( x.en_email.value == "" ) {
	error +="\n" + "- Please Enter  E-mail";
	flag=0;
	}else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.en_email.value))
	{
	/* return (true) */
	} else {
		flag=0;
		error +="\n" + "- Invalid E-mail Address! Please re-enter.";
	}
	
	
	 /*if( x.address.value == "" ) {
	 error +="\n" + "- Please Enter Address";
	 flag=0;
	 }
	 if( x.desc.value == "" ) {
	 error +="\n" + "- Please Enter about Yours";
	 flag=0;
	 }*/

	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 

function validate_ads1(){
 
  if(document.frm098.pack_id.value==2){
     if(document.frm098['country_ids[]'].name=="country_ids[]"){
				var fld_len=document.frm098['country_ids[]'].options.length;
				var errflag=0;
				var trackflag=0;
				for(var kk=0;kk<fld_len;kk++){
					if(document.frm098['country_ids[]'].options[kk].value=='' && document.frm098['country_ids[]'].options[kk].selected){
						errflag=1;
					}
					if(document.frm098['country_ids[]'].options[kk].selected){
						trackflag++;
					}
				}
				if(trackflag>=1 && errflag==1){
					alert("You cannot select 'Select' country");
					return false;
				}
				if(trackflag==0){
					alert("Please Select one country");
					return false;
				}
			}	
  }
  if(document.frm098.pack_id.value==1){
     if(document.frm098['country_ids[]'].name=="country_ids[]"){
				var fld_len=document.frm098['country_ids[]'].options.length;
				var errflag=0;
				var trackflag=0;
				for(var kk=0;kk<fld_len;kk++){
					if(document.frm098['country_ids[]'].options[kk].value=='' && document.frm098['country_ids[]'].options[kk].selected){
						errflag=1;
					}
					if(document.frm098['country_ids[]'].options[kk].selected){
						trackflag++;
					}
				}
				if(trackflag>=1 && errflag==1){
					alert("You cannot select 'Select' country");
					return false;
				}
				if(trackflag==0){
					alert("Please Select one country");
					return false;
				}
			}	
  }
  if(document.frm098.pack_id.value==3){
     if(document.frm098['country_ids[]'].name=="country_ids[]"){
				var fld_len=document.frm098['country_ids[]'].options.length;
				var errflag=0;
				var trackflag=0;
				for(var kk=0;kk<fld_len;kk++){
					if(document.frm098['country_ids[]'].options[kk].value=='' && document.frm098['country_ids[]'].options[kk].selected){
						errflag=1;
					}
					if(document.frm098['country_ids[]'].options[kk].selected){
						trackflag++;
					}
				}
				if(trackflag>=1 && errflag==1){
					alert("You cannot select 'Select' country");
					return false;
				}
				if((trackflag==0)|| (trackflag != 2))  {
					alert("Please Select two countries");
					return false;
				}
			}	
     }
	 
	 
	if(document.frm098.image.value==""){
		alert("Please upload banner image");
		document.frm098.image.focus();
		return false;
	} 
	if(document.frm098.image.value!=""){
		var flup = document.getElementById("image");
		if (flup.value != ""){
			if((flup.value.lastIndexOf(".jpg") == -1) && (flup.value.lastIndexOf(".png") == -1) && (flup.value.lastIndexOf(".gif") == -1) && (flup.value.lastIndexOf(".bmp") == -1) && (flup.value.lastIndexOf(".jpeg") == -1) && (flup.value.lastIndexOf(".JPG") == -1) && (flup.value.lastIndexOf(".PNG") == -1) && (flup.value.lastIndexOf(".GIF") == -1)  && (flup.value.lastIndexOf(".JPEG") == -1)){
				alert("Please upload only JPG, PNG, GIF types of file");
				flup.focus();
				return false;
			}
		}
    }	
	if(document.frm098.en_name.value==""){
		alert("Please enter name");
		document.frm098.en_name.focus();
		return false;
	}
	 if(!isNaN(document.frm098.en_name.value)){
		   alert("Please enter alphabetic value in name.")
		   document.frm098.en_name.focus()
		   return false;
     } 
	if(document.frm098.en_email.value==""){
		alert("Please enter email");
		document.frm098.en_email.focus();
		return false;
	}
	var email = document.frm098.en_email.value;
		if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/)){
			alert("This is not a valid email id! Please fill a valid Email ID.");
			document.frm098.en_email.focus();
			return false;
		}
	if(document.frm098.phone.value==""){
		alert("Please enter phone");
		document.frm098.phone.focus();
		return false;
	}
	if(isNaN(document.frm098.phone.value)){
		   alert("Please enter numeric value in phone.")
		   document.frm098.phone.focus()
		   return false;
     } 
	 
	if (document.frm098.pay[0].checked){
		    if(document.frm098.cheque_no1.value==''){
			alert('Please enter cheque no.');
			document.frm098.cheque_no1.focus();
			return false;
		}
		if(document.frm098.bank_name1.value==''){
			alert('Please enter bank name');
			document.frm098.bank_name1.focus();
			return false;
		}
		if(document.frm098.bank_city1.value==''){
			alert('Please enter bank city');
			document.frm098.bank_city1.focus();
			return false;
		}
		if(document.frm098.issdate1.value==''){
			alert('Please enter cheque issue date');
			document.frm098.issdate1.focus();
			return false;
		}
	}
	
	if (document.frm098.pay[1].checked){
		    if(document.frm098.cheque_no.value==''){
			alert('Please enter draft no.');
			document.frm098.cheque_no.focus();
			return false;
		}
		if(document.frm098.bank_name.value==''){
			alert('Please enter bank name');
			document.frm098.bank_name.focus();
			return false;
		}
		if(document.frm098.bank_city.value==''){
			alert('Please enter bank city');
			document.frm098.bank_city.focus();
			return false;
		}
		if(document.frm098.issdate.value==''){
			alert('Please enter cheque issue date');
			document.frm098.issdate.focus();
			return false;
		}
	}
  

		 
	 
 }


  function term(){
		if(document.frm607.tm.checked == false ){
		alert('Please check term & condition box');
		return false;
		}
	}
	
	function client_term(){
		if(document.frm978.tm.checked == false ){
		alert('Please check term & condition box');
		return false;
		}
  }

function validate_reg() 
{
	var x=document.frm607;
	
	
	var error='';
	var  flag=1;
	var pass_len=x.st_pass.value;
	var cnt=pass_len.length;	
		
	 
	 
	 /*if( x.st_title.value == "" ) {
	 error +="\n" + "- Please Enter Title";
	 flag=0;
	 } else {
	   var sText=x.st_title.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Title is not in pure Alphabet.";
					flag=0;
		}
     }
	 */
	 
	if( x.st_name.value=="") {
	
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 } else {
	   var sText=x.st_name.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Name is not in pure Alphabet.";
					flag=0;
		}
 }
	
	if( x.st_user.value == "" ) {
	 error +="\n" + "- Enter Your Username";
	 flag=0;
	 }
	
 	 if( x.st_pass.value == "" ) {
	 error +="\n" + "- Enter Your Password";
	 flag=0;
	 } else if(cnt <= 5 ) {
	  error +="\n" + "- Your Password should be atleast 6 characters long";
	  flag=0;
	 }
	 if( x.re_pass.value == "" ) {
	 error +="\n" + "- Enter Your Confirm Password";
	 flag=0;
	 }
	 else if(x.re_pass.value != x.st_pass.value) {
	 error +="\n" + "- Password Not Match With Confirm Password.";
	  flag=0;
	 }
	
	 /*if( x.st_dob.value == "" ) {
	 error +="\n" + "- Please Enter Your Date of Birth";
	 flag=0;
	 }*/
	/*
	if( x.st_address.value == "" ) {
	 error +="\n" + "- Enter Your Address";
	 flag=0;
	 }	*/
	if( x.st_city.value == "" ) {
	 error +="\n" + "- Please Enter City Name";
	 flag=0;
	 } else {
	   var sText=x.st_city.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1)
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- City Name is not in pure Alphabet.";
					flag=0;
		}
    }
	
	if( x.loc.value != "" ) {
	   var sText=x.loc.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1)
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Location Name is not in pure Alphabet.";
					flag=0;
		}
    }
	
	/*if( x.st_nationality.value != "" ) {	
	   var sText=x.st_nationality.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
		{ 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1)
				{
				 IsAlpha = false;
				}			
		}
		if( !IsAlpha ) {
					error +="\n" + "- Nationality is not in pure Alphabet.";
					flag=0;
		}
    }
	*/
	if( x.st_email.value == "" ) {
	error +="\n" + "- Enter Your Email";
	flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.st_email.value))
	{
	/* return (true) */
	} else 
	{
	flag=0;
	error +="\n" + "- Please Enter Valid Email Address";
	}
	if(x.st_phone.value!=''){
		var sText=x.st_phone.value;
   var ValidChars = "0123456789-+ ";
   var IsNumber=true;
   var Char; 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
					 IsNumber = false;
					}
				
			}
	if( !IsNumber ) {
				error +="\n" + "- Please Enter Valid Phone No.";
				flag=0;
			}	
	}
	/*
	if(x.country_id.selectedIndex == "") {
	 error +="\n" + "- Select country choice";
	 flag=0;
	 }	
	 
	  if(x.course_id.selectedIndex == "") {
	 error +="\n" + "- Select your course choice";
	 flag=0;
	 }*/
	 if( x.st_phone.value == "" ) {
	 //error +="\n" + "- <?=V_PHONE1;?>";
	 error +="\n" + "- Please enter your phone No.";
	 flag=0;
	 } else {
   var sText=x.st_phone.value;
   var ValidChars = "0123456789- ";
   var IsNumber=true;
   var Char; 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
					 IsNumber = false;
					}
				
			}
	if( !IsNumber ) {
				error +="\n" + "- Please enter valid Phone No.";
				flag=0;
			}
 }
	
	 ///////////////////////////////
	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 
 
 function valid_pack() 
	{
	var x=document.frm09;
	var error='';
	var  flag=1;	
	 
    if(x.pack_name.selectedIndex == "") {
	 error +="\n" + "- Select any package or Addons";
	 flag=0;
	 }

	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 
////////////////////  Bank Enq. ///////////////////

function validate_bankEnq() 
{
	var x=document.frm984;
	var error='';
	var  flag=1;
	
		
	if( x.benq_name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 }
	if( x.benq_name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 } else {
	   var sText=x.benq_name.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Name is not in pure Alphabet.";
					flag=0;
		}
 }
	 			 		 
	 if( x.benq_mobile .value == "" ) {
	 error +="\n" + "- Please Enter  Mobile No.";
	 flag=0;
	 } else {
	   var sText=x.benq_mobile .value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsNumber = false;
						}
					
				}
		if( !IsNumber ) {
					error +="\n" + "- Mobile No.  is not a complete numeric.";
					flag=0;
		}
    }
	//
	if( x.benq_email.value == "" ) {
		error +="\n" + "- Please Enter  E-mail";
		flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.benq_email.value))
	{
		/* return (true) */
	} else 
	{
		flag=0;
		error +="\n" + "- Invalid E-mail Address! Please re-enter.";
	}
 	
	 ///////////////////////////////
	if( x.benq_req.value == "" ) {
	 error +="\n" + "- Please Enter Requirment";
	 flag=0;
	 }
	
	 if( flag == 0 ) {
		 alert(error);
		 return false;	 
	 }
	 else  {
		 return true;
	 }
	 
 }
 
 ////////////////////  University ve Agent validation code ////////////////////////////
 function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
		 return false;
         }
      }
   return IsNumber;
   
}

 
 function client_validate() 
{
	var x=document.frm978;
	var error='';
	var  flag=1;
	
		/*
	 if(x.type.selectedIndex == "") {
	 error +="\n" + "- Select Login Type";
	 flag=0;
	 }	
	 */
	
	if( x.uname.value == "" ) {
	 error +="\n" + "- Please Enter  Username";
	 flag=0;
	 } else {
	   var sText=x.uname.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Username is not in pure Alphabet.";
					flag=0;
		}
     }
	
	if( x.name.value == "" ) {
	 error +="\n" + "- Please Enter  Name";
	 flag=0;
	 } else {
	   var sText=x.name.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Name is not in pure Alphabet.";
					flag=0;
		}
     }	
	 if( x.loc.value == "" ) {
	 error +="\n" + "- Please Enter Location";
	 flag=0;
	 } /*else {
	   var sText=x.loc.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Location(City) is not in pure Alphabet.";
					flag=0;
		}
     }
	*/
	if( x.country.value == "" ) {
	 error +="\n" + "- Please Enter Country";
	 flag=0;
	 } /*else {
	   var sText=x.country.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Country is not in pure Alphabet.";
					flag=0;
		}
    } 
 */
	if( x.email.value == "" ) {
		error +="\n" + "- Enter Your Email";
		flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.email.value)){
	/* return (true) */
	} else {
		flag=0;
		error +="\n" + "- Please Enter Valid Email Address";
	}
	if( x.ccode.value == "" ) {
		error +="\n" + "- Enter Country Code";
		flag=0;
	}
	if( x.phone.value == "" ) {
		error +="\n" + "- Enter Phone No.";
		flag=0;
	}
	if(!IsNumeric(x.ccode.value)){
		error +="\n" + "- Please Enter Valid Country Code";
	}
	if(!IsNumeric(x.phone.value)){
		error +="\n" + "- Please Enter Valid Phone No.";
	}
	if(!IsNumeric(x.contact_phone.value)){
		error +="\n" + "- Please Enter Valid Contact Phone No.";
	}
	/*
	if( x.address.value == "" ) {
	 error +="\n" + "- Enter Your Address";
	 flag=0;
	 }	*/
	
	if( x.contact_person.value == "" ) {
	 error +="\n" + "- Please Enter Contact Person";
	 flag=0;
	 } else {
	   var sText=x.contact_person.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Contact Person name is not in pure Alphabet.";
					flag=0;
		}
    }
	
	if( x.contact_email.value == "" ) {
	error +="\n" + "- Enter Your contact Person Email";
	flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.contact_email.value))
	{
	/* return (true) */
	} else 
	{
	flag=0;
	error +="\n" + "- Please Enter Valid Email Address";
	}
	/* if(x.country.selectedIndex == "") {
	 error +="\n" + "- <?=V_COUNTRY;?>";
	 flag=0;
	 }			 		 
	 if( x.phone.value == "" ) {
	 error +="\n" + "- <?=V_PHONE1;?>";
	 flag=0;
	 } else {
	   var sText=x.phone.value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
					 IsNumber = false;
					}
				
			}
	if( !IsNumber ) {
				error +="\n" + "- <?=V_PHONE2;?>";
				flag=0;
			}
 }*/
	
	 ///////////////////////////////
	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }
 
 //###################  client login ####################
 
  function abailability(action,value,siteUrl){
 //alert(siteUrl);
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?val="+value+"&action="+action;
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	//alert(url);
	ob1.open("GET",url,true);
	ob1.onreadystatechange=showoutput;
	ob1.send(null);
}

function showoutput(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
	 	document.getElementById("check").innerHTML=resp;
	}else{
		document.getElementById("check").innerHTML='Loading...';
 	}
}

//###################  Search  ####################
 
  function my_search(action,value,siteUrl){
  //alert(siteUrl);
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?val="+value+"&action="+action;
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	//alert(url);
	ob1.open("GET",url,true);
	ob1.onreadystatechange=showoutputOfSearch;
	ob1.send(null);
}

function showoutputOfSearch(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
	 	document.getElementById("search").innerHTML=resp;
	}else{
		document.getElementById("search").innerHTML='Loading...';
 	}
}


//###################  Search home  main search ####################
 
  function my_Homesearch(action,value,siteUrl){
  //alert(siteUrl);
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?val="+value+"&action="+action;
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	ob1.open("GET",url,true);
	ob1.onreadystatechange=HomeshowoutputOfSearch;
	ob1.send(null);
}

function HomeshowoutputOfSearch(){
	if(ob1.readyState==4 || ob1.readyState=='complete'){
	 	var resp=ob1.responseText;
		if(resp!=''){
	 	    document.getElementById("searchHome").innerHTML=resp;
		}else{
			document.getElementById("searchHome").innerHTML='';
		}
	
	}
}

//###################  populate price of advertisement ####################
 
  function getPrice(sel,bsize){
    
   // alert(bsize);
  var x = document.frm09;
  // adons value
  var adons='';  
  var cc=document.getElementsByName('aid[]');
  //alert(cc.length);
  for(var i=0; i < cc.length; i++){
	  if(cc[i].type == 'checkbox')
	  {
  		if(cc[i].checked)	adons +=cc[i].value + ",";
	  }
	  if(cc[i].type == 'radio')
	  {
		  	for(var ts=1;ts<=2;ts++){
				if(document.getElementById('checkbox'+ts).checked){	adons +=document.getElementById('checkbox'+ts).value + ",";}
	  		}
			
	  }
	  
  }
 	//alert("Adons: "+adons); 	
	// package value 
  for( i = 0; i < document.frm09.pack_name.length; i++ )
	{
		if( document.frm09.pack_name[i].checked == true ) 	var packName = document.frm09.pack_name[i].value;
	}
	if(packName =="undefined") packName='';
 // alert("paxk Name: "+packName);
  
  // maintenance pack durartin duration
  if(document.frm09.duration) {
   for( i = 0; i < document.frm09.duration.length; i++ )
	{
		if( document.frm09.duration[i].checked == true ) 	var duration = document.frm09.duration[i].value;
	}
  }
  //alert("Duration :"+duration);
  
  // month of the Adon pack
   var months  = document.frm09.period.options[document.frm09.period.selectedIndex].value;
  // alert(months);
	
	
//	#######################  ajax part ##########
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?packName="+packName+"&adons="+adons+"&duration="+duration+"&period="+months+"&val=MyPrice&bsize="+bsize;
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	//alert(url);
	ob1.open("GET",url,true);
	ob1.onreadystatechange=myAdsPricr;
	ob1.send(null);
}

function myAdsPricr(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
	 	document.getElementById("priceContainer").innerHTML=resp;
	}else{
		document.getElementById("priceContainer").innerHTML='Loading...';
 	}
}


//###################  populate price of Buy advertisement ####################
 
  function getPrice2(sel,bsize){
  var x = document.frm098;
  // adons value
  var adons='';  
  var cc=document.getElementsByName('aid[]');
  //alert(cc.length);
  for(var i=0; i < cc.length; i++){
	  if(cc[i].type == 'checkbox')
	  {
  		if(cc[i].checked)	adons +=cc[i].value + ",";
	  }
	  if(cc[i].type == 'radio')
	  {
		  	for(var ts=1;ts<=2;ts++){
				if(document.getElementById('checkbox'+ts).checked){	adons +=document.getElementById('checkbox'+ts).value + ",";}
	  		}
			
	  }
	  
  }
 	//alert("Adons: "+adons); 	
	// package value 
	  if(document.frm098.pack_id) {
		  	var packName = document.frm098.pack_id.value;			
			if(packName =="undefined") packName='';
	  }
 // alert("paxk Name: "+packName);
  
  // maintenance pack durartin duration
  if(document.frm098.duration) {
   for( i = 0; i < document.frm098.duration.length; i++ )
	{
		if( document.frm098.duration[i].checked == true ) 	var duration = document.frm098.duration[i].value;
	}
  }
  //alert("Duration :"+duration);
  
  // month of the Adon pack
   var months  = document.frm098.period.options[document.frm098.period.selectedIndex].value;
  // alert(months);
	
	
//	#######################  ajax part ##########
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?packName="+packName+"&adons="+adons+"&duration="+duration+"&period="+months+"&val=MyPrice2&bsize="+bsize;
	
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	//alert(url);
	ob1.open("GET",url,true);
	ob1.onreadystatechange=myAdsPricr2;
	ob1.send(null);
}

function myAdsPricr2(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
	 	document.getElementById("priceContainer").innerHTML=resp;
	}else{
		document.getElementById("priceContainer").innerHTML='Loading...';
 	}
}

function getCatId(sel) {
				
				
				var ids =Array();				
				for(var kk=0;kk<fld_len;kk++){
						if(sel.options[kk].value!=0 && sel.options[kk].selected){
							errflag=1;
							ids[tt]=sel.options[kk].value; tt++;
						}					
				}
				var str=ids.join(",");
				return str;
 } 

//###################  client login ####################
 
  function abailabilityLoc(action,value,siteUrl){
  //alert(value);
	try{
			ob1=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
				ob1=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
				ob1=false;
		}
	}
	if(!ob1 && typeof XMLHttpRequest!='undefined'){
			ob1=new XMLHttpRequest();
	}
	var url="chkavailability.php?val="+value+"&action="+action;
	//var url=siteUrl+"/chkavailability.php?val="+value+"&action="+action;
	//alert(url);
	ob1.open("GET",url,true);
	ob1.onreadystatechange=showoutputloc;
	ob1.send(null);
}

function showoutputloc(){
	if(ob1.readyState==4){
	 	var resp=ob1.responseText;
	 	document.getElementById("check_loc").innerHTML=resp;
	}else{
		document.getElementById("check_loc").innerHTML='Loading...';
 	}
}


/////////////////////   Event validation  ////////////////////////////


 function event_validate() 
{
	var x=document.frm65;
	var error='';
	var  flag=1;
	
		
	 
	 
	if( x.event_title.value == "" ) {
	 error +="\n" + "- Enter Event Title";
	 flag=0;
	 }
	
	if( x.start_time.value == "" ) {
	 error +="\n" + "- Enter Event Start Time";
	 flag=0;
	 }
	 
	if( x.end_time.value == "" ) {
	 error +="\n" + "- Enter Event End Time";
	 flag=0;
	 }
	 
	 
	 if( x.contact_person.value == "" ) {
	 error +="\n" + "- Please Enter Contact Person";
	 flag=0;
	 } else {
	   var sText=x.contact_person.value;
	   var ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
	   var IsAlpha=true;
	   var Char; 
	   for (i = 0; i < sText.length && IsAlpha == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
						{
						 IsAlpha = false;
						}
					
				}
		if( !IsAlpha ) {
					error +="\n" + "- Contact Person name is not in pure Alphabet.";
					flag=0;
		}
    }
	
	if( x.email_id.value == "" ) {
		error +="\n" + "- Enter Contact Person Email";
		flag=0;
	} else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.email_id.value)){
	/* return (true) */
	} else {
		flag=0;
		error +="\n" + "- Please Enter Valid Email Address";
	}
	
	if( x.address.value == "" ) {
	 error +="\n" + "- Enter Your Address";
	 flag=0;
	 }	
	/*if(x.contact_person.value == "" ) {
	 error +="\n" + "- Enter Your Contact Person";
	 flag=0;
	 }*/
	
	
	if( x.phone.value == "" ) {
	 error +="\n" + "- Enter Phone No.";
	 flag=0;
	 } else {
	   var sText=x.phone.value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
					 IsNumber = false;
					}
				
			}
	if( !IsNumber ) {
				error +="\n" + "- Valid phone No.";
				flag=0;
			}
 }
	/* if(x.country.selectedIndex == "") {
	 error +="\n" + "- <?=V_COUNTRY;?>";
	 flag=0;
	 }			 		 
	 if( x.phone.value == "" ) {
	 error +="\n" + "- <?=V_PHONE1;?>";
	 flag=0;
	 } else {
	   var sText=x.phone.value;
	   var ValidChars = "0123456789- ";
	   var IsNumber=true;
	   var Char; 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
					 IsNumber = false;
					}
				
			}
	if( !IsNumber ) {
				error +="\n" + "- <?=V_PHONE2;?>";
				flag=0;
			}
 }*/
	
	if( x.address.value == "" ) {
	 error +="\n" + "- Enter Location Address";
	 flag=0;
	 }
	if( x.desc.value == "" ) {
	 error +="\n" + "- Enter Event Description";
	 flag=0;
	 }	 
	 ///////////////////////////////
	
	 if( flag == 0 ) {
	 alert(error);
	 return false;	 
	 }
	 else  {
	 return true;
	 }
	 
 }

