/*** Allgemein ******************************************************************************/
/**/                                                                                      /**/
/**/ 

function $ (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) {
			$(arr[i]).src = '/bcsd_templates/images/ch/cs/de/templates/empty_arrow.gif';
		} else {
			$(arr[i]).src = '/bcsd_templates/images/ch/cs/de/templates/topNavi_'+level+'_arrow.gif';
		}
	}
}

function switchOffArrows (arr) {
	for (var i=0;i<arr.length;i++) $(arr[i]).src = '/bcsd_templates/images/ch/cs/de/templates/empty_arrow.gif';
}

function swapArrow (state, lnk, channel) {
 var a=lnk.getElementsByTagName('img');
 a[0].src=(state=='on')?'/bcsd_templates/images/ch/cs/de/templates/topNavi_'+channel+'_arrow.gif':'/bcsd_templates/images/ch/cs/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 **********************************************************************************/


