// JavaScript Document

<!--
var req;
var dumplayer;
var opacnu;
var dofade;
var myimage=new Image();
var mydiv=document.createElement('div');

function pausecomp(millis) {
  var date = new Date();
  var curDate = null;

  do { curDate = new Date(); } 
  while(curDate-date < millis);
} 

function getHTML(which,url) {
   var realurl = url;
   dumplayer=which;
   Stamp = new Date();

   if(url.indexOf('?')==-1) {
	    url+='?'+Stamp;
   } else { url+='&'+Stamp; }
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
   }

   req.open("GET", url, false);
   req.send(null);
   if(which!=null) {
     document.getElementById(which).innerHTML=req.responseText;
	 //now check for shadow and set it again
	 var v=document.getElementById('shadow_'+which);
	 if(v) {
	   var w=document.getElementById(which);
	   v.style.width=parseInt(w.offsetWidth);
	   v.style.height=parseInt(w.offsetHeight);
	 }
   } else { return req.responseText; }
}

function validate(url,which,wait) {
   var realurl = url;
   dumplayer=which;
   Stamp = new Date();

   if(url.indexOf('?')!=-1) {
	   url=url+'&'+Stamp;
   } else {
	   url=url+'?'+Stamp;
   }
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
   }

   if(wait==1) {
     req.open("GET", url, false);
   } else { 
     req.onreadystatechange = callback;
     req.open("GET", url, true);
  }
  req.send(null);
  if(wait==1) { return req.responseText; }
   
}

function validatePOST(url,which,wait) {
   var realurl = url;
   dumplayer=which;
   Stamp = new Date();

   if(url.indexOf('?')!=-1) {
	   url=url+'&'+Stamp;
   } else {
	   url=url+'?'+Stamp;
   }
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
   }
   if(wait==1) {
     req.open("POST", url, false);
   } else { 
     req.onreadystatechange = callback;
     req.open("POST", url, true);
  }
  req.send(null);
  if(wait==1) { return req.responseText; }
   
}

function callback() {
	if (req.readyState == 4) {
        if (req.status == 200) {
            parseMessage();
        }
    }
}

function parseMessage() {
  var message = req.responseText;
  if(dumplayer!=null) { setMessage(message); }
}

function setMessage(message) {
    mdiv = document.getElementById(dumplayer);
	mdiv.innerHTML = message;
	if(dofade==1) { dofadeoutin(layer,'',100,'fadein'); }
}

function dofadeoutin(which,url,opac,func) {
  layer=which;
  tmpurl=url;
  tmpfunc=func;
  opacnu=opac;
  
  document.getElementById('fader').style.top=document.getElementById(layer).offsetTop;
  document.getElementById('fader').style.left=document.getElementById(layer).offsetLeft;
  document.getElementById('fader').style.width=document.getElementById(layer).offsetWidth;
  document.getElementById('fader').style.height=document.getElementById(layer).offsetHeight;
  if(document.getElementById('fader').style.visibility=='hidden') { document.getElementById('fader').style.visibility='visible'; }

  if(tmpfunc=='fadeout') {
	if(opacnu<=100) {
	  opacnu=opacnu+5;
	  setTimeout("dofadeoutin('"+layer+"','"+url+"',"+opacnu+",'"+tmpfunc+"')",20);
	} else { dofade=1; validate(tmpurl,layer); }
  }
  if(tmpfunc=='fadein') {
	if(opacnu>=0) {
	  opacnu=opacnu-5;
	  setTimeout("dofadeoutin('"+layer+"','"+url+"',"+opacnu+",'"+tmpfunc+"')",20);
	} else { document.getElementById('fader').style.visibility='hidden'; }
  }
  var object = document.getElementById('fader').style; 
  object.opacity = (opac / 100);
  object.MozOpacity = (opac / 100);
  object.KhtmlOpacity = (opac / 100);
  object.filter = "alpha(opacity=" + opac + ")";

}

function fadeoutin(which,url,fadein) {
  layer=which;
  tmpurl=url;
  if(fadein==1) {
	dofade=1;  
    validate(tmpurl,layer);
  } else {
    dofadeoutin(layer,tmpurl,0,'fadeout');
  }
}

