function nWin(theURL,winName,width,height,features,br)
{
  var window_width = width+20;
  var window_height = height+20;
  var newfeatures= features;
  var window_top = (screen.height-window_height)/2;
  var window_left = (screen.width-window_width)/2;
  str='width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',' + newfeatures + '';
  newWindow = window.open('', '', str);
  newWindow.document.open();

  str="<html><head><title>" + winName + "</title></head><body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 rightmargin=0 bgcolor=#ffffff>"+
      (br>0?"<br>":"" ) + '<img src='+theURL+' width='+width+' height='+height+' border=0 hspace=10 vspace=10>'+
      "</body></html>";

  newWindow.document.write(str);
  newWindow.document.close();
}


// взято с http://www.siemens.com/
function CreateRefPopupWindow(windowname, url, width, height, addressLine, browserMenu, browserStatus,
                              closeWithCallingWindow, allowKeyboardCommand, resize, toolBar, scrollBars,
                              popupExtRefObjektId)
{
  var href, left, top;
  var params = "";

  if (width > screen.width)
     width = screen.width;
  if (height > screen.height)
     height = screen.height;

  // center popup window
  left = (screen.width - width) / 2;
  top = (screen.height - height) / 2;

  if (typeof(url) == 'string')
     href=url;
  else
     href=url.href;


  if (width > 0)
  {
    left = (screen.width - width) / 2;
    params += "width=" + width + ", left=" + left + ", ";
  }
  if (height > 0)
  {
    top = (screen.height - height) / 2;
    params += "height=" + height + ", top=" + top + ", ";
  }
  if (addressLine)
    params += "location=yes" + ", ";
  else
    params += "location=no" + ", ";
  if (browserMenu)
    params += "menubar=yes" + ", ";
  else
    params += "menubar=no" + ", ";
  if (browserStatus)
    params += "status=yes" + ", ";
  else
    params += "status=no" + ", ";
  if (closeWithCallingWindow)        // geht nicht
    params += "dependent=yes" + ", ";
  else
    params += "dependent=no" + ", ";
  if (allowKeyboardCommand)        // geht nicht
    params += "hotkeys=yes" + ", ";
  else
    params += "hotkeys=no" + ", ";
  if (resize)
    params += "resizable=yes" + ", ";
  else
    params += "resizable=no" + ", ";
  if (toolBar)
    params += "toolbar=yes" + ", ";
  else
    params += "toolbar=no" + ", ";
  if (scrollBars)
    params += "scrollbars=yes" + ", ";
  else
    params += "scrollbars=no" + ", ";

  if (params.length > 0)
      params = params.substring(0, params.length - 2);
  // alert(params);

  // alert(url);
  if (url.indexOf("http://") == -1)
  {
    if (url.indexOf("http:\\") != -1)
    {
      // for the case of EXTREFERENZ.FILEPATH = for example 'http:\\www.kleine.at'
      url = url.replace("http:\\", "http://");
    }
    else
    {
      if (url.indexOf("http:") != -1)
      {
        // for the case of EXTREFERENZ.FILEPATH = for example 'http:\www.kleine.at'
        url = url.replace("http:", "http://");
      }
    }
  }
  // alert(url);

  var winName = windowname + "_" +
                width + height + addressLine + browserMenu + browserStatus +
                closeWithCallingWindow + allowKeyboardCommand + resize + toolBar + scrollBars +
                "_" + popupExtRefObjektId;
  // alert(winName);
  var popup = window.open(url, winName, params);
  popup.focus();

}


function changePage4Country()
{
  if (document.layers != null && navigator.appName == "Netscape")
  {
    var newLand = '';
    for (var i=0; i < document.countrySelectorForm.sdc_countryurl.length; i++) {
     if (document.countrySelectorForm.sdc_countryurl.options[i].selected == true) {
       newLand = document.countrySelectorForm.sdc_countryurl[i].value;
     }
    }
    if (newLand != "nop")
    {
      window.open(newLand, "_blank", 'location=yes, menubar=yes, resizable=yes, status=yes, toolbar=yes,scrollbars=yes');
//      location = newLand;
      document.countrySelectorForm.sdc_countryurl.selectedIndex = 0;
    }
  }
  else
  {
    if (document.countrySelectorForm.sdc_countryurl.value != "nop")
    {
      window.open(document.countrySelectorForm.sdc_countryurl.value, "_blank", 'location=yes, menubar=yes, resizable=yes, status=yes, toolbar=yes,scrollbars=yes');
//      location = document.countrySelectorForm.sdc_countryurl.value;
      document.countrySelectorForm.sdc_countryurl.selectedIndex = 0;
    }
  }
}

