function  getHeight()
{
	var BrowserHeight = 0;
	
	if (typeof(window.innerHeight)=="undefined")
	{
		  BrowserHeight = document.body.clientHeight;
	 
	}
	else
	  BrowserHeight = window.innerHeight;
	 
 

	return BrowserHeight;

} 
function UnLoad(evt) {
 
 
  evt = (evt) ? evt : ((window.event) ? window.event : "")
 // alert(evt.dispatchEvent );
   // alert(evt.target);
   if ((!window.event) && ( evt.target==Window.document))
  
   	 {    
   	 	//self.location="closeup.jsp";
	  
	  
	  return;
	} 
    
		 
     if (window.event) {
	  if (evt.clientX < 0 && evt.clientY < 0)
			 { 
			 	self.location="/eto20my/closeup.jsp";
	 // window.open("/eto20my/closeup.jsp",null,"height=1,width=1,status=no,titlebar=no,resizable=no,toolbar=no,menubar=no,location=no");
	} 
	}
   
}
 
 

 var message="© 2007 Editorial Tráfico Vial S.A.";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
//alert(message);
return true;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return true;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

//document.oncontextmenu = new Function("alert(message);return 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 createMenu(arrayText,arrayCommand,MainMenuName,lettercolor,letterselec){
document.write('<table width="100"  cellspacing="2" cellpading="1" border="0" >');

 for(var i=0;i<arrayText.length;i++){
  with(document){
  if (i==0 )
  {
   write('<tr nowrap="" valign="top">')
   write('<td width="10"  nowrap=""> </td>');
   write('<td height="15"  nowrap="">');
   write('</td>');
   write('<td width="10"  nowrap=""> </td>');
   write('</tr>');
   

	}

   write('<tr>');
  write('<td class="enlace" style="color:'+lettercolor+';" onmouseover="this.style.textDecoration=\'underline\';this.style.color=\''+letterselec+'\'" onmouseout="this.style.textDecoration=\'None\';this.style.color=\''+lettercolor+'\'" nowrap="" ');
  write('onClick="doAction('+ String.fromCharCode(39)+arrayCommand[i]+String.fromCharCode(39) +')">' + arrayText[i] );
  write('</td>');
  write('</tr>');
 

  if (i==0 )
  {
   write('<tr nowrap="" valign="top">')
   write('<td width="10" nowrap=""> </td>');
   write('<td height="15"  nowrap="">');
   write('</td>');
   write('<td width="10" nowrap=""> </td>');
   write('</tr>');

  }

}



 }
document.write('</table>');
}


function createMenuCat(arrayText,arrayCommand,MainMenuName,lettercolor,letterselec,catname,catcolor){
document.write('<table width="100"  cellspacing="2" cellpading="1" border="0" >');

 for(var i=0;i<arrayText.length;i++){
  with(document){
  if (i==0 )
  {
   write('<tr nowrap="" valign="top">')
   write('<td width="10"  nowrap=""> </td>');
   write('<td height="15"  nowrap="">');
   write('</td>');
   write('<td width="10"  nowrap=""> </td>');
   write('</tr>');
   

	}

  write('<tr nowrap="" valign="top">')
  write('<td  nowrap=""></td>');
  
  write('<td class="enlace" style="color:'+lettercolor+';" onmouseover="this.style.textDecoration=\'underline\';this.style.color=\''+letterselec+'\'" onmouseout="this.style.textDecoration=\'None\';this.style.color=\''+lettercolor+'\'" nowrap="" ');
  write('onClick="doAction('+ String.fromCharCode(39)+arrayCommand[i]+String.fromCharCode(39) +')">' + arrayText[i] );
  write('</td>');
  write('</tr>');


  if (i==0 )
  {
   write('<tr nowrap="" valign="top">')
   write('<td width="10" nowrap=""> </td>');
   write('<td height="15"  nowrap="">');
   write('</td>');
   write('<td width="10" nowrap=""> </td>');
   write('</tr>');
   
	  write('<tr  >');
	  write('')
	  write('<td height="20" colspan="2" class="categoria" bgcolor="'+catcolor+'" style="color:'+lettercolor+';" >');
	  write(catname);
	  write('</td>');
	  write('</tr>');

  }

}



 }
document.write('</table>');
}


