function admin_add_user()
{


	//alert();
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.email.value);
		var str=formName.email.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, \/ ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		var mailregion = document.getElementById('mailregion').selectedIndex;
		//alert(formName.user_type.value);
		
		if(formName.user_type.value==0)
		{
			alert(USERTYPE);
			formName.user_type.focus();
			return false;
		}
		
		if(formName.first_name.value=='')
		{
			alert(FIRSTNAME);
			formName.first_name.focus();
			return false;
		}
		if(formName.first_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEFIRSTNAME);
		formName.first_name.value= "";
		formName.first_name.focus();
		return false;
		}
		if(!formName.first_name.value.match(reg_exp_char))
		{
			alert(VAILDFIRSTNAME);
			formName.first_name.value= "";
			formName.first_name.focus();
			return false;
		}
		
		if(formName.last_name.value=='')
		{
			alert(LASTNAME);
			formName.last_name.focus();
			return false;
		}
		if(formName.last_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACELASTNAME);
		formName.last_name.value= "";
		formName.last_name.focus();
		return false;
		}
		if(!formName.last_name.value.match(reg_exp_char))
		{
			alert(VAIDLASTNAME);
			formName.last_name.value= "";
			formName.last_name.focus();
			return false;
		}
		if(formName.email.value=='')
		{
			alert(EMAIL);
			formName.email.focus();
			return false;
		}
		if(formName.email.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.email.select();
			return false;
		}	
		if(formName.pwd.value=='')
		{   
			alert(PASSWORD);
			formName.pwd.focus();
			return false;
		}
		if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}
		
		if(formName.user_type.value==1 &&(mailregion==-1 || mailregion==0))
		{
			alert(MARKET_MAILREGIONNAME);
			return false;
		}
		if(formName.address.value=='')
		{
			alert(ADDRESS);
			formName.address.focus();
			return false;
		}
		/*if(!formName.address.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.address.value= "";
			formName.address.focus();
			return false;
		}*/
		if((formName.contact_no.value=='') && (formName.office_contact_no.value==''))
		{
			alert(USERCONTACTNUMBER);
			formName.contact_no.focus();
			return false;
		}
		if(formName.contact_no.value!='')
		{
			if(!formName.contact_no.value.match(zip_code))
			{
			alert(VALIDMOBILEPHONE);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
			else if(formName.contact_no.value.length < 8)
			{
			alert(VAILDMOBILEPHONELENGTH);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
		}
		if(formName.office_contact_no.value!='')
		{
			if(!formName.office_contact_no.value.match(zip_code))
			{
			alert(VALIDOFFICEPHONE);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
			else if(formName.office_contact_no.value.length < 8)
			{
			alert(VAILDOFFICEPHONELENGTH);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
		}
		



}





function admin_mod_user()
{
	//alert();
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.email.value);
		var str=formName.email.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		var mailregion = document.getElementById('mailregion').selectedIndex;
		
		if(formName.user_type.value=='')
		{
			alert(USERTYPE);
			formName.user_type.focus();
			return false;
		}
		if(formName.first_name.value=='')
		{
			alert(FIRSTNAME);
			formName.first_name.focus();
			return false;
		}
		
		if(formName.first_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEFIRSTNAME);
		formName.first_name.value= "";
		formName.first_name.focus();
		return false;
		}
		if(!formName.first_name.value.match(reg_exp_char))
		{
			alert(VAILDFIRSTNAME);
			formName.first_name.focus();
			return false;
		}

		if(formName.last_name.value=='')
		{
			alert(LASTNAME);
			formName.last_name.focus();
			return false;
		}
		if(formName.last_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACELASTNAME);
		formName.last_name.value= "";
		formName.last_name.focus();
		return false;
		}
		if(!formName.last_name.value.match(reg_exp_char))
		{
			alert(VAIDLASTNAME);
			formName.last_name.focus();
			return false;
		}				

		if(formName.email.value=='')
		{
			alert(EMAIL);
			formName.email.select();
			return false;
		}
		if(formName.email.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.email.focus();
			return false;
		}	

		if(formName.pwd.value=='')
		{   
			alert(PASSWORD);
			formName.pwd.focus();
			return false;
		}
		if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}

	    if(formName.user_type.value==1 &&(mailregion==-1 || mailregion==0))
		{
			alert(MARKET_MAILREGIONNAME);
			return false;
		}
		if(formName.address.value=='')
		{
			alert(ADDRESS);
			formName.address.focus();
			return false;
		}
		if(!formName.address.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.address.value= "";
			formName.address.focus();
			return false;
		}
  		if((formName.contact_no.value=='') && (formName.office_contact_no.value==''))
		{
			alert(USERCONTACTNUMBER);
			formName.contact_no.focus();
			return false;
		}
		if(formName.contact_no.value!='')
		{
			if(!formName.contact_no.value.match(zip_code))
			{
			alert(VALIDMOBILEPHONE);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
			else if(formName.contact_no.value.length < 8)
			{
			alert(VAILDMOBILEPHONELENGTH);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
		}
		if(formName.office_contact_no.value!='')
		{
			if(!formName.office_contact_no.value.match(zip_code))
			{
			alert(VALIDOFFICEPHONE);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
			else if(formName.office_contact_no.value.length < 8)
			{
			alert(VAILDOFFICEPHONELENGTH);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
		}
		
		
}






function admin_add_designer()
{
		var id1=document.getElementById('desired_res1').checked;
		var id2=document.getElementById('desired_res2').checked;
	//alert();
		var formName=document.frm;
		
		if(formName.designer_id.value=='')
		{
			alert(ADDDESIGNER);
			formName.designer_id.focus();
			return false;
		}
		
}


function admin_search_project()
{
	//alert();
	var zip_code=/^[0-9,+,-]+$/;
		var formName=document.frm;
		
		if(!formName.upload_date.value.match(zip_code))
		{
			alert(SEARCHADMIN);
			formName.upload_date.value= "";
			formName.upload_date.focus();
			return false;
		}
		
}



function admin_change_password()
{
	//alert();
		var formName=document.frm;
		
		if(formName.opwd.value=='')
		{   
			alert(OLDPASSWORD);
			formName.opwd.focus();
			return false;
		}
		else if(formName.pwd.value=='')
		{   
			alert(NEWPASSWORD);
			formName.pwd.focus();
			return false;
		}
		else if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}
		else if(formName.conpwd.value=='')
		{   
			alert(CONFIRMPASSWORD);
			formName.conpwd.focus();
			return false;
		}
		else if(formName.conpwd.value.length < 6)
		{
			alert(MATCHPASSWORD);
			formName.conpwd.value= "";
			formName.conpwd.focus();
			return false;
		}
		else if(formName.pwd.value!=formName.conpwd.value)
		{
			alert(MATCHPASSWORD);
			formName.conpwd.value= "";
			formName.conpwd.focus();
			return false;
		}
		
}


function admin_upload_proof()
{
	var formName=document.frm;
		var front      = document.frm.img_upload_front.value;
		var len        = front.length;
		var sub_front  = front.lastIndexOf('.');
		var ext_front  = front.substring(sub_front,len);
		
		var backend      = document.frm.img_upload_back.value;
		var len2        = backend.length;
		var sub_back  = backend.lastIndexOf('.');
		var ext_back  = backend.substring(sub_back,len2);
		
		var overrun      = document.frm.img_upload_overrun.value;
		var len3        = overrun.length;
		var sub_overrun  = overrun.lastIndexOf('.');
		var ext_overrun  = overrun.substring(sub_overrun,len3);
		
		if(formName.img_upload_front.value=='')
		{
			alert('Please upload front!!');
			formName.img_upload_front.focus();
			return false;
		}
		else if(formName.img_upload_front.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEUPLOADPROOF);
		formName.img_upload_front.select();
		return false;
		}
		else if(formName.img_upload_back.value=='')
		{
			alert('Please upload back!!');
			formName.img_upload_back.focus();
			return false;
		}
		else if(formName.img_upload_back.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEUPLOADPROOF);
		formName.img_upload_back.select();
		return false;
		}
		else if(formName.img_upload_overrun.value!='')
		{
			if(formName.img_upload_overrun.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPROOF);
			formName.img_upload_overrun.select();
			return false;
			}
			
		}
		
		
}

