
function dxBeforePrint(){

	var i;

	if (window.text)
		document.all.text.style.height = "auto";
			
	for (i=0; i < document.all.length; i++){
		if (document.all[i].tagName == "BODY") {
			document.all[i].scroll = "yes";
			}
		if (document.all[i].id == "pagetop") {
			document.all[i].style.margin = "0px 0px 0px 0px";
			document.all[i].style.width = "100%";
			}
		if (document.all[i].id == "pagebody") {
			document.all[i].style.overflow = "visible";
			document.all[i].style.top = "5px";
			document.all[i].style.width = "100%";
			document.all[i].style.padding = "0px 10px 0px 30px";
			}
		if (document.all[i].id == "seealsobutton" || document.all[i].id == "languagesbutton") {
			document.all[i].style.display = "none";
			}
		if (document.all[i].className == "LanguageSpecific") {
			document.all[i].style.display = "block";
			}
		}
}

function dxAfterPrint(){

	 document.location.reload();

}

function bodyLoad()
{
	resizeBan();
	document.body.onclick = bodyClick;
	document.body.onresize = bodyResize;
	window.onbeforeprint = dxBeforePrint;
	window.onafterprint = dxAfterPrint;	
	try
	{
		bodyOnLoad();
	}
	catch(e){}
}

function bodyResize()
{
	resizeBan();
}

function bodyClick()
{
	resizeBan();
}

function resizeBan()
{
	if (msieversion() > 4)
	{
		try
		{
			if (document.body.clientWidth==0)
				return;

			var oBanner= document.all.item("pagetop");
			var oText= document.all.item("pagebody");

			if (oText == null) 
				return;

			var oBannerrow1 = document.all.item("projectnamebanner");
			var oTitleRow = document.all.item("pagetitlebanner");

			if (oBannerrow1 != null)
			{
				var iScrollWidth = dxBody.scrollWidth;
				oBannerrow1.style.marginRight = 0 - iScrollWidth;
			}

			if (oTitleRow != null)
			{
				oTitleRow.style.padding = "0px 10px 1px 22px;";
			}

			if (oBanner != null)
			{
				document.body.scroll = "no"
				oText.style.overflow= "auto";
				oBanner.style.width= document.body.offsetWidth;
				oText.style.paddingRight = "40px"; // Width issue code
				oText.style.width= document.body.offsetWidth;
				oText.style.top=0;  
				if (document.body.offsetHeight > oBanner.offsetHeight)
					oText.style.height= document.body.offsetHeight - (oBanner.offsetHeight + 0);
				else
					oText.style.height=0;
			}

			try
			{
				oText.setActive();
			}
			catch(e){
			}
		}
		catch(e){
		}
	}
	
} 

function msieversion()
// Return Microsoft Internet Explorer (major) version number, or 0 for others.
// This function works by finding the "MSIE " string and extracting the version number
// following the space, up to the decimal point for the minor version, which is ignored.
{
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE ");

    if (msie > 0)        // is Microsoft Internet Explorer; return version number
        return parseInt(ua.substring(msie+5, ua.indexOf(".", msie)));
    else
        return 0;    // is other browser
}

