var mMenuas    = new Array();
var misShow   = new Boolean(); 
misShow=false;
var misdown   = new Boolean();
misdown=false;
var mnumberofsub=0;
var musestatus=false;
var mpopTimer = 0;
mMenuacolor='#64C3F3';
mfontcolor='#ffffff';
mMenuaoutcolor='#E64000';
mMenuaincolor='#F00000';
mMenuaoutbordercolor='#000000';
mMenuainbordercolor='#000000';
mmidoutcolor='#000000';
mmidincolor='#000000';
mMenuaovercolor='#FFFFFF';
mitemedge='0';
msubedge='0';
mMenuaunitwidth=91;
mMenuaitemwidth=134;
mMenuaheight=0;
mMenuawidth='400';
mMenuaadjust=0;
mMenuaadjustV=0;
mfonts='font-family: ËÎÌå; font-size: 9pt; color: #ffffff; ';mcursor='hand';
var swipeSteps = 4;
var swipemsec = 25;
var swipeArray = new Array();
function swipe(el, dir, steps, msec) {
	if (steps == null) steps = swipeSteps;
	if (msec == null) msec = swipemsec;
	if (el.swipeIndex == null)
		el.swipeIndex = swipeArray.length;
	if (el.swipeTimer != null)
		window.clearTimeout(el.swipeTimer);
	swipeArray[el.swipeIndex] = el;
	el.style.clip = "rect(-99999, 99999, 99999, -99999)";
	if (el.swipeCounter == null || el.swipeCounter == 0) {
		el.orgLeft  = el.offsetLeft;
		el.orgTop  = el.offsetTop;
		el.orgWidth = el.offsetWidth;
		el.orgHeight  = el.offsetHeight;
	}
	el.swipeCounter = steps;
	el.style.clip = "rect(0,0,0,0)";
	window.setTimeout("repeat(" + dir + "," + el.swipeIndex + "," + steps + "," + msec + ")", msec);
}
function repeat(dir, index, steps, msec) {
	el = swipeArray[index];
	var left   = el.orgLeft;
	var top    = el.orgTop;
	var width  = el.orgWidth;
	var height = el.orgHeight;
	if (el.swipeCounter == 0) {
		el.style.clip = "rect(-99999, 99999, 99999, -99999)";
		return;
	}
	else {
		el.swipeCounter--;
		el.style.visibility = "visible";
		switch (dir) {
			case 2:
				el.style.clip = "rect(" + height*el.swipeCounter/steps + "," + width + "," + height + "," + 0 + ")";
				el.style.top  = top - height*el.swipeCounter/steps;
				break;
			case 8:
				el.style.clip = "rect(" + 0 + "," + width + "," + height*(steps-el.swipeCounter)/steps + "," + 0 + ")";
				el.style.top  = top + height*el.swipeCounter/steps;
				break;
			case 6:
				el.style.clip = "rect(" + 0 + "," + width + "," + height + "," + width*(el.swipeCounter)/steps + ")";
				el.style.left  = left - width*el.swipeCounter/steps;
				break;
			case 4:
				el.style.clip = "rect(" + 0 + "," + width*(swipeSteps - el.swipeCounter)/steps + "," + height + "," + 0 + ")";
				el.style.left  = left + width*el.swipeCounter/steps;
				break;
		}
		
		el.swipeTimer = window.setTimeout("repeat(" + dir + "," + index + "," + steps + "," + msec + ")", msec);
	}
}
var mtmpleft="";
var mtmptop="";
function hideSwipe(el) {
	window.clearTimeout(el.swipeTimer);
	el.style.visibility = "hidden";
	el.style.clip = "rect(-99999, 99999, 99999, -99999)";
	el.swipeCounter = 0;
	if(mtmpleft!="")el.style.left = mtmpleft;
	if(mtmptop!="")el.style.top = mtmptop;
}

