//PRINCIPIO desactivar seleccion de texto --------------------------------------






function disableselect(e)
{
    return false
}
function reEnable()
{
    return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar)
{
    document.onmousedown=disableselect
    document.onclick=reEnable
}

function MM_preloadImages() { //v3.0
    var d=document;
    if(d.images){
        if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
        for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){
                d.MM_p[j]=new Image;
                d.MM_p[j++].src=a[i];
            }
        }
}
// desactivar seleccion de texto -------------------------------------------------


// desactivar boton derecho ------------------------------------------------------

var mensaje = "[Copyright 2009 DIODOLÁSER]";
function derecho(e)
{
    if (navigator.appName == 'Netscape' && e.which == 3)
        alert(mensaje);
    else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2)
        alert(mensaje);
}
document.onmousedown = derecho;
//fin desactivar boton derecho.

// NO BARRA EN POPUP ----------------------------------------------------------

function Abrir_ventana (pagina) {
    var opciones="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=486,height=430,top=85,left=140";
    window.open(pagina,"pop",opciones);
}

// ENVIAR FORMULARIO ----------------------------------------------------------



function valida_envia2(){

	
    if (document.fvalida2.nombre.value.length==0){
        alert("Por favor, escriba su nombre.")
        document.fvalida2.nombre.focus()
        return 0;
    }
	
	
    if (document.getElementById("fvalida2").telefono.value.length==0){
        alert("Por favor, escriba su teléfono.")
        document.getElementById("fvalida2").telefono.focus()
        return 0;
    }

	
    //el formulario se envia

    document.fvalida2.submit();
}

$(function() {
	$('#menuLinks a').each(function() {
                $(this).data('top', -60);
                $(this).data('bg', 0);
                $(this).data('desiredBg', $(this).hasClass('selected') ? 0 : -$(this).height());
                $(this).data('spantop', 0);
        });

        $('.layer').mouseover(function() {
                $(this).parent().data('desiredBg', 0);
                if (!$(this).parent().hasClass('selected')) {
                        $(this).parent().data('spantop', -60);
                }
        }).mouseout(function() {
                $(this).parent().data('over', false);
                $(this).parent().data('desiredBg', -$(this).height())
        });

        setInterval(function() {
                $('#menuLinks a').each(function(index) {
                        $(this).data('top', Math.round($(this).data('top') / 2));
                        var currentSpanTop = $(this).data('spantop');
                        $(this).data('spantop', currentSpanTop > -15 ? -currentSpanTop/2 : currentSpanTop + 10);
                        $(this).data('bg', Math.round($(this).data('bg') + ($(this).data('desiredBg') - $(this).data('bg')) / 2));
                        $(this).css({top: $(this).data('top') + 'px', backgroundPosition: 'center ' + ($(this).hasClass('selected') ? '0px' : $(this).data('bg') + 'px')});
                        $(this).children('span').css('top', $(this).data('spantop') + 10 + 'px');
                });
        }, 50);
});





