// Seek Attention
//jQuery.fn.seekAttention=function(o){var defaultOptions={color:'black',opacity:0.55,fade:true,fadeSpeed:400,hideOnClick:true,hideOnHover:true,pulse:true,blur:true,pulseSpeed:400,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,container:'body'};for(var i in o){if(i!=='container'){if(o[i]&&o[i]!=='undefined'){if(typeof o[i]!==typeof defaultOptions[i]){return}}}else{if(typeof o[i]!=='object'&&typeof o[i]!=='string'){return}}}var options=$.extend(defaultOptions,o);$('.sa-overlay,.sa-pulse-overlay,div[class*="sa-blur"]').remove();function getHorPadding(elem){if(elem===document){return 0}return parseInt($(elem).css('paddingLeft').replace('px',''),10)+parseInt($(elem).css('paddingRight').replace('px',''),10)}function getVerPadding(elem){if(elem===document){return 0}return parseInt($(elem).css('paddingTop').replace('px',''),10)+parseInt($(elem).css('paddingBottom').replace('px',''),10)}function pixelateBorders(elem){if(elem===document){return 0}var blw='borderLeftWidth';var brw='borderRightWidth';var btw='borderTopWidth';var bbw='borderBottomWidth';function makeNumerical(prop){if($(elem).css(prop).indexOf('i')>-1){if($(elem).css(prop)==='thin'){$(elem).css(prop,'2px')}if($(elem).css(prop)==='medium'){$(elem).css(prop,'4px')}if($(elem).css(prop)==='thick'){$(elem).css(prop,'6px')}}}makeNumerical(blw);makeNumerical(brw);makeNumerical(btw);makeNumerical(bbw)}function getHorBorder(elem){if(elem===document){return 0}var horBorder=0;var borderLeftWidth=$(elem).css('borderLeftWidth');var borderRightWidth=$(elem).css('borderRightWidth');if($(elem).css('borderLeftStyle')!=='none'){horBorder+=parseInt(borderLeftWidth.replace('px',''),10)}if($(elem).css('borderRightStyle')!=='none'){horBorder+=parseInt(borderRightWidth.replace('px',''),10)}return horBorder}function getVerBorder(elem){if(elem===document){return 0}var verBorder=0;var borderTopWidth=$(elem).css('borderTopWidth');var borderBottomWidth=$(elem).css('borderBottomWidth');if($(elem).css('borderTopStyle')!=='none'){verBorder+=parseInt(borderTopWidth.replace('px',''),10)}if($(elem).css('borderBottomStyle')!=='none'){verBorder+=parseInt(borderBottomWidth.replace('px',''),10)}return verBorder}function newBox(t,l,h,w,c){$('<div/>').css({top:t+'px',left:l+'px',position:'absolute',zIndex:9999,height:h+'px',width:w+'px',background:options.color,opacity:0,display:'none'}).addClass(c||'sa-overlay').appendTo('body').show()}$(this).each(function(i){if(i>0){return}pixelateBorders(this);var containerIsDocument=(options.container==='body'||options.container===document)?true:false;var container=(containerIsDocument)?document:$(options.container);var containerHeight=$(container).height()+getVerPadding(container)+getVerBorder(container);var containerWidth=$(container).width()+getHorPadding(container)+getHorBorder(container);var containerTop=(containerIsDocument)?0:$(container).offset().top;var containerLeft=(containerIsDocument)?0:$(container).offset().left;var width=$(this).width()+getHorPadding(this)+getHorBorder(this)+options.paddingLeft+options.paddingRight;var height=$(this).height()+getVerPadding(this)+getVerBorder(this)+options.paddingTop+options.paddingBottom;var left=$(this).offset().left-options.paddingLeft;var top=$(this).offset().top-options.paddingTop;var right=containerWidth-(width+left);var bottom=containerHeight-(height+top);if(left<containerLeft||top<containerTop||left>containerLeft+containerWidth||top>containerTop+containerHeight){return}right=(right.toString().indexOf('-')>-1)?0:right;bottom=(bottom.toString().indexOf('-')>-1)?0:bottom;top=(top.toString().indexOf('-')>-1)?0:top;left=(left.toString().indexOf('-')>-1)?0:left;newBox(containerTop,containerLeft,containerHeight,left-containerLeft);newBox(containerTop,containerLeft+(left-containerLeft),top-containerTop,width);newBox(containerTop,(left-containerLeft)+containerLeft+width,containerHeight,containerWidth-(left-containerLeft)-width);newBox((top-containerTop)+containerTop+height,left,containerHeight-((top-containerTop))-height,width);newBox(top,left,height,width,'sa-pulse-overlay');var blur=($.browser.msie&&$.browser.version<=6)?false:options.blur;if(blur){$([1,2,3,4]).each(function(i){newBox(top+i,left+i,height-(i*2),1,'sa-blur'+i);newBox(top+i,left+1+i,1,width-(2+(2*i)),'sa-blur'+i);newBox(top+i,left+width-(i+1),height-(2*i),1,'sa-blur'+i);newBox(top+height-(i+1),left+1+i,1,width-(2+(2*i)),'sa-blur'+i);$('.sa-blur'+i).css({backgroundColor:options.color,opacity:0}).attr('id','sa-blur'+(options.opacity/2-(i/8)).toString())})}var hasScrolled=false;var scrolled=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);var viewportHeight=(parseInt($(window).height(),10)>window.innerHeight)?window.innerHeight:parseInt($(window).height(),10);if(top>(scrolled+viewportHeight)||top+height>(scrolled+viewportHeight)||top<scrolled){var where=top-Math.round(viewportHeight/2);$('html, body').animate({scrollTop:where},1000);hasScrolled=true}setTimeout(function(){if(options.fade){$('.sa-overlay').animate({opacity:options.opacity},options.fadeSpeed);$('div[class*="sa-blur"]').each(function(){$(this).animate({opacity:$(this).attr('id').substr(7)})});setTimeout(function(){attachEvents()},options.fadeSpeed)}else{$('.sa-overlay').css({opacity:options.opacity});$('div[class*="sa-blur"]').each(function(){$(this).css({opacity:$(this).attr('id').substr(7)})});setTimeout(function(){attachEvents()},200)}function pulseElement(){$('.sa-pulse-overlay').animate({opacity:options.opacity/2},options.pulseSpeed,function(){$(this).animate({opacity:0},options.pulseSpeed,function(){pulseElement()})})}if(options.pulse){pulseElement()}},(hasScrolled)?1000:500);function attachEvents(){if(options.hideOnHover){$('.sa-pulse-overlay').mouseover(function(){$('.sa-pulse-overlay').remove();$('div[class*="sa-blur"],.sa-overlay,').fadeOut(400,function(){$('div[class*="sa-blur"],.sa-overlay,').remove()})})}if(options.hideOnClick){$('.sa-overlay,.sa-pulse-overlay').click(function(){$('.sa-overlay,.sa-pulse-overlay').remove();$('div[class*="sa-blur"]').remove()})}}})};
//