function openModal(m_url,m_width,m_height){
 window.showModalDialog(m_url,window,"status: no;dialogWidth:" + m_width + ";dialogHeight:" + m_height) ;
}

function OrderTable(id,type){
  this.id=id ;
  this.type=type ;
  this.sort=sort ;
  return type ;
 }
function sort(index,typefield,ascending) {
   switch(this.type){
    case "buble":
      //bubleSort(this.id,index,ascending,typefield);
    break;
    case "quick":
  	var tableobject=document.getElementById(this.id)
   	if (tableobject==null) return;  
     	quicksort(tableobject,index,ascending,typefield,1,tableobject.rows.length-1)
    break;
  }
 }
 
function  quicksort( tableobject,index,ascending,typefield,left, right)
{
  var evalcadena;
  
  if(typefield=="number")
   evalcadena=(ascending==true) ? "parseInt(tableobject.rows(current).cells(index).innerText) > parseInt(tableobject.rows(left).cells(index).innerText)":"parseInt(tableobject.rows(current).cells(index).innerText) < parseInt(tableobject.rows(left).cells(index).innerText)" ;
  else
   evalcadena=(ascending==true) ? "tableobject.rows(current).cells(index).innerText >  tableobject.rows(left).cells(index).innerText" : "tableobject.rows(current).cells(index).innerText < tableobject.rows(left).cells(index).innerText" ;

    var current;
    var  last;
     if (left >= right)
        return;
     swap(tableobject.rows(left),tableobject.rows((left+right)/2));
     last = left;
     for (current = left + 1; current <= right; current++)
     	 if(eval(evalcadena))
                 swap(tableobject.rows(++last),tableobject.rows(current));
   
     swap(tableobject.rows(left),tableobject.rows(last));
     quicksort( tableobject,index,ascending,typefield,left, last-1);
     quicksort(tableobject,index,ascending,typefield,last+1, right);
}

 
 
function bubleSort(id,index,ascending,typefield){
  var evalcadena;
  var tableobject=document.getElementById(id)
   if (tableobject==null) return;
  if(typefield=="number")
   evalcadena=(ascending==true) ? "parseInt(tableobject.rows(i).cells(index).innerText) > parseInt(tableobject.rows(j).cells(index).innerText)":"parseInt(tableobject.rows(i).cells(index).innerText) < parseInt(tableobject.rows(j).cells(index).innerText)" ;
  else
   evalcadena=(ascending==true) ? "tableobject.rows(i).cells(index).innerText >  tableobject.rows(j).cells(index).innerText" : "tableobject.rows(i).cells(index).innerText < tableobject.rows(j).cells(index).innerText" ;
   var bchange=false;
  for (var i=0; i < tableobject.rows.length-1; i++)
  {	bchange=false;
     	for (var j=i+1; j < document.all.mytable.rows.length; j++)
        	 if(eval(evalcadena)){
          		swap(tableobject.rows(i),tableobject.rows(j));
          		bchange=true;
          	 }
        if (!bchange) break;
   }
 }
function swap(elemento1,elemento2){
  var temp =0 ;
  var temp1 =0 ;
  temp = elemento1.id;
  elemento1.id=elemento2.id
  elemento2.id = temp;

  temp = elemento1.onClick;
  elemento1.onClick=elemento2.onClick
  elemento2.onClick = temp;

  temp = elemento1.ondblclick;
  elemento1.ondblclick=elemento2.ondblclick
  elemento2.ondblclick = temp;

  for (i=0; i< elemento1.cells.length; i++) {
  temp=elemento1.cells(i).innerHTML ;
  elemento1.cells(i).innerHTML = elemento2.cells(i).innerHTML ;
  elemento2.cells(i).innerHTML = temp;
  }
 }


