//
// psd2css.js
//
//   This is where all the javascript required by your design is written.
//
//   Originally generated at http://psd2cssonline.com 
//   July 9, 2009, 1:11 am with psd2css Online version 1.41

$(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 ); });
  
  // Here is the javascript that connects your lbthumb layers to
  // your jpeg images for lightbox.  There are a number of options
  // here you can modify.  Check their website for documentation.
  $('a.lightbox').lightBox({
    imageBtnClose: 'close.gif',
    imageBtnNext: 'next.gif',
    imageBtnPrev: 'prev.gif',
    imageLoading: 'loading.gif',
    containerResizeSpeed: 500,
    overlayBgColor: '#000' 
    /* 
    txtOf: 'de'  
    overlayOpacity: 0.6,
    txtImage: 'Imagem',
    */
  });
  
 

  // 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-3").addClass("Wrap-2-3").hide();
  $("#Layer-2").addClass("Wrap-2-3");
  $(".Wrap-2-3").hover(
    function(){ $("#Layer-3").show(); $("#Layer-2").hide(); },
    function(){ $("#Layer-2").show(); $("#Layer-3").hide(); });
  $("#Layer-5").addClass("Wrap-4-5").hide();
  $("#Layer-4").addClass("Wrap-4-5");
  $(".Wrap-4-5").hover(
    function(){ $("#Layer-5").show(); $("#Layer-4").hide(); },
    function(){ $("#Layer-4").show(); $("#Layer-5").hide(); });
  $("#Layer-7").addClass("Wrap-6-7").hide();
  $("#Layer-6").addClass("Wrap-6-7");
  $(".Wrap-6-7").hover(
    function(){ $("#Layer-7").show(); $("#Layer-6").hide(); },
    function(){ $("#Layer-6").show(); $("#Layer-7").hide(); });
  $("#Layer-9").addClass("Wrap-8-9").hide();
  $("#Layer-8").addClass("Wrap-8-9");
  $(".Wrap-8-9").hover(
    function(){ $("#Layer-9").show(); $("#Layer-8").hide(); },
    function(){ $("#Layer-8").show(); $("#Layer-9").hide(); });
  $("#Layer-11").addClass("Wrap-10-11").hide();
  $("#Layer-10").addClass("Wrap-10-11");
  $(".Wrap-10-11").hover(
    function(){ $("#Layer-11").show(); $("#Layer-10").hide(); },
    function(){ $("#Layer-10").show(); $("#Layer-11").hide(); });
  $("#Layer-13").addClass("Wrap-12-13").hide();
  $("#Layer-12").addClass("Wrap-12-13");
  $(".Wrap-12-13").hover(
    function(){ $("#Layer-13").show(); $("#Layer-12").hide(); },
    function(){ $("#Layer-12").show(); $("#Layer-13").hide(); });
  $("#Layer-35").addClass("Wrap-34-35").hide();
  $("#Layer-34").addClass("Wrap-34-35");
  $(".Wrap-34-35").hover(
    function(){ $("#Layer-35").show(); $("#Layer-34").hide(); },
    function(){ $("#Layer-34").show(); $("#Layer-35").hide(); });
  $("#Layer-91").addClass("Wrap-90-91").hide();
  $("#Layer-90").addClass("Wrap-90-91");
  $(".Wrap-90-91").hover(
    function(){ $("#Layer-91").show(); $("#Layer-90").hide(); },
    function(){ $("#Layer-90").show(); $("#Layer-91").hide(); });
  $("#Layer-93").addClass("Wrap-92-93").hide();
  $("#Layer-92").addClass("Wrap-92-93");
  $(".Wrap-92-93").hover(
    function(){ $("#Layer-93").show(); $("#Layer-92").hide(); },
    function(){ $("#Layer-92").show(); $("#Layer-93").hide(); });
 $("#Layer-103").addClass("Wrap-102-103").hide();
  $("#Layer-102").addClass("Wrap-102-103");
  $(".Wrap-102-103").hover(
    function(){ $("#Layer-103").show(); $("#Layer-102").hide(); },
    function(){ $("#Layer-102").show(); $("#Layer-103").hide(); });

});


  
/* 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.
   *  
   */

  $("#Layer-35").click(function(e){
    e.preventDefault();
    $.post( "formmail.php", 
      { 
        name: $("#name").val(),
		email: $("#email").val(),
        comment: $("#comment").val(),
        recipients: "support@qualityupc.com",
        subject: "Sample FormMail Testing",
        env_report: "REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER"
      },
      function(data){ $("#Layer-8").fadeOut("slow"); 
    }); 
  });



