var menu;
var ocnt;
var handler = null;

var d1;
var d4;
var menu_over =0;

function stepshowMenu() {
    if (menu == null)
        return false;
    menu.style.top = ocnt + "px";
    ocnt+=10;
    if (ocnt >= 10) {
        menu = null;
        clearTimeout(handler);
        handler = null;
    } else handler = setTimeout("stepshowMenu()", 30);
    return false;
}
function stephideMenu() {
    if (menu == null)
        return false;
    menu.style.top = ocnt + "px";
    ocnt-=10;
    if (ocnt < -100) {
        menu.style.display = "none";
        menu.parentNode.style.display = "none";
        menu = null;
        clearTimeout(handler);
        handler = null;
    } else handler = setTimeout("stephideMenu()", 50);
    return false;
}
function showMenu(own, mn) {
    if (handler != null) {
        if (menu != null) menu.style.display="none";
        clearTimeout(handler);
        handler = null; menu = null;
    }

	mn.style.top = "-100px";

    own.style.display = "block";
    mn.style.display = "block";

	ocnt = -100;
    menu = mn;

    handler = setTimeout("stepshowMenu()", 50);
    return false;
}

function isin(obj){
	if (obj=='d1'){
		d1=1;
	} else{
		d4= 1;
	}
}
			
function hideMenu(own, mn) {

    if (handler != null) {
        if (menu != null) menu.style.display="none";
        clearTimeout(handler);
        handler = null; menu = null;
    }
    ocnt = 0;
    menu = mn;
    handler = setTimeout("stephideMenu()", 50);
	
    return false;
}
function show(itemid, ownid, mnid,ox,oy) {
    var item = document.getElementById(itemid);
    var own = document.getElementById(ownid);
    var mn = document.getElementById(mnid);
	var tmp_image = document.getElementById('img_menu_id');
//	own.style.marginLeft ='50px';
//	own.style.marginBottom ='350px';
	own.style.top  = '33px';
    if (itemid=='item1'){
		own.style.left = '45px';
	} else{
		own.style.left = '680px';
	
	}
	if (ox>0)		own.style.left = ox;
	if (oy>0)		own.style.top = oy;

//    own.style.left = item.offsetLeft + "px";
//	own.style.top = item.offsetTop  + item.offsetHeight  + "px";

    return showMenu(own, mn);
}


function hide(itemid, ownid, mnid) {

	if (menu_over ==0){
			//alert(itemid);
		var own = document.getElementById(ownid);
		var mn = document.getElementById(mnid);
		if (itemid=='item2') document.getElementById('sub1').style.display="none"
    	return hideMenu(own, mn);
	}
}
function hide_with_detay(){
//	alert(menu_over);
	setTimeout("hide('item1', 'd1', 'd2')",40);
//	setTimeout("hide('item2', 'd4', 'd3')",1000);
}

function hide_with_detay2(){
	//setTimeout("hide('item1', 'd1', 'd2')",100);
	setTimeout("hide('item2', 'd4', 'd3')",40);
}


function over_menu(obj){
	this.style.color='#0099FF';
	this.style.bgcolor = '#FFFFFF';
}

function out_menu(obj){
	this.style.color='#0055AA';
	this.style.bgcolor = '#000000';
}


function div_menu_mouse_over(){
	menu_over = 1;
	

}
function div_menu_mouse_out(obj){
	menu_over = 0;
	
//	alert(obj);
	if (obj==1){
		hide_with_detay();
	} else{
		hide_with_detay2();	
	}/*sfHover = function() {
	var sfEls = document.getElementById("HeadSub").getElementsByTagName("area");
	for (var i=0; i<sfEls.length; i++) {
		c = i+'';
		if(i==0){c="0"}
		//document.write(i+"+");
		sfEls[i].onmouseover=function() {
			document.getElementById("ddm"+c).style.display="block";
		}
		sfEls[i].onmouseout=function() {
			document.getElementById("ddm"+c).style.display="none";
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);*/

/* PreloadMenuBgs
-------------------------*/

var imgbg1 = new Image();
imgbg1.src = "images/menu_bg_lvl1_hover.gif";

}

function SH_popup(uri,w,h,scroll){
	window.open(uri,'_blank','width='+w+', height='+h+', scrollbars='+scroll+'');
	}
function DailyNews(lang){
	var daten0 = new Date();
	var day0 = daten0.getDate();
	var month0 = daten0.getMonth();
	month0 = month0 + 1;
	if (month0 < 10){
		month0 = "0" + month0;
		}
	if (day0 < 10){
		day0 = "0" + day0;
		}
	var img0 = day0 + "-" + month0 + ".jpg";
	if (lang == "rus"){
		var folder = "cal_rus/";
		}
	if (lang == "deu"){
		var folder = "cal_deu/";
		}	
	var output = folder + img0;
	SH_popup(output,376,520,"no");
	}
function Ddate(){
	daten00 = new Date();
	var day00 = daten00.getDate();
	if (day00 < 10){
		day00 = "0" + day00;
		}
	document.write(day00);
	}