function pageWidth() {
	return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;
}

var current_li;

function my_toggle(element, zakl) { 
	var a = new Array ('district', 'gtype', 'abc', 'gtrc');
if (current_li) current_li.className = '';
current_li = zakl;
zakl.className  = 'act';
if (document.getElementById(element)) {
	if (document.getElementById(element).style.display != "block") {
		for (i=0;i<a.length;i++) {if (document.getElementById(a[i]) != undefined) document.getElementById(a[i]).style.display = "none";}
		document.getElementById(element).style.display = "block";
	} 
	else { return true; } 
}
}

function getScrollY() {
        var scrollY = 0;
        if( document.documentElement && document.documentElement.scrollTop ) {
            scrollY = document.documentElement.scrollTop;
        }
        else if( document.body && document.body.scrollTop ) {
            scrollY = document.body.scrollTop;
        }
        else if( window.pageYOffset ) {
            scrollY = window.pageYOffset;
        }
        else if( window.scrollY ) {
            scrollY = window.scrollY;
        }
        return scrollY;
}

var mhide=0;
var my_opened;
function my_show(id, id2)
{
	clearTimeout(mhide);
	if (my_opened) document.getElementById(my_opened).style.display = 'none';
	if (document.getElementById(id) != undefined) 
	{
		document.getElementById(id).style.display = 'block';
		my_opened = id;
	}
	if(id2 != undefined && document.getElementById(id2) != undefined)
	{
		document.getElementById(id2).style.borderColor = '#bcd1e4';
	}
}
function set_hide(id, time, id2)
{
	clearTimeout(mhide);
	if (time == undefined) time=500;
	// mhide = setTimeout('my_hide("'+id+'")',time);
	if(id2 != undefined && document.getElementById(id2) != undefined)
	{
		mhide = setTimeout('my_hide("'+id+'", "'+id2+'")',time);
	} else {
		mhide = setTimeout('my_hide("'+id+'")',time);
	}
}
function my_hide(id, id2)
{
	clearTimeout(mhide);
	my_opened = 0;
	if (document.getElementById(id) != undefined) document.getElementById(id).style.display = 'none';
	if(id2 != undefined && document.getElementById(id2) != undefined)
	{
		document.getElementById(id2).style.borderColor = '#ffffff';
	}
}
function dd_toggle(id)
{
	if(my_opened == id) my_hide(id);
		else my_show(id);
}