function showcontent(which,url) {
  var myDate=new Date();
  layer=which;
  tmpurl=url+'&tmpvar='+myDate;
  validate(tmpurl,layer,1);
}

function openlayer(which,maxhoogte) {
  var w=document.getElementById(which);
  var hoogte=parseInt(w.style.height);
  layer=which;
  max_hoogte=maxhoogte;
  if(hoogte<maxhoogte-10) {
	  w.style.height=hoogte+10;
	  setTimeout("openlayer(layer,max_hoogte)",1);
  } else { w.style.height=maxhoogte; }

}

function closelayer(which) {
  var w=document.getElementById(which);
  var hoogte=parseInt(w.style.height);
  layer=which;
  if(hoogte>10) {
	  w.style.height=hoogte-10;
	  setTimeout("closelayer(layer)",1);
  } else { w.style.height=0; w.style.visibility='hidden';}
}

function showpanel(event,which,shadow,trapmouse,settransparent,alignment,openslow,showmodal) {
  var w=document.getElementById(which);
  ref=w.parentNode;
  offset=0;
  
  //opera Netscape 6 Netscape 4x Mozilla 
  if (window.innerWidth || window.innerHeight){ 
    sw = window.innerWidth; 
    sh = window.innerHeight; 
  } 
  //IE Mozilla 
  if (document.body.clientWidth || document.body.clientHeight){ 
    sw = document.body.clientWidth; 
    sh = document.body.clientHeight; 
  } 
	  
//alignment 1=left,2=top,3=left,top,4=center screen
  if(trapmouse==1) {
	CurrentX=event.clientX;
	CurrentY=event.clientY;
	if(ref.id!='') {
	  CurrentX=CurrentX-parseInt(ref.style.left);
//	  CurrentY=CurrentY-parseInt(ref.style.top);
	}
	if (document.documentElement && document.documentElement.scrollTop) { var scrolltop = document.documentElement.scrollTop; }
	else if (document.body) { var scrolltop = document.body.scrollTop; }
	
	if(document.getElementById('maindiv')) { scrolltop=document.getElementById('maindiv').scrollTop; }
	if(ref.id!='') { offset=parseInt(document.getElementById(ref.id).offsetTop); }
	
	if(alignment==1) { //only left
	  NewX=parseInt(CurrentX)-parseInt(w.offsetWidth);
	  NewY=parseInt(CurrentY)+parseInt(scrolltop)+5;
	} 
	else if(alignment==2) { //only top
	  NewX=parseInt(CurrentX)+10;	
	  NewY=parseInt(CurrentY)+parseInt(scrolltop)-parseInt(w.offsetHeight);
	}
	else if(alignment==3) {
	  NewX=parseInt(CurrentX)-parseInt(w.offsetWidth);
	  NewY=parseInt(CurrentY)-parseInt(scrolltop)-parseInt(w.offsetHeight);
	} else {
	  NewX=parseInt(CurrentX)+10;
	  NewY=parseInt(CurrentY)+parseInt(scrolltop)+5;
	}
  } else {
	if(alignment==4) {
	  ScrollTop=document.body.scrollTop;
      NewX=(sw/2)-(w.offsetWidth/2);
      NewY=(sh/2)-(w.offsetHeight/2)+ScrollTop;//-offset;
	} else {
	  NewX=parseInt(w.style.left);
	  NewY=parseInt(w.style.top);
	}
  }
  Breedte= parseInt(w.offsetWidth);	
  Hoogte= parseInt(w.offsetHeight);

  NewY=NewY-offset;
  w.style.left=NewX+'px';
  w.style.top=NewY+'px';
  
  if(settransparent==1) {
	if(typeof w.style.opacity != 'undefined') {
	  w.style.opacity = 90/100;
	} 
	else if(typeof w.style.filter != 'undefined') {	
	  if(w.style.filter.indexOf("alpha")== -1) {
		var existingfilters="";
		if(w.style.filter) {
		  existingfilters = w.style.filter+" ";
		}  
		w.style.filter = existingfilters+"alpha(opacity="+90+")";
	  }	
	}	
  }
  if(openslow==1) { w.style.height=0; } //else { w.style.height=w.offsetHeight; }
  w.style.visibility='visible';
  
  if(openslow==1) {
	hoogte=w.offsetHeight;
	openlayer(which,hoogte);
  }
  
  if(showmodal==1) {
	var v=document.createElement('div');
	if(ref.id!='') { document.getElementById(ref.id).appendChild(v); }
	else { document.body.appendChild(v); }
    v.id='modal_'+which;
    v.style.display='block';
	v.style.position='absolute';
	v.style.background='#000000';
	v.style.visibilty='visible';
	v.style.zIndex='9';
	
	v.style.left='0px';
	v.style.top='0px';
	v.style.width=sw+'px';
	v.style.height=document.body.scrollHeight+'px';
	if(typeof v.style.opacity != 'undefined') {
      v.style.opacity = 40/100;
    } 
    else if(typeof v.style.filter != 'undefined') {	
      if(v.style.filter.indexOf("alpha")== -1) {
        var existingfilters="";
	    if(v.style.filter) {
	      existingfilters = v.style.filter+" ";
	    }  
	    v.style.filter = existingfilters+"alpha(opacity="+40+")";
      }	
    }	
  }	

  if(shadow==1) {
	if(!document.getElementById('shadow_'+which)) {
		var v=document.createElement('div');
		if(ref.id!='') { document.getElementById(ref.id).appendChild(v); }
		else { document.body.appendChild(v); }
		v.id='shadow_'+which;
		v.style.position='absolute';
		v.style.background='#000000';
		v.style.zIndex='9';

		v.style.left=NewX+4+'px';
		v.style.top=NewY+4+'px';
		v.style.width=Breedte+'px';
		v.style.height=Hoogte+'px';
		if(typeof v.style.opacity != 'undefined') {
			v.style.opacity = 40/100;
		} 
		else if(typeof v.style.filter != 'undefined') {	
			if(v.style.filter.indexOf("alpha")== -1) {
				var existingfilters="";
				if(v.style.filter) {
					existingfilters = v.style.filter+" ";
				}  
				v.style.filter = existingfilters+"alpha(opacity="+40+")";
			}	
		}	
		v.style.visibility='visible';
	}
  }	
}

