//var x_newWin = null;

function openurl (fileName,w,h,s,door,m) {
	    if (w == null) var w = 500;
            if (h == null) var h = 400;
            if (s == null) var s = 1;
            if (m == null) var m = 0;
            if (door == null) var door = '';
                    
            var t = (screen.height - h) / 2;
	    var l = (screen.width - w) / 2;
   	    var winArgs = 'height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + 'status=no,toolbar=no,menubar=' + m + ',location=no,fullscreen=no,resizable=no,directories=no' + ',scrollbars=' + s;
            //if(x_newWin != null) x_newWin.close();
            //x_newWin = window.open(fileName,'',winArgs);
            window.open(fileName,door,winArgs);
        }


function qn (url) {
	if ( window.confirm ( 'Удалить этот элемент?' ) ) {
		top.location = url;
	}
}

var z_newWin = null;

function document.onclick()
	{
        if (window.event.srcElement.name) {
		var picDesc = window.event.srcElement.name;
                var alt = window.event.srcElement.alt;
                alt = 'Увеличенная фотография';
		var iSize = picDesc.length;
		var exl = picDesc.lastIndexOf("!");
		var sPic = picDesc.substring(0, exl)
		var xPos = picDesc.indexOf("x", exl+1);
		var w = parseInt(picDesc.substring(exl+1, xPos));
		var h = parseInt(picDesc.substring(xPos+1, iSize));
		var t = (screen.height - h) / 2;
		var l = (screen.width - w) / 2;
		var winArgs = 'height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + 'status=no,toolbar=no,menubar=no,location=no,fullscreen=no,resizeble=no,directories=no';
		var sCont = '<html>\n\n<title>' + alt + '</title>\n\n<body scroll=NO topmargin=0 leftmargin=0>\n\n<img border=0 alt="' + alt + '"src="' + sPic + '">\n\n</body></html>\n'

		if(exl >= 0) {
			if(xPos >= 0) {
				if(w > 0 && h > 0) {
					if(sPic.length>0) {
						if(z_newWin != null) z_newWin.close();

						z_newWin = window.open(sPic, null, winArgs);

						z_newWin.document.open();
						z_newWin.document.write(sCont);
						z_newWin.document.close();

						return false;
					}
				}
			}
		}

            }
	
	}