/**
 * 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(a,b,c,d){var e=c||$$.replace;b=$$.copy($$.pluginOptions,b);if(!$$.hasFlash(b.version)){if(b.expressInstall&&$$.hasFlash(6,0,65)){var f={flashvars:{MMredirectURL:location,MMplayerType:'PlugIn',MMdoctitle:jQuery('title').text()}}}else if(b.update){e=d||$$.update}else{return this}}a=$$.copy($$.htmlOptions,f,a);return this.each(function(){e.call(this,$$.copy(a))})};$$.copy=function(){var a={},b={};for(var i=0;i<arguments.length;i++){var c=arguments[i];if(c==undefined)continue;jQuery.extend(a,c);if(c.flashvars==undefined)continue;jQuery.extend(b,c.flashvars)}a.flashvars=b;return a};$$.hasFlash=function(){if(/hasFlash\=true/.test(location))return true;if(/hasFlash\=false/.test(location))return false;var a=$$.hasFlash.playerVersion().match(/\d+/g);var b=String([arguments[0],arguments[1],arguments[2]]).match(/\d+/g)||String($$.pluginOptions.version).match(/\d+/g);for(var i=0;i<3;i++){a[i]=parseInt(a[i]||0);b[i]=parseInt(b[i]||0);if(a[i]<b[i])return false;if(a[i]>b[i])return true}return true};$$.hasFlash.playerVersion=function(){try{try{var a=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{a.AllowScriptAccess='always'}catch(e){return'6,0,0'}}catch(e){}return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1]}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'};$$.htmlOptions={height:240,flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash',width:320};$$.pluginOptions={expressInstall:false,update:true,version:'6.0.65'};$$.replace=function(a){this.innerHTML='<div class="alt">'+this.innerHTML+'</div>';jQuery(this).addClass('flash-replaced').prepend($$.transform(a))};$$.update=function(a){var b=String(location).split('?');b.splice(1,0,'?hasFlash=true&');b=b.join('');var c='<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="'+b+'">Click here.</a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+'</span>';jQuery(this).addClass('flash-update').prepend(c)};function toAttributeString(){var s='';for(var a in this)if(typeof this[a]!='function')s+=a+'="'+this[a]+'" ';return s};function toFlashvarsString(){var s='';for(var a in this)if(typeof this[a]!='function')s+=a+'='+encodeURIComponent(this[a])+'&';return s.replace(/&$/,'')};$$.transform=function(a){a.toString=toAttributeString;if(a.flashvars)a.flashvars.toString=toFlashvarsString;return'<embed '+String(a)+'/>'};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}})();


// Adds a class focus to input text when focused
	function focusfix(selector, className) {
		$(selector).focus(function() {
			$(this).addClass(className);
		});
		// Removes class when focus is lost
		$(selector).blur(function() {
			$(this).removeClass(className);
		});
	}

$(function() {
	// run the code in the markup!
	$('code.jquery').each(function() {
		eval($(this).text());
	});
	$("q").prepend("&ldquo;").append("&rdquo;");
	$("q q").prepend("&lsquo;").append("&rsquo;");
	// Add classes to input pseudotypes
	$("input[type='text'], input[type='password']").addClass("text");
	$("input[type='button'], input[type='submit'], input[type='checkbox'], input[type='image'], input[type='radio'], input[type='reset'], button").addClass("nontext");
	$("input[type='button'], input[type='submit'], input[type='reset'], button").addClass("button");
	// Focus on the first text input field in the first field on the page
	$("#content p input[type='text']:first").focus();
	// Add focus class to inputs
	focusfix("input.text", "focus");
	// Round corners
	$("#merchant_info, #dealer-logo, .corner, blockquote p.author").corner();
	// Add stripe and hover classes
	$(".striped tr, input").mouseover(function() {$(this).addClass("hover");}).mouseout(function() {$(this).removeClass("hover");});
	$(".striped tr:even").addClass("alt");
	// Add scrollbars
	$('.window').jScrollPane({showArrows:true, scrollbarMargin: 0,  scrollbarWidth: 17, arrowSize: 16});
	$('.jScrollPaneDrag').append('<div class="jScrollPaneGrip" style="width: 9px"></div>');
	// rotating vendor images
    $('#user_logos').flash({ src: 'st_user_logos.swf', width: 150, height: 100 });

});

