// JavaScript Document
// ------------- This is Script For Admin Pages----------------------//
//script for login validation 
function login_validation()
{
		 if (document.Login.txtUsername.value== "" )
		 { 
			 alert ("Please enter the User name");
			 document.Login.txtUsername.focus();
			 return false;
		 }
		 if (document.Login.txtPassword.value== "" )
		 { 
			 alert ("Please enter the Password");
			 document.Login.txtPassword.focus();
			 return false;
		 }
}

// To Validate Password Field in changepassword file
function pass_validate()
{
	     var Old = document.frm_change.Old.value;
		 if (Old == "" )
		 { 
			 alert ("Please enter Your Old Password");
			 document.frm_change.Old.focus();
			 return false;
		 }
		 var Password = document.frm_change.Password.value;
		 if (Password == "" )
		 { 
			 alert ("Please enter Your New Password");
			 document.frm_change.Password.focus();
			 return false;
		 }
		 if(Password.length<6)
		 { 
		 alert ("Password must be atleast 6 characters or numbers.");
		  document.frm_change.Password.focus();
		 return false;
		 }	
		 var Conpassword = document.frm_change.Conpassword.value;
		 if (Conpassword == "" )
		 { 
			 alert ("Please enter Your Confirm Password");
			 document.frm_change.Conpassword.focus();
			 return false;
		 }
		 var Conpassword = document.frm_change.Conpassword.value;
		 if (document.frm_change.Conpassword.value != document.frm_change.Password.value)
		 { 
			 alert ("Paasword and Confirm Password must be same");
			 document.frm_change.Conpassword.focus();
			 return false;
		 }
}

