function CambiaMenu(refer,nueva) 
{
	document[refer].src=nueva; 
}
/****************** menu **********************/
id_timer = 0;
function timerEsconder(ob) {
    id_timer = setTimeout("esconder('" + ob + "');", 4000);
}
function esconder(ob) {
    $(ob).setStyles({ "display": "none" });
}
function esconderTodo() {
    esconder('submenuSuc');
    esconder('submenuCli');
    esconder('submenuEmp');
}
function mostrar(ob) {
    esconderTodo();
    clearTimeout(id_timer)
    $(ob).setStyles({ "display": "inline" });
}
/***************** Fin de menu **********************/
/***************** Habrir ventas********************/
function abrirventana(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir, nombre) {
    //ejemplo de un  popup abrirventana('popup.php',0,0,0,0,0,0,0,320,290,50,50,1,'popup')
    var opciones = "";
    if (pantallacompleta != "") { opciones = opciones + "fullscreen=" + pantallacompleta + ","; }
    if (herramientas != "") { opciones = opciones + "toolbar=" + herramientas + ","; }
    if (direcciones != "") { opciones = opciones + "location=" + direcciones + ","; }
    if (estado != "") { opciones = opciones + "status=" + estado + ","; }
    if (barramenu != "") { opciones = opciones + "menubar=" + barramenu + ","; }
    if (barrascroll != "") { opciones = opciones + "scrollbars=" + barrascroll + ","; }
    if (cambiatamano != "") { opciones = opciones + "resizable=" + cambiatamano + ","; }
    if (ancho != "") { opciones = opciones + "width=" + ancho + ","; }
    if (alto != "") { opciones = opciones + "height=" + alto + ","; }
    if (izquierda != "") { opciones = opciones + "left=" + izquierda + ","; }
    if (arriba != "") { opciones = opciones + "top=" + arriba; }
    var ventana = window.open(direccion, nombre, opciones, sustituir);
}
/***************Fin de Habrir ventas****************/

/***********Arreglar menu izquierdo y poner la fodo de abajo en su lugar**************/

    function initMasterpage() {
        //top:,left:,width:,height:,right:,bottom:
        var posContenido = $('mainContent').getCoordinates();
        var posMenu = $('sidebar1').getCoordinates();

        if (posContenido.height > posMenu.height) {
            alert('es mayor');
            $('sidebar1').setStyles({ "height": posContenido.height });
        }
        else {
            alert('es menor');
        }

        /*
        //pone la imagen bottom pegada a la linea del footer
        if ($('imagenBottom')) {
            var posImgBott = $('imagenBottom').getCoordinates();
            posMenu = $('sidebar1').getCoordinates(); //saco de nuevo las cordenadas por si cambio
            /*
            alert("imagenbot top: " + posImgBott.top + " left: " + posImgBott.left + " width: " + posImgBott.width + " height: " + posImgBott.height + " right: " + posImgBott.right + " bottom: " + posImgBott.bottom + " \n"
            + "Contenido top: " + posContenido.top + " left: " + posContenido.left + " width: " + posContenido.width + " height: " + posContenido.height + " right: " + posContenido.right + " bottom: " + posContenido.bottom + " \n"
            + "sidebar1  top: " + posMenu.top + " left: " + posMenu.left + " width: " + posMenu.width + " height: " + posMenu.height + " right: " + posMenu.right + " bottom: " + posMenu.bottom);
            /
            $('mainContent').setStyles({ "height": posMenu.height });
            $('imagenBottom').setStyles({ "margin-top": (posMenu.bottom - posImgBott.bottom) });
        }
            /**/
    }

    /******* Fin de Arreglar menu izquierdo y poner la fodo de abajo en su lugar**************/







/**************************************Banners************************************************/
        $(document).ready(
				function () {
				    

				    $('ul#portfolio').innerfade({
				        speed: 1000,
				        timeout: 5000,
				        type: 'sequence',
				        containerheight: '300px'
				    });

				});

				/*********************************************************************************/

/*
        $(document).ready
        (
				function () {
				    var posContenido = $('#mainContent').height();
				    var posMenu = $('#sidebar1').height();
				    if (posContenido > posMenu) {
				        $('#sidebar1').css({ height: posContenido });
				    }
				    else {

				    }
				}
        );
  */  
