_uacct = "UA-1031228-1";
urchinTracker();

function submenu(obj,status) {
	if(status=="show") {
		$(obj).find(".submenu").css("top",($(obj).offset().top + $(obj).height() -5) + "px").css("left",($(obj).offset().left +1) + "px");
		$(obj).find(".submenu").width($(obj).width() +21);
		$(obj).find(".submenu").fadeIn(200);
	} else {
		$(obj).find(".submenu").fadeOut(500);
	}
}

function pospatches() {
	$("#patches").css("left",$("#border").offset().left -48);	
}


$(document).ready(function(){
	
	$("#patches").html("<div class='top'></div><div class='left'></div><div class='right'></div>");
	$("#patches div:eq(0)").html("<img src='/images/patches_top.png' width='249' height='55'>").css("text-align","center");
	$("#patches div:eq(1)").html("<img src='/images/patches_left.png' width='120' height='133'>").css("float","left").css("width","120px").css("margin-top","73px");
	$("#patches div:eq(2)").html("<img src='/images/patches_right.png' width='47' height='230'>").css("float","right").css("width","47px").css("margin-top","57px");
	pospatches();
	
	$("img").attr("border","0");
	
	$(".submenu").wrap("<div class='submenu'></div>").removeAttr("class");
	
	$("#front .item:odd").css("margin-right","0px");
	
	$("ul.paging li a").parent().css("background","#000000");
	
	$("#top_menu > .menu > ul > li").hover(
		function () {
			$(this).addClass("active");
			//submenu(this,'show');
		},
		function () {
			$(this).removeClass("active");
			//submenu(this,'');
		}
	);

	$("#header_image").innerfade({
		speed: 1000,
		timeout: 5000,
		type: "sequence",
		containerheight: "254px"
	});
	
	$("#newsscroll").innerfade({
		speed: 1000,
		timeout: 10000,
		type: "sequence",
		containerheight: "20px"
	});	
	
	if(jQuery.browser.msie & parseInt(jQuery.browser.version) <= 6) {
		$("img[src$=png]").each(function() {
			$(this).attr("width",$(this).width());
			$(this).attr("height",$(this).height());
		});
		$("#background_fade, #patches img, .logotype img, #front .item img").ifixpng();
	}
});

$(window).load(function(){
	pospatches();
});

$(window).resize(function(){
	pospatches();
});
