//<!--
//	****************************************************************************
//	How to use javascripts in your code....
//
//	all javascripts are kept in one file called hello/docs/funciones.js (this File)
//	when you make a new javascript...put it in this file. (don't forget to add comments explaining what its used for)
//
//	to call the javascript from your html code:
//
//	make sure that the following line is in your header...
//	<SCRIPT language=JavaScript src="/funciones.js"> </SCRIPT>
//
//	then at the point in the code you want your javascript executed put
//	<script>nameofjavascript()</script>
//
//	for example to put the date in your page...call the javascript hispafecha() like this
//	<script>hispafecha()</script>
//
//	simple eh?
//    	****************************************************************************
//-->
<!-- Hide from old browsers
  //days until Sabaki 2007
  now = new Date();
  eventDate = new Date("April 7, 2007");
  msEachDay = 24 * 60 * 60 * 1000 ;
  
  function daysUntilEvent(){
// Step 1:
  daysRemaining = (eventDate.getTime() - now.getTime()) / msEachDay;
// Step 2:
  daysRemaining = Math.round(daysRemaining);
// Step 3:
  document.write("The 2007 Sabaki Challenge is in " + daysRemaining + " days!");}
	// stop hiding script from old browsers -->
	
<!-- Hide from old browsers
  //days until Sabaki 2007
  now2 = new Date();
  msEachDay2 = 24 * 60 * 60 * 1000 ;
  
  function daysUntil(month,day,year){
    eventDate = new Date(month + " " + day + ", " + year);
    daysRemaining = (eventDate.getTime() - now2.getTime()) / msEachDay2;
    daysRemaining = Math.round(daysRemaining);
    document.write("The " + year + " Sabaki Challenge is in " + daysRemaining + " days!");
  }
// stop hiding script from old browsers -->	
	
	
// Funcion para saltar de menu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Funcion para abrir ventana
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Funciones de barra
  // mouse over
  function mOvr(src,clrOver) {
    if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'hand';
	  src.bgColor = clrOver;
	}
  }
  // mouse out
  function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrIn;
	}
  }
  // mouse click
  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();
    }
  }
  

// Abre una imagen en un pop up
function abrir_imagen(id,Ancho,Alto)
{
	MasAlto=Alto+11;
	features = "width="+Ancho+",height="+MasAlto;	
	window.open('/common/imagen.cfm?ID='+id,id,features);
}

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_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_findObj(n, d) { //v3.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); 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 changeImage(r,i)
{
r.src=i;
}
function goFlipURL()
{
  document.location = urlSet[currentFlip];
}
function flipFlipper(imageSet,speed)
{
  currentFlip ++;
  if (currentFlip == imageSet.length)
    currentFlip=0;
  changeImage(document.flip,imageSet[currentFlip]);
  setTimeout("flipFlipper(imageSet,speed)", speed)
}
function FlipperLong(width,height,s,images)
{
/* si: start index 
** i: current index
** ei: end index
** cc: current count
*/
 speed = s;
 si = 0; 
 ci=0;
 cc=0;
 imageSet = new Array();
 ei = images.length;
  for (i=1;i<ei;i++) {
    if (images.charAt(i) == ' ') {
      imageSet[cc] = images.substring(si,i);
      cc++;
      si=i+1;
      }
    }
  currentFlip = 0;
   document.write("<img name='flip'");
 if (width >0)
    document.write(" width="+width);
 if (height >0)
    document.write(" height="+height);
  document.writeln(" src=" +imageSet[0]+ " border=0>");
 setTimeout("flipFlipper(imageSet,speed)", speed)
}
function Flipper(width,height,images)
{
  speed=5000;
  FlipperLong(width,height,speed,images);
}

//Funcion para ocultar y mostrar capas
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Function for displaying the date
function hispafecha()
{
	fecha = new Date();
	mes = fecha.getMonth() + 1;
	anual = fecha.getFullYear();
	document.write(" " + DateDemo() + " " + MesDemo() + " " + DayDemo() + ", " + anual);
}
function hispasemana()
	{
fecha = new Date();
dia = fecha.getDate();
document.write(dia);
}
function DayDemo()
	{
fecha = new Date();
dia = fecha.getDate();
return(dia);
}
function DateDemo()
{
  var d, day, x, s = "";
  var x = new Array("Sunday", "Monday", "Tuesday");
  var x = x.concat("Wednesday","Thursday", "Friday");
  var x = x.concat("Saturday");
  d = new Date();
  day = d.getDay();
  return(s += x[day]);
}
function MesDemo()
{
  var d, day, x, s = "";
  var x = new Array("January", "February", "March");
  var x = x.concat("April","May", "June");
  var x = x.concat("July","August", "September");
  var x = x.concat("October","November", "December");
  d = new Date();
  mimes = d.getMonth();
  return(s += x[mimes]);
}
function TimeDemo()
{
  var d, s = "";
  var c = ":";
  d = new Date();
  s += d.getHours() + c;
  s += d.getMinutes();
  return(s);
}

