function displayPage()
{
	var input = document.GeneratorPP.getHTML();
	parent.frameout.document.writeln(input);
	parent.frameout.document.close();
}

function changeBackground()
{
	loadCSS();
	var input = document.GeneratorPP.getWebpageColor();
	document.getElementById("body").style.background = input;
	document.getElementById("headerFrame").style.borderColor = input;
}

function checkIsIE() 
{ 
	if (navigator.appName.toUpperCase() == "MICROSOFT INTERNET EXPLORER")
		return true;
	else
		return false;
}

function printPage() 
{
	if (checkIsIE() == true) 
	{ 
		document.frameout.focus(); 
		document.frameout.print(); 
	} 
	else 
	{ 
		window.frames["frameout"].focus(); 
		window.frames["frameout"].print(); 
	}
}

function resize_iframe()
{
	var height = window.innerHeight;//Firefox
	if (document.body.clientHeight)
	{
		height = document.body.clientHeight;//IE
	}
	document.getElementById("frameout").style.height = parseInt(height - document.getElementById("frameout").offsetTop - 1) + "px";
	document.getElementById("headerFrame").style.top = parseInt(document.getElementById("frameout").offsetTop + 1) + "px";
	document.getElementById("headerFrame").style.left = parseInt(document.getElementById("frameout").offsetLeft + 1) + "px";
}

function showHeader()
{
	var input = document.GeneratorPP.getHeaderHTML();
	document.getElementById("headerFrame").innerHTML = input;
	document.getElementById("headerFrame").style.visibility = "visible";
}

function hideHeader()
{
	document.getElementById("headerFrame").innerHTML = "";
	document.getElementById("headerFrame").style.visibility = "hidden";
}

function loadCSS(which)
{
	var css = document.GeneratorPP.getCSS();
	var cssLink = document.createElement("link") 
	cssLink.href = css; 
	cssLink.rel = "stylesheet"; 
	cssLink.type = "text/css"; 
	document.body.appendChild(cssLink); 
}

