
var addthis_config = {
   ui_click: true
}


function preloader(imagePath) 
{
    // counter
     var i = 0;

     // create object
     imageObj = new Image();

     // set image list
	preloadImages = new Array();
     	preloadImages[0]=imagePath+"refresh//nav_text_sprite.png"
     	preloadImages[1]=imagePath+"refresh/ico_youtube.gif"
     	preloadImages[2]=imagePath+"refresh/ico_twitter.gif"
     	preloadImages[3]=imagePath+"refresh/ico_facebook.gif"
	preloadImages[4]=imagePath+"refresh/ico_flickr.gif"
	 
     // start preloading
     for(i=0; i<=8; i++) 
     {
          imageObj.src=preloadImages [i];
		//alert("loaded"+images[i])
     }
  
} 

function openDir( form ) { 
	var newIndex = form.jump.selectedIndex; 
	cururl = form.jump.options[ newIndex ].value; 
	window.open(cururl,'_top'); 
} 


// Change the height of the iframes to match content (plus 10px padding)
function resizeFrame(f) {
	var centerFrame = document.getElementById('BodyCenter')
	f.style.height = (f.contentWindow.document.body.scrollHeight+10) + "px";			
	// Only make the change if the column is larger than the center content (previously caused bug that caused center content to overflow footer)
	if($(f).height() > $(centerFrame).height()){
		centerFrame.style.height = (f.contentWindow.document.body.scrollHeight+25)+ "px";						
	}						
}

/*
///DROP-DOWN GLOBALS (for top navigation)
$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

$("ul.topnav li span").click(function() { //When trigger is clicked...

	//Following events are applied to the subnav itself (moving subnav up and down)
	
	$(this).parent().find("ul.subnav").toggle(); //Drop down the subnav on click
	find("ul.subnav").toggle();

	//Following events are applied to the trigger (Hover events for the trigger)
	}).hover(function() {
		$(this).addClass("subhover"); //On hover over, add class "subhover"
	}, function(){	//On Hover Out
		$(this).removeClass("subhover"); //On hover out, remove class "subhover"
});


	
	 	
		var espanol_subnav = 'closed';
	    var tools_subnav = 'closed';
		var profile_subnav = 'closed';
	
      $(document).ready(function(){
	    
	 	///DROP-DOWN GLOBALS
		$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

        $("*").not("#espanol").not("#tools").not("#profile").mouseup(function(){
            $("#espanol_subnav").hide();
            $("#tools_subnav").hide();
			$("#profile_subnav").hide();

            espanol_subnav = 'closed';
            tools_subnav = 'closed';
			profile_subnav = 'closed';
        });

        $("#espanol").click(function(){
          $("#tools_subnav").hide();
          tools_subnav = 'closed';
		  profile_subnav = 'closed';
		  
          if(espanol_subnav == 'closed'){
			espanol_subnav = 'open';
            $("#espanol_subnav").show();
          } else {
            espanol_subnav = 'closed';
            $("#espanol_subnav").hide();
          }


        });
		

        $("#tools").click(function(){
          $("#espanol_subnav").hide();
          espanol_subnav = 'closed';
		  profile_subnav = 'closed';
		  
          if(tools_subnav == 'closed'){
            tools_subnav = 'open';
            $("#tools_subnav").show();
          } else {
            tools_subnav = 'closed';
            $("#tools_subnav").hide();
          }

        });
		
		  $("#profile").click(function(){
          $("#tools_subnav").hide();
		  $("#espanol_subnav").hide();
          tools_subnav = 'closed';
		  espanol_subnav = 'closed';
		  
          if(profile_subnav == 'closed'){
			profile_subnav = 'open';
            $("#profile_subnav").show();
          } else {
            profile_subnav = 'closed';
            $("#profile_subnav").hide();
          }
		  
        });

      }); */


$(function(){
				// set up rollover
				$("img.rollover").hover(
					function()
						{
							this.src = this.src.replace(".jpg","_hover.jpg");
						},
					function()
						{
							this.src = this.src.replace("_hover.jpg",".jpg");
						}
				);
			})
			
			$(function(){
				// set up active click
				$("img.rollover").click(
					function()
						{
							this.src = this.src.replace("_hover	.jpg","_on.jpg");
						}
				);
			})
			
			$(function(){
			$("img.activeover").hover(
					function()
						{
							this.src = this.src.replace("_on.jpg","_hover.jpg");
						},
						function()
						{
							this.src = this.src.replace("_hover.jpg","_on.jpg");
						}
				);
			})
