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()
{
  var brty = navigator.appName;
  var brve = navigator.appVersion;
  var url=parent.document.location.href; 
  var titel = document.title; 
  if (brty.indexOf("Explorer")>-1)
  {
    window.external.AddFavorite(url, unescape('Bayer Research'));
  }
  else
  {
    alert(unescape("Diese Funktion steht nur f%FCr Internet Explorer zur Verf%FCgung"));
  }
}
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(/|/ ,"");
     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/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>Закрыть окно</span><img src='/img/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';
}


function print(PageId,args)
{
  var a='';
  
  if(args) {
    a = "&args=" + args;
  }

     var location = document.location.href;
      window.open("/module/print/Print.aspx?url=" +location +"&pageid=" +PageId+a, "Drucken","width=775,height=750,scrollbars=yes");
  
}


var selectedreg;
var altselectedreg;

function selecttab(node,pos) {

   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';
}

function switch2Url(targeturl)
{
  if (targeturl != null)
  {
    var values = targeturl.split(";"); 
    var target = values[0];
    var href = values[1];
    
    switch (target)
    {
      case "_self":
        self.document.location.href = href;
        break;
      case "_top":
        top.document.location.href = href;
        break;
      case "_parent":
        parent.document.location.href = href;
        break;
      case "_blank":
        window.open(href, target, "", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
        break;
      case "_winopen":
        window.open(href, target, "", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
        break;
      default:
        if (document.location.frames == null || document.location.frames[target])
          document.location.href = href;
        else
          document.location.frames[target].href = href;       
    }
  }
}

function openPodcast(theURL)
{
    winName = window.open(theURL,'Podcast','location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=938,height=756');
    if(winName == null || winName.closed){
    	window.open(theURL,winName,features);
    }
    else{winName.location.href = theURL;}
    if (!winName.closed)
    winName.focus();
}

	function zoomVideo(zoom, smallvideo, bigvideo, preview) {
		
		if(zoom == 'zoom'){
		document.getElementById('flashvideo').style.width = '35.625em';
			var s1 = new SWFObject("/swf/flv/flvplayer.swf","single","570","341","8");
			s1.addVariable("file",bigvideo);
			s1.addVariable("image",preview);
			s1.addVariable("width","570");
			s1.addVariable("height","341");
			s1.addVariable("clickTag","javascript:zoomVideo('unzoom','"+ smallvideo+"', '"+bigvideo+"');");
			s1.addVariable("iszoomed","true");
			s1.addVariable("autostart","true");

if(document.getElementById("specialgallery")){
    document.getElementById("divimagebox_1" ).className = "imgbox zoomed";
    intStatus1 = 1;
    document.getElementById("gallerytext").style.width = '570px';
}


		}
		if(zoom == 'zoomdontplay'){
		document.getElementById('flashvideo').style.width = '35.625em';
			var s1 = new SWFObject("/swf/flv/flvplayer.swf","single","570","341","8");
			s1.addVariable("file",bigvideo);
			s1.addVariable("image",preview);
			s1.addVariable("width","570");
			s1.addVariable("height","341");
			s1.addVariable("clickTag","javascript:zoomVideo('unzoom','"+ smallvideo+"', '"+bigvideo+"');");
			s1.addVariable("iszoomed","true");
			s1.addVariable("autostart","false");

if(document.getElementById("specialgallery")){
    document.getElementById("divimagebox_1" ).className = "imgbox zoomed";
    intStatus1 = 1;
    document.getElementById("gallerytext").style.width = '570px';
}


		}		if(zoom == 'unzoom'){
		document.getElementById('flashvideo').style.width = '17.375em';
			var s1 = new SWFObject("/swf/flv/flvplayer.swf","single","278","178","8");
			s1.addVariable("file",smallvideo);
			s1.addVariable("image",preview);
			s1.addVariable("width","278");
			s1.addVariable("height","178");
			s1.addVariable("clickTag","javascript:zoomVideo('zoom','"+ smallvideo+"', '"+bigvideo+"');");
			s1.addVariable("iszoomed","false");
			s1.addVariable("autostart","false");
if(document.getElementById("specialgallery")){
    document.getElementById("divimagebox_1" ).className = "imgbox";
    intStatus1 = 0;
    document.getElementById("gallerytext").style.width = '276px';
}		}
			s1.addParam("wmode","transparent");
			s1.addVariable("showzoom","true");
			s1.write("flashvideo");
	}