function repositiondiv(event,which,parent) {
  var w=document.getElementById(which);
  offset=0;
  if(parent!=null && parent!="") {
    var x=document.getElementById(parent);
	if(x!=null) {
	  var sw = parseInt(x.offsetWidth);
	  var sh = parseInt(x.offsetHeight);
	}
  } else { 
    if(window.innerWidth || window.innerHeight){ 
	  sw = window.innerWidth; 
	  sh = window.innerHeight; 
    }
    //IE Mozilla 
    if(document.body.clientWidth || document.body.clientHeight){ 
	  sw = document.body.clientWidth; 
	  sh = document.body.clientHeight; 
    }
  }

  NewX=(sw/2)-(w.offsetWidth/2);
  NewY=(sh/2)-(w.offsetHeight/2);//-offset;
  if(NewX<0) { NewX=0; }
  if(NewY<0) { NewY=0; }
//  if(parent!=null && parent!="") {
//    var x=document.getElementById(parent);
    if(x!=null) {
      NewX+=parseInt(x.offsetLeft);
	  NewY+=parseInt(x.offsetTop);
    }
//  }
  Breedte= parseInt(w.offsetWidth);	
  Hoogte= parseInt(w.offsetHeight);

  NewY=NewY-offset;
  w.style.left=NewX+'px';
  w.style.top=NewY+'px';
  
  if(document.getElementById('shadow_'+which)) {
    var v=document.getElementById('shadow_'+which);
    v.style.position='absolute';
	v.style.background='#000000';
	v.style.zIndex='9';

	v.style.left=NewX+4+'px';
	v.style.top=NewY+4+'px';
	v.style.width=Breedte+'px';
	v.style.height=Hoogte+'px';
	v.style.visibility='visible';
  }
}

