// JavaScript Document
function categorySelect(selname,selvalue){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }

		var file = 'getSelect.php?stype=categorySelect&sname='+selname+'&svalue='+selvalue; //This is the path to the file we just finished making *
    //alert(file);
	xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('categorySelect').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
					  if(selvalue>0){
							document.getElementById("searchCat").disabled = false;
							document.getElementById("searchCutType").disabled = true;
							document.getElementById("searchShape").disabled = true;
						}else{
							document.getElementById("searchCat").disabled = true;
							document.getElementById("searchCutType").disabled = true;
							document.getElementById("searchShape").disabled = true;
						}
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function cuttypeSelect(selname,selvalue,productId){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }

	var file = 'getSelect.php?stype=cuttypeSelect&sname='+selname+'&svalue='+selvalue+'&productId='+productId; //This is the path to the file we just finished making *
    //alert(file);
	xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('cuttypeSelect').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
					  if(selvalue>0){
							document.getElementById("searchCat").disabled = false;
							document.getElementById("searchCutType").disabled = false;
							document.getElementById("searchShape").disabled = true;
						}else{
							document.getElementById("searchCat").disabled = false;
							document.getElementById("searchCutType").disabled = true;
							document.getElementById("searchShape").disabled = true;
						}
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function shapeSelect(selname,selvalue,productId,catId){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }

		var file = 'getSelect.php?stype=shapeSelect&sname='+selname+'&svalue='+selvalue+'&productId='+productId+'&catId='+catId; //This is the path to the file we just finished making *
    //alert(file);
	xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('shapeSelect').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
					  if(selvalue>0){
							document.getElementById("searchCat").disabled = false;
							document.getElementById("searchCutType").disabled = false;
							document.getElementById("searchShape").disabled = false;
						}else{
							document.getElementById("searchCat").disabled = false;
							document.getElementById("searchCutType").disabled = false;
							document.getElementById("searchShape").disabled = true;
						}
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function getShippingService(countryId){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object.
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }

		var file = 'getShippingService.php?countryId='+countryId+'&isprecious='+document.getElementById('isprecious').value; //This is the path to the file we just finished making *
    //alert(file);
	xmlhttp.open('GET', file, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4){ //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('shippingService').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                }
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}