function initall() {
	initMouse();

}
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}

browserr = new BrowserCheck()
//var flagopen[i]=0;
var xOld,yOld;
xOld=0;yOld=0;
var eldrag=null;



function initMouse() {
	document.onmousedown = mouseDown
	document.onmousemove = mouseMove
	document.onmouseup = mouseUp
	if (browserr.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
function mouseDown(e) {
	if ((browserr.ns && e.which!=1) || (browserr.ie && event.button!=1)) return true
	var x = (browserr.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (browserr.ns)? e.pageY : event.y+document.body.scrollTop
	if (browserr.ns && e.target!=document) routeEvent(e)

	return DownMouse(x,y)
}
function mouseMove(e) {
	var x = (browserr.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (browserr.ns)? e.pageY : event.y+document.body.scrollTop
	if (browserr.ns && e.target!=document) routeEvent(e)
	
	return MoveMouse(x,y)
}
function mouseUp(e) {
	var x = (browserr.ns)? e.pageX : event.x+document.body.scrollLeft
	var y = (browserr.ns)? e.pageY : event.y+document.body.scrollTop
	if (browserr.ns && e.target!=document) routeEvent(e)
	
	 return UpMouse(x,y)
}







function topf(divname) {
var fts1;
	if(document.all){
	fts1=document.all[divname].style.posTop;
	}
	if(document.layers){
	fts1=document.layers[divname].top;
	}

return fts1
}

function botf(divname) {
var fts1;
	if(document.all){
	fts1=document.all[divname].style.posTop+document.all[divname].scrollHeight;
	}
	if(document.layers){
	fts1=document.layers[divname].top+document.layers[divname].document.height;
	}

return fts1
}

function leftf(divname) {
var fts1;
	if(document.all){
	fts1=document.all[divname].style.posLeft;
	}
	if(document.layers){
	fts1=document.layers[divname].left;
	}

return fts1
}

function rightf(divname) {
var fts1;
	if(document.all){
	fts1=document.all[divname].style.posLeft+document.all[divname].scrollWidth;
	}
	if(document.layers){
	fts1=document.layers[divname].left+document.layers[divname].document.width;
	}

return fts1
}




function MoveMouse(x,y) {
if(document.layers){
	notopen=0;
	for(i=0;i<nmenu;i++){	if(flagopen[i]==1){notopen=1;}	}

	for(i=0;i<nmenu;i++){

if(y>=topf(('opendiv0')) && y<=botf(('opendiv'+(nmenu-1))) && x>=leftf(('opendiv'+i)) && x<=rightf(('opendiv'+i))  && flagopen[i]==0 && notopen==0){flagopen[i]=1;}

if(flagopen[i]==1){

if(y>=topf(('opendiv0')) && y<=botf(('opendiv'+(nmenu-1))) && x>=leftf(('opendiv'+i)) && x<=rightf(('opendiv'+i)))
	{	
	//document.layers[('opendiv'+i+'cont')].visibility='show';
	//show0(('arrow'+i),'im1',i);
	}
else if(y>=topf(('opendiv'+i+'cont')) && y<=botf(('opendiv'+i+'cont')) && x>=leftf(('opendiv'+i+'cont')) && x<=rightf(('opendiv'+i+'cont')))
	{	
	//document.layers[('opendiv'+i+'cont')].visibility='show';
	//show0(('arrow'+i),'im1',i);
	}
else{flagopen[i]=0;}
}

//if(flagopen[i]==1 && document.all){
//show0(('arrow'+i),'im1',i);
//}


if(flagopen[i]==0){

	
	document.layers[('opendiv'+i+'cont')].visibility='hide'
	show0(('arrow'+i),'im0',i);

//
}
}

}
	return true
	
	

}

function DownMouse(x,y) {
	for(i=0;i<nmenu;i++){
if(document.layers){
//if(y>=topf(('opendiv'+i)) && y<=botf(('opendiv'+i)) && x>=leftf(('opendiv'+i)) && x<=rightf(('opendiv'+i))  && flagopen[i]==0){flagopen[i]=1;}
//else if(y>=topf(('opendiv'+i)) && y<=botf(('opendiv'+i)) && x>=leftf(('opendiv'+i)) && x<=rightf(('opendiv'+i))  && flagopen[i]==1){flagopen[i]=0;}
}
}
	//document.form1.text2.value="down "+y+','+x+',flagopen='+flagopen[0];


	
	return true
	
	
}

function setflag(num) {
if(document.all){
for(i=0;i<nmenu;i++){
if(num==i)
{

flagopen[i]=1;

//if(document.all[('ttt')]!=null){alert(document.all[('ttt')])}
if(document.all[('opendiv'+i+'cont')]!=null && document.all['opendiv0dop']!=null){
document.all[('opendiv'+i+'cont')].style.visibility='visible';
show0(('arrow'+i),'im1',i);
document.all['opendiv0dop'].style.zIndex=0;
}
}
else{
flagopen[i]=0;


if(document.all[('opendiv'+i+'cont')]!=null){
	document.all[('opendiv'+i+'cont')].style.visibility='hidden';
	show0(('arrow'+i),'im0',i);
}
	}
}
}
////////////////////////////


if(document.layers){
	for(i=0;i<nmenu;i++){
if(num==i)
{
flagopen[i]=1;

document.layers[('opendiv'+i+'cont')].visibility='show';
show0(('arrow'+i),'im1',i);
}
else{
flagopen[i]=0;
}
//////////////////////////////////
}
}


}

function setflag0() {
for(i=0;i<nmenu;i++){flagopen[i]=0;
if(document.images[('arrow'+i)]!=null && document.all[('opendiv'+i+'cont')]!=null){
show0(('arrow'+i),'im0',i);
document.all[('opendiv'+i+'cont')].style.visibility='hidden';
}
}
//alert(1);
document.all[('opendiv0dop')].style.zIndex=-1;
}

function UpMouse(x,y) {

	///////////////////////
	//document.form1.text3.value=x+','+y;
	return true
	
	
}


function dopdiv() {
if(document.all){
	//for(i=0;i<nmenu;i++){
	i=0;
var nndopdiv;
var divheight=document.all[('opendiv'+i)].scrollHeight+20+document.all[(('opendiv'+i)+'cont')].scrollHeight;
nndopdiv='<div id="'+
('opendiv'+i)+
'dop" style="z-index:0;position:absolute;visibility:visible;left:'+
(0)+
';top:'+
(document.all[('opendiv0')].style.posTop-10)+
';width:'+
411+
';height:'+
210+
';cursor:arrow;" onmouseover="setflag0()"><img src="/img/general/pixels/t_pixel.gif" border=0 width='+
411+
' height='+
210+
'><br>'+
'</div>';

document.write(nndopdiv);
	//}
}

}

function dopdiv2() {
if(document.all){
	for(i=0;i<nmenu;i++){
var nndopdiv;
var divheight=document.all[('opendiv'+i)].scrollHeight+20+document.all[(('opendiv'+i)+'cont')].scrollHeight;
nndopdiv='<div id="opendiv0dop" style="z-index:-1;position:absolute;visibility:visible;left:0;top:'+
(document.all[('opendiv0')].style.posTop-10)+
';width:411;height:200;cursor:arrow;" onmouseover="setflag0()"><img src="/img/general/pixels/t_pixel.gif" border=0 width=411 height=140><br></div>';

document.write(nndopdiv);

//nndopdiv='<div id="opendiv1dop" //style="z-index:0;position:absolute;visibility:visible;left:140;top:260;width:245;height:27;cursor:arrow;" onmouseover="setflag0()"><img src="/img/general/pixels/t_pixel.gif" border=0 width=245 //height=27><br></div>';

//document.write(nndopdiv);

	}
}

}

/////////////////////////////////////////////////////////////////////////////////////

  function load(location){
    image=new Image();
    image.src=location;
    return image;
  }
  
  function show0(where,what,i){

	  if (document.images!=null){
if(document.all){document.images[where].src=eval(what+".src");}
if(document.layers){
document.layers[('opendiv'+i)].document.images[where].src=eval(what+".src");
}
	  }
}  
	 