//
function calldel(m)
{
  if(!confirm(m))
  {
    return false;
  }
  else
  return true;
}
function calldel_fee_check1(m,id)
{

   //window.location.href="swap.php?id=" +id+"&payment_type=normal";
// window.location.href="monthly_subscribe.php";
window.location.href="swap.php?id=" +id+"&payment_type=comp";

}
function calldel_fee_check_unsubscribe(m,id)
{
window.location.href="swap.php?id=" +id+"&payment_type=comp";
}
function calldel_fee_check2(m,id)
{
	
 /* if(!confirm(m))
  {
   return false;
  }
  else
  { */
// window.location.href="swap.php?id=" +id+"&payment_type=subscription";
window.location.href="swap.php?id=" +id+"&payment_type=comp";
  /*}*/
}
function calldel_fee_check3(m,id)
{
	
  if(!confirm(m))
  {
  //  window.location.href="swap.php?id=" +id+"&payment_type=subscription";
  window.location.href="swap.php?id=" +id+"&payment_type=comp";
  }
  else
  {
//window.location.href="monthly_subscribe.php";
window.location.href="swap.php?id=" +id+"&payment_type=comp";
  }
}
function calldel_monthly_subscribe(m)
{
  if(!confirm(m))
  {
    return false;
  }
  else
  return true;
}
function calldel_swap(m)
{
  if(!confirm(m))
  {
    return false;
  }
  else
  return true;
}
function calldel1()
{
  	alert('You must Member to this site.Then only you can Swap your Requested Search Informations.');
    return false;
  
}
// Valid Email  Script
function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}
//script for add member
function member_reg(type)
{
	
	
	 var firstname = document.CustomersForm.firstname.value;
	 if (firstname == "" )
	 { 
	 alert ("Please enter the First Name");
	 document.CustomersForm.firstname.focus();
	 return false;
	 }
	 var lastname = document.CustomersForm.lastname.value; 
	 if (lastname == "")
	 { 
	 alert ("Please enter the Last Name");
	 document.CustomersForm.lastname.focus();
	 return false;
	 }
	 var address1 = document.CustomersForm.address1.value;
	 if (address1 == "" )
	 { 
	 alert ("Please enter the Address Line1");
	 document.CustomersForm.address1.focus();
	 return false;
	 }
	//  var address2 = document.CustomersForm.address2.value;
//	 if (address2 == "" )
//	 { 
//		 alert ("Please enter the Address Line2");
//	 document.CustomersForm.address2.focus();
//	 return false;
//	 }
	  var city=document.CustomersForm.city.value;
	 if (city=="" )
	 { 
	 alert ("Please enter the City Name");
	 document.CustomersForm.city.focus();
	 return false;
	 }
	 var state = document.CustomersForm.state.value;
	 if (state == "Choose")
	 { 
	 alert ("Please Choose the State Name");
	 document.CustomersForm.state.focus();
	 return false;
	 }
	 var zipcode = document.CustomersForm.zipcode.value;
	 if (zipcode == "" )
	 { 
	 alert ("Please enter the Post Code");
	 document.CustomersForm.zipcode.focus();
	 return false;
	 }	
	 if (isNaN(document.CustomersForm.zipcode.value))
	 { 
	 alert ("Post Code must be numeric");
	 document.CustomersForm.zipcode.focus();
	 return false;
	 }	
	 
	  var varCountry = document.CustomersForm.varCountry.value;
	 if (varCountry == "" )
	 { 
	 alert ("Please Choose the Country");
	 document.CustomersForm.varCountry.focus();
	 return false;
	 }
		 
	var emailid = document.CustomersForm.emailid.value;
	 if (emailid == "")
	 { 
	 alert ("Please enter the Email Address");
	 document.CustomersForm.emailid.focus();
	 return false;
	 }	
	 if (!validateEmail(document.CustomersForm.emailid.value,1,1)) 
	 {
	 document.CustomersForm.emailid.focus();
	 return false;
	 }
	var reenter_emailid = document.CustomersForm.reenter_emailid.value;
	 if (reenter_emailid == "")
	 { 
	 alert ("Please enter the re-enter Email Address");
	 document.CustomersForm.reenter_emailid.focus();
	 return false;
	 }	
	 if (!validateEmail(document.CustomersForm.reenter_emailid.value,1,1)) 
	 {
	 document.CustomersForm.reenter_emailid.focus();
	 return false;
	 }
	 if (reenter_emailid !=emailid)
	 { 
	 alert ("Email Address and  re-enter Email Address Must be same");
	 document.CustomersForm.reenter_emailid.focus();
	 return false;
	 }	
	 
	  
		 var  phone1= document.CustomersForm.phone1.value;
		 var  phone2= document.CustomersForm.phone2.value;
		 var  phone3= document.CustomersForm.phone3.value;
		 
		 if (phone1 == "")
		 { 
		 alert ("Please enter the phone no");
		 document.CustomersForm.phone1.focus();
		 return false;
		 }	
		  if (isNaN(document.CustomersForm.phone1.value))
		 { 
		 alert ("Phone No must be numeric");
		 document.CustomersForm.phone1.focus();
		 return false;
		 }	
		  if (phone2 == "")
		 { 
		 alert ("Please enter the phone no");
		 document.CustomersForm.phone2.focus();
		 return false;
		 }	
		  if (isNaN(document.CustomersForm.phone2.value))
		 { 
		 alert ("Phone No must be numeric");
		 document.CustomersForm.phone2.focus();
		 return false;
		 }	
		  if (phone3 == "")
		 { 
		 alert ("Please enter the phone no");
		 document.CustomersForm.phone3.focus();
		 return false;
		 }	
		  if (isNaN(document.CustomersForm.phone3.value))
		 { 
		 alert ("Phone No must be numeric");
		 document.CustomersForm.phone3.focus();
		 return false;
		 }	
	 
	 
	 //	 var  ext= document.CustomersForm.ext.value;
//		 if (ext == "")
//		 { 
//		 alert ("Please enter the Ext");
//		 document.CustomersForm.ext.focus();
//		 return false;
//		 }	
	  if(type != "edit")
	 {
		 var  userid= document.CustomersForm.userid.value;
		 if (userid == "")
		 { 
		 alert ("Please enter the MHS User ID");
		 document.CustomersForm.userid.focus();
		 return false;
		 }	
		  var  addr= document.CustomersForm.userid.value;
   var invalidChars = '<>()@&';
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('User Id contains invalid characters');
		  return false;
	   }
	}
		 var  password= document.CustomersForm.password.value;
		 if (password == "")
		 { 
		 alert ("Please enter the password");
		 document.CustomersForm.password.focus();
		 return false;
		 }	
		if(password.length<6)
		 { 
		 alert ("Password must be atleast 6 characters or numbers.");
		 document.CustomersForm.password.focus();
		 return false;
		 }	
		 var  confirmpass= document.CustomersForm.confirmpass.value;
		 if (confirmpass == "")
		 { 
		 alert ("Please enter the Confirm Password");
		 document.CustomersForm.confirmpass.focus();
		 return false;
		 }	
		 if (password != confirmpass)
		 { 
		 alert ("Password and Confirm Password must be the same");
		 document.CustomersForm.confirmpass.focus();
		 return false;
		 }	
	 
	 var  secret_question= document.CustomersForm.secret_question.value;
		 if (secret_question == "")
		 { 
		 alert ("Please Pick a secret Question");
		 document.CustomersForm.secret_question.focus();
		  return false;
		 }
		  var  secret_answer= document.CustomersForm.secret_answer.value;
		 if (secret_answer == "")
		 { 
		 alert ("Please Enter Your secret answer ");
		 document.CustomersForm.secret_answer.focus();
		  return false;
		 }
	 }
	 
		  var  how_travel= document.CustomersForm.how_travel.value;
		 if (how_travel == "")
		 { 
		 alert ("Please Choose How often do you travel");
		 document.CustomersForm.how_travel.focus();
		  return false;
		 }
		  var  primarily_travel= document.CustomersForm.primarily_travel.value;
		 if (primarily_travel == "")
		 { 
		 alert ("Please Choose the primarily travel for business or pleasure");
		 document.CustomersForm.primarily_travel.focus();
		  return false;
		 }
		  var  where_do_you_travel= document.CustomersForm.where_do_you_travel.value;
		 if (where_do_you_travel == "")
		 { 
		 alert ("Please Choose the where do you travel?");
		 document.CustomersForm.where_do_you_travel.focus();
		  return false;
		 }
		   var  month= document.CustomersForm.month.value;
		 if (month == "")
		 { 
		 alert ("Please Choose the month");
		 document.CustomersForm.month.focus();
		  return false;
		 }
		   var  day= document.CustomersForm.day.value;
		 if (day == "")
		 { 
		 alert ("Please Choose the day");
		 document.CustomersForm.day.focus();
		  return false;
		 }
		   var  year= document.CustomersForm.year.value;
		 if (year == "")
		 { 
		 alert ("Please enter the year");
		 document.CustomersForm.year.focus();
		  return false;
		 }
		 if (isNaN(document.CustomersForm.year.value))
		 { 
		 alert ("year must be numeric");
		 document.CustomersForm.year.focus();
		 return false;
		 }	
		 
	txtshownamelength = document.CustomersForm.varGender.length;
			 var i=0;
			if(txtshownamelength > 1){
				for(GenIndex = 0; GenIndex < txtshownamelength; GenIndex++ ){
					if(document.CustomersForm.varGender[GenIndex].checked == false){
						i=i+1;
					}
				}
			}
			if(i==txtshownamelength)
			{
				alert("Please select the Gender");
				return false;
			}
	if(type != "edit")
	 {
	 if (document.CustomersForm.privacy_agree.checked==false)
	 { 
	 alert ("Please agree and check to Mile High Swap's User Agreement and Privacy Policy.");
	 return false;
	 }	  
	    var  recaptcha_response_field= document.CustomersForm.recaptcha_response_field.value;
		 if (recaptcha_response_field == "")
		 { 
		 alert ("Please Enter the Captcha Code");
		 document.CustomersForm.recaptcha_response_field.focus();
		  return false;
		 }
		
	 }
	 	
}

