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) {
     window.external.AddFavorite(bookmarkurl,document.title);
     } 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';
}



function print(PageId, args)
{
  var a='';
  if(args) {
    a = "&args=" + args;
  }
  var location = document.location.href;
  try {
    location = location.replace(/https?:\/\/.*?\//, '/');
  } catch(e) { }

  window.open("/module/print/Print.aspx?url=" +encodeURIComponent(location) + 
     "&pageid=" +PageId+a, "Drucken","width=775,height=750,scrollbars=yes");
}

	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(zoom == 'unzoom'){
		document.getElementById('flashvideo').style.width = '17.5em';
			var s1 = new SWFObject("/swf/flv/flvplayer.swf","single","280","178","8");
			s1.addVariable("file",smallvideo);
			s1.addVariable("image",preview);
			s1.addVariable("width","280");
			s1.addVariable("height","178");
			s1.addVariable("clickTag","javascript:zoomVideo('zoom','"+ smallvideo+"', '"+bigvideo+"');");
			s1.addVariable("iszoomed","false");
			s1.addVariable("autostart","false");
		}
			s1.addParam("wmode","transparent");
			s1.addVariable("showzoom","true");
			s1.write("flashvideo");
	}

function switchSite(dropDown)
{
  if (dropDown != null)
  {
    var href = dropDown.value;
    if (href == '') {return;}        

    if (href.indexOf("http://") < 0)
    {     
      if (href.indexOf(".pdfx") > 0)
      {
window.open(dropDown.value,"","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
      }
      else
      {
        document.location.href = href;
      }
    }
    else
    {
      if (href.indexOf(".docx") > 0)
       {
           document.location.href = href;
       }
       else
       {
      window.open(dropDown.value,"","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
       }
    }
  }
}