/* input background setting*/

var schonda=0;

if (window.addEventListener) {
	window.addEventListener("load", init, false)
//	window.addEventListener("resize", resize, false)
} else if (window.attachEvent) {
	window.attachEvent("onload", init)
//	window.attachEvent("onresize", resize)
}

function init() {
	if (Login = document.getElementById("logname")) {
	 	Login.style.backgroundImage = "url(/at/images/login.gif)";
	 	Login.onfocus = emptyValue;
		Login.onblur = refillValue;
	}
	if (Password = document.getElementById("logpassword")) {
	 	Password.style.backgroundImage = "url(/at/images/passwort.gif)";
	 	Password.onfocus = emptyValue_pw;
		Password.onblur = refillValue_pw;
	}
}

function emptyValue() {
	if (Login) {
        Login.style.backgroundColor = "#FFFFFF";
		Login.style.backgroundImage = "none";
	}
}
function emptyValue_pw() {
	if (Password) {
        Password.style.backgroundColor = "#FFFFFF";
		Password.style.backgroundImage = "none";
	}
}

function refillValue() {
	if (Login.value == "") {
		 Login.style.backgroundColor = "#FFFFFF";
   		 Login.style.backgroundImage = "url(/at/images/login.gif)";
	}
}
function refillValue_pw() {
	if (Password.value == "") {
		 Password.style.backgroundColor = "#FFFFFF";
   		 Password.style.backgroundImage = "url(/at/images/passwort.gif)";
	}
}

/* content resize funktion */
function resize() {
	if(document.getElementById('shop_sel_cat2')) {
		document.getElementById('shop_sel_cat2').style.width = "185px" ;
	}
	if(schonda<100) {
	try{	
		var breite = document.documentElement.clientWidth;
	
//		breite fuer gesamtlayout berechnen / anpassen
if(document.body) {
		if(breite < 977) {
//			anpassen
			document.body.style.width='98%';
		} else {
//			nothing
			document.body.style.width='987px';
			
		}
}
		
		if(document.getElementById('right')) {
//			document.getElementById("right").style.width='160px';
//			breite fuer contentbereich berechnen / anpassen
			breite = ( breite - ( 370 + 160 + 40 + 24 + 24 )); // breite - (news + right + padding + sicherheit)
		
			if(document.getElementById('content')) {
				document.getElementById("content").style.width=breite+'px';
			
				if(breite < 360) {	
					document.getElementById("content").style.width=breite+'px';			
				} else {
					document.getElementById("content").style.width='420px';
				}
				
			
			}
			if(breite < 160) {
				document.getElementById("content").style.width='160px';
				document.getElementById("container").style.width='770px';
			} else {
				document.getElementById("container").style.width='100%';
			}
			
		} else {
			breite = ( breite - ( 370 + 40 + 24 + 24 )); // breite - (news + right + padding + sicherheit)
	
			if(document.getElementById('content')) {
				document.getElementById("content").style.width=breite+'px';
			
				if(breite < 520) {	
					document.getElementById("content").style.width=breite+'px';			
				} else {
					document.getElementById("content").style.width='580px';
				}
				
			
			}
if(document.body) {			
			if(breite < 565) {
				document.body.style.width='987px';
			} else {
				document.getElementById("container").style.width='100%';
			}
		}
}
//		hohen berechnen und anpassen
			var hoehen = new Array();
			if(document.getElementById('container')) {
			hoehe = document.getElementById("container").clientHeight;
			
			ele_hoehe  = hoehe - (201);
			if(document.getElementById('right')) {
				document.getElementById("right").style.height=(ele_hoehe)+'px';
			}
			ele_hoehe  = hoehe - (381);
			document.getElementById("newstext").style.height=(ele_hoehe)+'px';
			}
			 var ultags = new Array();
		if(document.getElementById('cssmenu1')) {
			 var ultags=document.getElementById("cssmenu1").getElementsByTagName("ul");
		}
			if(document.getElementById('navigation')) {
//		Hmm, so wird inner die Navi neu positioniert ;-))))))) Endlich!
		document.getElementById("navigation").style.display="none";
		document.getElementById("navigation").style.display="block";
			}
		
		schonda++;
} catch(e) {
}
		return true;
		
		}
	
	}
function Numsort (a, b) {
  return a - b;
}
/***********************************************
* CSS Horizontal List Menu- by JavaScript Kit (www.javascriptkit.com)
* Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/ 
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset= -1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
		 /* spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;" 
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref) */
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)
