
//jQuery onReady

var jq = jQuery.noConflict();


jq(document).ready(function($){

$(".buttons li a").each(function(){
	if($(this).attr("href") == "")
	$(this).addClass("hide");
});

if ($.browser.msie){
/*$("div.tab a").each(function(){
	
	var thetext = $(this).html();		
	var breaks = thetext.split(" ");
	var breakTwo = "" + breaks[2]+"<br />";
	var newtext = thetext.replace(breaks[2],breakTwo);
	$(this).html(newtext);
});*/
$("#sidebar h2 > a").each(function(){
	
	var thetext = $(this).html();		
	var breaks = thetext.split(" ");
	var breakTwo = "" + breaks[2]+"<br />";
	var newtext = thetext.replace(breaks[2],breakTwo);
	$(this).html(newtext);
});
}else{
/*$("div.tab a").each(function(){
	
	var thetext = $(this).html();		
	var breaks = thetext.split(" ");
	var breakTwo = "" + breaks[1]+"<br />";
	var newtext = thetext.replace(breaks[1],breakTwo);
	$(this).html(newtext);
});*/

$("#sidebar h2 > a").each(function(){
	
	var thetext = $(this).html();		
	var breaks = thetext.split(" ");
	var breakTwo = "" + breaks[1]+"<br />";
	var newtext = thetext.replace(breaks[1],breakTwo);
	$(this).html(newtext);
});
}

$(".tab-buttons").each(function(){
var LI = $(this).children("li").length;
if((LI > 2)&&(LI < 5)){
$(this).addClass("middle");
}else if(LI > 4){
$(this).addClass("long");
}
});


//----
// Accesskeys
//----

$('#accesskeys a').focus(function(){
		$('#accesskeys').attr("style","left: 10px; z-index:999;");
});
$('#accesskeys a').blur(function(){
		$('#accesskeys').attr("style","left: -9999px; z-index:0;");
});


	


}); // End jQuery onReady


// Ends all jquery



// cookie functions http://www.quirksmode.org/js/cookies.html

function createCookie(name,value,days){
	if (days)	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name){
	createCookie(name,"",-1);
}

// cookie functions end

