window.onresize=ajustar;

function ajustar()
{
	document.getElementById('contenedor').style.width = (document.body.clientWidth < 800) ? '64.2em': '100%';
	document.getElementById('menuh').style.width = (document.body.clientWidth < 800) ? '100%': '100%';
}

function popup(url, ancho, alto, centrada)
{
	var v=null;
	if(v) v.close();
	var textCentro="";
	if(centrada){
	   var izq = (screen.width - ancho) / 2;
	   var arr = (screen.height - alto) / 2;
		textCentro=", left="+izq+", top="+arr;
	}
	var w=window.open(url,"","width="+ancho+", height="+alto+textCentro);
	return false;
}
function popup2(url, ancho, alto, centrada)
{
	var v=null;
	if(v) v.close();
	var textCentro="";
	if(centrada){
	   var izq = (screen.width - ancho) / 2;
	   var arr = (screen.height - alto) / 2;
		textCentro=", left="+izq+", top="+arr;
	}
	var w=window.open(url,"","width="+ancho+", height="+alto+textCentro+",scrollbars=yes,defaultStatus");
	return false;
}



function solic_tarjeta (tipo,item,subitem)
{
	var parametros=(tipo?"?tipo="+tipo:"")+(item?"&item="+item:"")+(subitem?"&subitem="+subitem:"");
	popup("inc/tarjeta.php"+parametros,284,550,1);
	return false;
}

function solicitar(tipo,item,subitem)
{
	var sub=subitem?("&subitem="+subitem):""
	popup("inc/presupuestoyrenting.php?tipo="+tipo+"&item="+item+sub,500,550,1);
	return false;
}

function CargaSeccionTrabaja()
{
    var f=document.getElementById("ftrabaja");

    var dpto=f.dpto.value;
    var sec=f.seccion;
    if(dpto==1 || dpto==2){
        f.seccion.disabled=false;
        f.seccion.options[1]=null;
        f.seccion.options[2]=null;
        f.seccion.options[3]=null;
        f.seccion.options[1]=new Option("Administración");
        f.seccion.options[2]=new Option("Comercial");

        if (dpto==1)
           f.seccion.options[3]=new Option("Técnico");

        if (dpto==2)
                f.seccion.options[3]=new Option("Mecánico");
    }
}

/*
var TF=75;
function aumentar()
{
	TF+=5;
	document.getElementById("body").style.fontSize=TF+"%";	
}

function disminuir()
{
	TF-=5;
	document.getElementById("info").style.fontSize=TF+"%";	
}
*/