<!--
var cantidad	= new Array();
cantidad["sub"] = "3";
cantidad["mapa"] = "3";
totalPestana["tab"] = 3;
totalPestana["mapa"] = 3;
var varcerrarmenu = new Array;
varcerrarmenu['ico']=true;
varcerrarmenu['ico3']=true;
varcerrarmenu['mapa']=true;
varcerrarmenu['mapa2']=true;
varcerrarmenu['mapa3']=true;
var estaCargada=true;
function busquedaCheckinPlt(obj, theForm) {

	if(obj.selectedIndex!=0) {
		document.getElementById('dire_GenRuta').disabled=false;
	} else {
		document.getElementById('dire_GenRuta').checked=false;
		document.getElementById('dire_STransito').checked=false;
		document.getElementById('dire_GenRuta').disabled=true;
		document.getElementById('dire_STransito').disabled=true;
	}
}
function busquedaCheckinRutaPlt(obj, theForm) {
	if(obj.selectedIndex!=0) {
		document.getElementById('dire_GenRuta').disabled=false;
	} else {
		document.getElementById('dire_GenRuta').checked=false;
		document.getElementById('dire_GenRuta').disabled=true;
	}
}
function busquedaCheckinOffPlt(obj, theForm) {
	if(obj.selectedIndex!=0) {
		document.getElementById('dire_STransito').disabled=false;
	} else {
		document.getElementById('dire_STransito').checked=false;
		document.getElementById('dire_STransito').disabled=true;
	}
}

function checkTransitoPlt(obj, theForm) {
	if ((document.getElementById('dire_Altura1').value == "") && (document.getElementById('dire_NombreViaInt1').value == ""))
	{

		alert ("Esta opción se puede utilizar solo con dirección o intersección");
		document.getElementById('dire_GenRuta').checked=false;
		return false;
	}
	if(obj.checked) {
		document.getElementById('dire_STransito').disabled=false;
	} else {
		document.getElementById('dire_STransito').checked=false;
		document.getElementById('dire_STransito').disabled=true;
	}
}

function doSubmitSearchDireccion(idForm)
{
	AsignaResolucion(document.forms[idForm]);

	if(CheckDireccion('dire_NombreVia1','dire_Altura1','dire_Comuna1','dire_CodigoPostal1'))
	{
		//pasar valores
		document.forms[idForm]['ciudad'					].value = document.getElementById('dire_ciudad'				).value;
		document.forms[idForm]['Producto'				].value = document.getElementById('dire_Producto'			).value;
		document.forms[idForm]['opcbuscar'			].value = document.getElementById('dire_opcbuscar'		).value;
		document.forms[idForm]['icono'					].value = document.getElementById('dire_icono'				).value;
		document.forms[idForm]['icmapa'					].value = document.getElementById('dire_icmapa'				).value;
		document.forms[idForm]['colormapa'			].value = document.getElementById('dire_colormapa'		).value;
		document.forms[idForm]['icono1'					].value = document.getElementById('dire_icono1'				).value;
		document.forms[idForm]['TipoVia1'				].value = document.getElementById('dire_TipoVia1'			).value;
		document.forms[idForm]['NombreVia1'			].value = document.getElementById('dire_NombreVia1'		).value;
		document.forms[idForm]['Altura1'				].value = document.getElementById('dire_Altura1'			).value;
		document.forms[idForm]['NombreViaInt1'	].value = document.getElementById('dire_NombreViaInt1').value;
		document.forms[idForm]['CodigoPostal1'	].value = document.getElementById('dire_CodigoPostal1').value;
		document.forms[idForm]['Comuna1'				].value = document.getElementById('dire_Comuna1'			).value;
		document.forms[idForm]['TxtPer1'				].value = document.getElementById('dire_TxtPer1'			).value;
		document.forms[idForm]['IdServicio'			].value = document.getElementById('dire_IdServicio'		).value;
		document.forms[idForm]['GenRuta'				].value = document.getElementById('dire_GenRuta'			).value;
		document.forms[idForm]['STransito'			].value = document.getElementById('dire_STransito'		).value;

		//submit
		document.getElementById(idForm).submit();
	}
}

