//Diverse Elemente bei kleiner Fenstergr��e ver�ndern
	function getWindowWidth() {
			if (window.innerWidth)
				return window.innerWidth;
			else if (document.body && document.body.offsetWidth)
				return document.body.offsetWidth;
		}
	function getWindowHeight() {
			if (window.innerHeight)
				return window.innerHeight;
			else if (document.body && document.body.offsetHeight)
				return document.body.offsetHeight;
		}
	function CheckAufloesung(){
	
		ams=document.getElementById('innenbild');
		cont=document.getElementById('content');
		calk=document.getElementById('calcdiv');
		navi=document.getElementById('nav');
		bild=document.getElementById('austauschbild');
		teiler=document.getElementById('teiler2');
		border=document.getElementById('border_oben');
		logo1=document.getElementById('logo1_innen');
		logo2=document.getElementById('logo2_innen');
		funct=document.getElementById('container_func_innen');
		suchf=document.getElementById('suchfeld');
		adr=document.getElementById('adr_innen');
		
		if(ams){
			var w=getWindowWidth();
			var h=getWindowHeight();
			if (w <= 900) {
				ams.style.display="none";
				if(cont) {cont.style.left="223px";
					cont.style.right="13px";
					cont.style.top="80px";
					cont.style.bottom="40px";
				}
				if(calk) {calk.style.left="223px";
					calk.style.right="13px";
					calk.style.top="80px";
					calk.style.bottom="40px";
				}
				if(navi){
					navi.style.left="10px";
					navi.style.top="80px";
				}
				if(teiler) teiler.style.top="47px";
				if(bild) bild.style.display="none";
				if(border) border.style.height="47px";
				if(logo1) {
					logo1.style.top="10px";
					logo1.style.left="25px";
				}
				if(logo2) {
					logo2.style.top="50px";
					logo2.style.left="25px";
				}
				if(funct) funct.style.top="20px";
				if(suchf) suchf.style.right="5px";
				if(adr) adr.style.left="5px";
				
			} else if (w <= 1100){
			
				ams.style.display="block";
				if(cont) {cont.style.left="333px";
					cont.style.right="20px";
					cont.style.top="195px";
					cont.style.bottom="45px";
				}
				if(calk) {calk.style.left="333px";
					calk.style.right="20px";
					calk.style.top="195px";
					calk.style.bottom="45px";
				}
				if(navi) {
					navi.style.left="110px";
					navi.style.top="196px";
				}
				if(bild) bild.style.display="block";
				if(teiler) teiler.style.top="135px";
				if(border) border.style.height="133px";
				if(logo1) {
					logo1.style.top="102px";
					logo1.style.left="110px";
				}
				if(logo2) {
					logo2.style.top="140px";
					logo2.style.left="110px";
				}
				if(funct) funct.style.top="111px";
				if(suchf) suchf.style.right="100px";
				if(adr) adr.style.left="113px";
			}else {
			
				ams.style.display="block";
				if(cont) {cont.style.left="333px";
					cont.style.right="110px";
					cont.style.top="195px";
					cont.style.bottom="56px";
				}
				if(calk) {calk.style.left="333px";
					calk.style.right="110px";
					calk.style.top="195px";
					calk.style.bottom="56px";
				}
				if(navi) {
					navi.style.left="110px";
					navi.style.top="196px";
				}
				if(bild) bild.style.display="block";
				if(teiler) teiler.style.top="135px";
				if(border) border.style.height="133px";
				if(logo1) {
					logo1.style.top="102px";
					logo1.style.left="110px";
				}
				if(logo2) {
					logo2.style.top="140px";
					logo2.style.left="110px";
				}
				if(funct) funct.style.top="111px";
				if(suchf) suchf.style.right="100px";
				if(adr) adr.style.left="113px";
			}
		}
	}
	window.onload=window.onresize=CheckAufloesung;

function changePic(obj2, over) {
	var obj = obj2.getElementsByTagName('IMG')[0];
	var tmp_sub = 'FOLDER_' + akt_sub;
	if (obj && (obj2.id != tmp_sub)) {
		file = obj.src;
		tmp_img= new Image();
		if (over) {
			tmp_img.src = file.replace(/2*\.gif/, '2.gif');
		} else {
			tmp_img.src = file.replace(/2+\.gif/, '.gif');
		}
		obj.src = tmp_img.src;
	}
}

