// --------------------------
// Funciones Javier Castan - Español
// --------------------------

// Función Derechos Reservados
function Derechos() {

document.write ("<font face='Verdana, Geneva, Arial, Helvetica, sans-serif' size='1'  color='#ffffff'>Manlio De Martis ® Sol y Nieve EVYT leg. 11.178 -</font>")
 }
 
// Función Fecha
function FechaActual() {
	var now = new Date();
	var textout;
	var day = now.getDay();
	var month = now.getMonth();
	var date = now.getDate();
	var year = now.getYear();
	
	if (month==0) textout="enero";
	if (month==1) textout="febrero";
	if (month==2) textout="marzo";
	if (month==3) textout="abril";
	if (month==4) textout="mayo";
	if (month==5) textout="junio";
	if (month==6) textout="julio";
	if (month==7) textout="agosto";
	if (month==8) textout="setiembre";
	if (month==9) textout="octubre";
	if (month==10) textout="noviembre";
	if (month==11) textout="diciembre";
	
	document.write ("<font size='1' color='#cccccc'>San Rafael, " + date + " de " + textout +" de "+ year +"</font>");
}


// Función Popup 
/*function WinPopup (URL){ 
	msgWindow=window.open(URL,"OpenWindow",
	"width=400,height=400,scrollbars=yes");
}
*/
function WinPopup (URL,Ancho,Alto,Scroll){ 
	msgWindow=window.open(URL,"OpenWindow",
	"width="+ Ancho +",height="+ Alto +",scrollbars=" + Scroll);
}

// Función cerrar Popup
function cw () {
  close();
}

// Función Popup siempre visible
var TieneFoco = true
function CambiarTieneFoco() {
	if (TieneFoco == true) {
		TieneFoco = false
		document.formModo.modo.value = "Normal"
	} else if (TieneFoco == false) {
		TieneFoco = true
		document.formModo.modo.value = "Siempre visible"
		DaFoco()
	}
}

function DaFoco() {
	if (TieneFoco == true)
		setTimeout("self.focus()",100)
}

// Función Botones para que se coloree el fondo
window.name='lno';
	function mOvr(src) {
		if (!src.contains(event.fromElement)) {
		src.style.cursor = 'hand';
		src.bgColor = '#DCDCC7';
		}
	}
	function mOut(src) {
		if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		src.bgColor = '';
		}
	}
	function mClk(src) {
		if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click();
		}
	}


// Función abrir Popup
function Popup(def, foto,ancho, alto) {
 windowname = 'def' + def;
 popupwin=window.open( "", windowname, "toolbar=no, location=no, directories=no, status=no, menubar=no, width=" + ancho + ",height=" + alto);
 shtml = "<HTML><HEAD></HEAD><title> - Hotel EL PASO - </title>";
 shtml = shtml + "<body leftmargin='0' topmargin='0' marginwidth='0'"; 
 shtml = shtml + " marginheight='0'>" + "<img src='" + foto + "' align='middle' >";
 shtml = shtml + "<div align='right'><font face='Verdana, Geneva, Arial, Helvetica, sans-serif'";
 shtml = shtml + "</body></HTML>";
 popupwin.document.write( shtml );
 popupwin.document.close();
}


// Función para imprimir
function imprimir() {
  self.print();
}


function horizontal (def, foto,ancho, alto)
{
windowname='def' + '';

popupwin=window.open("",windowname,"width="+ancho+",height="+alto);

popupwin.document.write("<HTML><HEAD></HEAD><title> - Fotos de Via-Sol  </title><body bgcolor='#CCCCCC' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>" + def + "<img src='" + foto + "'>");

popupwin.document.close();

}

//Funcion para el calendario
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}