function WindowOpen(url,w,h) {
   var nw,bfr;
   bfr='resizable,toolbar=no,location=no,directories=no,status=no,menubar=no,width='+(w+16)+',height='+(h+16)+"'";
   nw=window.open(url,'show',bfr);
}

function HideShowMenu(){
	var obj = document.getElementById("menu");
	if (obj.style.display == 'none')
		obj.style.display ="block";
	else
		obj.style.display ="none";
}

function ViewForgotDiv()
{
	el = document.getElementById('divforgot');
	if (el.style.display == 'none')
		el.style.display  = "block";
	else	
		el.style.display  = "none";

}
function checkNum(toCheck) {
  var isNum = true;


  if ((toCheck == null) || (toCheck == "")) {
    isNum = false;
    return isNum;
  }

  for (j = 0; j < toCheck.length; j++) {
    if ((toCheck.substring(j,j+1) != "0") &&
        (toCheck.substring(j,j+1) != "1") &&
        (toCheck.substring(j,j+1) != "2") &&
        (toCheck.substring(j,j+1) != "3") &&
        (toCheck.substring(j,j+1) != "4") &&
        (toCheck.substring(j,j+1) != "5") &&
        (toCheck.substring(j,j+1) != "6") &&
        (toCheck.substring(j,j+1) != "7") &&
        (toCheck.substring(j,j+1) != "8") &&
        (toCheck.substring(j,j+1) != "9") &&

        (toCheck.substring(j,j+1) != ".") &&
        (toCheck.substring(j,j+1) != "-")) {
      isNum = false;
    }
  }

  return isNum;

}

function CheckIsNum(lang,toCheck)
{	
	if (checkNum(toCheck.value) == false)
		{
			toCheck.value = "0";
			if (lang == 'ru')
				alert('Поле должно быть числовое.');
			else
				alert('This field must Numeric.');
		}	
}

function ChangeLang()
{
	document.changeLang.submit();
}


function MakeOn(url)
{
	location.href=url;
}

function DopImg()
{
  targetId="dopimg";
  targetElement = document.getElementById(targetId);
	if (targetElement.style.display == "none")
	        targetElement.style.display= "";
	else targetElement.style.display = "none";
	location.href = "#dopimg";
}