function CheckDireccion(idNombreVia,idAltura,idComuna,idCodigoPostal)
{
	var calle		=	document.getElementById(idNombreVia);
	var numero	=	document.getElementById(idAltura);
	var comuna	=	document.getElementById(idComuna);
	var cp			=	document.getElementById(idCodigoPostal);

	if ( calle.value == "" && comuna.options[comuna.selectedIndex].value == "" )
	{
		if ( cp.value == "" )
		{
			alert ("Debe ingresar nombre de Calle y/o Comuna y/o Codigo Postal");
			calle.focus();
			return false;
		}
		else
		{
			if ( isNaN(cp.value) )
			{
				alert ("Codigo Postal invalido, debe ser numerico");
				cp.value = "";
				cp.focus();
				return false;
			}
			if ( cp.value.length < 7 )
			{
				alert ("Codigo Postal invalido, debe ser de largo 7");
				cp.value = "";
				cp.focus();
				return false;
			}
		}
	}

	if ( numero.value != "" )
	{
		if ( ! CheckNum(numero) )
		{
			alert ("Numero no valido. Ingrese solo numeros");
			numero.value="";
			numero.focus();
			return false;
		}
	}
	CambiaBotonBuscar('bot_buscar01');
	return true;
}


function doSubmitSearchRuta(idForm){

	AsignaResolucion(document.forms[idForm]);

	if (CheckRuta('ruta_NombreVia1','ruta_NombreViaInt1','ruta_Altura1','ruta_Comuna1','ruta_NombreVia2','ruta_NombreViaInt2','ruta_Altura2','ruta_Comuna2')){
		//pasar valores
		document.forms[idForm]['Producto'     ].value = document.getElementById('ruta_Producto'    ).value;
		document.forms[idForm]['ciudad'       ].value = document.getElementById('ruta_ciudad'      ).value;
		document.forms[idForm]['opcbuscar'    ].value = document.getElementById('ruta_opcbuscar'   ).value;
		document.forms[idForm]['icono'        ].value = document.getElementById('ruta_icono'       ).value;
		document.forms[idForm]['icmapa'       ].value = document.getElementById('ruta_icmapa'      ).value;
		document.forms[idForm]['icorigen'     ].value = document.getElementById('ruta_icorigen'    ).value;
		document.forms[idForm]['icdestino'    ].value = document.getElementById('ruta_icdestino'   ).value;
		document.forms[idForm]['icono1'       ].value = document.getElementById('ruta_icono1'      ).value;
		document.forms[idForm]['icono2'       ].value = document.getElementById('ruta_icono2'      ).value;
		document.forms[idForm]['colormapa'    ].value = document.getElementById('ruta_colormapa'   ).value;
		document.forms[idForm]['TipoVia1'     ].value = document.getElementById('ruta_TipoVia1'    ).value;
		document.forms[idForm]['NombreVia1'   ].value = document.getElementById('ruta_NombreVia1'  ).value;
		document.forms[idForm]['Altura1'      ].value = document.getElementById('ruta_Altura1'     ).value;
		document.forms[idForm]['NombreViaInt1'].value = document.getElementById('ruta_NombreViaInt1').value;
		document.forms[idForm]['Comuna1'      ].value = document.getElementById('ruta_Comuna1'     ).value;
		document.forms[idForm]['TxtPer1'      ].value = document.getElementById('ruta_TxtPer1'     ).value;
		document.forms[idForm]['TipoVia2'     ].value = document.getElementById('ruta_TipoVia2'    ).value;
		document.forms[idForm]['NombreVia2'   ].value = document.getElementById('ruta_NombreVia2'  ).value;
		document.forms[idForm]['Altura2'      ].value = document.getElementById('ruta_Altura2'     ).value;
		document.forms[idForm]['NombreViaInt2'].value = document.getElementById('ruta_NombreViaInt2').value;
		document.forms[idForm]['Comuna1'      ].value = document.getElementById('ruta_Comuna1'     ).value;
		document.forms[idForm]['TxtPer2'      ].value = document.getElementById('ruta_TxtPer2'     ).value;

		//submit
		document.getElementById(idForm).submit();
	}
}

