
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://opensource.org/licenses/mit-license.php> */
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();

/* toJSON jQuery function */
(function($){$.toJSON=function(o){if(typeof(JSON)=='object'&&JSON.stringify)return JSON.stringify(o);var type=typeof(o);if(o===null)return"null";if(type=="undefined")return undefined;if(type=="number"||type=="boolean")return o+"";if(type=="string")return $.quoteString(o);if(type=='object'){if(typeof o.toJSON=="function")return $.toJSON(o.toJSON());if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++)ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")name='"'+k+'"';else if(type=="string")name=$.quoteString(k);else continue;if(typeof o[k]=="function")continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src){if(typeof(JSON)=='object'&&JSON.parse)return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src){if(typeof(JSON)=='object'&&JSON.parse)return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))return eval("("+src+")");else throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string){if(string.match(_escapeable)){return'"'+string.replace(_escapeable,function(a){var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);

//json2.js
"object"!==typeof JSON&&(JSON={});(function(){function k(a){return 10>a?"0"+a:a}function p(a){q.lastIndex=0;return q.test(a)?'"'+a.replace(q,function(a){var c=s[a];return"string"===typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function m(a,j){var c,d,h,n,g=e,f,b=j[a];b&&("object"===typeof b&&"function"===typeof b.toJSON)&&(b=b.toJSON(a));"function"===typeof i&&(b=i.call(j,a,b));switch(typeof b){case "string":return p(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);case "object":if(!b)return"null";e+=l;f=[];if("[object Array]"===Object.prototype.toString.apply(b)){n=b.length;for(c=0;c<n;c+=1)f[c]=m(c,b)||"null";h=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+g+"]":"["+f.join(",")+"]";e=g;return h}if(i&&"object"===typeof i){n=i.length;for(c=0;c<n;c+=1)"string"===typeof i[c]&&(d=i[c],(h=m(d,b))&&f.push(p(d)+(e?": ":":")+h))}else for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(h=m(d,b))&&f.push(p(d)+(e?": ":":")+h);h=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+g+"}":"{"+f.join(",")+"}";e=g;return h}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var r=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,q=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,l,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,j,c){var d;l=e="";if("number"===typeof c)for(d=0;d<c;d+=1)l+=" ";else"string"===typeof c&&(l=c);if((i=j)&&"function"!==typeof j&&("object"!==typeof j||"number"!==typeof j.length))throw Error("JSON.stringify");return m("",{"":a})});"function"!==typeof JSON.parse&&(JSON.parse=function(a,e){function c(a,d){var g,f,b=a[d];if(b&&"object"===typeof b)for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(f=c(b,g),void 0!==f?b[g]=f:delete b[g]);return e.call(a,d,b)}var d,a=String(a);r.lastIndex=0;r.test(a)&&(a=a.replace(r,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"===typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse");})})();

$.fn.fPlayer = function( options, obj ) {

	function trackCount() {
		if( o.counted )
			return false;
		else if( o.maxPlays ) {
			if( o.ctPlays <= o.maxPlays ) {
				o.counted = true;
				var qualities = o.playlist[o.curItem].qualities;
				if( qualities.length > o.curQuality )
					var thisSrc = qualities[o.curQuality].src;
				else if( qualities.length == 1 )
					var thisSrc = qualities[0].src;
				else
					var thisSrc = '';
				if( thisSrc.indexOf('missing') < 0 )
					o.ctPlays++;
				addCookie( 'wqa_fp_playCt', o.ctPlays, 365 );
			}
			return ( o.ctPlays > o.maxPlays );
		}
		return false;
	}

	function focusOnPlayer() {
		if( o.focusPlayer ) {
			var movePlayerTo	= $(document).scrollTop();
			var topPxl			= $(document).scrollTop();
			var winHeight		= $(window).height();
			var bottomPxl		= topPxl + winHeight;
			var playerHeight	= o.containerDiv.height();
			var playerTop		= o.containerDiv.offset().top;
			var playerBtm		= playerTop + playerHeight + 100;
			var playerPadding	= playerTop - ( winHeight - playerHeight ) / 2;
			if( playerBtm > bottomPxl ) {
				movePlayerTo = playerPadding;
			}

			if( playerTop < topPxl || winHeight < playerHeight ) {
				movePlayerTo = playerTop;
			}

			$('html, body').animate({ 'scrollTop': movePlayerTo }, 300 );
		}
	}

	function switcher() {
		o.curQuality	= ( quality = getCookie('wqa_fp_quality') ) ? quality : 0;
		var volLevel	= getCookie('wqa_fp_volume');
		var attributes	= {};
		var params = {
			wmode				: playVideoInFullScreen ? 'none' : 'transparent',
			allowFullScreen		: true,
			allowScriptAccess	: 'always',
			bgcolor				: o.uiTheme.background ? o.uiTheme.background : '#000000',
			quality				: 'best'
		};
		var flashvars	= {
			hidePrevNext 		: o.hidePrevNext,
			miniTimeline		: o.miniTimeline,
			staticTimeline		: o.staticTimeline,
			menuHeight			: o.menuHeight,
			fPlayerId			: o.fPlayerId,
			noScrubberBox		: o.noScrubberBox,
			deblocking			: o.deblocking,
			neverSmooth			: o.neverSmooth,
			noSizeToggle		: o.noSizeToggle,
			noFullscreen		: o.noFullscreen,
			continuePercent		: o.percent,
			statusUpdate		: o.statusUpdate,
			volCallback			: 'updateVolume',
			dimFunc				: o.dimFunc ? o.dimFunc : null,
			volumeLvl			: volLevel - 0 == volLevel ? volLevel : .50,
			dimFunc				: $.browser.webkit && o.dimClass ? 'toggleLights' : false,
			uiTheme				: escape( JSON.stringify( o.uiTheme ) ),
			curSize				: o.curSize,
			companyName			: o.companyName ? o.companyName : false,
			playlist			: escape( JSON.stringify( o.playlist ).replace(/&/g, "%26") ),
			curItem				: o.curItem,
			uiSizes				: o.noResize ? null : escape( JSON.stringify( o.uiSizes ) ),
			quality				: o.curQuality,
			startParam			: o.startParam,
			trackMediaFunc		: o.trackMediaFunc ? 'trackMediaTrend' : 0
		};

		var s = playVideoInFullScreen
			? { height: window.innerHeight, width: window.innerWidth }
			: o.uiSizes[o.curSize];

		if( playVideoInFullScreen ) {
			$('body').css({
				overflow	: 'hidden'
			});
			$('#fullscreenPlayerWrap').show();
		}

		var softwareData	= swfobject.getFlashPlayerVersion();
		var playerVersion	= softwareData.major + "." + softwareData.minor + "." +	softwareData.release;

		if( softwareData.major > 8 ) {
			swfobject.embedSWF(
				o.player,
				flashvars.fPlayerId,
				s.width,
				parseInt(s.height) + parseInt(o.menuHeight),
				"9.0.0",
				"/wqapps/fplayer/2/swf/expressInstall/",
				flashvars,
				params,
				attributes
			);
			onPlay();
		} else {
			var errorMsg	= softwareData.major
				? 'You are currently using Flash version:<br>' + playerVersion
					+ '<br><br>Please upgrade by clicking the link below'
				: 'You do not have Flash installed<br>Please install it by clicking the link below';
			$('<div>')
				.html( errorMsg + '<br><a target="_blank" href="http://get.adobe.com/flashplayer/">'
					+ 'http://get.adobe.com/flashplayer/</a>'
				)
				.css({
					textAlign	: 'center',
					margin		: '10% 10%',
					background	: 'grey',
					color		: 'black',
					padding		: 20
				}).appendTo( '#'+o.fPlayerId )
			;
		}
	}

	function resetPlayerCss() {
		if( o.lastCSS == o.uiSizes[0].css ) {
			if( o.uiSizes[ o.curSize ] )
				$( o.uiSizes[ o.curSize ].hide ).fadeIn(300);
		} else {
			o.containerDiv.switchClass(
				o.lastCSS,
				o.uiSizes[ 0 ].css,
				500,
				function() {
					o.lastCSS = o.uiSizes[0].css;
					$( o.uiSizes[ 0 ].css ).fadeIn(300);
				}
			);
		}
	}

	function limitReached() {
		resetPlayerCss();

		var end = o.playlist[ o.curItem ][ 'end' ];
		if( end ) {
			if( o.mainPlayBtn )
				o.mainPlayBtn.unbind('click');

			var clickFunc = function() {
				if( end.clickJS )
					window[ end.clickJS ]( o.fPlayerId, 1 );
				if( end.href )
					window.location = end.href;
				if( o.emptyVideoUrl )
					window.location = o.emptyVideoUrl;
			};

			if( end.img ) {
				o.fPlayer.fadeOut(
					200,
					function() {
						$( this ).html( '<img src="'+end.img+'">' ).click( clickFunc ).fadeIn(200);
						o.atEndPlacard = true;
					}
				);
			} else if( end.autoJS ) {
				window[ end.autoJS ]( o.fPlayerId, 1 );
			} else {
				clickFunc();
			}

		}
		o.atEndPlacard = true;
	}

	function play() {
		if( typeof checkPlayerFunction == 'function' && !checkPlayerFunction() ) {
			return false;
		}
		if( trackCount() ) {
			limitReached();
		} else if( o.playlist[ o.curItem ].qualities.length == 0 ) {
			switch( o.platform ) {
				case 'tv':
				case 'mobile':
				case 'tablet':
					alert( 'This video is not playable on this device' );
				break;
				case 'desktop':
				default:
					alert( 'This video is not available' );
				break;
			}
		} else {
			switch( o.platform ) {
				case 'tv':
				case 'mobile':
				case 'tablet':
					window.location.href = o.playlist[ o.curItem ].qualities[0].src;
				break;
				case 'desktop':
				default:
					resetPlayer();
					if( o.noResize || !o.uiSizes[o.curSize] )
						o.curSize = 0;
					if( playVideoInFullScreen ) {
						window.scrollTo(0,0);
					} else {
						if( o.lastCSS != o.uiSizes[o.curSize].css )
							updateDisplay(o.uiSizes[o.curSize]);
						focusOnPlayer();
						o.containerDiv.addClass('shown');
					}
					switcher();
				break;
			}
		}
	}

	function onPlay() {
		if( $('a#' + o.fPlayerId + 'Ad').length != 1 && o.playerAd.image && o.playerAd.url ) {
			$getPlayerElementById( o.fPlayerId )
				.append( '<a id="' + o.fPlayerId + 'Ad" href="' + o.playerAd.url
					+ '" style="display: none;"></a>'
				);
			$( 'a#' + o.fPlayerId + 'Ad' )
				.css( {
					background			: 'url(' + o.playerAd.image + ') bottom right no-repeat',
					'background-size'	: '100%',
					width				: o.playerAd.width + 'px',
					height				: o.playerAd.height + 'px',
					top					: '16px',
					right				: '28px',
					position			: 'absolute'
				} )
				.click( function () {
					window.open( o.playerAd.url, '_blank' );
					if( !o.playerAd.isCookieSet
						&& typeof o.playerAd.cookieValue != 'undefined'
						&& o.playerAd.cookieValue.length > 0
					) {
						setCookie( o.playerAd.cookieName, o.playerAd.cookieValue );
					}
					return false;
				} )
			;
		}
	}

	function onTime() {
		if( $('a#' + o.fPlayerId + 'Ad').length > 0
			&& $('a#' + o.fPlayerId + 'Ad').is(':hidden')
			&& $.inArray( o.curSeconds, o.playerAd.timeSeconds ) >= 0
		) {
			$div = $( 'a#' + o.fPlayerId + 'Ad' );
			$div.fadeIn(1000);
			setTimeout( function() { $div.fadeOut(1000); }, o.playerAd.lengthSeconds * 1000 );
		}
	}

	function completeUpdateDisplay( ) {
		o.containerDiv.removeClass( o.lastCSS ).addClass( o.uiSizes[o.curSize].css );
		o.lastCSS = o.uiSizes[o.curSize].css;
	}

	function updateDisplay( size ) {
		if( size.hide )
			$( size.hide ).fadeOut(200);
		if( o.noSizeTransition || navigator.userAgent.indexOf("Firefox") != -1 ) {
			resizeFlash(size);
	/*		if( o.uiSizes[ o.prevSize ].width <= size.width && navigator.userAgent.indexOf("Firefox") != -1 ) {
				setTimeout( "o.containerDiv.removeClass( '"+o.lastCSS+"' ).addClass( '"+size.css+"' );", 300 );
			} else {
				o.containerDiv.removeClass( o.lastCSS ).addClass( size.css );
			}*/
		} else if( $( o.containerDiv ).hasClass(size.css) ) {
			o.lastCSS = size.css;
			resizeFlash(size);
		} else if( o.lastCSS ) {
			$( o.containerDiv ).switchClass( o.lastCSS, size.css, 300, function ( ) {
				o.containerDiv.show();
				o.lastCSS = size.css;
				resizeFlash(size);
			});
		} else {
			$( o.containerDiv ).addClass( size.css );
			resizeFlash(size);
		}
	}

	function resizeFlash(size) {
		if( size.show )
			$( size.show ).fadeIn(300);
		$( '#'+o.fPlayer.attr('id') ).attr({
			height	: ( parseInt( size.height ) + parseInt( o.menuHeight ) ),
			width	: size.width
		});
	}

	function resetPlayer() {
		if( !trackCount() )
			o.fPlayer.replaceWith('<div id="' + o.fPlayerId + '"></div>');
	}

	function activate(e) {
		if( typeof e == 'object' )
			e.stopPropagation();

		if( !o.playlist[o.curItem].qualities[o.curQuality] ) {
			if( o.emptyVideoUrl ) {
				window.location = o.emptyVideoUrl;
				return false;
			}
		}

		if( typeof e != 'object' && e - 0 == e )
			o.curItem = e;
		else
			o.curItem = parseInt( o.playAttr ? $(this).attr(o.playAttr) : 0 );
		o.curItem = isNaN( o.curItem ) ? 0 : o.playlist[ o.curItem ] ? o.curItem : 0;
		if( o.platform == 'desktop' ) {
			if( $( '#'+o.fPlayerId ).get(0).changeItem ) {
				$( '#'+o.fPlayerId ).get(0).changeItem( o.curItem );
				focusOnPlayer();
			} else {
				play();
			}
		} else
			play();
	}

	function intervalCheck() {
		fP = $( '#'+o.fPlayerId ).fPlayer;
		if( $( '#'+o.fPlayerId ).length == 0 || typeof fP != 'function' )
			return false;

		o.curSeconds = Math.floor( fP('getPosition') );
		switch( fP('getState') ) {
			case 'IDLE':
			break;
			case 'BUFFERING':
			case 'PLAYING':
				onTime();
			break;
			case 'PAUSED':
			break;
		}
	}

	function makeClickable( obj ) {
		if( $( obj ).length )
			$( obj ).css({'cursor':'pointer'}).unbind( 'click',activate ).click(activate);
	}

	function limiter( o, l, h, r ) {
		return o > h ? ( r ? l : h ) : o < l ? ( r ? h : l ) : o;
	}

	if( typeof options == 'object' || options == null ) {
		o = $.extend({
			atEndPlacard	: false,
			autoplay		: false,
			containerDiv	: false,
			counted			: false,
			curQuality		: ( quality = getCookie( 'wqa_fp_quality' ) ) ? quality : 0,
			curItem			: 0,
			curSeconds		: 0,
			curSize			: getCookie( 'wqa_fp_uisize' ),
			dimClass		: false,
			dimParent		: 'body',
			fPlayerId		: $(this).attr('id'),
			lastCSS			: null,
			menuHeight		: 0,
			deblocking		: null,
			neverSmooth		: false,
			parent			: '',
			prevSize		: 0,
			noSizeTransition: true,
			percent			: 0,
			companyName		: null,
			player			: '/wqapps/fplayer/2/swf/',
            xmlPlaylist     : 0,
			playlist		: [],
			maxPlays		: 0,
			noSizeToggle	: false,
			noScrubberBox	: false,
			noFullscreen	: false,
			noResize		: false,
			focusPlayer		: true,
			ctPlays			: parseInt( getCookie( 'wqa_fp_playCt' ) ),
			staticTimeline	: false,
			autoplayHash	: false,
			hidePrevNext	: false,
			miniTimeline	: false,
			uiTheme			: {},
			platform		: false,
			mainPlayBtn		: false,
			uiSizes			: [
				{
					css		: null,
					hide	: null,
					show	: null,
					endImg	: null,
					height	: 360,
					width	: 640
				}
			],
			playAttr		: 'playItem',
			fPlayer			: null,
			fInterval		: 0,
			playerAd		: {},
			statusUpdate	: null,
			mediaSource		: null,
			emptyVideoUrl	: null,
			startParam		: null,
			trackMediaFunc	: 0
		}, options || {});

		if( typeof(playVideoInFullScreen) == 'undefined' )
			playVideoInFullScreen = false;

		$.each( o.uiSizes, function( k, v ) {
			o.uiSizes[k].width	= parseInt( v.width );
			o.uiSizes[k].height	= parseInt( v.height );
		});

		o.fPlayer		= $(this);
		o.fPlayerId		= o.fPlayer.attr('id');

		if( !o.fInterval ) {
			o.fInterval = self.setInterval( intervalCheck, 250 );
		}

		if( playVideoInFullScreen ) {
			o.fPlayer.removeAttr('id');
			o.fPlayer	= $('<div id="'+o.fPlayerId+'"></div>').prependTo('body');
			o.fPlayer.wrap('<div id="fullscreenPlayerWrap" style="display:none;">');
			o.containerDiv	= '#fullscreenPlayerWrap';
		}

		o.mainPlayBtn	= o.fPlayer.children().length == 1
			? o.fPlayer.children()
			: o.fPlayer.children().length == 0 ? o.fPlayer : false;
		o.containerDiv	= o.containerDiv ? $(o.containerDiv) : o.fPlayer.parent();
		o.percent		= parseFloat( o.percent );
		o.ctPlays		= isNaN( o.ctPlays ) ? 0 : o.ctPlays;
		o.curSize		= o.uiSizes[ o.curSize ] ? o.curSize : 0;
		o.lastCSS		= o.uiSizes[ 0 ].css;
		$( o.containerDiv ).addClass( o.lastCSS );

		if( navigator.userAgent.match(/(ipad|xbox)/i) )
			o.platform = 'tablet';
		else if( navigator.userAgent.match( /(IEMobile|opera mini|ipod|iphone|android|webOS|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|hiptop|\bpda|psp|treo|nokia|blackberry)/i ) )
			o.platform = 'mobile';
		else
			o.platform = 'desktop';

		$.each( o.playlist, function( k, v ) {
			var list = [];
			var mp4List = [];
			if( typeof v != 'undefined' ) {
				$( v.qualities ).each(function( kk, vv ) {
					if( typeof vv != 'undefined' && vv.src ) {
						if( !vv.platform || vv.platform.search( o.platform ) != -1 ) {
                            if ( o.xmlPlaylist ) {
                                $.ajax({
                                    url:vv.src,
                                    type:'GET',
                                    success: function(data) {
                                        var src = $(data).find('content set location').text();
                                        if ( src ) {
                                            vv.src = src;
                                            list.push( vv );
                                            if( vv.src.search( /\.mp4/i ) > 0 ) {
                                                mp4List.push( vv );
                                            }
                                        }
                                    }
                                });
                            } else {
                                list.push( vv );
                                if( vv.src.search( /\.mp4/i ) > 0 ) {
                                    mp4List.push( vv );
                                }
                            }
						}
					}
				});
				if( mp4List.length )
					o.playlist[ k ].qualities = mp4List;
				else
					o.playlist[ k ].qualities = list;
				if( !o.playlist[ k ].qualities.length ) {
					$( o.containerDiv ).addClass('fplayer-platform-unavailable');
					if( o.playAttr )
						$( '[' + o.playAttr + '='+k+']' ).addClass('fplayer-platform-unavailable');
				}
			}
		});

		if( o.mainPlayBtn )
			makeClickable( o.mainPlayBtn );

		if( o.playAttr )
			makeClickable( '[' + o.playAttr + ']' );

		if( o.autoplayHash ) {
			$( location.hash.replace('#','').split(',') ).each(function( k, v ) {
				v = v.search(':') >= 0 ? v.split(':') : v.search('=') >= 0 ? v.split('=') : [ v, null ];
				switch( v[0] ) {
					case o.autoplayHash:
						o.autoplay = 1;
					break;
					case 'startAt':
					break;
					case 'playClip':
						o.autoplay	= 1;
						o.curItem	= parseInt( v[1] );
					break;
					case 'playMediaId':
						var mediaId	= parseInt( v[1] );
						$.each( o.playlist, function( k, v ) {
							if( v.mediaId == mediaId ) {
								o.curItem	= k;
								o.autoplay	= 1;
							}
						});
					break;
				}
			});
		}

		if( o.statusUpdate && window[o.statusUpdate] )
			window[o.statusUpdate]('READY');

		if( o.autoplay )
			if( ( o.maxPlays && o.ctPlays <= o.maxPlays ) || !o.maxPlays )
				play();

		if( o.trackMediaFunc && !specsSet ) {
			specsSet = true;
			trackMediaTrend(
				null,
				null,
				'specs',
				o.autoplay,
				o.uiSizes[ o.curSize ].height
			);
		}
		if( $.browser.webkit ) {
			$('html').keyup(function(e) {
				if( !$("input:focus, object:focus").length
					&& $( '#'+o.fPlayerId ).get(0)
					&& $( '#'+o.fPlayerId ).get(0).releaseKey
				)
					$( '#'+o.fPlayerId ).get(0).releaseKey();
			}).keydown(function(e) {
				if( !$("input:focus, object:focus").length
					&& $( '#'+o.fPlayerId ).get(0)
					&& $( '#'+o.fPlayerId ).get(0).captureKey
				) {
					switch( e.which ) {
						case 9:
						case 32:
						case 37:
						case 38:
						case 39:
						case 40:
						case 70:
							$( '#'+o.fPlayerId ).get(0).captureKey( e.which );
							return false;
						break;
					}
				}
			});
		}
	} else if( typeof options == 'string' ) {
		switch( options ) {
			case 'resetPlayerCss':
				resetPlayerCss();
			break;
			case 'activate':
				activate( obj || 0 );
			break;
			case 'play':
				play();
			break;
			case 'prev':
			case 'next':
				switch( options ) {
					case 'next':	o.curItem++;	break;
					case 'prev':	o.curItem--;	break;
				}
				o.curItem = limiter( o.curItem, 0, o.playlist.length, obj.loop );
				if( $( '#'+o.fPlayerId ).get(0).changeItem ) {
					$( '#'+o.fPlayerId ).get(0).changeItem( o.curItem );
					focusOnPlayer();
				} else {
					resetPlayer();
					play();
				}
			break;
			case 'setPlaylist':
				o.playlist = obj.playlist;
				if( $(this).setPlaylist )
					$(this).setPlaylist( JSON.stringify( o.playlist ) );
				if( obj.play )
					play();
			break;
			case 'switchFormat':
				addCookie( 'wqa_fp_uisize', obj.newFormat, 365 );
				o.prevSize = o.curSize;
				o.curSize = obj.newFormat;
				updateDisplay( o.uiSizes[o.curSize] );
			break;
			case 'completeUpdateDisplay':
				completeUpdateDisplay( o.fPlayerId );
			break;
			case 'reset':
				$('#' + o.fPlayerId ).fPlayer($.extend(o, obj || {}));
			break;
			case 'togglePlay':
				if( $( '#'+o.fPlayerId ).get(0).togglePlay )
					$( '#'+o.fPlayerId ).get(0).togglePlay();
			break;
			case 'getState':
				if( $( '#'+o.fPlayerId ).get(0).getState )
					return $( '#'+o.fPlayerId ).get(0).getState();
				else
					return 'IDLE';
			break;
			case 'getPosition':
				if( $( '#'+o.fPlayerId ).get(0).getPosition ) {
					return Math.round( $( '#'+o.fPlayerId ).get(0).getPosition() * 1000 ) / 1000;
				} else
					return null;
			break;
			case 'setPosition':
				if( $( '#'+o.fPlayerId ).get(0).jumpTo ) {
					$( '#'+o.fPlayerId ).get(0).jumpTo( obj );
				}
			break;
			case 'moveSecs':
				if( $( '#'+o.fPlayerId ).get(0).moveSecs )
					$( '#'+o.fPlayerId ).get(0).moveSecs( obj );
			break;
			case 'set':
				$.extend(o, obj || {});
			break;
			case 'get':
				return obj ? o[ obj ] ? o[ obj ] : false : o;
			break;
		}
	}
	return this.each(function(){});

};

function $getPlayerElementById( playerId ) {
	var $plyr = $( 'object#' + playerId );
	if( $plyr.length )
		$plyr = $plyr.parent();
	else
		$plyr = $( '#' + playerId );
	return $plyr;
}

/* functions called from flash */
function switchFormat( fPlayerId, newFormat ) {
	$( '#' + fPlayerId ).fPlayer('switchFormat',{newFormat:newFormat});
}

function completeUpdateDisplay( fPlayerId ) {
	$( '#' + fPlayerId ).fPlayer('completeUpdateDisplay');
}

function toggleLights( id ) {
	var fp	= $( '#' + id ),
		dc	= fp.fPlayer('get','dimClass'),
		dp	= $(fp.fPlayer('get','dimParent')),
		div	= '#lightOutBG';
	if( dc && dp ) {
		if( $('body').hasClass( dc ) ) {
			$( div ).fadeOut(500,function() {
				$('body').removeClass( dc );
			});
		} else {
			if( $( div ).length == 0 )
				dp.prepend('<div id="lightOutBG" class="'+dc+'" style="display:none;"></div>');
			$('body').addClass( dc );
			$( div ).fadeIn(500).unbind('click').click(function(e) {
				if( $( '#'+id ).get(0).setDimmer ) {
					$( '#'+id ).get(0).setDimmer(false);
				}
				toggleLights();
			});
		}
	}
}

/* JS calls to Flash functions */
var specsSet = false;

function clearMTData() {
	var curTime		= new Date().getTime();
	var curMedia	= getCookie('wqa_mt_data');

	if( curMedia ) {
		curMedia		= $.parseJSON( curMedia );
		var parseData	= curMedia;
		$.each( parseData, function( k, v ) {
			if( v.t + 60000 < curTime ) {
				var url = '/wqapps/mediatrends/?wqa_mt_mediaId=' + k + '&wqa_mt_variation=' + v.v
					+ '&wqa_mt_mode=abandon&wqa_mt_reason=timeout'
					+ '&wqa_mt_cur=' + Math.round(v.s);
				if( v.ms ) {
					url += '&wqa_mt_mediaSource=' + v.ms;
				}
				$.get( url );
				delete curMedia[ k ];
			}
		});
	} else {
		curMedia	= {};
	}
	return curMedia;
}

function trackMediaCookie( mediaId, variationNum, seconds ) {
	var curTime		= new Date().getTime();
	var curMedia	= clearMTData();
	var curData		= {
		v: parseInt( variationNum ),	// variation
		s: seconds,						// clip seconds
		t: curTime						// current time
	};

	if( o.mediaSource ) {
		$.extend( curData, {
			ms: o.mediaSource
		} )
	}

	addCookie( 'wqa_mt_last_mId', JSON.stringify( $.extend( {
		m: mediaId
	}, curData ) ), 2 );

	curMedia[ mediaId ]	= curData;

	addCookie( 'wqa_mt_data', JSON.stringify( curMedia ), 30 );
}

function trackMediaTrend( mediaId, variationNum, mode, a, b, c, d ) {
	var url = 'http://' + document.domain + '/wqapps/mediatrends/?wqa_mt_siteId=' + o.siteId
		+ '&wqa_mt_mediaId=' + mediaId + '&wqa_mt_variation=' + variationNum
		+ '&wqa_mt_mode=' + mode + '&';
	if( o.mediaSource ) {
		url += 'wqa_mt_mediaSource=' + o.mediaSource + '&';
	}

	switch ( mode ) {
		case 'specs':
			if( !getCookie( 'wqa_mt_spec') ) {

				addCookie( 'wqa_mt_spec', JSON.stringify( {
					wqa_mt_sh	: screen.height,
					wqa_mt_sw	: screen.width,
					wqa_mt_dh	: b,
					wqa_mt_ap	: a
				} ), 0 );

				url += 'wqa_mt_sh='+screen.height+'&wqa_mt_sw='+screen.width
					+ '&wqa_mt_dh='+b+'&wqa_mt_autoplay='+a;

			} else {
				url = false;
			}

			if( getCookie( 'wqa_mt_data') )
				addCookie( 'wqa_mt_data', JSON.stringify( clearMTData() ), 30 );

		break;
		case 'abandon':
			url += 'wqa_mt_reason=called&wqa_mt_cur='+Math.round(a);
			var curMedia	= getCookie('wqa_mt_data');

			if( curMedia ) {
				curMedia	= $.parseJSON( curMedia );
				if( curMedia[ mediaId ] )
					delete curMedia[ mediaId ];
			} else {
				curMedia	= {};
			}

			addCookie( 'wqa_mt_data', JSON.stringify( curMedia ), 30 );

		break;
		case 'end':
			trackMediaCookie( mediaId, variationNum, Math.round(a) );
		case 'quality':
			url += 'wqa_mt_cur='+Math.round(a);
		break;
		case 'update':
			trackMediaCookie( mediaId, variationNum, a );
			url = false;
		break;
		case 'loaded':
			url += 'wqa_mt_cur='+Math.round(a)+'&wqa_mt_load='+Math.round(b);
		break;
		case 'pip':
			b = b.replace( /,-/g, ':' );
			c = c.replace( /,-/g, ':' );
			d = d.replace( /,-/g, ':' );
			url += 'wqa_mt_cur='+Math.round(a)+'&wqa_mt_goal='+b+'&wqa_mt_buf='+c+'&wqa_mt_time='+d;
		break;
		case 'seek':
			trackMediaCookie( mediaId, variationNum, Math.round(a) );
			url += 'wqa_mt_cur='+Math.round(b)+'&wqa_mt_goal='+Math.round(a)+'&wqa_mt_buf='+Math.round(c);
		break;
		case 'pause':
		case 'continue':
			trackMediaCookie( mediaId, variationNum, Math.round(a) );
			url += 'wqa_mt_cur='+Math.round(a)+'&wqa_mt_buf='+Math.round(b);
		break;
		case 'display':
			trackMediaCookie( mediaId, variationNum, Math.round(a) );
			url += 'wqa_mt_cur='+Math.round(a)+'&wqa_mt_dh='+( ( parseInt( b ) == -1 ) ? (-screen.height) : b );
		break;
		case 'start':
			trackMediaCookie( mediaId, variationNum, 0 );
		break;
		default:
			url = false;
		break;
	}
	if( url )
		$.get( url );
}

function hideSecs( fPlayerId ) {
	if( $( '#'+fPlayerId ).get(0).hideSecs ) {
		$( '#'+fPlayerId ).get(0).hideSecs();
	}
}

function jumpTo( fPlayerId, secs) {
	if( $( '#'+fPlayerId ).get(0).jumpTo ) {
		$( '#'+fPlayerId ).get(0).jumpTo(secs);
	}
}

function showSecs( fPlayerId, secs ) {
	if( $( '#'+fPlayerId ).get(0).showSecs ) {
		$( '#'+fPlayerId ).get(0).showSecs(secs);
	}
}

/* Cookie functions */
function updateVolume( setVol ) {
	addCookie( 'wqa_fp_volume', setVol, 365 );
}

function setHd( hd ) {
	addCookie( 'wqa_fp_quality', hd, 365 );

	o.curQuality = hd;

	trackMediaTrend( o.playlist[o.curItem].mediaId,
		o.playlist[o.curItem].qualities[o.curQuality].variation, 'start' );
}

function addCookie( name, value, days ) {
	name		= 'wq_' + name;
	var date	= new Date();
		date.setTime( date.getTime() + ( days*24*60*60*1000 ) );
	var expires	= "; expires=" + ( days == 0 ? days : date.toGMTString() );
	var comPos	= $.inArray('com',window.location.hostname.split('.'));
	var domain	= comPos == -1 ? ''
		: ';domain=.' + window.location.hostname.split('.').splice( comPos - 1 ).join('.');
	document.cookie = name + "=" + value + expires + "; path=/" + domain;
}

function getCookie( nameEQ ) {
	nameEQ = 'wq_' + nameEQ + '=';
	var ca = document.cookie.split(';');
	for( var i=0; i < ca.length; i++ ) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring( 1, c.length );
		if( c.indexOf(nameEQ) == 0 ) return c.substring( nameEQ.length,c.length );
	}
	return null;
}
