var w3c = (document.getElementById) ? true : false;

var ns4 = (document.layers && !w3c) ? true : false;

var ie4 = (document.all && !w3c) ? true : false;

var opera = (window.opera) ? true : false;

var switchSize = 1024;



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 = 386; break;

			default: contentWidth = 506;

		}

	}



	return contentWidth;

}

function UBS_getContentWidthFrame( type )



{



	var contentWidth;

	var browserWidth = UBS_getBrowserWidth();

//alert (browserWidth);

if (NS4) {

	curBrowserWidth = browserWidth;

}else {

	curBrowserWidth = browserWidth +163;

}

	if (curBrowserWidth >= 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 = 525; break;

			case "webster": contentWidth = 650; break;

			default: contentWidth = 649;

		}

	}

	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;

			case "webster": contentWidth = 510; break;

			default: contentWidth = 509;

		}

	}



	return contentWidth;

}



function UBS_getBackgroundImage( type, image )

{

	var width = UBS_getContentWidth( type );

	return "<img src=\"/web/common/images_2/bg_"+image+"_"+width+"x1.gif\" width=\""+width+"\" height=\"1\" border=\"0\">";

}



function UBS_getContentImage( type )

{

	return "<img src=\"/web/common/images_2/0.gif\" width=\""+UBS_getContentWidth( type )+"\" height=\"1\" border=\"0\">";

}



function UBS_getContentImageFrame( type )

{

	return "<img src=\"/web/common/images_2/0.gif\" width=\""+UBS_getContentWidthFrame( type )+"\" height=\"1\" border=\"0\">";

}



function UBS_getContentTable( type )

{

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

}





function breadcrumbStub(displayTitle){  // v1.0 adds breadcrumbs by stub and public site section

    baseStub=

    "<p class='navpath'>"+

    "<A class='navpath' target='_blank' href='http://www.ubs.com'>UBS Homepage</A> \> "+

    "<A class='navpath' target='_blank' href='http://www.ubs.com/e/globalam.html'>UBS Global AM</A> \> "+

    "<A class='navpath' target='_top' href='http://globalam-us.ubs.com'>US</A> ";



    // only display breadcrumb in public web site.

    var mainUrls = window.top.location.href.split("/");

    var context = mainUrls[3];

    if (context == "corpweb")

    {



        var node = parent.selectNode(parent.getSelected());

        // build the bread crumb backward, from the current selected node.

        var crumb = "";

		if (node == null) 
		{
            if (displayTitle)
            {
                baseStub += "\> <b>" + displayTitle + "</b> ";
            }
		} 
		else if (node != null)
        {

            if (displayTitle)

            {

                crumb = "\> <b>" + displayTitle + "</b> ";

            }

            else {

                crumb = "\> <b>" + node.name + "</b> ";

                node = node.parent;

            }



            while (node.level > 1)

            {

                crumb = "\> <a class='navpath' href='javascript:parent.jumpToNode(" + node.id + ");'>" + node.name + "</a> " + crumb;

                node = node.parent;

            }



            baseStub += crumb + "</p>";

        }

        return baseStub;

    }

    return "";

}







// Capability--Product--Manager Matrix







function availableAs(fundID) {



//fundID=1329;







return "\<a class='rflist' href='/corpweb/redirect.do?product="+fundID+"&frame=public'>Available Product</a>";

}





