// JavaScript Document
function SecOp(a){
	window.open (a,"newwid","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=850, height=620");
}
function SecOp3(a){
	window.open (a,"newrecordboat","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=900, height=580");
}
function UpdateOfficer(a){
	window.open ("secure/officers.asp","newofwid","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=550, height=500");
}
function UpdateEvent(a){
	window.open ("secure/event.asp","newevwid","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=700, height=550");
}
function UpdateArticle(a){
	window.open ("secure/articles.asp","newevwid","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=750, height=600");
}
function UpdateArticle2(a){
	window.open (a,"newevwid","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=750, height=600");
}
function UpdatePicture(a){
	window.open (a,"newpic","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=715, height=360");
}
function UpdatePicture2(a){
	window.open (a,"newpic","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=715, height=560");
}
function jump(a){
	window.location = a;
	return true;	
}
function jump2(a){
	window.location = a;
	window.target = 'weather'
	return true;	
}

function FotAmp(a){

	file="fotoamplia.asp?path=fotosnews&foto=" + a

	window.open (file,"newwid",1,1, x="10", y="10");
}

function FotAmp2(a){
	file="fotoamplia.asp?path=fotos&foto=" + a
	window.open (file,"newwid",1,1, x="10", y="10");
}

	varCosa = new Array(10);
	varCosa[0] = "I";
	varCosa[1] = "E";
	varCosa[2] = "R";
	varCosa[3] = "P";
	varCosa[4] = "M";
	varCosa[5] = "T";
	varCosa[6] = "H";
	varCosa[7] = "D";
	varCosa[8] = "K";
	varCosa[9] = "Y";
	
function menu(ta) {  //modifica el menu horizontal
	for (i=0;i<10; i++){
			if (varCosa[i] == ta){
				stri = "" + ta;
				document.all(stri).style.display='';
			}
			else{
				mnad = "" + varCosa[i];
				document.all(mnad).style.display='none';
			}
	}
}
function menuO() {  //modifica el menu horizontal
	for (i=0;i<7; i++){
				mnad = "" + varCosa[i];
				document.all(mnad).style.display='none';
			}
}
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->



<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=580,height=440,left = 365,top = 207');");
}
// End -->


<!-- Begin
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=auto,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=680,left = 10,top = 10');");
}
// End -->


<!-- Begin
function popUp3(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=690,height=440,left = 300,top = 170');");
}
// End -->


<!-- Begin
function popUp4(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1100,height=630,left=10,top=10');");
}

function popUp5(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1000,height=630,left=10,top=10');");
}

function showHideText(box,id,di)  { 
 	var elm = document.getElementById(id);  
	elm.style.display = box.checked? "block":"none" ;
	var eln = document.getElementById(di)  ;
	eln.style.display = box.checked? "none":"block" ;
	}
	
// funciones para validacion de form

function valObligatorio(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}

function validate_form(thisform)
{
with (thisform)
  {
   if (validate_text(nmid,"Invalid Character. The following is not allowed: \n ")==false)
   {comments.focus();return false;}
   if (validate_text(nbow,"Invalid Character. The following is not allowed: \n ")==false)
   {comments.focus();return false;}  
   if (validate_text(yacht,"Invalid Character. The following is not allowed: \n ")==false)
   {comments.focus();return false;}  
   if (validate_text(sponsor,"Invalid Character. The following is not allowed: \n ")==false)
   {comments.focus();return false;}     
   if (validate_num(isaf,"Must be a numeric value of max four numbers")==false)
   {classes_no.focus();return false;}  
   if (validate_email(emid,"New middleperson`s email incorrect sintax, please review!")==false)
   {juryemail.focus();return false;}
   if (validate_email(ebow,"New bowperson`s email incorrect sintax, please review!")==false)
   {juryemail.focus();return false;}    
   if (valObligatorio(letters,"Sail Letters must be filled, please review!")==false)
   {juryname.focus();return false;}
   if (valObligatorio(numbers,"Sail numbers must be filled, please review!")==false)
   {juryname.focus();return false;}
  }
}

function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {alert(alerttxt);return false;}
  else {return true;}
  }
}

function validate_text(field, alrtxt)
{
with(field)
	{
   var myString=new Array("DROP","Drop","drop","--","@", " EXEC ", " exec ", " Exec "," CAST ", " cast ", " Cast ", "\/","\\");
		  for (i=0;i<myString.length;i++) {
			if (value.indexOf(myString[i]) != -1) {
			  alert(alrtxt + myString[i]);
			  return false;} 
		   }
	}	
}

function validate_num(field, alerttxt)
{
	with(field)
	{
	var a=new Boolean(true);
	a=isFinite(Number(value)); 
	if (a==false) {alert(alerttxt);return false}
	else{return true;}
	}
}

function validate_zero(field, alerttxt)
{
	with(field)
	{
	if (value==0) {alert(alerttxt);return false}
	else{return true;}
	}
}


// End -->


