  function language_form(i)
  {    
    var strLocation = new String(window.location.href);
    var strIdx = strLocation.indexOf("#");
    if (strIdx != -1)
        {strLocation = strLocation.substr(0,strIdx);}
    strIdx = strLocation.indexOf("lang=");
    if(strIdx != -1) {
	strLocation = strLocation.substr(0,strIdx-1) + strLocation.substr(strIdx+10);
    }
    strLocation = document.form_languagebar_portlet.p_requested_url.value + escape(strLocation);
    document.form_languagebar_portlet.p_requested_url.value = strLocation;
    document.form_languagebar_portlet.submit();
  }

  function logout_form(command)
  {    
	var strLocation = new String(window.location);
	strLocation = strLocation.substring(strLocation.indexOf("\/\/")+2);
	strLocation = strLocation.substring(0,strLocation.indexOf("\/"));
	doneurl = "http://" + strLocation + "/pls/portal/portal.home";
	strLocation = strLocation.replace(/www/g,"sso");
	location.href="http://" + strLocation + "/pls/orasso/orasso.wwsso_app_admin.ls_logout?p_done_url=" + doneurl;
	return false;
  }

  function language_switch() 
  {
	var strLocation = new String(window.location);
  	var langIdx = strLocation.indexOf("lang=");
	if(langIdx != -1) {
		var lang = strLocation.substring(langIdx+5,langIdx+10);
		if(document.form_languagebar_portlet.p_http_language.value == lang) {
			language_form(2);
		}
	}
  }

