// JavaScript Document


// Include special CSS for Opera Browsers
if(navigator.appName.indexOf('Opera') > -1)
{
  document.write('<link type="text/css" rel="stylesheet" href="/eprise/main/_system/css/opera.css" />');
}

// Script to open an Pop-Up Window with a specific size
function PopUpWindow(filename,windowname,w,h) {
  var xw = w;
  var xh = h;
  if(screen) { 
    var xxw = (screen.width-xw)/2; var xxh = (screen.height-xh)/2 }
  else { var xxw = 80; var xxh = 80; }
  window.open(''+filename, windowname,'status=no,menubar=no,scrollbars=no,personalbar=no,directories=no,resizable=yes,fullscreen=no,width=' + w +',height=' + h + ',top=' + xxh + ',left=' + xxw );
}

// Roll-over and- out on HOME

function rollOver(image_id)
{
	image_obj = document.getElementById(image_id);
	footer_obj = document.getElementById("footer_" + image_id);
	if(footer_obj)
	{
		if (image_id == "consumers")
		{
			footer_obj.style.backgroundColor = "#c61c3b";
		}
		else if(image_id == "professionals")
		{
			footer_obj.style.backgroundColor = "#c61c3b";
		}
		else if(image_id == "bernafon")
		{
			footer_obj.style.backgroundColor = "#c61c3b";
		}
	}
	if (image_obj.src.substring(image_obj.src.length-7, image_obj.src.length).indexOf("off") > -1)
	{
		image_obj.src = image_obj.src.substring(0, image_obj.src.length-7) + "on.gif";
		image_obj.rolled_over = true;
	}
}
function rollOut(image_id)
{
	image_obj = document.getElementById(image_id)
	footer_obj = document.getElementById("footer_" + image_id);
	if (image_obj.rolled_over)
	{
		image_obj.src = image_obj.src.substring(0, image_obj.src.length-6) + "off.gif";
		if(footer_obj)
		{
			footer_obj.style.backgroundColor = "#666666";
		}
	}
}

// Change Website Jump Menu
 function Spring() {
    var welcherLink = document.Springen.country.selectedIndex;
    document.Springen.country.selectedIndex = "0";
    if(welcherLink > "0"){
       top.location.href = document.Springen.country.options[welcherLink].value;
    }
 }

// Change Language Jump Menu
 function SpringLanguage() {
    var welcherLink = document.language_form.language.selectedIndex;
    document.language_form.language.selectedIndex = "0";
    if(welcherLink > "0"){
       top.location.href = document.language_form.language.options[welcherLink].value;
    }
 }

//Change the ChannelNavigation when click on the TargetNavigation
function SetChannelNavigation(Channel)
{
  var oTargetNavigation = document.getElementById("TargetNavigation")
  if (oTargetNavigation!=null)
  {
alert("den er:" + oTargetNavigation.value);
    oTargetNavigation.value = Channel;
    alert("den er nu:" + oTargetNavigation.value);
  }
}

//This function set the hidden field GotoSearchpage to the correct page
//used on the search page
function SetSearchPage(NextPage)
{
  var oFrm = document.forms("frmSearch");
  if (oFrm != null)
  {
    oFld = oFrm.GotoSearchpage
    if (oFld != null)
    {
      oFld.value = NextPage;

       //update the search field if user have changed it
      oFldSearchLast = oFrm.LastSearchString;
      oFldSearch = oFrm.DataSearchInput;
      if ((oFldSearchLast != null) && (oFldSearch != null))
      {
        oFldSearch.value = oFldSearchLast.value;
        oFrm.submit();
      }
    }
  }
}