/* idiomas */

function es () {
dlugar_detalles_ciudad_1 = 'Ciudad:';
dlugar_detalles_ciudad_2 = 'Estado:';
dlugar_detalles_ciudad_3 = 'Municipio:';
dlugar_detalles_ciudad_4 = 'Personas que habitan aqu&iacute;:';
dlugar_detalles_ciudad_5 = 'Numero de casas:';
dlugar_detalles_ciudad_6 = 'Hombres:';
dlugar_detalles_ciudad_7 = 'Mujeres:';
dlugar_detalles_ciudad_8 = 'Personas economicamente activas:';
dlugar_detalles_ciudad_9 = 'Personas inactivas:';
dlugar_detalles_ciudad_10 = 'Personas Mayores de 15 a&#241;os:';
dlugar_detalles_ciudad_11 = 'Latitud:';
dlugar_detalles_ciudad_12 = 'Longitud:';
dlugar_detalles_ciudad_13 = 'Altura:';
dlugar_detalles_ciudad_14 = 'Acceso llegale:';
dlugar_detalles_ciudad_15 = 'Fuente';
dlugar_detalles_ciudad_16 = 'Ciudad:';
dlugar_detalles_ciudad_17 = 'Amplia esta ventana';

aquiestoy_aquiestoy_1 = 'De un click en el lugar en donde se encuentra actualmente';
aquiestoy_aquiestoy_2 = 'Esta sera su ubicacion predeterminada y le hara mas facil encontrar lo que esta buscando de acuerdo a la cercania';
aquiestoy_aquiestoy_3 = 'Ubicarme en el mapa';
aquiestoy_aquiestoy_4 = 'Se encuentra muy alejado para poder marcar una ubicacion inicial';
aquiestoy_aquiestoy_5 = 'Actualmente se encuentra muy alejado para poder especificar una ubicacion inicial en el mapa';
}
es ();omm = 'onmousemove=\"click1=false;\"';
var tam_img=250;
var click1;
var iniciox;
var inicioy;
var cmaxX=Math.round(srx/tam_img)+2;
var cmaxY=Math.round(sry/tam_img)+2;
var ix;
var iy;
var ix1;
var iy1;
var txt;
var txt_c;
var ml;
var vc;
var vcalle = '';
var vcalle1 = '';
var verificarloc;
var timerRunning;
var vangulo = 0;
var iniciox_b;
var inicioy_b;
var iniciox_bb;
var inicioy_bb;
var iniciox_b1;
var inicioy_b1;
var ampliar1=0;
var ampliar2=0;
var mescala = 2;
var txt_xml;
var objetos = new Array(cmaxX);
var url_b = '&b='+cu+'/';
var marcax=0;
var marcay=0,marcax1=0;
var marcay1=0,conteoImg;
var tfactivo = 150, tiactivo = 2000;
var tactivo = tfactivo;
buscadores = 0;
for(i=0;i<cmaxX;i++) objetos[i]=new Array(cmaxY);
var em = new Array(9);
var url_m = 'img.php';
obj = document.getElementById('oScratch');
obj.style.width = srx;
obj.style.height = sry;
obj.style.backgroundColor = fondo;
fi1 = 'php/gcalletel.php';
fi2 = 'php/cobj.php';
fi3 = 'php/eliminar.php';
fi4 = 'imgnegmasf.php';
fi5 = 'imgneg.php';
fi6 = 'eliminargiro.php';
fi7 = 'php/guardarcalle.php';
fi8 = 'php/guardarnegocio.php';
fi9 = 'php/guardargiro.php';
fi10 = 'php/nfoto.php';
fi11 = 'buscar_masf.php';
fi12 = 'image_completa.php';
fi13 = 'php/permiso.php';
fi14 = 'php/guardarmicasa.php';
fi15 = 'buscar_objetos.php';
fi16 = 'rbusqueda.php';
fi17 = 'tarjeta/buscartarjeta.php';
fi17a = 'tarjeta/negociobasico.php';
fi18 = 'tarjeta/guardarxy.php';
fi19 = 'telefono/buscar_tel.php';
fi20 = 'php/ggiro.php';
fi21 = 'tarjeta/bustarjeta.php';
fi22 = 'tarjeta/nt.php';
fi23 = 'tarjeta/nt2xml.php';
fi24 = 'tarjeta/nt2.php';
fi25 = 'tarjeta/nt4.php';
fi26 = 'tarjeta/nt4gimg.php';
fi27 = 'tarjeta/nt4.img.php';
fi28 = 'tarjeta/nt4d.php';
fi29 = 'tarjeta/cc.php';
fi30 = 'php/obcalle.php';
fi31 = 'calle/asignar.php';
fi32 = 'calle/gasig.php';
fi33 = 'calle/dcalle.php';
fi34 = 'calle/easig.php';
fi35 = 'rbusqueda.php';
fi40 = 'telefono/bt.php';

gi1 = 'img/cargando.gif';
gi2 = '/directorios/eliminar.a.png';
gi3 = 'img/compas.gif';
gi4 = 'img/ampliar.gif';
gi5 = 'img/1rightarrow.gif';
gi6 = '/nuevo.documento.png';
gi7 = '/admin/gaim_online.png';
gi8 = '/contable/gthumb.png';
gi9 = '/cat.png';
gi10 = '/directorios/eliminar.a.png';
gi11 = '/nuevo.documento.png';
gi12 = '/eliminar.a.png';
gi13 = 'img/cruz.png';
gi14 = 'img/ocultar.gif';
gi15 = 'img/mostrar.gif';
gi16 = 'img/flecha.gif';
gi17 = 'img/Diskettes.gif';
gi18 = 'img/Construction.gif';
gi19 = 'img/H95f.gif';
gi20 = 'img/Boxes.gif';
gi21 = 'img/button_ok.png';
gi22 = 'img/button_cancel.png';

/* Localizacion ventanas xy */

var loc_ventana_x = 25;
var loc_ventana_y = 112;
if (srx > 1100 && sry > 750) {
loc_ventana_y = 140;
}
var ancho_ventana_c = 450;
var alto_ventana_c = sry > 650 ? 460 : sry - 180;

servimg = 'http://imagen.llegalemapas.com/beta/1.5/';
/*{"c":1,"d":[ {"s":"http://imagen.llegalemapas.com/beta/1.5/"} ] };*/

linkemen = 'http://kakken.myhome.cx:8000/';

lciudades = {"cantidad":32,"lc":[{"e":"Aguascalientes","i":"1"},{"e":"Baja california","i":"2"},{"e":"Baja california sur","i":"3"},{"e":"Campeche","i":"4"},{"e":"Coahuila de zaragoza","i":"5"},{"e":"Colima","i":"6"},{"e":"Chiapas","i":"7"},{"e":"Chihuahua","i":"8"},{"e":"Distrito federal","i":"9"},{"e":"Durango","i":"10"},{"e":"Guanajuato","i":"11"},{"e":"Guerrero","i":"12"},{"e":"Hidalgo","i":"13"},{"e":"Jalisco","i":"14"},{"e":"M\u00e9xico","i":"15"},{"e":"Michoac\u00e1n de ocampo","i":"16"},{"e":"Morelos","i":"17"},{"e":"Nayarit","i":"18"},{"e":"Nuevo le\u00f3n","i":"19"},{"e":"Oaxaca","i":"20"},{"e":"Puebla","i":"21"},{"e":"Quer\u00e9taro arteaga","i":"22"},{"e":"Quintana roo","i":"23"},{"e":"San luis potos\u00ed","i":"24"},{"e":"Sinaloa","i":"25"},{"e":"Sonora","i":"26"},{"e":"Tabasco","i":"27"},{"e":"Tamaulipas","i":"28"},{"e":"Tlaxcala","i":"29"},{"e":"Veracruz de ignacio de la llave","i":"30"},{"e":"Yucat\u00e1n","i":"31"},{"e":"Zacatecas","i":"32"}]};

var pestana_neg;
function iglesias (id) {
pestana_neg = {"c":5,"h":18,"colors":colorpeshb,"colorn":colorpes2,"colorsf":colorpeshf,"colornf":colorpesf,"contenido":[
{"w":75,"txt":"General","border":colorpes1,"onclick":"igpest(1,"+id+")"},
{"w":75,"txt":"Eventos","border":colorpes1,"onclick":"igpest(2,"+id+")"},
/*{"w":75,"txt":"Galerias","border":colorpes1,"onclick":"igpest(3,"+id+")"},*/
{"w":105,"txt":"Horarios de misa","border":colorpes1,"onclick":"igpest(4,"+id+")"},
{"w":75,"txt":"Dispensario","border":colorpes1,"onclick":"igpest(5,"+id+")"},
{"w":40,"txt":"<b>[ X ]</b>","border":colorpes8,"onclick":"ocultarobj();"}
]};
}
function industria (id) {
pestana_neg = {"c":3,"h":18,"colors":colorpeshb,"colorn":colorpes2,"colorsf":colorpeshf,"colornf":colorpesf,"contenido":[
{"w":75,"txt":"General","border":colorpes1,"onclick":"indpest(1,"+id+")"},
{"w":75,"txt":"Catalogo","border":colorpes1,"onclick":"ocultarobj();buscar_catalogo("+id+")"},
/*{"w":75,"txt":"Galerias","border":colorpes1,"onclick":"indpest(3,"+id+")"},*/
/*{"w":105,"txt":"Agenda","border":colorpes1,"onclick":"indpest(4,"+id+")"},*/
{"w":40,"txt":"<b>[ X ]</b>","border":colorpes8,"onclick":"ocultarobj();"}
]};
}
function c_pest (obj, is) {
txt = '';
l_pest = 0;
for (i = 0; i < obj.c; i++) {
txt += c_div('',pos+t1(0)+l1(l_pest)+w1(obj.contenido[i].w)+h1(obj.h)+cur('hand')
+(obj.contenido[i].border ? border(obj.contenido[i].border, '1px', 'solid') : '')
+bgcolor(is == i ? obj.colors : obj.colorn)+co(is == i ? obj.colorsf : obj.colornf),cent(obj.contenido[i].txt), obj.contenido[i].onclick);
l_pest += obj.contenido[i].w + 3;
}
return c_div('', '', txt);

}

function pestxt (s, id, t) {
pest = ' align="center" style="'+color_ps+'"';
ctxt = font(12)+cur('hand')+oveh;
return '<td '+pest+'>'
+c_div('',(s == 1 ? color_ps : color_pns)+w1(50)+ctxt,'General', 'nt2_xml('+id+', \''+t+'\')')
+'</td><td '+pest+'>'+c_div('',(s == 2 ? color_ps : color_pns)+w1(75)+ctxt,'Eventos', 'ig1('+id+', \''+t+'\')')
+'</td><td '+pest+'>'+c_div('',(s == 3 ? color_ps : color_pns)+w1(100)+ctxt,'Horario de Misas', 'ig2('+id+', \''+t+'\')')
+'</td><td '+pest+'>'+c_div('',(s == 4 ? color_ps : color_pns)+w1(100)+ctxt,'Galerias de Fotos','ig3('+id+', \''+t+'\')')
+'</td><td '+pest+'>'+c_div('',(s == 5 ? color_ps : color_pns)+w1(75)+ctxt,'Dispensario', 'ig4('+id+', \''+t+'\')')
+'</td>';
}
function vacantespest1 (s, idf, t) {
pest = ' align="center" style="'+color_ps+'"';
ctxt = font(12)+cur('hand')+oveh;
return '<td '+pest+'>'
+c_div('',(s == 1 ? color_ps : color_pns)+w1(78)+ctxt,'<img border=0 src="imagen/cv/boton.general.gif" width="78" height="13" />', 'nt2_xml('+idf+', \''+t+'\')')
+'</td><td '+pest+'>'
+c_div('',(s == 2 ? color_ps : color_pns)+w1(78)+ctxt,'<img border=0 src="imagen/cv/boton.vacantes.gif" width="78" height="13" />', 'postular(2,'+idf+', \''+t+'\')')
+'</td><td '+pest+'>'
+c_div('',(s == 3 ? color_ps :color_pns)+w1(106)+ctxt,'<img border=0 src="imagen/cv/boton.nueva.oferta.gif" width="106" height="13" />','nuevaoferta('+idf+',\''+t+'\')')
/*+'</td><td '+pest+'>'
+c_div('',(s == 4 ? color_ps : color_pns)+w1(50)+ctxt,'Eventos', 'agenda(4,'+idf+', \''+t+'\')')*/
+'</td>';
}
function pestanas_tipo (s,id,t,t1) {
if (t1 == 1) {
return td2(it('100%')+'<tr>'+pestxt(s, id, t,t1)+'</tr>'+dt);
} else if (t1 == 2) {
return td2(it('250')+'<tr>'+vacantespest1(s,id,t)+'</tr>'+dt);
} else {
return '';
}
}var fontstyle10, fontstyle, mfont, sfont, titulo_dtel, cnl, cnl1, tablaobj, tabla2obj, tablacalle, potrocinio, fondo1, fondo2, letrab, overb, titulotb,wbuscador = 350,g;
function inicio_s () {
fontstyle10 = font(10);
fontstyle = font(12);
mfont = font(12);
sfont = ' style="'+font(12)+'"';
cnl = titulo_dtel+td2('Calle no localizada')+dt;
tablaobj = it(450, font(12));
tabla2obj = it('100%', 'style="'+font(12)+'"');
tablacalle = it(320, font(12));
potrocinio = it(120, font(12))+tdn('<img src='+ipaddr+gi3+' width=120>')+thn('Tu Negocio Aqu&iacute; (442) 135-02-89')+dt;
fondo1 = bgcolor(colorpes1);
fondo2 = bgcolor(colorpes2);
letrab = font(10);
overb = pos+oveh+t1(0)+h1(15)+fondo1+letrab+cur('hand');
titulotb = pos+ovea+t1(15)+l1(0)+w1(wbuscador)+letrab+fondo2;

}
var bay;
bay = -45;
function botones_anuncio (img, f, x, bay1) {
if (bay1) bay = bay1;
bay += 50;
return c_div('', pos+t1(bay)+l1(x)+cur('hand'), '<img src="'+img+'" width="133" height="50" onclick="'+f+'">');
}
function cdivpuntos () {
txt = '';
for (i = 1; i < 17; i++) {
txt += c_div('punto'+i, pos+t1('-100')+l1('-100')+w1(4)+h1(4)+bgcolor('0000ff')+border('0000ff', 'solid',1));
}
return txt;
}
function buscarnegocio() {
return it('400')
+td2(cent('<img src="img/logocanaco300.gif">'))+dt
+c_div('', img_back('imagen/cc/comunidad.canaco1.gif')+w1(400)+h1(180),
it('400')+tr('<td width="100" height="60">'+c_div('', w1(100)+h1(60)+cur('hand'), '', 'formularioinicial.innerHTML=buscarnegocio()')+'</td>'
+'<td rowspan="2" width="300" valign=middle><form action="'+jsv+'" name="buscarmapa1">'+cent('Escriba el nombre del negocio')
+'<br><center>'+cInputn('b','','b2', 'style="'+fontstyle+w1(250)+'"')+'<br>'+cbotton ('', 'Buscar','fbuscar(buscarmapa1.b.value, 3.5, \'\');',e)+'</center></form></td>')
+tr('<td height="75">'+c_div('', w1(100)+h1(60)+cur('hand'), '', 'formularioinicial.innerHTML=buscarcalle()')+'</td>')
+dt);
}
function buscarcalle () {
return it('400')
+td2(cent('<img src="img/logocanaco300.gif">'))+dt
+c_div('', img_back('imagen/cc/comunidad.canaco2.gif')+w1(400)+h1(180),
it('400')+tr('<td width="100" height="60">'+c_div('', w1(100)+h1(60)+cur('hand'), '', 'formularioinicial.innerHTML=buscarnegocio()')+'</td>'
+'<td rowspan="2" width="300" valign=middle><form action="'+jsv+'" name="buscarmapa1">'+cent('Escriba el nombre de la calle o colonia')
+'<br><center>'+cInputn('b','','b2', 'style="'+fontstyle+w1(250)+'"')+'<br>'+cbotton ('', 'Buscar','fbuscar(buscarmapa1.b.value, 1, \'\');',e)+'</center></form></td>')
+tr('<td height="75">'+c_div('', w1(100)+h1(60)+cur('hand'), '', 'formularioinicial.innerHTML=buscarcalle()')+'</td>')
+dt);
}
function v_inicial_busqueda () {
posmuestraobj((sry/2)-200,(srx/2)-145, 400, 290, '', '', '',colorpes8, c_div('formularioinicial', '', buscarnegocio()));
}
var obus = 'o_buscador_tel();';
var modocXY = 0;
var omm = 'onmousemove="click1=false;"';
var logonuevo = 1;
function crear_obj_ico (a1) {
ico = ''/*+iconot('img/logo.llegale.nvo.219.gif', 'llegalemapas.com', 'home', 219,75)*/
/*+icono('img/viewmag+.gif', 'Acercar', 'mas', 'acercar()',logonuevo)
+icono('img/viewmag-.gif', 'Alejar', 'menos', 'alejar()')
+icono('img/print_printer.gif', 'Imprime la pantalla visible', 'Imprimir','mprint();')
+icono('imagen/origen/origen.iconito.gif', 'Marcar mi ubicacion actual', 'Aqui estoy','aquiestoy();')*/
;
return ico;
}
function crear_obj_mapa (ix1,iy1) {
return c_div('formulario',font(10)+pos+vis(0)+oveh+zi(1000),'','',omm)
/*+bayuda(ayuda2, 'ayuda', "'',ayuda3,ayuda2,254", 1, 'auto')
+bayuda(mapa3, 'mapallave', 'mapa1(),mapa2,mapa3,254', 1, 'auto')
+vayuda ()*/
+c_div('formulariopos', font(10)+pos+vis(0)+oveh+zi(1002))
+ifr('formulariosguardar')+ifr('formulariosbuscar')+ifr('printf')
+ifr('formulariosimg')
+c_div('contenidomapa',pos+vis(1)+l1(5)+t1(5)+w1('100%')+h1('100%'),dobj(ix1,iy1));
}
function estiloboton () {
return border(colorpes3, 'solid', 1)+bgcolor(colorpes3)+font(12)+cur('hand')+pos+oveh+co(colorpeshf);
}
var adminboton;
function crear_obj_modo1 () {
adminboton = 0;
return c_div('locobjn', estiloboton()+vis(0)+h1(200)+t1(90)+l1(srx-370)+zi(953)+w1(350), '','', omm+' align=center');
return c_div('tarjetasventa', estiloboton()+w1(200)+vis(1)+h1(15)+t1(60)+l1(left2+70)+zi(999),bo('Ingresar una ficha Llegale'), obus+'ingresar()',omm+' align=center')
+c_div('ingresou', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+280)+zi(999)+w1(150),bo('Acceso usuarios'),obus+'ingresar()', omm+' align=center')
+c_div('enb', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+440)+zi(999)+w1(200),bo('Editar los datos de un negocio'),obus+'editar_negocio_basico()', omm+' align=center')
+c_div('locobjn', estiloboton()+vis(0)+h1(200)+t1(90)+l1(srx-370)+zi(953)+w1(350), '','', omm+' align=center');
}
function crear_obj_modo2 () {
adminboton = 1;
return c_div('locobjn', estiloboton()+vis(0)+h1(200)+t1(90)+l1(srx-370)+zi(953)+w1(350), '','', omm+' align=center');
return c_div('tarjetasventa', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+70)+zi(950),bo('Ingresar una ficha Llegale'), obus+'registro()',omm+' align=center')
+c_div('ingresou', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+275)+zi(951)+w1(100),bo('Terminar'),'terminar()', omm+' align=center')
+c_div('admtar', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+380)+zi(952)+w1(130),bo('Administraci&oacute;n'), obus+'adm_buscar_tarjetas(0)', omm+' title=\'Administrar mis fichas\' align=center')
+c_div('enb', estiloboton()+vis(1)+h1(15)+t1(60)+l1(left2+530)+zi(999)+w1(200),bo('Editar los datos de un negocio'),obus+'editar_negocio_basico()', omm+' align=center')
+c_div('locobjn', estiloboton()+vis(0)+h1(200)+t1(90)+l1(srx-370)+zi(953)+w1(350), '','', omm+' align=center');
}
function crear_obj_modo3 (br) {
return c_div('busquedas', buscadores_s(sry*0.4,fondob1,fondob2,85,30,350,br)+zi(1500),'','',omm)
/*+c_div('giros', vis(0)+pos+ovea+t1(75)+l1(left2+70)+zi(1100),'','',omm)
+c_div('compas',img_back('img/compas.gif')+pos+oveh+w1(141)+h1(128)+t1(sry-130)+l1(srx-150))*/
+c_div('bmaparpestanas',pos+oveh+t1(5)+l1(left2+70),'','',omm)
+c_div('bmapar',pos+oveh+t1(30)+l1(left2+70));
}
function crear_obj_modo4 () {
return c_div('locAjax',pos+oveh+w1(250)+h1(25)+t1(320)+l1(30))
/*+c_div('', bgcolor(colorpes2)+vis(1)+pos+oveh+h1(15)+t1(60)+l1(left2+515)+zi(999)+font(12)
+w1(100)+cur('hand'),bo('Fichas'),'adm_fichas()',
omm+' title=\'Administrador de fichas\' align=center')*/;
}
function procesar (ix1,iy1,v,y,x,mobj1,br,mobj2,a,ico) {
objs.innerHTML=crear_obj_mapa (ix1,iy1)
+c_div('marcaresultado',h1(50)+w1(50)+font(10)+img_back(gi16)+vis(v)+pos+oveh+t1(y)+l1(x))
+mobj1
+crear_obj_modo3(br)
+mobj2
+c_div('controles',pos+oveh+w1(left2+35)+h1(40)+t1(32)+l1(30),ico)
+c_div('poligono', pos+h1('100%')+w1('100%')+t1(0)+h1(0))
+crear_obj_mt(a);
}
var telefonon = ' al 01(442) 166-39-79';
function contrata () {
if (modcolor == 'cc') {
txtc = cambiar_img(1,'imagen/comunidad.canaco/servicios.gif')
+cambiar_img(2,'imagen/comunidad.canaco/ayuda.gif')
+cambiar_img(3,'imagen/comunidad.canaco/ciudades.gif')
+cambiar_img(4,'imagen/comunidad.canaco/contacto.gif')
+cambiar_img(5,'imagen/comunidad.canaco/preguntas.frecuentes.gif');
} else {
txtc = cambiar_img(1,'imagen/Buscador/folder1.png', 164, 166)
+cambiar_img(2,'imagen/Buscador/folder2.png', 164, 166)
+cambiar_img(3,'imagen/Buscador/folder3.png', 164, 166)
+cambiar_img(4,'imagen/Buscador/folder4.png', 164, 166);
}
contratav = cambiar_img2 (1,'imagen/Buscador/anunciate.gratis.png')
+c_div('conpestana1',pos+oveh+t1(-15)+l1(-15)+w1(10)+h1(10)+bgcolor('fecf76'), '',' onmousemove="click1=false;"');
return contratav+c_div('conpestanacontenedora',pos+oveh+t1(sry-32)+l1(30)+w1(840)+h1(378),
txtc +c_div('conpestana',pos+oveh+t1(28)+l1(0)+w1(840)+h1(350)+bgcolor('fecf76')), '',' onmousemove="click1=false;"');
}
function cambiar_img (n,img2, w, w2) {
return c_div('pesmenu'+n, pos+oveh+t1(0)+h1(28)+l1((w2 ? w2 : 150)*(n-1))+w1(w ? w : 165)+cur('hand')+img_back(img2), '','ocultar_buscador();vservicios('+n+')');
}
function cambiar_img2 (n,img2) {
return c_div('pesmenu'+n, pos+oveh+t1((150*(n-1))+loc_ventana_y)+h1(164)+l1(0)+w1(28)+cur('hand')+img_back(img2), '','if (om_buscador_v == 2) om_buscador();ocultar_buscador();contrata_basico('+n+');');
}
var modopago_PP;
function modo_pagoPP (modopp) {
if (modopp == 1) {
modopago_PP = '<br>Ahora hay que dar de alta el punto en el mapa para esto  '+cbotton('', 'DE UN CLICK AQU&Iacute;', 'registro();', 'style="'+font(14)+cur('hand')+co('ff0000')+'"');
} else {
modopago_PP = th2('<br>Ahora deberas ingresar como usuario o registrarte')
+th(cbotton('', 'Ingresar', 'ingresar ();','style="'+font(14)+cur('hand')+co('ff0000')+'"'),
cbotton('', 'Registrarse', 'crear_cuenta ();','style="'+font(14)+cur('hand')+co('ff0000')+'"'))
+td2('<br>Una vez que ingreses como usuario dale click en la opcion de <b>Ingresar una ficha Llegale</b>');
}
}
pos = 'position:absolute;';
posr = 'position:relative;';
oveh = 'overflow:hidden;';
ovea = 'overflow:auto;';
jsv = 'javascript:void(0);';
dt = '</table>';
encmf = 'enctype="multipart/form-data"';
vcerr = '<label title="Cerrar Ventana"><b>[ X ]</b></label>';
carg = '<img src="'+gi1+'">';
modopcolores = {"cc":{
"1":"2e8224","2":"E9F0CE",
"3":"2E8224","4":"2D8322","5":"898686","6":"E9F0CE","7":"ffffff",
"8":"000000","9":"ffffff","10":"2D8225","11":"D1C9B5","12":"f0f0f0","13":"808080","14":"2D8225",
"15":"f8f3dd"},
"normal":{
"1":"fea806","2":"fee0a7","3":"FECF76","4":"FEB72F","5":"898686","6":"fdf8df","7":"000000",
"8":"000000","9":"000000","10":"fea806","11":"D1C9B5","12":"f0f0f0","13":"808080","14":"FEA806",
"15":"f8f3dd"}};
if (modcolor == '') modcolor = 'normal';
colorpes1 = modopcolores[modcolor][1];
colorpes2 = modopcolores[modcolor][2];
colorpes3 = modopcolores[modcolor][3];
colorpes4 = modopcolores[modcolor][4];
colorpes5 = modopcolores[modcolor][5];
colorpes6 = modopcolores[modcolor][6];
colorpes7 = modopcolores[modcolor][7];
colorpesf = modopcolores[modcolor][8];
colorpeshf = modopcolores[modcolor][9];
colorpeshb = modopcolores[modcolor][10];
colorpes8 = modopcolores[modcolor][11];
cpred = modopcolores[modcolor][12];
bgpred = modopcolores[modcolor][13];
var modotc1 = modopcolores[modcolor][14];
var modotc2 = colorpes2;
var fondo = modopcolores[modcolor][15];
var fondobusqueda1 = colorpes1;
var fondobusqueda2 = colorpes2;
var colortitulo = colorpes1;
var colortitulofont = colorpes7;
fondob1 = colorpes1;
fondob2 = colorpes2;
var color_ps = bgcolor(colorpes2);
var color_pns = bgcolor(colorpes1);


