 

// main
(function($) {
$(document).ready(function() {  

    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        
        //Get the A tag
        var id = $(this).attr('href');
    
        //transition effect
        $(id).show();    
        $(id).css('opacity', 0);
        $(id).animate({opacity: 1.0}, {queue: false, duration: 1000});
        // $(id).fadeIn(2000); 
        // $(id).fadeTo(400,0.9);  
    
    });
    
    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        
        $('.window').hide();
    });     

   // initialize mega menu plug-in
   $("li.nmega").hoverIntent(
     {
     interval: 100,
     sensitivity: 4,
     over: function(){$(this).addClass("hovering");},
     timeout: 500,
     out: function (){ $(this).removeClass("hovering");}
     }
   ) ;
    
   $(window).unload( function() {
    ; //  $("li.nmega").removeClass("hovering");
   });

});
})(jQuery)


function validateForm1()
{
 var x=document.forms["newsletterform"]["email"].value ;
 if (x==null || x=="" || (x.indexOf("@") < 0)) {
  alert('Please enter a valid email address. Thank you.');
  return false;
 }
 return true;
}

function clickclear(thisfield, defaulttext) {
  if (thisfield.value == defaulttext) {
   thisfield.value = "";
  }
}

function clickrecall(thisfield, defaulttext) {
  if (thisfield.value == "") {
   thisfield.value = defaulttext;
  }
}

