/* Escribe flash embed para evitar bloqueo de IE*/

/*
 Se aplica:
 <div id="id_contenedor">
 	<img alternativa>
 	<script type="text/javascript">
		// <![CDATA[
		// Se aplica esta linea cuando es video
		urlVideo = "&MM_ComponentVersion=1&skinName=&MM_ComponentVersion=1&skinName=/es/Nombre_del_control&streamName=/swf/nombreflash&autoPlay=true&autoRewind=false";
		//
		var so = new SWFObject("/es/nombrepelicula.swf", "Video", "480px", "368px", "7", "#FFF","transparent", urlVideo);
		so.write("id_contenedor");
		// ]]>
	</script>
</div>
*/
 
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,z,_mode,_FlashVars,_7,_8,_9,_a,_b){
if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
if(z){this.addParam("z-index",z);}
if(_mode) this.addParam("wmode",_mode);
if(_FlashVars) this.addParam("FlashVars",_FlashVars);
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=key+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
	if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";}
catch(e){
if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}
if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){
var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){
_2d[i].style.display="none";
for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();
oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_30){
this[this.length]=_30;
return this.length;};}

var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for legacy support
var SWFObject=deconcept.SWFObject;


/* Funcion Precarga de imagenes */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/* Escribe Quicktime object para evitar bloqueo de IE*/
/*
Se llama de la siquiente forma
<script language="JavaScript" type="text/javascript">
		writeVideo('ancho','alto','6,0,2,0','URL video','TRUE');
</script>
*/

function writeVideo(ancho_video,alto_video,version_plugin,src,controles) {
	// Construye el Quicktime Embed
	var param1 = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ancho_video+'" height="'+alto_video+'" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version='+version_plugin+'">';
	var param2 = '<param name="controller" value="'+controles+'">';
    var param3 = '<param name="type" value="video/quicktime">';
    var param4 = '<param name="autoplay" value="true">';
    var param5 = '<param name="target" value="myself">';
    var param6 = '<param name="src" value="'+src+'">';
    var param7 = '<param name="HREF" value="'+src+'">';
    var param8 = '<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">';
    var param9 = '<embed width="'+ancho_video+'" height="'+alto_video+'" controller="'+controles+'" src="'+src+'" href="'+src+'" type="video/quicktime" target="myself" bgcolor="#000000" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>';
    var param10 = '</object>';


	// Escribe las lineas
	document.write(param1+param2+param3+param4+param5+param6+param7+param8+param9+param10)
}

/*Funcion pulldown menu*/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/* Funciones rollover de imagenes */
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* Funcion abre un popup */
function MM_openBrWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}


/* Funcion para introducir la fecha en una pagina
se llama <script type="text/javascript">fecha();</script>
*/
function fecha(){
	mes = new Array();
	diasem = new Array();
	fechas = new Date();
	diasemana = fechas.getDay();
	diasem[0] = "Domingo";
	diasem[1] = "Lunes";
	diasem[2] = "Martes";
	diasem[3] = "Miercoles";
	diasem[4] = "Jueves";
	diasem[5] = "Viernes";
	diasem[6] = "Sabado";
	dia = fechas.getDate();
	nomes = fechas.getMonth();
	anio = fechas.getYear();
	mes[0] = 'Enero';
	mes[1] = 'Febrero';
	mes[2] = 'Marzo';
	mes[3] = 'Abril';
	mes[4] = 'Mayo';
	mes[5] = 'Junio';
	mes[6] = 'Julio';
	mes[7] = 'Agosto';
	mes[8] = 'Septiembre';
	mes[9] = 'Octubre';
	mes[10] = 'Noviembre';
	mes[11] = 'Diciembre';
	if (anio < 1000) anio = anio + 1900;
	document.write(diasem[diasemana]+" "+ dia +" de "+ mes[nomes] +" de "+ anio);
}

/*funcion no spam*/
function nospam(name,domain){  
	window.location = 'mailto:' + name + '@' + domain; 
}


