// JavaScript Document

$(document).ready(function() { 
 
    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
		$('.window').hide();
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = $(this).attr('href');
               
        //transition effect
        $(id).fadeIn(200);
     
    });
     
    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        $('.window').hide();
    });    
          
});
