<!--
/* START Platform Detect */
//***************************
// A few variables to help figure out what platform we're on

var syn_ie  = (navigator.appName.toLowerCase().indexOf("microsoft") != -1);
var syn_ns  = (navigator.appName.toLowerCase().indexOf("netscape") != -1);
var syn_win = (navigator.platform.toLowerCase().indexOf("win") != -1);
var syn_mac = (navigator.platform.toLowerCase().indexOf("mac") != -1);

/* END Platform Detect */


if ( !syn_ie && syn_mac ) {
	document.write("<LINK REL='stylesheet' HREF='/css/stylemac.css' media='screen' TYPE='text/css'>"); 
    document.write("<LINK REL='stylesheet' HREF='/css/styleie_print.css' media='print'TYPE='text/css'>");
    }
else {
	if ( syn_ie ) {
		document.write("<LINK REL='stylesheet' HREF='/css/styleie.css' media='screen'TYPE='text/css'>");
        document.write("<LINK REL='stylesheet' HREF='/css/styleie_print.css' media='print'TYPE='text/css'>");
	}
	else {
		document.write("<LINK REL='stylesheet' HREF='/css/stylenn.css' media='screen'TYPE='text/css'>");
        document.write("<LINK REL='stylesheet' HREF='/css/styleie_print.css' media='print'TYPE='text/css'>");
    }
}

//-- BEGIN SCRIPTS BY MacroMedia
//-- BEGIN SCRIPTS BY MacroMedia
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
    if(a==null || a.length == null) return;
    for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-- Buttons Kommunikation

function open_Popup(url,width,height)
{
	//var trails="width=" + width + ",height=" + height + ",toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no,location=no";
	var winname = "neu";
	var trails="width=" + width + ",height=" + height + ",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no";
	
    if(url != '')
    {
		return newWindow=window.open(url,winname,trails);
	}
}  

function openPopup(url,height,width,winname,screenX,screenY) 
{
	//var trails="width=" + width + ",height=" + height + ",toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no,location=no";
	var trails="width=" + width + ",height=" + height + ",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no";
	if (screenX != null)
	{
		trails += ",top=" + screenX;
	}
	if (screenY != null)
	{
		trails += ",left=" + screenY;
	}
    if(url != '')
    {
		return newWindow=window.open(url,winname,trails);
	}
}  


function getArticle(country,n_idx,height,width)
//News-Lösung
{
url='news.htmi?country=de&newsID='+n_idx;
open_Popup(url,height,width);
}




//-- BEGIN SCRIPTS BY GM

function changeColour(obj,value,speed){
    var nowCol = obj.bgColor.substr(1,6);
    var num = 100;
    alert(isNaN(nowCol));
    alert(isNaN(speed));
    alert(isNaN(num));
    alert(nowCol);
}


//-- END SCRIPTS BY GM






//-- BEGIN SCRIPTS BY AC
function Obj (id)
{
	return document.getElementById (id);
}

function highlightSelectedLink (link)
{
	var l = Obj (link);
	if (l!=null)
	{
		if (l.href== document.location.href)
			l.style.backgroundColor="#7E93C9";
	}
}

/*	Dieses Datum wird unter "Stand" auf der Startseite ausgegeben
	Das ist etwas getrickst: wenn die Datei selbst am aktuellen Tag verändert wurde, dann 
	wird dieses Datum angezeigt, sonst das aktuelle Datum - 1
	*/
