var K_URL="img/",bBgCOn='#6087ad',bBgCOf='#7fa2c4',bBgCOf1='#FFFFFF',bCOn='#FFFFFF',bCOf='#cfdcec',mBgCOn='#e9eff5',mBgCOf='#7fa2c4',mBgCOf1='#FFFFFF',mCOn='#6087ad',mCOf='#6087ad',mCOf2='#cfdcec', bBdC='#FAF9F7',mBdC='#cfdcec',fFmly='verdana',fSz=10,mArrOn=K_URL+"seta.gif",mArrOf=K_URL+"seta_off.gif", cellH=21,pL=6,pR=6,pT=2,pB=2,pK=2,vSBCL1=1,hSBCL1=3,vSBCL2=2,hSBCL2=-2,st=new Array( '.BT{BORDER-TOP: '+bBdC+' 0px solid;BORDER-BOTTOM: '+bBdC+' 0px solid;BORDER-LEFT: '+bBdC+' 0px solid;BORDER-RIGHT: '+bBdC+' 0px solid;FONT-WEIGHT: normal;FONT-FAMILY: '+fFmly+';letter-spacing: 0px;}' ,'.BD{CURSOR: pointer;CURSOR: hand;PADDING-TOP: '+pT+'px;PADDING-BOTTOM: '+pB+'px;PADDING-LEFT: '+pL+'px;PADDING-RIGHT: '+pR+'px;BORDER-TOP: '+bBdC+' 0px solid;BORDER-BOTTOM: '+bBdC+' 0px solid;BORDER-LEFT: '+bBdC+' 2px solid;BORDER-RIGHT: '+bBdC+' 0px solid;BORDER-RIGHT: '+bBdC+' 0px solid;FONT-SIZE: '+fSz+'px;font-weight: bold;COLOR: '+bCOf+';BACKGROUND-COLOR: '+bBgCOf+';height: '+cellH+'}' ,'.MV{VISIBILITY: hidden;WIDTH: 0px;POSITION: absolute;BACKGROUND-COLOR: '+mBgCOf+'}' ,'.MT{BORDER-TOP: '+mBdC+' 1px solid;BORDER-BOTTOM: '+mBdC+' 0px solid;BORDER-RIGHT: '+mBdC+' 1px solid;BORDER-LEFT: '+mBdC+' 1px solid;FONT-SIZE: '+fSz+'px;FONT-FAMILY: '+fFmly+'}' ,'.MR{font-weight: bold;COLOR: '+mCOn+';BACKGROUND-COLOR: '+mBgCOf1+'}' ,'.MD1{CURSOR: pointer;CURSOR: hand;PADDING-TOP: '+pT+'px;PADDING-BOTTOM: '+pB+'px;PADDING-LEFT: '+pL+'px;PADDING-RIGHT: '+pK+'px;BORDER-TOP: '+mBdC+' 0px solid;BORDER-BOTTOM: '+mBdC+' 1px solid;BORDER-LEFT: '+mBdC+' 0px solid;BORDER-RIGHT: '+mBdC+' 0px solid;COLOR: '+mCOf+';FONT-SIZE: '+fSz+'px;height: '+cellH+'}' ,'.MD2{CURSOR: pointer;CURSOR: hand;PADDING-TOP: '+pT+'px;PADDING-BOTTOM: '+pB+'px;PADDING-LEFT: '+pK+'px;PADDING-RIGHT: '+pR+'px;BORDER-TOP: '+mBdC+' 0px solid;BORDER-BOTTOM: '+mBdC+' 1px solid;BORDER-LEFT: '+mBdC+' 0px solid;BORDER-RIGHT: '+mBdC+' 0px solid;COLOR: '+mCOf2+';FONT-SIZE: '+fSz+'px;height: '+cellH+'}' ,'.MD3{text-align: center;CURSOR: pointer;CURSOR: hand;PADDING-TOP: '+pT+'px;PADDING-BOTTOM: '+pB+'px;PADDING-LEFT: '+pL+'px;PADDING-RIGHT: '+pR+'px;BORDER-TOP: '+mBdC+' 0px solid;BORDER-BOTTOM: '+mBdC+' 1px solid;BORDER-LEFT: '+mBdC+' 0px solid;BORDER-RIGHT: '+mBdC+' 0px solid;COLOR: '+mCOf+';FONT-SIZE: '+fSz+'px;height: '+cellH+'}');var K_TTW=300, isIE=document.all?true:false, iTC=new Array('SELECT','OBJECT','INPUT'), MB=new Array(), iMB=0, K_MB="b",K_MI="i",K_M="m",K_MS='s',K_TAB="a",K_DIV="d",K_TR="t",K_IMG="g",K_SEP='separador', aP=null, aPT=null;
function dwln(s){
	document.writeln(s);
}
function dg(i){
	return document.getElementById(i);
}
function dgN(i){
	return document.getElementsByName(i);
}
function dw(s){
	document.write(s);
}
function IsNill(p){
	return p==null||(typeof(p)=="undefined")||String(p)=="";
}
function getMB(aId){
	var s=aId.substring(0,K_MB.length+2);
	return MB[s].ref;
}
function getStream(aId){
	var s=aId.substring(0,K_MB.length+2);
	var n=aId.length/3-2;
	if(MB[s].iL<n+1){
		var o=new Object();
		o.s="";
		++MB[s].iL;MB[s].ss[n]=o;
	}
	return MB[s].ss[n];
}
function LZ(n){
	n=parseInt(n,10);
	if( n < 10) return '0'+n;
	else return n;
}
function IAdd(aLabel,aLink,isPopUp){
	var isInMB=false;
	if(this.t==K_MI){
		this.v=new Array();
		this.size=0;
		this.t=K_M;
		var n=this.id.indexOf(K_MI);
		this.id=this.id.substring(0,n)+K_M+this.id.substr(n+1);
	}else if(this.t==K_MB){
		isInMB=true;
	}
	var aNewId=this.id+K_MI+LZ(this.size);
	var aNewMI=new IMenuItem(this,aNewId,isInMB,aLabel,aLink,isPopUp);
	this.v[this.size++]=aNewMI;
	return aNewMI;
}
function IGet(aId){
	if(this.id==aId){
		return this;
	}
	if(this.t==K_MI||this.t==K_MS){
		return null;
	}
	var m=null;
	for(var i=0;i<this.v.length;++i){
		m=this.v[i].get(aId);
		if(m!=null)break;
	}
	return m;
}
function IMenuBar(){
	var aId=iMB++;this.v=new Array();
	this.size=0;
	this.add=IAdd;
	this.ac=IAdd;
	this.get=IGet;
	this.draw=IMBDraw;
	this.t=K_MB;
	this.id=K_MB+LZ(aId);
	var o=new Object();
	o.ref=this;
	o.ss=new Array();
	o.iL=0;
	MB[this.id]=o;
}
function IMBDraw(){
	dw("<STYLE>");
	for(var i=0;i<st.length;++i){
		dwln(st[i]);
	}
	dw("</STYLE>");
	if(this.v.length>0){
		getStream(this.v[0].id).s+="<TABLE id=IMB name=IMB "+"class=BT cellSpacing=0 ><TBODY><TR>";
		for(var i=0;i<this.v.length;++i){
			this.v[i].draw();
		}
		getStream(this.v[0].id).s+="</TR></TBODY></TABLE>";
	}
	for(var i=0;i<MB[this.id].ss.length;++i){
		dw(MB[this.id].ss[i].s);
		MB[this.id].ss[i].s=null;
	}
	document.close();
}
function IMenuItem(aParent,aId,isInMB,aLabel,aLink,isPopUp){
	this.p=aParent;
	if(aLabel==K_SEP){
		this.t=K_MS;
		var n=aId.indexOf(K_MI);
		this.id=aId.substring(0,n)+K_MS+aId.substr(n+1);
	}else{
		this.t=K_MI;this.id=aId;
	}
	this.isInMB=isInMB;
	this.label=aLabel;
	this.link=aLink;
	this.isPU=isPopUp;
	this.add=IAdd;
	this.ac=IAdd;
	this.get=IGet;
	this.draw=IMIDraw;
	this.OMOvr=OMOvr;
	this.OMOut=OMOut;
	this.OMIOut=OMIOut;
	this.OMIOut1=OMIOut1;
	this.OMIOvr=OMIOvr;
	this.OMIClk=OMIClk;
}

