// JavaScript Document
  var myDomain = document.domain;
  var Latitud = 20.649450845767 ; 
  var Longitud = -103.4048223495 ; 
  var clave0 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhRVAhBS2LNJNZn7gIG7KAf7uW6g8xSfeDaKvvCDM3UvVyHg2eai4DMwbA&callback=loadMaps" ;
  var clave1 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhRVAhBS2LNJNZn7gIG7KAf7uW6g8xSfeDaKvvCDM3UvVyHg2eai4DMwbA&callback=loadMaps" ;
  var clave2 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhQfwpPFH_ceamE5V4vzFnBXHtofuRTVc4C4YdD0bBqEFKflvhi-LCFRFA&callback=loadMaps" ;
  var clave3 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhTqHeLIQWPGvxlzqOMaBz7nU_fK_BTWHmD7Tvcxe-l5gGixdCArNkH5fg&callback=loadMaps" ;
  var clave4 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSNOOc-3S0PS2LGv6geRdAVwxB-2xRhbQj0s8Evx9iGnjMjdm91ZUq8Eg&callback=loadMaps" ;
  var clave5 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSOazIdvvzX_5kzfUtblMQD2r0dqxQrEvHVn9yiVfjW1vNr9NvLA67iSw&callback=loadMaps" ;
  var clave6 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSP2DxoHeciirUjfHJ9d5MEGtRw5RSFpWzJDxAmYcK_JcQyb1MWvymWLA&callback=loadMaps" ;
  var clave7 = "http://www.google.com/jsapi?key=ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhTCSw3JYftGpqn7BXl_Hz3chwaQfBTOPPxe65aSFf_dlbtjUd6j9W8rtg&callback=loadMaps" ;

switch(myDomain)
	{
	case 'directoriohvacr.com': //alert('directoriohvacr.com');
	clave0 = clave1;
	break;
	case 'www.directoriohvacr.com': //alert('www.directoriohvacr.com');
	clave0 = clave1;
	break;
	case 'directoriohvacr.com.mx': //alert('directoriohvacr.com.mx');
	clave0 = clave2;
	break;
	case 'www.directoriohvacr.com.mx': //alert('www.directoriohvacr.com.mx');
	clave0 = clave2;
	break;
	
	case 'directoriohvac.com': //alert('directoriohvac.com');
	clave0 = clave7;
	break;
	case 'www.directoriohvac.com': //alert('www.directoriohvac.com');
	clave0 = clave7;
	break;
	case 'directoriohvac.com.mx': //alert('directoriohvac.com.mx');
	clave0 = clave3;
	break;
	case 'www.directoriohvac.com.mx': //alert('www.directoriohvac.com.mx');
	clave0 = clave3;
	break;
	
	case 'dirhvacr.com': //alert('dirhvacr.com');
	clave0 = clave6;
	break;
	case 'www.dirhvacr.com': //alert('www.dirhvacr.com');
	clave0 = clave6;
	break;
	
	case 'dirhvac.com':// alert('dirhvac.com');
	clave0 = clave5;
	break;
	case 'www.dirhvac.com': //alert('www.dirhvac.com');
	clave0 = clave5;
	break;

	case 'aireacondicionadomexico.org': //alert('aireacondicionadomexico.org');
	clave0 = clave4;
	break;
	case 'www.aireacondicionadomexico.org': //alert('www.aireacondicionadomexico.org');
	clave0 = clave4;
	break;
	
	}

