jQuery(document).ready(function(){
	jQuery("#sitemap_content").hide();
	jQuery("div.sitemap_grabber a").click(function () {
		jQuery("#sitemap_content_wrapper").toggle(function(){
			jQuery.scrollTo("#sitemap",{duration:1000,onAfter:function(){
				jQuery("#sitemap_content").slideToggle("slow");
				jQuery("div.sitemap_grabber").toggle();
			}});
		});
		return false;
	});
	jQuery(".homepage_itemblock_title").fadeTo("slow",0.8);
	jQuery(".homepage_textblock_container").hover(function(){
		jQuery(".homepage_itemblock_title",this).fadeTo("slow",1);
	},function(){
		jQuery(".homepage_itemblock_title",this).fadeTo("slow",0.8);
	})


jQuery('#s4') 
.before('<div id="nav">') 
.cycle({ 
    fx:     'fade', 
    speed:   1000, 
    timeout: 8000, 
    pager:  '#nav' 
});

var parents = jQuery(".current_page_item").parents("#left_menu_content ul");
var children = jQuery(".current_page_item").children("#left_menu_content ul");
jQuery("#left_menu_content ul").not( parents ).not( children ).hide();

});

	$(document).ready(function() {
		
		// Preload all rollovers
		$("#page_content img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.jpg$/ig,"_on.jpg");
			$("<img>").attr("src", rollON);
		});
		
		// Navigation rollovers
		$("#page_content a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_on/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.jpg$/ig,"_on.jpg"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		$("#page_content a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});
		
	
	});

