// JavaScript Club Nautico San Pedro


var factual = 11;
//window.onload=function(){ setFuentes('13','texto2'); }

function aumentar(texto){
	if (factual < 16 ){
		factual++; 
		setFuentes(factual,texto);
	}
}

function reducir(texto){
	if (factual > 9){
		factual--;
		setFuentes(factual,texto);
	}
}

function setFuentes(fontactual,idtexto){
	var lay = document.getElementById(idtexto);
	try{
		lay.style.fontSize = fontactual + "px";
		lay.style.lineHeight = (fontactual + 3) + "px";
	}catch(e){
		//alert(e.description  + " | " + fontactual + " | " + idtexto)
	}
}

function makeArray(n){
  this.length = n;
  for (i=1;i<=n;i++){
    this[i]=0;
  }
  return this;
}

function fecha() {
  var this_month = new makeArray(12);
  this_month[0]  = "Enero";
  this_month[1]  = "Febrero";
  this_month[2]  = "Marzo";
  this_month[3]  = "Abril";
  this_month[4]  = "Mayo";
  this_month[5]  = "Junio";
  this_month[6]  = "Julio";
  this_month[7]  = "Agosto";
  this_month[8]  = "Septiembre";
  this_month[9]  = "Octubre";
  this_month[10] = "Noviembre";
  this_month[11] = "Deciembre";

  var this_day_e = new makeArray(7);
  this_day_e[0]  = "Domingo";
  this_day_e[1]  = "Lunes";
  this_day_e[2]  = "Martes";
  this_day_e[3]  = "Miércoles";
  this_day_e[4]  = "Jueves";
  this_day_e[5]  = "Viernes";
  this_day_e[6]  = "Sábado";

  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  var dia = today.getDay();
    if (year < 1000) {
       year += 1900; }
  return( " " + this_day_e[dia] + " " + day + " de " + this_month[month] + " de " + year);
}

function hora(){
    momentoActual = new Date()
    hora = momentoActual.getHours()
    minuto = momentoActual.getMinutes()
    segundo = momentoActual.getSeconds()
return(hora + ":" + minuto + " Hs.");
} 

function validar(formulario) {
if (formulario.palabra.value.length < 4) {
alert("Escriba por lo menos 4 caracteres");
formulario.palabra.focus();
return (false);
}
}
function popWin(url, w, h, s) 
{
	 var madURL = url;
	 var x, y, winStr;
   		 x=0; y=0;
	 self.name="opener";
	 winStr = "height="+h+",width="+w+",screenX="+x+",left="+x+",screenY="+y+",top="+y+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars="+s+",status=0,toolbar=0";
	 lilBaby = window.open(madURL, "_blank", winStr);
}

function MM_openBrWindow(theURL,winName,features){//v1.2
                    window.open(theURL,winName,features);
            }
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xDef(){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}return true;}function xDisplay(e,s){if(!(e=xGetElementById(e))) return null;if(e.style && xDef(e.style.display)) {if (xStr(s)) e.style.display = s;return e.style.display;}return null;}function xGetElementById(e){if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);else if(document.all) e=document.all[e];else e=null;return e;}function xStr(s){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}return true;}

function opcion_1(capa){
 if (document.encuesta.dep.checked){
	xDisplay(capa, 'block')
 }else{
	xDisplay(capa, 'none')
 }

}
function opcion_3(capa){
 if (document.encuesta.nav.checked){
	xDisplay(capa, 'block')
 }else{
	xDisplay(capa, 'none')
 }

}
function opcion_4(capa){
 if (document.encuesta.otr.checked){
	xDisplay(capa, 'block')
 }else{
	xDisplay(capa, 'none')
 }

}

function contacto(formobj)	{var fieldRequired = Array("destino", "nombre", "email", "telefono", "ciudad", "consulta");var fieldDescription = Array("Destino", "Apellido y Nombre","E-mail","Teléfono", "Ciudad", "Consulta");var alertMsg = "Por favor completa los siguientes campos:\n";var l_Msg = alertMsg.length;for (var i = 0; i < fieldRequired.length; i++){var obj = formobj.elements[fieldRequired[i]];if (obj){switch(obj.type){case "select-one":if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){alertMsg += " - " + fieldDescription[i] + "\n";}break;case "select-multiple":if (obj.selectedIndex == -1){alertMsg += " - " + fieldDescription[i] + "\n";}break;case "text":case "textarea":if (obj.value == "" || obj.value == null){alertMsg += " - " + fieldDescription[i] + "\n";}break;default:if (obj.value == "" || obj.value == null){alertMsg += " - " + fieldDescription[i] + "\n";}}}}if (alertMsg.length == l_Msg){return true;}else{alert(alertMsg);return false;}}

function encuesta_cd(formobj)	{var fieldRequired = Array("nombre", "email", "socio");var fieldDescription = Array("Nombre y Apellido","Correo Electrónico", "Número de Socio");var alertMsg = "Por favor completa los siguientes campos:\n";var l_Msg = alertMsg.length;for (var i = 0; i < fieldRequired.length; i++){var obj = formobj.elements[fieldRequired[i]];if (obj){switch(obj.type){case "select-one":if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){alertMsg += " - " + fieldDescription[i] + "\n";}break;case "select-multiple":if (obj.selectedIndex == -1){alertMsg += " - " + fieldDescription[i] + "\n";}break;case "text":case "textarea":if (obj.value == "" || obj.value == null){alertMsg += " - " + fieldDescription[i] + "\n";}break;default:if (obj.value == "" || obj.value == null){alertMsg += " - " + fieldDescription[i] + "\n";}}}}if (alertMsg.length == l_Msg){return true;}else{alert(alertMsg);return false;}}

function top() 
{
var how_many_ads = 6;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
banner="img/hdr_01.gif";
}
if (ad==2) {
banner="img/hdr_02.gif";
}
if (ad==3) {
banner="img/hdr_03.gif";
}
if (ad==4) {
banner="img/hdr_04.gif";
}
if (ad==5) {
banner="img/hdr_05.gif";
}
if (ad==6) {
banner="img/hdr_06.gif";
}
document.write('<img src=\"' + banner + '\" width=768 height=100 border=0></img>')
// End -->
}
