// 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').after('<ul id="slideshowPager">').cycle({
   cleartype: true,
    fx:     'scrollHorz', 
   timeout: 15000,
   pause: true,
   prev:   '#slideshowPrev', 
   next:   '#slideshowNext',
   pager:  '#slideshowPager',

    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><span>' + idx + '</span></a></li>'; 
    } 
//   before: function() {
//     $('#slideshow span').css('display','none');
//   },
//   after: function() {
//     $('span', this).css({opacity: '0.9'}).slideDown();
//   }
 });
});


$(document).ready(function() {
	$('#navWrapper').corner("top 12px");
	$('#sideNavWrapper').corner("12px");
	$('#slideshowWrapper').corner("12px");
	$('#slideshow li').corner("8px");
	$('#homeButtons li a').corner("12px");
	$('#toolboxWrapper').corner("12px");
	$('div.sconetDiv').corner("12px");
	$('#supportBox').corner("12px");
	$('div#footer').corner("12px");
});

