	function getStylesheet() {
          var css;
           css  = '<link href="http://ubibar.ubi.com/v1.5/css/dropdown/dropdown.css" media="all" rel="stylesheet" type="text/css" />';
           css += '<link href="http://ubibar.ubi.com/v1.5/css/dropdown/themes/ubi.com-black/default.css" media="all" rel="stylesheet" type="text/css" />';
           css += '<!--[if lt IE 7]>';
           css += '<link href="http://ubibar.ubi.com/v1.5/css/dropdown/themes/ubi.com-black/ie6.css" media="all" rel="stylesheet" type="text/css" />';
           css += '<![endif]-->';

           return css;
	}
        
	function getJavascript() {
           var javascript;
           javascript  = '<script type="text/javascript" src="http://ubibar.ubi.com/v1.5/js/ubibarv15.js"></script>';

           // if jquery not defined by other script ...
           if (typeof jQuery == 'undefined') {
             javascript  += '<script type="text/javascript" src="http://ubibar.ubi.com/v1.5/js/jquery/jquery.js"></script>';
           }
           // noConflict with mootools and others ...
           javascript  += '<script type="text/javascript" src="http://ubibar.ubi.com/v1.5/js/jquery/jquery.dropdown.js"></script>';

           // if we are in ie6, we need to fix png transparency
           var isIE6 = false;
           if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
              var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
              isIE6 = (ieversion==6);
           }
           if (isIE6) {
             javascript  += '<script type="text/javascript" src="http://ubibar.ubi.com/v1.5/js/unitpngfix.js"></script>';
           }

           return javascript;
        }

	function getToolbar() {
		var the_bar;
	    var isFirefox = false; 
	    if (navigator.userAgent.indexOf('Firefox') != -1) { 
		  isFirefox = true;
	    }
                the_bar  = '<div id="ubisoft-toolbar-bg">';
                the_bar += '<div id="ubisoft-toolbar" style="width:980px">';
                the_bar += '<ul id="nav" class="ubisoft-toolbar-dropdown ubisoft-toolbar-dropdown-horizontal">';
                the_bar += ' <li class="dir ubisoftlogo"><div class="ubisoftlogodiv"><a href="http://www.ubi.com/US/default.aspx"><img src="http://ubibar.ubi.com/v1.5/css/blank.gif" border=0 width="90" height="20"></a></div>';
                the_bar += '	<ul>';
                the_bar += '   <li><a href="http://www.ubi.com/US/default.aspx">UBI.COM</a></li>';
the_bar += '   <li><a href="http://videos.ubi.com">Ubisoft Video Channel</a></li>';
the_bar += '   <li><a href="http://www.uplay.com"><span style="color: #FF0000">new!</span> UPLAY</a></li>';
the_bar += '   <li><a href="http://events.ubi.com">Ubisoft@Events</a></li>';
the_bar += '   <li><a href="http://forums.ubi.com">FORUMS</a></li>';
the_bar += '   <li><a href="http://support.ubi.com">SUPPORT</a></li>';
                the_bar += '  </ul>';
                the_bar += '  </li>';
                the_bar += '<li class="ubibar-search"><div class="search"><form id="gsearch_form" method="GET" action="http://search.ubi.com/search" target="_parent" onSubmit="return goGSASearch();">';
                the_bar += '    <input type="hidden" name="site" value="default_collection">';
                the_bar += '    <input type="hidden" name="client" value="ubiportal_1_5_en-US">';
                the_bar += '    <input type="hidden" name="proxystylesheet" value="ubiportal_1_5_en-US">';
                the_bar += '    <input type="hidden" name="output" value="xml_no_dtd">';
                the_bar += '    <input type="hidden" name="lr" value="lang_en">';
                the_bar += '    <input type="hidden" name="output" value="xml_no_dtd">';
                the_bar += '			<div class="fields">';
                the_bar += '				<input AUTOCOMPLETE="Off" type="text" id="q" name="q"  value="Search" class="text" label="Search" onBlur="show_gsawatermark(\'Search\');" onFocus="hide_gsawatermark(\'Search\');"/>';
                the_bar += '				<input height="18" width="20" type="image" alt="Search" src="http://ubibar.ubi.com/v1.5/css/blank.gif" class="submit" onmouseover="Interact(this,1)" onmouseout="Interact(this,0)"/></div>';
                the_bar += '</form></div></li>';
				if (!isFirefox) {
					the_bar += '	<li class="ubibar-blank">';
				}
				the_bar += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="550" height="40">'; 
the_bar += '<param name="movie" value="http://ubibar.ubi.com/uplay.swf" />'; 
the_bar += '<param name="quality" value="high" />'; 
the_bar += '<param name="bgcolor" value="#ffffff" />';  
the_bar += '<param name="flashvars" value="URL_UPLAY=http://www.uplay.com" />';
the_bar += '<embed src="http://ubibar.ubi.com/uplay.swf?URL_UPLAY=http://www.uplay.com" quality="high" bgcolor="#ffffff" width="550" height="40" name="mymoviename" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'; 
the_bar += '</object>';

				if (!isFirefox) {
					the_bar += '</li>';
				}
                                the_bar += '	<li class="ubibar-signup"><div class="signupbg"><a href="https://secure.ubi.com/login/Login.aspx?lang=en-US&skin=silenthunter4&NextURL=http%3A%2F%2Fwww.ubi.com">Log In</a></div></li>';
                                the_bar += '</ul>';
                the_bar += '</div>';
                the_bar += '</div>';

                return the_bar;
	}
	
	function displayToolbar() {
		document.write(getStylesheet());
		document.write(getJavascript());
		document.write(getToolbar());
	}

	function displayToolbarWithoutStylesheet() {
                document.write(getJavascript());
		document.write(getToolbar());
	}
	
	function printStylesheet() {
		document.write(getStylesheet());
	}

	function printJavascript() {
                document.write(getJavascript());
        }
	
		displayToolbar();
	
			
	function getPreferredLocalization() {
		preLoc = getCookie("PreferredLocalization");
		if (preLoc && (preLoc!=""))
		{
			return preLoc;
		}
		return 'us';
	}

	function setPreferredLocalization(mylocation) {
		var d = new Date();
		d.setYear(d.getYear()+10);
		setCookie("PreferredLocalization",mylocation,d);
	}

	function setCookie(name, value, expires, path, domain, secure)
	{
	    document.cookie= name + "=" + escape(value) +
	        ((expires) ? "; expires=" + expires.toGMTString() : "") +
	        ((path) ? "; path=" + path : "") +
	        ((domain) ? "; domain=" + domain : "") +
	        ((secure) ? "; secure" : "");
	}
	
	function getCookie(name)
	{
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    if (begin == -1)
	    {
	        begin = dc.indexOf(prefix);
	        if (begin != 0) return null;
	    }
	    else
	    {
	        begin += 2;
	    }
	    var end = document.cookie.indexOf(";", begin);
	    if (end == -1)
	    {
	        end = dc.length;
	    }
	    return unescape(dc.substring(begin + prefix.length, end));
	}
	
	function deleteCookie(name, path, domain)
	{
	    if (getCookie(name))
	    {
	        document.cookie = name + "=" + 
	            ((path) ? "; path=" + path : "") +
	            ((domain) ? "; domain=" + domain : "") +
	            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	    }
	}
	
	function getUserName()
	{
				return 'Guest';
		}

	function isUserLoggedIn()
	{
			return false;
		}
	
	function getLegalLocalization() {
			return 'us';
		}

	function getRatingParameter() {
			return -1;
		}
	
	function isAgeOK() {
			return 1;
	}
	
	