function hidepanel(which,closeslow) {
  var w=document.getElementById(which);
  var v=document.getElementById('modal_'+which);
  if(v!=null) {
    v.style.visibility='hidden';
  	ref=w.parentNode;
	if(ref.id!='') { document.getElementById(ref.id).removeChild(v); }
	else { document.body.removeChild(v); }
  }

  var v=document.getElementById('shadow_'+which);
  if(v!=null) {
    v.style.visibility='hidden';
  	ref=w.parentNode;
	if(ref.id!='') { document.getElementById(ref.id).removeChild(v); }
	else { document.body.removeChild(v); }
  }
  if(closeslow==1) {
	  closelayer(which);
  } else { w.style.visibility='hidden'; }

}

function showdivpopup(divname,divtext,showmodal,offset) {
  //opera Netscape 6 Netscape 4x Mozilla 
  if (window.innerWidth || window.innerHeight){ 
    sw = window.innerWidth; 
    sh = window.innerHeight; 
  } 
  //IE Mozilla 
  if (document.body.clientWidth || document.body.clientHeight){ 
    sw = document.body.clientWidth; 
    sh = document.body.clientHeight; 
  } 
  
  if(showmodal==1) {
	var v=document.createElement('div');
	document.body.appendChild(v);
    v.id='shadow_'+divname;
    v.style.display='block';
	v.style.position='absolute';
	v.style.background='#000000';
	v.style.visibilty='visible';
	v.style.zIndex='9';
	
	v.style.left='0px';
	v.style.top='0px';
	v.style.width=sw+'px';
	v.style.height=sh+'px';
    if(typeof v.style.opacity != 'undefined') {
      v.style.opacity = 40/100;
    } 
    else if(typeof v.style.filter != 'undefined') {	
      if(v.style.filter.indexOf("alpha")== -1) {
        var existingfilters="";
	    if(v.style.filter) {
	      existingfilters = v.style.filter+" ";
	    }  
	    v.style.filter = existingfilters+"alpha(opacity="+40+")";
      }	
    }	
	//v.style.visibility='visible';
  }	

  var w=document.createElement('div');
  document.body.appendChild(w);
  w.id=divname;
  w.style.position='absolute';
  w.style.background='#FFCC00';
  w.style.border='1px solid #000000';
  w.style.padding='5px';
  w.innerHTML=divtext;
  w.style.zIndex='10';
  
  posX=(sw/2)-(w.offsetWidth/2);
  posY=(sh/2)-(w.offsetHeight/2);//-offset;
  w.style.left=posX+'px';
  w.style.top=posY+'px';
  w.style.visibility='visible';

}

function removedivpopup(which) {
  var w=document.getElementById(which);
  var v=document.getElementById('shadow_'+which);
  if(w!=null) {
    document.body.removeChild(w);
	document.body.removeChild(v);
  }
}

function settext(which,tekst) {
  var w=document.getElementById(which);
  w.innerHTML=tekst;
}

function setimage(which,image) {
  var w=document.getElementById(which);
  w.innerHTML='<img src="'+image+'" border="0" width="640">';
}
function setpopuptext(which,header,tekst) {
  var w=document.getElementById(which);
  newtekst='<table width=250 cellpadding=0 cellspacing=0 border=0 class=sitetekst>';
  newtekst+='<tr><td bgcolor=#666666 align=center><font color=#ffffff><b>'+header+'</b></font></td></tr>';
  newtekst+='<tr><td style=padding:5px>'+tekst+'</td></tr></table>';
  
  w.innerHTML=newtekst;
}

function Popup(source,width,height,resizable,windowname) {
  if(width) { WindowWidth=width; } else { WindowWidth=640; }
  if(height) { WindowHeight=height; } else { WindowHeight=480; }
  var MiddleX=(screen.width/2)-(WindowWidth/2);
  var MiddleY=(screen.height/2)-(WindowHeight/2);
  if(resizable==1) { resizable='yes'; } else { resizable='no'; }
  if(screen.width<WindowWidth || screen.height<WindowHeight) { resizable='yes'; }
  if(windowname=='') { windowname='details'; }
  window.open(source,windowname,'width='+WindowWidth+',height='+WindowHeight+',top='+MiddleY+',left='+MiddleX+',resizable='+resizable);
}

