$(document).ready(function() {
	/*$(".content .group img").hide();
    $(".content .group img").bind('load',function(){
        
        $(this).show(500);
    });*/
    //$(".content .group").hide();
	//$(".content .group").show(2500/*,function(){alert(1)}*/);
	/*$(".content .group img").echo(function(i) {
        $(this).bind('load',function(){
            $(this).show("slow");
        });
    });*/
    var isMini = false;
    var buffer = 0;
    function windResize() {
        var wWidth = Math.min($(document).width(),$(window).width());
        if (wWidth<1150 && isMini == false) {
            $(".header .content > .left").hide();
            //$(".header .content > .top").hide();
            $(".header .content > .right").hide();
            $(".header .content > .bottom").css({
                "left":"59px",
                "width":"983px",
                "background-position":"center 0"
            });
            $(".header .content > *:visible").wrapAll('<div class="roll-header" />');
            $(".header .content > .roll-header").css({"left":"-59px"});
            $(".header .content").width(983);
            $(".main .content .contaner").width(983);
            buffer = parseInt($(".main .content .contaner .left").css("margin-left"));
            $(".main .content .contaner .left").css({"margin-left":"1px"});
            
            isMini = true;
        } else
        if (wWidth>=1150 && isMini == true) {
            $(".main .content .contaner .left").css({"margin-left":buffer+"px"});
            $(".main .content .contaner").width(1100);
            $(".header .content").width(1100);
            $(".header .content .roll-header > *:visible").unwrap();
            $(".header .content > .bottom").css({
                "left":"0px",
                "width":"1100px",
                "background-position":"center 0"
            });
            $(".header .content .right").show();
            //$(".header .content .top").show();
            $(".header .content .left").show();
            
            isMini = false;
        }
    }
    $(window).bind('resize',function(){
        windResize();
    });
    windResize();
    
    
    $(".content .group a").fancybox({
        'titleShow'     : false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    });
    $(".response table a").fancybox({
        'titleShow'     : false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    });
    $(".content table a").fancybox({
        'titleShow'     : false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    });
});

var Cookie = {
		
	set:function(name, value, expires, path, domain, secure){
		expires = expires ? expires * (1000 * 60 * 60 * 24) : false; // в днях
		document.cookie = name + "=" + escape(value) +
	    ((expires) ? "; expires=" + expires : "") +
	    ((path) ? "; path=" + path : "") +
	    ((domain) ? "; domain=" + domain : "") +
	    ((secure) ? "; secure" : "");
	},
		
	get:function(name,deflt){
		var deflt = deflt ? deflt : null;
		var cookie = " " + document.cookie;
		var search = " " + name + "=";
		var setStr = null;
		var offset = 0;
		var end = 0;
		if (cookie.length > 0) {
			offset = cookie.indexOf(search);
			if (offset != -1) {
				offset += search.length;
				end = cookie.indexOf(";", offset);
				if (end == -1) {
					end = cookie.length;
				}
				setStr = unescape(cookie.substring(offset, end));
			}
		}
		return(setStr ? setStr : deflt);		
	}
	
};