function coordinator_add_client()
{
	//	alert('aaa');
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.clientemail.value);
		var str=formName.clientemail.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_nm=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		


		var mailregion_n = document.getElementById('mailregion_n').selectedIndex;

		var postcard_back_n = document.getElementById('postcard_back_n').selectedIndex;
		
    	//var franchise_id_n = document.getElementById('franchise_id_n').selectedIndex;
        var market_id = document.getElementById('market_id_n').selectedIndex;

		var month_id = document.getElementById('month_id_n').selectedIndex;
        

	
	//	var mailregion = document.getElementById('mailregion').selectedIndex;

		if(formName.clientemail.value=='')
		{
			alert(EMAIL);
			formName.clientemail.focus();
			return false;
		}
		else if(formName.clientemail.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.clientemail.select();
			return false;
		}	


		else if(document.getElementById('radio_client').value==0)
		{
		 if(formName.company_n.value=='')
		{
			alert(COMPANYNAME);
			formName.company_n.focus();
			return false;
		}
		
	
		else if(formName.company_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!isNaN(formName.company_n.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!formName.company_n.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company_n.value= "";
			formName.company_n.focus();
			return false;
		}
		
		/*else if(formName.website_n.value=='')
		{   
			alert(WEBSITE);
			formName.website_n.focus();
			return false;
		}*/
		else if(formName.website_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website_n.value= "";
		formName.website_n.focus();
		return false;
		}
		
		/*else if((formName.website_n.value.substr(0,4)!='www.') && (formName.website_n.value.substr(0,4)!='WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website_n.select();
		return false;
		}
		*/
		else if(formName.clientname_n.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname_n.focus();
			return false;
		}
		else if(formName.clientname_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname_n.value= "";
		formName.clientname_n.focus();
		return false;
		}
		else if(!formName.clientname_n.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname_n.value= "";
			formName.clientname_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone_n.focus();
			return false;
		}
		else if(!formName.clientphone_n.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		else if(formName.category_n.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category_n.focus();
			return false;
		}

		else if(formName.category_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category_n.value= "";
		formName.category_n.focus();
		return false;
		}
		/*else if(postcard_back_n==-1 || postcard_back_n==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back_n.focus();
			return false;
		}*/
		else if(month_id==-1 || month_id==0)
		{
			alert(MONTH);
			formName.month_id_n.focus();
			return false;
		}
		else if(market_id==-1 || market_id==0)
		{
			alert(MARKET_MAILREGIONNAME);
			formName.market_id_n.focus();
			return false;
		}
			
       else if(mailregion_n==-1 || mailregion_n==0)
		{
			alert(EDITIONNAME);
			formName.mailregion_n.focus();
			return false;
		}
		else if(formName.quantity_n.value!='' && !formName.quantity_n.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity_n.value= "";
			formName.quantity_n.focus();
			return false;
		}
		return true;
		
 }
else if(document.getElementById('radio_client').value==1)
{
//alert('aa');
	//var postcard_back = document.getElementById('postcard_back').selectedIndex;

    var market_id_chk_db = document.getElementById('market_id_db').selectedIndex;
	
	
	var month_id_chk_db = document.getElementById('month_id_db').selectedIndex;
	
    var mailregion1 = document.getElementById('mailregion_n').value;
	
	//alert(mailregion1);

	if(formName.company.value=='')
		{
			alert(COMPANYNAME);
			formName.company.focus();
			return false;
		}
		
		else if(formName.company.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!isNaN(formName.company.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!formName.company.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company.value= "";
			formName.company.focus();
			return false;
		}
		
		else if(formName.website.value=='')
		{   
			alert(WEBSITE);
			formName.website.focus();
			return false;
		}
		
		
		else if(formName.website.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if((formName.website.value.substr(0,11)!='http://www.') && (formName.website.value.substr(0,12)!='https://www.') && (formName.website.value.substr(0,11)!='HTTP://WWW.') && (formName.website.value.substr(0,12)!='HTTPS://WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if(formName.clientname.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientname.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname.value= "";
		formName.clientname.focus();
		return false;
		}
		else if(!formName.clientname.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname.value= "";
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientphone.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone.focus();
			return false;
		}
		else if(!formName.clientphone.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.clientphone.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.category.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category.focus();
			return false;
		}
		else if(formName.category.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category.value= "";
		formName.category.focus();
		return false;
		}
//alert('postcard_back'+postcard_back);
		
/*else if(postcard_back==-1 || postcard_back==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back.focus();
			return false;
		}*/
else if(month_id_chk_db==0)
		{
			alert(MONTH);

			formName.month_id_db.focus();
			return false;
		}
		 else if(market_id_chk_db==0)
		{
			alert(MARKET_MAILREGIONNAME);
			formName.market_id_db.focus();
			return false;
		}
  else if(mailregion1==0)
		{
			alert(EDITIONNAME);
			return false;
		}
		else if(formName.quantity.value!='' && !formName.quantity.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity.value= "";
			formName.quantity.focus();
			return false;
		}
		return true;
		
	}
		


}

function franchise_add_client()
{
	//  alert(document.getElementById('radio_client').value+'sds');
	  //alert(document.getElementById('client1').checked+'sds');

		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.clientemail.value);
		var str=formName.clientemail.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_nm=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		


		var mailregion_n = document.getElementById('mailregion_n').selectedIndex;
        var month_n = document.getElementById('month_id_n').selectedIndex;

		var postcard_back_n = document.getElementById('postcard_back_n').selectedIndex;

	//	var mailregion = document.getElementById('mailregion').selectedIndex;

		if(formName.clientemail.value=='')
		{
			alert(EMAIL);
			formName.clientemail.focus();
			return false;
		}
		else if(formName.clientemail.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.clientemail.select();
			return false;
		}

			else if(document.getElementById('radio_client').value==0)
{
		
		 if(formName.company_n.value=='')
		{
			alert(COMPANYNAME);
			formName.company_n.focus();
			return false;
		}
		
	
		else if(formName.company_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!isNaN(formName.company_n.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!formName.company_n.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company_n.value= "";
			formName.company_n.focus();
			return false;
		}
				
		else if(formName.website_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website_n.value= "";
		formName.website_n.focus();
		return false;
		}
		/*
		else if((formName.website_n.value.substr(0,4)!='www.') && (formName.website_n.value.substr(0,4)!='WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website_n.select();
		return false;
		}*/
		
		else if(formName.clientname_n.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname_n.focus();
			return false;
		}
		else if(formName.clientname_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname_n.value= "";
		formName.clientname_n.focus();
		return false;
		}
		else if(!formName.clientname_n.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname_n.value= "";
			formName.clientname_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone_n.focus();
			return false;
		}
		else if(!formName.clientphone_n.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
	else if(formName.category_n.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category_n.focus();
			return false;
		}
		else if(formName.category_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category_n.value= "";
		formName.category_n.focus();
		return false;
		}
		
		/*else if(postcard_back_n==-1 || postcard_back_n==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back_n.focus();
			return false;
		}*/
	 else if(month_n==-1 || month_n==0)
		{
			alert(MONTH);
			formName.month_id_n.focus();
			return false;
		}
       else if(mailregion_n==-1 || mailregion_n==0)
		{
			alert(EDITIONNAME);
			formName.mailregion_n.focus();
			return false;
		}
		else if(formName.quantity_n.value!='' && !formName.quantity_n.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity_n.value= "";
			formName.quantity_n.focus();
			return false;
		}
		else 
		return true;
		
		
 }
 
else if(document.getElementById('radio_client').value==1)
{
	var postcard_back = document.getElementById('postcard_back').selectedIndex;

	var mailregion = document.getElementById('mailregion').selectedIndex;
	var month_1 = document.getElementById('month_id').selectedIndex;


	if(formName.company.value=='')
		{
			alert(COMPANYNAME);
			formName.company.focus();
			return false;
		}
		
		else if(formName.company.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!isNaN(formName.company.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!formName.company.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company.value= "";
			formName.company.focus();
			return false;
		}
		
		else if(formName.website.value=='')
		{   
			alert(WEBSITE);
			formName.website.focus();
			return false;
		}
		
		
		else if(formName.website.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if((formName.website.value.substr(0,11)!='http://www.') && (formName.website.value.substr(0,12)!='https://www.') && (formName.website.value.substr(0,11)!='HTTP://WWW.') && (formName.website.value.substr(0,12)!='HTTPS://WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if(formName.clientname.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientname.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname.value= "";
		formName.clientname.focus();
		return false;
		}
		else if(!formName.clientname.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname.value= "";
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientphone.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone.focus();
			return false;
		}
		else if(!formName.clientphone.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.clientphone.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.category.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category.focus();
			return false;
		}
		else if(formName.category.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category.value= "";
		formName.category.focus();
		return false;
		}
		/*else if(postcard_back==-1 || postcard_back==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back.focus();
			return false;
		}*/
 else if(month_1==-1 || month_1==0)
		{
			alert(MONTH);
			formName.month_id.focus();
			return false;
		}

    else if(mailregion==-1 || mailregion==0)
		{
			alert(EDITIONNAME);
			formName.mailregion.focus();
			return false;
		}
		else if(formName.quantity.value!='' && !formName.quantity.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity.value= "";
			formName.quantity.focus();
			return false;
		}
 		else 
		return true;
			
	}
		

}



function designer_upload_proof()
{
	var formName=document.frm;
		var front      = document.frm.img_upload_front.value;
		var len        = front.length;
		var sub_front  = front.lastIndexOf('.');
		var ext_front  = front.substring(sub_front,len);
		
		var backend      = document.frm.img_upload_back.value;
		var len2        = backend.length;
		var sub_back  = backend.lastIndexOf('.');
		var ext_back  = backend.substring(sub_back,len2);
		
		var overrun      = document.frm.img_upload_overrun.value;
		var len3        = overrun.length;
		var sub_overrun  = overrun.lastIndexOf('.');
		var ext_overrun  = overrun.substring(sub_overrun,len3);
		
		if(formName.img_upload_front.value=='')
		{
			alert('Please upload front!!');
			formName.img_upload_front.focus();
			return false;
		}
		else if(formName.img_upload_front.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEUPLOADPROOF);
		formName.img_upload_front.select();
		return false;
		}
		
		else if(formName.img_upload_back.value=='')
		{
			alert('Please upload back!!');
			formName.img_upload_back.focus();
			return false;
		}
		else if(formName.img_upload_back.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEUPLOADPROOF);
		formName.img_upload_back.select();
		return false;
		}
		
		else if(formName.img_upload_overrun.value!='')
		{
			if(formName.img_upload_overrun.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPROOF);
			formName.img_upload_overrun.select();
			return false;
			}
			
		}
		
		
}

function client_add_project_mod(today_date,photo_thumb_par,logo_thumb_par,art_file_path_th_par,brochure_path_th_par,template_path_th_par)
{
		var formName=document.frm;
		var id1=document.getElementById('desired_res1').checked;
		var id2=document.getElementById('desired_res2').checked;
	
			if(id1== true || id2== true){
				if( id1== true && formName.website.value==""){
				alert("Please enter the url");
				return false;}
				if( id2== true && formName.phone_no.value==""){
				alert("Please enter the phone no");
				return false;}
			  }		
		
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		
		var expr_date = formName.offer_expiration_year.value+'-'+formName.offer_expiration_month.value+'-'+formName.offer_expiration_day.value;
		var todaydate = today_date;
		
		var desired_res = document.getElementById('desired_res').checked;
		var art_for_postcard = document.getElementById('art_for_postcard').checked;
		var offer_details_chk = document.getElementById('offer_details_chk').checked;
		
		if(formName.describe_changes.value!='')
		{
		if(formName.describe_changes.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECDESCRIBECHANGES);
		formName.describe_changes.value= "";
		formName.describe_changes.focus();
		return false;
		}
		}
		
		if(formName.line_of_business.value!='')
		{
		if(formName.line_of_business.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLINEBUSINESS);
		formName.line_of_business.value= "";
		formName.line_of_business.focus();
		return false;
		}}
		if(formName.pro_ser_offer.value!='')
		{
		if(formName.pro_ser_offer.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECPRODUCTOFFER);
		formName.pro_ser_offer.value= "";
		formName.pro_ser_offer.focus();
		return false;
		}
    }
		if(formName.strongest_benefit.value!='')
			{				if(formName.strongest_benefit.value.charAt(0)==' ')
					{
				alert(INVALIDSPACECSTRONGESTOFFER);
				formName.strongest_benefit.value= "";
				formName.strongest_benefit.focus();
				return false;
				}
		}
		if(formName.most_compell_offer.value!='')
		{   
			
	
		if(formName.most_compell_offer.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECCOMPELLOFFER);
		formName.most_compell_offer.value= "";
		formName.most_compell_offer.focus();
		return false;
		}
	}
	
		
		if((formName.offer_details.value!='') && (formName.offer_details.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECOFFERDETAILS);
		formName.offer_details.value= "";
		formName.offer_details.focus();
		return false;
		}
		if((formName.pro_ser_benefits.value!='') && (formName.pro_ser_benefits.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECSERVICEBENEFITS);
		formName.pro_ser_benefits.value= "";
		formName.pro_ser_benefits.focus();
		return false;
		}
		if(formName.bus_add.value!='')
		{
		if(formName.bus_add.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECBUSINESSADDRESS);
		formName.bus_add.value= "";
		formName.bus_add.focus();
		return false;
		}
		else if(!formName.bus_add.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.bus_add.value= "";
			formName.bus_add.focus();
			return false;
		}
		}
		if((formName.cart_to_act.value!='') && (formName.cart_to_act.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECCARTTOACT);
		formName.cart_to_act.value= "";
		formName.cart_to_act.focus();
		return false;
		}
		//if(formName.ch[0].checked==true && photo_thumb_par=='')
					if(formName.customer_support_photo.value!='')
		{
			var path1      = document.frm.customer_support_photo.value;
			var len1        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path1   = path1.substring(sub_path1,len1);
			
			
			 if(formName.customer_support_photo.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERSUPPORTPHOTO);
			formName.customer_support_photo.select();
			return false;
			}
			else if(ext_path1!='.jpg' && ext_path1!='.jpeg' && ext_path1!='.JPG' && ext_path1!='.JPEG'&&  ext_path1!='.TIF'  && ext_path1!='.TIFF' && ext_path1!='.tiff' && ext_path1!='.tif'  )
			{
			alert("Upload customer supplied  photo in .jpg, .tiff files only");
			formName.customer_support_photo.select();
			return false;
			}
			
		}
		
			if(formName.customer_support_photo1.value!='')
			{
				var path1      = document.frm.customer_support_photo1.value;
			var len1        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path1   = path1.substring(sub_path1,len1);
			
			
			 if(formName.customer_support_photo1.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERSUPPORTPHOTO);
			formName.customer_support_photo1.select();
			return false;
			}
			else if(ext_path1!='.jpg' && ext_path1!='.JPG' && ext_path1!='.JPEG' && ext_path1!='.TIF'  && ext_path1!='.TIFF' && ext_path1!='.tiff' && ext_path1!='.tif')
			{
			alert("Upload customer support photo in .jpg, .tiff files only");
			formName.customer_support_photo1.select();
			return false;
			}
			
		
		
		}


			if(formName.customer_logo.value!='')
		{
			var path3      = document.frm.customer_logo.value;
			var len3        = path3.length;
			var sub_path3  = path3.lastIndexOf('.');
			var ext_path3   = path3.substring(sub_path3,len3);
			
			
			 if(formName.customer_logo.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERLOGO);
			formName.customer_logo.select();
			return false;
			}
			
        else if(ext_path3!='.eps' && ext_path3!='.EPS' &&  ext_path3!='.jpg' && ext_path3!='.JPG' && ext_path3!='.JPEG' && ext_path3!='.TIF'  && ext_path3!='.TIFF' && ext_path3!='.tiff' && ext_path3!='.tif')
		{
		alert("Upload customer logo in .jpg, .eps, .tiff files only");
		formName.customer_logo.select();
		return false;
			}
			
		
}
		
	
	if((formName.photo_ins.value!='') && (formName.photo_ins.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECPHOTOINSTRUCTION);
		formName.photo_ins.value= "";
		formName.photo_ins.focus();
		return false;
		}
		
		//if(formName.ch2[0].checked==true && art_file_path_th_par=='')
	
			if(document.frm.art_file_path.value!='')
		{

			var path5      = document.frm.art_file_path.value;
			var len5        = path5.length;
			var sub_path5  = path5.lastIndexOf('.');
			var ext_path5   = path5.substring(sub_path5,len5);
			
			
			if(formName.art_file_path.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEARTFILEPATH);
			formName.art_file_path.select();
			return false;
			}
			else if(ext_path5!='.jpg' && ext_path5!='.gif' && ext_path5!='.png' && ext_path5!='.PNG' && ext_path5!='.JPG' && ext_path5!='.GIF' )
			{
			alert("Upload art file in .jpg, .gif, .png files only");
			formName.art_file_path.select();
			return false;
			}
			
		}	