/* http://keith-wood.name/countdown.html
   Countdown for jQuery v1.5.3.
   Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
   Please attribute the author if you use it. */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(x($){x 1d(){8.1w=[];8.1w[\'\']={1e:[\'2o\',\'2p\',\'2q\',\'2r\',\'2s\',\'2t\',\'2u\'],2v:[\'2w\',\'2x\',\'2y\',\'2z\',\'2A\',\'2B\',\'2C\'],1f:[\'y\',\'m\',\'w\',\'d\'],1x:\':\',1M:1a};8.1g={1N:B,1O:B,1P:B,1Q:\'2D\',1h:\'\',1R:1a,1y:\'\',1S:\'\',1T:\'\',1U:1a,1V:B,1W:B};$.1o(8.1g,8.1w[\'\'])}t s=\'F\';t Y=0;t O=1;t W=2;t D=3;t H=4;t M=5;t S=6;$.1o(1d.1X,{1i:\'2E\',2F:2G(x(){$.F.1Y()},2H),13:[],2I:x(a){8.1z(8.1g,a);1A(8.1g,a||{})},1B:x(a,b,c,e,f,g,h,i){z(1j b==\'2J\'&&b.2K==L){i=b.2L();h=b.1C();g=b.1D();f=b.1E();e=b.Q();c=b.V();b=b.X()}t d=I L();d.2M(b);d.1Z(1);d.2N(c||0);d.1Z(e||1);d.2O(f||0);d.2P((g||0)-(R.2Q(a)<30?a*1p:a));d.2R(h||0);d.2S(i||0);A d},20:x(a,b){t c=$(a);z(c.21(8.1i)){A}c.2T(8.1i);t d={14:$.1o({},b),u:[0,0,0,0,0,0,0]};$.Z(a,s,d);8.22(a)},1F:x(a){z(!8.1G(a)){8.13.2U(a)}},1G:x(a){A($.2V(a,8.13)>-1)},1q:x(b){8.13=$.2W(8.13,x(a){A(a==b?B:a)})},1Y:x(){1b(t i=0;i<8.13.1H;i++){8.1k(8.13[i])}},1k:x(a,b){t c=$(a);b=b||$.Z(a,s);z(!b){A}c.2X(8.23(b));c[(8.C(b,\'1M\')?\'2Y\':\'2Z\')+\'31\'](\'33\');t d=8.C(b,\'1W\');z(d){d.1r(a,[b.P!=\'24\'?b.u:8.1s(b,b.E,I L())])}t e=b.P!=\'1l\'&&(b.J?b.15.N()<=b.J.N():b.15.N()>=b.16.N());z(e&&!b.1I){b.1I=25;z(8.1G(a)||8.C(b,\'1U\')){8.1q(a);t f=8.C(b,\'1V\');z(f){f.1r(a,[])}t g=8.C(b,\'1T\');z(g){t h=8.C(b,\'1h\');b.14.1h=g;8.1k(a,b);b.14.1h=h}t i=8.C(b,\'1S\');z(i){34.35=i}}b.1I=1a}1m z(b.P==\'1l\'){8.1q(a)}$.Z(a,s,b)},22:x(a,b,c){b=b||{};z(1j b==\'1J\'){t d=b;b={};b[d]=c}t e=$.Z(a,s);z(e){8.1z(e.14,b);1A(e.14,b);8.26(e);$.Z(a,s,e);t f=I L();z((e.J&&e.J<f)||(e.16&&e.16>f)){8.1F(a)}8.1k(a,e)}},1z:x(a,b){t c=1a;1b(t n 1K b){z(n.K(/[27]28/)){c=25;11}}z(c){1b(t n 1K a){z(n.K(/[27]28[0-9]/)){a[n]=B}}}},36:x(a){t b=$(a);z(!b.21(8.1i)){A}8.1q(a);b.37(8.1i).38();$.39(a,s)},3a:x(a){8.P(a,\'1l\')},3b:x(a){8.P(a,\'24\')},3c:x(a){8.P(a,B)},P:x(a,b){t c=$.Z(a,s);z(c){z(c.P==\'1l\'&&!b){c.u=c.29;t d=(c.J?\'-\':\'+\');c[c.J?\'J\':\'16\']=8.1t(d+c.u[0]+\'y\'+d+c.u[1]+\'o\'+d+c.u[2]+\'w\'+d+c.u[3]+\'d\'+d+c.u[4]+\'h\'+d+c.u[5]+\'m\'+d+c.u[6]+\'s\');8.1F(a)}c.P=b;c.29=(b==\'1l\'?c.u:B);$.Z(a,s,c);8.1k(a,c)}},3d:x(a){t b=$.Z(a,s);A(!b?B:(!b.P?b.u:8.1s(b,b.E,I L())))},C:x(a,b){A(a.14[b]!=B?a.14[b]:$.F.1g[b])},26:x(a){t b=I L();t c=8.C(a,\'1P\');c=(c==B?-I L().3e():c);a.J=8.C(a,\'1O\');z(a.J){a.J=8.1B(c,8.1t(a.J,B))}a.16=8.1B(c,8.1t(8.C(a,\'1N\'),b));a.E=8.2a(a)},1t:x(k,l){t m=x(a){t b=I L();b.2b(b.N()+a*2c);A b};t n=x(a){a=a.3f();t b=I L();t c=b.X();t d=b.V();t e=b.Q();t f=b.1E();t g=b.1D();t h=b.1C();t i=/([+-]?[0-9]+)\\s*(s|m|h|d|w|o|y)?/g;t j=i.2d(a);3g(j){3h(j[2]||\'s\'){17\'s\':h+=18(j[1],10);11;17\'m\':g+=18(j[1],10);11;17\'h\':f+=18(j[1],10);11;17\'d\':e+=18(j[1],10);11;17\'w\':e+=18(j[1],10)*7;11;17\'o\':d+=18(j[1],10);e=R.1u(e,$.F.1c(c,d));11;17\'y\':c+=18(j[1],10);e=R.1u(e,$.F.1c(c,d));11}j=i.2d(a)}A I L(c,d,e,f,g,h,0)};t o=(k==B?l:(1j k==\'1J\'?n(k):(1j k==\'3i\'?m(k):k)));z(o)o.2e(0);A o},1c:x(a,b){A 32-I L(a,b,32).Q()},23:x(c){c.u=T=(c.P?c.u:8.1s(c,c.E,I L()));t d=1a;t e=0;1b(t f=0;f<c.E.1H;f++){d|=(c.E[f]==\'?\'&&T[f]>0);c.E[f]=(c.E[f]==\'?\'&&!d?B:c.E[f]);e+=(c.E[f]?1:0)}t g=8.C(c,\'1R\');t h=8.C(c,\'1h\');t i=(g?8.C(c,\'1f\'):8.C(c,\'1e\'));t j=8.C(c,\'1x\');t k=8.C(c,\'1y\')||\'\';t l=x(a){t b=$.F.C(c,\'1f\'+T[a]);A(c.E[a]?T[a]+(b?b[a]:i[a])+\' \':\'\')};t m=x(a){t b=$.F.C(c,\'1e\'+T[a]);A(c.E[a]?\'<U 1n="3j"><U 1n="2f">\'+T[a]+\'</U><3k/>\'+(b?b[a]:i[a])+\'</U>\':\'\')};A(h?8.2g(c,h,g):((g?\'<U 1n="1L 2f\'+(c.P?\' 2h\':\'\')+\'">\'+l(Y)+l(O)+l(W)+l(D)+(c.E[H]?8.G(T[H],2):\'\')+(c.E[M]?(c.E[H]?j:\'\')+8.G(T[M],2):\'\')+(c.E[S]?(c.E[H]||c.E[M]?j:\'\')+8.G(T[S],2):\'\'):\'<U 1n="1L 3l\'+e+(c.P?\' 2h\':\'\')+\'">\'+m(Y)+m(O)+m(W)+m(D)+m(H)+m(M)+m(S))+\'</U>\'+(k?\'<U 1n="1L 3m">\'+k+\'</U>\':\'\')))},2g:x(c,d,e){t f=8.C(c,(e?\'1f\':\'1e\'));t g=x(a){A($.F.C(c,(e?\'1f\':\'1e\')+c.u[a])||f)[a]};t h=x(a,b){A R.1v(a/b)%10};t j={3n:8.C(c,\'1y\'),3o:8.C(c,\'1x\'),3p:g(Y),3q:c.u[Y],3r:8.G(c.u[Y],2),3s:8.G(c.u[Y],3),3t:h(c.u[Y],1),3u:h(c.u[Y],10),3v:h(c.u[Y],19),3w:g(O),3x:c.u[O],3y:8.G(c.u[O],2),3z:8.G(c.u[O],3),3A:h(c.u[O],1),3B:h(c.u[O],10),3C:h(c.u[O],19),3D:g(W),3E:c.u[W],3F:8.G(c.u[W],2),3G:8.G(c.u[W],3),3H:h(c.u[W],1),3I:h(c.u[W],10),3J:h(c.u[W],19),3K:g(D),3L:c.u[D],3M:8.G(c.u[D],2),3N:8.G(c.u[D],3),3O:h(c.u[D],1),3P:h(c.u[D],10),3Q:h(c.u[D],19),3R:g(H),3S:c.u[H],3T:8.G(c.u[H],2),3U:8.G(c.u[H],3),3V:h(c.u[H],1),3W:h(c.u[H],10),3X:h(c.u[H],19),3Y:g(M),3Z:c.u[M],40:8.G(c.u[M],2),41:8.G(c.u[M],3),42:h(c.u[M],1),43:h(c.u[M],10),44:h(c.u[M],19),45:g(S),46:c.u[S],47:8.G(c.u[S],2),48:8.G(c.u[S],3),49:h(c.u[S],1),4a:h(c.u[S],10),4b:h(c.u[S],19)};t k=d;1b(t i=0;i<7;i++){t l=\'4c\'.4d(i);t m=I 2i(\'\\\\{\'+l+\'<\\\\}(.*)\\\\{\'+l+\'>\\\\}\',\'g\');k=k.2j(m,(c.E[i]?\'$1\':\'\'))}$.2k(j,x(n,v){t a=I 2i(\'\\\\{\'+n+\'\\\\}\',\'g\');k=k.2j(a,v)});A k},G:x(a,b){a=\'4e\'+a;A a.4f(a.1H-b)},2a:x(a){t b=8.C(a,\'1Q\');t c=[];c[Y]=(b.K(\'y\')?\'?\':(b.K(\'Y\')?\'!\':B));c[O]=(b.K(\'o\')?\'?\':(b.K(\'O\')?\'!\':B));c[W]=(b.K(\'w\')?\'?\':(b.K(\'W\')?\'!\':B));c[D]=(b.K(\'d\')?\'?\':(b.K(\'D\')?\'!\':B));c[H]=(b.K(\'h\')?\'?\':(b.K(\'H\')?\'!\':B));c[M]=(b.K(\'m\')?\'?\':(b.K(\'M\')?\'!\':B));c[S]=(b.K(\'s\')?\'?\':(b.K(\'S\')?\'!\':B));A c},1s:x(f,g,h){f.15=h;f.15.2e(0);t i=I L(f.15.N());z(f.J&&h.N()<f.J.N()){f.15=h=i}1m z(f.J){h=f.J}1m{i.2b(f.16.N());z(h.N()>f.16.N()){f.15=h=i}}t j=[0,0,0,0,0,0,0];z(g[Y]||g[O]){t k=$.F.1c(h.X(),h.V());t l=$.F.1c(i.X(),i.V());t m=(i.Q()==h.Q()||(i.Q()>=R.1u(k,l)&&h.Q()>=R.1u(k,l)));t n=x(a){A(a.1E()*1p+a.1D())*1p+a.1C()};t o=R.4g(0,(i.X()-h.X())*12+i.V()-h.V()+((i.Q()<h.Q()&&!m)||(m&&n(i)<n(h))?-1:0));j[Y]=(g[Y]?R.1v(o/12):0);j[O]=(g[O]?o-j[Y]*12:0);t p=x(a,b,c){t d=(a.Q()==c);t e=$.F.1c(a.X()+b*j[Y],a.V()+b*j[O]);z(a.Q()>e){a.2l(e)}a.4h(a.X()+b*j[Y]);a.4i(a.V()+b*j[O]);z(d){a.2l(e)}A a};z(f.J){i=p(i,-1,l)}1m{h=p(I L(h.N()),+1,k)}}t q=R.1v((i.N()-h.N())/2c);t r=x(a,b){j[a]=(g[a]?R.1v(q/b):0);q-=j[a]*b};r(W,4j);r(D,4k);r(H,4l);r(M,1p);r(S,1);A j}});x 1A(a,b){$.1o(a,b);1b(t c 1K b){z(b[c]==B){a[c]=B}}A a}$.4m.F=x(a){t b=4n.1X.4o.4p(4q,1);z(a==\'4r\'){A $.F[\'2m\'+a+\'1d\'].1r($.F,[8[0]].2n(b))}A 8.2k(x(){z(1j a==\'1J\'){$.F[\'2m\'+a+\'1d\'].1r($.F,[8].2n(b))}1m{$.F.20(8,a)}})};$.F=I 1d()})(4s);',62,277,'||||||||this|||||||||||||||||||||var|_periods|||function||if|return|null|_get||_show|countdown|_minDigits||new|_since|match|Date||getTime||_hold|getDate|Math||periods|span|getMonth||getFullYear||data||break||_timerTargets|options|_now|_until|case|parseInt|100|false|for|_getDaysInMonth|Countdown|labels|compactLabels|_defaults|layout|markerClassName|typeof|_updateCountdown|pause|else|class|extend|60|_removeTarget|apply|_calculatePeriods|_determineTime|min|floor|regional|timeSeparator|description|_resetExtraLabels|extendRemove|UTCDate|getSeconds|getMinutes|getHours|_addTarget|_hasTarget|length|_expiring|string|in|countdown_row|isRTL|until|since|timezone|format|compact|expiryUrl|expiryText|alwaysExpire|onExpiry|onTick|prototype|_updateTargets|setUTCDate|_attachCountdown|hasClass|_changeCountdown|_generateHTML|lap|true|_adjustSettings|Ll|abels|_savePeriods|_determineShow|setTime|1000|exec|setMilliseconds|countdown_amount|_buildLayout|countdown_holding|RegExp|replace|each|setDate|_|concat|A&ntilde;os|Meses|Semanas|D&iacute;as|Hs|Min|Seg|labels1|Year|Month|Week|Day|Hour|Minute|Second|dHMS|hasCountdown|_timer|setInterval|980|setDefaults|object|constructor|getMilliseconds|setUTCFullYear|setUTCMonth|setUTCHours|setUTCMinutes|abs|setUTCSeconds|setUTCMilliseconds|addClass|push|inArray|map|html|add|remove||Class||countdown_rtl|window|location|_destroyCountdown|removeClass|empty|removeData|_pauseCountdown|_lapCountdown|_resumeCountdown|_getTimesCountdown|getTimezoneOffset|toLowerCase|while|switch|number|countdown_section|br|countdown_show|countdown_descr|desc|sep|yl|yn|ynn|ynnn|y1|y10|y100|ol|on|onn|onnn|o1|o10|o100|wl|wn|wnn|wnnn|w1|w10|w100|dl|dn|dnn|dnnn|d1|d10|d100|hl|hn|hnn|hnnn|h1|h10|h100|ml|mn|mnn|mnnn|m1|m10|m100|sl|sn|snn|snnn|s1|s10|s100|yowdhms|charAt|0000000000|substr|max|setFullYear|setMonth|604800|86400|3600|fn|Array|slice|call|arguments|getTimes|jQuery'.split('|'),0,{}))


// variables
today = new Date();
ekoFecha = new Date("September 21, 2011 08:00:00");

$(document).ready(function(){

// Codigo EMBED prensa
$("#codigo-embed-li").hide();
$("#codigo-embed").toggle(
	function(){
		$(this).text("Reel Edicion 2008 (Embed) [ X cerrar ]");
    	$("#codigo-embed-li").show(800); return false;
	},
	function(){
		$(this).text("Reel Edicion 2008 (Embed)");
    	$("#codigo-embed-li").slideUp(500); return false;
	}
);
$("#codigo-embed-li textarea").focus(function(){
   $(this).select();
});

// Links externos en vent nueva
$("a[href^='http']").attr({ target: "_blank" });

// Link IR ARRIBA
$('#wrapper').append('<a href="#top" class="top">IR ARRIBA</a>');
/*
//Scroll suave
function filterPath(string) {
	return string
	.replace(/^\//,'')
	.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
	.replace(/\/$/,'');
}
var locationPath = filterPath(location.pathname);
$('a[href*=#]').each(function() {
	var thisPath = filterPath(this.pathname) || locationPath;
	if (  locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && this.hash.replace(/#/,'') ) {
		var $target = $(this.hash), target = this.hash;
		if (target) {
			var targetOffset = $target.offset().top;
		$(this).click(function(event) {
			event.preventDefault();
			$('html, body').animate({scrollTop: targetOffset}, 700, function() {
				location.hash = target;
		    });
		});
	}
}
});
*/

// MENU
$("ul#menu li").hover(
	function() { //Hover over event on list item
		$(this).css({ 'background' : '#FC0053'}); //Add background color + image on hovered list item
		$(this).find("span").fadeIn("fast"); //Show the subnav
} , function() { //on hover out...
		$(this).css({ 'background' : 'none'}); //Ditch the background
		$(this).find("span").fadeOut("fast"); //Hide the subnav
});
// Conferencia (flechita abajo)
$("a:contains('Conferencia')").addClass('drop');

// Cronograma
$("ol").hide();
$('#crono h2').click(function() {
	$(this).next("ol").toggle('slow');
});


// TRAINing detalle
$(".about").hide();
$(".col_doble a").click(function(){
	$(".about").slideToggle("slow"); return false;
});

// Sidebar:
$("#noved").hover(
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#00AEEF"});
},
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#000"});
});
$("#sponsor").hover(
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#B4C10A"});
},
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#000"});
});
$("#organiz").hover(
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#FC0053"});
},
function(){
	$(this).css({"border-width":"1px" , "border-style" : "solid" , "border-color" : "#000"});
});
//

