/***
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties
oCMenu.pxBetween=0
//Using the cm_page object to place the menu ----
oCMenu.fromLeft=0
oCMenu.fromTop=0
oCMenu.rows=1
oCMenu.menuPlacement=0

oCMenu.offlineRoot=""
oCMenu.onlineRoot=""
oCMenu.resizeCheck=1
oCMenu.wait=1000
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

//Background bar properties
oCMenu.useBar=0

//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width=160
oCMenu.level[0].height=19
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=1
oCMenu.level[0].borderY=1
oCMenu.level[0].borderClass="clLevel0border"
oCMenu.level[0].offsetX=-1
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].arrow=0
oCMenu.level[0].arrowWidth=0
oCMenu.level[0].arrowHeight=0
oCMenu.level[0].align="bottom"

//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[1]=new cm_makeLevel() //Add this for each new level
oCMenu.level[1].width = oCMenu.level[0].width
oCMenu.level[1].height=19
oCMenu.level[1].regClass="clLevel1"
oCMenu.level[1].overClass="clLevel1over"
oCMenu.level[1].borderX=1
oCMenu.level[1].borderY=1
oCMenu.level[1].borderClass="clLevel1border"
oCMenu.level[1].offsetX=(oCMenu.level[0].width-2)/2+20
oCMenu.level[1].offsetY=-6
oCMenu.level[1].rows=0
oCMenu.level[1].arrow=0
oCMenu.level[1].arrowWidth=0
oCMenu.level[1].arrowHeight=0
oCMenu.level[1].align="bottom"


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout)
*************************************/

oCMenu.makeMenu('top0','','Nosotros', 'http://www.colegioecheyde.com/quienes_somos.htm','','150')
	oCMenu.makeMenu('sub00','top0','Quiénes Somos', 'http://www.colegioecheyde.com/quienes_somos.htm','','150')
	oCMenu.makeMenu('sub01','top0','Nuestros Centros...', 'http://www.colegioecheyde.com/colegios.htm','','150','','','','clLevelsub')
		oCMenu.makeMenu('sub010','sub01','Mapa de ubicación', 'http://www.colegioecheyde.com/colegios.htm','','150')
		oCMenu.makeMenu('sub011','sub01','Echeyde I...', 'http://www.colegioecheyde.com/COLEGIO1.HTM','','150','','','','clLevelsub')
			oCMenu.makeMenu('sub0110','sub011','Información General', 'http://www.colegioecheyde.com/COLEGIO1.HTM','','150')
			//oCMenu.makeMenu('sub0111','sub011','Claustro de Profesores', 'http://www.colegioecheyde.com/Claustro.htm','','150')
			oCMenu.makeMenu('sub0111','sub011','Claustro de Profesores', 'http://www.colegioecheyde.com/claustro_Echeyde_I.htm','','150')
			oCMenu.makeMenu('sub0112','sub011','Nuestras noticias', 'http://www.colegioecheyde.com/comunicacion/noticias1.htm','_blank','150')
			oCMenu.makeMenu('sub0113','sub011','Circulares', 'http://www.colegioecheyde.com/comunicacion/circulares1.htm','_blank','150')
			oCMenu.makeMenu('sub0114','sub011','Calendario escolar', 'http://www.gobiernodecanarias.org/boc/2011/109/005.html?categoria=3072','_blank','150')
			//oCMenu.makeMenu('sub0114','sub011','Calendario escolar', 'http://www.gobiernodecanarias.org/educacion/General/CEscolar/scripts/cescolar1011.asp','_blank','150')
			oCMenu.makeMenu('sub0115','sub011','Biblioteca escolar', 'http://www.colegioecheyde.com/comunicacion/catalogobiblioteca.htm','_blank','150')

		oCMenu.makeMenu('sub012','sub01','Echeyde II...', 'http://www.colegioecheyde.com/COLEGIO2.HTM','','150','','','','clLevelsub')
			oCMenu.makeMenu('sub0120','sub012','Información General', 'http://www.colegioecheyde.com/COLEGIO2.HTM','','150')
			//oCMenu.makeMenu('sub0121','sub012','Claustro de Profesores', 'http://www.colegioecheyde.com/Claustro_Echeyde_II.htm','','150')
			oCMenu.makeMenu('sub0121','sub012','Claustro de Profesores', 'http://www.colegioecheyde.com/claustro_Echeyde_II.htm','','150')
			oCMenu.makeMenu('sub0122','sub012','Nuestras noticias', 'http://www.colegioecheyde.com/comunicacion/noticias2.htm','_blank','150')
			oCMenu.makeMenu('sub0123','sub012','Circulares', 'http://www.colegioecheyde.com/comunicacion/circulares2.htm','_blank','150')
			oCMenu.makeMenu('sub0124','sub012','Calendario escolar', 'http://www.gobiernodecanarias.org/boc/2011/109/005.html?categoria=3072','_blank','150')
		oCMenu.makeMenu('sub013','sub01','Echeyde III...', 'http://www.colegioecheyde.com/COLEGIO3.HTM','','150','','','','clLevelsub')
			oCMenu.makeMenu('sub0130','sub013','Información General', 'http://www.colegioecheyde.com/COLEGIO3.HTM','','150')
			oCMenu.makeMenu('sub0131','sub013','Claustro de Profesores', 'http://www.colegioecheyde.com/Claustro_Echeyde_III.htm','','150')
			//oCMenu.makeMenu('sub0131','sub013','Claustro de Profesores', 'http://www.colegioecheyde.com/Proximamente.htm','','150')
			oCMenu.makeMenu('sub0132','sub013','Nuestras noticias', 'http://www.colegioecheyde.com/comunicacion/noticias3.htm','_blank','150')
			oCMenu.makeMenu('sub0133','sub013','Circulares', 'http://www.colegioecheyde.com/comunicacion/circulares3.htm','_blank','150')
			oCMenu.makeMenu('sub0134','sub013','Calendario escolar', 'http://www.gobiernodecanarias.org/boc/2011/109/005.html?categoria=3072','_blank','150')