function checkValidDate(fieldname, strDate,allownull)
{
	var Items=0;
	var Day=0;
	var Month=0;
	var Year=0;

	if ((!allownull) && (strDate.length==0)){
	   alert ("The date for the Field:'" +fieldname+"' can no contain null value.");
	   return false;
	}
	if (strDate.length==0) return true ;

	Items = strDate.split(".");
	if (Items.length!=3)
	{
		alert ("Field:'" +fieldname+"'. Invalid date. The valid date format is dd/MM/yyyy");
		return false;
	}


	Day = parseFloat(Items[0]);
	Month = parseFloat(Items[1]);
	Year = parseFloat(Items[2]);

	if (isNaN(Month))
	{
		alert("Field:'" +fieldname+"'. The value for Month is not correct value.The valid date format is dd/MM/yyyy");
		 return false;
	}
	else
		if (Month < 1 || Month > 12){
		alert("Field:'" +fieldname+"'. The value for Month is not correct value.The valid date format is dd/MM/yyyy");
		 return false;
		  }

	if (isNaN(Day))
		{
		alert("Field:'" +fieldname+"'. The value for Day is not correct value.The valid date format is dd/MM/yyyy");
		 return false;
		}
	else

	if (Day < 1 || Day > 31)
	{
		alert("Field:'" +fieldname+"'. The value for Day is not correct value.The valid date format is dd/MM/yyyy");
	        return false;
	}

	if (isNaN(Year))
		{
		alert("Field:'" +fieldname+"'. The value for Year is not correct value.The valid date format is dd/MM/yyyy");
		 return false;
		}

	return true;
 }


function checkValidNumberInput(fieldname, strvalue,allownull,allowlimit,max,min)
{
	var strnumber;
	if ((!allownull) && (strvalue.length==0)){
	   alert ("The number for the Field:'" +fieldname+"' can no contain null value.");
	   return false;
	   }
	if (strvalue.length==0) return true;
	strnumber = parseFloat(strvalue);

	if (isNaN(strnumber))
	{
		alert("Field:'" +fieldname+"': The numeric value is not correct");
		 return false;
	}

	if (!allowlimit )
	   {
	   	if ((strnumber<min)&& (strnumber>max))
	  	 {
	   		alert ("The number for the Field:'" +fieldname+"' has to be in the limit ["+min.toString(10)+","+max.toString(10)+"]");
		  	return false;
		}
	 }
	return true;
 }

function checkValidTextInput(fieldname, strvalue,allownull)
{
	var strnumber;
	if ((!allownull) && (strvalue.length==0)){
	   alert ("The text value for the Field:'" +fieldname+"' can no contain null value.");
	   return false;
	   }
	if (strvalue.length==0) return true;
	return true;
 }

function checkValidTime( fieldname , strvalue,allownull )
{
	var Items=0;
	var Hour=0;
	var Min=0;

	strvalue = strvalue.substr(0,4);
	if ((!allownull) && (strvalue.length==0)){
	   alert ("The time for the Field:'" +fieldname+"' can no contain null value.");
	   return false;
	}
	if (strvalue.length==0) return true;

	if (strvalue.length!=4)
	{
		alert ("Field:'" +fieldname+"'. Invalid time. The valid time format is HHMM and max value is 9999");
		return false;
	}

	Hour = parseFloat(strvalue.substr(0,2));
	Min = parseFloat(strvalue.substr(2,2));
	if (isNaN(Hour))
	{
		alert("Field:'" +fieldname+"'. The value for Hour is not correct value.The valid time format is HHMM");
		 return false;
	}
	else
		if (Hour < 0 || Hour > 99){
		alert("Field:'" +fieldname+"'. The value for Hour is not correct value.The valid time format is HHMM");
		 return false;
		  }

	if (isNaN(Min))
		{
		alert("Field:'" +fieldname+"'. The value for minutes is not correct value.The valid time format is HHMM");
		 return false;
		}
	else

	if (Min < 0 || Min > 99)
	{
		alert("Field:'" +fieldname+"'. The value for minutes is not correct value.The valid time format is HHMM");
	        return false;
	}
	return true
}

function ltrim(str)
{
	for (var i=0; str.charAt(i)==" "; i++);
	return str.substring(i,str.length);
}

function rtrim(str)
{
	for (var i=str.length-1; str.charAt(i)==" "; i--);
	return str.substring(0,i+1);
}


function trim(str)
{
	return ltrim(rtrim(str));
}

