$(document).ready(function(){
						   
	if(!$.browser.msie) $('#page-content').corner();

	$(".accordion").accordion({active:false,collapsible:true,autoHeight:false,navigation:true,animated:'slide'});	
		
	//added below for state-saving urls, but it was ugly
	/*$(".accordion h5").click(function(event){
		  var txt = $(this).find("a").attr("href");
		  window.location.hash=txt;
		  return false;
	 });*/
	
	/* open new windows for external links */
	$(function() {
		$('a[rel^=external]').click( function() {
			window.open(this.href);
			return false;
		});
	});
		
	/*funky navigation*/
	
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {}else{//if they are using an iphone/ipod switch off funky navigation
	
		if($.browser.msie) {//if browser is ie then change how high the span tag flys up
			var margtop = -28;
		} else {
			var margtop = -40;
		}
		
		$("#primary-navigation li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
		$("#primary-navigation li").each(function() { //For each list item...
			var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
			$(this).find("span").show().html(linkText); //Add the text in the <span> tag
		}); 
	
		$("#primary-navigation li").hover(function() {	//On hover...
			$(this).find("span").stop().animate({
				marginTop: margtop //Find the <span> tag and move it up 40 pixels
			}, {duration:350});
			
		} , function() { //On hover out...
			$(this).find("span").stop().animate({
				marginTop: "0"  //Move the <span> back to its original state (0px)
			}, {duration:350});
		});
	
	}
	
});