
nsName = {

        queryDefault: 'Логин',
        queryClick: function() {
                if ($_('sub_name').value == nsName.queryDefault) { $_('sub_name').value = ''; }
        },
        queryBlur: function() {
                if ($_('sub_name').value == '') { $_('sub_name').value = nsName.queryDefault; }
        }


}

nsPass = {

        queryDefault: 'Пароль',
        queryClick: function() {
                if ($_('sub_email').value == nsPass.queryDefault) { $_('sub_email').value = ''; }
        },
        queryBlur: function() {
                if ($_('sub_email').value == '') { $_('sub_email').value = nsPass.queryDefault; }
        },
        querySubmit: function() {
                if ($_('sub_email').value == nsPass.queryDefault || $_('sub_email').value == '' || $_('sub_name').value == nsName.queryDefault || $_('sub_name').value == '') {
                        alert ('Пожалуйста, заполните оба поля.'); return false;
                }
                return true;
        }


}




function $_() {
        var elements = new Array();
        for (var i = 0; i < arguments.length; i++) {
                var element = arguments[i];
                if (typeof element == 'string')
                        element = document.getElementById(element);
                if (arguments.length == 1)
                        return element;
                elements.push(element);
        }
        return elements;
}

function ImgPopUp (string, width, height){
	eval('window.open(\'imgpopup.php?file='+string+'\', \'ImgPopUpWin\', \'scrollbars=no, status=no, width='+width+', height='+height+', resizable=no\')');
}

function openWin(url) {
  myWin=window.open(url,'','width=530,height=350,status=no,toolbar=no,menubar=no, scrollbars=yes');
}

function openWinForModel(url) {
  myWin=window.open(url,'','width=800,height=600,status=no,toolbar=no,menubar=no, scrollbars=yes');
}

function openTalk(url) {
  myWin=window.open(url,'','width=500,height=600,status=no,toolbar=no,menubar=no, scrollbars=yes');
}

function openSort(url) {
  myWin=window.open(url,'','width=800,height=800,status=no,toolbar=no,menubar=no, scrollbars=yes');
}

function go_url( url )
{
  window.location = url;
}

function confirmDelete(question, where)
{
        temp = window.confirm(question);
        if (temp) //delete
        {
                window.location=where;
        }
}

function SubmitForm() {
if (confirm("Удалить?")) { form.submit(); };
}

function PopImgUp (string, width, height){
	eval('window.open(\''+string+'\', \'ImgPopUpWin\', \'scrollbars=no, status=no, width='+width+', height='+height+', resizable=no\')');
}


function confirmSubmit()
{
var agree=confirm("Уверены, что хотите удалить?");
if (agree)
	return true ;
else
	return false ;
}

function ShowHide(elem, icon_elem){
  var s = elem.style;
  s.display = (s.display != 'none') ? 'none': '';
  if(icon_elem) { icon_elem.innerHTML = (s.display != 'none') ? '[+]': '[&ndash;]'; }
}


function HideMe(elem, icon_elem){
  var s = elem.style;
  s.display = (s.display != 'none') ? 'none': '';
  if(icon_elem) { icon_elem.innerHTML = (s.display != 'none') ? 'Свернуть': 'Развернуть'; }
}

function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}


/* Modal login screen
 *--------------------------------------------------------------------------*/
function login_show() {
	$_('auth').style.display = "block";
	$_('authdialog').style.left = '50%';
	$_('focused').focus();
}


function login_hide() {
	$_('authdialog').style.position = 'absolute';
	$_('authdialog').style.left = '-2000px';
	$_('auth').style.display = "none";
}

document.onkeypress = function(ev){
	ev = ev || event;
	if(ev.keyCode==27)
		login_hide();
}

/* Modal login screen END
 *--------------------------------------------------------------------------*/



