
function showWindowAdsPage()
{
var id= '#dialogAdsPage';
var maskAdsPageHeight = $(document).height();
           var maskAdsPageWidth = $(window).width();
  
           //Set height and width to maskAdsPage to fill up the whole screen
           $('#maskAdsPage').css({'width':maskAdsPageWidth,'height':maskAdsPageHeight});
  
           //transition effect
           $('#maskAdsPage').fadeIn(1000);
           $('#maskAdsPage').fadeTo("slow",0.8);
  
           //Get the window height and width
           var winH = $(window).height();
           var winW = $(window).width();

           //Set the popup window to center
           $(id).css('top',  winH/2-$(id).height()/2);
           $(id).css('left', winW/2-$(id).width()/2);
  
           //transition effect
           $(id).fadeIn(2000);
}


    $(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');
  
           //Get the screen height and width
           var maskAdsPageHeight = $(document).height();
           var maskAdsPageWidth = $(window).width();
  
           //Set height and width to maskAdsPage to fill up the whole screen
           $('#maskAdsPage').css({'width':maskAdsPageWidth,'height':maskAdsPageHeight});
  
           //transition effect
           $('#maskAdsPage').fadeIn(1000);
           $('#maskAdsPage').fadeTo("slow",0.8);
  
           //Get the window height and width
           var winH = $(window).height();
           var winW = $(window).width();
  
           //Set the popup window to center
           $(id).css('top',  winH/2-$(id).height()/2);
           $(id).css('left', winW/2-$(id).width()/2);
  
           //transition effect
           $(id).fadeIn(2000);
  
       });
  
       //if close button is clicked
       $('.windowAdsPage .closeAdsPage').click(function (e) {
           //Cancel the link behavior
          e.preventDefault();
          
          $('#maskAdsPage, .windowAdsPage').hide();
       });
  
       //if maskAdsPage is clicked
      $('#maskAdsPage').click(function () {
         $(this).hide();
        
           $('.windowAdsPage').hide();
      });
  
  });
  
  
  /////////////////////
  ////////////////////
   
  
