$.fn.kevbox = function(){
	
	makeSkel();
	
	// Create's arrays
	
	var img_name = [];
	var img_width = [];
	var img_height = [];
	
	$("img", this).each(function(x){
		
		var sizes = $(this).attr("title").split(":");
		var d = $(this).attr("src").split("/");
		
		
		img_name.push(d[0] + "/" + d[1] + "/"+d[3]);
		
		img_width.push(sizes[0]);
		img_height.push(sizes[1]);
		fn = $(this).attr("src").split("/");
		
		$(this).attr("class", x);
	});	
	
	function makeSkel(){
		$("body").append("<div id='overlay' style='display: block; width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; background-color: black; z-index: -2;filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;'></div>");
		$("body").append("<img id='full' style='display: block; top: 10px; z-index: -2; position: absolute; border: 10px solid white;' src=''>");
		
		$("#full").hide();
		$("#overlay").hide();
	}
	
	function fixStupidIE6sProblemWithEverthing(){
		if($.browser.msie){
			if($.browser.version == 6.0){
				$("#overlay").height( $(document).height() );
			}
		}
	}	
	
	$("img", this).click(function(){
		$("#full").removeAttr("width").removeAttr("height").attr("src", " ").css({"width" : "auto", "height":"auto", "left" : "auto"});
		var id = $(this).attr("class");
		var bw = $(document).width();
		var bh = $(document).height();
		var name = img_name[id];
		var width = img_width[id];
		var height = img_height[id];
				
		$("#full").attr("src", name);
		
		if(width >= bw){
			$("#full").attr("width", "750px").show().width(750);
		}
		if(height >= bh){
			$("#full").attr("height", "550px").show().height(550);
		}
		
		
		var w = $("#full").width();
		var bw = $(window).width();
		var l = (bw - w) / 2;
		
		$("#overlay").show().css("z-index", "3");
		$("#full").show().css("left", l).css({"z-index" : "5"});

		fixStupidIE6sProblemWithEverthing();
	
	})
	
	
	$("#full").click(function(){
		$("#full").hide().css("z-index", -4);
		$("#overlay").hide().css("z-index", -4);
		$("#full").attr("src", "img/white.jpg");
	})
	
	
		
	
}