/*****************/
/* MENU SUPERIOR */
/*****************/



var menu1=new Array();
menu1[0]='<a href="/colegio/presentacion/">Presentaci&oacute;n</a>'
menu1[1]='<a href="#">Organizaci&oacute;n</a>'
menu1[2]='<a href="/archivos/responsabilidad_social">Responsabilidad social</a>'
menu1[3]='<a href="/servicios/farmacias_sigloXXI/">Fundaci&oacute;n S.XXI</a>'
menu1[4]='<a href="/colegio/contacto/">Contacto</a>'
var menu2=new Array();
menu2[0]='<a href="/servicios/bolsa_trabajo/">Bolsa de trabajo</a>'
menu2[1]='<a href="/archivos/">Informaci&oacute;n al ciudadano</a>'
menu2[2]='<a href="/servicios/farmacias_guardia/">Farmacias de Guardia</a>'
menu2[3]='<a href="/servicios/farmacias_navarra/">Farmacias en Navarra</a>'
menu2[4]='<a href="/servicios/tablon/">Tabl&oacute;n de anuncios</a>'
menu2[5]='<a href="/legislacion/">Legislaci&oacute;n</a>'
var menu3=new Array();
var menu4=new Array();
var menu5=new Array();
menu5[0]='<a href="/colegio/alta_colegiado/">Alta colegiado</a>'
//menu5[1]='<a href="/web/comun/goto.php?tipo=anexo&id=18&anexo=Impreso%20BAJA%20COLEGIAL.doc">Baja colegiado</a>'
menu5[1]='<a href="/colegio/baja_colegiado/">Baja colegiado</a>'
menu5[2]='<a href="mailto:sugerenciascofna@redfarma.org">Buzón de quejas y sugerencias</a>'
menu5[3]='<a href="/colegio/precolegiacion/">Pre-colegiaci&oacute;n</a>'
menu5[4]='<a href="/colegio/homologacion/">Homologaci&oacute;n t&iacute;tulo</a>'



var menu6=new Array();
menu6[0]='<a href="/web/home/web.php?seccion=202">Ventajas para el colegiado</a>'
menu6[1]='<a href="/web/home/web.php?seccion=173">Formaci&oacute;n</a>'
menu6[2]='<a href="/web/home/web.php?seccion=197">Consultas</a>'
menu6[3]='<a href="#">Actualidad Colegial</a>'
menu6[4]='<a href="/web/home/web.php?seccion=213">El Colegio Informa</a>'
menu6[5]='<a href="/web/home/web.php?seccion=187">Programas de atenci&oacute;n Farmac&eacute;utica</a>'
menu6[6]='<a href="/web/home/web.php?seccion=231">Informaci&oacute;n laboral</a>'
menu6[7]='<a href="/web/home/web.php?seccion=183">Facturaci&oacute;n</a>'
menu6[8]='<a href="/web/home/web.php?seccion=196">Centro de informaci&oacute;n de medicamentos</a>'
menu6[9]='<a href="/web/home/web.php?seccion=307">Secretar&iacute;a</a>'
menu6[10]='<a href="/web/home/web.php?seccion=298">Junta</a>'
menu6[11]='<a href="/web/home/web.php?seccion=299">Gerencia</a>'
menu7=new Array();
menu7[0]='<a href="/archivos/publicaciones/index.php?carpeta=./REVISTA ALBARELO">Albarelo</a>'
menu7[1]='<a href="/archivos/publicaciones/index.php?carpeta=./LIBRO INTERVENCIONES FARMACEUTICAS">Libro de intervenciones farmacéutica</a>'


var disappeardelay=400  				
var hidemenu_onclick="yes"	
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;position:absolute;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)" ></div>')
function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left") ? what.offsetLeft : what.offsetTop ;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
	totaloffset=(offsettype=="left") ? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop ;
	parentEl=parentEl.offsetParent;}	
	if(offsettype=="left"){
		if((what+"").indexOf("#_manteni_")!=-1)	totaloffset-=0;
		else if((what+"").indexOf("#_admin_")!=-1)	totaloffset-=0;
		else if((what+"").indexOf("#_herramientas_")!=-1) totaloffset-=0;
		else totaloffset-=0;
	}else totaloffset+=5;	
	return totaloffset-1;}
function showhide(obj, e, visible, hidden, menuwidth){
	if (ie4||ns6){
	dropmenuobj.style.left=dropmenuobj.style.top="-550px"
	}
	if (menuwidth!=""){
	dropmenuobj.widthobj=dropmenuobj.style
	dropmenuobj.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
	obj.visibility=visible
	else if (e.type=="click")
	obj.visibility=hidden}
function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
function clearbrowseredge(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge"){
	var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
	dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
	if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
	edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth}else{
	var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
	var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
	dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
	if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
	edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
	if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
	edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge}}
	return edgeoffset}
function populatemenu(what){
	if (ie4||ns6)
	dropmenuobj.innerHTML=what.join("")}
function dropdownmenu(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)
	if (ie4||ns6){
	showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
	dropmenuobj.x=getposOffset(obj, "left" )
	dropmenuobj.y=getposOffset(obj, "top" )
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"}
	return clickreturnvalue()}
