function winOpen(theURL,winName,features)  { 
	winName = window.open(theURL,winName,features); 
	if(winName == null || winName.closed){window.open(theURL,winName,features);} 
	else{winName.location.href = theURL;} 
	if (!winName.closed) 
	winName.focus(); 
}

function setBookmark(lang) {
	bookmarkurl = location.href;

	// if (document.all) {
	var text = document.title;
	text = text.replace(/:/ ,"");
	text = text.replace(/\*/ ,"");
	text = text.replace(/\?/ ,"");
	text = text.replace(/\\/ ,"");
	text = text.replace(/"/ ,"");
	text = text.replace(/</ ,"");
	text = text.replace(/>/ ,"");
	text = text.replace(/|/ ,"");

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(text, bookmarkurl,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( bookmarkurl, text); 
	} else if(window.opera && window.print) { // Opera Hotlist
		return true; 
	}
  
  // window.external.AddFavorite(bookmarkurl,text);
  // } else {
  //   alert('Your Browser does not support this feature');
  // }
}

function Top()
{
 document.location.href="#pagetop";
}

function zoomimg(src, id) {
  var zoomdiv  = document.getElementById('zoomdiv');
  var caption = "";

  if(id != "")
  {
    caption = document.getElementById(id).innerHTML
    caption = "<div style='text-align:left; padding:0 .25em;'><span>" +caption+"</span></div>";
  }

  zoomdiv.innerHTML="<div><span>Fenster schlie&szlig;en</span><img src='/img/system/close_icon.gif' alt='schlie&szlig;en'></div><table style='width:5em;' cellspacing='0' cellpadding='0'><tr><td><img src='"+src+"' />"+caption+"</td></tr></table>";

  var body =document.body;
  if(body.scrollTop > 50) {
    zoomdiv.style.top = body.scrollTop + 50;
  } else {
    zoomdiv.style.top = 50;
  }
  zoomdiv.style.visibility = 'visible';
}

function zoomimgen(src, id) {
  var zoomdiv  = document.getElementById('zoomdiv');
  var caption = "";

  if(id != "")
  {
    caption = document.getElementById(id).innerHTML
    caption = "<div style='text-align:left; padding:0 .25em;'><span>" +caption+"</span></div>";
  }

  zoomdiv.innerHTML="<div><span>Close window</span><img src='/img/system/close_icon.gif' alt='close'></div><table style='width:5em;' cellspacing='0' cellpadding='0'><tr><td><img src='"+src+"' />"+caption+"</td></tr></table>";

  var body =document.body;
  if(body.scrollTop > 50) {
    zoomdiv.style.top = body.scrollTop + 50;
  } else {
    zoomdiv.style.top = 50;
  }
  zoomdiv.style.visibility = 'visible';
}



var selectedreg;
var altselectedreg;

function selecttab(node,pos,array_index) {
	container[array_index]["actPos"] = 0;
	container[array_index]["intStatus"] = 0;
   var rdiv = document.getElementById("tab_" + node + "_" + pos);
   var rpdiv = document.getElementById("tabcontent_" + node + "_" + pos);
   var rspdiv = document.getElementById("tabcontent_" + node);
   if(!altselectedreg) altselectedreg = "tab_"+ node +"_0";
   var rsdiv = document.getElementById(altselectedreg);
   
   if(rdiv && rpdiv && rspdiv && rsdiv) {
   	   rspdiv.innerHTML = rpdiv.innerHTML;
	   rdiv.className += "tabselected"; 
	   rsdiv.className = rsdiv.className.replace(/tabselected/,""); 
	   selectedreg = "tab_" + node + "_" + pos;
	   altselectedreg = "tab_" + node + "_" + pos;
   }
}

function selecttabandscroll(node,pos,id) {

   var rdiv = document.getElementById("tab_" + node + "_" + pos);
   var rpdiv = document.getElementById("tabcontent_" + node + "_" + pos);
   var rspdiv = document.getElementById("tabcontent_" + node);
   if(!altselectedreg) altselectedreg = "tab_"+ node +"_0";
   var rsdiv = document.getElementById(altselectedreg);

   if(document.getElementById(id))
     document.getElementById(id).scrollIntoView();
   
   if(rdiv && rpdiv && rspdiv && rsdiv) {
   	   rspdiv.innerHTML = rpdiv.innerHTML;
	   rdiv.className += "tabselected"; 
	   rsdiv.className = rsdiv.className.replace(/tabselected/,""); 
	   selectedreg = "tab_" + node + "_" + pos;
	   altselectedreg = "tab_" + node + "_" + pos;
   }
}



function zoomschmittde() {
  var zoomdiv  = document.getElementById('zoomschmitt');

  zoomdiv.innerHTML="<map name='schmitt'><area alt='Fenster schliessen' coords='297,1,422,20' href=\"javascript:document.getElementById('zoomschmitt').style.visibility='hidden';void(0);\"></map><img src='/img/nachhaltigkeit/popup_schmitt_lord_de.gif' alt='' usemap='#schmitt'>";

  var body =document.body;
  if(body.scrollTop > 50) {
    zoomdiv.style.top = body.scrollTop + 50;
  } else {
    zoomdiv.style.top = 50;
  }
  zoomdiv.style.visibility = 'visible';
}
function zoomschmitten() {
  var zoomdiv  = document.getElementById('zoomschmitt');

  zoomdiv.innerHTML="<map name='schmitt'><area alt='Close window' coords='297,1,422,20' href=\"javascript:document.getElementById('zoomschmitt').style.visibility='hidden';void(0);\"></map><img src='/img/nachhaltigkeit/popup_schmitt_lord_en.gif' alt='' usemap='#schmitt'>";

  var body =document.body;
  if(body.scrollTop > 50) {
    zoomdiv.style.top = body.scrollTop + 50;
  } else {
    zoomdiv.style.top = 50;
  }
  zoomdiv.style.visibility = 'visible';
}
