
var windowopen = false;

/* 
 * #VZUGCOM-15
 * ===========
 * Because JavaScripts in IE not using the base href (FF does it),
 * generate the complete url with getting Base-Href "manually" (getBaseHref()).
 * For the link to the Switzerland-Page don't add the base href (look at the if)!
 */
function redirectToCountry(){
  var arr = window.document.getElementById('countries');
   for (var i = 0; i < arr.length; i++) {
    if (arr[i].selected) {
     if(arr[i].value != null && arr[i].value.indexOf('http://') < 0){
       window.location.href = getBaseHref() + arr[i].value;
     } else {
       window.location.href = arr[i].value;
     }
     break;
   }
  }
}

function changeLanguage(){
  var arr = window.document.getElementById('languages');
  for (var i = 0; i < arr.length; i++) {
   if (arr[i].selected) {
    window.location.href = getBaseHref() + arr[i].value;
    break;
  }
 }
}

function getBaseHref() {
  return document.getElementsByTagName("base")[0].getAttribute("href");
}

function imgOn(elementId, imageSrc){
  onImage = new Image();
  onImage.src = imageSrc;
  document.getElementById(elementId).src = (imageSrc);
}

function imgOut(elementId, imageSrc){
  outImage = new Image();
  outImage.src = imageSrc;
  document.getElementById(elementId).src = (imageSrc);
}

function open_window_popup(url) {
  if (windowopen) {
    if (hwin.closed) {
      hwin = window.open(url, "popup", "alwaysRaised=yes,resizable=yes,scrollbars=yes,width=630,height=400,Toolbar=no");
    } else {
      hwin.location.href = url;
      hwin.focus();
    }
 } else {
   hwin = window.open(url, "popup", "alwaysRaised=yes,resizable=yes,scrollbars=yes,width=630,height=400,Toolbar=no");
   windowopen = true;
 }
} 



