/***********************************************
* Función para obtener la posición del ratón
* autoria: caricatos.net
***********************************************/

var _ns4 = (document.layers) ? true : false;
var _ie = (document.all) ? true : false;
var _ns6 = (document.getElementById && !_ie) ? true : false;
var _coorX, _coorY;

if (_ns6)	document.addEventListener("mousemove", mouseMove, true);
if (_ns4)	{document.captureEvents(Event.MOUSEMOVE); document.mousemove = mouseMove;}
if (_ie)	document.onmousemove = mouseMove;

function mouseMove(e)
{
	if (_ns4||_ns6)	{_coorX = e.pageX; _coorY = e.pageY; /*e.preventDefault();*/}
	if (_ie)	{_coorX = event.x + document.body.scrollLeft; _coorY = event.y + document.body.scrollTop;}
	//return false;
}

function ratitaX()	{
	return _coorX;

}

function ratitaY()	{
	return _coorY;
}



/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=50

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",5)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

 function rdm()
  {
      var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    }
    else
        if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
        {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        }
        else
            if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
            {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
            }

    menuleft.style.height=(myHeight-188) + "px";
    banner.style.height=(myHeight-188) + "px";
    centro.style.height=(myHeight-188) + "px";
    centro.style.width=(myWidth-458) + "px";
    topban.style.width=(myWidth-149) + "px";
    footer.style.width=(myWidth-149) + "px";
    rounded.style.width=(myWidth-149) + "px";
    document.all("new").src="http://www.mediaxred.com/wordpress";
  }

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate


/*****************************************************************************
Carousel de imágenes (marquesina horizontal). Script creado por Tunait! (18/8/2003) modificado el 25/12/2003.
Si quieres usar este script en tu sitio eres libre de hacerlo con la condición de que permanezcan intactas estas líneas, osea, los créditos.
No autorizo a publicar y ofrecer el código en sitios de script sin previa autorización
Si quieres publicarlo, por favor, contacta conmigo.
http://javascript.tunait.com/
tunait@yahoo.com
******************************************************************************/
var ancho = 400  // especifica la anchura a mostrar
var alto = 300 // especifica la altura a mostrar (alto de las imágenes)
var velo = 10 // velocidad
var dis = 2 //cantidad de pixels que desplaza por movimiento