diri = '/directorios';
tarjventa = td2(cent(bo('&#161;Fichas llegale de venta aqui!')));
omm = '';
errornada = bo('Error:')+' La busqueda no ha producido ningun resultado<br><br>'+cent(bo('Verifique que este bien escrito o seleccione alguna otra categoria'));
errorb10 = bo('Error:')+' Debe seleccionar un giro o especificar al menos una palabra clave para filtrar su busqueda.'
+ ul(li('Ejemplo 1 (Busqueda por Giro):'+ul(li('Giro: '+bo('Danza')+' -> Buscar')))
+ li('Ejemplo 2 (Busqueda por Palabra):'+ul( li('Giro: '+bo('Seleccione Uno'))
+ li('Palabra: '+bo('autos')+' -> Buscar')))
+ li('Ejemplo 3 (Busqueda por Giro y Palabra):'
+ul(li('Giro: '+bo('Restaurante'))+li('Palabra: '+bo('sopes')+' -> Buscar'))));
errorb11 =  bo('Error:')+' Debe de especificar la clave de busqueda';
errorb12 =  bo('Error:')+' Debe de especificar al menos una palabra para poder buscar una calle';
errorb13 =  bo('Error:')+' Debe de especificar al menos una palabra para poder buscar una colonia';
errorbtel1 =  bo('Error:')+' Debe de especificar al menos una palabra para poder buscar una colonia';
no_permiso = 'Usted no tiene permiso de editar esta opcion';
var imgdir = 'imagen/botones/';
var bant = 'boton.anterior.png';
var clineacalle = '0000ff';
var polv = 0;
var printvn, vabierta = 0;
var lcdb;
var impre = new Array(2);
var on = new Array(cmaxX * cmaxY);
var x1=0;
mover_img =0;
var mtiempomax=60;
var mapa2 ='Ciudades(-)';
var mapa3 ='Ciudades(+)';
var top2 = 0;
var left2 = 0;
var styleayuda = 'z-index:1001;'+pos+oveh+'border-color:'+colorpes1+';border-style:solid;border-Width:1px;background-color:'+colorpes2+';cursor:default;font-size:14px;';
var zorder = 1000;
var ma =0;
var ayuda1='';
var mostrarayuda = '';
setTimeout('keep_alive()', 60000);
function titulo_bobj (texto, color, colorl) {return tr('<th colspan=2 style="'+bgcolor(color ? color : colorpeshb)+font(12)+co(colorl ? colorl : colorpeshb)+'">'+texto+'</th>');}
function formulario_da (t,id, nl) {
return (nl ? td2('No se localizaron Telefonos para esta calle') : '')+formulario('',fi1)+chidden('id', id)+ td('Editar el nombre de busqueda de la calle',cInput('t', t))+fine()+'</tr>';}
function linbott (c,s,w,st1) {
st = 'border-'+(st1 ? st1 : 'bottom-');
return st+'color:'+c+';'+st+'style:'+s+';'+st+'width:'+w+'px;';
}
function ftt (txt,t){return '<font style="'+font(t)+'">'+txt+'</font>'};
function border (c,s,w) {return 'border-color:'+c+';border-style:'+s+';'+borw(w);}
function border1 (c,s,w) {return 'border-bottom-color:'+c+';border-bottom-style:'+s+';'+borw(w);}
function borw(a) {return 'border-width:'+a+'px;';}
function bgcolor(a) {return 'background-color:'+a+';';}
function img_back(url) {return 'background-image:url('+url+');';}
function vis(v) {return 'visibility:'+(v ? 'visible' : 'hidden')+';';}
function font(t) {return 'font-size:'+(t ? t : '12')+'px;';}
function fonc (t,c) {return '<font style="'+co(c)+'">'+t+'</font>';}
function fonf(t) {return 'font-family:'+(t ? t : 'Arial')+';';}
function w1(t) {return 'width:'+(t ? t : '100')+';';}
function h1(t) {return 'height:'+(t ? t : '20')+';';}
function t1(t) {return 'top:'+(t ? t : '0px')+';';}
function l1(t) {return 'left:'+(t ? t : '0px')+';';}
function zi(t) {return 'z-index:'+(t ? t : '1000')+';';}
function cur(t) {return 'cursor:'+(t ? t : 'default')+';';}
function co(t) {return 'color:'+(t ? t : colorpes7)+';';}
function ifr (n) {return '<iframe name="'+n+'" style='+w1(0)+vis(0)+h1(0)+'></iframe>';}
function irad (n, t, v) {return '<input type=radio name="'+n+'" value="'+v+'">'+t;}
function icb (n, t, v, c) {return '<input type=checkbox name="'+n+'" value="'+v+'" "'+(c?'checked':'')+'">'+t;}
function tio(t,oc) {return it('100%')+tr(ths(t, '90%')+ths(c_div('cerring', font(12)+cur('hand'), vcerr, oc),'10%'))+dt;}
function awiki (url,t) {return '<a href="http://www.llegalemapas.com/wiki/index.php/'+url+'" target="_wiki">'+t+'</a>';}
function pestanas (id, c1, c2, c3) {
return c_div('',oveh+pos+t1(0)+l1(0)+w1('100%')+h1(20)+bgcolor(bgpred)+font(12), (c1 ? pestanna('ca1','Detalles','cambiar_contenido('+id+',1,this,0)',1,1,75) : '')
+(c2 ? pestanna('ca2','Telefono','cambiar_contenido('+id+',2,this,0)',0,79,75) : '')
+(c3 ? pestanna('ca3','Rutas de camion','cambiar_contenido('+id+',3,this,0)',0,158,150):'')
+c_div('', pos+oveh+t1(0)+l1('90%')+w1('10%')+h1(25)+cur('hand')+co('ffffff'), vcerr, 'ocultarobj()'));
}
function mensajeria (extra, tel,msn, yahoo, icq,t, mail,pw, calle, colonia) {
return it('',font(12))
+titulo_bobj('Aqui vive: '+nombre)
+extra+tel
+titulo_bobj('Mensajeria')+(msn ? +m_datos ('<img src='+linkemen+'msn/'+msn+'&'+t+'>', msn):'')+(yahoo ? +m_datos ('<img src='+linkemen+'yahoo/'+yahoo+'&'+t+'>', yahoo):'')
+(icq ? +m_datos ('<img src='+linkemen+'icq/'+icq+'&'+t+'>', icq):'')+m_datos ('E-mail', mail)+m_datos ('Pagina Web', pw,1)
+titulo_bobj('Direcci&oacute;n')+m_datos ('E-mail', mail)+m_datos ('Calle', calle)+m_datos ('Colonia', colonia);
}
function e_giro (id) {return ahref('gurl('+fi6+'?i='+id+')', '<img src="'+gi2+'" title="Eliminar este giro">');}
function dato1(id, d1, d2, d3, d4) {return m_datos ('Direcci&oacute;n:', d1)+m_datos ('Colonia:', d2)+m_datos ('E-Mail:', d3)+m_datos ('Pagina Web:', d4, 1)+acceso_directo(id, '');}
function nventana(width, height, bcolor, bstyle, bwidth, bgcolor, html,t) {
if (vabierta == 1) {
if (printvn.closed) {
vabierta = 0;
}
}
if (vabierta == 0) {
printvn=window.open('', '', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=no,width='+width+',height='+height);
v = "\'";
printvn.document.write('<head><title>'+t+'</title><script>vv=1;function nt4_r (id, t) {opener.nt4(id,t);}</script></head>'
+ '<BODY TOPMARGIN=0 LEFTMARGIN=0 bgcolor='+bgcolor+' onbeforeunload="opener.cmodo_ventana();" onunload="opener.cmodo_ventana();">'
+ifr('enviarimg')
+c_div('f1', pos+ovea, html)+'</body>');
}
printvn.f1.style.top = 0;
printvn.f1.style.left = 0;
printvn.f1.style.width = '100%';
printvn.f1.style.borderColor = bcolor;
printvn.f1.style.borderStyle = bstyle;
printvn.f1.style.borderWidth = bwidth;
printvn.f1.style.backgroundColor = bgcolor;
}
function cmodo_ventana () {vabierta=0;}
function copt (valor, nombre, s) {return '<option'+(valor ?  ' value="'+valor+'"' : '')+(s == valor ? ' selected' : '')+'>'+nombre+'</option>';}
function csel (n, txt, s, oc) {return '<select name="'+n+'"'+(s ? ' style="'+s+'"' : '')+(oc ? ' onchange="'+oc+'"' : '')+'>'+txt+'</select>';}
function bo (txt) {return '<strong>'+txt+'</strong>';}
function emh (txt) {return '<em>'+txt+'</em>';}
function p (txt, a) {return '<p alight="'+(a ? a : 'justify')+'">'+txt+'</p>';}
function h (txt, f, a) {return '<h'+f+(a ? ' align="'+a+'"' : '')+'>'+txt+'</h'+f+'>';}
function cent(txt) {return '<center>'+txt+'</center>';}
function cInput (nombre, valor,e) {return '<input type="text" name="'+nombre+'" value="'+(valor ? valor : '')+'" '+(e ? e : '')+'>';}
function cInputn (nombren, valorn,varn,e,eo){return '<input type="text" name="'+nombren+'" value="'+(valorn?valorn:'')+'" onchange="'+varn+'=this.value" '+(e ? e : '')+'>';}
function chidden (nombren, valorn){return '<input type="hidden" name="'+nombren+'" value="'+(valorn ? valorn : '')+'">';}
function cbotton (nombren, valorn,oc,e){return '<input type="button" name="'+nombren+'" value="'+(valorn?valorn:'')+'" onclick="'+oc+'" '+(e ? e : '')+'>';}
function cfile(n, e){return '<input type="file" name="'+n+'" style="'+(e ? e : '')+'">';}
function cenviar(n, e){return '<INPUT type="submit" name="'+n+'" value="'+n+'" style="'+(e ? e : '')+'">';}
function it (w,e) {return '<table border=0 cellspacing=0 cellpading=0 '+(w ? 'width="'+w+'"' : '')+(e ? e : '')+'>';}
function titulo_pestanna (texto) {return td2(texto);}
function pestanna (i,t,l,n,left,width) {return c_div(i, pos+borw(1)+h1(20)+t1(0)+l1(left)+w1(width)+font(12)+bgcolor(n ? colorpes1 : colorpes2) +co(colorpes7), t,l,'align=center');}
function cambiar_contenido (id,tipo,obj,pag) {
for (cc = 1; ;cc++) {
if (idc = document.getElementById('ca'+cc))
mod_pestanna(idc, '12px',colorpes2,colorpes7);
else
break;
}
mod_pestanna(document.getElementById('ca'+tipo), '12px',colorpes1,colorpes7);
idhtml = document.getElementById('contcalle');
buscadores = 1;
makeRequest(fi2+'?id='+id+'&tipo='+tipo+'&pag='+(pag ?pag :0), recepcion_datos);
idhtml.innerHTML = carg+'Cargando...';
}
function mod_pestanna (obj,d1,d2,d3) {
obj.style.fontSize = d1;
obj.style.backgroundColor = d2;
obj.style.color = d3;
}
function ltel (paginas,id, btel,t) {
urchinTracker('buscar_telefonos_calle/'+id);
sigp = td(paginas ? pag_sig(id,(paginas-10),1): '',(btel == 10 && paginas != 150) ? pag_sig(id,(paginas+10),0) : '');
return titulo_dtel +sigp +t +sigp+dt;
}
function mtl (tel, ct) {
if (!ct)
return '('+tel.substring(0,3)+')-'+tel.substring(3,6)+'-'+tel.substring(6);
else
return '('+tel.substring(0,2)+')-'+tel.substring(2,5)+'-'+tel.substring(5,8)+'-'+tel.substring(8);
}
function ldt(n,t,d) {return tr(tds(it()+tdn(bo(n), 14)+tdn(d)+dt, 300, linbott('black','solid',1))+tds(t, 150, linbott('black','solid',1)+font(14), 'valign="top"'));}
function img_mostrar (id, s) {return tdn(c_div('cnegocio', '', foto_p (id, (s ? s : 0))));}
function m_datos (texto, db, l, extralink, pre,olink) {
return (db ? td(texto, (!olink ? (l ? '<a href="http://'+db+(extralink ? extralink : '')+'" target=_new>' : '')+(pre ? pre : '')+db + (l ? '</a>' : '')
: '<a href="http://'+olink+'.llegalemapas.com/" target=_new>'+db+'</a>')) : '');
}
function d_modo (modo, giro, giro_txt) {return (modo == 1 ? m_datos('Giro:', giro+(giro_txt ? giro_txt : '')) : m_datos('Giro:', giro));}
function tc (txt, e) {return '<table style="'+e+'" border="0" cellpadding="0" cellspacing="0">'+txt+'</table>';}
function td (t1, t2,f,c,s) {return tr(tds(t1,0,font(f ? f : 12)+(s ? s : ''),'valign="top" '+(c ? 'align="center"' : ''))+tds(t2, 0, font(f ? f : 12)+(s ? s : '')));}
function tds (t,w,s,e) {return '<td'+(w ? ' width="'+w+'"' : '')+' style="'+(s ? s : '')+co(colorpesf)+'"'+(e ? e : '')+'>'+(t ? t : '')+'</td>';}
function tr(txt, m) {return '<tr '+(m ? 'valign="middle"':'valign="top"')+'>'+txt+'</tr>';}
function ths (t,w,s, e) {return '<th'+(w ? ' width="'+w+'"' : '')+' style="'+(s ? s : '')+co(colorpeshf)+bgcolor(colorpeshb)+'"'+(e ? ' '+e : '')+'>'+t+'</th>';}
function td2 (t,f,c) {return tr(tds(t,0,font(f ? f : 12),'valign="top" colspan=2 border=0 cellspacing=0 cellpading=0 '+(c ? 'align="center"' : '')));}
function tdn (t,f,c) {return tr(tds(t,0,font(f ? f : 12),' valign="top" '+(c ? 'align="center"' : '')));}
function th (t, i,f) {return tr(ths(t,0, font(f ? f : 12),+'valign="top"')+ths(i,0, font(f ? f : 12),+'valign="top"'));}
function th2 (t,f) {return tr(ths(t,0,font(f ? f : 12),'valign="top" colspan="2"'));}
function thn (t,f) {return tr(ths(t, 0, font(f ? f : 12),'valign="top"'));}
function li (t) {return '<li>'+t+'</li>'}
function ul (t) {return '<ul>'+t+'</ul>'}
function acceso_directo (id, pref) {
return m_datos('Acceso llegale:', pref+''+id, 1, '.llegalemapas.com/')+m_datos('Direccion de Acceso llegale:', pref+id+'.llegalemapas.com/', 1, '', 'http://')
+m_datos('En tu celular:', pref+id+'.llegale.mobi/', 1, '', 'http://')
+m_datos('<a href="/wiki/index.php/Código_QR" target="_wiki">QR</a>', '<img src="qr/qr_img.php?d=http%3A%2F%2F'+pref+id+'.llegale.mobi&e=S&s=6">');
}
function gurl (url) {formulariosguardar.location.href=url;}
function buscar_otrasfotos (id, s, mf) {return dicono('imagecompleta('+id+')',gi4,'Ver esta imagen en tama&ntilde;o completo', 5, 420)
+ (mf ? dicono('cambiarImg('+id+', '+s+')',gi5,'Ver Mas Imagenes de este lugar',30,420) : '');}
function dicono (onclick, src, title, top, left) {return c_div('',h1(30)+pos+t1(top)+l1(left)+w1(25),'<img src="'+src+'" width=25 height=25 title="'+title+'">', onclick);}
function icono_obj (src, titulo) {return '<img src="'+src+'" title="'+titulo+'" border=0 width=24 height=24>';}
function links_obj (oc, t, c) {return '<a href="'+jsv+'" onclick='+(c ? c : '"')+oc+(c ? c : '"')+'>'+t+'</a>';}
function ahref (oc, t, title) {return '<a href="'+jsv+'" onclick="'+oc+'" '+(title  ? 'title="'+title+'"' : '')+'>'+t+'</a>';}
function redireccion_eliminar (id) {formulariosguardar.location.href=fi3+'?i='+id+'&t=2';}
function descripcion (texto,col1,col2) {return texto ? tr(ths('Descripci&oacute;n',0,bgcolor(col1 ? col1 : bgpred)+co(col2 ? col2 : cpred), 'colspan=2')) + td2(texto) : '';}
function mas_fotos (id, descrip) {return it() +tdn('<img src='+fi4+'?id='+id+'>')+tdn(descrip);}
function foto_p (id, s) {return '<img src='+fi5+'?id='+id+'&s='+s+'>';}
function titulo_busqueda  (txt) {return titulo_busqueda_gps(txt);}
function titulo_busqueda_calle  (obj) {return titulo_busqueda_gps(lice(obj));}
function titulo_busqueda_ca  (obj) {return titulo_busqueda_gps(rbuscll(obj));}
function titulo_busqueda_neg  (obj) {return titulo_busqueda_gps(rbusneg(obj));}
var tambuscador = sry - (loc_ventana_y+40);
function mostrar_videos (obj) {
html = '';
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
html += tr(tds(ahref('mostrar_video('+obj.d[i].id+','+obj.idll+')', bo(obj.d[i].titulo ? obj.d[i].titulo : '[ Sin titulo ]')), 0, colordn))
+tr(tds('<ul><li>'+obj.d[i].detalles+'</li></lu>', 0, colordn+font(10)))
+tdn();
}
videos_ventana.innerHTML = tc(tdn(c_div('videos_ventana_flash'))+html, w1('100%'));
}
function mostrar_video (id,idll) {
if (window.cnegocio)
cnegocio.innerHTML = '';
urchinTracker('/vervideo/'+id+'/'+idll);
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '440',
'height', '300',
'src', 'php/fPlayer/fPlayerIn',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'exactfit',
'wmode', 'window',
'devicefont', 'false',
'id', 'fPlayer',
'bgcolor', '#000000',
'name', 'fPlayer',
'menu', 'true',
'FlashVars', 'playList=php/fPlayer/video.php?id='+id+'&idll='+idll+'&'+admt(),
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'movie', 'php/fPlayer/fPlayerIn',
'salign', '',
'container','videos_ventana_flash'
);
}
function titulo_busqueda_gps  (txt) {
return c_div('', overb+l1(0)+w1(wbuscador-25), bo('Resultados de busqueda'))
+c_div('', overb+l1(wbuscador-25)+w1(25),vcerr,'ocultar_buscador();','align="center"')
+c_div('', titulotb+h1(tambuscador-20), txt, '', 'onmousemove="click1 = false;" onmouseup="click1 = false;" align=left');
}
function lista_negocios_xy (obj) {
txt = '<h2>De un click en el nombre del negocio para ver mas detalles</h2>';
for (i = 0; i < obj.c; i++) {
txt += li('<img src="'+(obj.d[i][2] == 'nh' ? inohay  : micon+obj.d[i][2])+'" width=18 height=18>' + ahref('buscarnegociolistado('+obj.d[i][0]+', '+obj.y2+', '+obj.x2+')', bo(obj.d[i][1])));
}
posmuestraobj(loc_ventana_y,loc_ventana_x, obj.w, obj.h, colortitulo, 'solid', '1px', colorpes8, ul(txt),ovea,0,0,'Negocios_localizados','Negocios Localizados');
urchinTracker('/listadonegocios');
}
function buscarnegociolistado (id,y2,x2) {
makeRequest('buscar_negocio.php?id='+id+'&y2='+y2+'&x2='+x2, adm_tarjeta_xml);
posmuestraobj(y2, x2, 450, 100, colortitulo, 'solid', '1px', colorpes8, '<p align=left>'+carg+' Buscando...</p>',oveh,0,0,'','Buscar detalles');
}
function mostrar_ruta (id,t) {
return tr(tds(ahref('ver_ruta('+id+')', t)));
}
function ocultar_buscador () {
busquedas.style.visibility='hidden';
busquedas.innerHTML='';
tactivo = tfactivo;
ml = 0;
}
function dtel (t1,t2,t3,t4,t5,t6,t7,ca,ca2) {
txt = '';
if (t1 != 0) txt += td ('Telefono:', modo_tel(t1));
if (t2 != 0) txt += td ('Telefono:', modo_tel(t2));
if (t6 != 0) txt += td ('Lada sin costo:', '01 (800) '+t6);
if (t3 != 0) txt += td ('Fax:', modo_tel(t3));
if (t4 != 0) txt += td ('Celular:', ca2+modo_tel(t4));
if (t5 != 0) txt += td ('Nextel:', modo_tel(t5));
if (t7 != 0) txt += td ('Nextel ID:',t7);
return txt;
}
function replace(string,text,by) {
var strLength = string.length, txtLength = text.length;
if ((strLength == 0) || (txtLength == 0)) return string;
var i = string.indexOf(text);
if ((!i) && (text != string.substring(0,txtLength))) return string;
if (i == -1) return string;
var newstr = string.substring(0,i) + by;
if (i+txtLength < strLength)
newstr += replace(string.substring(i+txtLength,strLength),text,by);
return newstr;
}
function modo_tel (tel) {
if (tel.substring(0,2) == '55')
txte = ' ('+tel.substring(0,2)+') '+tel.substring(2,5)+'-'+tel.substring(5,8)+'-'+tel.substring(8,50);
else if (tel.substring(0,2) == '81')
txte = ' ('+tel.substring(0,2)+') '+tel.substring(2,5)+'-'+tel.substring(5,8)+'-'+tel.substring(8,50);
else if (tel.substring(0,2) == '33')
txte = ' ('+tel.substring(0,2)+') '+tel.substring(2,5)+'-'+tel.substring(5,8)+'-'+tel.substring(8,50);
else
txte = ' ('+tel.substring(0,3)+') '+tel.substring(3,6)+'-'+tel.substring(6,8)+'-'+tel.substring(8,50);
return txte;
}
function clave_tel (ca,tel) {
tel = replace(tel, '*', '-');
return 't'+ca+'-'+tel.substring(0,7);
}
function link_busqueda (xb,yb,xb1,yb1,c,t) {return ahref('realizarBusqueda('+xb+','+yb+','+xb1+','+yb1+');',t);}
function link_busqueda_c (xb,yb,xb1,yb1,t,col,i) {
return c_div('',cur('hand'),t+(col ? ' ('+col+')':''),'realizarBusqueda('+xb+','+yb+','+xb1+','+yb1+');'+(i ? 'mvacante('+i+');' : ''));
}
function mvacante(idv) {
posmuestraobj(90, 400, 470, 400, colorpes5, 'solid', '1px', colorpes6, carg+'Buscando informaci&oacute;n.....',2,idv);
indpest (2.1,0,idv);
}
function lice(obj) {
t = '';
for (i = 0; i < obj.c; i++) {
t += li(c_div('','',ahref('buscd('+obj.datos[i].i+', \''+obj.s+'\', \''+obj.b+'\', \''+obj.l+'\')',obj.datos[i].e)+c_div('cd'+obj.datos[i].i)));
}
return ul(t);
}
function buscd (e,m,b,l) {
makeRequest('rbusqueda.php?b='+b+'&l='+l+'&e='+e+'&t='+m, adm_tarjeta_xml);
lcdb = document.getElementById('cd'+e);
lcdb.innerHTML = carg+'Buscando...';
}
function rbusmunicipio (obj) {
t = '';
for (i = 0; i < obj.c; i++) {
t += li(c_div('','',ahref('busciudad('+obj.e+','+obj.s+',\''+obj.datos[i].i+'\',\''+obj.b+'\')', (obj.datos[i].e?obj.datos[i].e:obj.datos[i].i))+c_div('mun'+mtexto(obj.datos[i].i))));
}
lcdb.innerHTML = ul(t);
}
function mtexto (t) {return t.replace(/[^a-zA-Z0-9]+/g,'');}
function busciudad_mun(b,p) {
tdiv = '';
makeRequest('rbusqueda.php?b='+b+'&p='+p+'&t=1',adm_tarjeta_xml);
lcdb = document.getElementById(tdiv+(cd ? cd : m));
lcdb.innerHTML = carg+'Buscando...';
}
function busciudad(e,s,m,b) {
makeRequest('rbusqueda.php?b='+b+'&e='+e+'&m='+m+'&t='+s,adm_tarjeta_xml);
lcdb = document.getElementById('mun'+mtexto(m));
lcdb.innerHTML = carg+'Buscando...';
}
function rbusciudad (obj) {
t = '';
for (i = 0; i < obj.c; i++) {
t += li(c_div('','',ahref('buscalle('+obj.e+','+obj.s+',\''+obj.m+'\',\''+obj.datos[i].i+'\',\''+obj.b+'\')', (obj.datos[i].e ? obj.datos[i].e : obj.datos[i].i))+c_div('cll'+mtexto(obj.datos[i].i))));
}
lcdb.innerHTML = ul(t);
}
function buscalle(e,s,m,cd,b) {
makeRequest('rbusqueda.php?b='+b+'&e='+e+'&m='+m+'&cd='+cd+'&t='+s,adm_tarjeta_xml);
lcdb1 = document.getElementById('cll'+mtexto(cd));
lcdb1.innerHTML = carg+'Buscando...';
}
function dnegocio (obj) {
t = '<table style="'+font(12)+'">';
for (i = 0; i < obj.c; i++) {
t += tr(tds(link_busqueda_c(obj.datos[i].xb,obj.datos[i].yb,obj.datos[i].xb1,
obj.datos[i].yb1,obj.datos[i].n,obj.datos[i].c,(obj.mostrar ? obj.datos[i].i :0))));
}
t += dt;
lcdb1.innerHTML = t;
}
function iniciopoligono (px,py,obj) {
cpg = document.getElementById('cpoligono');
cpg.style.top=0;
cpg.style.left=0;
cpg.style.width=srx;
cpg.style.height=sry;
nombrep = 'poligono'+admt();
cpg.innerHTML = c_div('txtpol', t1(0)+l1(0))
+c_div(nombrep,pos+h1(sry)+w1(srx)+t1(py ? py : 0)+l1(py ? px : 0),
'','','onmousedown="fnClick(e);" onmousemove="if (movernodo) mmovernodo (e);else fnTrackMouse(e);" onmouseup="mdownruta(this,event,'+objetos[0][0][0].offsetLeft+','+objetos[0][0][0].offsetTop+')"');
polv=1;
return nombrep;
}
function mdownruta (obj,e,x,y) {
if(objrutaactivaobjetos==1){
mosemove(obj,objetos[0][0][1]-x, objetos[0][0][2]-y,event);
} else {
fnClickUp(e);
}
}
function ku (e) {if (e.which == 27)borrar_puntos();}
function trallcv (e) {if (e.which == 27) ocultarobj();}
function contrcv (e) {if (e.which == 27) oculatar_contrato();}
function poligonoclk (obj,loc_x,loc_y,e) {
d_nult();
i_bpol = detx (e) - obj.offsetLeft;
i_bpol = dety (e) - obj.offsetTop;
if (!buscadores) {
ocultarobj();
cargando(detx (e),dety (e));
makeRequest(fi15+'?t=1&x='+i_bpol+'&y='+i_bpol+'&x1='+loc_x+'&y1='+loc_y+'&x2='+detx(e)+'&y2='+dety (e)+'&esc='+EscalaMapa, localizarObjetoMapa);
}
}
function dblclkpol (ipx, ipy, e) {
mx = ((ipx - (detx(e) - (detx(e) % 250))) * 2) - 500;
my = ((ipy - (dety(e) - (dety(e) % 250))) * 2) - 1000;
ir_a(mx,my,EscalaMapa-1);
}
function rbuscll (obj) {
t = '<table style="'+font(12)+w1('100%')+'">';
colordn = '';
if (obj.ct > obj.c) {
paginan = 'Ir a la Pagina: ';
avancep = obj.p-3;
avancep1 = 1;
if (avancep < 1) avancep = 1;
for (i = (obj.p-1)*20; i < obj.ct; i += 20) {
if (obj.p == avancep)
paginan += bo(avancep)+' | ';
else
paginan += ahref('fbuscar (\''+obj.b+'\',\'1\',\''+obj.l+'\',\''+avancep+'\');',
avancep, 'Ir a la pagina: '+avancep)+' | ';
avancep++;
avancep1++;
if (avancep1 == 10) break;
if (avancep > 50) break;
}
t += tdn('Quiso buscar el giro: '+bo(ahref('fbuscar (\''+obj.b+'\',\'3.5\',\'\',\'1\');',
obj.b, ''))+'<br>'+paginan);
} else
t += tdn('Quiso buscar el giro: '+bo(ahref('fbuscar (\''+obj.b+'\',\'3.5\',\'\',\'1\');',
obj.b, '')));
for (i = 0; i < obj.c; i++) {
if (obj.datos[i].c.c) {
txtx = '';
txty = '';
coma = '';
if (obj.datos[i].c.c == 1) {
txt = 'var g = new jsGraphics(iniciopoligono ());d_elipse(g, \''+obj.color+'\', '+obj.datos[i].c.d[0].x1+','+obj.datos[i].c.d[0].y1+');';
} else {
for (xy = 0; xy < obj.datos[i].c.c; xy++) {
txtx += coma+(obj.datos[i].c.d[xy].x1 ? obj.datos[i].c.d[xy].x1 : 
obj.datos[i].c.d[xy][0]);
txty += coma+(obj.datos[i].c.d[xy].y1 ? obj.datos[i].c.d[xy].y1 : 
obj.datos[i].c.d[xy][1]) ;
coma = ',';
}
txt = 'var g = new jsGraphics(iniciopoligono ());dg_calle(g,4,\''+obj.color+'\',Array('+txtx+'),Array('+txty+'), 0, 0);';
}
} else {
txt = '';
}
if (colordn != '') colordn = ''; else colordn = ' style="'+bgcolor('fef4e1')+'"';
t += tr('<td '+colordn+'>'+c_div('',cur('hand'),obj.datos[i].i,'ir_a('+obj.datos[i].x+','+obj.datos[i].y+',4);'+txt)+'</td>'
+'<td '+colordn+'>'+c_div('',cur('hand'),'<img src="imagen/botones/boton.ver.calle.png" border=0>','ir_a('+obj.datos[i].x+','+obj.datos[i].y+',4);'+txt)+'</td>');
}
t += dt;
return t;
}
function rbusneg (obj) {
t = '<table style="'+font(12)+w1('100%')+'">';
colordn = '';
if (obj.ct > obj.c) {
paginan = 'Ir a la Pagina: ';
avancep = obj.p-3;
avancep1 = 1;
if (avancep < 1) avancep = 1;
for (i = (obj.p-1)*20; i < obj.ct; i += 20) {
if (obj.p == avancep)
paginan += bo(avancep)+' | ';
else
paginan += ahref('fbuscar (\''+obj.b+'\',\'3.5\',\''+obj.l+'\',\''+avancep+'\');', avancep, 'Ir a la pagina: '+avancep)+' | ';
avancep++;
avancep1++;
if (avancep1 == 10) break;
if (avancep > 50) break;
}
t += (obj.b ? tdn('Quiso buscar la calle: '+bo(ahref('fbuscar (\''+obj.b+'\',\'1\',\'\',\'1\');', obj.b, ''))+'<br>'+paginan) : paginan);
} else
t += (obj.b ? tdn('Quiso buscar la calle: '+bo(ahref('fbuscar (\''+obj.b+'\',\'1\',\'\',\'1\');', obj.b, ''))) : '');
if (EscalaMapa < 9) {
if (actuale_aqui == 0)
t += tdn(ahref('aquiestoy();','<img src="imagen/origen/especificar.origen.png" width="330" height="36" border=0 />'));
}
colordn1 = ' style="'+border('000000', 'solid',1)+'"';
for (i = 0; i < obj.c; i++) {
if (colordn != colordn1) colordn = colordn1; else colordn = ' style="'+bgcolor('fef4e1')+border('000000', 'solid',1)+'"';
t += tr('<td '+colordn+'>'+link_busqueda_c(obj.datos[i].xb,obj.datos[i].yb,obj.datos[i].xb1,obj.datos[i].yb1,bo(obj.datos[i].n),obj.datos[i].c,(obj.mostrar ? obj.datos[i].i :0))
+(obj.datos[i].cd != ', ' ? 'En la ciudad: <em>'+obj.datos[i].cd+'</em>' : '' )
+'<br>'+ahref('realizarBusqueda('+obj.datos[i].xb+','+obj.datos[i].yb+','+obj.datos[i].xb1+','+obj.datos[i].yb1+');', '<img src="imagen/botones/botones.localizacion.png" border=0>')
+ahref('buscarnegociolistado('+obj.datos[i].i+', 100, '+(srx-470)+')', '<img src="imagen/botones/botones.masinfo.png" border=0>')
+'</td>');
}
t += dt;
return t;
}
function borrar_puntos () {
cpg = document.getElementById('cpoligono');
cpg.innerHTML = '';
cpg.style.width = 1;
cpg.style.height = 1;
cpg.style.top = 0;
cpg.style.left = 0;
}
function eliminar_ruta () {
cpg = document.getElementById('cpoligono');
objrutaactivaobjetos = 0;
cpg.innerHTML = '';
cpg.style.width = 1;
cpg.style.height = 1;
cpg.style.top = 0;
cpg.style.left = 0;
}
function lic(t,txt) {return '<ul style="'+l1(4)+'">'+li(t)+'<ul style="'+l1(4)+'">'+txt+'</ul></ul>';}
function lic2(t,txt) {return li(t)+'<ul style="'+l1(4)+'">'+txt+'</ul>';}
function tituloe(t,txt) {
return c_div('',pos+oveh+h1(15)+t1(0)+l1(0)+w1(wbuscador-25)+font(10)+cur('hand')+fondo1,t)
+c_div('',pos+oveh+font(10)+h1(15)+w1(25)+t1(0)+l1(wbuscador-25)+cur('hand')+fondo1,vcerr,'ocultar_buscador();', 'align="center"')
+c_div('', titulotb+h1(tambuscador),txt, 'align="left"');
}
function buscadores_s (y1, f1, f2,h,l,w,v) {return pos+oveh+t1(h)+l1(l)+w1(w)+h1(y1)+border(f1,'solid',1)+bgcolor(f2)+borw(1)+vis(v)+cur('default');}
function c_div (n,s,txt,oc,e, k) {
return '<div'+(n ? ' id='+n : '')+(s ? ' style="'+s+'"' : '')+(oc ? ' onclick="'+oc+'"' : '')+(e ? ' '+e : '')+(k ? ' onKeyUp="'+k+'(event)"' :'')+'>'+(txt ? txt : '')+'</div>';
}
function actualizar_img (obj) {
if (modoc == modof1){
modoc=modof2;
obj.style.backgroundColor=modotc2;
}else{
modoc=modof1;
obj.style.backgroundColor=modotc1;
}
}
function cordenada_xy (obj) {
if (modocXY == 1) {
modocXY=0;
obj.style.backgroundColor=modotc2;
} else{
modocXY=1;
obj.style.backgroundColor=modotc1;
}
}
function mod_buscador (x,y,width,height) {
busc.style.left=x;
busc.style.top=y;
busc.style.width=width;
busc.style.height=height;
}
for (x = 0; x < cmaxX; x++) {
for (y = 0; y < cmaxY; y++) {
x1++;
on[x1] = x+''+y;
}
}
function moverObjeto (obj,ixl,iyl)  {
obj.style.left = obj.offsetLeft - ixl;
obj.style.top = obj.offsetTop - iyl;
}
function redibujarObj (obj99,ix,iy,d,top1,left1,f,xo,yo, objimg) {
if (f) {
obj99.style.top = top1;
obj99.style.left = left1;
} else {
if (top1) obj99.style.top = top1;
if (left1) obj99.style.left = left1;
}
ccobj (ix,iy,2,objimg);
 objetos[xo][yo][1] = ix;
 objetos[xo][yo][2] = iy;
}
function actimgx (x, posx3, suma) {
var datx = objetos[posx3][0][0].offsetLeft + suma;
for (y = 0; y < cmaxY; y++)
redibujarObj(objetos[x][y][0],objetos[posx3][y][1]+suma, objetos[x][y][2], objetos[x][y][3],0,datx,0,x,y,objetos[x][y][4]);
/*actualizar_xy (impre[1]+suma, impre[2]);*/
impre[1] = impre[1] +suma;
}
function actimgy (y, posy3, suma) {
var posy2 = objetos[0][posy3][0].offsetTop +suma;
for (x = 0; x < cmaxX; x++)
redibujarObj(objetos[x][y][0], objetos[x][y][1], objetos[x][posy3][2]+suma, objetos[x][y][3], posy2,0,0,x,y,objetos[x][y][4]);
/*actualizar_xy (impre[1], impre[2]+suma);*/
impre[2] = impre[2] +suma;
}
function actxycookies () {
setCookie('mx',impre[1]);
setCookie('my',impre[2]);
setCookie('escn',EscalaMapa);
}
function fnTrackMouse(e){
if (rutaactiva == 0){
scrollTo(0,0);
if (click1 && !buscadores) {
moverclima = true;
objs.style.top = 0;
objs.style.left = 0;
var ixl = iniciox-detx (e);
var iyl = inicioy-dety (e);
for (x = 0; x < cmaxX; x++) {
for (y = 0; y < cmaxY; y++) moverObjeto(objetos[x][y][0],ixl,iyl);
}
if (iniciox > detx (e)) {
for (x = 0; x < cmaxX; x++) {
if (objetos[x][0][0].offsetLeft + (tam_img * 2) < 0) {
actimgx (x, !x ? cmaxX-1 : x-1, tam_img);
mover_img = 1;
}
}
} else {
for (x = 0; x < cmaxX; x++) {
if (objetos[x][0][0].offsetLeft > (tam_img*(cmaxX-2))) {
actimgx (x, x == (cmaxX-1) ? 0 : x+1, -tam_img);
mover_img = 1;
}
}
}
if (inicioy < dety (e)) {
for (y = 0; y < cmaxY; y++) {
if (objetos[0][y][0].offsetTop > (tam_img*(cmaxY-2))) {
actimgy (y, y == (cmaxY-1) ? 0 : y+1, -tam_img);
mover_img = 1;
}
}
} else {
for (y = (cmaxY-1); y > -1; y--) {
if (objetos[0][y][0].offsetTop + tam_img < 0) {
actimgy (y, !y ? cmaxY-1 : y-1, tam_img);
mover_img = 1;
}
}
}
f.style.top = f.offsetTop - (inicioy-dety (e));
f.style.left = f.offsetLeft - (iniciox-detx (e));
if (mres.offsetLeft != -1000 && mres.offsetTop != -1000) mflecha(mres.offsetLeft - (iniciox-detx (e)), mres.offsetTop- (inicioy-dety (e)));
maqui(iniciox-detx (e), inicioy-dety (e));
iniciox = detx (e);
inicioy = dety (e);
actxycookies ();
}
}
}
function dety (e) {
if (!e.clientY) {
if (typeof(event) != "undefined")
return event.clientY;
else
return 0;
} else {
return e.clientY;
}
}
function detx (e) {
if (!e.clientX) {
if (typeof(event) != "undefined")
return event.clientX;
else
return 0;
} else {
return e.clientX;
}
}
function detx1 (e,obj) {return detx(e)-obj.offsetLeft;}
function dety1 (e,obj) {return dety(e)-obj.offsetTop;}
function tiempo_activo (obj, loc_x, loc_y,e) {
if (rutaactiva == 0){
d_nult();
if (mover_img == 0) {
if (EscalaMapa < 5) {
if (!buscadores) {
ocultarobj();
cargando(detx(e),dety(e));
makeRequest(fi15+'?t=1&x='+detx1(e,obj)+'&y='+dety1(e,obj)+'&x1='+loc_x+'&y1='+loc_y+'&x2='+detx(e)+'&y2='+dety(e)+'&esc='+EscalaMapa+'&srx='+srx+'&sry='+sry, localizarObjetoMapa);
}
} else {
if (!buscadores) {
ocultarobj();
cargando(detx(e),dety(e));
if (locc == 1) {
makeRequest('inegi/cciudad.php?idciudad='+idciudad+'&x='+loc_x+'&y='+loc_y+'&esc='+EscalaMapa, adm_tarjeta_xml);
locc=0;
} else {
makeRequest('inegi/ciudad.php?t=1&x='+detx1(e,obj)+'&y='+dety1(e,obj)+'&x1='+loc_x+'&y1='+loc_y+'&x2='+detx(e)+'&y2='+dety(e)+'&esc='+EscalaMapa+'&srx='+srx+'&sry='+sry, localizarObjetoMapa);
}
}
}
} else {
urchinTracker('mover/'+EscalaMapa);
}
mover_img = 0;
/*if (buscadores == 5 || buscadores == 6 || buscadores == 7) {*/
idtx = ((loc_x+detx1(e,obj))*mult);
idty = ((dety1(e,obj)+loc_y)*mult);
idtx1 = detx(e);
idty1 = dety(e);
/*}*/
} else {
dlinearuta(detx1(e,obj),dety1(e,obj),loc_x,loc_y,detx(e),dety(e));
}
}
var x_mov_aqui;
var y_mov_aqui;
function d_nult () {
x_mov_aqui = 0;y_mov_aqui = 0;
switch (EscalaMapa) {
case 1: mult=1;break;
case 2: mult=2;x_mov_aqui = 270;y_mov_aqui = 2710;break;
case 3: mult=4;x_mov_aqui = 260;y_mov_aqui = 1090;break;
case 4: mult=8;x_mov_aqui = 278;y_mov_aqui = 272;break;
case 5: mult=16;x_mov_aqui = 278;y_mov_aqui = -130;break;
case 6: mult=32;x_mov_aqui = 278;y_mov_aqui = -340;break;
case 7: mult=64;x_mov_aqui = 278;y_mov_aqui = -440;break;
case 8: mult=128;x_mov_aqui = 278;y_mov_aqui = -490;break;
case 9: mult=256;x_mov_aqui = 278;y_mov_aqui = -490;break;
case 10: mult=512;break;
default: mult=0;break;
}
}