function stoperror(){
return true;
}
window.onerror=stoperror;
function mpopOut() {
mpopTimer = setTimeout('mallhide()', 500);
}
function getReal(el, type, value) {
	temp = el;
	while ((temp != null) && (temp.tagName != "BODY")) {
		if (eval("temp." + type) == value) {
			el = temp;
			return el;
		}
		temp = temp.parentElement;
	}
	return el;
}


function mMenuaRegister(menu) 
{
  mMenuas[mMenuas.length] = menu
  return (mMenuas.length - 1)
}

function mMenuaItem(caption,command,target,isline,statustxt,level,img,sizex,sizey,pos){
	this.items = new Array();
	this.caption=caption;
	this.command=command;
	this.target=target;
	this.isline=isline;
	this.statustxt=statustxt;
	if(level!=null){mnumberofsub++;
	this.hasc=mnumberofsub;}
	this.level=level;
	this.img=img;
	this.sizex=sizex;
	this.sizey=sizey;
	this.pos=pos;
}

function mMenua(caption,command,target,img,sizex,sizey,pos){
	this.items = new Array();
	this.caption=caption;
	this.command=command;
	this.target=target;
	this.img=img;
	this.sizex=sizex;
	this.sizey=sizey;
	this.pos=pos;
	this.id=mMenuaRegister(this);
}
function mMenuaAddItem(item)
{
  this.items[this.items.length] = item
  item.parent = this.id;
  this.children=true;
}

mMenua.prototype.addItem = mMenuaAddItem;
mMenuaItem.prototype.addsubItem = mMenuaAddItem;

