var tp, tp_h,tp_f=0,tn_f=0, tn, tn_h;
var m_bgr=new Image(531,488);
m_bgr.src="../images/content_bg.jpg";
document.onselectstart=function(){return false;}
document.oncontextmenu=function(){return false;}

function cacheBgrIe(){
  try {document.execCommand('BackgroundImageCache', false, true);}catch(e){}
}
function sh(el){
  cacheBgrIe()  
  if(el=='top_products'){  
    tp_f=0;
    tp=document.getElementById('top_products');
    tp_h=document.getElementById('top_products_h');
    tp_h.style.display="block";
    tp.style.background = "url(../images/content_bg.jpg)";
    tp.style.backgroundRepeat="no-repeat";    
    tp.style.backgroundPosition="-267px 0px";
    if(parseInt(tp.style.top)>0)moveProductsUp();  
    else moveProductsDown();      
  }  
  else if(el=='top_news'){
    tn_f=0;  
    tn=document.getElementById('top_news');
    tn_h=document.getElementById('top_news_h');
    tn_h.style.display="block";
    tn.style.background="url(../images/content_bg.jpg)";
    tn.style.backgroundRepeat="no-repeat";    
    tn.style.backgroundPosition="0px 0px";
    if(parseInt(tn.style.top)>-350)moveNewsUp();  
    else moveNewsDown();      
  }
}
function moveProductsDown(){
      if(parseInt(tp.style.top)<420){
          tp.style.top=(parseInt(tp.style.top)+30)+"px";
          setTimeout("moveProductsDown()",10)
      }
      else{
      clearTimeout();
          tp.style.padding = "0px";
      tp.style.top = "420px";
      tp.style.background="none"
      tp_h.style.display="none";      
      }
}
function moveProductsUp(){
    if(parseInt(tp.style.top)>30){
      tp.style.top=(parseInt(tp.style.top)-30)+"px";
      setTimeout("moveProductsUp()",10);
  }
  else {
    clearTimeout();
    tp_f=1;
    tp.style.top="0px";
    tp.style.padding = "30px 0px 0px 0px";     
  }
}
function moveNewsDown(){
      if(parseInt(tn.style.top)<-30){
          tn.style.top=(parseInt(tn.style.top)+30)+"px";
          setTimeout("moveNewsDown()",10)
      }
      else{
      clearTimeout();
      tn_f=1;
          tn.style.padding = "0px";
      tn.style.top = "0px";
      tn.style.padding = "40px 0px 0px 0px";
      }
}
function moveNewsUp(){
    if(parseInt(tn.style.top)>-350){
      tn.style.top=(parseInt(tn.style.top)-30)+"px";
      setTimeout("moveNewsUp()",10);
  }
  else {
    clearTimeout();
    tn_f=1;
    tn.style.top="-350px";
    tn.style.padding = "0px";
    tn.style.background="none";
      
  }
}