function CheckKey(e,which,end) {
  var w=document.getElementById(which);
  var keynum;
  var keychar;

  if(window.event) { keynum = e.keyCode; }
  else if(e.which) { keynum = e.which; }
  keychar = String.fromCharCode(keynum);
  if(end==1) {
	if(keychar=='+' || keynum==13) { w.Addbutton.click(); return false; }
  }
  if((keychar>='0' && keychar<='9') || keychar=='.' || keychar=='-') {
    return true;
  } else { return false; }
}

function CheckNumeric(e,decimals) {
  var keynum;
  var keychar;

  if(window.event) { keynum = e.keyCode; }
  else if(e.which) { keynum = e.which; }
  keychar = String.fromCharCode(keynum);
  if(decimals) {
	if(keychar>='0' && keychar<='9' || keychar=='.' || keychar=='-') {
      return true;
    } else { return false; }
  } else {
    if(keychar>='0' && keychar<='9' || keychar=='-') {
      return true;
    } else { return false; }
  }
}

function PostData(which,url,form) {
	var v=document.getElementById(form);
	postdata="";
	if(v!=null) {
		elems=v.elements;
		for(var x=0; x<elems.length; x++) {
		  if(elems[x].type=="checkbox") {
		    if(elems[x].checked) { postdata+=elems[x].name+"="+elems[x].value+'&'; }
		  }
		  else if(elems[x].type=="select-one") {
	        postdata+=elems[x].name+"="+elems[x].value+'&';
		  }
		  else if(elems[x].type=="radio") {
			if(elems[x].checked) { postdata+=elems[x].name+"="+elems[x].value+'&'; }
		  }
		  else { postdata+=elems[x].name+"="+elems[x].value+'&'; } 
		}
	}

	if(url.indexOf('?')!=-1) {
		url+="&"+postdata;
	} else { url+="?"+postdata; }
	validate(url,null,1);
	
}

function SetMenuPos(event,which,menu,direction) {
	var v=document.getElementById(menu);
	document.body.appendChild(v);
  	var img=which;
	var imageLeft=0;
	var imageTop=0;
	while (img!= null)
	{
		imageLeft+= img.offsetLeft;
		imageTop+= img.offsetTop;
		img = img.offsetParent;
	}
	if(direction=='vertical') { 
		imageLeft+=which.offsetWidth; 
	} else { imageTop+=which.offsetHeight; }
	//set menu x,y
	v.style.left=imageLeft+'px';
	v.style.top=imageTop+'px';
	
}

function doimagefadeoutin(which,image,opac,func,color) {
  if(mydiv.style.width!=document.getElementById(which).width) {
    //ok let's init the overlay div
	document.body.appendChild(mydiv);
	if(color) { mydiv.style.background=color; }
	mydiv.style.width=document.getElementById(which).width;
	mydiv.style.height=document.getElementById(which).height;
	mydiv.style.position="absolute";
	mydiv.style.visibility="visible";
	var imageLeft=0;
    var imageTop=0;
	img=document.getElementById(which);
    while (img!= null)
    {
      imageLeft+= img.offsetLeft;
      imageTop+= img.offsetTop;
      img = img.offsetParent;
    }
	mydiv.style.left=parseInt(imageLeft)+2;
	mydiv.style.top=parseInt(imageTop)+2;
	mydiv.style.zIndex=10;
    var object = mydiv.style; //document.getElementById(which).style; 
    mydiv.style.opacity = (opac / 100);
    mydiv.style.MozOpacity = (opac / 100);
    mydiv.style.KhtmlOpacity = (opac / 100);
    mydiv.style.filter = "alpha(opacity=" + opac + ")";
  }

  if(func=='fadein') {
	if(opac>0) {
	  opac-=5;
	  setTimeout("doimagefadeoutin('"+which+"','"+image+"',"+opac+",'fadein')",100);
	}
  }
  if(func=='fadeout') {
	if(opac<100) {
	  opac+=5;
	  setTimeout("doimagefadeoutin('"+which+"','"+image+"',"+opac+",'fadeout')",100);
	} else {
	  document.getElementById(which).src=image;
	  opac=100;
	  doimagefadeoutin(which,image,opac,'fadein');
	}
  }
  var object = mydiv.style; //document.getElementById(which).style; 
  object.opacity = (opac / 100);
  object.MozOpacity = (opac / 100);
  object.KhtmlOpacity = (opac / 100);
  object.filter = "alpha(opacity=" + opac + ")";
}