if(document.frm.art_file_path1.value!='')
		{

			var path5      = document.frm.art_file_path1.value;
			var len5        = path5.length;
			var sub_path5  = path5.lastIndexOf('.');
			var ext_path5   = path5.substring(sub_path5,len5);
			
			
			if(formName.art_file_path1.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEARTFILEPATH);
			formName.art_file_path1.select();
			return false;
			}
			else if(ext_path5!='.jpg' && ext_path5!='.gif' && ext_path5!='.png' && ext_path5!='.PNG' && ext_path5!='.JPG' && ext_path5!='.GIF' )
			{
			alert("Upload art file in .jpg, .gif, .png files only");
			formName.art_file_path1.select();
			return false;
			}
			
		}
		
		
					if(formName.brochure_path.value!='')
		{
			var path7      = document.frm.brochure_path.value;
			var len7        = path7.length;
			var sub_path7  = path7.lastIndexOf('.');
			var ext_path7   = path7.substring(sub_path7,len7);
			
			
			 if(formName.brochure_path.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEBROCHUREPATH);
			formName.brochure_path.select();
			return false;
			}
			else if(ext_path7!='.pdf' && ext_path7!='.PDF' && ext_path7!='.jpg' && ext_path7!='.jpeg' && ext_path7!='.JPEG' && ext_path7!='.JPG')
			{
			alert("Upload brochure in .pdf,.jpg file only");
			formName.brochure_path.select();
			return false;
			}
			
		}
		
		
		
		//if(formName.ch4[0].checked==true && template_path_th_par=='')
			if(formName.add_template.value!='')

		{
			var path9      = document.frm.add_template.value;
			var len9        = path9.length;
			var sub_path9  = path9.lastIndexOf('.');
			var ext_path9   = path9.substring(sub_path9,len9);
			
			
			 if(formName.add_template.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEADDTEMPLATEPHOTO);
			formName.add_template.select();
			return false;
			}
			else if(ext_path9!='.jpg' && ext_path9!='.jpeg' && ext_path9!='.JPEG' && ext_path9!='.JPG' && ext_path9!='.pdf' && ext_path9!='.PDF' )
			{
			alert("Upload add template in .jpg, .pdf files only");
			formName.add_template.select();
			return false;
			}
			
		}
		/*if((formName.line_of_business.value=='')&&(formName.offer_details.value=='') && (formName.pro_ser_benefits.value=='') && (formName.strongest_benefit.value=='') && (formName.most_compell_offer.value=='')  && (formName.pro_ser_offer.value=='') && (formName.cart_to_act.value=='') && (formName.brochure_path.value=='') && (formName.add_template.value=='') &&  (formName.customer_logo.value=='')&&(formName.art_file_path.value=='')&& (formName.art_file_path1.value=='')&& (formName.customer_support_photo1.value=='')&& (formName.customer_support_photo.value==''))
		{
	alert('Please select atleast one field ');
	formName.line_of_business.focus();
	return false;
		}*/
		
	
		
	
}
function client_add_project(today_date)
{
	//alert(today_date);
	
		var formName=document.frm;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		
		var expr_date = formName.offer_expiration_year.value+'-'+formName.offer_expiration_month.value+'-'+formName.offer_expiration_day.value;
		var todaydate = today_date;
		
		var desired_res = document.getElementById('desired_res').checked;
		var art_for_postcard = document.getElementById('art_for_postcard').checked;
		var offer_details_chk = document.getElementById('offer_details_chk').checked;
		
	
if(formName.describe_changes.value!='')
		{
		if(formName.describe_changes.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECDESCRIBECHANGES);
		formName.describe_changes.value= "";
		formName.describe_changes.focus();
		return false;
		}
}

if(formName.line_of_business.value!='')
		{
		if(formName.line_of_business.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLINEBUSINESS);
		formName.line_of_business.value= "";
		formName.line_of_business.focus();
		return false;
		}
}
		
	if(formName.pro_ser_offer.value!='')
	{

		if(formName.pro_ser_offer.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECPRODUCTOFFER);
		formName.pro_ser_offer.value= "";
		formName.pro_ser_offer.focus();
		return false;
		}
	}
		
if(formName.strongest_benefit.value!='')
	{
		if(formName.strongest_benefit.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECSTRONGESTOFFER);
		formName.strongest_benefit.value= "";
		formName.strongest_benefit.focus();
		return false;
		}
}
	
if(formName.most_compell_offer.value!='')
{
		if(formName.most_compell_offer.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECCOMPELLOFFER);
		formName.most_compell_offer.value= "";
		formName.most_compell_offer.focus();
		return false;
		}
}
	
	if((formName.offer_details.value!='') && (formName.offer_details.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECOFFERDETAILS);
		formName.offer_details.value= "";
		formName.offer_details.focus();
		return false;
		}
	if((formName.pro_ser_benefits.value!='') && (formName.pro_ser_benefits.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECSERVICEBENEFITS);
		formName.pro_ser_benefits.value= "";
		formName.pro_ser_benefits.focus();
		return false;
		}
if(formName.bus_add.value!='')
		{
		if(formName.bus_add.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECBUSINESSADDRESS);
		formName.bus_add.value= "";
		formName.bus_add.focus();
		return false;
		}
		else if(!formName.bus_add.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.bus_add.value= "";
			formName.bus_add.focus();
			return false;
		}
		}
if((formName.cart_to_act.value!='') && (formName.cart_to_act.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECCARTTOACT);
		formName.cart_to_act.value= "";
		formName.cart_to_act.focus();
		return false;
		}
	if(formName.customer_support_photo.value!='')
			{
				var path1      = document.frm.customer_support_photo.value;
			var len1        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path1   = path1.substring(sub_path1,len1);
			
			
			 if(formName.customer_support_photo.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERSUPPORTPHOTO);
			formName.customer_support_photo.select();
			return false;
			}
			else if(ext_path1!='.jpg' && ext_path1!='.jpeg' && ext_path1!='.JPEG' && ext_path1!='.JPG' && ext_path1!='.tiff' && ext_path1!='.TIFF'&& ext_path1!='.TIF' && ext_path1!='.tif'  )
			{
			alert("Upload customer supplied photo in .jpg, .tiff files only");
			formName.customer_support_photo.select();
			return false;
			}
			
		
		
		}
		if(formName.customer_support_photo1.value!='')
			{
				var path1      = document.frm.customer_support_photo1.value;
			var len1        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path1   = path1.substring(sub_path1,len1);
			
			
			 if(formName.customer_support_photo1.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERSUPPORTPHOTO);
			formName.customer_support_photo1.select();
			return false;
			}
			else if(ext_path1!='.jpg'  && ext_path1!='.JPG' && ext_path1!='.JPEG' && ext_path1!='.jpeg' && ext_path1!='.tiff' && ext_path1!='.TIFF'&& ext_path1!='.TIF' && ext_path1!='.tif' )
			{
			alert("Upload customer support photo in .jpg, .tiff files only");
			formName.customer_support_photo1.select();
			return false;
			}
			
		
		
		}
	if(formName.customer_logo.value!='')
		{
			var path3      = document.frm.customer_logo.value;
			var len3        = path3.length;
			var sub_path3  = path3.lastIndexOf('.');
			var ext_path3   = path3.substring(sub_path3,len3);
			
			
			 if(formName.customer_logo.value.charAt(0)==' ')
			{
			alert(INVALIDSPACECUSTOMERLOGO);
			formName.customer_logo.select();
			return false;
			}
			else if(ext_path3!='.jpg' && ext_path3!='.jpeg'  && ext_path3!='.JPG' && ext_path3!='.JPEG' && ext_path3!='.eps' && ext_path3!='.EPS' && ext_path3!='.tiff' && ext_path3!='.TIFF'&& ext_path3!='.TIF' && ext_path3!='.tif'  )
			{
			alert("Upload customer logo in .jpg, .eps, .tiff files only");
			formName.customer_logo.select();
			return false;
			}
			
		}
		
		if((formName.photo_ins.value!='') && (formName.photo_ins.value.charAt(0)==' '))
		{
		alert(INVALIDSPACECPHOTOINSTRUCTION);
		formName.photo_ins.value= "";
		formName.photo_ins.focus();
		return false;
		}

		if(formName.art_file_path.value!='')
			//	if(formName.ch2[0].checked==true)

		{
		//	alert("a");
			var path5      = document.frm.art_file_path.value;
			var len5        = path5.length;
			var sub_path5  = path5.lastIndexOf('.');
			var ext_path5   = path5.substring(sub_path5,len5);
			
		
			 if(formName.art_file_path.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEARTFILEPATH);
			formName.art_file_path.select();
			return false;
			}
			else if(ext_path5!='.jpg' && ext_path5!='.jpeg'  && ext_path5!='.JPG' && ext_path5!='.JPEG'  && ext_path5!='.gif' && ext_path5!='.png' && ext_path5!='.PNG'&& ext_path5!='.GIF' )
			{
			alert("Upload art file in .jpg, .gif, .png files only");
			formName.art_file_path.select();
			return false;
			}
			
		}