function login_validation()
{
	
	 var varUsername = document.CustomersForm.varUsername.value;
	 if (varUsername == "" )
	 { 
	 alert ("Please enter the User Name");
	 document.CustomersForm.varUsername.focus();
	 return false;
	 }
	  var varPassword = document.CustomersForm.varPassword.value;
	 if (varPassword == "" )
	 { 
	 alert ("Please enter the Password");
	 document.CustomersForm.varPassword.focus();
	 return false;
	 }
}

function tell_friend_validation()
{

	var name1=document.tell_friend.name1.value;
	var name2=document.tell_friend.name2.value;
	var name3=document.tell_friend.name3.value;
	var name4=document.tell_friend.name4.value;
	
 	if ((name1== "" ) && (name2== "") && (name3== "") && (name4== ""))
		 { 
			 alert ("Please Enter Atleast One of the  Email address");
			 document.tell_friend.name1.focus();
			 return false;
		 }
	if(name1!="")
	{
	 if (!validateEmail(document.tell_friend.name1.value,1,1)) 
	 {
	 document.tell_friend.name1.focus();
	 return false;
	 }
	}
	if(name2!="")
	{
	 if (!validateEmail(document.tell_friend.name2.value,1,1)) 
	 {
	 document.tell_friend.name2.focus();
	 return false;
	 }
	}
	if(name3!="")
	{
	 if (!validateEmail(document.tell_friend.name3.value,1,1)) 
	 {
	 document.tell_friend.name3.focus();
	 return false;
	 }
	}
	if(name4!="")
	{
	 if (!validateEmail(document.tell_friend.name4.value,1,1)) 
	 {
	 document.tell_friend.name4.focus();
	 return false;
	 }
	}
	if (document.tell_friend.message.value=="")
		 { 
			 alert ("Please Enter Your Message");
			 document.tell_friend.message.focus();
			 return false;
		 }
	if (document.tell_friend.from_name.value=="")
		 { 
			 alert ("Please Enter Your Name");
			 document.tell_friend.from_name.focus();
			 return false;
		 }
	if (document.tell_friend.from_email.value=="")
		 { 
			 alert ("Please Enter Your Email");
			 document.tell_friend.from_email.focus();
			 return false;
		 }	
	if (!validateEmail(document.tell_friend.from_email.value,1,1)) 
	 {
	 document.tell_friend.from_email.focus();
	 return false;
	 }
	
}	

function update_billing_validate(){
	var varFirstName = document.frm_search_course.varFirstName.value;
		 if (varFirstName == "" )
		 { 
			 alert ("Please enter the FirstName");
			 document.frm_search_course.varFirstName.focus();
			 return false;
		 }
		 var varLastName = document.frm_search_course.varLastName.value;
		 if (varLastName == "" )
		 { 
			 alert ("Please enter the LastName");
			 document.frm_search_course.varLastName.focus();
			 return false;
		 }
		 var varAddress = document.frm_search_course.varAddress.value;
		 if (varAddress == "" )
		 { 
			 alert ("Please enter the Address");
			 document.frm_search_course.varAddress.focus();
			 return false;
		 }
		 var varCity = document.frm_search_course.varCity.value;
		 if (varCity == "" )
		 { 
			 alert ("Please enter the City");
			 document.frm_search_course.varCity.focus();
			 return false;
		 }
		 var varState = document.frm_search_course.varState.value;
		 if (varState == "Choose" )
		 { 
			 alert ("Please Choose the State");
			 document.frm_search_course.varState.focus();
			 return false;
		 }
		
		  var varZip = document.frm_search_course.varZip.value;
	 if (varZip == "" )
	 { 
	 alert ("Please enter the Zip Code");
	 document.frm_search_course.varZip.focus();
	 return false;
	 }	
	 if (isNaN(document.frm_search_course.varZip.value))
	 { 
	 alert ("Zip Code must be numeric");
	 document.frm_search_course.varZip.focus();
	 return false;
	 }	
	var varEmail = document.frm_search_course.varEmail.value;
	 if (varEmail == "")
	 { 
	 alert ("Please enter the Email Address");
	 document.frm_search_course.emailid.focus();
	 return false;
	 }	
	 if (!validateEmail(document.frm_search_course.varEmail.value,1,1)) 
	 {
	 document.frm_search_course.varEmail.focus();
	 return false;
	 }
	 var varPhone = document.frm_search_course.varPhone.value;
	 if (varPhone == "")
	 { 
	 alert ("Please enter the Phone Number");
	 document.frm_search_course.varPhone.focus();
	 return false;
	 }	
	 if (isNaN(document.frm_search_course.varPhone.value))
	 { 
	 alert ("Phone Number must be numeric");
	 document.frm_search_course.varPhone.focus();
	 return false;
	 }	
	 
		 
		 
	var card_name = document.frm_search_course.card_name.value;
		 if (card_name == "" )
		 { 
			 alert ("Please enter the Card Name");
			 document.frm_search_course.card_name.focus();
			 return false;
		 }
		 
        var card_no = document.frm_search_course.card_no.value;
		 if (card_no == "" )
		 { 
			 alert ("Please enter the Card No");
			 document.frm_search_course.card_no.focus();
			 return false;
		 }
		 if (isNaN(card_no))
		 { 
			 alert ("Card No Must be Numeric");
			 document.frm_search_course.card_no.focus();
			 return false;
		 }
		  var expiremnth = document.frm_search_course.expiremnth.value;
		 if (expiremnth == "" )
		 { 
			 alert ("Please Select the Expired month");
			 document.frm_search_course.expiremnth.focus();
			 return false;
		 }
		 var cvv_code = document.frm_search_course.cvv_code.value;
		 if (cvv_code == "" )
		 { 
			 alert ("Please Enter the CVV Code");
			 document.frm_search_course.cvv_code.focus();
			 return false;
		 }
}