function doimagemorph(which,image,lastimage,opac,func) {
	if(mydiv.style.width!=document.getElementById(which).width) {
		//ok let's init the overlay div
		document.body.appendChild(mydiv);
		if(lastimage) { mydiv.style.background='url('+lastimage+')'; }
		mydiv.style.width=document.getElementById(which).width+'px';
		mydiv.style.height=document.getElementById(which).height+'px';
		mydiv.style.position="absolute";
		mydiv.style.visibility="visible";
		var imageLeft=0;
		var imageTop=0;
		img=document.getElementById(which);
		while (img!= null)
		{
			imageLeft+= img.offsetLeft;
			imageTop+= img.offsetTop;
			img = img.offsetParent;
		}
		mydiv.style.left=parseInt(imageLeft)+'px';
		mydiv.style.top=parseInt(imageTop)+'px';
		mydiv.style.zIndex=10;
		var object = mydiv.style; //document.getElementById(which).style; 
		mydiv.style.opacity = (opac / 100);
		mydiv.style.MozOpacity = (opac / 100);
		mydiv.style.KhtmlOpacity = (opac / 100);
		mydiv.style.filter = "alpha(opacity=" + opac + ")";
	}

	if(func=='fadein') {
		if(opac>0) {
			opac-=5;
			setTimeout("doimagemorph('"+which+"','"+image+"','"+lastimage+"',"+opac+",'fadein')",100);
		}
	}
	if(func=='fadeout') {
		if(opac<100) {
			opac+=5;
			setTimeout("doimagemorph('"+which+"','"+image+"','"+lastimage+"',"+opac+",'fadeout')",100);
		} else {
			document.getElementById(which).src=image;
			opac=100;
			doimagemorph(which,image,lastimage,opac,'fadein');
		}
	}
	var object = mydiv.style; //document.getElementById(which).style; 
	object.opacity = (opac / 100);
	object.MozOpacity = (opac / 100);
	object.KhtmlOpacity = (opac / 100);
	object.filter = "alpha(opacity=" + opac + ")";
}

function doimageflip(which,image,pos,func) {
	if(document.getElementById(which).style.width) {
		widthnu=parseInt(document.getElementById(which).style.width);
		heightnu=parseInt(document.getElementById(which).style.height);
	} else { 
		widthnu=parseInt(document.getElementById(which).offsetWidth);
		heightnu=parseInt(document.getElementById(which).offsetHeight);
	}
	if(func=='flip') {
		if(widthnu>=15) {
			widthnu-=15;
			setTimeout("doimageflip('"+which+"','"+image+"',"+pos+",'flip')",100);
		} else {
			document.getElementById(which).style.width=0+'px';
			myimage.src=image;
			document.getElementById(which).src=image;
			document.getElementById(which).height=myimage.height;
			heightnu=myimage.height;
			setTimeout("doimageflip('"+which+"','"+image+"',"+pos+",'grow')",100);
		}
		if(widthnu>=0) { document.getElementById(which).style.width=widthnu; document.getElementById(which).style.height=heightnu; }
	}
	if(func=='grow') {
		if(widthnu<parseInt(myimage.width)) {
			widthnu+=15;
			setTimeout("doimageflip('"+which+"','"+image+"',"+pos+",'grow')",100);
		} else {
			document.getElementById(which).style.width=myimage.width;
		}
		if(widthnu>=0) { document.getElementById(which).style.width=widthnu; }
	}
}

