/**
 * jquery.timer.js
 *
 * Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
 *
 * http://jchavannes.com/jquery-timer
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

;(function($) {
	$.timer = function(func, time, autostart) {	
	 	this.set = function(func, time, autostart) {
	 		this.init = true;
	 	 	if(typeof func == 'object') {
		 	 	var paramList = ['autostart', 'time'];
	 	 	 	for(var arg in paramList) {if(func[paramList[arg]] != undefined) {eval(paramList[arg] + " = func[paramList[arg]]");}};
 	 			func = func.action;
	 	 	}
	 	 	if(typeof func == 'function') {this.action = func;}
		 	if(!isNaN(time)) {this.intervalTime = time;}
		 	if(autostart && !this.active) {
			 	this.active = true;
			 	this.setTimer();
		 	}
		 	return this;
	 	};
	 	this.once = function(time) {
			var timer = this;
	 	 	if(isNaN(time)) {time = 0;}
			window.setTimeout(function() {timer.action();}, time);
	 		return this;
	 	};
		this.play = function(reset) {
			if(!this.active) {
				if(reset) {this.setTimer();}
				else {this.setTimer(this.remaining);}
				this.active = true;
			}
			return this;
		};
		this.pause = function() {
			if(this.active) {
				this.active = false;
				this.remaining -= new Date() - this.last;
				this.clearTimer();
			}
			return this;
		};
		this.stop = function() {
			this.active = false;
			this.remaining = this.intervalTime;
			this.clearTimer();
			return this;
		};
		this.toggle = function(reset) {
			if(this.active) {this.pause();}
			else if(reset) {this.play(true);}
			else {this.play();}
			return this;
		};
		this.reset = function() {
			this.active = false;
			this.play(true);
			return this;
		};
		this.clearTimer = function() {
			window.clearTimeout(this.timeoutObject);
		};
	 	this.setTimer = function(time) {
			var timer = this;
	 	 	if(typeof this.action != 'function') {return;}
	 	 	if(isNaN(time)) {time = this.intervalTime;}
		 	this.remaining = time;
	 	 	this.last = new Date();
			this.clearTimer();
			this.timeoutObject = window.setTimeout(function() {timer.go();}, time);
		};
	 	this.go = function() {
	 		if(this.active) {
	 			this.action();
	 			this.setTimer();
	 		}
	 	};
	 	
	 	if(this.init) {
	 		return new $.timer(func, time, autostart);
	 	} else {
			this.set(func, time, autostart);
	 		return this;
	 	}
	};
})(jQuery);;
/*!	SWFObject v2.0 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/

var swfobject = function() {
	
	var UNDEF = "undefined",
		OBJECT = "object",
		SHOCKWAVE_FLASH = "Shockwave Flash",
		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
		FLASH_MIME_TYPE = "application/x-shockwave-flash",
		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
		
		win = window,
		doc = document,
		nav = navigator,
		
		domLoadFnArr = [],
		regObjArr = [],
		timer = null,
		storedAltContent = null,
		storedAltContentId = null,
		isDomLoaded = false,
		isExpressInstallActive = false;
	
	/* Centralized function for browser feature detection
		- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
		- User agent string detection is only used when no alternative is possible
		- Is executed directly for optimal performance
	*/	
	var ua = function() {
		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
			playerVersion = [0,0,0],
			d = null;
		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
			d = nav.plugins[SHOCKWAVE_FLASH].description;
			if (d) {
				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
				playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
			}
		}
		else if (typeof win.ActiveXObject != UNDEF) {
			var a = null, fp6Crash = false;
			try {
				a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
			}
			catch(e) {
				try { 
					a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
					playerVersion = [6,0,21];
					a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
				}
				catch(e) {
					if (playerVersion[0] == 6) {
						fp6Crash = true;
					}
				}
				if (!fp6Crash) {
					try {
						a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
					}
					catch(e) {}
				}
			}
			if (!fp6Crash && a) { // a will return null when ActiveX is disabled
				try {
					d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
					if (d) {
						d = d.split(" ")[1].split(",");
						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
					}
				}
				catch(e) {}
			}
		}
		var u = nav.userAgent.toLowerCase(),
			p = nav.platform.toLowerCase(),
			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
			ie = false,
			windows = p ? /win/.test(p) : /win/.test(u),
			mac = p ? /mac/.test(p) : /mac/.test(u);
		/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
		return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
	}();

	/* Cross-browser onDomLoad
		- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
		- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
	*/ 
	var onDomLoad = function() {
		if (!ua.w3cdom) {
			return;
		}
		addDomLoadEvent(main);
		if (ua.ie && ua.win) {
			try {  // Avoid a possible Operation Aborted error
				doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors 
				var s = getElementById("__ie_ondomload");
				if (s) {
					s.onreadystatechange = function() {
						if (this.readyState == "complete") {
							this.parentNode.removeChild(this);
							callDomLoadFunctions();
						}
					};
				}
			}
			catch(e) {}
		}
		if (ua.webkit && typeof doc.readyState != UNDEF) {
			timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
		}
		if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
		}
		addLoadEvent(callDomLoadFunctions);
	}();
	
	function callDomLoadFunctions() {
		if (isDomLoaded) {
			return;
		}
		if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
			var s = createElement("span");
			try { // Avoid a possible Operation Aborted error
				var t = doc.getElementsByTagName("body")[0].appendChild(s);
				t.parentNode.removeChild(t);
			}
			catch (e) {
				return;
			}
		}
		isDomLoaded = true;
		if (timer) {
			clearInterval(timer);
			timer = null;
		}
		var dl = domLoadFnArr.length;
		for (var i = 0; i < dl; i++) {
			domLoadFnArr[i]();
		}
	}
	
	function addDomLoadEvent(fn) {
		if (isDomLoaded) {
			fn();
		}
		else { 
			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
		}
	}
	
	/* Cross-browser onload
		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
		- Will fire an event as soon as a web page including all of its assets are loaded 
	 */
	function addLoadEvent(fn) {
		if (typeof win.addEventListener != UNDEF) {
			win.addEventListener("load", fn, false);
		}
		else if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("load", fn, false);
		}
		else if (typeof win.attachEvent != UNDEF) {
			win.attachEvent("onload", fn);
		}
		else if (typeof win.onload == "function") {
			var fnOld = win.onload;
			win.onload = function() {
				fnOld();
				fn();
			};
		}
		else {
			win.onload = fn;
		}
	}
	
	/* Main function
		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
	*/
	function main() { // Static publishing only
		var rl = regObjArr.length;
		for (var i = 0; i < rl; i++) { // For each registered object element
			var id = regObjArr[i].id;
			if (ua.pv[0] > 0) {
				var obj = getElementById(id);
				if (obj) {
					regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
					regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
					if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
						if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
							fixParams(obj);
						}
						setVisibility(id, true);
					}
					else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
						showExpressInstall(regObjArr[i]);
					}
					else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
						displayAltContent(obj);
					}
				}
			}
			else {  // If no fp is installed, we let the object element do its job (show alternative content)
				setVisibility(id, true);
			}
		}
	}
	
	/* Fix nested param elements, which are ignored by older webkit engines
		- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
		- Fall back to the proprietary embed element
	*/
	function fixParams(obj) {
		var nestedObj = obj.getElementsByTagName(OBJECT)[0];
		if (nestedObj) {
			var e = createElement("embed"), a = nestedObj.attributes;
			if (a) {
				var al = a.length;
				for (var i = 0; i < al; i++) {
					if (a[i].nodeName.toLowerCase() == "data") {
						e.setAttribute("src", a[i].nodeValue);
					}
					else {
						e.setAttribute(a[i].nodeName, a[i].nodeValue);
					}
				}
			}
			var c = nestedObj.childNodes;
			if (c) {
				var cl = c.length;
				for (var j = 0; j < cl; j++) {
					if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
						e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
					}
				}
			}
			obj.parentNode.replaceChild(e, obj);
		}
	}
	
	/* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
		- Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
		- Dynamic publishing only
	*/
	function fixObjectLeaks(id) {
		if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
			win.attachEvent("onunload", function () {
				var obj = getElementById(id);
				if (obj) {
					for (var i in obj) {
						if (typeof obj[i] == "function") {
							obj[i] = function() {};
						}
					}
					obj.parentNode.removeChild(obj);
				}
			});
		}
	}
	
	/* Show the Adobe Express Install dialog
		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
	*/
	function showExpressInstall(regObj) {
		isExpressInstallActive = true;
		var obj = getElementById(regObj.id);
		if (obj) {
			if (regObj.altContentId) {
				var ac = getElementById(regObj.altContentId);
				if (ac) {
					storedAltContent = ac;
					storedAltContentId = regObj.altContentId;
				}
			}
			else {
				storedAltContent = abstractAltContent(obj);
			}
			if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
				regObj.width = "310";
			}
			if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
				regObj.height = "137";
			}
			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
				dt = doc.title,
				fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
				replaceId = regObj.id;
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			if (ua.ie && ua.win && obj.readyState != 4) {
				var newObj = createElement("div");
				replaceId += "SWFObjectNew";
				newObj.setAttribute("id", replaceId);
				obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
				obj.style.display = "none";
				win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
			}
			createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
		}
	}
	
	/* Functions to abstract and display alternative content
	*/
	function displayAltContent(obj) {
		if (ua.ie && ua.win && obj.readyState != 4) {
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			var el = createElement("div");
			obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
			el.parentNode.replaceChild(abstractAltContent(obj), el);
			obj.style.display = "none";
			win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
		}
		else {
			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
		}
	}	

	function abstractAltContent(obj) {
		var ac = createElement("div");
		if (ua.win && ua.ie) {
			ac.innerHTML = obj.innerHTML;
		}
		else {
			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
			if (nestedObj) {
				var c = nestedObj.childNodes;
				if (c) {
					var cl = c.length;
					for (var i = 0; i < cl; i++) {
						if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
							ac.appendChild(c[i].cloneNode(true));
						}
					}
				}
			}
		}
		return ac;
	}
	
	/* Cross-browser dynamic SWF creation
	*/
	function createSWF(attObj, parObj, id) {
		var r, el = getElementById(id);
		if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
			attObj.id = id;
		}
		if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
			var att = "";
			for (var i in attObj) {
				if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
					if (i == "data") {
						parObj.movie = attObj[i];
					}
					else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						att += ' class="' + attObj[i] + '"';
					}
					else if (i != "classid") {
						att += ' ' + i + '="' + attObj[i] + '"';
					}
				}
			}
			var par = "";
			for (var j in parObj) {
				if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
					par += '<param name="' + j + '" value="' + parObj[j] + '" />';
				}
			}
			el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
			fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
			r = getElementById(attObj.id);	
		}
		else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
			var e = createElement("embed");
			e.setAttribute("type", FLASH_MIME_TYPE);
			for (var k in attObj) {
				if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
					if (k == "data") {
						e.setAttribute("src", attObj[k]);
					}
					else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						e.setAttribute("class", attObj[k]);
					}
					else if (k != "classid") { // Filter out IE specific attribute
						e.setAttribute(k, attObj[k]);
					}
				}
			}
			for (var l in parObj) {
				if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
					if (l != "movie") { // Filter out IE specific param element
						e.setAttribute(l, parObj[l]);
					}
				}
			}
			el.parentNode.replaceChild(e, el);
			r = e;
		}
		else { // Well-behaving browsers
			var o = createElement(OBJECT);
			o.setAttribute("type", FLASH_MIME_TYPE);
			for (var m in attObj) {
				if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
					if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						o.setAttribute("class", attObj[m]);
					}
					else if (m != "classid") { // Filter out IE specific attribute
						o.setAttribute(m, attObj[m]);
					}
				}
			}
			for (var n in parObj) {
				if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
					createObjParam(o, n, parObj[n]);
				}
			}
			el.parentNode.replaceChild(o, el);
			r = o;
		}
		return r;
	}
	
	function createObjParam(el, pName, pValue) {
		var p = createElement("param");
		p.setAttribute("name", pName);	
		p.setAttribute("value", pValue);
		el.appendChild(p);
	}
	
	function getElementById(id) {
		return doc.getElementById(id);
	}
	
	function createElement(el) {
		return doc.createElement(el);
	}
	
	function hasPlayerVersion(rv) {
		var pv = ua.pv, v = rv.split(".");
		v[0] = parseInt(v[0], 10);
		v[1] = parseInt(v[1], 10);
		v[2] = parseInt(v[2], 10);
		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
	}
	
	/* Cross-browser dynamic CSS creation
		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
	*/	
	function createCSS(sel, decl) {
		if (ua.ie && ua.mac) {
			return;
		}
		var h = doc.getElementsByTagName("head")[0], s = createElement("style");
		s.setAttribute("type", "text/css");
		s.setAttribute("media", "screen");
		if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
			s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
		}
		h.appendChild(s);
		if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
			var ls = doc.styleSheets[doc.styleSheets.length - 1];
			if (typeof ls.addRule == OBJECT) {
				ls.addRule(sel, decl);
			}
		}
	}
	
	function setVisibility(id, isVisible) {
		var v = isVisible ? "inherit" : "hidden";
		if (isDomLoaded) {
			getElementById(id).style.visibility = v;
		}
		else {
			createCSS("#" + id, "visibility:" + v);
		}
	}
	
	function getTargetVersion(obj) {
	    if (!obj)
	        return 0;
		var c = obj.childNodes;
		var cl = c.length;
		for (var i = 0; i < cl; i++) {
			if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") {
			    c = c[i].childNodes;
			    cl = c.length;
			    i = 0;
			}     
			if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "swfversion") {
			   return c[i].getAttribute("value"); 
			}
		}
		return 0;
	}
    
	function getExpressInstall(obj) {
	    if (!obj)
	        return "";
		var c = obj.childNodes;
		var cl = c.length;
		for (var i = 0; i < cl; i++) {
			if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") {
			    c = c[i].childNodes;
			    cl = c.length;
			    i = 0;
			}     
			if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "expressinstall") { 
			    return c[i].getAttribute("value"); 
			}	       
		}
		return "";
	}
    
	return {
		/* Public API
			- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
		*/ 
		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
			if (!ua.w3cdom || !objectIdStr) {
				return;
			}
			var obj = document.getElementById(objectIdStr);
			var xi = getExpressInstall(obj);
			var regObj = {};
			regObj.id = objectIdStr;
			regObj.swfVersion = swfVersionStr ? swfVersionStr : getTargetVersion(obj);
			regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : ((xi != "") ? xi : false);
			regObjArr[regObjArr.length] = regObj;
			setVisibility(objectIdStr, false);
		},
		
		getObjectById: function(objectIdStr) {
			var r = null;
			if (ua.w3cdom && isDomLoaded) {
				var o = getElementById(objectIdStr);
				if (o) {
					var n = o.getElementsByTagName(OBJECT)[0];
					if (!n || (n && typeof o.SetVariable != UNDEF)) {
				    	r = o;
					}
					else if (typeof n.SetVariable != UNDEF) {
						r = n;
					}
				}
			}
			return r;
		},
		
		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
			if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
				return;
			}
			widthStr += ""; // Auto-convert to string to make it idiot proof
			heightStr += "";
			if (hasPlayerVersion(swfVersionStr)) {
				setVisibility(replaceElemIdStr, false);
				var att = (typeof attObj == OBJECT) ? attObj : {};
				att.data = swfUrlStr;
				att.width = widthStr;
				att.height = heightStr;
				var par = (typeof parObj == OBJECT) ? parObj : {};
				if (typeof flashvarsObj == OBJECT) {
					for (var i in flashvarsObj) {
						if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
							if (typeof par.flashvars != UNDEF) {
								par.flashvars += "&" + i + "=" + flashvarsObj[i];
							}
							else {
								par.flashvars = i + "=" + flashvarsObj[i];
							}
						}
					}
				}
				addDomLoadEvent(function() {
					createSWF(att, par, replaceElemIdStr);
					if (att.id == replaceElemIdStr) {
						setVisibility(replaceElemIdStr, true);
					}
				});
			}
			else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
				setVisibility(replaceElemIdStr, false);
				addDomLoadEvent(function() {
					var regObj = {};
					regObj.id = regObj.altContentId = replaceElemIdStr;
					regObj.width = widthStr;
					regObj.height = heightStr;
					regObj.expressInstall = xiSwfUrlStr;
					showExpressInstall(regObj);
				});
			}
		},
		
		getFlashPlayerVersion: function() {
			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
		},
		
		hasFlashPlayerVersion:hasPlayerVersion,
		
		createSWF: function(attObj, parObj, replaceElemIdStr) {
			if (ua.w3cdom && isDomLoaded) {
				return createSWF(attObj, parObj, replaceElemIdStr);
			}
			else {
				return undefined;
			}
		},
		
		createCSS: function(sel, decl) {
			if (ua.w3cdom) {
				createCSS(sel, decl);
			}
		},
		
		addDomLoadEvent:addDomLoadEvent,
		
		addLoadEvent:addLoadEvent,
		
		getQueryParamValue: function(param) {
			var q = doc.location.search || doc.location.hash;
			if (param == null) {
				return q;
			}
		 	if(q) {
				var pairs = q.substring(1).split("&");
				for (var i = 0; i < pairs.length; i++) {
					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
						return pairs[i].substring((pairs[i].indexOf("=") + 1));
					}
				}
			}
			return "";
		},
		
		// For internal usage only
		expressInstallCallback: function() {
			if (isExpressInstallActive && storedAltContent) {
				var obj = getElementById(EXPRESS_INSTALL_ID);
				if (obj) {
					obj.parentNode.replaceChild(storedAltContent, obj);
					if (storedAltContentId) {
						setVisibility(storedAltContentId, true);
						if (ua.ie && ua.win) {
							storedAltContent.style.display = "block";
						}
					}
					storedAltContent = null;
					storedAltContentId = null;
					isExpressInstallActive = false;
				}
			} 
		}
		
	};

}();
;
// Using the closure to map jQuery to $.
(function ($) {
	
  // Store our function as a property of Drupal.behaviors.
  Drupal.behaviors.destacado = {
    attach: function (context, settings) {
      // Find all the secure links inside context that do not have our processed
      // class.
      $('#featured > ul', context)
        $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 10000, true);
    }
  }

}(jQuery));;
// Using the closure to map jQuery to $.
(function ($) {
	
  // Store our function as a property of Drupal.behaviors.
  Drupal.behaviors.fixedbuttoms = {
    attach: function (context, settings) {

		
		/* ICONO HOME */
		  $(".header-home-icon").mouseenter(function() {
		    $(".header-home-text").show("slow");
		  }).mouseleave(function() {
		    $(".header-home-text").hide("fast");
		  });
		
		
		/* CENTRAR MENU PRINCIPAL */
		var menu_ancho = $("#main-menu").width();
		menu_ancho = 972-menu_ancho;
		if(menu_ancho>1){
			menu_ancho = (menu_ancho/2);
			$("#main-menu").css('margin-right', menu_ancho );
		}
		
		/* DROPDOWN MENU */

		
		//MOSTRAR NOTICIAS PASADAS
		var showhistory = false;
		function doIthistory() {
		  $(".historynews, .view-secciones-internacional .item-list").show("slow");
		  $(".edicionanterior").text("Ocultar Ediciones Anteriores");
		  showhistory = true;
		}
		function nohistory() {
		  $(".historynews, .view-secciones-internacional .item-list").hide("fast");
		$(".edicionanterior").text("Mostrar Ediciones Anteriores");
		  showhistory = false;
		}
		
		$('.edicionanterior').click(function() {
			if(showhistory == false){
				doIthistory();
			}else{
				nohistory();
			}
		});
		
		/* CENTRAR VERTICAL EXCLUSIVAS DE ULT PAG */
		if ($('.exclusivas_ult_pag_row_nd').length){  
			$(".exclusivas_ult_pag_row_nd .link_center").each(function (index, domEle) {
				// domEle == this
				var exclusivas_alto = $(domEle).height();
				exclusivas_alto = 64-exclusivas_alto;
			    if(exclusivas_alto>1){
					exclusivas_alto = (exclusivas_alto/2);
					$(domEle).css('margin-top', exclusivas_alto );
				}
			});
		}
		
		/* CENTRAR VERTICAL INDICE */
		if ($('.indice_row_nd').length){
			$(".indice_row_nd .link_center").each(function (index, domEle) {
				// domEle == this
				var exclusivas_alto = $(domEle).height();
				exclusivas_alto = 64-exclusivas_alto;
			    if(exclusivas_alto>1){
					exclusivas_alto = (exclusivas_alto/2);
					$(domEle).css('margin-top', exclusivas_alto );
				}
			});
		}
			

		/* ULTIMOS TWEETS */
		if ($('.ultimos_tweets_row_nd').length){
			$(".ultimos_tweets_row_nd").tweet({
	            username: "quintodiaonline",
	            join_text: "auto",
	            avatar_size: 32,
	            count: 8,
	            auto_join_text_default: "Quintodia dice:",
	            auto_join_text_ed: "Quintodia",
	            auto_join_text_ing: "Quintodia dijo",
	            auto_join_text_reply: "Quintodia responde a",
	            auto_join_text_url: "Quintodia esta viendo",
	            loading_text: "Cargando tweets...",
				refresh_interval: 20,
				template: "{avatar}{text} » {time} · {reply_action} · {retweet_action}"
	        });
					//alert("entro");
					var countador = 0;
					var timer = $.timer(function() {
					if(countador==7){
						countador=0;
						$(".tweet_list").animate({"bottom": "-=448px"}, 2000);
					}else{
						$(".tweet_list").animate({"bottom": "+=64px"}, 4000);
						countador = countador+1;
					}
					});
					timer.set({ time : 1000*6, autostart : true });
					
					setTimeout(function(){  
					       timer.play(); 
					}, 3000);
					
					$(".ultimos_tweets_row_nd").mouseenter(function() {
					    timer.pause();
					}).mouseleave(function() {
						timer.play();
					});
							
		}
		
		/* CARROUSEL COLUMNAS HOME */
		
		var countador2 = 0;
		var timer2 = $.timer(function() {
		if(countador2==3){
			countador2=0;
			$(".panels-flexible-region-1-columnas").animate({"left": "+=702px"}, 3000);
		}else{
		    $(".panels-flexible-region-1-columnas").animate({"left": "-=234px"}, 4000);
			countador2 = countador2+1;
		}
		});

		timer2.set({ time : 1000*9, autostart : true });
		
		setTimeout(function(){  
		       timer2.play(); 
		}, 3000);
		
		$(".panels-flexible-region-1-columnas").mouseenter(function() {
		    timer2.pause();
		}).mouseleave(function() {
			timer2.play(); 
		});
		
		$(".columnas-carousel-next").mouseenter(function() {
		    timer2.pause();
			$(".columnas-carousel-next").css('opacity', "1" );
			$(".columnas-carousel-next").css('-moz-opacity', "1" );
			$(".columnas-carousel-next").css('filter', "alpha(opacity=1)" );
		}).mouseleave(function() {
			$(".columnas-carousel-next").css('opacity', ".40" );
			$(".columnas-carousel-next").css('-moz-opacity', ".40" );
			$(".columnas-carousel-next").css('filter', "alpha(opacity=40)" );
		});
		
		$(".columnas-carousel-prev").mouseenter(function() {
		    timer2.pause();
			$(".columnas-carousel-prev").css('opacity', "1" );
			$(".columnas-carousel-prev").css('-moz-opacity', "1" );
			$(".columnas-carousel-prev").css('filter', "alpha(opacity=1)" );
		}).mouseleave(function() {
			$(".columnas-carousel-prev").css('opacity', ".40" );
			$(".columnas-carousel-prev").css('-moz-opacity', ".40" );
			$(".columnas-carousel-prev").css('filter', "alpha(opacity=40)" );
		});
		
		$('.columnas-carousel-next').click(function() {
			if(countador2<3){
				$(".panels-flexible-region-1-columnas").animate({"left": "-=234px"}, 1000);
				countador2 = countador2+1;
			}	
		});
		$('.columnas-carousel-prev').click(function() {
			if(countador2!=0){
				$(".panels-flexible-region-1-columnas").animate({"left": "+=234px"}, 1000);
				countador2 = countador2-1;
			}	
		});
		
		/* CENTRAR VERTICAL CARROUSEL NODE */
		if ($('.art').length){
			$(".art .link_center").each(function (index, domEle) {
				// domEle == this
				var exclusivas_alto = $(domEle).height();
				exclusivas_alto = 64-exclusivas_alto;
			    if(exclusivas_alto>1){
					exclusivas_alto = (exclusivas_alto/2);
					$(domEle).css('margin-top', exclusivas_alto );
				}
			});
		}
		
		/* CARROUSEL INSIDE NODE */
		
		var countador3 = 0;
		var news_node_size = $(".noticias-carrousel-nodo-mv > div").length;
		
		if(news_node_size>4){
			
			$(".noticias-carrousel-nodo-next").css('display', "block" );
			$(".noticias-carrousel-nodo-prev").css('display', "block" );
			
			salto=(news_node_size-4)*211;
			
			var timer3 = $.timer(function() {
			if(countador3==news_node_size-4){
				countador3=0;
				$(".noticias-carrousel-nodo-mv").animate({"left": "+="+salto+"px"}, 3000);
			}else{
			    $(".noticias-carrousel-nodo-mv").animate({"left": "-=211px"}, 4000);
				countador3 = countador3+1;
			}
			});

			timer3.set({ time : 1000*9, autostart : true });
		
			setTimeout(function(){  
			       timer3.play(); 
			}, 3000);
		
			$(".noticias-carrousel-nodo-content").mouseenter(function() {
			    timer3.pause();
			}).mouseleave(function() {
				timer3.play(); 
			});
		
		}
		
		$('.noticias-carrousel-nodo-next').click(function() {
			if(countador3<news_node_size-4){
				$(".noticias-carrousel-nodo-mv").animate({"left": "-=211px"}, 1000);
				countador3 = countador3+1;
			}	
		});
		$('.noticias-carrousel-nodo-prev').click(function() {
			if(countador3!=0){
				$(".noticias-carrousel-nodo-mv").animate({"left": "+=211px"}, 1000);
				countador3 = countador3-1;
			}	
		});
		
		$(".noticias-carrousel-nodo-mv a").click(function(){
				//alert(this.href);
				$("#nodo-articulo").load(this.href+" #nodo-articulo");
				$(".tweetbutton").load(this.href+" .tweetbutton");
				try{
				    window.history.replaceState(null, "Quintodia", this.href);
				}catch(e){
				}
				//UpdateDiv(this.href);
				return false;
		});
		
		
		/* CARROUSEL MENU SECUNDARIO */
		
		var countador4 = 0;
			
			$('.sub-next').click(function() {
				if(countador4<3){
					$(".sub").animate({"left": "-=486px"}, 1000);
					countador4 = countador4+1;
					$(".sub-prev").css('display', "block" );
				}
				if(countador4>=3){
					$(".sub-next").css('display', "none" );
				}	
			});
			$('.sub-prev').click(function() {
				if(countador4!=0){
					$(".sub").animate({"left": "+=486px"}, 1000);
					countador4 = countador4-1;
					$(".sub-next").css('display', "block" );
				}
				if(countador4==0){
					$(".sub-prev").css('display', "none" );
				}	
			});	
		
		
		/* COMPROBAR SI EN LOS LISTADOS HAY NOTICIAS */
		if ($('#listado-noticias').length){
			if ($('#listado-noticias .smallnews').length){	  
			}else{
				$("#listado-noticias .listado-error").text("No hay noticias para esta edición");
			}
		}
		
		/* COMPROBAR SI EN LOS CARRUSEL HAY NOTICIAS */
		if ($('.pane-front-page').length){
			if ($('.pane-front-page .listado-error').length){
				$(".pane-front-page .listado-error").text("No hay noticias para esta edición");	  
			}
		}	
		
		/* ICONO HOME */
		if ($('#tarifas-mapa-wrap').length){
			
			function infotarifas(nro){
				$(".info-t-title").html($(".publicidades-row-"+nro+" .tarifas-row-title").text());
				$(".info-t-size").html($(".publicidades-row-"+nro+" .tarifas-row-size").text());
				$(".info-t-tecnologia").html($(".publicidades-row-"+nro+" .tarifas-row-tecnologia").text());
				$(".info-t-tarifa").html($(".publicidades-row-"+nro+" .tarifas-row-tarifa").text());				
			}
			
		  $(".pagina-top").mouseenter(function() {
			$(".pagina-top").css('background-color', "#3a3a3c" );
			$(".pagina-top").css('color', "#FFF" );
			infotarifas(1);
		    $(".info-wrap").show();
			$(".publicidades-row-1").css('background-color', "#69696C" );
			$(".publicidades-row-1").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pagina-top").css('background-color', "#FFF" );
			$(".pagina-top").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-1").css('background-color', "#FFF" );
			$(".publicidades-row-1").css('color', "#69696C" );
		  });
		
		  $(".pub-b").mouseenter(function() {
			$(".pub-b").css('background-color', "#3a3a3c" );
			$(".pub-b").css('color', "#FFF" );
			infotarifas(2);
		    $(".info-wrap").show();
			$(".publicidades-row-2").css('background-color', "#69696C" );
			$(".publicidades-row-2").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-b").css('background-color', "#FFF" );
			$(".pub-b").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-2").css('background-color', "#FFF" );
			$(".publicidades-row-2").css('color', "#69696C" );
		  });
		
		  $(".pub-c").mouseenter(function() {
			$(".pub-c").css('background-color', "#3a3a3c" );
			$(".pub-c").css('color', "#FFF" );
			infotarifas(2);
		    $(".info-wrap").show();
			$(".publicidades-row-2").css('background-color', "#69696C" );
			$(".publicidades-row-2").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-c").css('background-color', "#FFF" );
			$(".pub-c").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-2").css('background-color', "#FFF" );
			$(".publicidades-row-2").css('color', "#69696C" );
		  });
		
		  $(".pub-d").mouseenter(function() {
			$(".pub-d").css('background-color', "#3a3a3c" );
			$(".pub-d").css('color', "#FFF" );
			infotarifas(2);
		    $(".info-wrap").show();
			$(".publicidades-row-2").css('background-color', "#69696C" );
			$(".publicidades-row-2").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-d").css('background-color', "#FFF" );
			$(".pub-d").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-2").css('background-color', "#FFF" );
			$(".publicidades-row-2").css('color', "#69696C" );
		  });
		
		  $(".pub-e").mouseenter(function() {
			$(".pub-e").css('background-color', "#3a3a3c" );
			$(".pub-e").css('color', "#FFF" );
			infotarifas(3);
		    $(".info-wrap").show();
			$(".publicidades-row-3").css('background-color', "#69696C" );
			$(".publicidades-row-3").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-e").css('background-color', "#FFF" );
			$(".pub-e").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-3").css('background-color', "#FFF" );
			$(".publicidades-row-3").css('color', "#69696C" );
		  });
		
		  $(".pub-f").mouseenter(function() {
			$(".pub-f").css('background-color', "#3a3a3c" );
			$(".pub-f").css('color', "#FFF" );
			infotarifas(3);
		    $(".info-wrap").show();
			$(".publicidades-row-3").css('background-color', "#69696C" );
			$(".publicidades-row-3").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-f").css('background-color', "#FFF" );
			$(".pub-f").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-3").css('background-color', "#FFF" );
			$(".publicidades-row-3").css('color', "#69696C" );
		  });
		
		  $(".pub-g").mouseenter(function() {
			$(".pub-g").css('background-color', "#3a3a3c" );
			$(".pub-g").css('color', "#FFF" );
			infotarifas(4);
		    $(".info-wrap").show();
			$(".publicidades-row-4").css('background-color', "#69696C" );
			$(".publicidades-row-4").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-g").css('background-color', "#FFF" );
			$(".pub-g").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-4").css('background-color', "#FFF" );
			$(".publicidades-row-4").css('color', "#69696C" );
		  });
		
		  $(".pub-h").mouseenter(function() {
			$(".pub-h").css('background-color', "#3a3a3c" );
			$(".pub-h").css('color', "#FFF" );
			infotarifas(5);
		    $(".info-wrap").show();
			$(".publicidades-row-5").css('background-color', "#69696C" );
			$(".publicidades-row-5").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-h").css('background-color', "#FFF" );
			$(".pub-h").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-5").css('background-color', "#FFF" );
			$(".publicidades-row-5").css('color', "#69696C" );
		  });
		
		  $(".pub-i").mouseenter(function() {
			$(".pub-i").css('background-color', "#3a3a3c" );
			$(".pub-i").css('color', "#FFF" );
			infotarifas(5);
		    $(".info-wrap").show();
			$(".publicidades-row-5").css('background-color', "#69696C" );
			$(".publicidades-row-5").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-i").css('background-color', "#FFF" );
			$(".pub-i").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-5").css('background-color', "#FFF" );
			$(".publicidades-row-5").css('color', "#69696C" );
		  });
		
		  $(".pub-j").mouseenter(function() {
			$(".pub-j").css('background-color', "#3a3a3c" );
			$(".pub-j").css('color', "#FFF" );
			infotarifas(6);
		    $(".info-wrap").show();
			$(".publicidades-row-6").css('background-color', "#69696C" );
			$(".publicidades-row-6").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-j").css('background-color', "#FFF" );
			$(".pub-j").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-6").css('background-color', "#FFF" );
			$(".publicidades-row-6").css('color', "#69696C" );
		  });
		
		  $(".pub-k").mouseenter(function() {
			$(".pub-k").css('background-color', "#3a3a3c" );
			$(".pub-k").css('color', "#FFF" );
			infotarifas(6);
		    $(".info-wrap").show();
			$(".publicidades-row-6").css('background-color', "#69696C" );
			$(".publicidades-row-6").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-k").css('background-color', "#FFF" );
			$(".pub-k").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-6").css('background-color', "#FFF" );
			$(".publicidades-row-6").css('color', "#69696C" );
		  });
		
		  $(".pub-l").mouseenter(function() {
			$(".pub-l").css('background-color', "#3a3a3c" );
			$(".pub-l").css('color', "#FFF" );
			infotarifas(6);
		    $(".info-wrap").show();
			$(".publicidades-row-6").css('background-color', "#69696C" );
			$(".publicidades-row-6").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-l").css('background-color', "#FFF" );
			$(".pub-l").css('color', "#828387" );
		    $(".info-wrap").hide();
			$(".publicidades-row-6").css('background-color', "#FFF" );
			$(".publicidades-row-6").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-1").mouseenter(function() {
			$(".pagina-top").css('background-color', "#3a3a3c" );
			$(".pagina-top").css('color', "#FFF" );
			$(".publicidades-row-1").css('background-color', "#69696C" );
			$(".publicidades-row-1").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pagina-top").css('background-color', "#FFF" );
			$(".pagina-top").css('color', "#828387" );
			$(".publicidades-row-1").css('background-color', "#FFF" );
			$(".publicidades-row-1").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-2").mouseenter(function() {
			$(".pub-b,.pub-c,.pub-d").css('background-color', "#3a3a3c" );
			$(".pub-b,.pub-c,.pub-d").css('color', "#FFF" );
			$(".publicidades-row-2").css('background-color', "#69696C" );
			$(".publicidades-row-2").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-b,.pub-c,.pub-d").css('background-color', "#FFF" );
			$(".pub-b,.pub-c,.pub-d").css('color', "#828387" );
			$(".publicidades-row-2").css('background-color', "#FFF" );
			$(".publicidades-row-2").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-3").mouseenter(function() {
			$(".pub-e,.pub-f").css('background-color', "#3a3a3c" );
			$(".pub-e,.pub-f").css('color', "#FFF" );
			$(".publicidades-row-3").css('background-color', "#69696C" );
			$(".publicidades-row-3").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-e,.pub-f").css('background-color', "#FFF" );
			$(".pub-e,.pub-f").css('color', "#828387" );
			$(".publicidades-row-3").css('background-color', "#FFF" );
			$(".publicidades-row-3").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-4").mouseenter(function() {
			$(".pub-g").css('background-color', "#3a3a3c" );
			$(".pub-g").css('color', "#FFF" );
			$(".publicidades-row-4").css('background-color', "#69696C" );
			$(".publicidades-row-4").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-g").css('background-color', "#FFF" );
			$(".pub-g").css('color', "#828387" );
			$(".publicidades-row-4").css('background-color', "#FFF" );
			$(".publicidades-row-4").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-5").mouseenter(function() {
			$(".pub-h,.pub-i").css('background-color', "#3a3a3c" );
			$(".pub-h,.pub-i").css('color', "#FFF" );
			$(".publicidades-row-5").css('background-color', "#69696C" );
			$(".publicidades-row-5").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-h,.pub-i").css('background-color', "#FFF" );
			$(".pub-h,.pub-i").css('color', "#828387" );
			$(".publicidades-row-5").css('background-color', "#FFF" );
			$(".publicidades-row-5").css('color', "#69696C" );
		  });
		
		  $(".publicidades-row-6").mouseenter(function() {
			$(".pub-j,.pub-k,.pub-l").css('background-color', "#3a3a3c" );
			$(".pub-j,.pub-k,.pub-l").css('color', "#FFF" );
			$(".publicidades-row-6").css('background-color', "#69696C" );
			$(".publicidades-row-6").css('color', "#FFF" );
		  }).mouseleave(function() {
			$(".pub-j,.pub-k,.pub-l").css('background-color', "#FFF" );
			$(".pub-j,.pub-k,.pub-l").css('color', "#828387" );
			$(".publicidades-row-6").css('background-color', "#FFF" );
			$(".publicidades-row-6").css('color', "#69696C" );
		  });
			
			$('.pagina-home').click(function() {
			  $('.pagina-news').removeClass('active')
			  $('.pagina-home').addClass('active');
			
			  $('.pagina-news-wrap').removeClass('pag-active');
			  $('.pagina-news-wrap').hide();
			  $('.pagina-wrap').fadeIn("slow").addClass('pag-active');
			});
			
			$('.pagina-news').click(function() {
			  $('.pagina-home').removeClass('active')
			  $('.pagina-news').addClass('active');
			
			  $('.pagina-wrap').removeClass('pag-active');
			  $('.pagina-wrap').hide();
			  $('.pagina-news-wrap').fadeIn("slow").addClass('pag-active');
			});
			
		}
		
		/* PUBLICIDAD PERIODICO */
		  $(".publicidades-periodico-1").mouseenter(function() {
			$("#tarifas-periodico-img1").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-1").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-1").css('color', "#FFF" );
			
			$(".publicidades-periodico-2").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-3").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-4").css('background-color', "#f2f2f2" );	
		  }).mouseleave(function() {
			$("#tarifas-periodico-img1").css('background-color', "#FFF" );
			$(".publicidades-periodico-1").css('background-color', "#FFF" );
			$(".publicidades-periodico-1").css('color', "#69696C" );
			
			$(".publicidades-periodico-2").css('background-color', "#FFF" );	
			$(".publicidades-periodico-3").css('background-color', "#FFF" );	
			$(".publicidades-periodico-4").css('background-color', "#FFF" );
		  });
		
		  $(".publicidades-periodico-2").mouseenter(function() {
			$("#tarifas-periodico-img1").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-2").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-2").css('color', "#FFF" );
			
			$(".publicidades-periodico-1").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-3").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-4").css('background-color', "#f2f2f2" );	
		  }).mouseleave(function() {
			$("#tarifas-periodico-img1").css('background-color', "#FFF" );
			$(".publicidades-periodico-2").css('background-color', "#FFF" );
			$(".publicidades-periodico-2").css('color', "#69696C" );
			
			$(".publicidades-periodico-1").css('background-color', "#FFF" );	
			$(".publicidades-periodico-3").css('background-color', "#FFF" );	
			$(".publicidades-periodico-4").css('background-color', "#FFF" );
		  });
		
		  $(".publicidades-periodico-3").mouseenter(function() {
			$("#tarifas-periodico-img1").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-3").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-3").css('color', "#FFF" );
			
			$(".publicidades-periodico-1").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-2").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-4").css('background-color', "#f2f2f2" );	
		  }).mouseleave(function() {
			$("#tarifas-periodico-img1").css('background-color', "#FFF" );
			$(".publicidades-periodico-3").css('background-color', "#FFF" );
			$(".publicidades-periodico-3").css('color', "#69696C" );
			
			$(".publicidades-periodico-1").css('background-color', "#FFF" );	
			$(".publicidades-periodico-2").css('background-color', "#FFF" );	
			$(".publicidades-periodico-4").css('background-color', "#FFF" );
		  });
		
		  $(".publicidades-periodico-4").mouseenter(function() {
			$("#tarifas-periodico-img1").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-4").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-4").css('color', "#FFF" );
			
			$(".publicidades-periodico-1").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-2").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-3").css('background-color', "#f0f0f0" );	
		  }).mouseleave(function() {
			$("#tarifas-periodico-img1").css('background-color', "#FFF" );
			$(".publicidades-periodico-4").css('background-color', "#FFF" );
			$(".publicidades-periodico-4").css('color', "#69696C" );
			
			$(".publicidades-periodico-1").css('background-color', "#FFF" );	
			$(".publicidades-periodico-2").css('background-color', "#FFF" );	
			$(".publicidades-periodico-3").css('background-color', "#FFF" );
		  });
		
		  $(".publicidades-periodico-6").mouseenter(function() {
			$("#tarifas-periodico-img2").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-6").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-6").css('color', "#FFF" );
			
			$(".publicidades-periodico-5").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-7").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img2").css('background-color', "#FFF" );
			$(".publicidades-periodico-6").css('background-color', "#FFF" );
			$(".publicidades-periodico-6").css('color', "#69696C" );
			
			$(".publicidades-periodico-5").css('background-color', "#FFF" );	
			$(".publicidades-periodico-7").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-8").mouseenter(function() {
			$("#tarifas-periodico-img3").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-8").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-8").css('color', "#FFF" );
			
			$(".publicidades-periodico-9").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-10").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-11").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img3").css('background-color', "#FFF" );
			$(".publicidades-periodico-8").css('background-color', "#FFF" );
			$(".publicidades-periodico-8").css('color', "#69696C" );
			
			$(".publicidades-periodico-9").css('background-color', "#FFF" );	
			$(".publicidades-periodico-10").css('background-color', "#FFF" );
			$(".publicidades-periodico-11").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-9").mouseenter(function() {
			$("#tarifas-periodico-img3").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-9").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-9").css('color', "#FFF" );
			
			$(".publicidades-periodico-8").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-10").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-11").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img3").css('background-color', "#FFF" );
			$(".publicidades-periodico-9").css('background-color', "#FFF" );
			$(".publicidades-periodico-9").css('color', "#69696C" );
			
			$(".publicidades-periodico-8").css('background-color', "#FFF" );	
			$(".publicidades-periodico-10").css('background-color', "#FFF" );
			$(".publicidades-periodico-11").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-10").mouseenter(function() {
			$("#tarifas-periodico-img3").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-10").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-10").css('color', "#FFF" );
			
			$(".publicidades-periodico-8").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-9").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-11").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img3").css('background-color', "#FFF" );
			$(".publicidades-periodico-10").css('background-color', "#FFF" );
			$(".publicidades-periodico-10").css('color', "#69696C" );
			
			$(".publicidades-periodico-8").css('background-color', "#FFF" );	
			$(".publicidades-periodico-9").css('background-color', "#FFF" );
			$(".publicidades-periodico-11").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-11").mouseenter(function() {
			$("#tarifas-periodico-img3").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-11").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-11").css('color', "#FFF" );
			
			$(".publicidades-periodico-8").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-9").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-10").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img3").css('background-color', "#FFF" );
			$(".publicidades-periodico-11").css('background-color', "#FFF" );
			$(".publicidades-periodico-11").css('color', "#69696C" );
			
			$(".publicidades-periodico-8").css('background-color', "#FFF" );	
			$(".publicidades-periodico-9").css('background-color', "#FFF" );
			$(".publicidades-periodico-10").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-13").mouseenter(function() {
			$("#tarifas-periodico-img4").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-13").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-13").css('color', "#FFF" );
			
			$(".publicidades-periodico-14").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-15").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-16").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img4").css('background-color', "#FFF" );
			$(".publicidades-periodico-13").css('background-color', "#FFF" );
			$(".publicidades-periodico-13").css('color', "#69696C" );
			
			$(".publicidades-periodico-14").css('background-color', "#FFF" );	
			$(".publicidades-periodico-15").css('background-color', "#FFF" );
			$(".publicidades-periodico-16").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-14").mouseenter(function() {
			$("#tarifas-periodico-img4").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-14").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-14").css('color', "#FFF" );
			
			$(".publicidades-periodico-13").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-15").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-16").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img4").css('background-color', "#FFF" );
			$(".publicidades-periodico-14").css('background-color', "#FFF" );
			$(".publicidades-periodico-14").css('color', "#69696C" );
			
			$(".publicidades-periodico-13").css('background-color', "#FFF" );	
			$(".publicidades-periodico-15").css('background-color', "#FFF" );
			$(".publicidades-periodico-16").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-15").mouseenter(function() {
			$("#tarifas-periodico-img4").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-15").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-15").css('color', "#FFF" );
			
			$(".publicidades-periodico-13").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-14").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-16").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img4").css('background-color', "#FFF" );
			$(".publicidades-periodico-15").css('background-color', "#FFF" );
			$(".publicidades-periodico-15").css('color', "#69696C" );
			
			$(".publicidades-periodico-13").css('background-color', "#FFF" );	
			$(".publicidades-periodico-14").css('background-color', "#FFF" );
			$(".publicidades-periodico-16").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-16").mouseenter(function() {
			$("#tarifas-periodico-img4").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-16").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-16").css('color', "#FFF" );
			
			$(".publicidades-periodico-13").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-14").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-15").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img4").css('background-color', "#FFF" );
			$(".publicidades-periodico-16").css('background-color', "#FFF" );
			$(".publicidades-periodico-16").css('color', "#69696C" );
			
			$(".publicidades-periodico-13").css('background-color', "#FFF" );	
			$(".publicidades-periodico-14").css('background-color', "#FFF" );
			$(".publicidades-periodico-15").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-18").mouseenter(function() {
			$("#tarifas-periodico-img5").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-18").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-18").css('color', "#FFF" );
			
			$(".publicidades-periodico-19").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-20").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img5").css('background-color', "#FFF" );
			$(".publicidades-periodico-18").css('background-color', "#FFF" );
			$(".publicidades-periodico-18").css('color', "#69696C" );
			
			$(".publicidades-periodico-19").css('background-color', "#FFF" );	
			$(".publicidades-periodico-20").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-19").mouseenter(function() {
			$("#tarifas-periodico-img5").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-19").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-19").css('color', "#FFF" );
			
			$(".publicidades-periodico-18").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-20").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img5").css('background-color', "#FFF" );
			$(".publicidades-periodico-19").css('background-color', "#FFF" );
			$(".publicidades-periodico-19").css('color', "#69696C" );
			
			$(".publicidades-periodico-18").css('background-color', "#FFF" );	
			$(".publicidades-periodico-20").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-20").mouseenter(function() {
			$("#tarifas-periodico-img5").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-20").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-20").css('color', "#FFF" );
			
			$(".publicidades-periodico-18").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-19").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img5").css('background-color', "#FFF" );
			$(".publicidades-periodico-20").css('background-color', "#FFF" );
			$(".publicidades-periodico-20").css('color', "#69696C" );
			
			$(".publicidades-periodico-18").css('background-color', "#FFF" );	
			$(".publicidades-periodico-19").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-22").mouseenter(function() {
			$("#tarifas-periodico-img6").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-22").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-22").css('color', "#FFF" );
			
			$(".publicidades-periodico-23").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-24").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img6").css('background-color', "#FFF" );
			$(".publicidades-periodico-22").css('background-color', "#FFF" );
			$(".publicidades-periodico-22").css('color', "#69696C" );
			
			$(".publicidades-periodico-23").css('background-color', "#FFF" );	
			$(".publicidades-periodico-24").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-23").mouseenter(function() {
			$("#tarifas-periodico-img6").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-23").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-23").css('color', "#FFF" );
			
			$(".publicidades-periodico-22").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-24").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img6").css('background-color', "#FFF" );
			$(".publicidades-periodico-23").css('background-color', "#FFF" );
			$(".publicidades-periodico-23").css('color', "#69696C" );
			
			$(".publicidades-periodico-22").css('background-color', "#FFF" );	
			$(".publicidades-periodico-24").css('background-color', "#FFF" );	
		  });
		
		  $(".publicidades-periodico-24").mouseenter(function() {
			$("#tarifas-periodico-img6").css('background-color', "#f2f2f2" );
			$(".publicidades-periodico-24").css('background-color', "#3a3a3c" );
			$(".publicidades-periodico-24").css('color', "#FFF" );
			
			$(".publicidades-periodico-22").css('background-color', "#f2f2f2" );	
			$(".publicidades-periodico-23").css('background-color', "#f2f2f2" );		
		  }).mouseleave(function() {
			$("#tarifas-periodico-img6").css('background-color', "#FFF" );
			$(".publicidades-periodico-24").css('background-color', "#FFF" );
			$(".publicidades-periodico-24").css('color', "#69696C" );
			
			$(".publicidades-periodico-22").css('background-color', "#FFF" );	
			$(".publicidades-periodico-23").css('background-color', "#FFF" );	
		  });
		
		/* DISABLE INPUT SUBMIT COMMENTS AND NEWS */
		if ($('#comment-form').length){  
			$('#comment-form :input[type=submit]').removeAttr("disabled");
		}
		if ($('#article-node-form').length){  
	    	$('#article-node-form :input[type=submit]').removeAttr("disabled");
 		}
		
		if ($('#columna-node-form').length){
			$('#columna-node-form :input[type=submit]').removeAttr("disabled");
		}
		
		$('#comment-form').submit(function(){
		    $('input[type=submit]', this).attr('disabled', 'disabled');
		});
		$('#article-node-form').submit(function(){
		    $('input[type=submit]', this).attr('disabled', 'disabled');
		});
		$('#columna-node-form').submit(function(){
		    $('input[type=submit]', this).attr('disabled', 'disabled');
		});
		
		
		/* ENCUESTA */

		$('#encuesta-pest').click(function() {
			if ($('#block-poll-recent').css('display') == 'none') {
			  $("#block-poll-recent").show("slow");
			}else{
				$("#block-poll-recent").hide("slow");
			}
		});
		
		$('#encuesta-pest').mouseover(function() {
		  $("#encuesta-pest").css('background-color', "#3a3a3c" );
		}).mouseleave(function() {
		  $("#encuesta-pest").css('background-color', "#0F75BD" );
		});
		
	/** POPUP CHISPAGRAFIA **/
	  $('a[rel*=facebox]').facebox({
		loadingImage : 'sites/all/themes/QuintoDia/images/loading.gif',
		closeImage   : 'sites/all/themes/QuintoDia/images/closelabel.png'
	  });
	
	/* EVENTOS GOOGLE ANALITICS */
	
		
	/***ACORDION DE PRUEBA***/
	
	/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	
	//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER 
	$('.accordionButton').mouseenter(function(){
	
		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.accordionButton').removeClass('on');

		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.accordionContent').slideUp('slow');

		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {

			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('on');

			//OPEN THE SLIDE
			$(this).next().slideDown('slow');
		 }
		
	//ON MOUSEOUT REMOVE THE OVER CLASS
	}).mouseleave(function(){
	
			return false;					
	});
	/*** END REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
	$('.accordionContent').hide();
	
	
			
	   // Find all the secure links inside context that do not have our processed
      // class.
      $('.botones-wrap > div', context)
      if ($('.botones-wrap').length){ 	
				// Get a reference to the placeholder. This element
				// will take up visual space when the message is
				// moved into a fixed position.
				var placeholder = $( "#nodo-botones-placeholder" );

				// Get a reference to the message whose position
				// we want to "fix" on window-scroll.
				var message = $( "#nodo-botones" );

				// Get a reference to the window object; we will use
				// this several time, so cache the jQuery wrapper.
				var view = $( window );


				// Bind to the window scroll and resize events.
				// Remember, resizing can also change the scroll
				// of the page.
				view.bind(
					"scroll resize",
					function(){
						// Get the current offset of the placeholder.
						// Since the message might be in fixed
						// position, it is the plcaeholder that will
						// give us reliable offsets.
						var placeholderTop = placeholder.offset().top;

						// Get the current scroll of the window.
						var viewTop = view.scrollTop();

						// Check to see if the view had scroll down
						// past the top of the placeholder AND that
						// the message is not yet fixed.
						if (
							(viewTop > placeholderTop) &&
							!message.is( ".nodo-botones-fixed" )
							){

							// The message needs to be fixed. Before
							// we change its positon, we need to re-
							// adjust the placeholder height to keep
							// the same space as the message.
							//
							// NOTE: All we're doing here is going
							// from auto height to explicit height.
							placeholder.height(
								placeholder.height()
							);

							// Make the message fixed.
							message.addClass( "nodo-botones-fixed" );

						// Check to see if the view has scroll back up
						// above the message AND that the message is
						// currently fixed.
						} else if (
							(viewTop <= placeholderTop) &&
							message.is( ".nodo-botones-fixed" )
							){

							// Make the placeholder height auto again.
							placeholder.css( "height", "auto" );

							// Remove the fixed position class on the
							// message. This will pop it back into its
							// static position.
							message.removeClass( "nodo-botones-fixed" );

						}
					}
				);
			}
    }
  }

}(jQuery));
;
/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
// jquery.tweet.js - See http://tweet.seaofclouds.com/ or https://github.com/seaofclouds/tweet for more info
// Copyright (c) 2008-2011 Todd Matthews & Steve Purcell
(function($) {
  $.fn.tweet = function(o){
    var s = $.extend({
      username: null,                           // [string or array] required unless using the 'query' option; one or more twitter screen names (use 'list' option for multiple names, where possible)
      list: null,                               // [string]   optional name of list belonging to username
      favorites: false,                         // [boolean]  display the user's favorites instead of his tweets
      query: null,                              // [string]   optional search query (see also: http://search.twitter.com/operators)
      avatar_size: null,                        // [integer]  height and width of avatar if displayed (48px max)
      count: 3,                                 // [integer]  how many tweets to display?
      fetch: null,                              // [integer]  how many tweets to fetch via the API (set this higher than 'count' if using the 'filter' option)
      page: 1,                                  // [integer]  which page of results to fetch (if count != fetch, you'll get unexpected results)
      retweets: true,                           // [boolean]  whether to fetch (official) retweets (not supported in all display modes)
      intro_text: null,                         // [string]   do you want text BEFORE your your tweets?
      outro_text: null,                         // [string]   do you want text AFTER your tweets?
      join_text:  null,                         // [string]   optional text in between date and tweet, try setting to "auto"
      auto_join_text_default: "Quintodia dice:",   // [string]   auto text for non verb: "i said" bullocks
      auto_join_text_ed: "Quintodia",              // [string]   auto text for past tense: "i" surfed
      auto_join_text_ing: "Quintodia dijo:",       // [string]   auto tense for present tense: "i was" surfing
      auto_join_text_reply: "Quintodia responde a",// [string]   auto tense for replies: "i replied to" @someone "with"
      auto_join_text_url: "Quintodia esta viendo", // [string]   auto tense for urls: "i was looking at" http:...
      loading_text: null,                       // [string]   optional loading text, displayed while tweets load
      refresh_interval: null ,                  // [integer]  optional number of seconds after which to reload tweets
      twitter_url: "twitter.com",               // [string]   custom twitter url, if any (apigee, etc.)
      twitter_api_url: "api.twitter.com",       // [string]   custom twitter api url, if any (apigee, etc.)
      twitter_search_url: "search.twitter.com", // [string]   custom twitter search url, if any (apigee, etc.)
      template: "{avatar}{time}{join}{text}",   // [string or function] template used to construct each tweet <li> - see code for available vars
      comparator: function(tweet1, tweet2) {    // [function] comparator used to sort tweets (see Array.sort)
        return tweet2["tweet_time"] - tweet1["tweet_time"];
      },
      filter: function(tweet) {                 // [function] whether or not to include a particular tweet (be sure to also set 'fetch')
        return true;
      }
    }, o);

    // See http://daringfireball.net/2010/07/improved_regex_for_matching_urls
    var url_regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;

    // Expand values inside simple string templates with {placeholders}
    function t(template, info) {
      if (typeof template === "string") {
        var result = template;
        for(var key in info) {
          var val = info[key];
          result = result.replace(new RegExp('{'+key+'}','g'), val === null ? '' : val);
        }
        return result;
      } else return template(info);
    }
    // Export the t function for use when passing a function as the 'template' option
    $.extend({tweet: {t: t}});

    function replacer (regex, replacement) {
      return function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(regex, replacement));
        });
        return $(returning);
      };
    }

    $.fn.extend({
      linkUrl: replacer(url_regexp, function(match) {
        var url = (/^[a-z]+:/i).test(match) ? match : "http://"+match;
        return "<a href=\""+url+"\">"+match+"</a>";
      }),
      linkUser: replacer(/@(\w+)/gi, "@<a href=\"http://"+s.twitter_url+"/$1\">$1</a>"),
      // Support various latin1 (\u00**) and arabic (\u06**) alphanumeric chars
      linkHash: replacer(/(?:^| )[\#]+([\w\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0600-\u06ff]+)/gi,
                         ' <a href="http://'+s.twitter_search_url+'/search?q=&tag=$1&lang=all'+((s.username && s.username.length == 1) ? '&from='+s.username.join("%2BOR%2B") : '')+'">#$1</a>'),
      capAwesome: replacer(/\b(awesome)\b/gi, '<span class="awesome">$1</span>'),
      capEpic: replacer(/\b(epic)\b/gi, '<span class="epic">$1</span>'),
      makeHeart: replacer(/(&lt;)+[3]/gi, "<tt class='heart'>&#x2665;</tt>")
    });

    function parse_date(date_str) {
      // The non-search twitter APIs return inconsistently-formatted dates, which Date.parse
      // cannot handle in IE. We therefore perform the following transformation:
      // "Wed Apr 29 08:53:31 +0000 2009" => "Wed, Apr 29 2009 08:53:31 +0000"
      return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, '$1,$2$4$3'));
    }

    function relative_time(date) {
      var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
      var delta = parseInt((relative_to.getTime() - date) / 1000, 10);
      var r = '';
      if (delta < 60) {
        r = delta + ' segundos';
      } else if(delta < 120) {
        r = 'un minuto';
      } else if(delta < (45*60)) {
        r = (parseInt(delta / 60, 10)).toString() + ' minutos';
      } else if(delta < (2*60*60)) {
        r = 'una hora';
      } else if(delta < (24*60*60)) {
        r = '' + (parseInt(delta / 3600, 10)).toString() + ' horas';
      } else if(delta < (48*60*60)) {
        r = 'un día';
      } else {
        r = (parseInt(delta / 86400, 10)).toString() + ' días';
      }
      return ' Hace ' + r;
    }

    function build_auto_join_text(text) {
      if (text.match(/^(@([A-Za-z0-9-_]+)) .*/i)) {
        return s.auto_join_text_reply;
      } else if (text.match(url_regexp)) {
        return s.auto_join_text_url;
      } else if (text.match(/^((\w+ed)|just) .*/im)) {
        return s.auto_join_text_ed;
      } else if (text.match(/^(\w*ing) .*/i)) {
        return s.auto_join_text_ing;
      } else {
        return s.auto_join_text_default;
      }
    }

    function maybe_https(url) {
      return ('https:' == document.location.protocol) ? url.replace(/^http:/, 'https:') : url;
    }

    function build_api_url() {
      var proto = ('https:' == document.location.protocol ? 'https:' : 'http:');
      var count = (s.fetch === null) ? s.count : s.fetch;
      if (s.list) {
        return proto+"//"+s.twitter_api_url+"/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?page="+s.page+"&per_page="+count+"&callback=?";
      } else if (s.favorites) {
        return proto+"//"+s.twitter_api_url+"/favorites/"+s.username[0]+".json?page="+s.page+"&count="+count+"&callback=?";
      } else if (s.query === null && s.username.length == 1) {
        return proto+'//'+s.twitter_api_url+'/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+count+(s.retweets ? '&include_rts=1' : '')+'&page='+s.page+'&callback=?';
      } else {
        var query = (s.query || 'from:'+s.username.join(' OR from:'));
        return proto+'//'+s.twitter_search_url+'/search.json?&q='+encodeURIComponent(query)+'&rpp='+count+'&page='+s.page+'&callback=?';
      }
    }

    // Convert twitter API objects into data available for
    // constructing each tweet <li> using a template
    function extract_template_data(item){
      var o = {};
      o.item = item;
      o.source = item.source;
      o.screen_name = item.from_user || item.user.screen_name;
      o.avatar_size = s.avatar_size;
      o.avatar_url = maybe_https(item.profile_image_url || item.user.profile_image_url);
      o.retweet = typeof(item.retweeted_status) != 'undefined';
      o.tweet_time = parse_date(item.created_at);
      o.join_text = s.join_text == "auto" ? build_auto_join_text(item.text) : s.join_text;
      o.tweet_id = item.id_str;
      o.twitter_base = "http://"+s.twitter_url+"/";
      o.user_url = o.twitter_base+o.screen_name;
      o.tweet_url = o.user_url+"/status/"+o.tweet_id;
      o.reply_url = o.twitter_base+"intent/tweet?in_reply_to="+o.tweet_id;
      o.retweet_url = o.twitter_base+"intent/retweet?tweet_id="+o.tweet_id;
      o.favorite_url = o.twitter_base+"intent/favorite?tweet_id="+o.tweet_id;
      o.retweeted_screen_name = o.retweet && item.retweeted_status.user.screen_name;
      o.tweet_relative_time = relative_time(o.tweet_time);
      o.tweet_raw_text = o.retweet ? ('RT @'+o.retweeted_screen_name+' '+item.retweeted_status.text) : item.text; // avoid '...' in long retweets
      o.tweet_text = $([o.tweet_raw_text]).linkUrl().linkUser().linkHash()[0];
      o.tweet_text_fancy = $([o.tweet_text]).makeHeart().capAwesome().capEpic()[0];

      // Default spans, and pre-formatted blocks for common layouts
      o.user = t('<a class="tweet_user" href="{user_url}">{screen_name}</a>', o);
      o.join = s.join_text ? t(' <span class="tweet_join">{join_text}</span> ', o) : ' ';
      o.avatar = o.avatar_size ?
        t('<a class="tweet_avatar" href="{user_url}"><img src="{avatar_url}" height="{avatar_size}" width="{avatar_size}" alt="{screen_name}\'s avatar" title="{screen_name}\'s avatar" border="0"/></a>', o) : '';
      o.time = t('<span class="tweet_time"><a href="{tweet_url}" title="view tweet on twitter">{tweet_relative_time}</a></span>', o);
      o.text = t('<span class="tweet_text">{tweet_text_fancy}</span>', o);
      o.reply_action = t('<a class="tweet_action tweet_reply" href="{reply_url}">reply</a>', o);
      o.retweet_action = t('<a class="tweet_action tweet_retweet" href="{retweet_url}">retweet</a>', o);
      o.favorite_action = t('<a class="tweet_action tweet_favorite" href="{favorite_url}">favorite</a>', o);
      return o;
    }

    return this.each(function(i, widget){
      var list = $('<ul class="tweet_list">').appendTo(widget);
      var intro = '<p class="tweet_intro">'+s.intro_text+'</p>';
      var outro = '<p class="tweet_outro">'+s.outro_text+'</p>';
      var loading = $('<p class="loading">'+s.loading_text+'</p>');

      if(s.username && typeof(s.username) == "string"){
        s.username = [s.username];
      }

      if (s.loading_text) $(widget).append(loading);
      $(widget).bind("tweet:load", function(){
        $.getJSON(build_api_url(), function(data){
          if (s.loading_text) loading.remove();
          if (s.intro_text) list.before(intro);
          list.empty();

          var tweets = $.map(data.results || data, extract_template_data);
          tweets = $.grep(tweets, s.filter).sort(s.comparator).slice(0, s.count);
          list.append($.map(tweets, function(o) { return "<li>" + t(s.template, o) + "</li>"; }).join('')).
              children('li:first').addClass('tweet_first').end().
              children('li:odd').addClass('tweet_even').end().
              children('li:even').addClass('tweet_odd');

          if (s.outro_text) list.after(outro);
          $(widget).trigger("loaded").trigger((tweets.length === 0 ? "empty" : "full"));
          if (s.refresh_interval) {
            window.setTimeout(function() { $(widget).trigger("tweet:load"); }, 1000 * s.refresh_interval);
          }
        });
      }).trigger("tweet:load");
    });
  };
})(jQuery);
;
/*
 * Facebox (for jQuery)
 * version: 1.2 (05/05/2008)
 * @requires jQuery v1.2 or later
 *
 * Examples at http://famspam.com/facebox/
 *
 * Licensed under the MIT:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright 2007, 2008 Chris Wanstrath [ chris@ozmm.org ]
 *
 * Usage:
 *
 *  jQuery(document).ready(function() {
 *    jQuery('a[rel*=facebox]').facebox()
 *  })
 *
 *  <a href="#terms" rel="facebox">Terms</a>
 *    Loads the #terms div in the box
 *
 *  <a href="terms.html" rel="facebox">Terms</a>
 *    Loads the terms.html page in the box
 *
 *  <a href="terms.png" rel="facebox">Terms</a>
 *    Loads the terms.png image in the box
 *
 *
 *  You can also use it programmatically:
 *
 *    jQuery.facebox('some html')
 *    jQuery.facebox('some html', 'my-groovy-style')
 *
 *  The above will open a facebox with "some html" as the content.
 *
 *    jQuery.facebox(function($) {
 *      $.get('blah.html', function(data) { $.facebox(data) })
 *    })
 *
 *  The above will show a loading screen before the passed function is called,
 *  allowing for a better ajaxy experience.
 *
 *  The facebox function can also display an ajax page, an image, or the contents of a div:
 *
 *    jQuery.facebox({ ajax: 'remote.html' })
 *    jQuery.facebox({ ajax: 'remote.html' }, 'my-groovy-style')
 *    jQuery.facebox({ image: 'stairs.jpg' })
 *    jQuery.facebox({ image: 'stairs.jpg' }, 'my-groovy-style')
 *    jQuery.facebox({ div: '#box' })
 *    jQuery.facebox({ div: '#box' }, 'my-groovy-style')
 *
 *  Want to close the facebox?  Trigger the 'close.facebox' document event:
 *
 *    jQuery(document).trigger('close.facebox')
 *
 *  Facebox also has a bunch of other hooks:
 *
 *    loading.facebox
 *    beforeReveal.facebox
 *    reveal.facebox (aliased as 'afterReveal.facebox')
 *    init.facebox
 *    afterClose.facebox
 *
 *  Simply bind a function to any of these hooks:
 *
 *   $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... })
 *
 */
