// Contains a number of default scripts for the 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,#signuptext").toggleVal();
	});


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

	// Initialise campaign elements
	$(document).ready(function() {

		$("map *").tooltip({ delay: 0, track: true, showURL: false,top: -50, left: -5, fade: 100 });

		$('.constituencyMap').maphilight({fillColor: '09B2CD'});

		$('.showTooltip').tooltip({
			delay: 0,
			showURL: false
		});

	});

	$.fn.maphilight.defaults = {
		fill: true,
		fillColor: '09B2CD',
		fillOpacity: 1,
		stroke: true,
		strokeColor: '09B2CD',
		strokeOpacity: 1,
		strokeWidth: 1,
		fade: true,
		alwaysOn: false,
		neverOn: false,
		groupBy: false
	}