function getCurrentDate()
{
	var tempday = new Date();
	var strDate ="";
	if  (tempday.getDate() < 10)
		strDate= strDate + "0" ;
	strDate = strDate + tempday.getDate().toString();
	strDate = strDate +".";
	if  (tempday.getMonth() < 10)
		strDate= strDate + "0" ;
	strDate = strDate + (tempday.getMonth()+1).toString();
	strDate = strDate + ".";
	strDate = strDate + tempday.getYear().toString();

	return strDate;
}

function getCurrentDateinDBFormat()
{
	var tempday = new Date();
	var strDate ="";
	strDate = tempday.getYear().toString();
	strDate = strDate +".";
	if  (tempday.getMonth() < 10)
		strDate= strDate + "0" ;
	strDate = strDate + (tempday.getMonth()+1).toString();
	strDate = strDate +".";
	if  (tempday.getDate() < 10)
		strDate= strDate + "0" ;
	strDate = strDate + tempday.getDate().toString();
	return strDate;
}




function createButton2222 (btext,bwidth, bfunction,broot,bgcolor,lettercolor)
{
	
 	document.write('<table height=18 border=0 cellpadding=1 cellspacing=1 align=center ');
 	document.write('style=";border-color:#FFFF00;color:#FFFF00;  ; ">');
       document.write('<tr>');
       document.write('<td width=\"'+bwidth+'\" bgcolor="'+bgcolor+'"  onClick=\"'+bfunction+'\" align=center  style="border-width:1px;border-color:gray;border-style:solid;font-weight: bold;font-size: 11px;vertical-align: middle;color:'+lettercolor+';" onmouseout="this.className='+String.fromCharCode(39)+'Button'+String.fromCharCode(39)+';style.width='+bwidth+'" onmouseover="this.className='+String.fromCharCode(39)+'Button_hover'+String.fromCharCode(39)+';" ');
       
       document.write('>'+btext+'</td>');
      
      
       document.write('<tr>');
       document.write('</table>');
       
       return;
	
};

function buttonhover (x,j)
{
	
	var aInput= document.getElementById(x);
	aInput.style.cursor ="pointer";
	var aInput2= document.getElementById("t"+x);
	 
	
	if (aInput !=null)
	{
		if (j==0)
		{
			aInput2.style.color="#006699";
			aInput.src="/eto20my/images/botones/btn3.gif";
			
		}
		if (j==1)
		{       aInput2.style.color="#669900";
			aInput.src="/eto20my/images/botones/btn4.gif";
			 
		}
		if (j==2)
		{	aInput2.style.color="#669900";
			aInput.src="/eto20my/images/botones/btn4.gif";
			 
		}
	}
	 
	return ;
}

function createButton (btext,bwidth, bfunction,broot,bgcolor,lettercolor)
{
	
	MM_preloadImages("/eto20my/images/botones/btn_rep.PNG","/eto20my/images/botones/btn_sob.gif","/eto20my/images/botones/btn_pres.gif");
	bwidth="180";
	
 	document.write('<table      border=0 cellpadding=0 cellspacing=0 align=center ');
 	document.write('>');
       document.write('<tr style="cursor:hand;" onmouseout="buttonhover('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',0)" onmouseover="buttonhover('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',1);" onmousedown="buttonhover('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',2);" onClick=\"'+bfunction+'\" >');
         document.write('<td width="23" height="25"  style="background-image:url(/eto20my/images/botones/btn1.gif)"  >');
           document.write('</td>');
          //   document.write('<td ');
         
          //'+lettercolor+'
           
       //alert('<td width=\"'+bwidth+'\" onClick=\"'+bfunction+'\" align=center  style="border-width:0px;border-color:gray;border-style:solid;font-weight: bold;font-size: 11px;vertical-align: middle;color:'+lettercolor+';" onmouseout="this.className='+String.fromCharCode(39)+'Button'+String.fromCharCode(39)+';style.width='+bwidth+'" onmouseover="buttonhover('+String.fromCharCode(39)+btext+String.fromCharCode(39)+');"');
       document.write('<td id="t'+btext+'"   align=center  style="background-image:url(/eto20my/images/botones/btn2.png);border-width:0px;border-color:gray;border-style:solid;font-weight: bold;font-size: 11px;vertical-align: middle;color:'+lettercolor+';" ');
       
       document.write('     >'+btext+'&nbsp;</td>');
       
          document.write('<td width="23"     >');
           document.write('<img id="'+btext+'" src="/eto20my/images/botones/btn3.gif"   ></td>');
      
      
       document.write('</tr>');
       document.write('</table>');
       
       return;
	
};


