﻿/**
 * @filename			DellUExtras.js
 * @created				2009-Oct-13
 * @author				Danny
 */

$(document).ready(function(){

	// hide all toggle div's and point all arrows up
	$('li .toggle').hide();
	$('li .arrow').addClass("up").removeClass("down");
	
	// open the first items of each list
	$('li:first-child .toggle').show();
	$('li:first-child .arrow').addClass("down").removeClass("up");
	
	
	// toggle divs
	function toggler(thisLink){
		toggleDiv = "." + thisLink.attr('rel');
		$(toggleDiv).slideToggle("fast");
	}
	
	$('.arrow').click(function(){
		className = $(this).attr("class");
		if (className == "arrow up") {
			$(this).addClass("down").removeClass("up");
		} else { 
			$(this).addClass("up").removeClass("down");
		}
		toggler($(this));
		return false;
	});
	
	
	// stripe the list in the study breaks page	
	$("#breaks li:even").addClass('even');
	$("#breaks li:odd").addClass('odd');
	
	
	// make all 'related' tag links open in new windows
	$("p.related a").attr('target', '_blank');
	
});