// Footer deplegable

// Find list items representing folders and style them accordingly.  Also, turn them into links that can expand/collapse the tree leaf.
$('#footer li > ul').each(function(i) {
	// Find this list's parent list item.
	var parent_li = $(this).parent('li');

	// Style the list item as folder.
	parent_li.addClass('folder');

	// Temporarily remove the list from the parent list item, wrap the remaining text in an anchor, then reattach it.
	var sub_ul = $(this).remove();
	parent_li.wrapInner('<a/>').find('a').click(function() {
		// Make the anchor toggle the leaf display.
		sub_ul.slideToggle();
	});
	parent_li.append(sub_ul);
});

// Hide all lists except the outermost.
$('#footer ul ul').hide();

// Fomrulario REGISTRACION
$('#regis tr:odd').addClass('par');
$('#regis tr:even').addClass('impar');
$('#regis input, #regis textarea, #regis select').focus(function(){
	$(this).parent('td').parent('tr').addClass('tr_over');
}).blur(function(){
	$(this).parent('td').parent('tr').removeClass('tr_over');
});

// Actividades VER TXT COMPLETO
$('.txt_completo').hide(); 
$('.ver_txt_completo').toggle(
	function(){
		$(this).parent('p').next('.txt_completo').show("slow");
		$(this).text('- ocultar info');
	},
	function(){
		$(this).parent('p').next('.txt_completo').slideUp();
		$(this).text('+ ver info completa');
});