function buttonhover2 (x,j)
{
	
	var aInput= document.getElementById(x);
	//alert(aInput);
	if (aInput !=null)
	{
		if (j==0)
		{
			aInput.style.backgroundImage="url(/eto20my/images/botones/btn_rep2.gif)";
			aInput.style.cursor ="pointer";
		}
		if (j==1)
		{
			aInput.style.backgroundImage="url(/eto20my/images/botones/btn_sob2.gif)";
			aInput.style.cursor ="pointer";
		}
		if (j==2)
		{
			aInput.style.backgroundImage="url(/eto20my/images/botones/btn_pres2.gif)";
				aInput.style.cursor ="pointer";
		}
	}
	 
	return ;
}

function createButton2 (btext,bwidth, bfunction,broot,bgcolor,lettercolor)
{
	
	/*MM_preloadImages("/eto20my/images/botones/btn_rep2.gif","/eto20my/images/botones/btn_sob2.gif","/eto20my/images/botones/btn_pres2.gif");
	bwidth="180";
	
 	document.write('<table id="'+btext+'"  width="145" height=30 background="/eto20my/images/botones/btn_rep2.gif" border=0 cellpadding=1 cellspacing=1 align=center ');
 	document.write('>');
       document.write('<tr>');
       //alert('<td width=\"'+bwidth+'\" onClick=\"'+bfunction+'\" align=center  style="border-width:0px;border-color:gray;border-style:solid;font-weight: bold;font-size: 11px;vertical-align: middle;color:'+lettercolor+';" onmouseout="this.className='+String.fromCharCode(39)+'Button'+String.fromCharCode(39)+';style.width='+bwidth+'" onmouseover="buttonhover('+String.fromCharCode(39)+btext+String.fromCharCode(39)+');"');
       document.write('<td width=\"'+bwidth+'\" onClick=\"'+bfunction+'\" align=center  style="border-width:0px;border-color:gray;border-style:solid;font-weight: bold;font-size: 11px;vertical-align: middle;color:'+lettercolor+';" onmouseout="buttonhover2('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',0)" onmouseover="buttonhover2('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',1);" onmousedown="buttonhover2('+String.fromCharCode(39)+btext+String.fromCharCode(39)+',2);"');
       
       document.write('>&nbsp;'+btext+'&nbsp;</td><td width=29></td>');
      
      
       document.write('<tr>');
       document.write('</table>');*/
       createButton (btext,bwidth, bfunction,broot,bgcolor,lettercolor);
       
       return;
	
};

