function swapImage(imgIndex,imgSource,imgWidth,imgHeight) {
	document[imgIndex].src = imgSource;
	document[imgIndex].width = imgWidth;
	document[imgIndex].height = imgHeight;
}

function hideAllMenus() {
	document.getElementById("menuFabric1").style.visibility = 'hidden';
	document.getElementById("menuFabric1").style.left = '-250px';
	document.getElementById("menuFabric2").style.visibility = 'hidden';
	document.getElementById("menuFabric2").style.left = '-250px';
	document.getElementById("menuFabric3").style.visibility = 'hidden';
	document.getElementById("menuFabric3").style.left = '-250px';
	document.getElementById("menuFabric4").style.visibility = 'hidden';
	document.getElementById("menuFabric4").style.left = '-250px';
	
	document.getElementById("menuSurface1").style.visibility = 'hidden';
	document.getElementById("menuSurface1").style.left = '-250px';
	document.getElementById("menuSurface2").style.visibility = 'hidden';
	document.getElementById("menuSurface2").style.left = '-250px';
	document.getElementById("menuSurface3").style.visibility = 'hidden';
	document.getElementById("menuSurface3").style.left = '-250px';
	document.getElementById("menuSurface4").style.visibility = 'hidden';
	document.getElementById("menuSurface4").style.left = '-250px';
	
	document.getElementById("selectMenuFabric").style.visibility = 'hidden';
	document.getElementById("selectMenuFabricCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuFabricStain").style.visibility = 'hidden';
	document.getElementById("selectMenuFabricStainCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuSurface").style.visibility = 'hidden';
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuSurfaceStain").style.visibility = 'hidden';
	document.getElementById("selectMenuSurfaceStainCategories").style.visibility = 'hidden';
}

function getScreen1() {
	document.getElementById("btnFabric").style.visibility = 'visible';
	document.getElementById("btnSurface").style.visibility = 'visible';
	hideAllMenus();
	document.getElementById("footerNav").style.visibility = 'hidden';
	document.getElementById("progressDiv").style.visibility = 'hidden';
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/fabric_or_surface.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/fabric_or_surface.gif','181','31');
	//loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen1');
}

function getScreen2Fabric() {
	hideAllMenus();
	document.getElementById("selectMenuFabricCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuFabric").style.visibility = 'visible';
	document.getElementById("menuFabric1").style.visibility = 'visible';
	document.getElementById("menuFabric1").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen1()' class='small_left_arrow'>Start Over</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/white_colored.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/white_colored.gif','119','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_2.gif','39','21');
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen2');
}

function getScreen2Surface() {
	hideAllMenus();
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuSurface").style.visibility = 'visible';
	document.getElementById("menuSurface1").style.visibility = 'visible';
	document.getElementById("menuSurface1").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen1()' class='small_left_arrow'>Start Over</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/where_surface.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/where_surface.gif','152','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_2.gif','39','21');
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen2');
}

function getScreen3Fabric() {
	hideAllMenus();
	var newLoc = document.getElementById("selectMenuFabric");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	document.getElementById("selectMenuFabricCategories").style.visibility = 'visible';
	document.getElementById("selectMenuFabric").style.visibility = 'hidden';
	document.getElementById("selectMenuFabricStain").style.visibility = 'hidden';
	document.getElementById("menuFabric2").style.visibility = 'visible';
	document.getElementById("menuFabric2").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen2Fabric()' class='small_left_arrow'>Select a different color</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/choose_fabric.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/choose_fabric.gif','105','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_3.gif','39','21');
	ajaxFunctionFabric('stain_category',arrayParam[1]+arrayParam[0]);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen3');
}

function getScreen3Surface() {
	hideAllMenus();
	var newLoc = document.getElementById("selectMenuSurface");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'visible';
	document.getElementById("selectMenuSurface").style.visibility = 'hidden';
	document.getElementById("selectMenuSurfaceStain").style.visibility = 'hidden';
	document.getElementById("menuSurface2").style.visibility = 'visible';
	document.getElementById("menuSurface2").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen2Surface()' class='small_left_arrow'>Select a different place</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/choose_fabric.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/choose_fabric.gif','105','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_3.gif','39','21');
	ajaxFunctionFabric('stain_category',arrayParam[1]+arrayParam[0]);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen3');
}