/*
directoriohvacr.com 			ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhRVAhBS2LNJNZn7gIG7KAf7uW6g8xSfeDaKvvCDM3UvVyHg2eai4DMwbA
directoriohvacr.com.mx     		ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhQfwpPFH_ceamE5V4vzFnBXHtofuRTVc4C4YdD0bBqEFKflvhi-LCFRFA
directoriohvac.com      		ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhTCSw3JYftGpqn7BXl_Hz3chwaQfBTOPPxe65aSFf_dlbtjUd6j9W8rtg
directoriohvac.com.mx     		ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhTqHeLIQWPGvxlzqOMaBz7nU_fK_BTWHmD7Tvcxe-l5gGixdCArNkH5fg
dirhvac.com     				ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSOazIdvvzX_5kzfUtblMQD2r0dqxQrEvHVn9yiVfjW1vNr9NvLA67iSw
dirhvacr.com     				ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSP2DxoHeciirUjfHJ9d5MEGtRw5RSFpWzJDxAmYcK_JcQyb1MWvymWLA
aireacondicionadomexico.org    	ABQIAAAAdQbAgABRsf8xm-Eqo7zdLhSNOOc-3S0PS2LGv6geRdAVwxB-2xRhbQj0s8Evx9iGnjMjdm91ZUq8Eg
*/

function muestraRegistro(noRenglon,MostrarMapas,Lat,Lon)
	{	
	//alert(MostrarMapas);
	//$('areadetabla').show();
	//$('areaderegistro').show();
    new Ajax.Updater('ajaxmuestraregistro', ('../../muestraregistro.php?id='+noRenglon), { evalScripts: false });
	
	var_areadetabla = document.getElementById('areadetabla');
    var_areaderegistro = document.getElementById('areaderegistro');
	
	// Effect.SlideDown('ajaxmuestraregistro');		
	if( MostrarMapas == "si" )
		{
		var map = null;
		var_areadetabla.style.height = "120px";			
		var_areaderegistro.style.height = "430px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistro2.jpg)";	
		Latitud = Lat;
		Longitud = Lon;
		//alert(Lat+"   "+Lon);
	
		alert("Cargando Mapa");
		//for (var i=0;i<10000000;i++) { }
		initLoader();	
		}	
	else
		{
//		alert("debug point");
		var_areadetabla.style.height = "250px";	
		var_areaderegistro.style.height = "260px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistro.jpg)";				
		}
	
	}
	
function muestraRegistroFichaempresa(noRenglon,MostrarMapas,Lat,Lon,TipoAnuncio)
{
	if( MostrarMapas == "si" )
	{
		Latitud = Lat;
		Longitud = Lon;
		//alert(Lat+"   "+Lon);
	    var_areaderegistro = document.getElementById('areaderegistro');
		
		if( TipoAnuncio == 2 || TipoAnuncio == 3 )
		{
		//alert("especial");
		var_areaderegistro.style.height = "820px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistrovip2.jpg)";
		}
		if( TipoAnuncio == 1 )
		{
		var_areaderegistro.style.height = "430px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistro2.jpg)";
		}
	
		//alert("Cargando Mapa");
		//for (var i=0;i<10000000;i++) { }
		initLoader();		
	}
}

function muestraRegistroImpresion(noRenglon,MostrarMapas,Lat,Lon,TipoAnuncio)
{
	if( MostrarMapas == "si" )
	{
		Latitud = Lat;
		Longitud = Lon;
		//alert(Lat+"   "+Lon);
	    var_areaderegistro = document.getElementById('areaderegistroimpr');
		if( TipoAnuncio == 2 || TipoAnuncio == 3 )
		{
		//alert("especial");
		var_areaderegistro.style.height = "820px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistrovip2.jpg)";
		}
		if( TipoAnuncio == 1 )
		{
		var_areaderegistro.style.height = "430px";	
		var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistro2.jpg)";
		}
		
		//alert("Cargando Mapa");
		//for (var i=0;i<10000000;i++) { }
		initLoader();		
	}
}





function mapsLoaded() {	
  var map = new google.maps.Map2(document.getElementById("map"));
  var center = new google.maps.LatLng(Latitud,Longitud); 
  map.setCenter(center, 15); 
  
  map.addControl(new GSmallMapControl());
  var marker = new GMarker(center); 
  map.addOverlay(marker);   
}

function loadMaps() {
  google.load("maps", "2.x", {"callback" : mapsLoaded , "other_params":"sensor=false"});   
}

function initLoader() {

  var script = document.createElement("script");
  script.src = clave0;
  script.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(script);
}
	
function borraAnuncio()
	{
	div2 = document.getElementById('ajaxmuestraregistro');
	div2.innerHTML = "";	
	}