function doimageslide(holder,which,image,pos,func) {
	layer=which;
	tmpimg=image
	tmpfunc=func;
	posnu=pos;
  
	if(document.getElementById(holder).style.width) {
		widthnu=parseInt(document.getElementById(holder).style.width);
		heightnu=parseInt(document.getElementById(holder).style.height);
		leftnu=parseInt(document.getElementById(holder).style.left);
	} else { 
		widthnu=parseInt(document.getElementById(holder).offsetWidth);
		heightnu=parseInt(document.getElementById(holder).offsetHeight);
		leftnu=parseInt(document.getElementById(holder).offsetLeft);
		leftnu=0;
	}
	if(tmpfunc=='left' || tmpfunc=='leftshrink') {
	//    document.getElementById(holder).style.textalign="right";
		if(widthnu>=15) {
			widthnu-=15;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'leftshrink')",100);
		} else {
			document.getElementById(holder).style.width=0+'px';
			myimage.src=image;
			document.getElementById(which).src=image;
			document.getElementById(which).height=myimage.height;
			heightnu=myimage.height;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'leftgrow')",100);
		}
		if(widthnu>=0) { document.getElementById(holder).style.width=widthnu; document.getElementById(holder).style.height=heightnu; }
	}
	if(tmpfunc=='leftgrow') {
	//if(widthnu<parseInt(document.getElementById(which).offsetWidth)) {
	
		if(widthnu<parseInt(myimage.width)) {
			widthnu+=15;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'leftgrow')",100);
		} else {
			document.getElementById(holder).style.width=document.getElementById(which).offsetWidth;
		}
		if(widthnu>=0) { document.getElementById(holder).style.width=widthnu; }
	}
	if(tmpfunc=='right' || tmpfunc=='rightshrink') {
		if(widthnu>=15) {
			widthnu-=15;
			leftnu+=15;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'rightshrink')",100);
		} else {
			document.getElementById(holder).style.width=0+'px';
			document.getElementById(which).src=image;
			document.getElementById(which).height=myimage.height;
			heightnu=myimage.height;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'rightgrow')",100);
		}
		if(widthnu>=0) { document.getElementById(holder).style.width=widthnu; document.getElementById(holder).style.left=leftnu; }
	}
	if(tmpfunc=='rightgrow') {
		if(widthnu<parseInt(document.getElementById(which).offsetWidth)) {
			widthnu+=15;
			leftnu-=15;
			setTimeout("doimageslide('"+holder+"','"+which+"','"+image+"',"+posnu+",'rightgrow')",100);
		} else {
			document.getElementById(holder).style.width=document.getElementById(which).offsetWidth;
		}
		if(widthnu>=0) { document.getElementById(holder).style.width=widthnu; document.getElementById(holder).style.left=leftnu; }
	}
}

var timeout	= 100;
var closetimer	= 0;
var lastmenuitem	= new Array();
var timers = new Array();

// open hidden layer
function menuopen(ev,id,shadow,direction,slow)
{	
	// cancel close timer
	menucancelclosetime(id);

	// close old layer
	/*if(lastmenuitem.length>0) {
			for(var i=0; i<lastmenuitem.length; i++) {
				hidepanel(lastmenuitem[i],slow);
			}
			lastmenuitem.length=0;
	}*/
	// get new layer and show it
	ev = ev || window.event;
	var srcEl = ev.srcElement? ev.srcElement : ev.target;
	SetMenuPos(ev,srcEl,id,direction);
	lastmenuitem[id] = id;
	showpanel(ev,id,shadow,0,0,0,slow,0);
}
// close showed layer
function menuclose(itemid)
{
	if(lastmenuitem[itemid]) {
			/*for(var i=0; i<lastmenuitem.length; i++) {
				hidepanel(lastmenuitem[i]);
			}
			lastmenuitem.length=0; */
		hidepanel(lastmenuitem[itemid]);
		lastmenuitem[itemid]=null;
	}
}

// go close timer
function menuclosetime(itemid)
{
	closetimer = window.setTimeout('menuclose('+itemid+')', timeout);
	timers[itemid]=closetimer;	
}

// cancel close timer
function menucancelclosetime(itemid)
{
	window.clearTimeout(timers[itemid]);
	timers[itemid]=null;
	//timers.length--;
	/*for (var i= 0;i < timers.length; i++) {        
		window.clearTimeout(timers[i]);      
	}      
	timers = new Array();*/

/*	if(closetimer)
	{
		clearTimeout(closetimer);
		closetimer = 0;
	}*/
}

function menucancelclosetimeall()
{
	for (var i= 0;i < timers.length; i++) {        
		window.clearTimeout(timers[i]);      
	}      
	timers = new Array();

/*	if(closetimer)
	{
		clearTimeout(closetimer);
		closetimer = 0;
	}*/
}

// close layer when click-out
document.onclick = menuclose; 


-->
