	function ShowBigImage(img,w,h,t,t2) {
    	windowHeight = window.innerHeight;
        if (windowHeight == undefined) windowHeight = document.documentElement.clientHeight;
        if (windowHeight == 0) windowHeight = document.body.clientHeight;
		windowHeight = windowHeight - 20;
        
        if (h > windowHeight) {
        	newHeight = windowHeight - 20;
            ratio = (h - newHeight) / h;
            w = w * (1 - ratio);
            h = newHeight;
        }
        
		$("#background").css("position","absolute");		
		$("#background").css("height",  $(window).height() + $(window).scrollTop() + "px");
		$("#background").css("width",  $(window).width() + $(window).scrollLeft() + "px");	
		$("#background").css("width",  $(window).width() + $(window).scrollLeft() + "px");	
		$("#background").css("top",  "0px");	
		$("#background").css("left",  "0px");	
		$("#background").css("z-index",  "990");	
		$("#background").css("display",  "block");	
		
			$("#background").css("background","#777777");
			$("#background").css({"opacity" : "0.7"}).fadeIn("slow");			
			
			$("#large").css("display",  "block");	
			$("#large").css ("background", "#FFFFFF");
			$("#large").css ("z-index", "999");
			
			if (t.toLowerCase() == "lifetime") t = "";
			if (t2.toLowerCase() == "lifetime") t2 = "";
			
			if (t != "") t = "<Br><b>" + t + "</b>";
			if (t2 != "") t2 = "<br>" + t2; 
            
			$("#large").html("<div style='border:white solid thick;width:" + w + "px;'><img name=\"closebutton\" id=\"closebutton\" src=\"/images/closebigimagereddimmed.png\" onmouseover=\"this.src='/images/closebigimagered.png'\" onmouseout=\"this.src='/images/closebigimagereddimmed.png';\" onclick=\"close_lightbox();\" style=\"cursor:pointer;position:absolute;float:right;top:10px;left:" + (w - 20) + "px;\"/><img src='"+img+"' width='"+w+"' height='"+h+"' /><br>" + t + t2 + "</div>").center().fadeIn("slow");			 
            
			return false;		
	}
	
	jQuery.fn.center = function () {
		this.css("position","absolute");
		this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
		this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
		return this;
	}

	$(document).ready(function() {		
	
		$(window).scroll(function() {
		 	$("#background").css("height",  $(window).height() +$(window).scrollTop() + "px");
			$("#background").css("width",  $(window).width() + $(window).scrollLeft() + "px");	
			$("#large").center();
		});
					
		$(document).keypress(function(e){
			if(e.keyCode==27){
				$("#background").fadeOut("slow");
				$("#large").fadeOut("slow");
			}
		});
		
        $("#background").click(function(){
			$("#background").fadeOut("slow");
			$("#large").fadeOut("slow");
		});
		
		$("#large").click(function(){
			$("#background").fadeOut("slow");
			$("#large").fadeOut("slow");
		});
        
		
	});
		
    function close_lightbox () {
        $("#background").fadeOut("slow");
        $("#large").fadeOut("slow");
    }

