//
// contactinfo.js
//
//   This is where all the javascript required by your design is written.
//
//   Originally generated at http://psd2cssonline.com 
//   June 20, 2009, 6:41 pm with psd2css Online version 1.41

var timerId;
$(document).ready(function(){

  // This is required for the PNG fix to work.
  if( $.fn.pngfix != null )
    $("img[@src$=png]").pngfix();

  // This is some javascript to stop IE from displaying the img alt attributes
  // when you mouse over imagess.  If you would like IE to display the alt attributes,
  // just comment out the following 4 lines.  Don't worry, if you leave this in 
  // place, your ALT attributes are still readable by the search engines.
  var tmpalt;
  $("img").hover( 
    function(){ tmpalt = $(this).attr( "alt" ); $(this).attr( "alt", "" ); },
    function(){ $(this).attr( "alt", tmpalt ); });

  // This is code to handle all of the _linkover events.  It works by
  // creating a special Wrap class, adding it to the link and linkover
  // divs of each link and linkover pair, and assigning a hover event to
  // that.
  $("#Layer-5").addClass("Wrap-6-5").hide();
  $("#Layer-6").addClass("Wrap-6-5");
  $(".Wrap-6-5").hover(
    function(){ $("#Layer-5").show(); $("#Layer-6").hide(); },
    function(){ $("#Layer-6").show(); $("#Layer-5").hide(); });
  $("#Layer-7").addClass("Wrap-8-7").hide();
  $("#Layer-8").addClass("Wrap-8-7");
  $(".Wrap-8-7").hover(
    function(){ $("#Layer-7").show(); $("#Layer-8").hide(); },
    function(){ $("#Layer-8").show(); $("#Layer-7").hide(); });
  $("#Layer-9").addClass("Wrap-10-9").hide();
  $("#Layer-10").addClass("Wrap-10-9");
  $(".Wrap-10-9").hover(
    function(){ $("#Layer-9").show(); $("#Layer-10").hide(); },
    function(){ $("#Layer-10").show(); $("#Layer-9").hide(); });
  $("#Layer-11").addClass("Wrap-12-11").hide();
  $("#Layer-12").addClass("Wrap-12-11");
  $(".Wrap-12-11").hover(
    function(){ $("#Layer-11").show(); $("#Layer-12").hide(); },
    function(){ $("#Layer-12").show(); $("#Layer-11").hide(); });
  $("#Layer-13").addClass("Wrap-14-13").hide();
  $("#Layer-14").addClass("Wrap-14-13");
  $(".Wrap-14-13").hover(
    function(){ $("#Layer-13").show(); $("#Layer-14").hide(); },
    function(){ $("#Layer-14").show(); $("#Layer-13").hide(); });
  $("#Layer-15").addClass("Wrap-16-15").hide();
  $("#Layer-16").addClass("Wrap-16-15");
  $(".Wrap-16-15").hover(
    function(){ $("#Layer-15").show(); $("#Layer-16").hide(); },
    function(){ $("#Layer-16").show(); $("#Layer-15").hide(); });
  $("#Layer-18").addClass("Wrap-19-18").hide();
  $("#Layer-19").addClass("Wrap-19-18");
  $(".Wrap-19-18").hover(
    function(){ $("#Layer-18").show(); $("#Layer-19").hide(); },
    function(){ $("#Layer-19").show(); $("#Layer-18").hide(); });
  $("#Layer-21").addClass("Wrap-22-21").hide();
  $("#Layer-22").addClass("Wrap-22-21");
  $(".Wrap-22-21").hover(
    function(){ $("#Layer-21").show(); $("#Layer-22").hide(); },
    function(){ $("#Layer-22").show(); $("#Layer-21").hide(); });
  $("#aboutmjs-27").addClass("Wrap-28-27").hide();
  $("#aboutmjs-28").addClass("Wrap-28-27");
  $(".Wrap-28-27").hover(
    function(){ $("#aboutmjs-27").show(); $("#aboutmjs-28").hide(); },
    function(){ $("#aboutmjs-28").show(); $("#aboutmjs-27").hide(); });

 // This is code to handle the feedback_menu menu
  $("#contactinfo-27").hide().addClass("allMenus");
  $("#contactinfo-26").click(function(e){
    e.preventDefault();
    $(".allMenus").fadeOut("slow");
    $("#contactinfo-27").fadeIn("slow");

});


  /* Here we take care of any _close layers you have made */
  $("#contactinfo-36").click(function(){ $("#contactinfo-36").parent().hide("slow"); });

 /* Custom code added by hand... 
   *  
   *  Here we hijack the click event for our submit button.  First, we call
   *  preventDefault on the event because we dont want the link to take us to
   *  another page anymore, we're going to take care of it ourselves with AJAX.
   *  So then we make our AJAX call to formmail.php, send our data from the
   *  form, and define a fade out of the form (the thank you message is hiding
   *  behind it) to thank our user for helping out.
   *  
   */

  $("#contactinfo-30").click(function(e){
    e.preventDefault();
    $.post( "formmail.php", 
      { 
        email: $("#email").val(),
        message: $("#message").val(),
        recipients: "michael@innerlightcreations.com",
        subject: "ILC Website Form Inquiry",
        env_report: "REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER"
      },
      function(data){ $("#contactinfo-28").hide("slow"); 
    }); 
  });
});
