function Empty(o) {
	return typeof(o)=='undefined'||o===''||o==null;
};

function Def(o) {
	return !Empty(o);
};

function Undef(o) {
	return typeof(o)=='undefined';
};

function pI(s) {
	return parseInt(s);
};

function pB(v,d) {
	return Undef(v)?d:v&&v!='false';
};

function dw(s) {
	document.write(s);
};

function UsrAg() {
	var t=this,nv=navigator,n=nv.userAgent.toLowerCase(),v=parseInt(nv.appVersion);
	var ns=nv.appName=="Netscape";
	t.win=n.indexOf('win')>=0;
	t.mac=n.indexOf('mac')>=0;
	t.DOM=document.getElementById?true:false;
	t.dynDOM=document.createElement&&document.addEventListener;
	t.khtml=nv.vendor=="KDE";
	var idx=n.indexOf('opera');
	t.opera=idx!=-1;
	if(t.opera) {
		idx+=6;
		t.opera5=n.charAt(idx)=='5';
		t.opera6=n.charAt(idx)=='6';
		t.opera7=n.charAt(idx)=='7';
	}
	t.oldOpera=t.opera5||t.opera6;
	t.ie3down=n.indexOf('msie')!=-1&&v<4&&!t.opera;
	t.ie=t.ie4up=!t.ie3down&&document.all&&document.all.item&&!t.opera&&!t.khtml;
	t.ie5up=t.DOM&&t.ie4up;
	t.ie55=t.ie5up&&n.indexOf("msie 5.5")>0;
	t.ie6=t.ie5up&&n.indexOf('msie 6.')>0;
	t.ie55up=t.ie55||t.ie6;
	t.cm=document.compatMode;
	t.css1cm=t.cm=='CSS1Compat';
	t.nn4=ns&&!t.DOM&&!t.opera;
	t.moz=t.nn6up=t.DOM&&ns&&!t.opera;
	t.hj=n.indexOf('hotjava')!=-1;
	t.aol=n.indexOf('aol')!=-1;
	t.aol4up=t.aol&&t.ie4up;
	t.supp=t.supported=t.oldOpera||t.opera7||t.ie||t.moz||t.nn4||t.DOM;
};

var ua=new UsrAg();

function ClientEvent(e) {
	var t=this;
	t._e=e;
	t.x=ua.nn4||ua.moz?e.pageX:ua.oldOpera?e.clientX:e.clientX+document.body.scrollLeft;
	t.y=ua.nn4||ua.moz?e.pageY:ua.oldOpera?e.clientY:e.clientY+document.body.scrollTop;
	t.offsetX=ua.nn4||ua.moz?e.layerX:e.offsetX;
	t.offsetY=ua.nn4||ua.moz?e.layerY:e.offsetY;
	t.screenX=e.screenX;
	t.screenY=e.screenY;
	t.target=ua.ie?e.srcElement:e.target;
	t.key=ua.nn4||ua.moz?e.which:e.keyCode;
	t.alt=ua.nn4?e.modifiers&Event.ALT_MASK:e.altKey;
	t.ctrl=ua.nn4?e.modifiers&Event.CONTROL_MASK:e.ctrlKey;
	t.shift=ua.nn4?e.modifiers&Event.SHIFT_MASK:e.shiftKey;
	t.spec=t.alt||t.ctrl||t.shift;
	var b=ua.nn4||ua.moz?e.which:e.button;
	t.b_left=b==1;
	t.b_mid=ua.nn4||ua.moz?b==2:b==4;
	t.b_right=ua.nn4||ua.moz?b==3:b==2;
};

function ProtoMenu(id) {
	this._id=id;
	this._c=0;
	this.pre={};
	this.sz=[];
	this.ld=[];
};

{var DMp=ProtoMenu.prototype;

	DMp.findLayer=function(name,parent) {
		return this.findElement(name,parent);
	};

	DMp.findElement=function(name,parent) {
		if(ua.DOM) {
			return document.getElementById(name);
		} else if(ua.ie4up) {
			return document.all[name];
		} else {
			var set=Empty(parent)?document:parent.document;
			if(Empty(set[name])) {
				var i,el,len=set.layers.length;
				if(len==0) {
					return;
				} else {
					for(i=0;i<len;i++) {
						el=this.findElement(name,set.layers[i]);
						if(Def(el)) {
							return el;
						}
					}
				}
			} else {
				return set[name];
			}
		}
	};

	DMp.use=function(mod) {
		dw('<script language="javascript" type="text/javascript" src="'+(this._path||'')+mod+'"><\/script>');
	};

	DMp.path=function(p) {
		this._path=p;
	};

	DMp.regEventHandler=function(e,h,obj) {
		if(Empty(obj)) {
			obj=document;
		}
		e=e.toLowerCase();
		if(ua.nn4) {
			var name=e.toUpperCase();
			obj.captureEvents(Event[name]);
		}
		var f=typeof(h)=="function"?function(e) {
			var ev=ua.ie?window.event:e;
			if(Def(ev)) {
				ev=new ClientEvent(ev);
			}
			return h(ev);
		}:typeof(h)=="string"?new Function("e","var ev=ua.ie?window.event:e;if (Def(ev)) ev=new ClientEvent(ev);"+h):null;
		obj["on"+e]=f;
	};

	DMp.clearEventHandler=function(e,obj) {
		if(Empty(obj)) {
			obj=document;
		}
		e=e.toLowerCase();
		if(ua.nn4) {
			var name=e.toUpperCase();
			obj.releaseEvents(Event[name]);
		}
		obj["on"+e]=null;
	};

	DMp.setResizeHandler=DMp.setOnResize=function(h,b) {
		var s=this.sz,id=this._id;
		if(!s.length) {
			if(ua.oldOpera) {
				var _h=new Function(id+".saveWinSize();"+id+".checkSize()");
				b?_h():this.setOnLoad(_h);
			} else {
				s[0]=window.onresize;
				window.onresize=new Function(id+'.onresize()');
			}
		}
		s[s.length]=h;
	};

	DMp.setOnLoad=function(h) {
		var l=this.ld;
		if(!l.length) {
			l[0]=window.onload;
			window.onload=new Function(this._id+'.onload()');
		}
		l[l.length]=h;
	};

	DMp.checkSize=function() {
		var t=this;
		if(t.getWinHeight()!=t._WH||t.getWinWidth()!=t._WW) {
			t.saveWinSize();
			t.onresize();
		}
		t._resTO=setTimeout(t._id+'.checkSize()',1500);
	};

	DMp.call=function(a) {
		for(var i=0;i<a.length;i++) {
			if(Def(a[i])) {
				a[i]();
			}
		}
	};

	DMp.onload=function() {
		this.call(this.ld);
	};

	DMp.onresize=function() {
		this.call(this.sz);
	};

	DMp.saveWinSize=function() {
		this._WH=this.getWinHeight();
		this._WW=this.getWinWidth();
	};

	DMp.getWinHeight=function() {
		return ua.ie4up?ua.css1cm?document.documentElement.offsetHeight:document.body.clientHeight:self.innerHeight;
	};

	DMp.getWinWidth=function() {
		return ua.ie4up?ua.css1cm?document.documentElement.offsetWidth:document.body.clientWidth:self.innerWidth;
	};

	DMp.getScrollX=function() {
		return ua.ie4up?document.body.scrollLeft:self.pageXOffset;
	};

	DMp.getScrollY=function() {
		return ua.ie4up?document.body.scrollTop:self.pageYOffset;
	};

	DMp.cancelEvent=function(e) {
		if(ua.nn4) {
			return;
		}
		if(!Undef(e.stopPropagation)) {
			e.stopPropagation();
		} else {
			e.cancelBubble=true;
		}
	};

	DMp.newID=function() {
		return 'DropMenu'+this._c++;
	};

	DMp.readCookie=function(name) {
		var str=document.cookie;
		var set=str.split(';');
		var sz=set.length;
		var x,pcs;
		var val="";
		for(x=0;x<sz&&val=="";x++) {
			pcs=set[x].split('=');
			if(pcs[0].substring(0,1)==' ') {
				pcs[0]=pcs[0].substring(1,pcs[0].length);
			}
			if(pcs[0]==name) {
				val=pcs[1];
			}
		}
		return val;
	};

	DMp.writeCookie=function(name,val,exp) {
		var expDate=new Date();
		if(exp) {
			expDate.setTime(expDate.getTime()+exp);
			document.cookie=name+"="+val+"; expires="+expDate.toGMTString();
		} else {
			document.cookie=name+"="+val;
		}
	};

	DMp.preload=function() {
		var i,im=[],a=arguments;
		for(i=0;i<a.length;i++) {
			if(Empty(a[i])) {
				im[i]=null;
			} else if(Def(this.pre[a[i]])) {
				im[i]=this.pre[a[i]];
			} else {
				im[i]=new Image();
				im[i].src=a[i];
				this.pre[a[i]]=im[i];
			}
		}
		return a.length==1?im[0]:im;
	};

}


var DropMenu=new ProtoMenu('DropMenu');

DropMenu.setOnLoad(function() {DropMenu.loaded=1;});

function DM_el(l) {
	if(typeof l=='string') {
		l=DropMenu.findElement(l);
	}
	var st=ua.nn4?l:l.style;
	return[l,st];
};

