function popUpWindow(URLStr, left, top, width, height) {
  window.open(URLStr, '_blank', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

jQuery(function($) {
  var imgGallery = $("div.img a.overlay-single").size(); 
   
  if (imgGallery) { 
    // select the thumbnails and make them trigger our overlay
    $("div.img").each(function() {
    
      $("a.overlay-single", this).each(function(i){
          $(this).overlay({
            
            // each trigger uses the same overlay with the id "gallery" 
            target: '#gallery', 
         
            // optional exposing effect 
            expose: '#f1f1f1' 
         
        // let the gallery plugin do its magic! 
        }).gallery({ 
         
            // the plugin accepts its own set of configuration options 
            speed: 800 
        });
      });
    });
  }
});

jQuery(function($) {

  var imgGallery = $("div.scrollable a.overlay-multiple").size(); 
   
  if (imgGallery) { 
    $("div.scrollable").each(function(){
      
      $(this).scrollable({
        size: 4
      }).find("a.overlay-multiple").overlay({ 
       
          // each trigger uses the same overlay with id "gallery" 
          target: '#gallery', 
       
          // optional exposing effect with custom color 
          expose: '#f1f1f1', 
       
          // clicking outside the overlay does not close it 
          closeOnClick: false 
       
      // gallery plugin 
      }).gallery({ 
       
          // do not use the same disabled class name as scrollable 
          disabledClass: 'inactive',
          speed: 800 
      });
    });
  }

});