function createButtonid (id,btext,bwidth, bfunction,broot)
{
	
 	document.write('<table id="'+id+'" style="display=none" height=18 border=0 cellpadding=0 cellspacing=0 align=center ');
 	document.write('style="bgcolor=#FFFF00;border-color:#FFFF00;color:#FFFF00;">');
       document.write('<tr>');
       document.write('<td width='+bwidth+' bgcolor="#c10000"  onClick='+bfunction+' align=center style="cursor:pointer;border=1;border-bottom-style: solid;border-top-style: solid; border-left-style: solid;border-bottom-width: 1"  bgcolor="#FFFFff"');
       
       document.write('>'+btext+'</td>');
       document.write('<td>');
       if (broot)
       		document.write('<img width=8   src="../images/rigthcorner_EN.gif"  onmouseover="this.style.cursor='+String.fromCharCode(39)+'pointer'+String.fromCharCode(39)+'" >');
       	else
       		document.write('<img width=8   src="../images/rigthcorner_EN.gif"  onmouseover="this.style.cursor='+String.fromCharCode(39)+'pointer'+String.fromCharCode(39)+'" >');
       document.write('</td>');
       document.write('<tr>');
       document.write('</table>');
       
       return;
	
};



 
function createHeader (imgtop,imgtop2,colormnucategory,letterColor,datetoday,academianame,conectado,academianame2,userid)
{
	if (userid=="ANONIMO")
		userid="ETRASA";

	var usua1=userid;
	 if (usua1.indexOf("@")>0)	
		usua1 =usua1.substring(0,usua1.indexOf("@"));
			
	datetoday= datetoday.substring(0,1).toUpperCase() + datetoday.substring(1,datetoday.length);
	 
 document.write('<table  border="0" cellpadding="0" bgcolor="'+colormnucategory+'" height=97 width=100%  cellspacing="0" bgcolor="'+colormnucategory+'"      >');
document.write('	  <tr>');
if (imgtop2.indexOf("logotop21")>0)
  document.write('	    <td  rowspan=3     width="180" valign=center  align=center  >  <img width=146 height=35 border=0 src="'+imgtop2+'"   >');
else
   document.write('	    <td  rowspan=3     width="180" valign=center  align=center  >  <img width=180 height=94 border=0 src="'+imgtop2+'"   >');
document.write('	    </td>');
 
if (!conectado)
 document.write('	       <td     rowspan=3  bgcolor="'+colormnucategory+'" align=center    ><img border=0  src="'+imgtop+'"   ></TD>');
else
	document.write('	       <td     rowspan=3  bgcolor="'+colormnucategory+'" align=center valign=center   height=94 >   <TABLE BORDER=0  cellpadding=0 cellspacing=0    ><TR> <td align=center colspan=2 valign=bottom ><span class="logowhite" >'+academianame+'</span>&nbsp;<span class="logogreen">'+academianame2+'</span></TD></TR><TR>  <TD align=center><img   src="'+imgtop+'"   ></TD></TR></TABLE></TD>');

document.write('	      <td align=center valign=bottom  width="172" STYLE="color:'+letterColor+'" bgcolor="'+colormnucategory+'"  > &nbsp;'+datetoday );
document.write('	    </td>');
document.write('	 </tr>');
document.write('	 <tr>  <td  align=center CLASS=Texto12blink STYLE="color:'+letterColor+'"  width="172"  bgcolor="'+colormnucategory+'"  > &nbsp;'+usua1);
document.write('	    </td></tr>');
document.write('	    <tr> ');
if (conectado)
	document.write(' <td  align=center   width="172" STYLE="color:'+letterColor+'"  bgcolor="'+colormnucategory+'"  class="enlace"> <img   src="/eto20my/images/desconexion.gif"   >&nbsp;<a class="enlace" style="color:yellow;" href="/eto20my/index.jsp?operation=LOGOUT" target="_self">Desconectar</a> ');
else
	document.write(' <td  align=center   width="172" STYLE="color:'+letterColor+'"  bgcolor="'+colormnucategory+'"  class="enlace"> &nbsp;');
document.write('	    <tr> ');
document.write('	    </td> </tr>');
document.write('	 <tr>  <td colspan=3 bgcolor="#EEF8FD" height=4>  ');
document.write('	    </td></tr>');

document.write('	 </table>');
 return;
	
};



function createHeader2 (imgtop,colormnucategory,letterColor,datetoday,academianame,conectado)
{
 document.write('<table  border="0" cellpadding="0"   width="100%"  cellspacing="0"      >');
document.write('	  <tr>');
document.write('	    <td  rowspan=3 background="'+imgtop+'"  height="63" width="179"   > &nbsp;');
document.write('	    </td>');
document.write('	       <td      bgcolor="'+colormnucategory+'"  >&nbsp;');
document.write('	    </td>  <td align=center   width="200" STYLE="color:'+letterColor+'" bgcolor="'+colormnucategory+'"  > &nbsp;'+datetoday);
document.write('	    </td>');
document.write('	 </tr>');
document.write('	 <tr> <td   CLASS=Texto15 STYLE="color:'+letterColor+'"    bgcolor="'+colormnucategory+'"  > &nbsp;&nbsp; &nbsp; &nbsp;'+academianame);
document.write('	    </td> <td  align=center CLASS=Texto12blink STYLE="color:'+letterColor+'"  width="200"  bgcolor="'+colormnucategory+'"  > &nbsp;TEST ONLINE');
document.write('	    </td></tr>');
document.write('	    <tr> <td      bgcolor="'+colormnucategory+'"    > &nbsp');
if (conectado)
	document.write('	    </td><td  align=center   width="200" STYLE="color:'+letterColor+'"  bgcolor="'+colormnucategory+'"  class="enlace"> &nbsp;<a class="enlace" style="color:yellow;" href="http://localhost:88/eto20my/index.jsp?operation=LOGOUT" target="_self">Desconectar</a> ');
else
	document.write('	    </td><td  align=center   width="200" STYLE="color:'+letterColor+'"  bgcolor="'+colormnucategory+'"  class="enlace"> &nbsp;');
document.write('	    </td> </tr>');
document.write('	 </table>');
 return;
	
};

