// JavaScript Document




// External preloader for every page

//use the following to set the array
//var imageArray = ['/images/mainnav/home-over.gif','/images/mainnav/news-over.gif'];

function IM_preloadImages() { //v3.0
	if(arguments[0] instanceof Array) {
		return IM_preloadImages.apply(null, arguments[0]);
	}
	var d=document;
	if(d.images){ 
		if(!d.MM_p) {
			d.MM_p=new Array();
		}
		var i,j=d.MM_p.length,a=IM_preloadImages.arguments;
		for(i=0; i<a.length; i++) {
			if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
		}
	}
}
  
//If using the array, call the function with the array  
//IM_preloadImages(imageArray);


// 'How to Help' Button
$(function(){
	$('#how_to_help_lvl2, #how_to_help_lvl3').hide();
	$('.how_to_help_group').hover(
		function(){
			$('#how_to_help_lvl2, #how_to_help_lvl3').show();
		}, function(){
			$('#how_to_help_lvl2, #how_to_help_lvl3').hide();
		});
});


// Enhance Dropdowns
$(function(){
	$("SELECT").selectBox();
});


// Dropdowns used for Nav
$(function(){
 $('.usedfornav').change(function(){
	 if($(this).val()){
	 	window.location.href = $(this).val() + "#statecontent";
	 }
 });
});


// Login Box
$(function(){
	if($('#loginbox').length > 0){
		$('#logintexthover').click(function(){
			$('#loginbox').toggle();
			$('#arrow').toggleClass('alt');
			$('#logintexthover').toggleClass('alt');
			return false;
		});
	}
	
	$('#newsletter_email_entry').watermark('enter your email address', {useNative: false});
});
