// JavaScript Document

//javascripts that were originally embedded on the main page

function win(fileName) {

	myFloater = window.open('','myWindow','scrollbars=yes,status=no,width=300,height=300')

	myFloater.location.href = fileName;

	

	if (window.focus) {myFloater.focus()}

	

}

function winimage(fileName,width,height) {

	myFloater = window.open('','myWindow','scrollbars=yes,resizable=yes,status=no,width=' + width + ',height=' + height)

	myFloater.location.href = fileName;

}



var debug = 0;

var status = '';



function createRequestObject() {

	var ro;

	var browser = navigator.appName;

	if(browser == 'Microsoft Internet Explorer'){

		ro = new ActiveXObject("Microsoft.XMLHTTP");

	}else{

		ro = new XMLHttpRequest();

	}

	return ro;

}



var http = createRequestObject();



function sendReq(action, b) {

	if (b){

		b = '&amp;b='+b;

	}

	if (action=='close'){

		//use different url for close/cron routines

		url = 'cron.php?action=cron';

	} else {

		//so that page is valid, and ajax still works.

		url = '?a=ajax&amp;action='+action+b;

		url = url.replace(/amp;/ig,"");

	}

	if(debug) {

		status += 'URL: '+url+'\n';

		alert(status);

	}

	try {

		http.open('get', url);

		if(debug)

			status += 'Request sent\n\n';

		http.onreadystatechange = handleResponse;

		http.send(null);

	} catch(exception) {

			if(debug)	alert('exception error is . . . \n\n'+exception);

		}

}



function handleResponse() {

	if(http.readyState == 4) {

  var response = http.responseText;

  var update = new Array();

  if(response.indexOf('|') != -1) {

	update = response.split('|');

	if(debug) {

				alert('Debug: \n\t'+status+'\n\nupdate[0] = '+update[0]+'\n\nupdate[1] = '+update[1]);

				status = '';

			}

			if (document.getElementById(update[1]))

		  document.getElementById(update[1]).innerHTML = update[0];

		if (document.getElementById(update[2]))

			document.getElementById(update[2]).innerHTML = update[0];

		if (document.getElementById(update[3]))

			document.getElementById(update[3]).innerHTML = update[0];

		if (document.getElementById(update[4]))

			document.getElementById(update[4]).innerHTML = update[0];

		} else if(debug)

				alert ('Debug: \n\t'+status+'\n\n'+response);

	}

}



sendReq('close', '');



function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth;document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}



function rates(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function search(url,w,h){if((w==440) && (h==360)){window.open(url,"","status=0,scrollbars=0,resizable=0,toolbar=0,location=0,width="+440+",height="+360);} else {window.open(url,"","status=0,scrollbars=1,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function scams(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=1,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=1,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function photos(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function why(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=0,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function how(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=0,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function faq(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=0,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function adrates(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function calculator(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

function dealers(url,w,h){if((w==0) && (h==0)){window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);} else {window.open(url,"","status=0,scrollbars=0,resizable=1,toolbar=0,location=0,width="+w+",height="+h);}

}

