// css einstieg für javascript-an
document.documentElement.className += ' js ';

function surfto(form) {
var myindex=form.schnelleinstieg1.selectedIndex
if (form.schnelleinstieg1.options[myindex].value != "0") {
location=form.schnelleinstieg1.options[myindex].value;}
}
function surfto2(form) {
var myindex=form.schnelleinstieg2.selectedIndex
if (form.schnelleinstieg2.options[myindex].value != "0") {
location=form.schnelleinstieg2.options[myindex].value;}
}


function displayGlossary(articelNumber){
  glossarPopupPageId=108;
  modulId=144;
  url = baseurl + "desktopdefault.aspx/tabid-"+glossarPopupPageId+"/"+modulId+"_read-"+articelNumber+"/";
  glossar(url);
}


function displayZoom(imageNumber, title) {
  imagePopupPageId = 68;
  modulId = 125;
  url = baseurl + "desktopdefault.aspx/tabid-" + imagePopupPageId + "/" + modulId + "_read-" + imageNumber + "/cf-" + title + "/";
  pop2(url);
}


function pop (a){
	if(navigator.appName.substring(0,8)=="Netscape"){
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=no,scrollbars=1,height=260,width=450,top=10,left=10');
		mini.focus();
	}
	else{
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=no,scrollbars=1,height=240,width=467,top=10,left=10');
		mini.focus();	
	}
}

function glossar (a){
	if(navigator.appName.substring(0,8)=="Netscape"){
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=no,scrollbars=1,height=400,width=450,top=10,left=10');
		mini.focus();
	}
	else{
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=no,scrollbars=1,height=400,width=467,top=10,left=10');
		mini.focus();	
	}
}

function pop2 (a){
	if(navigator.appName.substring(0,8)=="Netscape"){
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=yes,scrollbars=1,height=560,width=450,top=10,left=10');
		mini.focus();
	}
	else{
		mini=window.open(a,'Pop','toolbar=0,location=0,status=0,menubar=1,resizable=yes,scrollbars=1,height=545,width=4670,top=10,left=10');
		mini.focus();	
	}
}

function go(url) {
opener.location.href = url;
}



function makeRemote(dateiname) {
  remote = window.open("","remotewin",'toolbar=0,location=0,status=0,menubar=0,resizable=yes,scrollbars=0,height=530,width=617,top=0,left=0');
  remote.location.href = dateiname
  if (remote.opener == null) {
    remote.opener = window;
  }
  remote.opener.name = "opener";
}


function go(url) {
  if (opener){
    opener.location.href = url;  
  }
}

var i=0, sw=screen.width*100/100, sh=screen.height*100/100;
function resize() {
if (navigator.appName == 'Netscape') {
  i=0;
}
if (document.articleImage) {
  nw = 67 + ((document.closeButton.width > document.articleImage.width) ? document.closeButton.width : document.articleImage.width);
} else {
  nw=560; 
}


if (document.articleImage) {
  nh = document.articleImage.height + 356 - i;
} else {
  nh = 560;
}
if (nw>sw) {
  nw = sw;
} 
if(nh>sh) {
  nh = sh;
}
window.resizeTo(nw, nh);
nx = screen.width/2 - nw/2;
ny = screen.height/2 - nh/2;
window.moveTo(nx, ny);
}


/* - - - - - - - - Einklappen / Ausklappen - - - - - - - - - - - - - */
function getElementsByClassName(class_name){
	var all_obj,ret_obj=new Array(),j=0,teststr;

	if(document.all){
		all_obj=document.all;
	}
	else if(document.getElementsByTagName && !document.all){
		all_obj=document.getElementsByTagName("*");
	}
	
	for(i=0;i<all_obj.length;i++){
		if(all_obj[i].className.indexOf(class_name)!=-1){
			teststr=","+all_obj[i].className.split(" ").join(",")+",";
			if(teststr.indexOf(","+class_name+",")!=-1){
				ret_obj[j]=all_obj[i];
				j++;
			}
		}
	}
return ret_obj;
}

function klappZu () {
  linktarget = window.location.hash+"";
  linktarget = linktarget.slice(1)
	var c = getElementsByClassName('show');
	for (var i = 0; i < c.length; i++){
	   if (c[i].getAttribute('name')=="cat"+linktarget){
		  // look for parent node       
		  theGrandFather = c[i].parentNode.parentNode;
		  if (theGrandFather && theGrandFather.nodeName=="LI"){
          theGrandFather.style.display = ''; 
      }
		} else {
      c[i].style.display = "none";
    }
	}
	if (linktarget && linktarget != ""){
	  //after the expansion of all demanded categories, you have to jump to the anker again, since it probably has moved in the meanwhile
    self.location.href=window.location;
  }
}

function outline(id){
 var anObject =  document.getElementById(id);
 if (anObject){
  if(anObject.style.display == 'none'){
    anObject.style.display = '';
  }
  else{
    anObject.style.display = 'none';
  }
}
}

/* --- Glossar ---*/

function displayGlossarInMainWindow(){
    // set parentWindow
    go ("desktopdefault.aspx/tabid-75/");
    // close window
     self.close();   
 }


/** capture return-events*/
function noenter() {
  return !(window.event && window.event.keyCode == 13); 
}





/* - - - - - - - - Klassenwechsel - - - - - - - - - - - - - */
var curSelect = 0;
var maxSelect = 3;

function onSelectTxt(prmThis)
{

 if (("cssTxtNotSelected"==prmThis.className) && (curSelect<maxSelect)) {
 prmThis.className = "cssTxtSelected";
 curSelect++;

 } else if ("cssTxtSelected"==prmThis.className) {
 prmThis.className = "cssTxtNotSelected";
 curSelect--;
 }

}

  
/* */
function removeEmptyTooltips() {

  nav = document.getElementById('senkrMenu');
  if (nav) {
    tooltips = getElementsByClassName('tooltip');
    for (var i = 0; i < tooltips.length; ++i) {
      if (tooltips[i].firstChild.innerHTML.length < 3) {
        tooltips[i].className = 'tooltipHidden';
      }
    }
  }
}

function hookTrHigh() {
	var trhigh = function () {
		if (typeof this._cname == 'undefined') {
			this._cname = this.className;
		}
		if (this._cname != this.className) {
			this.className = this._cname;
		} else {
			this.className = 'highlight';
		}
	}
	var tables = document.getElementsByTagName('table');
	var trows;
	for (var k = 0; k < tables.length; k++) {
		if (tables[k].className.toLowerCase().indexOf('komplex') != -1) {
			trows = tables[k].rows;
			for (var i = 0; i < trows.length; i++) {
				if (trows[i].parentNode.tagName.toLowerCase() != 'thead') {
					trows[i].onmouseover = trhigh;
					trows[i].onmouseout = trhigh;
				}
			}
		}
	}
}

/* - - - - - - - - Init - - - - - - - - - */
function init() {
	klappZu();
	hookTrHigh();
}
//window.onload=init;



document.write('<link rel="stylesheet" href="portaldata/1/resources/layout/css/jquery.lightbox.css" type="text/css" \/>');
document.write('<script type="text/javascript" src="portaldata/1/resources/layout/jscript/jquery-1.3.2.min.js"><\/script>');
document.write('<script type="text/javascript" src="portaldata/1/resources/layout/jscript/jquery.metadata.js"><\/script>');
document.write('<script type="text/javascript" src="portaldata/1/resources/layout/jscript/jquery.lightbox.js"><\/script>');
document.write('<script type="text/javascript" src="portaldata/1/resources/layout/jscript/mainjquery.js"><\/script>');