var isDOM=document.getElementById?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isIE=document.all?1:0;

function getDOMObj(obj)	{return document.getElementById(obj);}
function getIE4Obj(obj)	{return document.all[obj];}
function getNS4Obj(obj)	{}

if(document.getElementById)	myGetObject = getDOMObj
else if(document.all) myGetObject = getIE4Obj
else if(document.layers) myGetObject = getNS4Obj

function openWindow(dest,aw,ah,target) { 
	if (!aw) aw = 620;
	if (!ah) ah = 510;
	if (!target) target='infowindow'
	Win = window.open(dest,target,'width=' + aw + ',height=' + ah + ',resizable=1,scrollbars=yes,menubar=no,status=no,toolbar=no,location=no,directories=no' );
	Win.focus();
	return void(0);
}

function printWindow(aw,ah) {
	dest = window.location + "";
	if (dest.indexOf("?") > 0) {
		openWindow(window.location + '&print',aw,ah,'printpreview');
	} else {
		openWindow(window.location + '?print',aw,ah,'printpreview');
	}
}

function emailWindow(p) {
	dest = window.location + "";
	pass=window.location.href.split('/');
	pass=pass[pass.length-1];
	pass=pass.replace("?","&");
	window.location = 'email_page.cfm?page=' + pass;
}

function classToggle(o,n) {
	if (n) {
		o.tc=o.className;
		o.className=o.className + " " + n;
	} else {
		o.className=(o.tc) ? o.tc : null;
	}
}

function displayRndImage(a) {
	if (a.length == 0) return;
	var ranNum=Math.round(Math.random()*(a.length-1));
	tmpA=a[ranNum].split('|');
	if (tmpA[2] != '') document.write('<a href="' + tmpA[2] + '">');
	document.write('<img border=0 alt="' + tmpA[1] + '" src="' + tmpA[0] + '">');
	if (tmpA[2] != '') document.write('</a>');
}

function submitWith(variable, form) {
	if (!form) form = 'MainForm';
	myGetObject(form).action='?' + variable
	myGetObject(form).submit()
	return void(0);
}

