// JavaScript Document
function number(xxxxx)
        {
	                 var maintainplus = '';
                     var numval = xxxxx.value
 	                 curnumbervar = numval.replace(/[\\A-Za-z!"£%^&*+_=)({};:'@#~,-.¦\/<>?|`¬\]\[]/g,'');
 	                 xxxxx.value = maintainplus + curnumbervar;
 	                 var maintainplus = '';
 	                 xxxxx.focus;
       }	 
/* Starting Script For Trimimg  */

		 // Removes leading whitespaces
				 function LTrim( value ) 
				 	{
						var re = /\s*((\S+\s*)*)/;
						return value.replace(re, "$1");
	
					}

				// Removes ending whitespaces
				function RTrim( value ) 
					{
						var re = /((\s*\S+)*)\s*/;
						return value.replace(re, "$1");
					}

				// Removes leading and ending whitespaces
				function trim( value ) 	
					{
						return LTrim(RTrim(value));
	
					}
/* Ending Script For Trimimg  */	

function sendRequest()
{
		var sId5 = document.getElementById("selectservice").value;
	//	alert(sId5);
	
	    if(sId5=="Please Select an Option")
		 {
		   document.getElementById('div_dropdown').style.display='none';
		 }
	   
		if(sId5=="Web Media Services")
		 {
			  document.getElementById('div_dropdown').style.display='block';
		      document.getElementById('div_dropdown').innerHTML="<strong>Please select a sub option for service required : <font color=\"#FF0000\">*</font></strong><select name=\'ddl_submenu\' id=\'ddl_submenu\'><option value=\"Please Select an Option\" selected=\"selected\">Please Select an Option</option><option value=\'Website Design/Redesign\'>Website Design/Redesign</option><option value=\'Website Development\'>Website Development</option><option value=\'Website Maintenance\'>Website Maintenance</option><option value=\'Content Management\'>Content Management</option><option value=\'Internet Promotion\'>Internet Promotion</option><option value=\'Web Optimization\'>Web Optimization</option></select>";
		 }
	
	if(sId5=="Print Media Services")
		 {
			 document.getElementById('div_dropdown').style.display='block';
	         document.getElementById('div_dropdown').innerHTML="<strong>Please select a sub option for service required : <font color=\"#FF0000\">*</font></strong><select name=\"ddl_submenu\" id=\"ddl_submenu\" ><option value=\"Please Select an Option\" selected=\"selected\">Please Select an Option</option><option value=\"Brochure Design\">Brochure Design</option><option value=\"Logo Design\">Logo Design</option><option value=\"Corporate Identity Design\">Corporate Identity Design</option></select>";
		 }
	   
	    if(sId5=="Call Center Services")
		 {
			 document.getElementById('div_dropdown').style.display='block';
			 document.getElementById('div_dropdown').innerHTML="<strong>Please select a sub option for service required : <font color=\"#FF0000\">*</font></strong><select name=\"ddl_submenu\" id=\"ddl_submenu\"><option value=\"Please Select an Option\" selected=\"selected\">Please Select an Option</option><option value=\"Customer Care\">Customer Care</option><option value=\"Technical Support\">Technical Support</option><option value=\"Enterprise Help-desk\">Enterprise Help-desk</option></select>";
		 }
		 
}

function btn_reqqpg()
{
	if(document.getElementById("Name").value == "")
	{
	     alert("Please Enter Name");	
		 document.getElementById("Name").focus();
		 return false;
	}
	
	var email=document.getElementById("email");
			if(trim(email.value) < 1)
		     {
		           alert("Please Enter email.");
		           document.getElementById("email").value="";
		           document.getElementById("email").focus();
		           return false;
		     }
		    else 
		     {
				   var str=email.value;
		           var at="@";
		           var dot=".";
		           var lat=str.indexOf(at);
		           var lstr=str.length;
		           var ldot=str.indexOf(dot);
		
		           if(str.indexOf(at)==-1)
			        {
					       alert("Please enter valid e-mail ID.");
		 			       document.getElementById("email").value="";
					       document.getElementById("email").focus();
					       return false;
					}

			       if(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
				    {
		   		   		   alert("Please enter valid e-mail ID.");
		   				   document.getElementById("email").value="";
						   document.getElementById("email").focus();
						   return false;
					}

				   if(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
					{
		    			   alert("Please enter valid e-mail ID.");
		    			   document.getElementById("email").value="";
						   document.getElementById("email").focus();
						   return false;
					}

		 		   if(str.indexOf(at,(lat+1))!=-1)
					{
		    					  alert("Please enter valid e-mail ID.");
		    					  document.getElementById("email").value="";
						          document.getElementById("email").focus();
						          return false;
		 			}
 
                   if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
					{
		    			          alert("Please enter valid e-mail ID.");
		    			          document.getElementById("email").value="";
						          document.getElementById("email").focus();
						          return false;
		 			        }

		 		           if(str.indexOf(dot,(lat+2))==-1)
					        {
		    			          alert("Please enter valid e-mail ID.");
		    			          document.getElementById("email").value="";
						          document.getElementById("email").focus();
						          return false;
		 			        }
		
		 		           if(str.indexOf(" ")!=-1)
					        {
		    			          alert("Please enter valid e-mail ID.");
		    			          document.getElementById("email").value="";
						          document.getElementById("email").focus();
						          return false;
		 			        }
	             }

/*
   if(document.getElementById("company").value == "")
	{
	     alert("Please Enter Company");	
		 document.getElementById("company").focus();
		 return false;
	}
*/
   if(document.getElementById("phone").value == "")
	{
	     alert("Please Enter Phone Number");	
		 document.getElementById("phone").focus();
		 return false;
	}
	/*
	if(document.getElementById("address1").value == "")
	{
	     alert("Please Enter Street Address");	
		 document.getElementById("address1").focus();
		 return false;
	}
	
	if(document.getElementById("city").value == "")
	{
	     alert("Please Enter City");	
		 document.getElementById("city").focus();
		 return false;
	}
	
	if(document.getElementById("state").value == "")
	{
	     alert("Please Enter State");	
		 document.getElementById("state").focus();
		 return false;
	}
	
	if(document.getElementById("zip").value == "")
	{
	     alert("Please Enter Zip Code");	
		 document.getElementById("zip").focus();
		 return false;
	}
	
  if(document.form1.country.selectedIndex == 0)
    {
        alert("Please select your Country.");
        return false;
    }
	*/
   if(document.form1.selectservice.selectedIndex == 0)
    {
        alert("Please select your Services");
        return false;
    }

   if(document.form1.ddl_submenu.selectedIndex == 0 )
    {
        alert ( "Please Select a sub option for service" );
        return false;
    }

   if(document.getElementById("details").value == "")
	{
	     alert("Please Enter Your Requirements");	
		 document.getElementById("details").focus();
		 return false;
	}
	
	if(document.getElementById("security_code").value == "")
	{
	     alert("Please Enter Security Code");	
		 document.getElementById("security_code").focus();
		 return false;
	}
	
	return true;
}
