function GalleryViewer(url)
{
    var w=screen.width;
    var h=screen.height;
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    var left = 0;
    var top = 0;
    //w=(w/1)+20;  
    if (window.showModalDialog) {
            window.showModalDialog(url,"GalleryPopup",
            "dialogWidth:"+w+"px;dialogHeight:"+h+"px;dialogTop:"+top+";dialogLeft:"+left + "");
    } else {
            window.open(url,'GalleryPopup', 'height='+h+',width='+w+',toolbar=no,directories=no,statusbar=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes;top='+top+', left='+left);
    }    
}
function modalWin(url, w,h) {
    var left = (screen.width/2)-(w/2);
    var top = (screen.height/2)-(h/2);
    w=(w/1)+20;  
    if (window.showModalDialog) {
            window.showModalDialog(url,"GalleryPopup",
            "dialogWidth:"+w+"px;dialogHeight:"+h+"px;dialogTop:"+top+";dialogLeft:"+left + "");
    } else {
            window.open(url,'GalleryPopup', 'height='+h+',width='+w+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes;top='+top+', left='+left);
    }
} 
/*
jQuery(document).ready(function(){
    jQuery('#image-gallery-reset-image').bind('click', function(e){
        e.preventDefault();
        jQuery('#galleryimageblur').hide();        
	jQuery('#galleryimage').show();
    });
    jQuery('#galleryimage').bind('contextmenu',function(e){
          var $cmenu = $(this).next();
          jQuery('<div class="overlay"></div>').css({left : '0px', top : '0px',position: 'absolute', width: '100%', height: '100%', zIndex: '100' }).click(function() {
                  $(this).remove();
                  $cmenu.hide();
          }).bind('contextmenu' , function(){return false;}).appendTo(document.body);
          //jQuery(this).next().css({ left: e.pageX, top: e.pageY-100, zIndex: '101' }).show();
          
          return false;
    });	

    //hide the div when losing focus
    jQuery(window).bind('blur', function () {
	jQuery('#galleryimage').hide();
        jQuery('#galleryimageblur').show();
    });
    			 
});*/


// Helper function, used below.
// Usage: ['img1.jpg','img2.jpg'].remove('img1.jpg');
Array.prototype.remove = function(element) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] == element) { this.splice(i,1); }
  }
};


// Usage: $(['img1.jpg','img2.jpg']).preloadImages(function(){ ... });
// Callback function gets called after all images are preloaded
jQuery.fn.preloadImages = function(callback) {
  checklist = this.toArray();
  this.each(function() {
    jQuery('<img>').attr({ src: this }).load(function() {
      checklist.remove(jQuery(this).attr('src'));
      if (checklist.length == 0) { callback(); }
    });
  });
};

/* Minification failed (line 74, error number 1019): Unexpected token, found ';' */