function cargando (x, y) {
d_nult();
posmuestraobj(y+5, x+5, 18+(modocXY ? 200 : 0), (modocXY ? 25 : 18), '', '', '',colorpes8,carg);
}
function keep_alive () {
formulariosbuscar.document.write('<script src="php/servicio1.php?'+admt()+'"></script>');
setTimeout('keep_alive()', 450000);
}
function localizarObjetoMapa() {

if (http_request.readyState == 4) {
if (http_request.status == 200) {
var txt = http_request.responseText;
if (txt) {
conteoImg = 1;
eval(txt);
posmuestraobj_cursor('default');
tactivo = tiactivo;
urchinTracker('/BuscarObjetos/'+EscalaMapa);
} else {
ocultarobj();
tactivo = tfactivo;
}
}
}

}

function fnClick(e) {
if (!ml) click1 = true;
iniciox = detx (e);
inicioy = dety (e);
}
moverclima = false;
function fnClickUp (e) {
click1 = false;
if (buscadores == 5) {
pregfinmarcarlugar();
}
if (buscadores == 6) {
pregfinmarcarlugar_basico();
}
if (buscadores == 7) {
aquiestoy_marcarlugar();
}
borrar_puntos();
if (objrutaactivaobjetos == 1) {dibujarruta(objrutaactiva);}
if (moverclima == true) makeRequest('php/clima/index.php?', adm_tarjeta_xml);
moverclima = false;
}

function marcarlugar(ml1, objetom) {
if (!ml) {
objs.style.cursor = 'default';
marca.border='0';
negocio.border='0';
casa.border='0';
objetom.border='1';
ml = ml1;
} else {
objs.style.cursor = 'move';
objeto.border='0';
f.innerHTML = '';
f.style.visibility = 'hidden';
ml = 0;
}
}

function ctipobuscador () {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
bmapar.innerHTML=http_request.responseText;
}
}
}

function fbuscar (b,t,l,p) {
mod_buscador (loc_ventana_x,loc_ventana_y,wbuscador,90,fondo1,fondo2,1);
if (b == '' && l == '') {
buscadores = 1;
busquedas.style.visibility='visible';
busquedas.innerHTML=tituloe('Buscar', cent(bo('Error: ')+'Debe de especificar al menos una palabra para poder buscar una calle'));
tactivo = tiactivo;
return 0;
}
/*if (om_buscador_v == 2)
om_buscador();*/
if (t == 1) t = 1.1;
makeRequest(fi16+'?b='+b+'&t='+t+'&l='+l+'&p='+(p ? p : 1),mdatosbusqueda);
buscadores = 1;
busquedas.style.visibility='visible';
busquedas.innerHTML=tituloe('Buscando', cent(carg+'Realizando Busqueda....')+'<br>'+cent('Espere por favor'));
tactivo = tiactivo;
urchinTracker(fi16+'/'+t+(l ? '/'+l : '')+(b ? '/'+b : ''));
}

function mdatosbusqueda () {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
mod_buscador (loc_ventana_x,loc_ventana_y,wbuscador,tambuscador,fondo1,fondo2,1);
eval('busc.innerHTML='+http_request.responseText+';');
tactivo = tfactivo;
buscadores = 0;
}
}
}
function ocultarobj () {
f.style.top = -1000;
f.style.left = -1000;
f.style.visibility = 'hidden';
}
function posmuestraobj_cursor(cursor) {f.style.cursor = cursor;}
function realizarBusqueda (dx, dy, mx, my) {
ocultarobj();
EscalaMapa = 3;
contenidomapa.innerHTML = dobj (dx, dy, 0, 0);
mres.style.top = my-76;
mres.style.left = mx;
mres.style.visibility = 'visible';
acutalizarObjetos(dx,dy);
ira_aqui (dx, dy, EscalaMapa);
/*maqui (0,0);*/
}

function mosemove (objeto, obj1, obj2,e) {
if (!ml) tiempo_activo(objeto, obj1,obj2,e);
}

function RedibujarCuadros(ix, iy) {

ocultarobj();
actualizar_xy (ix, iy);
for (x = 0; x < cmaxX; x++) {
for (y = 0; y < cmaxY; y++)
redibujarObj(objetos[x][y][0], impre[1]+(tam_img*x), impre[2]+(tam_img*y), objetos[x][y][3], (y-1)*tam_img, (x-1)*tam_img,1,x,y,objetos[x][y][4]);
}
urchinTracker('acercar/'+ix+','+iy);
}
function mprint () {
txtimprimir = '';
x12 = 0;
y12 = 0;
for (x = -250; x < ((cmaxX-1)*250); x = x+250) {
y12 =0;
for (y = -250; y < ((cmaxY-1)*250); y = y+250) {
txtimprimir += c_div('',
pos+w1(tam_img)+h1(tam_img)+oveh+'scroll:no;'+t1(objetos[x12][y12][0].offsetTop)+l1(objetos[x12][y12][0].offsetLeft),
'<img src="'+servimg+'imgdb.php?x='+objetos[x12][y12][1] +'&y='+objetos[x12][y12][2]+'&b='+EscalaMapa+'">');
y12++;
}
x12++;
}
printw=window.open('', '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=no,resizable=no,width=' + ((srx)-150) + ',' +'height=' + ((sry)-50) );
parent.printw.document.write(c_div('', pos+t1(0)+l1(0)+w1(srx)+h1(sry)+oveh, txtimprimir)
+c_div('',pos+t1(sry-176)+l1(srx-296)+h1(126)+w1(146),'<img src="img/compas.gif" width="141" height="126" />'));
parent.printw.document.close();
parent.printw.focus();
if (window.print) parent.printw.print();
urchinTracker('imprimir');

}
function dobj (dx, dy, mx, my) {
var nom = 0, txtp = '', x12 = 0, y12 = 0;
actualizar_xy(dx, dy);
for (x = -250; x < ((cmaxX-1)*250); x = x + 250) {
y12 =0;
for (y = -250; y < ((cmaxY-1)*250); y = y + 250) {
nom = nom +1;
txtp = txtp + cobj (on[nom], dx + x, dy + y, x, y, x12, y12);
y12++;
}
x12++;
}
return txtp;
}
function cobj (n, dx, dy, tx, ty,x12,y12) {
xobj = 'objetos['+x12+']['+y12+'][1],objetos['+x12+']['+y12+'][2]';
return c_div('i'+n, t1(ty)+l1(tx)+w1(tam_img)+h1(tam_img), c_div('i_img'+n, t1(0)+l1(0)+w1(tam_img)+h1(tam_img)+ccobj (dx,dy, 1)),'/*cclick(this,'+xobj+',event);*/',
'onmouseup="mosemove(this,'+xobj+',event);" ondblclick="acercardbl('+xobj+');" onmousewheel="wheel_event ('+xobj+');" class="mapa" title="De un click en el mapa o arrastrelo"  alt="De un click en el mapa o arrastrelo" ');
}
function checkKey() {
if (event.keyCode == 43) {
acercardbl(x,y);
return false;
} else if (event.keyCode == 45) {
alejar();
return false;
}
}
function wheel_event (x,y) {
if (event.wheelDelta >= 20)
acercardbl(x,y);
else if (event.wheelDelta <= -20)
alejar();
}
function ccobj (dx,dy,n,obj) {

estrausuario = getCookie('estrausuario');
db1 = getCookie('db1img');
linkimg = servimg+'imgdb.php?b='+EscalaMapa+'&x='+dx+'&y='+dy+(estrausuario ? estrausuario : '')+(db1 ? '&db1='+db1 : '');

if (modoc) {
obj.style.backgroundImage = 'url('+linkimg+'&editar=1&'+admt()+')';
} else {
if (n == 1) {
return img_back(linkimg);
} else {
obj.style.backgroundImage = 'url('+linkimg+')';
}
}

}
function acercardbl (x,y) {
if (EscalaMapa != 2) {
ir_a ((x*2)-500, (y*2)-1000, EscalaMapa-1);
}
}
var arImages=new Array();
function Preload() {
var temp = Preload.arguments; 
for(x=0; x < temp.length; x++) {
arImages[x]=new Image();
arImages[x].src=Preload.arguments[x];
}
}
function actualizar_xy (ix, iy) {
impre[1] = ix - (ix % tam_img);
impre[2] = iy - (iy % tam_img);
}
function homepage () {window.open('http://www.llegale.com/');}
function modoescalamapa () {
switch (EscalaMapa) {
case '13':EscalaMapa=13;break;
case '12':EscalaMapa=12;break;
case '11':EscalaMapa=11;break;
case '10':EscalaMapa=10;break;
case '9': EscalaMapa=9;break;
case '8': EscalaMapa=8;break;
case '7': EscalaMapa=7;break;
case '6': EscalaMapa=6;break;
case '5': EscalaMapa=5;break;
case '4': EscalaMapa=4;break;
case '3': EscalaMapa=3;break;
case '2': EscalaMapa=2;break;
}
}
function ir_a (x,y, esci) {
borrar_puntos();
EscalaMapa=esci ? esci : 6;
modoescalamapa ();
mres.style.top = -1000;
mres.style.left = -1000;
mres.style.visibility = 'hidden';
RedibujarCuadros(x, y);
actxycookies ();
ira_aqui (x, y, esci);
/*maqui (0,0);*/
}
function alejar() {
if (EscalaMapa != 12) {
EscalaMapa += 1;
ir_a((impre[1]/2)-(tam_img*(cmaxX/4))+500, (impre[2]/2)-(tam_img*(cmaxY/4))+500,EscalaMapa);
}
}
function acercar() {
if (EscalaMapa != 2) {
EscalaMapa -= 1;
ir_a((impre[1]*2)+(tam_img*(cmaxX/4))+750, (impre[2]*2)+(tam_img*(cmaxY/4))-750,EscalaMapa);
}
}

function acutalizarObjetos (dx,dy) {
x1 = 0;
for (x = 0; x < cmaxX; x++) {
for (y = 0; y < cmaxY; y++) {
x1++;
objetos[x][y] = new Array(document.getElementById('i'+x+y), dx+((x-1)*250), dy+((y-1)*250), on[x1], document.getElementById('i_img'+x+y));
}
}

}
var tcm = '';
var lcd;
function mapa1() {
if (tcm =='') {
mapa_estado(lciudades);
}
return tcm;
}
function mflecha (x,y) {
/*mres.style.top = y-30;
mres.style.left = x;
mres.style.backgroundImage = 'url(\'imagen/apuntador/1.gif\')';
mres.style.visibility = 'visible';
setTimeout('flechaactiva()', 100);*/
mres.style.top = y;
mres.style.left = x;
mres.style.visibility = 'visible';
}
var siga = 1;
function flechaactiva () {
if (siga == 8) siga = 1; else siga += 1;
mres.style.backgroundImage = 'url(\'imagen/apuntador/'+siga+'.gif\')';
setTimeout('flechaactiva()', 100);
}
function bayuda (texto, id, titulos, top, scrool) {
return c_div(id, styleayuda+t1(top+250)+l1(srx - 145)+w1(145)+h1(18), texto, 'cayuda.style.overflow=\''+scrool+'\';moayuda('+titulos+');', 'align=right');
}
function vayuda () {return c_div('cayuda', styleayuda+t1(-255)+l1(srx - 265)+w1(265)+h1(255),ayuda1, '','onmousemove="click1=false;"');}
function icono (icono, titulo, id, click, left) {
if (!left) left2 +=35; else left2 = left;
return c_div(id, pos+t1(0)+l1(left2)+w1(35)+h1(35)+cur('hand'), '<img title="'+titulo+'" src="'+icono+'" width=32 height=32 border=0>', click);
}

function iconot (icono, titulo, id, w11,h) {
return c_div(id, pos+t1(0)+l1(0)+w1(w11)+h1(h), '<img title="'+titulo+'" src="'+icono+'" width='+w11+' height='+h+' border=0>');
left2 = w11;
}
function agregargiro (i) {
if (ml == 2) posmuestraobj(loc_ventana_y,loc_ventana_x, 400, 150, colortitulo, 'solid', '1px', colorpes8, 
itabla(394,'Agregar un Giro','',fi9,'')
+td2(c_div('respuestag', font(12)))
+chidden('i', i)
+td('Giro:', cInput('d1', ''))+fine());
}

function agregarfoto(i) {
if (ml == 2) posmuestraobj(loc_ventana_y,loc_ventana_x, 500, 300, bgpred, 'solid', '1px', colorpes8,
itabla(500,'Agregar Foto','',fi10,encmf)
+chidden('i',i)
+td('foto:', cfile('userfile'))
+tda('d3','',45,8)
+fine());
}
function cambiarImg (i,s) {
cnegocio.innerHTML= carg+'Espere un momento, Cargando imagenes';
makeRequest(fi11+'?i='+i+'&l='+conteoImg+'&s='+s, cambiarImgxml);
buscadores = 1;
}
function cambiarImgxml () {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var txt = new Function("return "+http_request.responseText)();
if (txt[0].innerHTML) {
eval('cnegocio.innerHTML='+txt[0].innerHTML+';');
conteoImg = txt[0].conteoImg;
buscadores = 0;
}
}
}
}
function eliminarmasfotos (i,i1,s) {
conteoImg=0;
makeRequest(fi11+'?i='+i+'&l=0&s='+s+'&d='+i1, cambiarImgxml);
buscadores = 1;
}
function imagecompleta (i) {
var conteoImg2 = conteoImg-1;
imgw=window.open (fi12+'?i='+i+'&l='+conteoImg2);
}
function moayuda (texto,textor,textor2,top) {
if (!ma) {
mapallave.innerHTML=textor;
mtiempomax = top;
mostrar_tiempo();
ma = 1;
} else {
mapallave.innerHTML=textor2;
mapallave.style.top=0;
ma = 0;
}
}
function cmostrarayuda (texto) {
mostrarayuda = texto;
}
function mostrar_tiempo () {
cayuda.style.top=cayuda.offsetTop+10;
mapallave.style.top=mapallave.offsetTop+10;
if (mapallave.offsetTop < 315)
mostrar_tiempoobj = setTimeout('mostrar_tiempo()', 50);
}

function otorgarpermiso(i) {
if (ml == 2)
posmuestraobj(loc_ventana_y,loc_ventana_x, 400, 120, colortitulo, 'solid', '1px', colorpes8,itabla(400,'Otorgar Permisos','',fi13,'')+chidden('i',i)+td('Usuario:', cInput('d1', ''))+fine());
}
function titulo(titulot, objc, lc) {
return tr(ths(it()+tr(ths(titulot)+ths('<label style="'+font(12)+'" onclick="'+(objc == '' ? '':objc+'.border=0;')+'ml=0;ocultarobj();">Cerrar</label>', 60, '','align="center"'))+dt, 0, '', 'colspan="2"'));
}
function cerrarv(objc, lc){return c_div('',pos+t1(5)+l1(lc)+zi(1005)+'color:'+colortitulofont+';', 'Cerrar', (objc == '' ? '':objc+'.border=0;')+'ml=0;ocultarobj();');}
function tda (ntda,vtda,colstda,rowstda) {return td2('Descripcci&oacute;n:', 12, 1)+td2(tda2t(ntda, vtda, colstda, rowstda));}
function tda2 (ntda,vtda,colstda,rowstda,d11) {
return tdn('Descripcci&oacute;n:<input type=radio name=d11 value=1 '
+(d11 ? 'checked' : '')+'>Mostrar /'
+'<input type=radio name=d11 value=0 '+(!d11 ? 'checked' : '')+'>Ocultar')
+td2(tda2t(ntda, vtda, colstda, rowstda));
}
function tda2t (ntda,vtda,colstda,rowstda) {return td2('<textarea name="'+ntda+'" cols='+colstda+' rows='+rowstda+' style="'+font(12)+'">'+(vtda ? vtda:'')+'</textarea>');}
function fine() {return fined('Guardar');}
function fined(v,e) {return td2(cent('<input type="submit" value="'+v+'">'+(e ? e : '')), 12, 1)+dt+'</form>';}
function itabla(tam,d1,d2, f, e,fd) {return formulario(e,f,fd)+it(tam, 'align=center')+titulo(d1, d2, tam);}
function formulario(e,f,fd) {return '<form method="POST" '+e+' target="'+(fd ? fd : 'formulariosguardar')+'" action="'+f+'">';}
function formularioput(e,f,fd) {return '<form method="PUT" '+e+' target="'+(fd ? fd : 'formulariosguardar')+'" action="'+f+'">';}
function formimg(f,e) {return '<form method="POST" '+e+' action="'+f+'">';}
function formarchivo (a) {return '<FORM ENCTYPE="multipart/form-data" ACTION="'+a+'" METHOD="POST" target="formulariosguardar">';}
function localizacionmarca_editar_mi_negocio (i,n,d1,d2,d3,d4,d5,d6,d9,d10,d11) {
if (ml == 2) posmuestraobj(loc_ventana_y,loc_ventana_x, 505, sry -120, colortitulo, 'solid', '1px', colorpes8,
c_div('', h1(sry -120)+w1(500)+ovea, itabla(485,'Editar mi Negocio: '+n,'',fi8, encmf)
+chidden('i',i)+td('Nombre:', cInput('d1', n))+td('Calle:', cInput('d2', d1))+td('Colonia:', cInput('d7', d2))+td('Telefono:', cInput('d5', d3))
+td('Email:', cInput('d9', d9))+td('Pagina Web:', cInput('d10', d10))+td('Nueva Fotograf&iacute;a:', cfile('userfile'))+tda('d3',d6,45,10)+fine()));
}
function marcarusr(ml1, objeto) {
if (!ml) {
oScratch.style.cursor = 'default';
casa.border='0';
objeto.border='1';
ml = ml1;
} else {
oScratch.style.cursor = 'move';
objeto.border='0';
formulario.innerHTML = '';
formulario.style.visibility = 'hidden';
ml = 0;
}
}
function getCookie(name) {
  var cookies = document.cookie;
  var start = cookies.indexOf(name + '=');
  if (start == -1) return null;
  var len = start + name.length + 1;
  var end = cookies.indexOf(';',len);
  if (end == -1) end = cookies.length;
  return unescape(cookies.substring(len,end));
}
function setCookie(name, value, expires, path, domain, secure) {
value = escape(value);
expires = (expires) ? ';expires=' + expires.toGMTString() :'';
path    = (path)    ? ';path='    + path                  :'';
domain  = (domain)  ? ';domain='  + domain                :'';
secure  = (secure)  ? ';secure'                           :'';

document.cookie = name + '=' + value + expires + path + domain + secure;
}
function lista_estados (nombre,e) {
estadosreg = '<option>Seleccione un estado</option>';
for (i = 0; i < 32; i++) {
if (e == lciudades.lc[i].i)
estadosreg += copt (lciudades.lc[i].i,lciudades.lc[i].e,lciudades.lc[i].i);
else
estadosreg += copt (lciudades.lc[i].i,lciudades.lc[i].e);
}
return '<select name="'+nombre+'" onchange="cambestado(this.value)">'+estadosreg+'</select>';
}
function cambestado (valor,e) {
if (valor) {
makeRequest('php/lista_ciudades_dnegocio.php?i='+valor+'&e='+(e ? e : 0)+'&mod=cambciudad', adm_tarjeta_xml);
cdcamb.innerHTML = carg+' Buscando las ciudades....';
} else {
cdcamb.innerHTML = 'Seleccione un estado';
}
}
function cambciudad(obj,e) {
lcd = '<option>Seleccione una ciudad</option>';
for (i = 0; i < obj.cant; i++) {
if (e ==obj.lc[i].id)
lcd += copt(obj.lc[i].id,obj.lc[i].c,obj.lc[i].id);
else
lcd += copt(obj.lc[i].id,obj.lc[i].c);
}
cdcamb.innerHTML = '<select name="cd1" onchange="cd.value=this.value">'+lcd+'</select>';
if (cdobj) {
cd1.value = cdobj;
cdobj = 0;
}
}
function asigcalle (id) {
makeRequest(fi31+'?id='+id+'&'+admt(), adm_tarjeta_xml);
contcalle.innerHTML = carg+'Cargando...';
}
function asignado (id) {return it()+tdn('<img src=calle/img.php?id='+id+' width=141 height=160 border=0>')+dt;}
function asignadoc (id) {return it()+tdn('<img src=calle/img.php?id='+id+' width=50 height=50 border=0>')+tdn(ahref('actp('+id+')','Cambiar<br>imagen'))+dt;}
function actp(id) {contcalle.innerHTML = formulario(encmf,fi34,'formulariosbuscar')+it()+chidden('id',id)+td('Cambiar la imagen',cfile('file')+cenviar('Guardar'))+dt+'</form>';}
function link_calle (id,idc,fecha,vigencia) {
return ahref('asignar_calle('+id+','+idc+')', 'Asignar esta imagen')+'<br>Asignar esta imagen a '+ahref('asignar_calle100('+id+',100)','100')+', '
+ahref('asignar_calle100('+id+',500)','500')+', '+ahref('asignar_calle100('+id+',1000)','1000')
+' calles al azar<br>Reasignar esta imagen a '+ahref('rasignar_calle100('+id+',100)','100')+', '
+ahref('rasignar_calle100('+id+',500)','500')+', '
+ahref('rasignar_calle100('+id+',1000)','1000')+' calles al azar<br>Creado el: '+bo(fecha)+', Vigente hasta: '+bo(vigencia);
}
function asignar_calle (id,idc) {makeRequest(fi33+'?id='+id+'&idc='+idc+'&'+admt(), adm_tarjeta_xml);}
function asignar_calle100 (id,lim) {makeRequest(fi33+'?id='+id+'&lim='+lim+'&'+admt(), adm_tarjeta_xml);}
function rasignar_calle100 (id,lim) {makeRequest(fi33+'?id='+id+'&lim='+lim+'&m=1&'+admt(), adm_tarjeta_xml);}
function links_calle (id,idc,cant,fecha,vigencia) {return td(asignadoc(id),link_calle (id,idc,fecha,vigencia)+'<br><b>Esta imagen se localiza en '+cant+' calles</b>')+td2('<hr>');}
function c_asign (c) {return td2('Total de calles asignadas: '+bo(c));}
function form_p (txt_asig,id){return it('100%')+tdn(txt_asig)+tdn('<hr>')+tdn(formulario(encmf,fi32,'formulariosbuscar')+it()+chidden('id',id)+td('Subir una nueva imagen',cfile('file')+cenviar('Guardar'))+dt+'</form>')+dt;}
function ingresar () {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, 300, 250, colortitulo, 'solid', '1px', colorpes2,
itabla(148,tio('Ingreso de usuarios','buscadores=0;ocultarobj();'),'','php/acceso.php','')
+td2(c_div('respuestag',font(12)))
+td2(bo('Para ingresar una Ficha llegale es necesario registrarse como usuario.<br>Si no tienes una cuenta '+cbotton('', 'REGISTRATE AQUI', 'crear_cuenta();')
+', de lo contrario escribe tu usuario y contrase&#241;a:<br><br>Nota: Con un solo registro puedes manejar todas tus tarjetas<br>'))
+td('Usuario:', cInput('d1', '',' style="'+w1(120)+'"'))
+td('Contrase&#241;a:', '<input type="password" name="d2" style="'+w1(120)+'">')
+td(c_div('f1', font(12)), c_div('f2', font(12)))
+fined('Ingresar'));
}
function terminar () {document.write('<script>parent.document.location="php/salir.php";</script>');}
function crear_cuenta () {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, 350, 235, colortitulo, 'solid', '1px', colorpes2,
itabla(233,tio('REGISTRATE AQUI','buscadores=0;ocultarobj();'),'','php/ccuenta.php','')
+td2(c_div('respuestag',font(12)))
+td('&#191;Cual es tu nombre?:', cInput('d1', '', 'style="'+w1(150)+'"'))
+td('Usuario:', cInput('d2', '', 'style="'+w1(150)+'"'))
+td('Contrase&#241;a: (minimo 6 caracteres)', '<input type="password" name="d3" style="'+w1(150)+'">')
+td('Confirma tu Contrase&#241;a:', '<input type="password" name="d4" style="'+w1(150)+'">')
+td('Email:', cInput('d5', '', 'style="'+w1(150)+'"'))
+td(c_div('f1', font(12)), c_div('f2', font(12)))
+fined('Crear Cuenta'));
}
function cuenta_creada (id) {
posmuestraobj(loc_ventana_y,loc_ventana_x, 350, 235, colortitulo, 'solid', '1px', colorpes2,
itabla(233,tio('Fin del Registro','document.location=\'index.php\';'),'','','')
+ th2(cent('Usuario '+bo(id)+' Creado con &eacute;xito.<br><br>'))
+ th2(c_div('', font(14)+cur('hand')+co('ff0000'),
cbotton('', 'DE UN CLICK AQU&Iacute;','document.location=\'index.php\';','style="'+font(14)+cur('hand')+co('ff0000')+'"')))
+th2('PARA INGRESAR CON SU USUARIO')+dt);

}
function cuenta_error(txt) {
respuestag.innerHTML=txt;
d3.value = '';
d4.value = '';

}var http_request = false;
function makeRequest(url, funcion) {
http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
return false;
}
http_request.onreadystatechange = funcion;
http_request.open('GET', url+'&g='+g+'&'+admt(), true);
http_request.send(null);
}

function makeRequestenvio(url, funcion, txt) {
request = false;
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
if (request.overrideMimeType) {
request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!request) {
return false;
}
request.onreadystatechange = funcion;
request.open("POST", url);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
request.send(txt);

}
function recepcion_datos () {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var txt = http_request.responseText;
eval('txthtml = '+txt+';');
idhtml.innerHTML = txthtml;
buscadores = 0;
}
}
}
function adm_tarjeta_xml () {

if (http_request.readyState == 4) {
if (http_request.status == 200) {
eval(http_request.responseText);
}
}
}
function adm_tarjeta_xmlpost () {

if (request.readyState == 4) {
if (request.status == 200) {
eval(request.responseText);
}
}
}
function admt() {
var Digital=new Date();
return Digital.getHours()+''+Digital.getMinutes()+''+Digital.getSeconds();
}var tablagiro = it('100%', 'style="'+font('12')+'"');
function lgiro(letra, l) {}
function glk(t,icono) {}
function mo (ida) {}
function cgiro (id) {}
function ocultar_todo_giros() {}
function ctxtgiro (txt) {}
function ogs(ida, m) {}
var posg = -1;
stygiro1 = ovea+pos+t1(15)+l1(0);
function stygiro2(l){ return pos+t1(0)+l1(l)+w1(15);}
stygiro3 = pos+t1(0)+l1(0)+w1(30);
stygiro4 = pos+t1(0)+l1(0)+h1(20)+w1(500)+bgcolor(colorpes3);
micon = '/mapa/icono/';
inohay = '/directorios/admin/idea.png';

var cud = cu;
var b2 = '';
var cantbus = 4;
var buscactual;
var diricono = '/mapa/img/buscador/';
var iconosb = new Array(cantbus);
var giro = new Array(6);
var om_buscador_v;
var om_buscador_top;
var modonuevo, dira, modonuevo;
var srx_old = srx;
var sry_old = sry;

function reinicializar (url) {
if (redimencionar_mapa()) setTimeout('reinicializar_t(\''+url+'\')', 1000);
}
function reinicializar_t (url) {
if (redimencionar_mapa()) location.href='index.php?'+url+'&'+admt();
}
function redimencionar_mapa () {
tammapa ();
if (srx == srx_old && sry == sry_old) return 0;
sepx = srx - srx_inicio;
sepy = sry - sry_inicio;
if (((sepx < 250) && (sepx > -250)) && ((sepy < 250) && (sepy > -250))) {
loc_ventana_x = 25;
loc_ventana_y = 112;
if (srx > 1100 && sry > 750) {
loc_ventana_y = 140;
}
ancho_ventana_c = 450;
alto_ventana_c = sry > 650 ? 460 : sry - 180;

inicio_s ();
cbuscar('3',cu,'');
conpestanacontenedora.style.top = sry -32;
} else
return 1;
}

