function printit()
{
	document.getElementById("print").className = "hide";

	if (document.all)
	{
		var WebBrowser = '<object id="WebBrowser1" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6,0);
	}
	else window.print();

	if (window.name == 'preview')
	{
		window.close();
	}
}

function checkPreview()
{
	if ((window.location.search == '?print') || (window.location.search == '#siteTop?print'))return true;
	else return false;
}

function printPreview2()
{
	var screenCSSFile = /content\.css/;

	if (checkPreview())
	{
		for (var i = 0; i < document.getElementsByTagName('link').length; i++)
		{
			if (document.getElementsByTagName('link')[i].media == 'screen,projection')
			{
				var csslink = document.getElementsByTagName('link')[i].href;
				var posInLink = csslink.search(screenCSSFile);
				var newlink = csslink.slice(0,posInLink);
				newlink += 'print.css';
				document.getElementsByTagName('link')[i].href = newlink;
			}
		}
	}
}

function oldURL()
{
	var URL = String(window.location);
	var temp = URL.split("?",1);
	return temp[0];
}
