function obtenerPoblaciones() {
	if (this.value && this.value > 0) {
		var a = new G.ajax( {
			pagina : "interceptor.php",
			post : {
				__quien : "mantenimiento",
				__accion : "listarCampo",
				__tabla : "zonas",
				__campo : "id",
				__valor : "poblacion",
				__condicion : "idprovincia='" + this.value + "'",
				__style : "border-width:1px;",
				__id : "localidad",
				__size : "1"
			}
		});
		var c = G.dom.$("poblacionesSelect");
		c.innerHTML = "Cargando Poblaciones...";
		a.recibir(c);
	}
}
function actualizar_teatros(fran){
	$("#intermisson").load('../../../../panelcliente/ajax_teatros.php',{fran:fran});
}

function iniciarMapa() {
	crearMapa(false, false, "mapaempresa", "españa");
}

function crearMapa(lat, lng, idcapamapa, address, nomovible, sinmarcador,
		minimapa, callejero, zoominicial) {
	if (!zoominicial) {
		zoominicial = 6;
	}
	var capamapa = G.dom.$(idcapamapa);
	if (capamapa) {
		capamapa.mapa = new GMap2(capamapa);
		capamapa.geocoder = new GClientGeocoder();
		var mapa = capamapa.mapa;
		mapa.setMapType(G_NORMAL_MAP);
		mapa.addControl(new GMapTypeControl());
		mapa.addControl(new GSmallMapControl());
		if (minimapa) {
			mapa.addControl(new GOverviewMapControl());
		}
		mapa.idcapamapa = idcapamapa;
		capamapa.marcador = [];
		var point = false;
		if (lat && lng && !isNaN(lat) && !isNaN(lng)) {
			point = new GLatLng(lat, lng);
			mapa.setCenter(point, zoominicial);
		}
		if (callejero && point) {
			mapa.panoramico = new GStreetviewPanorama(callejero);
			var svOverlay = new GStreetviewOverlay();
			mapa.addOverlay(svOverlay);
			mapa.svclient = new GStreetviewClient();
		}
		if (point) {
			if (!sinmarcador) {
				crearMarcador(point, idcapamapa, nomovible, false, false,
						false, callejero, zoominicial);
			}
		} else {
			showAddress(address, idcapamapa, nomovible, sinmarcador, false,
					false, false, callejero, zoominicial);
		}
		return capamapa.mapa;
	}
	return false;
}
function onLatLngChange(point) {
	var f = G.dom.$("FormRegistro");
	if (f) {
		f.latitud.value = point.y;
		f.longitud.value = point.x;
	}
}
function showAddress(address, idcapamapa, nomovible, sinmarcador, icono, link,
		unico, callejero, zoominicial) {
	if (!zoominicial) {
		zoominicial = 6;
	}
	var capamapa = G.dom.$(idcapamapa);
	if (capamapa && capamapa.mapa && capamapa.geocoder) {
		capamapa.geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						// alert(address + " not found");
					} else {
						var capamapa = G.dom.$(idcapamapa);
						var map = capamapa.mapa;
						if (map) {
							if (!map.centered) {
								map.setCenter(point, zoominicial);
								map.centered = true;
							}
							if (!sinmarcador) {
								crearMarcador(point, idcapamapa, nomovible,
										icono, link, unico, callejero,
										zoominicial);
							}
							if (callejero) {
								if (!map.panoramico) {
									map.panoramico = new GStreetviewPanorama(
											callejero);
									var svOverlay = new GStreetviewOverlay();
									map.addOverlay(svOverlay);
									map.svclient = new GStreetviewClient();
								}
								map.svclient.getNearestPanorama(point,
										streetviewclient_callback);
							}
							if (typeof onLatLngChange !== "undefined") {
								onLatLngChange(point);
							}
						}
					}
				});
	}
}
function crearMarcador(point, idcapamapa, nomovible, icono, link, unico,
		callejero, zoominicial) {
	if (!zoominicial) {
		zoominicial = 6;
	}
	var capamapa = G.dom.$(idcapamapa);
	var map = capamapa.mapa;
	var pos = 0;
	if (!unico) {
		capamapa.marcador.push(new GMarker(point, icono));
		pos = capamapa.marcador.length - 1;
		map.addOverlay(capamapa.marcador[pos]);
	} else {
		if (!capamapa.marcador[0]) {
			capamapa.marcador[pos] = new GMarker(point, icono);
			map.addOverlay(capamapa.marcador[pos]);
		}
		capamapa.marcador[pos].setLatLng(point);
		map.setCenter(point, zoominicial);
	}
	if (callejero) {
		if (!map.panoramico) {
			map.panoramico = new GStreetviewPanorama(callejero);
			var svOverlay = new GStreetviewOverlay();
			map.addOverlay(svOverlay);
			map.svclient = new GStreetviewClient();
		}
		map.svclient.getNearestPanorama(point, streetviewclient_callback);
	}
	if (!nomovible) {
		GEvent.addListener(map, 'click', function(overlay, latlng) {
			var capamapa = G.dom.$(this.idcapamapa);
			capamapa.marcador[pos].setLatLng(latlng);
			if (typeof onLatLngChange !== "undefined") {
				onLatLngChange(latlng);
			}
			if (this.panoramico) {
				map.svclient.getNearestPanorama(latlng,
						streetviewclient_callback);
			}
		});
	}
	if (link) {
		capamapa.marcador[pos].link = link;
		GEvent.addListener(capamapa.marcador[pos], 'click', function(overlay,
				latlng) {
			location.href = this.link;
		});
	}
}
function streetviewclient_callback(streetviewdata) {
	var capamapa = G.dom.$("mapaCallejero");
	var map = capamapa.mapa;
	if (streetviewdata.code != google.maps.StreetviewClient.ReturnValues.SUCCESS) {
		map
				.openInfoWindowHtml(
						streetviewdata.location.latlng,
						'<div style="width: 200px; height: 100px; overflow: auto;">No se encontro una visión Panorámica de la calle en la posición que se hizo click</div>');
		// alert('getNearestPanorama( ) failed: ' + streetviewdata.code);
		return;
	}
	var info = '';
	info += '<strong>' + streetviewdata.location.description + '</strong><br/>\n';
	info += '<small>' + streetviewdata.copyright + '</small><br/>\n';
	info += '<strong>Other Panoramas:</strong><br/>\n';
	for ( var i = 0; i < streetviewdata.links.length; i++) {
		info += '&rsaquo; <a href="#" onclick="oncustomclick( &quot;'
				+ streetviewdata.links[i].panoId + '&quot; ); return false;">'
				+ streetviewdata.links[i].description + '</a><br/>\n';
	}
	map
			.openInfoWindowHtml(
					streetviewdata.location.latlng,
					'<div style="width: 200px; height: 100px; overflow: auto;">' + info + '</div>');
	capamapa.mapa.panoramico.setLocationAndPOV(streetviewdata.location.latlng);
	capamapa.marcador[0].setLatLng(streetviewdata.location.latlng);
}
function oncustomclick(id) {
	var capamapa = G.dom.$("mapaCallejero");
	capamapa.mapa.svclient.getPanoramaById(id, streetviewclient_callback);
}

