function getBodyScrollTop()
{
  return self.pageYOffset || 
    (document.documentElement && document.documentElement.scrollTop) || 
    (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
  return self.pageXOffset || 
    (document.documentElement && document.documentElement.scrollLeft) || 
    (document.body && document.body.scrollLeft);
}

function getClientWidth()
{
	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; 
}

function getClientCenterX()
{
    return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY()
{
    return parseInt(getClientHeight()/2)+getBodyScrollTop();
}

function setPopupCenterX()
{
	$("div.popup").css("margin-left","0px");
	$("div.popup").css("left",getClientCenterX()-$("div.popup").width()/2);
}

function setPopupCenterY()
{
	$("div.popup").css("top",parseInt(getClientCenterY()-$("div.popup").height()/2));
}

function setPopupCenter()
{
	/*alert(	'CenterX: '+getClientCenterX()+'\n'+
			'CenterY: '+getClientCenterY()
	);*/


	setPopupCenterX();
	setPopupCenterY();
}

function HideWindow(classname){
  	$('.'+classname).fadeOut('fast');
        if (jQuery.browser.msie && jQuery.browser.version < 8) {
            $('div#semitransparent').hide();
        } else {
            $('div#semitransparent').fadeOut('slow');
        }
	return false;
}
 

$(document).ready(function() {
	$("#closeBigMap").click(function(){
		$("#semitransparent").hide();
		$("#contactsPopup").hide();
	});

	$("#openBigMap").click(function(){
		$("#semitransparent").show();
		$("#contactsPopup").show();
	});
	
	$('.left_column .menu ul li.expand').click(function(){
		$(this).next('li.submenu').toggleClass('hidden');
	});
	
	
	
	
});






