﻿
/* 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();
   });
   
   //set browser in body tag
   var browser = (navigator.appCodeName + '-' + navigator.appName).toLowerCase();
   if(browser) $('body').addClass(browser); 
   
});	  


/* Subnav */
$(document).ready(function(){
						   						   
	//remove static date / align from articles for migrated content 
	$('#news_details p[align="right"]').remove();
	$('#news_details p[align]').removeAttr('align');
	$('#news_details table[style]').removeAttr('style');					   
	
	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;
			}	 
		});	
	}	
	
});

$(window).load(function(){		

						
	//resize caption container
	if($('.imgRight img')){		
	   $('.imgRight img').each( function(){
		   var width = $(this).width();
		   if(width) $(this).parent('.imgRight').width(width);
		});		
	}
	if($('.imgLeft img')){		
		$('.imgLeft img').each(function(){
		   var width = $(this).width();
			if(width) $(this).parent('.imgLeft').width(width);
		});	
	}
});
