var Tout;

function show(id,num){
for(i=0;i<num;i++)
   {
   if(document.getElementById("t"+i)){
     document.getElementById("t"+i).style.display="none";}
   }
if(Tout!="") clearTimeout(Tout); 
  document.getElementById(id).style.display="block";
}

function hide(id){
 if(Tout!="") clearTimeout(Tout); 
   Tout=setTimeout('document.getElementById("'+id+'").style.display="none"',300);
 }
 
function expand(id){
   element = document.getElementById(id);
   element.style.display =(element.style.display=="block")?"none":"block";
 }

function showActiveMenu(id)
 {
 if(document.getElementById(id))
   document.getElementById(id).style.display="block"; 
 }
 
function lang(lang)
{
 var current=window.location.href;
 var new_loc;
 if(/lang=/.test(current))
   new_loc=current.replace(/lang=\w*/,"lang="+lang);
 else if(/\?/.test(current))
   new_loc=current+"&lang="+lang;
 else 
   new_loc=current+"?lang="+lang;  
 window.location.replace(new_loc);
}

 
 
function showPic(pic,width,height)
{ 
sDesrc = "width=" + width + ", height=" + height +
		", status=no, toolbar=no, menubar=no, scrollbars=no";
win=window.open("Gallery", "displayWindow", sDesrc);
win.document.write("<html><style>body{padding:0px;margin:0px;}</style><body>");
win.document.write("<img src='uploads/picgallery/"+pic+"' width='"+width+"' height='"+height+"'><br>");
win.document.write("</body></html>");
} 

function showMenu(id)
 {
 if(element=document.getElementById(id))
   {
   if(element.style.display!="block") element.style.display="block";
   else element.style.display="none";
   }
 }