var imagenes = new Array()
imagenes[0] = new Image()
imagenes[0].src = "imagenes/thumbZep1-1.png" // ruta o nombre de imagen
imagenes[0].a = "imagenes/Zep1-1.png" // link de la imagen
imagenes[0].target = "_blank" //target del link
imagenes[1] = new Image()
imagenes[1].src = "imagenes/thumbZep1-2.png"
imagenes[1].a = "imagenes/Zep1-2.png"
imagenes[1].target = "_self"
imagenes[2] = new Image()
imagenes[2].src = "imagenes/thumbZep1-3.png"
imagenes[2].a = "imagenes/Zep1-3.png"
imagenes[2].target = "_blank"
imagenes[3] = new Image()
imagenes[3].src = "imagenes/thumbZep1-4.png"
imagenes[3].a = "imagenes/Zep1-4.png"
imagenes[3].target = "_blank"
imagenes[4] = new Image()
imagenes[4].src = "imagenes/thumbZep1-5.png"
imagenes[4].a = "imagenes/Zep1-5.png"
imagenes[4].target = "_blank"
imagenes[5] = new Image()
imagenes[5].src = "imagenes/thumbZep1-6.png"
imagenes[5].a = "imagenes/Zep1-6.png"
imagenes[5].target = "_blank"
imagenes[6] = new Image()
imagenes[6].src = "imagenes/thumbZep1-7.png"
imagenes[6].a = "imagenes/Zep1-7.png"
imagenes[6].target = "_blank"
imagenes[7] = new Image()
imagenes[7].src = "imagenes/thumbZep1-8.png"
imagenes[7].a = "imagenes/Zep1-8.png"
imagenes[7].target = "_blank"
imagenes[8] = new Image()
imagenes[8].src = "imagenes/thumbZep1-9.png"
imagenes[8].a = "imagenes/Zep1-9.png"
imagenes[8].target = "_blank"
imagenes[9] = new Image()
imagenes[9].src = "imagenes/thumbZep1-10.png"
imagenes[9].a = "imagenes/Zep1-10.png"
imagenes[9].target = "_blank"
imagenes[10] = new Image()
imagenes[10].src = "imagenes/thumbZep1-11.png"
imagenes[10].a = "imagenes/Zep1-11.png"
imagenes[10].target = "_blank"
imagenes[11] = new Image()
imagenes[11].src = "imagenes/thumbZep1-12.png"
imagenes[11].a = "imagenes/Zep1-12.png"
imagenes[11].target = "_blank"
imagenes[12] = new Image()
imagenes[12].src = "imagenes/thumbZep1-13.png"
imagenes[12].a = "imagenes/Zep1-13.png"
imagenes[12].target = "_blank"
imagenes[13] = new Image()
imagenes[13].src = "imagenes/thumbZep1-14.png"
imagenes[13].a = "imagenes/Zep1-14.png"
imagenes[13].target = "_blank"
imagenes[14] = new Image()
imagenes[14].src = "imagenes/thumbZep1-15.png"
imagenes[14].a = "imagenes/Zep1-15.png"
imagenes[14].target = "_blank"
imagenes[15] = new Image()
imagenes[15].src = "imagenes/thumbZep1-16.png"
imagenes[15].a = "imagenes/Zep1-16.png"
imagenes[15].target = "_blank"
imagenes[16] = new Image()
imagenes[16].src = "imagenes/thumbZep1-17.png"
imagenes[16].a = "imagenes/Zep1-17.png"
imagenes[16].target = "_blank"
imagenes[17] = new Image()
imagenes[17].src = "imagenes/thumbZep1-18.png"
imagenes[17].a = "imagenes/Zep1-18.png"
imagenes[17].target = "_blank"
imagenes[18] = new Image()
imagenes[18].src = "imagenes/thumbZep1-19.png"
imagenes[18].a = "imagenes/Zep1-18.png"
imagenes[18].target = "_blank"

var vel = velo
pasos = 4
var tot = 0
var tam =0;
var pos,pos2,tam2 =0;
function escribe(){
document.write ('<div id ="fuera" style="position:relative; width:' + ancho + 'px; height:' + alto + 'px;overflow:hidden">');
document.write ('<span id="imas" style="position:absolute; width:' + tam + 'px;height:' + alto + 'px; left = -' + tam + 'px;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0"  src ="' + imagenes[m].src + '" id="ima' + m + '" name="ima' + m + '"  onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('<span id="imas2" style="position:absolute; width:' + tam + 'px;height:' + alto + ';left=0;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0" src ="' + imagenes[m].src + '" id="imaa' + m + '" name="imaa' + m + '" onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('</div>');
document.write ('<img border="0" src ="' + 'arrow.gif" onmouseover="{atras = true}" onmouseout="{atras = false}">');


}
var detienee = 0,posb,pos2b;
function mueve(){
pos = document.getElementById('imas').style.left;
pos2 = document.getElementById('imas2').style.left;
pos = pos.replace(/px/,"");
pos = pos.replace(/pt/,"");
pos = new Number(pos);
pos2 = pos2.replace(/px/,"");
pos2 = pos2.replace(/pt/,"");
pos2 = new Number(pos2);
if(detienee == 1){
	posb = pos;
	pos2b = pos2;
	}
if(atras == true){
pos-=dis;
pos2 -=dis;
}
else{
pos += dis;
pos2 += dis;
}
if(pos2 > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas2').style.left = pos  - (tam + dis);
		pos2 = document.getElementById('imas2').style.left;
		}
	else{
		document.getElementById('imas').style.left = pos
		}
	}
else{
	document.getElementById('imas').style.left = pos
	}

if(pos > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas').style.left = pos2 - (tam + dis);
		pos = document.getElementById('imas').style.left;
		}
	else{
		document.getElementById('imas2').style.left = pos2;
		}
	}
