$(document).ready(function() {
	if($.browser.msie && ($.browser.version < 7)){ $("body").addClass("ie"); }
	$("input[type=checkbox],input[type=radio]").prettyCheckboxes();

	$("#twitter").each(function() {
		$.get("/Home/Rss", { type: "Twitter" }, function(xml) {
            $("#twitter").append(xml);
        });
	});
	
	$(".box300x153").each(function() {
	    $(".item span:even").addClass("first");
        $(".item span:odd").addClass("third");
	});
	
	/*
	$(".box300x153 .item span").each(function() {
        $width = $(this).find("strong").html();
        $(this).css("width", "100%").append('<strong>'+ $width +'</strong>');
    });*/
    
    $("#ultimasNews").each(function() {
        $.get("/Home/Rss", { type: "EuReporter" }, function(xml) {
            $("#ultimasNews").append(xml);
        });
    });
    
    $("#mask").click(function () { 
        $(this).hide(); 
        $('.window').hide(); 
    }); 
    
   	
	$("a.btnVoceReporter").click(function() {
		tb_show('', '../tb/login.html?keepThis=true&TB_iframe=true&width=605&height=232&modal=true', false);
		return false;
	});

	$("#formCadastre").validate({ errorLabelContainer: $(".msgError") });
	$("#formLogin").validate({ errorLabelContainer: $(".msgError") });

	$("a.btnFechar").click(function() {
		parent.tb_remove();
		return false;
	});

	$("#mycarousel ul").jcarousel({ scroll: 4, wrap: 'last' });

	$("#holder").jScrollPane({ scrollbarWidth: 19, scrollbarMargin: 10, showArrows: false });
	
	$("#holder div").each(function() {
	    $(".comments:odd").addClass("odd");
	    $(".comments:even").addClass("even");
	});
	
	
	$(".fix").ifixpng();
	$(".header").append('<img src="/Content/Images/bg-rightHead.png" width="7" height="122" alt="" class="png" style="position: absolute; top: 0px; right: 0px;" />');
	$(".header").append('<img src="/Content/Images/bg-bottomHead.png" width="973" height="8" alt="" class="png" style="position: absolute; top: 114px; left: 0px;" />');
	$(".box605x520").append('<img src="/Content/Images/bg-rightBox605x520.png" width="29" height="650" alt="" class="png" style="position: absolute; top: 5px; left: 605px;" />');
	$(".box605x520").append('<img src="/Content/Images/bg-bottomBox605x520.png" width="630" height="11" alt="" class="png" style="position: absolute; bottom: -11px; left: 0px;" />');
	$(".box605x361").append('<img src="/Content/Images/bg-rightBox605x361.png" width="7" height="384" alt="" class="png" style="position: absolute; top: 0px; left: 605px;" />');
	$(".box605x361").append('<img src="/Content/Images/bg-bottomBox605x361.png" width="614" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	$(".box300x153").append('<img src="/Content/Images/bg-rightBox300x153.png" width="7" height="170" alt="" class="png" style="position: absolute; top: 0px; left: 300px;" />');
	$(".box300x153").append('<img src="/Content/Images/bg-bottomBox300x153.png" width="307" height="7" alt="" class="png" style="position: absolute; bottom: -7px; left: 0px;" />');
	$(".box300x265").append('<img src="/Content/Images/bg-rightBox300x265.png" width="7" height="264" alt="" class="png" style="position: absolute; bottom: 0px; left: 300px;" />');
	$(".box300x265").append('<img src="/Content/Images/bg-bottomBox300x265.png" width="307" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	$(".box300x115").append('<img src="/Content/Images/bg-rightBox300x165.png" width="7" height="119" alt="" class="png" style="position: absolute; top: 0px; left: 300px;" />');
	$(".box300x115").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="306" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	$(".box300x240").append('<img src="/Content/Images/bg-rightBox300x165.png" width="7" height="63" alt="" class="png" style="position: absolute; top: 0px; left: 300px;" />');
	$(".box300x240").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="306" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	$(".box300").append('<img src="/Content/Images/bg-rightBox300x57.png" width="7" height="58" alt="" class="png" style="position: absolute; top: 0px; left: 300px;" />');
	$(".box300").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="306" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');	
	$(".box605x335").append('<img src="/Content/Images/bg-rightBox300x57.png" width="7" height="335" alt="" class="png" style="position: absolute; top: 0px; left: 605px;" />');
	$(".box605x335").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="614" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	$(".box605x490").append('<img src="/Content/Images/bg-rightBox300x57.png" width="7" height="230" alt="" class="png" style="position: absolute; top: 0px; left: 605px;" />');
	$(".box605x490").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="614" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	
	$(".box300x387").append('<img src="/Content/Images/bg-rightBox300x57.png" width="7" height="392" alt="" class="png" style="position: absolute; top: 0px; left: 300px;" />');
	$(".box300x387").append('<img src="/Content/Images/bg-bottomBox300x165.png" width="307" height="8" alt="" class="png" style="position: absolute; bottom: -8px; left: 0px;" />');
	
	
	
	
});