function variables_tamano () {
tmb = {"dira":"imagen/Buscador/1024/","om_buscador_top":-90,"left":162,"d":[
{0:630,1:120}, /* 0: Imagen de fondo*/
{0:74,1:74,2:3,3:360,4:7}, /* 1: Imagenes de botones de buscar */
 {0:12,1:340,2:20,3:'FDAC26',4:'FF9C00',5:'color:black',6:30,7:15,8:50}, /* 2: formato cuadro de busqueda */
 {0:630,1:84,2:'pantalla.png'}, /* 3: Fondo del buscador */
 {0:257,1:33,2:15,3:10,4:'texto.calle.png'}, /* 4: texto de ayuda inicial para el buscador de calles*/
 {0:'texto.calle.png',1:'texto.negocio.png',2:'texto.acceso.png',3:257,4:33,5:293,6:33,7:335,8:33,9:'Buscador de calles o colonias, Escriba Calle, Colonia, Ciudad',10:''}, /* 5: Nombre de la imagen de los botones de buscar*/
 {0:0,1:158,2:'boton.ingresar.png',3:85,4:25}, /* 6: boton ingresar*/
 {0:160,1:127,2:'boton.accesos.png',3:85,4:25}, /* 7: boton ingresar*/
 {0:289,1:197,2:'boton.editar.png',3:85,4:25}, /* 8: boton ingresar*/
 {0:490,1:77,2:'boton.ocultar.png',3:85,4:25}, /* 9: boton ocultar */
 {0:180,1:80,2:75,3:300,4:74}, /* 10: controles laterales*/
 {0:'boton.+.png',1:'boton.-.png',2:'boton.cartelera.png',3:'boton.origen1.png',4:'boton.imprimir.png'}, /* 11: imagenes iconos laterales*/
 {0:160,1:77,2:'boton.terminar.png',3:85,4:25}, /* 12: boton ingresar*/
 {0:239,1:119,2:'boton.administracion.png',3:85,4:25}, /* 13: boton Administracion*/
 {0:5,1:5,2:152,3:52,4:'imagen/Buscador/1024/logo.llegale.nvo.150.gif'},/* 14 Especificaciones logotipo*/
 {0:'boton1a.png',1:'boton2a.png',2:'boton3a.png'} /* 15 imagenes botones de buscar */
]} ;
if (srx > 1100 && sry > 750) {
tmb = {"dira":"imagen/Buscador/","om_buscador_top":-115,"left":222,"d":[
{0:780,1:139}, /* 0: Imagen de fondo*/
{0:125,1:85,2:7,3:358,4:7}, /* 1: Imagenes de botones de buscar */
 {0:16,1:340,2:25,3:'FDAC26',4:'FF9C00',5:'color:black',6:30,7:15,8:60}, /* 2: formato cuadro de busqueda */
 {0:780,1:110,2:'buscador.llegalemapas.png'}, /* 3: Fondo del buscador */
 {0:345,1:45,2:15,3:10,4:'texto.calle.png'}, /* 4: texto de ayuda inicial para el buscador de calles*/
 {0:'texto.calle.png',1:'texto.negocio.png',2:'texto.acceso.png',3:345,4:45,5:345,6:45,7:345,8:45}, /* 5: Nombre de la imagen de los botones de buscar*/
 {0:0,1:204,2:'boton.ingresar.png',3:112,4: 29}, /* 6: boton ingresar*/
 {0:208,1:169,2:'boton.acceso.png',3:112,4: 29}, /* 7: boton ingresar*/
 {0:381,1:263,2:'boton.editar.png',3:112,4: 29}, /* 8: boton ingresar*/
 {0:646,1:102,2:'boton.ocultar.png',3:112,4: 29}, /* 9: boton ocultar */
 {0:150,1:80,2:75,3:300,4:74}, /* 10: controles laterales*/
 {0:'boton.+.png',1:'boton.-.png',2:'boton.cartelera.png',3:'boton.origen.png',4:'boton.imprimir.png'}, /* 11: imagenes iconos laterales*/
 {0:205,1:77,2:'boton.terminar.png',3:112,4:25}, /* 12: boton ingresar*/
 {0:284,1:119,2:'boton.administracion.png',3:112,4:25}, /* 13: boton Administracion*/
 {0:15,1:5,2:219,3:75,4:'img/logo.llegale.nvo.219.gif'}, /* 14 Especificaciones logotipo*/
{0:'boton1.png',1:'boton2.png',2:'boton3.png'} /* 15 imagenes botones de buscar */
]} ;
}
return tmb;
}
function cbuscar (v,cu1,b1) {

/* Nuevo Buscador */
tmb = variables_tamano();
modonuevo = 0;
om_buscador_v = 2;
om_buscador_top = tmb.om_buscador_top;
dira = tmb.dira;
bmaparstr = document.getElementById('bmapar');
bmaparstr.style.width=tmb.d[0][0];
bmaparstr.style.height=tmb.d[0][1];
bmaparstr.style.top=0;
bmaparstr.style.left=tmb.left;
/*bmaparstr.style.backgroundImage = 'url('+dira+'fondo.png)';*/
gi = document.getElementById('giros');
gi1 = document.getElementById('fondo_giros');
gi2 = document.getElementById('tache_giros');
bmaparstr.innerHTML = c_div('', pos+oveh+w1(tmb.d[3][0])+h1(tmb.d[3][1])+l1(0)+t1(0)+cur('default')+img_back(dira+tmb.d[3][2]),
/* Muestra el formulario del buscador*/
'<form action="'+jsv+'" name="bma">'
+c_div('', pos+w1(tmb.d[2][1])+h1(tmb.d[2][6])+l1(tmb.d[2][7])+t1(tmb.d[2][8]), chidden('l', 0)+
cInputn('b',b1,'b2', 'style="'+font(tmb.d[2][0])+w1(tmb.d[2][1])+h1(tmb.d[2][2])+bgcolor(tmb.d[2][3])+border(tmb.d[2][4])+tmb.d[2][2]+'"'))
+c_div('textobusqueda', pos+w1(tmb.d[4][0])+h1(tmb.d[4][1])+l1(tmb.d[4][2])+t1(tmb.d[4][3])+img_back(dira+tmb.d[4][4]))
+c_div('', pos+w1(tmb.d[1][0])+h1(tmb.d[1][1])+l1(tmb.d[1][3]+tmb.d[1][4])+t1(tmb.d[1][2])+cur('hand')
+img_back(dira+tmb.d[15][0]), '', 'fbuscar(bma.b.value, 1, bma.l.value);', textobusqueda_t(tmb.d[5][0],tmb.d[5][3],tmb.d[5][4]))
+c_div('', pos+w1(tmb.d[1][0])+h1(tmb.d[1][1])+l1(tmb.d[1][3]+tmb.d[1][0]+(tmb.d[1][4]*2))+t1(tmb.d[1][2])+cur('hand')
+img_back(dira+tmb.d[15][1]), '', 'fbuscar(bma.b.value, 3.5, bma.l.value);', textobusqueda_t(tmb.d[5][1],
tmb.d[5][5],tmb.d[5][6]))
+c_div('', pos+w1(tmb.d[1][0])+h1(tmb.d[1][1])+l1(tmb.d[1][3]+(tmb.d[1][0]*2)+(tmb.d[1][4]*3))+t1(tmb.d[1][2])+cur('hand')
+img_back(dira+tmb.d[15][2]), '','fbuscar(bma.b.value, 2, bma.l.value);', textobusqueda_t(tmb.d[5][2],tmb.d[5][7],tmb.d[5][8]))
+'</form>'
)
/* Muestra los botones de administracion*/
+(adminboton == 0 ?
/* Muestra los botones de ingreso de ficha, acceso usuarios, editar negocio*/
boton_img_r('tarjetasventa',6, 'ingresar()')
+boton_img_r('ingresou',7, 'ingresar()')
+boton_img_r('enb', 8, 'editar_negocio_basico()') :
/* Muestra los botones de terminar, administracion */
boton_img_r('tarjetasventa', 6, 'registro()')
+boton_img_r('ingresou', 12,'terminar()')
+boton_img_r('enb',13, 'adm_buscar_tarjetas(0)')
)
/* Muestra y oculta el buscador*/
+c_div('botonocultar', estiloboton_b(tmb.d[9][0], tmb.d[9][1], tmb.d[9][3], tmb.d[9][4])+img_back(dira+tmb.d[9][2]),'',
obus+'om_buscador()')
;
cntv = document.getElementById('controlesv');
lgp  = document.getElementById('logotipoubicacion');
cntv.style.top = (sry/2)-tmb.d[10][0];
cntv.style.left = srx-tmb.d[10][1];
cntv.style.width = tmb.d[10][2];
cntv.style.height = tmb.d[10][3];
tacer = tmb.d[10][4];
eimg = 'width='+tacer+' height='+tacer+' border=0';

lgp.style.top = tmb.d[14][0];
lgp.style.left = tmb.d[14][1];
lgp.style.width = tmb.d[14][2];
lgp.style.height = tmb.d[14][3];
lgp.style.backgroundImage = 'url('+tmb.d[14][4]+')';
/* Colocacion botones del lado derecho acercar, alejar, cartelera, etc */
cntv.innerHTML = c_div('i1', pos+t1(0)+l1(0)+w1(tacer)+h1(tacer)+cur('hand')+img_back(dira+tmb.d[11][0]), '', 'acercar()')
+c_div('', pos+t1(tacer)+l1(0)+w1(tacer)+h1(tacer)+cur('hand')+img_back(dira+tmb.d[11][1]), '', 'alejar()')
+c_div('', pos+t1(tacer*2)+l1(0)+w1(tacer)+h1(tacer)+cur('hand')+img_back(dira+tmb.d[11][2]), '', 'fbuscar(\'\', 3.5,\'Cartelera de cine\');')
+c_div('', pos+t1(tacer*3)+l1(0)+w1(tacer)+h1(tacer)+cur('hand')+img_back(dira+tmb.d[11][3]), '', 'aquiestoy()')
+c_div('', pos+t1(tacer*4)+l1(0)+w1(tacer)+h1(tacer)+cur('hand')+img_back(dira+tmb.d[11][4]), '', 'mprint();');
modonuevo = 1;

}
function publicidad_inicial () {
posmuestraobj(loc_ventana_y,loc_ventana_x, 380, 400, colortitulo, 'solid', '1px', colorpes2,
img_anuncio('impresos.llegale.jpg', 'buscarlugar_basico()')+c_div('', pos+t1(190)+l1(170)+w1(180)+h1(50)+cur('hand'), '', 'n_ventana1(\'1\')'));
}
function boton_img_r(n, i, j) {
return c_div(n, estiloboton_b(tmb.d[i][0], tmb.d[i][1], tmb.d[i][3], tmb.d[i][4])+img_back(dira+tmb.d[i][2]),'', obus+j );
}
function textobusqueda_t (t,w,h) {
return 'onmousemove="textobusqueda_c(\''+t+'\','+w+','+h+')"';
}
function textobusqueda_c (png,w,h) {
tbq = document.getElementById('textobusqueda');
tbq.style.backgroundImage = 'url('+dira+png+')';
tbq.style.width = w;
tbq.style.height = h;
}
function estiloboton_b (l,w,t,h) {
return cur('hand')+pos+oveh+co(colorpeshf)+t1(t)+vis(1)+h1(h)+l1(l)+zi(999)+w1(w);
}
function om_buscador() {
if (om_buscador_v == 2)
ocultar_buscador_c(0);
else
mostrar_buscador (om_buscador_top);
}
function ocultar_buscador_c (t) {
if (t == om_buscador_top) {
om_buscador_v = 1;
botonocultar.style.backgroundImage = 'url('+dira+'boton.abrir.png)';
return 0;
}
bmaparstr.style.top=t;
setTimeout('ocultar_buscador_c('+(t-5)+')', 50);
}
function mostrar_buscador (t) {
if (t == 0) {
om_buscador_v = 2;
botonocultar.style.backgroundImage = 'url('+dira+'boton.ocultar.png)';
return 0;
}
bmaparstr.style.top=t;
setTimeout('mostrar_buscador('+(t+5)+')', 50);
}

function redim_cbuscar (bmaparstr, width, height, fontSize, borderColor, borderStyle, borderWidth, backgroundColor,fc) {

bmaparstr.style.width=width;
bmaparstr.style.height=height;
bmaparstr.style.fontSize=fontSize;
bmaparstr.style.borderColor=borderColor;
bmaparstr.style.borderStyle=borderStyle;
bmaparstr.style.borderWidth=borderWidth;
bmaparstr.style.backgroundColor=backgroundColor;
bmaparstr.style.color=fc;

}lint = 'style="'+linbott(colorpes3,'solid',1)+font(10)+'"';
sth = pos+t1(0)+h1(22)+bgcolor(colorpes1)+fonf('sans-serif');
sth1 = bgcolor(colorpes1)+fonf('sans-serif')+font(14);
std = pos+fonf('sans-serif')+font(10);
cons = 0;
teltabla = 'style="'+bgcolor(colorpes2)+fonf('sans-serif')+font(10)+'"';
function errorimgnc() {
return tabla(cent(bo('El texto que escribio no coincide con el de la imagen con letras que aparece a un lado del boton Enviar')),'');
}
function errorbusqueda (t1,n,t,p,v) {
return tabla(cent(bo('Este servicio esta limitado 1 consulta por ip cada '+t1+' segundos')+'<br>'+ahref('realizar_tel_busqueda (\''+n+'\',\''+t+'\',\''+p+'\',\''+v+'\')','actualizar')),'');
}
function m_nombre (nombre, direc, cp, tel) {
return tr('<td width=75% '+lint+'><b><em>'+ nombre +'</em></b><br>'+ahref('fbuscar(\''+direc+'\',1,\'\',\''+cu+'\')',direc)+tipo('C.P.', cp) +'</td><td width=25% '+lint+'> '+tel+'</td>');
}
function tipo (modo, txt) {return txt ? ', '+modo+': '+txt : '';}
function titulo (txt) {
busc.style.height = sry*0.6;
return it('100%', teltabla) +tr('<td colspan=2 style="'+sth1+'" align=center>'+txt+'</td>');
}
function tabla(titulo_txt, contenido) {
return titulo(titulo_txt)+contenido+dt;
}
function mostrar_buscador_tel () {
busc.style.visibility = 'visible';
busc.innerHTML = formulario_telefono('','','','','');
}
function realizar_tel_busqueda (n,t,pag,v) {
idhtml = document.getElementById('cont_telefonos');
if (t || n) {
buscadores = 1;
cons = cons + 1;
makeRequest('telefono/buscar_tel_beta.php?n='+n+'&t='+t+'&pag='+(pag ? pag :0)+'&v='+v+'&cons='+cons,recepcion_datos);
idhtml.innerHTML = carg+'Cargando...';
urchinTracker('buscador_telefonos'+(n ? '/'+n : '')+(t ? '/'+t : ''));
} else
idhtml.innerHTML = tabla('Nada que buscar','');
}
function o_buscador_tel(){busc.style.visibility='hidden';busc.innerHTML = '';}
function pag_sig_b (n,t,pag,m,v) {
return c_div('', cur('hand')+w1(111)+h1(14), m == 1 ? '<img src=img/boton.1.png>' : '<img src=img/boton.2.png>','realizar_tel_busqueda(\''+n+'\',\''+t+'\',\''+pag+'\',\''+v+'\')', 'align=left');
}
function pag_sig (id,p,t) {
return c_div('', cur('hand')+font(12)+bgcolor(colorpes2)+w1(100), t == 1 ? '<img src=img/boton.1.png>' : '<img src=img/boton.2.png>','cambiar_contenido('+id+',2,this,'+p+')', 'align=left');
}
function bdt () {
mostrar_buscador_tel();
idhtml = document.getElementById('cont_telefonos');
idhtml.innerHTML = carg+'Cargando...';

}
function busqueda_directa (titulo,contenido) {
idhtml = document.getElementById('cont_telefonos');
idhtml.innerHTML = tabla(titulo,contenido);
}
function formulario_telefono (d1, d2, d3, d4, d5) {
mod_buscador (30,85,510,100);
return '<form action="'+jsv+'">'
+c_div('','',c_div('', sth+font(14)+w1('90%')+l1(0), 'Buscador de Tel&eacute;fonos')+c_div('',sth+font(14)+w1('10%')+l1('90%'), vcerr, 'o_buscador_tel()','align="center"'))
+c_div('', t1(25)+w1('100%')+std, c_div('', t1(0)+w1('100%')+std,'Nombre y/o direcci&#243;n: '+cInputn('n', d2, '', 'size="45"'))
+c_div('',t1(25)+w1('100%')+std, '<table style="'+font(10)+'" border=0 cellpading=0 cellspacing=0><tr><td>Tel&eacute;fono con<br>clave lada:</td><td>'+cInputn('t', d1, '', 'size="10" maxlength="10"') +'</td>'
+'<td>Escriba el texto que aparece<br>a continuacion:</td><td><img src="hc/image.php?'+admt()+'"></td><td>'+cInputn('v', '', '', 'size="7" maxlength="10"')
+'</td><td><input type="submit" name="e" value="Enviar" onclick="realizar_tel_busqueda(n.value, t.value, 0, v.value);"></td></tr></table>'))
+'</form>'
+c_div('cont_telefonos', ovea+std+t1(75)+w1('100%')+h1((sry*0.6)-80));
}
var r, mbuscador;
oweb = 'o_buscador_web();';
function o_buscador_web(){
busc.style.visibility='hidden';
busc.innerHTML = '';
}
qr = '';
pagv= 20;
e = 0;
function mostrar_imagenes (url, w,h) {
busc_img.style.top = 100;
busc_img.style.left = 150;
busc_img.style.width = srx * 0.8;
busc_img.style.height = sry * 0.8;
busc_img.style.overflow = 'auto';
busc_img.style.position = 'absolute';
busc_img.style.visibility='visible';
busc_img.innerHTML = c_div('',pos+oveh+t1(0)+l1(0)+h1(20)+w1('100%'),
c_div('', sth+font(14)+w1('90%')+l1(0), 'Imagen completa')
+c_div('',sth+font(14)+w1('10%')+l1('90%'), vcerr, 'o_buscador_img()','align="center"'))
+c_div('', pos+l1(0)+t1(20), '<img src="'+url+'" width="'+w+'" height="'+h+'">');
}

function o_buscador_img(){
busc_img.style.visibility='hidden';
busc_img.innerHTML = '';
}
var detalles_calle_txt;
var colortn = colorpes2;
var colortf = colorpes7;
var colortfn = '000000';
var titulo_ciudad, detalles_g;
locc = 0;
idciudad =0;
var nombre_ciudad;
var ventana_reducida = 0;
var fuenteinegi = td2('Fuente: <a href="http://www.inegi.gob.mx" target="_inegi">www.inegi.gob.mx</a>');
var ayudaciudad1 = 'Detalles_ciudades';
function detalles_ciudad (obj) {
ocultar_buscador();
nombre_ciudad = obj[0].localidad;
titulo_ciudad = '<table>';
detalles_g = td(dlugar_detalles_ciudad_1,nombre_ciudad)
+td(dlugar_detalles_ciudad_2, obj[0].Entidad_federativa)
+td(dlugar_detalles_ciudad_3, obj[0].municipio)
+td(dlugar_detalles_ciudad_4, obj[0].habitantes)
+td(dlugar_detalles_ciudad_5, obj[0].total_viviendas)
+td(dlugar_detalles_ciudad_6, obj[0].hombres)
+td(dlugar_detalles_ciudad_7, obj[0].mujeres)
+td(dlugar_detalles_ciudad_8, obj[0].activos)
+td(dlugar_detalles_ciudad_9, obj[0].inactivos)
+td(dlugar_detalles_ciudad_10, obj[0].qannos)
+td(dlugar_detalles_ciudad_11, obj[0].x[0]+'&#176; '+obj[0].x[1]+'&#039; '+obj[0].x[2]+'&#168;')
+td(dlugar_detalles_ciudad_12, obj[0].y[0]+'&#176; '+obj[0].y[1]+'&#039; '+obj[0].y[2]+'&#168;')
+td(dlugar_detalles_ciudad_13, obj[0].altura+' metros')
+td(dlugar_detalles_ciudad_14, '<a href="http://cd-'+obj[0].idl+'.llegalemapas.com/">http://cd-'+obj[0].idl+'.llegalemapas.com/</a>')
+ td(dlugar_detalles_ciudad_5, '<a href="http://www.inegi.gob.mx" target="_inegi">www.inegi.gob.mx</a><br><br>')
/*+td('Localizar centro:', c_div('', '', 'Marcar Lugar', 'locc=1;idciudad='+obj[0].clave))*/
+(obj[0].cx ? td2(c_div('', bgcolor(colorpes1)+w1(448)+h1(20),
c_div('',pos+l1(300)+w1(149)+h1(20),'<img src="img/zoom.1.gif">')
+ c_div('',pos+l1(389)+w1('19px')+h1('20px')+cur('hand')+ovea,'<img src="img/zoom.2.gif">', 'ir_a('+((obj[0].cx*1000)+1250)+','+((obj[0].cy*1000)-1250)+',4)')
+ c_div('',pos+l1(409)+w1(17)+h1(20)+cur('hand')+ovea,'<img src="img/zoom.3.gif">', 'ir_a('+((obj[0].cx*250)-500)+','+((obj[0].cy*250)-250)+')')
+ c_div('',pos+l1(429)+w1(17)+h1(20)+cur('hand')+ovea,'<img src="img/zoom.4.gif">', 'ir_a('+((obj[0].cx*62.5)-500)+','+((obj[0].cy*62.5)+250)+',8)')
)) : '')
;
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,
it('100%', font(12))
+pestanas(obj[0].clave,1)
+detalles_g
+dt
);
ventana_reducida = 0;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,0,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0,
ayudaciudad1,dlugar_detalles_ciudad_16+nombre_ciudad,'+','crecer_ventana(350,0)',dlugar_detalles_ciudad_17);
urchinTracker('/ciudad/inicio/'+obj[0].clave);
}

function c_pest_h (id, t) {
makeRequest('inegi/detalles.php?id='+id+'&t='+t, adm_tarjeta_xml);
buscando (id,t);
}
function wikipedia (id,m,t) {
makeRequest('php/wiki.php?id='+id+'&m='+m, adm_tarjeta_xml);
buscando (id,t);
}
function buscando (id,t) {
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,it('100%', font(12))+titulo_ciudad+pestanas(id,t)+td2(carg+'Espere un momento, realizando la busqueda')+dt);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,40,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, ayudaciudad1,'Ciudad:'+nombre_ciudad);
}
var sm1 = bgcolor(colorpes1)+co(colortf);
var sm2 = bgcolor(colortn)+co(colortfn);
function pestanas (id, s) {
style = pos+l1(0)+t1(0)+w1(75)+h1(15)+font(14)+cur('hand');
return td2(c_div('',style+l1(0)+(s == 1 ? sm2 : sm1),'General','d_detalles('+id+')',' align=center')
+c_div('',style+l1(75)+(s == 2 ? sm2 : sm1),'Historia','c_pest_h('+id+', 2)',' align=center')
+c_div('',style+l1(150)+(s == 3 ? sm2 : sm1),'Censos','c_pest_h('+id+', 3)',' align=center')
+c_div('',style+l1(225)+(s == 4 ? sm2 : sm1),'Wikipedia','wikipedia('+id+',1, 4)',' align=center')
+c_div('',style+l1(300)+(s == 5 ? sm2 : sm1),'Estado','wikipedia('+id+',2, 5)',' align=center')
+'<br>');
}
function d_detalles (id) {
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,it('100%', font(12))+titulo_ciudad+pestanas(id,1)+detalles_g+dt,'',' onmousemove="click1 = false;"');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,350,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, ayudaciudad1,'Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
}
function d_wiki (id,txt,tm) {
wiki = td2(c_div('wiki', pos+ovea+t1(33)+l1(0)+w1(450)+h1(317), txt));
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,it('100%', font(12))+titulo_ciudad+pestanas(id,tm)+wiki+dt,'',' onmousemove="click1 = false;"');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,350,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, ayudaciudad1,'Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
contentSub.innerHTML = '';
jtn = document.getElementById('jump-to-nav');
jtn.innerHTML = '';
urchinTracker('/ciudad/wikipeida/'+obj.id);
}
function d_historia (obj) {
historia = '';
for (i = 0; i < obj.cantidad; i++) {
historia += (obj.historia[i].a > 0 ? td(bo(obj.historia[i].a), obj.historia[i].e) : td2(obj.historia[i].e))+td2('<hr>');
}
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,it('100%', font(12))+titulo_ciudad+pestanas(obj.id,2)+historia+ fuenteinegi +dt,'',' onmousemove="click1 = false;"');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,350,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, ayudaciudad1,'Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
urchinTracker('/ciudad/historia/'+obj.id);
}
function d_censo (obj) {
censo = '<table width=430 style="'+font(12)+'">'
+tr(ths('Censos realizados', '','','colspan="4"'))
+tr(ths('A&ntilde;o')+ths('Habitantes')+ths('Hombres')+ths('Mujeres</th>'));
for (i = 0; i < obj.censo.cantidad; i++) {
censo += tr(tds(obj.censo.resultados[i].a)+tds(obj.censo.resultados[i].habitantes)+tds(obj.censo.resultados[i].hombres)+tds(obj.censo.resultados[i].mujeres))
+tr(ths('<hr>', '','','colspan="5"'));
}
censo +=dt;
localidad = it(430,'style="'+font(12)+'"')
+tr(ths('Detalles de la localidad', '','','colspan="4"'))
+tr(ths('localidad')+ths('municipio')+ths('categoria')+ths('Detalles del lugar'));
for (i = 0; i < obj.localidad.cantidad; i++) {
localidad += tr(tds(obj.localidad.resultados[i].localidad)
+tds(obj.localidad.resultados[i].municipio)
+tds(obj.localidad.resultados[i].categoria)
+tds(obj.localidad.resultados[i].modificacion+'<br>'+obj.localidad.resultados[i].extra))
+tr(ths('<hr>', '','','colspan="5"'));
}
localidad +=dt;
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(350)+ovea,it('100%', font(12))+titulo_ciudad+pestanas(obj.id,3)+td2(it('100%')+td2(censo)+td2(localidad)+dt)+fuenteinegi
+dt,'',' onmousemove="click1=false;"');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,350,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, ayudaciudad1,'Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
urchinTracker('/ciudad/censos/'+obj.id);
}