function IMIDraw(){
	if(this.isInMB){
		getStream(this.id).s+='<TD id='+this.id+' name='+this.id+' onmouseover="IMIOnMouseOver(isIE?event.srcElement:this)" onmouseout="IMIOnMouseOut(isIE?event.srcElement:this)" onclick="IMIOnClick(isIE?event.srcElement:this)" '+'class=BD noWrap >'+this.label+'</TD>';
		if(this.t==K_M){
			getStream(this.v[0].id).s+='<DIV id='+K_DIV+this.id+' name='+K_DIV+this.id+' class=MV>'+'<TABLE  id='+K_TAB+this.id+' name='+K_TAB+this.id+' onmouseout="IMOnMouseOut(isIE?event.srcElement:this)" onmouseover="IMOnMouseOver(isIE?event.srcElement:this)" '+'class=MT cellSpacing=0 >'+'<TBODY>';
			for(var i=0;i<this.v.length;++i){
				this.v[i].draw();
			}
			getStream(this.v[0].id).s+='</TBODY></TABLE></DIV>';
		}
	}else{
		if(this.t==K_M){
			getStream(this.id).s+='<TR  id='+this.id+' name='+this.id+' onmouseover="IMIOnMouseOver(isIE?event.srcElement:this)" onclick="IMIOnClick(isIE?event.srcElement:this)" onmouseout="IMIOnMouseOut(isIE?event.srcElement:this)" '+'class=MR> '+'<TD id='+this.id+' name='+this.id+' class=MD1 noWrap >'+this.label+'</TD>'+'<TD id='+this.id+' name='+this.id+' class=MD2 noWrap >'+'<IMG id='+K_IMG+this.id+' src="'+mArrOf+'" align=right border=0>'+'</TD></TR>';
			getStream(this.v[0].id).s+='<DIV align="center" id='+K_DIV+this.id+' name='+K_DIV+this.id+' class=MV>'+'<TABLE id='+K_TAB+this.id+' name='+K_TAB+this.id+' onmouseout="IMOnMouseOut(isIE?event.srcElement:this)" onmouseover="IMOnMouseOver(isIE?event.srcElement:this)" '+'class=MT cellSpacing=0 >'+'<TBODY>';
			for(var i=0;i<this.v.length;++i){
				this.v[i].draw();
			}
			getStream(this.v[0].id).s+='</TBODY></TABLE></DIV>';
		}else getStream(this.id).s+='<TR  id='+this.id+' name='+this.id+(this.t==K_MI?' onmouseover="IMIOnMouseOver(isIE?event.srcElement:this)" onclick="IMIOnClick(isIE?event.srcElement:this)" onmouseout="IMIOnMouseOut1(isIE?event.srcElement:this)" ':' ')+'class=MR>'+'<TD id='+this.id+' name='+this.id+' class=MD3 noWrap colSpan=2 >'+(this.t==K_MI?this.label:'<HR color='+mCOf+' size=1>')+'</TD></TR>';
	}
}
function OMIClk(v){
	if(!IsNill(this.link)){
		if(!IsNill(this.isPU)&&this.isPU)open(this.link);
		else location.href=this.link;
	}
}
function OMOvr(v){
	while(v.tagName!="TABLE") v=v.parentNode;
	if(v==null) return;
	var dId=K_DIV+v.id.substr(K_TAB.length);
	if(aPT!=null){
		clearTimeout(aPT);
		aPT=null;
	}
}function OMOut(v){
	while(v.tagName!="TABLE") v=v.parentNode;
	if(v==null) return;
	var dId=K_DIV+v.id.substr(K_TAB.length);
	myST(dId,aP);
}
function Hide(i,t,r,withTO){
	if(arguments.length<3){
		withTO=true;
		r=false;
	}else if(arguments.length<4)withTO=true;var mI=false;var d=dg(i);
		if(d==null)return;
		if(d.id.length>7){
			var x=d.id.substr(1);
			var col=dgN(x);
			for(var w=0;w<col.length;++w){
				with(col[w].style){
					backgroundColor=mBgCOf1;
					color=mCOf;
				}
			}
			dg(K_IMG+x).src=mArrOf;
		}else if(d.id.length==7){
			var k=d.id.substr(1);
			var col=dgN(k);
			for(var w=0;w<col.length;++w){
				with(col[w].style){
					backgroundColor=bBgCOf;color=bCOf;
				}
			}
			mI=true;
		}
		d.style.visibility="hidden";
		if(isIE&&((aP==null&&mI)||!isOn(d))){
			showItems();
		}
		if(d.id.length>7&&aP==d.id&&!r){
			var dId=d.id.substring(0,d.id.length-3);
			aP=dId;
			if(withTO){
				myST(dId,aP);
				bS=false;
			}else{
				Hide(dId,aP);
				bS=false;
			}
		}else if(aP!=null&&aP.indexOf(d.id)!=-1){
			var z=aP;if(aP.length==7){
			aP=null;
		}else{
			aP=aP.substring(0,aP.length-3);
		}
		Hide(z,aP);
		bS=false;
	}
}
function myST(pTH,oPU){
	if(aPT!=null){
		clearTimeout(aPT);
		aPT=null;
	}
	aPT=setTimeout('Hide("'+pTH+'","'+oPU+'")',K_TTW);
}
function OMIOut(v){
	var myPopUp=this.isInMB?(K_DIV+v.id):(K_DIV+v.id.substr(0,v.id.length));
	if(this.isInMB&&this.t==K_M){
		myST(myPopUp,aP);
	}else if(this.t!=K_M){
		var col=dgN(v.id);
		for(var w=0;w<col.length;++w){
			with(col[w].style){
				backgroundColor=mBgCOf;color=mCOf2;
			}
		}
	}
}
function OMIOut1(v){
	var myPopUp=this.isInMB?(K_DIV+v.id):(K_DIV+v.id.substr(0,v.id.length));
	if(this.isInMB&&this.t==K_M){
		myST(myPopUp,aP);
	}else if(this.t!=K_M){
		var col=dgN(v.id);
		for(var w=0;w<col.length;++w){
			with(col[w].style){
				backgroundColor=mBgCOf1;color=mCOf;
			}
		}
	}
}
function OMIOvr(v){
	var a=this.isInMB;
	var myPopUp=a?(K_DIV+v.id):(K_DIV+v.id.substr(0,v.id.length-3));
	if(aP!=null){
		var b=myPopUp!=aP;
		if((aPT!=null)&&((a==b)||(!b||a))){
			if(aP.indexOf(myPopUp)!=-1){
				clearTimeout(aPT);
				aPT=null;
			}
		}
		if(b){
			if( !(!this.isInMB&&(aP.substr(1)==v.id)) ){
				Hide(aP,myPopUp, aP.indexOf(myPopUp)!=-1,false);
			}
		}
	}
	var col=dgN(v.id);
	for(var w=0;w<col.length;++w){
		with(col[w].style){
			backgroundColor=a?bBgCOn:mBgCOn;
			color=a?bCOn:mCOn;
		}
	}
	if(this.t==K_M){
		var p=GetM(a?v:isIE?(this.t==K_MS?v.parentNode.parentNode:v.parentNode):v);
		var x=a?(p.x+hSBCL1):(p.x+p.w+hSBCL2);
		var y=a?(p.y+vSBCL1+p.h):(p.y+vSBCL2);
		if(!a){
			myPopUp=K_DIV+v.id;
			dg(K_IMG+v.id).src=mArrOn;
		}
		var d=dg(myPopUp);
		var dm=GetM(d);
		if(parseInt(x+dm.w)>document.body.clientWidth){
			x=x-dm.w+(a?(p.w-hSBCL1):(-p.w-hSBCL2));
		}
		if(isIE){
			checkItems(y,x,dm.w,dm.h);
		}
		with(d.style){
			top=y+1;
			left=x;
			visibility="visible";
		}
		aP=myPopUp;
	}
}
function IMOnMouseOver(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	else if(!isIE)OMOvr(v);
	else if(v.tagName=="TABLE")return;
	else{
		var m=getMB(v.id).get(v.id);
		if(m!=null)m.OMOvr(v);
	}
}
function IMOnMouseOut(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	else if(!isIE)OMOut(v);
	else if(v.tagName=="TABLE")return;
	else{
		var m=getMB(v.id).get(v.id);
		if(m!=null)m.OMOut(v);
	}
}
function IMIOnMouseOut(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	var m=getMB(v.id).get(v.id);
	if(m!=null)m.OMIOut(v);
}
function IMIOnMouseOut1(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	var m=getMB(v.id).get(v.id);
	if(m!=null)m.OMIOut1(v);
}
function IMIOnMouseOver(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	var m=getMB(v.id).get(v.id);
	if(m!=null)m.OMIOvr(v);
}
function IMIOnClick(v){
	if(v.tagName=="HR"||v.tagName=="IMG")v=v.parentNode;
	var m=getMB(v.id).get(v.id);
	if(m!=null)m.OMIClk(v);
}
function GetM(e){
	l=e.offsetLeft;t=e.offsetTop;w=e.offsetWidth;
	if(w==0)w=200;
	h=e.offsetHeight;
	p=e.offsetParent;
	while(p.tagName!="BODY"){
		l+=p.offsetLeft;
		t+=p.offsetTop;p=p.offsetParent;
	}
	return new Measure(l,t,w,h);
}
function Measure(x,y,w,h){
	this.x=x;
	this.y=y;
	this.w=w;
	this.h=h;
}
function Point(x,y){
	this.x=x;
	this.y=y;
}
function Rect(x,y,w,h){
	this.tL=new Point(x,y);
	this.bR=new Point(x+w, y+h);
}
function intersectRectRect(a1,a2,b1,b2){
	var rC=false;
	if(a2.y>=b1.y&&a1.y<=b2.y&&a2.x>=b1.x&&a1.x<=b2.x||b2.y>=a1.y&&b1.y<=a2.y&&b2.x>=a1.x&&b1.x<=a2.x) rC=true;
	return rC;
}
function containsRectRect(a1,a2,b1,b2){
	var rC=false;
	if(b1.x>=a1.x&&b1.x<=a2.x&&b1.y>=a1.y&&b1.y<=a2.y&&b2.x>=a1.x&&b2.x<=a2.x&&b2.y<=a2.y&&b2.y>=a1.y)rC=true;
	else if(a1.x>=b1.x&&a1.x<=b2.x&&a1.y>=b1.y&&a1.y<=b2.y&&a2.x<=b2.x&&a2.x>=b1.x&&a2.y<=b2.y&&a2.y>=b1.y)rC=true;
	return rC;
}
function checkItems(y,x,w,h){
	var r1,r2,m,o,cI;
	r1=new Rect(x,y,w,h);
	for(var j=0;j<iTC.length;++j){
		cI=document.all.tags(iTC[j]);
		for(var i=0;i<cI.length;++i){
			o=cI[i];
			if(!o||!o.offsetParent)continue;
			m=GetM(o);
			r2=new Rect(m.x,m.y,m.w,m.h);
			if(containsRectRect(r1.tL,r1.bR,r2.tL,r2.bR)||intersectRectRect(r1.tL,r1.bR,r2.tL,r2.bR))o.style.visibility="hidden";
		}
	}
}
function showItems(){
	var cI,o;
	for(var j=0;j<iTC.length;++j){
		cI=document.all.tags(iTC[j]);
		for(var i=0;i<cI.length;++i){
			o=cI[i];
			o.style.visibility="visible";
		}
	}
}
function isOn(e){
	var mb=getMB(e.id.substr(1)),d,c,b;
	for(var i=0;i<mb.v.length;++i){
		d=dg(mb.v[i].id);
		c=d.style.color;
		b=d.style.backgroundColor;
		if((!IsNill(c)&&c.toUpperCase()==bCOn)||(!IsNill(b)&&b.toUpperCase()==bBgCOn)){
			return true;
		}
	}
	return false;
}

