// JavaScript Document



//$(document).ready(inicio());
	
function inicio()
{	
	activarFlash();
	startList();
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("mmenuP");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;


function activarFlash()
{
	setTimeout("siguienteFlash()", 4000);
}

var i = 0;
var primera = true;

function siguienteFlash()
{
	
	var img = new Array("#imgFlash1", "#imgFlash2");
	var numImg = img.length;
	var total = numImg - 1;
		//alert(i);
	if((i==0) && (primera))
	{	
		$(img[i]).toggle("slide",{},"slow");
		i++;
		primera = false;		
	}
	else if((i==0) && (!primera))
	{
		$(img[i]).toggle("slide",{},"slow");		
		primera = true;
		var j=1;
		for(j=1;j<total;j++)
		{			
			$(img[j]).toggle("slide",{},"slow");
		}
	}
	else
	{
		$(img[i]).toggle("slide",{},"slow");
		i++;
	}
		
	if(i==total)
	{
		i=0;		
	}
	activarFlash();
}





//funciones de la ventana emergente

$(function ventana(){
	// Dialog			
	$('#dialog').dialog({
		autoOpen: true,
		width: 300		
	});
});