function detalles_racho (obj) {
ocultar_buscador();
detalles_calle_txt = c_div('', pos+t1(0)+w1(450)+h1(400)+ovea,
it('100%', font(12))
+titulo_bobj(it('100%', font(12))+th(obj[0].rancho,c_div('','',bo('[ + ]'), 'agrandar_dcalle()')) +dt,colorpes1,colortf)
+td('Ciudad:', obj[0].ciudad)
+td('Municipio:', obj[0].municipio)
+td('Localidad rural:', bo(obj[0].rancho))
+(obj[0].habitantes != 0 ? td('Personas que habitan aqu&iacute;:', obj[0].habitantes) : '')
+(obj[0].total_viviendas != 0 ? td('Numero de casas:', obj[0].total_viviendas) : '')
+(obj[0].hombres != 0 ? td('Hombres:', obj[0].hombres) : '')
+(obj[0].mujeres != 0 ? td('Mujeres:', obj[0].mujeres) : '')
+(obj[0].activos != 0 ? td('Personas economicamente activas:', obj[0].activos) : '')
+(obj[0].inactivos != 0 ? td('Personas inactivas:', obj[0].inactivos) : '')
+(obj[0].qannos != 0 ? td('Personas Mayores de 15 a&#241;os:', obj[0].qannos) : '')
+dt,'',' onmousemove="click1 = false;"'
);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,350,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh, 0, 0, 'Detalles_rancho','Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
urchinTracker('rancho/'+EscalaMapa);
}
function formulariow (id) {}
function d_trallecto (x2, y2, obj,editar) {
ocultar_buscador();
calles = '';
hr = '';
colordn = '';
for (var i = 0; i < obj.cantidad; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png');bgcolor('FEE0A7');
calles += td2(c_div('',w1(440)+colordn+border('black', 'solid', 1),it()+td(c_div('', w1(50)+h1(40)+bgcolor(obj.detalles[i].color)+oveh,'&nbsp;')
/*+cent(bo('<a href="javascript:Inicio_Ruta('+obj.detalles[i].id+');">inicio</a>'+(rutai ? '<br><a href="javascript:Fin_ruta('+obj.detalles[i].id+');">Fin</a>' : '')))*/,
(obj.detalles[i].idmodo ? c_div('', cur('hand'), '<u>'+bo(obj.detalles[i].calle)+'</u><br>'+obj.detalles[i].ciudad
+'<br><img src="imagen/calles/botone.calles.colonia.png" border=0>', 'buscar_calles_colonia('+obj.detalles[i].id+')')
/*Muestra la ciudad y la esquina de la calle*/
: bo(obj.detalles[i].calle) +'<br>'+obj.detalles[i].ciudad
+ '<br><a href="'+jsv+'" onclick="buscar_esquina('+obj.detalles[i].id+');"><img src="imagen/calles/botones.esquinas.png" border=0></a>')
/*Muestra el tamaño de la calle*/
+(obj.detalles[i].tamano ? '<br>Tama&ntilde;o de la calle: '+obj.detalles[i].tamano : '')
/*edita la calle actual*/
+(editar ? ' | <b><a href="'+jsv+'" onclick="editar_calle(\''+obj.detalles[i].id+'\',\''+obj.detalles[i].calle+'\',\''+obj.detalles[i].colonia+'\')">Editar</a></b>'
+ ' | <b><a href="calle/nuevacalle.php?d1='+obj.detalles[i].ciudad+'&d2='+obj.detalles[i].estado+'&d3='+obj.detalles[i].municipio+'&d4='+obj.detalles[i].colonia+'" target="_ncalle">Nueva calle</a></b>'
+ ' | <b><a href="'+jsv+'" onclick="eliminar_calle(\''+obj.detalles[i].id+'\')">Eliminar</a></b>' : ''))+dt));
hr = td2('<hr>');
}
detalles_calle_txt = c_div('', pos+t1(0)+w1(430), it('100%', font(12))+td(obj.patrocinio ? asignado(obj.patrocinio) : '', it('100%')+calles+dt)+dt,'','','trallcv');
tm = ((obj.cantidad*69) > (sry-200) ? sry-200 : obj.cantidad*69)+20;
posmuestraobj(loc_ventana_y,x2,450, tm,colorpes5,'solid','1px',colorpes6, detalles_calle_txt, ovea, 0, 0, 'Detalle_de_las_calles', 'Calles localizadas');
}
function buscar_esquina (id) {
makeRequest('php/calle/esquina.php?id='+id, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,100,colorpes5,'solid','1px',colorpes6, td2(cent(carg+'Espere un momento, Buscando calles.....'))+dt, ovea, 0, 0,
'Lista de calles que tocan esta calle', 'Buscando calles');
}
function resultado_esquina (obj) {
obj_calle_array = obj;
html = '';
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png');
html += tr(
tds(ahref('ubicar_esquina('+obj.d[i].x+','+obj.d[i].y+','+obj.d[i].x1+','+obj.d[i].y1+')', ftt(obj.d[i].n, 12), 'Muestra las esquinas de esta calle'), 277, colordn)
+tds(ahref('ubicar_esquina('+obj.d[i].x+','+obj.d[i].y+','+obj.d[i].x1+','+obj.d[i].y1+')', ftt('<img src="imagen/calles/boton.ubicar.esquina.png" border=0>', 14), 'Ubica la esquina en el mapa'), 85, colordn)
+tds('<a href="'+jsv+'" onclick="buscar_esquina('+obj.d[i].id+');"><img src="imagen/calles/botones.esquinas.png" border=0></a>', 78, colordn));
}
tyesquina = obj.c*22 + 50;
if (tyesquina > sry -220) tyesquina = sry-220;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,tyesquina,colorpes5,'solid','1px',colorpes6, cent('<font size=+1>Esta calle hace esquina con:</font>')+'<br>'+tc(html, w1(440)), ovea, 0, 0, 'Buscador de esquinas',  'Calle: '+obj.calle);
urchinTracker('/ListaEsquinas/'+obj.urch);
}
function ubicar_esquina (x, y, x1, y1) {
ir_a(x, y, 4);
var g = new jsGraphics(iniciopoligono ());
g.setColor('Blue');
g.fillEllipse(x1-10,y1-10,20,20);
g.setColor('Red');
g.fillEllipse(x1-5,y1-5,10,10);
g.paint();
resultado_esquina(obj_calle_array);
}
function resultado_esquina_error (obj) {
posmuestraobj(loc_ventana_y,loc_ventana_x,450,300,colorpes5,'solid','1px',colorpes6, '<br><ul><li>No se han localizado calles</li></ul>', ovea, 0, 0, 'Buscador de esquinas', 'Buscador de esquinas ');
}
function buscar_calles_colonia (id) {
makeRequest('php/calle/colonia.php?id='+id, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,100,colorpes5,'solid','1px',colorpes6, td2(cent(carg+'Espere un momento, Buscando calles.....'))+dt, ovea, 0, 0,
'Lista de calles en la colonia', 'Buscando calles en esta colonia');
}
function lista_calles_colonia (obj) {
t = '<table style="'+font(12)+w1('100%')+'">';
colordn = '';
for (i = 0; i < obj.c; i++) {
if (obj.datos[i].c.c) {
txtx = '';
txty = '';
coma = '';
if (obj.datos[i].c.c == 1) {
txt = 'var g = new jsGraphics(iniciopoligono ());g.setColor(\''+obj.color+'\');g.fillEllipse('+obj.datos[i].c.d[0].x1+','+obj.datos[i].c.d[0].y1+',10,10);g.paint();';
} else {
for (xy = 0; xy < obj.datos[i].c.c; xy++) {
txtx += coma+(obj.datos[i].c.d[xy].x1 ? obj.datos[i].c.d[xy].x1 : obj.datos[i].c.d[xy][0]);
txty += coma+(obj.datos[i].c.d[xy].y1 ? obj.datos[i].c.d[xy].y1 : obj.datos[i].c.d[xy][1]) ;
coma = ',';
}
txt = 'var g = new jsGraphics(iniciopoligono ());g.setStroke(4);g.setColor(\''+obj.color+'\');var Xpoints = new Array('+txtx+');var Ypoints = new Array('+txty+');g.drawPolyline(Xpoints,Ypoints);g.paint();';
}
} else {
txt = '';
}
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png');
t += tr(tds(c_div('',cur('hand'),obj.datos[i].i,'ir_a('+obj.datos[i].x+','+obj.datos[i].y+',4);'+txt), 0, colordn)
+tds(ahref('ir_a('+obj.datos[i].x+','+obj.datos[i].y+',4);'+txt,'<img src="imagen/botones/boton.ver.calle.png" border=0>'), 0, colordn));
}
t += dt;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,300,colorpes5,'solid','1px',colorpes6, t, ovea, 0, 0, 'Lista de calles en la colonia', 'Calles localizadas en esta colonia');
urchinTracker('/ListaColonias');
}
function eliminar_calle (id) {
makeRequest('calle/eliminar_calle.php?id='+id, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, ecalle (d1,d2,d3)+ td2(cent(carg+'Espere un momento.....'))+dt, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
}
function nueva_ruta_calle (ciudad,estado,municipio,colonia) {
badm = cbotton('enviar','Guardar', 'guardarnuevacalle(d1.value,d2.value,d3.value,d4.value,d5.value,d6.value);');
txt = it('95%')+ formarchivo('calle/nuevacalle.php')
+ td('Calle:', cInput('d1',''))
+ td('Colonia:', cInput('d2',colonia))
+ td('Estado:', cInput('d3',estado))
+ td('municipio:', cInput('d4',municipio))
+ td('ciudad:', cInput('d5',ciudad))
+ td('Archivo: ', cfile('file'))
+ td2(cent(cenviar('Guardar')))
+ '</form>'+dt;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, txt, ovea, 0, 0, 'Editar_Calles', 'Nueva Calle');
}
function puntoxy_calle (x,y) {
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, x+','+y, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
}
function guardarnuevacalle (d1,d2,d3,d4,d5,d6) {
txt = 'd1='+d1+'&d2='+d2+'&d3='+d3+'&d4='+d4+'&d5='+d5+'&d6='+d6;
makeRequest('calle/nuevacalle.php?'+txt, adm_tarjeta_xml);
}
function guardareditarcalle (d1,d2,d3) {
makeRequest('calle/editar.php?d1='+d1+'&d2='+d2+'&d3='+d3, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, ecalle (d1,d2,d3)+ td2(cent(carg+'Espere un momento Guardando.....'))+dt, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
}
function fineditarcalle (d1,d2,d3) {
makeRequest('calle/editar.php?d1='+d1+'&d2='+d2+'&d3='+d3, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, ecalle (d1,d2,d3)+ td2(cent('Calle guardada con exito'))+dt, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
}
function errorditarcalle (d1,d2,d3,e) {
makeRequest('calle/editar.php?d1='+d1+'&d2='+d2+'&d3='+d3, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, ecalle (d1,d2,d3)+ td2(cent(e))+dt, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
}
function editar_calle (id,txt,colonia) {
badm = cbotton('enviar','Guardar', 'guardareditarcalle(d1.value,d2.value,d3.value);');
ed = 0;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,210,colorpes5,'solid','1px',colorpes6, ecalle (txt,colonia,id)+dt, ovea, 0, 0, 'Editar_Calles', 'Editar Calles');
urchinTracker('/editar/calle');
}
function ecalle (d1,d2,d3) {
return it('95%')+ formulario('','','')+ td('Nombre:', cInput('d1',d1)+chidden('d3', d3))+ td('Colonia:', cInput('d2',d2))+ td2(c_div('gpinfo','',cent(badm)))+ '</form>';
}
var rutai;
function Inicio_Ruta (i) {rutai = i;}
function Fin_ruta (i) {
ocultar_buscador();
detalles_calle_txt = c_div('', pos+t1(0)+w1(430)+h1(400)+ovea,
it('100%', font(12))+titulo_bobj(it('100%', font(12))+th('Dise&ntilde;ando Ruta',c_div('','',bo('[ X ]'), 'ocultarobj()'))+dt, colorpes1)+td(carg+'Creando Ruta')+dt,'','','trallcv');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,180,colorpes5,'solid','1px',colorpes6, detalles_calle_txt);
makeRequest('php/ruta/auto/?i='+rutai+'&f='+i, adm_tarjeta_xml);
}
function disenarruta (obj) {
ocultar_buscador();
rutatxt = '<ul>';
for (i = 0; i < obj.c; i++) {
rutatxt += '<li>'+obj.d[i][4]+'</li>';
}
rutatxt += '</ul>';
detalles_calle_txt = c_div('', pos+t1(0)+w1(430)+h1(400)+ovea,
it('100%', font(12))+titulo_bobj(it('100%', font(12))+th('Ruta localizada',c_div('','',bo('[ X ]'), 'ocultarobj()'))+dt, colorpes1)+td(rutatxt)+dt,'','','trallcv');
posmuestraobj(loc_ventana_y,loc_ventana_x,450,180,colorpes5,'solid','1px',colorpes6, detalles_calle_txt);
}

function mostrar_calles (obj) {
var calleid = document.getElementById(obj.idimagen);
puntos = '';
for (i = 0; i < obj.calles.cantidad; i++) {
if (!i) {
puntos += c_div('', pos+t1(obj.calles[i].y)+l1(obj.calles[i].x)+border('ff0000','solid', '1')+ovea,obj.calles[i].nombre);
} else {
puntos += c_div('', pos+t1(obj.calles[i].y)+l1(obj.calles[i].x)+h1(2)+w1(2)+border('ff0000','solid', '1')+oveh,'', '', ' title="'+obj.calles[i].nombre+'" ');
}
}
calleid.innerHTML = obj.sql+puntos;
}
var tabla_i=new Array();
tabla_i={
1:{
00:6,06:6,17:6,23:6,28:6,34:6,     45:6,51:6,56:6,62:6,     73:6,79:6,84:6,90:6,
01:0,07:0,12:0,18:0,29:0,35:0,40:0,46:0,     57:0,63:0,68:0,74:0,     85:0,91:0,96:0,
02:1,     13:1,19:1,24:1,30:1,41:1,47:1,52:1,58:1,     69:1,75:1,80:1,86:1,     97:1,
03:2,08:2,14:2,     25:2,31:2,36:2,42:2,53:2,59:2,64:2,70:2,     81:2,87:2,92:2,98:2,
     09:3,15:3,20:3,26:3,     37:3,43:3,48:3,54:3,65:3,71:3,76:3,82:3,     93:3,99:3,
04:4,10:4,     21:4,27:4,32:4,38:4,     49:4,55:4,60:4,66:4,77:4,83:4,88:4,94:4,
05:5,11:5,16:5,22:5,     33:5,39:5,44:5,50:5,     61:5,67:5,72:5,78:5,89:5,95:5},
2:{00:0,01:6,02:5,03:4,04:3,05:2,06:1,07:0,08:6,09:5,10:4,11:3,12:2,13:1,14:0,15:4,16:2,17:0,18:5,19:3,20:2,21:6},
'meses':{1:"Enero",2:"Febrero",3:"Marzo",4:"Abril",5:"Mayo",6:"Junio",7:"Julio",8:"Agosto",9:"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"},
'dias':{1:"Lun",2:"Mar",3:"Mie",4:"Jue",5:"Vie",6:"Sab",0:"Dom"}};

fecha = new Date();
var tabla_ishift=new Array();
var year, month;
function inicializar () {
if(fecha.getFullYear){
year = fecha.getFullYear();
}else{
year = fecha.getYear()+1900;
}
month= fecha.getMonth()+1;
}

var theStatus = new Object();
function step_i(Year){
var Century=Math.floor(Year/100);
var Decade=Year-(Century*100);
var TABLA_I=tabla_i[1][Decade];
return ((TABLA_I+tabla_i[2][Century]) % 7);
}
function step_ii(Year,Month){
var step1=step_i(Year);
var CATEGORIA;
var b=bisiesto(Year);
switch (Month){
case 1:
if(b){CATEGORIA=6;}
else{CATEGORIA=0;}
break;
case 2:
if(b){CATEGORIA=5;}
else{CATEGORIA=4;}
break;
case 4:
case 7:
CATEGORIA=6;
break;
case 5:
CATEGORIA=1;
break;
case 6:
CATEGORIA=4;
break;
case 8:
CATEGORIA=2;
break;
case 10:
CATEGORIA=0;
break;
case 12:
case 9:
CATEGORIA=5;
break;
default:
CATEGORIA=3;

}
return ((CATEGORIA+step1) % 7);
}
function step_iii(Year,Month,Day){
var step2=step_ii(Year,Month);
Day=(Day % 7);
return step3=((Day+5+step2) % 7);
}

function bisiesto(Year){
var b=false;
if((Year % 4)==0){b=true;}
if((Year % 100)==0){b=false;}
if((Year % 400)==0){b=true;}
return b;
}

function daysOfMonth(Month,Year){
switch (Month){
case 4:
case 6:
case 9:
case 11:
return 30;
break;
case 2:
if (bisiesto(Year)){return 29;}else{return 28;}
break;
default:
return 31;

}
}

function doHide(id,fl){
layer = document.getElementById(id);
if (layer) layer.innerHTML='';
}
inicializar ();
function doShow(id,fl,idl,t,i){
if (month<1){month=12;year-=1;}
if (month>12){month=1;year+=1;}
if (year>2099){year=2099;month=12;}
if (year<2007){year=2007;month=1;}
layer = document.getElementById(id);
layer.innerHTML='';
var innerTMP='';
var MonthNum;
var DayNum;
var DayOfWeek=step_iii(year,month,1);
var funci = "doShow('"+id+"','"+fl+"','"+idl+"','"+t+"',0);";
innerTMP+=it('100%')
+tr(tds(it('100%')
+tr(tds(ahref('year-=1;'+funci, '<<','14%', '', 'align="center"'))
+tds(ahref('month-=1;'+funci,'<'),'14%', '', 'align="center"')
+tds(h(year + " - " + tabla_i.meses[month],4),'44%', '', 'align="center"')
+tds(ahref('month+=1;'+funci,'>'),'14%', '', 'align="center"')
+tds(ahref('year+=1;'+funci, '>>','14%', '', 'align="center"')))+dt))
+'<tr><td>'+it('100%')
+'<tr>';
var MaxDays=daysOfMonth(month,year);
for(dow=0;dow<7;dow++){
innerTMP+=tds(h(tabla_i.dias[dow],4), '14px', '', ' align="center"');
}
innerTMP+='</tr>';
var SDraw=false;
if(month>9){MonthNum=''+month;}else{MonthNum='0'+month;}
for(var day_c=1;day_c<=36;){
innerTMP+='<tr>';
for(var dow=0;dow<7;dow++){
if(dow==DayOfWeek){SDraw=true;}
if(day_c>9){
DayNum=''+day_c;
} else{
DayNum='0'+day_c;
}
innerTMP+='<td align="center" width="14%">';
if((day_c<=MaxDays) && SDraw){
innerTMP+=ahref(fl+"('"+year+"','"+MonthNum+"','"+DayNum+"','"+idl+"','"+t+"');doHide('"+id+"','"+fl+"')", day_c++);
} else if(SDraw){
day_c++;innerTMP+=" ";
}
innerTMP+='</td>';
}
innerTMP+='</tr>';
}
innerTMP+='</td></tr>'+dt;
layer.innerHTML=innerTMP;
}
/* Inicio dibujo de lineas*/
var jg_ok, jg_ie, jg_fast, jg_dom, jg_moz;
function chkDHTM(x, i) {
x = document.body || null;
jg_ie = x && typeof x.insertAdjacentHTML != "undefined" && document.createElement;
jg_dom = (x && !jg_ie &&
typeof x.appendChild != "undefined" &&
typeof document.createRange != "undefined" &&
typeof (i = document.createRange()).setStartBefore != "undefined" &&
typeof i.createContextualFragment != "undefined");
jg_fast = jg_ie && document.all && !window.opera;
jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined";
jg_ok = !!(jg_ie || jg_dom);
}

function pntCnvDom()
{
var x = this.wnd.document.createRange();
x.setStartBefore(this.cnv);
x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm);
if(this.cnv) this.cnv.appendChild(x);
this.htm = "";
}

function pntCnvIe()
{
if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
this.htm = "";
}

function pntDoc()
{
this.wnd.document.write(jg_fast? this.htmRpc() : this.htm);
this.htm = '';
}

function pntN()
{
;
}

function mkDiv(x, y, w, h) {
if (x > 0 && x < srx && y > 0 && y < sry) {
this.htm += c_div('', pos+l1(x)+t1(y)+w1(w)+h1(h)+'clip:rect(0,'+w+'px,'+h+'px,0);'+bgcolor(this.color)+(!jg_moz? oveh : ''));
}
}

function mkDivIe(x, y, w, h)
{
this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';';
}

function mkDivPrt(x, y, w, h)
{
this.htm += c_div('', 'border-left:'+w+'px solid '+this.color+';'+pos+l1(x)+t1(y)+w1(0)+h1(h)+'clip:rect(0,'+w+'px,'+h+'px,0);'+bgcolor(this.color) +(!jg_moz? oveh : ''));
}

var regex =  /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
function htmRpc()
{
return this.htm.replace(
regex,
'<div style="overflow:hidden;position:absolute;background-color:'+
'$1;left:$2;top:$3;width:$4;height:$5"></div>\n');
}

function htmPrtRpc()
{
return this.htm.replace(
regex,
'<div style="overflow:hidden;position:absolute;background-color:'+
'$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n');
}

function mkLin(x1, y1, x2, y2)
{
if(x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1;

if(dx >= dy)
{
var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx,
ox = x;
while(dx > 0)
{--dx;
++x;
if(p > 0)
{
this.mkDiv(ox, y, x-ox, 1);
y += yIncr;
p += pru;
ox = x;
}
else p += pr;
}
this.mkDiv(ox, y, x2-ox+1, 1);
}

else
{
var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy,
oy = y;
if(y2 <= y1)
{
while(dy > 0)
{--dy;
if(p > 0)
{
this.mkDiv(x++, y, 1, oy-y+1);
y += yIncr;
p += pru;
oy = y;
}
else
{
y += yIncr;
p += pr;
}
}
this.mkDiv(x2, y2, 1, oy-y2+1);
}
else
{
while(dy > 0)
{--dy;
y += yIncr;
if(p > 0)
{
this.mkDiv(x++, oy, 1, y-oy);
p += pru;
oy = y;
}
else p += pr;
}
this.mkDiv(x2, oy, 1, y2-oy+1);
}
}
}

function mkLin2D(x1, y1, x2, y2)
{
if(x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1;

var s = this.stroke;
if(dx >= dy)
{
if(dx > 0 && s-3 > 0)
{
var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
}
else var _s = s;
var ad = Math.ceil(s/2);

var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx,
ox = x;
while(dx > 0)
{--dx;
++x;
if(p > 0)
{
this.mkDiv(ox, y, x-ox+ad, _s);
y += yIncr;
p += pru;
ox = x;
}
else p += pr;
}
this.mkDiv(ox, y, x2-ox+ad+1, _s);
}

else
{
if(s-3 > 0)
{
var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
}
else var _s = s;
var ad = Math.round(s/2);

var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy,
oy = y;
if(y2 <= y1)
{
++ad;
while(dy > 0)
{--dy;
if(p > 0)
{
this.mkDiv(x++, y, _s, oy-y+ad);
y += yIncr;
p += pru;
oy = y;
}
else
{
y += yIncr;
p += pr;
}
}
this.mkDiv(x2, y2, _s, oy-y2+ad);
}
else
{
while(dy > 0)
{--dy;
y += yIncr;
if(p > 0)
{
this.mkDiv(x++, oy, _s, y-oy+ad);
p += pru;
oy = y;
}
else p += pr;
}
this.mkDiv(x2, oy, _s, y2-oy+ad+1);
}
}
}

function mkLinDott(x1, y1, x2, y2)
{
if(x1 > x2)
{
var _x2 = x2;
var _y2 = y2;
x2 = x1;
y2 = y1;
x1 = _x2;
y1 = _y2;
}
var dx = x2-x1, dy = Math.abs(y2-y1),
x = x1, y = y1,
yIncr = (y1 > y2)? -1 : 1,
drw = true;
if(dx >= dy)
{
var pr = dy<<1,
pru = pr - (dx<<1),
p = pr-dx;
while(dx > 0)
{--dx;
if(drw) this.mkDiv(x, y, 1, 1);
drw = !drw;
if(p > 0)
{
y += yIncr;
p += pru;
}
else p += pr;
++x;
}
}
else
{
var pr = dx<<1,
pru = pr - (dy<<1),
p = pr-dy;
while(dy > 0)
{--dy;
if(drw) this.mkDiv(x, y, 1, 1);
drw = !drw;
y += yIncr;
if(p > 0)
{
++x;
p += pru;
}
else p += pr;
}
}
if(drw) this.mkDiv(x, y, 1, 1);
}

function mkOv(left, top, width, height)
{
var a = (++width)>>1, b = (++height)>>1,
wod = width&1, hod = height&1,
cx = left+a, cy = top+b,
x = 0, y = b,
ox = 0, oy = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1,
st = (aa2>>1)*(1-(b<<1)) + bb2,
tt = (bb2>>1) - aa2*((b<<1)-1),
w, h;
while(y > 0)
{
if(st < 0)
{
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
st += bb2*((x<<1)+3) - aa4*(y-1);
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
w = x-ox;
h = oy-y;
if((w&2) && (h&2))
{
this.mkOvQds(cx, cy, x-2, y+2, 1, 1, wod, hod);
this.mkOvQds(cx, cy, x-1, y+1, 1, 1, wod, hod);
}
else this.mkOvQds(cx, cy, x-1, oy, w, h, wod, hod);
ox = x;
oy = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
}
w = a-ox+1;
h = (oy<<1)+hod;
y = cy-oy;
this.mkDiv(cx-a, y, w, h);
this.mkDiv(cx+ox+wod-1, y, w, h);
}

function mkOv2D(left, top, width, height)
{
var s = this.stroke;
width += s+1;
height += s+1;
var a = width>>1, b = height>>1,
wod = width&1, hod = height&1,
cx = left+a, cy = top+b,
x = 0, y = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1,
st = (aa2>>1)*(1-(b<<1)) + bb2,
tt = (bb2>>1) - aa2*((b<<1)-1);

if(s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0))
{
var ox = 0, oy = b,
w, h,
pxw;
while(y > 0)
{
if(st < 0)
{
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
st += bb2*((x<<1)+3) - aa4*(y-1);
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
w = x-ox;
h = oy-y;

if(w-1)
{
pxw = w+1+(s&1);
h = s;
}
else if(h-1)
{
pxw = s;
h += 1+(s&1);
}
else pxw = h = s;
this.mkOvQds(cx, cy, x-1, oy, pxw, h, wod, hod);
ox = x;
oy = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
}
this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
this.mkDiv(cx+a+wod-s, cy-oy, s, (oy<<1)+hod);
}

else
{
var _a = (width-(s<<1))>>1,
_b = (height-(s<<1))>>1,
_x = 0, _y = _b,
_aa2 = (_a*_a)<<1, _aa4 = _aa2<<1, _bb2 = (_b*_b)<<1, _bb4 = _bb2<<1,
_st = (_aa2>>1)*(1-(_b<<1)) + _bb2,
_tt = (_bb2>>1) - _aa2*((_b<<1)-1),

pxl = new Array(),
pxt = new Array(),
_pxb = new Array();
pxl[0] = 0;
pxt[0] = b;
_pxb[0] = _b-1;
while(y > 0)
{
if(st < 0)
{
pxl[pxl.length] = x;
pxt[pxt.length] = y;
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
pxl[pxl.length] = x;
st += bb2*((x<<1)+3) - aa4*(y-1);
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
pxt[pxt.length] = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}

if(_y > 0)
{
if(_st < 0)
{
_st += _bb2*((_x<<1)+3);
_tt += _bb4*(++_x);
_pxb[_pxb.length] = _y-1;
}
else if(_tt < 0)
{
_st += _bb2*((_x<<1)+3) - _aa4*(_y-1);
_tt += _bb4*(++_x) - _aa2*(((_y--)<<1)-3);
_pxb[_pxb.length] = _y-1;
}
else
{
_tt -= _aa2*((_y<<1)-3);
_st -= _aa4*(--_y);
_pxb[_pxb.length-1]--;
}
}
}

var ox = -wod, oy = b,
_oy = _pxb[0],
l = pxl.length,
w, h;
for(var i = 0; i < l; i++)
{
if(typeof _pxb[i] != "undefined")
{
if(_pxb[i] < _oy || pxt[i] < oy)
{
x = pxl[i];
this.mkOvQds(cx, cy, x, oy, x-ox, oy-_oy, wod, hod);
ox = x;
oy = pxt[i];
_oy = _pxb[i];
}
}
else
{
x = pxl[i];
this.mkDiv(cx-x, cy-oy, 1, (oy<<1)+hod);
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
ox = x;
oy = pxt[i];
}
}
this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
}
}

function mkOvDott(left, top, width, height)
{
var a = (++width)>>1, b = (++height)>>1,
wod = width&1, hod = height&1, hodu = hod^1,
cx = left+a, cy = top+b,
x = 0, y = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1,
st = (aa2>>1)*(1-(b<<1)) + bb2,
tt = (bb2>>1) - aa2*((b<<1)-1),
drw = true;
while(y > 0)
{
if(st < 0)
{
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
st += bb2*((x<<1)+3) - aa4*(y-1);
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
if(drw && y >= hodu) this.mkOvQds(cx, cy, x, y, 1, 1, wod, hod);
drw = !drw;
}
}

function mkRect(x, y, w, h)
{
var s = this.stroke;
this.mkDiv(x, y, w, s);
this.mkDiv(x+w, y, s, h);
this.mkDiv(x, y+h, w+s, s);
this.mkDiv(x, y+s, s, h-s);
}

function mkRectDott(x, y, w, h)
{
this.drawLine(x, y, x+w, y);
this.drawLine(x+w, y, x+w, y+h);
this.drawLine(x, y+h, x+w, y+h);
this.drawLine(x, y, x, y+h);
}

function jsgFont()
{
this.PLAIN = 'font-weight:normal;';
this.BOLD = 'font-weight:bold;';
this.ITALIC = 'font-style:italic;';
this.ITALIC_BOLD = this.ITALIC + this.BOLD;
this.BOLD_ITALIC = this.ITALIC_BOLD;
}
var Font = new jsgFont();

function jsgStroke()
{
this.DOTTED = -1;
}
var Stroke = new jsgStroke();

function jsGraphics(cnv, wnd)
{
this.setColor = new Function('arg', 'this.color = arg.toLowerCase();');

this.setStroke = function(x)
{
this.stroke = x;
if(!(x+1))
{
this.drawLine = mkLinDott;
this.mkOv = mkOvDott;
this.drawRect = mkRectDott;
}
else if(x-1 > 0)
{
this.drawLine = mkLin2D;
this.mkOv = mkOv2D;
this.drawRect = mkRect;
}
else
{
this.drawLine = mkLin;
this.mkOv = mkOv;
this.drawRect = mkRect;
}
};

this.setPrintable = function(arg)
{
this.printable = arg;
if(jg_fast)
{
this.mkDiv = mkDivIe;
this.htmRpc = arg? htmPrtRpc : htmRpc;
}
else this.mkDiv = arg? mkDivPrt : mkDiv;
};

this.setFont = function(fam, sz, sty)
{
this.ftFam = fam;
this.ftSz = sz;
this.ftSty = sty || Font.PLAIN;
};

this.drawPolyline = this.drawPolyLine = function(x, y)
{
for (var i=x.length - 1; i;)
{--i;
this.drawLine(x[i], y[i], x[i+1], y[i+1]);
}
};

this.fillRect = function(x, y, w, h)
{
this.mkDiv(x, y, w, h);
};

this.drawPolygon = function(x, y)
{
this.drawPolyline(x, y);
this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
};

this.drawEllipse = this.drawOval = function(x, y, w, h)
{
this.mkOv(x, y, w, h);
};

this.fillEllipse = this.fillOval = function(left, top, w, h)
{
var a = w>>1, b = h>>1,
wod = w&1, hod = h&1,
cx = left+a, cy = top+b,
x = 0, y = b, oy = b,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1,
st = (aa2>>1)*(1-(b<<1)) + bb2,
tt = (bb2>>1) - aa2*((b<<1)-1),
xl, dw, dh;
if(w) while(y > 0)
{
if(st < 0)
{
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
st += bb2*((x<<1)+3) - aa4*(y-1);
xl = cx-x;
dw = (x<<1)+wod;
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
dh = oy-y;
this.mkDiv(xl, cy-oy, dw, dh);
this.mkDiv(xl, cy+y+hod, dw, dh);
oy = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
}
}
this.mkDiv(cx-a, cy-oy, w, (oy<<1)+hod);
};

this.fillArc = function(iL, iT, iW, iH, fAngA, fAngZ)
{
var a = iW>>1, b = iH>>1,
iOdds = (iW&1) | ((iH&1) << 16),
cx = iL+a, cy = iT+b,
x = 0, y = b, ox = x, oy = y,
aa2 = (a*a)<<1, aa4 = aa2<<1, bb2 = (b*b)<<1, bb4 = bb2<<1,
st = (aa2>>1)*(1-(b<<1)) + bb2,
tt = (bb2>>1) - aa2*((b<<1)-1),
xEndA, yEndA, xEndZ, yEndZ,
iSects = (1 << (Math.floor((fAngA %= 360.0)/180.0) << 3))
| (2 << (Math.floor((fAngZ %= 360.0)/180.0) << 3))
| ((fAngA >= fAngZ) << 16),
aBndA = new Array(b+1), aBndZ = new Array(b+1);

fAngA *= Math.PI/180.0;
fAngZ *= Math.PI/180.0;
xEndA = cx+Math.round(a*Math.cos(fAngA));
yEndA = cy+Math.round(-b*Math.sin(fAngA));
aBndA.mkLinVirt(cx, cy, xEndA, yEndA);
xEndZ = cx+Math.round(a*Math.cos(fAngZ));
yEndZ = cy+Math.round(-b*Math.sin(fAngZ));
aBndZ.mkLinVirt(cx, cy, xEndZ, yEndZ);

while(y > 0)
{
if(st < 0)
{
st += bb2*((x<<1)+3);
tt += bb4*(++x);
}
else if(tt < 0)
{
st += bb2*((x<<1)+3) - aa4*(y-1);
ox = x;
tt += bb4*(++x) - aa2*(((y--)<<1)-3);
this.mkArcDiv(ox, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
oy = y;
}
else
{
tt -= aa2*((y<<1)-3);
st -= aa4*(--y);
if(y && (aBndA[y] != aBndA[y-1] || aBndZ[y] != aBndZ[y-1]))
{
this.mkArcDiv(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
ox = x;
oy = y;
}
}
}
this.mkArcDiv(x, 0, oy, cx, cy, iOdds, aBndA, aBndZ, iSects);
if(iOdds >> 16) 
{
if(iSects >> 16)
{
var xl = (yEndA <= cy || yEndZ > cy)? (cx - x) : cx;
this.mkDiv(xl, cy, x + cx - xl + (iOdds & 0xffff), 1);
}
else if((iSects & 0x01) && yEndZ > cy)
this.mkDiv(cx - x, cy, x, 1);
}
};
this.fillPolygon = function(array_x, array_y)
{
var i;
var y;
var miny, maxy;
var x1, y1;
var x2, y2;
var ind1, ind2;
var ints;

var n = array_x.length;
if(!n) return;

miny = array_y[0];
maxy = array_y[0];
for(i = 1; i < n; i++)
{
if(array_y[i] < miny)
miny = array_y[i];

if(array_y[i] > maxy)
maxy = array_y[i];
}
for(y = miny; y <= maxy; y++)
{
var polyInts = new Array();
ints = 0;
for(i = 0; i < n; i++)
{
if(!i)
{
ind1 = n-1;
ind2 = 0;
}
else
{
ind1 = i-1;
ind2 = i;
}
y1 = array_y[ind1];
y2 = array_y[ind2];
if(y1 < y2)
{
x1 = array_x[ind1];
x2 = array_x[ind2];
}
else if(y1 > y2)
{
y2 = array_y[ind1];
y1 = array_y[ind2];
x2 = array_x[ind1];
x1 = array_x[ind2];
}
else continue;

if((y >= y1) && (y < y2))
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);

else if((y == maxy) && (y > y1) && (y <= y2))
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
}
polyInts.sort(CompInt);
for(i = 0; i < ints; i+=2)
this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1);
}
};

this.drawString = function(txt, x, y)
{
this.htm += '<div style="position:absolute;white-space:nowrap;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'font-family:' +  this.ftFam + ';'+
'font-size:' + this.ftSz + ';'+
'color:' + this.color + ';' + this.ftSty + '">'+
txt +
'<\/div>';
};

this.drawStringRect = function(txt, x, y, width, halign)
{
this.htm += '<div style="position:absolute;overflow:hidden;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:'+width +'px;'+
'text-align:'+halign+';'+
'font-family:' +  this.ftFam + ';'+
'font-size:' + this.ftSz + ';'+
'color:' + this.color + ';' + this.ftSty + '">'+
txt +
'<\/div>';
};

this.drawImage = function(imgSrc, x, y, w, h, a)
{
this.htm += '<div style="position:absolute;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:' +  w + 'px;'+
'height:' + h + 'px;">'+
'<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+
'<\/div>';
};

this.clear = function()
{
this.htm = "";
if(this.cnv) this.cnv.innerHTML = "";
};

this.mkOvQds = function(cx, cy, x, y, w, h, wod, hod)
{
var xl = cx - x, xr = cx + x + wod - w, yt = cy - y, yb = cy + y + hod - h;
if(xr > xl+w)
{
this.mkDiv(xr, yt, w, h);
this.mkDiv(xr, yb, w, h);
}
else
w = xr - xl + w;
this.mkDiv(xl, yt, w, h);
this.mkDiv(xl, yb, w, h);
};

this.mkArcDiv = function(x, y, oy, cx, cy, iOdds, aBndA, aBndZ, iSects)
{
var xrDef = cx + x + (iOdds & 0xffff), y2, h = oy - y, xl, xr, w;

if(!h) h = 1;
x = cx - x;

if(iSects & 0xff0000)
{
y2 = cy - y - h;
if(iSects & 0x00ff)
{
if(iSects & 0x02)
{
xl = Math.max(x, aBndZ[y]);
w = xrDef - xl;
if(w > 0) this.mkDiv(xl, y2, w, h);
}
if(iSects & 0x01)
{
xr = Math.min(xrDef, aBndA[y]);
w = xr - x;
if(w > 0) this.mkDiv(x, y2, w, h);
}
}
else
this.mkDiv(x, y2, xrDef - x, h);
y2 = cy + y + (iOdds >> 16);
if(iSects & 0xff00)
{
if(iSects & 0x0100)
{
xl = Math.max(x, aBndA[y]);
w = xrDef - xl;
if(w > 0) this.mkDiv(xl, y2, w, h);
}
if(iSects & 0x0200)
{
xr = Math.min(xrDef, aBndZ[y]);
w = xr - x;
if(w > 0) this.mkDiv(x, y2, w, h);
}
}
else
this.mkDiv(x, y2, xrDef - x, h);
}
else
{
if(iSects & 0x00ff)
{
if(iSects & 0x02)
xl = Math.max(x, aBndZ[y]);
else
xl = x;
if(iSects & 0x01)
xr = Math.min(xrDef, aBndA[y]);
else
xr = xrDef;
y2 = cy - y - h;
w = xr - xl;
if(w > 0) this.mkDiv(xl, y2, w, h);
}
if(iSects & 0xff00)
{
if(iSects & 0x0100)
xl = Math.max(x, aBndA[y]);
else
xl = x;
if(iSects & 0x0200)
xr = Math.min(xrDef, aBndZ[y]);
else
xr = xrDef;
y2 = cy + y + (iOdds >> 16);
w = xr - xl;
if(w > 0) this.mkDiv(xl, y2, w, h);
}
}
};

this.setStroke(1);
this.setFont("verdana,geneva,helvetica,sans-serif", "12px", Font.PLAIN);
this.color = "#000000";
this.htm = "";
this.wnd = wnd || window;

if(!jg_ok) chkDHTM();
if(jg_ok)
{
if(cnv)
{
if(typeof(cnv) == "string")
this.cont = document.all? (this.wnd.document.all[cnv] || null)
: document.getElementById? (this.wnd.document.getElementById(cnv) || null)
: null;
else if(cnv == window.document)
this.cont = document.getElementsByTagName("body")[0];
else this.cont = cnv;
this.cnv = document.createElement("div");
this.cont.appendChild(this.cnv);
this.paint = jg_dom? pntCnvDom : pntCnvIe;
}
else
this.paint = pntDoc;
}
else
this.paint = pntN;

this.setPrintable(true);
}

Array.prototype.mkLinVirt = function(x1, y1, x2, y2)
{
var dx = Math.abs(x2-x1), dy = Math.abs(y2-y1),
x = x1, y = y1,
xIncr = (x1 > x2)? -1 : 1,
yIncr = (y1 > y2)? -1 : 1,
p,
i = 0;
if(dx >= dy)
{
var pr = dy<<1,
pru = pr - (dx<<1);
p = pr-dx;
while(dx > 0)
{--dx;
if(p > 0)
{
this[i++] = x;
y += yIncr;
p += pru;
}
else p += pr;
x += xIncr;
}
}
else
{
var pr = dx<<1,
pru = pr - (dy<<1);
p = pr-dy;
while(dy > 0)
{--dy;
y += yIncr;
this[i++] = x;
if(p > 0)
{
x += xIncr;
p += pru;
}
else p += pr;
}
}
for(var len = this.length, i = len-i; i;)
this[len-(i--)] = x;
};

function CompInt(x, y)
{
return(x - y);
}

function igpest (modo, id) {
var curtime = new Date();
var fecha = curtime.getDate()+'-'+(curtime.getMonth()+1)+'-'+curtime.getFullYear();
var busqueda = 'php/iglesia/igbuscard.php?id='+id+'&f='+fecha+'&m='+modo+'&'+admt();
makeRequest(busqueda, adm_tarjeta_xml);
contneg.innerHTML = carg+'Buscando informaci&oacute;n.....<br>'
/*+busqueda*/;
}

function igccontenido (id,i,t) {
iglesias (id);
contpest.innerHTML = c_pest(pestana_neg,i);
contneg.innerHTML=t;
}
function igevento(obj) {
iglesias (obj.id);
contpest.innerHTML = c_pest(pestana_neg,obj.i);
horario = it()+th2(c_div('cal1', w1('100%'), ''))+th2('Eventos para el dia: <b>'+obj.fi+'</b>');
for (hi = 0; hi< 24; hi++) {
objc = 0;
for (i = 0; i < obj.c; i++) {
if (obj.datos[i].h == hi) {
horario += tdig(hi+':00', '<b>'+obj.datos[i].n+'</b>: '+obj.datos[i].d
+ (obj.datos[i].loc.l ? '<br>'+ahref('realizarBusqueda('+obj.datos[i].loc.xb+', '+obj.datos[i].loc.yb+', '+obj.datos[i].loc.mx+', '+obj.datos[i].loc.my+', \'\')','Localizar') : ''));
objc = 1;
}
}
if (objc == 0) {
horario += tdig(hi+':00', '&nbsp;');
}
}
contneg.innerHTML=horario+dt;
doShow('cal1', 'igpest2',obj.id,2,1);

}

function igpest2 (a,i,d,id,m) {
var fecha = d+'-'+i+'-'+a;
var busqueda = 'php/iglesia/igbuscard.php?id='+id+'&f='+fecha+'&m='+m+'&'+admt();
makeRequest(busqueda, adm_tarjeta_xml);
contneg.innerHTML = carg+'Buscando informaci&oacute;n.....<br>'+busqueda;
}
function igpest4 (obj) {
var diass=new Array();
diass[1]="Domingo";
diass[2]="Lunes";
diass[3]="Martes";
diass[4]="Miercoles";
diass[5]="Jueves";
diass[6]="Viernes";
diass[7]="Sabado";
iglesias (obj.id);
contpest.innerHTML = c_pest(pestana_neg,obj.i);
horario = it('450')+th2('Horarios de misa');
if (obj.e) {
horario += td2('No hay horarios disponibles');
} else {
for (di = 1; di< 8; di++) {
objc = 0;
if (obj.datos[di] != '') {
horario += tdig(diass[di], obj.datos[di]);
objc = 1;
}
}
}
contneg.innerHTML=horario+dt;
}
function igpest5 (obj) {
var diass=new Array();
diass[1]="Domingo";
diass[2]="Lunes";
diass[3]="Martes";
diass[4]="Miercoles";
diass[5]="Jueves";
diass[6]="Viernes";
diass[7]="Sabado";
iglesias (obj.id);
contpest.innerHTML = c_pest(pestana_neg,obj.i);
horario = it('450')+th2('Horarios del dispensario');
if (obj.e) {
horario += td2('No hay horarios disponibles');
} else {
for (di = 1; di< 8; di++) {
objc = 0;
if (obj.datos[di]) {
horario += tdig(diass[di], obj.datos[di]);
objc = 1;
}
}
}
contneg.innerHTML=horario+dt;
}var idtn = 0, idtx = 0,idty = 0, tn, ed = 0;
sine = ' (Sin espacios ni guiones)';
obusc = 'buscadores=0;ocultarobj();';
var cdobj = '';
function rlocnegocio_basico (dx, dy, mx, my) {
EscalaMapa = 3;
contenidomapa.innerHTML = dobj (dx, dy, 0, 0);
mres.style.top = my-76;
mres.style.left = mx;
mres.style.visibility = 'visible';
acutalizarObjetos(dx,dy);
}
linkextra = 'http://www.llegalemapas.com/';
basel = linkextra+'beta/1.5/';
function contrata_basico (i) {
txtlink =linkextra+'wiki/index.php/Código_QR';
if (i == 1) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, alto_ventana_c, colortitulo, 'solid', '1px', colorpes2,
img_anuncio('impresos.llegale.jpg', 'buscarlugar_basico()')+c_div('', pos+t1(190)+l1(170)+w1(180)+h1(50)+cur('hand'), '', 'n_ventana1(\''+txtlink+'\')'));
urchinTracker('administracion/nueva tarjeta basico');
}
/*if (i == 2) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 460, colortitulo, 'solid', '1px', colorpes2,
img_anuncio('impresos.llegale2.jpg', 'buscarlugar_basico()') +c_div('', pos+t1(190)+l1(170)+w1(180)+h1(50)+cur('hand'), '', 'n_ventana1(\''+txtlink+'\')'));
urchinTracker('administracion/nueva tarjeta clasificado');
}
if (i == 3) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 520, colortitulo, 'solid', '1px', colorpes2,
'<img src="img/contrata/impresos.llegale1.jpg" border=0 width="'+ancho_ventana_c+'" height="900"><br>'
+'<img src="img/contrata/costos.gif" width="'+ancho_ventana_c+'" height="150" />');
urchinTracker('administracion/impresos llegale');
}*/
}
function img_anuncio (f,d,w,h) {
return '<img src="img/contrata/'+f+'" border=0 onclick="ocultar_buscador();'+d+'" width="'+(w ? w : ancho_ventana_c)+'" height="'+(h ? h : 460)+'" style="'+cur('hand')+'">';
}
function n_ventana1 (url) {
window.open(url, 'ayuda');
}
function mostrar_anuncio (id,nombre,ide) {
/*return tdn(c_div('cnegocio', '', '<img src="img/contrata/punto.llegale.png" width="'+ancho_ventana_c+'" height="150" onclick="anuncio_contrataplan('+id+',\''+nombre+'\',\''+ide+'\');" style="'+cur('hand')+'">'));*/
return tdn(c_div('cnegocio', '', '<img src="img/contrata/punto.llegale.png" width="'+ancho_ventana_c+'" height="150" style="'+cur('hand')+'">'));
}
function anuncio_contrataplan (id,nombre,ide) {
txtlink = basel+'estadisticas/index.pdf';
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, alto_ventana_c, colortitulo, 'solid', '1px', colorpes2,
img_anuncio('paquetes.jpg','contratacion('+id+',\''+nombre+'\',\''+ide+'\');', ancho_ventana_c,600)
+c_div('', pos+t1(520)+l1(220)+w1(100)+h1(60)+cur('hand'), '', 'urchinTracker(\'administracion/contratar anuncio/'+id+', '+nombre+'/estadisticas\');n_ventana1(\''+txtlink+'\')'));
urchinTracker('administracion/contratar anuncio/1/'+id+', '+nombre);
}
prod = {"c":"3","d":[{"e":"Llegale Rojo","c":"1800","c1":"2070"},{"e":"Llegale Amarillo","c":"1200","c1":"1380"},{"e":"Llegale Verde","c":"3000","c1":"3450"}]};
function modlugar_pagado (id) {

}
function contratacion(id,nombre,ide) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, alto_ventana_c, colortitulo, 'solid', '1px', colorpes2,
it(ancho_ventana_c)
+td2(ahref('anuncio_contrataplan('+id+', \''+nombre+'\')', 'Ver los Planes'))
+th2('Pago mediante Paypal (pago con tarjeta de credito)')
+td('Acceso Llegale:', id)
+td('Nombre:', nombre)
+td2(c_div('pagopaypal'))
+td2('Una vez realizado el pago mediante tarjeta de credito podra realizar la actualizacion de la informacion de este lugar, asi como incluirle mas informacion y mejorar su posicion en las busquedas')
+td2(itabla('100%','','','',encmf)
+th2('Pago mediante deposito bancario')
+td('Banco:', bo('Banamex'))
+td('Cuenta:', bo('4298 35381'))
+td('Mediante transferencia bancaria<br>Clabe:', bo('002680429800353817'))
+td('Referencia:', bo(id))
+td2('Una vez realizado el deposito o tranferencia, mandanos un correo a '+bo('rodrigoglz@llegale.com')+' indicandonos la cantidad pagada y accesso llegale y en breve recibiras toda la informacion para que puedas editar tu punto llegale')
), 0, 0, 0, 'Editar_un_Punto_llegale', 'Contratar un punto llegale');
cprecio(prod.d[0].e,id,ide);
urchinTracker('administracion/contratar anuncio/2/'+id+', '+nombre);
}
function cprecio (txt,id,ide) {
for (i = 0; i < prod.c; i++) {
if (txt == prod.d[i].e) {
pagopaypal.innerHTML = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_pagarfpaypal">'
+chidden('cmd','_xclick')
+'Producto: '+csel('item_name', copt(prod.d[0].e, prod.d[0].e, i == 0 ? prod.d[0].e : 0)+copt(prod.d[1].e, prod.d[1].e, i == prod.d[1].e ? 1 : 0)+copt(prod.d[2].e, prod.d[2].e, i == prod.d[2].e ? 1 : 0), '', 'cprecio(this.value,\''+id+'\',\''+ide+'\' );')+'<br>'
+chidden('item_number',id)
+c_div('preciof', '', 'Subtotal: $ '+prod.d[i].c+'<br>Total a pagar: $'+prod.d[i].c1)
+chidden('amount',prod.d[i].c1)+'<br>'
/*+chidden('business','rodrigo@llegalemapas.com')*/
+chidden('business','rodrigoglz@llegale.com')
+chidden('currency_code','MXN')
+chidden('rm','2')
+chidden('return',basel+'php/paypal/pppagado.php?id='+ide)
+chidden('cancel_return',basel+'php/paypal/pppagado.php?id='+ide)
+'<center><input type="image" src="https://www.paypal.com/es_XC/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">'
+'<img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" width="1" height="1"></center>'
+'</form><br><br>'
}
}
}