oCMenu.makeMenu('top1','','Servicios', 'http://www.colegioecheyde.com/servicios.html','','150')
	oCMenu.makeMenu('sub10','top1','Servicios', 'http://www.colegioecheyde.com/servicios.htm','','150')
	oCMenu.makeMenu('sub11','top1','Echeyde en Casa...', 'https://www.colegioecheyde.com/echeyde_encasa.asp','','150','','','','clLevelsub')
		oCMenu.makeMenu('sub110','sub11','Alta en servicios escolares o actividad', 'https://www.colegioecheyde.com/echeyde_encasa.asp#a1','','150','32')
		oCMenu.makeMenu('sub111','sub11','Modificación de datos bancarios', 'https://www.colegioecheyde.com/echeyde_encasa.asp#a2','','150','32')
		oCMenu.makeMenu('sub112','sub11','Solicitud de certificados académicos', 'https://www.colegioecheyde.com/echeyde_encasa.asp#a3','','150','32')
		oCMenu.makeMenu('sub113','sub11','Otras gestiones administrativas', 'https://www.colegioecheyde.com/echeyde_encasa.asp#a4','','150','32')
		oCMenu.makeMenu('sub114','sub11','Correo en casa', 'https://www.colegioecheyde.com/echeyde_encasa.asp#a5','','150')
	oCMenu.makeMenu('sub12','top1','Apoyo y Orientación', 'http://www.colegioecheyde.com/orientacion.htm','','150')
	oCMenu.makeMenu('sub13','top1','Noticias', 'http://www.colegioecheyde.com/circulares.htm','','150')

