var browser_name = navigator.appName;
var browser_version = parseFloat(navigator.appVersion);

var explorer = false;
if (browser_name == "Microsoft Internet Explorer") explorer = 'true';

var ww=screen.width; var xx=screen.height;
//if (document.body.innerwidth) { ww=document.body.innerwidth; xx=document.body.innerHeight; };
//if (document.body.clientWidth) { ww=document.body.clientWidth; xx=document.body.clientHeight; };


function closewin(a){
	var b=document.getElementById(a);
	b.style.display='none';
	return false;
};

function popupfrm(a){
        scroll(0,0);
	var b=document.getElementById(a);
	var posit=document.body.scrollTop; var posit2=document.body.scrollLeft;
	var ww=screen.width; var xx=screen.height;
	if (document.body.innerwidth) { ww2=document.body.innerwidth; xx2=document.body.innerHeight; };
	if (document.body.clientWidth) { ww2=document.body.clientWidth; xx2=document.body.clientHeight; };
	if (ww2<ww) ww=ww2; if (xx2<xx) xx=xx2;
	var temp = b.style.width; temp=temp.replace( 'px', '' );  var wid=temp;
	var temp = b.style.height; temp=temp.replace( 'px', '' ); var hei=temp;
	var x=(xx-hei)/2; var y=(ww-wid)/2;
	b.style.top=posit+x; b.style.left=posit2+y;
	b.style.top=50+'px';
	b.style.display='block';
	return false;
};

//показываем все убираем окна
function escape(a){
	if (a==27) {
        if (!(document.getElementById('kont')==null))  document.getElementById('kont').style.display='none';
        if (!(document.getElementById('gost')==null))  document.getElementById('gost').style.display='none';
        };
};


function checkwidth(){
 if (document.body.innerwidth) { ww=document.body.innerwidth; xx=document.body.innerHeight; };
 if (document.body.clientWidth) { ww=document.body.clientWidth; xx=document.body.clientHeight; };
 ww=parseInt(ww);
 var t=document.getElementById('maintable');
 if (ww>1280) document.getElementById('maintable').style.width='1250';
 if (ww<1280) document.getElementById('maintable').style.width='100%';
};

checkwidth();




function pp(a,b){
document.getElementById('newmestitle').innerHTML=a;
//document.getElementById('ft').style.display='none';
document.getElementById('ft').style.display='none';
document.pop.reply.value=b;
popupfrm('gost');
return false;
};

function ppf(a,b){
document.getElementById('newmestitle').innerHTML=a;
document.getElementById('ft').style.display='block';
document.pop.reply.value=b;
popupfrm('gost');
return false;
};