function item_validation(type)
{


			if(document.item_form.intCatid.value=="")
			{
			   alert("Please Choose the Item Category");
			   document.item_form.intCatid.focus();
			   return false;
			}	
			if(document.item_form.intSubCatid.value=="")
			{
			   alert("Please Choose the Item Sub Category");
			   document.item_form.intSubCatid.focus();
			   return false;
			}
			if(document.item_form.item_title_member.value=="")
			{
			   alert("Please Enter the Item Title");
			   document.item_form.item_title_member.focus();
			   return false;
			}
			
			if(document.item_form.item_description.value=="")
			{
			   alert("Please Enter the Item Description");
			   document.item_form.item_description.focus();
			   return false;
			}
			
			if(document.item_form.item_location.value=="")
			{
			   alert("Please enter the Item Location");
			   document.item_form.item_location.focus();
			   return false;
			}
			  if (isNaN(document.item_form.item_location.value))
		 { 
			  alert ("Item Location must be Numeric");
			  document.item_form.item_location.focus();
			  return false;
		 }
			if(document.item_form.transfer_fee.value=="")
			{
			   alert("Please Choose the transfer fee");
			   document.item_form.transfer_fee.focus();
			   return false;
			}
			
	ListBox1 = document.item_form.lstRight;
	if(ListBox1.options.length==0)
	{
	 
      alert("Please choose an item/items from the AirLine Name");
	   return false;
	 
	}  
if(type!="edit")
{
	if(document.item_form.p1.value=="")
			{
			   alert("Please Upload the thumb image");
			   return false;
			}
	if(document.item_form.p6.value=="")
			{
			   alert("Please Upload the enlarge image");
			     return false;
			}
}
	
	selectAll(document.item_form.lstRight);

}

function OnTransferBtnClick(blnFromLeft)
   {
	
    var LeftListBox= document.item_form.lstLeft;
	var LeftListBoxMiles= document.item_form.Miles;
    var RightListBox = document.item_form.lstRight;
    var ListItems = new Array();
	var ListItemsMiles = new Array();
	var ListItemsConcat = new Array();
	
    FromList = LeftListBox; 
    ToList = RightListBox;
	
	var ListItemsCheck= new Array();
	var ListItemsMilesCheck2= new Array();
	
	//Selecting Check
	
	for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItemsCheck[ListItemsCheck.length] = new Option(AirlineValue);
       
       }
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMilesCheck2[ListItemsMilesCheck2.length] = new Option(MilesValue);
        
       } 
	    //Check Selected
	 if(ListItemsCheck.length==0)
	{
      alert("You Must Select AirLine");
	}
	  else if(ListItemsMilesCheck2.length==0)
	{
      alert("You Must Select Miles");
	}
	else {
	   
	//AirLine ID
	   var ListItemsAirLineID = new Array();
	   for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValueId=FromList.options[i].value;
		ListItemsAirLineID[ListItemsAirLineID.length] = new Option(AirlineValueId);
       
       }
	
	//AirLine
	
    for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItems[ListItems.length] = new Option(AirlineValue);
        //FromList.options[i] = null;
       }
	   
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMiles[ListItemsMiles.length] = new Option(MilesValue);
        //LeftListBoxMiles.options[i] = null;
       } 
	   
	  
	   //Placed Item
	   
     for(var i=ListItems.length - 1;i>=0;i--)
	 {
	    var AirlineValue=ListItems[i].text;
		var Hyphen="-";
    	var ConcatValue=AirlineValue.concat(Hyphen);
		var MileValue=ListItemsMiles[i].text;
		var FromValue=ConcatValue.concat(MileValue);
		ListItemsConcat[ListItemsConcat.length] = new Option(FromValue);
	 }
	 var setflag="Notset";
	  for(var i=ListItemsConcat.length - 1;i>=0;i--)
	  {
	   var	OptionDisplayLength= ToList.options.length;
	    var	SeperateOperator=">>";
	   var	AirLineId=ListItemsAirLineID[i].text;
	   var	ConcatIDWithSeperator=AirLineId.concat(SeperateOperator);
	   var dubi=i;		
	    for(var j=(ToList.options.length - 1);j>=0;j--)
   
       {
			
			if(j!=-1)
			{
				
			if(ToList.options[j].text==ListItemsConcat[dubi].text)
			{
			var setflag="set";	
			}
			}
			
		
		}
		
		if(setflag!="set")
		{
	   ToList.options[ToList.options.length]= ListItemsConcat[i];
	   ToList.options[OptionDisplayLength].value = ConcatIDWithSeperator.concat(ListItemsMiles[i].text);
		}
		else
		alert("You have already selected this combination");
	   }
	 
	 
	 }
} 
function deleteitemairline()
{
var FromList = document.item_form.lstRight;
var j=1;

var len=FromList.options.length;
for(var i=(FromList.options.length - 1);i>=0;i--)
{
     if(FromList.options[i].selected)
       FromList.options[i] = null;
     else
	 {
	 	var testcheck=j;
		j++;
	 }
		
}

if(len==testcheck)
	{
      alert("You Must Select the Selected AirLine item for Deletion");
	}   
}

