<!-- Scripting by m:com cologne -->
var lastan="";
function laden(name, erstes, zweites) {  
     appname = navigator.appName;
     appversion = navigator.appVersion;
  if (browserOK) {     
    Bilder[name] = new Array(3);
    Bilder[name][0] = new Image();
    Bilder[name][0].src = erstes;
    Bilder[name][1] = new Image();
    Bilder[name][1].src = zweites;
  }
}

function an(name){
     appname = navigator.appName;
     appversion = navigator.appVersion;
  if (browserOK) {
    
     if ((name.indexOf("snav") >= 0) && (appname.indexOf("Netscape") >= 0) && appversion.substr(0,1) == "4") {
       //alert(navigator.appVersion);
       	   doc = document.snav.document; // 
	   }
     else if ((name.indexOf("unav") >= 0) && (appname.indexOf("Netscape") >= 0) && appversion.substr(0,1) == "4") {
		//alert(window.document.layers.length);
	 	  doc = window.document.nav.document; 
	   }   
	 else {
	   doc = document; }  
	 if(lastan != "") {
	    doc.images[lastan].src = Bilder[lastan][0].src;
	 } 
	 if(doc.images[name]){
	 	doc.images[name].src = Bilder[name][1].src;
	 	lastan = name;
	 }
  }
}

function aus(name){
     appname = navigator.appName;
	 appversion = navigator.appVersion;
     if ((name.indexOf("snav") >= 0) && (appname.indexOf("Netscape") >= 0) && appversion.substr(0,1) == "4") {
	   doc = document.snav.document; 
	 } else {
	   doc = document; }  
  if (browserOK) {
	 if(lastan != "") {
		  if(!doc.images[lastan]) {
		      //alert("Lastan: "+lastan);
		  }
	    doc.images[lastan].src = Bilder[lastan][0].src;
	 }  
	 lastan = "";
  }
}


function m_an(name,layer){
  if (browserOK) {
     if (document.images) {
		if ( document.getElementsByTagName ) {
		    if ((navigator.appName == "Netscape") && navigator.appVersion.substr(0,1) != "4") {
			     doc = document;
			
			}else if (navigator.appName == "Netscape") {
			    
				doc = document.getElementsByTagName("*");
			
			}else {
			    
		        doc =document.getElementById(layer).document ;
			}
		}else {
			doc = document.layers[layer].document
		}
	}
	if(lastan != "") {
	    doc.images[lastan].src = Bilder[lastan][0].src;
	 } 
	 //alert(doc.images[name].src);
	 doc.images[name].src = Bilder[name][1].src;
	 lastan = name;
	 //alert(doc.images[name].src);
  }
}

function m_aus(name,layer){
  if (browserOK) {
	 if(lastan != "") {
	     if (document.images) {
			if ( document.getElementsByTagName ) {
				if ((navigator.appName == "Netscape") && navigator.appVersion.substr(0,1) != "4"){	     
				 	doc = document;
				}else if (navigator.appName == "Netscape") {
					doc = document.getElementsByTagName("*");
				}else {
			        doc =document.getElementById(layer).document ;
				}
			}else {
				doc = document.layers[layer].document
			}
		}
	    doc.images[lastan].src = Bilder[lastan][0].src;
	 }  
	 lastan = "";
  }
}


function helpan(name){
 
  if (browserOK) {
	   document.images["ftext"].src = Bilder[name][1].src;	
  }
}


   function openlink(lnk, typ, stat, opn) {
       openlink(lnk, typ, stat, opn, '');
   }


   function openlink(lnk, typ, stat, opn, winpar) {
       //alert(stat + " " + opn);
	   if(stat) {
           var lnkparam = "";
           if(typ == 1 || typ == 2){	
               if(typ == 1){
                   lnkparam = "strLink=" + escape(lnk);
               } else {
			       lnkparam = "strFile=" + escape(lnk);
               }
			   lnk = "/showdata.php?" + lnkparam;
           }
	   }
       if(!opn) {
	       location.href = lnk;
	   } else {
	      if(winpar == "") {
			winpar = 'toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width=800, height=600';
          }
 	      openexternal(lnk, winpar);
	   }
   }


   function openexternal(page)
   {
		wshelp = window.open (page, 'Extlink','width=700,height=420,location=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes,screenY=80,screenX=80');
		wshelp.focus();
   }


   function openexternal(page,winpar)
   {
		wshelp = window.open (page, 'Extlink',winpar);
		wshelp.focus();
   }