/*Permite que los div se igualen en altura
se aplica <script type='text/javascript'>altura('div1', 'div2','div3');</script>
*/
	function altura(){
		al = new Array();
		max = 0;
		try{
			if(document.getElementById){
				for(i=0;i<arguments.length;i++){
					if(document.getElementById(arguments[i]))
						al[i] = document.getElementById(arguments[i]).offsetHeight;
				}
				max = mayor(al);
				if(max > 0){
					for(i=0;i<arguments.length;i++){
						if(document.getElementById(arguments[i]))
							document.getElementById(arguments[i]).style.height = max + 'px';
					}
				}
			}
		}
		catch (exc) {
			alert("Se ha producido un error en la carga del CSS. La página seguirá operativa pero algo más lenta.");
			throw exc;
		}
	}
	function mayor(datos){
		salida = 0;
		for(i=0;i<datos.length;i++){
			if(parseInt(datos[i]) > salida)
				salida = datos[i];
		}
		return salida;
	}



/*Oculta los select*/
function hideSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

/*Muestra los select*/
function showSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

function class_activo(elem)
{
	window.document.getElementById(elem).className='activo'
}


/*MUESTRA OCULTA  CAPAS*/
function show(valores)
	{
		arreglo = valores.split(',');
		for(i=0;i<arreglo.length;i++)
		{
			window.document.getElementById(arreglo[i]).style.display='';
		}
	}
	
function hide(valores)
	{
		arreglo = valores.split(',');
		for(i=0;i<arreglo.length;i++)
		{
			window.document.getElementById(arreglo[i]).style.display='none';
		}
	}

/*FUNCION BUSQUEDA DE LOCALES*/
function cambiar()
{

var index=document.forms.formulario.regiones.selectedIndex;

document.formulario.comuna.length=0;

if(index==0) region0();
if(index==1) region1();
if(index==2) region2();
if(index==3) region3(); 
if(index==4) region4();
if(index==5) region5();
if(index==6) region6();
if(index==7) region14();
if(index==8) region7();
if(index==9) region8();
if(index==10) region9();
if(index==11) region10();
if(index==12) region11();
if(index==13) region12();
if(index==14) region15();
if(index==15) region13();
}