function buscarDireccionCallejero() {
	var i = G.dom.$("criterioCallejero");
	if (i) {
		showAddress(i.value, "mapaCallejero", true, false, false, false, true,
				G.dom.$("mapaCalleCallejero"), 15);
	}
}

function presionaCriterioCallejero(event) {
	var key = G.event.getKey(event);
	if (key === 13) {
		buscarDireccionCallejero();
	}
}

function desplegarLista() {
	var li;
	if (this.tagName === "A") {
		li = this.parentNode;
		this.setAttribute("onclick", "return false;");
	} else if (this.tagName === "LI") {
		li = this;
	}
	if (li) {
		if (!li.id) {
			var idx;
			do {
				idx = "GDL" + parseInt(Math.random() * 10000);
			} while (G.dom.$(idx));
			li.id = idx;
		}
		var ulx = G.dom.$$$("ul", 0, li);
		if (ulx && ulx.style) {
			if (ulx.style.display !== "block") {
				li.className = "desplegado";
				ulx.style.display = "block";
				ulx.maxH = ulx.offsetHeight;
				ulx.style.overflow = "hidden";
				ulx.style.height = "0px";
				setTimeout("desplegarLista.call(G.dom.$('" + li.id + "'));", 40);
			} else {
				var h = ulx.offsetHeight;
				if (h < ulx.maxH) {
					h += 10;
					ulx.style.height = h + "px";
					setTimeout(
							"desplegarLista.call(G.dom.$('" + li.id + "'));",
							40);
				} else {
					ulx.style.height = ulx.maxH + "px";
					if (this.tagName === "A") {
						this.onclick = replegarLista;
					} else if (this.tagName === "LI") {
						var a = G.dom.$$$("a", 0, this);
						if (a) {
							a.onclick = replegarLista;
						}
					}
				}
			}
		}
	}
	return false;
}
function replegarLista() {
	var li;
	if (this.tagName === "A") {
		li = this.parentNode;
		this.setAttribute("onclick", "return false;");
	} else if (this.tagName === "LI") {
		li = this;
	}
	if (li) {
		if (!li.id) {
			var idx;
			do {
				idx = "GDL" + parseInt(Math.random() * 10000);
			} while (G.dom.$(idx));
			li.id = idx;
		}
		var ulx = G.dom.$$$("ul", 0, li);
		if (ulx && ulx.style) {
			var h = ulx.offsetHeight;
			if (h > 10) {
				h -= 10;
				ulx.style.height = h + "px";
				setTimeout("replegarLista.call(G.dom.$('" + li.id + "'));", 40);
			} else {
				li.className = undefined;
				ulx.style.display = "none";
				ulx.style.height = "auto";
				if (this.tagName === "A") {
					this.onclick = desplegarLista;
				} else if (this.tagName === "LI") {
					var a = G.dom.$$$("a", 0, this);
					if (a) {
						a.onclick = desplegarLista;
					}
				}
			}
		}
	}
	return false;
}