function DM_HTML(l,HTML) {
	l=DM_el(l);
	if(ua.nn4) {
		var d=l[0].document;
		d.open();
		d.write(HTML);
		d.close();
	} else if(!ua.oldOpera) {
		l[0].innerHTML=HTML;
	}
};

function DM_clear(l) {
	DM_setHTML(l,'');
};

function DM_vis(l,v) {
	l=DM_el(l);
	l[1].visibility=v=='i'?"inherit":v?ua.nn4?"show":"visible":ua.nn4?"hide":"hidden";
};

function DM_inhvis(l,v) {
	DM_vis(l,v?'i':0);
};

function DM_show(l) {
	DM_vis(l,1);
};

function DM_hide(l) {
	DM_vis(l,0);
};

function DM_showAt(l,x,y) {
	l=DM_el(l);
	DM_moveTo(l[0],x,y);
	DM_show(l[0]);
};

function DM_z(l,z) {
	l=DM_el(l);
	l[1].zIndex=z;
};

function DM_setWidth(l,w) {
	l=DM_el(l);
	var h=DM_getHeight(l[0]);
	if(ua.nn4) {
		l[0].resizeTo(w,h);
	} else if(ua.oldOpera) {
		l[1].pixelWidth=w;
	} else {
		l[1].width=w+"px";
	}
};

function DM_setHeight(l,h) {
	l=DM_el(l);
	var w=DM_getWidth(l[0]);
	if(ua.nn4) {
		l[0].resizeTo(w,h);
	} else if(ua.oldOpera) {
		l[1].pixelHeight=h;
	} else {
		l[1].height=h+"px";
	}
};

function DM_resize(l,w,h) {
	l=DM_el(l);
	if(ua.nn4) {
		l[0].resizeTo(w,h);
	} else {
		DM_setHeight(l[0],h);
		DM_setWidth(l[0],w);
	}
};

function DM_setTop(l,y) {
	l=DM_el(l);
	if(ua.nn4) {
		l[1].y=y;
	} else if(ua.oldOpera) {
		l[1].pixelTop=y;
	} else {
		l[1].top=y+"px";
	}
};

function DM_setLeft(l,x) {
	l=DM_el(l);
	if(ua.nn4) {
		l[1].x=x;
	} else if(ua.oldOpera) {
		l[1].pixelLeft=x;
	} else {
		l[1].left=x+"px";
	}
};

function DM_moveTo(l,x,y) {
	l=DM_el(l);
	if(ua.nn4) {
		l[0].moveTo(x,y);
	} else {
		DM_setTop(l[0],y);
		DM_setLeft(l[0],x);
	}
};

function DM_moveRel(l,dx,dy) {
	l=DM_el(l);
	DM_moveTo(l[0],DM_getLeft(l[0])+dx,DM_getTop(l[0])+dy);
};

function DM_css(l,css) {
	if(!ua.oldOpera&&!ua.nn4) {
		l=DM_el(l);
		l[0].className=css;
	}
};

function DM_setBgColor(l,c) {
	l=DM_el(l);
	if(!ua.nn4&&!ua.oldOpera) {
		l[1].backgroundColor=c;
	} else if(ua.nn4) {
		l[1].bgColor=c;
	} else if(ua.opera) {
		l[1].background=c;
	}
};

function DM_setBgImage(l,url) {
	l=DM_el(l);
	if(!ua.nn4&&!ua.oldOpera) {
		l[1].backgroundImage='url('+url+')';
	} else {
		l[1].background.src=url;
	}
};

function DM_clip(l,x,y,w,h) {
	l=DM_el(l);
	if(ua.nn4) {
		var area=l[1].clip;
		area.top=y;
		area.left=x;
		area.width=w;
		area.height=h;
	} else if(!ua.oldOpera) {
		l[1].clip='rect('+y+'px '+(x+w)+'px '+(y+h)+'px '+x+'px)';
	}
};

function DM_display(l,d) {
	l=DM_el(l);
	l[1].display=d;
};

function DM_overflow(l,o) {
	l=DM_el(l);
	l[1].overflow=o;
};

function DM_alpha(l,a) {
	if(ua.ie55up) {
		l=DM_el(l);
		l[1].filter='progid:DXImageTransform.Microsoft.Alpha(Opacity="'+a+'")';
	}
};

function DM_getVis(l) {
	l=DM_el(l);
	var v=l[1].visibility;
	return Def(v)?v=="show"||v=="visible":v;
};

function DM_getWidth(l) {
	l=DM_el(l);
	var w;
	if(ua.nn4) {
		w=l[0].clip.width;
	} else {
		w=ua.oldOpera?l[1].pixelWidth:l[0].offsetWidth;
	}
	return w;
};

function DM_getHeight(l) {
	l=DM_el(l);
	var h;
	if(ua.nn4) {
		h=l[0].clip.height;
	} else {
		h=ua.oldOpera?l[1].pixelHeight:l[0].offsetHeight;
	}
	return h;
};

function DM_getSize(l) {
	l=DM_el(l);
	return[DM_getWidth(l[0]),DM_getHeight(l[0])];
};

function DM_getContentWidth(l) {
	l=DM_el(l);
	return ua.nn4?l[0].document.width:ua.oldOpera?l[1].pixelWidth:ua.ie&&ua.win?l[0].scrollWidth:l[0].offsetWidth;
};

function DM_getContentHeight(l) {
	l=DM_el(l);
	return ua.nn4?l[0].document.height:ua.oldOpera?l[1].pixelHeight:ua.ie&&ua.win?l[0].scrollHeight:l[0].offsetHeight;
};

function DM_getTop(l) {
	l=DM_el(l);
	return ua.nn4?l[0].y:l[0].offsetTop;
};

function DM_getLeft(l) {
	l=DM_el(l);
	return ua.nn4?l[0].x:l[0].offsetLeft;
};

function DM_getPos(l) {
	l=DM_el(l);
	return[DM_getLeft(l[0]),DM_getTop(l[0])];
};

function DM_getAbsTop(l) {
	l=DM_el(l);
	if(ua.nn4) {
		return l[0].pageY;
	} else {
		var o=l[0],y=DM_getTop(l[0]);
		while(Def(o=o.offsetParent)) {
			y+=o.offsetTop;
		}
		return y;
	}
};

function DM_getAbsLeft(l) {
	l=DM_el(l);
	if(ua.nn4) {
		return l[0].pageX;
	} else {
		var o=l[0],l=DM_getLeft(l[0]);
		while(Def(o=o.offsetParent)) {
			l+=o.offsetLeft;
		}
		return l;
	}
};

function DM_getAbsPos(l) {
	l=DM_el(l);
	return[DM_getAbsLeft(l[0]),DM_getAbsTop(l[0])];
};

function DM_lrStyle(w,h,t,l,a,v,bgc,bgi,cl,o,d,st,z,al) {
	return 'position:'+(a?'absolute':'relative')+';overflow:'+(o||'hidden')+';visibility:'+(v?'inherit':'hidden')+(Def(t)?";top:"+t+"px":"")+(Def(l)?";left:"+l+"px":"")+(Def(w)?";width:"+w+"px":"")+(Def(h)?";height:"+h+"px":"")+(z?";z-index:"+z:"")+(bgc?";background-color:"+bgc:"")+(bgi?";background-image:url("+bgi+")":"")+(cl?";clip:rect("+cl[0]+"px "+cl[1]+"px "+cl[2]+"px "+cl[3]+"px)":"")+(d?";display:"+d:"")+";"+(st||'')+(Def(al)&&ua.ie55up?';filter:progid:DXImageTransform.Microsoft.Alpha(Opacity='+al+')':''); //'
};

function DM_lrSource(id,w,h,t,l,a,v,css,bgc,bgi,cl,o,d,st,z,al,ev,html) {
	var src='';
	if(ua.nn4) {
		if(Empty(cl)&&Def(h)&&Def(w)&&(Empty(o)||o=='hidden')) {
			cl=[0,w,h,0];
		}
		if(st) {
			src="<style type=text/css>#"+id+"{"+st+"}</style>";
		}
		src+=(a?'<':'<i')+'layer id='+id+(Def(t)?' top='+t:"")+(Def(l)?' left='+l:"")+(Def(w)?' width='+w:"")+(z?' z-index='+z:"")+' visibility='+(v?"inherit":"hide")+(cl?' clip="'+cl[3]+','+cl[0]+','+cl[1]+','+cl[2]+'"':"")+(bgc?' bgcolor="'+bgc+'"':"")+(bgi?' background="'+bgi+'"':"");
	} else {
		src='<div id="'+id+'" style="'+DM_lrStyle(w,h,t,l,a,v,bgc,bgi,cl,o,d,st,z,al)+'"';
	}
	if(css) {
		src+=' class="'+css+'"';
	}
	if(Def(ev)) {
		for(var i=ev.length-1;i>=0;i-=2) {
			src+=' on'+ev[i-1]+'="'+ev[i]+'"';
		}
	}
	return src+">"+(html||'')+'</'+(ua.nn4?(a?'':'i')+"layer>":"div>"); //'
};

