var switchSize = 1024;
// compatibility
if (typeof isW3C=="undefined") var isW3C = (document.getElementById) ? true : false;
if (typeof isNS4=="undefined") var isNS4 = (document.layers && !isW3C) ? true : false;
if (typeof isIE4=="undefined") var isIE4 = (document.all && !isW3C) ? true : false;
if (typeof isOpera=="undefined") var isOpera = (window.opera) ? true : false;

document.writeln("<style type=\"text/css\">\n");
// define styles that can only be used for last generation browser
if (isW3C||isIE4)
{
	document.writeln(".textinput { font-size: 11px; background-color: #ffffff; color: #003366; border-width: 1px; border-style: solid; border-color: #647c8c; height: 17px; padding-left: 2px; }\n");
}
else
{
	document.writeln(".textinput { font-size: 11px; background-color: #ffffff; color: #003366; height: 17px; padding-left: 2px; }\n");
}
document.writeln("</style>\n");

function TOPASS_getBrowserWidth()
{
	var outerWidth = (document.all) ? document.body.clientWidth + 28 : window.outerWidth;
	return outerWidth;
}

function TOPASS_getContentWidth( type )
{
	var contentWidth;
	var browserWidth = TOPASS_getBrowserWidth();

	if (browserWidth >= switchSize)
	{
		switch( type )
		{
			case "homepage": contentWidth = 497; break;
			case "rightfeature": contentWidth = 526; break;
			default: contentWidth = 648;
		}
	}
	else
	{
		switch( type )
		{
			case "homepage": contentWidth = 371; break;
			case "rightfeature": contentWidth = 385; break;
			default: contentWidth = 506;
		}
	}

	return contentWidth;
}

function TOPASS_getBackgroundImage( type, image )
{
	var width = TOPASS_getContentWidth( type );
	return "<img src=\"/images/bg_"+image+"_"+width+"x1.gif\" alt=\"\" width=\""+width+"\" height=\"1\" border=\"0\">";
}

function TOPASS_getContentImage( type )
{
	return "<img src=\"/0.gif\" alt=\"\" width=\""+TOPASS_getContentWidth( type )+"\" height=\"1\" border=\"0\">";
}

function TOPASS_getContentTable( type )
{
	return "<table width=\""+TOPASS_getContentWidth( type )+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
}

