/*** Allgemein ******************************************************************************/
/**/                                                                                      /**/
/**/ 

function $id (n) {
	try {
		return document.getElementById(n);
	} catch (e) {
		return
	}
}

function trim (str) {
   return str.replace(/^\s*|\s*$/g,"");
}

function bookmarkpage(seitenname) {
	bookmarkurl = location.href;
	if (document.all) {
		window.external.AddFavorite(bookmarkurl,seitenname);
	} else {
	   alert('Ihr Browser unterstützt diese Funktion nicht');
	}
  }

function openPopup(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

/**/                                                                                      /**/
/**/                                                                                      /**/
/*** /Allgemein *****************************************************************************/

/*** topNavi ********************************************************************************/
/**/                                                                                      /**/
/**/  

function imgOver(name,level) {
	eval("var arr=arr_"+level+";");
	for (var i=0;i<arr.length;i++) {
		if (arr[i]!==name) {
			$id(arr[i]).src = '/bcsd_templates/images/de/pf/de/templates/empty_arrow.gif';
		} else {
			$id(arr[i]).src = '/bcsd_templates/images/de/pf/de/templates/topNavi_'+level+'_arrow.gif';
		}
	}
}

function switchOffArrows (arr) {
	for (var i=0;i<arr.length;i++) $(arr[i]).src = '/bcsd_templates/images/de/pf/de/templates/empty_arrow.gif';
}

function swapArrow (state, lnk, channel) {
 var a=lnk.getElementsByTagName('img');
 a[0].src=(state=='on')?'/bcsd_templates/images/de/pf/de/templates/topNavi_'+channel+'_arrow.gif':'/bcsd_templates/images/de/pf/de/clear.gif';
}

/**/                                                                                      /**/
/**/                                                                                      /**/
/*** /topNavi *******************************************************************************/

/*** Zoom ***********************************************************************************/
/**/                                                                                      /**/
/**/                                                                                      /**/

function zoomIn () {
 var size = document.body.style.fontSize;
 if (parseInt(size) < 150) {
  size = parseInt(size);
  size = parseInt(size+10)+'%';
  savePersZoom(size);
  document.body.style.fontSize = size;
  moveAbsoluteDivs();
 }
}

function zoomOut () {
 var size = document.body.style.fontSize;
 if (parseInt(size) > 80) {
  size = parseInt(size);
  size = parseInt(size-10)+'%';
  savePersZoom(size);
  document.body.style.fontSize = size;
  moveAbsoluteDivs();
 }
}

function zoomNormal () {
 var size = document.body.style.fontSize;
 size = parseInt(size);
 size = '100%';
 savePersZoom(size);
 document.body.style.fontSize = size;
 moveAbsoluteDivs();
}

function setZoom () {
 document.body.style.fontSize = getPersZoom();
}

function savePersZoom (currentzoom) {
	//document.cookie = "currentzoom=" + currentzoom + ";";
	frames['cookieFrame'].setCookie(currentzoom);
}

function getPersZoom () {
	var c=frames['cookieFrame'].getCookie();
	//var currentzoom = '100%';
	//if (document.cookie) {
	//	var val = document.cookie
	//	var idxStart = val.indexOf("currentzoom=")
	//	var idxEnd = val.indexOf(";", idxStart);
	//	if (idxEnd < 0) idxEnd = val.length;
	//	if (idxStart >= 0) currentzoom = val.substring(idxStart + "currentzoom=".length, idxEnd);
	//} 
	//return currentzoom;
	return c;
}

function moveAbsoluteDivs () {
	/*
	$('supportNavi').style.display = 'none';
	$('supportNavi').style.position = 'absolute';
	$('supportNavi').style.top = '3.4375em';
	$('supportNavi').style.left = '49.5em';
	$('supportNavi').style.display = 'block';
	*/	
}

/**/                                                                                      /**/
/**/                                                                                      /**/
/*** /Zoom **********************************************************************************/

/*** Flash Pop Aufruf ***********************************************************************/
/**/                                                                                      /**/
/**/

function flashImgPopUp(uebergabe)	{
	popup = open("", "flash", "height=100, width=275 toolbar=no, menubar=yes, scrollbar=no, status=yes, directories=no");
	popup.document.open();
	
	with (popup.document) {
	write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>");
	write("<html><head><title>Bayer CropScience</title></head>");
	write("<body bgcolor='#000000' marginwidth='0' marginheight='0' leftmargin=0 topmargin=0>");
	write("<script language='Javascript'>");
	write("function fitImage(){");
	write("if (navigator.userAgent.indexOf('Opera') != -1)	{");
	write("breite = document.images[0].width + 12;");
	write("hoehe = document.images[0].height + 31;");
	write("}	else	{");
	write("if (navigator.userAgent.indexOf('Gecko') != -1)	{");
	write("breite = document.images[0].width + 8;");
	write("hoehe = document.images[0].height + 69;");
	write("}	else	{");
	write("if (navigator.appName.indexOf('Netscape') != -1)	{");
	write("breite = document.images[0].width;");
	write("hoehe = document.images[0].height - 18;");
	write("}	else	{");
	write("breite = document.images[0].width + 12;");
	write("hoehe = document.images[0].height + 80;");
	write("}");
	write("}");
	write("}");
	write("window.resizeTo(breite,hoehe)");
	write("}");
	write("<\/script>");
	write("<img src='" + uebergabe + "' border='0' alt='' onload='fitImage()'>");
	write("</body></html>");
	}
	popup.document.close();
	popup.focus();
}

/**/                                                                                      /**/
/**/                                                                                      /**/
/*** /Flash Pop Aufruf **********************************************************************/