function DM_createLayer(id,w,h,t,l,a,v,css,bgc,bgi,cl,o,d,st,z,al,ev,html,p) {
	var id=id||DropMenu.newID();
	var src=DM_lrSource(id,w,h,t,l,a,v,css,bgc,bgi,cl,o,d,st,z,al,ev,html);
	var parent=p||document.body;
	if(!DropMenu.loaded) {
		dw(src);
	} else if(ua.ie) {
		parent.insertAdjacentHTML("BeforeEnd",src);
	} else if(ua.dynDOM) {
		var lr=document.createElement('DIV');
		lr.setAttribute('id',id);
		if(Def(css)) {
			lr.setAttribute('className',css);
		}
		lr.setAttribute('style',DM_lrStyle(w,h,t,l,a,v,bgc,bgi,cl,o,d,st,z,al));
		lr.innerHTML=html;
		if(Def(ev)) {
			for(var i=ev.length-1;i>=0;i-=2) {
				lr.addEventListener(ev[i-1],new Function(ev[i]),0);
			}
		}
		parent.appendChild(lr);
	} else {
		return;
	}
	return id;
};

function DLayer() {
	var a=arguments,t=this;
	t._ex=false;
	if(a.length==2&&typeof(a[0])=='number') {
		t._w=parseInt(a[0]);
		t._h=parseInt(a[1]);
	} else if(a.length>=1&&typeof a[0]=='string') {
		t.assignLayer(DropMenu.findLayer(a[0],a[1]));
	}
	t._id=t._id||DropMenu.newID();
	t._HTML='';
	t._ev=[];
};

{var DLp=DLayer.prototype;

	DLp.assignLayer=function(oLr) {
		var t=this;
		if(Empty(oLr)) {
			oLr=t._id;
		}
		oLr=DM_el(oLr);
		t._lr=oLr[0];
		t._st=oLr[1];
		t._ex=1;
		return t;
	};

	DLp.setHTML=function(s) {
		this._HTML=s;
		if(this._ex) {
			DM_HTML(this._lr,s);
		}
	};

	DLp.appendHTML=function(s) {
		this.setHTML(this._HTML+s);
	};

	DLp.clear=function() {
		this.setHTML('');
	};

	DLp.setVisible=function(v) {
		this._v=v;
		if(this._ex) {
			DM_vis(this._lr,v);
		}
	};

	DLp.show=function() {
		this.setVisible(1);
	};

	DLp.hide=function() {
		this.setVisible(0);
	};

	DLp.showAt=function(x,y) {
		DM_showAt(this._lr,x,y);
	};

	DLp.setZIndex=function(z) {
		this._z=z;
		if(this._ex) {
			DM_z(this._lr,z);
		}
	};

	DLp.setWidth=function(w) {
		this._w=w;
		if(this._ex) {
			DM_setWidth(this._lr,w);
		}
	};

	DLp.setHeight=function(h) {
		this._h=h;
		if(this._ex) {
			DM_setHeight(this._lr,h);
		}
	};

	DLp.resize=DLp.setSize=function(w,h) {
		this.setHeight(h);
		this.setWidth(w);
	};

	DLp.setTop=function(y) {
		this._t=y;
		if(this._ex) {
			DM_setTop(this._lr,y);
		}
	};

	DLp.setLeft=function(x) {
		this._l=x;
		if(this._ex) {
			DM_setLeft(this._lr,x);
		}
	};

	DLp.moveTo=DLp.setPos=function(x,y) {
		var t=this;
		t._l=x;
		t._t=y;
		if(t._ex) {
			DM_moveTo(t._lr,x,y);
		}
	};

	DLp.setRel=function(r) {
		this._rel=r;
	};

	DLp.moveRel=function(dx,dy) {
		this.moveTo(this.getLeft()+dx,this.getTop()+dy);
	};

	DLp.setCSS=function(css) {
		this._css=css;
		if(this._ex) {
			DM_css(this._lr,css);
		}
	};

	DLp.setID=function(id) {
		if(!this._ex) {
			this._id=id||DropMenu.newID();
		}
	};

	DLp.setBgColor=function(c) {
		this._bgC=c;
		if(this._ex) {
			DM_setBgColor(this._lr,c);
		}
	};

	DLp.setBgImage=function(url) {
		this._bgI=url;
		if(this._ex) {
			DM_setBgImage(this._lr,url);
		}
	};

	DLp.clip=function(x,y,w,h) {
		this._cl=[y,x+w,y+h,x];
		if(this._ex) {
			DM_clip(this._lr,x,y,w,h);
		}
	};

	DLp.setDisplay=function(d) {
		this._dsp=d;
		if(this._ex) {
			DM_display(this._lr,d);
		}
	};

	DLp.setOverflow=function(o) {
		this._ov=o;
		if(this._ex) {
			DM_overflow(this._lr,o);
		}
	};

	DLp.addEventHandler=function(ev,src) {
		this._ev[this._ev.length]=[ev.toLowerCase(),src];
	};

	DLp.clearHandlers=function() {
		this._ev=[];
	};

	DLp.setAlpha=function(a) {
		this._al=a;
		if(this._ex) {
			DM_al(this._lr,a);
		}
	};

	DLp.addStyle=function(st) {
		this._sty=st;
	};

	DLp.object=function() {
		return this._lr;
	};

	DLp.getHTML=function() {
		return this._HTML;
	};

	DLp.getVisible=function() {
		return this._ex?DM_getVis(this._lr):this._v;
	};

	DLp.getWidth=function() {
		var t=this;
		if(t._ex&&(!ua.nn4||Empty(t._w))) {
			t._w=DM_getWidth(t._lr);
		}
		return t._w;
	};

	DLp.getHeight=function() {
		var t=this;
		if(t._ex&&(!ua.nn4||Empty(t._h))) {
			t._h=DM_getHeight(t._lr);
		}
		return t._h;
	};

	DLp.getSize=function() {
		return[this.getWidth(),this.getHeight()];
	};

	DLp.getContentWidth=function() {
		return this._ex?DM_getContentWidth(this._lr):this._w;
	};

	DLp.getContentHeight=function() {
		return this._ex?DM_getContentHeight(this._lr):this._h;
	};

	DLp.getTop=function() {
		return this._ex?DM_getTop(this._lr):this._t;
	};

	DLp.getLeft=function() {
		return this._ex?DM_getLeft(this._lr):this._l;
	};

	DLp.getPos=function() {
		return[this.getLeft(),this.getTop()];
	};

	DLp.getAbsoluteTop=function() {
		return this._ex?DM_getAbsTop(this._lr):this._t;
	};

	DLp.getAbsoluteLeft=function() {
		return this._ex?DM_getAbsLeft(this._lr):this._l;
	};

	DLp.getAbsolutePos=function() {
		return[this.getAbsoluteLeft(),this.getAbsoluteTop()];
	};

	DLp.getID=function() {
		return this._ex?this._lr.id||this._lr.name:this._id;
	};

	DLp.getCSS=function() {
		return this._ex?this._lr.className:this._css;
	};

	DLp.remapEv=function() {
		var i,e=this._ev,ev=[];
		for(i=0;i<e.length;i++) {
			ev[2*i]=e[i][0].substr(2);
			ev[2*i+1]=e[i][1];
		}
		return ev;
	};

	DLp.getSource=function() {
		var t=this;
		return DM_lrSource(t._id,t._w,t._h,t._t||0,t._l||0,!t._rel,t._v,t._css,t._bgC,t._bgI,t._cl,t._ov,t._dsp,t._st,t._z,t._al,t.remapEv(),t._HTML);
	};

	DLp.create=function(p) {
		var t=this;
		if(t._ex) {
			return;
		}
		if(Def(DM_createLayer(t._id,t._w,t._h,t._t||0,t._l||0,!t._rel,t._v,t._css,t._bgC,t._bgI,t._cl,t._ov,t._dsp,t._st,t._z,t._al,t.remapEv(),t._HTML))) {
			t.assignLayer();
		}
	};

}

function DNode(type,name,parent) {
	var t=this;
	t.type=type;
	t.name=name;
	t.parent=parent;
	t.parameters=[];
	t.subitems=[];
	t.value='';
};

{var DNp=DNode.prototype;

	DNp.getParameter=function(name) {
		for(var i=0;i<this.parameters.length;++i) {
			if(this.parameters[i].name==name) {
				return this.parameters[i].value;
			}
		}
		return null;
	};

	DNp.getValue=function() {
		return this.value;
	};

}

function DXMLTree(str) {
	this.str=str;
	this.tree=new DNode("DOCUMENT","",null);
	this.parse(this.str,0,this.tree);
};

