 function ImgShw(ID, width, height, alt)
{
	var scroll = "no";
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
	var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write(
		"<html><head>"+
		"<"+"script type=\"text/javascript\">"+
		"function KeyPress()"+
		"{"+
		"	if(window.event.keyCode == 27) "+
		"		window.close();"+
		"}"+
		"</"+"script>"+
		"<title>"+(alt == ""? "Картинка":alt)+"</title></head>"+
		"<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">"+
		"<div align=\"center\" style=\"background-color :#D2CCBC;\" ><img  src=\""+ID+"\" border=\"0\" alt=\""+alt+"\" /></div>"+
		"</body></html>"
	);
	wnd.document.close();
}

function MM_openBrWindow(theURL,winName,w,h,s) { //v2.0
        var width=w;
        var height=h;
        var top=(screen.height) ? (screen.height-height)/2 : 0;
        var left=(screen.width) ? (screen.width-width)/2 : 0;
        var features = '';
        if (s==1) {features = 'scrollbars=1,width='+width+',height='+height+',top='+top+',left='+left;};
	    if (s==2) {features = 'scrollbars=1,toolbar=1,status=1,resizable=1,width='+width+',height='+height+',top='+top+',left='+left;};
	    if (s==0) {features = 'scrollbars=0,toolbar=1,status=0,width='+width+',height='+height+',top='+top+',left='+left;};
	    if (s==3) {features = 'scrollbars=0,toolbar=0,status=0,resizable=0,width='+width+',height='+height+',top='+top+',left='+left;};

        
        window.open(theURL,winName,features);
}








 function func(obj){
 var addValue = new Array();
 idd="galera1";
	 for(j=0,i=1;j<mass[obj].length;i++,j++){
	    addValue = "";
		if(j<mass[obj].length-1 ){
			addValue = mass[obj][i][0].split(";");
		    document.all.item("galera1").outerHTML='<a id="galera1" title="общий вид изделия" onClick="ImgShw(\''+addValue[0]+'\',\''+addValue[5]+'\',\''+addValue[6]+'\', \''+addValue[2]+'\'); return false;" href="'+addValue[0]+'" target=_blank><img src="'+addValue[1]+'" id=\'mat'+obj+'\'  hspace=\'0\' vspace=\'0\' border=\'0\' title=\''+addValue[2]+'\' width='+addValue[3]+' height='+addValue[4]+' /></a>';			 
		    //alert(document.all.item("galera"+i).outerHTML);
			
		} 
	 }
 return false;
 }
 