
//ADD PRODUCT FUNCTION	
	function addProduct(intPrice, intProductID, intSubmit, strDiv2TurnOff, strDiv2TurnOn, intItemNumber ) {
		
		//Add Product
		xmlHttp=GetXmlHttpObject()
		
        if (xmlHttp==null){
	        alert ("Browser does not support HTTP Request")
	        return;
    	}
	
	    var url="preHTML_addProduct.asp"
	
	    url =url+"?cboProductID="+intProductID+"&price="+intPrice+"&ItemNumber="+intItemNumber
		xmlHttp.onreadystatechange= function showDays() {
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				//document.getElementById("testDiv").innerHTML=xmlHttp.responseText;
			} 
		}
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		
		//UPDATE SHOPPING CART TOTAL
		xmlHttp=GetXmlHttpObject()
		
        if (xmlHttp==null){
	        alert ("Browser does not support HTTP Request")
	        return;
    	}
	
	    var url="preHTML_updateCartTotal.asp"
	
	    
		xmlHttp.onreadystatechange= function() {
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				document.getElementById("cartTotal").innerHTML=xmlHttp.responseText;
				if (intSubmit == 1) {
        		    document.formProduct.submit();
		        }
			} 
		}
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)	
		
		if (strDiv2TurnOff != '') {
		    document.getElementById(strDiv2TurnOff).style.display = 'none';
		}
		if (strDiv2TurnOn != '') {
		    document.getElementById(strDiv2TurnOn).style.display = '';
		}

	
	}
	
// ADD SUB PRODUCT FUNCTION	
	function addSubProduct( intGo2Cart, strDiv2TurnOff, strDiv2TurnOn, counter, intSkip ) {
		if (intSkip == 1) {

		var intPrice
		var intProductID
		var intItemNumber
		var arrPrice, arrProductID
		
		
		for ( var i=0, len=counter; i<len; ++i ){
			
			//if item is checked.  get price and product id and add product
			
			if (document.getElementById('chkSelected'+myArray[i+'0']).checked == true) {
			    intProductID = myArray[i+'0']
			    intPrice = myArray[i+'1']
			    intItemNumber = myArray[i+'2']
			    		       
		        //Add Product
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_addProduct.asp"
        	
	            url =url+"?cboProductID="+intProductID+"&price="+intPrice+"&ItemNumber="+ intItemNumber
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				       // document.getElementById("testDiv").innerHTML= document.getElementById("testDiv").innerHTML + '<br>' + xmlHttp.responseText;
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)
        		
		        //UPDATE SHOPPING CART TOTAL
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_updateCartTotal.asp"
        	
        	    
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				        document.getElementById("cartTotal").innerHTML=xmlHttp.responseText;
				        if (intGo2Cart == 1) {
		                   document.formProduct.submit();
		                }
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)	
			    
			}
		}
		}
		else {
		    //not adding any sub products to cart.  Move on and deal with it.
	        if (intGo2Cart == 1) {
               document.formProduct.submit();
            }
		}
		
		
		if (strDiv2TurnOff != '') {
		    document.getElementById(strDiv2TurnOff).style.display = 'none';
		}
		if (strDiv2TurnOn != '') {
		    document.getElementById(strDiv2TurnOn).style.display = '';
		}
		
		    
		
	
	}

function addSubProduct2( intGo2Cart, strDiv2TurnOff, strDiv2TurnOn, counter, intSkip ) {
		if (intSkip == 1) {

		var intPrice
		var intProductID
		var intItemNumber
		var arrPrice, arrProductID
		
		
		for ( var i=0, len=counter; i<len; ++i ){
			
			//if item is checked.  get price and product id and add product

			if (document.getElementById('chkSelected'+myArray2[i+'0']).checked == true) {
			    intProductID = myArray2[i+'0']
			    intPrice = myArray2[i+'1']
			    intItemNumber = myArray2[i+'2']
			    		       
		        //Add Product
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_addProduct.asp"
        	
	            url =url+"?cboProductID="+intProductID+"&price="+intPrice+"&ItemNumber="+ intItemNumber
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				       // document.getElementById("testDiv").innerHTML= document.getElementById("testDiv").innerHTML + '<br>' + xmlHttp.responseText;
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)
        		
		        //UPDATE SHOPPING CART TOTAL
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_updateCartTotal.asp"
        	
        	    
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				        document.getElementById("cartTotal").innerHTML=xmlHttp.responseText;
				        if (intGo2Cart == 1) {
		                   document.formProduct.submit();
		                }
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)	
			    
			}
		}
		}
		else {
		    //not adding any sub products to cart.  Move on and deal with it.
	        if (intGo2Cart == 1) {
               document.formProduct.submit();
            }
		}
		
		
		if (strDiv2TurnOff != '') {
		    document.getElementById(strDiv2TurnOff).style.display = 'none';
		}
		if (strDiv2TurnOn != '') {
		    document.getElementById(strDiv2TurnOn).style.display = '';
		}
		
		    
		
	
	}
	
function addSubProduct3( intGo2Cart, strDiv2TurnOff, strDiv2TurnOn, counter, intSkip ) {
		if (intSkip == 1) {

		var intPrice
		var intProductID
		var intItemNumber
		var arrPrice, arrProductID
		
		
		for ( var i=0, len=counter; i<len; ++i ){
			
			//if item is checked.  get price and product id and add product

			if (document.getElementById('chkSelected'+myArray3[i+'0']).checked == true) {
			    intProductID = myArray3[i+'0']
			    intPrice = myArray3[i+'1']
			    intItemNumber = myArray3[i+'2']
			    		       
		        //Add Product
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_addProduct.asp"
        	
	            url =url+"?cboProductID="+intProductID+"&price="+intPrice+"&ItemNumber="+ intItemNumber
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				       // document.getElementById("testDiv").innerHTML= document.getElementById("testDiv").innerHTML + '<br>' + xmlHttp.responseText;
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)
        		
		        //UPDATE SHOPPING CART TOTAL
		        xmlHttp=GetXmlHttpObject()
        		
                if (xmlHttp==null){
	                alert ("Browser does not support HTTP Request")
	                return;
    	        }
        	
	            var url="preHTML_updateCartTotal.asp"
        	
        	    
		        xmlHttp.onreadystatechange= function showDays() {
			        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				        document.getElementById("cartTotal").innerHTML=xmlHttp.responseText;
				        if (intGo2Cart == 1) {
		                   document.formProduct.submit();
		                }
			        } 
		        }
		        xmlHttp.open("GET",url,true)
		        xmlHttp.send(null)	
			    
			}
		}
		}
		else {
		    //not adding any sub products to cart.  Move on and deal with it.
	        if (intGo2Cart == 1) {
               document.formProduct.submit();
            }
		}
		
		
		if (strDiv2TurnOff != '') {
		    document.getElementById(strDiv2TurnOff).style.display = 'none';
		}
		if (strDiv2TurnOn != '') {
		    document.getElementById(strDiv2TurnOn).style.display = '';
		}
		
		    
		
	
	}
	
//GET XML HTTP OBJECT FUNCTION	
function GetXmlHttpObject(){ 
    var objXMLHttp=null
    if (window.XMLHttpRequest){
        objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject){
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
} 	
	
    