if(formName.art_file_path1.value!='')
			//	if(formName.ch2[0].checked==true)

		{
		//	alert("a");
			var path5      = document.frm.art_file_path1.value;
			var len5        = path5.length;
			var sub_path5  = path5.lastIndexOf('.');
			var ext_path5   = path5.substring(sub_path5,len5);
			
			
			 if(formName.art_file_path1.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEARTFILEPATH);
			formName.art_file_path1.select();
			return false;
			}
			else if(ext_path5!='.jpg' && ext_path5!='.jpeg'  && ext_path5!='.JPG' && ext_path5!='.JPEG' && ext_path5!='.gif' && ext_path5!='.png' && ext_path5!='.PNG'  && ext_path5!='.GIF' )
			{
			alert("Upload art file in .jpg, .gif, .png files only");
			formName.art_file_path1.select();
			return false;
			}
			
		}
		
		
		
		//if(formName.ch3[0].checked==true)
			if(formName.brochure_path.value!='')
	{
			var path7      = document.frm.brochure_path.value;
			var len7        = path7.length;
			var sub_path7  = path7.lastIndexOf('.');
			var ext_path7   = path7.substring(sub_path7,len7);
			
		
			 if(formName.brochure_path.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEBROCHUREPATH);
			formName.brochure_path.select();
			return false;
			}
			else if(ext_path7!='.pdf' && ext_path7!='.PDF' && ext_path7!='.jpg' && ext_path7!='.jpeg'  && ext_path7!='.JPG' && ext_path7!='.JPEG')
			{
			alert("Upload brochure in .pdf,.jpg file only");
			formName.brochure_path.select();
			return false;
			}
			
		}
		
		
		
		//if(formName.ch4[0].checked==true)
		if(formName.add_template.value!='')
		{
			var path9      = document.frm.add_template.value;
			var len9        = path9.length;
			var sub_path9  = path9.lastIndexOf('.');
			var ext_path9   = path9.substring(sub_path9,len9);
			
			
			 if(formName.add_template.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEADDTEMPLATEPHOTO);
			formName.add_template.select();
			return false;
			}
			else if(ext_path9!='.jpg' && ext_path9!='.jpeg'  && ext_path9!='.JPG' && ext_path9!='.JPEG' && ext_path9!='.pdf' && ext_path9!='.PDF' )
			{
			alert("Upload add template in .jpg, .pdf files only");
			formName.add_template.select();
			return false;
			}
			
		}
		
		/*if((formName.line_of_business.value=='')&&(formName.offer_details.value=='') && (formName.pro_ser_benefits.value=='') && (formName.strongest_benefit.value=='') && (formName.most_compell_offer.value=='')  && (formName.pro_ser_offer.value=='') && (formName.cart_to_act.value=='') && (formName.brochure_path.value=='') && (formName.add_template.value=='') &&  (formName.customer_logo.value=='')&&(formName.art_file_path.value=='')&& (formName.art_file_path1.value=='')&& (formName.customer_support_photo1.value=='')&& (formName.customer_support_photo.value==''))
		{
	alert('Please select atleast one field ');
	return false;
		}
*/
	
		
		
		
		
		
		
		
}



function check_login()
{
	//alert();
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.username.value);
		var str=formName.username.value;
		
		if(formName.username.value=='')
		{
			alert(EMAIL);
			formName.username.focus();
			return false;
		}
		else if(formName.username.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEUSERNAME);
		formName.username.value= "";
		formName.username.focus();
		return false;
		}
		else if(formName.username.value!="" && check==false)
		{
			alert('Please enter valid email');
			formName.username.value= "";
			formName.username.focus();
			return false;
		}
		else if(formName.password.value=='')
		{
			alert(PASSWORD);
			formName.password.value= "";
			formName.password.focus();
			return false;
		}
		
}


function comment_check()
{
	//alert();
		var formName=document.frm;
		
		if(formName.comment.value=='')
		{
			alert(COMMENTCHECK);
			formName.comment.focus();
			return false;
		}
		else if(formName.comment.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMMENT);
		formName.comment.value= "";
		formName.comment.focus();
		return false;
		}
	
			
}

function admin_mod_region_region()
{
	//var num_reg=\*+[0-9]*\;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
        var formName=document.frm;
		if(formName.market.selectedIndex==0 || formName.market.selectedIndex==-1)
				 {
				alert(MAILREGION_SEL);
				formName.market.focus();
				return false;
					}
		
		else if(formName.edition.value=='')
				 {
				alert(EDITION_REGION);
				formName.edition.focus();
				return false;
					}
		else if(formName.edition.value.charAt(0)==' ')
					{
				alert(INVALID_EDITION_REGION);
				formName.edition.value= "";
				formName.edition.focus();
				return false;
					}
		 else if(!formName.edition.value.match(reg_exp_char))
					{
				alert(INVALID_EDITION_REGION);
				formName.edition.value= "";
				formName.edition.focus();
				return false;
					}
	
	
	}

function admin_add_edition_region()
{
	//var num_reg=\*+[0-9]*\;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
        var formName=document.frm;
		if(formName.mail_region.selectedIndex==0 || formName.mail_region.selectedIndex==-1)
				 {
				alert(MAILREGION_SEL);
				formName.mail_region.focus();
				return false;
					}
		
		else if(formName.edition_market.value=='')
				 {
				alert(EDITION_REGION);
				formName.edition_market.focus();
				return false;
					}
		else if(formName.edition_market.value.charAt(0)==' ')
					{
				alert(INVALID_EDITION_REGION);
				formName.edition_market.value= "";
				formName.edition_market.focus();
				return false;
					}
		 else if(!formName.edition_market.value.match(reg_exp_char))
					{
				alert(INVALID_EDITION_REGION);
				formName.edition_market.value= "";
				formName.edition_market.focus();
				return false;
					}
	
	
	}
	
	

	
	
function admin_check_proof()
{
	//alert();
		var formName=document.frm;
		if(formName.file_nm.value=='')
		{
			alert(ADMINUPLOADFILE);
			formName.file_nm.focus();
			return false;
		}
		
		else if(formName.message.value=='')
		{
			alert(ADMINUPLOADMESSAGE);
			formName.message.focus();
			return false;
		}
}

function designer_check_proof()
{
	//alert();
		var formName=document.frm;
		if(formName.file_nm.value=='')
		{
			alert(ADMINUPLOADFILE);
			formName.file_nm.focus();
			return false;
		}
		
		else if(formName.message.value=='')
		{
			alert(ADMINUPLOADMESSAGE);
			formName.message.focus();
			return false;
		}
}


function client_add_signature()
{
	//alert();
		var formName=document.frm;
		if(formName.digital_sign.value=='')
		{
			alert(CLIENTADDSIGN);
			formName.digital_sign.focus();
			return false;
		}
		else if(formName.digital_sign.value.charAt(0)==' ')
					{
				alert(INVALIDSPACEDIGITALSIGN);
				formName.digital_sign.value= "";
				formName.digital_sign.focus();
				return false;
					}
			
}





/*-----------------franchise popup mail check validation--------------------*/


function franchise_check_mail(arg)
  {
	      //alert(arg+'EMAIL');

  var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
  if(arg==1)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4},[&],["]|\d+)$/;
  var check = regex.test(document.frm_f.to_client.value);
       
  if(document.frm_f.to_client.value=='')
  {
    alert(EMAIL);
	document.frm_f.to_client.focus();
	return false;
  }
  else if(document.frm_f.to_client.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_f.to_client.value= "";
	document.frm_f.to_client.focus();
	return false;
	}
  else if(document.frm_f.to_client.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_f.to_client.select();
  return false;
  }
  else if(document.frm_f.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_f.subject.focus();
	return false;
  }
  else if(document.frm_f.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_f.subject.value= "";
		document.frm_f.subject.focus();
		return false;
		}
     else if(document.frm_f.message.value=='')
	  {
		alert(MESSAGEMAIL);
		document.frm_f.message.focus();
		return false;
	  }
	  else if(document.frm_f.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_f.message.value= "";
		document.frm_f.message.focus();
		return false;
		}
   }
  
   if(arg==2)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_d.to_designer.value);
  
   if(document.frm_d.to_designer.value=='')
  {
    alert(EMAIL);
	document.frm_d.to_designer.focus();
	return false;
  }
  else if(document.frm_d.to_designer.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_d.to_designer.value= "";
	document.frm_d.to_designer.focus();
	return false;
	}
  else if(document.frm_d.to_designer.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_d.to_designer.select();
  return false;
  }
  
  else if(document.frm_d.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d.subject.focus();
	return false;
  }
  else if(document.frm_d.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d.subject.value= "";
		document.frm_d.subject.focus();
		return false;
		}
  else if(document.frm_d.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d.message.focus();
	return false;
  }
  else if(document.frm_d.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d.message.value= "";
		document.frm_d.message.focus();
		return false;
		}
  }
  
   if(arg==3)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_c.to_admin.value);
  	  
  if(document.frm_c.to_admin.value=='')
  {
    alert(EMAIL);
	document.frm_c.to_admin.focus();
	return false;
  }
  else if(document.frm_c.to_admin.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_c.to_admin.value= "";
	document.frm_c.to_admin.focus();
	return false;
	}
  else if(document.frm_c.to_admin.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_c.to_admin.select();
  return false;
  }
  
 else  if(document.frm_c.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_c.subject.focus();
	return false;
  }
  else if(document.frm_c.subject.value.charAt(0)==' ')
	{
	alert(INVALIDSPACESUBJECT);
	document.frm_c.subject.value= "";
	document.frm_c.subject.focus();
	return false;
	}
 else if(document.frm_c.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_c.message.focus();
	return false;
  }
  else if(document.frm_c.message.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEMESSAGE);
	document.frm_c.message.value= "";
	document.frm_c.message.focus();
	return false;
	}
  }
  
 }


