// JavaScript Document
(function($) {
	$.fn.photoViewer = function(settings) {
		if( $("#photoViewer").length > 0 ){
			$(this).click(function(){
				var src = $(this).attr("src");
				$("#photoViewer").removeCss("height" , "width");
				$("#photoViewer").attr("src" , src);
				$("#photoViewer").click(function(){
					window.open( $("#photoViewer").attr("src") , "photoViewer");
				});
				var maxHeight = 250;
/*				var tmpHeight = $("#photoViewer").height > maxHeight ? maxHeight : $("#photoViewer").height;
				var tmpWidth = (maxHeight/ $("#photoViewer").height ) * tmpHeight
				$("#photoViewer").height(tmpHeight);
				$("#photoViewer").width(tmpWidth);*/
				$("#photoViewer").css("cursor" , "pointer");

				return false;
			});
		}
	}
})(jQuery); // Call and execute the function immediately passing the jQuery object

jQuery.fn.extend
({
    removeCss: function(cssName) {
        return this.each(function() {
            var curDom = $(this);
            jQuery.grep(cssName.split(","),
                    function(cssToBeRemoved) {
                        curDom.css(cssToBeRemoved, '');
                    });
            return curDom;
        });
    }
});

