var move = 0;

/*
window.onload=function () {
	show();
	init();
};
 */
if (navigator.appName == "Microsoft Internet Explorer") {
        active_element = document.activeElement;
        document.onfocusout = whenBlur;
} else { window.onblur = whenBlur; }
 
function whenBlur() {
	if(loaded)
	move=0;
}
window.onfocus=function () {
	if(loaded)
	move=1;
}
var loaded=0;
function init(warning) {
  scrollframe_width=document.getElementById("scrollframe").style.width;
  window.setInterval("scroll()",40);  
  scroll();
  move=1;
  loaded=1;
  if(warning!="") {
    window.setTimeout("alert('"+warning+"')",1);
  }
}

function scroll(){
   if(parseInt(document.getElementById("scrollcontent").style.left)<=-(parseInt(document.getElementById("scrollcontent").offsetWidth))) {
     document.getElementById("scrollcontent").style.left=scrollframe_width;
   }
   document.getElementById("scrollcontent").style.left=parseInt(document.getElementById("scrollcontent").style.left)-(2*move)+"px";
}

function show(id1,id2,id3) {
  var d = document.getElementById(id1);
  var e = document.getElementById(id2);
  var f = document.getElementById(id3);
  for (var i = 1; i<=10; i++) {
    if (document.getElementById('smenu'+i)) {
      document.getElementById('smenu'+i).style.visibility='hidden';
    }
    if (document.getElementById('t1menu'+i)) {
      document.getElementById('t1menu'+i).style.visibility='hidden';
    }
    if (document.getElementById('t2menu'+i)) {
      document.getElementById('t2menu'+i).style.visibility='hidden';
    }
  }
  if(id1=='') {
  for (var i = 1; i<=2; i++) {
    if (document.getElementById('sb_'+i)) {
      document.getElementById('sb_'+i).style.visibility='hidden';
    }
  }
  }
  if (d) {
    d.style.visibility='visible';
  }
  if (e) {
    e.style.visibility='visible';
  }
  if (f) {
    f.style.visibility='visible';
  }
}

function subshow(id1) {
  var d = document.getElementById(id1);
  for (var i = 1; i<=2; i++) {
    if (document.getElementById('sb_'+i)) {
      document.getElementById('sb_'+i).style.visibility='hidden';
    }
  }
  if (d) {
    d.style.visibility='visible';
  }
}

function submitform(a) {
  if(document.suchform.onsubmit())  {
    document.suchform.submit();
  }
}

var imgwindow;
function showimage(bid,w,h) {
  if(imgwindow)
  if(imgwindow.closed==false) {
    imgwindow.close();
  }
  features ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'
  window_top = 10
  window_left = 10
  imgwindow=window.open('index.php?c=img&b='+bid+'','img_window','width='+w+',height='+h+',top='+window_top+',left='+window_left+',features='+features+'');
  imgwindow.focus();
}