function editar_negocio_basico () {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 150, colortitulo, 'solid', '1px', colorpes2,
itabla('100%','','','tarjeta/editarnegociobasico.php',encmf)
+th2('Escriba el codigo de edicion que recibio por correo')
+td('Codigo de edicion:', cInput('c', ''))
+fined('Siguiente paso'), 0, 0, 0, 'Editar_un_Punto_llegale', 'Editar su negocio');
urchinTracker('administracion/editar tarjeta basico/1');
}
function editar_negocio_basico_2 (id,t,n,e,cd,c,cl,m,g,d,tel) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%','','','tarjeta/guardareditarnegociobasico.php',encmf)
+th2('Paso 2: Actualice los datos de su negocio')
+td('Nombre de su<br>negocio:', cInput('nombre', n)+chidden('id', id)+chidden('t', t))
+td('Estado:', lista_estados('estado',e))
+td('Ciudad:', c_div('cdcamb', '', 'Seleccione un estado')+chidden('cd', cd))
+td('Colonia:', cInput('colonia', c))
+td('Calle:', cInput('calle', cl))
+td('E-Mail:', cInput('mail', m))
+td('Telefono con clave Lada<br>(Sin espacio ni guiones Ej.: 4422142480):', cInput('tel', tel, 'maxlength=40'))
+td('Giro:', cInput('giro', g))
+th2('Escribe la descripcion de tu negocio')
+tda2t('descripcion',d,35,8)
+td2(c_div('respuestag', font(12)+co('dd0000')))
+fined('Actualizar'), 0, 0, 0, 'Dar_de_alta_un_Punto_Llegale_basico', 'Editar');
urchinTracker('administracion/editar tarjeta basico/2');
cambestado (e,cd);
}
function editar_negocio_basico_terminado (n,c) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 150, colortitulo, 'solid', '1px', colorpes2,
it('100%')
+th2('Su negocio ha sido editado con exito')
+td('Nombre del negocio:', bo(n))
+td('Codigo de edicion:', bo(c)), 0, 0, 0, 'Editar_un_Punto_llegale', 'Editar su negocio');
urchinTracker('administracion/editar tarjeta basico/3');
}
function buscarlugar_basico () {
locobjn.innerHTML = c_div('', ovea+w1('100%')+h1('100%'),
titulo('Paso 1:','',245)
+td2('Busque la calle donde se localiza su negocio, para esto puede usar nuestras herramientas de busqueda de calles y colonias.<br>'
+'Una vez que la localizo de un click en Continuar')
+th2('<input type="button" value="Continuar" onclick="marcarlugar_basico()"> <input type="button" value="Cancelar" onclick="otarjeta_t ()">')
+td2(c_div('finXY',font(10)+ovea,''))+dt);
buscadores=0;
ocultarobj();
locobjn.style.visibility = 'visible';
}
function marcarlugar_basico () {
locobjn.innerHTML = c_div('',ovea+w1('100%')+h1('100%'), titulo('Paso 2:','',245)
+td2(bo('De un click en el lugar correcto donde se localiza el punto o negocio que desea ubicar'))
+td2(c_div('posXY',font(10),''))
+td2(c_div('finXY',font(10)+ovea,''))
+dt);
buscadores=6;
}
function pregfinmarcarlugar_basico (){
buscadores=1;
mres.style.top = idty1-76;
mres.style.left = idtx1;
mres.style.visibility = 'visible';
finXY.innerHTML = '<font size=+1>&#191;La ubicaci&oacute;n de su negocio es correcta?<br>'
+cent('<input type="button" value="Si" onclick="otarjeta_t();registro_basico('+idtx+','+idty+','+EscalaMapa+');"> <input type="button" value="No" onclick="buscarlugar_basico();">') +'</font>';
}
function registro_basico(x,y,esc) {
buscadores = 1;
ed = 0;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%','','',fi17a,encmf)
+td('Nombre de su<br>negocio:', cInput('nombre', '')+chidden('x', x)+chidden('y', y)+chidden('esc', esc))
+td('Estado:', lista_estados('estado'))
+td('Ciudad:', c_div('cdcamb', '', 'Seleccione un estado')+chidden('cd', ''))
+td('Colonia:', cInput('colonia', ''))
+td('Calle:', cInput('calle', ''))
+td('E-Mail:', cInput('mail', ''))
+td('Giro:', cInput('giro', ''))
+td('Telefono con clave Lada<br>(Sin espacio ni guiones Ej.: 4422142480):', cInput('tel', '', 'maxlength=40'))
+th2('Escribe la descripcion de tu negocio')
+tda2t('descripcion','',35,8)
+td2(c_div('respuestag', font(12)+co('dd0000')))
+fined('Siguiente paso'), 0, 0, 0, 'Dar_de_alta_un_Punto_Mapa_basico', 'Paso 3: Agregue los datos de su negocio');
urchinTracker('administracion/nueva tarjeta basico');
}
function fin_basico (id,f,t,nombre,ide) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 200, colortitulo, 'solid', '1px', colorpes2,titulo('','',245)
+td2('Su Negocio ha sido dado de alta con &eacute;xito.<br><br>')
+td2('Su Clave de edicion es: '+bo(t)+'<br>')
+td2('Su Clave de Busqueda es '+bo(id)+'<br>')
+td2('Su acceso directo es: <a href="http://'+id+'.llegalemapas.com/" target="_new'+id+'">'+bo('http://'+id+'.llegalemapas.com/')+'</a><br>')
+td2('Estara disponible hasta el dia: <b>'+f+'</b>')
+td2('El icono se&#241;alando la ubicacion de su negocio aparecera en un plazo de 24 a 72 horas.<br>')
/*+th2(bo(ahref('anuncio_contrataplan('+id+',\''+nombre+'\',\''+ide+'\')', 'Mejora tu localizacion en las busquedas, agrega tu telefono, fotografias')))*/+dt, 0, 0, 0, 'Dar_de_alta_un_Punto_Mapa_basico', 'Terminado');
buscadores=0;
}
function registro() {
buscadores = 1;
ed = 0;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, alto_ventana_c-60, colortitulo, 'solid', '1px', colorpes2,
itabla('100%','','',fi17,encmf)
+td(bo('Ingrese la<br>clave de su<br>tarjeta:'), cInput('t', ''))
+td('Nombre de su<br>negocio:', cInput('nombre', ''))
+td('Estado:', lista_estados('estado'))
+td('Ciudad:', c_div('cdcamb', '', 'Seleccione un estado')+chidden('cd', ''))
+td('Colonia:', /*c_div('cdcamb1', '', 'Seleccione una ciudad')+'<br>'+*/cInput('colonia', ''))
+td('Calle:', cInput('calle', ''))
+td('Tel&eacute;fono:', '01 '+cInput('tel1', '', 'size="10"')+sine)
+td('Tel&eacute;fono 2:', '01 '+cInput('tel2', '', 'size="10"')+sine)
+td('Lada sin costo:', '01 (800)- '+cInput('lsc', '', 'size="7"')+sine)
+td('Fax:', '01 '+cInput('fax', '', 'size="10" maxlength="10"')+sine)
+td('Celuar:', '044- '+cInput('cel', '', 'size="10"')+sine)
+td('Nextel:', cInput('nextel', '', 'size="10"')+sine)
+td('Nextel ID:', cInput('nextelid', '', 'size="10"')+sine)
+td('Giro:', cInput('giro', ''))
+td('Email:', cInput('mail', ''))
+td('Pagina Web:', cInput('web', ''))
+th2('Escribe la descripcion de tu negocio')
+tda2t('descripcion','',35,8)
+fined('Siguiente paso')
+td2(c_div('respuestag', font(12)+co('dd0000'))), 0, 0, 0, 'Dar_de_alta_un_Punto_Mapa', 'Paso 1: Agregue los datos de su negocio');
urchinTracker('administracion/nueva tarjeta');
}
function buscarlugar (id, t) {
tn = t;
locobjn.innerHTML = c_div('', ovea+w1('100%')+h1('100%'),
titulo('Paso 2:','',245)
+td2('Su Negocio ha sido dado de alta con exito.<br><br>')
+td2('Su Clave de Busqueda es '+bo(id)+'<br>')
+td2('Su acceso directo es: <a href="http://'+id+'.llegalemapas.com/" target="_new'+id+'">'+bo('http://'+id+'.llegalemapas.com/')+'</a><br><br>')
+td2(bo('Ahora busque la calle donde se localiza su negocio, para esto puede usar nuestras herramientas de busqueda de calles y colonias.<br>Una vez que la localizo de un click en Continuar'))
+th2('<input type="button" value="Continuar" onclick="marcarlugar('+id+')">') +dt);
buscadores=0;
ocultarobj();
locobjn.style.visibility = 'visible';
}
function marcarlugar (id) {
idtn = id;
locobjn.innerHTML = c_div('',ovea+w1('100%')+h1('100%'), titulo('Paso 3:','',245)
+td2(bo('De un click en el lugar correcto donde se localiza el punto o negocio que desea ubicar'))
+td2(c_div('posXY',font(10),''))
+td2(c_div('finXY',font(10)+ovea,''))
+dt);
buscadores=5;
}
function pregfinmarcarlugar (){
buscadores=0;
mres.style.top = idty1-76;
mres.style.left = idtx1;
mres.style.visibility = 'visible';
txtno = ed ? 'nt3('+idtn+')' : 'continuarmarcalugar ();';
finXY.innerHTML = '<font size=+1>&#191;La ubicaci&oacute;n de su negocio es correcta?<br>'+ cent('<input type="button" value="Si" onclick="finmarcarlugar();"> <input type="button" value="No" onclick="'+txtno+'">') +'</font>';
makeRequest(fi18+'?id='+idtn+'&x='+idtx+'&y='+idty+'&esc='+EscalaMapa+'&t='+tn+'&nr=1', adm_tarjeta_xml);
}
function guardadoxy () {}
function finmarcarlugar () {
buscadores=0;
makeRequest(fi18+'?id='+idtn+'&x='+idtx+'&y='+idty+'&esc='+EscalaMapa+'&t='+tn+'&nr=2', adm_tarjeta_xml);
}
function continuarmarcalugar () {
buscarlugar (idtn, tn);
buscadores=0;
finXY.innerHTML = '';
mres.style.visibility = 'hidden';
}
function terminado (id,x,y,f) {
if (ed) {
finXY.innerHTML = 'Punto ubicado con &#233;xito<br><br>'
+ 'Nota: El icono se&#241;alando la ubicacion de su negocio aparecera en un plazo de 24 horas.<br><br>'
+ 'Para dar de alta sus imagenes de un click en el boton de "Administración".<br><br>'
+ c_div('', pos+oveh+w1('10%')+h1(25)+t1(0)+l1('90%'), vcerr, 'otarjeta_t()')
+ cbotton('c', 'De un click para terminar', 'otarjeta_t()');
} else {
finXY.innerHTML = 'Punto actualizado con &#233;xito<br><br>'
+ 'Nota: El icono se&#241;alando la ubicacion de su negocio aparecera en un plazo de 24 horas.'
+ c_div('', pos+oveh+w1('10%')+h1(25)+t1(0)+l1('90%'), vcerr, 'otarjeta_t()')
+ cbotton('c', 'De un click para terminar', 'otarjeta_t()');
}
locobjn.style.height = 300;
}

function otarjeta_t () {
locobjn.style.visibility = 'hidden';
finXY.innerHTML = '';
buscadores = 0;
mres.style.top = -1000;
mres.style.left = -1000;
}

function alta_giro () {
buscadores = 1;
txtic = '';
for (ic = 1; ic < 16; ic++)
txtic += td(cInput('i'+ic, '', 'style="'+w1(150)+'"')+cInput('u'+ic, '', 'style="'+w1(150)+'"'), cfile('userfile'+ic, w1(200)));
posmuestraobj(loc_ventana_y,loc_ventana_x, 600, 430, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Dar de alta nuevos giros',obusc), '',fi20,encmf)
+td2(c_div('respuestag', font(12)))
+td(c_div('', pos+w1(150),'Giro')+c_div('', pos+w1(150)+l1(150),'URL'), 'Imagen')
+txtic
+fined('Guardar'));

}
function adm_tarjeta (p) {
var temp = getCookie('cv');
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, alto_ventana_c+10, alto_ventana_c-60, colortitulo, 'solid', '1px', colorpes2,
c_div('', pos+l1(0)+t1(0)+w1('100%')+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'), tio('Administrar mi cuenta',obusc))
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('cont', pos+w1('100%')+h1(360)+t1(25)+l1(0)+cur('default'),
c_div('infopersonal', pos+l1(0)+h1('50px')+w1(ancho_ventana_c)+bgcolor('eed29b'), imgdat(1,'adm_info_personal()'))
+c_div('butarjeta', pos+t1('50px')+l1(0)+h1('50px')+w1(ancho_ventana_c)+bgcolor('eed29b'), imgdat(2,'adm_buscar_tarjetas('+p+')'))
+c_div('cv', pos+t1('100px')+l1(0)+h1('50px')+w1(ancho_ventana_c)+bgcolor('eed29b'), imgdat(3,'curriculum1('+p+')'))
+(temp ? c_div('busccv', pos+t1('150px')+l1(0)+h1('50px')+w1(ancho_ventana_c)+bgcolor('eed29b'), imgdat(9,'curriculum2('+p+')')) : '')
))+dt
);
urchinTracker('/administracion/inicio');

}
function adm_buscar_tarjetas (p) {
if (om_buscador_v == 2)
om_buscador();
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 60, colortitulo, 'solid', '1px', colorpes2, carg+'Buscando sus tarjetas....');
makeRequest(fi21+'?pag='+p, adm_tarjeta_xml);
}
var style = font(12)+linbott(colorpes7, 'solid',1);
function adm_tarjeta_json (obj) {
txt = '';
for (i = 0; i < obj.c; i++) {
txt += dtar(obj.d[i][0], obj.d[i][2], obj.d[i][1], obj.d[i][3], obj.d[i][4], obj.d[i][5], obj.d[i][6], obj.d[i][7]);
}
adm_tarjeta_bus (txt, obj.c1, obj.c2);
}
function adm_tarjeta_bus (txt,c1,c2,k) {
var k = getCookie('rutamapa');
avances = ((c1 != ''  || c2 != '' ) ? tr('<TD colspan=6>'
+ it(ancho_ventana_c)
+tr(tds(c1 != '' ? ahref('adm_buscar_tarjetas('+(c1 == 'c' ? 0 : c1)+')','<img src="imagen/botones/boton.anterior.png" border=0>') : '','30%',font(12), ' align="left"')
+(k ? tds(cent(bo(ahref('administrar_kiosko(0)','<img src="imagen/botones/boton.administrar.png" border=0>'))), '60%', font(12)) : '')
+tds(c2 != '' ? ahref('adm_buscar_tarjetas('+c2+')','<img src="imagen/botones/boton.siguiente.png" border=0>') : '','30%',font(12), ' align="right"')
+'</TD>')+dt) : (k  ?  it(ancho_ventana_c) + tds(cent(bo(ahref('administrar_kiosko(0)','<img src="imagen/botones/boton.administrar.png" border=0>'))), '60%', font(12))+dt : ''));
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c+50, alto_ventana_c, colortitulo, 'solid', '1px', colorpes2,
c_div('', pos+l1(0)+t1(0)+w1(ancho_ventana_c)+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'), tio('Administrar mi cuenta',obusc))
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('', pos+w1('100%')+h1(360)+t1(25)+l1(0)+cur('default'),
it()+ avances +tr(ths('Acceso llegale', 50, style)+ths('Negocio', 180, style)+ths('Vigencia', 80, style)+ths('Controles', 140, style)+txt)+avances +dt))+dt);

}

function dtar (id,d1,d3, d2,x,y,t,m) {

if (m == 4) {
e = '<br>'+ahref('enlazar_obj('+id+',\''+t+'\')','Nueva ruta')+' | '+ahref('lista_ruta_obj('+id+',\''+t+'\')','Editar ruta');
} else
e = '';
if (d3)
d1 = '<label title="'+d3+'">'+d1+'</label>';
return tr(tds(id, 0, style)+tds(d1+e, 0, style)+tds(d2, 0, style)
+tds(it(100)
+tds('<img src='+(x != 0 ? gi21 : gi22)+' title="'+(x != 0 ? 'Las coordenadas han sido asignadas' : 'Falta asignar coordenadas')+'" onclick="buscadores = 0;ir_a('+x+','+y+',4)">')
+tds(c_div('', font(12)+w1(35)+cur('hand'), '<img src='+gi17+' title="Igresar una nueva tarjeta">', 'nt1('+id+')'), 35, font(12))
+tds(c_div('', font(12)+w1(35)+cur('hand'), '<img src='+gi18+' title="Editar mi negocio">', 'nt2_xml('+id+',\''+t+'\')'), 35, font(12))
+tds(c_div('', font(12)+w1(35)+cur('hand'), '<img src='+gi20+' title="Editar las coordenadas mi negocio">', 'nt3('+id+',\''+t+'\')'), 35, font(12))
+tds(c_div('', font(12)+w1(35)+cur('hand'), '<img src='+gi19+' title="Ingresar nuevas imagenes">', 'nt4('+id+',\''+t+'\')'), 35, font(12))+dt, 0, style));

}

function no_tarjetas () {

posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 60, colortitulo, 'solid', '1px', colorpes2, it()+th2('No se han encontrado tarjetas<br>'+ahref('registro()',bo('Ingresar una nueva tarjeta')))+dt);

}
function tdig (t, i,f,c,m) {
return tr('<TD style="border-right-style:solid;border-right-width:1px;border-right-color:#252525;'+font(f ? f : 12)+'" valign=top'
+(c ? 'align="center"' : '')+' width=1%>'+t+'</td>'
+'<td style="border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#252525;'+font(f ? f : 12)+'" width=99%>'+i+'</TD>');
}
function lista_ig_eventos (id,t,obj) {

buscadores = 1;
horario = '';
for (hi = 0; hi< 24; hi++) {
objc = 0;
for (i = 0; i < obj.datos.c; i++) {
if (obj.lista[i].hora == hi) {
horario += tdig(ahref('editar_ig_evento(\''+id+'\',\''+t+'\',\''+obj.lista[i].id+'\',\''+obj.lista[i].negocio+'\','+obj.datos.fecha2+','+hi+',\''+obj.datos.fecha+'\',\''+obj.lista[i].nombre+'\',\''+obj.lista[i].descripcion+'\',\''+obj.lista[i].clave+'\')',hi+':00'), bo(obj.lista[i].nombre)+': '+obj.lista[i].descripcion); objc = 1;
}
}
if (objc == 0) {horario += tdig(ahref('ingresar_ig_evento (\''+id+'\',\''+t+'\','+obj.datos.fecha2+','+hi+',\''+obj.datos.fecha+'\')',hi+':00'), '&nbsp;');}
}
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
titulo(tio('Agregar/Editar sus eventos',obusc), '', ancho_ventana_c)
+td2(it('100%')+tr(pestanas_tipo(2, id, t, 1))+dt)
+th2(c_div('cal1', w1('100%'), ''))
+th2(c_div('cal2', w1('100%'), ''))
+th2('Lista de eventod para el dia: '+bo(obj.datos.fecha))
+horario
+dt);
doShow('cal1', 'esp_fecha_evento',id,t,1);

}
function ingresar_ig_evento (id,t,f,h,f2) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Agregar un nuevo evento',obusc),'','php/iglesia/agregar_evento.php',encmf)
+ chidden('t', t)
+ chidden('id', id)
+ chidden('f', f)
+ chidden('h', h)
+td2(c_div('respuestag', font(12)))
+chidden('id', id)
+td('Fecha:', bo(f2))
+td('Hora:', bo(h+':00'))
+td('Nombre del evento:', cInput('nombre', ''))
+td('Clave del evento:', cInput('clave', ''))
+th2('Escribe la descripcion del evento')
+tda2t('descripcion','',55,6)
+fined('Guardar'));
}
function editar_ig_evento (id,t,id1,n,f,h,f2, d1, d2, d3) {
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Agregar un nuevo evento',obusc),'','php/iglesia/editar_evento.php',encmf)
+ chidden('n', n)
+ chidden('id', id1)
+ chidden('f', f)
+ chidden('h', h)
+td2(c_div('respuestag', font(12)))
+chidden('id', id)
+td('Fecha:', bo(f2))
+td('Hora:', bo(h+':00'))
+td('Nombre del evento:', cInput('nombre', d1))
+td('Clave del evento:', cInput('clave', d3))
+th2('Escribe la descripcion del evento')
+tda2t('descripcion',d2,55,6)
+fined('Guardar'));
}
function esp_fecha_evento(y,m,d,id,t) {
m_xml('Agregar/Editar Eventos','Buscando los eventos...<br><br>'+ahref('esp_fecha_evento('+y+','+m+','+d+',\''+id+'\',\''+t+'\')','Ya tardo mucho Volver a intentar'),
'php/iglesia/eventos.php',id,t,'&fy='+y+'&fm='+m+'&fd='+d);
}
function nt1(id) {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 100, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Aumentar el periodo de vigencia',obusc),'',fi22,encmf)
+'<input type=hidden name="id" value="'+id+'">'
+td2(c_div('respuestag', font(12)))
+td('Ingrese el codigo de su tarjeta:', cInput('t', ''))
+fined('Continuar'));

}

function nt2_xml(id,t) {
m_xml('Editar los datos de mi negocio','Buscando sus los datos de su negocio....',fi23,id,t);
}
function ig1 (id, t) {
m_xml('Agregar/Editar Eventos','Buscando los eventos...','php/iglesia/eventos.php',id,t);
}
function ig2(id, t) {
m_xml('Editar los horarios de misa','Buscando horarios de misa...','php/iglesia/horario.php',id,t);
}
function ig3(id, t) {
m_xml('Agregar/Editar las galerias de imagenes','Buscando galerias disponibles...','php/iglesia/galerias1.php',id,t);
}
function ig4(id, t) {
m_xml('Agregar/Editar horarios del dispensario','Buscando los horarios...','php/iglesia/horario_dispensario.php',id,t);
}
function ig_horario (id,t,obj) {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Horarios de misa',obusc),'','php/iglesia/guardar_horario.php',encmf)
+td2(it('100%')+tr(pestanas_tipo(3, id, t,1))+dt)
+th2('Agregar un nuevo horario')
+td2(c_div('respuestag', font(12)))
+chidden('id', id)
+chidden('t', t)
+chidden('misa', 1)
+td('Horario:', cInput('hora', '', 'size="2"')+bo(':')+cInput('min', '00', 'size="2"'))
+td('Ofrecida por: (Opcional)', cInput('padre', ''))
+td('Dia:', icb('d1', 'Domingo', 1, 0)+'<br>'
+icb('d2', 'Lunes', 1, 0)+'<br>'
+icb('d3', 'Martes', 1, 0)+'<br>'
+icb('d4', 'Miercoles', 1, 0)+'<br>'
+icb('d5', 'Jueves', 1, 0)+'<br>'
+icb('d6', 'Viernes', 1, 0)+'<br>'
+icb('d7', 'Sabado', 1, 0)+'<br>'
)
+th2('Descripci&oacute;n (opcional)')
+tda2t('des','',55,6)
+fined('Guardar'));
}
function ig_dispensario (id,t,obj) {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 300, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Horarios de misa',obusc),'','php/iglesia/guardar_horario.php',encmf)
+td2(it('100%')+tr(pestanas_tipo(3, id, t,1))+dt)
+th2('Agregar un nuevo horario')
+td2(c_div('respuestag', font(12)))
+chidden('id', id)
+chidden('t', t)
+chidden('misa', 2)
+td('Doctor:', cInput('padre', ''))
+td('Horario:', cInput('hora', '', 'size="2"')+bo(':')+cInput('min', '00', 'size="2"'))
+td('Dia:', icb('d1', 'Domingo', 1, 0)+'<br>'
+icb('d2', 'Lunes', 1, 0)+'<br>'
+icb('d3', 'Martes', 1, 0)+'<br>'
+icb('d4', 'Miercoles', 1, 0)+'<br>'
+icb('d5', 'Jueves', 1, 0)+'<br>'
+icb('d6', 'Viernes', 1, 0)+'<br>'
+icb('d7', 'Sabado', 1, 0)+'<br>'
)
+th2('Descripci&oacute;n (opcional)')
+tda2t('des','',55,6)
+fined('Guardar'));
}
function m_xml (txt, txt1, ar,id,t,e) {
tn = t;
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 100, colortitulo, 'solid', '1px', colorpes2,
c_div('', pos+l1(0)+t1(0)+w1('100%')+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'), tio(txt,obusc))
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('cont', pos+w1('100%')+t1(25)+l1(0)+cur('default'), carg+txt1))+dt);
makeRequest(ar+'?id='+id+'&t='+(t ? t : '')+(e ? e : ''), adm_tarjeta_xml);
}
function nt2(id,nombre,calle,colonia,tel1,tel2,lsc,fax,cel,nextel,nextelid,giro,mail,web,descrip,t,t1) {
buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, alto_ventana_c-60, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Editar los datos de mi negocio',obusc),'',fi24,encmf)
+ chidden('t', tn)
+(t1 ? pestanas_tipo(1,id,t,t1) : '')
+td2(c_div('respuestag', font(12)))
+chidden('id', id)
+td('Nombre de su<br>negocio:', cInput('nombre', nombre))
+td('Calle:', cInput('calle', calle))
+td('Colonia:', cInput('colonia', colonia))
+td('Tel&eacute;fono:', '01 '+cInput('tel1', tel1, 'size="7"')+' (Sin espacios ni guiones)')
+td('Tel&eacute;fono 2:', '01 '+cInput('tel2', tel2, 'size="7"')+' (Sin espacios ni guiones)')
+td('Lada sin costo:', '01 (800)- '+cInput('lsc', lsc, 'size="7"')+' (Sin espacios ni guiones)')
+td('Fax:', '01 '+cInput('fax', fax, 'size="10"')+' (Sin espacios ni guiones)')
+td('Celuar:', '044- '+cInput('cel', cel, 'size="10"')+' (Sin espacios ni guiones)')
+td('Nextel:', cInput('nextel', nextel, 'size="10"')+' (Sin espacios ni guiones)')
+td('Nextel ID:', cInput('nextelid', nextelid, 'size="10"')+' (Sin espacios ni guiones)')
+td('Giro:', cInput('giro', giro))
+td('Email:', cInput('mail', mail))
+td('Pagina Web:', cInput('web', web))
+th2('Escribe la descripcion de tu negocio')
+tda2t('descripcion',descrip,55,6)
+fined('Guardar'));
}

