/* Menu inicial */
$(document).ready(function(){
    $("#nav-one li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    if (document.all) {
        $("#nav-one li").hoverClass ("sfHover");
    }
});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};    


    $(function() { 
        // cache the question element 
        var question = $('#question')[0]; 
 
        $('#test').click(function() { 
            $.blockUI(question, { width: '275px' }); 
        }); 
 
        $('#yes').click(function() { 
            // update the block message 
            $.blockUI("<h1>Remote call in progress...</h1>" ); 
 
            $.ajax({ 
                url: 'wait.php?' + new Date().getTime(), // prevent caching in IE 
                complete: function() { 
                    // unblock when remote call returns 
                    $.unblockUI(); 
                } 
            }); 
            return false; 
        }); 
 
        $('#no').click($.unblockUI); 
    }); 




function cambiafondotrpasison(id) {
document.getElementById(id).style.background="url(images/fondomenui1.gif)";
}

function cambiafondotrpasisoff(id) {
document.getElementById(id).style.background="url(images/fondomenui.gif)";
}

function nuevoAjax()
{ 
	var xmlhttp=false; 
	try 
	{ 
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
}

function cambialistateles(paistele) {
d="<iframe src='cambiateles.php?paistele="+paistele+"' width='238' height='339'  AllowTransparency frameborder='0'></iframe>";
document.getElementById("telepais").innerHTML=d;		

}


function cambiaondeman(tipo,id) {
		ajax=nuevoAjax();
		ajax.open("GET", 'cambiaondeman'+tipo+'.php?_pagi_pg='+id, true);
		ajax.onreadystatechange=function() 	{ 
			if (ajax.readyState==1)	{

			}
			if (ajax.readyState==4)	{ 
				document.getElementById("ondeman").innerHTML=ajax.responseText;
			} 
		}
		ajax.send(null);
}