(function($) {
  $.facebox = function(data, klass) {
    $.facebox.loading()

    if (data.ajax) fillFaceboxFromAjax(data.ajax, klass)
    else if (data.image) fillFaceboxFromImage(data.image, klass)
    else if (data.div) fillFaceboxFromHref(data.div, klass)
    else if ($.isFunction(data)) data.call($)
    else $.facebox.reveal(data, klass)
  }

  /*
   * Public, $.facebox methods
   */

  $.extend($.facebox, {
    settings: {
      opacity      : 0.2,
      overlay      : true,
      loadingImage : '/facebox/loading.gif',
      closeImage   : '/facebox/closelabel.png',
      imageTypes   : [ 'png', 'jpg', 'jpeg', 'gif' ],
      faceboxHtml  : '\
    <div id="facebox" style="display:none;"> \
      <div class="popup"> \
        <div class="content"> \
        </div> \
        <a href="#" class="close"><img src="/facebox/closelabel.png" title="close" class="close_image" /></a> \
      </div> \
    </div>'
    },

    loading: function() {
      init()
      if ($('#facebox .loading').length == 1) return true
      showOverlay()

      $('#facebox .content').empty()
      $('#facebox .body').children().hide().end().
        append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')

      $('#facebox').css({
        top:	getPageScroll()[1] + (getPageHeight() / 10),
        left:	$(window).width() / 2 - 205
      }).show()

      $(document).bind('keydown.facebox', function(e) {
        if (e.keyCode == 27) $.facebox.close()
        return true
      })
      $(document).trigger('loading.facebox')
    },

    reveal: function(data, klass) {
      $(document).trigger('beforeReveal.facebox')
      if (klass) $('#facebox .content').addClass(klass)
      $('#facebox .content').append(data)
      $('#facebox .loading').remove()
      $('#facebox .body').children().fadeIn('normal')
      $('#facebox').css('left', $(window).width() / 2 - ($('#facebox .popup').width() / 2))
      $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
    },

    close: function() {
      $(document).trigger('close.facebox')
      return false
    }
  })

  /*
   * Public, $.fn methods
   */

  $.fn.facebox = function(settings) {
    if ($(this).length == 0) return

    init(settings)

    function clickHandler() {
      $.facebox.loading(true)

      // support for rel="facebox.inline_popup" syntax, to add a class
      // also supports deprecated "facebox[.inline_popup]" syntax
      var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
      if (klass) klass = klass[1]

      fillFaceboxFromHref(this.href, klass)
      return false
    }

    return this.bind('click.facebox', clickHandler)
  }

  /*
   * Private methods
   */

  // called one time to setup facebox on this page
  function init(settings) {
    if ($.facebox.settings.inited) return true
    else $.facebox.settings.inited = true

    $(document).trigger('init.facebox')
    makeCompatible()

    var imageTypes = $.facebox.settings.imageTypes.join('|')
    $.facebox.settings.imageTypesRegexp = new RegExp('\.(' + imageTypes + ')$', 'i')

    if (settings) $.extend($.facebox.settings, settings)
    $('body').append($.facebox.settings.faceboxHtml)

    var preload = [ new Image(), new Image() ]
    preload[0].src = $.facebox.settings.closeImage
    preload[1].src = $.facebox.settings.loadingImage

    $('#facebox').find('.b:first, .bl').each(function() {
      preload.push(new Image())
      preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1')
    })

    $('#facebox .close').click($.facebox.close)
    $('#facebox .close_image').attr('src', $.facebox.settings.closeImage)
  }

  // getPageScroll() by quirksmode.com
  function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;
    }
    return new Array(xScroll,yScroll)
  }

  // Adapted from getPageSize() by quirksmode.com
  function getPageHeight() {
    var windowHeight
    if (self.innerHeight) {	// all except Explorer
      windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
      windowHeight = document.body.clientHeight;
    }
    return windowHeight
  }

  // Backwards compatibility
  function makeCompatible() {
    var $s = $.facebox.settings

    $s.loadingImage = $s.loading_image || $s.loadingImage
    $s.closeImage = $s.close_image || $s.closeImage
    $s.imageTypes = $s.image_types || $s.imageTypes
    $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
  }

  // Figures out what you want to display and displays it
  // formats are:
  //     div: #id
  //   image: blah.extension
  //    ajax: anything else
  function fillFaceboxFromHref(href, klass) {
    // div
    if (href.match(/#/)) {
      var url    = window.location.href.split('#')[0]
      var target = href.replace(url,'')
      if (target == '#') return
      $.facebox.reveal($(target).html(), klass)

    // image
    } else if (href.match($.facebox.settings.imageTypesRegexp)) {
      fillFaceboxFromImage(href, klass)
    // ajax
    } else {
      fillFaceboxFromAjax(href, klass)
    }
  }

  function fillFaceboxFromImage(href, klass) {
    var image = new Image()
    image.onload = function() {
      $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
    }
    image.src = href
  }

  function fillFaceboxFromAjax(href, klass) {
    $.get(href, function(data) { $.facebox.reveal(data, klass) })
  }

  function skipOverlay() {
    return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null
  }

  function showOverlay() {
    if (skipOverlay()) return

    if ($('#facebox_overlay').length == 0)
      $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')

    $('#facebox_overlay').hide().addClass("facebox_overlayBG")
      .css('opacity', $.facebox.settings.opacity)
      .click(function() { $(document).trigger('close.facebox') })
      .fadeIn(200)
    return false
  }

  function hideOverlay() {
    if (skipOverlay()) return

    $('#facebox_overlay').fadeOut(200, function(){
      $("#facebox_overlay").removeClass("facebox_overlayBG")
      $("#facebox_overlay").addClass("facebox_hide")
      $("#facebox_overlay").remove()
    })

    return false
  }

  /*
   * Bindings
   */

  $(document).bind('close.facebox', function() {
    $(document).unbind('keydown.facebox')
    $('#facebox').fadeOut(function() {
      $('#facebox .content').removeClass().addClass('content')
      $('#facebox .loading').remove()
      $(document).trigger('afterClose.facebox')
    })
    hideOverlay()
  })

})(jQuery);

// JavaScript Document;

