function w(q) {document.write(q)}
function e() {w("<br>")}

//construcción del menú desplegable
menuprincipal=new VCMmenuItem(null,'');

menu11=new VCMmenuItem("presentación","inic.html");
menu12=new VCMmenuItem("geografía","");
	menu12_2=new VCMmenuItem("localización y mapas","geog.html");
	menu12_1=new VCMmenuItem("los montes del valle de buiza","mont.html");
menu13=new VCMmenuItem("datos sobre buiza","dato.html");
menu14=new VCMmenuItem("historia","");
	menu14_1=new VCMmenuItem("documentos históricos","hist_docus.html");
	menu14_3=new VCMmenuItem("buiza en la antigüedad","hist_antig.html");
	menu14_4=new VCMmenuItem("la emigración a cuba","hist_cuba.html");
menu19=new VCMmenuItem("costumbres","");
	menu19_1=new VCMmenuItem("tradiciones","trad.html");
	menu19_2=new VCMmenuItem("religión","reli.html");
menu15=new VCMmenuItem("buiza virtual","virt.html");
menu1a=new VCMmenuItem("fotos","foto.html");
menu17=new VCMmenuItem("eventos","even.html");
	menu17_1=new VCMmenuItem("exposición de maquetas 2005","even_maquetas2005.html");
	menu17_2=new VCMmenuItem("exposición de maquetas 2006","even_maquetas2006.html");
menu16=new VCMmenuItem("vuestras cartas","cart.html");
menuVIS=new VCMmenuItem("libro de visitas","http://book.cranf.net");
menu18=new VCMmenuItem("contacto","cont.html");

menuprincipal.ad(menu11,menu13,menu12,menu14,menu19,menu15,menu1a,menu17,menu16,menuVIS,menu18);
	menu12.ad(menu12_2,menu12_1);
	menu19.ad(menu19_1,menu19_2);
	menu14.ad(menu14_1,menu14_3,menu14_4);
	menu17.ad(menu17_1,menu17_2);

//****************
function menu()
{a='<table width=652 cellspacing=0 cellpadding=0 border=0 background="iconos/mfondogrande.jpg"><tr><td>'+VCMcuadromenu()+'</td><td width=100% class=georgiagrande>'+VCMtitular+'</td><td><img src="iconos/spacer.gif" width=1 height=80></td></tr></table>';
w(a);
}

//****************
function abretabla()
{a='<center><table cellpadding=0 cellspacing=0 border=0><tr><td>&nbsp;</td><td width=6><img src="iconos/spacer.gif" width=6></td><td width=652 bgcolor=#ffffec>';
w(a);}

//****************
function cierratabla()
{a='</td><td width=6 background="iconos/sombralao.gif"><img src="iconos/sombralao.gif" width=6></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td colspan=3><img src="iconos/sombrabajo.gif"></td><td>&nbsp;</td></tr></table></center>';
w(a);}

//****************
function firma()
{a='<div style="text-align:center;color:#BDAF72;font-style:normal;font-family:arial;font-size:9px;letter-spacing:1px">http://buiza.cranf.net (c) alberto viñuela :: voet cranf MMIII - MMV</div><br>';
w(a);}

//****************
function tablasombra(q)
{
a='<table  height=1 cellspacing=0 cellpadding=0 border=0><tr><td>'+q+'</td><td width=6 background="iconos/si2.gif" valign=top><img src="iconos/si1.gif" width=6 height=6></td></tr>';
a+='<td height=6 background="iconos/si4.gif" align=left><img height=6 src="iconos/si3.gif"></td><td width=6 height=6><img src="iconos/si5.gif" width=6 height=6></td></table>';
w(a);
}

//****************
function tablasom()
{
w('<table  height=1 cellspacing=0 cellpadding=0 border=0><tr><td>');
}

//****************
function tablabra()
{
w('</td><td width=6 background="iconos/si2.gif" valign=top><img src="iconos/si1.gif" width=6 height=6></td></tr><td height=6 background="iconos/si4.gif" align=left><img height=6 src="iconos/si3.gif"></td><td width=6 height=6><img src="iconos/si5.gif" width=6 height=6></td></table>');
}


//****************
function cantafoto(url,tit,descri)
{
urlt=url.replace(".","_t.");
w('<table cellspacing=0 class=tablamargen><tr><td>');
tablasombra('<a href="javascript:VCFabrefoto(&quot;'+url+'&quot;,&quot;'+tit+'&quot;)"><img src="'+urlt+'"></a>');
w('</td><td class=textod>'+descri+'</td></tr></table>');
}



function escribe() {location.href="mailto:voet@cranf.net"}
function buizacom() {q="http://bu";window.open(q+"iza.com")}

function VCLcambiatrans(ele2,i)
{var num=Math.ceil(75+Math.cos(i*0.31415927)*25);
if (document.all)	{document.getElementById(ele2).style.filter="alpha(opacity="+num+")"}
else if (document.getElementById(ele2))
{num--;document.getElementById(ele2).style.MozOpacity=num/100;}
}

function VCLdisparatrans(ele)
{for (i=0;i<20 ;i++) setTimeout("VCLcambiatrans('"+ele+"',"+i+")",i*25);}

hexa = "0123456789abcdef";
PI=3.1415927;

function hex2dec(hex)
{return hexa.indexOf(hex.charAt(0))*16+hexa.indexOf(hex.charAt(1));}

function dec2hex(i) 
{	if (i < 0) return "00";
	else if (i > 255) return "ff";
	else return "" + hexa.charAt(Math.floor(i/16)) + hexa.charAt(i%16);}

	
var VCLnetid=0;

function VCLparpadeaNets(e)
{var st=e.target.parentNode;

if (e.target.tagName=="IMG")
	if (st.tagName=="A")
		if (e.target.className!="b")
			{
			e.target.id="soy"+VCLnetid;
			VCLdisparatrans(e.target.id);
			VCLnetid++;
			}
}

function noVCLparpadea() 
{var elemento = event.srcElement;}

function noVCLparpadeaNets(e)
{}


function VCLparpadea() 
{
var elemento = event.srcElement;
	if (elemento.tagName == "A") 
		{VCLbrillo(elemento.uniqueID);return};
	if (elemento.tagName=="IMG")
		if (elemento.parentNode.tagName=="A") 
			 if(elemento.className!="b")
				VCLdisparatrans(elemento.uniqueID);
}

function VCLsetTrans(ele, arg)
{
document.getElementById(ele).style.color=arg+"";
}

function VCLbrillo(elemento)
{
//cini=document.getElementById(elemento).currentStyle.color.substr(1,6);
cini="504A30";
sr=hex2dec(cini.substr(0,2));
sg=hex2dec(cini.substr(2,2));
sb=hex2dec(cini.substr(4,2));
//alert(cini+" "+sr+","+sg+","+sb);

p=PI/200;

for (var i=1;i<41;i++)
	{
	e=(40-i)*(40-i)*p;
	r=sr+Math.sin(e)*sr;
	g=sg+Math.sin(e)*sg;
	b=sb+Math.sin(e)*sb;
	arg="#"+dec2hex(r)+dec2hex(g)+dec2hex(b);
	setTimeout("VCLsetTrans('"+elemento+"','"+arg+"')",i*50);
	}
}


if (!document.all)
{
document.addEventListener('mouseover', VCLparpadeaNets, false);
document.addEventListener('mouseout', noVCLparpadeaNets, false);
}
else
{
document.attachEvent('onmouseover', VCLparpadea);
document.attachEvent('onmouseout', noVCLparpadea);
}