$(document).ready(function(){
		//alert($("#destacados"))
		$("#destacados > ul").tabs({ event: 'mouseover',fx: { opacity: 'toggle' } }).tabs('rotate', 4000).bind('mouseover',function()
		{
			$(this).tabs('rotate', null)
		}).bind('mouseout',function()
		{
			$(this).tabs('rotate', 4000)
		})
		.bind('click', function(){
			link = $(this).attr("rel");
			document.location.href = link;
		});
		
});

/***********************************************
* Local Time script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var weekdaystxt=["Dom", "Lun", "Mar", "Mier", "Jue", "Vie", "Sab"]

function showLocalTime(container, servermode, offsetMinutes, displayversion, dato){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.displayversion=displayversion
var servertimestring=(servermode=="server-php") ? dato : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'

this.localtime=this.serverdate=new Date(servertimestring)
this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time
this.updateTime()
this.updateContainer()
}

showLocalTime.prototype.updateTime=function(){
var thisobj=this
this.localtime.setSeconds(this.localtime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

showLocalTime.prototype.updateContainer=function(){
var thisobj=this
if (this.displayversion=="long")
this.container.innerHTML=this.localtime.toLocaleString()
else{
var hour=this.localtime.getHours()
var minutes=this.localtime.getMinutes()
var seconds=this.localtime.getSeconds()
var ampm=(hour>=12)? "PM" : "AM"
var dayofweek=weekdaystxt[this.localtime.getDay()]
this.container.innerHTML=formatField(hour, 1)+":"+formatField(minutes)+" "+ampm
}
setTimeout(function(){thisobj.updateContainer()}, 1000) //update container every second
}

function formatField(num, isHour){
if (typeof isHour!="undefined"){ //if this is the hour field
var hour=(num>12)? num-12 : num
return (hour==0)? 12 : hour
}
return (num<=9)? "0"+num : num//if this is minute or sec field
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	//document.cookie = name+"="+value+expires+"; path=/";
	document.cookie = name+"="+value+expires+"; path=/mendozaeconomico/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}

function minmaxCookie(cooky,nombre){
	var matriz = cooky.split("%7C%7C");
	var nueva;
	for(i = 0; i < 3; i++) 
	{		
		if(matriz[i].indexOf(nombre) != -1)
		{
			var dato = matriz[i].split("%2C");
			
			
			if(dato[1] == '1')
			{
				matriz[i] = dato[0]+"%2C0";
			}
			else
			{
				matriz[i] = dato[0]+"%2C1";			
			}
		}
	}	
	nueva = matriz.join("%7C%7C");
	return nueva;
	

}
function ira(aa)
{

		document.location.href = aa;
}
function addFav()
{
	if (window.sidebar && window.sidebar.addPanel)
		window.sidebar.addPanel("MendozaEconomico.com - Lo que necesitas saber a un click","http://www.mendozaeconomico.com","");
		else
		window.external.AddFavorite("http://www.mendozaeconomico.com","MendozaEconomico.com - Lo que necesitas saber a un click")

	return false;
}
function fbs_click() 
{
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

