// JavaScript Functions



/*--------------------------------------------------*/

/* IE6 PNG Fix */

/*--------------------------------------------------*/

$(document).pngFix(); 

/*--------------------------------------------------*/

/* Stripped Tables */

/*--------------------------------------------------*/

$(document).ready(function(){ 

	 $("#top_ranked table").addClass("ranked_table").addClass("stripe"); 
        $(".stripe tr:odd").addClass("alt"); 

});

$(document).ready(function(){ 

        $(".stripe2 tr:even").addClass("alt"); 

});



/*--------------------------------------------------*/

/* Clickable Blocks */

/*--------------------------------------------------*/

$(document).ready(function(){

						   

	$("table.dl-table tr").click(function(){

    	window.location=$(this).find("a").attr("href");return false;

	});

	$(".article").click(function(){

    	window.location=$(this).find("a").attr("href");return false;

	});

	$(".class_btn").click(function(){

    	window.location=$(this).find("a").attr("href");return false;

	});



}); //close doc ready





/*--------------------------------------------------*/

/* Selector Divs */

/*--------------------------------------------------*/

$(document).ready(function(){			

	$(".menu_selector ul").find('li a:first').addClass("current");

	$(".menu_selector ul").find('li a:not(:first)').removeClass("current");

	

	$(".menu_selector ul").find('li:first').addClass("current");

	$(".menu_selector ul").find('li:not(:first)').removeClass("current");

	

	$(".menu_selector li").click(function() {

		var linkIndex = $(".menu_selector li").index(this)      /// determines the index of the link you click--- starts at zero for first one

		$(".visibleDiv").removeClass("visibleDiv").hide();            //  only ever have one div with this class so hide the whole class /// don't really need the hide()-CSS will do it for you

		$(".select_box").eq(linkIndex).addClass("visibleDiv").fadeIn(1200);    // give it the visibleClassName the css alone will show the div without needing the show() function, same index as link,

		$(".current").removeClass("current");

		$(this).addClass("current");

	});

});





/*--------------------------------------------------*/

/* Custom Checkboxes*/

/*--------------------------------------------------*/

$(function(){

	$('#checkLink').click(function () {

    var $el = $('#cbox');



  	 $el.is(':checked') ? 

        $el.removeAttr('checked') : 

        $el.attr('checked', 'checked');



	});

});



$(document).ready(function(){

	$(".fakecheck").click(function(){

		($(this).hasClass('fakechecked')) ? $(this).removeClass('fakechecked') : $(this).addClass('fakechecked');

		$(this.hash).trigger("click");

		return false;

	});

});



/*--------------------------------------------------*/

/* jQuery Corners*/

/*--------------------------------------------------*/

$(document).ready(function() 

{

  	$('#content').corner("7px");

	$('#sidebar').corner( "tr bottom 7px");

	$('.class_btn').corner("20px");

	

}); 


/*--------------------------------------------------*/

/* Link Fader */

/*--------------------------------------------------*/
$(document).ready(function() {

$('.fadeLink').hover(
		function (){ $('span',this).stop().animate({ opacity: 0 }, 150 );
		},
		function (){ $('span',this).stop().animate({ opacity: 1 }, 150 );
		}	
	);
	
});
