//*****Variablen****//
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

//Browser bestimmen
var agt=navigator.userAgent.toLowerCase(); 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 
var nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1));

var nav4 = (nav && (is_major == 4));
var nav4up = (nav && (is_major >= 4));
var navonly      = (nav && ((agt.indexOf(";nav") != -1) ||
                      (agt.indexOf("; nav") != -1)) );
var nav5 = (nav && (is_major == 5));
var nav5up = (nav && (is_major >= 5));
var ie   = (agt.indexOf("msie") != -1);
var ie3  = (ie && (is_major < 4));
var ie4  = (ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var ie4up  = (ie  && (is_major >= 4));
var ie5  = (ie && (is_major == 5) && (agt.indexOf("msie 5.0")!=-1) );
var ie5up  = (ie  && !ie3 && !ie4);
var op = (agt.indexOf('opera')!=-1);

 

/*------------------------------------------------------------
Layer Menue in der Topnavigation
*/
	
startMenu = function() {
if (!mac && ie) {
	if (document.all&&document.getElementById) {
		cssmenu = document.getElementById("nav_sub");
		
		for (i=0; i < cssmenu.childNodes.length; i++) {
			node = cssmenu.childNodes[i];
			if (node.nodeName=="UL") {
				for(n=0; n < node.childNodes.length; n++) {
					child = node.childNodes[n];
		
					if (child.nodeName=="LI") {
						child.onmouseover=function() { 
							if(agt.indexOf("compatible; msie 5.5") >= 0) {
								//this.className = "over";
							}
							this.className = "over";
						}
						child.onmouseout=function(){ this.className=this.className.replace("over", "")}
					}
				}
			}
		}
	}
}
}

//window.onload=startMenu;

/*------------------------------------------------------------
Cookies
*/
function setCookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ){
  var cookie_string = name + "=" + escape ( value );
  if ( exp_y ){
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }
  if ( path ){ cookie_string += "; path=" + escape ( path );}
  if ( domain ){cookie_string += "; domain=" + escape ( domain );}
  if ( secure ){cookie_string += "; secure";}
  document.cookie = cookie_string;
}


function delCookie ( cookie_name ){
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}


function getCookie ( cookie_name ){
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );
  if ( results ){
    return ( unescape ( results[1] ) );
  }else{
    return null;
  }
}

/*------------------------------------------------------------
Container an und ausschalten
*/




function show (element) {
  if (document.getElementById){
    right=getCookie('rightSide');
    delCookie ('rightSide')
    setCookie('rightSide','visible', 2010, 12, 12,"/" );
    document.getElementById(element).style.visibility = 'visible';
  }
 }


function hide(element) {
  if (document.getElementById){
    right=getCookie('rightSide');
    delCookie ('rightSide')
    setCookie('rightSide','hidden', 2010, 12, 12,"/" );

    document.getElementById(element).style.visibility = 'hidden';
  }
}



/*------------------------------------------------------------
Elemente einer CSS-Klasse ermitteln
*/

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;
}


/*------------------------------------------------------------

	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.

--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:

var tgs;
//var tgs = new Array('body','div','td','tr','font','li');
var tgs = new Array('body');

//Specify spectrum of different font sizes:
//var szs = new Array('xx-small','x-small','small','medium','large','x-large','xx-large');
var szs = new Array('60%','70%','80%','90%','100%','110%','120%');
var startSz = 2;
//alert(szs[ startSz ]);

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;

	sz += inc;
	//if ( sz < 0 ) sz = 0;
	//if(!ie5){
	//	if ( sz > 4 ) sz = 4;
	//}else{
	//	if ( sz > 3 ) sz = 3;
	//}
	startSz = sz;
	//alert(sz + " --- " + szs[ sz ]);
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];


	cEl.style.fontSize = szs[ sz ];
	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ){
			 cTags[ j ].style.fontSize = szs[ sz ];
		 }
	}
	
	
	 /*Ausblenden der Layer im IE, sobald die Button-Zeile oben umbricht*/
	var submenue=getElementsByClassName("submenue");
 	if(ie && sz >4){
		for(i=0;i<submenue.length;i++){
  			submenue[i].style.visibility = "hidden";
		}
	}else{
	  	for(i=0;i<submenue.length;i++){
  			submenue[i].style.visibility = "visible";
		}
	}
}

/*--------------------------------------------------------------*/
 
function init(){
  startMenu();
//  var right = getCookie('rightSide');
//  if (right!=null) {
//     document.getElementById('rechts').style.visibility = right;
//  }
  
}
window.onload=init;