{DXp=DXMLTree.prototype;

	DXp.parse=function(s,begin,tag) {
		var close=false;
		var index=begin;
		if(typeof(s)!="string"||s==null) {
			return null;
		}
		while(!close) {
			index=this.skipWhitespaces(s,index);
			if(index>s.length-1) {
				break;
			}
			if(s.charAt(index)=='<') { //'
				index++;
				if(s.charAt(index)=='?') {
					index=s.indexOf('>',index)+1;
				} else if(s.charAt(index)=='/') {
					close=true;
					index=s.indexOf('>',index)+1;
				} else if(s.substr(index,3)=='!--') {
					index=s.indexOf('-->',index)+3;
				} else if(s.substr(index,8)=='![CDATA[') {
					index+=8;
					var end=s.indexOf(']]>',index);
					var charnode=new DNode("CHARDATA","",tag);
					charnode.value=s.substr(index,end-index);
					tag.subitems[tag.subitems.length]=charnode;
					index=end+3;
				} else if(s.charAt(index)=='!') {
					index=s.indexOf('>',index)+1;
				} else {
					var tagname=this.getCharname(s,index);
					if(tagname==null||tagname.length==0) {
						return null;
					} else {
						index+=tagname.length;
						index=this.skipWhitespaces(s,index);
						var newtag=new DNode("ELEMENT",tagname,tag);
						while(s.charAt(index)!='/'&&s.charAt(index)!='>') {
							var paramname=this.getCharname(s,index);
							var param=new DNode("PARAMETER",paramname,newtag);
							newtag.parameters[newtag.parameters.length]=param;
							index+=paramname.length;
							index=this.skipWhitespaces(s,index);
							if(s.charAt(index)!='=') {};
							index++;
							index=this.skipWhitespaces(s,index);
							if(s.charAt(index)!='\"') {};
							index++;
							var paramend=s.indexOf("\"",index); //"
							param.value=this.processValue(s.substr(index,paramend-index));
							index=this.skipWhitespaces(s,paramend+1);
						}
						tag.subitems[tag.subitems.length]=newtag;
						index=s.indexOf('>',index)+1;
						if(s.charAt(index-2)=='/') {
						} else {
							index=this.parse(s,index,newtag);
						}
					}
				}
			} else {
				var end=s.indexOf('<',index);
				var charnode=new DNode("CHARDATA","",tag);
				charnode.value=this.processValue(s.substr(index,end-index));
				tag.subitems[tag.subitems.length]=charnode;
				index=end;
			}
		}
		return index;
	};

	DXp.skipWhitespaces=function(str,begin) {
		var c,i=begin;
		while(i<str.length&&((c=str.charAt(i))=='\n'||c=='\r'||c=='\t'||c==' ')) {
			++i;
		}
		return i;
	};

	DXp.getCharname=function(str,begin) {
		var c,i=begin;
		while(i<str.length&&!((c=str.charAt(i))=='\n'||c=='\r'||c=='\"'||c=='\''||c=='\t'||c=='/'||c=='>'||c=='<'||c=='='||c==' ')) { //'
			++i;
		}
		return str.substr(begin,i-begin);
	};

	DXp.processValue=function(str) {
		var a=[];
		a=str.split("&lt;");
		str=a.join("<");
		a=str.split("&gt;");
		str=a.join(">");
		a=str.split("&quot;");
		str=a.join("\""); //"
		a=str.split("&apos;");
		str=a.join("\'");
		a=str.split("&amp;");
		str=a.join("&");
		return str;
	};

	DXp.toObject=function(node) {
		node=node||this.tree;
		var i,o;
		if(node.parameters.length==0&&node.subitems.length==1&&node.subitems[0].type=='CHARDATA') {
			o=node.subitems[0].value;
		} else {
			o={};
			for(i=0;i<node.parameters.length;++i) {
				var par=node.parameters[i];
				o[par.name]=par.value;
			}
			for(i=0;i<node.subitems.length;++i) {
				var val,it=node.subitems[i];
				if(it.type=='CHARDATA') {
					o.__value=it.value;
				} else {
					val=this.toObject(it);
					if(Empty(o[it.name])) {
						o[it.name]=val;
					} else {
						if(o[it.name].constructor!=Array) {
							o[it.name]=[o[it.name]];
						}
						o[it.name][o[it.name].length]=val;
					}
				}
			}
		}
		return o;
	};

}

function DTimer(p,id,sig,oS,n,ps,bef,betw,aft) {
	this._par=p;
	this._id=id;
	this._sig=sig;
	this._o=oS;
	this._n=n;
	this._ps=ps||100;
	this._scr=[bef,betw,aft];
};

{var DMp=DTimer.prototype;

	DMp.run=function() {
		if(Empty(this._o)) {
			return;
		}
		this._i=0;
		if(Def(this._scr[0])) {
			eval(this._scr[0]);
		}
		this._to=setTimeout(this+'.step()',this._ps);
	};

	DMp.step=function() {
		var t=this;
		if(t._o) {
			t._o.onTimer();
		}
		if(Def(t._scr[1])) {
			eval(t._scr[1]);
		}
		t._i++;
		if(t._i<t._n) {
			t._to=setTimeout(t+'.step()',t._ps);
		} else {
			t.finish();
		}
	};

	DMp.stop=function() {
		this.pause();
		this.finish();
	};

	DMp.pause=function() {
		clearTimeout(this._to);
		this._to=null;
	};

	DMp.paused=function() {
		return this._to==null;
	};

	DMp.on=function() {
		this.step();
	};

	DMp.finish=function() {
		if(Def(this._scr[2])) {
			eval(this._scr[2]);
		}
		if(this._sig) {
			this._par.sig_stop(this._id);
		}
	};

	DMp.toString=function() {
		return this._par.getObjPath(this._id);
	};

}

function DSlideAnimat(oPar,id,sig,aCL,aP,df,dt,bef,betw,aft) {
	var i,dx,dy,n,t=this;
	t.base=DTimer;
	t._l=aCL;
	t._x=[];
	t._y=[];
	t._st_x=[];
	t._st_y=[];
	for(i=0;i<t._l.length;i++) {
		t._x[i]=t._l[i].getLeft();
		t._y[i]=t._l[i].getTop();
		dx=aP[i][0]-t._x[i];
		dy=aP[i][1]-t._y[i];
		if(!i) {
			n=Math.floor(Math.sqrt(dx*dx+dy*dy)/df);
		}
		t._st_x[i]=dx/n;
		t._st_y[i]=dy/n;
	}
	t.base(oPar,id,sig,t,n,dt,bef,betw,aft);
};

DSlideAnimat.prototype=new DTimer;

DSlideAnimat.prototype.onTimer=function() {
	var i,t=this;
	for(i=0;i<t._l.length;i++) {
		t._x[i]+=t._st_x[i];
		t._y[i]+=t._st_y[i];
		t._l[i].moveTo(Math.round(t._x[i]),Math.round(t._y[i]));
	}
};

function DClipAnimat(oPar,id,sig,oCL,aP,n,ps,bef,betw,aft) {
	var i,t=this;
	t.base=DTimer;
	t._l=oCL;
	t._c=oCL.getClip();
	t._st=[];
	for(i=0;i<4;i++) {
		t._st[i]=(aP[i]-t._c[i])/n;
	}
	this.base(oPar,id,sig,t,n,ps,bef,betw,aft);
};

DClipAnimat.prototype=new DTimer;

DClipAnimat.prototype.onTimer=function() {
	var i=0,c=this._c;
	for(;i<4;i++) {
		c[i]+=this._st[i];
	}
	this._l.clip(c[3],c[0],c[1]-c[3],c[2]-c[0]);
};

function DAniCollect(id) {
	var t=this;
	t._id=id;
	t._c=0;
	t._a=[];
	t.slideAni=DSlideAnimat;
	t.clipAni=DClipAnimat;
	t.SLIDE='slideAni';
	t.CLIP='clipAni';
};

{var DCp=DAniCollect.prototype;

	DCp.add=function() {
		var id='s'+this._c++,a=arguments;
		var o=new this[a[0]](this,id,a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]);
		this._a[id]=o;
		return id;
	};

	DCp.remove=function(t_id) {
		delete this._a[t_id];
	};

	DCp.run=function(t_id) {
		if(Empty(this._a[t_id])) {
			return;
		}
		this._a[t_id].run();
	};

	DCp.obj=function(t_id) {
		return this._a[t_id];
	};

	DCp.sig_stop=function(t_id) {
		setTimeout(this._id+".remove('"+t_id+"')",1);
	};

	DCp.getObjPath=function(t_id) {
		return this._id+'._a.'+t_id;
	};

	var DLp=DLayer.prototype;

	DLp.slide=function(x,y,st,tm,bef,betw,aft) {
		var a=arguments;
		var s=DropMenu.Ani.add(DropMenu.Ani.SLIDE,true,[this],[[x,y]],st,tm,bef,betw,aft);
		DropMenu.Ani.run(s);
		return s;
	};

	DLp.slideRel=function(dx,dy,st,tm,bef,betw,aft) {
		var a=arguments;
		var s=DropMenu.Ani.add(DropMenu.Ani.SLIDE,true,[this],[[this.getLeft()+dx,this.getTop()+dy]],st,tm,bef,betw,aft);
		DropMenu.Ani.run(s);
		return s;
	};

	DLp.clipSlide=function(l,t,r,b,n,tm,bef,betw,aft) {
		var s=DropMenu.Ani.add(DropMenu.Ani.CLIP,true,this,[t,r,b,l],n,tm,bef,betw,aft);
		DropMenu.Ani.run(s);
		return s;
	};

	DLp.clipMove=function(l,t,n,tm,bef,betw,aft) {
		var c=this.getClip();
		var dx=l-c[3],dy=t-c[0];
		var s=DropMenu.Ani.add(DropMenu.Ani.CLIP,true,this,[t,c[1]+dx,c[2]+dy,l],n,tm,bef,betw,aft);
		DropMenu.Ani.run(s);
		return s;
	};

}

DropMenu.Ani=new DAniCollect('DropMenu.Ani');

//document.write("TOOLPATH="+toolpath);
var DM_IMG_BLANK=toolpath+"spacer.gif";

function DM_pre(src) {
	return DropMenu.preload(src);
};

var DM_fnv=ua.oldOpera||ua.nn4?DM_vis:DM_inhvis;