function getScreen4Fabric() {
	hideAllMenus();
	var newLoc = document.getElementById("selectMenuFabricStain");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	document.getElementById("selectMenuFabricCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuFabric").style.visibility = 'hidden';
	document.getElementById("selectMenuFabricStain").style.visibility = 'visible';
	document.getElementById("selectMenuFabricStainCategories").style.visibility = 'hidden';
	document.getElementById("menuFabric3").style.visibility = 'visible';
	document.getElementById("menuFabric3").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen3Fabric()' class='small_left_arrow'>Select a different fabric</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/kind_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/kind_mess.gif','215','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_4.gif','39','21');
	ajaxFunctionFabric('stain_category',arrayParam[2]+arrayParam[1]+arrayParam[0]);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen4');
}

function getScreen4Surface() {
	hideAllMenus();
	var newLoc = document.getElementById("selectMenuSurfaceStain");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'hidden';
	document.getElementById("selectMenuSurface").style.visibility = 'hidden';
	document.getElementById("selectMenuSurfaceStain").style.visibility = 'visible';
	document.getElementById("selectMenuSurfaceStainCategories").style.visibility = 'hidden';
	document.getElementById("menuSurface3").style.visibility = 'visible';
	document.getElementById("menuSurface3").style.left = '0px';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen3Surface()' class='small_left_arrow'>Select a different surface</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/kind_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/kind_mess.gif','215','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_4.gif','39','21');
	ajaxFunctionSurface('stain_category',arrayParam[2]+arrayParam[1]+arrayParam[0]);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen4');
}


function getFabricSelection() {
	document.getElementById("btnFabric").style.visibility = 'hidden';
	document.getElementById("btnSurface").style.visibility = 'hidden';
	document.getElementById("menuFabric1").style.visibility = 'visible';
	document.getElementById("menuFabric1").style.left = '0px';
	document.getElementById("selectMenuFabric").style.visibility = 'visible';
	document.getElementById("footerNav").style.visibility = 'visible';
	document.getElementById("progressDiv").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen1()' class='small_left_arrow'>Start Over</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/white_colored.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/white_colored.gif','119','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_2.gif','39','21');
	ajaxFunctionFabric('surface_type','fabric');
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen2');
}

function getSurfaceSelection() {
	document.getElementById("btnFabric").style.visibility = 'hidden';
	document.getElementById("btnSurface").style.visibility = 'hidden';
	document.getElementById("menuSurface1").style.visibility = 'visible';
	document.getElementById("menuSurface1").style.left = '0px';
	document.getElementById("selectMenuSurface").style.visibility = 'visible';
	document.getElementById("footerNav").style.visibility = 'visible';
	document.getElementById("progressDiv").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen1()' class='small_left_arrow'>Start Over</a>";
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/where_surface.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/where_surface.gif','152','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_2.gif','39','21');
	ajaxFunctionSurface('surface_type','surface');
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen2');
}


