var show=1;
var up=0;
function OpenCenterWindow( sUri, iWidth, iHeight )
{
        var sWindowName = 'win' + Math.floor( Math.random()*1000 )
        var iRealWidth = iWidth ? iWidth : 600
        var iRealHeight = iHeight ? iHeight : screen.height - 300

        var iLeft = Math.round( (screen.width-iRealWidth)/2 )
        var iTop =  Math.round( (screen.height-iRealHeight)/2 ) - 35

        var sWindowOptions = 'status=yes,menubar=no,toolbar=no'
        sWindowOptions += ',resizable=no,scrollbars=no,location=no'
        sWindowOptions += ',width='  + iRealWidth
        sWindowOptions += ',height=' + iRealHeight
        sWindowOptions += ',left='   + iLeft
        sWindowOptions += ',top='       + iTop

        var oWindow = window.open( sUri, sWindowName, sWindowOptions )
        oWindow.focus();
        return oWindow
}

function prevNew(num){
	document.getElementById('top_news').className='top_news_empty';
	document.getElementById('top_news').innerHTML='';
	document.getElementById('loder').src='load_news.php?id='+num;
}


$(document).ready(function(){
    $(".btn-slide").click(function(){
        $("#panel").slideToggle("slow");
        $(this).toggleClass("btn-slide-active");
    });
	
});

function mov(nu){
	if(nu==show){
			
	}
	else {
		show=nu;
		nm1="block"+nu;
		document.getElementById(nm1).style.display='';
		document.getElementById("l"+nu).style.border="#22aae1 1px solid";
		document.getElementById("l"+nu).style.background="#fff";
		els=3-nu;
		nm2="block"+els;
		document.getElementById(nm2).style.display='none';
		document.getElementById("l"+els).style.background="";
		document.getElementById("l"+els).style.border="#a4a4a4";
		if(up==0){
			document.getElementById("block2").innerHTML="<h3>Загрузка...</h3> <p>пожалуйста подождите</p>";	
			document.getElementById("loder").src="load_cont.php";
			up=1;
		}
	}
}
