//host location
//var host = "http://pc-davenport.sounddevices.local";
var host = 'http://'+window.location.host;
// figure out what xmlhttp object is supported by their browser and return it...
function getHTTPObject(){
	var xmlhttp = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	 // JScript gives us Conditional compilation, we can cope with old IE versions.
	 // and security blocked creation of the objects.
	 try {
	 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	 alert(e);
	 try {
	 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	 } catch (E) {
	 alert(E);
	 xmlhttp = false;
	 }
	 }
	 @end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} 
		catch (e) {
			xmlhttp = false;
			alert(e);
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} 
		catch (e) {
			xmlhttp = false;
			alert(e);
		}
	}
	return xmlhttp;
}

//used on /resellers/index.html
function showResellerPage(id, ddlObj) {
$('ajaxMsg').innerHTML = "<a href='./'>Dealer Search</a><img src='../images/blue-arrow-crumbs.gif' width='15' height='10' alt='' /> <img src='../images/loaderOrange.gif' />";
ho = getHTTPObject();
if (ho != null) {
	ho.open("GET", window.location.href + ddlObj.value, true);
	ho.send(null);
	
	ho.onreadystatechange = function() {
		if (ho.readyState == 4) {
			//window.location.href += "#" + ddlObj.value;
			$('ajaxMsg').innerHTML = "<a href='./'>Dealer Search</a><img src='../images/blue-arrow-crumbs.gif' width='15' height='10' alt='' /> " + ddlObj.options[ddlObj.selectedIndex].innerHTML;
			$(id).innerHTML = ho.responseText;
		}
	}
}
}


//searchform post query
function sfPostQuery(q, id) {
new Ajax.Request('http://pc-davenport.sounddevices.local/', {
	method: 'get',
	onSuccess: function(transport){
		alert('success');
		new Effect.Appear(id,{duration: .1});
	}
});
}