function openpage(page, features, type) {
    if(page != "") {
	    if(type == "O") {
	      if (page != "") {
	        parent.location.href="print.php?page_id=" +page + "&type=" +type;
		  }
		} else {
		    //window.open (dynamicserver + "/print.php?page_id=" + page + '&type=' + type, 'winxtra','height=360,width=540,scrollbars');
		    window.open ("print.php?page_id=" + page + "&type=" +type, 'winxtra',features);
		}
	}	
}

function selectpage(page,type) {
  openpage(page,'height=360,width=540,scrollbars',type);
}

  function openenglish_static()
{
wsopen=window.open('englisch.htm','Fenster1','width=300,height=200')
wsopen.focus();
}

  function not_available() 
  	{
	    seite = 'not_available.htm';
		window.open(seite, 'Fenster2', 'width=200,height=120,scrollbars,screenY=80,screenX=80');  
	}
	
 function forgot_password(lang) 
  	{
	    seite = 'forgot_password.cfm?lang=' + lang;
		window.open(seite, 'Fenster3', 'width=300,height=200,scrollbars,screenY=80,screenX=80');  
	}

function selectanw()
   {
	    a1 = document.mainform.anwend_1_id.options[document.mainform.anwend_1_id.selectedIndex].value;
        if(!a1) {
		  a1 = '0';
		}
	    a2 = document.mainform.anwend_2_id.options[document.mainform.anwend_2_id.selectedIndex].value;
        if(!a2) {
		  a2 = '0';
		}
	    a3 = document.mainform.anwend_3_id.options[document.mainform.anwend_3_id.selectedIndex].value;
        if(!a3) {
		  a3 = '0';
		}
        location.href = "anw" + page_id + "_" + a1 + "_" + a2 + "_" +a3 + ".htm";
   }


function ausblenden()
	{
	 document.all.alertdiv.style.visibility='hidden';			
	}

  
  function alertdivshow(text) {
           	document.all.alertdiv.style.visibility='visible';
			document.all.alertdiv.innerHTML = "<span class=\"normal\">";
			document.all.alertdiv.innerHTML += text;
			document.all.alertdiv.innerHTML += "</span>";
			setTimeout("ausblenden()",5000);
  }

function load_content(x)
{
  if (x == "")
  {
  }
  else
  {
    //teil = x.indexOf("http://");
    teil = -1;
    if (teil == "-1")
    {
      document.location.href = x;
    }
    else
    {
window.open(x,"Fenster","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600");
    }
  }
}

function dosearch(strLang){
   q = document.mainform.q.value;
   if (strLang == "de"){
        x = 'http://search.bayer.com/newbayer/suche.php?tag=D%&wf=12421&ps=10&hilfe=0&q='+ q;
   } else {
        x = 'http://search.bayer.com/newbayer/search.php?tag=E%&wf=12421&ps=10&hilfe=0&q='+ q;
   }
   document.location.href = x;
}


function getprintstatic()
 	{  
	seite = location.pathname;
	linkanf = seite.lastIndexOf("page");
	if (linkanf == -1) {
	    linkanf = seite.lastIndexOf("anw");
	} 
	charnum = seite.length - linkanf + 1;
	seite = 'print_' + seite.substr(linkanf,charnum);
	return seite;
  }

  
if (document.layers) brows = "ns";
if (document.getElementById) brows = "ie";  // bei nn5 und ie5 

var activ_div = "";

function show(ebene) 
	{     
	    if( activ_div != ebene ) {
			if( ebene != "" ) {
				if ( brows == "ie") {
				     document.getElementById(ebene).style.visibility =  "visible";
					}
				else {
					eval('document.layers["'+ebene+'"].visibility="show"');
					//alert(document.layers[ebene].visibility);
					}
			}
			if ( activ_div != "" ) {
				if ( brows == "ie") {
				    eval('document.getElementById("' + activ_div + '").style.visibility =  "hidden"')  ;
					}
				else {
					eval('document.layers["'+ activ_div +'"].visibility="hidden"');
					}
			}
		}
		activ_div = ebene;
	}

