function GetCPLogo (gifName){
	if (gifName==null){
		gifName="cp_logo";
	}
	var srv         = self.location.host; // e.g. ln4d21www.ldn.swissbank.com:8989
	var ref         = self.location.href; // e.g. http://ln4d21www.ldn.swissbank.com:8989/test.html
	var httpsplit   = ref.split(":");     // e.g. http, //ln4d21www.ldn.swissbank.com, 8989/test.html
	var httpset     = httpsplit[0];       // e.g. http

	if (srv.indexOf("swissbank")!=-1)
               srv = httpset + "://logo.swissbank.com";
	else if (srv.indexOf("ubsw.net") != -1)
		srv = httpset + "://logo.swissbank.com";
        else if (srv.indexOf("ubstest")!=-1 || srv.indexOf("ubswtest")!=-1)
                srv = httpset + "://clientportal.ibb.ubstest.com";
        else if (srv.indexOf(".")==-1)                 // this is to catch aliases, like http://ims
                srv = httpset + "://logo.swissbank.com";
	else
		srv = httpset + "://clientportal.ibb.ubs.com";
	document.write ("<img src=\""+srv + "/logo/" +gifName+".gif\" border=\"0\">");
}
function PrintDisclaimer(width) {
	if (width == null) width = "100%";

	var httpurlbase = getServerURL();

	//alert (httpurlbase);
	document.write ("<LINK REL=stylesheet HREF='" + httpurlbase + "/ibol_open/css/disclaimer.css'>");
	document.write("<table width='" + width + "' border=0 cellspacing=0 cellpadding=0>");
	document.write("<tbody><tr><td class='footnote'><strong>Important legal &amp; regulatory information.</strong></td></tr>");
	document.write("<tr><td class='footnote'><br />Use of this website is strictly for authorised users of clients of UBS and is subject to the terms and conditions of the <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=extranet\">System Use Agreement</a>, <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=disclaimer\">Disclaimer</a> and <a href=\"" + httpurlbase + "/ibol_open/marketdata.htm\">Market Data Terms of Use</a>. If you are not an authorised user, you should not access or use this website.  Products and services in this website may not be available for residents of certain jurisdictions. Please consult the restrictions relating to the product or service in question for further information.  For information as to which entity provides the services in each jurisdiction, click <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=disclaimer\">here</a>.</td></tr>");
	document.write("<tr><td><br />&copy; UBS 1998-2009. All rights reserved.</td></tr>");
	document.write("</tbody></table>");
}
function PrintTargetedDisclaimer(width,target) 
{
	if (width == null) width = "100%";

	var httpurlbase = getServerURL();
             
	var targetParams = "";
	
	if (target != "" && target != null) 
		targetParams = " target=" + target;
        
	document.write ("<LINK REL=stylesheet HREF='" + httpurlbase + "/ibol_open/css/disclaimer.css'>");
	document.write("<table width='" + width + "' border=0 cellspacing=0 cellpadding=0>");
	document.write("<tbody><tr><td class='footnote'><strong>Important legal &amp; regulatory information.</strong></td></tr>");
	document.write("<tr><td class='footnote'><br />Use of this website is strictly for authorised users of clients of UBS and is subject to the terms and conditions of the <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=extranet\">System Use Agreement</a>, <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=disclaimer\">Disclaimer</a> and <a href=\"" + httpurlbase + "/ibol_open/marketdata.htm\">Market Data Terms of Use</a>. If you are not an authorised user, you should not access or use this website.  Products and services in this website may not be available for residents of certain jurisdictions. Please consult the restrictions relating to the product or service in question for further information.  For information as to which entity provides the services in each jurisdiction, click <a href=\"" + httpurlbase + "/portal/agreement.jsp?application=disclaimer\">here</a>.</td></tr>");
	document.write("<tr><td><br />&copy; UBS 1998-2009. All rights reserved.</td></tr>");
	document.write("</tbody></table>");

}

function getServerURL() {
	var srv         = self.location.host; // e.g. ln4d21www.ldn.swissbank.com:8989
	var ref         = self.location.href; // e.g. http://ln4d21www.ldn.swissbank.com:8989/test.html
	var httpsplit   = ref.split(":");     // e.g. http, //ln4d21www.ldn.swissbank.com, 8989/test.html
	var httpset     = httpsplit[0];       // e.g. http

	if (srv.indexOf("wfdev")!=-1 || srv.indexOf("clientportal-dev") != -1)
		srv = "clientportal-dev.swissbank.com";
	else if (srv.indexOf("wfuat")!=-1 || srv.indexOf("clientportal-uat") != -1)
		srv = "clientportal-uat.swissbank.com";
	else if (srv.indexOf("swissbank")!=-1)
		srv = "clientportal.swissbank.com";
	else if (srv.indexOf("ubsw.net") != -1)
		srv = "clientportal.swissbank.com";
	else if (srv.indexOf("ubstest")!=-1)
		srv = "clientportal.ibb.ubstest.com";
        else if (srv.indexOf(".")==-1)                 // this is to catch aliases, like http://ims
                srv = "clientportal.swissbank.com";
	else
		srv = "clientportal.ibb.ubs.com";

	var httpurlbase = httpset + "://" + srv;	
	return httpurlbase;
}
