 $(document).ready(function(){
	
	
	$('ul.sf-menu').superfish({ 
               hoverClass:    'sfHover',          // the class applied to hovered list items 
				pathClass:     'overideThisToUse', // the class you have applied to list items that lead to the current page 
				pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass 
				delay:        	0,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing 
				animation:     {height:'show'},   // an object equivalent to first parameter of jQueryÕs .animate() method 
				speed:         'fast',           	// speed of the animation. Equivalent to second parameter of jQuery's .animate() method 
				disableHI:     false,              // set to true to disable hoverIntent detection 
				onInit:        function(){},       // callback function fires once Superfish is initialised - 'this' is the containing ul 
				onBeforeShow:  function(){},       // callback function fires just before reveal animation begins - 'this' is the ul about to open 
				onShow:        function(){},       // callback function fires once reveal animation completed - 'this' is the opened ul 
				onHide:        function(){},        // callback function fires after a sub-menu has closed - 'this' is the ul that just closed 
			
				autoArrows:  false,                           // disable generation of arrow mark-up 
				dropShadows: false                            // disable drop shadows 
        }); 
        
        

	
	//set class for links to external sites and other document types
	$('#content a[href^="http://"]').addClass('external').attr('target', '_blank');
	$('#content a[href$=".pdf"]').addClass('pdf').attr('target','_blank');
	$('#content a[href$=".ppt"]').addClass('powerpoint').attr('target','_blank');
	$('#content a[href$=".doc"]').addClass('word').attr('target','_blank');
	$('#content a[href$=".xls"]').addClass('excel').attr('target','_blank');
	$('#content a[href$=".csv"]').addClass('excel').attr('target','_blank');	
	$('#content a.remove_external').removeClass('external').attr('target', '_blank'); 

	$('a.cluetip').cluetip({width:'240', arrows:true, cursor: 'pointer', cluetipClass:'jtip'});

	
	$('.view_details').click(	
		function(){
		var eDiv = $('div.'+$(this).attr('rel'));
		var t = $(this).text();
		
		if(eDiv.is(':hidden')){
				eDiv.show(1200);
				
			}					
		else if(eDiv.is(':visible')){				
				eDiv.hide('slow');
				
			}		
		 $(this).blur();
	});

	//  page
	$('.view_video').click(	
		function(){
			
			var eDiv = $('div.'+$(this).attr('rel'));
			var oDiv = $('div[class*=videodiv_]');

		if(eDiv.is(':hidden')){
				oDiv.hide('slow');
				eDiv.show('slow');
		}	
		else if(eDiv.is(':visible')){				
				eDiv.hide('slow');
		}		
		$(this).blur();
	});

	$('.blog_title').css('margin-left', '150px');

	$('#state24').attr( "selected", "selected" );
		
	

}); /* END DOCUMENT READY */


/* functions for  page */
function checkEmail (strng) {
var error="";
 var emailFilter=/^.+@.+\..{2,3}$/;
var illegalChars= "/[\(\)\<\>\,\;\:\\\"\[\]]/";
if (strng == "") {
   error = "Please enter an Email address.\n";
}  
 else if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid Email address.\n";
    }
    else if (strng.match(illegalChars)){
//test email for illegal characters
         error = "The Email address contains unprocessable  characters.\n";
       }
return error;    
}

function checkImgtext (strng) {
var error = "";
if (strng == "") {
   error = "In the last text box, please enter the word shown in the image.\n";
}
var illegalChars= /[W]/;
if (illegalChars.test(strng)) { 
       error = "Not able process the word. Please try to match the word again. \n";
    }
 return error;
}

function checkComments (strng) {
var error = "";
if (strng == "") {
   error = "Please enter a comment.\n";
}
 return error;
}

function checkTeenForm(theForm) {
    var why = "";
      	why += checkEmail(theForm.Email.value);
     	 why += checkComments(theForm.Comments.value);
   
   if (why != "") {
       alert(why);
       return false;
    }
return true;
}