var standDatumOffset = 1;
function getLastChangeDate()
{
	var lastMod = document.lastModified;
	lastMod = new Date(lastMod);
	lastMod = new Date(lastMod.getFullYear(), lastMod.getMonth(), lastMod.getDate(),0,0,1);
	var today = new Date();
	
	today = new Date(today.getFullYear(), today.getMonth(), today.getDate(),0,0,1);
	//document.writeln(lastMod + ",,," + addZeroToDateString((today.getMonth()+1)) + "/" + addZeroToDateString(today.getDate()) + "/" + today.getFullYear() );		
	//if (lastMod.substr(0,10) == addZeroToDateString((today.getMonth()+1)) + "/" + addZeroToDateString(today.getDate()) + "/" + today.getFullYear()  )
	if(lastMod == today)
		standDatumOffset=0;
	return today;
	//document.writeln(ToShortDateString(today));
		
}
//Halmbruchmonitoring: aktuellen Stand anzeigen
function getHaMoStand()
{
	var limit = new Date(2005, 7, 1);
	if ((new Date())>=limit) return;
	//standDatumOffset=0;
	var today = getLastChangeDate();
	var act_date = ToShortDateString(today);
	document.write ("(Stand: " + act_date + ")");
	
}

function ToShortDateString(dat)
{
	
	dat = new Date(dat-24*60*60*1000*standDatumOffset);

	if (dat.getDay()==0) //Sonntag
		dat = new Date(dat-24*60*60*1000);
	if (dat.getDay()==6) //Samstag
		dat = new Date(dat-24*60*60*1000);
	dat  =new Date(dat.getFullYear(), dat.getMonth(), dat.getDate(),0,0,1);
	
	var d = new Date();
	
	return addZeroToDateString(dat.getDate()) + "." + addZeroToDateString(dat.getMonth()+1) + "." + dat.getFullYear();
}
function addZeroToDateString(ds)
{
	if (ds==null) return "01";
	if ((ds+"").length==1)
		return "0" + ds;
	else
		return ds;
}

var window_count_berater=0;
/*
function openLexikonPopup(select_box,  data, width, height, winname)
{
if (select_box.selectedIndex==0) return;
	openLexikonPopup2(select_box.value,data,width,height,winname);
}
*/

function openLexikonPopup1(id, data)
{
	if(current_country==null)
		current_country = "de";
	openLexikonPopup(id, data, current_country);
}


function openLexikonPopup(id, data, country)
{
 var url;
 var newWindow;
 var height = 500;
 var width = 650;
 var winname = "Lexikon";
  
 url="/syngenta_scripts/_asp/lexikon/generate_lex_site.asp?country="  + country +"&idx=" + 
	id;
  url=url+"&Prefix="+data;

 var trails=  "width=" + width +
              ",height=" + height +
              ",toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no,location=no";
 if(url != '../../../schadorganismen/inse')
 {newWindow=window.open(url,winname,trails);}
}


// QUICK LINK ROUTINES
var _CurrentMenu;
var _CurrentMenuStyle;
function getMenuItemObjectByNumber (number)
{
	if (_MenuItemsArray==null) return;
	for (var i=0; i<_MenuItemsArray.length;i++)
	{
		if (_MenuItemsArray[i]==null) continue;
		if ( number == parseInt(_MenuItemsArray[i].menunumber))
			return _MenuItemsArray[i];
	}
	return null;
}

function getParentMenuStyle (name)
{
	var number;
	if (_mi==null) return;
	for (var i=0; i<_mi.length;i++)
	{
		if (_mi[i]==null) continue;
		if ( _mi[i][3] == name )
			return _mi[i];
	}
	return null;
}

function getMenuStyleByItemName (name)
{
	var number;
	if (_mi==null) return;
	for (var i=0; i<_mi.length;i++)
	{
		if (_mi[i]==null) continue;
		if ( _mi[i][3] == name )
			return _mi[i];
	}
	return null;
}


// QUICK-LINK
//Style für die Listbox
var quick_link_selectbox_style= "background-color:#94A5D1;color:white;border:0px solid red";//";

