var Userwin;
var ConfCookie;
var AllCookies = document.cookie.split("; ");
for (var i=0;i<AllCookies.length;i++) {
	var cpair = AllCookies[i].split("=");
	if (cpair[0] == 'Conf')  ConfCookie = unescape(cpair[1]); 
}
if (ConfCookie) {
	var AllConfSettings = ConfCookie.split("&");
	for (var i=0;i<AllConfSettings.length;i++) {
		var spair = AllConfSettings[i].split(":");
		if (spair[0] == 'Userwin') Userwin = spair[1];
	}
}

var ie=document.all
var ns6=document.getElementById && !document.all

function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function getmousepos(e) {
	if (document.documentElement && document.documentElement.scrollTop && window.event) {
		curX = window.event.x + document.documentElement.scrollLeft;
		curY = window.event.y + document.documentElement.scrollTop;
	}
	else if(ie) {
		curX = window.event.x + window.document.body.scrollLeft;
		curY = window.event.y + window.document.body.scrollTop;
	}
	else if(ns6) {
		curX = e.pageX;
		curY = e.pageY;
	}
}


var closeaktiv;
var dropping;
var vc;
var AllMenues = new Array('partnerbereich','discounter','handynews');

function dropdown(DivID,height) {
	var dropobj = document.getElementById('drop_'+DivID);
	if (dropobj == null) return;
	if (dropobj.style.display == "block") return;
	closealldrops();

	var dropY = 89;

	if (ie) { dropY += 6; }
	dropobj.style.height = "10px";
	dropobj.style.display = "block";
	dropobj.style.top = dropY+"px";
	curOpened = DivID;
	window.clearInterval(closeaktiv);
	dropping = window.setInterval("dropmovedown('"+DivID+"',"+height+")",3);
}

function dropmovedown(DivID, endheight) {
	curHeight = document.getElementById('drop_'+DivID).style.height;
	curHeight = Math.round(curHeight.substr(0, curHeight.length-2)) +10;
	document.getElementById('drop_'+DivID).style.height = curHeight + "px";
	if (endheight <= curHeight) {
		window.clearInterval(dropping);
		closeaktiv = window.setInterval("closealldrops('"+DivID+"')",4000);
	}
}

function closealldrops() {
	if (vc) return false;
	window.clearInterval(dropping);
	window.clearInterval(closeaktiv);
	for (var m = 0; m < AllMenues.length; m++) {
		closeobj = document.getElementById('drop_'+AllMenues[m]);
		if ( closeobj == null ) continue;
		closeobj.style.display = "none";
		closeobj.style.height = "10px";
	}
}

function togglediv(DivID) {
	var toggleobj = document.getElementById(DivID);
	if (toggleobj == null) return;
	if (toggleobj.style.display == "none") 	{ toggleobj.style.display = "block"; }
	else									{ toggleobj.style.display = "none"; }
}

document.onmousemove = getmousepos;
document.onmousedown = closealldrops;

