
function open2(url, width, height, target) {
    if (target == undefined)
        target = "_blank";
    
    var features = 'width=' + width + 'px, height=' + height + 'px, center=yes';
    
    window.open(url, target, features, false);
    
    if (window.event)
        window.event.returnValue = false;
    return false;
    
}

function openImage(name, width, height, title) {
    var features = 'width = ' + width + ', height = ' + height + ', channelmode = no, directories = no, fullscreen = no, location = no, menubar = no, resizable = no, scrollbars = no, status = no, titlebar = yes, toolbar = no';
    var _window = window.open('about:blank', '_image', features, false);
    var HTML = new String();
    var imageUrl = '/files2/images/' + name;
    
    if (title == undefined)
        title = 'Картинка';
    
    HTML += '<html>' + '\n';
    HTML += '<head>' + '\n';
    HTML += '<title>' + title + '</title>' + '\n';
    HTML += '</head>' + '\n';
    HTML += '<body style="margin: 0px 0px 0px 0px;">' + '\n';
    HTML += '<a href="#" onclick="window.close();">' + '\n';
    HTML += '<img style="border-width: 0px;" alt="Закрыть" src="' + imageUrl + '" />' + '\n';
    HTML += '</a>' + '\n';
    HTML += '</body>' + '\n';
    HTML += '</html>' + '\n';
    
    _window.document.write(HTML);
    
    if (window.event)
        window.event.returnValue = false;
    return false;
}

function Toggle(name) {
	document.all[name].style.display = (document.all[name].style.display == '' ? 'none' : '');
	if (window.event) window.event.returnValue = false;
	return false;
}

function isemail(value) {
	return (/.@{1}[0-9A-Za-z\-]{1,}\.{1}[A-Za-z]{2,4}/gi).test(value);
}

function IsEMail(value) {
	return isemail(value);
}

function chState(id) {
    var obj = document.getElementById(id);
    obj.style.display = (obj.style.display == 'none') ? '' : 'none';
    if (window.event) window.event.returnValue = false;
	return false;
}

