/* Mannum Waters V1.0 GUI */

$(document).ready(function () {
	
// load map	      
	$("#banner.map").append("<iframe width='940' height='414' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.com.au/maps/ms?ie=UTF8&amp;t=h&amp;msa=0&amp;msid=115648426317869386711.00044c161c669aa20a845&amp;ll=-34.895506,139.205704&amp;spn=0.05829,0.161533&amp;z=13&amp;output=embed'></iframe>");


// Reveal map		  
	$("#showmap img").toggle(
	function (){
		$("#banner").slideDown('slow');
		this.src = this.src.replace("show","hide");
	},
	function (){
		$("#banner").slideUp('slow');
		this.src = this.src.replace("hide","show");
	}
	);
	
// Preload Images
      $("img").each(function(){
        $('<img/>')[0].src =  $(this).attr("src").replace("_off","_hover");
		  });

// Drop Down Menu (Header)
	
	// dlayed effect
	$("#menu li").hoverIntent({
		interval:5,
		over: hoverover, 
		timeout:300,
		out: hoverout
	});
	function hoverover () {
		$('>ul', this).animate(
		{
			opacity:.95,
			height:'show'
		}, 150); 
 		}
	function hoverout() {

		$('>ul', this).animate(
		{
			opacity:'hide',
			height:'hide'
		}, 150); 
 		}	

	// instant effect sets current dropdown above previous
	$("#menu li").hover(
		function() {	
		$(this).addClass('over');	
		$(this).css({ "z-index":"2000" });

		}
		,
		function() {	
		$(this).removeClass("over");
		$(this).css({ "z-index":"1000" });	
		}
	);
	
	//rollover images with class:hoverme ,change trail _hover / _off on
	$("img.imghover").hover(
		 function() {
				 this.src = this.src.replace("_off","_hover");	
			  }
		 ,
		 function() {
				 this.src = this.src.replace("_hover","_off");		  
 		 }
	);		
	
});

