//////////////////////////////
// FUNCIONES
//////////////////////////////
function obtenerObjeto(Id)                                                                 
{                 
  var obj = null;                                                                                                       
  // Netscape 6,7 y Explorer 5                                                         
  if (document.getElementById) {                                                       
	obj = document.getElementById(Id);                                                                                                                                                                                          
  }                                                                                    
  // Explorer 4                                                                        
  else if (document.all) {                                                             
	obj = document.all[Id];                                                      
  }                                                                                    
  // Netscape 4                                                                        
  else if (document.layers) {                                                          
	obj = document.layers[Id];                                                   
  }      
  return obj;      
}
	
function SetHand(obj)
{
	obj.style.cursor="Pointer";
}

function isDate(_value) {
    var _test = Date.parse(_value)
	return (!isNaN(_test));
}

///////////////////////////////
// JQUERY
//////////////////////////////
$(document).ready(function() {
		
	// Preload all rollovers
	$("#botones img, #pie img, .enlaces img, #anterior img, #siguiente img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#botones a,#pie a, .enlaces a, .enlacesPaginacion a, #anterior a, #siguiente a").mouseover(function(){
		imgsrc = $(this).children("img").attr("src");
		matches = imgsrc.match(/-over/);
		
		// don't do the rollover if state is already ON
		if (!matches) {
		imgsrcON = imgsrc.replace(/.gif$/ig,"-over.gif"); // strip off extension
		$(this).children("img").attr("src", imgsrcON);
		}
		
	});
	
	$("#botones a, #pie a, .enlaces a, .enlacesPaginacion a, #anterior a, #siguiente a").mouseout(function(){
		$(this).children("img").attr("src", imgsrc);
	});
	
});

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