function GetDate() {
	obj = document.getElementById("date");
	if (!obj)
		return;
	var jetzt = new Date();
	var Tag = jetzt.getDate();
	if (Tag < 10)
		Tag = "0" + String(Tag);
	var months = new Array("J�nner", "Februar", "M�rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
	var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
	var Jahr = jetzt.getYear();
	if (Jahr < 999)
		Jahr += 1900;
	obj.innerHTML = Wochentag[jetzt.getDay()] + ", <span>" + Tag + ". " + months[jetzt.getMonth()] + " " + Jahr + "</span>";
}

function changeDisplay(div_id, if_, then_) {
	var elem = document.getElementById(div_id);
	if (elem && elem.style.display == if_)
		elem.style.display = then_;
}

function changeVisibility(div_id, if_, then_) {
	var elem = document.getElementById(div_id);
	if (elem && elem.style.visibility == if_)
		elem.style.visibility = then_;
}

function open_sub(SM_SHORT) {
	if (akt_sub != SM_SHORT) {
		 changeDisplay(akt_sub, 'block', 'none');
		 changeDisplay(SM_SHORT, 'none', 'block');
		 akt_sub=SM_SHORT;
	}
}

function getAdr(prefix, postfix, lnkparam, lnktxt) {
	lnktxt = lnktxt.replace(/TMPL_MAIL/, prefix + '@' + postfix);
	document.write('<a ' + lnkparam + ' href="mailto:' + prefix + '@' + postfix + '">' + lnktxt);
}

/*printjob*/
function printjob() {
	if (document.all && (navigator.appVersion.indexOf("Mac") != -1)) {
		self.focus();
		alert("Drucken-Funktion unter Macintosh nicht moeglich! \nBitte verwenden Sie Datei/Drucken");
	} else {
		if (document.all && navigator.appVersion.substring(22,23)==4) {
			self.focus();
			var OLECMDID_PRINT = 6;
			var OLECMDEXECOPT_DONTPROMPTUSER = 2;
			var OLECMDEXECOPT_PROMPTUSER = 1;
			var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
			document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
			WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
			WebBrowser1.outerHTML = '';
		} else{
			self.focus();
			window.print();
		}
	}
}

function Startpage(obj) {
	if (document.all) {
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage('http://');
	}
}

function Favorite() {
	if (document.all)
		window.external.AddFavorite('http://','Name');
}

function cont2pdf(ID) {
	script = "http://www.atikon.at/rechner/content2pdf.php";
	script = script + "?ID=" + ID + "&url=" + encodeURIComponent(window.location);
	window.open(script, 'm', 'scrollbars=no,height=400,width=470');
}

var popupmenuoldonload = window.onload;
window.onload = function() {
	if (!bin_startpage){
		var nav = document.getElementById('nav');
		var uls = nav.getElementsByTagName('UL');
		for(var i = 0; i < uls.length; i++)
			new xMenu1(uls[i], 0, 'mouseover');
		if(popupmenuoldonload)
			popupmenuoldonload();
	}
}

function xMenu1(menu, mouseMargin, openEvent) {
	var isOpen = false;
	if (menu)
		xAddEventListener(menu.parentNode, openEvent, onOpen, false);

	function onOpen() {
		if (!isOpen) {
			xShow(menu);
			HideSelects(xPageX(menu), xPageY(menu), xWidth(menu), xHeight(menu));
			xAddEventListener(document, 'mousemove', onMousemove, false);
			isOpen = true;
		}
	}
	function onMousemove(ev) {
		var e = new xEvent(ev);
		contains = (xHasPoint(menu, e.pageX, e.pageY, -mouseMargin) || xHasPoint(menu.parentNode, e.pageX, e.pageY, -mouseMargin));
		if(!contains) {
			var submenus = menu.getElementsByTagName('UL');
			for(var i = 0; i < submenus.length; i++)
				if(xHasPoint(submenus[i], e.pageX, e.pageY, -mouseMargin)) {
					contains = true;
					break;
				}
		}
		if(!contains) {
			xHide(menu);
			HideSelects(0, 0, 0, 0);
			xRemoveEventListener(document, 'mousemove', onMousemove, false);
			isOpen = false;
		}
	}
}

var sel;
function HideSelects(x,y,w,h) {
	if(xIE4Up && !xMac) {
		var selx, sely, selw, selh, i
		if(!sel)
			sel = document.getElementsByTagName("SELECT");
		for(i = 0; i < sel.length; i++) {
			selx = xPageX(sel[i]);
			sely = xPageY(sel[i]);
			selw = sel[i].offsetWidth;
			selh = sel[i].offsetHeight;
			sel[i].style.visibility = (selx + selw > x && selx < x + w && sely + selh > y && sely < y + h) ? "hidden" : "visible";
		}
	}
}