//Add to Favioute in all browsers
// JavaScript Document
function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	}
	else if( document.all ) {
		window.external.AddFavorite( url, title);
	}
	else if( window.opera && window.print ){
		return true;
	}
}
function openwin(nm,width1,height1){
	var name1=nm;
	var path1="";
	var pop="";
	if (pop && !pop.closed) {
	   pop.close();
	}
	pop=eval("window.open('"+name1+"','NewWIN','chrome[4],toolbar=no,left=5,top=5,width="+width1+",height="+height1+",directories=no,menubar=no,SCROLLBARS=yes,left=2,right=2,resizable=yes')");
	if (!pop.opener) popUpWin.opener = self;
}
function CheckLeftSearch(){
	var doc,str,s;
	doc=document.LeftsearchForm;
	s=0;
	if((doc.SearchKeyword.value=='Keyword...' || doc.SearchKeyword.value=='' ) && doc.SearchDate.value.length==0){
		alert("Please Enter Search Criteria");
		doc.SearchKeyword.value='';
		doc.SearchKeyword.focus();
		return false;
	}
}
function CheckTopSearch(){
	var doc,str,s;
	doc=document.TopsearchForm;
	s=0;
	if((doc.SearchKeyword.value=='Keyword...' || doc.SearchKeyword.value=='' ) && doc.SearchDate.value.length==0){
		alert("Please Enter Search Criteria");
		doc.SearchKeyword.value='';
		doc.SearchKeyword.focus();
		return false;
	}
}
function CheckOnevote(){
	var doc,str,s;
	doc=document.VoteForm;
	s=0;
	counts=doc.elements.length;
	for(i=0;i<counts;i++){
		if(doc.elements[i].type=="radio"){
			if(doc.elements[i].checked==true){
				s=1;
			}
		}
	}
	if(s==0){
		alert("Please Check one to vote");
		return false;
	}
}
function checkNewsletter(){
	var doc,str,s;
	doc=document.newsletterFrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;	
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
}
function checkrefer(){
	var doc,str,s;
	doc=document.referfrm;
	s=0;
	
	if(doc.your_email.value=="your email"){
		alert("Please Enter Your Email");
		doc.your_email.value='';
		doc.your_email.focus();
		return false;
	}
	if(doc.your_email.value.indexOf('@')==-1 || doc.your_email.value.indexOf('.')==-1){
		alert("Please Enter Your Email Correctly");
		doc.your_email.value="";
		doc.your_email.focus();
		return false;	
	}
	if(doc.friend_email.value=="friend email"){
		alert("Please Enter Friend Email");
		doc.friend_email.value='';
		doc.friend_email.focus();
		return false;
	}
	if(doc.friend_email.value.indexOf('@')==-1 || doc.friend_email.value.indexOf('.')==-1){
		alert("Please Enter Friend Email Correctly");
		doc.friend_email.value="";
		doc.friend_email.focus();
		return false;
	}
}
function Checkevent(){
	var doc,str,s;
	doc=document.eventfrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.event_title.value.length){
		alert("Please Enter Event Title");
		doc.event_title.focus();
		return false;
	}
	if(!doc.file_1.value.length){
		alert("Please Enter Event Image");
		doc.file_1.focus();
		return false;
	}
	if(!doc.event_date.value.length){
		alert("Please Enter Event Date");
		doc.event_date.focus();
		return false;
	}
	if(!doc.event_short_desc.value.length){
		alert("Please Enter Event Short Description");
		doc.event_short_desc.focus();
		return false;
	}
	if(!doc.event_desc.value.length){
		alert("Please Enter Event Description");
		doc.event_desc.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter value in image properly");
		doc.captcha.focus();
		return false;
	}
}
function CheckWishfrom(){
	var doc,str,s;
	doc=document.wishfrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.your_email.value.length){
		alert("Please Enter Your Email");
		doc.your_email.focus();
		return false;
	}
	if(doc.your_email.value.indexOf('@')==-1 || doc.your_email.value.indexOf('.')==-1){
		alert("Please Enter Your Email Correctly");
		doc.your_email.value="";
		doc.your_email.focus();
		return false;
	}
	if(!doc.comment.value.length){
		alert("Please Enter Comment");
		doc.comment.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function Checkbirthday(){
	var doc,str,s;
	doc=document.birthdayfrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.birth_date.value.length){
		alert("Please Enter Birth Date");
		doc.birth_date.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function checkads(){
	var doc,str,s;
	doc=document.adsfrm;
	s=0;
	if(!doc.banner_StateID.value.length){
		alert("Please Select State Name");
		doc.banner_StateID.focus();
		return false;
	}
	if(!doc.banner_comp_name.value.length){
		alert("Please Enter Company Name");
		doc.banner_comp_name.focus();
		return false;
	}
	if(doc.banner_comp_name.value.length >0 && parseFloat(doc.banner_comp_name.value)){
		alert("Please Enter Alphabets only in Company Name");
		doc.banner_comp_name.value="";
		doc.banner_comp_name.focus();
		return false;
	}
	if(!doc.banner_comp_address.value.length){
		alert("Please Enter Address");
		doc.banner_comp_address.focus();
		return false;
	}
	if(!doc.banner_comp_phone.value.length){
		alert("Please Enter Phone");
		doc.banner_comp_phone.focus();
		return false;
	}
	if(doc.banner_comp_phone.value.length){
		if(!validphone(doc.banner_comp_phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			doc.banner_comp_phone.value="";
			doc.banner_comp_phone.focus();
			return false;
		}
	}
	if(!doc.banner_comp_email.value.length){
		alert("Please Enter Email");
		doc.banner_comp_email.focus();
		return false;
	}
	if(doc.banner_comp_email.value.indexOf('@')==-1 || doc.banner_comp_email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.banner_comp_email.value="";
		doc.banner_comp_email.focus();
		return false;
	}
	if(!doc.banner_url.value.length){
		alert("Please Enter Banner Url");
		doc.banner_url.focus();
		return false;
	}
	
	if(doc.banner_position.selectedIndex=="0"){
		alert("Please Select banner location");
		doc.banner_position.focus();
		return false;
	}
	
	if(doc.banner_position1.selectedIndex=="0"){
		alert("Please Select banner position");
		doc.banner_position1.focus();
		return false;
	}
	if(!doc.file_1.value.length){
		alert("Please Enter File 1");
		doc.file_1.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
	if(!doc.banner_cost.value.length){
		alert("Please Enter Banner Cost");
		doc.banner_cost.focus();
		return false;
	}
}
function validphone(txt){
	var str=/^[\+0-9][0-9_-]+\d$/;
	if(!str.test(txt)){ //+91-011-41428132
		return false;
	}
	else{
		return true;
	}
}
function checkEnquiry(){
	var doc,str,s;
	doc=document.enquiryfrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(doc.phone.value.length){
		if(!validphone(doc.phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			doc.phone.value="";
			doc.phone.focus();
			return false;
		}
	}
	if(!doc.requirement.value.length){
		alert("Please Enter Requirement");
		doc.requirement.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function checkeditfrom(){
	var doc,str,s;
	doc=document.Editorfrm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.city.value.length){
		alert("Please Enter City");
		doc.city.focus();
		return false;
	}
	if(doc.city.value.length >0 && parseFloat(doc.city.value)){
		alert("Please Enter Alphabets only in City");
		doc.city.value="";
		doc.city.focus();
		return false;
	}
	if(!doc.state.value.length){
		alert("Please Enter State");
		doc.state.focus();
		return false;
	}
	if(doc.state.value.length >0 && parseFloat(doc.state.value)){
		alert("Please Enter Alphabets only in State");
		doc.state.value="";
		doc.state.focus();
		return false;
	}
	if(!doc.edit_short_desc.value.length){
		alert("Please Enter Editorial");
		doc.edit_short_desc.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function checkguestbookfrom(){
	var doc,str,s;
	doc=document.guestForm;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.guest_short_desc.value.length){
		alert("Please Enter Comment");
		doc.guest_short_desc.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function CheckLog(){
	var doc,str,s;
	doc=document.LoginFrm;
	s=0;
	
	if(!doc.member_userid.value.length){
		alert("Please Enter Member Userid");
		doc.member_userid.focus();
		return false;
	}
	if(!doc.member_password.value.length){
		alert("Please Enter Member Password");
		doc.member_password.focus();
		return false;
	}
}
function checkRegister(){
	var doc,str,s;
	doc=document.Regsiterfrom;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.user_name.value.length){
		alert("Please Enter User Name");
		doc.user_name.focus();
		return false;
	}
	if(!doc.password.value.length){
		alert("Please Enter Password");
		doc.password.focus();
		return false;
	}
	if(!doc.confirm_password.value.length){
		alert("Please Enter Confirm Password");
		doc.confirm_password.focus();
		return false;
	}
	if(doc.password.value!=doc.confirm_password.value){
		alert("Please Enter Confirm Password Same as Password Field.");
		doc.password.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.phone.value.length){
		alert("Please Enter Phone");
		doc.phone.focus();
		return false;
	}
	if(doc.phone.value.length){
		if(!validphone(doc.phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			doc.phone.value="";
			doc.phone.focus();
			return false;
		}
	}
	if(!doc.address.value.length){
		alert("Please Enter Address");
		doc.address.focus();
		return false;
	}
	if(!doc.city.value.length){
		alert("Please Enter City");
		doc.city.focus();
		return false;
	}
	if(doc.city.value.length >0 && parseFloat(doc.city.value)){
		alert("Please Enter Alphabets only in Your City");
		doc.city.value="";
		doc.city.focus();
		return false;
	}
	if(!doc.state.value.length){
		alert("Please Enter State");
		doc.state.focus();
		return false;
	}
	if(doc.state.value.length >0 && parseFloat(doc.state.value)){
		alert("Please Enter Alphabets only in Your State");
		doc.state.value="";
		doc.state.focus();
		return false;
	}
	if(!doc.captcha.value.length){
	alert("Please Enter Captcha");
	doc.captcha.focus();
	return false;
	}
}


function validate_checkout_form() {
	var pb=document.checkout_form;
	
	if(!pb.contactPerson.value.length){
		alert("Please Enter Billing Contact Person Name");
		pb.contactPerson.focus();
		return false;
	}
	if(pb.contactPerson.value.length >0 && parseFloat(pb.contactPerson.value)){
		alert("Please Enter Alphabets only in Billing Contact Person Name");
		pb.contactPerson.value="";
		pb.contactPerson.focus();
		return false;
	}
	
	/*
	if(!pb.companyName.value.length){
		alert("Please Enter Billing Company Name");
		pb.companyName.focus();
		return false;
	}
	*/
	if(!pb.address.value.length){
		alert("Please Enter Billing Address");
		pb.address.focus();
		return false;
	}
	/*
	if(!pb.postCode.value.length){
		alert("Please Enter Billing Post Code");
		pb.postCode.focus();
		return false;
	}
	*/
	if(!pb.phone.value.length){
		alert("Please Enter Billing Phone");
		pb.phone.focus();
		return false;
	}	
	if(pb.phone.value.length){
		if(!validphone(pb.phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			pb.phone.value="";
			pb.phone.focus();
			return false;
		}
	}
	/*
	if(isNaN(pb.phone.value)){
		alert("Please Enter Numbers only in Phone");
		pb.phone.focus();
		return false;
	}
	
	if(pb.phone.value.length < 8){
		alert("Please Enter a Valid Phone Number");
		pb.phone.focus();
		return false;
	}
	*/
	if(!pb.city.value.length){
		alert("Please Enter Billing City");
		pb.city.focus();
		return false;
	}
	if(pb.city.value.length >0 && parseFloat(pb.city.value)){
		alert("Please Enter Alphabets only in Billing City");
		pb.city.value="";
		pb.city.focus();
		return false;
	}
	
	if(!pb.state.value.length){
		alert("Please Enter Billing State");
		pb.state.focus();
		return false;
	}
	if(pb.state.value.length >0 && parseFloat(pb.state.value)){
		alert("Please Enter Alphabets only in Billing State");
		pb.state.value="";
		pb.state.focus();
		return false;
	}
	/*
	if(!pb.country.value.length){
		alert("Please Enter Billing Country");
		pb.country.focus();
		return false;
	}
	*/
	if(!pb.contactPersonShip.value.length){
		alert("Please Enter Shipping Contact Person Name");
		pb.contactPersonShip.focus();
		return false;
	}
	if(pb.contactPersonShip.value.length >0 && parseFloat(pb.contactPersonShip.value)){
		alert("Please Enter Alphabets only in Shipping Contact Person Name");
		pb.contactPersonShip.value="";
		pb.contactPersonShip.focus();
		return false;
	}
	/*
	if(!pb.companyNameShip.value.length){
		alert("Please Enter Shipping Company Name");
		pb.companyNameShip.focus();
		return false;
	}
	*/
	if(!pb.addressShip.value.length){
		alert("Please Enter Shipping Address");
		pb.addressShip.focus();
		return false;
	}
	/*
	if(!pb.postCodeShip.value.length){
		alert("Please Enter Shipping Post Code");
		pb.postCodeShip.focus();
		return false;
	}
	*/
	if(!pb.phoneShip.value.length){
		alert("Please Enter Shipping Phone");
		pb.phoneShip.focus();
		return false;
	}
	if(pb.phoneShip.value.length){
		if(!validphone(pb.phoneShip.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			pb.phoneShip.value="";
			pb.phoneShip.focus();
			return false;
		}
	}
	
	if(!pb.cityShip.value.length){
		alert("Please Enter Shipping City");
		pb.cityShip.focus();
		return false;
	}
	if(pb.cityShip.value.length >0 && parseFloat(pb.cityShip.value)){
		alert("Please Enter Alphabets only in Shipping City");
		pb.cityShip.value="";
		pb.cityShip.focus();
		return false;
	}
	
	if(!pb.stateShip.value.length){
		alert("Please Enter Shipping State");
		pb.stateShip.focus();
		return false;
	}
	if(pb.stateShip.value.length >0 && parseFloat(pb.stateShip.value)){
		alert("Please Enter Alphabets only in Shipping State");
		pb.stateShip.value="";
		pb.stateShip.focus();
		return false;
	}
	/*
	if(!pb.countryShip.value.length){
		alert("Please Enter Shipping Country");
		pb.countryShip.focus();
		return false;
	}
	
	if(!pb.captcha.value.length){
		alert("Please Enter Captcha");
		pb.captcha.focus();
		return false;
	}
	*/
}


function checkUpdateRegister(){
	var doc,str,s;
	doc=document.Regsiterfrom;
	s=0;
	
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.phone.value.length){
		alert("Please Enter Phone");
		doc.phone.focus();
		return false;
	}
	if(doc.phone.value.length){
		if(!validphone(doc.phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			doc.phone.value="";
			doc.phone.focus();
			return false;
		}
	}
	if(!doc.address.value.length){
		alert("Please Enter Address");
		doc.address.focus();
		return false;
	}
	if(!doc.city.value.length){
		alert("Please Enter City");
		doc.city.focus();
		return false;
	}
	if(doc.city.value.length >0 && parseFloat(doc.city.value)){
		alert("Please Enter Alphabets only in Your City");
		doc.city.value="";
		doc.city.focus();
		return false;
	}
	if(!doc.state.value.length){
		alert("Please Enter State");
		doc.state.focus();
		return false;
	}
	if(doc.state.value.length >0 && parseFloat(doc.state.value)){
		alert("Please Enter Alphabets only in Your State");
		doc.state.value="";
		doc.state.focus();
		return false;
	}
	if(!doc.captcha.value.length){
	alert("Please Enter Captcha");
	doc.captcha.focus();
	return false;
	}
}
function Checkpass(){
	var doc,str,s;
	doc=document.changePass;
	s=0;
	
	if(!doc.old_password.value.length){
		alert("Please Enter Old Password");
		doc.old_password.focus();
		return false;
	}
	if(!doc.new_password.value.length){
		alert("Please Enter New Password");
		doc.new_password.focus();
		return false;
	}
	if(!doc.new_confirm_password.value.length){
		alert("Please Enter New Confirm Password");
		doc.new_confirm_password.focus();
		return false;
	}
	if(doc.new_confirm_password.value!=doc.new_password.value){
		alert("Please Enter Confirm Password Same As New Password.");
		doc.new_confirm_password.focus();
		return false;
	}
}
function Checkpass(){
	var doc,str,s;
	doc=document.changePass;
	s=0;
	
	if(!doc.old_password.value.length){
		alert("Please Enter Old Password");
		doc.old_password.focus();
		return false;
	}
	if(!doc.new_password.value.length){
		alert("Please Enter New Password");
		doc.new_password.focus();
		return false;
	}
	if(!doc.new_confirm_password.value.length){
		alert("Please Enter New Confirm Password");
		doc.new_confirm_password.focus();
		return false;
	}
	if(doc.new_confirm_password.value!=doc.new_password.value){
		alert("Please Enter Confirm Password Same As New Password.");
		doc.new_confirm_password.focus();
		return false;
	}
}
function Checkforgetpass(){
	var doc,str,s;
	doc=document.forgetPass;
	s=0;
	
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;	
	}
	if(!doc.user_name.value.length){
		alert("Please Enter User Name");
		doc.user_name.focus();
		return false;
	}
}
function CheckpostAd(){
	var doc,str,s;
	doc=document.postadfrm;
	s=0;
	if(!doc.ads_parentID.value.length){
		alert("Please Select Classified Category");
		doc.ads_parentID.focus();
		return false;
	}
	if(doc.ads_parentID.value=="M"){
		alert("Please Select Sub Category Of any Main Catgory");
		doc.ads_parentID.focus();
		return false;
	}
	if(!doc.classified_title.value.length){
		alert("Please Enter Classified Title");
		doc.classified_title.focus();
		return false;
	}
	if(!doc.file_1.value.length && doc.AdImage.value=="N"){
		alert("Please Enter Image");
		doc.file_1.focus();
		return false;
	}
	if(!doc.short_description.value.length){
		alert("Please Enter Short Description");
		doc.short_description.focus();
		return false;
	}
	if(!doc.description.value.length){
		alert("Please Enter Description");
		doc.description.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function Checkpostdir(){
	var doc,str,s;
	doc=document.postdirfrm;
	s=0;
	
	if(!doc.industry.value.length){
		alert("Please Enter Industry");
		doc.industry.focus();
		return false;
	}
	if(!doc.company_name.value.length){
		alert("Please Enter Company Name");
		doc.company_name.focus();
		return false;
	}
	if(doc.company_name.value.length >0 && parseFloat(doc.company_name.value)){
		alert("Please Enter Alphabets only in Company Name");
		doc.company_name.value="";
		doc.company_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.address.value.length){
		alert("Please Enter Address");
		doc.address.focus();
		return false;
	}
	if(!doc.state.value.length){
		alert("Please Enter State");
		doc.state.focus();
		return false;
	}
	if(!doc.phone.value.length){
		alert("Please Enter Phone");
		doc.phone.focus();
		return false;
	}
	if(doc.phone.value.length){
		if(!validphone(doc.phone.value)){
			alert("Please Enter Phone in 000-000-0000 Format");
			doc.phone.value="";
			doc.phone.focus();
			return false;
		}
	}
	if(doc.fax.value.length){
		if(!validphone(doc.fax.value)){
			alert("Please Enter Fax in 000-000-0000 Format");
			doc.fax.value="";
			doc.fax.focus();
			return false;
		}
	}
	if(!doc.website_URL.value.length){
		alert("Please Enter Website URL");
		doc.website_URL.focus();
		return false;
	}
	if(!doc.services.value.length){
		alert("Please Enter Services");
		doc.services.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function checkReply(){
	var doc,str,s;
	doc=document.replyfrm;
	s=0;
	
	if(!doc.message.value.length){
		alert("Please Enter Message");
		doc.message.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}
function checknews(){
	var doc,str,s;
	doc=document.Newsfrm;
	s=0;
	if(!doc.news_StateID.value.length){
		alert("Please Select News State Name");
		doc.news_StateID.focus();
		return false;
	}
	if(!doc.news_category.value.length){
		alert("Please Select News Category");
		doc.news_category.focus();
		return false;
	}
	if(!doc.your_name.value.length){
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(doc.your_name.value.length >0 && parseFloat(doc.your_name.value)){
		alert("Please Enter Alphabets only in Your Name");
		doc.your_name.value="";
		doc.your_name.focus();
		return false;
	}
	if(!doc.email.value.length){
		alert("Please Enter Email");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Email Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(!doc.address.value.length){
		alert("Please Enter Address");
		doc.address.focus();
		return false;
	}
	if(!doc.city.value.length){
		alert("Please Enter City");
		doc.city.focus();
		return false;
	}
	if(doc.city.value.length >0 && parseFloat(doc.city.value)){
		alert("Please Enter Alphabets only in City");
		doc.city.value="";
		doc.city.focus();
		return false;
	}
	if(!doc.state.value.length){
		alert("Please Enter State");
		doc.state.focus();
		return false;
	}
	if(doc.state.value.length >0 && parseFloat(doc.state.value)){
		alert("Please Enter Alphabets only in State");
		doc.state.value="";
		doc.state.focus();
		return false;
	}
	if(!doc.news_category.value.length){
		alert("Please Enter News Category");
		doc.news_category.focus();
		return false;
	}
	if(!doc.news_title.value.length){
		alert("Please Enter News Title");
		doc.news_title.focus();
		return false;
	}
	if(!doc.file_1.value.length){
		alert("Please Enter News Image");
		doc.file_1.focus();
		return false;
	}
	if(!doc.news_date.value.length){
		alert("Please Enter News Date");
		doc.news_date.focus();
		return false;
	}
	if(!doc.short_description.value.length){
		alert("Please Enter Short Description");
		doc.short_description.focus();
		return false;
	}
	if(!doc.description.value.length){
		alert("Please Enter Description");
		doc.description.focus();
		return false;
	}
	if(!doc.captcha.value.length){
		alert("Please Enter Captcha");
		doc.captcha.focus();
		return false;
	}
}

function filldata() {
	var pb=document.checkout_form;
  if(pb.chk.checked==1) {
	  pb.contactPersonShip.value=pb.contactPerson.value;
	  pb.companyNameShip.value=pb.companyName.value;
	  pb.addressShip.value=pb.address.value;
	  pb.phoneShip.value=pb.phone.value;
	  pb.postCodeShip.value=pb.postCode.value;
	  pb.cityShip.value=pb.city.value;	  
	  pb.stateShip.value=pb.state.value;
  }
  else{
	  pb.contactPersonShip.value="";
	  pb.companyNameShip.value="";
	  pb.addressShip.value="";
	  pb.phoneShip.value="";
	  pb.postCodeShip.value="";
	  pb.cityShip.value="";	  
	  pb.stateShip.value="";
  }
}

function validate_listing_form() {
	var pb=document.listing_form;
	if (pb.companyName.value==0) {
		alert("Company Name is Must");
		pb.companyName.focus();
		return false;
	}
	
	var name_check = /^([a-zA-Z\s])+([\s])*([a-zA-Z\s])*$/;
	if (pb.contactPerson.value==0) {
		alert("Contact Person Name  is Must.");
		pb.contactPerson.value="";
		pb.contactPerson.focus();
		return false;						
	}
	if(!name_check.test(pb.contactPerson.value)) {
		alert("Contact Person Name should be in Alphabets Only");
		pb.contactPerson.focus();
		return false;
	}
	
	var email_check = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if((pb.email.value.length >= 0) && (!email_check.test(pb.email.value))) {
		alert("Please enter a valid Email ID");
		pb.email.focus();
		return false;
	}
	
	if (pb.phone.value==0) {
		alert("Please Enter Your Phone Number");
		pb.phone.focus();
		return false;
	}
	
	if (pb.address.value==0) {
		alert("Please Enter Your Address");
		pb.address.focus();
		return false;
	}
	
	if (pb.listingState.options[pb.listingState.selectedIndex].value=="") {
		alert("State is must");
		pb.listingState.focus();
		return false;
	}
	
	if (pb.listingCity.options[pb.listingCity.selectedIndex].value=="") {
		alert("City is must");
		pb.listingCity.focus();
		return false;
	}
	
	if (pb.mainCategory.options[pb.mainCategory.selectedIndex].value=="") {
		alert("Listing Category is must");
		pb.mainCategory.focus();
		return false;
	}
	
	var pkb=0;
	var len=pb.listingCategories.length;
	
	if (!len) {
		if (!pb.listingCategories.checked) {
			alert("Please check atleaset one Listing Categories");
			pb.listingCategories.focus();
			return false;
		}
	}
	else {
		for (var i=0; i < len; i++) {
			if (pb.listingCategories[i].checked) {
				pkb=1;
				break;
			}
		}
		if (pkb == 0) {
			alert("Please check atleaset one Listing Categories");
			pb.listingCategories[0].focus();
			return false;
		}
	}
	
	if (pb.video.value != 0) {
		if ((pb.video.value.lastIndexOf('.mov')==-1) && (pb.video.value.lastIndexOf('.mpg')==-1) && (pb.video.value.lastIndexOf('.mpeg')==-1) && (pb.video.value.lastIndexOf('.wmv')==-1) && (pb.video.value.lastIndexOf('.aac')==-1) && (pb.video.value.lastIndexOf('.mp4')==-1) && (pb.video.value.lastIndexOf('.mp3')==-1) && (pb.video.value.lastIndexOf('.dat')==-1)) {
			alert('You May Only Upload .mov, .mpg, .mpeg, .wmv, .aac, .mp4, .mp3, .dat Files');
			pb.video.focus();
			return false;
		}
	}
	
	if (pb.video.value != 0 && pb.youtubeLink.value != 0) {
		alert('Please either upload a video or enter youtube URL');
		pb.youtubeLink.focus();
		return false;
	}
}