function getQuickLinkListBox()
{
	if(_CurrentMenuStyle!=null)
	{
		//Menü der aktuellen Seite
		_CurrentMenu = getMenuItemObjectByNumber (_CurrentMenuStyle[0]);
		if (_CurrentMenu==null) return;
		
		//Gibt es Untermenüs?
		var items = _m[_CurrentMenuStyle[0]][0];
		drawQuickLinkListBox2(items);
	}else
	{
		getQuickLinkListBoxStatic();
	}
}
function getCurrentMenu(name)
{
	if(_m!=null)
	{
		for(var i=0; i<_m.length; i++)
		{
			if(	_m[i][1] ==name)
				return _m[i];	
		}
	}
}
function drawQuickLinkListBox(_CurrentMenuStyle1)
{
	var temp = "";	

	
	//Menü-Style der aktuellen Seite
	if (_CurrentMenuStyle1==null) return;
	
	//Menü der aktuellen Seite
	_CurrentMenu = getMenuItemObjectByNumber (_CurrentMenuStyle1[0]);
	if (_CurrentMenu==null) return;
	
	
	//Gibt es Untermenüs?
	var _items = _m[_CurrentMenuStyle1[0]][0];
	//Wenn keine Untermenüs, dann die Menüpunkte der gleichen Ebene anzeigen
	if (_items==null)
	{
		//Das Parent-Menu ermitteln ...
		_CurrentMenuStyle1 = getParentMenuStyle (_CurrentMenu.name);
		// ... und seine Untermenüs anzeigen
		drawQuickLinkListBox(_CurrentMenuStyle1); return;
	}		
	var limit_options_count = 7;
	if (_items.length<7) limit_options_count= _items.length-1;
	
	
	//Start html table
	echo ("<table id='quick_link_table' width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"\" ID=\"Table1\" style='border:0px solid #94A5D1'>" +
          "    <tr> " +
          "      <td valign=\"top\" bgcolor=\"\" > <div align=\"right\"> " +
          "            <table width=\"98%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" class=\"navLink\" ID=\"Table2\">");
	

    var tt="";
	for (var i=0; i< _items.length;i++)
	{
		if (_CurrentMenuStyle1[2]!=_mi[_items[i]][2] )
		{
			//Link schreiben
			echo("<tr> " + 
                 "         <td class=\"navLink\" >" + 
                 "				<a  style='color:#000066' href=\"" + _mi[_items[i]][2] + "\">"+ _mi[_items[i]][1] + "</a>" + 
                 "      </td>" +
                 "       </tr>");
		}	
	}
	
	//Close the html table
	echo ("</table></div></td></tr></table>");
	
	
}

function drawQuickLinkListBox2 (items)
{
	
	//Start html table
	echo ("<table id='quick_link_table' width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"\" ID=\"Table1\" style='border:0px solid #94A5D1'>" +
          "    <tr> " +
          "      <td valign=\"top\" bgcolor=\"\" > <div align=\"right\"> " +
          "            <table width=\"98%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" class=\"navLink\" ID=\"Table2\">");
		
	if(items.length>0)
	{
		for(var i=0; i<items.length; i++)
		{
			var s = _mi[items[i]];
			//Link schreiben
			echo("<tr> " + 
                 "         <td class=\"navLink\" >" + 
                 "				<a  style='color:#000066' href=\"" + s [2] + "\">"+ s[1] + "</a>" + 
                 "      </td>" +
                 "       </tr>");			
		}
	}
	//Close the html table
	echo ("</table></div></td></tr></table>");

} 
function getQuickLinkListBoxStatic()
{
	for (var m in smenus.collection)
	{
		var smenu = smenus.collection[m];
		var act_link = document.location.href;
		var ignore = smenu.IgnoreSite;
		if(act_link.substr(act_link.length-ignore.length)!=ignore &&
			act_link.indexOf(smenu.Path)>=0)
		{
		
			var nr = smenu.MMenu.menunumber;
			var m = _m[nr];
			var items = m[0];
			drawQuickLinkListBox2(items);
				
		}
		
		/*function _getCurrentPage(){
			_I=_mi[_el];
			if(_I[2]){
				_url=_I[2];
				_hrf=location.href;
				fstr=_hrf.substr((_hrf.length-_url.length),_url.length);
				
				if(fstr==_url){
					_setCPage(_I);
					_cip[_cip.length]=_el;
					_CurrentMenuStyle = _I;
				}
			}
		}*/
		
	}
}


