var jsG_Browser = jsf_TipoBrowser();
var gConsultarTarifa = false;

function jsf_TipoBrowser(){
  if ( document.layers ) return "NS";
  if ( document.all ) {
		var agt=navigator.userAgent.toLowerCase();
		var is_opera = ( agt.indexOf("opera") != -1 );
		var is_konq = ( agt.indexOf("konqueror") != -1 );
		if(is_opera) {
			return "OPR";
		} else {
			if(is_konq) {
				return "KONQ";
			} else {
				return "IE";
			}
		}
  }
  if ( document.getElementById ) return "MOZ";
  return "OTHER";
}

function jsf_lTrim(jsr_value){ 
	while (jsr_value.charAt(0) == " ")  
		jsr_value = jsr_value.substr(1, jsr_value.length - 1); 
	return jsr_value; 
} 

function jsf_rTrim(jsr_value){ 
	while (jsr_value.charAt(jsr_value.length - 1) == " ")  
		jsr_value = jsr_value.substr(0, jsr_value.length - 1); 
	return jsr_value; 
} 

function jsf_allTrim(jsr_value){ 
	return jsf_rTrim(jsf_lTrim(jsr_value)); 
} 

function jsf_getPropertiesCSS( jsr_obj, jsr_style ){
	if( jsG_Browser == "IE" ){
		return jsr_obj.currentStyle[ jsr_style ];
	}else{
		var jsL_compstyle = getComputedStyle( jsr_obj, "" );
		return jsL_compstyle.getPropertyValue( jsr_style );
	}
	return false;
}

function jsf_marquee (jsr_id, jsr_vel) {
	if(document.getElementById(jsr_id))
		document.getElementById(jsr_id).scrollAmount = jsr_vel;
}

function jsf_homenaje(){
	window.open("ciccia/resenia.html","ciccia","width=660,height=580,resizable=no");
}

/*-------------------*/

function jsf_newCliente() {
	var jsl_obj = new Array();
	jsl_obj[0] = document.getElementById("txt_nombre");
	jsl_obj[1] = document.getElementById("txt_apellido");
	jsl_obj[2] = document.getElementById("txt_email");
	
	if(jsf_allTrim(jsl_obj[0].value) != "" && jsf_allTrim(jsl_obj[1].value) != "" & jsf_allTrim(jsl_obj[2].value) != ""){
		document.getElementById('form_cliente').submit();
	}else{
		alert('Asegurese de llenar los campos');
	}
}

function jsf_newSugerencia() {
	var jsl_obj = new Array();
	jsl_obj[0] = document.getElementById("txt_nombre");
	jsl_obj[1] = document.getElementById("txt_email");
	jsl_obj[2] = document.getElementById("texto");
	
	if(jsf_allTrim(jsl_obj[2].value) != ""){
		document.getElementById('form_sugerencia').submit();
	}else{
		alert('Escriba su sugerencia por favor');
	}
}

function jsf_mostrarDetalleAgencia(jsr_id) {
	window.open("getDetAgencia.php?g_id="+jsr_id,"","width=400,height=450,resizable=yes,scrollbars=yes");
}

function jsf_mostrarAgencias(jsr_id) {
	window.open("getAgenciaL.php?g_id="+jsr_id,"","width=400,height=450,resizable=yes,scrollbars=yes");
}

function jsf_mostrarDetalleCiudad(jsr_id) {
	window.open("getDetCiudad.php?g_id="+jsr_id,"","width=450,height=500,resizable=yes,scrollbars=yes");
}

function jsf_mostrarDetalleFestividad(jsr_id) {
	window.open("getDetFestividad.php?g_id="+jsr_id,"","width=450,height=500,resizable=yes,scrollbars=yes");
}

function jsf_openImage(jsr_nmb) {
	window.open("flotaG.php?g_id="+jsr_nmb,"","width=550,height=510,resizable=yes,scrollbars=yes");
}

function jsf_openVideo() {
	window.open("video.php","","width=500,height=410,resizable=no");
}

function jsf_showHiddeElement(jsr_id) {
	document.getElementById('slc_mes').style.display = 'none';
	document.getElementById('slc_ciudad').style.display = 'none';
	document.getElementById(jsr_id).style.display = 'inline';
}