function MM_preloadImages()
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function changeScrollbarColor(C)
{
  if (document.all)
  {
    document.body.style.scrollbarBaseColor = C
  }   
}
function ValidatorTrim(s)
{
	var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
	return (m == null) ? "" : m[1];
}
function MM_openBrWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
  return false;
}
function feedbackVal()
{
if(document.feedback.username.value == "")
{
alert("Please enter the Fullname.");
document.getElementById('username').focus();
return false;
}
if(document.feedback.email.value == "")
{
alert("Please enter the email ID.");
document.getElementById('email').focus();
return false;
}
if(document.feedback.email.value.indexOf('@')==-1){

alert("Please enter your correct email id");
document.getElementById('email').focus();
return false;
}
if(document.feedback.email.value.indexOf('.')==-1){

alert("Please enter your correct email id");
document.getElementById('email').focus();
return false;
}
if(document.feedback.phone_no.value == "")
{
alert("Please enter the Phone Number.");
document.getElementById('phone_no').focus();
return false;
}
if(document.feedback.mobile_no.value == "")
{
alert("Please enter the Mobile Number.");
document.getElementById('mobile_no').focus();
return false;
}
if(document.feedback.feed_Desc.value == "")
{
alert("Please enter the Feedback.");
document.getElementById('feed_Desc').focus();
return false;
}
return true;
}
function feedbackReset()
{
var R = "Are you sure you want to clear the Form?"
self.focus();
document.feedback.username.value = ""
document.feedback.email.value = ""
document.feedback.phone_no.value = ""
document.feedback.mobile_no.value = ""
document.feedback.feed_Desc.value = ""
}
function doAdmADReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.hmeFrm.admin_username.value = ""
	document.hmeFrm.admin_password.value = ""
}
function checkAdmVal()
{
	if(ValidatorTrim(document.hmeFrm.admin_username.value)=='')
	{
		alert('Please enter Admin Username');
		document.getElementById('admin_username').focus();
		return false;		
	} 
	var newUsnm=document.hmeFrm.admin_password.value;
	if(ValidatorTrim(document.hmeFrm.admin_password.value)=='')
	{
		alert('Please enter Admin Password');
		document.getElementById('admin_password').focus();
		return false;		
	}
	if(newUsnm!="")
	{
		if(newUsnm.indexOf(" ")!=-1)
		{
	    	alert("Please dont use space for Admin Password.");
		 	document.hmeFrm.admin_password.value="";
		 	document.hmeFrm.admin_password.focus();
		 	return false;
		}
		if(newUsnm.length<5||newUsnm.length>8)
		{
		   alert("Admin Password length must lie between 5 - 8 Characters Only");
		   document.hmeFrm.admin_password.value="";
		   document.hmeFrm.admin_password.focus();
		   return false;
		}
	}
}
function checkAdmPwdVal()
{
	if(document.fmrChgeAdmPwd.cpassword.value=="")
	{
		alert("Please provide your old Password");
		document.fmrChgeAdmPwd.cpassword.focus();
		return false;
	}
	if(document.fmrChgeAdmPwd.cpassword.value!="")
	{
		if(document.fmrChgeAdmPwd.pwd.value!=document.fmrChgeAdmPwd.cpassword.value)
		{
			alert("Please provide your valid old password");
			document.fmrChgeAdmPwd.cpassword.focus();
			return false;
		}
	}
	var newpass=document.fmrChgeAdmPwd.password.value;
	if(document.fmrChgeAdmPwd.password.value=="")
	{
		alert("Please enter new password");
		document.fmrChgeAdmPwd.password.focus();
		return false;
	}
	if(newpass!="")
	{
		if(newpass.indexOf(" ")!=-1)
		{
			alert("Please dont use space for password");
			document.fmrChgeAdmPwd.password.value="";
			document.fmrChgeAdmPwd.password.focus();
			return false;
		}
		if(newpass.length<1||newpass.length>16)
		{
			alert("Password length must lie between 1 - 16 Characters");
			document.fmrChgeAdmPwd.password.value="";
			document.fmrChgeAdmPwd.password.focus();
			return false;
		}
	}
	if(document.fmrChgeAdmPwd.password.value!=document.fmrChgeAdmPwd.password_confirm.value)
	{
			alert("Both New and Confirm Password must be same");
			document.fmrChgeAdmPwd.password_confirm.focus();
			return false;
	}
	return true;
}

function doAdmPwdReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.fmrChgeAdmPwd.cpassword.value = ""
	document.fmrChgeAdmPwd.password.value = ""
	document.fmrChgeAdmPwd.password_confirm.value = ""
}
function alert_home()
{
	if(ValidatorTrim(document.add_policy_form.title.value)=='')
	{
		alert('Please enter title for home page.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.editor1.value)=='')
	{
		alert('Please enter content for home page.');
		document.getElementById('editor1').focus();
		return false;		
	}
	return true;
}
function privacy_policyReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.add_policy_form.title.value = ""
	document.add_policy_form.editor1.value = ""
}
function editPrivacyPolicy()
{
	if(ValidatorTrim(document.edit_privacy_policy.title.value)=='')
	{
		alert('Please enter title for home page.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policy.editor1.value)=='')
	{
		alert('Please enter content for home page.');
		document.getElementById('editor1').focus();
		return false;		
	}
	return true;
}
function alert_pricing()
{
	if(ValidatorTrim(document.add_policy_form.title.value)=='')
	{
		alert('Please enter pricing details.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.editor1.value)=='')
	{
		alert('Please enter pricing details.');
		document.getElementById('editor1').focus();
		return false;		
	}
	return true;
}
function pricingReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.add_policy_form.title.value = ""
	document.add_policy_form.editor1.value = ""
}
function editpricing()
{
	if(ValidatorTrim(document.edit_privacy_policy.title.value)=='')
	{
		alert('Please enter pricing details.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policy.editor1.value)=='')
	{
		alert('Please enter pricing details.');
		document.getElementById('editor1').focus();
		return false;		
	}
	return true;
}
function alert_tour()
{
	if(ValidatorTrim(document.add_policy_form.title.value)=='')
	{
		alert('Please enter title for tour image.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.userfile.value)=='')
	{
		alert('Please upload tour image');
		document.getElementById('userfile').focus();
		return false;		
	}	
	return true;
}
function privacy_policySDSDReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.add_policy_form.title.value = ""
}
function editpricingTour()
{
	if(ValidatorTrim(document.edit_privacy_policy.title.value)=='')
	{
		alert('Please enter title for tour image.');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policy.userfile.value)=='')
	{
		alert('Please upload tour image');
		document.getElementById('userfile').focus();
		return false;		
	}	
	return true;
}
function CouponsReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.add_policy_form.title.value = ""
	document.add_policy_form.coupons_sub_hdg.value = ""
	document.add_policy_form.price_more.value = ""
	document.add_policy_form.descr.value = ""
}
function alert_coupons()
{
	if(ValidatorTrim(document.add_policy_form.title.value)=='')
	{
		alert('Please enter title');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.coupons_sub_hdg.value)=='')
	{
		alert('Please enter Coupon Tag/Qutoe');
		document.getElementById('coupons_sub_hdg').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.price_more.value)=='')
	{
		alert('Please enter Coupon Scheme');
		document.getElementById('price_more').focus();
		return false;		
	}
	if(ValidatorTrim(document.add_policy_form.descr.value)=='')
	{
		alert('Please enter description');
		document.getElementById('descr').focus();
		return false;		
	}
	return true;
}
function editpricingCoupons()
{
	if(ValidatorTrim(document.edit_privacy_policycPN.title.value)=='')
	{
		alert('Please enter title');
		document.getElementById('title').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policycPN.coupons_sub_hdg.value)=='')
	{
		alert('Please enter Coupon Tag/Qutoe');
		document.getElementById('coupons_sub_hdg').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policycPN.price_more.value)=='')
	{
		alert('Please enter Coupon Scheme');
		document.getElementById('price_more').focus();
		return false;		
	}
	if(ValidatorTrim(document.edit_privacy_policycPN.descr.value)=='')
	{
		alert('Please enter description');
		document.getElementById('descr').focus();
		return false;		
	}
	return true;
}

function checkAvialVal()
{
	if(ValidatorTrim(document.check_availabilityFrm.date11.value)=='')
	{
					alert('Please enter date');
					document.getElementById('date11').focus();
					return false;		
	}
	var ifeed_fullnameChars = "!@#$%^*+=\;{}\":<>?";
	var digfeed_fullnamedesit = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	if(document.check_availabilityFrm.date11.value!="")
	{
		for (var i = 0; i < document.check_availabilityFrm.date11.value.length; i++)
		{ 
			if(ifeed_fullnameChars.indexOf(document.check_availabilityFrm.dadate11te.value.charAt(i)) != -1) 
			{				
				alert('Entered date contains special characters like @,$,*,^,& etc.\nThese are not allowed.\nPlease remove them and enter proper date');
				document.check_availabilityFrm.date11.value="";
				document.check_availabilityFrm.date11.focus();
				return false;
			}
			if(digfeed_fullnamedesit.indexOf(document.check_availabilityFrm.date11.value.charAt(i)) != -1) 
			{				
				alert('Entered date contains alphabates etc.\nThese are not allowed.\nPlease remove them and try again and enter only numbers ..');
				document.check_availabilityFrm.date11.value="";
				document.check_availabilityFrm.date11.focus();
				return false;
			}
		}
	}
	return true;
}	

function DateReset()
{
	var R = "Are you sure you want to clear the Form?"    
	self.focus();
	document.check_availabilityFrm.date11.value = ""
}
function member_infoFrmVal()
{
if(document.member_infoFrm.username.value == "")
{
alert("Please enter the Fullname.");
document.getElementById('username').focus();
return false;
}
if(document.member_infoFrm.address.value == "")
{
alert("Please enter the address.");
document.getElementById('address').focus();
return false;
}
if(document.member_infoFrm.email.value == "")
{
alert("Please enter the email ID.");
document.getElementById('email').focus();
return false;
}
if(document.member_infoFrm.email.value.indexOf('@')==-1){

alert("Please enter your correct email id");
document.getElementById('email').focus();
return false;
}
if(document.member_infoFrm.email.value.indexOf('.')==-1){

alert("Please enter your correct email id");
document.getElementById('email').focus();
return false;
}
if(document.member_infoFrm.phone_no.value == "")
{
alert("Please enter the Phone Number.");
document.getElementById('phone_no').focus();
return false;
}
if(document.member_infoFrm.mobile_no.value == "")
{
alert("Please enter the Mobile Number.");
document.getElementById('mobile_no').focus();
return false;
}
if(document.member_infoFrm.occassion.value == "")
{
alert("Please enter the occassion description.");
document.getElementById('occassion').focus();
return false;
}
return true;
}
function member_infoFrmValReset()
{
var R = "Are you sure you want to clear the Form?"
self.focus();
document.member_infoFrm.username.value = ""
document.member_infoFrm.address.value = ""
document.member_infoFrm.email.value = ""
document.member_infoFrm.phone_no.value = ""
document.member_infoFrm.mobile_no.value = ""
document.member_infoFrm.occassion.value = ""
}