function getFabricCategories() {
	var newLoc = document.getElementById("selectMenuFabric");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/choose_fabric.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/choose_fabric.gif','105','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_3.gif','39','21');
	document.getElementById("selectMenuFabric").style.visibility = 'hidden';
	document.getElementById("menuFabric2").style.visibility = 'visible';
	document.getElementById("menuFabric2").style.left = '0px';
	document.getElementById("selectMenuFabricCategories").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen2Fabric()' class='small_left_arrow'>Select a different color</a>";
	ajaxFunctionFabric('surface_category',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen3');
}
function getSurfaceCategories() {
	var newLoc = document.getElementById("selectMenuSurface");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/choose_surface.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/choose_surface.gif','116','13');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_3.gif','39','21');
	document.getElementById("selectMenuSurface").style.visibility = 'hidden';
	document.getElementById("menuSurface2").style.visibility = 'visible';
	document.getElementById("menuSurface2").style.left = '0px';
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen2Surface()' class='small_left_arrow'>Select a different place</a>";
	ajaxFunctionSurface('surface_category',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen3');
}


function getFabricStain() {
	var newLoc = document.getElementById("selectMenuFabricCategories");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/kind_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/kind_mess.gif','215','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_4.gif','39','21');
	document.getElementById("selectMenuFabricCategories").style.visibility = 'hidden';
	document.getElementById("menuFabric3").style.visibility = 'visible';
	document.getElementById("menuFabric3").style.left = '0px';
	document.getElementById("selectMenuFabricStain").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen3Fabric()' class='small_left_arrow'>Select a different fabric</a>";
	ajaxFunctionFabric('stain',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen4');
}
function getSurfaceStain() {
	var newLoc = document.getElementById("selectMenuSurfaceCategories");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/kind_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/kind_mess.gif','215','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_4.gif','39','21');
	document.getElementById("selectMenuSurfaceCategories").style.visibility = 'hidden';
	document.getElementById("menuSurface3").style.visibility = 'visible';
	document.getElementById("menuSurface3").style.left = '0px';
	document.getElementById("selectMenuSurfaceStain").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen3Surface()' class='small_left_arrow'>Select a different surface</a>";
	ajaxFunctionSurface('stain',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen4');
}


function getFabricStainCategories() {
	var newLoc = document.getElementById("selectMenuFabricStain");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/your_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/your_mess.gif','126','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_5.gif','39','21');
	document.getElementById("selectMenuFabricStain").style.visibility = 'hidden';
	document.getElementById("menuFabric4").style.visibility = 'visible';
	document.getElementById("menuFabric4").style.left = '0px';
	document.getElementById("selectMenuFabricStainCategories").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen4Fabric()' class='small_left_arrow'>Select a different kind of mess</a>";
	ajaxFunctionFabric('stain_category',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen5');
}
function getSurfaceStainCategories() {
	var newLoc = document.getElementById("selectMenuSurfaceStain");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	//swapImage('advisorQuestion','','/img/tools/cleaning_advisor/your_mess.gif',1);
	swapImage('advisorQuestion','/img/tools/cleaning_advisor/your_mess.gif','126','15');
	swapImage('progressIndicator','/img/tools/cleaning_advisor/progress_5.gif','39','21');
	document.getElementById("selectMenuSurfaceStain").style.visibility = 'hidden';
	document.getElementById("menuSurface4").style.visibility = 'visible';
	document.getElementById("menuSurface4").style.left = '0px';
	document.getElementById("selectMenuSurfaceStainCategories").style.visibility = 'visible';
	document.getElementById("caFooterText").innerHTML = "&nbsp;&nbsp;&nbsp;<a href='javascript:getScreen4Surface()' class='small_left_arrow'>Select a different kind of mess</a>";
	ajaxFunctionSurface('stain_category',thisParam);
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen5');
}


function getFabricResults() {
	var newLoc = document.getElementById("selectMenuFabricStainCategories");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	window.location = "/tools/cleaning_advisor/cleaning_advisor_results.php?s="+arrayParam[0].replace('&','amp')+"&sc="+arrayParam[1]+"&u="+arrayParam[2]+"&uc="+arrayParam[3];
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen6');
}
function getSurfaceResults() {
	var newLoc = document.getElementById("selectMenuSurfaceStainCategories");
	var thisParam = newLoc.options[newLoc.selectedIndex].value;
	var arrayParam = thisParam.split("|");
	window.location = "/tools/cleaning_advisor/cleaning_advisor_results.php?s="+arrayParam[0].replace('&','amp')+"&sc="+arrayParam[1]+"&u="+arrayParam[2]+"&uc="+arrayParam[3];
	loadTrackingImages('/img/tracking.png?pageID=cleaningadvisor_screen6');
}

function ajaxFunctionFabric(param1,param2) {
	var xmlHttp;
	var thisArray;
	var j;
	try {
    	// Firefox, Opera 8.0+, Safari
    	xmlHttp=new XMLHttpRequest();
    }
  	catch (e) {
    	// Internet Explorer
    	try {
     		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      	}
    	catch (e) {
      		try {
        		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        	}
      		catch (e) {
        		alert("Your browser does not support AJAX!");
        		return false;
        	}
      	}
    }
    xmlHttp.onreadystatechange=function() {
    	if(xmlHttp.readyState==4) {
    		if (param1 == "surface_type") {
    			document.myForm.selectMenuFabric.options.length=1;
	        	thisArray = xmlHttp.responseText.split("|");
	        	j=1;
	        	for (i=0;i<thisArray.length;i++) {
	        		if (thisArray[i].length > 1) {
	        			document.myForm.selectMenuFabric.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		   	} else if (param1 == "surface_category") {
		    	document.myForm.selectMenuFabricCategories.options.length=1;
		        thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
		        	if (thisArray[i].length > 1) {
			        	document.myForm.selectMenuFabricCategories.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		   	} else if (param1 == "stain") {
		    	document.myForm.selectMenuFabricStain.options.length=1;
		        thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
		        	if (thisArray[i].length > 1) {
			        	document.myForm.selectMenuFabricStain.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		    } else if (param1 == "stain_category") {
		    	document.myForm.selectMenuFabricStainCategories.options.length=1;
		        thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
			        if (thisArray[i].length > 1) {	
			        	document.myForm.selectMenuFabricStainCategories.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		    }
		}
	}
	var arrayParam2 = param2.split("|");
	
	if (param1 == "surface_category") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?surface_category="+arrayParam2[0],true);
	} else if (param1 == "stain") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?surface_name="+arrayParam2[0]+"&surface_category="+arrayParam2[1],true);
	} else if (param1 == "stain_category") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?stain_category="+arrayParam2[0]+"&surface_name="+arrayParam2[1]+"&surface_category="+arrayParam2[2],true);
	} else {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?"+param1+"="+arrayParam2[0],true);
	}
    xmlHttp.send(null);
	
	
}

function ajaxFunctionSurface(param1,param2) {
	var xmlHttp;
	var thisArray;
	var j;
	try {
    	// Firefox, Opera 8.0+, Safari
    	xmlHttp=new XMLHttpRequest();
    }
  	catch (e) {
    	// Internet Explorer
    	try {
     		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      	}
    	catch (e) {
      		try {
        		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        	}
      		catch (e) {
        		alert("Your browser does not support AJAX!");
        		return false;
        	}
      	}
    }
    xmlHttp.onreadystatechange=function() {
    	if(xmlHttp.readyState==4) {
    		if (param1 == "surface_type") {
    			// BUILDS SELECT MENU FOR SURFACE LOCATIONS - i.e., surface_category_name
		        document.myForm.selectMenuSurface.options.length=1;
	        	thisArray = xmlHttp.responseText.split("|");
	        	j=1;
	        	for (i=0;i<thisArray.length;i++) {
	        		if (thisArray[i].length > 1) {
		        		document.myForm.selectMenuSurface.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		   	} else if (param1 == "surface_category") {
		    	// BUILDS SELECT MENU FOR SPECIFIC SURFACE - i.e., surface_name
		    	document.myForm.selectMenuSurfaceCategories.options.length=1;
		        thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
		        	if (thisArray[i].length > 1) {
			        	document.myForm.selectMenuSurfaceCategories.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
			} else if (param1 == "stain") {
		    	// BUILDS SELECT MENU FOR KIND OF MESS - i.e., stain_category_name
		    	document.myForm.selectMenuSurfaceStain.options.length=1;
		       	thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
		        	if (thisArray[i].length > 1) {
			        	document.myForm.selectMenuSurfaceStain.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
			} else if (param1 == "stain_category") {
		    	document.myForm.selectMenuSurfaceStainCategories.options.length=1;
		        thisArray = xmlHttp.responseText.split("|");
		        j=1;
		        for (i=0;i<thisArray.length;i++) {
		        	if (thisArray[i].length > 1) {
			        	document.myForm.selectMenuSurfaceStainCategories.options[j]=new Option(thisArray[i], thisArray[i]+"|"+param2, true, false);
						j++;
					}
				}
		    }
		}
	}
	var arrayParam2 = param2.split("|");
	
	if (param1 == "surface_category") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?surface_category="+arrayParam2[0],true);
	} else if (param1 == "stain") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?surface_name="+arrayParam2[0]+"&surface_category="+arrayParam2[1],true);
	} else if (param1 == "stain_category") {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?stain_category="+arrayParam2[0]+"&surface_name="+arrayParam2[1]+"&surface_category="+arrayParam2[2],true);
	} else {
		xmlHttp.open("GET","/php-bin/cleaning_advisor.php?"+param1+"="+arrayParam2[0],true);
	}
    xmlHttp.send(null);
}