function validarBusqueda() {
	var crit = this.criterio;
	if (crit.value.length < 3) {
		setTimeout(
				'alert("El criterio de busqueda debe tener mas de 3 letras");',
				100);
		return false;
	}
	if (crit.value === crit.defaultText) {
		setTimeout('alert("Debe colocar un criterio de busqueda");', 100);
		return false;
	}
	return true;
}

G.util
		.ready(function() {
			var a = G.dom.$$$("a");
			for ( var i = 0; i < a.length; i++) {
				if (a[i].getAttribute("rel") === "email") {
					a[i].innerHTML = a[i].innerHTML.replace("_^_", "@");
					a[i].href = "mailto:" + a[i].innerHTML;
				}
			}
			var d = G.dom.$$$("div");
			var diE = [];
			var max = 0;
			for ( var i = 0; i < d.length; i++) {
				if (d[i].className === "itemEmpresa") {
					if (max < d[i].offsetHeight - 12) {
						max = d[i].offsetHeight - 12;
					}
					diE.push(d[i]);
				}
				if (d[i].className === "anuncioSimple") {
					if (max < d[i].offsetHeight - 4) {
						max = d[i].offsetHeight - 4;
					}
					diE.push(d[i]);
				}
			}

			for ( var i = 0; i < diE.length; i++) {
				diE[i].style.height = max + "px";
			}

			var mdiv = G.dom.$("mapaEmpresa");
			if (mdiv) {
				var ll = mdiv.getAttribute("rel").split(":");
				var lat = ll[0];
				var lng = ll[1];
				if (lat && lng) {
					crearMapa(lat, lng, "mapaEmpresa", "", true, false, true,
							false, 15);
				}
			}
			var ls = G.dom.$("listadoSugerencia");
			if (ls) {
				var desp = new G.desplazante( {
					capa : ls,
					intervaloTiempo : 20,
					tiempoDescanso : 2000,
					sentido : "horizontal",
					direccion : "negativa",
					incremento : 5,
					detenerSobre : true
				});
				desp.iniciar();
			}
			var fbus = G.dom.$("formBuscar");
			if (fbus) {
				G.OwnTextBox.convert(fbus.criterio, "Que Quieres Buscar...");
			}
			var fbus = G.dom.$("formularioContactoForm");
			if (fbus) {
				fbus.onsubmit = function() {
					if (G.valid.isEmpty(this.nombre.value)) {
						G.dom.$("respuestaMensaje").innerHTML = "El Nombre no puede estar vacio";
						this.nombre.focus();
						return false;
					}
					if (G.valid.isEmpty(this.email.value)) {
						G.dom.$("respuestaMensaje").innerHTML = "El Email no puede estar vacio";
						this.email.focus();
						return false;
					}
					if (!G.valid.isEmail(this.email.value)) {
						G.dom.$("respuestaMensaje").innerHTML = "El Email debe tener formato de Correo Electrónico";
						this.email.focus();
						return false;
					}
					if (!G.valid.isInt(this.telefono.value)) {
						G.dom.$("respuestaMensaje").innerHTML = "El Telefono debe contener solo numeros";
						this.telefono.focus();
						return false;
					}
					return true;
				};
				fbus.telefono.onkeypress = G.valid.int;
				fbus.email.onkeypress = G.valid.email;
			}
			var dd = G.dom.$("listaPublicidadCentro");
			if (dd) {
				var desp = new G.desplazante( {
					capa : dd,
					intervaloTiempo : 100,
					tiempoDescanso : 3000,
					sentido : "horizontal",
					direccion : "negativa",
					incremento : 8,
					detenerSobre : true
				});
				desp.iniciar();
			}
			var resF = G.dom.$("formReserva");
			if (resF) {
				resF.onsubmit = function() {
				};
				$("#paraFechaReserva").datepicker( {
					dateFormat : "dd/mm/yy",
					onSelect : function(dateText, inst) {
						G.dom.$("formReserva").fecha.value = dateText;
					}
				});
			}
			verificadorHash();
			$("a.imagenLightbox").lightBox();
			var campoVotacion = G.dom.$("campoVotacionOcio");
			if (campoVotacion) {
				var x = new G.extra.votacion(campoVotacion, 5);
			}
		});
