//fotos en ventanas
function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

//proteccion de copia de imagenes
<!-- Compatible con IE y NS -->
function derecha(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)){
alert('Copyright (c) Inmobiliaria')
return false;
}

else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2)){
alert('Copyright (c) Inmobiliaria')
}
}

//abrir ventana a un tamaño especifico
function ventanaSecundaria (URL){ 
window.open(URL,"ventanaadm","width=570, height=500, scrollbars=yes, menubar=no, location=no, resizable=no"); 
} 

function Abrir_ventana (pagina) {
var opciones="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=600,top=45,left=140";
window.open(pagina,"",opciones);
}

//cerrar ventana
function cerrarse(){ 
window.close() 
} 
function ventanaClave (URL){ 
window.open(URL,"ventanaadm","width=220, height=150, scrollbars=no, menubar=no, location=no, resizable=no"); 
} 
    
<!--

/******************************************
* Imagen con Tooltip Script - HTML.Dynamico 2001
* Mas Scripts y Recursos para tu web en:
* http://www.htmldynamico.cjb.net
******************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// acá va el contenido del tooltip (imagen, descripcion, opcional bgColor, opcional color del texto)
var messages = new Array();
// multi-dimensional arrays containing: 
// imagen y texto para el tooltip
// opcional: bgColor - color del fondo
messages[0] = new Array('images/logoP.gif','No hay información adicional.Contactenos.',"#ffffff");
messages[1] = new Array('images/Venta/001/1.jpg','Tipo Ranchos de Chana - Manantial de Guayamuri',"#FFFFFF");
messages[2] = new Array('test.gif','Test description','black','white');
messages[3] = new Array('images/Venta/003/1.jpg','Yaque Alto',"#FFFFFF");
messages[4] = new Array('images/Venta/003/1.jpg','<table width="195" border="0" cellpadding="0" cellspacing="0" id="gen"><tr><td class="lenguetas"><b>Tipo:</b> <br><b>A&ntilde;o const.:</b> <br><b>Localidad:</b> <br><b>Zona:</b> <b>:</b> <br><b>Situaci&oacute;n:</b> <br><b>Tipo const.:</b> <br><b>Mts. construcci&oacute;n:</b> <br><b>Jard&iacute;n:</b> si<br><b>Piscina: Si</b></td></tr></table>',"#FFFFFF");
messages[5] = new Array('images/Venta/005/1.jpg','La Orchila',"#FFFFFF");
messages[6] = new Array('images/Venta/006/1.jpg','Vivalco - A Estrenar',"#FFFFFF");
messages[7] = new Array('images/Venta/007/1.jpg','Torre Molino',"#FFFFFF");
messages[8] = new Array('images/Venta/008/1.jpg','El Farallon',"#FFFFFF");
messages[9] = new Array('images/Venta/009/1.jpg','Bahía Mágica',"#FFFFFF");
messages[10] = new Array('images/Venta/010/1.jpg','Crystal Lake',"#FFFFFF");
messages[11] = new Array('images/Venta/011/1.jpg','Solimar',"#FFFFFF");
messages[12] = new Array('images/Venta/012/1.jpg','Laguna Blanca',"#FFFFFF");
messages[13] = new Array('images/Venta/013/1.jpg','Alcatraz',"#FFFFFF");
messages[14] = new Array('images/Venta/014/1.jpg','Las Margaritas',"#FFFFFF");
messages[15] = new Array('images/Venta/015/1.jpg','Margarita Regency',"#FFFFFF");
messages[16] = new Array('images/Venta/016/1.jpg','Margarita Plaza',"#FFFFFF");
messages[17] = new Array('images/Venta/017/1.jpg','Bahía del Morro',"#FFFFFF");
messages[18] = new Array('images/Venta/018/1.jpg','Guarame',"#FFFFFF");
messages[19] = new Array('images/Venta/019/1.jpg','La Fundación',"#FFFFFF");
messages[20] = new Array('images/Venta/020/1.jpg','Ranchos de Chana',"#FFFFFF");
messages[21] = new Array('images/Venta/021/1.jpg','Margarita Regency',"#FFFFFF");
messages[22] = new Array('images/Venta/022/1.jpg','Margarita Regency',"#FFFFFF");
messages[23] = new Array('images/Venta/023/1.jpg','La Colmena',"#FFFFFF");
messages[24] = new Array('images/Venta/024/1.jpg','Villas de Paraguachi',"#FFFFFF");
messages[25] = new Array('images/Venta/025/1.jpg','Casa en Sabanamar',"#FFFFFF");
messages[26] = new Array('images/Venta/026/1.jpg','Tejas Rojas',"#FFFFFF");
messages[27] = new Array('images/Venta/027/1.jpg','Esparta Suite',"#FFFFFF");
messages[28] = new Array('images/Venta/028/1.jpg','Manantial de Guayamuri',"#FFFFFF");
messages[29] = new Array('images/Venta/029/1.jpg','Residencias Adriana',"#FFFFFF");
messages[30] = new Array('images/Venta/030/1.jpg','Residencias La Orquidea',"#FFFFFF");
messages[31] = new Array('images/Venta/031/1.jpg','Terreno Apecurero',"#FFFFFF");
messages[32] = new Array('images/Venta/032/1.jpg','Villas de Paraguachi',"#FFFFFF");
messages[33] = new Array('images/Venta/033/1.jpg','Residencias Alcatraz',"#FFFFFF");
messages[34] = new Array('images/Venta/034/1.jpg','Terreno Playa El Angel',"#FFFFFF");
messages[35] = new Array('images/Venta/035/1.jpg','Costa Azul',"#FFFFFF");
messages[36] = new Array('images/Venta/036/1.jpg','Jorge Coll',"#FFFFFF");
messages[37] = new Array('images/Venta/037/1.jpg','Costa Azul',"#FFFFFF");
messages[38] = new Array('images/Venta/038/1.jpg','Terreno Manantial de Guayamuri',"#FFFFFF");
messages[39] = new Array('images/Vacacional/001/1.jpg','Montaña Dorada',"#FFFFFF");//VACACIONALES
messages[40] = new Array('images/Vacacional/002/1.jpg','Villamar',"#FFFFFF");//VACACIONALES
messages[41] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[42] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[43] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[44] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[45] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[46] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[47] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[48] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[49] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[50] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[51] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[52] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[53] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[54] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[55] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[56] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[57] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[58] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[59] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[60] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[61] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[62] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[63] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[64] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[65] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[66] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[67] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[68] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[69] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[70] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[71] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[72] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[73] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[74] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[75] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[76] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[77] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[78] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[79] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[80] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[81] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[82] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[83] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[84] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[85] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[86] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[87] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[88] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[89] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[90] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[91] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[92] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[93] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[94] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[95] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[96] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[97] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[98] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[99] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[100] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[101] = new Array('images/Alquiler/101/1.jpg','La Reserve',"#FFFFFF");
messages[102] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[103] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[104] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[105] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[106] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[107] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[108] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
messages[109] = new Array('images/Venta/024/1.jpg','Margarita Plaza',"#FFFFFF");
////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}
	

// -->

<!--
function galeria(img,img_med,img_small){
foto = "imgUpload/"+img;
//definimos imagenes
image_med = new Image();
image_small = new Image();

//definimos las rutas
image_med.src = "imgUpload/"+img_med;
image_small.src = "imgUpload/"+img_small;
loader(img_med, img_small);
}

function loader(img, img_small){
	flagx=false;
	var tiempo = "";

	if (image_med.complete){flagx=true;}
	if (flagx) {
	clearTimeout(tiempo);
	document.images['large'].src=image_med.src;
	} else {
	document.images['large'].src="imgUpload/loading.gif";
	tiempo=setTimeout("loader('"+img+"', '"+img_small+"')",1000);
	}
}

function ampliaFoto(){
GP_AdvOpenWindow('ampliaFoto.asp?img='+foto,'form_ampli','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no',550,413,'center','ignoreLink','',0,'');return document.MM_returnValue
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = "";
}

function resetText(thefield){
if(thefield.value==""){
thefield.value=thefield.defaultValue;
}}

function buscaRef(){
	if(document.getElementById('searchRef').style.visibility == "hidden") {
		document.getElementById('searchRef').style.visibility = "visible";
		document.getElementById('searchRef').style.display = 'block'; 
	} else {
		document.getElementById('searchRef').style.visibility = "hidden";
		document.getElementById('searchRef').style.display = 'none'; 
	}
}

function linkRef(ref){
	if(ref!=""){
		var idioma = '';
		var refSearch = "detalle.asp?refPage=ventas%2Easp&refSearch=" + ref;
		if(idioma!=""){refSearch += "&idioma=" + idioma}
		document.location.href = refSearch;
	}
}

function badSearch(){ 
	var badSearch = '';
	if(badSearch != ""){
		document.getElementById('searchRef').style.visibility = "visible";
		document.getElementById('searchRef').style.display = 'block';
	}
}
// Fin busqueda por ref
// -->