function clickreturnvalue(){
	if (ie4||ns6) return false
	else return true}
function contains_ns6(a, b) {
	while (b.parentNode)
	if ((b = b.parentNode) == a)return true;
	return false;}
function dynamichide(e){
	if (ie4&&!dropmenuobj.contains(e.toElement))
	delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
	delayhidemenu()}
function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
	if (ie4||ns6)
	dropmenuobj.style.visibility="hidden"}}
function delayhidemenu(){
	if (ie4||ns6)
	delayhide=setTimeout("hidemenu()",disappeardelay)}
function clearhidemenu(){
	if (typeof delayhide!="undefined")
	clearTimeout(delayhide)}
if (hidemenu_onclick=="yes") document.onclick=hidemenu





/***********/
/* BANNERS */
/***********/

function pintarBanners(){
	txt="";
	/*
	txt+="<tr>";
  txt+="  <td><a href=\"https://www.sabadellatlantico.com/cs/Satellite/SabAtl/Colectivos/1191332198947/es/\" target=\"_blank\"><img src=\"/_includes/IMG/Sabadell.gif\" width=\"150\" height=\"150\" border=\"0\" alt=\"Anuncio 1\"/></a><br>&nbsp;</td>";
  txt+="</tr>";  
  txt+="<tr>";
  txt+="  <td><a href=\"http://www.delta.es/\" target=\"_blank\"><img src=\"/_includes/IMG/Delta.gif\" width=\"150\" height=\"150\" border=\"0\" alt=\"Anuncio 2\"/></a></td>";
  txt+="</tr>";
  */
  txt+="<tr><td><div> ";
  txt+="<object width=\"170\" type=\"application/x-shockwave-flash\" data=\"delta%20farmaceuticos.swf\"> ";
  txt+="<param name=\"wmode\" value=\"transparent\" />";
	txt+="<param style=\"z-index:-50\" name=\"movie\" value=\"/_includes/IMG/delta%20farmaceuticos.swf\"> ";
	txt+="</object>";
	txt+="</div></td></tr>";
	/*
  txt+="<tr><td><div> ";
  txt+="<object width=\"170\" type=\"application/x-shockwave-flash\" data=\"encuesta.swf\"> ";
  txt+="<param name=\"wmode\" value=\"transparent\" />";
	txt+="<param style=\"z-index:-50\" name=\"movie\" value=\"/_includes/IMG/encuesta.swf\"> ";
	txt+="</object>";
	txt+="</div></td></tr>";
	*/
/*
  txt+="<tr><td>";
  txt+="<a href=\"/_includes/Navidad2010.pdf\" target=\"_blank\"><img src=\"/_includes/IMG/Postal2010.jpg\" width=\"170\" height=\"170\" border=\"0\" alt=\"Feliz Navidad\"/></a><br>&nbsp;";
  txt+="</td></tr>";

  txt+="<tr><td><div> ";
  txt+="<a href=\"/web/home/web.php?tipo=elecciones&cod=335\"><img style=\"cursor:pointer\" src=\"/_includes/IMG/elecciones.jpg\" /></a>";
  txt+="</div></td></tr>";
*/

  txt+="<tr><td><div> ";
  txt+="<object width=\"170\" type=\"application/x-shockwave-flash\" data=\"farmacias_camino.swf\"> ";
  txt+="<param name=\"wmode\" value=\"transparent\" />";
	txt+="<param style=\"z-index:-50\" name=\"movie\" value=\"/_includes/IMG/farmacias_camino.swf\"> ";
	txt+="</object>";
	txt+="</div></td></tr>";
	
	
	

  document.write(txt);	
}



/***********************/
/* Funciones generales */
/***********************/

function Dia_de_Semana (d1,d2,d3,d4,d5,d6,d7) {
	this[0]=d1;this[1]=d2;this[2]=d3;this[3]=d4;this[4]=d5;this[5]=d6;this[6]=d7;
}
function Mes_del_Anio (d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12) {
	this[0]=d1;this[1]=d2;this[2]=d3;this[3]=d4;this[4]=d5;this[5]=d6;this[6]=d7;this[7]=d8;this[8]=d9;
	this[9]=d10;this[10]=d11;this[11]=d12;
}
Semana = new Dia_de_Semana ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
Mes=new Mes_del_Anio ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
var today=new Date;
diahoy=today.getDay();
fechahoy=today.getDate();
meshoy=today.getMonth();
anio=today.getYear();
if (fechahoy<10) fechahoy="0"+fechahoy;
function dia(){
	document.write (Semana[diahoy]+', '+fechahoy+' - '+Mes[meshoy]+' - '+anio+'  ' );
}
function newImage(arg){
	if (document.images){
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages(){
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
var preloadFlag = false;
function preloadImages(){
	if(document.images){
		index_04_over = newImage("/images/index_04-over.gif");
		index_05_over = newImage("/images/index_05-over.gif");
		index_06_over = newImage("/images/index_06-over.gif");
		index_07_over = newImage("/images/index_07-over.gif");
		index_08_over = newImage("/images/index_08-over.gif");
		preloadFlag = true;
	}
}
