﻿var popUp; 

function OpenCalendar(idname, postBack)
{
	if(idname=="TextBox1")
	{
	popUp = window.open('Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=160,height=210,left=415,top=322,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no');
		}
		else{
		popUp = window.open('Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=160,height=210,left=415,top=356, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no');
		}
}

function SetDate(formName, id, newDate, postBack)
{
	
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	if (postBack)
		__doPostBack(id,'');
}		


function CloseWindow()
 {
   self.close();
 }
            
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  x.src=x.oSrc;
}
function ImgRestore() { 
  
  for (i = 0; i < document.form1.opt_carros_.length; i++) 
  {
    if (document.form1.opt_carros_[i].checked)
    {
        switch ( document.form1.opt_carros_[i].value )
        { 
	        case "Mini Van": 
	                document.images["autos"].src="images/c_familiar_ppal.gif";
			        break;
	        case "Intermedio": 
	                document.images["autos"].src="images/c_intermedio_ppal.gif";
			        break;
			case "Rústico 4x4 4 Puertas": 
	                document.images["autos"].src="images/c_rustico_ppal.gif";
			        break;
			case "Rústico 4x4 2 Puertas": 
	                document.images["autos"].src="images/c_meru_ppal.gif";
			        break;
	        case "Pick Up Doble Cabina": 
	                document.images["autos"].src="images/c_dcabina_ppal.gif";
			        break;
			case "Compacto": 
	                document.images["autos"].src="images/c_compacto_ppal.gif";
			        break;
			case "Económico": 
	                document.images["autos"].src="images/c_económico_ppal.gif";
			        break;
			case "Carga": 
	                document.images["autos"].src="images/c_hiace_ppal.gif";
			        break;
	        default:
	            document.images["autos"].src="images/c_económico_ppal.gif";
        }


     
    }
    
  }

}

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];}}
}

function MM_findObj(n, d) { //v4.01
  alert(n);
  alert(d);
  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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function mensaje() 
    { 
    //document.images["autos"].src="images/c_intermedio_ppal.gif";
    for (i = 0; i < document.form1.radio1.length; i++) 
    {
        if (document.form1.radio1[i].checked)
        {
            document.form1.TextBox3.text=document.form1.radio1[i].value;
            //alert("entro");
            
         }
    }
    } 
    
    
function popupWindow(url) 
    {
    window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=180,height=250,top=150,left=150')
    }
    
function popupWindowG(url) 
    {
    window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=520,height=250,screenX=400,screenY=500,top=500,left=400')
    }
    
    