function CheckRuta(idNombreVia1,idNombreViaInt1, idAltura1, idComuna1, idNombreVia2, idNombreViaInt2, idAltura2, idComuna2)
{
	var calle1		=document.getElementById(idNombreVia1);
	var calleint1	=document.getElementById(idNombreViaInt1);
	var numero1		=document.getElementById(idAltura1);
	var comuna1		=document.getElementById(idComuna1);
	var calle2		=document.getElementById(idNombreVia2);
	var calleint2	=document.getElementById(idNombreViaInt2);
	var numero2		=document.getElementById(idAltura2);
	var comuna2		=document.getElementById(idComuna2);

	if (( calle1.value == "" && numero1.value == "" ) || ( calle1.value == "" && calleint1.value == "" ))
	{
		alert ("Ingrese Direccion o Interseccion de Origen")
		calle1.focus()
		return false
	}

	if (( calle2.value == "" && numero2.value == "" ) || ( calle2.value == "" && calleint2.value == "" ))
	{
		alert ("Ingrese Direccion o Interseccion de Destino")
		calle2.focus()
		return false
	}

	if ( numero1.value != "" )
	{
		if ( ! CheckNum(numero1) )
		{
			alert ("Numero de Origen no valido, ingrese solo numeros");
			numero1.value="";
			numero1.focus();
			return false;
		}
	}

	if ( numero2.value != "" )
	{
		if ( ! CheckNum(numero2) )
		{
			alert ("Numero de Destino no valido, ingrese solo numeros");
			numero2.value="";
			numero2.focus();
			return false;
		}
	}
	CambiaBotonBuscar('bot_buscar02');
	return true;
}

function CheckNum(querynumero)
{
	if ( isNaN(querynumero.value) )
	{
		return false;
	}
	else
	{
		return true
	}
}

function doSubmitSearchTelefono(idForm)
{
	AsignaResolucion(document.forms[idForm]);

	if (CheckTelefono('fono_Telefono1'))
	{
		//pasar valores

		document.forms[idForm]['Producto'  ].value = document.getElementById('fono_Producto'  ).value;
		document.forms[idForm]['ciudad'    ].value = document.getElementById('fono_ciudad'    ).value;
		document.forms[idForm]['opcbuscar' ].value = document.getElementById('fono_opcbuscar' ).value;
		document.forms[idForm]['icono'     ].value = document.getElementById('fono_icono'     ).value;
		document.forms[idForm]['icmapa'    ].value = document.getElementById('fono_icmapa'    ).value;
		document.forms[idForm]['icono1'    ].value = document.getElementById('fono_icono1'    ).value;
		document.forms[idForm]['colormapa' ].value = document.getElementById('fono_colormapa' ).value;
		document.forms[idForm]['Telefono1' ].value = document.getElementById('fono_Telefono1' ).value;
		document.forms[idForm]['TxtPer1'   ].value = document.getElementById('fono_TxtPer1'   ).value;
		document.forms[idForm]['IdServicio'].value = document.getElementById('fono_IdServicio').value;

		//submit
		document.getElementById(idForm).submit();
	}
}

function CheckTelefono(idTelefono1)
{
	var telefono=document.getElementById(idTelefono1);
	if ( telefono.value == "" )
	{
		alert ("Ingrese Telefono");
		telefono.focus();
		return false;
	}

	if ( !CheckNum(telefono) )
	{
		alert ("Nro. telefono no valido, ingrese solo numeros");
		telefono.value="";
		telefono.focus();
		return false;
	}
	CambiaBotonBuscar('bot_buscar03');
	return true;
}