function region0(){
	opcion0=new Option("Seleccione Comuna","0","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}

/*REGION DE ARICA*/

function region1(){
	opcion0=new Option("Arica","/locales/arica.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}
/*REGION DE IQUIQUE*/
function region2(){
	opcion0=new Option("Iquique","/locales/iquique.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}

/*REGION DE ANTOFAGASTA*/
function region3(){
	opcion0=new Option("Antofagasta","/locales/antofagasta.php","defauldSelected");
	opcion1=new Option("Calama","/locales/calama.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
}

/*REGION DE COPIAPO*/
function region4(){
	opcion0=new Option("Copiapó","/locales/copiapo.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;

}

/*REGION DE COQUIMBO*/
function region5(){
	opcion0=new Option("Coquimbo","/locales/coquimbo.php","defauldSelected");
	opcion1=new Option("La Serena","/locales/laserena.php");
	opcion2=new Option("Ovalle","/locales/ovalle.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
	document.forms.formulario.comuna.options[2]=opcion2;
}

/*REGION DE VALPARAISO*/
function region6(){
	opcion0=new Option("Valparaíso","/locales/valparaiso.php","defauldSelected");
	opcion1=new Option("Viña del Mar","/locales/vinna_del_mar.php");
	opcion2=new Option("Con-Con","/locales/concon.php");
	opcion3=new Option("Quillota","/locales/quillota.php");
	opcion4=new Option("San Felipe","/locales/sanfelipe.php");
	opcion5=new Option("Los Andes","/locales/losandes.php");
	opcion6=new Option("Quilpué","/locales/quilpue.php");
	opcion7=new Option("Reñaca","/locales/rennaca.php");
	opcion8=new Option("San Antonio","/locales/sanantonio.php");
	opcion9=new Option("Villa Alemana","/locales/villa_alemana.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
	document.forms.formulario.comuna.options[2]=opcion2;
	document.forms.formulario.comuna.options[3]=opcion3;
	document.forms.formulario.comuna.options[4]=opcion4;
	document.forms.formulario.comuna.options[5]=opcion5;
	document.forms.formulario.comuna.options[6]=opcion6;
	document.forms.formulario.comuna.options[7]=opcion7;
	document.forms.formulario.comuna.options[8]=opcion8;
	document.forms.formulario.comuna.options[9]=opcion9;
}

/*REGION DE OHIGGINGS*/
function region7(){
	opcion0=new Option("Rancagua","/locales/rancagua.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}

/*REGION DEL MAULE*/
function region8(){
	opcion0=new Option("Curicó","/locales/curico.php","defauldSelected");
	opcion1=new Option("Talca","/locales/talca.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
}

/*REGION DEL BIOBIO*/
function region9(){
	opcion0=new Option("Chillán","/locales/chillan.php","defauldSelected");
	opcion1=new Option("Concepción","/locales/concepcion.php");
	opcion2=new Option("Los Ángeles","/locales/losangeles.php");
	opcion3=new Option("Talcahuano","/locales/talcahuano.php");
	opcion4=new Option("San Pedro de la Paz","/locales/sanpedro_delapaz.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
	document.forms.formulario.comuna.options[2]=opcion2;
	document.forms.formulario.comuna.options[3]=opcion3;
	document.forms.formulario.comuna.options[4]=opcion4;
}

/*REGION DE LA ARAUCANIA*/
function region10(){
	opcion0=new Option("Temuco","/locales/temuco.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}

/*REGION DE LOS RIOS*/
function region11(){
	opcion0=new Option("Valdivia","/locales/valdivia.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}

/*REGION DE LOS RIOS*/
function region12(){
	opcion0=new Option("Puerto Montt","/locales/puerto_montt.php","defauldSelected");
	opcion1=new Option("Osorno","/locales/osorno.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
}

/*REGION DE LOS RIOS*/
function region13(){
	opcion0=new Option("Todas las Comunas","/locales/todas_las_comunas.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}
/*REGION DE MAGALLANES*/
function region15(){
	opcion0=new Option("Punta Arenas","/locales/punta_arenas.php","defauldSelected");
	document.forms.formulario.comuna.options[0]=opcion0;
}
/*FLASH RESIZER*/

function setFlashWidth(divid, newW){
document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
document.getElementById(divid).style.height = newH+"px";  
}
function setFlashSize(divid, newW, newH){
setFlashWidth(divid, newW);
setFlashHeight(divid, newH);
}

function delete_banner(x){
	window.document.getElementById(x).style.display='none';
}

/*REGION METROPOLITANA: DIVIDIDA POR COMUNA*/
function region14(){
	opcion0=new Option("Todas las Comunas","/locales/region_metropolitana.php","defauldSelected");
	opcion1=new Option("Cerrillos","/locales/cerrillos.php");
	opcion2=new Option("El Bosque","/locales/el_bosque.php");
	opcion3=new Option("Estación Central","/locales/estacion_central.php");
	opcion4=new Option("Huechuraba","/locales/huechuraba.php");
	opcion5=new Option("Independencia","/locales/independencia.php");
	opcion6=new Option("La Cisterna","/locales/lacisterna.php");
	opcion7=new Option("La Florida","/locales/laflorida.php");
	opcion8=new Option("La Reina","/locales/lareina.php");
	opcion9=new Option("Las Condes","/locales/lascondes.php");
	opcion10=new Option("La Granja","/locales/lagranja.php");
	opcion11=new Option("Lo Barnechea","/locales/lobarnechea.php");
	opcion12=new Option("Macul","/locales/macul.php");
	opcion13=new Option("Maipú","/locales/maipu.php");
	opcion14=new Option("Nuñoa","/locales/nunnoa.php");
	opcion15=new Option("Peñaflor","/locales/pennaflor.php");
	opcion16=new Option("Peñalolén","/locales/pennalolen.php");
	opcion17=new Option("Providencia","/locales/providencia.php");
	opcion18=new Option("Puente Alto","/locales/puente_alto.php");
	opcion19=new Option("Quilicura","/locales/quilicura.php");
	opcion20=new Option("San Bernardo","/locales/san_bernardo.php");
	opcion21=new Option("San Miguel","/locales/san_miguel.php");
	opcion22=new Option("Santiago","/locales/santiago.php");
	opcion23=new Option("Vitacura","/locales/vitacura.php");
	opcion24=new Option("Talagante","/locales/talagante.php");
	//opcion20=new Option("Santiago Centro","/locales/santiago_centro.php");
	
	//opcion13=new Option("Pajaritos","/locales/pajaritos.php");
	document.forms.formulario.comuna.options[0]=opcion0;
	document.forms.formulario.comuna.options[1]=opcion1;
	document.forms.formulario.comuna.options[2]=opcion2;
	document.forms.formulario.comuna.options[3]=opcion3;
	document.forms.formulario.comuna.options[4]=opcion4;
	document.forms.formulario.comuna.options[5]=opcion5;
	document.forms.formulario.comuna.options[6]=opcion6;
	document.forms.formulario.comuna.options[7]=opcion7;
	document.forms.formulario.comuna.options[8]=opcion8;
	//document.forms.formulario.comuna.options[9]=opcion9;
	document.forms.formulario.comuna.options[9]=opcion9;
	document.forms.formulario.comuna.options[10]=opcion10;
	document.forms.formulario.comuna.options[11]=opcion11;
	document.forms.formulario.comuna.options[12]=opcion12;
	document.forms.formulario.comuna.options[13]=opcion13;
	document.forms.formulario.comuna.options[14]=opcion14;
	document.forms.formulario.comuna.options[15]=opcion15;
	document.forms.formulario.comuna.options[16]=opcion16;
	document.forms.formulario.comuna.options[17]=opcion17;
	document.forms.formulario.comuna.options[18]=opcion18;
	document.forms.formulario.comuna.options[19]=opcion19;
	document.forms.formulario.comuna.options[20]=opcion20;
	document.forms.formulario.comuna.options[21]=opcion21;
	document.forms.formulario.comuna.options[22]=opcion22;
	document.forms.formulario.comuna.options[23]=opcion23;
	document.forms.formulario.comuna.options[24]=opcion24;
	//document.forms.formulario.comuna.options[21]=opcion21;

}


function loadMenu() {

	TabsFotos = MakeMenu('fotos', 4, 0, 1);
	TabsFotos.autoClose = false;
	TabsFotos.useTabs = true;
	TabsFotos.classTabsActive = "activo"; //La clase del tab activo
	TabsFotos.classTabsInactive = ""; //La clase del tab inactivo

	menuLocales = MakeMenu('menu_locales', 3, 0, 1);
	menuLocales.autoClose = false;
	menuLocales.useTabs = true;
	menuLocales.classTabsActive = ""; //La clase del tab activo
	menuLocales.classTabsInactive = ""; //La clase del tab inactivo

}


var tamagnoLetras	= new Array(); 
tamagnoLetras['contenidos'] = 100;




function Duplex(nodosmaximo, nodo, padre, numeracion, removeLast)
{
	this.padre = padre;
	this.nodo = nodo;
	this.newnodo = new Object();
	this.cantidadNodos = 0;
	this.maximoNodos = nodosmaximo;
	this.numeracion = 0;
	this.removeLast = false;
	if(numeracion)
	{
		this.numeracion = numeracion;
	}
	if(removeLast)
	{
		this.removeLast = true;
	}
	this.getElementChildren = function(element)
	{
		ele = document.getElementById(element).parentNode;
		var children = [];
		var child = ele.firstChild;
		while (child)
		{
			if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
				children.push(child);
			child = child.nextSibling;
		}
		return children;
	}
	
	this.colocarNumero = function()
	{
		hijos = this.getElementChildren(this.nodo);
		elem = getElementsByAttribute(this.newnodo, "span", "opc", "indice");
		elem[0].innerHTML = (this.numeracion + hijos.length).toString();
	}
	
	this.duplicar = function ()
	{
		childs = this.getElementChildren(this.nodo);
		if(childs.length<=this.maximoNodos)
		{
			var arreglo 
			arreglo=nodo.split("_");
			base_id=arreglo[0];
			newnodo=document.getElementById(this.nodo).cloneNode(true);
			var rand_no = Math.random();
			newnodo.setAttribute("id",base_id+rand_no); 
			window.document.getElementById(this.padre).appendChild (newnodo);
			new_padre=newnodo.id;
			
			
			var hijos = newnodo.getElementsByTagName("input");
			for(i=0;i<hijos.length;i++)
			{
				try{
					hijos[i].setAttribute("value",'');
				}catch(e){}
			}
			hijos = window.document.getElementById(new_padre).childNodes;
			for(i=0;i<hijos.length;i++)
			{
				if(hijos[i].nodeType == 1)
				{
					hijos[i].setAttribute("id",hijos[i].id+(hijos.length+1));
					hijos[i].setAttribute("name",hijos[i].id);
					hijos[i].className = 'duplicado'
				}
			}
			//aqui colocamos el remover
			elem = getElementsByAttribute(newnodo, "div", "opc", "remover");
			if(elem[0])
			{
				boton = document.createElement('a')
				boton.setAttribute("type", "button");
				boton.setAttribute("id", "button_" + newnodo.id);
				boton.appendChild(document.createTextNode("Eliminar"));
				boton.setAttribute("className", "eliminar_nodo");
				//window.document.getElementsById(boton).setAttribute("class", "eliminar_nodo");
				boton.setAttribute("target", newnodo.id);
				boton.setAttribute("style", "cursor:pointer");
				if(this.removeLast)
				{
					try
					{	
						boton.addEventListener("click",function(){removeLastChild(this);}, false);
					}
					catch (e)
					{
						boton.attachEvent("onclick",function(){removeLastChild(this);});
					}
				}
				else
				{
					try
					{	
						boton.addEventListener("click",function(){removeChild(this);}, false);
					}
					catch (e)
					{
						boton.attachEvent("onclick",function(){removeChild(this);});
					}
				}
				elem[0].appendChild(boton);
			}
			this.newnodo = newnodo;
			this.cantidadNodos++;
		}
	}
}


function removeLastChild(boton)
{
	if(document.all)
	{
		boton = window.event.srcElement;
	}
	//antes de eliminar recuperamos el numero del que vamos a eliminar.
	//si hay un siguiente, reemplazamos por este numero
	nodo = boton.getAttribute("target");
	if(el = document.getElementById(nodo)) 
	{
		elem = getElementsByAttribute(el, "span", "opc", "indice");
		numero = elem[0].innerHTML;	
		var _paren = el.parentNode;
		if(_paren.lastChild!=el)
		{
			next = nextElement(el);
			if(next){
				elem_n = getElementsByAttribute(next, "span", "opc", "indice");
				elem_n[0].innerHTML = numero;
			}
		}
		el.parentNode.removeChild(el);
	}
}

function nextElement(child)
{
	i=0;
	while (child)
		{
			if (child.nodeType == 1)
			{
				i++;
				if(i>1)	return child;
			}
			child = child.nextSibling;
		}
		return false;
}

function removeChild(boton)
{
	if(document.all)
	{
		boton = window.event.srcElement;
	}
	nodo = boton.getAttribute("target");		
	document.getElementById(nodo);
	if(el = document.getElementById(nodo)) 
	{
		el.parentNode.removeChild(el);
	}
}




function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\\s)" + strAttributeValue + "(\\s|$)") : null;
    var oCurrent;
    var oAttribute;
    for(var i=0; i<arrElements.length; i++){
        oCurrent = arrElements[i];
        oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
        if(typeof oAttribute == "string" && oAttribute.length > 0){
            if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
                arrReturnElements.push(oCurrent);
            }
        }
    }
    return arrReturnElements;
}