$('.txt_completo_eng').hide(); 
$('.ver_txt_completo_eng').toggle(
	function(){
		$(this).parent('p').next('.txt_completo_eng').show("slow");
		$(this).text('- hide info');
	},
	function(){
		$(this).parent('p').next('.txt_completo_eng').slideUp();
		$(this).text('+ read more');
});

/* embeber flash 
$('#flash').flash({ 
	swf: 'logo.swf', 
	width: '500px', 
	height: '250px', 
	hasVersion: 8, 
	flashvars: {}, 
	params: { wmode: 'transparent'} 
});
*/


// Novedades
var first = 0;
var speed = 400;
var pause = 5000;

function removeFirst(){
	first = $('#noved ul li:first').html();
	$('#noved ul li:first')
		.animate({opacity: 0}, speed)
		.slideUp('400', function() {$(this).remove();
	});
	addLast(first);
}
		
function addLast(first){
	last = '<li style="display:none">'+first+'</li>';
	$('#noved ul').append(last)
	$('#noved ul li:last')
		.animate({opacity: 1}, speed)
		.fadeIn('slow')
}
interval = setInterval(removeFirst, pause);

// Desordenar listado Gold
$('#sponsor #gold').each(function(){
    // get current ul
    var $ul = $(this);
    // get array of list items in current ul
    var $liArr = $ul.children('li');
    // sort array of list items in current ul randomly
    $liArr.sort(function(a,b){
          // Get a random number between 0 and 10
          var temp = parseInt( Math.random()*10 );
          // Get 1 or 0, whether temp is odd or even
          //var isOddOrEven = temp%2;
          // Get +1 or -1, whether temp greater or smaller than 5
          //var isPosOrNeg = temp>5 ? 1 : -1;
          // Return -1, 0, or +1
          return( temp );
    })
    // append list items to ul
    .appendTo($ul);            
});


