function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}


function changeImage(obj,fn) {if (document.images && (preloadFlag == true)) {obj.src = fn}}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

var preloadFlag = false;

function RunFlash(fn,w,h,FlashVars)
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width='+w+' height='+h+'>\n');
document.write('<param name="movie" value="'+fn+'">\n');
document.write('<param name="quality" value="high">\n');
document.write('<param name="FlashVars" value="'+FlashVars+'">\n');
document.write('<param name="wmode" value="transparent">\n');
document.write('<param name="allowScriptAccess" value="sameDomain">\n');
document.write('<embed FlashVars="'+FlashVars+'" allowScriptAccess="sameDomain" wmode="transparent" src="'+fn+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF"></embed>\n');
document.write('</object>\n');
}


function ShowImagePopup(fn,w,h,alt)
{
 newWindow = window.open("","newWindow","width=" + w + ",height=" + h);
 newWindow.document.open();
 newWindow.document.write('<html><head><title>' + alt + '</title>');
 newWindow.document.write('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /></head>');
 newWindow.document.write('<body bgcolor=#FFFFFF leftmargin=0 topmargin=0  marginheight=0 marginwidth=0 onBlur="self.close()">');
 newWindow.document.write('<a href="javascript:self.close();" title="Закрыть окно">');
 newWindow.document.write('<img src="/upload/' + fn + '" width=' + w + ' height=' + h + '></a>');
 newWindow.document.write('</body></html>');
 newWindow.document.close();
 newWindow.focus();

}
