var xmlHttp

function noAjax() {

	alert("Sorry, your browser has AJAX disabled. This may cause some difficulty with some of the sites features. Please enable AJAX to gain full accessibility of these features.");

}

function changeLetter(letter) {

	xmlHttp = GetXmlHttpObject();
	
	if (xmlHttp==null) {
  	noAjax();
  	return;
  }
	
	var url = "sources/ajax/manufacturers.php";
	url = url + "?l=" + letter;
	xmlHttp.onreadystatechange=showManufacturers;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

function showManufacturers() {
	document.getElementById("listing").innerHTML=xmlHttp.responseText;	
}

function GetXmlHttpObject() {
	var xmlHttp=null;

	try {
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	} catch (e) {

		try {
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    	} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}
		
  	}
	
	return xmlHttp;
}

function serviceCheck(zip) {
	url = "serviceCheck.php";
	url = url + "?zip=" + zip;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=310,height=310');");
}

function parentLink(url){
	self.opener.location = url;
}

function deleteConfirm(id, email, password){

	var box = confirm("Are you sure you want to delete this listing? This is permanent!");
	
	if(box){
		window.location = 'http://ais-service.net/classifieds/delete/' + id + '/' + email + '/' + password;
	} else {
		// Do nothing.
	}

}
