var switchSize = 1024;

var contextRoot = "";

document.writeln("<style type=\"text/css\">\n");
// define styles that can only be used for last generation browser
if (w3c || ie4)
{
	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 UBS_getBrowserWidth()
{
	var outerWidth = (document.all) ? document.body.clientWidth + 28 : window.outerWidth;
	return outerWidth;
}

function UBS_getContentWidth( type )
{
	var contentWidth;
	var browserWidth = UBS_getBrowserWidth();

	if (browserWidth >= switchSize)
	{
		switch( type )
		{
			case "homepage": contentWidth = 726; break;
			case "homeleft": contentWidth = 265; break; // 252+13
			case "homemiddle": contentWidth = 259; break; // 246+13
			case "rightfeature": contentWidth = 526; break;
			default: contentWidth = 648;
		}
	}
	else
	{
		switch( type )
		{
			case "homepage": contentWidth = 585; break;
			case "homeleft": contentWidth = 159; break; // 146+13
			case "homemiddle": contentWidth = 224; break; // 211+13
			case "rightfeature": contentWidth = 385; break;
			default: contentWidth = 506;
		}
	}

	return contentWidth;
}

function UBS_getBackgroundImage( type, image )
{
	var width = UBS_getContentWidth( type );
	return "<img src=\""+contextRoot+"img/bg_"+image+"_"+width+"x1.gif\" width=\""+width+"\" alt=\"\" height=\"1\" border=\"0\">";
}

function UBS_getContentImage( type )
{
	return "<img src=\""+contextRoot+"img/0.gif\" width=\""+UBS_getContentWidth( type )+"\" alt=\"\" height=\"1\" border=\"0\">";
}

function UBS_getContentTable( type )
{
	return "<table width=\""+UBS_getContentWidth( type )+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
}

