

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function vacio(q) {
        for ( i = 0; i < q.length; i++ ) {
                if ( q.charAt(i) != " " ) {
                        return true
                }
        }
        return false
}

function reply(){
	var repTxt=""
	repTxt+="<p align=center>Sus datos se han mandado correctamente, Gracias</p>"
	document.getElementById('response').innerHTML=repTxt;
}

function validar()
{
    if (vacio(document.frm_presupuesto.telefono.value) == false || vacio(document.frm_presupuesto.contacto.value) == false) {
	    alert("Atención: Falta introducir teléfono y persona de contacto.");
	    return false;
	}
		else
	{
		document.frm_presupuesto.submit();
		reply();
	}
}

	function DisplayElement ( elt, displayValue ) {
		elt = document.getElementById( elt );
		elt.style.display = displayValue;
	}

function anchaltVis(val){
			if (val==2){
				DisplayElement ( 'anchalt_tr', 'block' )
				}
				else{
				DisplayElement ( 'anchalt_tr', 'none' )
				document.frm_presupuesto.ancho.value=""
				document.frm_presupuesto.alto.value=""
				}
}
function anvRev1(val){
			if (val==2){
				DisplayElement ( 'impanChoice_tr', 'block' )
			}
			else{
				DisplayElement ( 'impanChoice_tr', 'none' )
				document.frm_presupuesto.tint1.value=""
				document.frm_presupuesto.seri1.value=""
				}
}
function anvRev2(val){
			if (val==2){
				DisplayElement ( 'imprevChoice_tr', 'block' )
			}
			else{
				DisplayElement ( 'imprevChoice_tr', 'none' )
				document.frm_presupuesto.tint2.value=""
				document.frm_presupuesto.seri2.value=""
				}
}

function initialise(){
		hidenext3();
		hidenum();
		hidepan();
		hideper();
		DisplayElement ( 'imprevChoice_tr', 'none' )
		DisplayElement ( 'impanChoice_tr', 'none' )
		DisplayElement ( "anchalt_tr", "none" )
		document.frm_presupuesto.bmag[0].checked=false;
		document.frm_presupuesto.bmag[1].checked=false
		document.frm_presupuesto.panel[0].checked=false;
		document.frm_presupuesto.panel[1].checked=false
		document.frm_presupuesto.pers[0].checked=false;
		document.frm_presupuesto.pers[1].checked=false;
}

function shownext3(){
			DisplayElement ( "color_tr", "block" )
			DisplayElement ( "sobre_tr", "block" )
			DisplayElement ( "coerc_tr", "block" )
}

function hidenext3(){
			DisplayElement ( "color_tr", "none" )
			DisplayElement ( "sobre_tr", "none" )
			DisplayElement ( "coerc_tr", "none" )
}
function shownum(){
			DisplayElement ( "nucolor_tr", "block" )
}
function hidenum(){
			DisplayElement ( "nucolor_tr", "none" )
}
function showpan(){
		DisplayElement ( "pan_tr", "block" )
		DisplayElement ( "pfimp_tr", "block" )
}
function hidepan(){
		DisplayElement ( "pan_tr", "none" )
		DisplayElement ( "pfimp_tr", "none" )
}

function hideper(){
		DisplayElement ( "pers_tr", "none" )
}
function showper(){
		DisplayElement ( "pers_tr", "block" )
}	

/*
function MostrarFormImpresora () {
	if (document.forms.length==1 && document.forms[0].name=='frm_presupuesto')
	{
		v_formulario=document.frm_presupuesto
		v_valor_tipo=v_formulario.tipo.value

		if (v_valor_tipo=="TARJETAS PVC")
		{
			DisplayElement ( "marca", "none" )
			DisplayElement ( "articulo", "none" )
			DisplayElement ( "grosor", "block" )
			DisplayElement ( "unidades", "block" )
			DisplayElement ( "nro_tintas", "block" )
			DisplayElement ( "tinta_especial", "block" )
			DisplayElement ( "personalizacion", "block" )
			DisplayElement ( "foto", "block" )
			DisplayElement ( "banda_magnetica", "block" )
			DisplayElement ( "codigo_barras", "block" )
			DisplayElement ( "paneles_esp", "block" )
			DisplayElement ( "agujero", "block" )
		}
		else if (v_valor_tipo=="IMPRESORAS DE TARJETAS")
		{
				DisplayElement ( "marca", "block" )
				DisplayElement ( "articulo", "none" )
				DisplayElement ( "grosor", "none" )
				DisplayElement ( "unidades", "none" )
				DisplayElement ( "nro_tintas", "none" )
				DisplayElement ( "tinta_especial", "none" )
				DisplayElement ( "personalizacion", "none" )
				DisplayElement ( "foto", "none" )
				DisplayElement ( "banda_magnetica", "none" )
				DisplayElement ( "codigo_barras", "none" )
				DisplayElement ( "paneles_esp", "none" )
				DisplayElement ( "agujero", "none" )
		}
		else
		{
				DisplayElement ( "marca", "none" )
				DisplayElement ( "articulo", "block" )
				DisplayElement ( "grosor", "none" )
				DisplayElement ( "unidades", "none" )
				DisplayElement ( "nro_tintas", "none" )
				DisplayElement ( "tinta_especial", "none" )
				DisplayElement ( "personalizacion", "none" )
				DisplayElement ( "foto", "none" )
				DisplayElement ( "banda_magnetica", "none" )
				DisplayElement ( "codigo_barras", "none" )
				DisplayElement ( "paneles_esp", "none" )
				DisplayElement ( "agujero", "none" )
		}
	}
	}

	function varios () {
        positionIt();
        MostrarFormImpresora();
	}
*/

// --------------------------------


//window.onload = positionIt;
//window.onload = varios;
//window.onresize = positionIt;

