function getOptionsAnzeigen(type){

	oSel = document.getElementById('sel_rubrik');
	if(!oSel){return false;}
	if(!type){return false;}	
	if(!window.Ajax){return false;}
	param = '?r=' +  type;
	var url = 'getRubrikenAnzeigen_ajax.php' + param;
	 
	 new Ajax.Request( url, {
	 	 method: 'get',   
	 	 onSuccess: function(transport) {     	 				
	 	 				data = transport.responseText;
	 	 				//alert(data)
	 	 				aZeile = data.split(/\n/);
	 	 				oSel.length = 1;
	 	 				
	 	 				for(i=0; i<aZeile.length; i++){
	 	 					aFelder = aZeile[i].split(/##/);
		 	 				if(aFelder[0]){
		 	 					aFelder[0] = convert(aFelder[0],'ascii_to_iso');
		 	 					aFelder[1] = convert(aFelder[1],'ascii_to_iso');
    							tmp = document.createElement("option");
    							tmp.appendChild(document.createTextNode(aFelder[0] + '(' + aFelder[1] + ')'));
    							tmp.value=aFelder[0];
    							oSel.appendChild(tmp);
	 	 					}
	 	 				}
	 	 			} 
	 	 }
	 	 ); 

}

var text, dir, sString;

var ISOChars = new Array("¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ","–","—","‘","’","‚","“","”","„","†","‡","‰","‹","›");
var NamedEntities = new Array("&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&Dagger;","&permil;","&lsaquo;","&rsaquo;");
var UnicodeEntities = new Array("&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;");

function convert(text,dir)
{
 var maxChars = ISOChars.length;
 if(dir == "ascii_to_iso")
 {
  for(var i = 0; i < maxChars; i++)
  {
   sStringND = "/" + NamedEntities[i] + "/";
   sStringND = eval(sStringND);
   sStringUC = "/" + UnicodeEntities[i] + "/";
   sStringUC = eval(sStringUC);
   while(sStringND.test(text) == true) {
    text = text.replace(sStringND,ISOChars[i]); }
   while(sStringUC.test(text) == true) {
    text = text.replace(sStringUC,ISOChars[i]); }
  }
 }
 else if( (dir == "iso_to_ascii_named") || (dir == "iso_to_ascii_uc") )
 {
  for(var i = 0; i < maxChars; i++)
  {
   sString = "/" + ISOChars[i] + "/";
   sString = eval(sString);
   while(sString.test(text) == true)
   {
    if(dir == "iso_to_ascii_named")
     text = text.replace(sString,NamedEntities[i]);
    else if(dir == "iso_to_ascii_uc")
     text = text.replace(sString,UnicodeEntities[i]);
   }
  }
 }
 return text;
}












//kama,mahe 2006-07-03
//this javascripts are provided by conova (mahe@conova.com, kama@conova.com)



window.onload = function(){

	

	

	allInputs = document.getElementsByTagName('INPUT');



	for(i=0; i<allInputs.length;i++)

	

	if(allInputs[i].type.match(/submit/i)){

		allInputs[i].style.cursor='pointer';

	}







}



function test() {

	alert('test');

}



function reHeightenIFrame() {

	return false;

	//height = Element.getHeight(parent.frames[0].$('content'));

	height =  document.body.scrollHeight; //kama

	

	if(!height) {

		height = Element.getHeight(parent.frames[0].$('content'));

	}

		

	if(height){

		height1 = height+25;

		height2 = height1;

	}else {

		//height1=350;

		height1=850;

		height2=900;	

	}





	if(top != self /*&& top.document.getElementById('inews')*/){ //only in frame eviroment

		if(this.location.href.indexOf('_search_step0')>-1){

			if(top.document.getElementById('inews')) {

				top.document.getElementById('inews').style.display = 'block';

			}

			//top.document.getElementById('icontent').style.height = '350px';		

			top.document.getElementById('icontent').style.height = height1 ;					

		}else{

			if (top.document.getElementById('inews')) {

				top.document.getElementById('inews').style.display = 'none';

			}

			//top.document.getElementById('icontent').style.height = '900px';		

			top.document.getElementById('icontent').style.height = height2 + 'px';		

		}

	}

	//alert('height:'+ height );

	return false;

	

}









function descramble( address ) { //descrambles scrambled email-adresses

  return address.split("").reverse().join("").replace("(a)", "@");

}  







function getArgs(sep){

  var args = new Object();

  var query = location.search.substring(1);

  if(!sep) sep = '&';

  var pairs = query.split(sep);

  for(var i = 0; i <pairs.length; i++) {

    var pos = pairs[i].indexOf('=');

    if (pos == -1){

      args[pairs[i]]='';

      continue;

    }

    var argname = pairs[i].substring(0,pos);

    var value = pairs[i].substring(pos+1);

    args[argname] = unescape(value);}

  return args;

}







function checkImg(pic){

	// var width = Element.getDimensions(pic.parentNode).width;

    width = 450;



    

	if(pic.width>width){

		pic.width = width;

	}



}





function openWinSrc(src, txt){

   win = window.open('../bibliothek/AssignmentManagement/L_htm/winopen.html?img='+src+'&txt='+txt,'originalansicht','width=800,height=600,status=no,resizable');

}



function openWin(img,txt){

	win = window.open('../bibliothek/AssignmentManagement/L_htm/winopen.html?img='+img.src+'&txt='+txt,'originalansicht','width=300,height=200,status=yes,resizable,toolbar=no,scrollbars=yes,left=0,top=0');

/*

		win.document.write('<html><head><title>Originalansicht</title>');

		win.document.write('<script language="JavaScript" src="../js/funktionen.js" type="text/javascript"></script>');

		win.document.write('</head><body onload_="alert(win.document.referrer);" style="margin:0"><div style="width:auto" id="box">');

		win.document.write('<img id="pic" src="' + img.src + '" >');

		win.document.write('</div><script>alert(document.referrer)</script></body></html>');			

		win.document.close();

*/		

}



function openWin(img,txt,cid){

	win = window.open('../bibliothek/AssignmentManagement/L_htm/winopen.html?img='+img.src+'&txt='+txt+'&ad='+cid,'originalansicht','width=300,height=200,status=yes,resizable,toolbar=no,scrollbars=yes,left=0,top=0');

}

	

















function formatTab(){



 if($('tab')){   

    oTab = $('tab');

	numCols=oTab.rows[0].cells[0];

	

    

    for(var i=0; i<oTab.rows.length; i++){

    if(oTab.rows[i].className=='tr1' || oTab.rows[i].className=='tr0'){

	  if(oTab.rows[i].className=='tr1'){	

      oTab.rows[i].style.backgroundColor='#eeeeee';

      oTab.rows[i].cells[0].style.backgroundColor='#ffffff';}

      for(var j=0; j<oTab.rows[i].cells.length; j++){

        if(j==0){

        	if(i==0){continue;}

          oTab.rows[i].cells[j].onmouseover = function(){

          	//alert(this.getElementsByTagName('IMG').length)

          	//if(this.getElementsByTagName('IMG').length == 0}{return;}

            if(this.getElementsByTagName('IMG')[0].src.match(/trans.gif/)){return;}

            xy = Position.page(this.getElementsByTagName('IMG')[0]);	

			xy1 = Position.realOffset(this.getElementsByTagName('IMG')[0]);



            dimxy = Element.getDimensions(this.getElementsByTagName('IMG')[0]);

            if(dimxy.height<5 && dimxy.width<5){return;}

            oBox = $('box');

            newSrc = this.getElementsByTagName('IMG')[0].src;

            newSrc = newSrc.replace(/BildTn/,'BildLr')

            oBox.innerHTML='<img onload="if(Element.getDimensions(this).width >300){this.width=300}" border=1 src="' + newSrc  + '">'

            oBox.style.left = xy[0]+dimxy.width;

            oBox.style.top = xy[1]+xy1[1];

            oBox.style.display = 'block'

          }





          oTab.rows[i].cells[j].onmouseout = function(){

            oBox = $('box');

            oBox.style.display = 'none'

          }



          continue;

        }

        if(oTab.rows[i].className=='tr1'){

        if(oTab.rows[i].cells[j].innerHTML == ''){oTab.rows[i].cells[j].innerHTML = '&nbsp;'}

        oTab.rows[i].cells[j].style.paddingTop='5px';

        oTab.rows[i].cells[j].style.borderRight='1px solid #ffffff';

        /*oTab.rows[i].cells[j].style.textAlign='center';*/

        //oTab.rows[i].cells[j].style.cursor='s-resize';

		}

		





      }

   // oTab.rows[i].cells[numCols].style.borderRight='1px solid #000000';



      

    }

          

    } 







}





}





function hiliSelect(){

	//Hilight select-box if value not empty string

	oSelect = document.getElementsByTagName('SELECT');

	

	for(var i=0; i<oSelect.length; i++){

	  

	  if(oSelect[i].options[oSelect[i].selectedIndex].value!=''){

	    oSelect[i].style.color='white';

	    //oSelect[i].style.backgroundColor='#336699';

	    oSelect[i].style.backgroundColor='#888888';

	  }

	  oSelect[i].onchange=function(){

	    if(this.options[this.selectedIndex].value!=''){

	      this.style.color='white';

	      this.style.backgroundColor='#888888';

	      //this.style.backgroundColor='#336699';

	      }else{

	      this.style.color='black';

	      this.style.backgroundColor='#ffffff';      

	      }

	  }

	

	}

}





function popupPDF(link)

{

	var hoehe=650;

	var breite=530;

	var oben=Math.round(window.screen.availHeight-700);

	var links=window.screen.availWidth-breite-40;

	

	var options="titlebar=no,scrollbars=yes,resizable=yes,toolbar=no,locationbar=no,directories=no,status=no,menubar=no,dependent=yes,width="+ breite +",height="+ hoehe +",top="+ oben +",left="+ links;



	var W = window.open(link,'PDF',options);

	W.focus();

}