/*-----------------designer popup mail check validation--------------------*/


function designer_check_mail(arg)
  {
  var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, "]+$/;
  if(arg==1)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_f.to_creative.value);
    
  if(document.frm_f.to_creative.value=='')
  {
    alert(EMAIL);
	document.frm_f.to_creative.focus();
	return false;
  }
  else if(document.frm_f.to_creative.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_f.to_creative.value= "";
	document.frm_f.to_creative.focus();
	return false;
	}
  else if(document.frm_f.to_creative.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_f.to_creative.select();
  return false;
  }
  else if(document.frm_f.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_f.subject.focus();
	return false;
  }
  else if(document.frm_f.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_f.subject.value= "";
		document.frm_f.subject.focus();
		return false;
		}
  else if(document.frm_f.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_f.message.focus();
	return false;
  }
  else if(document.frm_f.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_f.message.value= "";
		document.frm_f.message.focus();
		return false;
		}
		 else if(document.frm_f.upload_file.value!='')
  {
	 		 var file_value=document.frm_f.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_f.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_f.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  }
  
   if(arg==2)
  {
   if(document.getElementById('sub_admin_email_id').value==-1 ||  document.getElementById('sub_admin_email_id').value==0)
  {
    alert(EMAIL);
	document.frm_d.sub_admin_email_id.focus();
	return false;
  }
 
  
  else if(document.frm_d.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d.subject.focus();
	return false;
  }
  else if(document.frm_d.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d.subject.value= "";
		document.frm_d.subject.focus();
		return false;
		}
  else if(document.frm_d.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d.message.focus();
	return false;
  }
  else if(document.frm_d.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d.message.value= "";
		document.frm_d.message.focus();
		return false;
		}

   else if(document.frm_d.upload_file.value!='')
  {
	 		 var file_value=document.frm_d.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_d.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_d.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
 
  
  } 
 
  }
 /*-----------------client popup mail check validation--------------------*/


function client_check_mail(arg)
  {
  var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, "]+$/;
  if(arg==1)
	  {
	 	 var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
	 	 var check = regex.test(document.frm_f.to_franchise.value);
	  
		  if(document.frm_f.to_franchise.value=='')
	 	 {
		alert(EMAIL);
		document.frm_f.to_franchise.focus();
		return false;
		  }
	   else if(document.frm_f.to_franchise.value.charAt(0)==' ')
			{
		alert(INVALIDSPACEEMAIL);
		document.frm_f.to_franchise.value= "";
		document.frm_f.to_franchise.focus();
		return false;
			}
	  else if(document.frm_f.to_franchise.value!="" && check==false)
	 	 {
	  alert(VALIDEMAIL);
	  document.frm_f.to_franchise.select();
	  return false;
		  }
	  else if(document.frm_f.subject.value=='')
	 	 {
		alert(SUBJECTMAIL);
		document.frm_f.subject.focus();
		return false;
	 	 }
	  else if(document.frm_f.subject.value.charAt(0)==' ')
			{
			alert(INVALIDSPACESUBJECT);
			document.frm_f.subject.value= "";
			document.frm_f.subject.focus();
			return false;
			}
	  else if(document.frm_f.message.value=='')
		  {
		alert(MESSAGEMAIL);
		document.frm_f.message.focus();
		return false;
		  }
	  else if(document.frm_f.message.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEMESSAGE);
			document.frm_f.message.value= "";
			document.frm_f.message.focus();
			return false;
			}
			
		 else if(document.frm_f.upload_file.value!='')
  {
	 		 var file_value=document.frm_f.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_f.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_f.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
			
			
	  }
  
   if(arg==2)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_d.to_designer.value);
  
  if(document.frm_d.to_designer.value=='')
  {
    alert(EMAIL);
	document.frm_d.to_designer.focus();
	return false;
  }
   else if(document.frm_d.to_designer.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_d.to_designer.value= "";
	document.frm_d.to_designer.focus();
	return false;
	}
  else if(document.frm_d.to_designer.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_d.to_designer.select();
  return false;
  }
  
  else if(document.frm_d.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d.subject.focus();
	return false;
  }
  else if(document.frm_d.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d.subject.value= "";
		document.frm_d.subject.focus();
		return false;
		}
  else if(document.frm_d.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d.message.focus();
	return false;
  }
  else if(document.frm_d.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d.message.value= "";
		document.frm_d.message.focus();
		return false;
		}
		 else if(document.frm_d.upload_file.value!='')
  {
	 		 var file_value=document.frm_d.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_d.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_d.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
		
  }
  
   if(arg==3)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_c.to_admin.value);
  	  
  if(document.frm_c.to_admin.value=='')
  {
    alert(EMAIL);
	document.frm_c.to_admin.focus();
	return false;
  }
   else if(document.frm_c.to_admin.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_c.to_admin.value= "";
	document.frm_c.to_admin.focus();
	return false;
	}
  else if(document.frm_c.to_admin.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_c.to_admin.select();
  return false;
  }
  
 else  if(document.frm_c.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_c.subject.focus();
	return false;
  }
  else if(document.frm_c.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_c.subject.value= "";
		document.frm_c.subject.focus();
		return false;
		}
 else if(document.frm_c.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_c.message.focus();
	return false;
  }
  else if(document.frm_c.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_c.message.value= "";
		document.frm_c.message.focus();
		return false;
		}
  }
  
   else if(document.frm_c.upload_file.value!='')
  {
	 		 var file_value=document.frm_c.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_c.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_c.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_c.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_c.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  
 }
 
 
 
 /*-----------------admin popup mail check validation--------------------*/
function admin_check_mail1(arg)
  {
  var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
  if(arg==2)
  {
	  //alert('arg');  
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_d1.to_designer.value);
    
 if(document.frm_d1.to_designer.value=='')
  {	

    alert(EMAIL);
	document.frm_d1.to_designer.focus();
	return false;
  }
    else if(document.frm_d1.to_designer.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_d1.to_franchise.value= "";
	document.frm_d1.to_franchise.focus();
	return false;
	}
  else if(document.frm_d1.to_designer.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_d1.to_franchise.select();
  return false;
  }
 else if(document.frm_d1.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d1.subject.focus();
	return false;
  }
  else if(document.frm_d1.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d1.subject.value= "";
		document.frm_d1.subject.focus();
		return false;
		}
  else if(document.frm_d1.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d1.message.focus();
	return false;
  }
  else if(document.frm_d1.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d1.message.value= "";
		document.frm_d1.message.focus();
		return false;
		}
			
			///////////////

		 else if(document.frm_d1.upload_file.value!='')
  {
	 		 var file_value=document.frm_d1.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d1.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_d1.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_d1.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d1.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  
  
  	///////////////

 }
  
 
  
  }

