var mm, nn, opened, openedt, scroller;

opened=6;
openedt=5;

function init()
{
	var h=document.body.offsetHeight;
	var w=document.body.offsetWidth;
}

function show(id)
{
	if(opened!=id){
	hide(opened);
	opened=id;
	slide(id);
}
}

function slide(id)
{
mm = setTimeout("slide("+id+")",5);
sec='s'+id;
 if(parseInt(document.all[sec].style.left)<0)
 {
  document.all[sec].style.left=parseInt(document.all[sec].style.left)+5+'px';
 }
 else
 {
  clearTimeout(mm);
 }
}

function hide(id)
{
nn = setTimeout("hide("+id+")",5);
sec='s'+id;
 if(parseInt(document.all[sec].style.left)>-132)
 {
  document.all[sec].style.left=parseInt(document.all[sec].style.left)-5+'px';
 }
 else
 {
  clearTimeout(nn);
 }
}


function showt(id)
{
	if(openedt!=id){
	hidet(openedt);
	openedt=id;
	slidet(id);
}
}

function slidet(id)
{
mm = setTimeout("slidet("+id+")",5);
sec='s'+id;
 if(parseInt(document.all[sec].style.left)<0)
 {
  document.all[sec].style.left=parseInt(document.all[sec].style.left)+5+'px';
 }
 else
 {
  clearTimeout(mm);
 }
}

function hidet(id)
{
nn = setTimeout("hidet("+id+")",5);
sec='s'+id;
 if(parseInt(document.all[sec].style.left)>-168)
 {
  document.all[sec].style.left=parseInt(document.all[sec].style.left)-5+'px';
 }
 else
 {
  clearTimeout(nn);
 }
}


function shownews()
{
nn = setTimeout("shownews()",1);
 if(parseInt(document.all["news"].style.left)>0)
 {
  document.all["news"].style.left=parseInt(document.all["news"].style.left)-1+'px';
 }
 else  if(parseInt(document.all["news"].style.top)>0)
{
  document.all["news"].style.top=parseInt(document.all["news"].style.top)-1+'px';
}
 else
 {
  clearTimeout(nn);
 }
}


function hidenews()
{
nn = setTimeout("hidenews()",1);
  if(parseInt(document.all["news"].style.top)<287)
{
  document.all["news"].style.top=parseInt(document.all["news"].style.top)+1+'px';
}
 else if(parseInt(document.all["news"].style.left)<333)
 {
  document.all["news"].style.left=parseInt(document.all["news"].style.left)+1+'px';
 }
 else
 {
  clearTimeout(nn);
 }
}



function scrollup()
{
 scroller=setTimeout("scrollup()",30);
 if( Math.abs(parseInt(document.all["txt"].style.top))+300 >= document.all["txt"].offsetHeight )
  {
   clearTimeout(scroller);
  }
 else {document.all["txt"].style.top=parseInt(document.all["txt"].style.top)-5;}
 
}

function showposition(){
alert(document.all["txt"].style.top);

}

function scrolldown()
{
 scroller=setTimeout("scrolldown()",30);
  if( parseInt(document.all["txt"].style.top)+5 >0 )
  {
   document.all["txt"].style.top=0;
   clearTimeout(scroller);
  }
  else{document.all["txt"].style.top=parseInt(document.all["txt"].style.top)+5;}
 }


