jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"],
{
    random: function(a, i, m, r) {
        if (i == 0) {
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
        };
        return i == jQuery.jQueryRandom;
    }
});

$(document).ready(function() {
						   
	$("ul.accordion").accordion();
	$("ul.accordion").find("li:first").addClass("active");
	$("ul.accordion").find("li:first").children().show();
	$("ul.accordion ul").find("li:last").addClass("lastrowitem");
	
	/*$("#sponsorList li:random").addClass("active");
	$("#sponsorList").tabify();*/

$(".tab2, .tab3, .tab4").hide();

$("a.t1").click(function() {
	$(".tab2, .tab3, .tab4").hide();
	$(".tab1").show();
	$(this).parent().addClass("active");
	$("a.t2, a.t3, a.t4").parent().removeClass("active"); return false;
});

$("a.t2").click(function() {
	$(".tab1, .tab3, .tab4").hide();
	$(".tab2").show();
	$(this).parent().addClass("active");
	$("a.t1, a.t3, a.t4").parent().removeClass("active"); return false;
});

$("a.t3").click(function() {
	$(".tab1, .tab2, .tab4").hide();
	$(".tab3").show();
	$(this).parent().addClass("active");
	$("a.t1, a.t2, a.t4").parent().removeClass("active"); return false;
});

$("a.t4").click(function() {
	$(".tab1, .tab2, .tab3").hide();
	$(".tab4").show();
	$(this).parent().addClass("active");
	$("a.t1, a.t2, a.t3").parent().removeClass("active"); return false;
});

$("ul#sponsorPageList").find("li:nth-child(4n)").css({ 'margin-right': '0' });

$("ul#newsfeed").find("li:nth-child(2n)").css({ 'margin-right': '0' });

});
