
function ajaxwin(page, mode,text, siberid, post, title){

		document.getElementById('window_small').style.display ='';

		document.getElementById('window_small_title').innerHTML= mode;

                	document.getElementById('window_small_content').innerHTML= text ;
		win_mover(100, 'window_small', 0);

}
function ajaxwin_close(mode){
	if (mode == "window"){
		document.getElementById('window').style.display ='none';
		document.getElementById('window_small').style.display ='none';
		dofadeout('layer','6','display');
	}
	if (mode == "window_small"){
		document.getElementById('window_small').style.display ='none';
	}
}

var DivY= 500;
var DivY0 = DivY/6;
var PoseActive=0;

function win_mover(my_y, go_up_id_old, leftpx){
	go_up_id=go_up_id_old;
	newleft=document.body.clientWidth/2 - parseInt(document.getElementById(go_up_id).style.width)/2;
	document.getElementById(go_up_id).style.top = "0px";
	document.getElementById(go_up_id).style.left = newleft-leftpx+"px";

	DivY = document.body.clientHeight+1500;
    DivY0 = DivY/my_y;
	Pos();
	DivUp();
	document.getElementById(go_up_id).style.display="";
}
function Pos(){
	if (window.innerHeight)
	{
	    pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
	 	pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		pos = document.body.scrollTop
	}
	if (PoseActive)
	{
		document.getElementById(go_up_id).style.top = DivY + pos+"px";
		temp = setTimeout('Pos()',300);
	}
}
function DivUp(){
	if (Math.abs(DivY- DivY0)>.1){
		DivY = (DivY0 - DivY) * .2  + DivY;
		document.getElementById(go_up_id).style.top = DivY + pos+"px";
		setTimeout("DivUp()", 50);
	}
	else
	{
	 	PoseActive = 0;
	}
}