oCMenu.makeMenu('top2','','Actividades', 'http://www.colegioecheyde.com/EVENTOS.HTM','','150')
	oCMenu.makeMenu('sub20','top2','Actividades Extraescolares...', '','','150','32','','','clLevelsub')
		oCMenu.makeMenu('sub200','sub20','Adotlen', '','','150','','','','clLevelsub')
			oCMenu.makeMenu('sub2000','sub200','Estudio Asistido', 'http://www.colegioecheyde.com/estudio_asistido.htm','','250')
			oCMenu.makeMenu('sub2001','sub200','Juegos Tradicionales Infantiles Canarios','http://www.colegioecheyde.com/juegos_canarios.htm','','250')
			oCMenu.makeMenu('sub2002','sub200','Manualidades o Bloque Actividades','http://www.colegioecheyde.com/manualidades.htm','','250')
			oCMenu.makeMenu('sub2003','sub200','Taller Psicomotricidad y Expresión Corporal','http://www.colegioecheyde.com/psicomotricidad.htm','','250')
			oCMenu.makeMenu('sub2004','sub200','Iniciación Deportiva','http://www.colegioecheyde.com/Iniciacion_deportiva.htm','','250')
			oCMenu.makeMenu('sub2005','sub200','Juegos y Deportes Alternativos','http://www.colegioecheyde.com/Juegos_alternativos.htm','','250')
			oCMenu.makeMenu('sub2006','sub200','Informática','http://www.colegioecheyde.com/informatica.htm','','250')
			oCMenu.makeMenu('sub2007','sub200','Taller de Cine y Fotografía','http://www.colegioecheyde.com/cine.htm','','250')
			oCMenu.makeMenu('sub2008','sub200','Deportes de Aventura','http://www.colegioecheyde.com/aventura.htm','','250')
			oCMenu.makeMenu('sub2009','sub200','Taller de Periodismo','http://www.colegioecheyde.com/periodismo.htm','','250')
			oCMenu.makeMenu('sub2010','sub200','Voleibol','http://www.colegioecheyde.com/voleibol.htm','','250')
			oCMenu.makeMenu('sub2011','sub200','Atletismo','http://www.colegioecheyde.com/atletismo.htm','','250')
			oCMenu.makeMenu('sub2012','sub200','Taller de Fantas&iacute;a','http://www.colegioecheyde.com/tfantasia.htm','','250')
			oCMenu.makeMenu('sub2013','sub200','Pl&aacute;stica','http://www.colegioecheyde.com/plastica.htm','','250')
		//oCMenu.makeMenu('sub201','sub20','Apuntes de Informática', 'http://www.iespana.es/inforweb','_blank','150')
		oCMenu.makeMenu('sub202','sub20','Bádminton...', 'http://www.colegioecheyde.com/Badminton.htm','','150','','','','clLevelsub')
			//oCMenu.makeMenu('sub2020','sub202','Noticias', 'http://www.colegioecheyde.com/Proximamente.htm','','150')
			//oCMenu.makeMenu('sub2020','sub202','Noticias', 'http://www.colegioecheyde.com/Badminton_09-10.htm','','150')
			//oCMenu.makeMenu('sub2021','sub202','Temporada 2006 - 2007', 'http://www.colegioecheyde.com/Badminton_2006.htm','','150')

		oCMenu.makeMenu('sub203','sub20','Teatro', 'http://www.colegioecheyde.com/TEATRO.htm','','150')
		oCMenu.makeMenu('sub204','sub20','Ajedrez', 'http://www.colegioecheyde.com/noticias_ajedrez.htm','','150')
		oCMenu.makeMenu('sub205','sub20','Baloncesto', 'http://www.colegioecheyde.com/noticias_basket.htm','','150')
		oCMenu.makeMenu('sub206','sub20','Voleyball', 'http://www.colegioecheyde.com/noticias_volleyball.htm','','150')
		oCMenu.makeMenu('sub207','sub20','Communication skills in English', 'http://www.colegioecheyde.com/communication.htm','','150','32')
        	oCMenu.makeMenu('sub208','sub20','Percusi&oacute;n','http://www.colegioecheyde.com/percusion.htm','','150')
        	oCMenu.makeMenu('sub209','sub20','Taller de Pl&aacute;stica','http://www.colegioecheyde.com/tallerplastica.htm','','150')
        	oCMenu.makeMenu('sub210','sub20','Semana blanca','http://www.colegioecheyde.com/semana_blanca.htm','','150')
        	oCMenu.makeMenu('sub211','sub20','Juegos alternativos','http://www.colegioecheyde.com/juegos_altenativos.htm','','150')

	oCMenu.makeMenu('sub22','top2','Eventos...', 'http://www.colegioecheyde.com/EVENTOS.HTM','','150','','','','clLevelsub')
		oCMenu.makeMenu('sub220','sub22','Información General', 'http://www.colegioecheyde.com/EVENTOS.HTM','','150')
		//oCMenu.makeMenu('sub221','sub22','Olimpiadas XXI Echeyde...', 'http://www.colegioecheyde.com/OLIMPIADAS_2008.html','','150','32','','','clLevelsub')
			//oCMenu.makeMenu('sub2210','sub221','Presentación', 'http://www.colegioecheyde.com/OLIMPIADAS_2008.html','','150')
			//oCMenu.makeMenu('sub2211','sub221','Arona', 'http://www.colegioecheyde.com/OLIMPIADAS_2008a.html','','150')
			//oCMenu.makeMenu('sub2212','sub221','Geneto', 'http://www.colegioecheyde.com/OLIMPIADAS_2008g.html','','150')
		//oCMenu.makeMenu('sub222','sub22','Día de la Paz', 'http://www.colegioecheyde.com/DIA_PAZ.HTM','','150')
		oCMenu.makeMenu('sub223','sub22','Campamento de verano Echeyde','http://www.colegioecheyde.com/Campamento_verano.htm','','150','32')
	//oCMenu.makeMenu('sub23','top2','Club de Danza', 'http://www.colegioecheyde.com/Proximamente.htm','','150')
	oCMenu.makeMenu('sub23','top2','Club de Danza', 'http://www.colegioecheyde.com/noticias_danza.htm','','150')
	oCMenu.makeMenu('sub24','top2','Club de Karate...', 'http://www.colegioecheyde.com/comunicacion/KARATE/','_blank','150','','','','clLevelsub')
	oCMenu.makeMenu('sub25','top2','Inglés en Inglaterra', 'http://www.colegioecheyde.com/noticias_ingles.htm','','150','','','','clLevelsub')
		oCMenu.makeMenu('sub240','sub24','Histórico de Noticias', 'http://www.colegioecheyde.com/noticias_karate.htm','','150')
	   /*	oCMenu.makeMenu('sub241','sub24','Videos', 'noticias_karate_video.htm','','150')*/
		oCMenu.makeMenu('sub242','sub24','Web Karate', 'http://www.colegioecheyde.com/comunicacion/KARATE/','','150')