if (!G.extra)
	G.extra = {};
G.util
		.parse(
				{
					votacion : function(campo, estrellas, datos) {
						if (campo && campo.appendChild) {
							if (!datos) {
								datos = campo.getAttribute("rel");
							}
							campo.innerHTML = "<span style='font-weight:bold;margin-left:8px;'><span style='font-size:15px;'>&bull; </span>Votación:</span> ";
							var images = [];
							for ( var i = 0; i < estrellas; i++) {
								images.push(G.dom.create("img"));
								images[i].src = "images/graystar.jpg";
								if (i > 0) {
									images[i].anterior = images[i - 1];
								}
								images[i].iluminar = function() {
									var aux = this;
									while (aux) {
										aux.src = "images/yellowstar.jpg";
										aux = aux.anterior;
									}
								};
								images[i].datos = datos;
								images[i].apagar = function() {
									var aux = this;
									while (aux) {
										aux.src = "images/graystar.jpg";
										aux = aux.anterior;
									}
								};
								images[i].onmouseover = function() {
									this.iluminar();
								};
								images[i].onmouseout = function() {
									this.apagar();
								};
								images[i].valor = (i + 1);
								images[i].style.cursor = "pointer";
								images[i].onclick = function() {
									if (this.datos) {
										var variables = this.datos.split(":");
										var a = new G.ajax(
												{
													pagina : "interceptor.php",
													post : {
														__quien : "mantenimiento",
														__accion : "insertar",
														__tabla : "votacion",
														quien : variables[1],
														referencia : variables[0],
														valoracion : this.valor
													},
													json : true,
													campo : campo,
													accion : function() {
														var json = this.JSON;
														if (json
																&& json.success) {
															location.href = location.href
																	.split("#")
																	.shift();
														} else {
															this.campo.innerHTML = "Error de servidor, por favor inténtelo mas tarde";
														}
													}
												});
										a.enviar();
									}
								};
								campo.appendChild(images[i]);
							}
						}
					}
				}, G.extra);

var hashActual = "";
var primerHash = false;
var funcionesHash = [];
function verificadorHash() {
	if ("#" + hashActual !== location.hash || !primerHash) {
		var anterior = hashActual;
		primerHash = true;
		if (hashActual !== "" && location.hash === "") {
			location.href = location.href + "#" + hashActual;
		} else {
			hashActual = location.hash.replace("#", "");
		}

		if (funcionesHash.length > 0) {
			for ( var i = 0; i < funcionesHash.length; i++) {
				funcionesHash[i](hashActual, anterior);
			}
		}
	}
	setTimeout(verificadorHash, 250);
}