function insertMoreUploadcoms() 
{ 
	
	
	var nUploads = parseInt(document.getElementById('NumberOfUploadcoms').value)+1;		 
	var tbody    = document.getElementById("tabUploadcoms").getElementsByTagName("tbody")[1]; 
	var row      = document.createElement("TR"); 

	
	//insert second <td>
	var cell2 = document.createElement("TD");
	cell2.setAttribute("valign","top");
	cell2.setAttribute("align","center");
	cell2.setAttribute("width","56%");
	//File
	var eInput = document.createElement("INPUT"); 
	eInput.setAttribute("type","file");
	eInput.setAttribute("size","20");
	eInput.setAttribute("name","downloadfilcom" + nUploads);
	eInput.setAttribute("id","downloadfilcom" + nUploads);
	cell2.appendChild(eInput);
	
	//row.appendChild(cell1); 
	row.appendChild(cell2); 
	
	
	tbody.appendChild(row);
	document.item_form.NumberOfUploadcoms.value = nUploads;
	return false;
}

function service_validation(type)
{
		 if(document.item_form.intCatid.value=="")
			{
			   alert("Please Choose the Service Category");
			   document.item_form.intCatid.focus();
			   return false;
			}
			if(document.item_form.intSubCatid.value=="")
			{
			   alert("Please Choose the Service Sub Category");
			   document.item_form.intSubCatid.focus();
			   return false;
			}
				if(document.item_form.item_title_member.value=="")
			{
			   alert("Please Enter the Service Title");
			   document.item_form.item_title_member.focus();
			   return false;
			}
			if(document.item_form.item_description.value=="")
			{
			   alert("Please Enter the Service Description");
			   document.item_form.item_description.focus();
			   return false;
			}
			if(document.item_form.item_location.value=="")
			{
			   alert("Please enter the Service Location");
			   document.item_form.item_location.focus();
			   return false;
			}
			  if (isNaN(document.item_form.item_location.value))
		 { 
			  alert ("Service Location must be Numeric");
			  document.item_form.item_location.focus();
			  return false;
		 }
			if(document.item_form.transfer_fee.value=="")
			{
			   alert("Please Choose the transfer fee");
			   document.item_form.transfer_fee.focus();
			   return false;
			}
			
	ListBox1 = document.item_form.lstRight;
	if(ListBox1.options.length==0)
	{
	 
      alert("Please choose an item/items from the AirLine Name");
	   return false;
	 
	}  
if(type!="edit")
{
		if(document.item_form.p1.value=="")
			{
			   alert("Please Upload the thumb image");
			    return false;
			}
	if(document.item_form.p6.value=="")
			{
			   alert("Please Upload the enlarge image");
			    return false;
			}
}
	
	selectAll(document.item_form.lstRight);

}
function search_validation()
{
		 if (document.frm_search.search_text.value== "" )
		 { 
			 alert ("Please enter the search Keyword");
			 document.frm_search.search_text.focus();
			 return false;
		 }
}
function update_fund_validate()
{
		 if (document.frm_fund.fund.value== "" )
		 { 
			 alert ("Please enter Your Fund Amount");
			 document.frm_fund.fund.focus();
			 return false;
		 }
		   if (isNaN(document.frm_fund.fund.value))
		 { 
			 alert ("Your Fund Amount Must be Numberic");
			 document.frm_fund.fund.focus();
			 return false;
		 }
		  if (document.frm_fund.fund.value== 0 )
		 { 
			  alert ("Please enter valid Fund Amount");
			 document.frm_fund.fund.focus();
			 return false;
		 }
		   if (document.frm_fund.fund.value< 0 )
		 { 
			  alert ("Please enter valid Fund Amount");
			 document.frm_fund.fund.focus();
			 return false;
		 }
}


var lists=new Array();
var lists1=new Array();
var centers=new Array();
var emptycenters=new Array();
emptycenters[0]	= new Array('Choose','Choose');

function emptyList(box) 
{
	while (box.options.length) box.options[0] = null;
}

function fillList( box, arr ) 
{
	//alert(arr);
	for ( i = 0; i < arr[0].length; i++ ) 
	{
		opton = new Option( arr[0][i], arr[0][i+1] );
		box.options[box.length] = opton;
		i=i+1;
	}
	
	box.selectedIndex=0;
}