function mtoout(src){

src.style.borderLeftColor=mMenuaoutbordercolor;
src.style.borderRightColor=mMenuainbordercolor;
src.style.borderTopColor=mMenuaoutbordercolor;
src.style.borderBottomColor=mMenuainbordercolor;
src.style.backgroundColor=mMenuaoutcolor;
src.style.color=mMenuaovercolor;
}
function mtoin(src){

src.style.borderLeftColor=mMenuainbordercolor;
src.style.borderRightColor=mMenuaoutbordercolor;
src.style.borderTopColor=mMenuainbordercolor;
src.style.borderBottomColor=mMenuaoutbordercolor;
src.style.backgroundColor=mMenuaincolor;
src.style.color=mMenuaovercolor;
}
function mnochange(src){
src.style.borderLeftColor=mMenuacolor;
src.style.borderRightColor=mMenuacolor;
src.style.borderTopColor=mMenuacolor;
src.style.borderBottomColor=mMenuacolor;
src.style.backgroundColor='';
src.style.color=mfontcolor;

}
function mallhide(){
	for(var numMenua=0;numMenua<mMenuas.length;numMenua++){
		var themenu=document.all['mMenua'+numMenua]
		var themenudiv=document.all['mMenuadiv'+numMenua]
                mnochange(themenu);
                mMenuahide(themenudiv);
                }
        for(numMenua=1;numMenua<=mnumberofsub;numMenua++){  
        	var thesub=document.all['msubmenudiv'+numMenua]      
        	msubmenuhide(thesub);
        	mnochange(document.all['mp'+numMenua]);
        	document.all["mitem"+numMenua].style.color=mfontcolor;
        	}
}
function mMenuahide(menuid){

hideSwipe(menuid);
misShow=false;
}
function msubmenuhide(menuid){

menuid.style.visibility='hidden';
}
function mMenuashow(menuid,pid){

menuid.style.left=mposflag.offsetLeft+pid.offsetLeft+mMenuaadjust;menuid.style.top=mposflag.offsetTop+mMenuatable.offsetHeight+mMenuaadjustV+1;
if(mMenuaitemwidth+parseInt(menuid.style.left)>document.body.clientWidth+document.body.scrollLeft)
menuid.style.left=document.body.clientWidth+document.body.scrollLeft-mMenuaitemwidth;
mtmpleft=menuid.style.left;mtmptop=menuid.style.top;swipe(menuid,2,4);
misShow=true;
}
function mshowsubmenu(menuid,pid,rid){

menuid.style.left=pid.offsetWidth+rid.offsetLeft;
menuid.style.top=pid.offsetTop+rid.offsetTop-3;
if(mMenuaitemwidth+parseInt(menuid.style.left)>document.body.clientWidth+document.body.scrollLeft)
menuid.style.left=document.body.clientWidth+document.body.scrollLeft-mMenuaitemwidth;
menuid.style.visibility='visible';
}
function mMenua_over(menuid,x){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
if(x==0||x==7){
  misShow = false;
  mallhide();
  mtoout(eval("mMenua"+x));
}else{

  mallhide();
  mtoin(eval("mMenua"+x));
  mMenuashow(menuid,eval("mMenua"+x));

}
clearTimeout(mpopTimer);
}
function mMenua_out(x){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
if (misShow){
mtoin(eval("mMenua"+x));
}else{
mnochange(eval("mMenua"+x));
}
mpopOut()
}
function mMenua_down(menuid,x){
  if(misShow){
  mMenuahide(menuid);
  mtoout(eval("mMenua"+x));
  }
  else{
  mtoin(eval("mMenua"+x));
  mMenuashow(menuid,eval("mMenua"+x));
  misdown=true;
  }
}
function mMenua_up(){
  misdown=false;
}
function mMenuaitem_over(menuid,item,x,j,i){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
srcel = getReal(window.event.srcElement, "className", "coolButton");
        for(numMenua=1;numMenua<=mnumberofsub;numMenua++){  
        	var thesub=document.all['msubmenudiv'+numMenua] 
        	if(!(menuid==thesub||menuid.style.tag>=thesub.style.tag)){
        	msubmenuhide(thesub);
        	mnochange(document.all['mp'+numMenua]);
        	document.all["mitem"+numMenua].style.color=mfontcolor;
        	}
        }
if(item)document.all["mitem"+item].style.color=mMenuaovercolor;
if(misdown||item){
	mtoin(srcel);
}
else{
	mtoout(srcel);
}
if(x==-1)mthestatus=eval("msub"+j).items[i].statustxt;
if(j==-1)mthestatus=mMenuas[x].items[i].statustxt;
if(mthestatus!=""){
	musestatus=true;
	window.status=mthestatus;
}
clearTimeout(mpopTimer);
}
function mMenuaitem_out(hassub){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
srcel = getReal(window.event.srcElement, "className", "coolButton");
if(!hassub)mnochange(srcel);
if(musestatus)window.status="";
mpopOut()
}
function mMenuaitem_down(){
srcel = getReal(window.event.srcElement, "className", "coolButton");
mtoin(srcel)
misdown=true;
}
function mMenuaitem_up(){
srcel = getReal(window.event.srcElement, "className", "coolButton");
mtoout(srcel)
misdown=false;
}
function mexec3(j,i){
var cmd;
if(eval("msub"+j).items[i].target=="blank"){
  cmd = "window.open('"+eval("msub"+j).items[i].command+"')";
}else{
  cmd = eval("msub"+j).items[i].target+".location=\""+eval("msub"+j).items[i].command+"\"";
}
eval(cmd);
}
function mexec2(x){
var cmd;
if(mMenuas[x].target=="blank"){
  cmd = "window.open('"+mMenuas[x].command+"')";
}else{
  cmd = mMenuas[x].target+".location=\""+mMenuas[x].command+"\"";
}
eval(cmd);
}
function mexec(x,i){
var cmd;
if(mMenuas[x].items[i].target=="blank"){
  cmd = "window.open('"+mMenuas[x].items[i].command+"')";
}else{
  cmd = mMenuas[x].items[i].target+".location=\""+mMenuas[x].items[i].command+"\"";
}
eval(cmd);
}
function mbody_click(){

if (misShow){
	srcel = getReal(window.event.srcElement, "className", "coolButton");
	for(var x=0;x<=mMenuas.length;x++){
		if(srcel.id=="mMenua"+x)
		return;
	}
	for(x=1;x<=mnumberofsub;x++){
		if(srcel.id=="mp"+x)
		return;
	}
	mallhide();
}
}
document.onclick=mbody_click;

