// OnChange, change the search list
// --------------------------------
function ajax_search(code) {
	xmlHttp=GetXmlHttpObject()
	var url="scripts/content/ajax_search.php";
	url=url+"?code="+code;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} // end function

function sear_disp(m_cat,s_cat) {
   window.location="store.html?cat="+ m_cat +"&sub="+ s_cat;
} // end function

function stateChanged() {
	if (xmlHttp.readyState==4) {
		var explode = xmlHttp.responseText;

		var explodes = new Array();
		explodes = explode.split('~');

		document.getElementById(explodes[0]).options.length = 0;

		var get_val = explodes[1];

		var get_vals = new Array();
		get_vals = get_val.split('|');

		for (loop=0;loop<get_vals.length;loop++){
			var get_desc = new Array();
			get_desc = get_vals[loop].split(',');

			document.getElementById(explodes[0]).options[loop] = new Option(get_desc[1],get_desc[0]);
		} // end for
	} // end if
} // end function
// --------------------------------

// AJAX CAPABILITY
function GetXmlHttpObject() {
	var xmlHttp=null;

	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}