function verificardatos( formulario)
{

	return false;
	var valor="";
	for ( var i=0;i<formulario.elements.length;i++)
	{
		if ( formulario.elements[i].type == "checkbox" )
		{
			if ( formulario.elements[i].checked )
			{
				Campos=formulario.elements[i].name+'='+formulario.elements[i].value;
				Valor=formulario.elements[i].value;
			}
		}
		else
		{
			if ( formulario.elements[i].type == "radio" )
			{
				if (formulario.elements[i].checked)
				{
					Campos=formulario.elements[i].name+'='+formulario.elements[i].value;
					Valor=formulario.elements[i].value;
				}
			}
			else
			{
				Campos=formulario.elements[i].name+'='+formulario.elements[i].value;
				Valor=formulario.elements[i].value;
			}
		}

		if ( Valor != '' )
			alert(Campos);
	}
	return false;
}

function CambiaBotonBuscar(boton_buscar)
{
	MM_swapImage(boton_buscar,'','/images/botones/bt-buscar_act.gif',1);
	document.MM_sr[0].oSrc = '/images/botones/bt-buscar_act.gif';
	document.MM_sr[0].src = '/images/botones/bt-buscar_act.gif';
	bot_buscar_over = '/images/botones/bt-buscar_act.gif';
}

 var iDelay2 = 800 ;
 var sDisplayTimer2 = null, oLastItem;
 var iNSWidth2 = 100;

 function stopTimer2() {
	 clearTimeout(sDisplayTimer2)
}

function startTimer2(el,a,ico,mapa,otro) {
	stopTimer2();
 /*if (!el.contains(event.toElement)) {*/
 /* alert('empezo el timer');*/
  if(a==1)
  sDisplayTimer2 = setTimeout("showThing1('"+ico+"','"+mapa+"')",iDelay2);
  else if(a==2)
  sDisplayTimer2 = setTimeout("showThing2('"+ico+"','"+mapa+"')",iDelay2);
  else if(a==3)
  sDisplayTimer2 = setTimeout("showThing3('"+ico+"','"+mapa+"','"+otro+"')",iDelay2);
  else if(a==4)
  sDisplayTimer2 = setTimeout("showThing4('"+ico+"','"+mapa+"','"+otro+"')",iDelay2);
  else if(a==5)
  sDisplayTimer2 = setTimeout("showThing5('"+ico+"','"+mapa+"')",iDelay2);
/*}*/
}

function showThing1(ico,mapa) {

	hideIMLayer(ico);MM_showHideLayers(mapa,'','show',ico,'','hide');showIMLayer(mapa); varcerrarmenu[mapa]=false;

}

function showThing2(ico,mapa) {

	hideIMLayer(mapa);MM_showHideLayers(mapa,'','hide',ico,'','show');showIMLayer(ico);varcerrarmenu[ico]=false

}

 function showThing3(destino,origen,mapa){

 	hideIMLayer(destino);hideIMLayer(mapa);MM_showHideLayers(origen,'','show',destino,'','hide');showIMLayer(origen); varcerrarmenu[origen]=false

 }

 function showThing4(destino,origen,mapa){
 	hideIMLayer(origen);hideIMLayer(mapa);MM_showHideLayers(destino,'','show',origen,'','hide');showIMLayer(destino); varcerrarmenu[destino]=false
 }

 function showThing5(mapa,ico){
 MM_showHideLayers(mapa,'','show',ico,'','hide');showIMLayer(mapa); varcerrarmenu[mapa]=false;
}

MM_preloadImages('../images/botones/mapa-ico_clasico-over.gif','../images/botones/mapa-ico_verde-over.gif','../images/botones/mapa-ico_azul-over.gif');
//-->
