// JavaScript Document
var ie = document.all;
var nn6 = document.getElementById && !document.all;
var isdrag=false;
var x,y;
var dobj;
function movemouse(e){
if (isdrag){
dobj.style.left = nn6 ? (tx+e.clientX-x)+"px" : tx+event.clientX-x;
dobj.style.top = nn6 ? (ty+e.clientY-y)+"px" : ty+event.clientY-y;
return false;
}
}
function selectmouse(e) {
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";
while (fobj.tagName!=topelement && fobj.className!="ampliacion"){
fobj = nn6 ? fobj.parentNode : fobj.parentElement;
}
if (fobj.className=="ampliacion"){
isdrag = true;
//dobj = fobj.cloneNode(true);
dobj = fobj;
if (dobj.filters) {
try {
dobj.style.filter="alpha(opacity=70)";
}
catch (e) { }
}
else if (dobj.style.opacity) {
dobj.style.opacity = .7;
}
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = nn6 ? e.clientX : event.clientX;
y = nn6 ? e.clientY : event.clientY;
document.onmousemove=movemouse;
return false;
}
}
function unselectmouse(e){
if (dobj){
if (dobj.filters) {
try {
dobj.style.filter="alpha(opacity=100)";
}
catch(e){ }
}
}
isdrag=false;
dobj=null;
}
document.onmousedown = selectmouse;
document.onmouseup = unselectmouse;
function muestra_imagen(archivo,alto,ancho){
//xInnerHtml('c1','')
xWidth ('ampliacion',ancho + 12);
xHeight ('ampliacion',alto + 6 + 20 + 18);
xWidth ('c1',ancho);
xHeight ('c1',alto);
xWidth ('cerrarampliacion',ancho);
document.all['c1'].innerHTML ='
';
pos_left = parseInt((xClientWidth()-ancho+3)/2);
pos_top = xScrollTop() + parseInt((xClientHeight()-alto+10)/2);
//if (pos_top>150) pos_top = 150
if (pos_top<10) { pos_top=10; }
pos_left=150;
pos_top=200; // Mueve la ventana, el margen izquierdo
xMoveTo('ampliacion',pos_left,pos_top);
setTimeout("xShow('ampliacion')",50);
}
function cerrar_ampliacion(){
xHide('ampliacion');
}
function muestraDatos(){
//if (document.layers) {
document.getElementById('datos').style.visibility = 'visible';
document.getElementById('precarga_datos').style.visibility = 'hidden';
//}
}
function limpiaCampo(campo, frase) {
if (document.getElementById(campo).value == frase) {
document.getElementById(campo).value = "";
}
}
function checkTelefono(telefono){
var RegExPatternX = new RegExp("[0123456789 -]");
if(telefono != ""){
if (telefono.match(RegExPatternX)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
function validaEmail() {
if (!checkEmail(document.frmAlertas.email_alerta.value)) {
alert('Por favor, introduce una direcci\u00f3n de correo electr\u00f3nico correcta.');
return false;
} else {
if (!checkTelefono(document.frmAlertas.telefono_alerta.value)) {
alert('Por favor, introduce tu n\u00FAmero de tel\u00E9fono.');
return false;
} else {
document.getElementById('alertasEmail').value=1;
return true;
}
}
}
//
Coordenadas:
Latitud : "+point.y+"
Longitud : "+point.x+"
Fotografias");
//marcador.openInfoWindowHtml("Coordenadas: "+point.y+","+point.x);
document.getElementById('formCoordenadas').value = point.y+","+point.x;
}
}
);
} // Cierra LLAVE 1.
} // Cierra LLAVE 2.
function showAddress(address, zoom) {
//alert("Direccion: "+address);
if (geocoder) {
geocoder.getLatLng(address,
function(point) {
if (!point) {
alert(address + " no encontrado");
} else {
map.setCenter(point, zoom);
var marker2 = new GMarker(point);
map.addOverlay(marker2);
//marker.openInfoWindowHtml(""+address+"
Coordenadas:
Latitud : "+point.y+"
Longitud : "+point.x+"
Fotografias");
//marker.openInfoWindowHtml("Coordenadas: "+point.y+","+point.x);
document.getElementById('formCoordenadas').value = point.y+","+point.x;
}
}
);
}
}
function actualizaMapa() {
var direccion = document.getElementById('formDomicilio').value+" "+document.getElementById('formNumero').value+", "+document.getElementById('formLocalidad').value+", "+document.getElementById('formCp').value+" "+document.getElementById('formProvincia').value+" ,EspaƱa";
showAddress(direccion, 15);
}
//---------------------------------//
// FIN DE GEOCODER
//---------------------------------//
//]]>
function compartirSocialMedia(url,titulo,red,a){
var http="";
var principal="http://www.pisoenalicante.net";
titulo=titulo.replace("","");
titulo=titulo.replace("","");
switch(red){
case"facebook":
http="http://www.facebook.com/share.php?src=bm&u="+encodeURIComponent(principal+url)+"&t="+encodeURIComponent(titulo)+"&v=3";
break;
case"myspace":
http="http://www.myspace.com/Modules/PostTo/Pages/?u="+encodeURIComponent(principal+url)+"&t="+encodeURIComponent(titulo)+'&l=3&c=%20via+Pisos+en+Alicante+pisoenalicante.net';
break;
case"twitter":
http="http://twitter.com/home?status="+encodeURIComponent(principal+url)+encodeURIComponent(titulo+" ");
break
}
//if(typeof(a)=="undefined"){
//a="/buscar/anyadido_a"
//}
//track(a+"_"+red);
window.open(http,"","")
}