// Contains a number of scripts for the Congress website


	/* -------------------------------------------------- *
	 * ToggleVal Plugin for jQuery                        *
	 * Version 1.0                                        *
	 * -------------------------------------------------- *
	 * Author:   Aaron Kuzemchak                          *
	 * URL:      http://kuzemchak.net/                    *
	 * E-mail:   afkuzemchak@gmail.com                    *
	 * Date:     8/18/2007                                *
	 * -------------------------------------------------- */
	
	jQuery.fn.toggleVal = function(focusClass) {
		this.each(function() {
			$(this).focus(function() {
				// clear value if current value is the default
				if($(this).val() == this.defaultValue) { $(this).val(""); }
				
				// if focusClass is set, add the class
				if(focusClass) { $(this).addClass(focusClass); }
			}).blur(function() {
				// restore to the default value if current value is empty
				if($(this).val() == "") { $(this).val(this.defaultValue); }
				
				// if focusClass is set, remove class
				if(focusClass) { $(this).removeClass(focusClass); }
			});
		});
	}
	


	// Initialise toggleval
	$(document).ready(function() {
	   $("#searchtext,#newslettertext").toggleVal();
	});



$(document).ready(function() {
 $('#slideshow').cycle({
   cleartype: true,
   timeout: 5000,
   pause: true,
   before: function() {
     $('#slideshow span').css('display','none');
   },
   after: function() {
     $('span', this).slideDown();
   }
 });
});


	$(document).ready(function() {
		$('a.lightbox').lightBox(); // Select all links with lightbox class
	});

	// external links open in new window

	$(document).ready(function(){
		$("a[href^='http']").not("[href*='revolutionaries.ie']").attr('target','_blank');
	});

$(document).ready(function() { 
	$('#primaryNav').superfish({ 
		pathClass:   'current',
		pathLevels:  0,
		delay:       1000,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 
	});
}); 