function admin_check_mail(arg)
  {
  var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
  if(arg==1)
  {
  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  var check = regex.test(document.frm_f.to_franchise.value);
    
  if(document.frm_f.to_franchise.value=='')
  {
    alert(EMAIL);
	document.frm_f.to_franchise.focus();
	return false;
  }
   else if(document.frm_f.to_franchise.value.charAt(0)==' ')
	{
	alert(INVALIDSPACEEMAIL);
	document.frm_f.to_franchise.value= "";
	document.frm_f.to_franchise.focus();
	return false;
	}
  else if(document.frm_f.to_franchise.value!="" && check==false)
  {
  alert(VALIDEMAIL);
  document.frm_f.to_franchise.select();
  return false;
  }
  else if(document.frm_f.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_f.subject.focus();
	return false;
  }
  else if(document.frm_f.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_f.subject.value= "";
		document.frm_f.subject.focus();
		return false;
		}
  else if(document.frm_f.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_f.message.focus();
	return false;
  }
  else if(document.frm_f.message.value.charAt(0)==' ')

		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_f.message.value= "";
		document.frm_f.message.focus();
		return false;
		}
			
			///////////////

		 else if(document.frm_f.upload_file.value!='')
  {
	 		 var file_value=document.frm_f.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_f.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_f.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_f.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  
  
  	///////////////

  }
   if(arg==2)
	  {
	  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
	  var check = regex.test(document.frm_d.to_designer.value);
	  
	   if(document.frm_d.to_designer.value=='')
	  {
		alert(EMAIL);
		document.frm_d.to_designer.focus();
		return false;
	  }
	   else if(document.frm_d.to_designer.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEEMAIL);
		document.frm_d.to_designer.value= "";
		document.frm_d.to_designer.focus();
		return false;
		}
	  else if(document.frm_d.to_designer.value!="" && check==false)
	  {
	  alert(VALIDEMAIL);
	  document.frm_d.to_designer.select();
	  return false;
	  }
	  
	  else if(document.frm_d.subject.value=='')
	  {
		alert(SUBJECTMAIL);
		document.frm_d.subject.focus();
		return false;
	  }
	  else if(document.frm_d.subject.value.charAt(0)==' ')
			{
			alert(INVALIDSPACESUBJECT);
			document.frm_d.subject.value= "";
			document.frm_d.subject.focus();
			return false;
			}
	  else if(document.frm_d.message.value=='')
	  {
		alert(MESSAGEMAIL);
		document.frm_d.message.focus();
		return false;
	  }
	  else if(document.frm_d.message.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEMESSAGE);
			document.frm_d.message.value= "";
			document.frm_d.message.focus();
			return false;
			}
			  //////////
	
			
			 else if(document.frm_d.upload_file.value!='')
	  {
				 var file_value=document.frm_d.upload_file.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_d.upload_file.select();
					return false;
		
		
				 
			}
			
	  }
			 else if(document.frm_d.upload_file_ftp.value!='')
	  {
				 var file_value=document.frm_d.upload_file_ftp.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_d.upload_file.select();
					return false;
		
		
				 
			}
			
	  }
	  /////////////
	  
	  }
  
   if(arg==3)
	  {
	  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
	  var check = regex.test(document.frm_c.to_client.value);
		  
	  if(document.frm_c.to_client.value=='')
	  {
		alert(EMAIL);
		document.frm_c.to_client.focus();
		return false;
	  }
	   else if(document.frm_c.to_client.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEEMAIL);
		document.frm_c.to_client.value= "";
		document.frm_c.to_client.focus();
		return false;
		}
	  else if(document.frm_c.to_client.value!="" && check==false)
	  {
	  alert(VALIDEMAIL);
	  document.frm_c.to_client.select();
	  return false;
	  }
	  
	 else  if(document.frm_c.subject.value=='')
	  {
		alert(SUBJECTMAIL);
		document.frm_c.subject.focus();
		return false;
	  }
	  else if(document.frm_c.subject.value.charAt(0)==' ')
			{
			alert(INVALIDSPACESUBJECT);
			document.frm_c.subject.value= "";
			document.frm_c.subject.focus();
			return false;
			}
	 else if(document.frm_c.message.value=='')
	  {
		alert(MESSAGEMAIL);
		document.frm_c.message.focus();
		return false;
	  }
	  else if(document.frm_c.message.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEMESSAGE);
			document.frm_c.message.value= "";
			document.frm_c.message.focus();
			return false;
			}
			//////////
			
			else if(document.frm_c.upload_file.value!='')
	  {
				 var file_value=document.frm_c.upload_file.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_c.upload_file.select();
					return false;
		
		
				 
			}
			
	  }
			
			else if(document.frm_c.upload_file_ftp.value!='')
	  {
				 var file_value=document.frm_c.upload_file_ftp.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_c.upload_file_ftp.select();
					return false;
		
		
				 
			}
			
	  }
	  /////////
	  }
  //alert('arg'+arg)
  
  if(arg==4)
	  {
	  var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
	  var check = regex.test(document.frm_a.to_creative.value);
		  
	  if(document.frm_a.to_creative.value=='')
	  {
		alert(EMAIL);
		document.frm_a.to_creative.focus();
		return false;
	  }
	   else if(document.frm_a.to_creative.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEEMAIL);
		document.frm_a.to_creative.value= "";
		document.frm_a.to_creative.focus();
		return false;
		}
	  else if(document.frm_a.to_creative.value!="" && check==false)
	  {
	  alert(VALIDEMAIL);
	  document.frm_a.to_creative.select();
	  return false;
	  }
	  
	 else  if(document.frm_a.subject.value=='')
	  {
		alert(SUBJECTMAIL);
		document.frm_a.subject.focus();
		return false;
	  }
	  else if(document.frm_a.subject.value.charAt(0)==' ')
			{
			alert(INVALIDSPACESUBJECT);
			document.frm_a.subject.value= "";
			document.frm_a.subject.focus();
			return false;
			}
	 else if(document.frm_a.message.value=='')
	  {
		alert(MESSAGEMAIL);
		document.frm_a.message.focus();
		return false;
	  }
	  else if(document.frm_a.message.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEMESSAGE);
			document.frm_a.message.value= "";
			document.frm_a.message.focus();
			return false;
			}
	 
	  
	  ///////////
		
			else if(document.frm_a.upload_file.value!='')
	  {
				 var file_value=document.frm_a.upload_file.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_a.upload_file.select();
					return false;
		
		
				 
			}
			
	  }
			
			else if(document.frm_a.upload_file_ftp.value!='')
	  {
				 var file_value=document.frm_a.upload_file_ftp.value;
				 var len        = file_value.length;
				 var file_value1  = file_value.lastIndexOf('.');
				 var ext_path2  = file_value.substring(file_value1,len);
				// ext_path =strtolower()
		
		if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
				{
					
					alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
					document.frm_a.upload_file_ftp.select();
					return false;
		
		
				 
			}
			
	  }
	  
	  ////////
	  
	 }
 
  }


 function  for_creative_director_fran()
 {
	 
  //var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/;
 // var check = regex.test(document.frm_a.to_creative.value);
  	  
  if(document.getElementById('sub_admin_email_id').value==-1 ||  document.getElementById('sub_admin_email_id').value==0)
  {
    alert(EMAIL);
	document.frm_d.sub_admin_email_id.focus();
	return false;
  }
  
  
 else  if(document.frm_d.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d.subject.focus();
	return false;
  }
  else if(document.frm_d.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d.subject.value= "";
		document.frm_d.subject.focus();
		return false;
		}
 else if(document.frm_d.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d.message.focus();
	return false;
  }
  else if(document.frm_d.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d.message.value= "";
		document.frm_d.message.focus();
		return false;
		}
		
		 else if(document.frm_d.upload_file.value!='')
  {
	 		 var file_value=document.frm_d.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_d.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_d.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_d.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  
  

  
	 
	 
	 }
      function for_creative_director()
 	 {
	 
  //var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/;
 // var check = regex.test(document.frm_a.to_creative.value);
  	  
  if(document.getElementById('sub_admin_email_id').value==-1 ||  document.getElementById('sub_admin_email_id').value==0)
  {
    alert(EMAIL);
	document.frm_a.sub_admin_email_id.focus();
	return false;
  }
  
  
 else  if(document.frm_a.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_a.subject.focus();
	return false;
  }
  else if(document.frm_a.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_a.subject.value= "";
		document.frm_a.subject.focus();
		return false;
		}
 else if(document.frm_a.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_a.message.focus();
	return false;
  }
  else if(document.frm_a.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_a.message.value= "";
		document.frm_a.message.focus();
		return false;
		}
		
		 else if(document.frm_a.upload_file.value!='')
  {
	 		 var file_value=document.frm_a.upload_file.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_a.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  		 else if(document.frm_a.upload_file_ftp.value!='')
  {
	 		 var file_value=document.frm_a.upload_file_ftp.value;
	 		 var len        = file_value.length;
			 var file_value1  = file_value.lastIndexOf('.');
			 var ext_path2  = file_value.substring(file_value1,len);
			// ext_path =strtolower()
	
	if(ext_path2!='.jpg' && ext_path2!='.gif' && ext_path2!='.png' && ext_path2!='.PNG' && ext_path2!='.JPG' && ext_path2!='.GIF' && ext_path2!='.pdf' && ext_path2!='.PDF' && ext_path2!='.indd' && ext_path2!='.INDD' && ext_path2!='.qxd' && ext_path2!='.QXD' && ext_path2!='.psd' && ext_path2!='.PSD' && ext_path2!='.ai' && ext_path2!='.AI' && ext_path2!='.eps' && ext_path2!='.EPS' && ext_path2!='.txt' && ext_path2!='.TXT' && ext_path2!='.doc' && ext_path2!='.DOC' && ext_path2!='.docx' && ext_path2!='.DOCX')
			{
				
				alert("Upload .jpg, .gif, .png, .pdf, .indd, .qxd, .psd, .ai, .eps, .doc files only");
				document.frm_a.upload_file.select();
				return false;
	
	
		     
        }
		
  }
  
  

  
	 }
	 
	   	///////////////

	 //// start for franchise section
/*
	  function for_creative_director()
 {
	 
  //var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/;
 // var check = regex.test(document.frm_a.to_creative.value);
  	  
  if(document.getElementById('sub_admin_email_id').value==-1 ||  document.getElementById('sub_admin_email_id').value==0)
  {
    alert(EMAIL);
	document.frm_d.sub_admin_email_id.focus();
	return false;
  }
  
  
 else  if(document.frm_d.subject.value=='')
  {
    alert(SUBJECTMAIL);
	document.frm_d.subject.focus();
	return false;
  }
  else if(document.frm_d.subject.value.charAt(0)==' ')
		{
		alert(INVALIDSPACESUBJECT);
		document.frm_d.subject.value= "";
		document.frm_d.subject.focus();
		return false;
		}
 else if(document.frm_d.message.value=='')
  {
    alert(MESSAGEMAIL);
	document.frm_d.message.focus();
	return false;
  }
  else if(document.frm_d.message.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEMESSAGE);
		document.frm_d.message.value= "";
		document.frm_d.message.focus();
		return false;
		}
  
	 }*/
 
//// for franchise section
 
 
 function designer_mod_details()
{
	//alert();
		var formName=document.frm;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		
		if(formName.first_name.value=='')
		{
			alert(FIRSTNAME);
			formName.first_name.focus();
			return false;
		}
		else if(formName.first_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEFIRSTNAME);
		formName.first_name.value= "";
		formName.first_name.focus();
		return false;
		}
		else if(!formName.first_name.value.match(reg_exp_char))
		{
			alert(VAILDFIRSTNAME);
			formName.first_name.value= "";
			formName.first_name.focus();
			return false;
		}
		
		else if(formName.last_name.value=='')
		{
			alert(LASTNAME);
			formName.last_name.focus();
			return false;
		}
		else if(formName.last_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACELASTNAME);
		formName.last_name.value= "";
		formName.last_name.focus();
		return false;
		}
		else if(!formName.last_name.value.match(reg_exp_char))
		{
			alert(VAIDLASTNAME);
			formName.last_name.value= "";
			formName.last_name.focus();
			return false;
		}
		else if(formName.pwd.value=='')
		{   
			alert(PASSWORD);
			formName.pwd.focus();
			return false;
		}
		else if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}
		
		else if(formName.address.value=='')
		{
			alert(ADDRESS);
			formName.address.focus();
			return false;
		}
		else if(!formName.address.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.address.value= "";
			formName.address.focus();
			return false;
		}
		else if((formName.contact_no.value=='') && (formName.office_contact_no.value==''))
		{
			alert(PHONE);
			formName.contact_no.focus();
			return false;
		}
		else if(formName.contact_no.value!='')
		{
			if(!formName.contact_no.value.match(zip_code))
			{
			alert(VALIDMOBILEPHONE);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
			if(formName.contact_no.value.length < 8)
			{
			alert(VAILDMOBILEPHONELENGTH);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
		}
		else if(formName.office_contact_no.value!='')
		{
			if(!formName.office_contact_no.value.match(zip_code))
			{
			alert(VALIDOFFICEPHONE);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
			if(formName.office_contact_no.value.length < 8)
			{
			alert(VAILDOFFICEPHONELENGTH);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
		}
		
}


function franchise_mod_details()
{
	//alert();
		var formName=document.frm;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_addr=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		
		if(formName.first_name.value=='')
		{
			alert(FIRSTNAME);
			formName.first_name.focus();
			return false;
		}
		else if(formName.first_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEFIRSTNAME);
		formName.first_name.value= "";
		formName.first_name.focus();
		return false;
		}
		else if(!formName.first_name.value.match(reg_exp_char))
		{
			alert(VAILDFIRSTNAME);
			formName.first_name.value= "";
			formName.first_name.focus();
			return false;
		}
		
		else if(formName.last_name.value=='')
		{
			alert(LASTNAME);
			formName.last_name.focus();
			return false;
		}
		else if(formName.last_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACELASTNAME);
		formName.last_name.value= "";
		formName.last_name.focus();
		return false;
		}
		else if(!formName.last_name.value.match(reg_exp_char))
		{
			alert(VAIDLASTNAME);
			formName.last_name.value= "";
			formName.last_name.focus();
			return false;
		}
		else if(formName.pwd.value=='')
		{   
			alert(PASSWORD);
			formName.pwd.focus();
			return false;
		}
		else if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}
		
		else if(formName.address.value=='')
		{
			alert(ADDRESS);
			formName.address.focus();
			return false;
		}
		else if(!formName.address.value.match(reg_exp_addr))
		{
			alert(VAILDADDRESS);
			formName.address.value= "";
			formName.address.focus();
			return false;
		}
		else if((formName.contact_no.value=='') && (formName.office_contact_no.value==''))
		{
			alert(PHONE);
			formName.contact_no.focus();
			return false;
		}
		else if(formName.contact_no.value!='')
		{
			if(!formName.contact_no.value.match(zip_code))
			{
			alert(VALIDMOBILEPHONE);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
			if(formName.contact_no.value.length < 8)
			{
			alert(VAILDMOBILEPHONELENGTH);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
			}
		}
		else if(formName.office_contact_no.value!='')
		{
			if(!formName.office_contact_no.value.match(zip_code))
			{
			alert(VALIDOFFICEPHONE);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
			if(formName.office_contact_no.value.length < 8)
			{
			alert(VAILDOFFICEPHONELENGTH);
			formName.office_contact_no.value= "";
			formName.office_contact_no.focus();
			return false;
			}
		}
		
}



function client_mod_details()
{
	//alert();
		var formName=document.frm;
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		
		
		if(formName.company.value=='')
		{
			alert(COMPANYNAME);
			formName.company.focus();
			return false;
		}
		
		else if(formName.company.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(formName.website.value=='')
		{   
			alert(WEBSITE);
			formName.website.focus();
			return false;
		}
		else if((formName.website.value.substr(0,11)!='http://') && (formName.website.value.substr(0,11)!='HTTP://WWW.'))
		{   
			alert(INVALID_WEBSITEURL);
			formName.website.select();
			return false;
		}
		else if(formName.client_name.value=='')
		{
			alert(CLIENT_NAME);
			formName.client_name.focus();
			return false;
		}
		else if(formName.client_name.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.client_name.value= "";
		formName.client_name.focus();
		return false;
		}
		else if(!formName.client_name.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.client_name.value= "";
			formName.client_name.focus();
			return false;
		}
		else if(formName.pwd.value=='')
		{   
			alert(PASSWORD);
			formName.pwd.focus();
			return false;
		}
		else if(formName.pwd.value.length < 6)
		{
			alert(VAILDPASSWORD);
			formName.pwd.value= "";
			formName.pwd.focus();
			return false;
		}
		else if(formName.contact_no.value=='')
		{
			alert(CLIENTPHONE);
			formName.contact_no.focus();
			return false;
		}
		else if(!formName.contact_no.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
		}
		else if(formName.contact_no.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.contact_no.value= "";
			formName.contact_no.focus();
			return false;
		}
		
		
    else if(formName.comments.value=='')
		{
			alert(COMMENTS);
			formName.comments.focus();
			return false;
		}
		
		
		
}



function check_forgot_pwd()
{
	//alert();
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.username.value);
		var str=formName.username.value;
		
		if(formName.username.value=='')
		{
			alert('Please enter email');
			formName.username.focus();
			return false;
		}
		else if(formName.username.value!="" && check==false)
		{
			alert('Invalid email');
			formName.username.select();
			return false;
		}
		
}

function customer_support_photo_check()
{
var formName=document.frm;
		if(formName.customer_support_photo.value!="")
		{
			alert(MANNUALPATHFORCUSTOMERPHOTO);
			formName.customer_support_photo.select();
			formName.customer_support_photo.value="";
			
			return false;
		}
}

function customer_logo_check()
{
var formName=document.frm;
		if(formName.customer_logo.value!="")
		{
			alert(MANNUALPATHFORCUSTOMERLOGO);
			formName.customer_logo.value="";
			formName.customer_logo.select();
			return false;
		}
}

function additional_art_check()
{
var formName=document.frm;
		if(formName.art_file_path.value!="")
		{
			alert(MANNUALPATHFORADDITIONALART);
			formName.art_file_path.value="";
			formName.art_file_path.select();
			return false;
		}
}

function brochure_check()
{
var formName=document.frm;
		if(formName.brochure_path.value!="")
		{
			alert(MANNUALPATHFORBROCHURE);
			formName.brochure_path.value="";
			formName.brochure_path.select();
			return false;
		}
}





function admin_check_postcard()
{
	//alert();
		var formName=document.frm;
		//alert(formName.ch3[0].checked);
		//alert(formName.ch3[1].checked);
		
		if(formName.ch3[0].checked==true)
		{
			var path1      = document.frm.img_upload.value;
			var len        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path  = path1.substring(sub_path1,len);
			
			if(formName.img_upload.value=='')
			{
				alert(UPLOADPOSTCARD);
				formName.img_upload.focus();
				return false;
			}
			else if(formName.img_upload.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPOSTCARD);
			formName.img_upload.select();
			return false;
			}
			else if(ext_path!='.jpg' && ext_path!='.JPG')
			{
				
				alert("Upload .jpg files only");
				formName.img_upload.select();
				return false;
			}
			
		}
		else if(formName.ch3[1].checked==true)
		{
			
			var path1      = document.frm.img_upload_f.value;
			var len        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path  = path1.substring(sub_path1,len);
			
			
			if(formName.img_upload_f.value=='')
			{
				alert(UPLOADPOSTCARD);
				formName.img_upload_f.focus();
				return false;
			}
			else if(formName.img_upload_f.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPOSTCARD);
			formName.img_upload_f.select();
			return false;
			}
			else if(ext_path!='.jpg' && ext_path!='.JPG')
			{
				
				alert("Upload .jpg files only");
				formName.img_upload_f.select();
				return false;
			}
		
		}
		
}



