function logout() {
	if (confirm('Are you sure you want to sign out?')) {
		self.location = "/default.asp?act=logout"
	}
}

function pop_file(f, w, h) {
	var temp_url = f;
	var new_win = window.open(temp_url, 'pop' + h + w, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',left=0,top=0,alwaysRaised=yes');
	new_win.focus();
}

function external_site(u) {
	form = document.external_site;
	form.ExternalURL.value = u;
	form.target = '_blank';
	form.submit();
}

function check_search(opt) {
	form = document.search_form;
	if (form.SearchTerm.value == '') {
		alert('Please enter a search term and click "Search" again.');
		if (opt == 0) return false;
	} else {
		if (opt == 0)
			return true;
		else
			form.submit();
	}
}

function check_search2(opt) {
	form = document.search_form2;
	if (form.SearchTerm.value == '') {
		alert('Please enter a search term and click "Search" again.');
		if (opt == 0) return false;
	} else {
		if (opt == 0)
			return true;
		else
			form.submit();
	}
}

function ad_count(aid) {
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e1) {
		try {
			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e2) {
			xmlhttp = null;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	if (xmlhttp) {
		var qs = '?ID=' + aid;
		xmlhttp.open('GET', '/ad_link.asp' + qs, true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				if (xmlhttp.statusText == 'OK') {
					return;
				}
			}
		};
		xmlhttp.send(null);
	} else {
		document.location = '/ad_link.asp?ID=' + aid + '&src=' + escape(document.location);
	}
}

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-13040540-1']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/ javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https:// ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(ga, s);
})();

