function t1(o) {if(o)o.style.backgroundColor="#f8f8f8";}
function t2(o) {if(o)o.style.backgroundColor="#ffffff";}

function Get(id)
{	var x=null;
	if(!x && document.getElementById) x=document.getElementById(id);
	if(!x && document.all) x=document.all[id];
	if(!x && document.layers) x=document.layers[id];
	return x;
}

function OnSelChange(t)
{	var f=Get("F");
	if(f) f.T.value=t;
	setTimeout("OnPreview()", 300);
}

function OnPreview()
{	var f=Get("F");
	if(!f) return;
	PrintHtml("<html><head><style>"+f.T.value+"</style></head><body>"+f.H.value+"</body></html>");
}

function OnShowHtml()
{	var f=Get("F");
	if(!f) return;
	PrintHtml("<html><body><code>"+f.H.value.replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/[\r\n]+/g,'<br>')+"</code></body></html>");
}

function PrintHtml(s)
{	var doc,o=Get("P");
	if(o)
	{	doc=o.contentDocument;
		if(doc==undefined || doc==null) doc=o.contentWindow.document;
		doc.open();
		doc.write(s);
		doc.close();
	}
}