// END QUICK LINK ROUTINES

//Termin / News empfehlen
function forwardItem (item)
{
	
	var win = window.open ("", "ForwardItem"+item, "width=600,height=400,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=no");
	Obj("forward_form").target = "ForwardItem"+item;
	Obj("forward_form").submit();
	win.focus();
}


//SOME UTILS
function echo(txt)
{
	document.write (txt);
}
function echo_br(txt)
{
	echo (txt + "<br>");
}





/***************************
/*
/* GM 2005-02-24 
/*

function writeProductFootnotes ()
{
	var res="";
	if (arrFootnotes==null || arrFootnotes.length==0) return;
	for (var i=0; i<arrFootnotes.length; i++)
	{
		res +="<sup><font size=-1>" + (i+1) + ")</font></sup>&nbsp;" + arrFootnotes[i];
	}
	var pFootnotes = Obj("footnotes_output");
	if (pFootnotes !=null)
		pFootnotes.innerHTML=res;
}
*/
//-- END SCRIPTS BY AC
var versuchsstandort_img_path="/images/re/vers";
function changeimg ()
{

	var pic=changeimg.arguments[0];
	
	if(pic.indexOf("/images")==0)
		newPic = pic;
	else
		newPic=versuchsstandort_img_path+pic;
	document.bild.src=newPic;
}

function changeimg2 ()
{
var path='/images/re/vers/vr_os/';
var pic=changeimg.arguments[0];

   newPic=path+pic;
   document.bild.src=newPic;
}

function change_img ()
{
var path='/images/re/vers/vs_salz';
var pic=change_img.arguments[0];

   newPic=path+pic;
   document.bild.src=newPic;
}


//Für die Banner-Rotierung notwendige Variablen
  var actBannerRotationSteps = new Array();
  var actBannerRotationParams = new Array();
  //Diese Funktion ist der zentrale Aufruf für die Banner-Rotierung
  function rotateBanner(bannerId, params)
  {
	try
	{
		if(bannerId==null || document.getElementById (bannerId)==null) return;
		if(params==null)
		{	
			if (actBannerRotationParams == null && actBannerRotationParams [bannerId]==null) return;
			else params = actBannerRotationParams [bannerId];
		}
		
		var links = params["links"];
		var sources = params["sources"];
		var speeds = params["speeds"];
		if (links==null || sources==null) return;
		if (links.length != sources.length) return;
		
		//Set parameters
		var actRotationStep = actBannerRotationSteps [bannerId];
		if(actRotationStep == null) 
			actRotationStep = 0;
		
		actRotationStep = Number (actRotationStep);
		var actBanner, actHref, actLink, actSource, actSpeed;
		actBanner = document.getElementById (bannerId);
		if(actBanner==null) return;
		actHref = actBanner.parentNode;
		actLink = links [actRotationStep];	
		if (actLink!=null)
		{
			actSource = sources [actRotationStep];
			
			if (actSource != null)
			{
				actSpeed = speeds [actRotationStep];
				if (actSpeed == null)
					actSpeed = 6;
				
				//Rotate the banner
				actBanner.src = actSource;
				//Change the link
				if(actHref!=null)
					actHref.href = actLink;
				
			}
		}
		//Increase the step and save the parameters
		actRotationStep ++;
		
		if (actRotationStep > links.length) 
			actRotationStep=0;
		
		actBannerRotationSteps [bannerId] = actRotationStep;
		actBannerRotationParams [bannerId] = params;
		
		//Call the next rotation step
		window.setTimeout("rotateBanner('" + bannerId + "')",actSpeed*1000);
	}
	catch (err)
	{
		window.status=err.message;
	}
  }
//-- END SCRIPTS BY AC
//-->