function despliegaMapa() {
	var ll = this.getAttribute("rel").split(":");
	var lat = ll[0];
	var lng = ll[1];
	if (lat && lng) {
	
		crearMapa(lat, lng, this.id, "", true, false, true, false, 15);
	}
}
function lasOfertas(recivir) {
	  $("#menganillo").load("lasOfertas.php", {nombre: recivir});
}
function editarAnuncio(id) {
	var a = new G.ajax(
			{
				pagina : "interceptor.php",
				post : {
					__quien : "mantenimiento",
					__accion : "obtener",
					__tabla : "anuncio",
					__campo : "id",
					__valor : id
				},
				json : true,
				accion : function() {
					var json = this.JSON;
					var f = G.dom.$("Formanuncio");
					if (f) {
						f.reset();
						if (json && json.success && json.object) {
							for ( var index in json.object) {
								if (f[index]) {
									if ((f[index].tagName == "INPUT" && f[index].type != "file")
											|| f[index].tagName == "SELECT"
											|| f[index].tagName == "TEXTAREA") {
										if (G.nav.isIE && G.nav.version < 7) {
											f[index].innerHTML = json.object[index];
										} else {
											f[index].value = json.object[index];
										}
									}
								}
							}
							f.__accion.value = "Modificar Anuncio";
							f.defectoLocalidad = json.object.localidad;
							buscarLocalidades.call(f.provincia);
						}
					}
				}

			});
	a.enviar();
	return false;
}

function cancelarEdicionAnuncio() {
	var f = this.form;
	if (f) {
		f.id.value = "";
		f.reset();
		f.__accion.value = "Crear Anuncio";
	}
}

function editarEmpresa(id) {
	var a = new G.ajax(
			{
				pagina : "interceptor.php",
				post : {
					__quien : "mantenimiento",
					__accion : "obtener",
					__tabla : "empresa",
					__campo : "id",
					__valor : id
				},
				json : true,
				accion : function() {
					var json = this.JSON;
					var f = G.dom.$("FormRegistro");
					if (f) {
						f.reset();
						if (json && json.success && json.object) {
							for ( var index in json.object) {
								if (f[index]) {
									if ((f[index].tagName == "INPUT" && f[index].type != "file")
											|| f[index].tagName == "SELECT"
											|| f[index].tagName == "TEXTAREA") {
										if (G.nav.isIE && G.nav.version < 7) {
											f[index].innerHTML = json.object[index];
										} else {
											f[index].value = json.object[index];
										}
									}
								}
							}
							if (json.object.latitud && json.object.longitud) {
								var punto = new GLatLng(json.object.latitud,
										json.object.longitud);
								crearMarcador(punto, "mapaempresa", false,
										false, false, true, false, 15);
							}
							f.Submit.value = "Modificar";
						}
					}
				}

			});
	a.enviar();
	return false;
}

function cancelarEdicionEmpresa() {
	var f = this.form;
	if (f) {
		f.reset();
		f.Submit.value = "Enviar";
	}
}

function guardarPedido(referencia, tarifa) {
	var a = new G.ajax( {
		pagina : "interceptor.php",
		post : {
			__quien : "mantenimiento",
			__tabla : "pago",
			__accion : "insertar",
			tarifa : tarifa,
			referencia : referencia,
			monto : this.amount.value
		},
		form : this,
		json : true,
		accion : function() {
			var json = this.JSON;
			if (json && json.success) {
				this.form.invoice.value = json.id;
				var xxx = this.form.cancel_return.value;
				xxx = xxx.split("/");
				if (xxx.pop() === "cancelar") {
					xxx.push("cancelar");
					xxx.push(json.id);
				} else {
					xxx.push(json.id);
				}
				this.form.cancel_return.value = xxx.join("/");
				this.form.onsubmit = null;
				this.form.submit();
			} else {
				alert(this.TEXT);
			}
		}
	});
	a.enviar();
	return false;
}

function cambiarDireccionMapa() {
	if (this.form) {
		var f = this.form;
		var p = f.provincia.options[f.provincia.selectedIndex].innerHTML;
		var l = f.localidad.options[f.localidad.selectedIndex].innerHTML;
		showAddress("España, " + p + ", " + l + ", " + this.value,
				"mapaempresa", false, false, false, false, true, false, 15);
	}
}
function cambiarDireccionMapa2() {
	if (this.form) {
		var f = this.form;
		var p = f.sl_provincia.options[f.sl_provincia.selectedIndex].innerHTML;
		var l = f.sl_localidad.options[f.sl_localidad.selectedIndex].innerHTML;
		showAddress("España, " + p + ", " + l + ", " + this.value,
				"mapaempresa", false, false, false, false, true, false, 15);
	}
}

