function oG(a) {
	var h = window.screen.height;
	var features = "location=no, status=no, menubar=no, width=700, scrollbars=no, top=0";
	if (h <= 600) {
		features += ", height=534";
	} else {
		features += ", height=644";
	}
	window.open(a, '', features);
}

function oF(url, width, height) {
	window.open(url, 'frame', 'location=no,status=no,menubar=no,scrollbars=no,width=' + width + ',height=' + height);
}

function ri() {
	document.cookie = "h=" + screen.height;
}

var menuTimer = null;
function hl(o){
	o.style.backgroundColor = "#eb3d00";
}

function ll(o) {
	if (document.all) {
		prefix = "document.all." + o.id;
		menuTimer = window.setTimeout(prefix + '.style.backgroundColor = "#999999"', 100);
	} else {
		menuTimer = window.setTimeout('document.getElementById("' + o.id + '").style.backgroundColor = "#999999"', 150);
	}
}

function get_cookie(name) {
	var dc = document.cookie;
	var s = name + "=";
	var rv = "";
	if (dc.length > 0) {
		ofs = dc.indexOf(s);
		if (ofs != -1 ) {
			ofs += s.length;
			end = dc.indexOf(";", ofs);
			if (end == -1) end = dc.length;
			rv = unescape(dc.substring(ofs, end));
		}
	}
	return rv;
}

function showBanner(lang) {
	if (get_cookie("bmw1") != "open") {
		document.cookie = "bmw1=open;path=/;domain=.car.ee";
		window.open('http://car.ee/okoshki/bmw/?l=' + lang, '', 'width=790,height=500,location=no,menubar=no,status=no,resizable=no,scrollbars=no');
	}
}

function BMW2(lang) {
	if (get_cookie("bmw2" + lang) != "open") {
		bmwPopup = document.getElementById("bmwPop");
		bmwPopup.style.display = "block";
		document.cookie = "bmw2" + lang + "=open;path=/;domain=.car.ee";
	}
}

function BMW2Close() {
	bmwPopup = document.getElementById("bmwPop");
	bmwPopup.style.display = 'none';
}

function Vote(a) {
	if (document.getElementById) {
		ans = document.getElementById("answer");
		ans.value = a;
		frm = document.getElementById("pollForm");
		frm.submit();
	} else {
		pollForm.answer.value = a;
		pollForm.submit();
	}
}

function showGreeting() {
	return; // christmas is over
	if (get_cookie("greeting") != "open") {
		greet = document.getElementById("greeting");
		greet.style.display = "block";
		document.cookie = "greeting=open;path=/;domain=.car.ee";
	}
}

function showPopup(cookieName, bShowAnyway) {
	bShowAnyway = true;
	if (get_cookie(cookieName) != "open" || bShowAnyway) {
		p = document.getElementById("popup");
		if (p != null) {
			p.style.display = "block";
			document.cookie = cookieName + "=open;path=/;domain=.car.ee";
		}
	}
}

function closePopup() {
	p = document.getElementById("popup");
	p.style.display = "none";
}