﻿



function getScreenWidth()
	{
		
			return screen.width
		
	}

function dynamicLayout()
	{
		var browserWidth = getScreenWidth();

		if (browserWidth < 1200)
		{
		setActiveStyleSheet('altcss');
		}
	}


function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}




function addEvent( obj, type, fn )
	{ 
	   if (obj.addEventListener)
	   { 
	      obj.addEventListener(type, fn, false);
	   }
	   else if (obj.attachEvent)
	   { 
	      obj['e' + type + fn] = fn; 
	      obj[type + fn] = function(){obj['e' + type + fn](window.event)};
	      obj.attachEvent('on' + type, obj[type + fn]); 
	   } 
	} 

	addEvent(window, 'load', dynamicLayout);
	//addEvent(window, 'resize', dynamicLayout);
	
	if(window.navigator.systemLanguage && !window.navigator.language) {
  function hoverIE() {
    var LI = document.getElementById("navig").firstChild;
    do {
      if (sucheUL(LI.firstChild)) {
        LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
      }
      LI = LI.nextSibling;
    }
    while(LI);
  }

  function sucheUL(UL) {
    do {
      if(UL) UL = UL.nextSibling;
      if(UL && UL.nodeName == "UL") return UL;
    }
    while(UL);
    return false;
  }

  function einblenden() {
    var UL = sucheUL(this.firstChild);
    UL.style.display = "block"; UL.style.backgroundColor = "#F0DC93";
    //document.getElementById("nav").style.height = "28px"
   // document.getElementById("liRest").firstChild.style.color = "#000000";
   // document.getElementById("liRestSub1").firstChild.style.color = "#000000";
    //document.getElementById("liRestSub2").firstChild.style.color = "#000000";
    //document.getElementById("liRestSub3").firstChild.style.color = "#000000";
   // document.getElementById("liRest").style.backgroundColor = "#F0DC93";
    //document.getElementById("navig").style.overflow = "visible"
  }
  function ausblenden() {
    sucheUL(this.firstChild).style.display = "none";
    document.getElementById("liRest").firstChild.style.color = "#000000";
    document.getElementById("liRest").style.backgroundColor = "#F0DC93";
  }

  window.onload=hoverIE;
}