// Sponsors Gold rotativos

$('.anythingSlider2').anythingSlider({
	//easing: "easeInOutExpo",
	autoPlay: true,
	delay: 3000,
	startStopped: false,
	animationTime: 500,
	hashTags: false,
	buildNavigation: false,
	pauseOnHover: false,
	startText: "",
	stopText: ""
	//navigationFormatter: formatText
});

// seccion ARCHIVO
$('#archivo li:odd').addClass('par');
$('#archivo li:even').addClass('impar');

$("#archivo a[href$=pdf]").addClass("pdf");
$("#archivo a[href$=ppt]").addClass("ppt");
$("#archivo a[href$=pptx]").addClass("ppt");
$("#archivo a[href$=jpg], #archivo a[href$=gif], #archivo a[href$=png]").addClass("img");
$("#archivo a[href$=zip]").addClass("zip");
$("#archivo a[href$=rar]").addClass("rar");
$("#archivo a[href*=/videos.php], #archivo a[href*=/videos.php]").addClass("ekovideos").attr({ target: "_blank" });
$("#archivo a[href*=http://www.youtube.com], #archivo a[href*=http://youtube.com]").addClass("youtube").attr({ target: "_blank" });
$("#archivo a[href*=http://www.vimeo.com], #archivo a[href*=http://vimeo.com]").addClass("vimeo").attr({ target: "_blank" });