function changeList(box) 
{
	//alert(box.options[box.selectedIndex].value);
	//alert(lists[box.options[box.selectedIndex].value]);
	list = lists[box.options[box.selectedIndex].value];
	//alert(list);
	if(box.options[box.selectedIndex].value != "select" && box.options[box.selectedIndex].value != "Choose" && box.options[box.selectedIndex].value != "")
	{
		
		emptyList(box.form.intSubCatid);
		fillList(box.form.intSubCatid, list );
	}
}

function selectAll(objTargetElement)
	{
		for (var i = 0; i < objTargetElement.length; i++) 
		{
			objTargetElement.options[i].selected = true;
		}
		return false;
	}
	
function calldel_sessioncheck(m)
{
alert("You must Login to Mile High Swap in order to contact and swap with other members.");
 window.location.href="login.php";
  return true;
}

function calldel_dubcheck(m)
{
	alert("This item is posted by you.So, you can't swap with this item");
   return false;

}
function calldel_dubcheck1(m)
{
	alert("This item is already Swapped by you.");
   return false;

}
function calldel_close_subscribe_account(m)
{
  if(!confirm(m))
  {
     return false;
  }
  else
  {
  window.location.href="close_subscribe_account.php";
  return true;
  }
}

function calldel_close_account(m)
{
  if(!confirm(m))
  {
     return false;
  }
  else
  {
  window.location.href="close_account.php";
  return true;
  }
}

function swap_accept_val(m,id1,id2,from)
{
  if(!confirm(m))
  {
    return false;
  }
  else
  {
 window.location.href="accept_swap_notification.php?id1=" +id1+"&id2=" +id2+"&from=" +from;
  return true;
  }
}

function chartvalidation()
{
		 if (document.frm_valuechart.item_select.value== "" )
		 { 
			 alert ("Please Choose the  item or services");
			 document.frm_valuechart.item_select.focus();
			 return false;
		 }
}


/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
//menu1[0]='<a href="item_category.php?from=empty"  class="leftlinks1"><font color="#FFFFFF">Items</font></a>'
//menu1[1]='<a href="cat_service.php?from=empty" class="leftlinks1"><font color="#FFFFFF">Services</font></a>'
menu1[0]='<a href="search_result.php?searchby=category"  class="leftlinks1"><font color="#FFFFFF">By Category</font></a>'
menu1[1]='<a href="search_result.php?searchby=miles" class="leftlinks1"><font color="#FFFFFF">By Miles</font></a>'
menu1[2]='<a href="search_result.php" class="leftlinks1"><font color="#FFFFFF">Show All</font></a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="hotswaps.php"  class="leftlinks1"><font color="#FFFFFF">Items</font></a>'
menu2[1]='<a href="hotswaps_service.php" class="leftlinks1"><font color="#FFFFFF">Services</font></a>'


var menuwidth='165px' //default menu width
var menubgcolor='#b5c7d6'  //menu bgcolor
var color_front='#FFFFFF'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';color:'+color_front+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){

if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)


dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


function valechart_check_validation(from_value){
	ListBox1 = document.item_form.lstRight;
	if(ListBox1.options.length==0)
	{
	  alert("Please choose an item/items from the AirLine Name for view the value chart");
	   return false;
	}  
	else
	{
	
selectAll(document.item_form.lstRight);    
    FromList = document.item_form.lstRight;
 	count=0;
	//Selecting Check
	for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		   count++;
	   if(count==1)
		var select_value1=FromList.options[i].value;
		if(count==2)
		var select_value2=FromList.options[i].value;
		if(count==3)
		var select_value3=FromList.options[i].value;
	
        }
	   
		if(from_value=="not_seesiion")
		{
			window.location.href="valuechart3.php?from=view&select_value1=" + select_value1+"&select_value2=" + select_value2+"&select_value3=" + select_value3;
		
		}
		else
		{
		window.location.href="valuechart.php?select_value1=" + select_value1+"&select_value2=" + select_value2+"&select_value3=" + select_value3;
		}
	}
}









function swapmiles(blnFromLeft)
   {
	
    var LeftListBox= document.frm_swap.lstLeft;
	var LeftListBoxMiles= document.frm_swap.Miles;
    var RightListBox = document.frm_swap.lstRight;
    var ListItems = new Array();
	var ListItemsMiles = new Array();
	var ListItemsConcat = new Array();
	
    FromList = LeftListBox; 
    ToList = RightListBox;
	
	var ListItemsCheck= new Array();
	var ListItemsMilesCheck2= new Array();
	
	//Selecting Check
	
	for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItemsCheck[ListItemsCheck.length] = new Option(AirlineValue);
       
       }
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMilesCheck2[ListItemsMilesCheck2.length] = new Option(MilesValue);
        
       } 
	    //Check Selected
	 if(ListItemsCheck.length==0)
	{
      alert("You Must Select AirLine");
	}
	  else if(ListItemsMilesCheck2.length==0)
	{
      alert("You Must Select Miles");
	}
	else {
	   
	//AirLine ID
	   var ListItemsAirLineID = new Array();
	   for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValueId=FromList.options[i].value;
		ListItemsAirLineID[ListItemsAirLineID.length] = new Option(AirlineValueId);
       
       }
	
	//AirLine
	
    for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItems[ListItems.length] = new Option(AirlineValue);
        //FromList.options[i] = null;
       }
	   
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMiles[ListItemsMiles.length] = new Option(MilesValue);
        //LeftListBoxMiles.options[i] = null;
       } 
	   
	  
	   //Placed Item
	   
     for(var i=ListItems.length - 1;i>=0;i--)
	 {
	    var AirlineValue=ListItems[i].text;
		var Hyphen="-";
    	var ConcatValue=AirlineValue.concat(Hyphen);
		var MileValue=ListItemsMiles[i].text;
		var FromValue=ConcatValue.concat(MileValue);
		ListItemsConcat[ListItemsConcat.length] = new Option(FromValue);
	 }
	 var setflag="Notset";
	  for(var i=ListItemsConcat.length - 1;i>=0;i--)
	  {
	   var	OptionDisplayLength= ToList.options.length;
	    var	SeperateOperator=">>";
	   var	AirLineId=ListItemsAirLineID[i].text;
	   var	ConcatIDWithSeperator=AirLineId.concat(SeperateOperator);
	   var dubi=i;		
	    for(var j=(ToList.options.length - 1);j>=0;j--)
   
       {
			
			if(j!=-1)
			{
				
			if(ToList.options[j].text==ListItemsConcat[dubi].text)
			{
			var setflag="set";	
			}
			}
			
		
		}
		
		if(setflag!="set")
		{
	   ToList.options[ToList.options.length]= ListItemsConcat[i];
	   ToList.options[OptionDisplayLength].value = ConcatIDWithSeperator.concat(ListItemsMiles[i].text);
		}
		else
		alert("You have already selected this combination");
	   }
	 
	 
	 }
} 