function DM_copy(src,dest,menu,box) {
	for(var i in src) {
		if(Undef(dest[i])) {
			if(menu||!box||i!='bgcolor'&&i!='bgimg'&&i!='border'&&i!='shadow'&&i!='itemoffset'&&i!='opacity') {
				dest[i]=src[i];
			}
		}
	}
};

function DM_mnuLrSource(w,h,t,l,ox,oy,z,a,v,bgc,bgi,b,html,ev,al) {
	var i=this._l.length,lw=w,lh=h;
	var st,lr=this._l[i]=[DropMenu.newID(),ox,oy,0];
	if(b) {
		var bw=b.width;
		lr[3]=bw;
		if(ua.moz||ua.oldOpera||ua.nn4) {
			lw-=2*bw;
			if(lh) {
				lh-=2*bw;
			}
		}
		if(!ua.nn4) {
			st="border:"+bw+"px "+(b.style||'solid')+' '+b.color;
		} else {
			html=DM_lrSource('s'+lr[0],lw,lh,bw,bw,1,1,'',bgc||this._p.style.bgcolor,bgi,'','','','',z+1,'','',html);
			lw=w;
			lh=h;
			bgc=b.color;
			bgi='';
		}
	}
	return DM_lrSource(lr[0],lw,lh,t+oy,l+ox,a,v,'',bgc,bgi,'','','',st,z,al,ev,html);
};

function DM_Border(d,b,hor,w) {
	var bw=b.width,bc=b.color;
	var def=d||{},bsrc='',sz=def.size||w;
	if(Def(d)) {
		var i,tdw,tblw,tblh,atr,add,diff=sz;
		bw=pI(def.width||bw);
		bc=def.color||bc;
		tblw=hor?sz:bw;
		tblh=hor?bw:sz;
		atr=hor?' width=':' height=';
		add=hor?' height='+tblh:' width='+tblw;
		if(Def(def.el)) {
			var elw,elm=def.el;
			for(i=0;i<elm.length;i++) {
				elw=pI(elm[i].width);
				if(!isNaN(elw)) {
					diff-=elw;
				}
			}
			if(diff<0) {
				diff=0;
			}
			bsrc='<table cellpadding=0 cellspacing=0 border=0 width='+tblw+' height='+tblh+'>'+(hor?'<tr>':'');
			for(i=0;i<elm.length;i++) {
				var imsrc='',bgimg='';
				if(!hor) {
					bsrc+='<tr>';
				}
				tdw=elm[i].width;
				imsrc=elm[i].src||DM_IMG_BLANK;
				if(Empty(tdw)) {
					tdw=diff;
					bgimg=imsrc;
					imsrc=DM_IMG_BLANK;
				}
				tdw=atr+tdw;
				bsrc+='<td'+tdw+(Def(bgimg)?' background="'+bgimg+'"':'')+(Def(elm[i].color)?' bgcolor="'+elm[i].color+'"':'')+add+'>'+'<img src="'+imsrc+'"'+tdw+add+'></td>';
				if(!hor) {
					bsrc+='</tr>';
				}
			}
			bsrc+=(hor?'</tr>':'')+'</table>';
		}
	}
	return Def(d)||Def(bw)&&Undef(d)?[bsrc,hor?sz:bw,bc,pI(def.offset||(hor?-bw:0)),hor?bw:sz]:null;
};

function DMenu(def,id) {
	var t=this;
	t.id=id;
	t.open=[];
	if(Empty(def)) {
		def={};
	}
	if(Empty(def.type)) {
		def.type="bar";
	}
	t.dd=def.type=="dropdown";
	if(Empty(def.style)) {
		def.style={};
	}
	var o=def.style;
	o.box=pB(o.box,1);
	if(Undef(o.bgcolor)) {
		o.bgcolor='white';
	}
	o.z=o.z||1;
	if(Empty(def.position)) {
		def.position={};
	}
	o=def.position;
	o.pos=o.pos||[0,0];
	o.pos[0]=pI(o.pos[0]);
	o.pos[1]=pI(o.pos[1]);
	o.anchor_side=o.anchor_side||"nw";
	o.absolute=pB(o.absolute,1);
	t.menu=new DPopupMenu(def,t,null,t.id+".menu");
	t.timer=def.timer||1000;
	t.otime=def.otime||10;
	t.aclose=pB(o.autoclose,0);
	DM_IMG_BLANK=def.imgblank||DM_IMG_BLANK;
	DM_pre(DM_IMG_BLANK);
	_DM_menus[_DM_menus.length]=t;
};

{var DMp=DMenu.prototype;

	DMp.create=function() {
		this.menu.createTop();
	};

	DMp.handleEvent=function(e,s1,s2,src) {
		if(!this._dis) {
			var t=this;
			t.clearTimer();
			if(e=='i') {
				var o=t.open,l=o.length;
				if(Empty(s1)) {
					t.hide();
				} else if(Empty(s2)||(l!=0&&o[l-1].id!=s2.id)) {
					t.hideAfter(s1);
				}
				if(Def(s2)) {
					t.showTimer(s2);
				}
				if(Def(src)) {
					src.over();
				}
			} else if(e=='o') {
				t.setTimer();
				if(Def(src)) {
					src.out();
				}
			}
		}
	};

	DMp.clearTimer=function() {
		if(Def(this._to)) {
			clearTimeout(this._to);
		}
		this._to='';
	};

	DMp.setTimer=function() {
		if(this._to) {
			return;
		}
		this._to=setTimeout(this.id+'.hide()',this.timer);
	};

	DMp.showTimer=function(m) {
		if(this._to) {
			return;
		}
		this._to=setTimeout(this.id+'.show('+m._path+')',this.otime);
	};

	DMp.show=function(path) {
		var t=this;
		path.visible(1);
		t.open[t.open.length]=path;
		t._to='';
		if(path.type=='popup'&&t.aclose) {
			t.setTimer();
		}
	};

	DMp.hide=function() {
		if(this.open.length>0) {
			this.hideAfter({"id":''});
		}
		this._to='';
	};

	DMp.hideAfter=function(path) {
		var i,l,o;
		while((l=(o=this.open).length)>0&&o[l-1].id!=path.id) {
			i=l-1;
			o[i].visible(0);
			this.open=o.slice(0,i);
		}
	};

	DMp.popupAt=function(x,y) {
		this.menu.moveRel(x,y);
		this._ap=this.menu.AbsPos();
		this.popup();
	};

	DMp.popupEv=function(e) {
		this.popupAt(e.x,e.y);
	};

	DMp.popup=function() {
		this.handleEvent('i',null,this.menu);
	};

	DMp.run=function() {
		var r=arguments.length>0;
		if(!r) {
			this.menu.create();
		}
		if(!(ua.ie4up&&!ua.ie55up||ua.oldOpera)||r) {
			this.menu.moveLayers();
			if(this.menu.type!='popup') {
				this.menu.visible(1);
			}
			this._op=1;
			this._ap=this.menu.AbsPos();
			this.checkMove();
		} else if(!ua.oldOpera) {
			setTimeout(this.id+'.run(1)',1);
		}
	};

	DMp.checkMove=function() {
		if(this.menu.AbsPos().join()!=this._ap.join()) {
			this.movePos();
		}
		this._mv=setTimeout(this.id+'.checkMove()',500);
	};

	DMp.movePos=function() {
		this._ap=this.menu.AbsPos();
		this.menu.Repos();
	};

	DMp.state=function(b) {
		if(b) {
			this.checkMove();
		} else if(Def(this._mv)) {
			clearTimeout(this._mv);
		}
		this._dis=!b;
	};

	DMp.obj=function() {
		return this.menu;
	};

}

function DPopupMenu(def,p,p_lvl,path) {
	var t=this;
	t.id=DropMenu.newID();
	if(Empty(def)) {
		def={};
	}
	t._p=p;
	t._p_lvl=p_lvl;
	t._top=Empty(p_lvl);
	t._tid=t._p._tid||t._p.id;
	t.dd=p_lvl&&p_lvl.dd||p.dd;
	t._path=path;
	var o=t.style=def.style||{};
	if(Def(o.box)) {
		o.box=pB(o.box,1);
	}
	if(Def(o.itemoffset)) {
		o.itemoffset.x=pI(o.itemoffset.x||0);
		o.itemoffset.y=pI(o.itemoffset.y||0);
	}
	if(Def(o.size)) {
		o.size[0]=pI(o.size[0]);
		o.size[1]=pI(o.size[1]);
	}
	if(Def(o.shadow)) {
		o.shadow.width=pI(o.shadow.width||5);
	}
	if(Def(o.border)) {
		o.border.width=pI(o.border.width||1);
	}
	t.itemover=def.itemover||{};
	t.itemon=def.itemon||{};
	o=t.position=def.position||{};
	if(Def(o.pos)) {
		o.pos[0]=pI(o.pos[0]);
		o.pos[1]=pI(o.pos[1]);
	} else {
		o.pos=[0,0];
	}
	if(Def(o.menuoffset)) {
		o.menuoffset.x=pI(o.menuoffset.x||0);
		o.menuoffset.y=pI(o.menuoffset.y||0);
	}
	if(t._top||t.dd) {
		t.style.direction=t.style.direction||(t._top&&t.dd?"h":"v");
		o.anchor=o.anchor||(p_lvl&&p_lvl._p.dd?"sw":"ne");
	}
	t.separator=def.separator||{};
	t.defaction=def.defaction||{};
	if(!t._top) {
		t.style.z=t.style.z||(p.style.z+5);
		DM_copy(p_lvl.style,t.style,1);
		DM_copy(p_lvl.itemover,t.itemover,1);
		DM_copy(p_lvl.itemon,t.itemon,1);
		DM_copy(p_lvl.separator,t.separator,1);
		DM_copy(p_lvl.position,t.position,1);
		DM_copy(p_lvl.defaction,t.defaction,1);
	} else {
		t.type=def.type;
		t.style.z=t.style.z||1;
		if(t.type=='toolbar') {
			o=t.style.bar=t.style.bar||{};
			o.drag=pB(o.drag,1);
		}
	}
	if(Def(o=t.style.bar)) {
		o.size=o.size||[10,10];
		if(!o.src&&!o.bgcolor) {
			o.bgcolor="blue";
		}
		o.dir=o.dir||t.style.direction;
		o.size[0]=pI(o.size[0]);
		o.size[1]=pI(o.size[1]);
	}
	t.createItems(def);
	t._l=[];
};

