/* flCookie 0.1
Copyright (c) 2009 Kyle Simpson, Getify Solutions, Inc.
This software is released under the MIT License
====================================================================================================
*/
(function(r){var x=r,n=r.document,v=true,o=false,b="",w="undefined",l="object",p="function",m="string",t="div",f="onunload",z=null,y=0,q=null,j=null,u=null,a="text/javascript",i="flCookie.js",k="flensed.js",d="checkplayer.js",g="flCookie.swf",h=i,e=r.parseInt,s=r.setTimeout,c=r.clearTimeout;if(typeof r.flensed===w){r.flensed={}}if(typeof r.flensed.flCookie!==w){return}q=r.flensed;s(function(){var A=o,L=n.getElementsByTagName("script"),P=n.getElementsByTagName("head")[0],F=L.length;try{q.base_path.toLowerCase();A=v}catch(D){q.base_path=b}function J(T,S){for(var R=0;R=0){break}}}var Q=n.createElement("script");Q.setAttribute("src",q.base_path+T);if(typeof S!==w){Q.setAttribute("type",S)}P.appendChild(Q)}if((typeof L!==w)&&(L!==null)){if(!A){var M=0;for(var E=0;E=0)||((M=L[E].src.indexOf(i))>=0)){q.base_path=L[E].src.substr(0,M);break}}}}}try{q.checkplayer.module_ready()}catch(K){J(d,a)}J(k,a);var N=null;(function O(){try{q.ua.pv.join(".")}catch(Q){N=s(arguments.callee,25);return}q.bindEvent(x,f,function(){try{r.flensed.unbindEvent(x,f,arguments.callee);for(var T in _flcookie){if(_flcookie.hasOwnProperty(T)){try{_flcookie[T]=null}catch(S){}}}q.flCookie=_flcookie=q=u=j=null}catch(R){}})})();function I(){c(N);try{x.detachEvent(f,I)}catch(Q){}}if(N!==null){try{x.attachEvent(f,I)}catch(H){}}var C=null;function B(){c(C);try{x.detachEvent(f,B)}catch(Q){}}try{x.attachEvent(f,B)}catch(G){}C=s(function(){B();try{q.checkplayer.module_ready()}catch(Q){throw new r.Error("flCookie dependencies failed to load.")}},20000)},0);q.flCookie=function(B,af,S,ab){if(typeof B===m){if(B.length>0&&B.charAt(B.length-1)!=="/"){B+="/"}}else{B=b}if(typeof af!==m){af=b}if(typeof S!==p){S=function(){}}var R=++y,N,G=null,L,P="flCookieHideSwf",K=o,A=o,J=o,V=b,D,I=n.getElementsByTagName("body"),W=o,Y=null,F="flCookie_swf";var aa=function(){V=F+"_"+R;function ag(){c(L);try{x.detachEvent(f,ag)}catch(aj){}}try{x.attachEvent(f,ag)}catch(ah){}(function ai(){try{q.bindEvent(x,f,O)}catch(aj){L=s(arguments.callee,25);return}ag();L=s(X,1)})()}();function X(){if(Y===null){G=I[0]}else{G=q.getObjectById(Y)}try{G.nodeName.toLowerCase();q.checkplayer.module_ready();j=q.checkplayer}catch(ah){L=s(X,25);return}q.bindEvent(x,f,O);j=q.checkplayer;if((u===null)&&(typeof j._ins===w)){try{u=new j(_flcookie.MIN_PLAYER_VERSION,T,o,Z)}catch(ag){U(_flcookie.DEPENDENCY_ERROR,"flCookie: checkplayer Init Failed","The initialization of the 'checkplayer' library failed to complete.");return}}else{u=j._ins;ad()}}function ad(){if(K===null&&Y===null){q.createCSS("."+P,"left:-1px;top:0px;width:1px;height:1px;position:absolute;");K=v}var ak=n.createElement(t);ak.id=V;ak.className=P;G.appendChild(ak);G=null;var ah={},al={allowScriptAccess:"always"},ai={id:V,name:V,styleclass:P},aj={swfCB:M,swfEICheck:"setId"};try{u.DoSWF(B+g,V,"1","1",ah,al,ai,aj)}catch(ag){U(_flcookie.DEPENDENCY_ERROR,"flCookie: checkplayer Call Failed","A call to the 'checkplayer' library failed to complete.");return}}function T(ag){if(ag.checkPassed){ad()}else{if(!W){U(_flcookie.PLAYER_VERSION_ERROR,"flCookie: Insufficient Flash Player Version","The Flash Player was either not detected, or the detected version ("+ag.playerVersionDetected+") was not at least the minimum version ("+_flcookie.MIN_PLAYER_VERSION+") needed by the 'flCookie' library.")}else{u.UpdatePlayer()}}}function Z(ag){if(ag.updateStatus===j.UPDATE_CANCELED){U(_flcookie.PLAYER_VERSION_ERROR,"flCookie: Flash Player Update Canceled","The Flash Player was not updated.")}else{if(ag.updateStatus===j.UPDATE_FAILED){U(_flcookie.PLAYER_VERSION_ERROR,"flCookie: Flash Player Update Failed","The Flash Player was either not detected or could not be updated.")}}}function M(ag){if(ag.status!==j.SWF_EI_READY){return}ae();D=q.getObjectById(V);D.setId(V);D.doOnError=U;D.doOnReady=Q;D.initCookie(af)}function ac(ag){A=v;s(function(){try{S(N)}catch(ah){U(_flcookie.HANDLER_ERROR,"flCookie::readyCallback(): Error","An error occurred in the handler function. ("+ah.message+")");return}},0)}function O(){try{r.flensed.unbindEvent(x,f,O)}catch(aj){}try{for(var ai in N){if(N.hasOwnProperty(ai)){try{N[ai]=null}catch(ah){}}}}catch(am){}N=null;ae();if((typeof D!==w)&&(D!==null)){try{D.doOnError=null;doOnError=null}catch(al){}try{D.doOnReady=null;doOnReady=null}catch(ak){}D=null;try{r.swfobject.removeSWF(V)}catch(ag){}}S=null;ab=null}function Q(){if(!A&&!J){ac()}}function U(){ae();J=v;var aj;try{aj=new q.error(arguments[0],arguments[1],arguments[2],N)}catch(ak){function ah(){this.number=0;this.name="flCookie Error: Unknown";this.description="Unknown error from 'flCookie' library.";this.message=this.description;this.srcElement=N;var ao=this.number,an=this.name,aq=this.description;function ap(){return ao+", "+an+", "+aq}this.toString=ap}aj=new ah()}var al=o;try{if(typeof ab===p){ab(aj);al=v}}catch(ag){var ai=aj.toString();function am(){this.number=_flcookie.HANDLER_ERROR;this.name="flCookie::errorCallback(): Error";this.description="An error occured in the handler function. ("+ag.message+")\nPrevious:["+ai+"]";this.message=this.description;this.srcElement=N;var ao=this.number,an=this.name,aq=this.description;function ap(){return ao+", "+an+", "+aq}this.toString=ap}aj=new am()}if(!al){SETTIMEOUT(function(){q.throwUnhandledError(aj.toString())},1)}}function ae(){c(L);L=null}function E(ah){if(!J){if(typeof ah!==m||ah.length<1){return null}var ag=new Date().getTime(),ak,ai;try{ak=D.getValue(ah)}catch(aj){U(_flcookie.CALL_ERROR,"flCookie::getValue(): Failed","The getValue() call failed to complete.");return null}if(ak!==null){ak=ak.match(/^([^\;]+);(.*)/m);if(ak.length!==3||(ak[1]!=="."&&ag>=e(ak[1]))){H(ah);return null}return ak[2]}else{return null}}else{return null}}function C(ah,aj,ag){if(!J){if(typeof ah!==m||ah.length<1||typeof aj!==m||aj.length<1){return null}if(typeof ag!==w){if(typeof ag!==m){ag=b+ag}if(ag!=="."&&ag.match(/[^0-9]/g)){ag=Date.parse(ag)}else{if(ag===b){ag="."}}}else{ag="."}try{return D.setValue(ah,ag+";"+aj)}catch(ai){U(_flcookie.IO_ERROR,"flCookie::setValue(): Failed","The setValue() call failed to complete.");return o}}else{return o}}function H(ag){if(!J){if(typeof ag!==m||ag.length<1){return o}try{return D.deleteValue(ag)}catch(ah){U(_flcookie.IO_ERROR,"flCookie::deleteValue(): Failed","The deleteValue() call failed to complete.");return o}}else{return o}}N={instanceId:V,ready:function(){return A},getValue:E,setValue:C,deleteValue:H,Destroy:O};return N};_flcookie=q.flCookie;_flcookie.HANDLER_ERROR=10;_flcookie.CALL_ERROR=11;_flcookie.DEPENDENCY_ERROR=13;_flcookie.PLAYER_VERSION_ERROR=14;_flcookie.SECURITY_ERROR=15;_flcookie.IO_ERROR=16;_flcookie.MIN_PLAYER_VERSION="9";_flcookie.module_ready=function(){}})(window);