// Cuenta regresiva - Countdown
$('#defaultCountdown').countdown({
	until: ekoFecha, 
	format: 'DHMS',
	layout: '<div id="t7_timer">'+
				'<div id="t7_vals">'+
					'<div id="t7_y" class="t7_numbs">{ynn}</div>'+
					'<div id="t7_d" class="t7_numbs">{dnnn}</div>'+
					'<div id="t7_h" class="t7_numbs">{hnn}</div>'+
					'<div id="t7_m" class="t7_numbs">{mnn}</div>'+
					'<div id="t7_s" class="t7_numbs">{snn}</div>'+
				'</div>'+
				'<div id="t7_labels">'+
					'<div id="t7_yl" class="t7_labs">years</div>'+
					'<div id="t7_dl" class="t7_labs">days</div>'+
					'<div id="t7_hl" class="t7_labs">hours</div>'+
					'<div id="t7_ml" class="t7_labs">mins</div>'+
					'<div id="t7_sl" class="t7_labs">secs</div>'+
				'</div>'+
				'<div id="t7_timer_over"></div>'+
			'</div>'
});


// fin JS
});


// ANYTHING SLIDER
/*
    anythingSlider v1.1
    
    By Chris Coyier: http://css-tricks.com
    with major improvements by Doug Neiner: http://pixelgraphics.us/
    based on work by Remy Sharp: http://jqueryfordesigners.com/


	To use the navigationFormatter function, you must have a function that
	accepts two paramaters, and returns a string of HTML text.
	
	index = integer index (1 based);
	panel = jQuery wrapped LI item this tab references
	@return = Must return a string of HTML/Text
	
	navigationFormatter: function(index, panel){
		return index + " Panel"; // This would have each tab with the text 'X Panel' where X = index
	}
*/