oCMenu.makeMenu('top3','','En la web', 'http://www.colegioecheyde.com/POSTALES.HTM','','150')
	oCMenu.makeMenu('sub30','top3','Postales', 'http://www.colegioecheyde.com/POSTALES.HTM','','150')
	oCMenu.makeMenu('sub31','top3','Enlaces Educativos...', 'http://www.colegioecheyde.com/ENLACES1.HTM','','150','','','','clLevelsub')
		oCMenu.makeMenu('sub310','sub31','Educared.net', 'http://www.colegioecheyde.com/ENLACES1.HTM','','150')
		oCMenu.makeMenu('sub311','sub31','Recursos Alumnos', 'http://www.colegioecheyde.com/ENLACES2.HTM','','150')
		oCMenu.makeMenu('sub312','sub31','Recursos Profesores', 'http://www.colegioecheyde.com/ENLACES3.HTM','','150')
		oCMenu.makeMenu('sub313','sub31','Organismos e Instituciones', 'http://www.colegioecheyde.com/ENLACES4.HTM','','150','32')
	oCMenu.makeMenu('sub32','top3','Mapa del Web', 'http://www.colegioecheyde.com/mapa.htm','','150')
	oCMenu.makeMenu('sub33','top3','Contactar', 'https://www.colegioecheyde.com/CONTACTO.HTM','','150')

oCMenu.makeMenu('top4','','Inicio', 'http://www.colegioecheyde.com/default.htm','','134')

//Leave this line - it constructs the menu
oCMenu.construct()


//Extra code to find position:
function findPos(num){
  //alert(num)
  if(bw.ns4){   //Netscape 4
    x = document.layers["layerMenu"+num].pageX
    y = document.layers["layerMenu"+num].pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"+num]:document.getElementById("divMenu"+num);
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent;
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}
function placeElements(){
  //Changing the position of ALL top items:
  pos = findPos(0)
  oCMenu.m["top0"].b.moveIt(pos[0],pos[1])
  pos = findPos(1)
  oCMenu.m["top1"].b.moveIt(pos[0],pos[1])
  pos = findPos(2)
  oCMenu.m["top2"].b.moveIt(pos[0],pos[1])
  pos = findPos(3)
  oCMenu.m["top3"].b.moveIt(pos[0],pos[1])
  pos = findPos(4)
  oCMenu.m["top4"].b.moveIt(pos[0],pos[1])

  //Setting the fromtop value
  oCMenu.fromTop = pos[1]
}
placeElements()
//Setting it to re place the elements after resize - the resize is not perfect though..
oCMenu.onafterresize="placeElements()"