function mwritetodocument(){
      var mwb=0;
                     var stringx='<div id="mposflag" style="position:absolute;"></div><table background="imges/bg.gif" id=mMenuatable border=0 cellpadding=0 cellspacing=0 width='+mMenuawidth+' height='+mMenuaheight+' bgcolor='+mMenuacolor+
                     ' onselectstart="event.returnValue=false"'+
                     ' style="cursor:'+mcursor+';'+mfonts+
                     ' border-left: '+mwb+'px solid '+mMenuaoutbordercolor+';'+
                     ' border-right: '+mwb+'px solid '+mMenuainbordercolor+'; '+
                     'border-top: '+mwb+'px solid '+mMenuaoutbordercolor+'; '+
                     'border-bottom: '+mwb+'px solid '+mMenuainbordercolor+'; padding:0px"><tr>'
                     for(var x=0;x<mMenuas.length;x++){
                     	var thismenu=mMenuas[x];
                     	var imgsize="";
                     	if(thismenu.sizex!="0"||thismenu.sizey!="0")imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;
                     	var ifspace="";
                     	if(thismenu.caption!="")ifspace="&nbsp;";
                     	stringx += "<td nowrap class=coolButton id=mMenua"+x+" style='border: "+mitemedge+"px solid "+mMenuacolor+
                     	"' width="+mMenuaunitwidth+"px onmouseover=mMenua_over(mMenuadiv"+x+
                     	","+x+") onmouseout=mMenua_out("+x+
                     	") onmousedown=mMenua_down(mMenuadiv"+x+","+x+")";
                     	      if(thismenu.command!=""){
                     	          stringx += " onmouseup=mMenua_up();mexec2("+x+");";
                     	      }else{
                     	      	  stringx += " onmouseup=mMenua_up()";
                     	      }
                     	      if(thismenu.pos=="0"){
                     	          stringx += " align=center><img align=absmiddle src='"+thismenu.img+"'"+imgsize+">"+ifspace+thismenu.caption+"</td>";	
                     	      }else if(thismenu.pos=="1"){
                     	          stringx += " align=center>"+thismenu.caption+ifspace+"<img align=absmiddle src='"+thismenu.img+"'"+imgsize+"></td>";	
                     	      }else if(thismenu.pos=="2"){
                     	          stringx += " align=center background='"+thismenu.img+"'>&nbsp;"+thismenu.caption+"&nbsp;</td>";	
                     	      }else{
                     	          stringx += " align=center>&nbsp;"+thismenu.caption+"&nbsp;</td>";
                     	      }
                     	stringx += "";
                     }
                     stringx+="<td width=*>&nbsp;</td></tr></table>";
                     
                     
                     for(var x=0;x<mMenuas.length;x++){
                     	thismenu=mMenuas[x];
                        if(x==0||x==7){
                        stringx+='<div id=mMenuadiv'+x+' style="visiable:none"></div>';
                        }else{
                        stringx+='<div id=mMenuadiv'+x+
                        ' style="cursor:'+mcursor+';position:absolute;'+
                        'width:'+mMenuaitemwidth+'px; z-index:'+(x+100);
                        if(mMenuainbordercolor!=mMenuaoutbordercolor&&msubedge=="0"){
                        stringx+=';border-left: 1px solid '+mmidoutcolor+
                        ';border-top: 1px solid '+mmidoutcolor;}
                        stringx+=';border-right: 1px solid '+mMenuainbordercolor+
                        ';border-bottom: 1px solid '+mMenuainbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+
                     	'<table background="" width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="0" '+
                     	'style="'+mfonts+' border-left: 0px solid '+mMenuaoutbordercolor;
                     	if(mMenuainbordercolor!=mMenuaoutbordercolor&&msubedge=="0"){
                     	stringx+=';border-right: 0px solid '+mmidincolor+
                     	';border-bottom: 0px solid '+mmidincolor;}
                     	stringx+=';border-top: 0px solid '+mMenuaoutbordercolor+
                     	';padding: 4px" bgcolor='+mMenuacolor+'>\n'
                     	for(var i=0;i<thismenu.items.length;i++){
                     		var thismenuitem=thismenu.items[i];
                     		var imgsize="";
                     	        if(thismenuitem.sizex!="0"||thismenuitem.sizey!="0")imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey;
                     	        var ifspace="";
                     	        if(thismenu.caption!="")ifspace="&nbsp;";
                     		if(thismenuitem.hasc!=null){
                     		stringx += "<tr><td id=mp"+thismenuitem.hasc+" class=coolButton style='border: "+mitemedge+"px solid "+mMenuacolor+
                     		"' width=100% onmouseout=mMenuaitem_out(true) onmouseover=\"mMenuaitem_over(mMenuadiv"+x+
                     		",'"+thismenuitem.hasc+"',"+x+",-1,"+i+");mshowsubmenu(msubmenudiv"+thismenuitem.hasc+",mp"+thismenuitem.hasc+",mMenuadiv"+x+");\""+
                     		"><table id=mitem"+thismenuitem.hasc+" cellspacing='0' cellpadding='0' border='0' width='100%' style='"+mfonts+"'><tr><td ";
                     		  if(thismenuitem.pos=="0"){
                     	            stringx += "><img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+">"+ifspace+thismenuitem.caption+"</td><td";	
                     	          }else if(thismenuitem.pos=="1"){
                     	            stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+"></td><td";
                     	          }else if(thismenuitem.pos=="2"){
                     	            stringx += "background='"+thismenuitem.img+"'>"+thismenuitem.caption+"</td><td background='"+thismenuitem.img+"'";	
                     	          }else{
                     	            stringx += ">"+thismenuitem.caption+"</td><td";
                     	          }
                     		  stringx += " align=right width='1'><font face='Webdings' style='font-size: 6pt'>4</font></td></tr></table></td></tr>\n";                     		
                     		}else if(!thismenuitem.isline){
                     		stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mMenuacolor+
                     		"' width=100% height=15px onmouseover=\"mMenuaitem_over(mMenuadiv"+x+
                     		",false,"+x+",-1,"+i+");\" onmouseout=mMenuaitem_out() onmousedown=mMenuaitem_down() onmouseup=";
 				stringx += "mMenuaitem_up();mexec("+x+","+i+"); ";
 				  if(thismenuitem.pos=="0"){
                     	            stringx += "><img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";	
                     	          }else if(thismenuitem.pos=="1"){
                     	            stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+"></td></tr>";	
                     	          }else if(thismenuitem.pos=="2"){
                     	            stringx += "background='"+thismenuitem.img+"'>"+thismenuitem.caption+"</td></tr>";	
                     	          }else{
                     	            stringx += ">"+thismenuitem.caption+"</td></tr>";
                     	          }
 				}else{
                     		stringx+='<tr><td height="1" background="hr.gif" onmousemove="clearTimeout(mpopTimer);"><img height="1" width="1" src="none.gif" border="0"></td></tr>\n';
                     		}
                     	}stringx+='</table>\n</div>'
                     	}                     	
                }
                
for(var j=1;j<=mnumberofsub;j++){     
thisitem=eval("msub"+j);
stringx+='<div id=msubmenudiv'+j+
                        ' style="tag:'+thisitem.level+';cursor:'+mcursor+';position:absolute;'+
                        'width:'+mMenuaitemwidth+'px; z-index:'+(j+200);
                        if(mMenuainbordercolor!=mMenuaoutbordercolor&&msubedge=="0"){
                        stringx+=';border-left: 1px solid '+mmidoutcolor+
                        ';border-top: 1px solid '+mmidoutcolor;}
                        stringx+=';border-right: 1px solid '+mMenuainbordercolor+
                        ';border-bottom: 1px solid '+mMenuainbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+
                     	'<table background="" width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="0" '+
                     	'style="'+mfonts+' border-left: 1px solid '+mMenuaoutbordercolor;
                     	if(mMenuainbordercolor!=mMenuaoutbordercolor&&msubedge=="0"){
                     	stringx+=';border-right: 1px solid '+mmidincolor+
                     	';border-bottom: 1px solid '+mmidincolor;}
                     	stringx+=';border-top: 1px solid '+mMenuaoutbordercolor+
                     	';padding: 4px" bgcolor='+mMenuacolor+'>\n'
                     	for(var i=0;i<thisitem.items.length;i++){
                     		var thismenuitem=thisitem.items[i];
                     		var imgsize="";
                     	        if(thismenuitem.sizex!="0"||thismenuitem.sizey!="0")imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey;
                     	        var ifspace="";
                     	        if(thismenu.caption!="")ifspace="&nbsp;";
                     		if(thismenuitem.hasc!=null){
                     		stringx += "<tr><td id=mp"+thismenuitem.hasc+" class=coolButton style='border: "+mitemedge+"px solid "+mMenuacolor+
                     		"' width=100% onmouseout=mMenuaitem_out(true) onmouseover=\"mMenuaitem_over(msubmenudiv"+j+
                     		",'"+thismenuitem.hasc+"',-1,"+j+","+i+");mshowsubmenu(msubmenudiv"+thismenuitem.hasc+",mp"+thismenuitem.hasc+",msubmenudiv"+j+");\""+
                     		"><table id=mitem"+thismenuitem.hasc+" cellspacing='0' cellpadding='0' border='0' width='100%' style='"+mfonts+"'><tr><td ";
                     		  if(thismenuitem.pos=="0"){
                     	            stringx += "><img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+">"+ifspace+thismenuitem.caption+"</td><td";	
                     	          }else if(thismenuitem.pos=="1"){
                     	            stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+"></td><td";
                     	          }else if(thismenuitem.pos=="2"){
                     	            stringx += "background='"+thismenuitem.img+"'>"+thismenuitem.caption+"</td><td background='"+thismenuitem.img+"'";	
                     	          }else{
                     	            stringx += ">"+thismenuitem.caption+"</td><td";
                     	          }
                     		  stringx += " align=right width='1'><font face='Webdings' style='font-size: 6pt'>4</font></td></tr></table></td></tr>\n";                     		
                     		}else if(!thismenuitem.isline){
                     		stringx += "<tr><td class=coolButton style='border: "+mitemedge+"px solid "+mMenuacolor+
                     		"' width=100% height=15px onmouseover=\"mMenuaitem_over(msubmenudiv"+j+
                     		",false,-1,"+j+","+i+");\" onmouseout=mMenuaitem_out() onmousedown=mMenuaitem_down() onmouseup=";
                     		stringx += "mMenuaitem_up();mexec3("+j+","+i+"); ";
 				if(thismenuitem.pos=="0"){
                     	            stringx += "><img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";	
                     	          }else if(thismenuitem.pos=="1"){
                     	            stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+"></td></tr>";	
                     	          }else if(thismenuitem.pos=="2"){
                     	            stringx += "background='"+thismenuitem.img+"'>"+thismenuitem.caption+"</td></tr>";	
                     	          }else{
                     	            stringx += ">"+thismenuitem.caption+"</td></tr>";
                     	          }
                     	        }else{
                     		stringx+='<tr><td height="1" background="hr.gif" onmousemove="clearTimeout(mpopTimer);"><img height="1" width="1" src="none.gif" border="0"></td></tr>\n';
                     		}
                     	}
stringx+='</table>\n</div>'
}
       document.write("<div align='left'>"+stringx+"</div>");
}


