//Plugin to add text to an input field that disappears on focus 
jQuery.fn.inputFieldText = function(string) {          
    this.each(function() { 
        $(this).val(string); 
        $(this).focus(function(){ 
            if ($(this).val() == string){ 
                $(this).val('');
				$(this).css("color", "#000");
            } 
        }); 
        $(this).blur(function(){ 
            if ($(this).val() == '' ){ 
                $(this).val(string);
				$(this).css("color", "#000");
            } 
        });     
    }); 
}


$(document).ready(function() {
	$(this).pngFix();
	
	$(function() {
	
	$('.tabNavigation').tabs({ fxFade: true, fxSpeed: 'fast' });	
	});
	
	var zindex = 0;
	$("#largeTabs a").mouseenter(function() {									  
			$(this).parent().find(".popTab").show("slide", { direction: "right" }, 200);
			zindex = $(this).parent().css("z-index");
			$(this).parent().css({'z-index': '100'});
	});
	
	$("#largeTabs a").mouseleave(function() {
		$(this).parent().css({'z-index': zindex});
		$(this).parent().find(".popTab").hide("slide", { direction: "right" }, 200);

	});

	

function formatText(index, panel) {
	  return index + "";
	}
	
/* Initialise slider panel IF it exists on the page */
	if ( $(".panelSlider").length > 0 ) {
		$('body').append("<script type='text/javascript' src='scripts/jquery.anythingslider.js'></script>" + "<script type='text/javascript' src='scripts/jquery.easing.1.2.js'></script>");
		$(function () {
			$('.panelSlider').anythingSlider({
				easing: "easeInOutExpo",        		// Anything other than "linear" or "swing" requires the easing plugin
				autoPlay: true,                 		// This turns off the entire FUNCTIONALY, not just if it starts running or not.
				delay: 7000,                    		// How long between slide transitions in AutoPlay mode
				startStopped: false,            		// If autoPlay is on, this can force it to start stopped
				animationTime: 900,             		// How long the slide transition takes
				hashTags: true,                 		// Should links change the hashtag in the URL?
				buildNavigation: true,          		// If true, builds and list of anchor links to link to each slide
				pauseOnHover: true,             		// If true, and autoPlay is enabled, the show will pause on hover
				startText: "Go",             			// Start text
				stopText: "Stop",               		// Stop text
				navigationFormatter: formatText      	// Details at the top of the file on this use (advanced use)
			});
			$("#slide-jump").click(function(){
				$('.panelSlider').anythingSlider(6);
			});
		});
	};


$('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth: 6, arrowSize: 16, scrollbarMargin: 2});



$("b a.tooltip").mouseenter(function() {
	$(this).parent().nextAll(".summary").fadeIn("fast")
});

$("a.tooltip").mouseleave(function() {
	$(".summary").fadeOut("fast")
});




});
