	
	   function Validation_quote(thisform){ 
	
			with (thisform){
	
				if (your_name.value==your_name.defaultValue) your_name.value="";
	
			 	if (emptyvalidation(your_name,"Please fill in your Name.")==false){
	
			 		your_name.select();
	
			 		your_name.focus();
	
					return false;
	
				}


			 	if (emptyvalidation(phone_quote,"Please fill in your Phone number.")==false) {
	
			 		phone_quote.select();
	
			 		phone_quote.focus();
	
					return false;
	
				}
	
				if (emptyvalidation(company_name,"Please fill in your Company/Organization Name.")==false) {
	
					company_name.select();
	
					company_name.focus();
	
					return false;
	
				}
	
				if (Email_quote.value==Email_quote.defaultValue) Email_quote.value="";
	
				if (emptyvalidation(Email_quote,"Please fill in your Email Address.")==false){
	
					Email_quote.select();
	
					Email_quote.focus();
	
					return false;
	
				}	
				
				if (emailvalidation(Email_quote)==false){
					Email_quote.select();
			
					Email_quote.focus();
			
					return false;
			
				}

				if (emptyvalidation(project_type,"Please select your project type.")==false){
	
					project_type.select();
	
					project_type.focus();
	
					return false;
	
				}

				if (emptyvalidation(budget,"Please select your budget.")==false) {
	
					budget.select();
	
					budget.focus();
	
					return false;
	
				}
				
				document.request_quote.submit();
	
		}
	
		return false;
	
	}
	
	function emailvalidation(thisform) {
	
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	
	   var address = thisform.value;
	
	   var email = address.split(',');
	
	   for (var i = 0; i < email.length; i++) {
	
		   if(reg.test(email[i]) == false) {
		
		      alert('Invalid Email Address');
		
		      return false;
		
		   }
	
	   }
	
	}
	
	function emptyvalidation(entered, alertbox)
	
	{
	
		with (entered)
	
		{
		
			while (value.charAt(0) == ' ')
	
			value = value.substring(1);
	
			while (value.charAt(value.length - 1) == ' ')
	
			value = value.substring(0, value.length - 1);
	
			if (value==null || value=="")
	
			{
	
			if (alertbox!="") alert(alertbox);
	
			return false;
	
			}
	
			else 
				return true;
	
		}
	
	}

	function handleSelect(elm){
		
		if(elm.value=="Other"){
			$("#source").html("<input type='text' id='other' name='source' name='text'></input>");
			$("#other").focus();
		}
	}


	$(function () {
		  var $list = $('#select_source');
		  
		  $list.keypress(function (e) {
		    var keyCode = e.keyCode || e.which;
		    if ( keyCode == 40) {
		       if($(this).val()=="Newspaper"){
					$("#source").html("<input type='text' id='other' name='source' name='text'></input>");
					$("#other").focus();
				}
		    }
		    
		    if(keyCode == 38){
		    	if($(this).val()==""){
					$("#source").html("<input type='text' id='other' name='source' name='text'></input>");
					$("#other").focus();
				}
		    } 
		  });
		  
		});

