  $(document).ready(function(){
					   
	  showHora();
				    
  });

function sfb(el)
{
	
  $.facebox(
      { ajax: $(el).attr("href") });

  return false;
}

function clearValue(obj, value)
	{
		if(obj.value==value)
			obj.value="";
	}

	function setDefaultValue(obj, value)
	{
		// if(obj.value=="")
			// obj.value=value;
	}

  function clearValue2(obj, value)
	{
		if(obj.innerHTML==value)
			obj.innerHTML="";
	}

	function setDefaultValue2(obj, value)
	{
		// if(obj.innerHTML=="")
			// obj.innerHTML=value;
	}

  
	// JavaScript Document
	function LZ(x) {
		return(x<0||x>9?"":"0")+x;
		}
	

  
  function showHora(){
  	
    if (typeof es_archivo != "undefined" && es_archivo==true)
    {
      document.getElementById("hora_content").innerHTML= archivo_date ;
      document.getElementById("fecha_content").innerHTML= "Archivo";
      document.getElementById("dia_content").innerHTML= "" ;			
      return;
    }
    
    var Digital=new Date();  
		var Digital=new Date();
		var hours=Digital.getHours();
		var minutes=Digital.getMinutes();
		var seconds=Digital.getSeconds();
		if (minutes<=9)
			minutes="0"+minutes;
		if (seconds<=9)
			seconds="0"+seconds;
		var ctime=hours+":"+minutes+":"+seconds+" ";
 		document.getElementById("hora_content").innerHTML= ctime ;
		document.getElementById("fecha_content").innerHTML= LZ(Digital.getDate()) + '-' + LZ(Digital.getMonth()+1) + '-' + Digital.getFullYear();
		document.getElementById("dia_content").innerHTML= weekdayName(Digital) ;
		setTimeout("showHora()",1000);
	}

	function weekdayName(p_date)
	{
		var retVal = p_date.toString().split(' ')[0];
		var retVal = Array('Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado')[p_date.getDay()];

		return retVal;
	}

	function marqueeStop(){
		document.getElementById("marq").stop();
		//document.getElementById("marqueeplay").style.display = "block";
		//document.getElementById("marqueestop").style.display = "none";
	}
	function marqueePlay(){
		document.getElementById("marq").start();
		//document.getElementById("marqueeplay").style.display = "none";
		//document.getElementById("marqueestop").style.display = "block";
	}

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

	function doSearch()
	{
		window.location="interior.html";
	}

	function openNew(noticia_id)
	{
		window.location = "noticia.php?noticia_id=" + noticia_id + "&date=" +  Date.UTC()
	}
  
  
  /* REDES SOCIALES */
  $(document).ready(function(){
	//
	var mouseX = 0;
	var mouseY = 0;		
	var openRedSoc = false;	
	//
	function openRed(){
		$('.redesSociales').stop().animate({top: 0},{queue:false, duration:400, easing: 'easeOutExpo'});	
		openRedSoc = true;
	}
	function closeRed(){
    /*if($.browser.msie)
      $('.redesSociales').stop().animate({top: -37},{queue:false, duration:400, easing: 'easeOutExpo'});	 
		else
      $('.redesSociales').stop().animate({top: -51},{queue:false, duration:400, easing: 'easeOutExpo'});	*/
    $('.redesSociales').stop().animate({top: -51},{queue:false, duration:400, easing: 'easeOutExpo'});	
    openRedSoc = false;
	}
	//
	
  $('.redesSociales .btnDesp').mouseover(function () { 	
		if (!openRedSoc){
			openRed();
		}
	});
  
  // $('.redesSociales').mouseout(function(e) {
    // if (openRedSoc){
      // closeRed();
    // }
  // });
	 
	$(document).mousemove( function(e) {
		if (!openRedSoc)
      return;
    mouseX = e.pageX;
		mouseY = e.pageY;
		if (openRedSoc){
			if (mouseY > 100){
				closeRed();
			}
		}
	});
	//
});		
  