function nt3 (id, t) {
tn = t;
locobjn.innerHTML = c_div('', ovea+w1('100%')+h1('100%'),
titulo('Localizaci&oacute;n<br>de su negocio','',245)
+td2('Busque la calle donde se localiza su negocio, para esto puede usar nuestras herramientas de busqueda de calles y colonias.<br>Una vez que la localizo de un click en Continuar')
+th('<input type="button" value="Continuar" onclick="nt3a('+id+')">', '<input type="button" value="Cancelar" onclick="otarjeta_t();">') +dt
+ c_div('', pos+oveh+w1(35)+h1(25)+t1(0)+l1('80%'), vcerr, 'otarjeta_t()')
+td2(c_div('posXY',font(10),''))
+td2(c_div('finXY',font(10)+ovea,'')));
buscadores=0;
ocultarobj();
locobjn.style.visibility = 'visible';
}


function nt3a (id) {
idtn = id;
ed = 1;
locobjn.innerHTML = c_div('', ovea+w1('100%')+h1('100%'),titulo('Paso 2:','',245)
+td2(c_div('paso3',font(10),bo('De un click en el lugar correcto en donde se localiza su negocio')))
+td2(c_div('posXY',font(10),''))
+td2(c_div('finXY',font(10)+ovea,''))
+dt
+ c_div('', pos+oveh+w1(35)+h1(25)+t1(0)+l1('85%'), vcerr, 'otarjeta_t()'));
buscadores=5;
}
function nt4 (id, t) {
tn = t;
buscadores = 1;
nventana(520, 300, colortitulo, 'solid', '1px', colorpes2,'', 'Administrar mis imagenes');
makeRequest(fi25+'?id='+id+'&t='+t, adm_tarjeta_xml);
printvn.f1.innerHTML=c_div('imagenespp', '',it('100%')
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('cont', cur('default'), carg+'Buscando las imagenes dadas de alta....'))
+td2(c_div('', cur('hand'), 'ya tardo mucho, Recargar', 'opener.nt4('+id+',\''+t+'\')'))
+dt);
vabierta = 1;
}

function nt4_xml (id, cant1, cant2,txt) {
buscadores = 0;
imga = th('Imagen','Descripci&oacute;n');
st = 'style="'+w1(230)+'"';
i = 0;
if (cant1 != cant2) imga += td(cfile('userfile'+i, w1(250)), cInput('descrip'+i,'',st));
printvn.f1.innerHTML=formimg(fi26,encmf+' target="enviarimg" ')
+chidden('t', tn)+chidden('id', id)+chidden('admt', admt())
+c_div('',cur('default')+font(12),it('100%')
+td2(c_div('respuestag', font(12)))+txt+imga+fined('Guardar imagenes', cbotton('Cerrarv', 'Cerrar Ventana', 'opener.vabierta=0;window.close();')));
}
function imagen_adm (id, m) {
return '<img width=50 src="'+fi27+'?id='+id+'&m='+m+'">';
}
function nt4_img (idi,id,m,d) {
return td2(it('100%')+tr(tds(imagen_adm(id,m),50)+tds((d ? d+'<br>' : '')+c_div('', font(12)+cur('hand')+w1(100),'Eliminar', 'opener.nt4_img_e('+idi+','+id+','+m+')'),390))+dt);
}

function nt4_img_e(idi,id,m) {
buscadores = 1;
if (m == 1) {
advertencia = c_div('', font(14),cent(bo('Advertencia:')+' Debido a aque esta es la imagen principal, si es eliminada, no apareceran fotografias hasta que ingrese otra imagen'));
h = 160;
} else {
advertencia = '';
h = 100;
}
printvn.f1.innerHTML= it('100%')
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('', cur('default'),
c_div('', font(16),cent('&#191;Desea eliminar esta imagen?</center>'))
+advertencia
+c_div('',w1('100%'),
cbotton ('','Si','opener.nt4_img_ec('+idi+','+id+','+m+')', 'style="'+w1(150)+'"')+'&nbsp;&nbsp;&nbsp;'
+cbotton ('','No','opener.nt4('+idi+',\''+tn+'\')', 'style="'+w1(150)+'"')+'<br>'+ahref('opener.vabierta=0;window.close();','Cerrar ventana'),'', 'align="center"')))+dt;
}

function nt4_img_ec(idi,id,m) {
makeRequest(fi28+'?idi='+idi+'&id='+id+'&m='+m+'&t='+tn, adm_tarjeta_xml);
}

function adm_fichas () {

buscadores = 1;
posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c, 100, colortitulo, 'solid', '1px', colorpes2,
c_div('', pos+l1(0)+t1(0)+w1('100%')+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'), tio('Administrar Fichas llegale',obusc))
+td2(c_div('respuestag', font(12)+cur('default')))
+td2(c_div('cont', pos+w1('100%')+t1(25)+l1(0)+cur('default'), carg+'Espere un momento por favor...'))
+td2(c_div('', pos+w1('100%')+t1(75)+l1(0)+cur('hand'), 'ya tardo mucho, Recargar', 'adm_fichas();'))
+dt);
makeRequest(fi29+'?', adm_tarjeta_xml);
}
function maf (txt1, txt2,txt3) {

posmuestraobj(loc_ventana_y,loc_ventana_x, ancho_ventana_c+50, 150, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Administrar Fichas llegale',obusc),'',jsv,'')
+td2(c_div('respuestag', font(12)))
+td('Paso 1: '+bo('Crear codigos de fichas llegale'), txt1)
+td('Paso 2: '+bo('Obten los codigos'),txt2)
+td('Paso 3: '+bo('Eliminar fichas no utilizadas'),txt3)
+'</form>'+dt);

}
function cccl (l) {
respuestag.innerHTML = carg+'Espere un momento.....';
makeRequest(l, adm_tarjeta_xml);
}
function ccc (c,l) {
return cbotton ('', c,'cccl(\''+l+'\');');
}
function np() {
buscadores=0;
ocultarobj();
}

function adm_fichas_exito (c) {

respuestag.innerHTML = cent('Se han generado '+bo(c)+' fichas con exito.');

}
function adm_fichas_b (c) {
respuestag.innerHTML = cent('Se han eliminado '+bo(c)+'.');
}

function lista_ruta_obj (id,t) {

posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 60, colortitulo, 'solid', '1px', colorpes2, carg+'Buscando sus rutas....');
makeRequest('tarjeta/listaruta.php?id='+id+'&t='+t, adm_tarjeta_xml);
}

function enlazar_obj (id,t) {

posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 100, colortitulo, 'solid', '1px', colorpes2,
itabla('100%',tio('Crear una ruta hacia mi negocio',obusc),'','tarjeta/nuevaruta.php',encmf)
+'<input type=hidden name="id" value="'+id+'">'
+'<input type=hidden name="t" value="'+t+'">'
+td2(c_div('respuestag', font(12)))
+td('Escriba el nombre de la ruta:', cInput('d1', ''))
+td('Descripcion:', cInput('d2', ''))
+fined('Continuar'));

}

function lista_1_ruta_obj (obj) {

datos = '';
if (obj.c) {
datos = '<ul>';
for (i = 0; i < obj.c; i++) {
datos += '<li>'+ ahref('buscar_ruta_obj('+obj.id+','+obj.d[i].id+',\''+obj.t+'\')', bo(obj.d[i].titulo))+'</li>';
}
datos += '</ul>';
tam1 = 450;
} else
tam1 = 180;
posmuestraobj(loc_ventana_y,loc_ventana_x, 450, tam1, colortitulo, 'solid', '1px', colorpes2,
it('100%')
+th2('Seleccione la ruta que desea editar')
+td2(datos)
+td2('<br><br>')
+dt
+itabla('100%',tio('Crear una ruta hacia mi negocio',obusc),'','tarjeta/nuevaruta.php',encmf)
+'<input type=hidden name="id" value="'+obj.id+'">'
+'<input type=hidden name="t" value="'+obj.t+'">'
+td2(c_div('respuestag', font(12)))
+td('Escriba el nombre de la ruta:', cInput('d1', ''))
+td('Descripcion:', cInput('d2', ''))
+fined('Continuar'));
}
function buscar_ruta_obj (id, idr,t) {

posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 60, colortitulo, 'solid', '1px', colorpes2, carg+'Buscando los nodos de la ruta....');
makeRequest('tarjeta/listanodoruta.php?id='+id+'&idr='+idr+'&t='+t, adm_tarjeta_xml);
}
function eliminar_nodo_obj (id, idr,idn) {

posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 60, colortitulo, 'solid', '1px', colorpes2, carg+'Eliminando el nodo de la ruta....');
makeRequest('tarjeta/eliminarnodoruta.php?id='+id+'&idr='+idr+'&idn='+idn, adm_tarjeta_xml);
}

function insertar_ruta_obj (obj) {

datos = '';
if (obj.c) {
datos = '<ul>';
for (i = 0; i < obj.c; i++) {
datos += '<li>'+ahref('eliminar_nodo_obj('+obj.id+','+obj.d[i].idruta+','+obj.d[i].id+')', 'Eliminar')+' '+obj.d[i].nombre+'</li>';
}
datos += '</ul>';
tam1 = 400;
} else
tam1 = 180;
posmuestraobj(loc_ventana_y,loc_ventana_x, 450, tam1, colortitulo, 'solid', '1px', colorpes2,
it('100%')+th2('Lista de nodos')+td2(datos)+td2('<br><br>')+dt
+itabla('100%',tio('Agregar un nuevo nodo a la ruta',obusc),'','tarjeta/nuevopunto.php',encmf)
+'<input type=hidden name="id" value="'+obj.id+'">'
+'<input type=hidden name="idr" value="'+obj.idr+'">'
+'<input type=hidden name="t" value="'+obj.t+'">'
+td2(c_div('respuestag', font(12)))
+td('Escriba el Acceso llegale del lugar:', cInput('d1', ''))
+td('Comentarios:', cInput('d2', ''))
+fined('Guardar'));
}
function ver_ruta (id) {
posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 60, colortitulo, 'solid', '1px', colorpes2, carg+'Buscando ruta....');
makeRequest('tarjeta/buscarruta.php?id='+id, adm_tarjeta_xml);
}
var objruta;
function monstrar_ruta (obj) {
objruta = obj;
txt = it(440)+th2('Ruta');
for (i = 0; i < obj.c; i++) {
txt += td('<img src="'+obj.d[i][4]+'" width=32 height=32>',ahref('ir_a('+obj.d[i][2]+','+obj.d[i][3]+',4);monstrar_ruta (objruta);mflecha ('+obj.d[i][5]+','+obj.d[i][6]+')', obj.d[i][1]));
}
posmuestraobj(loc_ventana_y,loc_ventana_x, 450, 460, colortitulo, 'solid', '1px', colorpes2, txt+dt);
}


var rutaactiva = 0;
var idruta = 0;
var objrutaactiva;
var objrutaactivaobjetos = 0;
var diverror = new Array();
diverror = {11:795, 10:780, 9:740, 8:670, 7:530, 6:260, 5:-300, 4:-1400, 3:-3650, 2:-8100};
var divruta = new Array();
divruta = {11:512,10:256,9:128,8:64,7:32,6:16,5:8,4:4,3:2,2:1};
var lruta = 15;
var movernodo = false;
var cmx,cmy;
var objnodo;
var nodoactivo = -1;
function crear_obj_mt (a1) {
if (a1) {
return c_div('modott',styleayuda+w1(140)+h1(18)+t1(5)+l1(15),
'Actualizar Imagen','actualizar_img(this)','align=center')
+c_div('ruta',styleayuda+w1(140)+h1(18)+t1(65)+l1(15),
'Editor de rutas','inicioruta(this)','align=center')
+iconoruta('/folder.png','Abrir una ruta','abrirruta();')
+iconoruta('/folder/FireWire.png', 'Crear una nueva ruta', 'nuevaruta();')
+iconoruta('/button_ok.png','Renombrar ruta','renombrarruta();')
+iconoruta('/nuevo.documento.png','Ver/ocultar la ruta','ocultarrutausuario(this);')
+iconoruta('/documento.png','Agregar un nuevo nodo','nuevonodo_ruta_ruta(this);')
+iconoruta('/actions/stop.png','Eliminar esta ruta','ruta_eliminar();');
} else {
return '';
}
}
function iconoruta (i,t,oc) {
txt = c_div('',styleayuda+w1(18)+h1(18)+t1(83)+l1(lruta)+cur('hand'),'<img src="'+diri+i+'" border=0 width="16" title="'+t+'" height="16">',oc,'align="center"');
lruta += 18;
return txt;
}
function abrirruta () {makeRequest('php/ruta/lista.php?', adm_tarjeta_xml);}
function listarutas (obj) {
rutaslistanodos = '';
for (i = 0; i < obj.c; i++) {
rutaslistanodos += '<li>'+ahref('obtenerruta('+obj.d[i][0]+')',obj.d[i][1])+'</li>';
}
posmuestraobj(loc_ventana_y,loc_ventana_x,320,200,colorpes1,'solid','1px',colorpes2, it('100%', font(12))
+titulo_menu('Lista de rutas',310)
+th2('Seleccione una ruta a editar')
+td2('<ul>'+rutaslistanodos+'</ul>')
+dt,ovea);
}
function renombrarruta () {
badm = cbotton('enviar','Guardar', 'editarnombre('+cvvalores(3)+');');
posmuestraobj(loc_ventana_y,loc_ventana_x, 400, 250, colorpes1, 'solid', '1px', colorpes2,
formulario('','','')
+c_div('', pos+l1(0)+t1(0)+w1('100%')+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'),
tio('Destalles de la ruta',obusc))
+c_div('','',it('95%')+td2('<br><br>')
+td2(c_div('respuestag', font(12)))
+td('Nombre de la ruta:', cInput('d1', ''))
+tda('d2','',45,7)
+td2(c_div('gpinfo','',cent(badm)))
+'</form>'+dt));
}
function editarnombre (l) {
gpinfo.innerHTML = cent('Espere un momento por favor, guardando');
makeRequest('php/ruta/editarnombre.php?idr='+idruta+l, adm_tarjeta_xml);
}
function cvvalores (c) {
r = '';
for (i = 1; i < c; i++) r += '&d'+i+'=\'+d'+i+'.value+\'';
return '\''+r+'\'';
}
function obtenerruta (i) {
idruta = i;
makeRequest('php/ruta/ruta.php?idr='+idruta, adm_tarjeta_xml);
}
function nuevaruta() {idruta = 0;}
function inicioruta (obj) {
if (rutaactiva == 1){
rutaactiva=0;
obj.style.backgroundColor=modotc2;
} else{
rutaactiva=1;
obj.style.backgroundColor=modotc1;
if (objrutaactivaobjetos) {
dibujarruta(objrutaactiva);
} else
makeRequest('php/ruta/ruta.php?idr='+idruta, adm_tarjeta_xml);
}
}
function nuevonodo_ruta_ruta (obj) {
if (objrutaactivaobjetos) {
if (rutaactiva == 1){
rutaactiva=0;
obj.style.backgroundColor=modotc2;
} else{
rutaactiva=1;
obj.style.backgroundColor=modotc1;
dibujarruta(objrutaactiva);
}
}
}
function ocultarrutausuario (obj) {
if (objrutaactivaobjetos) {
if (objrutaactivaobjetos == 1){
objrutaactivaobjetos=2;
obj.style.backgroundColor=modotc2;
borrar_puntos ();
} else {
objrutaactivaobjetos=1;
obj.style.backgroundColor=modotc1;
dibujarruta(objrutaactiva);
}
}
}
function dlinearuta(x,y,x1,y1,x2,y2) {
ilineax = x+x1-5;
ilineay = y+y1-5;
ipantallax1=x2-5;
ipantallay1=y2-5;
var g = new jsGraphics(iniciopoligono ());
d_elipse(g,'blue',ipantallax1,ipantallay1);
makeRequest('php/ruta/gpunto.php?'
+'&x='+ilineax+'&y='+ilineay
+'&x1='+ipantallax1+'&y1='+ipantallay1
+'&esc='+EscalaMapa+'&idr='+idruta, adm_tarjeta_xml);
}
function dibujarruta(obj,nog) {
if (nog) objrutaactiva = obj;
objrutaactivaobjetos = 1;
var g = new jsGraphics(iniciopoligono ());
dg_calle(g, 4,'blue',ob_arr_ruta(obj.c, 1, obj.Xpoints),ob_arr_ruta(obj.c, 2, obj.Ypoints), 0, 0);
if (obj.n == 1) {
ihtml='';
for (i = 0; i < obj.c; i++) {
x = ob_punto_ruta(1, obj.Xpoints[i])-7;
y = ob_punto_ruta(2, obj.Ypoints[i])-7;
if (x > 0 && x < srx && y > 0 && y < sry) {
ihtml += c_div('na'+i,pos+bgcolor('0000cc')+cur('hand')+oveh+t1(y)+l1(x)+w1(14)+h1(14),'','',
'onmousedown="iniciomovernodo(this,'+i+',e);" onmousemove="mmovernodo(e);" onmouseup="finmovernodo(e);"'
+ ' title="De un click en el nodo para ver las opciones"');
}
}
nombrep.innerHTML += ihtml;
movernodo = false;
buscadores = 0;
}
}
function dibujarrutas(obj) {
urchinTracker('rutas/'+EscalaMapa);
ocultar_buscador();
calles = '';
for (var i = 0; i < obj.c; i++) {
calles += td(c_div('', w1(50)+h1(20)+bgcolor(obj.detalles[i].color)+oveh,'&nbsp;'),
obj.detalles[i].titulo
+(obj.detalles[i].descripcion ? '<br>Descripcion:'+bo(obj.detalles[i].descripcion):''));
}
posmuestraobj(loc_ventana_y,loc_ventana_x,450, 150, colorpes1,'solid','1px',colorpes2,
c_div('', pos+t1(0)+w1(450)+ovea,
it('100%', font(12))
+titulo_bobj(it('100%', font(12))+th('Rutas localizadas',c_div('','',bo('[ X ]'), 'ocultarobj()'))+dt, colorpes1)
+td2(it('100%')+calles+dt)
+dt),ovea);
var g = new jsGraphics(iniciopoligono ());
for (i1 = 0; i1 < obj.c; i1++) {
dg_calle(g, 4, obj.r[i1].color, ob_arr_ruta(obj.r[i1].c, 1, obj.r[i1].Xpoints), ob_arr_ruta(obj.r[i1].c, 2, obj.r[i1].Ypoints), 0, 0);
}
g.paint();
}
function titulo_menu (tx,w) {return titulo_bobj(it('100%', font(12))+th(tx, c_div('',pos+l1(w-30)+cur('hand'), bo('<font size=-1>[ X ]</font>'), 'ocultarobj()'))+dt, colorpes1);}
function menunodo (i,e) {
posmuestraobj(dety(e),detx(e),165,140,colorpes1,'solid','1px',colorpes2, it('100%', font(12))
+titulo_menu('Nodo',160)
+td2(ahref('eliminarnodo ('+i+')','Eliminar nodo'))
+td2(ahref('agregardatos('+i+')', 'Agregar datos al nodo'))
+td2('<hr>')
+td2(ahref('copiar_ruta()', 'Copiar esta ruta'))
+td2(ahref('copiar_hasta('+i+')', 'Copiar hasta aqu&iacute;'))
+td2(ahref('copiar_desde('+i+')', 'Copiar desde aqu&iacute;'))
+td2(ahref('orientacion()', 'Cambiar el inicio de la ruta'))
+dt,oveh);
}
function insertarnodo (i) {makeRequest('php/ruta/insertar_nodo.php?idr='+idruta+'&i='+i, adm_tarjeta_xml);}
function copiar_ruta () {makeRequest('php/ruta/copiar_ruta.php?idr='+idruta, adm_tarjeta_xml);}
function copiar_hasta (i) {makeRequest('php/ruta/copiar_hasta.php?idr='+idruta+'&i='+i, adm_tarjeta_xml);}
function copiar_desde (i) {makeRequest('php/ruta/copiar_desde.php?idr='+idruta+'&i='+i, adm_tarjeta_xml);}
function orientacion () {makeRequest('php/ruta/reorientar.php?idr='+idruta, adm_tarjeta_xml);}
function agregardatos (i) {
badm = cbotton('enviar','Guardar', 'editarnodo('+cvvalores(4)+');');
posmuestraobj(loc_ventana_y,loc_ventana_x, 400, 250, colorpes1, 'solid', '1px', colorpes2,
formulario('','','')
+chidden('d3', i)
+c_div('', pos+l1(0)+t1(0)+w1('100%')+h1(25)+font(12)+bgcolor(colorpes3)+cur('default'),
tio('Destalles de este nodo',obusc))
+c_div('','',it('95%')+td2('<br><br>')
+td2(c_div('respuestag', font(12)))
+td('titulo:', cInput('d1', ''))
+tda('d2','',45,7)
+td2(c_div('gpinfo','',cent(badm)))
+'</form>'+dt));
}
function editarnodo (l) {
gpinfo.innerHTML = cent('Espere un momento por favor, guardando');
makeRequest('php/ruta/editarnodo.php?idr='+idruta+l, adm_tarjeta_xml);
}
function ruta_eliminar () {
posmuestraobj((sry/2)-75,(srx/2)-200,400,150,colorpes1,'solid','1px',colorpes2, it('100%', font(12))
+titulo_bobj(it('100%', font(14))+th('Alerta',c_div('','',bo('[ X ]'), 'ocultarobj()'))+dt, colorpes1)
+th2('<br><font size=+1>&#191;Desea eliminar esta ruta?</font>')
+th(ahref('confirmareliminarruta();ocultarobj()', '<font size=+1>Si</font>'),
ahref('ocultarobj()','<font size=+1>No</font>'))
+dt);
}
function confirmareliminarruta () {
makeRequest('php/ruta/eliminarruta.php?idr='+idruta, adm_tarjeta_xml);
idruta = 0;
rutaactiva = 0;
objrutaactivaobjetos = 0;
}
function eliminarnodo (i) {
posmuestraobj((sry/2)-75,(srx/2)-200,400,150,colorpes1,'solid','1px',colorpes2, it('100%', font(12))
+titulo_bobj(it('100%', font(14))+th('Alerta',c_div('','',bo('[ X ]'), 'ocultarobj()'))+dt, colorpes1)
+th2('<br><font size=+1>&#191;Desea eliminar este nodo?</font>')
+th(ahref('confirmareliminarnodo('+i+');ocultarobj()', '<font size=+1>Si</font>'),
ahref('ocultarobj()','<font size=+1>No</font>'))
+dt);
}
function confirmareliminarnodo(i) {makeRequest('php/ruta/eliminar.php?i='+i+'&idr='+idruta, adm_tarjeta_xml);}
function iniciomovernodo (obj,i,e) {
movernodo = true;
buscadores = 10;
objnodo = obj;
cmx = detx (e);
cmy = dety (e);
nodoactivo = i;
}
function mmovernodo (e) {
if (movernodo) {
objnodo.style.top = dety (e)-7;
objnodo.style.left = detx (e)-7;
}
}
function finmovernodo(e) {
if (cmx == detx (e) && cmy == dety (e)) {
menunodo(nodoactivo,e);
/*eliminarnodo (nodoactivo);*/
nodoactivo = -1;
} else {
if (nodoactivo != -1) {
x = objetos[0][0][1] - objetos[0][0][0].offsetLeft+detx (e);
y = objetos[0][0][2] - objetos[0][0][0].offsetTop+dety (e);
makeRequest('php/ruta/epunto.php?&x='+x+'&y='+y+'&i='+nodoactivo
+'&esc='+EscalaMapa+'&idr='+idruta, adm_tarjeta_xml);
movernodo = false;
nodoactivo = -1;
}
}
}
function ob_arr_ruta (c, xy, obj) {
var v = new Array();
for (i = 0; i < c; i++) {
v[i] = (obj[i]/divruta[EscalaMapa])-objetos[0][0][xy]+(xy ==1 ? objetos[0][0][0].offsetLeft : objetos[0][0][0].offsetTop+diverror[EscalaMapa]);
}
return v;
}
function ob_punto_ruta (xy, v) {return (v/divruta[EscalaMapa])-objetos[0][0][xy]+(xy ==1 ? objetos[0][0][0].offsetLeft : objetos[0][0][0].offsetTop+diverror[EscalaMapa]);}
function d_elipse(g,color, x, y) {
g.setColor(color);
g.fillEllipse(x,y,12,12);
g.paint();
}
function dg_calle(g, s,color, obj1,obj2,x,y) {
g.setStroke(s);
if (x != 0)
d_elipse(g,color, x, y);
g.setColor(color);
g.drawPolyline(obj1,obj2);
g.paint();
}





var iwiki = 'http://www.llegalemapas.com/wiki/index.php/';
var ocultar_ventana_var = c_div('', pos+t1(8)+l1(770)+cur('hand'), '[ X ]', 'ocultar_ventana (0, 35)', 'title="Ocultar Ventana" onmousemove="this.innerHTML=bo(\'[ X ]\')" onmouseout="this.innerHTML=\'[ X ]\'"');
function varr (obj) {
posmuestraobj(
obj.t ? obj.t : 0,
obj.l ? obj.l : 0,
obj.w ? obj.w : 50,
obj.h ? obj.h : 50,
obj.borde ? obj.borde : '',
obj.estilo ? obj.estilo : '',
obj.anchoborde ? obj.andoborde : '',
obj.fondo ? obj.fondo : '',
obj.html ? obj.html : '',
obj.overflow ? obj.overflow : '',
obj.mpest ? obj.mpest : '',
obj.id ? obj.id : '',
obj.ayuda ? obj.ayuda : '',
obj.titulo ? obj.titulo : '',
obj.bextra ? obj.bextra : '',
obj.accionextra ? obj.accionextra : '',
obj.tituloe ? obj.tituloe : '');
}
function posmuestraobj(top, left, width, height, bcolor, bstyle, bwidth, bgcolorpantalla, html, overflowt, mpest, id, ayuda, titulov, bextra, accionexra, tituloaextra) {
if ((width + left) > srx) left = srx - width;
if ((height + top) > sry) top = sry - height;
f.style.top = top;
f.style.left = left;
f.style.width = width+9;
f.style.height = height+30;
/*f.style.backgroundColor = bgcolorpantalla;*/
/*f.style.backgroundImage = 'url(imagen/kiosko/ventana/2.png)';*/
extracc = 0;
extracch = 0;
imagencc = '';
if (mpest >= 1) {
if (mpest == 1) {
iglesias (id);
} else if (mpest == 2) {
industria (id);
extracc = 40;
extracch = 164;
f.style.width = width+9+extracc;
if (modcolor == 'cc')
imagencc = '<img src="imagen/comunidad.canaco/catalogo.virtual.gif" width="40" height="164" />';
else
imagencc = '<img src="imagen/catalogo.virtual.gif" width="40" height="164" />';
imagencc = c_div('', pos+t1(0)+ovea+l1(width+10)+w1(extracc)+h1(extracch), imagencc, 'ocultarobj();buscar_catalogo('+id+')');
}
txt = c_div('contpest',pos+oveh+t1(0)+l1(0)+w1(width)+h1(18),c_pest(pestana_neg,0),'',' onmousemove="click1=false;"')
+c_div('contneg',pos+ovea+t1(18)+l1(0)+w1(width)+h1(height-18),html ? html : '','',' onmousemove="click1 = false;"');
} else {
txt = c_div('contneg',pos+(overflowt ? overflowt : ovea)+t1(0)+l1(0)+w1(width)+h1(height),html,'',' onmousemove="click1 = false;"');
}
colorff = ' onmousemove="this.style.borderColor=\'black\';this.style.backgroundImage=\'url(imagen/4a.png)\';click1=false;"; '
+'onmouseout="this.style.borderColor=\'gray\';this.style.backgroundImage=\'url(imagen/4.png)\';";';
ayudat = '';
be = '';
tituloventana = '';
restl = 0;
if (ayuda != undefined) {
if (ayuda != '') {
ayudat = c_div('', pos+oveh+t1(3)+l1(width-42)+w1(20)+h1(18)+border('gray', 'solid',1)+cur('hand')+font(14),
bo(cent('<a href="'+iwiki+ayuda+'" title="Ayuda" target="wiki"><font color="black">?</font></a>')), '', ' title="Ayuda" '+colorff);
restl = 20;
}
}
if (titulov != undefined) {
if (titulov != '')
tituloventana = c_div('', pos+oveh+t1(3)+w1(width-(42+restl))+l1(0)+h1(18)+cur('hand')+font(14), bo(cent(titulov)));
}
if (bextra != undefined) {
if (bextra != '')
be = c_div('', pos+oveh+t1(3)+l1(width-(42+restl))+w1(20)+h1(18)+border('gray', 'solid',1)+cur('hand')+font(14), bo(cent(bextra)), accionexra, colorff+(tituloaextra?' title="'+tituloaextra+'"':''));
}
f.innerHTML = c_div('', pos+t1(0)+oveh+l1(0)+w1(width+12)+h1(height+32)+img_back('imagen/4.png')+border('gray', 'solid',1),
c_div('', pos+t1(0)+oveh+l1(0)+w1(width+10)+h1(height+30),
c_div('', pos+oveh+t1(3)+l1(width-22)+w1(20)+h1(18)+border('gray', 'solid',1)+cur('hand')+font(14), bo(cent('<label title="Cerrar ventana">X</label>')), 'buscadores=0;ocultarobj();', colorff)
+ayudat+tituloventana+be
+c_div('contenidoventanausuario', pos+t1(24)+oveh+l1(3)+w1(width+1)+h1(height+1)+border('gray', 'solid',1),txt), '',
' onmousemove="click1=false;";'), '',' onmousemove="click1=false;";')
+imagencc;
f.style.visibility = 'visible';
}
function marco_ventana (width, height, txt, color) {
return c_div('', pos+ovea+t1(6)+l1(6)+w1(width-13)+h1(height-16)+img_back('imagen/ventana/'+color+'_04.gif')+cur('default'), txt)
+c_div('', pos+oveh+t1(1)+l1(1)+w1(6)+h1(6)+img_back('imagen/ventana/'+color+'_00.gif')+cur('default'))
+c_div('', pos+oveh+t1(1)+l1(7)+w1(width-14)+h1(6)+img_back('imagen/ventana/'+color+'_01.gif')+cur('default'))
+c_div('', pos+oveh+t1(1)+l1(width-7)+w1(6)+h1(6)+img_back('imagen/ventana/'+color+'_02.gif')+cur('default'))
+c_div('', pos+oveh+t1(7)+l1(1)+w1(6)+h1(height-17)+img_back('imagen/ventana/'+color+'_03.gif')+cur('default'))
+c_div('', pos+oveh+t1(7)+l1(width-7)+w1(6)+h1(height-17)+img_back('imagen/ventana/'+color+'_05.gif')+cur('default'))
+c_div('', pos+oveh+t1(height-10)+l1(1)+w1(6)+h1(6)+img_back('imagen/ventana/'+color+'_06.gif')+cur('default'))
+c_div('', pos+oveh+t1(height-10)+l1(7)+w1(width-14)+h1(6)+img_back('imagen/ventana/'+color+'_07.gif')+cur('default'))
+c_div('', pos+oveh+t1(height-10)+l1(width-7)+w1(6)+h1(6)+img_back('imagen/ventana/'+color+'_08.gif')+cur('default'))
;
}
/*Crea un titulo con fondo y esquinas redondeadas*/
function marco_titulo (txt, color,w) {
return tr(td2(it(w)+tr(
'<th style="'+img_back('imagen/ventana/'+color+'-t_00.gif')+'" height=22 width=5></th>'
+'<th style="'+img_back('imagen/ventana/'+color+'-t_01.gif')+font(16)+'" height=22 width='+(w-14)+'>'+txt+'</th>'
+'<th style="'+img_back('imagen/ventana/'+color+'-t_02.gif')+'" height=22 width=5></th>'
)+dt));
}
function recomendar_pagina (n,c,e) {
posmuestraobj(loc_ventana_y,loc_ventana_x, 500, 100, colortitulo, 'solid', '1px', colorpes8,itabla(490,'')+td2(c_div('respuestag', font(12), e ? e : ''))+td('Cual es tu Nombre:', cInput('nombre', n ? n : ''))
+td('Email de tu amigo:', cInput('mail', c ? c : '')) +td2(cent(cbotton('Enviar', 'Recomendar','recomendar_enviar_pagina(nombre.value,mail.value);')))+dt,
oveh,0,0,'','Recomienda esta pagina a un amigo');
}
function recomendar_enviar_pagina(n,c) {
makeRequest('mail/index.php?n='+n+'&c='+c, adm_tarjeta_xml);
posmuestraobj(loc_ventana_y,loc_ventana_x, 500, 100, colortitulo, 'solid', '1px', colorpes8, '<p align=left><h3>'+carg+' Enviando...</h3></p>',oveh,0,0,'','Recomienda esta pagina a un amigo');
}
function gracias_recomendar (n) {
urchinTracker('/recomendar');
posmuestraobj(loc_ventana_y,loc_ventana_x, 500, 100, colortitulo, 'solid', '1px', colorpes8, '<p align=left><h3>Gracias, la recomendacion ha sido enviada a '+n+'</h3></p>',oveh,0,0,'','Recomienda esta pagina a un amigo');
}
function vservicios1 (numero) {
if (numero != 3) {
conpestana.innerHTML = marco_ventana(840, 350, carg+'Cargando...', 'FEE0A7')+ocultar_ventana_var;
makeRequest('html/pestana.php?n='+numero, adm_tarjeta_xml);
} else {
conpestana.innerHTML = marco_ventana(840, 350, mapa_estado(lciudades), 'FEE0A7')+ocultar_ventana_var;
}
if (statusventana == numero) {
ocultar_ventana (0, 35);
} else if (statusventana == 0)
mostrar_ventana (35, 0, numero);
else
statusventana = numero;
}
function vservicios (numero) {
if (numero != 3) {
conpestana.innerHTML = marco_ventana(840, 350, carg+'Cargando...', 'FEE0A7')+ocultar_ventana_var;
makeRequest('html/pestana.php?n='+numero, adm_tarjeta_xml);
} else {
conpestana.innerHTML = marco_ventana(840, 350, mapa_estado(lciudades), 'FEE0A7')+ocultar_ventana_var;
}
if (statusventana == numero) {
ocultar_ventana (0, 35);
} else if (statusventana == 0)
mostrar_ventana (35, 0, numero);
else
statusventana = numero;
}
function mapa_estado(obj) {
t = it(240)+td2(cent('<img src="imagen/boton.estados.gif" width="240" height="15" />'));
lciudad = '';
for (i =0; i < obj.cantidad; i++) {
lciudad += tr('<td valign=middle><img src="imagen/flechita.gif"></td>'+tds(ahref('mapacd2('+obj.lc[i].i+')', obj.lc[i].e, 'De un click para ver la lista de ciudades')));
}
t += td2('<table style="'+font(12)+'" border=0 cellpadding=0 cellspacing=0>'+lciudad+'</table>')+dt;
return it(810)+td(t,c_div('lcdtxt', '', '<h3>Seleccione una ciudad</h3>'))+dt;
}
function mapacd2(i) {
urchinTracker('/pestanasinferiores/3/'+i);
makeRequest('php/lista_ciudades.php?i='+i, adm_tarjeta_xml);
lcdtxt.innerHTML = '<p align=left><h3>'+carg+'Buscando...</h3></p>';
}