function willswapmiles(blnFromLeft)
   {
	
    var LeftListBox= document.frm_swap.willswap_Lsleft;
	var LeftListBoxMiles= document.frm_swap.willswap_miles;
    var RightListBox = document.frm_swap.willswap_Lsright;
    var ListItems = new Array();
	var ListItemsMiles = new Array();
	var ListItemsConcat = new Array();
	
    FromList = LeftListBox; 
    ToList = RightListBox;
	
	var ListItemsCheck= new Array();
	var ListItemsMilesCheck2= new Array();
	
	//Selecting Check
	
	for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItemsCheck[ListItemsCheck.length] = new Option(AirlineValue);
       
       }
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMilesCheck2[ListItemsMilesCheck2.length] = new Option(MilesValue);
        
       } 
	    //Check Selected
	 if(ListItemsCheck.length==0)
	{
      alert("You Must Select AirLine");
	}
	  else if(ListItemsMilesCheck2.length==0)
	{
      alert("You Must Select Miles");
	}
	else {
	   
	//AirLine ID
	   var ListItemsAirLineID = new Array();
	   for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValueId=FromList.options[i].value;
		ListItemsAirLineID[ListItemsAirLineID.length] = new Option(AirlineValueId);
       
       }
	
	//AirLine
	
    for(var i=(FromList.options.length - 1);i>=0;i--)
     if(FromList.options[i].selected)
       {
		var AirlineValue=FromList.options[i].text;
		ListItems[ListItems.length] = new Option(AirlineValue);
        //FromList.options[i] = null;
       }
	   
	   
	  //Miles
	  
	   for(var i=(LeftListBoxMiles.options.length - 1);i>=0;i--)
     if(LeftListBoxMiles.options[i].selected)
       {
		var MilesValue=LeftListBoxMiles.options[i].text;
		ListItemsMiles[ListItemsMiles.length] = new Option(MilesValue);
        //LeftListBoxMiles.options[i] = null;
       } 
	   
	  
	   //Placed Item
	   
     for(var i=ListItems.length - 1;i>=0;i--)
	 {
	    var AirlineValue=ListItems[i].text;
		var Hyphen="-";
    	var ConcatValue=AirlineValue.concat(Hyphen);
		var MileValue=ListItemsMiles[i].text;
		var FromValue=ConcatValue.concat(MileValue);
		ListItemsConcat[ListItemsConcat.length] = new Option(FromValue);
	 }
	 var setflag="Notset";
	  for(var i=ListItemsConcat.length - 1;i>=0;i--)
	  {
	   var	OptionDisplayLength= ToList.options.length;
	    var	SeperateOperator=">>";
	   var	AirLineId=ListItemsAirLineID[i].text;
	   var	ConcatIDWithSeperator=AirLineId.concat(SeperateOperator);
	   var dubi=i;		
	    for(var j=(ToList.options.length - 1);j>=0;j--)
   
       {
			
			if(j!=-1)
			{
				
			if(ToList.options[j].text==ListItemsConcat[dubi].text)
			{
			var setflag="set";	
			}
			}
			
		
		}
		
		if(setflag!="set")
		{
	   ToList.options[ToList.options.length]= ListItemsConcat[i];
	   ToList.options[OptionDisplayLength].value = ConcatIDWithSeperator.concat(ListItemsMiles[i].text);
		}
		else
		alert("You have already selected this combination");
	   }
	 
	 
	 }
} 


function deleteswapmiles()
{
var FromList = document.frm_swap.lstRight;
var j=1;

var len=FromList.options.length;
for(var i=(FromList.options.length - 1);i>=0;i--)
{
     if(FromList.options[i].selected)
       FromList.options[i] = null;
     else
	 {
	 	var testcheck=j;
		j++;
	 }
		
}

if(len==testcheck)
	{
      alert("You Must Select the Selected AirLine item for Deletion");
	}   
}
function deletewillswapmiles()
{
var FromList = document.frm_swap.willswap_Lsright;
var j=1;

var len=FromList.options.length;
for(var i=(FromList.options.length - 1);i>=0;i--)
{
     if(FromList.options[i].selected)
       FromList.options[i] = null;
     else
	 {
	 	var testcheck=j;
		j++;
	 }
		
}

if(len==testcheck)
	{
      alert("You Must Select the Selected AirLine item for Deletion");
	}   
}