else{
	document.getElementById('imas2').style.left = pos2
	}
if(detienee > 0){
	if(detienee == pasos){
		vel = velo;
		atras = true;
		detienee--;
		tiempo = setTimeout('mueve()',vel);
		}
	else{
		if(atras == true){
			if(detienee>(pasos/2))
				{detienee--}
			else{
			vel = velo;
			clearTimeout(tiempo)
			}
			}
	else{
		detienee++
		}
	if(detienee > (pasos/2) && atras == false){vel +=10}
		if(detienee < (pasos/2)){vel +=10}
		tiempo = setTimeout('mueve()',vel)
		}
	}
else{
tiempo = setTimeout('mueve()',vel)
	}
if(atras == true){
		if (pos == posb){
			clearTimeout(tiempo);
			atras = false;
			}
		}
}
var tiempo;
var atras = false, ini;
function inicio(){
if(tot == (imagenes.length * 2)){clearTimeout(ini);reDimCapas();mueve()}
else{ini=setTimeout('inicio()',500)}
}
function reDimCapas(){
for(m=0;m<imagenes.length;m++){
	tam +=document.getElementById('ima'+m).width
	document.getElementById('imas').style.left = (-tam +10);
	document.getElementById('imas').style.width = tam ;
	document.getElementById('imas2').style.width = tam;
	}
}

function atras(){
 var atras = true;
}





var color_fondo_pop="#CCCCCC"
var titulo="Imagen blasten.com"

function detectar_existente(obj){
return (typeof obj !="undefined")
}

function pop_img(img_path, popwidth, popheight, descripcion_img){

function posicion(){
izquierda_=(detectar_existente(window.screenLeft))?
screenLeft+document.body.clientWidth/2-popwidth/2 :
detectar_existente(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
superior_=(detectar_existente(window.screenTop))?
screenTop+document.body.clientHeight/2-popheight/2 :
detectar_existente(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
if (window.opera){
izquierda_-=screenLeft
superior_-=screenTop
}
}

posicion()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes, left='+izquierda_+',top='+superior_
var contenido=(color_fondo_pop.indexOf(".")!=-1)?
'background="'+color_fondo_pop+'"' : 'bgcolor="'+
color_fondo_pop+'"'
if (typeof pop_ventana=="undefined" || pop_ventana.closed)
pop_ventana=window.open("","",winattributes)
else{
pop_ventana.resizeTo(popwidth, popheight+30)
}
pop_ventana.document.open()
pop_ventana.document.write('<html><title>'+titulo+'</title> <body '+contenido+'>'+descripcion_img+'<img src="'+img_path+'" style="margin-bottom: 0.5em"><br></body></html>')
pop_ventana.document.close()
pop_ventana.focus()
}

function mostrar(nombreCapa)
    {

   document.getElementById(nombreCapa).style.visibility="visible"
            document.getElementById(nombreCapa).style.left= (ratitaX()+10) + "px"
            document.getElementById(nombreCapa).style.top= (ratitaY()+10) + "px"

    }

function mostrardiv(nombreCapa)
    {
        document.getElementById(nombreCapa).style.visibility="visible";
        document.getElementById(nombreCapa).style.height="330px";
    }
function ocultar(nombreCapa)
    {
        document.getElementById(nombreCapa).style.visibility="hidden";
        document.getElementById(nombreCapa).style.height="0px";
    }

function click2009()
    {
            mostrardiv('2009')
            ocultar('2010')
    }

function click2010()
    {
            mostrardiv('2010')
            ocultar('2009')
    }

function rdm()
{
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    }
    else
        if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
        {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
        }
        else
            if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
            {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
            }

        bleft.style.height=(myHeight-240) + "px";
        repro.style.height=(myHeight-240) + "px";
       <!-- main.style.height=winheight + "px"; -->
}