{var DPp=DPopupMenu.prototype;

	DPp.createTop=function() {
		var mw,mh,t=this,st=t.style;
		var p=t.position.pos,w=t.width(),h=t.height();
		if(st.box) {
			mw=w;
			mh=h;
		} else {
			mw=pI(st.fixwidth)||w;
			mh=pI(st.fixheight)||h;
		}
		var x=t.getAlignX();
		if(Def(x)) {
			p[0]=x;
		}
		t.createLr(mw,mh,p[1],p[0],0,0,st.z,t.position.absolute,0);
	};

	DPp.createLr=function(w,h,t,l,ox,oy,z,a,v,bgc,bgi,html,ev,al) {
		var i=this._l.length;
		var lr=this._l[i]=[DropMenu.newID(),ox,oy];
		var b=this.style.box;
		DM_createLayer(lr[0],w,h,t+oy,l+ox,a,v,'',bgc,bgi,'',b||ua.nn4?'hidden':'visible','','',z,al,ev,html);
		return i;
	};

	DPp.apply=function() {
		this.create();
		this._p.refresh();
	};

	DPp.create=function() {
		var t=this;
		var i,b=t.style.box;
		var p=t.position.pos,w=t.width(),h=t.height(),st=t.style,z=st.z;
		var al=st.opacity;
		if(!st.autosize) {
			t.moveItems();
		}
		var itsrc=t.itSrc();
		t._b=t.createLr(w,h,p[1],p[0],0,0,b?z+2:z,1,0,b?st.bgcolor:'',b?st.bgimg:'',ua.nn4?'':itsrc,['mouseover',t._tid+'.clearTimer()','mouseout',t._tid+'.setTimer()'],b?al:'');
		if(ua.nn4) {
			dw(itsrc);
		}
		if(st.autosize) {
			t.sizeItems();
			t.moveItems(1);
			h=t.height(1);
			DM_resize(t._l[t._b][0],w,h);
			if(t._top&&b) {
				DM_resize(t._l[0][0],w,h);
			}
		}
		var iw=w,ih=h,iox=0,ioy=0;
		if(b) {
			var j=st.shadow;
			if(j) {
				t.createLr(j.width,h,p[1],p[0],w,j.width,z,1,0,j.color,'','','',j.opacity||al);
				t.createLr(w,j.width,p[1],p[0],j.width,h,z,1,0,j.color,'','','',j.opacity||al);
			}
			j=st.border;
			if(j) {
				var bpr,bw=w;
				bpr=DM_Border(j.l,j,0,h);
				if(bpr) {
					iox=-bpr[1];
					t.createLr(bpr[1],bpr[4],p[1],p[0],-bpr[1],bpr[3],z+1,1,0,bpr[2],'',bpr[0],'',al);
					bw+=bpr[1];
				}
				bpr=DM_Border(j.r,j,0,h);
				if(bpr) {
					t.createLr(bpr[1],bpr[4],p[1],p[0],w,bpr[3],z+1,1,0,bpr[2],'',bpr[0],'',al);
					bw+=bpr[1];
				}
				bpr=DM_Border(j.t,j,1,bw);
				if(bpr) {
					ioy=-bpr[4];
					t.createLr(bpr[1],bpr[4],p[1],p[0],bpr[3],-bpr[4],z+1,1,0,bpr[2],'',bpr[0],'',al);
				}
				bpr=DM_Border(j.b,j,1,bw);
				if(bpr) {
					ih+=bpr[4];
					t.createLr(bpr[1],bpr[4],p[1],p[0],bpr[3],h,z+1,1,0,bpr[2],'',bpr[0],'',al);
				}
				iw=bw;
			}
			j=st.bar;
			if(j) {
				var o,bh=j.size[1],bw=j.size[0];
				if(bh<0) {
					bh=h;
				}
				if(bw<0) {
					bw=w;
				}
				bh=Math.min(bh,h);
				bw=Math.min(bw,w);
				t._bar=t.createLr(bw,bh,p[1],p[0],0,0,z+3,1,0,j.bgcolor,j.src,'',['mouseover',t._tid+'.clearTimer()','mouseout',t._tid+'.setTimer()'],al);
				DM_pre(j.src);
				if(j.drag) {
					t._dragbar=t._bar;
					var o=DM_el(t._l[t._bar][0])[0];
					DropMenu.regEventHandler("mousedown",t._path+".startDrag(ev)",o);
					DropMenu.regEventHandler("mouseup",t._path+".stopDrag()",o);
					if(ua.ie4up) {
						DropMenu.regEventHandler("dragstart","return false");
						DropMenu.regEventHandler("selectstart","return false");
					}
				}
			}
		} else {
			iox=t._fx1;
			ioy=t._fy1;
			iw=Math.max(iw,t._fx2-iox);
			ih=Math.max(ih,t._fy2-ioy);
		}
		t._iw=iw;
		t._ih=ih;
		if(ua.ie55up) {
			t.createLr(iw,ih,p[1],p[0],iox,ioy,z-1,1,0,'','','<iframe frameborder=0 '+(location.protocol=='https:'?' src="/blank.html"':'')+' style="filter:Alpha(Opacity=0);visibility:inherit;position:absolute;top:0px;left:0px;height:100%;width:100%"></iframe>');
		}
		for(i=t.items.length;i>0;) {
			t.items[--i].createChild();
		}
		t.created=1;
	};

	DPp.itSrc=function() {
		var i=0,src='',it=this.items;
		for(;i<it.length;) {
			src+=it[i++].src();
		}
		return src;
	};

	DPp.St=function(a,v) {
		this.style[a]=v;
	};

	DPp.StOver=function(a,v) {
		this.itemover[a]=v;
	};

	DPp.StOn=function(a,v) {
		this.itemon[a]=v;
	};

	DPp.Pos=function(a,v) {
		this.position[a]=v;
	};

	DPp.z=function(z) {
		this.style.z=z;
	};

	DPp.Separator=function(v) {
		this.separator=v;
	};

	DPp.AbsPos=function() {
		var p;
		if(this._top) {
			p=this.created?DM_getAbsPos(this._l[0][0]):this.position.pos;
		} else {
			p=this.position.pos||[0,0];
		}
		return[p[0],p[1]];
	};

	DPp.sizeItems=function() {
		for(var i=0;i<this.items.length;i++) {
			this.items[i].autoSize();
		}
	};

	DPp.moveItems=function(mv) {
		var i,ap,ix,iy,ox,oy,t=this;
		var dh=t.hor(),it=t.items,b=t.style.box,ioff=t.style.itemoffset;
		t._fx1=t._fy1=t._fx2=t._fy2=ox=oy=0;
		if(ua.nn4) {
			ap=(t._top&&!t.position.absolute?t.AbsPos():t.position.pos)||[0,0];
		}
		if(b) {
			var bar=t.style.bar;
			ix=Def(bar)&&bar.dir=='v'?bar.size[0]:0;
			iy=Def(bar)&&bar.dir=='h'?bar.size[1]:0;
		} else {
			iy=ix=0;
		}
		if(Def(ioff)) {
			ox=pI(ioff.x||0);
			oy=pI(ioff.y||0);
			if(b) {
				ix+=ox;
				iy+=oy;
			}
		}
		for(i=0;i<it.length;i++) {
			var p,s=it[i].style.size;
			if(b||!it[i].Pos()) {
				it[i].Pos([ix,iy]);
				if(dh) {
					ix+=s[0]+ox;
				} else {
					iy+=s[1]+oy;
				}
			}
			if(ua.nn4) {
				it[i].moveRel(ap[0],ap[1]);
			} else if(mv) {
				it[i].moveRel(0,0);
			}
			if(!b) {
				p=it[i].Pos();
				t._fx1=Math.min(t._fx1,p[0]);
				t._fy1=Math.min(t._fy1,p[1]);
				t._fx2=Math.max(t._fx2,p[0]+s[0]);
				t._fy2=Math.max(t._fy2,p[1]+s[1]);
			}
		}
	};

	DPp.moveSubs=function() {
		var o,p=this.AbsPos(),i=this._top?1:0;
		for(;i<this._l.length;) {
			o=this._l[i++];
			DM_moveTo(o[0],p[0]+o[1],p[1]+o[2]);
		}
	};

	DPp.moveLayers=function() {
		this.moveSubs();
		if(ua.nn4) {
			this.moveItems();
		}
	};

	DPp.Repos=function() {
		var t=this,p=t.position.pos,x=t.getAlignX()||p[0],v=t.vis;
		if(Def(x)) {
			if(v) {
				t.visible(0);
			}
			this.moveTo(x,p[1]);
			if(v) {
				t.visible(v);
			}
		}
	};

	DPp.getAlignX=function() {
		var x,ww=DropMenu.getWinWidth(),al=this.position.align,w=this.width();
		if(Def(al)) {
			if(al=='left') {
				x=0;
			} else if(al=='right') {
				x=ww-w;
			} else if(al=='center') {
				x=(ww-w)/2;
			}
		}
		return x;
	};

	DPp.imVis=function(v) {
		var i,it=this.items;
		for(i=0;i<it.length;i++) {
			it[i].visible(v);
		}
	};

	DPp.visible=function(v) {
		var i,t=this;
		t.vis=v;
		if(v&&t._p.width) {
			t._p.moveChild();
		}
		for(i=0;i<t._l.length;i++) {
			DM_vis(t._l[i][0],v);
		}
		if(ua.oldOpera||ua.nn4) {
			t.imVis(v);
		}
		if(t._p.setOver) {
			t._p.setOver(v);
		}
	};

	DPp.moveTo=function(x,y) {
		var i,o,p=this.position;
		p.pos=[x,y];
		if(this._l.length>0) {
			DM_moveTo(this._l[0][0],x,y);
			this.moveLayers();
		}
	};

	DPp.moveRel=function(x,y) {
		var w,h,off,wp,t=this,p=t.position,a=p.anchor,as=p.anchor_side;
		if(t._p.width) {
			w=t._p.width();
			h=t._p.height();
			if(a=='nw'||a=='sw'||a=='w') {
			} else if(a=='ne'||a=='se'||a=='e') {
				x+=w;
			}
			if(a=='nw'||a=='ne'||a=='n') {
			} else if(a=='sw'||a=='se'||a=='s') {
				y+=h;
			}
			if(a=='n'||a=='s') {
				x=Math.ceil(x+w/2);
			}
			if(a=='e'||a=='w') {
				y=Math.ceil(y+h/2);
			}
		}
		w=t.width(),h=t.height();
		if(as=='nw'||as=='sw'||as=='w') {
		} else if(as=='ne'||as=='se'||as=='e') {
			x-=w;
		}
		if(as=='nw'||as=='ne'||as=='n') {
		} else if(as=='sw'||as=='se'||as=='s') {
			y-=h;
		}
		if(as=='n'||as=='s') {
			x-=Math.floor(w/2);
		}
		if(as=='e'||as=='w') {
			y-=Math.floor(h/2);
		}
		if(Def(off=p.menuoffset)) {
			x+=off.x;
			y+=off.y;
		}
		wp=DropMenu.getScrollX()+DropMenu.getWinWidth()-t._iw;
		if(x>wp) {
			x=wp;
		}
		if(x<0) {
			x=0;
		}
		wp=DropMenu.getScrollY()+DropMenu.getWinHeight()-t._ih;
		if(y>wp) {
			y=wp;
		}
		if(y<0) {
			y=0;
		}
		t.moveTo(x,y);
	};

	DPp.hor=function() {
		return this.style.direction=='h';
	};

	DPp.width=function(c) {
		var i,obj,h,r=0,ix=0,t=this,it=t.items;
		if(t.style.box) {
			if(!Undef(t._b)&&!c) {
				r=DM_getWidth(t._l[t._b][0]);
			} else {
				h=t.hor();
				if(Def(obj=t.style.itemoffset)) {
					ix=obj.x;
				}
				for(i=0;i<it.length;i++) {
					var iw=it[i].style.size[0];
					r=h?r+iw+ix:Math.max(r,iw);
				}
				r+=(h?1:2)*ix;
				if(Def(obj=t.style.bar)&&obj.dir=='v') {
					r+=obj.size[0];
				}
			}
		} else {
			r=it[0].style.size[0];
		}
		return r;
	};

	DPp.height=function(c) {
		var i,h,obj,r=0,iy=0,t=this,it=t.items;
		if(t.style.box) {
			if(!Undef(t._b)&&!c) {
				r=DM_getHeight(t._l[t._b][0]);
			} else {
				h=t.hor();
				if(Def(obj=t.style.itemoffset)) {
					iy=obj.y;
				}
				for(i=0;i<it.length;i++) {
					var ih=it[i].style.size[1];
					r=h?Math.max(r,ih):r+ih+iy;
				}
				r+=(h?2:1)*iy;
				if(Def(obj=t.style.bar)&&obj.dir=='h') {
					r+=obj.size[1];
				}
			}
		} else {
			r=it[0].style.size[1];
		}
		return r;
	};

	DPp.createItems=function(def) {
		this.items=[];
		var i,it=def.items;
		if(Undef(it)) {
			return;
		}
		if(Undef(it.length)&&Def(it.item)) {
			it=it.item;
		}
		if(Undef(it.length)) {
			it=[it];
		}
		for(i=0;i<it.length;i++) {
			this.addItem(it[i]);
		}
	};

	DPp.addItem=function(def) {
		var it=this.items;
		return it[it.length]=new DMenuItem(def,this,this._path+".items["+it.length+"]");
	};

	DPp.delItem=function(i) {
		var j,it=this.items;
		if(i<it.length&&i>=0) {
			it[i]=null;
			it=this.items=it.slice(0,i).concat(it.slice(i+1));
			for(j=0;j<it.length;) {
				it[j]._path=this._path+".items["+j+++"]";
			}
		}
	};

	DPp.getItem=function(i) {
		return i<this.items.length?this.items[i]:null;
	};

	DPp.startDrag=function(e) {
		var t=this;
		if(!t.position.absolute) {
			return;
		}
		DropMenu.regEventHandler('mousemove',t._path+'.dragTo(ev)');
		var p=t.AbsPos();
		t._drdX=p[0]-e.x;
		t._drdY=p[1]-e.y;
		t._p.hide();
		t._p.state(0);
	};

	DPp.stopDrag=function() {
		DropMenu.clearEventHandler('mousemove');
		this.Repos();
		this._p.state(1);
	};

	DPp.dragTo=function(e) {
		this.moveTo(e.x+this._drdX,e.y+this._drdY);
	};

}

