/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by:
 * SWFObject (http://blog.deconcept.com/swfobject/)
 * UFO (http://www.bobbyvandersluis.com/ufo/)
 * sIFR (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: 
 * The packed version of jQuery breaks ActiveX control
 * activation in Internet Explorer. Use JSMin to minifiy
 * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
 *
 **/ 
;(function(){
	
var $$;

/**
 * 
 * @desc Replace matching elements with a flash movie.
 * @author Luke Lutman
 * @version 1.0.1
 *
 * @name flash
 * @param Hash htmlOptions Options for the embed/object tag.
 * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
 * @param Function replace Custom block called for each matched element if flash is installed (optional).
 * @param Function update Custom block called for each matched if flash isn't installed (optional).
 * @type jQuery
 *
 * @cat plugins/flash
 * 
 * @example $('#hello').flash({ src: 'hello.swf' });
 * @desc Embed a Flash movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
 * @desc Embed a Flash 8 movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
 * @desc Embed a Flash movie using Express Install if flash isn't installed.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
 * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
 *
**/
$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
	
	// Set the default block.
	var block = replace || $$.replace;
	
	// Merge the default and passed plugin options.
	pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
	
	// Detect Flash.
	if(!$$.hasFlash(pluginOptions.version)) {
		// Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
		if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) {
			// Add the necessary flashvars (merged later).
			var expressInstallOptions = {
				flashvars: {  	
					MMredirectURL: location,
					MMplayerType: 'PlugIn',
					MMdoctitle: jQuery('title').text() 
				}					
			};
		// Ask the user to update (if specified).
		} else if (pluginOptions.update) {
			// Change the block to insert the update message instead of the flash movie.
			block = update || $$.update;
		// Fail
		} else {
			// The required version of flash isn't installed.
			// Express Install is turned off, or flash 6,0,65 isn't installed.
			// Update is turned off.
			// Return without doing anything.
			return this;
		}
	}
	
	// Merge the default, express install and passed html options.
	htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
	
	// Invoke $block (with a copy of the merged html options) for each element.
	return this.each(function(){
		block.call(this, $$.copy(htmlOptions));
	});
	
};
/**
 *
 * @name flash.copy
 * @desc Copy an arbitrary number of objects into a new object.
 * @type Object
 * 
 * @example $$.copy({ foo: 1 }, { bar: 2 });
 * @result { foo: 1, bar: 2 };
 *
**/
$$.copy = function() {
	var options = {}, flashvars = {};
	for(var i = 0; i < arguments.length; i++) {
		var arg = arguments[i];
		if(arg == undefined) continue;
		jQuery.extend(options, arg);
		// don't clobber one flash vars object with another
		// merge them instead
		if(arg.flashvars == undefined) continue;
		jQuery.extend(flashvars, arg.flashvars);
	}
	options.flashvars = flashvars;
	return options;
};
/*
 * @name flash.hasFlash
 * @desc Check if a specific version of the Flash plugin is installed
 * @type Boolean
 *
**/
$$.hasFlash = function() {
	// look for a flag in the query string to bypass flash detection
	if(/hasFlash\=true/.test(location)) return true;
	if(/hasFlash\=false/.test(location)) return false;
	var pv = $$.hasFlash.playerVersion().match(/\d+/g);
	var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
	for(var i = 0; i < 3; i++) {
		pv[i] = parseInt(pv[i] || 0);
		rv[i] = parseInt(rv[i] || 0);
		// player is less than required
		if(pv[i] < rv[i]) return false;
		// player is greater than required
		if(pv[i] > rv[i]) return true;
	}
	// major version, minor version and revision match exactly
	return true;
};
/**
 *
 * @name flash.hasFlash.playerVersion
 * @desc Get the version of the installed Flash plugin.
 * @type String
 *
**/
$$.hasFlash.playerVersion = function() {
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always';	} 
			catch(e) { return '6,0,0'; }				
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}		
	}
	return '0,0,0';
};
/**
 *
 * @name flash.htmlOptions
 * @desc The default set of options for the object or embed tag.
 *
**/
$$.htmlOptions = {
	height: 240,
	flashvars: {},
	pluginspage: 'http://www.adobe.com/go/getflashplayer',
	src: '#',
	type: 'application/x-shockwave-flash',
	width: 320		
};
/**
 *
 * @name flash.pluginOptions
 * @desc The default set of options for checking/updating the flash Plugin.
 *
**/
$$.pluginOptions = {
	expressInstall: false,
	update: true,
	version: '6.0.65'
};
/**
 *
 * @name flash.replace
 * @desc The default method for replacing an element with a Flash movie.
 *
**/
$$.replace = function(htmlOptions) {
	this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
	jQuery(this)
		.addClass('flash-replaced')
		.prepend($$.transform(htmlOptions));
};
/**
 *
 * @name flash.update
 * @desc The default method for replacing an element with an update message.
 *
**/
$$.update = function(htmlOptions) {
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
	jQuery(this)
		.addClass('flash-update')
		.prepend(msg);
};
/**
 *
 * @desc Convert a hash of html options to a string of attributes, using Function.apply(). 
 * @example toAttributeString.apply(htmlOptions)
 * @result foo="bar" foo="bar"
 *
**/
function toAttributeString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'="'+this[key]+'" ';
	return s;		
};
/**
 *
 * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). 
 * @example toFlashvarsString.apply(flashvarsObject)
 * @result foo=bar&foo=bar
 *
**/
function toFlashvarsString() {
	var s = '';
	for(var key in this)
		if(typeof this[key] != 'function')
			s += key+'='+encodeURIComponent(this[key])+'&';
	return s.replace(/&$/, '');		
};
/**
 *
 * @name flash.transform
 * @desc Transform a set of html options into an embed tag.
 * @type String 
 *
 * @example $$.transform(htmlOptions)
 * @result <embed src="foo.swf" ... />
 *
 * Note: The embed tag is NOT standards-compliant, but it 
 * works in all current browsers. flash.transform can be
 * overwritten with a custom function to generate more 
 * standards-compliant markup.
 *
**/
$$.transform = function(htmlOptions) {
	htmlOptions.toString = toAttributeString;
	if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString;
	return '<embed ' + String(htmlOptions) + '/>';		
};

