  function trimmer(untrimed){
  		var regexp = /^\s+/ 		
		return untrimed.replace(regexp, "") 

  }
	
	function CalculateC(url) {
						/*************************************************************************/
							var xmlhttp=false;
							try { 
								xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //here simply we are creating object
							} catch (e) { 
										try { 
											xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //here simply we are creating object
										} catch (E) { 
											xmlhttp = false; 
										}//try {  
							}//	try { 
						
							if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
								xmlhttp = new XMLHttpRequest();//here simply we are creating object
							}
						/*************************************************************************/
	

		xmlhttp.open("POST", url,true); 
	
		xmlhttp.onreadystatechange = function() { 
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 		
		var finalprice=trimmer(xmlhttp.responseText);
		if(finalprice==''){
			alert("NO Calculation!");			
			}else{
				document.form1.c.value=finalprice;


}
//		alert(xmlhttp.responseText);
//		window.focus();
		} 
		}//xmlhttp.onreadystatechange = function() { 
		xmlhttp.send(null);
	}
	
	
	
	
	
	function getAddressState(url) {
						/*************************************************************************/
							var xmlhttp=false;
							try { 
								xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //here simply we are creating object
							} catch (e) { 
										try { 
											xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //here simply we are creating object
										} catch (E) { 
											xmlhttp = false; 
										}//try {  
							}//	try { 
						
							if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
								xmlhttp = new XMLHttpRequest();//here simply we are creating object
							}
						/*************************************************************************/
	

		xmlhttp.open("POST", url,true); 
	
		xmlhttp.onreadystatechange = function() { 
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 		
		var finalprice=trimmer(xmlhttp.responseText);		


		if(finalprice==''){
			document.getElementById("locations_address").innerHTML="";
			alert("Sorry, we do not have agents in this Location. \r\n Please call the Customer Service Department");			
		}else{
				//alert(finalprice);
			document.getElementById("locations_address").innerHTML= finalprice;
		}
		//alert(xmlhttp.responseText);
		window.focus();
		} 
		}//xmlhttp.onreadystatechange = function() { 
		xmlhttp.send(null);
	}
	
	
	
	
	
/******************************************************************************************************/
function FinalPrice(url) {
						/*************************************************************************/
							var xmlhttp=false;
							try { 
								xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //here simply we are creating object
							} catch (e) { 
										try { 
											xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //here simply we are creating object
										} catch (E) { 
											xmlhttp = false; 
										}//try {  
							}//	try { 
						
							if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
								xmlhttp = new XMLHttpRequest();//here simply we are creating object
							}
						/*************************************************************************/
	

		xmlhttp.open("POST", url,true); 
	
		xmlhttp.onreadystatechange = function() { 
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 		
		var finalprice=trimmer(xmlhttp.responseText);
		if(finalprice==''){
			alert("Price Not Available with cover "+document.form1.cover.value+" ,Set up "+document.form1.proof.value+" ,Additions "+document.form1.finishing.value+" Shipping Handling "+document.form1.shipping_handling.value);
			
		document.getElementById("submitbutton").style.display="none";			
		document.getElementById("totalprice").innerHTML="Price Not Available";
		document.form1.total_price.value="0";
			}else{
		document.getElementById("submitbutton").style.display="block";							
		document.getElementById("totalprice").innerHTML="$&nbsp;"+finalprice;
		document.form1.total_price.value=finalprice;


}
//		alert(xmlhttp.responseText);
//		window.focus();
		} 
		}//xmlhttp.onreadystatechange = function() { 
		xmlhttp.send(null);
	}
	
	function FinalCopiesPrice(url) {
						/*************************************************************************/
							var xmlhttp=false;
							try { 
								xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); //here simply we are creating object
							} catch (e) { 
										try { 
											xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //here simply we are creating object
										} catch (E) { 
											xmlhttp = false; 
										}//try {  
							}//	try { 
						
							if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
								xmlhttp = new XMLHttpRequest();//here simply we are creating object
							}
						/*************************************************************************/
	

		xmlhttp.open("POST", url,true); 
	
		xmlhttp.onreadystatechange = function() { 
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 		
		var finalprice=trimmer(xmlhttp.responseText);
		if(finalprice==''){
//			alert("Price Not Available for size "+document.form1.size.value+" with paper "+document.form1.paper.value+" , Proof "+document.form1.proof.value+" Shipping Handling "+document.form1.shipping_handling.value);
			
		document.getElementById("submitbutton").style.display="none";			
//		document.getElementById("totalprice").innerHTML="Price Not Available";
		document.form1.total_price.value="0";
			}else{
		document.getElementById("submitbutton").style.display="block";							
		document.getElementById("totalprice").innerHTML="$&nbsp;"+finalprice;
		document.form1.total_price.value=finalprice;
		}
//		alert(xmlhttp.responseText);
//		window.focus();
		} 
		}//xmlhttp.onreadystatechange = function() { 
		xmlhttp.send(null);
	}	
