Cufon.replace('h1, #secondary h2, h2.mHead, .activity_highlights h2, #secondary h3, .shBlock h3, h3.shead, #footer h3, #sidebar h2, #sidebar h3, div#secondary div.sgiCenter div h4, div.sectionBlock ul#tabTitle li, div#contentInner div.apply h3, div#contentInner div#contentBlock div.mhBlock h2');

/* Language Select */
$(document).ready(function(){
   $("div#header div#headerInner div.language div.langContent").mouseover(function(){
     $("div#header div#headerInner div.language div.langContent ul").show();
   });
   $("div#header div#headerInner div.language div.langContent").mouseout(function(){
     $("div#header div#headerInner div.language div.langContent ul").hide();
   });
 });	  


/* Subnav */
$(document).ready(function(){
	if($(".sNav")) {
		$(".sNav li ul").hide();
		$(".sNav li.active ul").show();
		$(".sNav li.active ul").prev().addClass('clicked');
		$(".sNav li span").click(function() {
			if($(this).hasClass('clicked')) {
				$(this).next().slideUp(200);
				$(this).removeClass("clicked");
			}
			else {
				$(".sNav li span").removeClass();
				$(this).addClass("clicked");
				$(".sNav li ul:visible").slideUp(200);				
				$(this).next().slideDown(500);
			}
			return false;
		});
	}	
	
	//jump to select box
	if($('.jumpto')){
		$('.jumpto').change(function(){
			if(this.value!='') {
				document.location.href = this.value;
			}	 
		});	
	}	
	
});

//news images, resize div container, float etc
$(window).load(function(){
	//resize caption container
	if($('.imgRight img').length){		
	   $('.imgRight img').each( function(){
		   var width = $(this).width();
		   if(width) $(this).parent('.imgRight').width(width);
		});		
	}
	if($('.imgLeft img').length){		
		$('.imgLeft img').each(function(){
		   var width = $(this).width();
			if(width) $(this).parent('.imgLeft').width(width);
		});	
	}
	
	
	//custom class from old content, added by SGI staff
	if($('.picGroup img').length){	
		$('.picGroup').addClass('clearfix');
		var i=0;
		$.each($('.picGroup div'), function(index) { 
			var className = $(this).attr('class');
			//classes assign to images are ordered like pic1, pic23, pic11. 
			//Not always in order and sometimes random numbers like pic200. Go figure
			if(className.substr(0,3)=='pic') { //if div containing image i.e. not caption or something else
				var width = $(this).find('img').width(); 
				if(width) { 
					//float the first image
					direction = (i%2==0)?'left':'right'; //float image pairs, left and right
					$(this).width(width);					
					$(this).css({'float':direction});
					i++;
				}
			}	
		
		});
	}
});
