NS6 = (document.getElementById&&!document.all)
IE = (document.all)
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4")

patronatoItems=new Array();
escuelasItems=new Array();
festivalItems=new Array();
actoresItems=new Array();
auditorioItems=new Array();

ssm = new Array();
bssm = new Array();
bssm2 = new Array();
moving = new Array();

moving['Patronato']=setTimeout('null',1);
moving['Escuelas']=setTimeout('null',1);
moving['Festival']=setTimeout('null',1);
moving['Actores']=setTimeout('null',1);
moving['Auditorio']=setTimeout('null',1);

function buildMenu(section, elementos) {
document.write('<DIV style="position:relative; left: 2px; background-color: transparent;">');
if (IE||NS6) {document.write('<DIV ID="basessm'+section+'" style="visibility:hidden;Position : absolute ;Left : '+XOffset+'px ;Top : '+YOffset+'px ;Z-Index : 20;width:'+(menuWidth+10)+'px"><DIV ID="thessm'+section+'" style="Position : Absolute ;Left : '+(-menuWidth-20)+'px ;Top : 0 ;Z-Index : 20;" onmouseover="moveOut(\''+section+'\')" onmouseout="moveBack(\''+section+'\')">')}
if (NS) {document.write('<LAYER name="basessm'+section+'1" top="'+YOffset+'" LEFT='+XOffset+' visibility="show"><ILAYER name="basessm'+section+'2"><LAYER visibility="hide" name="thessm'+section+'" left="'+(-menuWidth+50)+'" onmouseover="moveOut(\''+section+'\')" onmouseout="moveBack(\''+section+'\')">')}
if (NS6){document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+(menuWidth)+'px"><TR><TD>')}
document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+(menuWidth)+'px" style="border-collapse: collapse">');
for(i=0;i<elementos.length;i++) {
	if(!elementos[i][3]){elementos[i][3]=menuCols;elementos[i][5]=menuWidth-1}
	else if(elementos[i][3]!=menuCols)elementos[i][5]=Math.round(menuWidth*(elementos[i][3]/menuCols)-1);
	document.write('<TR>');
	if(!elementos[i][2])elementos[i][2]=linkTarget;
	document.write('<TD style="border: 1px solid #cccccc;height: 20px;vertical-align: middle" BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'"><DIV ALIGN="'+linkAlign+'" style="cursor:pointer"><A HREF="'+elementos[i][1]+'" target="'+elementos[i][2]+'" CLASS="elementos"><div id="elemento" style="color: #666666; padding-left: 10px;width:130px;font-size: 11px;" width="120" onclick="window.location.href=\''+elementos[i][1]+'\'" style="color:666666">'+elementos[i][0]);
document.write('</div></A></DIV></TD>')}
document.write('</TR>')
document.write('</table>')

if (NS6){document.write('</TD></TR></TABLE>')}
if (IE||NS6) {document.write('</DIV></DIV>')}
if (NS) {document.write('</LAYER></ILAYER></LAYER>')}
document.write('</DIV>');
theleft=-menuWidth;lastY=0;setTimeout('initSlide(\''+section+'\')', 1)
}


function moveOut(section) {
if ((NS6||NS)&&parseInt(ssm[section].left)<0 || IE && ssm[section].pixelLeft<0) {
clearTimeout(moving[section]);moving[section] = setTimeout('moveOut(\''+section+'\')', slideSpeed);slideMenu(10, section)}
else {clearTimeout(moving[section]);moving[section]=setTimeout('null',1)}};


function moveBack(section) {clearTimeout(moving[section]);moving[section] = setTimeout('moveBack1(\''+section+'\')', waitTime)}


function moveBack1(section) {
if ((NS6||NS) && parseInt(ssm[section].left)>(-menuWidth-20) || IE && ssm[section].pixelLeft>(-menuWidth-20)) {
clearTimeout(moving[section]);moving[section] = setTimeout('moveBack1(\''+section+'\')', slideSpeed);slideMenu(-10, section)}
else {clearTimeout(moving[section]);moving[section]=setTimeout('null',1)}}


function slideMenu(num, section){
if (IE) {ssm[section].pixelLeft += num;}
if (NS6) {ssm[section].left = parseInt(ssm[section].left)+num+"px";}
if (NS) {ssm[section].left = parseInt(ssm[section].left)+num; bssm[section].clip.right+=num;bssm2[section].clip.right+=num;}
}

function initSlide(section) {
	if (NS6){
		ssm[section]=document.getElementById("thessm"+section).style;
		bssm[section]=document.getElementById("basessm"+section).style;
		bssm[section].clip="rect(0 "+document.getElementById("thessm"+section).offsetWidth+" "+document.getElementById("thessm"+section).offsetHeight+" 0)";
		ssm[section].visibility="visible";
	}
	else if (IE) {
		ssm[section]=document.all("thessm"+section).style;
		bssm[section]=document.all("basessm"+section).style
		bssm[section].clip="rect(0 "+bssm[section].width+" 1000 0)";
		bssm[section].visibility = "visible";
	}
	else if (NS) {
		bssm[section]=document.layers["basessm"+section+"1"];
		bssm2[section]=bssm[section].document.layers["basessm"+section+"2"];
		ssm[section]=bssm2[section].document.layers["thessm"+section];
		bssm2[section].clip.left=0;
		ssm[section].visibility = "show";
	}
}