(function($){
	
    $.anythingSlider = function(el, options){
        // To avoid scope issues, use 'base' instead of 'this'
        // to reference this class from internal events and functions.
        var base = this;
        
        // Access to jQuery and DOM versions of element
        base.$el = $(el);
        base.el = el; 

		// Set up a few defaults
        base.currentPage = 1;
		base.timer = null;
		base.playing = false;

        // Add a reverse reference to the DOM object
        base.$el.data("AnythingSlider", base);
        
        base.init = function(){
            base.options = $.extend({},$.anythingSlider.defaults, options);
			
			// Cache existing DOM elements for later 
			base.$wrapper = base.$el.find('> div').css('overflow', 'hidden');
            base.$slider  = base.$wrapper.find('> ul');
            base.$items   = base.$slider.find('> li');
            base.$single  = base.$items.filter(':first');

			// Build the navigation if needed
			if(base.options.buildNavigation) base.buildNavigation();
        
        	// Get the details
            base.singleWidth = base.$single.outerWidth();
            base.pages = base.$items.length;

            // Top and tail the list with 'visible' number of items, top has the last section, and tail has the first
			// This supports the "infinite" scrolling
			base.$items.filter(':first').before(base.$items.filter(':last').clone().addClass('cloned'));
            base.$items.filter(':last' ).after(base.$items.filter(':first').clone().addClass('cloned'));

			// We just added two items, time to re-cache the list
            base.$items = base.$slider.find('> li'); // reselect
            
			// Setup our forward/backward navigation
			base.buildNextBackButtons();
		
			// If autoPlay functionality is included, then initialize the settings
			if(base.options.autoPlay) {
				base.playing = !base.options.startStopped; // Sets the playing variable to false if startStopped is true
				base.buildAutoPlay();
			};
			
			// If pauseOnHover then add hover effects
			if(base.options.pauseOnHover) {
				base.$el.hover(function(){
					base.clearTimer();
				}, function(){
					base.startStop(base.playing);
				});
			}
			
			// If a hash can not be used to trigger the plugin, then go to page 1
			if((base.options.hashTags == true && !base.gotoHash()) || base.options.hashTags == false){
				base.setCurrentPage(1);
			};
        };

		base.gotoPage = function(page, autoplay){
			// When autoplay isn't passed, we stop the timer
			if(autoplay !== true) autoplay = false;
			if(!autoplay) base.startStop(false);
			
			if(typeof(page) == "undefined" || page == null) {
				page = 1;
				base.setCurrentPage(1);
			};
			
			// Just check for bounds
			if(page > base.pages + 1) page = base.pages;
			if(page < 0 ) page = 1;

			var dir = page < base.currentPage ? -1 : 1,
                n = Math.abs(base.currentPage - page),
                left = base.singleWidth * dir * n;
			
			base.$wrapper.filter(':not(:animated)').animate({
                scrollLeft : '+=' + left
            }, base.options.animationTime, base.options.easing, function () {
                if (page == 0) {
                    base.$wrapper.scrollLeft(base.singleWidth * base.pages);
					page = base.pages;
                } else if (page > base.pages) {
                    base.$wrapper.scrollLeft(base.singleWidth);
                    // reset back to start position
                    page = 1;
                };
				base.setCurrentPage(page);
				
            });
		};
		
		base.setCurrentPage = function(page, move){
			// Set visual
			if(base.options.buildNavigation){
				base.$nav.find('.cur').removeClass('cur');
				$(base.$navLinks[page - 1]).addClass('cur');	
			};
			
			// Only change left if move does not equal false
			if(move !== false) base.$wrapper.scrollLeft(base.singleWidth * page);

			// Update local variable
			base.currentPage = page;
		};
		
		base.goForward = function(autoplay){
			if(autoplay !== true) autoplay = false;
			base.gotoPage(base.currentPage + 1, autoplay);
		};
		
		base.goBack = function(){
			base.gotoPage(base.currentPage - 1);
		};
		
		// This method tries to find a hash that matches panel-X
		// If found, it tries to find a matching item
		// If that is found as well, then that item starts visible
		base.gotoHash = function(){
			if(/^#?panel-\d+$/.test(window.location.hash)){
				var index = parseInt(window.location.hash.substr(7));
				var $item = base.$items.filter(':eq(' + index + ')');
				if($item.length != 0){
					base.setCurrentPage(index);
					return true;
				};
			};
			return false; // A item wasn't found;
		};
        
		// Creates the numbered navigation links
		base.buildNavigation = function(){
			base.$nav = $("<div id='thumbNav'></div>").appendTo(base.$el);
			base.$items.each(function(i,el){
				var index = i + 1;
				var $a = $("<a href='#'></a>");
				
				// If a formatter function is present, use it
				if( typeof(base.options.navigationFormatter) == "function"){
					$a.html(base.options.navigationFormatter(index, $(this)));
				} else {
					$a.text(index);
				}
				$a.click(function(e){
                    base.gotoPage(index);
                    
                    if (base.options.hashTags)
						base.setHash('panel-' + index);
						
                    e.preventDefault();
				});
				base.$nav.append($a);
			});
			base.$navLinks = base.$nav.find('> a');
		};
		
		
		// Creates the Forward/Backward buttons
		base.buildNextBackButtons = function(){
			var $forward = $('<a class="arrow forward">&gt;</a>'),
				$back    = $('<a class="arrow back">&lt;</a>');
				
            // Bind to the forward and back buttons
            $back.click(function(e){
                base.goBack();
				e.preventDefault();
            });

            $forward.click(function(e){
                base.goForward();
				e.preventDefault();
            });

			// Append elements to page
			base.$wrapper.after($back).after($forward);
		};
		
		// Creates the Start/Stop button
		base.buildAutoPlay = function(){

			base.$startStop = $("<a href='#' id='start-stop'></a>").html(base.playing ? base.options.stopText :  base.options.startText);
			base.$el.append(base.$startStop);            
            base.$startStop.click(function(e){
				base.startStop(!base.playing);
				e.preventDefault();
            });

			// Use the same setting, but trigger the start;
			base.startStop(base.playing);
		};
		
		// Handles stopping and playing the slideshow
		// Pass startStop(false) to stop and startStop(true) to play
		base.startStop = function(playing){
			if(playing !== true) playing = false; // Default if not supplied is false
			
			// Update variable
			base.playing = playing;
			
			// Toggle playing and text
			base.$startStop.toggleClass("playing", playing).html( playing ? base.options.stopText : base.options.startText );
			
			if(playing){
				base.clearTimer(); // Just in case this was triggered twice in a row
				base.timer = window.setInterval(function(){
					base.goForward(true);
				}, base.options.delay);
			} else {
				base.clearTimer();
			};
		};
		
		base.clearTimer = function(){
			// Clear the timer only if it is set
			if(base.timer) window.clearInterval(base.timer);
		};
		
		// Taken from AJAXY jquery.history Plugin
		base.setHash = function ( hash ) {
			// Write hash
			if ( typeof window.location.hash !== 'undefined' ) {
				if ( window.location.hash !== hash ) {
					window.location.hash = hash;
				};
			} else if ( location.hash !== hash ) {
				location.hash = hash;
			};
			
			// Done
			return hash;
		};
		// <-- End AJAXY code


		// Trigger the initialization
        base.init();
    };

	
    $.anythingSlider.defaults = {
        easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        delay: 3000,                    // How long between slide transitions in AutoPlay mode
        animationTime: 600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Start",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: null       // Details at the top of the file on this use (advanced use)
    };
	

    $.fn.anythingSlider = function(options){
		if(typeof(options) == "object"){
		    return this.each(function(i){			
				(new $.anythingSlider(this, options));

	            // This plugin supports multiple instances, but only one can support hash-tag support
				// This disables hash-tags on all items but the first one
				options.hashTags = false;
	        });	
		} else if (typeof(options) == "number") {

			return this.each(function(i){
				var anySlide = $(this).data('AnythingSlider');
				if(anySlide){
					anySlide.gotoPage(options);
				}
			});
		}
    };

	
})(jQuery);



