function popupOpen() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=popupOpen.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win=window.open(url,'win_front','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win.focus();
}

function openPicture() {		// parameter.reihenfolge: URL, WIDTH, HEIGHT
	var w,h,url,aw,ah;
	var a=openPicture.arguments;
	if (a.length==0) return;
	url=a[0];
	if (a.length>1) {
		w=a[1]; h=a[2];
	}
	else {
		w=500; h=400
	}
	win_pic=window.open(url,'win_pic','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h);
	if (screen) {
		aw=screen.availWidth;
		ah=screen.availHeight;
		win_pic.moveTo(((aw/2)-(w/2)),((ah/2)-(h/2)));
	}
	win_pic.focus();
}

var obj_to_hide=new Array();
var hids=new Array();
Array.prototype.in_array=function(s) {
	for (var i=0; i<this.length; i++) {
		if (s==this[i]) return i;
	}
	return -1;
}

function show(obj) {
	var op=obj_to_hide.in_array(obj);
	if (op != -1) {
		clearTimeout(hids[op]);
		obj_to_hide[op]=false;
	}
	else {
		if (obj.className.indexOf('over') == -1) {
			obj.className+=' over';
		}
	}
}

function hide(obj) {
	obj_to_hide[obj_to_hide.length]=obj;
	hids[hids.length]=setTimeout('exec_hide('+(obj_to_hide.length-1)+')',200);
}

function exec_hide(i) {
	obj_to_hide[i].className=obj_to_hide[i].className.replace(' over', '');
	obj_to_hide[i]=false;
	clearTimeout(hids[i]);
}

function getBrowser() {
	if (!window.RegExp) return false;
	var ret={ name:'', version: 0 };
	var AGENTS = ["opera","msie","safari","firefox","netscape","mozilla"];
	var agent = navigator.userAgent.toLowerCase();
	for (var i = 0; i < AGENTS.length; i++) {
		var agentStr = AGENTS[i];
		if (agent.indexOf(agentStr) != -1) {
			var versionExpr = new RegExp(agentStr + "[ \/]?([0-9]+(\.[0-9]+)?)");
			var version = 0;
			if (versionExpr.exec(agent) != null) {
				ret.version = parseFloat(RegExp.$1);
				ret.name=agentStr;
				return ret;
			}
		}
	}
	return ret;
}
Browser= {
	IE:     !!(window.attachEvent && !window.opera),
	Opera:  !!window.opera,
	WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
	Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
	XPath: !!document.evaluate,
	version: getBrowser().version
};

function getWindowHeight() {
	if(!Browser.XPath && Browser.WebKit){
		return this.innerHeight;
	}
	if(Browser.Opera){
		//return document.body.clientHeight;
		return document.body.parentNode.clientHeight;
	}
	//return document.documentElement.clientHeight;
	if (Browser.IE && Browser.version<7) {
		return document.documentElement.offsetHeight;
	}
	return document.body.parentNode.clientHeight;
}
function scaleFlexContent() {
	var h=parseInt( getWindowHeight());
	if (h==0) return;
	var fc=document.getElementById("flex_content");
	var fi=document.getElementById("flex_content_inner");
	var sh=fc.scrollHeight;
	if (sh>(h-196)) {
		fi.style.paddingLeft="16px";
		//fc.style.marginLeft="8px";
		//fc.style.width=(fc.scrollWidth-8)+"px";
	}
	fc.style.height = (h-196)+"px";
}

if (window.attachEvent) {
	window.attachEvent('onload', scaleFlexContent);
	window.attachEvent('onresize', scaleFlexContent);
}
else if (window.addEventListener) {
	window.addEventListener('load', scaleFlexContent,false);
	window.addEventListener('resize', scaleFlexContent,false);
}													

// Fader
Event.observe(window, "load", function() {
	if (typeof Effect == "undefined") return;
	try {
		new Effect.Move("move_heli",{y: -177, duration: 2.5, delay: 0.5, mode:"relative", beforeStart: function() {
			$("move_heli").show();
			Position.absolutize("move_heli");
			var h=getWindowHeight() - ((Browser.IE && Browser.version<7) ? 160 : 15);
			$("move_heli").setStyle({top: h+"px"});
		}})
	}
	catch(e) { }
});