function hide(ebene) 
	{    
	     if (activ_div != ""){
	      	if(document.layers) 
	      		document.layers[activ_div].visibility="hide"; 
	    	else 
	      		eval('document.getElementById("' + activ_div + '").style.visibility ="hidden"')  ;
			activ_div = "";	
	    }
	}


function zoombild(bildname, width, height, strHeadline) {
//        MM_openBrWindow('/zoombild.html?bildpfad='+bildname+'&width'+width+'&height'+height+'&strHeadline='+strHeadline,'zoombild','scrollbars=no,width='+width+',height='+height);
    if (strHeadline) {
        openlink(dynamicserver+'/zoombildclose.php?bildpfad='+bildname+'&width='+width+'&height='+height+'&strHeadline='+strHeadline,1,false,true,'scrollbars=no,width='+width+',height='+height);
    } else {    
        openlink(dynamicserver+'/zoombildclose.php?bildpfad='+bildname+'&width='+width+'&height='+height,1,false,true,'scrollbars=no,width='+width+',height='+height);
    }
}

function gohome(){
	seite = location.href;
	if(seite.indexOf("host") > 0){
	    linkanf = seite.indexOf("host");
		linkend = seite.indexOf("&&");
		hostname = seite.substring(linkanf+5,linkend);
  	    //alert(hostname);
		document.location.href = "http://" + hostname;
  	}
		
}


function do_submit(operate) {
    if(!cdversion) {
	    if(operate.indexOf("callpage_") == 0) {
		    document.mainform.page_id.value = operate.replace(/callpage_/,"");
			operate = "";
		}
	    document.mainform.operate.value = operate;
		document.mainform.submit();
	} else {
	    if(operate.indexOf("callpage_") == 0) {
		    var page = operate.replace(/callpage_/,"");
			location.href = 'page' + page + '.htm';
		} else if(operate == "selectanw") { 
		    selectanw();
		} else {
		    not_available(lang);
		}
	}
}


function not_available() {
   alert ('In der CD Version nicht verfügbar');
}


function order_action(operate,item_id) {
    document.mainform.operate.value = operate;
    document.mainform.item_id.value = item_id;
	document.mainform.submit();
}

function selectcountry(landid) {
   var seite;
   if(!cdversion) {
   	seite = "print.php?page_id=" + weltweit + "&type=K&land="+landid;
  } else {
    seite = "land" + weltweit + "_" + landid + ".htm";
  }
  window.open(seite,'Contact','width=620, height=420, menubar=yes, resizable=yes, scrollbars=yes, screenY=80, screenX=80');
}


function openbewerbung() {
   var seite;
   if(!cdversion) {
   	location.href = "index.php?page_id=" + bewerbung;
  } else {
    not_available();
  }
}


function selectbereich(bereich_id) {
   location.href = "index.php?bereich_id=" + bereich_id;
}

var hint_timer;
function showhint(hint) {
   status = hint;
   hint_timer=30;
   var hintobj = document.getElementById('jshint');
   var X = event.clientX+document.body.scrollLeft;
   var Y = event.clientY+document.body.scrollTop;
   var hd = hintobj.style.visibility;
   hintobj.style.visibility = 'visible';
   hintobj.style.left = X;
   hintobj.style.top = Y;
   hintobj.innerText = hint;
   hidehint();
}

function hidehint() {
   if(hint_timer > 0) {
   	 hint_timer -= 1;
     setTimeout('hidehint()',100);
   } else {
   	var hintobj = document.getElementById('jshint');
   	hintobj.style.visibility = 'hidden';
   }
 }
 
 function do_search(searchpage) {
     //document.mainform.suchfeld.value = document.all.suchfeld2.innerText;
     do_submit('callpage_' + searchpage);
 }
 
 function openpdf(lnk) {
    lnk2 = lnk.replace(/produktdaten/,"daten");
	openlink(lnk2,2,true,true,'');
 }