function DMenuItem(def,p,path) {
	this._p=p;
	this._tid=p._tid;
	this._path=path;
	if(Def(def)&&def.type=='separator') {
		def=p.separator;
		def.type='separator';
	}
	this.initDef(def);
	this._l=[];
};

{var DMp=DMenuItem.prototype;

	DMp.lrSrc=DM_mnuLrSource;

	DMp.initDef=function(def) {
		var t=this;
		if(Empty(def)) {
			def={};
		}
		t.text=def.text;
		t.textover=def.textover;
		t.texton=def.texton;
		var o=t.style=def.style||{};
		if(Def(o.size)) {
			o.size[0]=pI(o.size[0]);
			o.size[1]=pI(o.size[1]);
		}
		if(Def(o.shadow)) {
			o.shadow.width=pI(o.shadow.width||5);
		}
		if(Def(o.border)) {
			o.border.width=pI(o.border.width||1);
		}
		o.z=o.z||(t._p.style.z+5);
		t.styleover=def.styleover||{};
		t.styleon=def.styleon||{};
		DM_copy(t._p.style,t.style,0,t._p.style.box);
		DM_copy(t._p.itemover,t.styleover,0);
		DM_copy(t._p.itemon,t.styleon,0);
		if(def.menu) {
			t.menu=new DPopupMenu(def.menu,t,t._p,t.child());
		} else {
			t.menu=null;
		}
		t.action=def.action||{};
		DM_copy(t._p.defaction,t.action,0);
		var o=t.position=def.position||{};
		if(Def(o.pos)) {
			o.pos[0]=pI(o.pos[0]);
			o.pos[1]=pI(o.pos[1]);
		}
		t.type=def.type;
		t.sep=def.type=='separator';
		t.bool=def.type=='bool';
		t.val=pB(def.value,0);
		t.frm=pB(def.frm,0);
	};

	DMp.src=function() {
		var t=this,src='';
		var p=t.Pos()||[0,0],st=t.style,s=st.size,_z=st.z,vis=!ua.nn4||t._p.vis,m_o=t.sep||t.frm;
		var op=st.opacity;
		var w=s[0],h=st.autosize&&!t.sep?'':s[1],x=p[0],y=p[1],ox=0,oy=0;
		var act=t.action,js=act.js,url=act.url,target=act.target;
		var anch=!m_o&&(js||url||t.bool);
		var p_p=t._p._path;
		if(anch) {
			src+='<a href="'+(url||'#')+(target?'" target="'+target:'')+'" onClick="'+(t.bool?t._path+'.toggle();':'')+(ua.nn4?'':'this.blur();')+t._tid+'.hide();'+(js?js:url?'':'return false')+'" title="'+(act.title||'')+'">';
		}
		if(!m_o) {
			t._imid=DropMenu.newID();
			src=t.lrSrc(w,h,y,x,0,0,_z+5,1,vis,'','','',src+'<img border=0 '+(ua.nn4?'name=':'id=')+t._imid+' src="'+DM_IMG_BLANK+'" width='+w+' height='+s[1]+'>'+(anch?'</a>':''),['mouseover',t._tid+".handleEvent('i',"+p_p+(!m_o?","+t.child()+","+t._path:'')+");DropMenu.cancelEvent(event)",'mouseout',t._tid+".handleEvent('o',"+p_p+",null"+(!m_o?","+t._path:'')+");DropMenu.cancelEvent(event)"]);
		}
		var bg=st.bgimg,bgc=st.bgcolor,brd=st.border;
		src+=t.lrSrc(w,h,y,x,ox,oy,_z+2,1,vis,bgc,bg,brd,t.sep?'':t.gHTML(0),'',op);
		if(!m_o) {
			src+=t.lrSrc(w,h,y,x,ox,oy,_z+4,1,0,t.styleover.bgcolor||bgc,t.styleover.bgimg||bg,t.styleover.border||brd,t.gHTML(1),'',op);
		}
		if(!m_o&&t.bool&&!t.menu) {
			src+=t.lrSrc(w,h,y,x,ox,oy,_z+3,1,vis&&t.val,t.styleon.bgcolor||bgc,t.styleon.bgimg||bg,t.styleon.border||brd,t.gHTML(2),'',op);
		}
		var v=st.shadow;
		if(v) {
			src+=t.lrSrc(w,h,y,x,v.width,v.width,_z,1,vis,v.color,'','','','',v.opacity||op);
		}
		return src;
	};

	DMp.gHTML=function(n) {
		var t=this;
		var sto,st=t.style;
		var im,ei=st.imgendoff,brd=st.border,w=st.size[0],h=st.size[1],txt=t.text;
		if(t.menu) {
			im=st.imgdir;
		} else {
			im=st.imgitem;
			if(ei) {
				ei={src:DM_IMG_BLANK,width:ei.width,height:ei.height};
			}
		}
		var al=st.align,css=st.css,tcol=st.color;
		if(n==0) {
			return t.doHTML(w,h,tcol,css,al,t.text,im,ei,brd);
		}
		if(n==1) {
			txt=t.textover||txt;
			sto=t.styleover;
			if(t.menu) {
				im=sto.imgdir||st.imgdiropen||im;
				ei=st.imgendon||ei;
			} else {
				im=sto.imgitem||im;
			}
		} else if(n==2) {
			txt=t.texton||txt;
			sto=t.styleon;
			im=sto.imgitem||im;
		}
		return t.doHTML(w,h,sto.color||tcol,sto.css||css,sto.align||al,txt,im,ei,sto.border||brd);
	};

	DMp.fillLr=function() {
		var t=this;
		DM_HTML(t._l[1][0],t.gHTML(0));
		if(!t.sep) {
			DM_HTML(t._l[2][0],t.gHTML(1));
		}
		if(t.bool) {
			DM_HTML(t._l[3][0],t.gHTML(2));
		}
	};

	DMp.doHTML=function(lw,lh,fn,css,al,txt,img,ei,b) {
		var spc,iw,ih,w,isrc='',src='';
		if(txt||Def(img)||Def(ei)) {
			src='<table border=0 cellpadding=0 cellspacing=0 width=100%><tr>';
			if(b) {
				lw-=2*b.width;
				lh-=2*b.width;
			}
			if(img) {
				spc=img.space||this.style.imgspace;
				spc=pI(spc||0);
				iw=pI(img.width);
				ih=pI(img.height);
				w=iw+spc*2;
				lw-=w;
				src+='<td width='+w+' height='+ih+'><img src="'+img.src+'" width='+iw+' height='+ih+' hspace='+spc+' border=0></td>';
			}
			if(ei) {
				spc=ei.space||this.style.imgspace;
				spc=pI(spc||0);
				iw=pI(ei.width);
				ih=pI(ei.height);
				w=iw+spc*2;
				lw-=w;
				isrc='<td width='+w+' height='+ih+' align=right><img src="'+ei.src+'" width='+iw+' height='+ih+' hspace='+spc+' border=0></td>';
			}
			if(txt) {
				src+='<td'+(al?' align='+al:'')+' height="'+lh+'" width="'+lw+'"><div'+(css?' class="'+css+'"':'')+'>'+(fn?'<font color='+fn+'>'+txt+'</font>':txt)+'</div></td>';
			}
			src+=isrc+'</tr></table>';
		}
		return src;
	};

	DMp.createChild=function() {
		if(this.menu) {
			this.menu.create();
		}
	};

	DMp.child=function() {
		return this._path+".menu";
	};

	DMp.St=function(a,v) {
		this.style[a]=v;
	};

	DMp.StOver=function(a,v) {
		this.styleover[a]=v;
	};

	DMp.StOn=function(a,v) {
		this.styleon[a]=v;
	};

	DMp.z=function(z) {
		this.style.z=z;
	};

	DMp.Act=function(a,v) {
		this.action[a]=v;
	};

	DMp.visible=function(v) {
		var i,t=this;
		if(t._l.length) {
			for(i=0;i<t._l.length;) {
				DM_fnv(t._l[i++][0],v);
			}
			if(t.bool) {
				t.setBool(true);
			} else if(t._l[2]) {
				DM_hide(t._l[2][0]);
			}
		}
	};

	DMp.Pos=function(p) {
		return Def(p)?this.position.pos=p:this.position.pos;
	};

	DMp.Type=function(t) {
		if(Def(t)) {
			if(t=='separator') {
				this.initDef(this._p.separator);
				this.sep=1;
			}
			this.type=t;
			this.bool=t=='bool';
		}
		return this.type;
	};

	DMp.AbsPos=function() {
		var pos=this._p.AbsPos();
		pos[0]+=this.Pos()[0];
		pos[1]+=this.Pos()[1];
		return pos;
	};

	DMp.width=function() {
		return this.style.size[0];
	};

	DMp.height=function() {
		return this.style.size[1];
	};

	DMp.autoSize=function() {
		var i,t=this,h=0,b=0;
		if(t.sep) {
			return;
		}
		var inc=ua.moz||ua.oldOpera||ua.nn4?0:1;
		for(i=0;i<t._l.length;i++) {
			h=Math.max(h,DM_getContentHeight(t._l[i][0]=DM_el(t._l[i][0])[0])+2*t._l[i][3]*inc);
		}
		t.style.size=[t.style.size[0],h];
		for(i=0;i<t._l.length;i++) {
			DM_setHeight(t._l[i][0],h-2*t._l[i][3]*(!inc&&!ua.oldOpera));
		}
		if(t._imid) {
			DropMenu.findElement(t._imid).height=h;
		}
	};

	DMp.moveChild=function() {
		if(this.menu) {
			var ap=this.AbsPos();
			this.menu.moveRel(ap[0],ap[1]);
		}
	};

	DMp.moveRel=function(x,y) {
		var i=0,l=this._l,p=this.Pos();
		for(;i<l.length;i++) {
			DM_moveTo(l[i][0],x+p[0]+l[i][1],y+p[1]+l[i][2]);
		}
	};

	DMp.over=function() {
		var t=this;
		DM_fnv(t._l[2][0],1);
		DM_hide(t._l[1][0]);
		var scr=t.action.over;
		if(Def(scr)) {
			eval(scr);
		}
		if(t.bool) {
			DM_hide(t._l[3][0]);
		}
	};

	DMp.out=function() {
		if(!this.menu||!this._over) {
			this.setBool(1);
			var scr=this.action.out;
			if(Def(scr)) {
				eval(scr);
			}
		}
	};

	DMp.setOver=function(v) {
		this._over=v;
		this.setBool(!v);
	};

	DMp.setBool=function(v) {
		var t=this;
		if(v) {
			DM_hide(t._l[2][0]);
			if(!(ua.nn4||ua.oldOpera)||t._p.vis) {
				if(t.bool) {
					DM_fnv(t._l[1][0],!t.val);
					DM_fnv(t._l[3][0],t.val);
				} else {
					DM_fnv(t._l[1][0],1);
				}
			}
		}
	};

	DMp.toggle=function() {
		var t=this;
		t.val=!t.val;
		DM_fnv(t._l[1][0],!t.val);
		DM_fnv(t._l[3][0],t.val);
		var code=t.val?t.action.on:t.action.off;
		if(Def(code)) {
			eval(code);
		}
	};

	DMp.addPopup=function(def) {
		var t=this;
		delete t.menu;
		t.menu=new DPopupMenu(def,t,t._p,t.child());
		if(t._p.created) {
			t.fillLr();
		}
		return t.menu;
	};

	DMp.delPopup=function() {
		var t=this;
		if(t.menu) {
			t.menu.visible(0);
			delete t.menu;
		}
		if(t._p.created) {
			t.fillLr();
		}
	};

	DMp.refresh=function() {
		this.moveChild();
	};

	DMp.setText=function(s,t) {
		this['text'+(t||'')]=s;
	};

}

var _DM_menus=[];

function DM_m_load() {
	for(var i=0;i<_DM_menus.length;) {
		_DM_menus[i++].run(1);
	}
	DropMenu.setOnResize(DM_m_res,1);
};

function DM_m_res() {
	if(ua.oldOpera||ua.nn4) {
		if(Empty(window._DM_reloading)) {
			window._DM_reloading=1;
			location.reload(1);
		}
	} else {
		for(var i=0;i<_DM_menus.length;) {
			_DM_menus[i++].movePos();
		}
	}
};

if(ua.oldOpera) {
	DropMenu.setOnLoad(DM_m_load);
} else {
	DropMenu.setOnResize(DM_m_res);
}

