  var curpos=0;
  var endpos=90;
  var curpos2=0;
  var endpos2=98;
  var aktiv;
  var aktiv2;
  var hidingdone=0;
  var afterhideurl='';

	function pause(numberMillis) {
		var now = new Date();
		var exitTime = now.getTime() + numberMillis;
		while (true) {
			now = new Date();
			if (now.getTime() > exitTime)
				return;
		}
	}
	
  function ShowOtherProducts(url)
  {
    if(document.getElementById('main_product') && !document.getElementById('main_basket'))
    {
      if(aktiv) window.clearInterval(aktiv);
      curpos=90;
      endpos=0;
      afterhideurl=url;
      HideProduct();
      document.getElementById('border3_content').style.overflow='hidden';
      aktiv = window.setInterval("HideProduct()",20);
    }
    else
      window.location.href=url;     
  }
  
  function ShowOtherCategory(url)
  {
    if(!document.getElementById('main_products') && !document.getElementById('main_product'))
      window.location.href=url;     

    if(document.getElementById('main_product') && !document.getElementById('main_basket'))
      ShowOtherProducts(url);
      
    if(document.getElementById('main_products'))
    {
      curpos2=90;
      endpos2=0;
      afterhideurl=url;
      HideProducts();
      aktiv2 = window.setInterval("HideProducts()",20);
    }
  }
  function ShowCategories()
  {
    document.getElementById('main_categories').style.height=curpos+'%'; if(curpos<5) curpos+=2; else if(curpos<14) curpos+=3; else if(curpos<30) curpos+=4; else curpos+=5; if(curpos>endpos) { window.clearInterval(aktiv); document.getElementById('main_categories').style.height=endpos+'%'; }
  }        
  function ShowProducts()
  {
    document.getElementById('main_products').style.height=curpos+'%'; if(curpos<5) curpos+=2; else if(curpos<14) curpos+=3; else if(curpos<30) curpos+=4; else curpos+=5; if(curpos>endpos) { window.clearInterval(aktiv); document.getElementById('main_products').style.height=endpos+'%'; }
  }        
  function ShowProduct()
  {
    document.getElementById('main_product').style.height=curpos+'%'; if(curpos<5) curpos+=2; else if(curpos<14) curpos+=3; else if(curpos<30) curpos+=4; else curpos+=5; if(curpos>endpos) { window.clearInterval(aktiv); document.getElementById('border3_content').style.overflow='auto'; document.getElementById('main_product').style.height=endpos+'%'; }
  }        
  function ShowBasket()
  {
    document.getElementById('main_basket').style.height=curpos+'%'; if(curpos<5) curpos++; else if(curpos<14) curpos+=2; else curpos+=3; if(curpos>endpos) { window.clearInterval(aktiv); document.getElementById('border4_content').style.overflow='auto'; document.getElementById('main_basket').style.height=endpos+'%'; }
  }        
  function ShowStatus()
  {
    document.getElementById('main_status').style.width=curpos2+'%'; curpos2+=3; 
    if(curpos2>endpos2) {
      document.getElementById('status_line').style.display='inline'; 
      window.clearInterval(aktiv2); 
      document.getElementById('main_status').style.width=endpos2+'%'; 

      ShowCategories();
      document.getElementById('main_categories').style.display='inline'; 
      window.setInterval("ShowCategories()",20);      
    }
  }        
  function HideBasket()
  {
    curpos=90;
    endpos=0;
    HideBasketLoop();
    document.getElementById('border4_content').style.overflow='hidden';
    var aktiv = window.setInterval("HideBasketLoop()",20);
  }
  function HideBasketLoop()
  {
    document.getElementById('main_basket').style.height=curpos+'%'; curpos-=3; if(curpos<0) { window.clearInterval(aktiv); document.getElementById('main_basket').style.height=endpos+'%'; }
  }        
  function HideProduct()
  {
    document.getElementById('main_product').style.height=curpos+'%'; curpos-=8;
    if(curpos<0) { 
      window.clearInterval(aktiv); document.getElementById('main_product').style.height=endpos+'%'; 
      window.location.href=afterhideurl; 
    }
  }        
  function HideProducts()
  {
    document.getElementById('main_products').style.height=curpos2+'%'; curpos2-=8;
    if(curpos2<0) { 
      window.clearInterval(aktiv2); document.getElementById('main_products').style.height=endpos2+'%'; 
      window.location.href=afterhideurl;
    }
  }        
  