/**
 *
 * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
 *
**/
if (window.attachEvent) {
	window.attachEvent("onbeforeunload", function(){
		__flash_unloadHandler = function() {};
		__flash_savedUnloadHandler = function() {};
	});
}
	
})();
/*

jQuery sIFR Plugin
	* Version 2.0 Beta 2
	* 2008-07-22 08:32:02
	* URL: http://jquery.thewikies.com/sifr
	* Description: jQuery Sifr Plugin replaces traditional text in a web page with flash text (sIFR).
	* Author: Jonathan Neal
	* Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license.
	* JSLint: This javascript file passes JSLint verification.
*//*jslint
		bitwise: true,
		browser: true,
		eqeqeq: true,
		glovar: true,
		nomen: true,
		plusplus: true,
		undef: true,
		white: true
*//*global
		jQuery
*/

/* == jQuery Sifr Plugin (with selectors) == */
jQuery.fn.sifr = function (prefs) {

	/* == lock and load our preferences == */
	var p = jQuery.extend((prefs === false) ? { unsifr: true } : {}, arguments.callee.prefs, prefs);

	/* == if necessary, save our prefs == */
	if (p.save) {
		arguments.callee.prefs = jQuery.extend(p, { save: false });
	}

	/* == we're done if there's no sIFR specified == */
	if (this[0] === document) {
		return;
	}

	/* == if necessary, run a custom function before we begin == */
	if (!p.unsifr && typeof p.before === 'function') {
		p.before.apply(this, [p]);
	}

	/* == do this function on every element we've selected == */
	this.each(function () {

		/* == 't' will mean the jQuery version of 'this' == */
		var t = jQuery(this);

		/* == 'a' will mean the possible '.sIFR-alternate' child of 't' == */
		var a = t.children('.sIFR-alternate');

		/* == if 'a' exists, then it's time to unSifr == */
		if (a) {
			t.html(a.html());

			/* == if unsifr was called, then it's time to go == */
			if (p.unsifr) {
				return;
			}
		}

		if (typeof p.beforeEach === 'function') {
			p.beforeEach.apply(this, [t, p]);
		}

		/* == 's' will mean the newly created child of 't', and it's what will be sIFRed == */
		var s = t.html('<span class="flash-replaced sIFR-replaced">' + (p.content || t.html()).replace(/^\s+|\s+$/g, '') + '</span>').children();

		/* == 'a' will mean another newly created child of 't', and it's where the alternate text goes == */
		a = t.append('<span class="alt sIFR-alternate">' + s.html() + '</span>').children('.sIFR-alternate');

		/* == if 'a' isn't hidden already, make it secret, make it safe == */
		if (a.css('display') !== 'none') {
			a.css('display', 'none');
		}

		/* == make a function which converts "most" colors into the 6 digit hexidecimal equivelent == */
		var toHex = function (c) {
			var h = function (n) {
				if (n === 0 || isNaN(n)) {
					return '00';
				}
				n = Math.round(Math.min(Math.max(0, n), 255));
				return '0123456789ABCDEF'.charAt((n - n % 16) / 16) + '0123456789ABCDEF'.charAt(n % 16);
			};
			c = (c) ? c.replace(/rgb|\(|\)|#$/g, '') : false;
			if (!c) {
				return false;
			}
			if (c.indexOf(',') > -1) {
				c = c.split(', ');
				return '#' + h(c[0]) + h(c[1]) + h(c[2]);
			}
			if (c.search('#') > -1 && c.length <= 4) {
				c = c.split('');
				return '#' + c[1] + c[1] + c[2] + c[2] + c[3] + c[3];
			}
			return c;
		};

		/* == this is a very special addition for textTransform support == */
		if (p.textTransform) {
			if (p.textTransform.toLowerCase() === 'uppercase') {
				s.html(s.html().toUpperCase());
			}
			if (p.textTransform.toLowerCase() === 'lowercase') {
				s.html(s.html().toLowerCase());
			}
			if (p.textTransform.toLowerCase() === 'capitalize') {
				var c = s.html().replace(/\>/g, '> ').split(' ');
				for (var i = 0; i < c.length; i = i + 1) {
					c[i] = c[i].charAt(0).toUpperCase() + c[i].substring(1);
				}
				s.html(c.join(' ').replace(/\> /g, '>'));
			}
		}

		/* == 'f' will mean the flash plugin htmloptions == */
		var f = {
			flashvars: jQuery.extend({
				h: s.height() * (p.zoom || 1),
				offsetLeft: p.offsetLeft || undefined,
				offsetTop: p.offsetTop || undefined,
				textAlign: p.textAlign || (/(left|center|right)/.exec(t.css('textAlign')) || ['center'])[0],
				textColor: toHex(p.color || t.css('color')) || undefined, /*'23ffcc00'*/
				
				txt: p.content || s.html(),
				underline: (p.underline || (p.underline !== false && t.css('textDecoration') === 'underline')) ? true : undefined,
				w: (p.width || s.width()) * (p.zoom || 1)
			}, p.flashvars),
			height: p.height || s.height(),
			src: (p.path || '') + ((p.path && p.path.substr(p.path.length - 1) !== '/') ? '/' : '') + (p.font || '') + ((p.font && p.font.indexOf('.swf') === -1) ? '.swf' : ''),
			width: p.width || s.width(),
			wmode: 'transparent'
		};

		/* == make some more flash plugin htmloptions == */
		f.flashvars.linkColor = toHex(p.link || t.find('a').css('color')) || f.flashvars.textColor;
		f.flashvars.hoverColor = toHex(p.hover) || f.flashvars.linkColor;
		
		
		if (p.zoom) {
			f.flashvars.offsetTop = ((p.offsetTop || 0) + ((s.height() - (s.height() * p.zoom)) / 2)) * (p.zoomTop || 1);
			f.flashvars.offsetLeft = ((p.offsetLeft || 0) + ((s.width() - (s.width() * p.zoom)) / 2)) * (p.zoomLeft || 1);
		}

		/* == hand the mic over to luke lutman and his big flash band == */
		t.flash(
			jQuery.extend(f, p.embedOptions),
			jQuery.extend({
				expressInstall: p.expressInstall || false,
				version: p.version || 7,
				update: p.update || false
			}, p.pluginOptions),
			function (f) {

				/* == now remember how wide and tall things are == */
				var preHeight = t.height();
				var preWidth = t.width();

				/* == the flash bang == */
				s.html(jQuery.fn.flash.transform(f));

				/* == 'e' will mean the embedded flash == */
				var e = s.find(':first');
				
				if($.browser.linux){
					
					if(e.parents('h2').attr('class')=='masabajo') {
						e.attr('bgcolor','#98999B');
					
					}else{
						e.attr('bgcolor','#77787C');
					
					}
					
				}
				e.css({
					verticalAlign: 'text-bottom',
					display: 'inline',
					width: p.width,
					height: p.height
				});
				
				var marginBottom = preHeight - t.height();
				var width = parseInt(e.css('width'), 10) + parseInt(preWidth - t.width(), 10);

				/* == now enforce these non-changes == */
				if (!p.height) {
					e.css({
						marginBottom: marginBottom
					});
				}
				if (!p.width) {
					e.css({
						width: width
					});
				}

				/* == special and strange middle vertical alignment == */
				if (p.height && p.verticalAlign === 'middle') {
					e.css({
						marginTop: Math.floor((p.height - s.height()) / 2),
						marginBottom: Math.round((p.height - s.height()) / 2),
						height: s.height()
					});
					e.attr('height', s.height());
				}

				/* == special and strange bottom vertical alignment == */
				if (p.height && p.verticalAlign === 'bottom') {
					var a = t.find('.sIFR-alternate');
					e.css({
						marginTop: (p.height - s.height()),
						height: s.height()
					});
					e.attr('height', s.height());
				}

				if (p.css) {
					e.css(p.css);
				}
			}
		);

		if (typeof p.afterEach === 'function') {
			p.afterEach.apply(this, [t, p]);
		}
	});

	/* == if necessary, run a custom function after we're done == */
	if (!p.unsifr && typeof p.after === 'function') {
		p.after.apply(this, [p]);
	}

};

/* == jQuery Sifr Plugin (without selectors) == */
jQuery.sifr = function (prefs) {
	jQuery().sifr(jQuery.extend({
		save: true
	}, prefs));
};

/* == jQuery Sifr Plugin (as unSifr) == */
jQuery.fn.unsifr = function () {
	return this.each(
		function () {
			jQuery(this).sifr(false);
		}
	);
};




$(document).ready(function() {

	//$.sifr({path: "http://dev.irontec.com/irontec/travelair/fuentes/",save: true});
	$.sifr({path: location.protocol+"//www.travelair-empresas.com/travelair/fuentes/",save: true});
      //$('h2').sifr({ font: 'trav.swf' ,color:'23ffcc00',h:19,w:150} );
      $('h1.gordo').sifr({ font: 'travg.swf' ,color:'00000000'} );
		$('h1.fino').sifr({ font: 'travf.swf' ,color:'00000000'} );
		
		$('h2.normal').sifr({ font: 'trav.swf' ,color:'00000000'} );
		//$('.enlace').sifr({ font: 'trav.swf' ,color:'00000000'} );
		$('h2.seccion').sifr({ font: 'trav.swf' ,color:'00000000'} );
		$('h2.seccionfina').sifr({ font: 'travf.swf' ,color:'00000000'} );
        
});
