var ie=document.all;

var ns=document.layers;

var ns6=document.getElementById&&!document.all;



function ventanaW ( ) {

	winName = 'Logo';

	pageToLoad='http://lacabezuela.webcindario.com';

	args = '';

	w = window.open( pageToLoad,winName,args);

	//w.close();

}





function renderPage ( image , title , text ) 

{

	htmlCode = "";

	htmlCode += '<TABLE cellSpacing=0 cellPadding=2  bgColor=#f5d77a border=0>';

  	htmlCode += '<TBODY>';

  	htmlCode += '<TR>';

    	htmlCode += '<TD vAlign=center bgColor=#f5e4b8> <IMG height=32 ';

      	htmlCode += 'src="Casa_rural_archivos/logo.gif" width=45></TD>';

    	htmlCode += '<TD align=right bgColor=#f5e4b8><IMG height=27 '; 

      	htmlCode += 'src="Casa_rural_archivos/titulo.gif" width=199></TD></TR>';

  	htmlCode += '<TR>';

    	htmlCode += '<TD colSpan=2>';

      	htmlCode += '<TABLE cellSpacing=0 cellPadding=0 border=0>';

        htmlCode += '<TBODY>';

	htmlCode += '   <TR>';

	htmlCode += '          <TD align=middle bgColor=#f5e4b8 colSpan=5 height=308><IMG ';

	htmlCode += '            height=303 src="'+image+'" useMap=#Map ';

	htmlCode += '            border=0></TD></TR>';

	htmlCode += '        <TR><TD><font face=Arial color=black size=2>'+title+'</font>';

	htmlCode += '        </TD></TR>	';	

	htmlCode += '   <TR><TD><font face=Arial color=blue size=1>'+text+'</font></TD></TR>';

	htmlCode += '	</TBODY></TABLE></TD></TR></TBODY></TABLE>';

	return htmlCode;

}



function enlarge(which, title, text, x,y){

	if (ie||ns6){

		crossobj=document.getElementById? document.getElementById("showimage") : document.all["showimage"]

		if (crossobj.style.visibility){

			crossobj.style.left=ns6? pageXOffset+x : document.body.scrollLeft+x

			crossobj.style.top=ns6? pageYOffset+y : document.body.scrollTop+y

			crossobj.innerHTML= renderPage(which,title,text) + '<div align=right id=drag><font face="Arial" style="cursor:hand" onClick=closepreview()>CERRAR </font></div>'

			crossobj.style.visibility="visible"

		}



	}

	else if (document.layers){

		if (document.showimage.visibility){

			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="../'+which+'" border=0></a>')

				document.showimage.document.close()

				document.showimage.left=x

				document.showimage.top=y

				document.showimage.visibility="show"

		}

		

	}

		else

		return true

}



function closepreview(){

	if (ie||ns6){

		crossobj=document.getElementById? document.getElementById("showimage") : document.all["showimage"]

		if (crossobj.style.visibility){

			crossobj.style.visibility="hidden"

		}



	}

	else if (document.layers){

		if (document.showimage.visibility){

			document.showimage.visibility="hidden"

		}

		

	}

	else

		return true

	

}





var nsx,nsy,nstemp;



function drag_dropns(name){

		temp=eval(name)

		temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)

		temp.onmousedown=gons

		temp.onmousemove=dragns

		temp.onmouseup=stopns

}



function gons(e){

		temp.captureEvents(Event.MOUSEMOVE)

		nsx=e.x

		nsy=e.y

}



function dragns(e){

		temp.moveBy(e.x-nsx,e.y-nsy)

		return false

}



function stopns(){

	temp.releaseEvents(Event.MOUSEMOVE)

}



function drag_drop(e){

		if (ie&&dragapproved){

				crossobj.style.left=tempx+event.clientX-offsetx

				crossobj.style.top=tempy+event.clientY-offsety

		}

		else if (ns6&&dragapproved){

				crossobj.style.left=tempx+e.clientX-offsetx

				crossobj.style.top=tempy+e.clientY-offsety

		}

return false

}



function initializedrag(e){

	if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){

		offsetx=ie? event.clientX : e.clientX

		offsety=ie? event.clientY : e.clientY

		tempx=parseInt(crossobj.style.left)

		tempy=parseInt(crossobj.style.top)

		dragapproved=true

		document.onmousemove=drag_drop

	}

}



document.onmousedown=initializedrag

document.onmouseup=new Function("dragapproved=false")







function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}





function ponPunto(x,y){

	if (ie||ns6){

		ptoObj=document.getElementById? document.getElementById("pto") : document.all["pto"]

   		if (ptoObj.style.visibility){

			ptoObj.style.left=(x+10)

			ptoObj.style.top=y

			ptoObj.style.visibility="visible"

		}



	}

	else if (document.layers){

		if (document.pto.visibility){

				document.pto.left=x

				document.pto.top=y

				document.pto.visibility="show"

		}



	}

		else

		return true

}





function ocultaPunto(){

	if (ie||ns6){

		ptoObj=document.getElementById? document.getElementById("pto") : document.all["pto"]

		if (ptoObj.style.visibility){

			ptoObj.style.visibility="hidden"

		}



	}

	else if (document.layers){

		if (document.pto.visibility){

				document.pto.visibility="hidden"

		}



	}

		else

		return true

}