function Validaemail(string){
		if ((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+/.test(string))) return true;
  return false;
};


function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function ValidaDNI(str){
	
        	var numero = str.substring(0,str.length-1);
        	if (numero.length==8)
        			if (!/^\d{8}/.test(numero)) return false;
		if (numero.length==7)
			if (!/^\d{7}/.test(numero)) return false;
		var letras = 'TRWAGMYFPDXBNJZSQVHLCKE';
		var numero1 = numero%23;
		var letra = letras.substring(numero1,numero1+1);
		if (str.substring(str.length-1).toUpperCase()!= letra ) return false;
		return true;
};

var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function checkValidDate(fieldname, strDate,allownull)
{

	var Items=0;
	var Day=0;
	var Month=0;
	var Year=0;

	if ((!allownull) && (strDate.length==0)){
	   alert ("La fecha no puede ser vacía.");
	   return false;
	}
	if (strDate.length==0) return true ;

	Items = strDate.split("/");
	
	if (Items.length!=3)
	{
		alert ("'" +fieldname+"'. La fecha no tiene un formato válido. El formato de Fecha válido es  dd/MM/yyyy");
		return false;
	}


	Day = parseFloat(Items[0]);
	Month = parseFloat(Items[1]);
	Year = parseFloat(Items[2]);

	if (isNaN(Month))
	{
		alert("'" +fieldname+"'. El valor del Mes no es correcto.El formato de Fecha válido es  dd/MM/yyyy");
		 return false;
	}
	else
		if (Month < 1 || Month > 12){
		alert("'" +fieldname+"'. El valor del Mes no es correcto.El formato de Fecha válido es  dd/MM/yyyy");
		 return false;
		  }

	if (isNaN(Day))
		{
		alert("Field:'" +fieldname+"'. El valor del Día no es correcto.El formato de Fecha válido es  dd/MM/yyyy");
		 return false;
		}
	else

	if (Day < 1 || Day > 31)
	{
		alert("'" +fieldname+"'. El valor del Día no es correcto.El formato de Fecha válido es  dd/MM/yyyy");
	        return false;
	}

	if (isNaN(Year))
		{
		alert("'" +fieldname+"'. El valor del Año no es correcto.El formato de Fecha válido es  dd/MM/yyyy");
		 return false;
		}
	if (!isDate(strDate))
	{
	alert("La fecha no tiene un formato válido. El formato de Fecha válido es  dd/MM/yyyy");
		 return false;
		}
	return true;
 }
 
 function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}
 function isDate(dtStr){
	var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
	//	alert("The date format should be : DD.MM.YYYY")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
	//	alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
	
return true
}


function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function checkonlynumber(s)
{
	
	for (var i=0;i<s.length;i++)
	{
		//alert(s.charAt(i));
		if (!isInteger(s.charAt(i))  )
			 if ((s.charAt(i) != ",") && (s.charAt(i) != "-"))
				return false;
			
	}

	return true;
}

 
	function goOption4(url)
	{
	
			window.open(url,null,"maximize=true,scrollbars=yes, status=yes,titlebar=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes");
	
}

	function goOption3(url)
	{
	
			window.open(url,null,"height=600,width=1000,left=40, top=40,status=no,titlebar=no,resizable=no,toolbar=no,menubar=no,location=no");
	
	}
	