function abrirFranquicia(id) {
	var ul = G.dom.$(id);
	if (ul) {
		if (ul.style.display == "none") {
			ul.style.display = "block";
		} else {
			ul.style.display = "none";
		}
	}
	return false;
}
function verNoVerSiguiente() {
	var siguiente = this.nextSibling;
	if (siguiente) {
		var alto = false;
		while (siguiente && !alto) {
			if (siguiente.nodeType === 1) {
				alto = true;
			} else {
				siguiente = siguiente.nextSibling;
			}
		}
		if (siguiente) {
			if (siguiente.style.display == "block") {
				siguiente.style.display = "none";
			} else {
				siguiente.style.display = "block";
			}
		}
	}
}
var cacheOcioPeliculaCine = {};
function desplegarEmergente(id, e) {
	var pos = G.event.getPos(e);
	var emergente = G.dom.$("emergenteVentana");
	if (!emergente) {
		emergente = G.dom.create("div");
		emergente.id = "emergenteVentana";
		document.body.appendChild(emergente);
	}
	G.util.parse( {
		left : (pos.x + 5) + "px",
		top : (pos.y + 5) + "px",
		display : "block"
	}, emergente.style);
	if (cacheOcioPeliculaCine[id]) {
		emergente.innerHTML = cacheOcioPeliculaCine[id];
	} else {
		var ajax = new G.ajax(
				{
					pagina : "interceptor.php",
					post : {
						__quien : "mantenimiento",
						__accion : "obtener",
						__tabla : "ocio_pelicula_cine",
						__campo : "id",
						__valor : id
					},
					json : true,
					pos : pos,
					accion : function() {
						var json = this.JSON;
						if (json) {
							var emergente = G.dom.$("emergenteVentana");
							if (emergente) {
								emergente.innerHTML = "Sala: "
										+ json.object.sala + "<br/>";
								emergente.innerHTML += "Descripcion: "
										+ json.object.descripcion;
								cacheOcioPeliculaCine[json.object.id] = emergente.innerHTML;
							}

						}
					}
				});
		ajax.recibir("emergenteVentana");
		emergente.innerHTML = "Leyendo...";
	}

}

function ocultarEmergente() {
	var emergente = G.dom.$("emergenteVentana");
	if (emergente) {
		emergente.style.display = "none";
	}
}
function moverEmergente(e) {
	var pos = G.event.getPos(e);
	var emergente = G.dom.$("emergenteVentana");
	if (emergente) {
		G.util.parse( {
			left : (pos.x + 5) + "px",
			top : (pos.y + 5) + "px",
			display : "block"
		}, emergente.style);
	}
}

function compartirFacebook() {
	bitLY(location.href, function(json, url) {
		if (json && json.errorCode == 0 && json.statusCode == "OK") {
			var t = document.title;
			for ( var res in json.results) {
				url = json.results[res].shortUrl;
			}
			if (url) {
				window
						.open('http://www.facebook.com/sharer.php?u='
								+ encodeURI(url) + '&t='
								+ encodeURIComponent(t), ' sharer',
								'toolbar=0, status=0, width=626,height=436 ');
			}
		}
	});
	return false;
}

function compartirTwitter() {
	bitLY(location.href, function(json, url) {
		if (json && json.errorCode == 0 && json.statusCode == "OK") {
			var t = document.title;
			for ( var res in json.results) {
				url = json.results[res].shortUrl;
			}
			if (url) {
				window
						.open('http://twitter.com/home?status=Leyendo '
								+ encodeURIComponent(t) + ' en '
								+ encodeURI(url), ' sharer',
								'toolbar=0, status=0, width=626,height=436 ');
			}
		}
	});
	return false;
}

function compartirTuenti() {
	bitLY(
			location.href,
			function(json, url) {
				if (json && json.errorCode == 0 && json.statusCode == "OK") {
					var t = document.title;
					for ( var res in json.results) {
						url = json.results[res].shortUrl;
					}
					if (url) {
						window
								.open(
										'http://www.tuenti.com/share?url=' + encodeURI(url),
										'sharer',
										'toolbar=0, status=0, width=626,height=436 ');
					}
				}
			});
	return false;
}

function bitLY(url, enRespuesta) {
	var a = new G.ajax( {
		pagina : "interceptor.php",
		post : {
			__quien : "bitly",
			__accion : "darURL",
			url : url
		},
		json : true,
		funcionX : enRespuesta,
		accion : function() {
			if (this.JSON && this.funcionX) {
				this.funcionX(this.JSON, url);
			}
		}
	});
	a.enviar();
}

function cambiarFechaCalendario(mes,anio){
	alert('yuhuu mes:'+mes+'anyo'+anio);
	var a=new G.ajax();
	a.recibir("calendario_busqueda");
	
}
