$(document).ready(function(){

	$('#dk-block').hover(function () {
		$(this).stop().animate({width: '244px'},150)
	},
    function () {
		$(this).stop().animate({width: '76px'},150)

	});

 $(".contacts a").click(function(){
	if ( $(this).hasClass("active") ) {
		$(".contacts a.active").next("span").removeClass("hidden");
	}
	else {
		$(".contacts a.active").next("span").addClass("hidden");
		$(".contacts a.active").removeClass("active");
		$(this).next("span").removeClass("hidden");
		$(this).addClass("active");
	}
	return false;
     });

  $("a.town").click(function(){
		_rel = $(this).attr("rel");
	if ( $(this).hasClass("active") ) {
		$("div."+_rel+"").show();
	}
	else {
		$("div.town").hide();
		$("div.conTabs a.active").removeClass("active");
		$("div."+_rel+"").show();
		$(this).addClass("active");
	}
	return false;
     });



});


function lib_open_img_window(src,width,height){
    if(width==0)
        width=500;
    width+=20;
    if(height==0)
        height=400;
    height+=20;
    if(height>600)
        height=600;
    var left = (screen.availWidth/2) - (width/2);
    var top = (screen.availHeight/2) - (height/2);
    info=window.open('/img_preview.php?src='+src,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
    info.focus();
}
function open_window(src, id, width, height){
    if(width==0)   width=500;
    width+=20;
    if(height==0)  height=400;
    height+=20;
    if(height>600)  height=600;
    var left = (screen.availWidth/2) - (width/2);
    var top = (screen.availHeight/2) - (height/2);
    info=window.open('/'+src+'?id='+id,'photo','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
    info.focus();
}
