function zoom(srcfile){
	var m = screen.availWidth/2;
	zw=window.open('','zoomwin','width=50,height=50,top=20,left=20,resizable=yes,location=0,scrollbars=1,status=no,toolbar=no,directories=no');
	zwdata='<html><head><title>-</title><script type="text/javascript"> function rwin(){ self.resizeTo(document.images["imgfile"].width+12, document.images["imgfile"].height+31); var sleva='+m+'-((document.getElementById("imgfile").width)/2); self.moveTo(sleva,50); } </script></head><body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0" onload="rwin()"><a href="javascript:self.close()"><img id="imgfile" src='+srcfile+' alt="закрыть окно" title="закрыть окно" border="0"></a></body></html>';
	zw.document.open();
	zw.document.write(zwdata);
	zw.focus();
	zw.document.close();
}


function preview(img){
	for(i=0;i<img.length;i++){
		var content='<div class="image" style="float:left;">'+
					'<div>'+
						'<a href="/popwin.php?mod=image&id='+img[i][2]+'&link='+img[i][0]+'" onclick="window.open(this.href,\'\',\'width=50,height=50,top=20,left=20,resizable=yes,location=0,scrollbars=1,status=no,toolbar=no,directories=no\');return false;" target="_blank">'+
						//'<a href="/popwin.php?mod=image&id='+img[i][2]+'&link='+img[i][0]+'" class="highslide" onclick="return hs.expand(this)" target="_blank">'+
						'<img src="'+img[i][1]+'" border="0">'+
						'</a>'+
					'</div>'+
				'</div>';
		
		document.write(content);
	}
}

function createBookmark(name){
	/*
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) 
		window.sidebar.addPanel ("My Site", "http://www.mysite.com", "");
	//IE4+
	else if (typeof window.external == "object") 
		window.external.AddFavorite("http://www.mysite.com", "My Site");
	//Opera7+
	else if(window.opera && document.createElement){
		var a = document.createElement('A');
		if (!a) return false; //IF Opera 6
		a.setAttribute('rel','sidebar');
		a.setAttribute('href',url);
		a.setAttribute('title',title);
		a.click();
	}*/
	
	we = window.external;

	if (!we){
		//opera		
		return true;
	}else{
		if((typeof(window.sidebar)=='object') && (typeof(window.sidebar.addPanel)=='function')){
			//firefox
			window.sidebar.addPanel(name,location.href,'');
			return false;
		}else{
			//IE
			we.addFavorite(location.href, name);
			return false;
		}
	}
}