function enviar_comentarios (d1,d2,d3,d4,d5,d6) {
urchinTracker('/pestanasinferiores/4/enviomensaje/'+d2);
makeRequest('html/form.php?d1='+d1+'&d2='+d2+'&d3='+d3+'&d4='+d4+'&d5='+d5+'&d6='+d6, adm_tarjeta_xml);
enviarmensaje.innerHTML = 'Enviando informacion '+d1;
}

function mapa_ciudad(obj) {
t = it(540, 'style="'+font(12)+'"')+tr('<td colspan=3 width=45><img src="imagen/zoom.gif"></td><td align=left width=495><img src="imagen/boton.ciudad.gif"></td>');
base = '/pestanasinferiores/3/';
for (i =0; i < obj.cant; i++) {
t += tr(
tds(c_div('',cur('hand'),'<img src="imagen/lupa4.gif">',
'urchinTracker(\''+base+obj.i+'/'+obj.lc[i].c+'/4\');ir_a('+(((obj.lc[i].x+3)*1000)-250)+','+((obj.lc[i].y*1000)-250)+',4);ocultar_ventana (0, 35);'), 0, linbott(colorpes1,'solid',1))
+tds(c_div('',cur('hand'),'<img src="imagen/lupa6.gif">',
'urchinTracker(\''+base+obj.i+'/'+obj.lc[i].c+'/6\');ir_a('+(obj.lc[i].x*250)+','+(obj.lc[i].y*250)+',6);ocultar_ventana (0, 35);'), 0, linbott(colorpes1,'solid',1))
+tds(c_div('',cur('hand'),'<img src="imagen/lupa8.gif">',
'urchinTracker(\''+base+obj.i+'/'+obj.lc[i].c+'/8\');ir_a('+((obj.lc[i].x*62.5)-500)+','+((obj.lc[i].y*62.5)+250)+',8);ocultar_ventana (0, 35);'), 0, linbott(colorpes1,'solid',1))
+tds(ahref('urchinTracker(\''+base+obj.i+'/'+obj.lc[i].c+'/6\');ir_a('+(obj.lc[i].x*250)+','+(obj.lc[i].y*250)+',6);ocultar_ventana (0, 35);', bo(obj.lc[i].c)), 0, linbott(colorpes1,'solid',1)),1);
}
t += '</table>';
lcdtxt.innerHTML = t;

}
var statusventana =0;
function mostrar_ventana (max, tf, s) {
tf += 1;
conpestanacontenedora.style.top = sry-(tf*10)-28;
if (tf != max)
crecer_ventana1 = setTimeout('mostrar_ventana('+max+','+tf+','+s+')', 25);
else {
conpestanacontenedora.style.top = sry-(tf*10)-28;
statusventana = s;
urchinTracker('/pestanasinferiores/'+s);
}

}
function ocultar_ventana (max, tf) {
tf -= 1;
conpestanacontenedora.style.top = sry-(tf*10)-32;
if (tf != max)
crecer_ventana1 = setTimeout('ocultar_ventana('+max+','+tf+')', 25);
else {
conpestanacontenedora.style.top = sry-32;
statusventana = 0;
}

}

function crecer_ventana (max,tf) {
tf += 10;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,tf,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh,0,0,ayudaciudad1,'Ciudad:'+nombre_ciudad);
if (tf < max)
crecer_ventana1 = setTimeout('crecer_ventana('+max+','+tf+')', 25);
else
posmuestraobj(loc_ventana_y,loc_ventana_x,450,max,bgpred,'solid','1px',colortn, detalles_calle_txt,oveh,0,0,ayudaciudad1,'Ciudad:'+nombre_ciudad,'-','reducir_ventana(350)','Reduce esta ventana');
}

function reducir_ventana (tf) {
tf -= 10;
posmuestraobj(loc_ventana_y,loc_ventana_x,450,tf,bgpred,'solid','1px',colortn, detalles_calle_txt, oveh,0,0, ayudaciudad1,'Ciudad:'+nombre_ciudad);
if (tf != 0)
crecer_ventana1 = setTimeout('reducir_ventana('+tf+')', 25);
else
posmuestraobj(loc_ventana_y,loc_ventana_x,450,0,bgpred,'solid','1px',colortn,detalles_calle_txt,oveh,0,0,ayudaciudad1,'Ciudad:'+nombre_ciudad,'+','crecer_ventana(350,0)','Amplia esta ventana');
}function buscar_catalogo (id, p) {

posmuestraobj(loc_ventana_y,loc_ventana_x, 920, 500, colortitulo, 'solid', '1px', colorpes8, 'Buscando catalogo virtual', oveh,0,0,'','Catalogo Virtual');
makeRequest('php/catalogo/?id='+id+'&p='+(p ? p : 0), adm_tarjeta_xml);

}
var cat_obj;
function mostrar_catalogo (obj) {

cat_obj = obj;

if (obj.c != 0) {
txt = it('120');
for (i = 0; i < obj.c; i++) {
txt += tdn('<img src="php/catalogo/img.php?m=1&id='+obj.d[i].id+'" width=120 height=120 onclick="ecc('+i+')" style="'+cur('hand')+'">')
+tdn(cent('<a href="'+jsv+'" onclick="ecc('+i+')">'+obj.d[i].t+'</a>'));
}
txt += dt;
txt = it('900')+tr(tds(c_div('obj_catalogo', 'overflow:auto;'+h1(490)+w1(780), contenido_catalogo(obj.d[0].id,obj.d[0].t1,obj.d[0].d,obj.d[0].p,obj.d[0].u)), 780)
+tds(c_div('', 'overflow:auto;'+h1(490)+w1(140), txt)))+dt;
} else {
txt = cent('Este lugar no tiene ningun catalogo dado de alta');
}
posmuestraobj(loc_ventana_y,loc_ventana_x, 920, 500, colortitulo, 'solid', '1px', colorpes8, txt, oveh,0,0,'Catalogo_Virtual','Catalogo Virtual');

}

function contenido_catalogo (id, t,d, p, u) {

return cent(bo(cent(t)))+'<br><img src="php/catalogo/img.php?m=0&id='+id+'" width=780><br><p align="justify">'+d+'</p>'
+(p ? '<br>Precio: <b>$'+p+'</b>' : '')+(u ? '<br>Pagina relacionada: <b><a href="'+u+'" target="_new">'+u+'</a></b>' : '');

}

function ecc (i) {

obj_catalogo.innerHTML = contenido_catalogo (cat_obj.d[i].id, cat_obj.d[i].t1,cat_obj.d[i].d, cat_obj.d[i].p, cat_obj.d[i].u);
}var aquiestoyoffsetx;
var aquiestoyoffsety;
var aquiestoyoffsetx_actual;
var aquiestoyoffsety_actual;
function aquiestoy () {
ocultar_buscador();
if (EscalaMapa < 9) {
posmuestraobj(loc_ventana_y,loc_ventana_x, 300, 200, colortitulo, 'solid', '1px', colorpes8, itabla(490,aquiestoy_aquiestoy_1)
+td2(aquiestoy_aquiestoy_2)+dt,
oveh,0,0,'',aquiestoy_aquiestoy_3);
buscadores = 7;
} else
posmuestraobj(loc_ventana_y,loc_ventana_x, 300, 200, colortitulo, 'solid', '1px', colorpes8, itabla(490,aquiestoy_aquiestoy_4)
+td2(aquiestoy_aquiestoy_5)+dt,
oveh,0,0,'',aquiestoy_aquiestoy_3);
}
var actualx_aqui;
var actualy_aqui;
var actuale_aqui;
actuale_aqui = 0;
var actualv_aqui;
actualv_aqui = 0;
function aquiestoy_marcarlugar () {
switch(EscalaMapa) {
case 2:Ajustey = 4864; break;
case 3:Ajustey = 3244; break;
case 4:Ajustey = 0; break;
case 5:Ajustey = -6480; break;
case 6:Ajustey = -19400; break;
case 7:Ajustey = -45400; break;
case 8:Ajustey = -98000; break;
}
buscadores=0;
/*aquiestoyp.style.top = idty1-45;
aquiestoyp.style.left = idtx1-45;*/

aquiestoyp.style.visibility = 'visible';

actualx_aqui = idtx;
actualy_aqui = idty+Ajustey;
actuale_aqui = 1;
actualv_aqui = EscalaMapa;
aquiestoyoffsety = idty1-45;/*((actualy_aqui/mult)-impre[2])-idty1;*/
aquiestoyoffsetx = idtx1-45;/*((actualx_aqui/mult)-impre[1])-idtx1;*/
reubicar_origen ();
ocultarobj();
urchinTracker('/ubicacionpersonal');
setCookie('actualx_aqui',actualx_aqui);
setCookie('actualy_aqui',actualy_aqui);
}
function maqui (x,y) {
if (actualv_aqui) {
d_nult ();
/*if (y_mov_aqui && x_mov_aqui) {
aquiestoyoffsety = ((actualy_aqui/mult)-impre[2])-y_mov_aqui;
aquiestoyoffsetx = ((actualx_aqui/mult)-impre[1])-x_mov_aqui;

reubicar_origen ();
actualv_aqui = EscalaMapa;
aquiestoyp.style.visibility = 'visible';
} else {*/
/*x = aquiestoyp.offsetLeft - x;
y = aquiestoyp.offsetTop-y;
aquiestoyp.style.top = y;
aquiestoyp.style.left = x;*/

aquiestoyoffsetx = aquiestoyoffsetx - x;
aquiestoyoffsety = aquiestoyoffsety - y;
reubicar_origen ();
aquiestoyp.style.visibility = 'visible';
/*}*/
} else {
aquiestoyp.style.top = -1000;
aquiestoyp.style.left = -1000;
aquiestoyp.style.visibility = 'hidden';
}
}
function ira_aqui (x, y, esci) {
if (actualv_aqui) {
d_nult ();
aquiestoyoffsety = ((actualy_aqui/mult)-impre[2])-y_mov_aqui;
aquiestoyoffsetx = ((actualx_aqui/mult)-impre[1])-x_mov_aqui;
/*alert(aquiestoyoffsetx + ', '+aquiestoyoffsety);*/
/*aquiestoyoffsetx = aquiestoyoffsetx - x;
aquiestoyoffsety = aquiestoyoffsety - y;*/
actualv_aqui = EscalaMapa;
reubicar_origen ();
}
}
function reubicar_origen () {
minX = 15;
maxX = srx-152;
minY = 110;
maxY = sry-114;
if (aquiestoyoffsetx < minX)
aquiestoyoffsetx_actual = minX;
else if (aquiestoyoffsetx > maxX)
aquiestoyoffsetx_actual = maxX;

else
aquiestoyoffsetx_actual = aquiestoyoffsetx;

if (aquiestoyoffsety < minY)
aquiestoyoffsety_actual = minY;
else if (aquiestoyoffsety > maxY)
aquiestoyoffsety_actual = maxY;
else
aquiestoyoffsety_actual = aquiestoyoffsety;

aquiestoyp.style.top = aquiestoyoffsety_actual;
aquiestoyp.style.left = aquiestoyoffsetx_actual;
aquiestoyp.style.visibility = 'visible';
if (aquiestoyoffsetx_actual == minX && aquiestoyoffsety_actual == minY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/noroeste.png)';
else if (aquiestoyoffsetx_actual == maxX && aquiestoyoffsety_actual == minY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/noreste.png)';
else if (aquiestoyoffsetx_actual == minX && aquiestoyoffsety_actual == maxY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/suroeste.png)';
else if (aquiestoyoffsetx_actual == maxX && aquiestoyoffsety_actual == maxY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/sureste.png)';
else if (aquiestoyoffsetx_actual == minX && aquiestoyoffsety_actual != minY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/izquierda.png)';
else if (aquiestoyoffsetx_actual != minX && aquiestoyoffsety_actual == minY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/arriba.png)';
else if (aquiestoyoffsetx_actual == maxX && aquiestoyoffsety_actual != maxY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/derecha.png)';
else if (aquiestoyoffsetx_actual != maxX && aquiestoyoffsety_actual == maxY)
aquiestoyp.style.backgroundImage = 'url(imagen/origen/abajo.png)';
else
aquiestoyp.style.backgroundImage = 'url(imagen/origen/aqui.png)';
}function clima_mod (d1,d2,d3,d4) {

clima.style.top = 110;
clima.style.left = srx-360;
clima.style.width = 350;
clima.style.height = 250;
clima.style.overflow = 'scroll';
clima.style.backgroundImage = 'url(imagen/4a.png)';
clima.style.cursor = 'default';
clima.innerHTML = it()
+th(d1,c_div('', cur('hand'), '<p align=right>[ X ]</p>', 'oclima_mod();'))
+td2('<font style="font-size:12px;">'+d2+'</font>')
+th(d3, c_div('', cur('hand'), '<p align=right>[ X ]</p>', 'oclima_mod();'))
+td2('<font style="font-size:12px;">'+d4+'</font>')+dt;

}

function oclima_mod () {
clima.style.top = -200;
clima.style.left = -200;
clima.style.width = 0;
clima.style.height = 0;
clima.innerHTML = '';
setCookie('clima_cc',0);

}dirk = 'php/kiosko/';
kiosko_lista_v = tr(ths(cent(ahref('administrar_kiosko ()', 'Acutalizar lista')), '', '', 'colspan=5'));
kiosko_inicio = ahref('administrar_kiosko ()', 'Regreso a lista de kioskos');
function administrar_kiosko () {
html = tc(td2(carg+'Buscando informacion...'));
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'index.php?', adm_tarjeta_xml);
}
/* Muestra la lista de los kioskos */
function kiosko_lista (obj) {

txt = kiosko_lista_v;
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
txt += tr(tds(ahref('kiosko_reload('+obj.d[i][0]+')', '<img src="img/reload_page.gif" width=24 height=24 border=0>'), '25', border1('black', 'solid',1)+colordn)
+tds(ahref('kiosko_detalles('+obj.d[i][0]+')', '<img src="img/page_break.png" width=24 height=24 border=0>'), '25', border1('black', 'solid',1)+colordn)
+tds('<a href="http://www.llegalemapas.com/beta/anfitrion/anfitrion.php?g='+obj.d[i][1]+'" target="_guiatur">http</a>', '50', border1('black', 'solid',1)+colordn)
+tds(obj.d[i][2], '75', border1('black', 'solid',1)+colordn)
+tds(ahref('kiosko_detalles(\''+obj.d[i][1]+'\')', bo(obj.d[i][1])), '275', border1('black', 'solid',1)+colordn ));
}
html = tc(txt);
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":300, "html":html,"titulo":titulo});
}
function kiosko_reload(id) {
html = tc(td2(carg+'Reiniciando kiosko...'));
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'index.php?r='+id, adm_tarjeta_xml);
}
/* busca los detalles del kiosko seleccionado*/
function kiosko_detalles(id) {
html = tc(td2(carg+'Buscando kiosko...')+tr(tds(cent(kiosko_inicio), '', '', 'colspan=5')));
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'detalles.php?id='+id, adm_tarjeta_xml);
}
/* Muestra los detalles del kiosko seleccionado*/
function kiosko_detalles_xml(obj) {
titulo = 'Administraci&oacute;n de kioskos';
html = tc(tr(ths('Detalles del kiosko', '', '', 'colspan=5'))
+td2(cent(kiosko_inicio))
+td('Administrar kiosko: ', bo(ftt(obj[0].guia, 22)), 0, 0, img_back('imagen/4a.png')+bgcolor('FEE0A7'))
+td('Ubicacion:', bo('('+obj[0].idll+') <a href="http://'+obj[0].idll+'.llegalemapas.com" target="_kiosko">'+obj[0].nombre+'</a>'))
+td2(ahref('kiosko_editar_guia_buscar(\''+obj[0].guia+'\',0)', '<img src="imagen/botones/boton.editar.guia.png" border=0>')
+ahref('kiosko_editar_guia_rotacion_buscar(\''+obj[0].guia+'\')', '<img src="imagen/botones/boton.edit.videos.enrot.png" border=0>')+'<br>')
+tr(ths('Cambiar ubicacion', '', '', 'colspan=5'))
/* Muestra el formulario para cambiar la ubicacion del kiosko */
+'<form name="formkiosko" action="'+jsv+'">'
+th2('Especifica el numero del acceso llegale del nuevo lugar')
+td('Acceso llegale del lugar',cInput('kioskoidll', obj[0].idll)+cbotton('Guardar', 'Guardar', 'kiosko_editar_ubicacion_guardar(\''+obj[0].guia+'\', formkiosko.kioskoidll.value)'))
+td2(cent(bo('Especifique el acceso llegale del lugar')))
+td2(c_div('errorkioskolugar'))
+'</form>'
, w1('100%'))
+dt;
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":300, "html":html,"titulo":titulo});
}
var error_info_k = 'Error: '+bo('No se pudo guardar la informacion con exito');
var info_lugar_guardado = bo('La informacion ha sido actualizada con exito');
/* Cambia la ubicacion de un kiosko*/
function kiosko_editar_ubicacion_guardar (id,idll) {
errorkioskolugar.innerHTML = carg+'Espere un momento guardando la informacion';
makeRequest(dirk+'ubicacion_guardar.php?id='+id+'&idll='+idll);
}
function kiosko_respuesta(txt) {
errorkioskolugar.innerHTML = txt;
}
/* Videos en Rotacion, mientras no se usa la maquina */
function kiosko_editar_guia_rotacion_buscar (id) {

html = tc(td2(carg+'Buscando videos...')+tr(tds(cent(kiosko_inicio), '', '', 'colspan=5')));
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'guia_r.php?id='+id+'&guia='+g, adm_tarjeta_xml);
}
/* Formulario para guardar videos en Rotacion, mientras no se usa la maquina */
function kiosko_editar_guia_rotacion_lugar (obj) {
html = '';
if (obj.c != 0) {
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
html += td('Video:', ahref('kiosko_editar_guia_lugar_eliminar(\''+obj.id+'\', '+obj.grupo+', '+obj.idll+', '+obj.d[i].id+')', '<img src="imagen/kiosko/eliminar.png" title="Eliminar este video" border=0>')
+ahref('kiosko_vervideo('+obj.d[i].id+')', '<img src="imagen/kiosko/ver.png" title="Ver video" border=0>')
+ahref('kiosko_vervideo('+obj.d[i].id+')', bo(obj.d[i].titulo ? obj.d[i].titulo : '[ Sin Titulo ]')), 12, 0, colordn)
+td('', bo(obj.d[i].fecha)+' ('+obj.d[i].tipo+')', 10, 0, colordn);
}
} else
html += td2(cent('No se han dado de alta videos para este lugar'));
html = tc(tr(tds(cent(kiosko_inicio), '', '', 'colspan=5'))
+th2('Videos en rotacion (pantalla superior)')
/* Muestra el formulario para dar de alta nuevos campos en la guia turistica */
+html
+'<form method="post" enctype="multipart/form-data" name="formkiosko1" onsubmit="kiosko_editar_guia_rotacion_lugar_guardar_video()" action="'+dirk+'guia_lugar_rotacion_guardar.php" target="formulariokioskoguia">'
+chidden('id', obj.id)
+th2('Subir un nuevo video para que aparesca en la pantalla superior')
+td('Seleccione un archivo', cfile('userfile'))
+td('Titulo',cInput('titulo', ''))
+td('Duracion (en segundos):',cInput('tiempo', ''))
+td2('Descripcion:')
+tda2t ('descripcion','',50,10)
+td2(cent(c_div('enviovideob', '', cenviar('Guardar'))))
+td2(c_div('enviandovideo'))
+'</form>'
,w1('100%'))
+c_div('formulario', vis(0)+w1(0)+h1(0), '<iframe name="formulariokioskoguia" rows=0 cols=0 style="'+w1(0)+h1(0)+vis(0)+'"></iframe>');
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":300, "html":html,"titulo":titulo});
}
function kiosko_editar_guia_rotacion_lugar_guardar_video() {
enviovideob.innerHTML = 'Guardando';
enviandovideo.innerHTML = carg+'Espere un momento por favor, se esta enviando el video, puede tardar unos segundos o varios minutos, dependiendo de la velocidad de la conexion y del tamaño del video';
}
/* Busca los detalles de las guias de ese kiosko */
function kiosko_editar_guia_buscar (id,g) {
html = tc(td2(carg+'Buscando Guias...')+tr(tds(cent(kiosko_inicio), '', '', 'colspan=5')));
titulo = 'Administraci&oacute;n de kioskos';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'guia.php?id='+id+'&guia='+g, adm_tarjeta_xml);
}
/* Edita los detalles de la guia del kiosko*/
function kiosko_editar_guia_lista (obj) {
titulo = 'Administraci&oacute;n de kioskos';
html = '';
if (obj.c != 0 || obj.cn != 0) {
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
html += td('Guia: ', ahref('kiosko_editar_guia_eliminar(\''+obj.id+'\', '+obj.grupo+', '+obj.d[i].id+')', '<img src="imagen/kiosko/eliminar.png" title="Eliminar esta Guia Turistica" border=0>')
+ahref('kiosko_editar_guia_buscar(\''+obj.d[i].kiosko+'\', '+obj.d[i].id+')', bo(obj.d[i].titulo)), 10, 0, colordn);
}
if (obj.cn != 0) {
for (i = 0; i < obj.cn; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
html += td('Lugar: ', ahref('kiosko_editar_guia_eliminar(\''+obj.id+'\', '+obj.grupo+', '+obj.dn[i].id+')', '<img src="imagen/kiosko/eliminar.png" title="Eliminar este lugar" border=0>')
+obj.dn[i].enlace+', '+ahref('kiosko_editar_guia_buscar_lugar(\''+obj.id+'\', '+obj.grupo+', '+obj.dn[i].id+')', bo(obj.dn[i].nombre)), 12, 0, colordn)
+ td('',obj.dn[i].fecha, 12, 0, colordn);
}
}
} else
html += td2('No se han dado de alta elementos en esta Guia turistica')
html = tc(tr(tds(cent( (obj.grupo != 0 ? ahref('kiosko_editar_guia_buscar(\''+obj.id+'\',0)', 'Regresar')+' | ' : '')+kiosko_inicio), '', '', 'colspan=5'))
+(obj.grupo == 0 ?  th2('Lista de Guias turisticas') : th2('Lista de: ' + obj.nombre))
+html
/* Muestra el formulario para dar de alta nuevos campos en la guia turistica */
+'<form method="POST" name="formkiosko1" action="'+jsv+'">'
+th2('Dar de alta una nueva Guia turistica')
+td('Campo de la guia',cInput('kioskoguia', '')+cbotton('Guardar', 'Guardar', 'kiosko_editar_guia_guardar(\''+obj.id+'\', '+obj.grupo+', formkiosko1.kioskoguia.value, 0)'))
+td2(cent(bo('Especifique el nombre de la guia turistica a crear')))
+'</form>'
/* Muestra el formulario para dar de alta nuevos campos en la guia turistica */
+'<form method="POST" name="formkiosko2" action="'+jsv+'">'
+th2('Enlazar un lugar con esta maquina dentro de esta guia turistica')
+td('Acceso llegale del lugar',cInput('kioskoguialugar', '')+cbotton('Guardar', 'Guardar', 'kiosko_editar_guia_guardar(\''+obj.id+'\', '+obj.grupo+', 0, formkiosko2.kioskoguialugar.value)'))
+td2(cent(bo('Especifique el acceso llegale del lugar a enlazar')))
+td2(c_div('Error_kiosko_lugar'))
+'</form>'
,w1('100%'));
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":300, "html":html,"titulo":titulo});
}
function kiosko_editar_guia_guardar (id, grupo, dato, idll) {
Error_kiosko_lugar.innerHTML = carg+'Guardando datos de la guia...';
makeRequest(dirk+'guia_guardar.php?id='+id+'&grupo='+grupo+'&d='+dato+'&idll='+idll, adm_tarjeta_xml);
}
/* Elimina un lugar en la guia turistica del kiosko*/
function kiosko_editar_guia_eliminar (id,grupo,e) {
Error_kiosko_lugar.innerHTML = carg+'Eliminando datos de la guia...';
makeRequest(dirk+'guia_eliminar_lugar.php?id='+id+'&grupo='+grupo+'&e='+e, adm_tarjeta_xml);
}
/* Busca la informacion que se ha dado de alta en el lugar como videos, rutas, etc*/
function kiosko_editar_guia_buscar_lugar (id, grupo, idll) {

titulo = 'Administraci&oacute;n de kioskos';
html = carg+'Buscando datos del lugar';
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":100, "html":html,"titulo":titulo});
makeRequest(dirk+'guia_lugar.php?id='+id+'&grupo='+grupo+'&idll='+idll, adm_tarjeta_xml);
}
function kiosko_editar_guia_lugar (obj) {
html = '';
if (obj.c != 0) {
colordn = '';
for (i = 0; i < obj.c; i++) {
if (colordn != '') colordn = ''; else colordn = img_back('imagen/4a.png')+bgcolor('FEE0A7');
html += td('Video:', ahref('kiosko_editar_guia_lugar_eliminar(\''+obj.id+'\', '+obj.grupo+', '+obj.idll+', '+obj.d[i].id+')', '<img src="imagen/kiosko/eliminar.png" title="Eliminar este video" border=0>')
+ahref('kiosko_vervideo('+obj.d[i].id+')', '<img src="imagen/kiosko/ver.png" title="Ver video" border=0>')
+ahref('kiosko_vervideo('+obj.d[i].id+')', bo(obj.d[i].titulo)), 12, 0, colordn)
+td('', bo(obj.d[i].fecha)+' ('+obj.d[i].tipo+')', 10, 0, colordn);
}
} else
html += td2(cent('No se han dado de alta videos para este lugar'));
html = tc(tr(tds(cent(kiosko_inicio), '', '', 'colspan=5'))
+th2('Videos del lugar')
/* Muestra el formulario para dar de alta nuevos campos en la guia turistica */
+html
+'<form method="post" enctype="multipart/form-data" name="formkiosko1" onsubmit="kiosko_editar_guia_lugar_guardar_video()" action="'+dirk+'guia_lugar_guardar.php" target="formulariokioskoguia">'
+chidden('id', obj.id)
+chidden('grupo', obj.grupo)
+chidden('idll', obj.idll)
+th2('Subir un nuevo video o contenido')
+td('Seleccione un archivo', cfile('userfile'))
+td('Titulo',cInput('titulo', ''))
+td('Duracion (en segundos):',cInput('tiempo', ''))
+td2('Descripcion:')
+tda2t ('descripcion','',50,10)
+td2(cent(c_div('enviovideob', '', cenviar('Guardar'))))
+td2(c_div('enviandovideo'))
+'</form>'
,w1('100%'))
+c_div('formulario', vis(0)+w1(0)+h1(0), '<iframe name="formulariokioskoguia" rows=0 cols=0 style="'+w1(0)+h1(0)+vis(0)+'"></iframe>');
varr({"t":loc_ventana_y,"l":loc_ventana_x, "w":450, "h":300, "html":html,"titulo":titulo});
}
function kiosko_editar_guia_lugar_guardar_video() {
enviovideob.innerHTML = 'Guardando';
enviandovideo.innerHTML = carg+'Espere un momento por favor, se esta enviando el video, puede tardar unos segundos o varios minutos, dependiendo de la velocidad de la conexion y del tamaño del video';
}
function kiosko_vervideo (id) {
window.open(dirk+'video.php?id='+id, '', 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=no,width=640,height=480');
}
function kiosko_editar_guia_lugar_eliminar (id,grupo,idll,ide) {
/*Error_kiosko_lugar.innerHTML = carg+'Eliminando datos de la guia...';*/
makeRequest(dirk+'guia_eliminar_lugar_video.php?id='+id+'&grupo='+grupo+'&idll='+idll+'&id='+ide, adm_tarjeta_xml);
}



















/*v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.*/
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
var version;
var axo;
var e;

/* NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry*/

try {
/* version will be set for 7.X or greater players*/
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}

if (!version)
{
try {
/* version will be set for 6.X players only*/
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");

/* installed player is some revision of 6.0
 GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
 so we have to be careful. 

// default to the first public version*/
version = "WIN 6,0,21,0";

/* throws if AllowScripAccess does not exist (introduced in 6.0r47)*/
axo.AllowScriptAccess = "always";

/* safe to call for 6.0r47 or greater*/
version = axo.GetVariable("$version");

} catch (e) {
}
}

if (!version)
{
try {
/* version will be set for 4.X or 5.X player*/
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}

if (!version)
{
try {
/* version will be set for 3.X player*/
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}

if (!version)
{
try {
/* version will be set for 2.X player*/
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}

return version;
}

/* JavaScript helper required to detect Flash Player PlugIn version information*/
function GetSwfVer(){
/* NS/Opera version >= 3 check for Flash plugin in plugin array*/
var flashVer = -1;

if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
/* MSN/WebTV 2.6 supports Flash 4**/
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
/* WebTV 2.5 supports Flash 3*/
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
/* older WebTV supports Flash 2*/
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}

/* When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available*/
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
/* Given "WIN 2,0,0,11"*/
tempArray         = versionStr.split(" ");
tempString        = tempArray[1];
versionArray      = tempString.split(",");
} else {
versionArray      = versionStr.split(".");
}
var versionMajor      = versionArray[0];
var versionMinor      = versionArray[1];
var versionRevision   = versionArray[2];

        /* is the major.revision >= requested major.revision AND the minor version >= requested minor*/
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
/*CONTAINER HACK by hA :]]] 08.05.01 //y.m.d*/
if(params['container'] == undefined || params['container'] == '') document.write(str);
else document.getElementById(params['container']).innerHTML = str;
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
