function prevEmail(ID, emailserver, emailname, emailinner) {
	var span=document.getElementById(ID);
	if (span!=null) {
		var str="<a href='mailto:"+emailname+"@"+emailserver+"'>";
		if (emailinner=='') str+=emailname+"@"+emailserver;else str+=emailinner;
		str+="</a>";
		span.innerHTML=str;
	}
}

//called on page load (first 'full, non ajax' load);
$(document).ready(function () {
	main();
});

function main() {
	//disable right-click on entire document (copy-protect!)
	$(document).bind("contextmenu", function (e) { return false; });

	//disable right-click on just img elements (copy-protect!)
	//$('img').bind("contextmenu", function (e) { return false; });

	//change css class on form input fields when activated
	var inputs=$('input[type=text], input[type=password], select, textarea');
	inputs.triggerHandler("focus");
	inputs.focus(function () { $(this).addClass('input_onfocus'); });
	inputs.blur(function () { $(this).removeClass('input_onfocus'); });

	//track click-throughs to 3rd party pages via Google Analytics...
	//$("a[rel*='nofollow']").click(function() {
	$("a[target*='_blank']").click(function () {
		if (typeof (pageTracker)!="undefined")
			pageTracker._trackPageview('/outgoing/'+$(this).attr('href'));
	});

	//breakout of frames
	if (parent!=window) { parent.location=location.href; }

	//Select all links with lightbox class
	if ($().lightBox)
		$('a.lightbox').lightBox({ fixedNavigation: true });
}

$.url=function(url) {
	return $('#baseHref').attr('href')+url.substr(1);
}
