// JavaScript Document

$(document).ready(function(){
						   
	function preloadMenu(){
		src1 = new Image(186, 43);
		src2 = new Image(186, 43);
		src3 = new Image(186, 43);
		src4 = new Image(186, 43);
		src5 = new Image(186, 43);
		src6 = new Image(699, 297);
		src7 = new Image(699, 297);
		src8 = new Image(699, 297);
		src9 = new Image(699, 297);
		src10 = new Image(699, 297);
		src11 = new Image(86, 30);
			src1 = "http://marriageandsextherapy.org/images/hoverHome.gif";
			src2 = "http://marriageandsextherapy.org/images/hoverAboutMe.gif";	
			src3 = "http://marriageandsextherapy.org/images/hoverForms.gif";	
			src4 = "http://marriageandsextherapy.org/images/hoverResources.gif";	
			src5 = "http://marriageandsextherapy.org/images/hoverTestimonials.gif";	
			src6 = "http://marriageandsextherapy.org/images/Pic1.jpg";	
			src6 = "http://marriageandsextherapy.org/images/Pic2.jpg";	
			src7 = "http://marriageandsextherapy.org/images/Pic3.jpg";	
			src8 = "http://marriageandsextherapy.org/images/Pic4.jpg";	
			src9 = "http://marriageandsextherapy.org/images/Pic5.jpg";	
			src10 = "http://marriageandsextherapy.org/images/homePhoto.jpg";	
			src11 = "http://marriageandsextherapy.org/images/contacthover.png";
		}
		
		preloadMenu();
		
	topImages = new Array();
	function preloadPhotos(t){
		for (var x=1; x<t; x++){
			topImages[x] = new Image(699, 297);
			topImages[x].src = ".../images/Pic" + x + ".jpg";	
		}
	}
	preloadPhotos(6);
	
	
	
    $("#home").hover(
        function () {
        // hover in
		$("#home img").attr("src", "images/hoverHome.gif");
      }, 
      function () {
        // hover out
		$("#home img").attr("src", "images/home.gif");
      }
	);
	
	$("#about").hover(
        function () {
        // hover in
		$("#about img").attr("src", "images/hoverAboutMe.gif");
      }, 
      function () {
        // hover out
		$("#about img").attr("src", "images/aboutMe.gif");
      }
	);
	
	$("#testimonials").hover(
        function () {
        // hover in
		$("#testimonials img").attr("src", "images/hoverTestimonials.gif");
      }, 
      function () {
        // hover out
		$("#testimonials img").attr("src", "images/testimonials.gif");
      }
	);
	
	$("#forms").hover(
        function () {
        // hover in
		$("#forms img").attr("src", "images/hoverForms.gif");
      }, 
      function () {
        // hover out
		$("#forms img").attr("src", "images/forms.gif");
      }
	);
	
	$("#resources").hover(
        function () {
        // hover in
		$("#resources img").attr("src", "images/hoverResources.gif");
      }, 
      function () {
        // hover out
		$("#resources img").attr("src", "images/resources.gif");
      }
	);
	$(".contact").hover(
        function () {
        // hover in
		$(".contact img").attr("src", "images/contacthover.png");
      }, 
      function () {
        // hover out
		$(".contact img").attr("src", "images/contact.gif");
      }
	);

   $("#home").click(function(){
		$('#resources img').show("src", "images/selectedHome.gif");
		$('#home img').hide();
		$("#home img").hide("src", "images/hoverHome.gif");
		}
	);					   
															   
});


