function cust_inf()
{
	var s=document.form1;
	var user=document.form1.email.value;
	var user1=document.form1.alt_email.value;
	
 	if(s.title.value=="select")
	{
	alert ("Please select the title");
	s.title.focus()
	return false;
	}
	if(s.firstname.value=="")
	{
	alert ("Please enter the first name");
	s.firstname.focus()
	return false;
	}
	if(s.hand_phone.value=="")
	{
	alert ("Please enter the hand phone");
	s.hand_phone.focus()
	return false;
	}
	if(s.address1.value=="")
	{
	alert ("Please enter the address");
	s.address1.focus()
	return false;
	}
	if(s.city.value=="")
	{
	alert ("Please enter the city");
	s.city.focus()
	return false;
	}
	if(s.state.value=="")
	{
	alert ("Please enter the state/province");
	s.state.focus()
	return false;
	}
	if(s.zip.value=="")
	{
	alert ("Please enter the zip/postal code");
	s.zip.focus()
	return false;
	}
	if(s.country.value=="")
	{
	alert ("Please enter the country");
	s.country.focus()
	return false;
	}
	if((user=="")|| (user=="Enter Your E-Mail ID"))
	{
		alert("Please enter your email");
		s.email.focus();
		return false;
		}
		else if (Email(user))
		{
		alert("Please enter valid email Id  (e.g.: yourname@hotmail.com) ");
		s.email.focus();
		
		return false;
	}
	
	if(s.alt_email.value!="")
	{
	 if (Email(user1))
		{
		alert("Please enter valid email Id  (e.g.: yourname@hotmail.com) ");
		s.alt_email.focus();
		return false;
	}
   }
   
   
   if(s.website.value!="")
	{
	 var theurl=s.website.value;
	 var tomatch= ("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$")
	 if (!tomatch.test(theurl))
	 {
	 alert("Please enter valid URL");
	 s.website.focus()
	 s.website.select()
	 return false; 
	}
	}
	
	document.form1.submit();
}


function logo_design_inf()
{
	var s=document.form1;
 	if(s.company_name.value=="")
	{
	alert ("Please enter the company name");
	s.company_name.focus()
	return false;
	}
	if(s.tag_line.value=="")
	{
	alert ("Please enter the tag line");
	s.tag_line.focus()
	return false;
	}
	if((s.url.value=="")||(s.url.value=="http://"))
	{
	alert ("Please enter website");
	s.url.focus()
	s.url.select()
	return false;
	}
	else
	{
	 var theurl=s.url.value;
	 var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
	 if (!tomatch.test(theurl))
	 {
	 alert("Please enter valid URL");
	 s.url.focus()
	 s.url.select()
	 return false; 
	}
	}
	if(s.com_details.value=="")
	{
	alert ("Please enter the company description");
	s.com_details.focus()
	return false;
	}
	if(s.logo_concept.value=="")
	{
	alert ("Please enter the logo concept");
	s.logo_concept.focus()
	return false;
	}
	if(s.logo_effect.value=="select")
	{
	alert ("Please select the logo effect");
	s.logo_effect.focus()
	return false;
	}
	if(s.prefered_color.value=="")
	{
	alert ("Please enter the prefered color");
	s.prefered_color.focus()
	return false;
	}
	 if(s.confirm_agreement.checked)
   {
		var move="true";
	}
	if(move!="true")
	{
		alert("You can not Order unless you agree to the Terms & Conditions.");
		s.confirm_agreement.focus();
		return false;
	}
	document.form1.submit();
}

function brochure_design_inf()
{
	var s=document.form1;
	var opt = document.getElementsByName('logo');
	
 	if(s.company_name.value=="")
	{
	alert ("Please enter the company name");
	s.company_name.focus()
	return false;
	}
	if(s.tag_line.value=="")
	{
	alert ("Please enter the tag line");
	s.tag_line.focus()
	return false;
	}
	if((s.url.value=="")||(s.url.value=="http://"))
	{
	alert ("Please enter website");
	s.url.focus()
	s.url.select()
	return false;
	}
	else
	{
	 var theurl=s.url.value;
	 var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
	 if (!tomatch.test(theurl))
	 {
	 alert("Please enter valid URL");
	 s.url.focus()
	 s.url.select()
	 return false; 
	}
	}
	if(s.business_type.value=="select")
	{
	alert ("Please select the business type");
	s.business_type.focus()
	return false;
	}
	if(s.com_details.value=="")
	{
	alert ("Please enter the company description");
	s.com_details.focus()
	return false;
	}
	if(s.brochure_concept.value=="")
	{
	alert ("Please enter the brochure concept");
	s.brochure_concept.focus()
	return false;
	}
	if(s.brochure_style.value=="select")
	{
	alert ("Please select the brochure style");
	s.brochure_style.focus()
	return false;
	}
	if(s.brochure_effect.value=="select")
	{
	alert ("Please select the brochure effect");
	s.brochure_effect.focus()
	return false;
	}
	if(s.brochure_effect.value=="select")
	{
	alert ("Please select the brochure effect");
	s.brochure_effect.focus()
	return false;
	}
	
	var j=0; 
	if(opt[j].checked)
	{	
	if(opt[j].value=="Yes")
	{
	if(s.logo_image.value=="")
	{
		alert("Please select the logo");
		s.logo_image.focus();
		return false;	
	}
  }
    }
    
	if(s.prefered_color.value=="")
	{
	alert ("Please enter the prefered color");
	s.prefered_color.focus()
	return false;
	}
	 if(s.confirm_agreement.checked)
   {
		var move="true";
	}
	if(move!="true")
	{
		alert("You can not Order unless you agree to the Terms & Conditions.");
		s.confirm_agreement.focus();
		return false;
	}
	document.form1.submit();
}
function Email(str)
	{
		  var supported = 0;
			if (window.RegExp)
			{
			var tStr = "a";
			var tReg = new RegExp(tStr);
			if (tReg.test(tStr)) supported = 1;
			}
			if (!supported)
			return (str.indexOf(".") <= 2) || (str.indexOf("@") < 0);
			var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
			var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			return (r1.test(str) || !r2.test(str));
		}
function isNumberKey1(evt)
      {
	  
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
         {
	         alert("Please enter only numbers");
            return false;
        }

         return true;

      }
      
 function isNumberKey(evt)
      {
	  
          var charCode = (evt.which) ? evt.which : event.keyCode
         if ((charCode >=48 && charCode <=57 )|| (charCode == 43 )|| (charCode == 46 )||(charCode == 10 )||(charCode == 13 )|| (charCode == 8)||(charCode == 32)||(charCode == 45))
        {
	       return true; 
        }
         else
          {
	         alert("Please enter only numbers");
            return false;
        }
        

      }
function isStringKey(evt)
{
  var charCode = (evt.which) ? evt.which : event.keyCode
  if ((charCode >=97 && charCode <=122 ) || (charCode >=65 && charCode <=90 )|| (charCode == 32)|| (charCode == 46)|| (charCode == 127)|| (charCode == 8) )
  {
  return true; 
  }
  else
  {
  alert("Please enter only alphabets");
  
  return false;
  }
}

    
//Limiting Character validation   
function limitlength(obj, length)
{
	var maxlength=length
	if (obj.value.length>maxlength)
	{
	obj.value=obj.value.substring(0, maxlength)
	alert ("Please enter only "+maxlength+" characters");
     }
}  
function back()
{
	alert("d");
	document.form1.submit();
}