function verMas(no_reg)
	{	
	$('areadetabla').hide();
	$('anuncio2').hide();	
	areavip = document.getElementById("areaderegistro");
	areavip.style.height = "660px";	
	areavip.style.backgroundImage = "url(../../imagenes/marcoregistrovip.jpg)";	
	areavipChild = document.getElementById("ajaxmuestraregistro");
	areavipChild.style.height = "660px";
	new Ajax.Updater('ajaxmuestraregistro', ('../../muestraregistrovip.php?id='+no_reg));		
	}
	
function verMasBak(no_reg)
	{	
	$('ajaxmuestraregistro').hide();
	new Ajax.Updater('ajaxmuestraregistro', ('../../muestraregistro2.php?id='+no_reg), { onSuccess: function(transport) { $('ajaxmuestraregistro').show();  } });	
	areavip = document.getElementById("areaderegistro");
	areavip.style.height = "260px";	
	areavip.style.backgroundImage = "url(../../imagenes/marcoregistro.jpg)";
	areavipChild = document.getElementById("ajaxmuestraregistro");
	areavipChild.style.height = "260px";
	$('areadetabla').show();
	$('anuncio2').show();		
	//modificaestado( no_reg, 2);
	}
	
function Criterio1 (dato1,dato2)
	{	
	document.forma_busqueda.giro.value = dato2;
	new Ajax.Updater('contenido', '../../tablaregistros.php', {
	parameters: { giro: $F('giro') ,estado: $F('estado'), area: $F('area') }    ,
	evalScripts: true }	
	);
	}
		
function busca_empresa()
	{	
	var strlen = $F('buscar_empresa').length;
		if ( strlen < 3) 
			{
			alert ( "Favor de ingresar 3 letras o mas");
			}
		else
			{
			document.forma_busqueda.empresa.value = $F('buscar_empresa');
			//alert ( $F('area')+"  "+$F('estado')+"  "+$F('giro')+"  "+$F('empresa') );
			new Ajax.Updater('contenido', '../../tablabuscar.php', {
			parameters: { estado: $F('estado'), area: $F('area'), empresa: $F('empresa') }    ,
			evalScripts: true });	
			}
	}
	
function tablaAlfabeto()
	{	
	// alert ( $F('area')+"  "+$F('estado')+"  "+$F('letra')+"  "+$F('producto_empresa') );
	document.forma_busqueda.letra.value = document.forma_alfabeto.letra.value;
	document.forma_busqueda.producto_empresa.value = document.forma_alfabeto.producto_empresa.value;
	new Ajax.Updater('contenido', '../../tablaalfabeto.php', {
	parameters: { area: $F('area') ,estado: $F('estado') ,letra: $F('letra'),producto_empresa: $F('producto_empresa')  },
	evalScripts: true});
	}
	
	
function top10 (dato1,dato2)
	{	
	new Ajax.Updater('contenido', ('../../templates/navppal.php'));	
	new Ajax.Updater('contenido', ('../../tablatop10.php') , {insertion: Insertion.Bottom} );	
	}
	

	
function navegacionGral(nombrePagina)
	{	
	new Ajax.Updater('contenido', ('../../templates/navppal.php'));	
	new Ajax.Updater('contenido', ('../../contenido/'+nombrePagina) , {insertion: Insertion.Bottom} );	
	}
	
	
function modificaestado( noRenglon, anuncio)
{
if(anuncio=='1')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("f" + noRenglon).className ="ajaxtabladatos2over";
	}
if(anuncio=='2')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("f" + noRenglon).className ="ajaxtabladatos2overclasico";
	}
if(anuncio=='3')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("f" + noRenglon).className ="ajaxtabladatos2overespecial";
	}
	
}

