var imageWindow; 
function ImgWin(src,width,height,print){ 
	var scroll='no';
	if (print==true)
	{	var w=20;	var h=20;	}
	else{ var w=20;	var h=0;		}

	if( height>600 ) { w = w+width; h=600; scroll='yes'; }
	else { w=width; h=h+height; scroll='no'; }

	if(imageWindow)
		imageWindow.close(); 
	imageWindow=window.open("","blankImageWindow", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	imageWindow.document.write("<html><head><title>Просмотр</title><link rel='stylesheet' type='text/css' href='./inc/normal.css'></head>");
	imageWindow.document.write("<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=white text=black link=black alink=black vlink=black>"); 
	imageWindow.document.write("<center>"); 
	imageWindow.document.write("<table border=0 cellspacing=0 cellpadding=0 bgcolor=#FFFFFF>"); 
	imageWindow.document.write("<tr><td align=center bgcolor=white>"); 
	imageWindow.document.write("<a href='javascript:self.close();' title='закрыть окно'><img src='"+src+"' width="+width+" height="+height+" border=0></a>"); 
	if (print==true)
		imageWindow.document.write("</td></tr><tr><td align='center'><a class='cat' href='javascript:self.print();'>Распечатать</a></td></tr>"); 
	else
		imageWindow.document.write("</td></tr>"); 
	imageWindow.document.write("</table>"); 
	imageWindow.document.write("</body></html>"); 
	imageWindow.document.close(); 
	imageWindow.focus(); 
} 


var docWindow; 
function PanWin(src){ 
	var scroll='no';
	var w=710; 
	var h=560;
if(imageWindow)
		imageWindow.close();
	docWindow=window.open(src,"blankDocWindow", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	docWindow.focus(); 
} 

var hlpWindow; 
function ShowHelpWin(src){ 
	var scroll='yes';
	var w=500; 
	var h=400;

	hlpWindow=window.open("../template/"+src,"blankHelpWindow", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	hlpWindow.focus(); 
} 

var shWindow; 
function ShowWin(src){ 
	var scroll='yes';
	var w=500; 
	var h=400;

	shWindow=window.open("","blankDocWindow", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	shWindow.document.location="./control/show.php?id="+src;
	shWindow.focus(); 
} 

function GoToSite(src)
{
	window.open(src,"general"); 
	self.close();
}

function insertFlash(imageSource,width,height,id) {
	 var Content = ''+
	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'">'+
	'<param name="movie" value="' + imageSource + '">'+
	'<param name="play" value="true">'+
	'<param name="loop" value="true">'+
	'<param name="quality" value="high">'+
	'<param name="bgcolor" value="#CCCCCC">'+
	'<param name="wmode" value="transparent">'+
	'<param name="menu" value="false">'+
	'<embed name="'+id+'" src="' + imageSource + '" width="' + width + '" height="' + height + '" play="true" loop="true" bgcolor="#CCCCCC" quality="high" menu="false" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'+
	'</object>';
	document.write(Content);
}

var iFW; 
function ImgFlashWin(src,title){ 
	var scroll='no';
	
	var oImg = new Image();
	oImg.src= src;
	var width = oImg.width;
	var height = oImg.height;

	var w = oImg.width + 20;
	var h = oImg.height + 20;

	if(iFW)	iFW.close(); 
	iFW=window.open("","blankIFW", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	iFW.document.write("<html><meta http-equiv='content-type' content='text/html; charset=windows-1251' /><head><title>" + title + "</title></head>");
	iFW.document.write("<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=white>"); 
	iFW.document.write("<table width=100% height=100% border=0 cellspacing=0 cellpadding=0 bgcolor=#FFFFFF>"); 
	iFW.document.write("<tr><td align=center bgcolor=white>"); 
	iFW.document.write("<a href='javascript:self.close();' title='закрыть окно'><img src='"+src+"' width="+width+" height="+height+" border=0></a>"); 
		iFW.document.write("</td></tr>"); 
	iFW.document.write("</table>"); 
	iFW.document.write("</body></html>"); 
	iFW.document.close(); 
	iFW.focus(); 
}
