/* Bouncing down overlay */
$(document).ready(function(){
	// click to draw contact form
	$('.open').click(function(){
		// open .panel-1 to 500px then shrink back fast to 425px
		$("div.panel").animate({height: "300px"}).animate({height: "260px" }, "fast");
		
		
			// using window.setTimeout to delay .panel-2 for 100 ms
		window.setTimeout(function(){$("div.panel-contents").fadeIn("slow");});
		

	});
 
	// this function closes the panels and is loaded in the click function below
	function closePanels(){
		// extend panel-1 to 520px then send it up, to hide
		$(".panel").animate({height: "280px"}).animate({height: "0px",top:"0px"}, "fast", function(){$(this).hide();});
		// using window.setTimeout to delay .panel-2 for 100 ms

	} // end closePanels() function
 
	// on click fadeOut content then call closePanels() to send them up
	$('.close').click(function(){					
		$('div.panel-contents').fadeOut("fast",closePanels());	
	});     
});


/* Menu Slider */
$(function() {
            $("#1, #2, #3").lavaLamp({
                fx: "backout", 
                speed: 700,
                click: function(event, menuItem) {
                    return true;
                }
            });
        });


/* EXTERNAL LINKS - Keeps W3C Happy */
/* Script to launch link whilst still being strict compliant */
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;