function regresaestado(noRenglon,anuncio)
{
if(anuncio=='1')
{
document.getElementById("a" + noRenglon).className ="ajaxtabladatos2";
document.getElementById("b" + noRenglon).className ="ajaxtabladatos2";
document.getElementById("c" + noRenglon).className ="ajaxtabladatos2";
document.getElementById("d" + noRenglon).className ="ajaxtabladatos2";
document.getElementById("e" + noRenglon).className ="ajaxtabladatos2";
document.getElementById("f" + noRenglon).className ="ajaxtabladatos2";
}
if(anuncio=='2')
{
document.getElementById("a" + noRenglon).className ="ajaxtabladatos2clasico";
document.getElementById("b" + noRenglon).className ="ajaxtabladatos2clasico";
document.getElementById("c" + noRenglon).className ="ajaxtabladatos2clasico";
document.getElementById("d" + noRenglon).className ="ajaxtabladatos2clasico";
document.getElementById("e" + noRenglon).className ="ajaxtabladatos2clasico";
document.getElementById("f" + noRenglon).className ="ajaxtabladatos2clasico";
}

if(anuncio=='3' )
{
document.getElementById("a" + noRenglon).className ="ajaxtabladatos2especial";
document.getElementById("b" + noRenglon).className ="ajaxtabladatos2especial";
document.getElementById("c" + noRenglon).className ="ajaxtabladatos2especial";
document.getElementById("d" + noRenglon).className ="ajaxtabladatos2especial";
document.getElementById("e" + noRenglon).className ="ajaxtabladatos2especial";
document.getElementById("f" + noRenglon).className ="ajaxtabladatos2especial";
}

}

	
function modificaestadotop10( noRenglon, anuncio)
{
if(anuncio=='1')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2over";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2over";
	}
if(anuncio=='2')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2overclasico";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2overclasico";
	}
if(anuncio=='3')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2overespecial";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2overespecial";
	}
	
}

function regresaestadotop10(noRenglon,anuncio)
{	
	if(anuncio=='1')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2";
	}
	if(anuncio=='2')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2clasico";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2clasico";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2clasico";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2clasico";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2clasico";
	}	
	if(anuncio=='3')
	{
	document.getElementById("a" + noRenglon).className ="ajaxtabladatos2especial";
	document.getElementById("b" + noRenglon).className ="ajaxtabladatos2especial";
	document.getElementById("c" + noRenglon).className ="ajaxtabladatos2especial";
	document.getElementById("d" + noRenglon).className ="ajaxtabladatos2especial";
	document.getElementById("e" + noRenglon).className ="ajaxtabladatos2especial";
	}
}

function buscardireccion()
{
$('accion').value = "";
$('mensaje').value = "Para finalizar presiona CONTINUAR";


document.form2.submit();


}

function muestraTrabajo(bdt_id)
{
	
	//alert(bdt_id);
	new Ajax.Updater('ajaxmuestraregistro', ('../../muestratrabajo.php?bdt_id='+bdt_id), { evalScripts: false });
	
	var_areadetabla = document.getElementById('areadetabla');
	var_areaderegistro = document.getElementById('areaderegistro');
	
	var_areadetabla.style.height = "120px";			
	var_areaderegistro.style.height = "430px";

	var_areaderegistro.style.backgroundImage = "url(../../imagenes/marcoregistro2.jpg)";
}


	function verMasJob(bdt_id)
	{	
	$('areadetabla').hide();
	$('anuncio2').hide();	
	areavip = document.getElementById("areaderegistro");
	areavip.style.height = "660px";	
	areavip.style.backgroundImage = "url(../../imagenes/marcoregistrovip.jpg)";	
	areavipChild = document.getElementById("ajaxmuestraregistro");
	areavipChild.style.height = "660px";
	new Ajax.Updater('ajaxmuestraregistro', ('../../RegistroJobs.php?bdt_id='+bdt_id));		
	}
	
	
	function muestra_anuncio()
	{		
			document.forma_busqueda.empresa.value = "T&P";
			//alert ( $F('area')+"  "+$F('estado')+"  "+$F('giro')+"  "+$F('empresa') );
			new Ajax.Updater('contenido', '../../tablabuscar.php', {
			parameters: { estado: 'Todos', area: $F('area'), empresa: $F('empresa') }    ,
			evalScripts: true });	
	
	}