function boxit(ht) {

var modalbox;
var scrollWidth;
var scrollHeight;

    var fdiv = document.getElementById('pfcont');
    var modalbox = document.getElementById('modalbox');

modalbox.innerHTML = ht;


var width = 0, height = 0;
  if(window.innerWidth){
    width = window.innerWidth;
    height = window.innerHeight;
  }
  else if(document.documentElement && document.documentElement.clientWidth){
    width = document.documentElement.clientWidth;
    height = document.documentElement.clientHeight;
  }
  else if(document.body && document.body.clientWidth){
    width = document.body.clientWidth;
    height = document.body.clientHeight;
  }


scrollWidth = document.body.scrollWidth;
scrollHeight = document.body.scrollHeight;


//fdiv.style.width = scrollWidth+'%';
//fdiv.style.height = scrollHeight+'%';

fdiv.style.width = scrollWidth;
fdiv.style.height = scrollHeight;


//fdiv.style.width = width;
//fdiv.style.height = height;


fdiv.style.filter = "alpha(opacity=50)";
fdiv.style.opacity = 0.5;
fdiv.style.display = "block";

modalbox.style.display = "block";

posleft = Math.round(scrollWidth / 2);
postop = Math.round(scrollHeight / 2);

modalbox.style.width = '350px';

var ff_x = (document.all)?document.body.scrollLeft:window.pageXOffset; 
var ff_y = (document.all)?document.body.scrollTop:window.pageYOffset;

//modalbox.style.top = postop - (document.getElementById('modalbox').offsetHeight / 2);;
//modalbox.style.left = posleft - (document.getElementById('modalbox').offsetWidth / 2);

modalbox.style.top = ff_y  + window.innerHeight/2 - (document.getElementById('modalbox').offsetHeight / 2);;
modalbox.style.left = ff_x + window.innerWidth/2 - (document.getElementById('modalbox').offsetWidth / 2);

fdiv.style.visibility='visible';

return true;
}


function chLIForm() {

if (document.fr.login.value.length == 0) {
alert('Ошибка. Не все поля формы были заполнены.');
return false;
}

if (document.fr.password.value.length == 0) {
alert('Ошибка. Не все поля формы были заполнены.');
return false;
}

//document.fr.LISubmit.disabled = true;
//document.fr.CLSubmit.disabled = true;

    return true;
}


function ch77Form() {

if (document.fr.login.value.length == 0) {
alert('Ошибка. Не все поля формы были заполнены.');
return false;
}

if (document.fr.password.value.length == 0) {
alert('Ошибка. Не все поля формы были заполнены.');
return false;
}

    return true;
}

function GBFormCheck() {

if (document.gbform.uname.value.length == 0 || document.gbform.umail.value.length == 0 || document.gbform.umessage.value.length == 0) {
alert('Ошибка. Не все поля формы были заполнены.');
return false;
}

    return true;
}

function hidepf(src) {

 var fdiv = document.getElementById('pfcont');
 var modalbox = document.getElementById("modalbox");

fdiv.style.visibility='hidden';
modalbox.style.display='none';

if(!src) src="./";

self.location = src;

}