function swapmiles_validation(){

   ListBox1 = document.frm_swap.lstRight;
	if(ListBox1.options.length==0)
	{
	 
      alert("Please choose an item/items from the AirLine Name for swap");
	   return false;
	 
	}  
 ListBox1 = document.frm_swap.willswap_Lsright;
	if(ListBox1.options.length==0)
	{
	 
      alert("Please choose an item/items from the AirLine Name for will swap");
	   return false;
	 
	}  
	selectAll(document.frm_swap.lstRight);
	selectAll(document.frm_swap.willswap_Lsright);

}

function swap_notification_validation()
{
		 if (document.swap_notification.from_name.value== "" )
		 { 
			 alert ("Please enter your name");
			 document.swap_notification.from_name.focus();
			 return false;
		 }
		 if (document.swap_notification.from_email.value== "" )
		 { 
			 alert ("Please enter your email");
			 document.swap_notification.from_email.focus();
			 return false;
		 }
}


function poporder(URL)
{
	day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,directories=no,menubar=0,resizable=0,width=348,height=100,left =274,top = 221');");
}


//script for Subscriber validation 
function subscriber_validation()
{
		 if (document.CustomersForm.varName.value== "" )
		 { 
			 alert ("Please Enter your Name");
			 document.CustomersForm.varName.focus();
			 return false;
		 }
		 if (document.CustomersForm.varEmail.value== "" )
		 { 
			 alert ("Please Enter Your E-mail Address");
			 document.CustomersForm.varEmail.focus();
			 return false;
		 }
		  if (!validateEmail(document.CustomersForm.varEmail.value,1,1)) 
		 {
		 document.CustomersForm.varEmail.focus();
		 return false;
		 }
		
}



function letmeknow_validation()
{
	
	if (document.letmeknow_frm.intCatid.value=="")
		 { 
			 alert ("Please Choose the Category");
			 document.letmeknow_frm.intCatid.focus();
			 return false;
		 }
if (document.letmeknow_frm.key1.value=="")
		 { 
			 alert ("Please Enter the Keyword1");
			 document.letmeknow_frm.key1.focus();
			 return false;
		 }
	if (document.letmeknow_frm.key2.value=="")
		 { 
			 alert ("Please Enter the Keyword2");
			 document.letmeknow_frm.key2.focus();
			 return false;
		 }
		if (document.letmeknow_frm.key3.value=="")
		 { 
			 alert ("Please Enter the Keyword3");
			 document.letmeknow_frm.key3.focus();
			 return false;
		 }
			if (document.letmeknow_frm.desc.value=="")
		 { 
			 alert ("Please Enter the Description");
			 document.letmeknow_frm.desc.focus();
			 return false;
		 }
		 		if (document.letmeknow_frm.name.value=="")
		 { 
			 alert ("Please Enter the Name");
			 document.letmeknow_frm.name.focus();
			 return false;
		 }
		  		if (document.letmeknow_frm.email.value=="")
		 { 
			 alert ("Please Enter the email");
			 document.letmeknow_frm.email.focus();
			 return false;
		 }
		  if (!validateEmail(document.letmeknow_frm.email.value,1,1)) 
	 {
	 document.letmeknow_frm.email.focus();
	 return false;
	 }
}

	function uploadvalidation()
	{
	 if (document.frm_upload.thumb.value== "" )
		 { 
			 alert ("Please Upload the thumb image");
			 document.frm_upload.thumb.focus();
			 return false;
		 }
	}
	
	function contact_validation()
{
		 if (document.frm_contact.name.value== "" )
		 { 
			 alert ("Please enter the  name");
			 document.frm_contact.name.focus();
			 return false;
		 }
		 	if (document.frm_contact.email.value=="")
		 { 
			 alert ("Please Enter Your Email");
			 document.frm_contact.email.focus();
			 return false;
		 }	
	if (!validateEmail(document.frm_contact.email.value,1,1)) 
	 {
	 document.frm_contact.email.focus();
	 return false;
	 }
	 	if (document.frm_contact.regarding.value=="")
		 { 
			 alert ("Please Select Your regarding");
			 document.frm_contact.regarding.focus();
			 return false;
		 }	
		 	if (document.frm_contact.message.value=="")
		 { 
			 alert ("Please Enter Your Message");
			 document.frm_contact.message.focus();
			 return false;
		 }	
}

function sendemail_validation(){
	
	var emailid = document.send_email_frm.emailid.value;
	 if (emailid == "")
	 { 
	 alert ("Please enter the Email Address");
	 document.send_email_frm.emailid.focus();
	 return false;
	 }	
	 if (!validateEmail(document.send_email_frm.emailid.value,1,1)) 
	 {
	 document.send_email_frm.emailid.focus();
	 return false;
	 }

}

//script for Subscriber validation 
function milehighmadsubscriber_validation()
{
		 if (document.CustomersForm.varName.value== "" )
		 { 
			 alert ("Please Enter your Name");
			 document.CustomersForm.varName.focus();
			 return false;
		 }
		 if (document.CustomersForm.varEmail.value== "" )
		 { 
			 alert ("Please Enter Your E-mail Address");
			 document.CustomersForm.varEmail.focus();
			 return false;
		 }
		  if (!validateEmail(document.CustomersForm.varEmail.value,1,1)) 
		 {
		 document.CustomersForm.varEmail.focus();
		 return false;
		 }
		
}