function designer_check_postcard()
{
	//alert();
		var formName=document.frm;
		//alert(formName.ch3[0].checked);
		//alert(formName.ch3[1].checked);
		
		if(formName.ch3[0].checked==true)
		{
			var path1      = document.frm.img_upload.value;
			var len        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path  = path1.substring(sub_path1,len);
			
			if(formName.img_upload.value=='')
			{
				alert(UPLOADPOSTCARD);
				formName.img_upload.focus();
				return false;
			}
			else if(formName.img_upload.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPOSTCARD);
			formName.img_upload.select();
			return false;
			}
			else if(ext_path!='.jpg' && ext_path!='.JPG')
			{
				
				alert("Upload .jpg files only");
				formName.img_upload.select();
				return false;
			}
			
		}
		else if(formName.ch3[1].checked==true)
		{
			
			var path1      = document.frm.img_upload_f.value;
			var len        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path  = path1.substring(sub_path1,len);
			
			
			if(formName.img_upload_f.value=='')
			{
				alert(UPLOADPOSTCARD);
				formName.img_upload_f.focus();
				return false;
			}
			else if(formName.img_upload_f.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPOSTCARD);
			formName.img_upload_f.select();
			return false;
			}
			else if(ext_path!='.jpg' && ext_path!='.JPG')
			{
				
				alert("Upload .jpg files only");
				formName.img_upload_f.select();
				return false;
			}
		
		}
		
}



function search_upload_date_client()
{
	//alert();
		var formName=document.frm;
		
		if(formName.postcard_month.value=='')
		{
			alert("Please select month for Target Upload");
			formName.postcard_month.focus();
			return false;
		}
		
		else if(formName.postcard_year.value=='')
		{
			alert("Please select year");
			formName.postcard_year.focus();
			return false;
		}
		
}


function admin_upload_proof1()
{
		
		var formName=document.frm;
	
		
			var path1      = document.frm.img_upload.value;
			var len        = path1.length;
			var sub_path1  = path1.lastIndexOf('.');
			var ext_path  = path1.substring(sub_path1,len);
			
			if(formName.img_upload.value=='')
			{
				alert(UPLOADPROOF);
				formName.img_upload.focus();
				return false;
			}
			else if(formName.img_upload.value.charAt(0)==' ')
			{
			alert(INVALIDSPACEUPLOADPROOF);
			formName.img_upload.select();
			return false;
			}
		/*	else if(ext_path!='.jpg' && ext_path!='.gif' && ext_path!='.png' && ext_path!='.PNG' && ext_path!='.JPG' && ext_path!='.GIF' )
			{
				
				alert("Upload .jpg, .gif, .png files only");
				formName.img_upload.select();
				return false;
			}*/
			
				

}

 function validateDelete()
 
 {
 
 	var len=document.frm.elements.length;
 
 	var i=0, j=0;
 
 //alert(document.frm.elements[i].checked);
 	for(i=0;i<len;i++)
 
 	if(document.frm.elements[i].type=='checkbox' && document.frm.elements[i].checked==true)
 		j++;
 
 	if(j==1 && document.frm.checkAll.checked==true)
 
 	{
 
 		alert("Select at least one to delete");
 
 		return false;	
 
 	}
 
 	else if(j>0)
 
 	{
 
 			
 
 		return confirm("Are you sure you want to delete?");
 
 
 
 	}
 
 	else 
 
 	{
 
 
 		alert("Select at least one to delete");
 
 		return false;
 
 	}	
 
 }

function select_deselectAll (chkVal, idVal) 
{



var frm = document.forms[0];

	for (i=0; i<frm.length; i++)

	{

		if (idVal.indexOf ('selectall') != -1) 

		{

			if(chkVal == true) 

			{

			frm.elements[i].checked = true;

			} 

			else 

			{

			frm.elements[i].checked = false;

			}

		

		} 

		else if (idVal.indexOf ('checkAll') != -1)

		{

		if(frm.elements[i].checked == false) 

		{

			frm.elements[0].checked = false; //Uncheck main select all checkbox

		} 

		

		}

	}

}

function select_deselectAll_new (chkVal, idVal) 
{



var frm = document.frm;

	for (i=0; i<frm.length; i++)

	{

		if (idVal.indexOf ('selectall') != -1) 

		{

			if(chkVal == true) 

			{

			frm.elements[i].checked = true;

			} 

			else 

			{

			frm.elements[i].checked = false;

			}

		

		} 

		else if (idVal.indexOf ('checkAll') != -1)

		{

		if(frm.elements[i].checked == false) 

		{

			frm.elements[0].checked = false; //Uncheck main select all checkbox

		} 

		

		}

	}

}


var wProgress = null;
function ShowProgress(x)
{
	if(document.getElementById(x).value!="")
	{
		document.getElementById('uploader').style.display="inline";
		document.getElementById('uploader').innerHTML="<img src='../images/loadingAnimation.gif'>";
		return true;
	}
}

function ShowProgress1(id1,id2,id3)
{
//alert(document.getElementById(id1).value);

	if(document.getElementById(id1).value!="")
	{
		document.getElementById('uploader').style.display="inline";
		document.getElementById('uploader').innerHTML="<img src='../images/loadingAnimation.gif'>";
		return true;
	}
  else if(document.getElementById(id2).value!="")
	{
		document.getElementById('uploader').style.display="inline";
		document.getElementById('uploader').innerHTML="<img src='../images/loadingAnimation.gif'>";
		return true;
	}
else if(document.getElementById(id3).value!="")
	{
		document.getElementById('uploader').style.display="inline";
		document.getElementById('uploader').innerHTML="<img src='../images/loadingAnimation.gif'>";
		return true;
	}
}

