$(document).ready(
function(){
$(".sm_img").click(function(){
	bid='i'+$(this).attr('id');
	$(".big_img").css('display', 'none');
	$("#"+bid).css('display', 'inline');

})
}
);


function imgView(href,w,h)
{
 var mat = 100;
 var maxwidth = screen.width;
 var maxheight = screen.height;
 var top = Math.max(Math.floor((screen.height - (h + mat)) / 2), 10);
 var left = Math.max(Math.floor((screen.width - (w + mat)) / 2), 10);
 var param = 'top=' + top + ',left=' + left + ',Toolbar=0,Location=0,Directories=0,Status=0,Menubar=0, Resizable=0';
 if (w <= maxwidth && h <= maxheight) param += ',scrollbars=0';
 else { param += ',scrollbars=1'; w += 20; h += 20; }
 if(w > maxwidth) w = maxwidth; else w += mat;
 param  = param + ',width=' + w;
 if(h > maxheight) h = maxheight; else h += mat;
 param = param + ',height=' + h;

 imgWin = window.open('', '_blank', param);
 imgWin.opener = window;
 imgWin.resizeTo(w,h);
    imgWin.document.open("text/html");
 imgWin.document.writeln("<html>");
    imgWin.document.writeln("<head><title>Alvenia</title></head>");
    imgWin.document.writeln("<body style='margin:0; width:100%; height:100%; padding:0; background-color:#fff;'>");
 imgWin.document.writeln("<table style=' border-collapse:collapse; margin:0; padding:0; width:100%; height:100%;'>");
 imgWin.document.writeln("<tr>");
 imgWin.document.writeln("<td style=' margin:0; padding:0; width:100%; height:100%; text-align:center; vertical-align:middle;'>");
    imgWin.document.writeln('<a href="javascript:void(0);" onclick="window.close();"><img style="border: solid 3px #ccc;" src='+ href+'></a>');
 imgWin.document.writeln("</td></tr></table>");
 imgWin.document.write("</body>");
    imgWin.document.write("</html>");
    imgWin.document.close();
 imgWin.focus();
}


function winOpen(newWin,href) {
 	var top = Math.max(Math.floor((screen.height - 700) / 2), 10);
	var left = Math.max(Math.floor((screen.width - 1010) / 2), 10);	
	var param='toolbar=0,top=' + top + ',left=' + left + ',Toolbar=0,Location=0,Directories=0,Status=0,Menubar=0,Resizable=0,scrollbars=yes,width=1010,height=700'
	window.open(href, 'menu', param)
	return false 
	}


function winOpenPrint(newWin,href) {
 	var top = Math.max(Math.floor((screen.height - 850) / 2), 10);
	var left = Math.max(Math.floor((screen.width - 750) / 2), 10);	
	var param='toolbar=0,top=' + top + ',left=' + left + ',Toolbar=0,Location=0,Directories=0,Status=0,Menubar=0,Resizable=0,scrollbars=yes,width=750,height=850'
	window.open(href, 'menu', param)
	return false 
	}


