var xmlhttp
if(document.getElementById){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/
if (!xmlhttp) {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}
}
function sendSelect(obj,url,target_select){
	var fd='',f = document.forms[obj.form.name];
	var ele = f.elements;
		for(i=0;i<ele.length;i++){
		fd += ele[i].name +'='+ escape(ele[i].value)+'&';
		}
	if(xmlhttp){
	xmlhttp.open("POST",url,true);
	var e = f.elements[target_select];
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
		var x =xmlhttp.responseText.replace(/\s{2,100}/gi,'');
			if(xmlhttp.responseText!=''){
			//alert(xmlhttp.responseText);
			
					e.options.length = 0;
		sString = x.split("|");
				for(var i=0;i<sString.length;i++){
				sValue = sString[i].split("*");
				if(sValue[1]!=null && sValue[1]!='')
				e.options[i] = new Option(sValue[1], sValue[0]);
				}
				if(e.options.length==0){
				e.options[0] = new Option('No matches found','');
				}
				f.elements[target_select].disabled = false;
				
			} else {
			e.options.length=0;
			e.options[0] = new Option('No matches found','');
			}
			
		}
	} 
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
 	xmlhttp.send(fd);
 	} 

}
function sendIsXMLhttp(destination){
if(xmlhttp){
	xmlhttp.open("GET",'../isxmlhttp.php?fd=true',true);
	xmlhttp.onreadystatechange=function() {	
	if (xmlhttp.readyState==4) {
	if(xmlhttp.status==200){
			location.href = destination;
			}
			}
	}
 	xmlhttp.send(null);
 	} 
}
function openPageWindow(url,winname,w,h){ // 24-04-2004 for McDonagh Furniture
	newWindow = window.open(url,winname,"width="+ w + ",height=" + h +",status=yes,resizable=no");
	newWindow.focus();
}