function CloseProgress()
{

	document.getElementById('uploader').style.display="none";
	document.getElementById('uploader').src="";
	return true;
}





function coordinator_add_client3()
{
	//	alert('aaa');
		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.clientemail.value);
		var str=formName.clientemail.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_nm=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		


		if(formName.clientemail.value=='')
		{
			alert(EMAIL);
			formName.clientemail.focus();
			return false;
		}
		else if(formName.clientemail.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.clientemail.select();
			return false;
		}	


		else if(document.getElementById('radio_client').value==0)
		{
		 if(formName.company_n.value=='')
		{
			alert(COMPANYNAME);
			formName.company_n.focus();
			return false;
		}
		
	
		else if(formName.company_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!isNaN(formName.company_n.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!formName.company_n.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company_n.value= "";
			formName.company_n.focus();
			return false;
		}
		
		/*else if(formName.website_n.value=='')
		{   
			alert(WEBSITE);
			formName.website_n.focus();
			return false;
		}*/
		else if(formName.website_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website_n.value= "";
		formName.website_n.focus();
		return false;
		}
		
		/*else if((formName.website_n.value.substr(0,4)!='www.') && (formName.website_n.value.substr(0,4)!='WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website_n.select();
		return false;
		}
		*/
		else if(formName.clientname_n.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname_n.focus();
			return false;
		}
		else if(formName.clientname_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname_n.value= "";
		formName.clientname_n.focus();
		return false;
		}
		else if(!formName.clientname_n.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname_n.value= "";
			formName.clientname_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone_n.focus();
			return false;
		}
		else if(!formName.clientphone_n.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		else if(formName.category_n.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category_n.focus();
			return false;
		}

		else if(formName.category_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category_n.value= "";
		formName.category_n.focus();
		return false;
		}
		/*else if(postcard_back_n==-1 || postcard_back_n==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back_n.focus();
			return false;
		}*/
		else if(month_id==-1 || month_id==0)
		{
			alert(MONTH);
			formName.month_id_n.focus();
			return false;
		}
		else if(market_id==-1 || market_id==0)
		{
			alert(MARKET_MAILREGIONNAME);
			formName.market_id_n.focus();
			return false;
		}
			
       else if(mailregion_n==-1 || mailregion_n==0)
		{
			alert(EDITIONNAME);
			formName.mailregion_n.focus();
			return false;
		}
		else if(formName.quantity_n.value!='' && !formName.quantity_n.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity_n.value= "";
			formName.quantity_n.focus();
			return false;
		}
		return true;
		
 }
else if(document.getElementById('radio_client').value==1)
{
//alert('aa');
	//var postcard_back = document.getElementById('postcard_back').selectedIndex;

    var market_id_chk_db = document.getElementById('market_id_db').selectedIndex;
	
	
	var month_id_chk_db = document.getElementById('month_id_db').selectedIndex;
	
    var mailregion1 = document.getElementById('mailregion_n').value;
	
	//alert(mailregion1);

	if(formName.company.value=='')
		{
			alert(COMPANYNAME);
			formName.company.focus();
			return false;
		}
		
		else if(formName.company.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!isNaN(formName.company.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!formName.company.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company.value= "";
			formName.company.focus();
			return false;
		}
		
		else if(formName.website.value=='')
		{   
			alert(WEBSITE);
			formName.website.focus();
			return false;
		}
		
		
		else if(formName.website.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if((formName.website.value.substr(0,11)!='http://www.') && (formName.website.value.substr(0,12)!='https://www.') && (formName.website.value.substr(0,11)!='HTTP://WWW.') && (formName.website.value.substr(0,12)!='HTTPS://WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if(formName.clientname.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientname.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname.value= "";
		formName.clientname.focus();
		return false;
		}
		else if(!formName.clientname.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname.value= "";
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientphone.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone.focus();
			return false;
		}
		else if(!formName.clientphone.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.clientphone.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.category.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category.focus();
			return false;
		}
		else if(formName.category.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category.value= "";
		formName.category.focus();
		return false;
		}
//alert('postcard_back'+postcard_back);
		
/*else if(postcard_back==-1 || postcard_back==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back.focus();
			return false;
		}*/
else if(month_id_chk_db==0)
		{
			alert(MONTH);

			formName.month_id_db.focus();
			return false;
		}
		 else if(market_id_chk_db==0)
		{
			alert(MARKET_MAILREGIONNAME);
			formName.market_id_db.focus();
			return false;
		}
  else if(mailregion1==0)
		{
			alert(EDITIONNAME);
			return false;
		}
		else if(formName.quantity.value!='' && !formName.quantity.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity.value= "";
			formName.quantity.focus();
			return false;
		}
		return true;
		
	}
		


}



function franchise_add_client3()
{
	//  alert(document.getElementById('radio_client').value+'sds');
	  //alert(document.getElementById('client1').checked+'sds');

		var formName=document.frm;
		var regex = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|[A-Z]{2,4}|\d+)$/;
  		var check = regex.test(formName.clientemail.value);
		var str=formName.clientemail.value;
		
		var reg_exp_char=/^[a-z,A-Z,.,_,\-,',`, &, " ]+$/;
		var reg_exp_nm=/^[0-9,a-z,A-Z,.,_,\-,',`,\s, &, " ]+$/;
		var zip_code=/^[0-9,+,-]+$/;		



		if(formName.clientemail.value=='')
		{
			alert(EMAIL);
			formName.clientemail.focus();
			return false;
		}
		else if(formName.clientemail.value!="" && check==false)
		{
			alert(VALIDEMAIL);
			formName.clientemail.select();
			return false;
		}

			else if(document.getElementById('radio_client').value==0)
{
		
		 if(formName.company_n.value=='')
		{
			alert(COMPANYNAME);
			formName.company_n.focus();
			return false;
		}
		
	
		else if(formName.company_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!isNaN(formName.company_n.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company_n.value= "";
		formName.company_n.focus();
		return false;
		}
		
		else if(!formName.company_n.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company_n.value= "";
			formName.company_n.focus();
			return false;
		}
				
		else if(formName.website_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website_n.value= "";
		formName.website_n.focus();
		return false;
		}
		/*
		else if((formName.website_n.value.substr(0,4)!='www.') && (formName.website_n.value.substr(0,4)!='WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website_n.select();
		return false;
		}*/
		
		else if(formName.clientname_n.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname_n.focus();
			return false;
		}
		else if(formName.clientname_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname_n.value= "";
		formName.clientname_n.focus();
		return false;
		}
		else if(!formName.clientname_n.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname_n.value= "";
			formName.clientname_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone_n.focus();
			return false;
		}
		else if(!formName.clientphone_n.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
		
		else if(formName.clientphone_n.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone_n.value= "";
			formName.clientphone_n.focus();
			return false;
		}
	else if(formName.category_n.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category_n.focus();
			return false;
		}
		else if(formName.category_n.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category_n.value= "";
		formName.category_n.focus();
		return false;
		}
		
		/*else if(postcard_back_n==-1 || postcard_back_n==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back_n.focus();
			return false;
		}*/
	 else if(month_n==-1 || month_n==0)
		{
			alert(MONTH);
			formName.month_id_n.focus();
			return false;
		}
       else if(mailregion_n==-1 || mailregion_n==0)
		{
			alert(EDITIONNAME);
			formName.mailregion_n.focus();
			return false;
		}
		else if(formName.quantity_n.value!='' && !formName.quantity_n.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity_n.value= "";
			formName.quantity_n.focus();
			return false;
		}
		else 
		return true;
		
		
 }
 
else if(document.getElementById('radio_client').value==1)
{
	var postcard_back = document.getElementById('postcard_back').selectedIndex;

	var mailregion = document.getElementById('mailregion').selectedIndex;
	var month_1 = document.getElementById('month_id').selectedIndex;


	if(formName.company.value=='')
		{
			alert(COMPANYNAME);
			formName.company.focus();
			return false;
		}
		
		else if(formName.company.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECOMPANYNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!isNaN(formName.company.value.charAt(0)))
		{
		alert(INVALIDCOMPANYNUMBERNAME);
		formName.company.value= "";
		formName.company.focus();
		return false;
		}
		
		else if(!formName.company.value.match(reg_exp_nm))
		{
			alert(VAIDCOMPANY_NAME);
			formName.company.value= "";
			formName.company.focus();
			return false;
		}
		
		else if(formName.website.value=='')
		{   
			alert(WEBSITE);
			formName.website.focus();
			return false;
		}
		
		
		else if(formName.website.value.charAt(0)==' ')
		{
		alert(INVALIDSPACEWEBSITE);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if((formName.website.value.substr(0,11)!='http://www.') && (formName.website.value.substr(0,12)!='https://www.') && (formName.website.value.substr(0,11)!='HTTP://WWW.') && (formName.website.value.substr(0,12)!='HTTPS://WWW.'))
		{
			//alert('ss'+formName.website_n.value.substr(0,4));
		alert(INVALID_WEBSITEURL);
		formName.website.value= "";
		formName.website.focus();
		return false;
		}
		else if(formName.clientname.value=='')
		{
			alert(CLIENT_NAME);
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientname.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECLIENTNAME);
		formName.clientname.value= "";
		formName.clientname.focus();
		return false;
		}
		else if(!formName.clientname.value.match(reg_exp_char))
		{
			alert(VAIDCLIENT_NAME);
			formName.clientname.value= "";
			formName.clientname.focus();
			return false;
		}
		else if(formName.clientphone.value=='')
		{
			alert(CLIENTPHONE);
			formName.clientphone.focus();
			return false;
		}
		else if(!formName.clientphone.value.match(zip_code))
		{
			alert(VALIDCLIENTPHONE);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.clientphone.value.length < 8)
		{
			alert(VAILDCLIENTPHONELENGTH);
			formName.clientphone.value= "";
			formName.clientphone.focus();
			return false;
		}
		else if(formName.category.value=='')
		{
			alert(CATEGORYNAMEFRANCHISE);
			formName.category.focus();
			return false;
		}
		else if(formName.category.value.charAt(0)==' ')
		{
		alert(INVALIDSPACECATEGORY);
		formName.category.value= "";
		formName.category.focus();
		return false;
		}
		/*else if(postcard_back==-1 || postcard_back==0)
		{
			alert(POSTCARD_BACK);
			formName.postcard_back.focus();
			return false;
		}*/
 else if(month_1==-1 || month_1==0)
		{
			alert(MONTH);
			formName.month_id.focus();
			return false;
		}

    else if(mailregion==-1 || mailregion==0)
		{
			alert(EDITIONNAME);
			formName.mailregion.focus();
			return false;
		}
		else if(formName.quantity.value!='' && !formName.quantity.value.match(zip_code))
		{
			alert(VALIDQUANTITY);
			formName.quantity.value= "";
			formName.quantity.focus();
			return false;
		}
 		else 
		return true;
			
	}
		

}
