var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x;}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;}var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0])){parent=properties.shift();}function klass(){this.initialize.apply(this,arguments);}Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}for(var i=0;i<properties.length;i++){klass.addMethods(properties[i]);}if(!klass.prototype.initialize){klass.prototype.initialize=Prototype.emptyFunction;}klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length){properties.push("toString","valueOf");}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value,value=Object.extend((function(m){return function(){return ancestor[m].apply(this,arguments);};})(property).wrap(method),{valueOf:function(){return method;},toString:function(){return method.toString();}});}this.prototype[property]=value;}return this;}};var Abstract={};Object.extend=function(destination,source){for(var property in source){destination[property]=source[property];}return destination;};Object.extend(Object,{inspect:function(object){try{if(Object.isUndefined(object)){return"undefined";}if(object===null){return"null";}return object.inspect?object.inspect():String(object);}catch(e){if(e instanceof RangeError){return"...";}throw e;}},toJSON:function(object){var type=typeof object;switch(type){case"undefined":case"function":case"unknown":return ;case"boolean":return object.toString();}if(object===null){return"null";}if(object.toJSON){return object.toJSON();}if(Object.isElement(object)){return ;}var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(!Object.isUndefined(value)){results.push(property.toJSON()+": "+value);}}return"{"+results.join(", ")+"}";},toQueryString:function(object){return $H(object).toQueryString();},toHTML:function(object){return object&&object.toHTML?object.toHTML():StringClassMethods.interpret(object);},keys:function(object){var keys=[];for(var property in object){keys.push(property);}return keys;},values:function(object){var values=[];for(var property in object){values.push(object[property]);}return values;},clone:function(object){return Object.extend({},object);},isElement:function(object){return object&&object.nodeType==1;},isArray:function(object){return object!=null&&typeof object=="object"&&"splice" in object&&"join" in object;},isHash:function(object){return object instanceof Hash;},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return names.length==1&&!names[0]?[]:names;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this;}var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));};},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));};},curry:function(){if(!arguments.length){return this;}var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)));};},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args);},timeout);},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)));};},methodize:function(){if(this._methodized){return this._methodized;}var __method=this;return this._methodized=function(){return __method.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"';};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}return returnValue;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer){return ;}clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();}finally{this.currentlyExecuting=false;}}}});StringClassMethods={interpret:function(value){return value==null?"":String(value);},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}};Object.extend(String,StringClassMethods);Object.extend(String.prototype,{gsub:function(pattern,replacement){var result="",source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=StringClassMethods.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source="";}}return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0];}return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this);},truncate:function(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this);},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=new Element("div");div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){return memo+node.nodeValue;}):div.childNodes[0].nodeValue):"";},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{};}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value);}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]];}hash[key].push(value);}else{hash[key]=value;}}return hash;});},toArray:function(){return this.split("");},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(count){return count<1?"":new Array(count+1).join(this);},camelize:function(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0];}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);}return camelized;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();},dasherize:function(){return this.gsub(/_/,"-");},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:"\\u00"+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"';}return"'"+escapedString.replace(/'/g,"\\'")+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,"#{1}");},isJSON:function(){var str=this;if(str.blank()){return false;}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")");}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());},include:function(pattern){return this.indexOf(pattern)>-1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=="";},blank:function(){return/^\s*$/.test(this);},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");}});}String.prototype.gsub.prepareReplacement=function(replacement){if(Object.isFunction(replacement)){return replacement;}var template=new Template(replacement);return function(match){return template.evaluate(match);};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text);}var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements)){object=object.toTemplateReplacements();}return this.template.gsub(this.pattern,function(match){if(object==null){return"";}var before=match[1]||"";if(before=="\\"){return match[2];}var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null){return before;}while(match!=null){var comp=match[1].startsWith("[")?match[2].gsub("\\\\]","]"):match[1];ctx=ctx[comp];if(null==ctx||""==match[3]){break;}expr=expr.substring("["==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}return before+StringClassMethods.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;iterator=iterator.bind(context);try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break){throw e;}}return this;},eachSlice:function(number,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length){slices.push(array.slice(index,index+number));}return slices.collect(iterator,context);},all:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator(value,index);if(!result){throw $break;}});return result;},any:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator(value,index)){throw $break;}});return result;},collect:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator,context){iterator=iterator.bind(context);var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(iterator(value,index)){results.push(value);}});return results;},grep:function(filter,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];if(Object.isString(filter)){filter=new RegExp(filter);}this.each(function(value,index){if(filter.match(value)){results.push(iterator(value,index));}});return results;},include:function(object){if(Object.isFunction(this.indexOf)){if(this.indexOf(object)!=-1){return true;}}var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number){slice.push(fillWith);}return slice;});},inject:function(memo,iterator,context){iterator=iterator.bind(context);this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value>=result){result=value;}});return result;},min:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value<result){result=value;}});return result;},partition:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value){results.push(value[property]);});return results;},reject:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(!iterator(value,index)){results.push(value);}});return results;},sortBy:function(iterator,context){iterator=iterator.bind(context);return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck("value");},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last())){iterator=args.pop();}var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(iterable){if(!iterable){return[];}if(iterable.toArray){return iterable.toArray();}var length=iterable.length||0,results=new Array(length);while(length--){results[length]=iterable[length];}return results;}if(Prototype.Browser.WebKit){$A=function(iterable){if(!iterable){return[];}if(!(Object.isFunction(iterable)&&iterable=="[object NodeList]")&&iterable.toArray){return iterable.toArray();}var length=iterable.length||0,results=new Array(length);while(length--){results[length]=iterable[length];}return results;};}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++){iterator(this[i]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return !values.include(value);});},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value))){array.push(value);}return array;});},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value;});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value)){results.push(value);}});return"["+results.join(", ")+"]";}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach;}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0){i=length+i;}for(;i<length;i++){if(this[i]===item){return i;}}return -1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;};}Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string)){return[];}string=string.strip();return string?string.split(/\s+/):[];}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++){array.push(this[i]);}for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){array.push(arguments[i][j]);}}else{array.push(arguments[i]);}}return array;};}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return"0".times(length-string.length)+string;},toJSON:function(){return isFinite(this)?this.toString():"null";}});$w("abs round ceil floor").each(function(method){Number.prototype[method]=Math[method].methodize();});function $H(object){return new Hash(object);}var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,value){if(Object.isUndefined(value)){return key;}return key+"="+encodeURIComponent(StringClassMethods.interpret(value));}return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);},_each:function(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},set:function(key,value){return this._object[key]=value;},get:function(key){return this._object[key];},unset:function(key){var value=this._object[key];delete this._object[key];return value;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},index:function(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;},merge:function(object){return this.clone().update(object);},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=="object"){if(Object.isArray(values)){return values.map(toQueryPair.curry(key)).join("&");}}return toQueryPair(key,values);}).join("&");},inspect:function(){return"#<Hash:{"+this.map(function(pair){return pair.map(Object.inspect).join(": ");}).join(", ")+"}>";},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}};})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start){return false;}if(this.exclusive){return value<this.end;}return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder)){this.responders.push(responder);}},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=Class.create({initialize:function(options){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams();}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject();}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){params._method=this.method;this.method="post";}this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+params;}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){params+="&_=";}}}try{var response=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(response);}Ajax.Responders.dispatch("onCreate",this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1);}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();}}catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var headers={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){headers["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){headers.Connection="close";}}if(typeof this.options.requestHeaders=="object"){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push)){for(var i=0,length=extras.length;i<length;i+=2){headers[extras[i]]=extras[i+1];}}else{$H(extras).each(function(pair){headers[pair.key]=pair.value;});}}for(var name in headers){this.transport.setRequestHeader(name,headers[name]);}},success:function(){var status=this.getStatus();return !status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0;}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=="Complete"){try{this._complete=true;(this.options["on"+response.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}var contentType=response.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse();}}try{(this.options["on"+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch("on"+state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}if(state=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return !m||(m[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch("onException",this,exception);}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=StringClassMethods.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"";}catch(e){return"";}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null;}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader("X-JSON");if(!json){return null;}json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null;}try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete)){onComplete(response,json);}}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?"success":"failure"],options=this.options;if(!options.evalScripts){responseText=responseText.stripScripts();}if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}else{options.insertion(receiver,responseText);}}else{receiver.update(responseText);}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText;}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++){elements.push($(arguments[i]));}return elements;}if(Object.isString(element)){element=document.getElementById(element);}return Element.extend(element);}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++){results.push(Element.extend(query.snapshotItem(i)));}return results;};}if(!window.Node){var Node={};}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}(function(){var element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName="<"+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}if(!cache[tagName]){cache[tagName]=Element.extend(document.createElement(tagName));}return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(this.Element,element||{});}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!="none";},toggle:function(element){element=$(element);Element[Element.visible(element)?"hide":"show"](element);return element;},hide:function(element){$(element).style.display="none";return element;},show:function(element){$(element).style.display="";return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement();}if(Object.isElement(content)){return element.update().insert(content);}content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;},replace:function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement();}else{if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}}element.parentNode.replaceChild(content,element);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML))){insertions={bottom:insertions};}var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement){content=content.toElement();}if(Object.isElement(content)){insert(element,content);continue;}content=Object.toHTML(content);tagName=((position=="before"||position=="after")?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=="top"||position=="after"){childNodes.reverse();}childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer();}return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper)){$(wrapper).writeAttribute(attributes||{});}else{if(Object.isString(wrapper)){wrapper=new Element(wrapper,attributes);}else{wrapper=new Element("div",wrapper);}}if(element.parentNode){element.parentNode.replaceChild(wrapper,element);}wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result="<"+element.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||"").toString();if(value){result+=" "+attribute+"="+value.inspect(true);}});return result+">";},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property]){if(element.nodeType==1){elements.push(Element.extend(element));}}return elements;},ancestors:function(element){return $(element).recursivelyCollect("parentNode");},descendants:function(element){return $(element).select("*");},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1){element=element.nextSibling;}return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild)){return[];}while(element&&element.nodeType!=1){element=element.nextSibling;}if(element){return[element].concat($(element).nextSiblings());}return[];},previousSiblings:function(element){return $(element).recursivelyCollect("previousSibling");},nextSiblings:function(element){return $(element).recursivelyCollect("nextSibling");},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(Object.isString(selector)){selector=new Selector(selector);}return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1){return $(element.parentNode);}var ancestors=element.ancestors();return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index);},down:function(element,expression,index){element=$(element);if(arguments.length==1){return element.firstDescendant();}return Object.isNumber(expression)?element.descendants()[expression]:element.select(expression)[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(element));}var previousSiblings=element.previousSiblings();return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index);},next:function(element,expression,index){element=$(element);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(element));}var nextSiblings=element.nextSiblings();return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index);},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=element.readAttribute("id"),self=arguments.callee;if(id){return id;}do{id="anonymous_element_"+self.counter++;}while($(id));element.writeAttribute("id",id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name]){return t.values[name](element,name);}if(t.names[name]){name=t.names[name];}if(name.include(":")){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=="object"){attributes=name;}else{attributes[name]=Object.isUndefined(value)?true:value;}for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr]){name=t.values[attr](element,value);}if(value===false||value===null){element.removeAttribute(name);}else{if(value===true){element.setAttribute(name,name);}else{element.setAttribute(name,value);}}}return element;},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element))){return ;}var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element))){return ;}if(!element.hasClassName(className)){element.className+=(element.className?" ":"")+className;}return element;},removeClassName:function(element,className){if(!(element=$(element))){return ;}element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)")," ").strip();return element;},toggleClassName:function(element,className){if(!(element=$(element))){return ;}return element[element.hasClassName(className)?"removeClassName":"addClassName"](className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue)){element.removeChild(node);}node=nextNode;}return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);var originalAncestor=ancestor;if(element.compareDocumentPosition){return(element.compareDocumentPosition(ancestor)&8)===8;}if(element.sourceIndex&&!Prototype.Browser.Opera){var e=element.sourceIndex,a=ancestor.sourceIndex,nextAncestor=ancestor.nextSibling;if(!nextAncestor){do{ancestor=ancestor.parentNode;}while(!(nextAncestor=ancestor.nextSibling)&&ancestor.parentNode);}if(nextAncestor&&nextAncestor.sourceIndex){return(e>a&&e<nextAncestor.sourceIndex);}}while(element=element.parentNode){if(element==originalAncestor){return true;}}return false;},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=="float"?"cssFloat":style.camelize();var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}if(style=="opacity"){return value?parseFloat(value):1;}return value=="auto"?null:value;},getOpacity:function(element){return $(element).getStyle("opacity");},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=";"+styles;return styles.include("opacity")?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}for(var property in styles){if(property=="opacity"){element.setOpacity(styles[property]);}else{elementStyle[(property=="float"||property=="cssFloat")?(Object.isUndefined(elementStyle.styleFloat)?"cssFloat":"styleFloat"):property]=styles[property];}}return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==="")?"":(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=$(element).getStyle("display");if(display!="none"&&display!=null){return{width:element.offsetWidth,height:element.offsetHeight};}var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility="hidden";els.position="absolute";els.display="block";var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,"position");if(pos=="static"||!pos){element._madePositioned=true;element.style.position="relative";if(window.opera){element.style.top=0;element.style.left=0;}}return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right="";}return element;},makeClipping:function(element){element=$(element);if(element._overflow){return element;}element._overflow=Element.getStyle(element,"overflow")||"auto";if(element._overflow!=="hidden"){element.style.overflow="hidden";}return element;},undoClipping:function(element){element=$(element);if(!element._overflow){return element;}element.style.overflow=element._overflow=="auto"?"":element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=="BODY"){break;}var p=Element.getStyle(element,"position");if(p!=="static"){break;}}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(element.getStyle("position")=="absolute"){return ;}var offsets=element.positionedOffset();var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position="absolute";element.style.top=top+"px";element.style.left=left+"px";element.style.width=width+"px";element.style.height=height+"px";return element;},relativize:function(element){element=$(element);if(element.getStyle("position")=="relative"){return ;}element.style.position="relative";var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+"px";element.style.left=left+"px";element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent){return $(element.offsetParent);}if(element==document.body){return $(element);}while((element=element.parentNode)&&element!=document.body){if(Element.getStyle(element,"position")!="static"){return $(element);}}return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,"position")=="absolute"){break;}}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||element.tagName=="BODY"){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,"position")=="absolute"){parent=element.getOffsetParent();delta=parent.viewportOffset();}if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}if(options.setLeft){element.style.left=(p[0]-delta[0]+options.offsetLeft)+"px";}if(options.setTop){element.style.top=(p[1]-delta[1]+options.offsetTop)+"px";}if(options.setWidth){element.style.width=source.offsetWidth+"px";}if(options.setHeight){element.style.height=source.offsetHeight+"px";}return element;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(proceed,element,style){switch(style){case"left":case"top":case"right":case"bottom":if(proceed(element,"position")==="static"){return null;}case"height":case"width":if(!Element.visible(element)){return null;}var dim=parseInt(proceed(element,style),10);if(dim!==element["offset"+style.capitalize()]){return dim+"px";}var properties;if(style==="height"){properties=["border-top-width","padding-top","padding-bottom","border-bottom-width"];}else{properties=["border-left-width","padding-left","padding-right","border-right-width"];}return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo-parseInt(val,10);})+"px";default:return proceed(element,style);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==="title"){return element.title;}return proceed(element,attribute);});}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);var position=element.getStyle("position");if(position!=="static"){return proceed(element);}element.setStyle({position:"relative"});var value=proceed(element);element.setStyle({position:position});return value;});$w("positionedOffset viewportOffset").each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);var position=element.getStyle("position");if(position!=="static"){return proceed(element);}var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle("position")==="fixed"){offsetParent.setStyle({zoom:1});}element.setStyle({position:"relative"});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=="float"||style=="cssFloat")?"styleFloat":style.camelize();var value=element.style[style];if(!value&&element.currentStyle){value=element.currentStyle[style];}if(style=="opacity"){if(value=(element.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(value[1]){return parseFloat(value[1])/100;}}return 1;}if(value=="auto"){if((style=="width"||style=="height")&&(element.getStyle("display")!="none")){return element["offset"+style.capitalize()]+"px";}return null;}return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,"");}element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=="normal")){element.style.zoom=1;}var filter=element.getStyle("filter"),style=element.style;if(value==1||value===""){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute("filter");return element;}else{if(value<0.00001){value=0;}}style.filter=stripAlpha(filter)+"alpha(opacity="+(value*100)+")";return element;};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:function(element,attribute){attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23,-2):null;},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:"";}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==="")?"":(value<0.00001)?0:value;return element;};}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==="")?"":(value<0.00001)?0:value;if(value==1){if(element.tagName=="IMG"&&element.width){element.width++;element.width--;}else{try{var n=document.createTextNode(" ");element.appendChild(n);element.removeChild(n);}catch(e){}}}return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body){if(Element.getStyle(element,"position")=="absolute"){break;}}element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement();}if(Object.isElement(content)){return element.update().insert(content);}content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node);});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node);});}else{element.innerHTML=content.stripScripts();}content.evalScripts.bind(content).defer();return element;};}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement();}if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling){fragments.each(function(node){parent.insertBefore(node,nextSibling);});}else{fragments.each(function(node){parent.appendChild(node);});}}else{element.outerHTML=content.stripScripts();}content.evalScripts.bind(content).defer();return element;};}Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element("div"),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild;});}else{div.innerHTML=html;}return $A(div.childNodes);};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element);},top:function(element,node){element.insertBefore(node,element.firstChild);},bottom:function(element,node){element.appendChild(node);},after:function(element,node){element.parentNode.insertBefore(node,element.nextSibling);},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K;}var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window){return element;}var methods=Object.clone(Methods),tagName=element.tagName,property,value;if(ByTag[tagName]){Object.extend(methods,ByTag[tagName]);}for(property in methods){value=methods[property];if(Object.isFunction(value)&&!(property in element)){element[property]=value.methodize();}}element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute){return element.hasAttribute(attribute);}return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)});}if(arguments.length==2){var tagName=methods;methods=arguments[1];}if(!tagName){Object.extend(Element.Methods,methods||{});}else{if(Object.isArray(tagName)){tagName.each(extend);}else{extend(tagName);}}function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName]){Element.Methods.ByTag[tagName]={};}Object.extend(Element.Methods.ByTag[tagName],methods);}function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value)){continue;}if(!onlyIfAbsent||!(property in destination)){destination[property]=value.methodize();}}}function findDOMClass(tagName){var klass;var trans={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(trans[tagName]){klass="HTML"+trans[tagName]+"Element";}if(window[klass]){return window[klass];}klass="HTML"+tagName+"Element";if(window[klass]){return window[klass];}klass="HTML"+tagName.capitalize()+"Element";if(window[klass]){return window[klass];}window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass)){continue;}copy(T[tag],klass.prototype);}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh();}Element.cache={};};document.viewport={getDimensions:function(){var dimensions={};var B=Prototype.Browser;$w("width height").each(function(d){var D=d.capitalize();dimensions[d]=(B.WebKit&&!document.evaluate)?self["inner"+D]:(B.Opera)?document.body["client"+D]:document.documentElement["client"+D];});return dimensions;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();this.compileMatcher();},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false;}var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty"))){return false;}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false;}return true;},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher();}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return ;}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return ;}this.matcher=[".//*"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath){return document._getElementsByXPath(this.xpath,root);}return this.matcher(root);},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],"");}else{return this.findElements(document).include(element);}}}}var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}return match;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(m){if(m[1]=="*"){return"";}return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h){return"";}if(Object.isFunction(h)){return h(m);}return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],"");break;}}}return"[not("+exclusion.join(" and ")+")]";},"nth-child":function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},"nth-last-child":function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},"nth-of-type":function(m){return Selector.xpath.pseudos.nth("position() ",m);},"nth-last-of-type":function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},"first-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-of-type"](m);},"last-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](m);},"only-of-type":function(m){var p=Selector.xpath.pseudos;return p["first-of-type"](m)+p["last-of-type"](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=="even"){formula="2n+0";}if(formula=="odd"){formula="2n+1";}if(mm=formula.match(/^(\d+)$/)){return"["+fragment+"= "+mm[1]+"]";}if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-"){mm[1]=-1;}var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);},pseudo:function(m){if(m[6]){m[6]=m[6].replace(/"/g,'\\"');}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++){a.push(node);}return a;},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++){node._countedByPrototype=_true;}return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++){node._countedByPrototype=undefined;}return nodes;},index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype)){node.nodeIndex=j++;}}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++){if(node.nodeType==1&&(!ofType||node._countedByPrototype)){node.nodeIndex=j++;}}}},unique:function(nodes){if(nodes.length==0){return nodes;}var results=[],n;for(var i=0,l=nodes.length;i<l;i++){if(!(n=nodes[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n));}}return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){h.concat(results,node.getElementsByTagName("*"));}return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++){if(child.nodeType==1&&child.tagName!="!"){results.push(child);}}}return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next){results.push(next);}}return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){h.concat(results,Element.nextSiblings(node));}return results;},nextElementSibling:function(node){while(node=node.nextSibling){if(node.nodeType==1){return node;}}return null;},previousElementSibling:function(node){while(node=node.previousSibling){if(node.nodeType==1){return node;}}return null;},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++){h.concat(results,node.getElementsByTagName(tagName));}return results;}else{nodes=this[combinator](nodes);}if(tagName=="*"){return nodes;}}for(var i=0,node;node=nodes[i];i++){if(node.tagName.toUpperCase()===uTagName){results.push(node);}}return results;}else{return root.getElementsByTagName(tagName);}},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode){return[];}if(!nodes&&root==document){return[targetNode];}if(nodes){if(combinator){if(combinator=="child"){for(var i=0,node;node=nodes[i];i++){if(targetNode.parentNode==node){return[targetNode];}}}else{if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++){if(Element.descendantOf(targetNode,node)){return[targetNode];}}}else{if(combinator=="adjacent"){for(var i=0,node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(targetNode)==node){return[targetNode];}}}else{nodes=h[combinator](nodes);}}}}for(var i=0,node;node=nodes[i];i++){if(node==targetNode){return[targetNode];}}return[];}return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator){nodes=this[combinator](nodes);}return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes){nodes=Selector.handlers.descendant([root]);}var needle=" "+className+" ";for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0){continue;}if(nodeClassName==className||(" "+nodeClassName+" ").include(needle)){results.push(node);}}return results;},attrPresence:function(nodes,root,attr,combinator){if(!nodes){nodes=root.getElementsByTagName("*");}if(nodes&&combinator){nodes=this[combinator](nodes);}var results=[];for(var i=0,node;node=nodes[i];i++){if(Element.hasAttribute(node,attr)){results.push(node);}}return results;},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes){nodes=root.getElementsByTagName("*");}if(nodes&&combinator){nodes=this[combinator](nodes);}var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null){continue;}if(handler(nodeValue,value)){results.push(node);}}return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator){nodes=this[combinator](nodes);}if(!nodes){nodes=root.getElementsByTagName("*");}return Selector.pseudos[name](nodes,value,root);}},pseudos:{"first-child":function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node)){continue;}results.push(node);}return results;},"last-child":function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node)){continue;}results.push(node);}return results;},"only-child":function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){if(!h.previousElementSibling(node)&&!h.nextElementSibling(node)){results.push(node);}}return results;},"nth-child":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},"nth-last-child":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},"nth-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},"nth-last-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},"first-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},"last-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},"only-of-type":function(nodes,formula,root){var p=Selector.pseudos;return p["last-of-type"](p["first-of-type"](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0){return b>0?[b]:[];}return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0){memo.push(i);}return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0){return[];}if(formula=="even"){formula="2n+0";}if(formula=="odd"){formula="2n+1";}var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++){if(node.nodeIndex==formula){results.push(node);}}}else{if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-"){m[1]=-1;}var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++){if(node.nodeIndex==indices[j]){results.push(node);}}}}}h.unmark(nodes);h.unmark(indexed);return results;},empty:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=="!"||(node.firstChild&&!node.innerHTML.match(/^\s*$/))){continue;}results.push(node);}return results;},not:function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++){if(!node._countedByPrototype){results.push(node);}}h.unmark(exclusions);return results;},enabled:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(!node.disabled){results.push(node);}}return results;},disabled:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.disabled){results.push(node);}}return results;},checked:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.checked){results.push(node);}}return results;}},operators:{"=":function(nv,v){return nv==v;},"!=":function(nv,v){return nv!=v;},"^=":function(nv,v){return nv.startsWith(v);},"$=":function(nv,v){return nv.endsWith(v);},"*=":function(nv,v){return nv.include(v);},"~=":function(nv,v){return(" "+nv+" ").include(" "+v+" ");},"|=":function(nv,v){return("-"+nv.toUpperCase()+"-").include("-"+v.toUpperCase()+"-");}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});return expressions;},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++){if(element._countedByPrototype){results.push(element);}}h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}return Selector.matchElements(elements,expression||"*")[index||0];},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(","));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}return(l>1)?h.unique(results):results;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++){if(node.tagName!=="!"){a.push(node);}}return a;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++){node.removeAttribute("_countedByPrototype");}return nodes;}});}function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,options){if(typeof options!="object"){options={hash:!!options};}else{if(Object.isUndefined(options.hash)){options.hash=true;}}var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&(element.type!="submit"||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key])){result[key]=[result[key]];}result[key].push(value);}else{result[key]=value;}}}return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){return $A($(form).getElementsByTagName("*")).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()]){elements.push(Element.extend(child));}return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName("input");if(!typeName&&!name){return $A(inputs).map(Element.extend);}for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name)){continue;}matchingInputs.push(Element.extend(input));}return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke("disable");return form;},enable:function(form){form=$(form);Form.getElements(form).invoke("enable");return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return"hidden"!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute("tabIndex")&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex;}).first();return firstByIndex?firstByIndex:elements.find(function(element){return["input","select","textarea"].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute("action")||"";if(action.blank()){action=window.location.href;}options.parameters=form.serialize(true);if(params){if(Object.isString(params)){params=params.toQueryParams();}Object.extend(options.parameters,params);}if(form.hasAttribute("method")&&!options.method){options.method=form.method;}return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}return"";},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value="";return element;},present:function(element){return $(element).value!="";},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(element.type))){element.select();}}catch(e){}return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(Object.isUndefined(value)){return element.checked?element.value:null;}else{element.checked=!!value;}},textarea:function(element,value){if(Object.isUndefined(value)){return element.value;}else{element.value=value;}},select:function(element,index){if(Object.isUndefined(index)){return this[element.type=="select-one"?"selectOne":"selectMany"](element);}else{var opt,value,single=!Object.isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return ;}}else{opt.selected=index.include(value);}}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length){return null;}for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected){values.push(this.optionValue(opt));}}return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case"checkbox":case"radio":Event.observe(element,"click",this.onElementEvent.bind(this));break;default:Event.observe(element,"change",this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event={};}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(event){var element;switch(event.type){case"mouseover":element=event.fromElement;break;case"mouseout":element=event.toElement;break;default:return null;}return Element.extend(element);}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code];};}else{if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code);};}}return{isLeftClick:function(event){return isButton(event,0);},isMiddleClick:function(event){return isButton(event,1);},isRightClick:function(event){return isButton(event,2);},element:function(event){var node=Event.extend(event).target;return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);},findElement:function(event,expression){var element=Event.element(event);if(!expression){return element;}var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0);},pointer:function(event){return{x:event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(event){return Event.pointer(event).x;},pointerY:function(event){return Event.pointer(event).y;},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}};})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.returnValue=false;},inspect:function(){return"[object Event]";}});return function(event){if(!event){return false;}if(event._extendedByPrototype){return event;}event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,methods);return Prototype.K;}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._prototypeEventID){return element._prototypeEventID[0];}arguments.callee.id=arguments.callee.id||1;return element._prototypeEventID=[++arguments.callee.id];}function getDOMEventName(eventName){if(eventName&&eventName.include(":")){return"dataavailable";}return eventName;}function getCacheForID(id){return cache[id]=cache[id]||{};}function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[];}function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler)){return false;}var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName)){return false;}Event.extend(event);handler.call(element,event);};wrapper.handler=handler;c.push(wrapper);return wrapper;}function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler;});}function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName]){return false;}c[eventName]=c[eventName].without(findWrapper(id,eventName,handler));}function destroyCache(){for(var id in cache){for(var eventName in cache[id]){cache[id][eventName]=null;}}}if(window.attachEvent){window.attachEvent("onunload",destroyCache);}return{observe:function(element,eventName,handler){element=$(element);var name=getDOMEventName(eventName);if(eventName=="dom:loaded"&&document.loaded){handler();return ;}var wrapper=createWrapper(element,eventName,handler);if(!wrapper){return element;}if(element.addEventListener){element.addEventListener(name,wrapper,false);}else{element.attachEvent("on"+name,wrapper);}return element;},stopObserving:function(element,eventName,handler){element=$(element);var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler);});return element;}else{if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName);});return element;}}var wrapper=findWrapper(id,eventName,handler);if(!wrapper){return element;}if(element.removeEventListener){element.removeEventListener(name,wrapper,false);}else{element.detachEvent("on"+name,wrapper);}destroyWrapper(id,eventName,handler);return element;},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent){element=document.documentElement;}var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true);}else{event=document.createEventObject();event.eventType="ondataavailable";}event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event);}else{element.fireEvent(event.eventType,event);}return Event.extend(event);}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var timer;function fireContentLoadedEvent(){if(document.loaded){return ;}if(timer){window.clearInterval(timer);}document.fire("dom:loaded");document.loaded=true;}if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){fireContentLoadedEvent();}},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(element,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(element,x,y);}this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode){return 0;}if(mode=="vertical"){return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;}if(mode=="horizontal"){return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName){document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";}instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(""):iter(className);return cond?document._getElementsByXPath(".//*"+cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className){return elements;}var nodes=$(element).getElementsByTagName("*");className=" "+className+" ";for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=" "+child.className+" ")&&(cn.include(className)||(classNames&&classNames.all(function(name){return !name.toString().blank()&&cn.include(" "+name+" ");})))){elements.push(Element.extend(child));}}return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd)){return ;}this.set($A(this).concat(classNameToAdd).join(" "));},remove:function(classNameToRemove){if(!this.include(classNameToRemove)){return ;}this.set($A(this).without(classNameToRemove).join(" "));},toString:function(){return $A(this).join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();var Scriptaculous={Version:"1.8.1",require:function(libraryName){document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');},REQUIRED_PROTOTYPE:"1.6.0",load:function(){function convertVersionString(versionString){var r=versionString.split(".");return parseInt(r[0])*100000+parseInt(r[1])*1000+parseInt(r[2]);}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(convertVersionString(Prototype.Version)<convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE);}}};Scriptaculous.load();var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(elementName){elementName=elementName.toUpperCase();var parentTag=this.NODEMAP[elementName]||"div";var parentElement=document.createElement(parentTag);try{parentElement.innerHTML="<"+elementName+"></"+elementName+">";}catch(e){}var element=parentElement.firstChild||null;if(element&&(element.tagName.toUpperCase()!=elementName)){element=element.getElementsByTagName(elementName)[0];}if(!element){element=document.createElement(elementName);}if(!element){return ;}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(element,arguments[1]);}else{var attrs=this._attributes(arguments[1]);if(attrs.length){try{parentElement.innerHTML="<"+elementName+" "+attrs+"></"+elementName+">";}catch(e){}element=parentElement.firstChild||null;if(!element){element=document.createElement(elementName);for(attr in arguments[1]){element[attr=="class"?"className":attr]=arguments[1][attr];}}if(element.tagName.toUpperCase()!=elementName){element=parentElement.getElementsByTagName(elementName)[0];}}}}if(arguments[2]){this._children(element,arguments[2]);}return element;},_text:function(text){return document.createTextNode(text);},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(attributes){var attrs=[];for(attribute in attributes){attrs.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+attributes[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"');}return attrs.join(" ");},_children:function(element,children){if(children.tagName){element.appendChild(children);return ;}if(typeof children=="object"){children.flatten().each(function(e){if(typeof e=="object"){element.appendChild(e);}else{if(Builder._isStringOrNumber(e)){element.appendChild(Builder._text(e));}}});}else{if(Builder._isStringOrNumber(children)){element.appendChild(Builder._text(children));}}},_isStringOrNumber:function(param){return(typeof param=="string"||typeof param=="number");},build:function(html){var element=this.node("div");$(element).update(html.strip());return element.down();},dump:function(scope){if(typeof scope!="object"&&typeof scope!="function"){scope=window;}var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);tags.each(function(tag){scope[tag]=function(){return Builder.node.apply(Builder,[tag].concat($A(arguments)));};});}};String.prototype.parseColor=function(){var color="#";if(this.slice(0,4)=="rgb("){var cols=this.slice(4,this.length-1).split(",");var i=0;do{color+=parseInt(cols[i]).toColorPart();}while(++i<3);}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var i=1;i<4;i++){color+=(this.charAt(i)+this.charAt(i)).toLowerCase();}}if(this.length==7){color=this.toLowerCase();}}}return(color.length==7?color:(arguments[0]||this));};Element.collectTextNodes=function(element){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));}).flatten().join("");};Element.collectTextNodesIgnoreClass=function(element,className){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,className))?Element.collectTextNodesIgnoreClass(node,className):""));}).flatten().join("");};Element.setContentZoom=function(element,percent){element=$(element);element.setStyle({fontSize:(percent/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0);}return element;};Element.getInlineOpacity=function(element){return $(element).style.opacity||"";};Element.forceRerendering=function(element){try{element=$(element);var n=document.createTextNode(" ");element.appendChild(n);element.removeChild(n);}catch(e){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(pos){return(-Math.cos(pos*Math.PI)/2)+0.5;},reverse:function(pos){return 1-pos;},flicker:function(pos){var pos=((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;return pos>1?1:pos;},wobble:function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;},pulse:function(pos,pulses){pulses=pulses||5;return(((pos%(1/pulses))*pulses).round()==0?((pos*pulses*2)-(pos*pulses*2).floor()):1-((pos*pulses*2)-(pos*pulses*2).floor()));},spring:function(pos){return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6));},none:function(pos){return 0;},full:function(pos){return 1;}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(element){var tagifyStyle="position:relative";if(Prototype.Browser.IE){tagifyStyle+=";zoom:1";}element=$(element);$A(element.childNodes).each(function(child){if(child.nodeType==3){child.nodeValue.toArray().each(function(character){element.insertBefore(new Element("span",{style:tagifyStyle}).update(character==" "?String.fromCharCode(160):character),child);});Element.remove(child);}});},multiple:function(element,effect){var elements;if(((typeof element=="object")||Object.isFunction(element))&&(element.length)){elements=element;}else{elements=$(element).childNodes;}var options=Object.extend({speed:0.1,delay:0},arguments[2]||{});var masterDelay=options.delay;$A(elements).each(function(element,index){new effect(element,Object.extend(options,{delay:index*options.speed+masterDelay}));});},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(element,effect){element=$(element);effect=(effect||"appear").toLowerCase();var options=Object.extend({queue:{position:"end",scope:(element.id||"global"),limit:1}},arguments[2]||{});Effect[element.visible()?Effect.PAIRS[effect][1]:Effect.PAIRS[effect][0]](element,options);}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null;},_each:function(iterator){this.effects._each(iterator);},add:function(effect){var timestamp=new Date().getTime();var position=Object.isString(effect.options.queue)?effect.options.queue:effect.options.queue.position;switch(position){case"front":this.effects.findAll(function(e){return e.state=="idle";}).each(function(e){e.startOn+=effect.finishOn;e.finishOn+=effect.finishOn;});break;case"with-last":timestamp=this.effects.pluck("startOn").max()||timestamp;break;case"end":timestamp=this.effects.pluck("finishOn").max()||timestamp;break;}effect.startOn+=timestamp;effect.finishOn+=timestamp;if(!effect.options.queue.limit||(this.effects.length<effect.options.queue.limit)){this.effects.push(effect);}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15);}},remove:function(effect){this.effects=this.effects.reject(function(e){return e==effect;});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var timePos=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++){this.effects[i]&&this.effects[i].loop(timePos);}}});Effect.Queues={instances:$H(),get:function(queueName){if(!Object.isString(queueName)){return queueName;}return this.instances.get(queueName)||this.instances.set(queueName,new Effect.ScopedQueue());}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""));}if(options&&options.transition===false){options.transition=Effect.Transitions.linear;}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this);}},loop:function(timePos){if(timePos>=this.startOn){if(timePos>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish();}this.event("afterFinish");return ;}var pos=(timePos-this.startOn)/this.totalTime,frame=(pos*this.totalFrames).round();if(frame>this.currentFrame){this.render(pos);this.currentFrame=frame;}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this);}this.state="finished";},event:function(eventName){if(this.options[eventName+"Internal"]){this.options[eventName+"Internal"](this);}if(this.options[eventName]){this.options[eventName](this);}},inspect:function(){var data=$H();for(property in this){if(!Object.isFunction(this[property])){data.set(property,this[property]);}}return"#<Effect:"+data.inspect()+",options:"+$H(this.options).inspect()+">";}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(effects){this.effects=effects||[];this.start(arguments[1]);},update:function(position){this.effects.invoke("render",position);},finish:function(position){this.effects.each(function(effect){effect.render(1);effect.cancel();effect.event("beforeFinish");if(effect.finish){effect.finish(position);}effect.event("afterFinish");});}});Effect.Tween=Class.create(Effect.Base,{initialize:function(object,from,to){object=Object.isString(object)?$(object):object;var args=$A(arguments),method=args.last(),options=args.length==5?args[3]:null;this.method=Object.isFunction(method)?method.bind(object):Object.isFunction(object[method])?object[method].bind(object):function(value){object[method]=value;};this.start(Object.extend({from:from,to:to},options||{}));},update:function(position){this.method(position);}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}));},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError);}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});}var options=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(options);},update:function(position){this.element.setOpacity(position);}});Effect.Move=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError);}var options=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(options);},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop;}},update:function(position){this.element.setStyle({left:(this.options.x*position+this.originalLeft).round()+"px",top:(this.options.y*position+this.originalTop).round()+"px"});}});Effect.MoveBy=function(element,toTop,toLeft){return new Effect.Move(element,Object.extend({x:toLeft,y:toTop},arguments[3]||{}));};Effect.Scale=Class.create(Effect.Base,{initialize:function(element,percent){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError);}var options=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:percent},arguments[2]||{});this.start(options);},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(k){this.originalStyle[k]=this.element.style[k];}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var fontSize=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(fontSizeType){if(fontSize.indexOf(fontSizeType)>0){this.fontSize=parseFloat(fontSize);this.fontSizeType=fontSizeType;}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth];}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth];}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];}},update:function(position){var currentScale=(this.options.scaleFrom/100)+(this.factor*position);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*currentScale+this.fontSizeType});}this.setDimensions(this.dims[0]*currentScale,this.dims[1]*currentScale);},finish:function(position){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle);}},setDimensions:function(height,width){var d={};if(this.options.scaleX){d.width=width.round()+"px";}if(this.options.scaleY){d.height=height.round()+"px";}if(this.options.scaleFromCenter){var topd=(height-this.dims[0])/2;var leftd=(width-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){d.top=this.originalTop-topd+"px";}if(this.options.scaleX){d.left=this.originalLeft-leftd+"px";}}else{if(this.options.scaleY){d.top=-topd+"px";}if(this.options.scaleX){d.left=-leftd+"px";}}}this.element.setStyle(d);}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError);}var options=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(options);},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return ;}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"});}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff");}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color");}this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];}.bind(this));},update:function(position){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart());}.bind(this))});},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));}});Effect.ScrollTo=function(element){var options=arguments[1]||{},scrollOffsets=document.viewport.getScrollOffsets(),elementOffsets=$(element).cumulativeOffset(),max=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(options.offset){elementOffsets[1]+=options.offset;}return new Effect.Tween(null,scrollOffsets.top,elementOffsets[1]>max?max:elementOffsets[1],options,function(p){scrollTo(scrollOffsets.left,p.round());});};Effect.Fade=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();var options=Object.extend({from:element.getOpacity()||1,to:0,afterFinishInternal:function(effect){if(effect.options.to!=0){return ;}effect.element.hide().setStyle({opacity:oldOpacity});}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Appear=function(element){element=$(element);var options=Object.extend({from:(element.getStyle("display")=="none"?0:element.getOpacity()||0),to:1,afterFinishInternal:function(effect){effect.element.forceRerendering();},beforeSetup:function(effect){effect.element.setOpacity(effect.options.from).show();}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Puff=function(element){element=$(element);var oldStyle={opacity:element.getInlineOpacity(),position:element.getStyle("position"),top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};return new Effect.Parallel([new Effect.Scale(element,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(element,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(effect){Position.absolutize(effect.effects[0].element);},afterFinishInternal:function(effect){effect.effects[0].element.hide().setStyle(oldStyle);}},arguments[1]||{}));};Effect.BlindUp=function(element){element=$(element);element.makeClipping();return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(effect){effect.element.hide().undoClipping();}},arguments[1]||{}));};Effect.BlindDown=function(element){element=$(element);var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makeClipping().setStyle({height:"0px"}).show();},afterFinishInternal:function(effect){effect.element.undoClipping();}},arguments[1]||{}));};Effect.SwitchOff=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();return new Effect.Appear(element,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(effect){new Effect.Scale(effect.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned().setStyle({opacity:oldOpacity});}});}},arguments[1]||{}));};Effect.DropOut=function(element){element=$(element);var oldStyle={top:element.getStyle("top"),left:element.getStyle("left"),opacity:element.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(element,{x:0,y:100,sync:true}),new Effect.Opacity(element,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(effect){effect.effects[0].element.makePositioned();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);}},arguments[1]||{}));};Effect.Shake=function(element){element=$(element);var options=Object.extend({distance:20,duration:0.5},arguments[1]||{});var distance=parseFloat(options.distance);var split=parseFloat(options.duration)/10;var oldStyle={top:element.getStyle("top"),left:element.getStyle("left")};return new Effect.Move(element,{x:distance,y:0,duration:split,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance,y:0,duration:split,afterFinishInternal:function(effect){effect.element.undoPositioned().setStyle(oldStyle);}});}});}});}});}});}});};Effect.SlideDown=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle("bottom");var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera){effect.element.setStyle({top:""});}effect.element.makeClipping().setStyle({height:"0px"}).show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+"px"});},afterFinishInternal:function(effect){effect.element.undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.SlideUp=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle("bottom");var elementDimensions=element.getDimensions();return new Effect.Scale(element,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera){effect.element.setStyle({top:""});}effect.element.makeClipping().show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+"px"});},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.Squish=function(element){return new Effect.Scale(element,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping();}});};Effect.Grow=function(element){element=$(element);var options=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var initialMoveX,initialMoveY;var moveX,moveY;switch(options.direction){case"top-left":initialMoveX=initialMoveY=moveX=moveY=0;break;case"top-right":initialMoveX=dims.width;initialMoveY=moveY=0;moveX=-dims.width;break;case"bottom-left":initialMoveX=moveX=0;initialMoveY=dims.height;moveY=-dims.height;break;case"bottom-right":initialMoveX=dims.width;initialMoveY=dims.height;moveX=-dims.width;moveY=-dims.height;break;case"center":initialMoveX=dims.width/2;initialMoveY=dims.height/2;moveX=-dims.width/2;moveY=-dims.height/2;break;}return new Effect.Move(element,{x:initialMoveX,y:initialMoveY,duration:0.01,beforeSetup:function(effect){effect.element.hide().makeClipping().makePositioned();},afterFinishInternal:function(effect){new Effect.Parallel([new Effect.Opacity(effect.element,{sync:true,to:1,from:0,transition:options.opacityTransition}),new Effect.Move(effect.element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition}),new Effect.Scale(effect.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:options.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(effect){effect.effects[0].element.setStyle({height:"0px"}).show();},afterFinishInternal:function(effect){effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);}},options));}});};Effect.Shrink=function(element){element=$(element);var options=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var moveX,moveY;switch(options.direction){case"top-left":moveX=moveY=0;break;case"top-right":moveX=dims.width;moveY=0;break;case"bottom-left":moveX=0;moveY=dims.height;break;case"bottom-right":moveX=dims.width;moveY=dims.height;break;case"center":moveX=dims.width/2;moveY=dims.height/2;break;}return new Effect.Parallel([new Effect.Opacity(element,{sync:true,to:0,from:1,transition:options.opacityTransition}),new Effect.Scale(element,window.opera?1:0,{sync:true,transition:options.scaleTransition,restoreAfterFinish:true}),new Effect.Move(element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition})],Object.extend({beforeStartInternal:function(effect){effect.effects[0].element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle);}},options));};Effect.Pulsate=function(element){element=$(element);var options=arguments[1]||{};var oldOpacity=element.getInlineOpacity();var transition=options.transition||Effect.Transitions.sinoidal;var reverser=function(pos){return transition(1-Effect.Transitions.pulse(pos,options.pulses));};reverser.bind(transition);return new Effect.Opacity(element,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(effect){effect.element.setStyle({opacity:oldOpacity});}},options),{transition:reverser}));};Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};element.makeClipping();return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide().undoClipping().setStyle(oldStyle);}});}},arguments[1]||{}));};Effect.Morph=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError);}var options=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(options.style)){this.style=$H(options.style);}else{if(options.style.include(":")){this.style=options.style.parseStyle();}else{this.element.addClassName(options.style);this.style=$H(this.element.getStyles());this.element.removeClassName(options.style);var css=this.element.getStyles();this.style=this.style.reject(function(style){return style.value==css[style.key];});options.afterFinishInternal=function(effect){effect.element.addClassName(effect.options.style);effect.transforms.each(function(transform){effect.element.style[transform.style]="";});};}}this.start(options);},setup:function(){function parseColor(color){if(!color||["rgba(0, 0, 0, 0)","transparent"].include(color)){color="#ffffff";}color=color.parseColor();return $R(0,2).map(function(i){return parseInt(color.slice(i*2+1,i*2+3),16);});}this.transforms=this.style.map(function(pair){var property=pair[0],value=pair[1],unit=null;if(value.parseColor("#zzzzzz")!="#zzzzzz"){value=value.parseColor();unit="color";}else{if(property=="opacity"){value=parseFloat(value);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});}}else{if(Element.CSS_LENGTH.test(value)){var components=value.match(/^([\+\-]?[0-9\.]+)(.*)$/);value=parseFloat(components[1]);unit=(components.length==3)?components[2]:null;}}}var originalValue=this.element.getStyle(property);return{style:property.camelize(),originalValue:unit=="color"?parseColor(originalValue):parseFloat(originalValue||0),targetValue:unit=="color"?parseColor(value):value,unit:unit};}.bind(this)).reject(function(transform){return((transform.originalValue==transform.targetValue)||(transform.unit!="color"&&(isNaN(transform.originalValue)||isNaN(transform.targetValue))));});},update:function(position){var style={},transform,i=this.transforms.length;while(i--){style[(transform=this.transforms[i]).style]=transform.unit=="color"?"#"+(Math.round(transform.originalValue[0]+(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart()+(Math.round(transform.originalValue[1]+(transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart()+(Math.round(transform.originalValue[2]+(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart():(transform.originalValue+(transform.targetValue-transform.originalValue)*position).toFixed(3)+(transform.unit===null?"":transform.unit);}this.element.setStyle(style,true);}});Effect.Transform=Class.create({initialize:function(tracks){this.tracks=[];this.options=arguments[1]||{};this.addTracks(tracks);},addTracks:function(tracks){tracks.each(function(track){track=$H(track);var data=track.values().first();this.tracks.push($H({ids:track.keys().first(),effect:Effect.Morph,options:{style:data}}));}.bind(this));return this;},play:function(){return new Effect.Parallel(this.tracks.map(function(track){var ids=track.get("ids"),effect=track.get("effect"),options=track.get("options");var elements=[$(ids)||$$(ids)].flatten();return elements.map(function(e){return new effect(e,Object.extend({sync:true},options));});}).flatten(),this.options);}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var style,styleRules=$H();if(Prototype.Browser.WebKit){style=new Element("div",{style:this}).style;}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';style=String.__parseStyleElement.childNodes[0].style;}Element.CSS_PROPERTIES.each(function(property){if(style[property]){styleRules.set(property,style[property]);}});if(Prototype.Browser.IE&&this.include("opacity")){styleRules.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);}return styleRules;};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(element){var css=document.defaultView.getComputedStyle($(element),null);return Element.CSS_PROPERTIES.inject({},function(styles,property){styles[property]=css[property];return styles;});};}else{Element.getStyles=function(element){element=$(element);var css=element.currentStyle,styles;styles=Element.CSS_PROPERTIES.inject({},function(results,property){results[property]=css[property];return results;});if(!styles.opacity){styles.opacity=element.getOpacity();}return styles;};}Effect.Methods={morph:function(element,style){element=$(element);new Effect.Morph(element,Object.extend({style:style},arguments[2]||{}));return element;},visualEffect:function(element,effect,options){element=$(element);var s=effect.dasherize().camelize(),klass=s.charAt(0).toUpperCase()+s.substring(1);new Effect[klass](element,options);return element;},highlight:function(element,options){element=$(element);new Effect.Highlight(element,options);return element;}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(effect){Effect.Methods[effect]=function(element,options){element=$(element);Effect[effect.charAt(0).toUpperCase()+effect.substring(1)](element,options);return element;};});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(f){Effect.Methods[f]=Element[f];});Element.addMethods(Effect.Methods);if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library");}var Autocompleter={};Autocompleter.Base=Class.create({initialize:function(element,update,options){this.baseInitialize(element,update,options);},baseInitialize:function(element,update,options){element=$(element);this.element=element;this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(options);}else{this.options=options||{};}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||this.onShowDefault;this.options.onHide=this.options.onHide||function(element,update){new Effect.Fade(update,{duration:0.15});};if(typeof (this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens);}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n");}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this));},onShowDefault:function(element,update){if(!update.style.position||update.style.position=="absolute"){update.style.position="absolute";Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight});}Effect.Appear(update,{duration:0.15});},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update);}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix");}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50);}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=(this.options.ieZIndex)?this.options.ieZIndex:1;this.update.style.zIndex=(this.options.ieZIndex)?this.options.ieZIndex+1:2;Element.show(this.iefix);},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update);}if(this.iefix){Element.hide(this.iefix);}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator);}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator);}},onKeyPress:function(event){if(this.active){switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return ;case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(event);return ;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(event);return ;}}else{if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&event.keyCode==0)){return ;}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer);}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices();},onHover:function(event){var element=Event.findElement(event,"LI");if(this.index!=element.autocompleteIndex){this.index=element.autocompleteIndex;this.render();}Event.stop(event);},onClick:function(event){var element=Event.findElement(event,"LI");this.index=element.autocompleteIndex;this.selectEntry();this.hide();},onBlur:function(event){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false;},render:function(){if(this.entryCount>0){for(var i=0;i<this.entryCount;i++){this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");}if(this.hasFocus){this.show();this.active=true;}}else{this.active=false;this.hide();}},markPrevious:function(){if(this.index>0){this.index--;}else{this.index=this.entryCount-1;}this.getEntry(this.index).scrollIntoView(true);},markNext:function(){if(this.index<this.entryCount-1){this.index++;}else{this.index=0;}this.getEntry(this.index).scrollIntoView(false);},getEntry:function(index){return this.update.firstChild.childNodes[index];},getCurrentEntry:function(){return this.getEntry(this.index);},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry());},updateElement:function(selectedElement){if(this.options.updateElement){this.options.updateElement(selectedElement);return ;}var value="";if(this.options.select){var nodes=$(selectedElement).select("."+this.options.select)||[];if(nodes.length>0){value=Element.collectTextNodes(nodes[0],this.options.select);}}else{value=Element.collectTextNodesIgnoreClass(selectedElement,"informal");}var bounds=this.getTokenBounds();if(bounds[0]!=-1){var newValue=this.element.value.substr(0,bounds[0]);var whitespace=this.element.value.substr(bounds[0]).match(/^\s+/);if(whitespace){newValue+=whitespace[0];}this.element.value=newValue+value+this.element.value.substr(bounds[1]);}else{this.element.value=value;}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,selectedElement);}},updateChoices:function(choices){if(!this.changed&&this.hasFocus){this.update.innerHTML=choices;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var i=0;i<this.entryCount;i++){var entry=this.getEntry(i);entry.autocompleteIndex=i;this.addObservers(entry);}}else{this.entryCount=0;}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide();}else{this.render();}}},addObservers:function(element){Event.observe(element,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(element,"click",this.onClick.bindAsEventListener(this));},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices();}else{this.active=false;this.hide();}this.oldElementValue=this.element.value;},getToken:function(){var bounds=this.getTokenBounds();return this.element.value.substring(bounds[0],bounds[1]).strip();},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds;}var value=this.element.value;if(value.strip().empty()){return[-1,0];}var diff=arguments.callee.getFirstDifferencePos(value,this.oldElementValue);var offset=(diff==this.oldElementValue.length?1:0);var prevTokenPos=-1,nextTokenPos=value.length;var tp;for(var index=0,l=this.options.tokens.length;index<l;++index){tp=value.lastIndexOf(this.options.tokens[index],diff+offset-1);if(tp>prevTokenPos){prevTokenPos=tp;}tp=value.indexOf(this.options.tokens[index],diff+offset);if(-1!=tp&&tp<nextTokenPos){nextTokenPos=tp;}}return(this.tokenBounds=[prevTokenPos+1,nextTokenPos]);}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(newS,oldS){var boundary=Math.min(newS.length,oldS.length);for(var index=0;index<boundary;++index){if(newS[index]!=oldS[index]){return index;}}return boundary;};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url;},getUpdatedChoices:function(){this.startIndicator();var entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams;}new Ajax.Request(this.url,this.options);},onComplete:function(request){this.updateChoices(request.responseText);}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(element,update,array,options){this.baseInitialize(element,update,options);this.options.array=array;},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));},setOptions:function(options){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(instance){var ret=[];var partial=[];var entry=instance.getToken();var count=0;for(var i=0;i<instance.options.array.length&&ret.length<instance.options.choices;i++){var elem=instance.options.array[i];var foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase()):elem.indexOf(entry);while(foundPos!=-1){if(foundPos==0&&elem.length!=entry.length){ret.push("<li><strong>"+elem.substr(0,entry.length)+"</strong>"+elem.substr(entry.length)+"</li>");break;}else{if(entry.length>=instance.options.partialChars&&instance.options.partialSearch&&foundPos!=-1){if(instance.options.fullSearch||/\s/.test(elem.substr(foundPos-1,1))){partial.push("<li>"+elem.substr(0,foundPos)+"<strong>"+elem.substr(foundPos,entry.length)+"</strong>"+elem.substr(foundPos+entry.length)+"</li>");break;}}}foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase(),foundPos+1):elem.indexOf(entry,foundPos+1);}}if(partial.length){ret=ret.concat(partial.slice(0,instance.options.choices-ret.length));}return"<ul>"+ret.join("")+"</ul>";}},options||{});}});Field.scrollFreeActivate=function(field){setTimeout(function(){Field.activate(field);},1);};Ajax.InPlaceEditor=Class.create({initialize:function(element,url,options){this.url=url;this.element=element=$(element);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(options);Object.extend(this.options,options||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId="";}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl);}if(!this.options.externalControl){this.options.externalControlOnly=false;}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners();},checkForEscapeOrReturn:function(e){if(!this._editing||e.ctrlKey||e.altKey||e.shiftKey){return ;}if(Event.KEY_ESC==e.keyCode){this.handleFormCancellation(e);}else{if(Event.KEY_RETURN==e.keyCode){this.handleFormSubmission(e);}}},createControl:function(mode,handler,extraClasses){var control=this.options[mode+"Control"];var text=this.options[mode+"Text"];if("button"==control){var btn=document.createElement("input");btn.type="submit";btn.value=text;btn.className="editor_"+mode+"_button";if("cancel"==mode){btn.onclick=this._boundCancelHandler;}this._form.appendChild(btn);this._controls[mode]=btn;}else{if("link"==control){var link=document.createElement("a");link.href="#";link.appendChild(document.createTextNode(text));link.onclick="cancel"==mode?this._boundCancelHandler:this._boundSubmitHandler;link.className="editor_"+mode+"_link";if(extraClasses){link.className+=" "+extraClasses;}this._form.appendChild(link);this._controls[mode]=link;}}},createEditField:function(){var text=(this.options.loadTextURL?this.options.loadingText:this.getText());var fld;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){fld=document.createElement("input");fld.type="text";var size=this.options.size||this.options.cols||0;if(0<size){fld.size=size;}}else{fld=document.createElement("textarea");fld.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);fld.cols=this.options.cols||40;}fld.name=this.options.paramName;fld.value=text;fld.className="editor_field";if(this.options.submitOnBlur){fld.onblur=this._boundSubmitHandler;}this._controls.editor=fld;if(this.options.loadTextURL){this.loadExternalText();}this._form.appendChild(this._controls.editor);},createForm:function(){var ipe=this;function addText(mode,condition){var text=ipe.options["text"+mode+"Controls"];if(!text||condition===false){return ;}ipe._form.appendChild(document.createTextNode(text));}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"));}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form);}addText("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);addText("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");addText("After",this.options.okControl||this.options.cancelControl);},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;}this.leaveEditMode();this.unregisterListeners();},enterEditMode:function(e){if(this._saving||this._editing){return ;}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide();}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField();}if(e){Event.stop(e);}},enterHover:function(e){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName);}if(this._saving){return ;}this.triggerCallback("onEnterHover");},getText:function(){return this.element.innerHTML;},handleAJAXFailure:function(transport){this.triggerCallback("onFailure",transport);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null;}},handleFormCancellation:function(e){this.wrapUp();if(e){Event.stop(e);}},handleFormSubmission:function(e){var form=this._form;var value=$F(this._controls.editor);this.prepareSubmission();var params=this.options.callback(form,value)||"";if(Object.isString(params)){params=params.toQueryParams();}params.editorId=this.element.id;if(this.options.htmlResponse){var options=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,options);}else{var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,options);}if(e){Event.stop(e);}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show();}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode");},leaveHover:function(e){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName);}if(this._saving){return ;}this.triggerCallback("onLeaveHover");},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._form.removeClassName(this.options.loadingClassName);var text=transport.responseText;if(this.options.stripLoadedTextTags){text=text.stripTags();}this._controls.editor.value=text;this._controls.editor.disabled=false;this.postProcessEditField();}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,options);},postProcessEditField:function(){var fpc=this.options.fieldPostCreation;if(fpc){$(this._controls.editor)["focus"==fpc?"focus":"activate"]();}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(defs){Object.extend(this.options,defs);}.bind(this));},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving();},registerListeners:function(){this._listeners={};var listener;$H(Ajax.InPlaceEditor.Listeners).each(function(pair){listener=this[pair.value].bind(this);this._listeners[pair.key]=listener;if(!this.options.externalControlOnly){this.element.observe(pair.key,listener);}if(this.options.externalControl){this.options.externalControl.observe(pair.key,listener);}}.bind(this));},removeForm:function(){if(!this._form){return ;}this._form.remove();this._form=null;this._controls={};},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show();},triggerCallback:function(cbName,arg){if("function"==typeof this.options[cbName]){this.options[cbName](this,arg);}},unregisterListeners:function(){$H(this._listeners).each(function(pair){if(!this.options.externalControlOnly){this.element.stopObserving(pair.key,pair.value);}if(this.options.externalControl){this.options.externalControl.stopObserving(pair.key,pair.value);}}.bind(this));},wrapUp:function(transport){this.leaveEditMode();this._boundComplete(transport,this.element);}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,element,url,options){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(element,url,options);},createEditField:function(){var list=document.createElement("select");list.name=this.options.paramName;list.size=1;this._controls.editor=list;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection();}else{this.checkForExternalText();}this._form.appendChild(this._controls.editor);},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw"Server returned an invalid collection representation.";}this._collection=eval(js);this.checkForExternalText();}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options);},showLoadingText:function(text){this._controls.editor.disabled=true;var tempOption=this._controls.editor.firstChild;if(!tempOption){tempOption=document.createElement("option");tempOption.value="";this._controls.editor.appendChild(tempOption);tempOption.selected=true;}tempOption.update((text||"").stripScripts().stripTags());},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText();}else{this.buildOptionList();}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._text=transport.responseText.strip();this.buildOptionList();}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,options);},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(entry){return 2===entry.length?entry:[entry,entry].flatten();});var marker=("value" in this.options)?this.options.value:this._text;var textFound=this._collection.any(function(entry){return entry[0]==marker;}.bind(this));this._controls.editor.update("");var option;this._collection.each(function(entry,index){option=document.createElement("option");option.value=entry[0];option.selected=textFound?entry[0]==marker:0==index;option.appendChild(document.createTextNode(entry[1]));this._controls.editor.appendChild(option);}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor);}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(options){if(!options){return ;}function fallback(name,expr){if(name in options||expr===undefined){return ;}options[name]=expr;}fallback("cancelControl",(options.cancelLink?"link":(options.cancelButton?"button":options.cancelLink==options.cancelButton==false?false:undefined)));fallback("okControl",(options.okLink?"link":(options.okButton?"button":options.okLink==options.okButton==false?false:undefined)));fallback("highlightColor",options.highlightcolor);fallback("highlightEndColor",options.highlightendcolor);};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(form){return Form.serialize(form);},onComplete:function(transport,element){new Effect.Highlight(element,{startcolor:this.options.highlightColor,keepBackgroundImage:true});},onEnterEditMode:null,onEnterHover:function(ipe){ipe.element.style.backgroundColor=ipe.options.highlightColor;if(ipe._effect){ipe._effect.cancel();}},onFailure:function(transport,ipe){alert("Error communication with the server: "+transport.responseText.stripTags());},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(ipe){ipe._effect=new Effect.Highlight(ipe.element,{startcolor:ipe.options.highlightColor,endcolor:ipe.options.highlightEndColor,restorecolor:ipe._originalBackground,keepBackgroundImage:true});}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this));},delayedListener:function(event){if(this.lastValue==$F(this.element)){return ;}if(this.timer){clearTimeout(this.timer);}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element);},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element));}});if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library");}var Droppables={drops:[],remove:function(element){this.drops=this.drops.reject(function(d){return d.element==$(element);});},add:function(element){element=$(element);var options=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(options.containment){options._containers=[];var containment=options.containment;if(Object.isArray(containment)){containment.each(function(c){options._containers.push($(c));});}else{options._containers.push($(containment));}}if(options.accept){options.accept=[options.accept].flatten();}Element.makePositioned(element);options.element=element;this.drops.push(options);},findDeepestChild:function(drops){deepest=drops[0];for(i=1;i<drops.length;++i){if(Element.isParent(drops[i].element,deepest.element)){deepest=drops[i];}}return deepest;},isContained:function(element,drop){var containmentNode;if(drop.tree){containmentNode=element.treeNode;}else{containmentNode=element.parentNode;}return drop._containers.detect(function(c){return containmentNode==c;});},isAffected:function(point,element,drop){return((drop.element!=element)&&((!drop._containers)||this.isContained(element,drop))&&((!drop.accept)||(Element.classNames(element).detect(function(v){return drop.accept.include(v);})))&&Position.within(drop.element,point[0],point[1]));},deactivate:function(drop){if(drop.hoverclass){Element.removeClassName(drop.element,drop.hoverclass);}this.last_active=null;},activate:function(drop){if(drop.hoverclass){Element.addClassName(drop.element,drop.hoverclass);}this.last_active=drop;},show:function(point,element){if(!this.drops.length){return ;}var drop,affected=[];this.drops.each(function(drop){if(Droppables.isAffected(point,element,drop)){affected.push(drop);}});if(affected.length>0){drop=Droppables.findDeepestChild(affected);}if(this.last_active&&this.last_active!=drop){this.deactivate(this.last_active);}if(drop){Position.within(drop.element,point[0],point[1]);if(drop.onHover){drop.onHover(element,drop.element,Position.overlap(drop.overlap,drop.element));}if(drop!=this.last_active){Droppables.activate(drop);}}},fire:function(event,element){if(!this.last_active){return ;}Position.prepare();if(this.isAffected([Event.pointerX(event),Event.pointerY(event)],element,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(element,this.last_active.element,event);return true;}}},reset:function(){if(this.last_active){this.deactivate(this.last_active);}}};var Draggables={drags:[],observers:[],register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);}this.drags.push(draggable);},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable;});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress);}},activate:function(draggable){if(draggable.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=draggable;}.bind(this),draggable.options.delay);}else{window.focus();this.activeDraggable=draggable;}},deactivate:function(){this.activeDraggable=null;},updateDrag:function(event){if(!this.activeDraggable){return ;}var pointer=[Event.pointerX(event),Event.pointerY(event)];if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect())){return ;}this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer);},endDrag:function(event){if(this._timeout){clearTimeout(this._timeout);this._timeout=null;}if(!this.activeDraggable){return ;}this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null;},keyPress:function(event){if(this.activeDraggable){this.activeDraggable.keyPress(event);}},addObserver:function(observer){this.observers.push(observer);this._cacheObserverCallbacks();},removeObserver:function(element){this.observers=this.observers.reject(function(o){return o.element==element;});this._cacheObserverCallbacks();},notify:function(eventName,draggable,event){if(this[eventName+"Count"]>0){this.observers.each(function(o){if(o[eventName]){o[eventName](eventName,draggable,event);}});}if(draggable.options[eventName]){draggable.options[eventName](draggable,event);}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(eventName){Draggables[eventName+"Count"]=Draggables.observers.select(function(o){return o[eventName];}).length;});}};var Draggable=Class.create({initialize:function(element){var defaults={handle:false,reverteffect:function(element,top_offset,left_offset){var dur=Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;new Effect.Move(element,{x:-left_offset,y:-top_offset,duration:dur,queue:{scope:"_draggable",position:"end"}});},endeffect:function(element){var toOpacity=Object.isNumber(element._opacity)?element._opacity:1;new Effect.Opacity(element,{duration:0.2,from:0.7,to:toOpacity,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[element]=false;}});},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(defaults,{starteffect:function(element){element._opacity=Element.getOpacity(element);Draggable._dragging[element]=true;new Effect.Opacity(element,{duration:0.2,from:element._opacity,to:0.7});}});}var options=Object.extend(defaults,arguments[1]||{});this.element=$(element);if(options.handle&&Object.isString(options.handle)){this.handle=this.element.down("."+options.handle,0);}if(!this.handle){this.handle=$(options.handle);}if(!this.handle){this.handle=this.element;}if(options.scroll&&!options.scroll.scrollTo&&!options.scroll.outerHTML){options.scroll=$(options.scroll);this._isScrollChild=Element.childOf(this.element,options.scroll);}Element.makePositioned(this.element);this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this);},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this);},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]);},initDrag:function(event){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return ;}if(Event.isLeftClick(event)){var src=Event.element(event);if((tag_name=src.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return ;}var pointer=[Event.pointerX(event),Event.pointerY(event)];var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i]);});Draggables.activate(this);Event.stop(event);}},startDrag:function(event){this.dragging=true;if(!this.delta){this.delta=this.currentDelta();}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex;}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this.element._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this.element._originallyAbsolute){Position.absolutize(this.element);}this.element.parentNode.insertBefore(this._clone,this.element);}if(this.options.scroll){if(this.options.scroll==window){var where=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=where.left;this.originalScrollTop=where.top;}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop;}}Draggables.notify("onStart",this,event);if(this.options.starteffect){this.options.starteffect(this.element);}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event);}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element);}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this);}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height];}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight);}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity);}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity);}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity);}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity);}this.startScrolling(speed);}if(Prototype.Browser.WebKit){window.scrollBy(0,0);}Event.stop(event);},finishDrag:function(event,success){this.dragging=false;if(this.options.quiet){Position.prepare();var pointer=[Event.pointerX(event),Event.pointerY(event)];Droppables.show(pointer,this.element);}if(this.options.ghosting){if(!this.element._originallyAbsolute){Position.relativize(this.element);}delete this.element._originallyAbsolute;Element.remove(this._clone);this._clone=null;}var dropped=false;if(success){dropped=Droppables.fire(event,this.element);if(!dropped){dropped=false;}}if(dropped&&this.options.onDropped){this.options.onDropped(this.element);}Draggables.notify("onEnd",this,event);var revert=this.options.revert;if(revert&&Object.isFunction(revert)){revert=revert(this.element);}var d=this.currentDelta();if(revert&&this.options.reverteffect){if(dropped==0||revert!="failure"){this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);}}else{this.delta=d;}if(this.options.zindex){this.element.style.zIndex=this.originalZ;}if(this.options.endeffect){this.options.endeffect(this.element);}Draggables.deactivate(this);Droppables.reset();},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC){return ;}this.finishDrag(event,false);Event.stop(event);},endDrag:function(event){if(!this.dragging){return ;}this.stopScrolling();this.finishDrag(event,true);Event.stop(event);},draw:function(point){var pos=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);pos[0]+=r[0]-Position.deltaX;pos[1]+=r[1]-Position.deltaY;}var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){pos[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;pos[1]-=this.options.scroll.scrollTop-this.originalScrollTop;}var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i]);}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){p=this.options.snap(p[0],p[1],this);}else{if(Object.isArray(this.options.snap)){p=p.map(function(v,i){return(v/this.options.snap[i]).round()*this.options.snap[i];}.bind(this));}else{p=p.map(function(v){return(v/this.options.snap).round()*this.options.snap;}.bind(this));}}}var style=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){style.left=p[0]+"px";}if((!this.options.constraint)||(this.options.constraint=="vertical")){style.top=p[1]+"px";}if(style.visibility=="hidden"){style.visibility="";}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null;}},startScrolling:function(speed){if(!(speed[0]||speed[1])){return ;}this.scrollSpeed=[speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10);},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]);}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000;}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0;}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0;}this.draw(Draggables._lastScrollPointer);}if(this.options.change){this.options.change(this);}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight;}}}return{top:T,left:L,width:W,height:H};}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(element,observer){this.element=$(element);this.observer=observer;this.lastValue=Sortable.serialize(this.element);},onStart:function(){this.lastValue=Sortable.serialize(this.element);},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element);}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(element){while(element.tagName.toUpperCase()!="BODY"){if(element.id&&Sortable.sortables[element.id]){return element;}element=element.parentNode;}},options:function(element){element=Sortable._findRootElement($(element));if(!element){return ;}return Sortable.sortables[element.id];},destroy:function(element){var s=Sortable.options(element);if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d);});s.draggables.invoke("destroy");delete Sortable.sortables[s.element.id];}},create:function(element){element=$(element);var options=Object.extend({element:element,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:element,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(element);var options_for_draggable={revert:true,quiet:options.quiet,scroll:options.scroll,scrollSpeed:options.scrollSpeed,scrollSensitivity:options.scrollSensitivity,delay:options.delay,ghosting:options.ghosting,constraint:options.constraint,handle:options.handle};if(options.starteffect){options_for_draggable.starteffect=options.starteffect;}if(options.reverteffect){options_for_draggable.reverteffect=options.reverteffect;}else{if(options.ghosting){options_for_draggable.reverteffect=function(element){element.style.top=0;element.style.left=0;};}}if(options.endeffect){options_for_draggable.endeffect=options.endeffect;}if(options.zindex){options_for_draggable.zindex=options.zindex;}var options_for_droppable={overlap:options.overlap,containment:options.containment,tree:options.tree,hoverclass:options.hoverclass,onHover:Sortable.onHover};var options_for_tree={onHover:Sortable.onEmptyHover,overlap:options.overlap,containment:options.containment,hoverclass:options.hoverclass};Element.cleanWhitespace(element);options.draggables=[];options.droppables=[];if(options.dropOnEmpty||options.tree){Droppables.add(element,options_for_tree);options.droppables.push(element);}(options.elements||this.findElements(element,options)||[]).each(function(e,i){var handle=options.handles?$(options.handles[i]):(options.handle?$(e).select("."+options.handle)[0]:e);options.draggables.push(new Draggable(e,Object.extend(options_for_draggable,{handle:handle})));Droppables.add(e,options_for_droppable);if(options.tree){e.treeNode=element;}options.droppables.push(e);});if(options.tree){(Sortable.findTreeElements(element,options)||[]).each(function(e){Droppables.add(e,options_for_tree);e.treeNode=element;options.droppables.push(e);});}this.sortables[element.id]=options;Draggables.addObserver(new SortableObserver(element,options.onUpdate));},findElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.tag);},findTreeElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.treeTag);},onHover:function(element,dropon,overlap){if(Element.isParent(dropon,element)){return ;}if(overlap>0.33&&overlap<0.66&&Sortable.options(dropon).tree){return ;}else{if(overlap>0.5){Sortable.mark(dropon,"before");if(dropon.previousSibling!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,dropon);if(dropon.parentNode!=oldParentNode){Sortable.options(oldParentNode).onChange(element);}Sortable.options(dropon.parentNode).onChange(element);}}else{Sortable.mark(dropon,"after");var nextElement=dropon.nextSibling||null;if(nextElement!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,nextElement);if(dropon.parentNode!=oldParentNode){Sortable.options(oldParentNode).onChange(element);}Sortable.options(dropon.parentNode).onChange(element);}}}},onEmptyHover:function(element,dropon,overlap){var oldParentNode=element.parentNode;var droponOptions=Sortable.options(dropon);if(!Element.isParent(dropon,element)){var index;var children=Sortable.findElements(dropon,{tag:droponOptions.tag,only:droponOptions.only});var child=null;if(children){var offset=Element.offsetSize(dropon,droponOptions.overlap)*(1-overlap);for(index=0;index<children.length;index+=1){if(offset-Element.offsetSize(children[index],droponOptions.overlap)>=0){offset-=Element.offsetSize(children[index],droponOptions.overlap);}else{if(offset-(Element.offsetSize(children[index],droponOptions.overlap)/2)>=0){child=index+1<children.length?children[index+1]:null;break;}else{child=children[index];break;}}}}dropon.insertBefore(element,child);Sortable.options(oldParentNode).onChange(element);droponOptions.onChange(element);}},unmark:function(){if(Sortable._marker){Sortable._marker.hide();}},mark:function(dropon,position){var sortable=Sortable.options(dropon.parentNode);if(sortable&&!sortable.ghosting){return ;}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);}var offsets=Position.cumulativeOffset(dropon);Sortable._marker.setStyle({left:offsets[0]+"px",top:offsets[1]+"px"});if(position=="after"){if(sortable.overlap=="horizontal"){Sortable._marker.setStyle({left:(offsets[0]+dropon.clientWidth)+"px"});}else{Sortable._marker.setStyle({top:(offsets[1]+dropon.clientHeight)+"px"});}}Sortable._marker.show();},_tree:function(element,options,parent){var children=Sortable.findElements(element,options)||[];for(var i=0;i<children.length;++i){var match=children[i].id.match(options.format);if(!match){continue;}var child={id:encodeURIComponent(match?match[1]:null),element:element,parent:parent,children:[],position:parent.children.length,container:$(children[i]).down(options.treeTag)};if(child.container){this._tree(child.container,options,child);}parent.children.push(child);}return parent;},tree:function(element){element=$(element);var sortableOptions=this.options(element);var options=Object.extend({tag:sortableOptions.tag,treeTag:sortableOptions.treeTag,only:sortableOptions.only,name:element.id,format:sortableOptions.format},arguments[1]||{});var root={id:null,parent:null,children:[],container:element,position:0};return Sortable._tree(element,options,root);},_constructIndex:function(node){var index="";do{if(node.id){index="["+node.position+"]"+index;}}while((node=node.parent)!=null);return index;},sequence:function(element){element=$(element);var options=Object.extend(this.options(element),arguments[1]||{});return $(this.findElements(element,options)||[]).map(function(item){return item.id.match(options.format)?item.id.match(options.format)[1]:"";});},setSequence:function(element,new_sequence){element=$(element);var options=Object.extend(this.options(element),arguments[2]||{});var nodeMap={};this.findElements(element,options).each(function(n){if(n.id.match(options.format)){nodeMap[n.id.match(options.format)[1]]=[n,n.parentNode];}n.parentNode.removeChild(n);});new_sequence.each(function(ident){var n=nodeMap[ident];if(n){n[1].appendChild(n[0]);delete nodeMap[ident];}});},serialize:function(element){element=$(element);var options=Object.extend(Sortable.options(element),arguments[1]||{});var name=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:element.id);if(options.tree){return Sortable.tree(element,arguments[1]).children.map(function(item){return[name+Sortable._constructIndex(item)+"[id]="+encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));}).flatten().join("&");}else{return Sortable.sequence(element,arguments[1]).map(function(item){return name+"[]="+encodeURIComponent(item);}).join("&");}}};Element.isParent=function(child,element){if(!child.parentNode||child==element){return false;}if(child.parentNode==element){return true;}return Element.isParent(child.parentNode,element);};Element.findChildren=function(element,only,recursive,tagName){if(!element.hasChildNodes()){return null;}tagName=tagName.toUpperCase();if(only){only=[only].flatten();}var elements=[];$A(element.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==tagName&&(!only||(Element.classNames(e).detect(function(v){return only.include(v);})))){elements.push(e);}if(recursive){var grandchildren=Element.findChildren(e,only,recursive,tagName);if(grandchildren){elements.push(grandchildren);}}});return(elements.length>0?elements.flatten():[]);};Element.offsetSize=function(element,type){return element["offset"+((type=="vertical"||type=="height")?"Height":"Width")];};if(!Control){var Control={};}Control.Slider=Class.create({initialize:function(handle,track,options){var slider=this;if(Object.isArray(handle)){this.handles=handle.collect(function(e){return $(e);});}else{this.handles=[$(handle)];}this.track=$(track);this.options=options||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0;});this.spans=this.options.spans?this.options.spans.map(function(s){return $(s);}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled();}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max();}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(h,i){i=slider.handles.length-1-i;slider.setValue(parseFloat((Object.isArray(slider.options.sliderValue)?slider.options.sliderValue[i]:slider.options.sliderValue)||slider.range.start),i);h.makePositioned().observe("mousedown",slider.eventMouseDown);});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true;},dispose:function(){var slider=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(h){Event.stopObserving(h,"mousedown",slider.eventMouseDown);});},setDisabled:function(){this.disabled=true;},setEnabled:function(){this.disabled=false;},getNearestValue:function(value){if(this.allowedValues){if(value>=this.allowedValues.max()){return(this.allowedValues.max());}if(value<=this.allowedValues.min()){return(this.allowedValues.min());}var offset=Math.abs(this.allowedValues[0]-value);var newValue=this.allowedValues[0];this.allowedValues.each(function(v){var currentOffset=Math.abs(v-value);if(currentOffset<=offset){newValue=v;offset=currentOffset;}});return newValue;}if(value>this.range.end){return this.range.end;}if(value<this.range.start){return this.range.start;}return value;},setValue:function(sliderValue,handleIdx){if(!this.active){this.activeHandleIdx=handleIdx||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles();}handleIdx=handleIdx||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((handleIdx>0)&&(sliderValue<this.values[handleIdx-1])){sliderValue=this.values[handleIdx-1];}if((handleIdx<(this.handles.length-1))&&(sliderValue>this.values[handleIdx+1])){sliderValue=this.values[handleIdx+1];}}sliderValue=this.getNearestValue(sliderValue);this.values[handleIdx]=sliderValue;this.value=this.values[0];this.handles[handleIdx].style[this.isVertical()?"top":"left"]=this.translateToPx(sliderValue);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished();}},setValueBy:function(delta,handleIdx){this.setValue(this.values[handleIdx||this.activeHandleIdx||0]+delta,handleIdx||this.activeHandleIdx||0);},translateToPx:function(value){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(value-this.range.start))+"px";},translateToValue:function(offset){return((offset/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start);},getRange:function(range){var v=this.values.sortBy(Prototype.K);range=range||0;return $R(v[range],v[range+1]);},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX);},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX);},isVertical:function(){return(this.axis=="vertical");},drawSpans:function(){var slider=this;if(this.spans){$R(0,this.spans.length-1).each(function(r){slider.setSpan(slider.spans[r],slider.getRange(r));});}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value));}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum));}},setSpan:function(span,range){if(this.isVertical()){span.style.top=this.translateToPx(range.start);span.style.height=this.translateToPx(range.end-range.start+this.range.start);}else{span.style.left=this.translateToPx(range.start);span.style.width=this.translateToPx(range.end-range.start+this.range.start);}},updateStyles:function(){this.handles.each(function(h){Element.removeClassName(h,"selected");});Element.addClassName(this.activeHandle,"selected");},startDrag:function(event){if(Event.isLeftClick(event)){if(!this.disabled){this.active=true;var handle=Event.element(event);var pointer=[Event.pointerX(event),Event.pointerY(event)];var track=handle;if(track==this.track){var offsets=Position.cumulativeOffset(this.track);this.event=event;this.setValue(this.translateToValue((this.isVertical()?pointer[1]-offsets[1]:pointer[0]-offsets[0])-(this.handleLength/2)));var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}else{while((this.handles.indexOf(handle)==-1)&&handle.parentNode){handle=handle.parentNode;}if(this.handles.indexOf(handle)!=-1){this.activeHandle=handle;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var offsets=Position.cumulativeOffset(this.activeHandle);this.offsetX=(pointer[0]-offsets[0]);this.offsetY=(pointer[1]-offsets[1]);}}}Event.stop(event);}},update:function(event){if(this.active){if(!this.dragging){this.dragging=true;}this.draw(event);if(Prototype.Browser.WebKit){window.scrollBy(0,0);}Event.stop(event);}},draw:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var offsets=Position.cumulativeOffset(this.track);pointer[0]-=this.offsetX+offsets[0];pointer[1]-=this.offsetY+offsets[1];this.event=event;this.setValue(this.translateToValue(this.isVertical()?pointer[1]:pointer[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this);}},endDrag:function(event){if(this.active&&this.dragging){this.finishDrag(event,true);Event.stop(event);}this.active=false;this.dragging=false;},finishDrag:function(event,success){this.active=false;this.dragging=false;this.updateFinished();},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this);}this.event=null;}});var Resizeable=Class.create();Resizeable.prototype={initialize:function(element){var options=Object.extend({top:6,bottom:6,left:6,right:6,minHeight:0,minWidth:0,maxHeight:50,maxWidth:1,zindex:1000,resize:null,duringresize:null},arguments[1]||{});this.element=$(element);this.handle=this.element;Element.makePositioned(this.element);this.options=options;this.active=false;this.resizing=false;this.currentDirection="";this.eventMouseDown=this.startResize.bindAsEventListener(this);this.eventMouseUp=this.endResize.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.eventCursorCheck=this.cursor.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);this.registerEvents();},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);this.unregisterEvents();},registerEvents:function(){Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);Event.observe(this.handle,"mousedown",this.eventMouseDown);Event.observe(this.element,"mousemove",this.eventCursorCheck);},unregisterEvents:function(){},startResize:function(event){if(Event.isLeftClick(event)){var src=Event.element(event);if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){return ;}if(this.options.beforeresize){this.options.beforeresize(this.element);}var dir=this.directions(event);if(dir.length>0){this.active=true;var offsets=Position.cumulativeOffset(this.element);this.startTop=offsets[1];this.startLeft=offsets[0];this.startWidth=parseInt(Element.getStyle(this.element,"width"));this.startHeight=parseInt(Element.getStyle(this.element,"height"));this.startX=event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;this.startY=event.clientY+document.body.scrollTop+document.documentElement.scrollTop;this.currentDirection=dir;Event.stop(event);}}},finishResize:function(event,success){this.active=false;this.resizing=false;if(this.options.zindex){this.element.style.zIndex=this.originalZ;}if(this.options.resize){this.options.resize(this.element);}},keyPress:function(event){if(this.active){if(event.keyCode==Event.KEY_ESC){this.finishResize(event,false);Event.stop(event);}}},endResize:function(event){if(this.active&&this.resizing){this.finishResize(event,true);Event.stop(event);}this.active=false;this.resizing=false;},draw:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var style=this.element.style;if(this.currentDirection.indexOf("n")!=-1){var pointerMoved=this.startY-pointer[1];var margin=Element.getStyle(this.element,"margin-top")||"0";var newHeight=this.startHeight+pointerMoved;if(newHeight>this.options.minHeight){if(newHeight>this.options.maxHeight){newHeight=this.options.maxHeight;}style.height=newHeight+"px";style.top=(this.startTop-pointerMoved-parseInt(margin))+"px";}}if(this.currentDirection.indexOf("w")!=-1){var pointerMoved=this.startX-pointer[0];var margin=Element.getStyle(this.element,"margin-left")||"0";var newWidth=this.startWidth+pointerMoved;if(newWidth>this.options.minWidth){if(newWidth>this.options.maxWidth){newWidth=this.options.maxWidth;}style.left=(this.startLeft-pointerMoved-parseInt(margin))+"px";style.width=newWidth+"px";}}if(this.currentDirection.indexOf("s")!=-1){var newHeight=this.startHeight+pointer[1]-this.startY;if(newHeight>this.options.minHeight){if(newHeight>this.options.maxHeight){newHeight=this.options.maxHeight;}style.height=newHeight+"px";}}if(this.currentDirection.indexOf("e")!=-1){var newWidth=this.startWidth+pointer[0]-this.startX;if(newWidth>this.options.minWidth){if(newWidth>this.options.maxWidth){newWidth=this.options.maxWidth;}style.width=newWidth+"px";}}if(style.visibility=="hidden"){style.visibility="";}},between:function(val,low,high){return(val>=low&&val<high);},directions:function(event){var pointer=[Event.pointerX(event),Event.pointerY(event)];var offsets=Position.cumulativeOffset(this.element);var cursor="";if(this.between(pointer[1]-offsets[1],0,this.options.top)){cursor+="n";}if(this.between((offsets[1]+this.element.offsetHeight)-pointer[1],0,this.options.bottom)){cursor+="s";}if(this.between(pointer[0]-offsets[0],0,this.options.left)){cursor+="w";}if(this.between((offsets[0]+this.element.offsetWidth)-pointer[0],0,this.options.right)){cursor+="e";}return cursor;},cursor:function(event){var cursor=this.directions(event);if(cursor.length>0){cursor+="-resize";}else{cursor="";}this.element.style.cursor=cursor;},update:function(event){if(this.active){if(!this.resizing){var style=this.element.style;this.resizing=true;if(Element.getStyle(this.element,"position")==""){style.position="relative";}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);style.zIndex=this.options.zindex;}}this.draw(event);if(this.options.duringresize){this.options.duringresize(this.element);}if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0);}Event.stop(event);return false;}}};var EventSelectors={version:"1.0_pre",cache:[],start:function(rules){this.rules=rules||{};this.timer=new Array();this._extendRules();this.assign(this.rules);},assign:function(rules){var observer=null;this._unloadCache();rules._each(function(rule){var selectors=$A(rule.key.split(","));selectors.each(function(selector){var pair=selector.split(":");var event=pair[1];$$(pair[0]).each(function(element){if(pair[1]==""||pair.length==1){return rule.value(element);}if(event.toLowerCase()=="loaded"){this.timer[pair[0]]=setInterval(this._checkLoaded.bind(this,element,pair[0],rule),15);}else{observer=function(event){if(element.nodeType==3){element=element.parentNode;}rule.value($(element),event);};this.cache.push([element,event,observer]);Event.observe(element,event,observer);}}.bind(this));}.bind(this));}.bind(this));},_unloadCache:function(){if(!this.cache){return ;}for(var i=0;i<this.cache.length;i++){Event.stopObserving.apply(this,this.cache[i]);this.cache[i][0]=null;}this.cache=[];},_checkLoaded:function(element,timer,rule){var node=$(element);if(element.tagName!="undefined"){clearInterval(this.timer[timer]);rule.value(node);}},_extendRules:function(){Object.extend(this.rules,{_each:function(iterator){for(key in this){if(key=="_each"){continue;}var value=this[key];var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}}});}};Ajax.Responders.register({});Object.Event={extend:function(object){object._objectEventSetup=function(event_name){this._observers=this._observers||{};this._observers[event_name]=this._observers[event_name]||[];};object.observe=function(event_name,observer){if(typeof (event_name)=="string"&&typeof (observer)!="undefined"){this._objectEventSetup(event_name);if(!this._observers[event_name].include(observer)){this._observers[event_name].push(observer);}}else{for(var e in event_name){this.observe(e,event_name[e]);}}};object.stopObserving=function(event_name,observer){this._objectEventSetup(event_name);this._observers[event_name]=this._observers[event_name].without(observer);};object.notify=function(event_name){this._objectEventSetup(event_name);var collected_return_values=[];var args=$A(arguments).slice(1);try{for(var i=0;i<this._observers[event_name].length;++i){collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args)||null);}}catch(e){if(e==$break){return false;}else{throw e;}}return collected_return_values;};if(object.prototype){object.prototype._objectEventSetup=object._objectEventSetup;object.prototype.observe=object.observe;object.prototype.stopObserving=object.stopObserving;object.prototype.notify=function(event_name){if(object.notify){var args=$A(arguments).slice(1);args.unshift(this);args.unshift(event_name);object.notify.apply(object,args);}this._objectEventSetup(event_name);var args=$A(arguments).slice(1);var collected_return_values=[];try{if(this.options&&this.options[event_name]&&typeof (this.options[event_name])=="function"){collected_return_values.push(this.options[event_name].apply(this,args)||null);}for(var i=0;i<this._observers[event_name].length;++i){collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args)||null);}}catch(e){if(e==$break){return false;}else{throw e;}}return collected_return_values;};}}};if(typeof (Control)=="undefined"){Control={};}Control.Modal=Class.create();Object.extend(Control.Modal,{loaded:false,loading:false,loadingTimeout:false,overlay:false,container:false,current:false,ie:false,effects:{containerFade:false,containerAppear:false,overlayFade:false,overlayAppear:false},targetRegexp:/#(.+)$/,imgRegexp:/\.(jpe?g|gif|png|tiff?)$/,overlayStyles:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:9998},overlayIEStyles:{position:"absolute",top:0,left:0,zIndex:9998},disableHoverClose:false,load:function(){if(!Control.Modal.loaded){Control.Modal.loaded=true;Control.Modal.ie=!(typeof document.body.style.maxHeight!="undefined");Control.Modal.overlay=$(document.createElement("div"));Control.Modal.overlay.id="modal_overlay";Object.extend(Control.Modal.overlay.style,Control.Modal["overlay"+(Control.Modal.ie?"IE":"")+"Styles"]);Control.Modal.overlay.hide();Control.Modal.container=$(document.createElement("div"));Control.Modal.container.id="modal_container";Control.Modal.container.hide();Control.Modal.loading=$(document.createElement("div"));Control.Modal.loading.id="modal_loading";Control.Modal.loading.hide();var body_tag=document.getElementsByTagName("body")[0];body_tag.appendChild(Control.Modal.overlay);body_tag.appendChild(Control.Modal.container);body_tag.appendChild(Control.Modal.loading);Control.Modal.container.observe("mouseout",function(event){if(!Control.Modal.disableHoverClose&&Control.Modal.current&&Control.Modal.current.options.hover&&!Position.within(Control.Modal.container,Event.pointerX(event),Event.pointerY(event))){Control.Modal.close();}});}},open:function(contents,options){options=options||{};if(!options.contents){options.contents=contents;}var modal_instance=new Control.Modal(false,options);modal_instance.open();return modal_instance;},close:function(force){if(typeof (force)!="boolean"){force=false;}if(Control.Modal.current){Control.Modal.current.close(force);}},attachEvents:function(){Event.observe(window,"load",Control.Modal.load);},center:function(element){if(!element._absolutized){element.setStyle({position:"absolute"});element._absolutized=true;}var dimensions=element.getDimensions();Position.prepare();var offset_left=(Position.deltaX+Math.floor((Control.Modal.getWindowWidth()-dimensions.width)/2));var offset_top=(Position.deltaY+((Control.Modal.getWindowHeight()>dimensions.height)?Math.floor((Control.Modal.getWindowHeight()-dimensions.height)/2):0));element.setStyle({top:((dimensions.height<=Control.Modal.getDocumentHeight())?((offset_top!=null&&offset_top>0)?offset_top:"0")+"px":0),left:((dimensions.width<=Control.Modal.getDocumentWidth())?((offset_left!=null&&offset_left>0)?offset_left:"0")+"px":0)});},getWindowWidth:function(){return(self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0);},getWindowHeight:function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0);},getDocumentWidth:function(){return Math.min(document.body.scrollWidth,Control.Modal.getWindowWidth());},getDocumentHeight:function(){return Math.max(document.body.scrollHeight,Control.Modal.getWindowHeight());},onKeyDown:function(event){if(event.keyCode==Event.KEY_ESC){Control.Modal.close();}}});Object.extend(Control.Modal.prototype,{mode:"",html:false,href:"",element:false,src:false,imageLoaded:false,ajaxRequest:false,initialize:function(element,options){this.element=$(element);this.options={beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,beforeImageLoad:Prototype.emptyFunction,afterImageLoad:Prototype.emptyFunction,autoOpenIfLinked:true,contents:false,loading:false,fade:false,fadeDuration:0.75,image:false,imageCloseOnClick:true,hover:false,iframe:false,disableWindowObserver:false,iframeTemplate:new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0" id="#{id}"></iframe>'),evalScripts:true,requestOptions:{},overlayDisplay:true,overlayClassName:"",overlayCloseOnClick:true,containerClassName:"",opacity:0.8,zIndex:9998,ignoreZIndex:false,width:null,height:null,offsetLeft:0,offsetTop:0,position:"absolute"};Object.extend(this.options,options||{});var target_match=false;var image_match=false;if(this.element){target_match=Control.Modal.targetRegexp.exec(this.element.href);image_match=Control.Modal.imgRegexp.exec(this.element.href);}if(this.options.position=="mouse"){this.options.hover=true;}if(this.options.contents){this.mode="contents";}else{if(this.options.image||image_match){this.mode="image";this.src=this.element.href;}else{if(target_match){this.mode="named";var x=$(target_match[1]);this.html=x.innerHTML;x.remove();this.href=target_match[1];}else{this.mode=(this.options.iframe)?"iframe":"ajax";this.href=this.element.href;}}}if(this.element){if(this.options.hover){this.element.observe("mouseover",this.open.bind(this));this.element.observe("mouseout",function(event){if(!Position.within(Control.Modal.container,Event.pointerX(event),Event.pointerY(event))){this.close();}}.bindAsEventListener(this));}else{this.element.onclick=function(event){this.open();Event.stop(event);return false;}.bindAsEventListener(this);}}var targets=Control.Modal.targetRegexp.exec(window.location);this.position=function(event){if(this.options.position=="absolute"){Control.Modal.center(Control.Modal.container);}else{if(this.options.position!="fixed"){var xy=(event&&this.options.position=="mouse"?[Event.pointerX(event),Event.pointerY(event)]:Position.cumulativeOffset(this.element));Control.Modal.container.setStyle({position:"absolute",top:xy[1]+(typeof (this.options.offsetTop)=="function"?this.options.offsetTop():this.options.offsetTop)+"px",left:xy[0]+(typeof (this.options.offsetLeft)=="function"?this.options.offsetLeft():this.options.offsetLeft)+"px"});}}if(Control.Modal.ie){Control.Modal.overlay.setStyle({height:Control.Modal.getDocumentHeight()+"px",width:Control.Modal.getDocumentWidth()+"px"});}}.bind(this);if(this.mode=="named"&&this.options.autoOpenIfLinked&&targets&&targets[1]&&targets[1]==this.href){this.open();}},showLoadingIndicator:function(){if(this.options.loading){Control.Modal.loadingTimeout=window.setTimeout(function(){var modal_image=$("modal_image");if(modal_image){modal_image.hide();}Control.Modal.loading.style.zIndex=this.options.zIndex;Control.Modal.loading.update('<div id ="modal_loading_message">Downloading the internets, holding the horses<br/><small>(waiting for some other website)</small></div><img id="modal_lol" src="'+this.options.loading+'"/>');Control.Modal.loading.show();Control.Modal.center(Control.Modal.loading);}.bind(this),250);}},hideLoadingIndicator:function(){if(this.options.loading){if(Control.Modal.loadingTimeout){window.clearTimeout(Control.Modal.loadingTimeout);}var modal_image=$("modal_image");if(modal_image){modal_image.show();}Control.Modal.loading.hide();}},showCloseButton:function(){var _closeSettings={href:"#",onclick:"javascript:Control.Modal.close(); return false;"};var _cb=Builder.node("div",{id:"modal_close_button"},[Builder.node("a",_closeSettings,"close"),Builder.node("a",_closeSettings,[Builder.node("div",{className:"Sprites closeButtonSm"})])]);Control.Modal.container.appendChild(_cb);},open:function(force){if(!force&&this.notify("beforeOpen")===false){return ;}if(!Control.Modal.loaded){Control.Modal.load();}Control.Modal.close();if(!this.options.hover){Event.observe($(document.getElementsByTagName("body")[0]),"keydown",Control.Modal.onKeyDown);}Control.Modal.current=this;if(!this.options.hover){Control.Modal.overlay.setStyle({zIndex:this.options.zIndex});}Control.Modal.container.setStyle({width:(this.options.width?(typeof (this.options.width)=="function"?this.options.width():this.options.width)+"px":null),height:(this.options.height?(typeof (this.options.height)=="function"?this.options.height():this.options.height)+"px":null)});if(Control.Modal.ie&&!this.options.hover){$A(document.getElementsByTagName("select")).each(function(select){select.style.visibility="hidden";});}if(!this.options.ignoreZIndex){Control.Modal.container.setStyle({zIndex:this.options.zIndex+1});}Control.Modal.overlay.addClassName(this.options.overlayClassName);Control.Modal.container.addClassName(this.options.containerClassName);switch(this.mode){case"image":this.imageLoaded=false;this.notify("beforeImageLoad");this.showLoadingIndicator();var img=document.createElement("img");img.onload=function(img){if(img.width>640){var w=img.width;img.width=640;img.height=img.height*(img.width/w);}if(img.height>480){var h=img.height;img.height=480;img.width=img.width*(img.height/h);}this.hideLoadingIndicator();this.update([img]);if(this.options.imageCloseOnClick){$(img).observe("click",Control.Modal.close);}this.position();this.notify("afterImageLoad");img.onload=null;this.showCloseButton();}.bind(this,img);img.src=this.src;img.id="modal_image";break;case"ajax":this.notify("beforeLoad");var options={method:"post",onSuccess:function(request){this.hideLoadingIndicator();this.update(request.responseText);this.notify("onSuccess",request);this.ajaxRequest=false;}.bind(this),onFailure:function(){this.notify("onFailure");}.bind(this),onException:function(){this.notify("onException");}.bind(this)};Object.extend(options,this.options.requestOptions);this.showLoadingIndicator();this.ajaxRequest=new Ajax.Request(this.href,options);break;case"iframe":if(this.options.forceLoading){this.showLoadingIndicator();}this.update(this.options.iframeTemplate.evaluate({href:this.href,id:"modal_iframe"}));if(this.options.closeButton){this.showCloseButton();}break;case"contents":this.update((typeof (this.options.contents)=="function"?this.options.contents():this.options.contents));if(this.options.closeButton){this.showCloseButton();}break;case"named":this.update(this.html);break;}if(!this.options.hover){if(this.options.overlayCloseOnClick&&this.options.overlayDisplay){Control.Modal.overlay.observe("click",Control.Modal.close);}if(this.options.overlayDisplay){if(this.options.fade){if(Control.Modal.effects.overlayFade){Control.Modal.effects.overlayFade.cancel();}Control.Modal.effects.overlayAppear=new Effect.Appear(Control.Modal.overlay,{queue:{position:"front",scope:"Control.Modal"},to:this.options.opacity,duration:this.options.fadeDuration/2});}else{Control.Modal.overlay.show();}}}if(this.options.position=="mouse"){this.mouseHoverListener=this.position.bindAsEventListener(this);this.element.observe("mousemove",this.mouseHoverListener);}this.notify("afterOpen");},update:function(html){if(typeof (html)=="string"){Control.Modal.container.update(html);}else{Control.Modal.container.update("");(html.each)?html.each(function(node){Control.Modal.container.appendChild(node);}):Control.Modal.container.appendChild(node);}if(this.options.fade){if(Control.Modal.effects.containerFade){Control.Modal.effects.containerFade.cancel();}Control.Modal.effects.containerAppear=new Effect.Appear(Control.Modal.container,{queue:{position:"end",scope:"Control.Modal"},to:1,duration:this.options.fadeDuration/2});}else{Control.Modal.container.show();}this.position();if(!this.options.disableWindowObserver){Event.observe(window,"resize",this.position,false);Event.observe(window,"scroll",this.position,false);}},close:function(force){if(!force&&this.notify("beforeClose")===false){return ;}if($("videoPlayback")){$("videoPlayback").setStyle({visibility:"visible"});}if(this.ajaxRequest){this.ajaxRequest.transport.abort();}this.hideLoadingIndicator();if(this.mode=="image"){var modal_image=$("modal_image");if(this.options.imageCloseOnClick&&modal_image){modal_image.stopObserving("click",Control.Modal.close);}}if(Control.Modal.ie&&!this.options.hover){$A(document.getElementsByTagName("select")).each(function(select){select.style.visibility="visible";});}if(!this.options.hover){Event.stopObserving(window,"keyup",Control.Modal.onKeyDown);}Control.Modal.current=false;Event.stopObserving(window,"resize",this.position,false);Event.stopObserving(window,"scroll",this.position,false);if(!this.options.hover){if(this.options.overlayCloseOnClick&&this.options.overlayDisplay){Control.Modal.overlay.stopObserving("click",Control.Modal.close);}if(this.options.overlayDisplay){if(this.options.fade){if(Control.Modal.effects.overlayAppear){Control.Modal.effects.overlayAppear.cancel();}Control.Modal.effects.overlayFade=new Effect.Fade(Control.Modal.overlay,{queue:{position:"end",scope:"Control.Modal"},from:this.options.opacity,to:0,duration:this.options.fadeDuration/2});}else{Control.Modal.overlay.hide();}}}if(this.options.fade){if(Control.Modal.effects.containerAppear){Control.Modal.effects.containerAppear.cancel();}Control.Modal.effects.containerFade=new Effect.Fade(Control.Modal.container,{queue:{position:"front",scope:"Control.Modal"},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){Control.Modal.container.update("");this.resetClassNameAndStyles();}.bind(this)});}else{Control.Modal.container.hide();Control.Modal.container.update("");this.resetClassNameAndStyles();}if(this.options.position=="mouse"){this.element.stopObserving("mousemove",this.mouseHoverListener);}this.notify("afterClose");},resetClassNameAndStyles:function(){Control.Modal.overlay.removeClassName(this.options.overlayClassName);Control.Modal.container.removeClassName(this.options.containerClassName);Control.Modal.container.setStyle({height:null,width:null,top:null,left:null});},notify:function(event_name){try{if(this.options[event_name]){return[this.options[event_name].apply(this.options[event_name],$A(arguments).slice(1))];}}catch(e){if(e!=$break){throw e;}else{return false;}}}});if(typeof (Object.Event)!="undefined"){Object.Event.extend(Control.Modal);}Control.Modal.attachEvents();var Validator=Class.create();Validator.prototype={initialize:function(className,error,test,options){if(typeof test=="function"){this.options=$H(options);this._test=test;}else{this.options=$H(test);this._test=function(){return true;};}this.error=error||__bundle.validationFailed;this.className=className;},test:function(v,elm){return(this._test(v,elm)&&this.options.all(function(p){return Validator.methods[p.key]?Validator.methods[p.key](v,elm,p.value):true;}));}};Validator.methods={pattern:function(v,elm,opt){return Validation.get("IsEmpty").test(v)||opt.test(v);},minLength:function(v,elm,opt){return v.length>=opt;},maxLength:function(v,elm,opt){return v.length<=opt;},min:function(v,elm,opt){return v>=parseFloat(opt);},max:function(v,elm,opt){return v<=parseFloat(opt);},notOneOf:function(v,elm,opt){return $A(opt).all(function(value){return v!=value;});},oneOf:function(v,elm,opt){return $A(opt).any(function(value){return v==value;});},is:function(v,elm,opt){return v==opt;},isNot:function(v,elm,opt){return v!=opt;},equalToField:function(v,elm,opt){return v==$F(opt);},notEqualToField:function(v,elm,opt){return v!=$F(opt);},include:function(v,elm,opt){return $A(opt).all(function(value){return Validation.get(value).test(v,elm);});}};var Validation=Class.create();Validation.prototype={initialize:function(form,options){this.options=Object.extend({onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,onFormValidate:function(result,form){},onElementValidate:function(result,elm){}},options||{});this.form=$(form);Validation.addInstance(form.id,this);if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false);}if(this.options.immediate){var useTitles=this.options.useTitles;var callback=this.options.onElementValidate;Form.getElements(this.form).each(function(input){Event.observe(input,"blur",function(ev){Validation.validate(Event.element(ev),{useTitle:useTitles,onElementValidate:callback});});});}},onSubmit:function(ev){if(this.isDisabled){return ;}if(!this.validate()){Event.stop(ev);}},disable:function(){this.isDisabled=true;Event.stopObserving(this.form,"submit",this.onSubmit);this.onSubmit=null;},validate:function(){var result=false;var useTitles=this.options.useTitles;var callback=this.options.onElementValidate;try{if(this.options.stopOnFirst){result=Form.getElements(this.form).all(function(elm){return Validation.validate(elm,{useTitle:useTitles,onElementValidate:callback});});}else{result=Form.getElements(this.form).collect(function(elm){return Validation.validate(elm,{useTitle:useTitles,onElementValidate:callback});}).all();}if(!result&&this.options.focusOnError){Form.getElements(this.form).findAll(function(elm){return $(elm).hasClassName("validation-failed");}).first().focus();}this.options.onFormValidate(result,this.form);return result;}catch(e){throw (e);}},reset:function(){Form.getElements(this.form).each(Validation.reset);}};Object.extend(Validation,{validate:function(elm,options){options=Object.extend({useTitle:false,onElementValidate:function(result,elm){}},options||{});elm=current.utils.Compatibility.convertElement(elm);var cn=elm.classNames();return result=cn.all(function(value){var test=Validation.test(value,elm,options.useTitle,options.hideAdvice);options.onElementValidate(test,elm);return test;});},test:function(name,elm,useTitle,hideAdvice){var v=Validation.get(name);var prop="__advice"+name.camelize();try{if(Validation.isVisible(elm)&&!v.test($F(elm),elm)){if(!elm[prop]&&(hideAdvice==null||hideAdvice==false)){var advice=Validation.getAdvice(name,elm);if(advice==null){var errorMsg=useTitle?((elm&&elm.title)?elm.title:v.error):v.error;advice='<div class="validation-advice error" id="advice-'+name+"-"+Validation.getElmID(elm)+'" style="display:none">'+errorMsg+"</div>";switch(elm.type.toLowerCase()){case"checkbox":case ("radio"&&!elm.hasClassName("globalAdvice")):var p=elm.parentNode;if(p){new Insertion.Bottom(p,advice);}else{new Insertion.After(elm,advice);}break;default:if(elm.hasClassName("globalAdvice")){if($("globalAdvice")){new Insertion.Bottom($("globalAdvice"),advice);}}else{new Insertion.After(elm,advice);}}advice=Validation.getAdvice(name,elm);}if(typeof Effect=="undefined"){advice.style.display="block";}else{new Effect.Appear(advice,{duration:1});}}elm[prop]=true;elm.removeClassName("validation-passed");elm.addClassName("validation-failed");return false;}else{var advice=Validation.getAdvice(name,elm);if(advice!=null){advice.hide();}elm[prop]="";elm.removeClassName("validation-failed");elm.addClassName("validation-passed");return true;}}catch(e){throw (e);}},isVisible:function(elm){while(elm.tagName!="BODY"){if(!$(elm).visible()){return false;}elm=elm.parentNode;}return true;},getAdvice:function(name,elm){return $("advice-"+name+"-"+Validation.getElmID(elm))||$("advice-"+Validation.getElmID(elm));},getElmID:function(elm){return elm.id?elm.id:elm.name;},reset:function(elm){elm=$(elm);var cn=elm.classNames();cn.each(function(value){var prop="__advice"+value.camelize();if(elm[prop]){var advice=Validation.getAdvice(value,elm);if(advice){advice.hide();elm[prop]="";}}elm.removeClassName("validation-failed");elm.removeClassName("validation-passed");});},add:function(className,error,test,options){var nv={};nv[className]=new Validator(className,error,test,options);Object.extend(Validation.methods,nv);},addAllThese:function(validators){var nv={};$A(validators).each(function(value){nv[value[0]]=new Validator(value[0],value[1],value[2],(value.length>3?value[3]:{}));});Object.extend(Validation.methods,nv);},get:function(name){return Validation.methods[name]?Validation.methods[name]:Validation.methods._LikeNoIDIEverSaw_;},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})},instances:{},addInstance:function(id,instance){this.instances[id]=instance;},getInstance:function(id){return this.instances[id];},throwError:function(target,errMsg){var id="thrownError"+Math.round(Math.random()*1000);var advice='<div id="'+id+'" class="validation-advice error" style="display: none">'+errMsg+"</div>";new Insertion.After(target,advice);Effect.BlindDown(id,{duration:0.5});return $(id);}});Validation.add("IsEmpty","",function(v){return((v==null)||(v.length==0)||/^\s+$/.test(v));});Validation.addAllThese([["required",__bundle["validate.required"],function(v){return !Validation.get("IsEmpty").test(v);}],["validate-description",__bundle["validate.description"],function(v){return !Validation.get("IsEmpty").test(v);}],["validate-tags",__bundle["validate.tags"],function(v){return !Validation.get("IsEmpty").test(v);}],["validate-isNotHint",__bundle["validate.isNotHint"],function(v,elm){return(v!=elm.title);}],["validate-isNotEmptyHint",__bundle["validate.isNotEmptyHint"],function(v,elm){return(v.replace(/^\s+|\s+$/g,"")!=elm.title.replace(/^\s+|\s+$/g,""));}],["validate-number",__bundle["validate.number"],function(v){return Validation.get("IsEmpty").test(v)||(!isNaN(v)&&!/^\s+$/.test(v));}],["validate-digits",__bundle["validate.digits"],function(v){return Validation.get("IsEmpty").test(v)||!/[^\d]/.test(v);}],["validate-alpha",__bundle["validate.alpha"],function(v){return Validation.get("IsEmpty").test(v)||/^[a-zA-Z]+$/.test(v);}],["validate-alphanum",__bundle["validate.alphanum"],function(v){return Validation.get("IsEmpty").test(v)||!/\W/.test(v);}],["validate-username",__bundle["validate.username"],function(v){return Validation.get("IsEmpty").test(v)||/^[a-zA-Z0-9_]+$/.test(v);}],["validate-date",__bundle["validate.date"],function(v){var test=new Date(v);return Validation.get("IsEmpty").test(v)||!isNaN(test);}],["validate-email",__bundle["validate.email"],function(v){return Validation.get("IsEmpty").test(v)||/^(("[\w-\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i.test(v);}],["validate-email-list",__bundle["validate.email-list"],function(v){if(Validation.get("IsEmpty").test(v)){return false;}var emails=v.split(",");for(var i=0;i<emails.length;i++){emails[i]=emails[i].strip();if(!(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(emails[i]))){return false;}}return true;}],["validate-url",__bundle["validate.url"],function(v){return Validation.get("IsEmpty").test(v)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(v);}],["validate-strictUrl",__bundle["validate.url"],function(v){return Validation.get("IsEmpty").test(v)||/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.;\d\w]|%[a-fA-f\d]{2,2})*)*(\??(&?([-+_~.;\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.;\d\w]|%[a-fA-f\d]{2,2})*)?$/.test(v);}],["validate-selection",__bundle["validate.selection"],function(v,elm){return elm.options?elm.selectedIndex>0:!Validation.get("IsEmpty").test(v);}],["validation-selection-withTitles",__bundle["validate.selection-withTitles"],function(v,elm){return elm.options?(elm.selectedIndex>0&&v!=-1):!Validation.get("IsEmpty").test(v);}],["validate-one-required",__bundle["validate.one-required"],function(v,elm){var p=elm.parentNode.parentNode;var options=p.getElementsByTagName("INPUT");return $A(options).any(function(elm){return $F(elm);});}],["validate-zip5-US",__bundle["validate.zipCode"],{minLength:5,maxLength:5,pattern:new RegExp("^[0-9]+$","gi")}],["validate-birthYear",__bundle["validate.birthYear"]+" "+((new Date()).getFullYear()-1),{minLength:4,min:1899,max:((new Date()).getFullYear()-1)}],["validate-password",__bundle["validate.password"],{minLength:4}],["validate-min3","3 "+__bundle["validate.minCharacter"],{minLength:3}],["validate-interestNameLength","100 "+__bundle["validate.maxCharacter"],{maxLength:100}],["validate-max20","20 "+__bundle["validate.maxCharacter"],{maxLength:20}],["validate-max30","30 "+__bundle["validate.maxCharacter"],{maxLength:30}],["validate-max50","50 "+__bundle["validate.maxCharacter"],{maxLength:50}],["validate-max60","60 "+__bundle["validate.maxCharacter"],{maxLength:60}],["validate-max75","75 "+__bundle["validate.maxCharacter"],{maxLength:75}],["validate-max90","90 "+__bundle["validate.maxCharacter"],{maxLength:90}],["validate-max120","120 "+__bundle["validate.maxCharacter"],{maxLength:120}],["validate-max200","200 "+__bundle["validate.maxCharacter"],{maxLength:200}],["validate-max255","250 "+__bundle["validate.maxCharacter"],{maxLength:250}],["validate-max255","255 "+__bundle["validate.maxCharacter"],{maxLength:255}],["validate-max420","420 "+__bundle["validate.maxCharacter"],{maxLength:420}],["validate-max500","500 "+__bundle["validate.maxCharacter"],{maxLength:500}],["validate-max1000","1000 "+__bundle["validate.maxCharacter"],{maxLength:1000}],["validate-max1500","1500 "+__bundle["validate.maxCharacter"],{maxLength:1500}],["validate-max2000","2000 "+__bundle["validate.maxCharacter"],{maxLength:2000}],["validate-max3000","3000 "+__bundle["validate.maxCharacter"],{maxLength:3000}],["validate-max4000","4000 "+__bundle["validate.maxCharacter"],{maxLength:4000}],["validate-max8000","8000 "+__bundle["validate.maxCharacter"],{maxLength:8000}],["validate-max10000","10000 "+__bundle["validate.maxCharacter"],{maxLength:10000}],["validate-max32000","16000 "+__bundle["validate.maxCharacter"],{maxLength:16000}],["validate-max32000","32000 "+__bundle["validate.maxCharacter"],{maxLength:32000}],["validate-max64000","64000 "+__bundle["validate.maxCharacter"],{maxLength:64000}],["validate-imageType",__bundle["validate.imageType"],function(v){var v=v.toLowerCase();if(v!=""&&(v.indexOf(".jpg")==-1&&v.indexOf(".gif")==-1&&v.indexOf("jpeg")==-1&&v.indexOf(".png")==-1)){return false;}return true;}],["validate-excelFile",__bundle["validate.excelFile"],function(v){var v=v.toLowerCase();if(v!=""&&(v.indexOf(".xls")==-1)){return false;}return true;}],["validate-excelOrXmlFile",__bundle["validate.excelOrXmlFile"],function(v){var v=v.toLowerCase();if(v!=""&&(v.indexOf(".xls")==-1)&&(v.indexOf(".xml")==-1)){return false;}return true;}]]);if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return ;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';_19+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var _1a=this.getParams();for(var key in _1a){_19+=[key]+'="'+_1a[key]+'" ';}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+='flashvars="'+_1c+'"';}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';_19+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var _1d=this.getParams();for(var key in _1d){_19+='<param name="'+key+'" value="'+_1d[key]+'" />';}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+='<param name="flashvars" value="'+_1f+'" />';}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var LazyLoader={};LazyLoader.timer={};LazyLoader.scripts=[];LazyLoader.load=function(url,callback){var classname=null;var properties=null;try{if($A(LazyLoader.scripts).indexOf(url)==-1){LazyLoader.scripts.push(url);var script=document.createElement("script");script.src=url;script.type="text/javascript";$$("head")[0].appendChild(script);if(callback){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){callback();}};script.onload=function(){callback();return ;};if((Prototype.Browser.WebKit&&!navigator.userAgent.match(/Version\/3/))||Prototype.Browser.Opera){LazyLoader.timer[url]=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(LazyLoader.timer[url]);callback();}},10);}}}else{if(callback){callback();}}}catch(e){alert(e);}};var Scroller=Class.create();Scroller.ids=new Object();Scroller.i=0;Scroller.prototype={initialize:function(el){this.outerBox=el;this.decorate();},decorate:function(){$(this.outerBox).makePositioned();Scroller.i=Scroller.i+1;this.myIndex=Scroller.i;this.innerBox=document.createElement("DIV");this.innerBox.className="scroll-innerBox";$(this.innerBox).makePositioned();this.innerBox.style.cssFloat=this.innerBox.style.styleFloat="left";this.innerBox.id="scroll-innerBox-"+Scroller.i;this.innerBox.style.top="0px";while(this.outerBox.hasChildNodes()){this.innerBox.appendChild(this.outerBox.firstChild);}this.innerBox.style.overflow="hidden";this.outerBox.style.overflow="hidden";this.track=document.createElement("div");this.track.className="scroll-track";$(this.track).makePositioned();this.track.style.cssFloat=this.track.style.styleFloat="left";this.track.id="scroll-track-"+Scroller.i;this.track.appendChild(document.createComment(""));this.tracktop=document.createElement("div");this.tracktop.className="scroll-track-top";$(this.tracktop).makePositioned();this.tracktop.style.cssFloat=this.tracktop.style.styleFloat="left";this.tracktop.id="scroll-track-top-"+Scroller.i;this.tracktop.appendChild(document.createComment(""));this.trackbot=document.createElement("div");this.trackbot.className="scroll-track-bot";$(this.trackbot).makePositioned();this.trackbot.style.cssFloat=this.trackbot.style.styleFloat="left";this.trackbot.id="scroll-track-bot-"+Scroller.i;this.trackbot.appendChild(document.createComment(""));this.handle=document.createElement("div");this.handle.className="scroll-handle-container";this.handle.id="scroll-handle-container"+Scroller.i;this.handle_middle=document.createElement("div");this.handle_middle.className="scroll-handle";$(this.handle_middle).makePositioned();this.handle_middle.id="scroll-handle-"+Scroller.i;this.handle_middle.appendChild(document.createComment(""));this.handletop=document.createElement("div");this.handletop.className="scroll-handle-top";$(this.handletop).makePositioned();this.handletop.id="scroll-handle-top-"+Scroller.i;this.handletop.appendChild(document.createComment(""));this.handlebot=document.createElement("div");this.handlebot.className="scroll-handle-bot";$(this.handlebot).makePositioned();this.handlebot.id="scroll-handle-bot-"+Scroller.i;this.handlebot.appendChild(document.createComment(""));this.track.hide();this.tracktop.hide();this.trackbot.hide();this.outerBox.appendChild(this.innerBox);this.outerBox.appendChild(this.tracktop);this.handle.appendChild(this.handletop);this.handle.appendChild(this.handle_middle);this.handle.appendChild(this.handlebot);this.track.appendChild(this.handle);this.outerBox.appendChild(this.track);this.outerBox.appendChild(this.trackbot);this.slider=new Control.Slider($(this.handle).id,$(this.track).id,{axis:"vertical",minimum:0,maximum:$(this.outerBox).clientHeight});this.slider.options.onSlide=this.slider.options.onChange=this.onChange.bind(this);setTimeout(this.resetScrollbar.bind(this,false),10);this.domMouseCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.mouseWheelCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.trackTopCB=this.tracktopEvent.bindAsEventListener(this,this.slider);this.trackBotCB=this.trackbotEvent.bindAsEventListener(this,this.slider);$(this.outerBox).observe("DOMMouseScroll",this.domMouseCB);$(this.outerBox).observe("mousewheel",this.mouseWheelCB);$(this.tracktop).observe("mousedown",this.trackTopCB);$(this.trackbot).observe("mousedown",this.trackBotCB);},release:function(){$(this.outerBox).stopObserving("DOMMouseScroll",this.domMouseCB);$(this.outerBox).stopObserving("mousewheel",this.mouseWheelCB);$(this.tracktop).stopObserving("mousedown",this.trackTopCB);$(this.trackbot).stopObserving("mousedown",this.trackBotCB);},slideToTop:function(){this.slider.setValue(0);},resetScrollbar:function(repeat){this.track.hide();this.tracktop.hide();this.trackbot.hide();this.enableScroll=false;this.innerHeight=$(this.outerBox).clientHeight;this.innerBox.style.height=this.innerHeight+"px";var newWidth=$(this.outerBox).clientWidth;var tth=Element.getStyle(this.tracktop,"height");if(tth){tth=tth.replace("px","");}else{tth=0;}var hth=Element.getStyle(this.handletop,"height");if(hth){hth=hth.replace("px","");}else{hth=0;}if(this.innerHeight<this.innerBox.scrollHeight){this.viewportHeight=this.innerHeight-tth*2;this.slider.trackLength=this.viewportHeight;this.track.style.height=this.viewportHeight+"px";this.handleHeight=Math.round(this.viewportHeight*this.innerHeight/this.innerBox.scrollHeight);if(this.handleHeight<(hth*2)){this.handleHeight=(hth*2);}if(this.handleHeight<10){this.handleHeight=10;}this.handle.style.height=this.handleHeight+"px";this.handle_middle.style.height=this.handleHeight-hth*2+"px";this.handletop.style.height=hth+"px";this.slider.handleLength=this.handleHeight;this.track.style.display="inline";this.tracktop.style.display="inline";this.trackbot.style.display="inline";this.ieDecreaseBy=1;if(this.outerBox.currentStyle){var borderWidth=this.outerBox.currentStyle.borderWidth.replace("px","");if(!isNaN(borderWidth)){this.ieDecreaseBy=(borderWidth)*2;}}newWidth=($(this.outerBox).clientWidth-$(this.track).clientWidth-this.ieDecreaseBy);this.enableScroll=true;}this.innerBox.style.width=newWidth+"px";if(repeat){setTimeout(this.resetScrollbar.bind(this,false),10);}},MouseWheelEvent:function(event,slider){var delta=0;if(!event){event=window.event;}if(event.wheelDelta){delta=event.wheelDelta/120;}else{if(event.detail){delta=-event.detail/3;}}if(delta){slider.setValueBy(-delta/100);}Event.stop(event);},trackbotEvent:function(event,slider){if(Event.isLeftClick(event)){slider.setValueBy(0.2);Event.stop(event);}},tracktopEvent:function(event,slider){if(Event.isLeftClick(event)){slider.setValueBy(-0.2);Event.stop(event);}},onChange:function(val){if(this.enableScroll){this.innerBox.scrollTop=Math.round(val*(this.innerBox.scrollHeight-this.innerBox.offsetHeight));}}};Scroller.setAll=function(){$$(".makeScroll").each(function(item){Scroller.ids[item.id]=new Scroller(item);});};Scroller.updateAll=function(){$H(Scroller.ids).each(function(pair){Scroller.ids[pair.key].resetScrollbar(true);});};Scroller.reset=function(body_id){if($(body_id).className.match(new RegExp("(^|\\s)makeScroll(\\s|$)"))){if(Scroller.ids[body_id]){Scroller.ids[body_id].release();}Scroller.ids[body_id]=new Scroller($(body_id));}};Scroller.scrollToTop=function(body_id){if($(body_id).className.match(new RegExp("(^|\\s)makeScroll(\\s|$)"))){if(Scroller.ids[body_id]){Scroller.ids[body_id].slideToTop();}}};Event.observe(window,"load",Scroller.setAll);Event.observe(window,"resize",Scroller.updateAll);(function colorPickerNamespace(){var cp=null;var colorNames={aliceblue:"F0F8FF",darkslategray:"2F4F4F",lightsalmon:"FFA07A",palevioletred:"DB7093",antiquewhite:"FAEBD7",darkturquoise:"00CED1",lightseagreen:"20B2AA",papayawhip:"FFEFD5",aqua:"00FFFF",darkviolet:"9400D3",lightskyblue:"87CEFA",peachpuff:"FFDAB9",aquamarine:"7FFFD4",deeppink:"FF1493",lightslategray:"778899",peru:"CD853F",azure:"F0FFFF",deepskyblue:"00BFFF",lightsteelblue:"B0C4DE",pink:"FFC0CB",beige:"F5F5DC",dimgray:"696969",lightyellow:"FFFFE0",plum:"DDA0DD",bisque:"FFE4C4",dodgerblue:"1E90FF",lime:"00FF00",powderblue:"B0E0E6",black:"000000",firebrick:"B22222",limegreen:"32CD32",purple:"800080",blanchedalmond:"FFEBCD",floralwhite:"FFFAF0",linen:"FAF0E6",red:"FF0000",blue:"0000FF",forestgreen:"228B22",magenta:"FF00FF",rosybrown:"BC8F8F",blueviolet:"8A2BE2",fuchsia:"FF00FF",maroon:"800000",royalblue:"4169E1",brown:"A52A2A",gainsboro:"DCDCDC",mediumaquamarine:"66CDAA",saddlebrown:"8B4513",burlywood:"DEB887",ghostwhite:"F8F8FF",mediumblue:"0000CD",salmon:"FA8072",cadetblue:"5F9EA0",gold:"FFD700",mediumorchid:"BA55D3",sandybrown:"F4A460",chartreuse:"7FFF00",goldenrod:"DAA520",mediumpurple:"9370DB",seagreen:"2E8B57",chocolate:"D2691E",gray:"808080",mediumseagreen:"3CB371",seashell:"FFF5EE",coral:"FF7F50",green:"008000",mediumslateblue:"7B68EE",sienna:"A0522D",cornflowerblue:"6495ED",greenyellow:"ADFF2F",mediumspringgreen:"00FA9A",silver:"C0C0C0",cornsilk:"FFF8DC",honeydew:"F0FFF0",mediumturquoise:"48D1CC",skyblue:"87CEEB",crimson:"DC143C",hotpink:"FF69B4",mediumvioletred:"C71585",slateblue:"6A5ACD",cyan:"00FFFF",indianred:"CD5C5C",midnightblue:"191970",slategray:"708090",darkblue:"00008B",indigo:"4B0082",mintcream:"F5FFFA",snow:"FFFAFA",darkcyan:"008B8B",ivory:"FFFFF0",mistyrose:"FFE4E1",springgreen:"00FF7F",darkgoldenrod:"B8860B",khaki:"F0E68C",moccasin:"FFE4B5",steelblue:"4682B4",darkgray:"A9A9A9",lavender:"E6E6FA",navajowhite:"FFDEAD",tan:"D2B48C",darkgreen:"006400",lavenderblush:"FFF0F5",navy:"000080",teal:"008080",darkkhaki:"BDB76B",lawngreen:"7CFC00",oldlace:"FDF5E6",thistle:"D8BFD8",darkmagenta:"8B008B",lemonchiffon:"FFFACD",olive:"808000",tomato:"FD6347",darkolivegreen:"556B2F",lightblue:"ADD8E6",olivedrab:"6B8E23",turquoise:"40E0D0",darkorange:"FF8C00",lightcoral:"F08080",orange:"FFA500",violet:"EE82EE",darkorchid:"9932CC",lightcyan:"E0FFFF",orangered:"FF4500",wheat:"F5DEB3",darkred:"8B0000",lightgoldenrodyellow:"FAFAD2",orchid:"DA70D6",white:"FFFFFF",darksalmon:"E9967A",lightgreen:"90EE90",palegoldenrod:"EEE8AA",whitesmoke:"F5F5F5",darkseagreen:"8FBC8F",lightgrey:"D3D3D3",palegreen:"98FB98",yellow:"FFFF00",darkslateblue:"483D8B",lightpink:"FFB6C1",paleturquoise:"AFEEEE",yellowgreen:"9ACD32"};function hex(c){c=parseInt(c).toString(16);return c.length<2?"0"+c:c;}function mouseCoordinates(ev){ev=ev||window.event;if(ev.pageX||ev.pageY){return{x:ev.pageX,y:ev.pageY};}return{x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop};}function getPosition(obj){var left=0;var top=0;while(obj.offsetParent){left+=obj.offsetLeft;top+=obj.offsetTop;obj=obj.offsetParent;}left+=obj.offsetLeft;top+=obj.offsetTop;return{x:left,y:top};}function buildColorPicker(A){var aL=A.length,node,child,ref={},bRef=false;if(aL>=1){node=cE(A[0]);if(aL>=2){for(var arg in A[1]){var narg=arg;if(narg.indexOf("cp_")==0){narg=narg.substring(3);}if(narg.indexOf("on")==0){node[narg]=A[1][arg];}else{if(narg=="ref"){ref[A[1][arg]]=node;ref.DOM=node;bRef=true;}}if(narg=="style"){node.style.cssText=A[1][arg];}if(narg.toLowerCase()=="classname"){node.style.className=A[1][arg];node.setAttribute("class",A[1][arg]);}if(narg.indexOf("on")==-1&&narg.indexOf("ref")==-1&&narg!="style"&&narg!="classname"){node.setAttribute(narg,A[1][arg]);}}}for(var i=2;i<aL;i++){if(typeof (A[i])=="string"){node.appendChild(document.createTextNode(A[i]));}else{child=buildColorPicker(A[i]);if(child.DOM){bRef=true;for(n in child){if(n=="DOM"){node.appendChild(child[n]);}else{ref[n]=child[n];}}ref.DOM=node;}else{node.appendChild(child);}}}return bRef?ref:node;}return null;}function cE(){var A=arguments;if(!cE.cache[A[0]]){cE.cache[A[0]]=document.createElement(A[0]);}return cE.cache[A[0]].cloneNode(false);}cE.cache={};function createColorPicker(){if(cp){return ;}var imgBase=current.Constants.getInstance().getDatanodeUrl()+"/images/current/misc/colorpicker/";cp=buildColorPicker(["DIV",{cp_className:"colorpicker",cp_ref:"ColorPicker",cp_id:"colorpicker"},["DIV",{cp_className:"pickerContainer",cp_ref:"fColorPicker"},["DIV",{cp_className:"selectTextDiv"},"Select Color:"],["IMG",{cp_className:"lgBg",cp_src:imgBase+"lg_background.png",cp_width:260,cp_height:260}],["IMG",{cp_className:"lgBgOverlay",cp_src:imgBase+"lg_overlay.png",cp_width:256,cp_height:256,cp_ref:"fColorImg",cp_onmousedown:cpMouseDown,cp_onmouseup:cpMouseUp,cp_onclick:cpMouseClick}],["IMG",{cp_className:"colorSlider",cp_src:imgBase+"color_slider.png",cp_width:23,cp_height:260,cp_ref:"colorSlider",cp_onmousedown:cpSliderMouseDown,cp_onmouseup:cpSliderMouseUp,cp_onclick:cpSliderClick}],["IMG",{cp_className:"arrows",cp_src:imgBase+"arrows.gif",cp_width:41,cp_height:9,cp_ref:"Arrows",cp_onmousedown:cpSliderMouseDown,cp_onmouseup:cpSliderMouseUp,cp_onclick:cpSliderClick}],["IMG",{cp_className:"currBg",cp_src:imgBase+"cur_color_background.png",cp_width:62,cp_height:70}],["IMG",{cp_className:"imgWebSafe",cp_src:imgBase+"web_safe.gif",cp_width:14,cp_height:28,cp_title:"Click to Select Web Safe Color",cp_ref:"websafeImg",cp_onclick:selectWebSafeColor}],["DIV",{cp_className:"newColor",cp_ref:"curColorDiv",cp_title:"New Color"}],["DIV",{cp_className:"origColor",cp_ref:"OrigColorDiv",cp_title:"Original Color",cp_onclick:resetColor}],["DIV",{cp_className:"hexTitle"},"Hex:"],["DIV",{cp_className:"rTitle"},"R:"],["DIV",{cp_className:"gTitle"},"G:"],["DIV",{cp_className:"bTitle"},"B:"],["INPUT",{cp_className:"hexInput",cp_ref:"hexInput",cp_onchange:setCPHexColor}],["INPUT",{cp_className:"rInput",cp_ref:"rInput",cp_onchange:setCPColor}],["INPUT",{cp_className:"gInput",cp_ref:"gInput",cp_onchange:setCPColor}],["INPUT",{cp_className:"bInput",cp_ref:"bInput",cp_onchange:setCPColor}],["BUTTON",{cp_className:"okButton",cp_ref:"OK",cp_onclick:hColorPickerMouseDown},"OK"],["BUTTON",{cp_className:"cancelButton",cp_ref:"Cancel",cp_onclick:hideColorPicker},"Cancel"],["INPUT",{cp_className:"inputWebSafe",cp_type:"checkbox",cp_ref:"websafeCheckbox"}],["DIV",{cp_className:"webSafeTextDiv"},"Only Web Colors"],["IMG",{cp_src:imgBase+"mini_icon.png",cp_height:21,cp_width:21,cp_style:"display: none;",cp_ref:"fColorIcon"}]]]);document.onmousemove=cpMouseMove;cp.baseColor={r:0,g:0,b:0};document.observe("dom:loaded",appendColorPicker.bindAsEventListener(this));}function appendColorPicker(){document.body.appendChild(cp.ColorPicker);cp.ColorPicker.style.display="none";}function getHorizColor(i,width,height){var sWidth=(width)/7;var C=i%width;var R=Math.floor(i/(sWidth*7));var c=i%sWidth;var r,g,b,h;var l=(255/sWidth)*c;if(C>=sWidth*6){r=g=b=255-l;}else{h=255-l;r=C<sWidth?255:C<sWidth*2?h:C<sWidth*4?0:C<sWidth*5?l:255;g=C<sWidth?l:C<sWidth*3?255:C<sWidth*4?h:0;b=C<sWidth*2?0:C<sWidth*3?l:C<sWidth*5?255:h;if(R<(height/2)){var base=255-(255*2/height)*R;r=base+(r*R*2/height);g=base+(g*R*2/height);b=base+(b*R*2/height);}else{if(R>(height/2)){var base=(height-R)/(height/2);r=r*base;g=g*base;b=b*base;}}}return hex(r)+hex(g)+hex(b);}function getVertColor(i,sZ){var n=sZ/6,j=sZ/n,C=i,c=C%n;r=C<n?255:C<n*2?255-c*j:C<n*4?0:C<n*5?c*j:255;g=C<n*2?0:C<n*3?c*j:C<n*5?255:255-c*j;b=C<n?c*j:C<n*3?255:C<n*4?255-c*j:0;return{r:r,g:g,b:b};}function getGradientColor(x,y,Base){x=x<0?0:x>255?255:x;y=y<0?0:y>255?255:y;var r=Math.round((1-(1-(Base.r/255))*(x/255))*(255-y));var g=Math.round((1-(1-(Base.g/255))*(x/255))*(255-y));var b=Math.round((1-(1-(Base.b/255))*(x/255))*(255-y));return{r:r,g:g,b:b};}function getWebSafeColor(color){var rMod=color.r%51;var gMod=color.g%51;var bMod=color.b%51;if((rMod==0)&&(gMod==0)&&(bMod==0)){return false;}var wsColor={};wsColor.r=(rMod<=25?Math.floor(color.r/51)*51:Math.ceil(color.r/51)*51);wsColor.g=(gMod<=25?Math.floor(color.g/51)*51:Math.ceil(color.g/51)*51);wsColor.b=(bMod<=25?Math.floor(color.b/51)*51:Math.ceil(color.b/51)*51);return wsColor;}function hColorPickerMouseDown(){if(cp.cpColor.r||(cp.cpColor.r===0)){cp.cpColor="#"+hex(cp.cpColor.r)+hex(cp.cpColor.g)+hex(cp.cpColor.b);}cp.cpInput.style.backgroundColor=cp.cpColor;cp.cpInput.style.color=cp.cpColor;cp.cpInput.title="Color: "+cp.cpColor;cp.cpInput.value=cp.cpColor;hideColorPicker();}function attachColorPicker(input){this._input=input;createColorPicker();input.onfocus=showMyColorPicker;input.onblur=tryHideColorPicker;input.onclick=showMyColorPicker;}function showMyColorPicker(ev){cp.clicked=true;showColorPicker(ev);}function showColorPicker(ev){ev=ev||window.event;var input=ev.target||ev.srcElement;cp.ColorPicker.style.display="block";if(input.nodeName=="INPUT"){cp.cpInput=input;}cp.fColorIcon.style.display="none";var inpPos=getPosition(cp.cpInput);cp.ColorPicker.style.left=inpPos.x+"px";cp.ColorPicker.style.top=inpPos.y+parseInt(cp.cpInput.offsetHeight)+"px";var inpPos2=getPosition(cp.ColorPicker);cp.fColorPicker.style.display="none";cp.fColorPicker.style.display="block";if(cp.cpInput.value!=""){cp.baseColor=parseColor(cp.cpInput.value);}setCPColor(cp.fColorImg.style.backgroundColor=cp.origColor=cp.OrigColorDiv.style.backgroundColor="#"+hex(cp.baseColor.r)+hex(cp.baseColor.g)+hex(cp.baseColor.b));cp.sliderPos=getPosition(cp.colorSlider);}function tryHideColorPicker(){if(!cp.clicked){hideColorPicker();}}function hideColorPicker(){cp.ColorPicker.style.display="none";}function cpMouseDown(ev){cp.cpPos=getPosition(cp.fColorImg);cp.cpMouseDown=true;return false;}function cpMouseUp(ev){cp.cpMouseDown=false;}function cpSliderMouseDown(ev){cp.csPos=getPosition(cp.colorSlider);cp.SliderMouseDown=true;return false;}function cpSliderMouseUp(ev){cp.SliderMouseDown=false;}function cpSliderClick(ev){ev=ev||window.event;var mousePos=mouseCoordinates(ev);var y=mousePos.y-cp.sliderPos.y-4;cpSliderSetColor(y);}function cpMouseClick(ev){ev=ev||window.event;var mousePos=mouseCoordinates(ev);var x=mousePos.x-cp.cpPos.x-1;var y=mousePos.y-cp.cpPos.y-1;setCPColor(getGradientColor(x,y,cp.baseColor));}function cpMouseMove(ev){if(cp.cpMouseDown){cpMouseClick(ev);}if(cp.SliderMouseDown){cpSliderClick(ev);}return false;}function cpSliderSetColor(y){y=y<0?0:y>255?255:y;cp.Arrows.style.top=(y+18)+"px";var color=cp.baseColor=getVertColor(y,256);cp.fColorImg.style.backgroundColor="#"+hex(color.r)+hex(color.g)+hex(color.b);}function selectWebSafeColor(){setCPColor(getWebSafeColor(cp.cpColor));}function resetColor(){setCPColor(cp.origColor);}function setCPColor(color){if(color.srcElement||color.target){color=null;}if(color&&(!color.r&&(color.r!=0))){color=parseColor(color);}if(!color){color={r:parseInt(cp.rInput.value),g:parseInt(cp.gInput.value),b:parseInt(cp.bInput.value)};}var wsColor=getWebSafeColor(color);if(wsColor&&!cp.websafeCheckbox.checked){cp.websafeImg.style.display="block";cp.websafeImg.style.backgroundColor="#"+hex(wsColor.r)+hex(wsColor.g)+hex(wsColor.b);}else{if(wsColor&&cp.websafeCheckbox.checked){color=wsColor;}cp.websafeImg.style.display="none";}cp.rInput.value=color.r;cp.gInput.value=color.g;cp.bInput.value=color.b;cp.hexInput.value=""+hex(color.r)+hex(color.g)+hex(color.b);cp.cpColor=color;cp.curColorDiv.style.backgroundColor="#"+hex(color.r)+hex(color.g)+hex(color.b);}function setCPHexColor(){var col=cp.hexInput.value;setCPColor(parseColor(col));}function parseColor(text){if(colorNames[text.toLowerCase()]){text=colorNames[text.toLowerCase()];}if(/^\#?[0-9A-F]{6}$/i.test(text)){return{r:eval("0x"+text.substr(text.length==6?0:1,2)),g:eval("0x"+text.substr(text.length==6?2:3,2)),b:eval("0x"+text.substr(text.length==6?4:5,2))};}}function documentMouseDown(ev){if(!cp){return ;}ev=ev||window.event;var target=ev.srcElement||ev.target;while(target){if(target==cp.ColorPicker){return ;}target=target.parentNode;}cp.ColorPicker.style.display="none";}function documentMouseUp(ev){if(!cp){return ;}cpMouseUp(ev);cpSliderMouseUp(ev);}document.onmousedown=documentMouseDown;document.onmouseup=documentMouseUp;window.attachColorPicker=attachColorPicker;})();var current={};current.Types={CONTENT_SHORT:1,INTEREST_SHORT:3,USER_SHORT:2,LOCALE_US:"en_US",LOCALE_UK:"en_UK",LOCALE_IT:"it_IT",SEARCH_QUERY_PARAM:"q"};current.Constants=Class.create({initialize:function(){},setServerName:function(serverName){this._serverName=serverName;this.setSecureServerName(serverName.replace(/http:/,"https:"));},isReadOnlyMode:function(){return this._writeEnabled;},setReadOnlyMode:function(mode){this._writeEnabled=mode;},getServerName:function(){return this._serverName;},setSecureServerName:function(serverName){this._secureServerName=serverName;},getSecureServerName:function(){return this._secureServerName;},setDatanodeUrl:function(datanodeUrl){this._datanodeUrl=datanodeUrl;},getDatanodeUrl:function(){return this._datanodeUrl;},setStaticContentUrl:function(staticContentUrl){this._staticContentUrl=staticContentUrl;},getStaticContentUrl:function(){return this._staticContentUrl;},setBuildNumber:function(buildNumber){this._buildNumber=buildNumber;},getBuildNumber:function(){return this._buildNumber;},setTrackingBucket:function(trackingBucket){this._trackingBucket=trackingBucket;},getTrackingBucket:function(){return this._trackingBucket;},setTrackingProfile:function(trackingProfile){this._trackingProfile=trackingProfile;},getTrackingProfile:function(){return this._trackingProfile;},setTrackingAppPath:function(trackingAppPath){this._trackingAppPath=trackingAppPath;},getTrackingAppPath:function(){return this._trackingAppPath;},setAdServerUrl:function(adServerUrl){this._adServerUrl=adServerUrl;},getAdServerUrl:function(){return this._adServerUrl;},setAdSite:function(adSite){this._adSite=adSite;},getAdSite:function(){return this._adSite;},setAdOrdinal:function(adOrdinal){this._adOrdinal=adOrdinal;},getAdOrdinal:function(){return this._adOrdinal;},getLandingMsgReferrers:function(){this._landingMsgReferrers=["aol.com","ask.com","buzz.yahoo.com","del.icio.us","digg.com","google.com","live.com","mixx.com","msn.com","reddit.com","sharethis.com","yahoo.com"];return this._landingMsgReferrers;},getProxyUrl:function(){return this._proxyUrl;},setProxyUrl:function(proxyUrl){proxyUrl=proxyUrl.replace(/\/broxy\.htm/,"");this._proxyUrl=proxyUrl;},getScriptName:function(){return this._scriptName;},setScriptName:function(scriptName){this._scriptName=scriptName;},getSwfDatanodeUrl:function(){return this._swfDatanode;},setSwfDatanodeUrl:function(datanode){this._swfDatanode=datanode;},getFacebookConfig:function(){return this._fbConfig;},setFacebookConfig:function(config){this._fbConfig=config;},getLocale:function(){return this._locale;},setLocale:function(locale){this._locale=locale;}});current.Constants.getInstance=function(){if(!document.__currentConstants__){document.__currentConstants__=new current.Constants();}return document.__currentConstants__;};current.stub=function(path){var c=window;path.split(".").each(function(s){if(typeof c[s]=="undefined"){c[s]={};}c=c[s];});};current.uncache=function(){setSessionCookie(current.Cookies.CACHE_NAME,current.Cookies.CACHE_VALUE);};current.loaded=[];current.load=function(lib){if(current.loaded[lib]!=null){return ;}current.loaded[lib]=true;var f=current.Constants.getInstance().getStaticContentUrl()+"/js/"+lib.split(".").join("/")+".js";document.write('<script type="text/javascript" src="'+f+'"><\/script>');};document.onTabClick=function(node){var links=$$("li.tab a");if(links.length<1||$(node.rel)===null){return ;}links.each(function(link){if(link.rel===null||$(link.rel)===null||(link.rel==node.rel)){return ;}link.removeClassName("active");$(link.rel).hide();});node.addClassName("active");$(node.rel).show();return false;};Position.GetWindowSize=function(w){w=w?w:window;var width=w.innerWidth||(w.document.documentElement.clientWidth||w.document.body.clientWidth);var height=w.innerHeight||(w.document.documentElement.clientHeight||w.document.body.clientHeight);return[width,height];};onValidateComplete=function(result,form){$$(".disableOnSubmit").each(function(node){node.disabled=result;});};function isUndefined(v){return(typeof v=="undefined");}function scaleToWidth(node,width){var size=Element.getDimensions(node);var nativeWidth=size.width;if(size.width>width){node.width=width;}node.show();}function popWin(theURL,theWidth,theHeight,theBars){var width=theWidth;var height=theHeight;var bars=theBars;var winl=(screen.width-width)/3;var wint=(screen.height-height)/2;var theFeatures="width="+width+",height="+height+",top="+wint+",left="+winl+",scrollbars="+bars;var theWin=window.open(theURL,"popWin",theFeatures);theWin.focus();}function getURLParameter(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexString="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexString);var results=regex.exec(window.location.href);if(results===null){return"";}else{return results[1];}}function highlightTerms(txt,q){q=unescape(q);q=q.replace(/\+/," ");var regexString=new RegExp(q,"gim");return txt.replace(regexString,function($0){return("<em>"+$0+"</em>");});}var Events=Class.create({});var now=new Date();function calculateTime(secs,val1,val2,leadingString){var t=((Math.floor(secs/val1))%val2).toString();if(t.length<2){t=leadingString+t;}return t;}function getDistanceOfTimeToNow(dateString){var endDate=new Date(dateString);var deltaDate=new Date(endDate-now);return Math.floor(deltaDate.valueOf()/1000);}function getDSTOffset(testDateString){var testDate=new Date(testDateString);var startDST=new Date(testDate.getFullYear(),2,1,2);var endDST=new Date(testDate.getFullYear(),10,1,2);endDST.setDate(1+7-endDST.getDay());startDST.setDate(8+7-startDST.getDay());if(startDST<testDate&&testDate<endDST){return 0;}return -1;}function getDateAndTimeFromUTC(utcDate,timezoneOffset,timezoneString,showMinutes,showSeconds,pattern){if(pattern==null||pattern==""){pattern="mmmm d, yyyy h:MM TT ";}pattern=(showMinutes)?pattern:pattern.replace(":MM",":00");pattern=(showSeconds)?pattern:pattern.replace(":ss","");var dstOffset=getDSTOffset(utcDate);timezoneString=(dstOffset<0)?timezoneString:timezoneString.replace("S","D");timezoneOffset+=dstOffset;var regionalDate=new Date(utcDate);regionalDate.setHours(regionalDate.getHours()+timezoneOffset);return(dateFormat(regionalDate,pattern)+timezoneString);}function msToHHMMSS(duration){var hrs=Math.floor(duration/(1000*60*60));var mins=Math.floor((duration-(hrs*1000*60*60))/(1000*60));var secs=Math.floor((duration-(hrs*1000*60*60)-(mins*1000*60))/1000);var str=((hrs>0)?hrs+":":"");str+=((mins>9)?mins+":":((mins>0)?"0"+mins+":":"00:"));str+=((secs>9)?secs:((secs>0)?"0"+secs:"00"));return str;}function getEasternTimezoneString(){var edt_2008=new Date("March 9, 2008 02:00:00 EST");var est_2008=new Date("November 2, 2008 02:00:00 EDT");var edt_2009=new Date("March 8, 2009 02:00:00 EST");var est_2009=new Date("November 1, 2009 02:00:00 EDT");var edt_2010=new Date("March 14, 2010 02:00:00 EST");var est_2010=new Date("November 7, 2010 02:00:00 EDT");var localTime=new Date();var TimezoneOffset=-4;var ms=localTime.getTime()+(localTime.getTimezoneOffset()*60000)+TimezoneOffset*3600000;var rightNowInNY=new Date(ms);switch(parseInt(rightNowInNY.getFullYear())){case 2007:if(rightNowInNY>edt_2007&&rightNowInNY<est_2007){return" EDT";}else{return" EST";}case 2008:if(rightNowInNY>edt_2008&&rightNowInNY<est_2008){return" EDT";}else{return" EST";}case 2009:if(rightNowInNY>edt_2009&&rightNowInNY<est_2009){return" EDT";}else{return" EST";}case 2010:if(rightNowInNY>edt_2010&&rightNowInNY<est_2010){return" EDT";}else{return" EST";}default:return" EDT";}}function dwrErrorBlackHole(){$A(arguments).each(function(arg){});}if(!window.console){var console={};console.log=function(){};}var trace=console.log;function getSwfByName(swfName){if(Prototype.Browser.IE){return window[swfName];}else{return document[swfName];}}var HintUtils={resetHint:function(el){if(el.value===""&&el.title!==null){el.setStyle({color:"#999"});el.value=el.title;}else{if(el.value===""){el.value="";}}return el;}};Element.addMethods(HintUtils);Object.extend(String.prototype,{introspect:function(){return this.replace(/_/,"-").toLowerCase().camelize();},truncateDots:function(len,ignoreSpaces){if(this.length<=len){return this;}var endIndex=len;if(!ignoreSpaces){endIndex=this.lastIndexOf(" ",len);if(endIndex==-1){endIndex=len;}}this.slice(0,endIndex-3)+"...";return this;},dumbify:function(){s=this.replace(/\u2018/g,"'").replace(/\u2019/g,"'").replace(/\u201c/g,'"').replace(/\u201d/g,'"').replace(/\u2013/g,"-").replace(/\u2014/g,"--");return s;}});function truncateText(text,len,truncate_string,truncate_lastspace){text=typeof (text)!="undefined"?text:"";len=typeof (len)!="undefined"?len:30;truncate_string=typeof (truncate_string)!="undefined"?truncate_string:"...";truncate_lastspace=typeof (truncate_lastspace)!="undefined"?truncate_lastspace:false;if(text==""){return"";}if(text.length>len){text=text.substring(0,len);if(truncate_lastspace){var newLen=len;for(var i=newLen-1;text.charAt(i)!=" ";i--){newLen--;}newLen--;if(newLen==0){newLen=len;}text=text.substr(0,newLen);}return text+truncate_string;}else{return text;}}function in_array(needle,haystack,argStrict){var key="",strict=!!argStrict;if(strict){for(key in haystack){if(haystack[key]===needle){return true;}}}else{for(key in haystack){if(haystack[key]==needle){return true;}}}return false;}function array_keys(input,search_value,argStrict){var tmp_arr={},strict=!!argStrict,include=true,cnt=0;var key="";for(key in input){include=true;if(search_value!=undefined){if(strict&&input[key]!==search_value){include=false;}else{if(input[key]!=search_value){include=false;}}}if(include){tmp_arr[cnt]=key;cnt++;}}return tmp_arr;}function redraw(_a){if(_a&&_a.style){_a.style.display="none";_a.style.display="";}}function purge(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==="function"){d[n]=null;}}}a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){purge(d.childNodes[i]);}}}function StringBuffer(){this.buffer=[];}StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join(" ");};function htmlEntities(str){return String(str).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");}current.PlayerStates={LOADED:-1,FINISHED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5,STARTED:6,AUDIO_ON:7,INSIDEWARNINGTIME:8,OUTSIDEWARNINGTIME:9,RESUMED:10};function onPlayStatusChange(state,arg1,arg2){if(state==current.PlayerStates.AUDIO_ON&&current.Constants.getLocale()==LOCALE_UK){setSessionCookie(current.Cookies.PLAYER_AUDIO_ON,-1);}if(document.__currentVideoCarousel__){document.__currentVideoCarousel__.onVideoStateChange(state,arg1,arg2);}if(document.__currentVideoLanding__){document.__currentVideoLanding__.onVideoStateChange(state,arg1,arg2);}if(document.__currentVideoRibbons__){document.__currentVideoRibbons__.onVideoStateChange(state,arg1,arg2);}if(document.__currentItemPage__){document.__currentItemPage__.onVideoStateChange(state,arg1,arg2);}if(document.__currentRightRailVideo__){document.__currentRightRailVideo__.onVideoStateChange(state,arg1,arg2);}}current.stub("current.locale.Bundle");current.locale.Bundle.get=function(key){try{var i=__bundle[key];return i;}catch(e){return" ";}};current.advertising={};current.advertising.Ads=Class.create({initialize:function(adDomain,adSite,adConfig){this._timers={};this._adDomain=adDomain;this._adSite=adSite;this._adConfig=adConfig;},moveAd:function(position,random,loadRandom){var div=$("ad_"+position+"_"+random);var loadDiv=$("loadAd_"+position+"_"+loadRandom);if(div&&loadDiv){var next,child=loadDiv.firstChild;while(child){next=child.nextSibling;div.appendChild(child);child=next;}}},refreshAd:function(position,random,width,height,zone,page,tile,tag,millis){var divId="ad_"+position+"_"+random;var div=$("ad_"+position+"_"+random);if(millis&&div){var scope=this;this._timers[divId]=setTimeout(function(){if(width==1&&height==1&&position=="Navigation"&&$("studiosLogosBack")){$("studiosLogosBack").className="studiosLogos";div.className="floatRight";tag=tag.replace("sz=1x1","sz=470x86");width="470";height="86";}while(div.firstChild){div.removeChild(div.firstChild);}var iframe=new Element("iframe",{id:"adi_"+position+"_"+Math.floor(100000000*Math.random()),width:width,height:height,scrolling:"no",frameBorder:"0",marginWidth:"0",marginHeight:"0",src:scope._adDomain+"adi/"+scope._adSite+"/"+zone+";"+page+"tag=adi;tile="+tile+";"+tag});div.insert(iframe);scope.refreshAd(position,random,width,height,zone,page,tile,tag,millis);},millis);}}});current.advertising.Ads.getInstance=function(){if(!document.__currentAdvertisingAds__){document.__currentAdvertisingAds__=new current.advertising.Ads(document.currentAdDomain,document.currentAdSite,document.currentAdConfig);}return document.__currentAdvertisingAds__;};current.stub("current.auth");current.auth.Facebook=Class.create({initialize:function(){var fbConfig=current.Constants.getInstance().getFacebookConfig();this._appId=fbConfig[0];this._xdReceiver=fbConfig[1];this._initCallbacks=[];this.logged_in_fbuid=null;this.logged_in_token=null;this._initialized=false;this.inviteKey=null;this._loginLink=$("loginLinkA");this._regLink=$("regLinkA");this._logoutLink=$("logoutLinkA");this._cbPermPublishStream=$("facebook_settings_publish_stream");this._cbPermEmail=$("facebook_settings_email");this._cbPermOfflineAccess=$("facebook_settings_offline_access");this._cbPermReadStream=$("facebook_settings_read_stream");this._cbPrefsPostItem=$("facebook_settings_postItem");this._cbPrefsPostComment=$("facebook_settings_postComment");this._cbPrefsPostBadge=$("facebook_settings_postBadge");this._cbPermPublishClipperPost=null;this._loginFbConnectImg=$("fb_login_image");this._inlineConnectButton=$("fb_login_image_inline");if(this._loginLink){this._loginLink.observe("click",this.__onLoginClick.bindAsEventListener(this));}if(this._regLink){this._regLink.observe("click",this.__onLoginClick.bindAsEventListener(this));}if(this._inlineConnectButton){this._inlineConnectButton.observe("click",this.showConnect.bindAsEventListener(this));}if(this._loginFbConnectImg){this._loginFbConnectImg.observe("click",this.showConnect.bindAsEventListener(this));}},initCoreFirst:function(callback){if(callback){this._initCallbacks.push(callback);}if(!this._startedInit){this._startedInit=true;var scope=this;window.fbAsyncInit=function(){FB.init({appId:scope._appId,status:true,cookie:true,xfbml:true,oauth:true});FB.Event.subscribe("edge.create",function(href,widget){current.tracking.Track.getInstance().onFacebookLike();});for(var i=0;i<scope._initCallbacks.length;i++){(scope._initCallbacks[i])();}scope._initialized=true;};if(window.FB===undefined){var fbHiddenDiv=document.createElement("div");fbHiddenDiv.id="fb-root";fbHiddenDiv.style.position="absolute";fbHiddenDiv.style.left="-10000px";fbHiddenDiv.style.top="-10000px";fbHiddenDiv.style.width="0px";fbHiddenDiv.style.height="0px";window.document.body.insertBefore(fbHiddenDiv,window.document.body.firstChild);(function(){var e=document.createElement("script");e.src=document.location.protocol+"//connect.facebook.net/en_US/all.js";e.async="true";document.getElementById("fb-root").appendChild(e);}());}}else{if(this._initialized&&callback){callback();}}},__onPermClick:function(event,perm,clipperPublishRequest){var cb;switch(perm){case"email":cb=this._cbPermEmail;break;case"publish_stream":if(clipperPublishRequest){cb=this.getClipperPublishElement();}else{cb=this._cbPermPublishStream;}break;case"read_stream":cb=this._cbPermReadStream;break;case"offline_access":cb=this._cbPermOfflineAccess;break;}if(!cb){return ;}this.initCoreFirst(function(){if(cb.checked==true){FB.api({method:"users.hasAppPermission",ext_perm:perm},function(has_perm){if(has_perm<1){FB.login(function(response){if(!response.authResponse){cb.checked=false;return ;}},{scope:"publish_stream,email"});}});}else{cb.checked=false;}if((perm=="publish_stream")&&!clipperPublishRequest){if(cb.checked==true){$("facebook_settings_postItem").checked=true;$("facebook_settings_postComment").checked=true;$("facebook_settings_postBadge").checked=true;$("facebook_settings_postItem").disabled=false;$("facebook_settings_postComment").disabled=false;$("facebook_settings_postBadge").disabled=false;}else{$("facebook_settings_postItem").checked=false;$("facebook_settings_postComment").checked=false;$("facebook_settings_postBadge").checked=false;$("facebook_settings_postItem").disabled=true;$("facebook_settings_postComment").disabled=true;$("facebook_settings_postBadge").disabled=true;}}});},__onLoginClick:function(event){},__onLogoutClick:function(event){event.stop();var logoutUrl=current.Constants.getInstance().getScriptName()+"/logout.htm";setTimeout('window.location="'+logoutUrl+'"',10000);this.initCoreFirst(function(){FB.logout(function(response){window.location=logoutUrl;});});},showConnect:function(event){if(event){Event.stop(event);}setSessionCookie(current.Cookies.LOGIN_REDIRECT,window.location.href);var scope=this;this.initCoreFirst(function(){FB.login(function(response){if(response.authResponse){scope.setFacebookId(response.authResponse.userID);scope.setFacebookToken(response.authResponse.accessToken);var redirectUrl=current.Constants.getInstance().getScriptName()+"/account/connectExternal/facebook.htm";window.location=redirectUrl;}},{scope:"publish_stream,email"});});},setFacebookId:function(id){this.logged_in_fbuid=id;},setFacebookToken:function(token){this.logged_in_token=token;},setSquareImage:function(event){Event.stop(event);if(this.logged_in_fbuid){$("profile_picture").src="http://graph.facebook.com/"+this.logged_in_fbuid+"/picture";$("ExternalProfileImage_useFacebookProfileImage").checked=true;}},checkLoginStatus:function(){var scope=this;var user=current.User.getInstance();this.initCoreFirst(function(){FB.getLoginStatus(function(response){if(response.status==="connected"){var uid=response.authResponse.userID;if(user.getFacebookId()==uid){scope._isConnected=true;scope.showHeaderFlag();scope.enableFacebookLogout(scope._logoutLink);scope.enableExternalAccountsSettings();scope.enableUseProfileImage();}else{if(user.isFacebookOnly()){window.location=current.Constants.getInstance().getScriptName()+"/logout.htm";}}}else{if(response.status==="not_authorized"){if(user.isFacebookOnly()){window.location=current.Constants.getInstance().getScriptName()+"/logout.htm";}}else{if(user.isFacebookOnly()){window.location=current.Constants.getInstance().getScriptName()+"/logout.htm";}}}});});},showHeaderFlag:function(){var fbFlagA=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/account/editExternalAccounts.htm","class":"Sprites facebookSignedIn floatLeft",style:"margin-right:5px"}).update("&nbsp");$("headerUserAccounts").insert({top:fbFlagA});},enableFacebookLogout:function(link){if(this._isConnected&&link){link.observe("click",this.__onLogoutClick.bindAsEventListener(this));}},enableExternalAccountsSettings:function(){if(this._cbPermEmail){this._cbPermEmail.disabled=false;this._cbPermEmail.observe("click",this.__onPermClick.bindAsEventListener(this,"email",false));}if(this._cbPermPublishStream){this._cbPermPublishStream.disabled=false;if(this._cbPermPublishStream.checked==true){this._cbPrefsPostItem.disabled=false;this._cbPrefsPostComment.disabled=false;this._cbPrefsPostBadge.disabled=false;}this._cbPermPublishStream.observe("click",this.__onPermClick.bindAsEventListener(this,"publish_stream",false));}if(this._cbPermReadStream){this._cbPermReadStream.disabled=false;this._cbPermReadStream.observe("click",this.__onPermClick.bindAsEventListener(this,"read_stream",false));}if(this._cbPermOfflineAccess){this._cbPermOfflineAccess.disabled=false;this._cbPermOfflineAccess.observe("click",this.__onPermClick.bindAsEventListener(this,"offline_access",false));}},enableUseProfileImage:function(){var useProfileImage=$("facebook_use_profile_image");if(useProfileImage){useProfileImage.style.display="block";}},setInviteKey:function(inviteKey){this.inviteKey=inviteKey;},setClipperPublishElement:function(element){this._cbPermPublishClipperPost=element;if(this._cbPermPublishClipperPost){this._cbPermPublishClipperPost.observe("click",this.__onPermClick.bindAsEventListener(this,"publish_stream",true));}},getClipperPublishElement:function(){if(this._cbPermPublishClipperPost){return this._cbPermPublishClipperPost;}return undefined;}});current.auth.Facebook.getInstance=function(){if(!document.__currentAuthFacebook__){document.__currentAuthFacebook__=new current.auth.Facebook();}return document.__currentAuthFacebook__;};current.stub("current.auth");current.auth.Twitter=Class.create({initialize:function(){this.authWindow=null;this.logged_in_uid=null;this._cbPermReadStream=$("facebook_settings_facebookread_stream");this._loginTwitterConnectImg=$("twitter_login_image");if(this._loginTwitterConnectImg){this._loginTwitterConnectImg.observe("click",this.showConnect.bindAsEventListener(this));}},showConnect:function(event){if(event){Event.stop(event);}setSessionCookie(current.Cookies.LOGIN_REDIRECT,window.location.href);this.openAuthWindow();},setInviteKey:function(inviteKey){this.inviteKey=inviteKey;},openAuthWindow:function(){if(this.authWindow){this.authWindow.close();}var width=800;var height=500;var popupCoords=this.getCenteredCoords(width,height);var popupX=popupCoords[0];var popupY=popupCoords[1];var popupUrl=$("twitter_login_image").href;setSessionCookie(current.Cookies.LOGIN_REDIRECT,window.location.href);this.authWindow=window.open(popupUrl,"twitter_auth_window","location=1,status=0,scrollbars=1,width="+width+",height="+height);this.authWindow.moveTo(popupX,popupY);},getWindowInnerSize:function(){var width=0;var height=0;var elem=null;if("innerWidth" in window){width=window.innerWidth;height=window.innerHeight;}else{if(("BackCompat"===window.document.compatMode)&&("body" in window.document)){elem=window.document.body;}else{if("documentElement" in window.document){elem=window.document.documentElement;}}if(elem!==null){width=elem.offsetWidth;height=elem.offsetHeight;}}return[width,height];},getParentCoords:function(){var width=0;var height=0;if("screenLeft" in window){width=window.screenLeft;height=window.screenTop;}else{if("screenX" in window){width=window.screenX;height=window.screenY;}}return[width,height];},getCenteredCoords:function(width,height){var parentSize=this.getWindowInnerSize();var parentPos=this.getParentCoords();var xPos=parentPos[0]+Math.max(0,Math.floor((parentSize[0]-width)/2));var yPos=parentPos[1]+Math.max(0,Math.floor((parentSize[1]-height)/2));return[xPos,yPos];},setTwitterId:function(id){this.logged_in_uid=id;},setSquareImage:function(event){event.stop();$("ExternalProfileImage_useTwitterProfileImage").checked=true;},checkLoginStatus:function(){var scope=this;var user=current.User.getInstance();if(user.getTwitterId()){this._isConnected=true;this.showHeaderFlag();this.enableUseProfileImage();}},enableUseProfileImage:function(){var useProfileImage=$("twitter_use_profile_image");if(useProfileImage){useProfileImage.style.display="block";}},showHeaderFlag:function(){var twitterFlagA=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/account/editExternalAccounts.htm","class":"Sprites twitterSignedIn floatLeft",style:"margin-right:5px"}).update("&nbsp");$("headerUserAccounts").insert({top:twitterFlagA});},setClipperPublishElement:function(element){this._cbPermPublishClipperPost=element;},getClipperPublishElement:function(){if(this._cbPermPublishClipperPost){return this._cbPermPublishClipperPost;}return undefined;}});current.auth.Twitter.getInstance=function(){if(!document.__currentAuthTwitter__){document.__currentAuthTwitter__=new current.auth.Twitter();}return document.__currentAuthTwitter__;};current.stub("current.components.account");current.components.account.LoginWindow=Class.create({initialize:function(event,activity,posLeft,posTop){this._open=false;this._modalWidth="459";this._modalHeight="351";this._contentWidth="405";this._modalId="loginWindow";this._activity=activity;this._message="you must be logged in to do that";this._winWidth=document.viewport.getWidth();if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{if(event){var offset=current.utils.Compatibility.getEventElement(event).cumulativeOffset();this._modalPosLeft=offset.left;this._modalPosTop=offset.top;}else{this._modalPosLeft=parseInt(this._winWidth/2);this._modalPosTop=100;}}if(this._modalPosLeft<10){this._modalPosLeft=10;}this._modalPosRight=parseInt(this._modalPosLeft)+parseInt(this._modalWidth);if(this._modalPosRight>this._winWidth){this._modalPosLeft=(this._winWidth-this._modalWidth)-10;}if(this._modalPosTop>20){this._modalPosTop=this._modalPosTop-10;}},init:function(){this._title=current.locale.Bundle.get("Login.almost");if(this._activity==current.components.account.LoginActivity.NONE){this._message="";this._title=current.locale.Bundle.get("header.login");}else{if(this._activity){this._message=this._activity;}}setTimedCookie(current.Cookies.LOGIN_REDIRECT,document.location,30);this._titleWidth=this._contentWidth;if(current.utils.Compatibility.isIE6Browser()){this._titleWidth=parseInt(parseInt(this._contentWidth)+parseInt(1));}var wrapper='<div class="accountModalTitle" style="width: '+this._titleWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="accountModalBody" style="width: '+this._contentWidth+'px;">'+this._message+'<div id="accountModalForm"></div><br class="clearBoth"/></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"accountModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._draggable.destroy();this._open=false;document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+"/inline_login.htm",{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){for(key in EventSelectorRules){key="#loginBox "+key;}EventSelectors.start(EventSelectorRules);$("accountModalRegisterLink").observe("click",this.__onRegisterClick.bindAsEventListener(this));if($("fb_login_image")){$("fb_login_image").observe("click",this.__onFacebookClick.bindAsEventListener(this));}if($("twitter_login_image")){$("twitter_login_image").observe("click",this.__onTwitterClick.bindAsEventListener(this));}$("login_passwordDisplay").observe("focus",this.__onPasswordFocus.bindAsEventListener(this));$("login_password").observe("blur",this.__onPasswordBlur.bindAsEventListener(this));$("login_passwordDisplay").setStyle({color:"#999999"});$("loginForm").observe("submit",this.__onLoginSubmit.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();},__onRegisterClick:function(event){event.stop();if(current.Constants.getInstance().isReadOnlyMode()){new current.components.alerts.AlertWindow(event).init();return ;}var posL=$("modal_container").cumulativeOffset()["left"];var posT=parseInt($("modal_container").cumulativeOffset()["top"]+10);Control.Modal.close();var regWindow=new current.components.account.RegisterWindow(posL,posT);regWindow.init();},__onFacebookClick:function(event){Event.stop(event);setTimedCookie(current.Cookies.USER_MEMBER,"login_popup",5);var cfb=current.auth.Facebook.getInstance();cfb.showConnect();},__onTwitterClick:function(event){Event.stop(event);var ct=current.auth.Twitter.getInstance();ct.showConnect();},__onPasswordFocus:function(event){event.element().hide();$("login_password").show();$("login_password").focus();},__onPasswordBlur:function(event){if(event.element().value==""||event.element().title==event.element().value){event.element().hide();$("login_passwordDisplay").show();}},__onLoginSubmit:function(event){var u=Validation.validate("login_username",{hideAdvice:true});var p=Validation.validate("login_password",{hideAdvice:true});if(!u||!p){event.stop();var el=$("inlineLoginError");if(!el.visible()){el.update("*"+current.locale.Bundle.get("error.usernamePasswordRequired"));Effect.Appear(el,{duration:0.5});}}setTimedCookie(current.Cookies.USER_MEMBER,"login_popup",5);}});current.components.account.LoginActivity={VOTE:current.locale.Bundle.get("LoginActivityMsg_vote"),EDIT:current.locale.Bundle.get("LoginActivityMsg_edit"),CLIP:current.locale.Bundle.get("LoginActivityMsg_clip"),SEND:current.locale.Bundle.get("LoginActivityMsg_send"),SHARE:current.locale.Bundle.get("LoginActivityMsg_share"),COMMENT:current.locale.Bundle.get("LoginActivityMsg_comment"),ADD_TO_GROUP:current.locale.Bundle.get("LoginActivityMsg_group"),TAG:current.locale.Bundle.get("LoginActivityMsg_tag"),START_A_GROUP:current.locale.Bundle.get("LoginActivityMsg_start_a_group"),JOIN:current.locale.Bundle.get("LoginActivityMsg_join"),FLAG:current.locale.Bundle.get("LoginActivityMsg_flag"),NONE:"none"};current.stub("current.components.account");current.components.account.RegisterWindow=Class.create({initialize:function(posLeft,posTop){this._open=false;this._modalWidth="459";this._modalHeight="";this._contentWidth="405";this._modalPosLeft=posLeft;this._modalPosTop=posTop;this._modalId="registerWindow";this._winWidth=document.viewport.getWidth();if(this._modalPosLeft<10){this._modalPosLeft=10;}this._modalPosRight=parseInt(this._modalPosLeft)+parseInt(this._modalWidth);if(this._modalPosRight>this._winWidth){this._modalPosLeft=(this._winWidth-this._modalWidth)-10;}if(this._modalPosTop>20){this._modalPosTop=this._modalPosTop-10;}},init:function(){if(current.Constants.getInstance().isReadOnlyMode()){new current.components.alerts.AlertWindow().init();return false;}this._titleWidth=this._contentWidth;if(current.utils.Compatibility.isIE6Browser()){this._titleWidth=parseInt(parseInt(this._contentWidth)+parseInt(3));}var wrapper='<div class="accountModalTitle" style="width: '+this._titleWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+current.locale.Bundle.get("header.register")+'</div><div id="accountModalBody" style="width: '+this._contentWidth+'px;"><div id="accountModalForm"></div><br class="clearBoth"/></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"accountModalContainer regModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._draggable.destroy();this._open=false;document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});new Ajax.Request(current.Constants.getInstance().getScriptName()+"/inline_register.htm",{method:"get",evalJS:false,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(data){$("accountModalForm").innerHTML=data.responseText;var node=$("frame")||$("toolbar");if($("reCaptcha")){node.insert(new Element("script",{src:"http://api.recaptcha.net/js/recaptcha_ajax.js",type:"text/javascript"}));setTimeout(function(){Recaptcha.create("6Lc9_gMAAAAAAAhHd78qsU268jG76485HnTrq3Gj","recaptcha_widget",{theme:"custom",lang:"en",custom_theme_widget:"recaptcha_widget"});},500);}for(key in EventSelectorRules){key="#registrationBox "+key;}EventSelectors.start(EventSelectorRules);if($("fb_login_image")){$("fb_login_image").observe("click",this.__onFacebookClick.bindAsEventListener(this));}if($("twitter_login_image")){$("twitter_login_image").observe("click",this.__onTwitterClick.bindAsEventListener(this));}$("register_password1Display").observe("focus",this.__onPasswordFocus.bindAsEventListener(this));$("register_password1").observe("blur",this.__onPasswordBlur.bindAsEventListener(this));$("register_password1Display").setStyle({color:"#999999"});},__onCloseClick:function(){Control.Modal.close();},__onFacebookClick:function(event){Event.stop(event);var cfb=current.auth.Facebook.getInstance();cfb.showConnect();},__onTwitterClick:function(event){Event.stop(event);var ct=current.auth.Twitter.getInstance();ct.showConnect();},__onPasswordFocus:function(event){event.element().hide();$("register_password1").show();$("register_password1").focus();},__onPasswordBlur:function(event){if(event.element().value==""||event.element().title==event.element().value){event.element().hide();$("register_password1Display").show();}}});LoginPage=new Class.create({initialize:function(){},init:function(){$("loginPage_passwordDisplay").observe("focus",this.__onPasswordFocus.bindAsEventListener(this));$("loginPage_password").observe("blur",this.__onPasswordBlur.bindAsEventListener(this));$("loginPage_passwordDisplay").setStyle({color:"#999999"});},__onPasswordFocus:function(event){event.element().hide();$("loginPage_password").show();$("loginPage_password").focus();},__onPasswordBlur:function(event){if(event.element().value==""||event.element().title==event.element().value){$$(".validate-isNotHint,.hasHinting").invoke("resetHint");event.element().hide();$("loginPage_passwordDisplay").show();}}});Object.Event.extend(LoginPage);LoginPage.getInstance=function(){if(!document.__loginPage__){document.__loginPage__=new LoginPage();}return document.__loginPage__;};RegisterPage=new Class.create({initialize:function(){},init:function(){$("register_password1Display").observe("focus",this.__onPasswordFocus.bindAsEventListener(this));$("register_password1").observe("blur",this.__onPasswordBlur.bindAsEventListener(this));$("register_password1Display").setStyle({color:"#999999"});},__onPasswordFocus:function(event){event.element().hide();$("register_password1").show();$("register_password1").focus();},__onPasswordBlur:function(event){if(event.element().value==""||event.element().title==event.element().value){$$(".validate-isNotHint,.hasHinting").invoke("resetHint");event.element().hide();$("register_password1Display").show();}}});Object.Event.extend(RegisterPage);RegisterPage.getInstance=function(){if(!document.__registerPage__){document.__registerPage__=new RegisterPage();}return document.__registerPage__;};current.stub("current.components.account");current.components.account.VerifyWindow=Class.create({initialize:function(event,posLeft,posTop,messageId){this._open=false;this._modalWidth="373";this._modalHeight="";this._contentWidth="319";this._modalId="verifyWindow";this._messageId=((messageId!=null)?messageId:1);this._headline=((this._messageId==2)?current.locale.Bundle.get("verify.almost_there"):current.locale.Bundle.get("verify.verify_your_email_address"));if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._eventElement=current.utils.Compatibility.getEventElement(event);this._modalPosLeft=(this._eventElement.cumulativeOffset()["left"]-236);this._modalPosTop=this._eventElement.cumulativeOffset()["top"];}if(this._modalPosLeft<10){this._modalPosLeft=10;}},init:function(){var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="accountModalBody" style="width: '+this._contentWidth+'px;"><div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"accountModalContainer verifyModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._draggable.destroy();this._open=false;document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});new Ajax.Request(current.Constants.getInstance().getScriptName()+"/inline_verify/"+this._messageId+".htm",{method:"get",evalJS:false,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(data){if(data.responseText=="force_login"){Control.Modal.close();new current.components.account.LoginWindow(null,current.components.account.LoginActivity.NONE,(this._modalPosLeft+100),this._modalPosTop).init();return ;}$("accountModalForm").innerHTML=data.responseText;var emailVerification=new current.user.EmailVerification("resendEmailLink");emailVerification.setTarget("verifyEmail");},__onCloseClick:function(){Control.Modal.close();}});current.stub("current.components.account");current.components.account.EditProfile=Class.create({initialize:function(){this._facebookProfileImage=$("ExternalProfileImage_useFacebookProfileImage");this.profilePicture=$("profile_picture");this.originalProfileImage=this.profilePicture.src;if(this._facebookProfileImage){this._facebookProfileImage.observe("click",this.__onFbProfileImageClick.bindAsEventListener(this));}},__onFbProfileImageClick:function(event){switch(this._facebookProfileImage.checked){case true:$("image_userImageFile").value=null;$("image_userImageFile").style.display="none";$("picture_description").style.display="none";$("external_preview_text").style.display="block";var cfb=current.auth.Facebook.getInstance();cfb.setSquareImage(event);break;case false:$("image_userImageFile").style.display="block";$("picture_description").style.display="block";$("external_preview_text").style.display="none";this.profilePicture.src=this.originalProfileImage;break;}}});current.components.account.EditProfile.getInstance=function(){if(!document.__currentComponentsAccountEditProfile__){document.__currentComponentsAccountEditProfile__=new current.components.account.EditProfile();}return document.__currentComponentsAccountEditProfile__;};current.stub("current.components.account");current.components.account.AgreeToTerms=Class.create({initialize:function(){this._linkSet=$$("a");this._termsRead=false;},init:function(){this._linkSet.each(function(a){a.href=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/logout.htm";});$("loginPageForm").observe("submit",this.__onAgreeToTermsSubmit.bindAsEventListener(this));$("tos").observe("scroll",this.__onAgreeToTermsScroll.bindAsEventListener(this));},__onAgreeToTermsSubmit:function(event){if(!this._termsRead){event.stop();this.__showScrollError();return false;}else{setLoginPagePath();}},__onAgreeToTermsScroll:function(event){var ScrollMod=1;oh=$("tos").getHeight();it=$("terms").cumulativeScrollOffset()["top"];ih=$("terms").getHeight();if(Math.round(it+oh)>=ih&&Math.abs(it)!=0){$("agreeToTermsSubmit").removeClassName("lgGrayButton");$("agreeToTermsSubmit").addClassName("lgBlueButton");$("login_agreeToTerms").value="true";this._termsRead=true;$("agreeToTermsScrollError").hide();}},__showScrollError:function(){$("agreeToTermsScrollError").show();}});current.components.account.AgreeToTerms.getInstance=function(){if(!document.__currentComponentsAccountAgreeToTerms__){document.__currentComponentsAccountAgreeToTerms__=new current.components.account.AgreeToTerms();}return document.__currentComponentsAccountAgreeToTerms__;};current.stub("current.components.alerts");current.components.alerts.Message=Class.create({initialize:function(){$$(".alertCloseLink").invoke("observe","click",this.__onMessageCloseClick.bindAsEventListener(this));},__onMessageCloseClick:function(event){event.stop();event.element().up(0).remove();return false;}});current.stub("current.components.alerts");current.components.alerts.AlertBar=Class.create({initialize:function(message,closeMessage,closeCallback){this._open=false;this._modalId="alertBar";this._message=((message!=null)?message:current.locale.Bundle.get("alert.feature_unavailable")+" "+current.locale.Bundle.get("alert.try_again_later"));this._closeMessage=((closeMessage!=null)?closeMessage:current.locale.Bundle.get("messages.Close"));this._closeCallback=closeCallback;},init:function(){var wrapper='<div id="alertBarBody" style="display:none;"><div class="alertBarFrame"><div class="floatRight"><a id="accountBarCloseButton" href="#" onclick="return false;" title="'+this._closeMessage+'"><div class="floatLeft Sprites accountModalCloseButtonRed" style="margin-top:.2em"></div><div class="floatLeft twelvePoint bold alertBarCloseMessage">'+this._closeMessage+"</div></a></div>"+this._message+'<br class="clearBoth"/></div></div>';Control.Modal.open(false,{contents:wrapper,position:"fixed",containerClassName:"accountBarBox",overlayDisplay:false,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){if(this._closeCallback){this._closeCallback(this);}this._open=false;},__onModalLoaded:function(){this._open=true;Effect.SlideDown("alertBarBody",{duration:0.3});$("accountBarCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();}});current.stub("current.components.alerts");current.components.alerts.AlertWindow=Class.create({initialize:function(event,message){this._open=false;this._modalWidth="308";this._modalHeight="";this._contentWidth="254";this._modalId="alertWindow";this._message=((message!=null)?message:current.locale.Bundle.get("alert.feature_unavailable")+" "+current.locale.Bundle.get("alert.try_again_later"));this._headline=current.locale.Bundle.get("alert.sorry");if(!isUndefined(event)&&event!=null){this._eventElement=current.utils.Compatibility.getEventElement(event);this._modalPosLeft=(this._eventElement.cumulativeOffset()["left"]-166);this._modalPosTop=this._eventElement.cumulativeOffset()["top"];this._winWidth=document.viewport.getWidth();if(this._modalPosLeft<10){this._modalPosLeft=10;}if(this._modalPosTop<10){this._modalPosTop=10;}this._modalPosRight=parseInt(this._modalPosLeft)+parseInt(this._modalWidth);if(this._modalPosRight>this._winWidth){this._modalPosLeft=(this._winWidth-this._modalWidth)-10;}}},init:function(){var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="alertModalBody" style="width: '+this._contentWidth+'px;">'+this._message+"</div>";if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._modalPosLeft=this._modalPosLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}if(!isUndefined(this._modalPosLeft)){Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"alertModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});}else{Control.Modal.open(false,{contents:wrapper,position:"absolute",containerClassName:"accountModalContainer alertModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});}},__resetWindow:function(){this._draggable.destroy();this._open=false;},__onModalLoaded:function(){this._open=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();}});current.stub("current.components.alerts");current.components.alerts.SystemMessage=Class.create({initialize:function(target,id){var ids=getCookieValue(current.Cookies.SYSTEM_MESSAGE_HIDE+"-"+id);if(ids!=null){$(target).up().remove();return ;}$(target).up().show();this._systemMessageId=id;$(target).observe("click",this.__onSystemMessageCloseClick.bindAsEventListener(this));},__onSystemMessageCloseClick:function(event){event.stop();event.element().up(0).remove();setTimedCookie(current.Cookies.SYSTEM_MESSAGE_HIDE+"-"+this._systemMessageId,this._systemMessageId,current.Cookies.SYSTEM_MESSAGE_HIDE_EXPIRE);}});current.components.alerts.ProfileAlert=Class.create({initialize:function(target){$(target).observe("click",this.__onProfileAlertCloseClick.bindAsEventListener(this));},__onProfileAlertCloseClick:function(event){event.stop();event.element().up(0).remove();deleteCookie(current.Cookies.PROFILE_COMPLETION);}});current.stub("current.components.assets");current.components.assets.AssetDisplay=Class.create({initialize:function(content,w1,h1,w_max,h_max){this._content=content;this._width=w1;this._height=h1;this._maxWidth=w_max;this._maxHeight=h_max;this._assetWidth=this._content.pageAsset.width;this._assetHeight=this._content.pageAsset.height;this._forceVolume=-1;this._skipLoadTracking=false;this._fixedHeight=0;this._useThumbUrl=false;this._thumbUrl=this._content.pageAsset.thumbUrl;if(!isUndefined(this._content.contentUrl)&&(this._content.contentUrl!=null)){this._permalink=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+this._content.contentUrl;}this._hideLogo=false;this._bgColor="#fff";if(this._assetWidth>w1&&h1!=h_max){this._width=this._maxWidth;this._height=this._content.pageAsset.height*(this._maxWidth/this._content.pageAsset.width);}this._autoplay=false;this._showThumbnail=false;this._showPlayerCallback=null;this._asset=null;},init:function(){if(this._content.pageAsset.assetType!="I"&&(this._content.contentSource=="internet"&&this._content.contentSource=="webcam"||this._content.contentSource=="pod"||this._content.contentSource=="vc2"||(this._content.contentSource=="videoegg"&&this._content.pageAsset.transcodeStatus==1)||(this._content.contentSource=="upload"&&this._content.pageAsset.transcodeStatus==1))){if(this._fixedHeight!=0){this._height=this._fixedHeight;}var __v=new Object();__v.contentTitle=this._content.contentTitle;__v.assetUrl=(this._content.pageAsset.assetUrl.indexOf(".flv")==-1)?this._content.pageAsset.assetUrl+".flv":this._content.pageAsset.assetUrl;__v.thumbUrl=this._thumbUrl;__v.contentId=this._content.id;__v.addedByUser=this._content.addedUser.username;__v.permalink=this._permalink;__v.w=this._width;__v.h=this._height;__v.vw=this._assetWidth;__v.vh=this._assetHeight;__v.hideLogo=this._hideLogo;__v.skipOverlay=this._skipOverlay;__v.disableEndSlate=this._disableEndSlate;__v.enableMenu=this._enableMenu;__v.autoplay=this._autoplay;__v.showThumbnail=this._showThumbnail;__v.showPlayerCallback=this._showPlayerCallback;__v.forceVolume=this._forceVolume;__v.skipLoadTracking=this._skipLoadTracking;__v.adSite=current.Constants.getInstance().getAdSite();__v.adPage=this._pageContext;__v.adOrdinal=current.Constants.getInstance().getAdOrdinal();__v.adKeywords=this._adKeywords;__v.externalContext="cdc";__v.context=this._pageContext;__v.sitePage=this._pageContext;__v.serviceUrl=current.Constants.getInstance().getProxyUrl()+"/broxy.htm";__v.frontController=current.Constants.getInstance().getScriptName();var videoPlayback=new current.components.video.Veep(this._assetDivId,this._movieId,__v);videoPlayback.setBgColor(this._bgColor);videoPlayback.init();}},setAsset:function(){if(this._content.pageAsset.assetType=="I"){this._asset=new Element("div",{"class":"contentItemAssetImage",style:"max-width: "+this._maxWidth+"px;  max-height: "+this._maxHeight+"px; overflow: hidden;"});var anchor=null;var img=null;if(!isUndefined(this._content.contentUrl)&&this._content.contentUrl!=null&&this._content.contentUrl!="undefined"){if(!isUndefined(this._permalink)){anchor=new Element("a",{href:this._permalink,target:"_blank"});}else{anchor=new Element("a",{href:this._content.contentUrl,target:"_blank"});}}if(this._assetWidth!="0"&&this._assetHeight!="0"&&!this._useThumbUrl){if(this._width>this._maxWidth||this._height>this._maxHeight){this._width=this._maxWidth;this._height=(this._assetWidth>0)?parseInt(this._assetHeight*(this._width/this._assetWidth),0):(this._width*3/4);}img=new Element("img",{id:"contentItemAssetImage_"+this._content.id,src:this._content.pageAsset.assetUrl,alt:current.locale.Bundle.get("item.Image")+"-01",width:this._width,height:this._height});}else{if(this._content.pageAsset.thumbUrl!=null&&this._content.pageAsset.thumbUrl!=""){img=new Element("img",{id:"contentItemAssetImage_"+this._content.id,src:this._content.pageAsset.thumbUrl+"_400x300.jpg",alt:current.locale.Bundle.get("item.Image")+"-02",width:this._width,height:this._height});}else{img=new Element("div",{style:"padding-bottom: 1.0em;"}).insert(new Element("img",{id:"contentItemAssetImage_"+this._content.id,src:this._content.pageAsset.assetUrl,alt:current.locale.Bundle.get("item.Image")+"-03",width:this._width}));}}if(anchor!=null){anchor.insert(img);this._asset.insert(anchor);}else{this._asset.insert(img);}}else{if(this._content.pageAsset.assetType=="V"||this._content.pageAsset.assetType=="M"){if((this._content.contentSource=="upload"||this._content.contentSource=="videoegg")&&this._content.pageAsset.transcodeStatus<1){this._asset=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/transcoding/transcode_430x323.gif",width:this._width,height:(this._width*3/4),alt:current.locale.Bundle.get("item.media")});}if(this._content.contentSource=="webcam"||this._content.contentSource=="pod"||this._content.contentSource=="vc2"||(this._content.contentSource=="videoegg"&&this._content.pageAsset.transcodeStatus==1)||(this._content.contentSource=="upload"&&this._content.pageAsset.transcodeStatus==1)){this._asset=new Element("div",{id:this._assetDivId});}if(this._content.contentSource=="internet"||this._content.contentSource=="bundle"||this._content.contentSource=="feed"||this._content.contentSource=="scene"){if(this._width<this._maxWidth){this._width=this._maxWidth;this._height=(parseInt(this._assetWidth)>0)?Math.ceil(this._assetHeight*(this._width/this._assetWidth)):(this._width*3/4);}var assetUrl=this._content.pageAsset.assetUrl;assetUrl=assetUrl.replace(/id=[\'\"]\s*\w+\s*[\'\"]/g,'id="'+this._movieId+'"');assetUrl=assetUrl.replace(/width=[\'\"]\s*\d+\s*[\'\"]/g,'width="'+this._width+'"');assetUrl=assetUrl.replace(/height=[\'\"]\s*\d+\s*[\'\"]/g,'height="'+this._height+'"');if(assetUrl.indexOf("id=")==-1){assetUrl=assetUrl.substring(0,assetUrl.lastIndexOf('"')+1)+' id="'+this._movieId+'"></embed>';}if(assetUrl.indexOf("width=")==-1){assetUrl=assetUrl.substring(0,assetUrl.lastIndexOf('"')+1)+' width="'+this._width+'"></embed>';}if(assetUrl.indexOf("height=")==-1){assetUrl=assetUrl.substring(0,assetUrl.lastIndexOf('"')+1)+' height="'+this._height+'"></embed>';}this._asset=new Element("div",{}).update(assetUrl);}if((this._content.contentSource=="upload"||this._content.contentSource=="videoegg")&&this._content.pageAsset.transcodeStatus>1){this._asset=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/failed/bad_transcode_430x323.gif",width:this._width,height:(this._width*3/4),alt:current.locale.Bundle.get("item.transcode_failed")});}if((this._content.contentSource=="upload"||this._content.contentSource=="videoegg"||this._content.contentSource=="webcam")&&(this._content.pageAsset.transcodeStatus==null||this._content.pageAsset.transcodeStatus<1)){this._asset=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/transcoding/transcode_430x323.gif",width:this._width,height:(this._width*3/4),alt:current.locale.Bundle.get("item.Transcoding")});}}else{if(this._content.pageAsset==null){this._asset=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/no_asset/no_image_430x323.gif",width:this._width,height:(this._width*3/4),alt:current.locale.Bundle.get("item.no_asset")});}}}},setAssetWidth:function(w){this._assetWidth=w;},setAssetHeight:function(h){this._assetHeight=h;},setPlayerWidth:function(w){this._width=w;},setPlayerHeight:function(h){this._height=h;},setPlayerBgColor:function(bgColor){this._bgColor=bgColor;},setFixedHeight:function(fh){this._fixedHeight=fh;},setHideLogo:function(hideLogo){this._hideLogo=hideLogo;},useThumbUrl:function(useThumbUrl){this._useThumbUrl=useThumbUrl;},setThumbUrl:function(thumbUrl){this._thumbUrl=thumbUrl;},setAssetDivId:function(assetDivId){this._assetDivId=assetDivId;},setMovieId:function(movieId){this._movieId=movieId;},setAutoplay:function(autoplay){this._autoplay=autoplay;},setShowThumbnailForVideo:function(showThumbnail,showPlayerCallback){this._showThumbnail=showThumbnail;this._showPlayerCallback=showPlayerCallback;},setVolume:function(volume){this._forceVolume=volume;},skipLoadTracking:function(value){this._skipLoadTracking=value;},setPermalink:function(permalink){this._permalink=permalink;},setDisableEndSlate:function(disableEndSlate){this._disableEndSlate=disableEndSlate;},setEnableMenu:function(enableMenu){this._enableMenu=enableMenu;},setPageContext:function(pageContext){this._pageContext=pageContext;},setSkipOverlay:function(skipOverlay){this._skipOverlay=skipOverlay;},setAdKeywords:function(keywords){this._adKeywords=keywords;},getAsset:function(){return this._asset;},getThumbUrl:function(){var thumbUrl=this._content.pageAsset.thumbUrl;if(thumbUrl!=null&&thumbUrl!=""){if(thumbUrl.indexOf(".jpg")!=-1){thumbUrl=thumbUrl.substring(0,thumbUrl.indexOf(".jpg"));}if(thumbUrl.indexOf("_400x300")!=-1){thumbUrl=thumbUrl.substring(0,thumbUrl.indexOf("_400x300"));}thumbUrl=thumbUrl+"_400x300.jpg";}return thumbUrl;}});current.stub("current.components.assets");current.components.assets.ThumbUrl=Class.create({initialize:function(content){this._data=content;this._thumbUrl=this.__getThumbUrl();},init:function(){},getThumbnailBySize:function(width,height,extension){var t=String(this._thumbUrl);if(this._data.pageAsset==null||this._data.pageAsset.thumbUrl==null||this._data.pageAsset.thumbUrl==""){extension=".gif";}if(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=null&&this._data.pageAsset.transcodeStatus<1){t=current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/thumbnailing/image_transcode";extension=".gif";}if(t.endsWith("_400x300.jpg")){t=t.replace(/_400x300.jpg/g,"");}t+="_"+width+"x"+height+extension;return t;},__getThumbUrl:function(){if(this._data.pageAsset!=null&&this._data.pageAsset.thumbUrl!=null&&this._data.pageAsset.thumbUrl!=""){return this._data.pageAsset.thumbUrl;}else{if((this._data.contentSource=="upload"||this._data.contentSource=="videoegg")&&this.__getTranscodeStatus()<1){return current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/transcoding/transcode";}if(this._data.contentSource=="webcam"&&this.__getTranscodeStatus()!=1){return current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/thumbnailing/image_transcode";}if((this._data.contentSource=="internet"||this._data.contentSource=="bundle"||this._data.contentSource=="feed"||this._data.contentSource=="scene")&&this.__getTranscodeStatus()!=1&&this._data.pageAsset!=null){return current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/thumbnailing/image_transcode";}if((this._data.contentSource=="text")&&(this._data.pageAsset==null)){return current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/text/text";}return current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/no_asset/no_image";}},__getTranscodeStatus:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=""&&this._data.pageAsset.transcodeStatus!=null)?this._data.pageAsset.transcodeStatus:0;}});current.stub("current.components.bfd");current.components.bfd.BfdModule=Class.create({initialize:function(moduleId){this._module=$(moduleId);this._form=$(moduleId).down("#bfdCommentPost");this._textarea=$(moduleId).down("textarea");this._submitButton=$(moduleId).down("#submitButton");this._submitButton.observe("click",this.__onSubmitClick.bindAsEventListener(this));this._user=current.User.getInstance();this._textarea.observe("click",this.__onTextareaClick.bindAsEventListener(this));},__onTextareaClick:function(event){if(!this._user.isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);this._textarea.disable();return ;}if(!current.Authorize.checkWriteMode(event)){event.stop();this._textarea.disable();return ;}},__onSubmitClick:function(event){if(!this._user.isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);this._textarea.disable();return ;}if(!current.Authorize.checkWriteMode(event)){event.stop();return ;}if(!Validation.validate($(this._textarea))){event.stop();return ;}else{this.dimSubmitButton();}},dimSubmitButton:function(){this._submitButton.value=current.locale.Bundle.get("submitting")+"...";this._submitButton.setOpacity(0.4);},resetSubmitButton:function(){this._submitButton.value=this._submitButton.value=current.locale.Bundle.get("submit");this._submitButton.setOpacity(1);}});Object.Event.extend(current.components.bfd.BfdModule);current.components.bfd.BfdModule.getInstance=function(moduleId){if(!document.__bfdModule__){document.__bfdModule__=new current.components.bfd.BfdModule(moduleId);}return document.__bfdModule__;};current.stub("current.components.assignments");current.components.assignments.AssignmentsCreate=Class.create({initialize:function(){this._aMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this._aDays=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();if($("titleText").value==""||$("titleText").value==current.locale.Bundle.get("c_assignment.Enter_a_title_for_this_Assignment")){$("type_1").checked=true;$("hide_1").checked=true;$("assignment_payment_non-paid").checked=true;Element.hide("deleteButton");if(sourceType=="Item Page"){$("actionLinkText").value=current.locale.Bundle.get("c_assignment.leave_comment");}else{$("actionLinkText").value=current.locale.Bundle.get("c_assignment.post_a_story");}}var fields=$$(".isBlurable");for(var i=0;i<fields.length;i++){Event.observe(fields[i],"blur",this.__onInputBlur.bindAsEventListener(this));this.__onInputBlur(null,fields[i]);}var clicks=$$(".isClickable");for(var i=0;i<clicks.length;i++){Event.observe(clicks[i],"click",this.__onInputClick.bindAsEventListener(this));if($("moreInfoText").value!=""){this.__onInputClick(null,clicks[i]);}}if($("deleteButton")){Event.observe($("deleteButton"),"click",this.__onConfirmDelete.bindAsEventListener(this));}if($("brandSelect")){Event.observe($("brandSelect"),"change",this.__onInputChange.bindAsEventListener(this));this.__onInputChange(null,$("brandSelect"));}var cals=$$(".isDateTime");for(var i=0;i<cals.length;i++){this.__onLoadDate(cals[i]);}var cals=$$(".dateTimeSelect");for(var i=0;i<cals.length;i++){Event.observe(cals[i],"change",this.__setDate.bindAsEventListener(this));}},__onInputBlur:function(event,field){var elm=(event==null)?field:Event.element(event);var names=elm.classNames().toString().split(" ");for(var i=0;i<names.length;i++){if(names[i].startsWith("validate-max")){elm.value=elm.value.substring(0,parseInt(names[i].substring(12,names[i].length))-elm.value.substring(0,parseInt(names[i].substring(12,names[i].length))).split(/\n/).length);}if(names[i].startsWith("blurValueListener-")){if($(names[i].substring(18,names[i].length))){$(names[i].substring(18,names[i].length)).innerHTML=elm.value;}}if(names[i].startsWith("blurClassListener-")){$$("."+names[i].substring(18,names[i].length)).each(function(node){node.innerHTML=elm.value;});}if(names[i].startsWith("blurBuildListener-")){var obj=$(names[i].substring(18,names[i].length));var choice=(elm.id=="moreInfoText")?"moreInfo":"logosAndAssets";var choiceClick=(choice=="moreInfo")?"displayExtraInfo('moreInfo');":"displayExtraInfo('logosAndAssets');";var choiceText=(choice=="moreInfo")?"more info":"logos and assets";}}},__onInputChange:function(event,change){var elm=(event==null)?change:Event.element(event);var names=elm.classNames().toString().split(" ");for(var i=0;i<names.length;i++){if(names[i].startsWith("changeValueClassListener-")){$$("."+names[i].substring(25,names[i].length)).each(function(node){node.innerHTML=elm[elm.selectedIndex].value+"";});}if(names[i].startsWith("changeImageClassListener-")){$$("."+names[i].substring(25,names[i].length)).each(function(node){node.className="assignmentDetail first "+elm[elm.selectedIndex].value.replace(" ","");});}if(names[i].startsWith("changeLabelClassListener-")){$$("."+names[i].substring(25,names[i].length)).each(function(node){node.className="Sprites previewLabel label "+elm[elm.selectedIndex].value.replace(" ","")+"Label";});}if(names[i].startsWith("changePatternClassListener-")){$$("."+names[i].substring(27,names[i].length)).each(function(node){if(node.id=="assignmentBanner"){node.className="previewAssignmentCallout "+elm[elm.selectedIndex].value.replace(" ","")+"AssignmentPattern "+elm[elm.selectedIndex].value.replace(" ","")+"AssignmentColors";}if(node.id=="assignmentMoreInfo"){node.className="previewAssignmentCallout "+elm[elm.selectedIndex].value.replace(" ","")+"AssignmentColors noTopBorder";}});}}},setPromoImage:function(path){if(path==""||path=="undefined"){return ;}$("assignment_promoImage").hide();$("assignment_promoImage").up("div").insert(new Element("a",{href:"#",id:"promoImageRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var promoImageHolder=new Element("div",{id:"promoImageHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path,style:"margin-right: 5px;"}));promoImageHolder.insert(new Element("a",{href:"#",id:"promoImageReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$("assignment_promoImage").up("div").insert(promoImageHolder);Event.observe($("promoImageRevertLink"),"click",this._hideImageForm.bindAsEventListener(this));Event.observe($("promoImageReplaceLink"),"click",this._showImageForm.bindAsEventListener(this));},_hideImageForm:function(){$("assignment_deletePromoImage").value="false";$("assignment_promoImage").hide();$("promoImageRevertLink").hide();$("promoImageHolder").show();},_showImageForm:function(){$("assignment_deletePromoImage").value="true";$("promoImageHolder").hide();$("assignment_promoImage").show();$("promoImageRevertLink").show();},__onLoadDate:function(elm){var stringValue=elm.value;now=new Date();localeShift=now.getTimezoneOffset()/60;now.setHours(now.getHours()+localeShift);now.setMinutes(0);var tempDateString=this.__getRFC822Date(now);if(elm.id.indexOf("start")!=-1){endTime=(stringValue=="")?tempDateString:elm.value;$("startTime").value=endTime;}else{var shift=new Date(now.getTime()+(7*24*60*60*1000));endTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$("endTime").value=endTime;}end=new Date(endTime);delta=new Date(end-now);seconds=Math.floor(delta.valueOf()/1000);var elSrc=end;elSrc.setHours(elSrc.getHours()+elSrc.getTimezoneOffset()/60);endTime=elSrc.toString();var elTargetMonth=elm.id+"Month";var elTargetDay=elm.id+"Day";var elTargetYear=elm.id+"Year";var elTargetTime=elm.id+"Hour";var month=elSrc.getMonth();var day=elSrc.getDate()-1;var year=elSrc.getFullYear();var time=elSrc.getHours()-1;if(time<0){time=0;}if($(elTargetMonth)&&$(elTargetMonth).options[month]){$(elTargetMonth).options[month].selected=true;}if($(elTargetDay)&&$(elTargetDay).options[day]){$(elTargetDay).options[day].selected=true;}if($(elTargetYear)){for(var i=0;i<$(elTargetYear).options.length;i++){if($(elTargetYear).options[i].value==year){$(elTargetYear).options[i].selected=true;}}}if($(elTargetTime)){for(var i=0;i<$(elTargetTime).options.length;i++){if($(elTargetTime).options[i].value==time){$(elTargetTime).options[i].selected=true;}}}if(elm.id.indexOf("start")!=-1){$("startEastern").innerHTML="* "+getDateAndTimeFromUTC(endTime,-4,"EST",false,false);$("startPacific").innerHTML="* "+getDateAndTimeFromUTC(endTime,-7,"PST",false,false);}else{$("endEastern").innerHTML="* "+getDateAndTimeFromUTC(endTime,-4,"EST",false,false);$("endPacific").innerHTML="* "+getDateAndTimeFromUTC(endTime,-7,"PST",false,false);}},__getRFC822Date:function(oDate){var rfc822=new String();rfc822=this._aDays[oDate.getDay()]+", ";rfc822+=this.__padWithZero(oDate.getDate())+" ";rfc822+=this._aMonths[oDate.getMonth()]+" ";rfc822+=oDate.getFullYear()+" ";rfc822+=this.__padWithZero(oDate.getHours())+":";rfc822+=this.__padWithZero(oDate.getMinutes())+":";rfc822+=this.__padWithZero(oDate.getSeconds())+" ";rfc822+=this.__getTZOString(oDate.getTimezoneOffset());return rfc822;},__padWithZero:function(val){if(parseInt(val)<10){return"0"+val;}return val;},__getTZOString:function(timezoneOffset){var hours=Math.floor(timezoneOffset/60);var modMin=Math.abs(timezoneOffset%60);var s=new String();s+=(hours>0)?"-":"+";var absHours=Math.abs(hours);s+=(absHours<10)?"0"+absHours:absHours;s+=((modMin==0)?"00":modMin);return(s);},__setDate:function(event){var elm=Event.element(event);if(elm.id.indexOf("start")!=-1){var dateText=$("startTimeMonth").options[$("startTimeMonth").selectedIndex].value+"/"+$("startTimeDay").options[$("startTimeDay").selectedIndex].value+"/"+$("startTimeYear").options[$("startTimeYear").selectedIndex].value+" "+$("startTimeHour").options[$("startTimeHour").selectedIndex].text;if(new Date(dateText)>end){alert(current.locale.Bundle.get("c_assignment.The_start_date_must_be"));this.__onLoadDate($("startTime"));}else{$("startEastern").innerHTML="* "+getDateAndTimeFromUTC(dateText,-4,"EST",false,false);$("startPacific").innerHTML="* "+getDateAndTimeFromUTC(dateText,-7,"PST",false,false);$("startTime").value=dateText+" GMT";}}if(elm.id.indexOf("end")!=-1){var dateText=$("endTimeMonth").options[$("endTimeMonth").selectedIndex].value+"/"+$("endTimeDay").options[$("endTimeDay").selectedIndex].value+"/"+$("endTimeYear").options[$("endTimeYear").selectedIndex].value+" "+$("endTimeHour").options[$("endTimeHour").selectedIndex].text;if(new Date($("startTime").value)>new Date(dateText)){alert(current.locale.Bundle.get("c_assignment.The_start_date_must_be"));this.__onLoadDate($("endTime"));}else{$("endEastern").innerHTML="* "+getDateAndTimeFromUTC(dateText,-4,"EST",false,false);$("endPacific").innerHTML="* "+getDateAndTimeFromUTC(dateText,-7,"PST",false,false);$("endTime").value=dateText+" GMT";end=new Date(dateText);}}},__onConfirmDelete:function(event){if(confirm("Are you sure you want to delete this?")){$("actionJackson").value="delete";return true;}Event.stop(event);return false;},__onInputClick:function(event,check){var elm=(event==null)?check:Event.element(event);if(elm.checked){var names=elm.classNames().toString().split(" ");var displayText="";for(var i=0;i<names.length;i++){if(names[i].startsWith("clickBuildListener-")){displayText=names[i].substring(19,names[i].length);}}}else{if($(elm.id+"li")){$("resourceList").removeChild($(elm.id+"li"));}if($("otherResources")&&$("resourceList")&&$("resourceList").childNodes.length==0){$("otherResources").removeChild($("resourceList"));$("otherResources").removeChild($("otherResourcesHeader"));}}},cleanUpResources:function(){var clicks=$$(".isClickable");for(var i=0;i<clicks.length;i++){if($(clicks[i].id+"li")){$("resourceList").removeChild($(clicks[i].id+"li"));}if($("resourceList")&&$("resourceList").childNodes.length==0){$("otherResources").removeChild($("resourceList"));$("otherResources").removeChild($("otherResourcesHeader"));}}}});current.stub("current.components.assignments");current.components.assignments.Assignments=Class.create({initialize:function(assignmentId,groupSlug,link,isMember){this._downloadLink=$(link);this._id=assignmentId;this._slug=groupSlug;this._userHasJoined=isMember;this._userHasAcceptedTerms=false;this._user=current.User.getInstance();},init:function(){if(this._downloadLink!=null){this._buildTerms();if(this._user.isLoggedIn()){UserService.fetchHeaderInfo(this._user.getUsername(),this.__rolesReceived.bindAsEventListener(this),this.__rolesFailed.bindAsEventListener(this));}}},_buildTerms:function(){try{if(this._downloadLink){this._downloadLink.observe("click",this.__onTermsClick.bindAsEventListener(this));}$("assignmentMoreInfo").show();}catch(e){}},__onTermsClick:function(event){event.stop();if(!this._user.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}if(this._userHasAcceptedTerms){location.href=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/download_assets.htm?slug="+this._slug;return ;}else{var termsWindow=new current.components.assignments.TermsWindow(event,this._slug,(event.element().cumulativeOffset()["left"]),(event.element().cumulativeOffset()["top"]),this._userHasJoined);termsWindow.init();}},__rolesReceived:function(data){if(data&&data.length>0){for(var i=0;i<data.length;i++){if(data[i]["name"]=="ROLE_MAKE_COMMONS_DAY"){this._userHasAcceptedTerms=true;}}}},__rolesFailed:function(data){}});current.components.assignments.Assignments.getInstance=function(){if(!document.__currentAssignments__){document.__currentAssignments__=new current.components.assignments.Assignments();}return document.__currentAssignments__;};current.stub("current.components.assignments");current.components.assignments.TermsWindow=Class.create({initialize:function(event,slug,posLeft,posTop,isMember){this._open=false;this._modalWidth="300";this._modalHeight="390";this._modalId="termsWindow";this._slug=slug;this._message=current.locale.Bundle.get("assignment.additional_terms_and_conditions")+":";this._error=null;if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=event.element().cumulativeOffset()["left"];this._modalPosTop=event.element().cumulativeOffset()["top"];}if(this._modalPosLeft<10){this._modalPosLeft=10;}this._user=current.User.getInstance();this._userHasJoined=isMember;},init:function(){this._title=current.locale.Bundle.get("assignment.almost");Control.Modal.open(false,{contents:'<div class="accountModalTitle"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="accountModalBody" class="assignmentTerms"><h3>'+this._message+'</h3><div id="accountModalForm"></div></div>',position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"accountModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._open=false;},__onModalLoaded:function(){new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+"/assignment_terms_and_conditions.htm?id="+this._slug,{method:"get",onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){$("termsAndConditionsForm").observe("submit",this.__onTermsSubmit.bindAsEventListener(this));if($("termsAndConditionsText")&&$("termsAndConditionsHidden")){$("termsAndConditionsText").value=$("termsAndConditionsHidden").innerHTML;}},__onCloseClick:function(){Control.Modal.close();},__onTermsSubmit:function(event){event.stop();var t=Validation.validate("termsAndConditions_accept",{hideAdvice:true});if(!t){if(this._error==null){this._error=Validation.throwError("termsCheckbox",current.locale.Bundle.get("assignment.You_must_accept_the_Additional_Terms_and_Conditions_to_continue"));}}else{if(this._error!=null){this._error.remove();this._error=null;}if(!this._userHasJoined){var param={id:this._slug,username:this._user.getUsername(),action:"add"};current.proxy.CCCP.execute("group","join_group",param,this.__onJoinData.bindAsEventListener(this),this.__onJoinFail.bindAsEventListener(this));}else{this.__onJoinData();}}},__onJoinData:function(){UserService.addSpecialRole(this._user.getUsername(),"add","ROLE_MAKE_COMMONS_DAY",this.__onTermsSuccess.bindAsEventListener(this),this.__onTermsFail.bindAsEventListener(this));},__onJoinFail:function(){this._error=Validation.throwError("termsCheckbox","You could not be added to this group.");},__onTermsSuccess:function(){Control.Modal.close();new Ajax.Request(current.Constants.getInstance().getScriptName()+"/utils/sessions/invalidate/"+this._user.getId(),{method:"get",evalJS:false,onSuccess:this.__goToDownloads.bindAsEventListener(this),onFailure:this.__invalidateFail.bindAsEventListener(this)});},__onTermsFail:function(){this._error=Validation.throwError("termsCheckbox","Your agreement could not be logged.");},__goToDownloads:function(){location.href=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/download_assets.htm?slug="+this._slug;},__invalidateFail:function(){this._error=Validation.throwError("termsCheckbox","Your session could not be invalidated.");}});current.stub("current.components.badges");current.components.badges.BadgeList=Class.create({initialize:function(){this._offsetX=12;this._offsetY=-20;},init:function(){this._observeBadges($(this._badgeList));this._toolTip=new current.components.menus.ToolTip("300","40");},setBadgeList:function(name){this._badgeList=name;},_observeBadges:function(target){if($(target)){this._badges=$(target).select(".badge");this._badges.invoke("observe","mouseover",this.__onBadgeHover.bindAsEventListener(this));this._badges.invoke("observe","mouseout",this.__onBadgeExit.bindAsEventListener(this));}},__onBadgeHover:function(event){event.stop();var e=event.element();if(!e.hasClassName("badge")){e=e.up(".badge");}if(this._itemInFocus==e.id){return ;}if(this._itemInFocus){this._toolTip.hide();this._itemInFocus=false;}this._itemInFocus=e.id;var PosLeft=(e.cumulativeOffset()["left"]+e.getWidth()+this._offsetX);var PosTop=(e.cumulativeOffset()["top"]+this._offsetY);if($(this._badgeList+"_"+e.rel)){this._toolTip.setDomContent($(this._badgeList+"_"+e.rel).innerHTML);this._toolTip.show(event,PosLeft,PosTop);}},__onBadgeExit:function(e){var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if(!reltg||!this._itemInFocus){return ;}try{if(reltg.id==this._itemInFocus){return ;}}catch(e){return false;}this._toolTip.hide();this._itemInFocus=false;}});Object.Event.extend(current.components.badges.BadgeList);current.components.badges.BadgeList.getInstance=function(){if(!document.__badgeList__){document.__badgeList__=new current.components.badges.BadgeList();}return document.__badgeList__;};current.stub("current.components.channelfinder");current.components.channelfinder.FinderWindow=Class.create({initialize:function(event){this._open=false;this._modalWidth="574";this._modalHeight="";this._contentWidth="520";this._modalId="finderWindow";this._content="";this._headline=current.locale.Bundle.get("channel_finder");this._eventElement=current.utils.Compatibility.getEventElement(event);this._winWidth=document.viewport.getWidth();this._posTop=120;this._posLeft=parseFloat(parseFloat(parseFloat(this._winWidth)-parseFloat(this._modalWidth))/2);if(this._posLeft<10){this._posLeft=10;}if(this._posTop<120){this._posTop=120;}},setIframeUrl:function(url){this._content='<div style="height:6px;clear:both;"></div><iframe src="'+url+'" width="520" height="400" frameborder="0" scrolling="auto"></iframe>';},init:function(){var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="alertModalBody" style="width: '+this._contentWidth+'px;height:420px">'+this._content+"</div>";if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._modalPosLeft=this._modalPosLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._posLeft,offsetTop:this._posTop,overlayDisplay:false,width:this._modalWidth,closeButton:false,containerClassName:"channelfinderModalContainer",disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._draggable.destroy();this._open=false;},__onModalLoaded:function(){this._open=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();}});current.stub("current.components.completers");current.components.completers.AbstractCompleter=Class.create(Autocompleter.Base,{initialize:function(element,update,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.frequency=0.2;},getUpdatedChoices:function(){},onComplete:function(data){var out="";items=data.each(function(i){out+="<li>"+i.name+"</li>";});this.updateChoices("<ul>"+out+"</ul>");}});Autocompleter.Interests=Class.create(Autocompleter.Base,{initialize:function($super,element,update,options,interestType){this._interestType=interestType;options.asynchronous=true;options.frequency=0.2;options.ieZIndex=10001;$super(element,update,options);},getUpdatedChoices:function(){InterestUserService.searchInterestsForUser(this._interestType,this.element.value,this.options.choices,"false",this.onComplete.bindAsEventListener(this));},getInputElement:function(){return this.element;},onComplete:function(data){var out="";items=data.each(function(i){out+="<li>"+i.name.escapeHTML()+'<span class="informal">&nbsp;&nbsp;('+i.contentCount+")</span></li>";});this.updateChoices("<ul>"+out+"</ul>");},onShowDefault:function(element,update){if(!update.style.position||update.style.position=="absolute"){update.style.position="absolute";update.style.zIndex="10005";Position.clone(element,update,{setHeight:false,setWidth:false,offsetTop:element.offsetHeight});update.addClassName("interestDropDownDefault");}Effect.Appear(update,{duration:0.15});}});current.TagsBrowser=Class.create(Autocompleter.Interests,{initialize:function($super,element,update,options){$super(element,update,options,"tags");},getUpdatedChoices:function(){var u=current.User.getInstance();var showClosed=u.isTagAdminWrite();this._newText=(this.element.value.lastIndexOf(",")!=-1)?this.element.value.substring(this.element.value.lastIndexOf(",")+1):this.element.value;this._newText=this._newText.replace(/^\s+|\s+$/g,"");if(this._newText.length>1){InterestService.searchInterests(this._interestType,this._newText,this.options.choices,showClosed,this.onComplete.bindAsEventListener(this));}}});current.TagsIdBrowser=Class.create(Autocompleter.Interests,{initialize:function($super,element,update,options,target){$super(element,update,options,"tags");this._target=target;},getUpdatedChoices:function(){var u=current.User.getInstance();var showClosed=u.isTagAdminWrite();this._newText=(this.element.value.lastIndexOf(",")!=-1)?this.element.value.substring(this.element.value.lastIndexOf(",")+1):this.element.value;this._newText=this._newText.replace(/^\s+|\s+$/g,"");if(this._newText.length>1){InterestService.searchInterests(this._interestType,this._newText,this.options.choices,showClosed,this.onComplete.bindAsEventListener(this));}},onComplete:function(data){var out="";if(data.length>0){scope=this;items=data.each(function(i){out+='<li><a href="#" rel="'+i.id+'">'+i.name+"</a></li>";});}else{out+="<li>"+current.locale.Bundle.get("interestAutocompleteJS.noResults")+"</li>";}this.updateChoices("<ul>"+out+"</ul>");},onClick:function(event){var element=Event.findElement(event,"LI");this.element.value=element.down("a").rel;this.hide();event.stop();}});current.GroupsBrowser=Class.create(Autocompleter.Interests,{initialize:function($super,element,update,options,identifyinger){$super(element,update,options,"groups");this._identifier=identifyinger;if((this._identifier=="groups")||(this._identifier=="parentSlug")||(this._identifier=="path")){$(element).observe("change",this.onTargetChange.bindAsEventListener(this));}},getUpdatedChoices:function(){this._newText=(this.element.value.lastIndexOf(",")!=-1)?this.element.value.substring(this.element.value.lastIndexOf(",")+1):this.element.value;this._newText=this._newText.replace(/^\s+|\s+$/g,"");if(this._newText.length>1){if(this._identifier=="parentSlug"||this._identifier=="path"){InterestService.searchGroupsBySlug(this._newText,this.options.choices,"true",this.onComplete.bindAsEventListener(this));}else{InterestService.searchInterests("groups",this._newText,this.options.choices,"true",this.onComplete.bindAsEventListener(this));}}},onComplete:function(data){var out="";if(data.length>0){scope=this;items=data.each(function(i){var display="";if(scope._identifier=="groups"){display=i.name;fn="channelPage.setGroupSlug";}else{if(scope._identifier=="parentSlug"||this._identifier=="path"){display=i.slug;fn="groupCreatePage.setParentSlug";}else{display=i.slug;fn="console.log";}}out+='<li name="'+i.slug+'"><a href="#" rel="'+i.slug+'" onclick="'+fn+'(this.rel); return false;">'+display+"</a></li>";});}else{out+="<li>"+current.locale.Bundle.get("interestAutocompleteJS.noResults")+"</li>";}this.updateChoices("<ul>"+out+"</ul>");},onTargetChange:function(){var slug=$(this.getCurrentEntry()).down().rel;if(this._identifier=="parentSlug"||this._identifier=="path"){groupCreatePage.setParentSlug(slug);}else{channelPage.setGroupSlug(slug);}}});current.stub("current.components.completers");current.components.completers.College=Class.create(Autocompleter.Base,{initialize:function(element,update,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.frequency=0.2;this.options.afterUpdateElement=this._afterUpdateElement.bind(this);this.active=true;},getUpdatedChoices:function(){UserService.fetchUniversitiesMatching(this.element.value,this.__onComplete.bindAsEventListener(this));},getInputElement:function(){return this.element;},setValueField:function(f){this._valueField=$(f);},getValueField:function(){return this._valueField;},_afterUpdateElement:function(el,selected){this.getValueField().value=$(selected).title;},__onComplete:function(data){var out="";items=data.each(function(i){out+='<li title="'+i.id+'">'+i.name+"</li>";});this.updateChoices("<ul>"+out+"</ul>");},onKeyPress:function(event){this.getValueField().value=0;if(this.active){switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return ;case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;case Event.KEY_UP:this.markPrevious();this.render();if(Prototype.Browser.WebKit){Event.stop(event);}return ;case Event.KEY_DOWN:this.markNext();this.render();if(Prototype.Browser.WebKit){Event.stop(event);}return ;}}else{if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&event.keyCode==0)){return ;}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer);}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);}});current.stub("current.components.completers");current.components.completers.Member=Class.create(current.components.completers.AbstractCompleter,{initialize:function($super,element,update,options,creditor){$super(element,update,options);this.crediting=creditor;},getUpdatedChoices:function(){if(this.crediting=="simpleUserSearch"){UserService.fetchUsersByName(this.element.value,this.onComplete.bindAsEventListener(this));}else{UserService.fetchUsersByName(this.element.value,this.onCreditingComplete.bindAsEventListener(this));}},onCreditingComplete:function(data){if(data.length>0){$("creditingMembersList").innerHTML="";this.crediting._addToSelectList(data,"creditingMembersList","list");}else{this.crediting._noCreditingChoicesFound("creditingMembersList",current.locale.Bundle.get("messageJS.nobody_found_yet"));}},onComplete:function(data){if(data.length>0){var out="";items=data.each(function(i){out+='<li name="'+i.id+'"><a href="#" rel="'+i.username+'">'+i.username+"</a></li>";});this.updateChoices("<ul>"+out+"</ul>");}},onClick:function(event){var element=Event.findElement(event,"LI");this.element.value=element.down("a").rel;this.hide();event.stop();},hide:function(){if($("challengeStartSceneOwnerHolder")){$("challengeStartSceneOwnerHolder").hide();}}});current.stub("current.components.connections");current.components.connections.Manager=Class.create({initialize:function(connectionIdPrefix,removeLinkClassName,addLinkClassName,unblockLinkClassName){this._user=current.User.getInstance();this._connectionIdPrefix=connectionIdPrefix;this._removeLinkClassName=removeLinkClassName;this._addLinkClassName=addLinkClassName;this._unblockLinkClassName=unblockLinkClassName;this.__observeRemoveLinks($("content"));this.__observeAddLinks($("content"));if(this._unblockLinkClassName!=null){this.__observeUnblockLinks($("content"));}$("content").select(".inviteLink").invoke("observe","click",this.__onInviteClick.bindAsEventListener(this));},__onInviteClick:function(event){if(!current.Authorize.checkWriteMode(event)){event.stop();return ;}},__observeRemoveLinks:function(target){target.select("."+this._removeLinkClassName).invoke("observe","click",this.__onRemoveClick.bindAsEventListener(this));},__onRemoveClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this.__setActionElement(event.element());this.__setTargetUser(event.element().rel);FriendService.removeFriendAjax(this._user.getUsername(),this.__getTargetUser(),"delete",this.__onRemoveComplete.bindAsEventListener(this));},__onRemoveComplete:function(data){Effect.DropOut($(this._connectionIdPrefix+this.__getTargetUser()));this.__setTargetUser("");this.__setActionElement("");},__observeAddLinks:function(target){target.select("."+this._addLinkClassName).invoke("observe","click",this.__onAddClick.bindAsEventListener(this));},__onAddClick:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}this.__setActionElement(event.element());this.__setTargetUser(event.element().rel);FriendService.addAsFriendAjax(this._user.getUsername(),this.__getTargetUser(),"add",this.__onAddComplete.bindAsEventListener(this));},__onAddComplete:function(data){$(this.__getActionElement()).replace(current.locale.Bundle.get("messages.In_Your_Network"));this.__setTargetUser("");this.__setActionElement("");},__observeUnblockLinks:function(target){target.select("."+this._unblockLinkClassName).invoke("observe","click",this.__onUnblockClick.bindAsEventListener(this));},__onUnblockClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this.__setActionElement(event.element());this.__setTargetUser(event.element().rel);FriendService.unblockUser(current.User.getInstance().getUsername(),this.__getTargetUser(),this.__onUnblockUser.bindAsEventListener(this));},__onUnblockUser:function(data){$(this.__getActionElement()).up().hide();this.__setTargetUser("");this.__setActionElement("");},__setTargetUser:function(username){this._targetUser=username;},__getTargetUser:function(){return this._targetUser;},__setActionElement:function(element){this._actionElement=element;},__getActionElement:function(){return this._actionElement;}});current.stub("current.components.header");current.components.header.PasswordProtect=Class.create({initialize:function(){this._isProtected=false;this._iHasProtection=false;this._showingProtection=false;this._passwordPath=null;this._passwordArray={};this._cookiePasswords={};},init:function(cfg){if(cfg.length==2){this._isProtected=true;this._passwordPath=cfg[0];this._passwordArray=cfg[1];}if(this._isProtected){var ccv=getCookieValue(current.Cookies.URL_PASSWORDS);if(ccv&&ccv!=null&&ccv!=""){try{this._cookiePasswords=eval("("+ccv+")");}catch(e){}if(this._cookiePasswords[this._passwordPath]!==undefined){this._iHasProtection=this.__isValidPassword(this._cookiePasswords[this._passwordPath]);}}}if(this._isProtected&&!this._iHasProtection){this._showingProtection=true;this.__buildPasswordOverlay();}},isWallUp:function(){return this._showingProtection;},onWallDown:function(){},__isValidPassword:function(str){var str=str.toLowerCase();for(var i=0;i<this._passwordArray.length;i++){if(this._passwordArray[i].toLowerCase()==str){return true;}}return false;},__submitPassword:function(event){event.stop();if(this._passwordInput.hasClassName("validation-failed")){return ;}var passphrase=this._passwordInput.value.toLowerCase();if(!this.__isValidPassword(passphrase)){return ;}this._cookiePasswords[this._passwordPath]=passphrase;var ccv=Object.toJSON(this._cookiePasswords);setTimedCookie(current.Cookies.URL_PASSWORDS,ccv,current.Cookies.DISTANT_EXPIRE);current.tracking.Track.getInstance().onPasswordAccess(passphrase);this.__destroyPasswordOverlay();},__submitEmail:function(event){if(this._emailInput.hasClassName("validation-failed")){event.stop();return ;}var email=this._emailInput.value;current.tracking.Track.getInstance().onPasswordAccessEmail(email);this._emailDesc.innerHTML=current.locale.Bundle.get("studiosProtect.enter_email_thanks");this._emailInput.style.display="none";this._emailSubmit.style.display="none";},__showEmailTab:function(event){event.stop();this._passwordTab.hide();this._emailTab.show();},__showPasswordTab:function(event){event.stop();this._emailTab.hide();this._passwordTab.show();},__focusEmailInput:function(event){if(!this._emailInput.emptyVal){this._emailInput.emptyVal=this._emailInput.value;}if(this._emailInput.value==this._emailInput.emptyVal){this._emailInput.value="";}this._emailInput.addClassName("filled");},__focusPasswordInput:function(event){if(!this._passwordInput.emptyVal){this._passwordInput.emptyVal=this._passwordInput.value;}if(this._passwordInput.value==this._passwordInput.emptyVal){this._passwordInput.value="";}this._passwordInput.addClassName("filled");},__blurEmailInput:function(event){if(this._emailInput.value==""){this._emailInput.value=this._emailInput.emptyVal;this._emailInput.removeClassName("filled");}},__blurPasswordInput:function(event){if(this._passwordInput.value==""){this._passwordInput.value=this._passwordInput.emptyVal;this._passwordInput.removeClassName("filled");}},__buildPasswordOverlay:function(){var doc=document;var windowHeight=Math.max(Math.max(doc.body.scrollHeight,doc.documentElement.scrollHeight),Math.max(doc.body.offsetHeight,doc.documentElement.offsetHeight),Math.max(doc.body.clientHeight,doc.documentElement.clientHeight));var node=$("frame")||$("toolbar");var overlay=new Element("div",{id:"protectedPageOverlay","class":"protectedPageOverlay",style:"height:"+windowHeight+"px;"});var outer=new Element("div",{id:"protectedPageOuter","class":"protectedPageOuter"});var inner=new Element("div",{id:"protectedPageInner","class":"protectedPageInner"});var badge=new Element("div",{id:"protectedPageBadge","class":"protectedPageBadge"});this._passwordTab=new Element("div",{id:"protectedPageContainer","class":"protectedPageContainer"});this._passwordForm=new Element("form",{action:"#",method:"get",id:"protectedPageForm","class":"validate-init"});var passwordUL=new Element("ul");var passwordCaptionLI=new Element("li",{"class":"caption"}).insert(new Element("label",{"for":"protectedPageFormPassword"}).insert(current.locale.Bundle.get("studiosProtect.enter_code_caption")));passwordUL.insert(passwordCaptionLI);var passwordDescLI=new Element("li",{"class":"description"}).insert(new Element("div").insert("&nbsp;"));passwordDescLI.insert(new Element("label",{"for":"protectedPageFormPassword"}).insert(current.locale.Bundle.get("studiosProtect.enter_code_desc")));this._passwordInput=new Element("input",{type:"text",id:"protectedPageFormPassword",name:"protectedPageForm[password]","class":"required validate-accessCode",value:current.locale.Bundle.get("studiosProtect.enter_code_title")});passwordDescLI.insert(this._passwordInput);passwordUL.insert(passwordDescLI);var passwordSubmitLI=new Element("li",{"class":"submit"});var passwordSwitchA=new Element("a",{id:"protectedPasswordSwitchLink","class":"protectedPageLink",href:"#"}).insert(current.locale.Bundle.get("studiosProtect.enter_email_link"));passwordSubmitLI.insert(new Element("div",{"class":"protectedPageLinkDiv"}).insert(passwordSwitchA));this._passwordSubmit=new Element("input",{type:"submit",id:"protectedPageFormSubmit",name:"protectedPageForm[submit]",value:current.locale.Bundle.get("studiosProtect.enter_code_button"),"class":"Sprites Button lgButton lgBlueButton floatLeft"});passwordSubmitLI.insert(new Element("div",{"class":"protectedPageSubmitDiv"}).insert(this._passwordSubmit));passwordUL.insert(passwordSubmitLI);this._passwordForm.insert(passwordUL);this._passwordTab.insert(this._passwordForm);this._emailTab=new Element("div",{id:"protectedEmailContainer","class":"protectedEmailContainer"});this._emailForm=new Element("form",{action:"http://visitor.r20.constantcontact.com/d.jsp",method:"post",target:"_blank",id:"protectedEmailForm","class":"validate-init"});var emailUL=new Element("ul");emailUL.insert(new Element("input",{type:"hidden",name:"llr",value:"lhkvqtdab"}));emailUL.insert(new Element("input",{type:"hidden",name:"m",value:"1103387863275"}));emailUL.insert(new Element("input",{type:"hidden",name:"p",value:"oi"}));var emailCaptionLI=new Element("li",{"class":"caption"}).insert(new Element("label",{"for":"protectedEmailFormEmail"}).insert(current.locale.Bundle.get("studiosProtect.enter_email_caption")));emailUL.insert(emailCaptionLI);var emailDescLI=new Element("li",{"class":"description"}).insert(new Element("div").insert("&nbsp;"));this._emailDesc=new Element("label",{"for":"protectedEmailFormEmail"});emailDescLI.insert(this._emailDesc.insert(current.locale.Bundle.get("studiosProtect.enter_email_desc")));this._emailInput=new Element("input",{type:"text",id:"protectedEmailFormEmail",name:"ea","class":"required validate-email",value:current.locale.Bundle.get("studiosProtect.enter_email_title")});emailDescLI.insert(this._emailInput);emailUL.insert(emailDescLI);var emailSubmitLI=new Element("li",{"class":"submit"});var emailSwitchA=new Element("a",{id:"protectedEmailSwitchLink","class":"protectedPageLink",href:"#"}).insert(current.locale.Bundle.get("studiosProtect.enter_code_link"));emailSubmitLI.insert(new Element("div",{"class":"protectedPageLinkDiv"}).insert(emailSwitchA));this._emailSubmit=new Element("input",{type:"submit",id:"protectedEmailFormSubmit",name:"protectedEmailForm[submit]",value:current.locale.Bundle.get("studiosProtect.enter_email_button"),"class":"Sprites Button lgButton lgBlueButton floatLeft"});emailSubmitLI.insert(new Element("div",{"class":"protectedPageSubmitDiv"}).insert(this._emailSubmit));emailUL.insert(emailSubmitLI);this._emailForm.insert(emailUL);this._emailTab.insert(this._emailForm);this._errorDiv=new Element("div",{id:"protectedPageError","class":"protectedPageError"});this._emailTab.hide();badge.insert(this._passwordTab);badge.insert(this._emailTab);inner.insert(badge);inner.insert(this._errorDiv);outer.insert(inner);overlay.insert(outer);node.insert(overlay);passwordSwitchA.observe("click",this.__showEmailTab.bindAsEventListener(this));emailSwitchA.observe("click",this.__showPasswordTab.bindAsEventListener(this));this._passwordInput.observe("focus",this.__focusPasswordInput.bindAsEventListener(this));this._emailInput.observe("focus",this.__focusEmailInput.bindAsEventListener(this));this._passwordInput.observe("blur",this.__blurPasswordInput.bindAsEventListener(this));this._emailInput.observe("blur",this.__blurEmailInput.bindAsEventListener(this));var scope=this;Validation.add("validate-accessCode",current.locale.Bundle.get("validate.accessCode"),function(v){return scope.__isValidPassword(v);});this._passwordValidator=new Validation(this._passwordForm);this._emailValidator=new Validation(this._emailForm);this._passwordForm.observe("submit",this.__submitPassword.bindAsEventListener(this));this._emailForm.observe("submit",this.__submitEmail.bindAsEventListener(this));},__destroyPasswordOverlay:function(){if($("protectedPageOverlay")){Effect.Fade("protectedPageOverlay",{duration:1.5});}this._showingProtection=false;this.onWallDown();}});current.components.header.PasswordProtect.getInstance=function(){if(!document.__currentPasswordProtect__){document.__currentPasswordProtect__=new current.components.header.PasswordProtect();}return document.__currentPasswordProtect__;};current.stub("current.components.header");current.components.header.UserBadges=Class.create({initialize:function(){this._user=current.User.getInstance();this.init();},init:function(){if(this._user.isLoggedIn()){this._getNewBadges();}else{return ;}},_getNewBadges:function(){if(this._user.isLoggedIn()&&$("frame")){this._badge=0;UserService.newBadgesCheck(this._user.getUsername(),5,"newSinceLastCheck",this._newBadgesCheckSuccess.bindAsEventListener(this),this._newBadgesCheckFail.bindAsEventListener(this));}},_newBadgesCheckSuccess:function(data){if(data.items){this._badgeList=data.items;this.__cycleBadgesStart();}},__cycleBadgesStart:function(){var scope=this;document.observe("dom:loaded",function(){scope.__cycleBadges();});},__cycleBadges:function(){if(this._badgeList.length>0){var badge=this._badgeList.pop();var scope=this;if(badge.notification&&badge.notification!="N/A"){if(this._badgeDisplayTimer){clearTimeout(this._badgeDisplayTimer);}var notification=new Element("div").insert(badge.notification);var badgeUrl=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/badges/"+badge.slug+".htm";var badgesUrl=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/badges/";var badgeImage=new Element("a",{href:badgeUrl}).insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+badge.thumb}));var closeButton=new Element("a",{href:"#",id:"badgeDisplayClose","class":"Sprites closeButtonGrey floatRight"});var data={url:badgesUrl};var message=new Template(current.locale.Bundle.get("badges.learn_about_other_badges"));var alertBox=new Element("div",{id:"badgeInfo","class":"badgeInfo"});alertBox.insert(closeButton);alertBox.insert(badgeImage);notification.insert("&nbsp;"+message.evaluate(data));alertBox.insert(notification);if($("badgeDisplay")){$("badgeInfo").setOpacity(0);$("badgeDisplay").innerHTML="";alertBox.setOpacity(0);$("badgeDisplay").insert(alertBox);new Effect.Opacity(alertBox,{to:1,duration:0.5});}else{var alertContainer=new Element("div",{id:"badgeDisplay","class":"badgeAlert"});alertBox.setOpacity(0);alertContainer.insert(alertBox);Element.insert($("frame"),{before:alertContainer});new Effect.Opacity(alertBox,{to:1,duration:0.5});}$("badgeDisplayClose").observe("click",this.__onBadgeDisplayCloseClick.bindAsEventListener(this));this._badgeDisplayTimer=setTimeout(function(){scope.__cycleBadges();},30000);}else{this._badgeDisplayTimer=setTimeout(function(){scope.__cycleBadges();},100);}}else{this.__onBadgeDisplayCloseClick(null);}},_newBadgesCheckFail:function(data){},__onBadgeDisplayCloseClick:function(event){if(event!=null){event.stop();}if(this._badgeDisplayTimer){clearTimeout(this._badgeDisplayTimer);}if($("badgeDisplay")){$("badgeDisplay").hide();}}});current.components.header.UserBadges.getInstance=function(){if(!document.__currentUserBadges__){document.__currentUserBadges__=new current.components.header.UserBadges();}return document.__currentUserBadges__;};current.stub("current.components.groups");current.components.groups.Homepage=Class.create({initialize:function(){},init:function(){if($("postLink")){$("postLink").observe("click",this.__onClipperClick.bindAsEventListener(this));}if($("popModule_popularList")&&$("popModule_risingList")){this.initPopularStories();}if($("giModule_popularList")&&$("giModule_risingList")){this.initGroupStories();}if($("hpBfdModule")){this.initBfd();}if($("pDayInit")){this.initTvSchedule();}},initPopularStories:function(){var popItemList=new current.content.items.ItemList(["popModule_popularList","popModule_risingList"],"popular");popItemList.init();popItemList.enableInlineSorting("popModule_Rising","popModule_Popular","popModule_risingList","popModule_popularList");popItemList.setListSort("popular");},initGroupStories:function(){var giItemList=new current.content.items.ItemList(["giModule_popularList","giModule_risingList"],"new");giItemList.init();giItemList.enableInlineSorting("giModule_Rising","giModule_Popular","giModule_risingList","giModule_popularList");giItemList.setListSort("new");},initBfd:function(){var bfd=current.components.bfd.BfdModule.getInstance("hpBfdModule");},initTvSchedule:function(){var initData=$("pDayInit");var primetime=current.components.schedule.PrimetimeModule.getInstance();primetime.init("homePrimetimeModule",initData.rel);},__onClipperClick:function(event){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP,true);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var clipperWindow=new current.clipper.ClipperWindow(event);clipperWindow.setEditString(false);clipperWindow.init();}});Object.Event.extend(current.components.groups.Homepage);current.components.groups.Homepage.getInstance=function(){if(!document.__homepage__){document.__homepage__=new current.components.groups.Homepage();}return document.__homepage__;};current.stub("current.components.groups");current.components.groups.Manager=Class.create({initialize:function(updatesLinkClassName,removeLinkClassName){this._user=current.User.getInstance();this._updatesLinkClassName=updatesLinkClassName;this._removeLinkClassName=removeLinkClassName;this.__observeLinks($("content"));},__observeLinks:function(target){target.select("."+this._updatesLinkClassName).invoke("observe","click",this.__onUpdatesClick.bindAsEventListener(this));target.select("."+this._removeLinkClassName).invoke("observe","click",this.__onRemoveClick.bindAsEventListener(this));},__onUpdatesClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var updatesWindow=new current.components.groups.UpdatesWindow(event,event.element().rel,(event.element().cumulativeOffset()["left"]-125),(event.element().cumulativeOffset()["top"]+12));updatesWindow.init();},__onRemoveClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this.__setActionElement(event.element());this.__setTargetId(event.element().rel);var param={username:this._user.getUsername(),id:this.__getTargetId(),action:"delete"};current.proxy.CCCP.execute("group","join_group",param,this.__onRemoveComplete.bindAsEventListener(this));},__onRemoveComplete:function(data){if(isUndefined(data)||typeof data!="boolean"){return ;}Effect.DropOut($(this.__getActionElement()).up("li"));this.__setTargetId("");this.__setActionElement("");},__setTargetId:function(id){this._targetId=id;},__getTargetId:function(){return this._targetId;},__setActionElement:function(element){this._actionElement=element;},__getActionElement:function(){return this._actionElement;}});current.stub("current.components.groups");current.components.groups.FeaturedGroups=Class.create({initialize:function(){this._spinCarousel=true;this._currentIndex=0;this._previousIndex=-1;this._playlistTimer=6;this._secondClick=false;this._nonVideoTimer;},init:function(groupArray){this._limit=groupArray.length;this._playlistArray=groupArray;if($("startGroupLink")){$("startGroupLink").observe("click",this.__onStartGroupClick.bindAsEventListener(this,$("startGroupLink").href));}this._setListLinks($(document.getElementsByTagName("body")[0]));this._setInfoDivs($(document.getElementsByTagName("body")[0]));this.__startRotation();},_setListLinks:function(target){this._featuredGroupList=$(target).select(".featuredListLink");this._featuredGroupList.invoke("observe","click",this.__onFeaturedGroupClick.bindAsEventListener(this));},_setInfoDivs:function(target){this._featuredGroupInfoDivs=$(target).select(".featuredGroupInfo");},__onFeaturedGroupClick:function(event){event.stop();clearTimeout(this._nonVideoTimer);this._spinCarousel=false;this._currentIndex=event.element().id;this.__onGroupAdvance(this._currentIndex,event.element());},__startRotation:function(){this._nonVideoTimer=setTimeout(this.__advanceFeaturedGroup.bind(this),this._playlistTimer*1000);},__advanceFeaturedGroup:function(){clearTimeout(this._nonVideoTimer);this.__advanceIndex();this.__onGroupAdvance(this._currentIndex,null);},__advanceIndex:function(){this._currentIndex++;if(this._currentIndex>(this._limit-1)){this._currentIndex=0;}},__onGroupAdvance:function(i,el){this._currentIndex=i;if(this._previousIndex!=this._currentIndex){var listLink=$("list_"+this._playlistArray[this._currentIndex]);var groupInfo=$("info_"+this._playlistArray[this._currentIndex]);for(var i=0;i<this._featuredGroupList.length;i++){this._featuredGroupList[i].up("li").removeClassName("active");this._featuredGroupInfoDivs[i].hide();}listLink.addClassName("active");groupInfo.appear({duration:0.4});this._previousIndex=this._currentIndex;if(this._spinCarousel){this.__startRotation();}}else{if(!this._spinCarousel&&this._secondClick&&el!=null){this.__goToGroup(el.href);}}if(!this._spinCarousel){this._secondClick=true;}else{this._secondClick=false;}},__goToGroup:function(url){location.href=url;},__onStartGroupClick:function(event,startURL){if(!current.User.getInstance().isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.START_A_GROUP);setTimedCookie(current.Cookies.LOGIN_REDIRECT,startURL,30);}else{if(!current.User.getInstance().isEmailVerified()){event.stop();new current.components.account.VerifyWindow(event).init();return ;}}}});Object.Event.extend(current.components.groups.FeaturedGroups);current.components.groups.FeaturedGroups.getInstance=function(){if(!document.__featuredGroups__){document.__featuredGroups__=new current.components.groups.FeaturedGroups();}return document.__featuredGroups__;};current.stub("current.components.groups");current.components.groups.UpdatesWindow=Class.create({initialize:function(event,groupSlug,posLeft,posTop){this._open=false;this._modalWidth="224";this._modalHeight="240";this._contentWidth="170";this._modalId="updatesWindow";this._groupSlug=groupSlug;this._message=current.locale.Bundle.get("group.send_me_updates_on_this_groups_activity")+":";if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=event.element().cumulativeOffset()["left"];this._modalPosTop=event.element().cumulativeOffset()["top"];}if(this._modalPosLeft<10){this._modalPosLeft=10;}},init:function(){this._title=current.locale.Bundle.get("group.email_updates");var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="accountModalBody" class="updatesWindowBody" style="width: '+this._contentWidth+'px;">'+this._message+'<div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"accountModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){document.__modalOpenL1__=false;this._draggable.destroy();this._open=false;},__onModalLoaded:function(){document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+"/group_email_digest.htm?id="+this._groupSlug,{method:"get",onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){$("groupEmailUpdatesForm").observe("submit",this.__onLoginSubmit.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();},__onLoginSubmit:function(){var radio_name="groupEmailUpdates[frequency]";var radios=document.forms.groupEmailUpdates.elements[radio_name];var freq="daily";for(var i=0;i<radios.length;i++){if(radios[i].checked){freq=radios[i].value;}}current.proxy.CCCP.execute("user","set_email_digest",{id:current.User.getInstance().getName(),groupSlug:this._groupSlug,frequency:freq},this.__onCloseClick.bindAsEventListener(this));}});current.stub("current.components.groups");current.components.groups.RelatedWebsites=Class.create({initialize:function(target,groupId,count){this.setTarget(target);this._groupId=groupId;this._lastIndex=count;this._websiteInputs=new Array();},addOtherSite:function(string){if(this._websiteInputs.length<5){var inputValue=(string==null)?current.locale.Bundle.get("messageJS.other"):string;var i=this._lastIndex++;var li=new Element("li",{});var input=new Element("input",{type:"text",id:"related_"+i,name:"groupAdminEdit_related_"+i,title:"http:// ","class":"hasHinting"});this.getTarget().insert(li.insert(input));input.observe("keypress",this.__onKeyPress.bindAsEventListener(this,input));input.observe("blur",this.__onBlur.bindAsEventListener(this));EventSelectors.start(EventSelectorRules);this._websiteInputs.push("related_"+i);}},onOtherFocus:function(input){if(input.value!=input.title){return ;}input.value="";},decrementCount:function(){this._lastIndex=(this._lastIndex-1>0)?this._lastIndex-1:0;},setTarget:function(target){this._target=target;},getTarget:function(){return $(this._target);},getOtherValues:function(){var c=this._websiteInputs.length;var arr=new Array();for(var i=0;i<c;i++){var o=$(this._websiteInputs[i]);if(o!=null&&o.value!=""&&o.value!=o.title){arr.push(o.value);}}return arr;},__onKeyPress:function(event,input){this.onOtherFocus(input);var el=$(Event.element(event).id);var len=el.value.length;if(len>0){el.addClassName("validate-strictUrl");}else{el.removeClassName("validate-strictUrl");}if(this._lastIndex<5&&(this.getOtherValues().length-this._websiteInputs.length==0)){this.addOtherSite();}},__onBlur:function(event){var el=event.element();var url=el.value;if(!url.startsWith("http://")&&url!=""){el.value="http://"+url;}this.gatherWebsites();},gatherWebsites:function(){var ov=this.getOtherValues();$("groupAdminEdit_websites").value=ov.join(",");return true;}});current.stub("current.components.groups");current.components.groups.JSONUgoElements=Class.create({initialize:function(prefix,formId,customClass,target,limit,suppressDescription){this._prefix=prefix;this._formId=formId;this._customClass=customClass;this._suppressDescription=suppressDescription;this.setTarget(target);this._lastIndex=0;this._limit=limit;},addOtherElement:function(display){if(this._lastIndex<this._limit){var i=this._lastIndex;var labelStyle="margin: 0 0 1.5em; border-top-width: 0;";if(i>0){labelStyle+="padding-top: 1.5em;";}if(i==0){var liL=new Element("li",{id:this._formId+"Labels_"+i,"class":"customElement "+this._customClass+" ultraThin",style:"display: "+display+";"});var divL=new Element("div",{"class":"elementContainer"});var label0L=new Element("label",{"class":"leftLabel empty"}).insert("&nbsp;");var ulL=new Element("ul",{"class":"JSONDataElements"});var li1L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(current.locale.Bundle.get("custom_layouts.title")));ulL.insert(li1L);if(!this._suppressDescription){var liDL=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(current.locale.Bundle.get("custom_layouts.description")));ulL.insert(liDL);}var li2L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(current.locale.Bundle.get("custom_layouts.url")));ulL.insert(li2L);var li3L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(current.locale.Bundle.get("custom_layouts.image")));ulL.insert(li3L);divL.insert(label0L);divL.insert(ulL);liL.insert(divL);this.getTarget().insert({before:liL});}var li=new Element("li",{id:this._formId+"Element_"+i,"class":"customElement "+this._customClass,style:labelStyle+" display: "+display+";"});var div=new Element("div",{"class":"elementContainer"});var label=new Element("label",{"class":"leftLabel"}).insert("UGO No. "+(i+1)+":");div.insert(label);var ul=new Element("ul",{"class":"JSONDataElements"});var li1=new Element("li");var input1=new Element("input",{type:"text","class":"lrg validate-max255 characterCount hasHinting",name:this._prefix+"[ugo_title"+i+"]",id:this._prefix+"_"+this._formId+"_title"+i,title:current.locale.Bundle.get("custom_layouts.add_a_title")});li1.insert(input1);ul.insert(li1);if(!this._suppressDescription){var liD=new Element("li");var inputD=new Element("input",{type:"text","class":"lrg validate-max500 characterCount hasHinting",name:this._prefix+"[ugo_desc"+i+"]",id:this._prefix+"_"+this._formId+"_desc"+i});liD.insert(inputD);ul.insert(liD);}else{var inputD=new Element("input",{type:"hidden",value:"",name:this._prefix+"[ugo_desc"+i+"]",id:this._prefix+"_"+this._formId+"_desc"+i});li1.insert(inputD);}var li2=new Element("li");var input2=new Element("input",{type:"text","class":"lrg validate-url max1000 characterCount hasHinting",name:this._prefix+"[ugo_url"+i+"]",id:this._prefix+"_"+this._formId+"_url"+i,title:"http://"});li2.insert(input2);ul.insert(li2);var li3=new Element("li");var input3=new Element("input",{type:"file",name:this._prefix+"[ugo_thumb"+i+"]",id:this._prefix+"_"+this._formId+"_thumb"+i});li3.insert(input3);ul.insert(li3);div.insert(ul);var hiddenDelete=new Element("input",{type:"hidden",name:this._prefix+"[delete_ugo_thumb"+i+"]",id:this._prefix+"_delete_"+this._formId+"_thumb"+i});var hiddenOld=new Element("input",{type:"hidden",name:this._prefix+"[old_ugo_thumb"+i+"]",id:this._prefix+"_old_"+this._formId+"_thumb"+i});div.insert(hiddenDelete);div.insert(hiddenOld);li.insert(div);this.getTarget().insert({before:li});input2.observe("blur",this.__onBlur.bindAsEventListener(this));this._lastIndex++;}if(this._lastIndex==this._limit){this.getTarget().down(".threadedCommentControls").hide();}if(display==""){if($(this._prefix+"_"+this._formId+"_title"+i)){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._formId+"_title"+i);}if($(this._prefix+"_"+this._formId+"_desc"+i)&&$(this._prefix+"_"+this._formId+"_desc"+i).type=="text"){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._formId+"_desc"+i);}if($(this._prefix+"_"+this._formId+"_url"+i)){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._formId+"_url"+i);}}},setTarget:function(target){this._target=target;},getTarget:function(){return $(this._target);},toggleAddButton:function(){if(this._lastIndex<this._limit){this.getTarget().down(".threadedCommentControls").show();}else{this.getTarget().down(".threadedCommentControls").hide();}},__onBlur:function(event){var el=event.element();var url=el.value;if(!url.startsWith("http://")&&url!=""){el.value="http://"+url;}}});current.stub("current.components.groups");current.components.groups.JSONRibbonElements=Class.create({initialize:function(prefix,target,slug,nLimit,pLimit){this._prefix=prefix;this.setTarget(target);this._slug=slug;this._lastNavIndex=0;this._lastSubNavIndex=new Array(0,0,0,0,0,0,0,0,0,0);this._navLimit=nLimit;this._subNavLimit=pLimit;this._groupSuggest=new Array();this._suppressData=false;this._suppressDataValue="";this._suppressLabel=false;this._suppressLabelValue="";this._suppressSort=false;this._suppressSortValue="";this._suppressType=false;this._suppressTypeValue="";this._suppressTypeLimit=2;this._useNavLabel=true;this._navString="customNav_";this._subNavString="customSubNav";this._customLayout="";this._navLabel=current.locale.Bundle.get("custom_layouts.group_subpage");this._navTitle=current.locale.Bundle.get("custom_layouts.group_subpage_link");this._replaceNavLink=current.locale.Bundle.get("custom_layouts.delete_subpage_link");this._subNavLabel=current.locale.Bundle.get("custom_layouts.link_info");this._miniLabelLabel=current.locale.Bundle.get("custom_layouts.label");this._miniLabelType=current.locale.Bundle.get("custom_layouts.type");this._miniLabelData=current.locale.Bundle.get("custom_layouts.group_slug");this._miniLabelSort=current.locale.Bundle.get("custom_layouts.sort");this._addSubElementLink=current.locale.Bundle.get("custom_layouts.add_another_nav_element");},addOtherNavElement:function(display,bool){var j=this._lastNavIndex;var imp=display;var backfill=false;var navCount=1;for(var n=0;n<this._navLimit;n++){if(!$(this._navString+n)){if(!backfill&&n<j){j=n;backfill=true;}}else{navCount++;}}if(j<this._navLimit){if(this._useNavLabel){display=display+"; margin-bottom: 1.5em";display=(j>0?display+"; margin-top: 2.5em":display);}else{display=display+"; margin-bottom: 0.5em; padding-top: 1.0em";display=(j==0?display+"; border-top-width: 0":display);}var li=new Element("li",{id:this._navString+j,"class":"customElement "+this._customLayout,style:"display: "+display+";"});var label=new Element("label").insert(this._navLabel);var div=new Element("div",{"class":"elementContainer"});var label1=new Element("label",{"for":this._prefix+"_"+this._navString+"headerText"+j,"class":"leftLabel"}).insert(this._navTitle+":");var ul=new Element("ul",{"class":"JSONDataElements"});var li1=new Element("li").insert(new Element("input",{type:"text","class":"lrg validate-max255 characterCount hasHinting",style:"clear: none;",name:this._prefix+"[ribbon_headerText"+j+"]",id:this._prefix+"_"+this._navString+"headerText"+j,title:current.locale.Bundle.get("custom_layouts.add_a_title")}));ul.insert(li1);var delNav=new Element("a",{href:"#",id:"del_"+this._navString+"_"+j,rel:j,"class":"replaceLink"}).insert(this._replaceNavLink);div.insert(label1);div.insert(ul);div.insert(delNav);if(this._useNavLabel){li.insert(label);}li.insert(div);this.getTarget().insert({before:li});delNav.observe("click",this.__deleteNavElement.bindAsEventListener(this));if(bool){this.addSubNavElement(j,"");}if(!backfill){this._lastNavIndex++;}if(imp==""){if($(this._prefix+"_"+this._navString+"headerText"+j)){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._navString+"headerText"+j);}}}if(j>=this._navLimit-1||navCount==this._navLimit){$(this._target).down(".threadedCommentControls").hide();}return false;},addSubNavElement:function(j,display){if(j==null){return ;}var i=this._lastSubNavIndex[j];if(i==0){var liL=new Element("li",{id:this._subNavString+"Labels_"+j,"class":"customElement "+this._customLayout+" ultraThin",style:"display: "+display+";"});var divL=new Element("div",{"class":"elementContainer"});var label0L=new Element("label",{"class":"leftLabel empty"}).insert("&nbsp;");var ulL=new Element("ul",{"class":"JSONDataElements"});if(!this._suppressLabel){var li1L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelLabel));ulL.insert(li1L);}if(!this._suppressData){var li2L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelData));ulL.insert(li2L);}if(!this._suppressSort){var li3L=new Element("li",{"class":"select"}).insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelSort));ulL.insert(li3L);}if(!this._suppressType){var li4L=new Element("li",{"class":"select"}).insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelType));ulL.insert(li4L);}divL.insert(label0L);divL.insert(ulL);liL.insert(divL);$(this._navString+j).insert({after:liL});}var backfill=false;var subNavCount=1;for(var s=0;s<this._subNavLimit;s++){if(!$(this._subNavString+"_"+j+"_"+s)){if(!backfill&&s<i){i=s;backfill=true;}}else{subNavCount++;}}if(i<this._subNavLimit){var li=new Element("li",{id:this._subNavString+"_"+j+"_"+i,"class":"customElement "+this._customLayout+" thin",style:"display: "+display+";"});var div=new Element("div",{"class":"elementContainer"});var label0=new Element("label",{"class":"leftLabel"}).insert(this._subNavLabel+":");var ul=new Element("ul",{"class":"JSONDataElements"});if(!this._suppressData){var li1=new Element("li").insert(new Element("input",{type:"text","class":"lrg validate-max255 characterCount hasHinting",name:this._prefix+"[ribbon_feedLabel"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Label"+j+"_"+i,title:current.locale.Bundle.get("custom_layouts.add_a_title")}));ul.insert(li1);}else{var label=new Element("input",{type:"hidden",name:this._prefix+"[ribbon_feedLabel"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Label"+j+"_"+i,value:this._suppressLabelValue});div.insert(label);}if(!this._suppressData){var li2=new Element("li",{id:this._subNavString+"ListItem_"+j+"_"+i}).insert(new Element("input",{type:"text","class":"lrg validate-max255 characterCount",name:this._prefix+"[ribbon_feedData"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Data"+j+"_"+i}));ul.insert(li2);}else{var data=new Element("input",{type:"hidden",name:this._prefix+"[ribbon_feedData"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Data"+j+"_"+i,value:this._suppressDataValue});div.insert(data);}if(!this._suppressSort){var li3=new Element("li",{"class":"select"});var select3=new Element("select",{"class":"",name:this._prefix+"[ribbon_feedSort"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Sort"+j+"_"+i,rel:i});var option31=new Element("option",{"class":"",value:"new"}).insert(current.locale.Bundle.get("custom_layouts.new"));var option32=new Element("option",{"class":"",value:"popular"}).insert(current.locale.Bundle.get("custom_layouts.popular"));select3.insert(option31);select3.insert(option32);li3.insert(select3);ul.insert(li3);}else{var sort=new Element("input",{type:"hidden",name:this._prefix+"[ribbon_feedSort"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Sort"+j+"_"+i,value:this._suppressSortValue});div.insert(sort);}if(!this._suppressType){var li4=new Element("li",{"class":"select"});var select4=new Element("select",{"class":"",name:this._prefix+"[ribbon_feedType"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Type"+j+"_"+i,rel:i});if(this._suppressTypeLimit>0){var option41=new Element("option",{"class":"",value:"group"}).insert(current.locale.Bundle.get("custom_layouts.group_slug"));select4.insert(option41);}if(this._suppressTypeLimit>1){var option42=new Element("option",{"class":"",value:"tag"}).insert(current.locale.Bundle.get("custom_layouts.tag_id"));select4.insert(option42);}li4.insert(select4);ul.insert(li4);}else{var type=new Element("input",{type:"hidden",name:this._prefix+"[ribbon_feedType"+j+"_"+i+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Type"+j+"_"+i,value:this._suppressTypeValue});div.insert(type);}var delSubNav=new Element("a",{href:"#",id:"del_"+this._subNavString+"_"+j+"_"+i,rel:j+"_"+i,"class":"Sprites redDeleteButton"});div.insert(label0);div.insert(ul);if(i>0&&this._subNavLimit>1){div.insert(delSubNav);}if(i==0&&this._subNavLimit>1){var liA=new Element("li",{id:"add_"+this._subNavString+"_"+j+"_"+i,"class":"customElement "+this._customLayout+" thin",style:"display: "+display+";"});var divA=new Element("div",{"class":"elementContainer"});var label0A=new Element("label",{"class":"leftLabel empty"}).insert("&nbsp;");var newA=new Element("a",{href:"#",id:"add_"+this._subNavString+"_"+j,rel:j,"class":"Sprites threadedCommentControls threadedCommentExpand addPlaylistLink"}).insert(this._addSubElementLink);divA.insert(label0A);divA.insert(newA);liA.insert(divA);}li.insert(div);if(i>0){$(this._subNavString+"_"+j+"_"+(i-1)).insert({after:li});}else{liL.insert({after:li});li.insert({after:liA});if(this._subNavLimit>1){newA.observe("click",this.__addSubNavElement.bindAsEventListener(this));}}if(this._subNavLimit>1){delSubNav.observe("click",this.__deleteSubNavElement.bindAsEventListener(this));}if(!this._suppressType){$(this._prefix+"_"+this._navString+this._subNavString+"Type"+j+"_"+i).observe("change",this.__selectSubNavType.bindAsEventListener(this,j+"_"+i));}this._groupSuggest.push(new current.GroupsBrowser(this._prefix+"_"+this._navString+this._subNavString+"Data"+j+"_"+i,"groupsInputHolder",{minChars:2,disablePreselect:true,choices:12},"slug"));if(!backfill){this._lastSubNavIndex[j]=this._lastSubNavIndex[j]+1;}}if(i>=this._subNavLimit-1||subNavCount==this._subNavLimit){if($("add_"+this._subNavString+"_"+j+"_0")){$("add_"+this._subNavString+"_"+j+"_0").down(".threadedCommentControls").hide();}}if(display==""){if($(this._prefix+"_"+this._navString+this._subNavString+"Label"+j+"_"+i)&&$(this._prefix+"_"+this._navString+this._subNavString+"Label"+j+"_"+i).type=="text"){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._navString+this._subNavString+"Label"+j+"_"+i);}}},__addSubNavElement:function(event){event.stop();var el=event.element();var rel=el.rel;this.addSubNavElement(rel,"");},setTarget:function(target){this._target=target;},getTarget:function(){return $(this._target);},setNavElementIndex:function(index){this._lastNavIndex=index;},getNavElementIndex:function(){return this._lastNavIndex;},setTagValue:function(val,target){$(this._prefix+"_"+this._navString+this._subNavString+"Data"+target).value=val;},toggleAddButton:function(){if(this._lastNavIndex<this._navLimit){this.getTarget().down(".threadedCommentControls").show();}else{this.getTarget().down(".threadedCommentControls").hide();}},selectSubNavSort:function(id){this.__selectSubNavSort(null,id);},__selectSubNavSort:function(event,id){var el=(event!=null)?event.element():$(this._prefix+"_"+this._navString+this._subNavString+"Sort"+id);},selectSubNavType:function(id){this.__selectSubNavType(null,id);},__selectSubNavType:function(event,id){var el=(event!=null)?event.element():$(this._prefix+"_"+this._navString+this._subNavString+"Type"+id);var li=$(this._prefix+"_"+this._navString+this._subNavString+"Data"+id).up("li");switch(el.selectedIndex){case 0:li.innerHTML="";var input3=new Element("input",{type:"text","class":"lrg required",name:this._prefix+"[ribbon_feedData"+id+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Data"+id});li.insert(input3);this._groupSuggest.splice(id,1,new current.GroupsBrowser(this._prefix+"_"+this._navString+this._subNavString+"Data"+id,"groupsInputHolder",{minChars:2,disablePreselect:true,choices:12},"slug"));break;case 1:li.innerHTML="";var input3=new Element("input",{type:"text","class":"lrg required validate-number",name:this._prefix+"[ribbon_feedData"+id+"]",id:this._prefix+"_"+this._navString+this._subNavString+"Data"+id});li.insert(input3);this._groupSuggest.splice(id,1,new current.TagsIdBrowser(this._prefix+"_"+this._navString+this._subNavString+"Data"+id,"tagsInputHolder",{minChars:2,disablePreselect:true,choices:12},id));break;default:break;}},__deleteNavElement:function(event){event.stop();var el=event.element();if(confirm("This will remove this Element and any Sub-Elements it contains. Are you really, positively sure?")){if($("add_"+this._subNavString+"_"+el.rel+"_0")){$("add_"+this._subNavString+"_"+el.rel+"_0").remove();}for(var i=0;i<10;i++){if($(this._subNavString+"_"+el.rel+"_"+i)){$(this._subNavString+"_"+el.rel+"_"+i).remove();}}if($(this._subNavString+"Labels_"+el.rel)){$(this._subNavString+"Labels_"+el.rel).remove();}if($(this._navString+el.rel)){$(this._navString+el.rel).remove();}this._lastSubNavIndex[el.rel]=0;if($(this._target)){$(this._target).down(".threadedCommentControls").show();}}},__deleteSubNavElement:function(event){event.stop();var el=event.element();var navStr=el.rel.substring(0,el.rel.indexOf("_"));if($(this._subNavString+"_"+el.rel)){$(this._subNavString+"_"+el.rel).remove();}if($("add_"+this._subNavString+"_"+navStr+"_0")){$("add_"+this._subNavString+"_"+navStr+"_0").down(".threadedCommentControls").show();}},setSuppressData:function(val){this._suppressData=val;},setSuppressDataValue:function(val){this._suppressDataValue=val;},setSuppressLabel:function(val){this._suppressLabel=val;},setSuppressLabelValue:function(val){this._suppressLabelValue=val;},setSuppressSort:function(val){this._suppressSort=val;},setSuppressSortValue:function(val){this._suppressSortValue=val;},setSuppressType:function(val){this._suppressType=val;},setSuppressTypeValue:function(val){this._suppressTypeValue=val;},setSuppressTypeChoices:function(val){this._suppressTypeLimit=val;},setUseNavLabel:function(val){this._useNavLabel=val;},setNavString:function(val){this._navString=val;},setSubNavString:function(val){this._subNavString=val;},setCustomLayout:function(val){this._customLayout=val;},setNavLabel:function(val){this._navLabel=val;},setNavTitle:function(val){this._navTitle=val;},setReplaceNavLink:function(val){this._replaceNavLink=val;},setSubNavLabel:function(val){this._subNavLabel=val;},setMiniLabelLabel:function(val){this._miniLabelLabel=val;},setMiniLabelType:function(val){this._miniLabelType=val;},setMiniLabelData:function(val){this._miniLabelData=val;},setMiniLabelSort:function(val){this._miniLabelSort=val;},setAddSubElementLink:function(val){this._addSubElementLink=val;}});current.stub("current.components.groups");current.components.groups.JSONNavElements=Class.create({initialize:function(prefix,target,slug,nLimit){this._prefix=prefix;this.setTarget(target);this._slug=slug;this._lastNavIndex=0;this._navLimit=nLimit;this._groupSuggest=new Array();this._suppressData=false;this._suppressDataValue="";this._navString="customNav_";this._customLayout="";this._navLabel=current.locale.Bundle.get("custom_layouts.group_subpage");this._navTitle=current.locale.Bundle.get("custom_layouts.group_subpage_link");this._replaceNavLink=current.locale.Bundle.get("custom_layouts.delete_subpage_link");this._subNavLabel=current.locale.Bundle.get("custom_layouts.link_info");this._miniLabelLabel=current.locale.Bundle.get("custom_layouts.label");this._miniLabelData=current.locale.Bundle.get("custom_layouts.group_slug");this._addSubElementLink=current.locale.Bundle.get("custom_layouts.add_another_nav_element");},addOtherNavElement:function(display,bool){var j=this._lastNavIndex;var imp=display;var backfill=false;var navCount=1;for(var n=0;n<this._navLimit;n++){if(!$(this._navString+n)){if(!backfill&&n<j){j=n;backfill=true;}}else{navCount++;}}if(j<this._navLimit){display=(j==0?display+"; border-top-width: 0":display);if(j==0){var liL=new Element("li",{id:this._navString+"Labels_"+j,"class":"customElement ultraThin",style:"display: "+display+";"});var divL=new Element("div",{"class":"elementContainer"});var label0L=new Element("label",{"class":"leftLabel empty"}).insert("&nbsp;");var ulL=new Element("ul",{"class":"JSONDataElements"});var li1L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelLabel));ulL.insert(li1L);var li2L=new Element("li").insert(new Element("label",{"class":"miniLabel"}).insert(this._miniLabelData));ulL.insert(li2L);divL.insert(label0L);divL.insert(ulL);liL.insert(divL);this.getTarget().insert({before:liL});}display=(j==0?display+"; margin-bottom: 0.5em; padding-top: 0.2em":display+"; margin-bottom: 0.5em; padding-top: 1.0em");var li=new Element("li",{id:this._navString+j,"class":"customElement "+this._customLayout,style:"display: "+display+";"});var label=new Element("label").insert(this._navLabel);var div=new Element("div",{"class":"elementContainer"});var label1=new Element("label",{"for":this._prefix+"_"+this._navString+"text"+j,"class":"leftLabel"}).insert(this._navTitle+":");var ul=new Element("ul",{"class":"JSONDataElements"});var li1=new Element("li").insert(new Element("input",{type:"text","class":"lrg validate-max255 characterCount hasHinting",style:"clear: none;",name:this._prefix+"[text"+j+"]",id:this._prefix+"_"+this._navString+"text"+j,title:current.locale.Bundle.get("custom_layouts.add_a_title")}));ul.insert(li1);if(!this._suppressData){var li2=new Element("li",{id:this._navString+"ListItem_"+j}).insert(new Element("input",{type:"text","class":"lrg validate-max255 characterCount",name:this._prefix+"[link"+j+"]",id:this._prefix+"_"+this._navString+"link"+j}));ul.insert(li2);}else{var data=new Element("input",{type:"hidden",name:this._prefix+"[link"+j+"]",id:this._prefix+"_"+this._navString+"link"+j,value:this._suppressDataValue});div.insert(data);}var delNav=new Element("a",{href:"#",id:"del_"+this._navString+"_"+j,rel:j,"class":"replaceLink"}).insert(this._replaceNavLink);div.insert(label1);div.insert(ul);div.insert(delNav);if(this._useNavLabel){li.insert(label);}li.insert(div);this.getTarget().insert({before:li});delNav.observe("click",this.__deleteNavElement.bindAsEventListener(this));if(!backfill){this._lastNavIndex++;}if(imp==""){if($(this._prefix+"_"+this._navString+"text"+j)){CharacterCounter.getInstance().addCounter(this._prefix+"_"+this._navString+"text"+j);}}if(!this._suppressData){this._groupSuggest.push(new current.GroupsBrowser(this._prefix+"_"+this._navString+"link"+j,"groupsInputHolder",{minChars:2,disablePreselect:true,choices:12},"slug"));}}if(j>=this._navLimit-1||navCount==this._navLimit){$(this._target).down(".threadedCommentControls").hide();}},setTarget:function(target){this._target=target;},getTarget:function(){return $(this._target);},setNavElementIndex:function(index){this._lastNavIndex=index;},getNavElementIndex:function(){return this._lastNavIndex;},setTagValue:function(val,target){$(this._prefix+"_"+this._navString+"link"+target).value=val;},toggleAddButton:function(){if(this._lastNavIndex<this._navLimit){this.getTarget().down(".threadedCommentControls").show();}else{this.getTarget().down(".threadedCommentControls").hide();}},__deleteNavElement:function(event){event.stop();var el=event.element();if(confirm("This will remove this link. Are you really, positively sure?")){if($("add_"+this._navString+"_"+el.rel+"_0")){$("add_"+this._navString+"_"+el.rel+"_0").remove();}if($(this._navString+"Labels_"+el.rel)){$(this._navString+"Labels_"+el.rel).remove();}if($(this._navString+el.rel)){$(this._navString+el.rel).remove();}if($(this._target)){$(this._target).down(".threadedCommentControls").show();}}},setSuppressData:function(val){this._suppressData=val;},setSuppressDataValue:function(val){this._suppressDataValue=val;},setUseNavLabel:function(val){this._useNavLabel=val;},setNavString:function(val){this._navString=val;},setCustomLayout:function(val){this._customLayout=val;},setNavLabel:function(val){this._navLabel=val;},setNavTitle:function(val){this._navTitle=val;},setReplaceNavLink:function(val){this._replaceNavLink=val;},setMiniLabelLabel:function(val){this._miniLabelLabel=val;},setMiniLabelData:function(val){this._miniLabelData=val;},setAddSubElementLink:function(val){this._addSubElementLink=val;}});current.stub("current.components.groups");current.components.groups.FeatureInGroupWindow=Class.create({initialize:function(event,groupName,posLeft,posTop){var p=current.site.Page.getInstance();var u=current.User.getInstance();this._pageId=p.getId();this._open=false;this._modalWidth="240";this._modalHeight="240";this._modalId="featureInGroupWindow";this._message=current.locale.Bundle.get("group.As_a_group_leader_or_moderator_you_can");this._el=event.element();this._groupSlug=this._el.rel;if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=event.element().cumulativeOffset()["left"];this._modalPosTop=event.element().cumulativeOffset()["top"];}if(this._modalPosLeft<10){this._modalPosLeft=10;}this._title=current.locale.Bundle.get("edit");this._isFeatured=this._el.hasClassName("groupFeaturedEdit");this._include="group_feature_inline";if(this._isFeatured){this._include="group_featured_inline";}},init:function(){var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="groupFeatureModalBody" style="width: '+this._contentWidth+'px;">'+this._message+'<div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"accountModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._open=false;},__onModalLoaded:function(){new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+"/"+this._include+"/"+this._groupSlug+"/",{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){for(key in EventSelectorRules){key="#featureInGroupList "+key;}EventSelectors.start(EventSelectorRules);if(!this._isFeatured){$("groupFeatureButton").observe("click",this.__onFeatureClick.bindAsEventListener(this));}if(this._isFeatured){$("groupFeaturedButton").observe("click",this.__onUnfeatureClick.bindAsEventListener(this));}$("groupRemoveButton").observe("click",this.__onRemoveClick.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();},__onFeatureClick:function(event){event.stop();var target=event.element();GroupService.addFeaturedItem(target.rel,this._pageId,"0",this.__onFeatureComplete.bindAsEventListener(this,target),this.__onFeatureFail.bindAsEventListener(this,target.rel));current.uncache();Control.Modal.close();},__onUnfeatureClick:function(event){event.stop();var target=event.element();GroupService.removeFeaturedItem(target.rel,this._pageId,this.__onUnfeatureComplete.bindAsEventListener(this,target),this.__onUnfeatureFail.bindAsEventListener(this,target.rel));current.uncache();Control.Modal.close();},__onRemoveClick:function(event){if(!u.isEmailVerified()){event.stop();new current.components.account.VerifyWindow(event).init();return ;}event.stop();if(confirm(current.locale.Bundle.get("item.admin.removeFromGroupConfirm"))){var target=event.element();current.proxy.CCCP.execute("item","group_post",{id:this._pageId,groupSlugs:target.rel,action:"delete"},this.__onRemoveComplete.bindAsEventListener(this,target),this.__onRemoveFail.bindAsEventListener(this,target.rel));current.uncache();}Control.Modal.close();},__onFeatureComplete:function(data,target){$("edit_"+target.rel).removeClassName("groupFeatureEdit");$("edit_"+target.rel).addClassName("groupFeaturedEdit");},__onFeatureFail:function(data,value){$("frame").scrollTo();var str="Whoops, <strong>"+data+" Error!</strong> Could not feature: <strong>"+value+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},__onUnfeatureComplete:function(data,target){$("edit_"+target.rel).removeClassName("groupFeaturedEdit");$("edit_"+target.rel).addClassName("groupFeatureEdit");},__onUnfeatureFail:function(data,value){$("frame").scrollTo();var str="Whoops, <strong>"+data+" Error!</strong> Could not unfeature: <strong>"+value+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},__onRemoveComplete:function(data,target){$("edit_"+target.rel).up().hide();},__onRemoveFail:function(data,value){$("frame").scrollTo();var str="Whoops, <strong>"+data+" Error!</strong> Could not remove: <strong>"+value+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});}});current.stub("current.components.groups");current.components.groups.Leaderboard=Class.create({initialize:function(){},init:function(){if(this._helpBtn){this._helpBtn.observe("click",this.__onHelpClick.bindAsEventListener(this));}if(this._moreLink){this._moreLink.observe("click",this.__onMoreClick.bindAsEventListener(this));}},setHelpLink:function(helpId){this._helpBtn=$(helpId);},setMoreLink:function(moreLinkId){this._moreLink=$(moreLinkId);},setLeaderCount:function(num){this._leaderCount=num;},__onHelpClick:function(event){event.stop();var leaderboardWindow=new current.components.groups.LeaderboardHelpWindow(event,(event.element().cumulativeOffset()["left"]-125),(event.element().cumulativeOffset()["top"]+12));leaderboardWindow.init();},__onMoreClick:function(event){event.stop();var el=event.element();while(typeof el.rel=="undefined"){el=el.up("a");}var relJSON=el.rel.evalJSON();var relId=relJSON.sort;var relPts=relJSON.points;this._target=el.up(".leaderboardBox").down(".leaderboard");current.proxy.CCCP.execute("users","leaderboard",{id:relId,start:this._leaderCount,len:25},this.__onMoreSuccess.bindAsEventListener(this,relId,relPts),this.__onMoreFailure.bindAsEventListener(this));current.uncache();},__onMoreSuccess:function(data,id,pts){if(data==null){return ;}var items=data.items;var scope=this;for(i=0;i<items.length;i++){var className=(scope._leaderCount%2==0)?"odd":"even";var row=new Element("li",{"class":className});var user=new Element("div",{"class":"user"});var userHref=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/users/"+items[i].username+".htm";var thumbLink=new Element("a",{title:items[i].username,href:userHref});thumbLink.insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+items[i].thumbnail+"_60x60.jpg",alt:items[i].username,width:60,height:60}));var userLink=new Element("a",{title:items[i].username,href:userHref}).insert(items[i].username);var points=new Element("div",{"class":"points"}).insert(eval("items[i]."+pts));user.insert(thumbLink);user.insert(userLink);row.insert(user);row.insert(points);this._target.insert(row);scope._leaderCount++;}if(items.length<25){this._moreLink.up("div").hide();}},__onMoreFailure:function(){}});current.components.groups.Leaderboard.getInstance=function(){if(!document.__currentLeaderboard__){document.__currentLeaderboard__=new current.components.groups.Leaderboard();}return document.__currentLeaderboard__;};current.stub("current.components.groups");current.components.groups.LeaderboardHelpWindow=Class.create({initialize:function(event,posLeft,posTop){this._open=false;this._modalWidth="428";this._modalHeight="100";this._contentWidth="420";this._modalId="leaderboardWindow";this._message="Each time a storyline or scene you contribute is rewarded as one of the Top 20 Recommended, Producer Pick, or Credited on Air within a challenge, you earn one point towards ranking on the leaderboard.";this._title="how to earn points";if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=event.element().cumulativeOffset()["left"];this._modalPosTop=event.element().cumulativeOffset()["top"];}if(this._modalPosLeft<10){this._modalPosLeft=10;}},init:function(){var wrapper='<div class="accountModalTitle" style="width: '+this._contentWidth+'px;"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="accountModalBody" style="width: '+this._contentWidth+'px; font-size: 1.2em;">'+this._message+'<div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft-10,offsetTop:this._modalPosTop-10,containerClassName:"accountModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){document.__modalOpenL1__=false;this._draggable.destroy();this._open=false;},__onModalLoaded:function(){document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onCloseClick:function(){Control.Modal.close();}});current.stub("current.components.menus");current.components.menus.TabMenu=Class.create({initialize:function(target,active){this._target=$(target);this._clickListener=this.__onTabClick.bindAsEventListener(this);this._target.observe("click",this._clickListener);this._active=(active!=null)?$(active):$(this._target.select('a[rel="tab"]').reject(function(t){return !t.visible();}).first().target);this._locked=false;},__onTabClick:function(event){event.stop();if(this._locked||event.element().rel!="tab"){return ;}var tab=$(event.element().readAttribute("target"));if(tab==null||tab.visible()){return ;}this._active.hide();this._active=tab;tab.show();this._target.fire(current.components.menus.TabMenu.SWITCH,{active:this._active});},toggleLock:function(){this._locked=this.setLock(!this._locked);},setLock:function(bool){this._locked=bool;},getActive:function(){return this._active;}});current.components.menus.TabMenu.SWITCH="current:onTabMenuSwitch";current.stub("current.components.menus");current.components.menus.SimpleTabs=Class.create({initialize:function(){this.tabs=[];this.panes=[];},setActiveTab:function(tab){this.tabs.each(function(t){if($(t).hasClassName("active")){$(t).removeClassName("active");}if($(t).rel==tab){$(t).addClassName("active");}});this.panes.each(function(p){if($(p).hasClassName(tab)){$(p).show();}else{$(p).hide();}});},handleTabClick:function(event){event.stop();var el=event.element();if(!el.rel){el=el.up();}this.setActiveTab(el.rel);},setTabs:function(tabs){this.tabs=tabs;var scope=this;this.tabs.each(function(t){$(t).observe("click",scope.handleTabClick.bindAsEventListener(scope));});},setPanes:function(panes){this.panes=panes;}});Object.Event.extend(current.components.menus.SimpleTabs);current.components.menus.SimpleTabs.getInstance=function(){if(!document.__simpleTabs__){document.__simpleTabs__=new current.components.menus.SimpleTabs();}return document.__simpleTabs__;};current.stub("current.components.menus");current.components.menus.ToolTip=Class.create({initialize:function(w,h){this._message="";this._modalWidth=w;this._modalHeight=h;this._domContent=false;},setDomContent:function(el){this._domContent=el;},getDomContent:function(){return this._domContent;},setText:function(text){this._message=text;},getText:function(){return this._message;},setWidth:function(w){this._modalWidth=w;},getWidth:function(){return this._modalWidth;},setHeight:function(h){this._modalHeight=h;},getHeight:function(){return this._modalHeight;},getContents:function(){var wrapper='<div class="Sprites toolTipArrow"></div><div class="toolTipText" id="toolTipText" style="min-height: 24px;">'+this.getText()+"</div>";if(Prototype.Browser.IE){wrapper='<div class="toolTipBox"><div class="toolTipVertical"></div><div class="toolTipHorizontal"></div><div class="Sprites toolTipTopLeft"></div><div class="Sprites toolTipTopRight"></div><div class="Sprites toolTipBottomRight"></div><div class="Sprites toolTipBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartToolTipContainer"><div class="Sprites toolTipArrow"></div>'+wrapper+"</div>";}return wrapper;},show:function(event,posLeft,posTop){event.stop();if(document.__modalOpenL1__){return false;}if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._eventElement=current.utils.Compatibility.getEventElement(event);this._modalPosLeft=this._eventElement.cumulativeOffset()["left"];this._modalPosTop=this._eventElement.cumulativeOffset()["top"];}if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+3;this.setWidth(this.getWidth()-3);}Control.Modal.open(false,{contents:this.getContents(),position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"toolTipContainer",overlayDisplay:false,width:this.getWidth(),height:this.getHeight(),afterOpen:this.__onModalLoaded.bindAsEventListener(this),closeButton:false});},__onModalLoaded:function(){if(this.getDomContent()){$("toolTipText").update(this.getDomContent());$("toolTipText").insert(new Element("br",{"class":"clearBoth"}));}},hide:function(){if(document.__modalOpenL1__){return false;}Control.Modal.close();}});current.stub("current.components.pagination");current.components.pagination.PagingButtons=Class.create({BUTTON_DISABLED_CLASS:"disabled",initialize:function(target){this._target=$(target);if(!this._target){return ;}this._back=this._target.down(".previousPages");this._next=this._target.down(".nextPages");this._rangeDisplay=this._target.down(".pagingRangeDisplay");if(this._rangeDisplay){this._rangeDisplay.hide();}this._currentPage=0;},init:function(){if(this._next){this._next.onclick=this.__onNextClick.bindAsEventListener(this);}if(this._back){this._back.onclick=this.__onBackClick.bindAsEventListener(this);}},setRange:function(startIndex,endIndex,total){this._startIndex=startIndex;this._endIndex=endIndex;this._total=total;if(this._rangeDisplay){this._updateRange();}},setButtonsAvailable:function(currentPage,totalPages){if(this._next){this._setButtonDisable(this._next,(currentPage>=totalPages));}if(this._back){this._setButtonDisable(this._back,(currentPage==1));}},_setButtonDisable:function(button,disable){if(disable){button.addClassName(this.BUTTON_DISABLED_CLASS);}else{button.removeClassName(this.BUTTON_DISABLED_CLASS);}},hide:function(){this._target.hide();},show:function(){this._target.show();},toggle:function(){this._target.toggle();},visible:function(bool){if(bool){this.show();}else{this.hide();}},_updateRange:function(){this._rangeDisplay.show();var t=new Template("<span>"+current.locale.Bundle.get("showingXofX")+"</span>");var o={startIndex:this._startIndex,endIndex:this._endIndex,total:this._total};this._rangeDisplay.update(t.evaluate(o));},__onNextClick:function(event){Event.stop(event);if(this._next.hasClassName(this.BUTTON_DISABLED_CLASS)){return ;}this.notify(current.components.pagination.PaginationEvent.NEXT_CLICK);},__onBackClick:function(event){Event.stop(event);if(this._back.hasClassName(this.BUTTON_DISABLED_CLASS)){return ;}this.notify(current.components.pagination.PaginationEvent.BACK_CLICK);}});Object.Event.extend(current.components.pagination.PagingButtons);current.components.pagination.PaginationEvent={NEXT_CLICK:"onPageNextClick",BACK_CLICK:"onPageBackClick",PAGING_COMPLETE:"onPagingComplete"};current.stub("current.components.pitcher");current.components.pitcher.Pitcher=Class.create({initialize:function(){this._form="";this._textField="";this._imageField="";this._descHint="";this._contentSource="";this._isEdit=false;this._gis="";this._gisInput="";this._gisSubmit="";this._gisResult="";this._gisResultListener=this.__onGisUpdates.bindAsEventListener(this);this._oldImageUrl="";},init:function(){this.getTextField().observe("keyup",this.__onTextKeyUp.bindAsEventListener(this));this.getImageField().observe("gis:imageUrlUpdated",this.__onImageChange.bindAsEventListener(this));this.getForm().observe("submit",this.__onSubmit.bindAsEventListener(this));if((this.getContentSource()=="text")){this.getTextField().addClassName("required");}if((this.getContentSource()=="internet")){$("formButtons").hide();}},setEdit:function(edit){this._isEdit=edit;},setForm:function(form){this._form=form;},getForm:function(){return $(this._form);},setContentSource:function(source){this._contentSource=source;},getContentSource:function(){return this._contentSource;},setTextField:function(field){this._textField=field;this._descHint=$(this._textField).title;},getTextField:function(){return $(this._textField);},setImageField:function(field){this._imageField=field;},getImageField:function(){return $(this._imageField);},setOldImageUrl:function(oldImgUrl){this._oldImageUrl=oldImgUrl;},setGisFields:function(queryInput,submitButton,resultDiv){this._gisInput=queryInput;this._gisSubmit=submitButton;this._gisResult=resultDiv;},initGis:function(){this._gis=current.components.pitcher.GoogleImageSearch.getInstance();this._gis.setResultDiv(this._gisResult);this._gis.setEdit(this._isEdit);$(this._gisSubmit).observe("click",this.__onImageSearchClick.bindAsEventListener(this));$(this._gisSubmit).observe("gis:submit",this.__onImageSearchClick.bindAsEventListener(this));if(this._oldImageUrl!=""){this._gis.createOldImageDisplay(this._oldImageUrl);}},__onImageSearchClick:function(event){event.stop();$(this._gisResult).stopObserving("gis:updated",this._gisResultListener);if(!isUndefined($(this._gisInput).value)){this._gis.executeSearch($(this._gisInput).value);$(this._gisResult).observe("gis:updated",this._gisResultListener);}else{alert("please enter a search term");}return false;},__onGisUpdates:function(){$(this._gisResult).select(".gisResultImgBox").invoke("observe","click",this.__onGisResultClick.bindAsEventListener(this));},__onGisResultClick:function(event){event.stop();event.element().addClassName("selected");this.getImageField().value=event.element().alt;this._gis.selectImage(event.element());this.getImageField().fire("gis:imageUrlUpdated");},_beforeSubmit:function(event){if((this.getContentSource()=="internet")&&!this._isEdit){if(this.getImageField().value==""){event.stop();alert("please select an image.");return ;}if(this.getTextField().value==this._descHint){this.getTextField().value="";this.getTextField().title="";}}if(this.getContentSource()=="text"){if(!Validation.validate(this.getTextField())){event.stop();this.getTextField().focus();return ;}}},__onTextKeyUp:function(event){current.utils.Compatibility.adjustRows(this.getTextField(),3);if(!$("formButtons").visible()){$("formButtons").show();}},__onImageChange:function(event){this.getTextField().up().show();$("formButtons").show();},__onSubmit:function(event){this._beforeSubmit(event);}});Object.Event.extend(current.components.pitcher.Pitcher);current.components.pitcher.Pitcher.getInstance=function(){if(!document.__Pitcher__){document.__Pitcher__=new current.components.pitcher.Pitcher();}return document.__Pitcher__;};current.stub("current.components.pitcher");current.components.pitcher.PitcherWindow=Class.create({initialize:function(event,posLeft,posTop){var p=current.site.Page.getInstance();var u=current.User.getInstance();this._pageId=p.getId();this._open=false;this._modalWidth="634";this._modalHeight="420";this._contentWidth="600";this._modalId="pitcherWindow";this._el=current.utils.Compatibility.getEventElement(event);this._edit=false;this._slug="";this._groupTitle="";this._itemId=0;this._clipperTitle="";this._contentSource="";this._context=Clipper2Static.CONTEXT_FULL;this._clipperContainer="accountModalForm";this._url="";this._challengeType="";var viewport=document.viewport.getDimensions();this._winWidth=viewport.width;this._winHeight=viewport.height;if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=(this._el.cumulativeOffset()["left"]-92);this._modalPosTop=(this._el.cumulativeOffset()["top"]-80);}if(this._modalPosLeft>(this._winWidth-983)/2+359){this._modalPosLeft=((this._winWidth-983)/2+359);}if(this._modalPosLeft<(this._winWidth-983)/2){this._modalPosLeft=(this._winWidth-983)/2;}},setEditString:function(edit){this._edit=edit;},setGroupSlug:function(slug){this._slug=slug;},setGroupTitle:function(title){this._groupTitle=title;},setItemId:function(id){this._itemId=id;},setClipperTitle:function(title){this._clipperTitle=title;},setContentSource:function(src){this._contentSource=src;},setContext:function(context){this._context=context;},setChallengeType:function(type){this._challengeType=type;},init:function(){this._titleWidth=(this._contentWidth-20);this._bodyWidth=this._contentWidth;if(current.utils.Compatibility.isIE6Browser()){this._titleWidth=parseInt(parseInt(this._contentWidth)+parseInt(5));this._bodyWidth=parseInt(parseInt(this._contentWidth)+parseInt(25));}this._title=(!this._edit)?current.locale.Bundle.get("pitcher.submit_your_pitch"):current.locale.Bundle.get("pitcher.edit_this_pitch");if(this._clipperTitle!=""){this._title=this._clipperTitle;}var wrapper='<div class="clipperModalTitle" style="width: '+this._titleWidth+'px"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="clipperModalBody" style="width: '+this._bodyWidth+'px;"><div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"accountModalContainer clipperModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._open=false;this._draggable.destroy();document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;this._draggable=new Draggable("modal_container",{handle:"clipperModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});document.__modalOpenL1__=true;var ajaxString="/pitcher.htm?modal=true";if((this._slug!="")&&(this._itemId==0)){ajaxString=ajaxString+"&groupSlug="+this._slug;}if(this._itemId!=0){ajaxString=ajaxString+"&cid="+this._itemId;}if(this._url!=""){ajaxString=ajaxString+"&url="+this._url;}if(this._contentSource!=""){ajaxString=ajaxString+"&contentSource="+this._contentSource;}if((this._groupTitle!="")&&(this._itemId==0)){ajaxString=ajaxString+"&groupTitle="+this._groupTitle;}if(this._challengeType!=""){ajaxString=ajaxString+"&challengeType="+this._challengeType;}new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+ajaxString,{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});Control.Modal.container.setStyle({height:"auto"});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){EventSelectors.start(EventSelectorRules);if(this._edit){$$("#pitcherModalBody .validate-isNotHint").each(function(c){$(c).setStyle({color:"#000"});});}},__onCloseClick:function(){this.__resetWindow();Control.Modal.close();}});current.stub("current.components.pitcher");current.components.pitcher.GoogleImageSearch=Class.create({initialize:function(){this._google="";this._gis="";this._resultDivId="";this.imageScaler={width:138,height:138};this._lastPage=0;this._lastQuery="";this._isEdit=false;this._pagerPrevListener=this.__onPagerPrev.bindAsEventListener(this);this._pagerNextListener=this.__onPagerNext.bindAsEventListener(this);this._reSearchListener=this.__onReSearch.bindAsEventListener(this);this._returnKeyListener=this.__onReturnKeyPress.bindAsEventListener(this);},init:function(google){this._google=google;this._gis=new this._google.search.ImageSearch();this._gis.setRestriction(this._google.search.ImageSearch.RESTRICT_IMAGESIZE,this._google.search.ImageSearch.IMAGESIZE_MEDIUM);this._gis.setRestriction(this._google.search.Search.RESTRICT_SAFESEARCH,this._google.search.Search.SAFESEARCH_STRICT);this._gis.setRestriction(this._google.search.ImageSearch.RESTRICT_RIGHTS,this._google.search.ImageSearch.RIGHTS_REUSE);this._gis.setResultSetSize(8);this._gis.setSearchCompleteCallback(this,this.searchComplete,null);},setEdit:function(bool){this._isEdit=bool;},setResultDiv:function(id){this._resultDivId=id;$("gisSubmit").insert({after:this._google.search.Search.getBranding()});this.showSearchForm();},setLastPage:function(page){this._lastPage=page;},setLastQuery:function(query){this._lastQuery=query;},executeSearch:function(query){this.setLastQuery(query);this._gis.execute(query);},searchComplete:function(){if(this._gis.results&&this._gis.results.length>0){$(this._resultDivId).innerHTML="";if($("reSearchLink")){$("reSearchLink").stopObserving("click",this._reSearchListener);}var results=this._gis.results;for(var i=0;i<results.length;i++){var result=results[i];var imgContainer=new Element("div",{"class":"floatLeft gisResultImgBox",id:"gisResultImgBox"+i});if(i==3||i==7){imgContainer.addClassName("rowEnd");}var scaled=this._google.search.Search.scaleImage(result.tbWidth,result.tbHeight,this.imageScaler);var newImg=new Element("img",{src:result.tbUrl,width:scaled.width,height:scaled.height,"class":"gisResultImg",id:"gisResultImg"+i,alt:result.unescapedUrl});imgContainer.appendChild(newImg);$(this._resultDivId).appendChild(imgContainer);$(this._resultDivId).fire("gis:updated");}$("gisPagerPrev").stopObserving("click",this._pagerPrevListener);$("gisPagerNext").stopObserving("click",this._pagerNextListener);this.addPager();}else{$("gisPager").hide();$(this._resultDivId).innerHTML="no results found";}},addPager:function(){this.setLastPage(this._gis.cursor.currentPageIndex);$("gisPagerPrev").observe("click",this._pagerPrevListener);$("gisPagerNext").observe("click",this._pagerNextListener);var resultMsg="Page "+parseInt(this._lastPage+1)+" of "+this._gis.cursor.pages.length;$("gisPagerText").update(resultMsg);$("gisPager").show();this._constrainPager();},__onPagerPrev:function(event){event.stop();if(this._gis.cursor.currentPageIndex==0){return false;}this._constrainPager();this._gis.gotoPage(parseInt(this._lastPage-1));},__onPagerNext:function(event){event.stop();this._constrainPager();this._gis.gotoPage(parseInt(this._lastPage+1));},_constrainPager:function(){var pageNum=parseInt(this._gis.cursor.currentPageIndex+1);if(this._gis.cursor.pages.length==1){$("gisPagerPrev").setOpacity(0.5);$("gisPagerNext").setOpacity(0.5);}else{if(pageNum<=1){$("gisPagerPrev").setOpacity(0.5);}else{if(pageNum>=this._gis.cursor.pages.length){$("gisPagerNext").setOpacity(0.5);}else{$("gisPagerPrev").setOpacity(1);$("gisPagerNext").setOpacity(1);}}}},__onReSearch:function(event){event.stop();this.showSearchForm();if(this._lastQuery==""){$(this._resultDivId).innerHTML="";$("gisQuery").focus();}else{this._gis.gotoPage(this._lastPage);}},__onReturnKeyPress:function(event){if(Event.KEY_RETURN==event.keyCode){event.stop();$("gisSubmit").fire("gis:submit");}return ;},showSearchForm:function(){$("gisSearchForm").show();$(document).observe("keypress",this._returnKeyListener);},hideSearchForm:function(){$("gisSearchForm").hide();$(document).stopObserving("keypress",this._returnKeyListener);},createOldImageDisplay:function(url){var oldImg=new Element("img",{src:url,width:138,height:138,"class":"gisResultImg",id:"gisOldImg"});this.selectImage(oldImg);$("imageRow").show();this.hideSearchForm();},selectImage:function(el){$(this._resultDivId).innerHTML="";var imgContainer=new Element("div",{"class":"floatLeft gisResultImgBox selected",id:"gisSelectedImgBox"});imgContainer.insert($(el));$(this._resultDivId).insert(imgContainer);var msgDiv=new Element("div",{id:"gisSelectedLinks"});var backLink=new Element("a",{href:"#",id:"reSearchLink"}).insert("select a different image");backLink.observe("click",this._reSearchListener);msgDiv.insert(backLink);$(this._resultDivId).insert(msgDiv);$("gisPager").hide();this.hideSearchForm();}});Object.Event.extend(current.components.pitcher.GoogleImageSearch);current.components.pitcher.GoogleImageSearch.getInstance=function(){if(!document.__pitcherGoogleImageSearch__){document.__pitcherGoogleImageSearch__=new current.components.pitcher.GoogleImageSearch();}return document.__pitcherGoogleImageSearch__;};current.stub("current.components.recommend");current.components.recommend.Recommending=Class.create({initialize:function(pageId,contentType,targetLink,recommended){this._pageId=pageId;this._username=current.User.getInstance().getUsername();this._contentType=contentType;this._recommendLink=targetLink;this._recommendLink.observe("click",this.__onRecommendClick.bindAsEventListener(this));this._recommended=recommended;this._redrawRecommendLink();},_hasRecommended:function(){return this._recommended;},_setRecommended:function(recommendState){this._recommended=recommendState;},_redrawRecommendLink:function(){this._recommendLink.update(((this._hasRecommended())?"un":"")+"recommend");},__onRecommendClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var actionJackson=(!this._hasRecommended())?"add":"delete";if(this._contentType=="item"){ContentService.recommendItem(this._pageId,this._username,actionJackson,this.__onRecommendData.bindAsEventListener(this));}else{ContentService.recommendComment(this._pageId,this._username,actionJackson,this.__onRecommendData.bindAsEventListener(this));}},__onRecommendData:function(isRecommended){current.uncache();this._recommended=isRecommended;this._redrawRecommendLink(isRecommended);}});current.stub("current.components.schedule");current.components.schedule.PrimetimeModule=Class.create({initialize:function(){this._activeDayNum=0;this._dayData=[];},init:function(moduleId,zeroDay){this._module=$(moduleId);this._zeroDay=zeroDay;this.setActiveDayName(this._zeroDay);this.setActiveDayId($("dayLink_0").rel);this.setActiveDayLink($("dayLink_0"));this._getScheduleData();this._titleHolder=$("primetimeModuleTitle");this._showsHolder=$("primetimeShowsList");this._getNavLinkHolders($(this._module));this._observeNavLinks($(this._module));this._observeShowTitles($(this._module));this._toolTip=new current.components.menus.ToolTip("300","80");},_getNavLinkHolders:function(target){this._navList=$(target).select(".dayLinkLi");},_observeNavLinks:function(target){this._navLinks=$(target).select(".dayLink");this._navLinks.invoke("observe","click",this.__onNavClick.bindAsEventListener(this));},_observeShowTitles:function(target){this._showLinks=$(target).select(".slot");this._showLinks.invoke("observe","mouseover",this.__onShowHover.bindAsEventListener(this));this._showLinks.invoke("observe","mouseout",this.__onShowExit.bindAsEventListener(this));},__onShowHover:function(event,retriggered){event.stop();var e=event.element();if(!e.hasClassName("slot")){e=e.up(".slot");}if(this._itemInFocus==e.id){return ;}if(this._itemInFocus){$(this._itemInFocus).removeClassName("active");$(this._itemInFocus).setStyle("margin:1.5em 0;padding:0 .8em 0 0");this._toolTip.hide();this._itemInFocus=false;}this._itemInFocus=e.id;e.addClassName("active");e.setStyle("margin:1.1em 0;padding:.4em");var PosLeft=(e.cumulativeOffset()["left"]+e.getWidth()+12);var PosTop=(e.cumulativeOffset()["top"]-20);var summary=this._buildEpisodeSummary(e.rel);if(summary){this._toolTip.setDomContent(summary);this._toolTip.show(event,PosLeft,PosTop);}},__onShowExit:function(e){var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if(!reltg||!this._itemInFocus){return ;}try{if(reltg.id==this._itemInFocus){return ;}}catch(e){return false;}$(this._itemInFocus).setStyle("margin:1.5em 0;padding:0 .8em 0 0");$(this._itemInFocus).removeClassName("active");this._toolTip.hide();this._itemInFocus=false;},__onNavClick:function(event){event.stop();this.setActiveDayId(event.element().rel);this.setActiveDayName(event.element().title);this.setActiveDayLink(event.element());if(!this.getDayData(this.getActiveDayId())){this._getScheduleData();}else{this._buildSchedule();}},setActiveDayId:function(num){this._activeDayNum=num;},getActiveDayId:function(){return this._activeDayNum;},setActiveDayName:function(name){this._activeDayName=name;},getActiveDayName:function(){return this._activeDayName;},setActiveDayLink:function(element){this._activeDayLink=element;},getActiveDayLink:function(){return this._activeDayLink;},setDayData:function(id,data){this._dayData[id]=data;},getDayData:function(id){if(isUndefined(this._dayData[id])){return false;}return this._dayData[id];},_buildEpisodeSummary:function(id){var data=this.getDayData(this.getActiveDayId());if(!data){return false;}var show=data.evalJSON()[id];var ul=new Element("ul",{"class":"epSummary"});var series=new Element("li",{"class":"series"}).insert(show.linkText);if(show.episodeTitle!=""){var title=new Element("li",{"class":"title"}).insert(show.episodeTitle);if(show.isNew){title.insert(new Element("span",{"class":"Sprites newBadge"}));}}else{if(show.isNew){series.insert(new Element("span",{"class":"Sprites newBadge"}));}}var time=new Element("li",{"class":"time"});var dayname=current.locale.Bundle.get("days."+show.airDay);if(Object.isArray(show.airTime)){if(!isUndefined(show.airTime[1])){time.insert(dayname+" "+show.airTime[0]+"/"+show.airTime[1]);}else{time.insert(dayname+" "+show.airTime[0]);}}else{time.insert(dayname+" "+show.airTime);}var desc=new Element("li",{"class":"desc"}).insert(show.desc);ul.insert(series);ul.insert(title);ul.insert(time);ul.insert(desc);return ul;},_buildSchedule:function(){var data=this.getDayData(this.getActiveDayId());var shows=data.evalJSON();this._showsHolder.update("");var scope=this;var i=0;shows.each(function(s){var li=new Element("li");var slot=new Element("a",{href:s.linkUrl,"class":"slot",rel:i,id:"pts_slot_"+i});if(Object.isArray(s.airTime)){var time=new Element("div",{"class":"time"});var t1=new Element("span",{"class":"bold"}).insert(s.airTime[0]);time.insert(t1);if(!isUndefined(s.airTime[1])){time.insert("/"+s.airTime[1]);}slot.insert(time);}else{var time=new Element("div",{"class":"time bold"});var t1=new Element("span",{"class":"bold"}).insert(s.airTime);time.insert(t1);slot.insert(time);}var show=new Element("div",{"class":"showLink"}).insert(s.linkTextTrunc);slot.insert(show);var episode=new Element("div",{"class":"episode"}).insert(s.episodeTitle);if(s.episodeTitle.strip()!=""){slot.insert(episode);}if(s.isNew){slot.insert(new Element("div",{"class":"Sprites newBadge"}));}li.insert(slot);scope._showsHolder.insert(li);i++;});this._navList.invoke("removeClassName","active");this.getActiveDayLink().up().addClassName("active");this._observeShowTitles($(document.getElementsByTagName("body")[0]));},_getScheduleData:function(){new Ajax.Request(current.Constants.getInstance().getScriptName()+"/schedule/primetime_schedule/"+this.getActiveDayId(),{method:"get",evalJS:false,onSuccess:this.__onSuccess.bindAsEventListener(this),onFailure:this.__onFailure.bindAsEventListener(this)});},__onSuccess:function(data,action){this.setDayData(this.getActiveDayId(),data.responseText);this._buildSchedule();},__onFailure:function(data){return false;}});Object.Event.extend(current.components.schedule.PrimetimeModule);current.components.schedule.PrimetimeModule.getInstance=function(){if(!document.__primetimeModule__){document.__primetimeModule__=new current.components.schedule.PrimetimeModule();}return document.__primetimeModule__;};var ExternalPost=Class.create({initialize:function(parent,event,contentId,contentUrl,contentShortUrl,contentTitle,contentDesc){this._parent=parent;this._open=false;this._modalWidth="155";this._modalHeight="212";this._modalPosLeft=event.element().positionedOffset()["left"];this._modalPosTop=(event.element().positionedOffset()["top"]+18);this._contentId=contentId;this._contentUrl=contentUrl;this._contentShortUrl=contentShortUrl;this._contentTitle=contentTitle;this._contentDesc=contentDesc;this._shareText=current.locale.Bundle.get("share.Send_to_a_friend");},init:function(){var encUrl=encodeURIComponent(this._contentUrl);var encTitle=encodeURIComponent(this._contentTitle);var encTweet=encodeURIComponent('Check out "'+this._contentTitle.substr(0,50)+'" at '+this._contentShortUrl);var encDesc=encodeURIComponent(this._contentDesc);var html='<div class="itemSharingAddins">';if(true){html+='<a id="contentItemShareLinkSmall_'+this._contentId+'" class="first" href="#shareThis" onclick="return false;" title="share"><span class="Sprites envelopeIcon floatLeft" style="margin-right:5px"></span>'+this._shareText+"</a>";}if(current.User.getInstance().getLocale()=="en_US"){html+='<a id="contentItemBuzzLink" href="http://buzz.yahoo.com/article/current616/'+encUrl+'" target="_blank" title="Buzz up!"><span class="Sprites yBuzzIcon floatLeft" style="margin-right:5px"></span>Buzz up!</a>';}if(true){html+='<a id="contentItemFacebookLink" href="http://www.facebook.com/sharer.php?u='+encUrl+"&t="+encTitle+'" target="_blank" title="Facebook"><span class="Sprites facebookIcon floatLeft" style="margin-right:5px"></span>Facebook</a>';}if(true){html+='<a id="contentItemDiggLink" href="http://digg.com/submit?phase=2&url='+encUrl+"&title="+encTitle+"&bodytext="+encDesc+'&topic=news" target="_blank" title="Digg"><span class="Sprites diggIcon floatLeft" style="margin-right:5px"></span>Digg</a>';}if(true){html+='<a id="contentItemMySpaceLink" href="http://www.myspace.com/Modules/PostTo/Pages/?l=1&u='+encUrl+"&t="+encTitle+"&c="+encDesc+'" target="_blank" title="MySpace"><span class="Sprites mySpaceIcon floatLeft" style="margin-right:5px"></span>MySpace</a>';}if(true){var tweet='Check out "';html+='<a id="contentItemTwitterLink" href="http://twitter.com/home?status='+encTweet+'" target="_blank" title="Twitter"><span class="Sprites twitterIcon floatLeft" style="margin-right:5px"></span>Twitter</a>';}if(true){html+='<a id="contentItemDeliciousLink" href="http://del.icio.us/post?v=2&url='+encUrl+"&title="+encTitle+'" target="_blank" title="Del.icio.us"><span class="Sprites deliciousIcon floatLeft" style="margin-right:5px"></span>Del.icio.us</a>';}if(true){html+='<a id="contentItemRedditLink" href="http://reddit.com/submit?url='+encUrl+"&title="+encTitle+'" target="_blank" title="Reddit"><span class="Sprites redditIcon floatLeft" style="margin-right:5px"></span>Reddit</a>';}if(true){html+='<a id="contentItemStumbleUponLink" href="http://www.stumbleupon.com/submit?url='+encUrl+"&title="+encTitle+'" target="_blank" title="StumbleUpon"><span class="Sprites stumbleUponIcon floatLeft" style="margin-right:5px"></span>StumbleUpon</a>';}if(true){html+='<a id="contentItemGBooksLink" href="http://www.google.com/bookmarks/mark?op=add&bkmk='+encUrl+"&title="+encTitle+'" target="_blank" title="Google Bookmarks"><span class="Sprites gBooksIcon floatLeft" style="margin-right:5px"></span>Google Bookmarks</a>';}html+="</div>";Control.Modal.open(false,{contents:html,position:"relative",hover:true,offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"itemSharingLayer",width:this._modalWidth,height:this._modalHeight,closeButton:false,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},setShareText:function(val){this._shareText=val;},__onModalLoaded:function(){this._shareLinkElement=$("contentItemShareLinkSmall_"+this._contentId);if(this._shareLinkElement&&this._parent._share){this._parent._share.setShareLink(this._shareLinkElement);}if(this._shareLinkElement&&this._parent._shareList){this._parent._shareList.get(this._contentId).setShareLink(this._shareLinkElement);}},__resetWindow:function(){this._open=false;}});current.stub("current.components.twitter");current.components.twitter.TwitterWidget=Class.create({initialize:function(target){this._target=target;},searchCallback:function(obj){if(!obj||!obj.results||!obj.results.length){return ;}var html="";for(var i=0;i<obj.results.length;i++){html+="<li>";if(obj.results[i].profile_image_url){html+='<a name="twitter" href="http://www.twitter.com/'+obj.results[i].from_user+'">';html+='<img src="'+obj.results[i].profile_image_url+'" border="0" width="48" height="48"/>';html+="</a>";}html+='<a name="twitter" class="poster" href="http://www.twitter.com/'+obj.results[i].from_user+'">'+obj.results[i].from_user+"</a>";var text=obj.results[i].text;text=text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(F){return'<a name="twitter" href="'+F+'">'+F+"</a>";});text=text.replace(/\B@([_a-z0-9]+)/ig,function(F){return F.charAt(0)+'<a name="twitter" href="http://www.twitter.com/'+F.substring(1)+'">'+F.substring(1)+"</a>";});html+=" "+text;html+='<span class="date">'+this.getRelativeTime(obj.results[i].created_at)+"</span>";html+="</li>";}$(this._target).innerHTML=html;var box=$("twitter_search_box");if(box){box.style.display="block";}},getRelativeTime:function(C){var B=C.split(" ");C=B[1]+" "+B[2]+", "+B[4]+" "+B[3];var A=Date.parse(C);var D=(arguments.length>1)?arguments[1]:new Date();var E=parseInt((D.getTime()-A)/1000);E=E+(D.getTimezoneOffset()*60);if(E<60){return current.locale.Bundle.get("justNow");}if(E<120){return current.locale.Bundle.get("minuteAgo");}if(E<(60*60)){var message=new Template(current.locale.Bundle.get("minutesAgo"));return message.evaluate({num:(parseInt(E/60)).toString()});}if(E<(120*60)){return current.locale.Bundle.get("hourAgo");}if(E<(24*60*60)){var message=new Template(current.locale.Bundle.get("hoursAgo"));return message.evaluate({num:(parseInt(E/3600)).toString()});}if(E<(48*60*60)){return current.locale.Bundle.get("dayAgo");}var message=new Template(current.locale.Bundle.get("daysAgo"));return message.evaluate({num:(parseInt(E/86400)).toString()});}});current.stub("current.components.toolbar");current.components.toolbar.Toolbar=Class.create({initialize:function(framedUrl){var p=current.site.Page.getInstance();var u=current.User.getInstance();this._userId=parseInt(u.getId());this._pageId=parseInt(p.getId());this._username=u.getUsername();this._exitLink=$("toolbarCloseButton");this._framedUrl=framedUrl;this.init();},init:function(){$("toolbarCloseButton").observe("click",this.__onExitClick.bindAsEventListener(this));if($("toolbarClipperLink")){$("toolbarClipperLink").observe("click",this.__onClipperClick.bindAsEventListener(this,$("toolbarClipperLink").href));}this._doVoteState();this._addSharingLinks($(document.getElementsByTagName("body")[0]));try{if($("loginLinkA")){$("loginLinkA").observe("click",this.__onLoginClick.bindAsEventListener(this));}}catch(e){}},__onLoginClick:function(event){event.stop();var loginWindow=new current.components.account.LoginWindow(event,current.components.account.LoginActivity.NONE);loginWindow.init();},_doVoteState:function(){var u=current.User.getInstance();this._voting=$H();scope=this;$$(".voting").each(function(v){var vote=new current.components.voting.VoteControls(v);vote.init();scope._voting.set(vote._id.toString(),vote);});if(u.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:u.getName(),items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});current.components.voting.VoteControls.executeDelayed();},_addSharingLinks:function(target){var t=$("itemSharingMenuLink");if(t){this._share=new Share(this._pageId);this._share.setShareType("C");this._share.setUserId(this._userId);t.observe("click",this.__onExternalPostClick.bindAsEventListener(this));}},__onExitClick:function(event){event.stop();document.location.href=this._framedUrl;},__onClipperClick:function(event,startURL){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP,true);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var clipperWindow=new current.clipper.ClipperWindow(event);clipperWindow.setContentUrl(this._framedUrl);clipperWindow.setEditString(false);clipperWindow.init();},__onExternalPostClick:function(event){if(this._externalPost==null){var p=current.site.Page.getInstance();this._externalPost=new ExternalPost(this,event,p.getId(),p.getUrl(),p.getShortUrl(),p.getContentTitle().unescapeHTML(),p.getContentDesc().unescapeHTML());this._externalPost.init();}if(this._externalPost._open){return ;}else{var p=current.site.Page.getInstance();this._externalPost=new ExternalPost(this,event,p.getId(),p.getUrl(),p.getShortUrl(),p.getContentTitle().unescapeHTML(),p.getContentDesc().unescapeHTML());this._externalPost.init();}}});current.components.toolbar.Toolbar.getInstance=function(framedUrl){if(!document.__currentToolbar__){document.__currentToolbar__=new current.components.toolbar.Toolbar(framedUrl);}return document.__currentToolbar__;};current.stub("current.components.voting");current.components.voting.VoteControls=Class.create({_package:current.components.voting,initialize:function(target,isItemList){this._target=$(target);this._target._voteControl=this;this._isVoting=false;this._justVoted=false;this._isItemList=(!isUndefined(isItemList))?isItemList:false;this._id=this._target.down("."+this._package.VoteConstants.UP_VOTE_CLASS).rel.evalJSON().id;this._display=this._target.down("a.voteShow");this._voteClickListener=this.__onVoteClick.bindAsEventListener(this);this._displayOverListener=this.__onDisplayRollOver.bindAsEventListener(this);this._displayOutListener=this.__onDisplayRollOut.bindAsEventListener(this);this._voteDataListener=this.__onVoteData.bindAsEventListener(this);this._display.observe("mouseout",this._displayOutListener);this._display.observe("mouseover",this._displayOverListener);},init:function(){if(!current.User.getInstance().isLoggedIn()){this._target.observe("click",function(event){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.VOTE,true);});}else{if(current.Constants.getInstance().isReadOnlyMode()){this._target.observe("click",function(event){event.stop();new current.components.alerts.AlertWindow(event).init();});}else{if(!current.User.getInstance().isEmailVerified()){this._target.observe("click",function(event){event.stop();new current.components.account.VerifyWindow(event).init();});}else{this._target.observe("click",this._voteClickListener);}}}},setVoteData:function(voteState){if(voteState!=null){this._showVoteState(voteState);}else{this._showVoteButtons();}},_showVoteState:function(state){this._displayClass=this._package.VoteConstants[this._getClassFromState(state)+"_SHOW"];this._display.addClassName(this._displayClass);if(this._isItemList){var infoDiv=this._target.up(".info");if(this._displayClass==this._package.VoteConstants.UP_VOTE_SHOW){$(infoDiv).addClassName("infoVotedUp");this._target.down(".N").hide();this._display.addClassName("top");}else{if(this._displayClass==this._package.VoteConstants.DOWN_VOTE_SHOW){$(infoDiv).addClassName("infoVotedDown");this._target.down(".Y").hide();this._display.addClassName("bottom");}}this._target.show();}else{this._target.down().hide().next().hide();}this._display.show();},_showVoteButtons:function(){if(this._isItemList){var infoDiv=this._target.up(".info");if($(infoDiv).hasClassName("infoVotedUp")){$(infoDiv).removeClassName("infoVotedUp");}if($(infoDiv).hasClassName("infoVotedDown")){$(infoDiv).removeClassName("infoVotedDown");}this._target.down(".Y").show();this._target.down(".N").show();}else{this._target.down().show().next().show();}this._display.removeClassName(this._displayClass);this._display.hide();this._displayClass=null;},_getVoteStateFromClick:function(classes){var values=$H(this._package.VoteConstants).values();return $A(classes).find(function(c){return values.indexOf(c)!=-1;});},_getClassFromState:function(str){var pair=$H(this._package.VoteConstants).find(function(pair){return(str==pair.value);});return pair[0];},__onVoteClick:function(event){event.stop(event);var clickState=this._getVoteStateFromClick($w(event.element().className));if(!clickState){return ;}this.__execVote(this._id,clickState);},__execVote:function(id,clickState){if(this._isVoting){return ;}this._isVoting=true;this._justVoted=true;current.tracking.Track.getInstance().onVote(id,clickState);var u=current.User.getInstance();current.proxy.CCCP.execute("user","vote_post",{id:u.getName(),item:id,vote:clickState},this._voteDataListener);},__onVoteData:function(data){if(data.voteState!=null){this._showVoteState(data.voteState);}else{this._showVoteButtons();}this._isVoting=false;},__onDisplayRollOver:function(event){if(this._justVoted){return ;}event.element().addClassName(this._package.VoteConstants.UNVOTE_CLASS);},__onDisplayRollOut:function(event){if(this._justVoted){this._justVoted=false;}event.element().removeClassName(this._package.VoteConstants.UNVOTE_CLASS);}});current.components.voting.VoteConstants={UP_VOTE:"Y",DOWN_VOTE:"N",UNVOTE:"C",UP_VOTE_CLASS:"voteUp",DOWN_VOTE_CLASS:"voteDown",UNVOTE_CLASS:"voteUndo",UP_VOTE_SHOW:"votedUp",DOWN_VOTE_SHOW:"votedDown",ITEM_VOTE_TYPE:"C"};current.components.voting.VoteControls.executeDelayed=function(){if(!current.User.getInstance().isLoggedIn()||!current.User.getInstance().isEmailVerified()){return ;}var match,controls,vote,href=document.location.href;if(match=(/\#voteUp\_(\d+)/.exec(href))){controls=document.getElementsByClassName(current.components.voting.VoteConstants.UP_VOTE_CLASS+" id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.VoteConstants.UP_VOTE);}return ;}if(match=(/\#voteDown\_(\d+)/.exec(href))){controls=document.getElementsByClassName(current.components.voting.VoteConstants.DOWN_VOTE_CLASS+" id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.VoteConstants.DOWN_VOTE);}return ;}if(match=(/\#voteShow\_(\d+)/.exec(href))){controls=document.getElementsByClassName("voteShow id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.VoteConstants.UNVOTE);}return ;}};current.stub("current.components.voting");current.components.voting.CommentVoteControls=Class.create({initialize:function(){this._isVoting=false;this._justVoted=false;this._VoteConstants=current.components.voting.VoteConstants;this._voteClickListener=this.__onVoteClick.bindAsEventListener(this);this._displayOverListener=this.__onDisplayRollOver.bindAsEventListener(this);this._displayOutListener=this.__onDisplayRollOut.bindAsEventListener(this);this._voteDataListener=this.__onVoteData.bindAsEventListener(this);},init:function(target){this._target=$(target);this._id=this._target.down("."+this._VoteConstants.UP_VOTE_CLASS).rel.evalJSON().id;this._display=this._target.down("a.voteShow");this._initState=this._getInitalVoteState(this._display);this._target.down(".voteUp").addClassName("commentActive");this._target.down(".voteDown").addClassName("commentActive");this._target.down(".voteUp").removeClassName("comment");this._target.down(".voteDown").removeClassName("comment");if((this._initState=="Y")||(this._initState=="N")){this.setVoteData(this._initState);}this.observeVoteControls();},reset:function(){this.unobserveVoteControls();this._target.down(".voteUp").addClassName("comment");this._target.down(".voteDown").addClassName("comment");this._target.down(".voteUp").removeClassName("commentActive");this._target.down(".voteDown").removeClassName("commentActive");},observeVoteControls:function(){this._target.observe("click",this._voteClickListener);this._display.observe("mouseout",this._displayOutListener);this._display.observe("mouseover",this._displayOverListener);},unobserveVoteControls:function(){this._target.stopObserving("click",this._voteClickListener);this._display.stopObserving("mouseover",this._displayOverListener);this._display.stopObserving("mouseout",this._displayOutListener);},setVoteData:function(voteState){if(voteState!=null){this._showVoteState(voteState);}else{this._showVoteButtons();}},_showVoteState:function(state){this._displayClass=this._VoteConstants[this._getClassFromState(state)+"_SHOW"];this._display.addClassName(this._displayClass);this._target.down().hide().next().hide();this._display.show();},_showVoteButtons:function(){this._target.down().show().next().show();this._display.removeClassName(this._displayClass);this._display.hide();this._displayClass=null;},_getInitalVoteState:function(element){if($(element).hasClassName(this._VoteConstants.UP_VOTE_SHOW)){return this._VoteConstants.UP_VOTE;}if($(element).hasClassName(this._VoteConstants.DOWN_VOTE_SHOW)){return this._VoteConstants.DOWN_VOTE;}return this._VoteConstants.UNVOTE;},_getVoteStateFromClick:function(classes){var values=$H(this._VoteConstants).values();return $A(classes).find(function(c){return values.indexOf(c)!=-1;});},_getClassFromState:function(str){var pair=$H(this._VoteConstants).find(function(pair){return(str==pair.value);});return pair[0];},__onVoteClick:function(event){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.VOTE,true);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var clickState=this._getVoteStateFromClick($w(event.element().className));if(!clickState){return ;}this.__execVote(this._id,clickState);},__execVote:function(id,clickState){if(this._isVoting){return ;}this._isVoting=true;this._justVoted=true;current.tracking.Track.getInstance().onVote(id,clickState);var u=current.User.getInstance();current.proxy.CCCP.execute("user","comment_vote_post",{id:u.getName(),comment:id,vote:clickState},this._voteDataListener);},__onVoteData:function(data){if(data.voteState!=null){this._updateVoteScore(data.voteState);this._initState=data.voteState;this._showVoteState(data.voteState);}else{this._updateVoteScore(this._VoteConstants.UNVOTE);this._showVoteButtons();}this._isVoting=false;},_updateVoteScore:function(voteState){var state=voteState;var s=this._target.up(".vote").down(".score");var ns;if(state==this._VoteConstants.UNVOTE){if(this._initState==this._VoteConstants.UP_VOTE){state=this._VoteConstants.DOWN_VOTE;}if(this._initState==this._VoteConstants.DOWN_VOTE){state=this._VoteConstants.UP_VOTE;}}if(state==this._VoteConstants.UP_VOTE){ns=parseInt(parseInt(s.innerHTML)+1);}if(state==this._VoteConstants.DOWN_VOTE){ns=parseInt(parseInt(s.innerHTML)-1);}var sClass=this._getScoreClass(ns);if(parseInt(ns)>0){ns="+"+ns;}var newScoreDiv=new Element("div",{"class":"score "+sClass}).update(ns);s.replace(newScoreDiv);return ;},_getScoreClass:function(score){score=parseInt(score);if(score==0){return"neu";}if(score>=10){return"vpos";}if(score>=3){return"pos";}if(score>=-2){return"neu";}if(score>=-9){return"neg";}return"vneg";},__onDisplayRollOver:function(event){this._display.addClassName(this._VoteConstants.UNVOTE_CLASS);},__onDisplayRollOut:function(event){if(this._justVoted){this._justVoted=false;}this._display.removeClassName(this._VoteConstants.UNVOTE_CLASS);}});Object.Event.extend(current.components.voting.CommentVoteControls);current.components.voting.CommentVoteControls.getInstance=function(){if(!document.__currentCommentVoteControls__){document.__currentCommentVoteControls__=new current.components.voting.CommentVoteControls();}return document.__currentCommentVoteControls__;};current.components.voting.CommentVoteControls.executeDelayed=function(){if(!current.User.getInstance().isLoggedIn()||!current.User.getInstance().isEmailVerified()){return ;}var match,elem,vote,href=document.location.href;if(match=(/\#commentVoteUp\_(\d+)/.exec(href))){elem=$("commentVoting_"+match[1]);if(elem){vote=current.components.voting.CommentVoteControls.getInstance();vote.init(elem);vote.__execVote(match[1],current.components.voting.VoteConstants.UP_VOTE);vote.reset();}return ;}if(match=(/\#commentVoteDown\_(\d+)/.exec(href))){elem=$("commentVoting_"+match[1]);if(elem){vote=current.components.voting.CommentVoteControls.getInstance();vote.init(elem);vote.__execVote(match[1],current.components.voting.VoteConstants.DOWN_VOTE);vote.reset();}return ;}if(match=(/\#commentVoteShow\_(\d+)/.exec(href))){elem=$("commentVoting_"+match[1]);if(elem){vote=current.components.voting.CommentVoteControls.getInstance();vote.init(elem);vote.__execVote(match[1],current.components.voting.VoteConstants.UNVOTE);vote.reset();}return ;}};current.stub("current.components.voting");current.components.voting.SimpleVoteObserver=Class.create({initialize:function(targetSelector){this._target=targetSelector;this._user=current.User.getInstance();},init:function(){this.doVoteState();},doVoteState:function(){this._voting=$H();scope=this;$$(this._target).each(function(v){var vote=new current.components.voting.VoteControls(v);vote.init();scope._voting.set(vote._id.toString(),vote);});console.log(this._voting.keys().length);if(this._user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:this._user.getUsername(),items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});current.components.voting.VoteControls.executeDelayed();}});current.components.voting.SimpleVoteObserver.getInstance=function(targetSelector){if(!document.__currentSimpleVoteObserver__){document.__currentSimpleVoteObserver__=new current.components.voting.SimpleVoteObserver(targetSelector);}return document.__currentSimpleVoteObserver__;};current.stub("current.components.voting");current.components.voting.ChallengeVoteControls=Class.create({_package:current.components.voting,initialize:function(target,slug,isItemList){this._target=$(target);this._target._voteControl=this;this._isVoting=false;this._justVoted=false;this._slug=(!isUndefined(slug))?slug:null;this._isItemList=(!isUndefined(isItemList))?isItemList:false;this._id=this._target.down("."+this._package.ChallengeVoteConstants.UP_VOTE_CLASS).rel.evalJSON().id;this._display=this._target.down("a.studiosVoteShow");this._voteClickListener=this.__onVoteClick.bindAsEventListener(this);this._displayOverListener=this.__onDisplayRollOver.bindAsEventListener(this);this._displayOutListener=this.__onDisplayRollOut.bindAsEventListener(this);this._voteDataListener=this.__onVoteData.bindAsEventListener(this);this._display.observe("mouseout",this._displayOutListener);this._display.observe("mouseover",this._displayOverListener);},init:function(){if(!current.User.getInstance().isLoggedIn()){this._target.observe("click",function(event){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.VOTE,true);});}else{if(current.Constants.getInstance().isReadOnlyMode()){this._target.observe("click",function(event){event.stop();new current.components.alerts.AlertWindow(event).init();});}else{if(!current.User.getInstance().isEmailVerified()){this._target.observe("click",function(event){event.stop();new current.components.account.VerifyWindow(event).init();});}else{this._target.observe("click",this._voteClickListener);}}}},setVoteData:function(voteState){if(voteState!=null){this._showVoteState(voteState);}else{this._showVoteButtons();}},_showVoteState:function(state){this._displayClass=this._package.ChallengeVoteConstants[this._getClassFromState(state)+"_SHOW"];this._display.addClassName(this._displayClass);if(!this._isItemList){var infoDiv=this._target.down(".favoriteText");if(this._displayClass==this._package.ChallengeVoteConstants.UP_VOTE_SHOW){$(infoDiv).innerHTML=current.locale.Bundle.get("challenge.gracias");this._target.down(".N").hide();this._display.addClassName("top");}else{if(this._displayClass==this._package.ChallengeVoteConstants.DOWN_VOTE_SHOW){$(infoDiv).innerHTML=current.locale.Bundle.get("challenge.pssst");this._target.down(".Y").hide();this._display.addClassName("bottom");}}this._target.down("a").hide().next().hide();}else{this._target.down().hide().next().hide();}this._display.show();},_showVoteButtons:function(){if(!this._isItemList){var infoDiv=this._target.down(".favoriteText");$(infoDiv).innerHTML=current.locale.Bundle.get("challenge.pssst");this._target.down(".Y").show();}else{this._target.down().show().next().show();}this._display.removeClassName(this._displayClass);this._display.hide();this._displayClass=null;},_getVoteStateFromClick:function(classes){var values=$H(this._package.ChallengeVoteConstants).values();return $A(classes).find(function(c){return values.indexOf(c)!=-1;});},_getClassFromState:function(str){var pair=$H(this._package.ChallengeVoteConstants).find(function(pair){return(str==pair.value);});return pair[0];},__onVoteClick:function(event){event.stop(event);var clickState=this._getVoteStateFromClick($w(event.element().className));if(!clickState){return ;}this.__execVote(this._id,clickState);},__execVote:function(id,clickState){if(this._isVoting||this._slug==null){return ;}this._isVoting=true;this._justVoted=true;current.tracking.Track.getInstance().onVote(id,clickState);var u=current.User.getInstance();var actionText="cancel";if(clickState!=this._package.ChallengeVoteConstants.UNVOTE){actionText="select";document.__currentChallengePage__.flushVoteData();}current.proxy.CCCP.execute("challenge","storyline_vote",{id:this._slug,user:u.getName(),item:this._id,action:actionText},this._voteDataListener);},__onVoteData:function(data){if(data&&data.contentId!=null){this._showVoteState(this._package.ChallengeVoteConstants.UP_VOTE);}else{this._showVoteButtons();}this._isVoting=false;},__onDisplayRollOver:function(event){if(this._justVoted){return ;}event.element().addClassName(this._package.ChallengeVoteConstants.UNVOTE_CLASS);},__onDisplayRollOut:function(event){if(this._justVoted){this._justVoted=false;}event.element().removeClassName(this._package.ChallengeVoteConstants.UNVOTE_CLASS);}});current.components.voting.ChallengeVoteConstants={UP_VOTE:"Y",DOWN_VOTE:"N",UNVOTE:"C",UP_VOTE_CLASS:"studiosVoteUp",DOWN_VOTE_CLASS:"studiosVoteDown",UNVOTE_CLASS:"studiosVoteUndo",UP_VOTE_SHOW:"studiosVotedUp",DOWN_VOTE_SHOW:"studiosVotedDown",ITEM_VOTE_TYPE:"C"};current.components.voting.ChallengeVoteControls.executeDelayed=function(){if(!current.User.getInstance().isLoggedIn()||!current.User.getInstance().isEmailVerified()){return ;}var match,controls,vote,href=document.location.href;if(match=(/\#favoriteUp\_(\d+)/.exec(href))){controls=document.getElementsByClassName(current.components.voting.ChallengeVoteConstants.UP_VOTE_CLASS+" id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.ChallengeVoteConstants.UP_VOTE);}return ;}if(match=(/\#favoriteDown\_(\d+)/.exec(href))){controls=document.getElementsByClassName(current.components.voting.ChallengeVoteConstants.DOWN_VOTE_CLASS+" id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.ChallengeVoteConstants.DOWN_VOTE);}return ;}if(match=(/\#favoriteShow\_(\d+)/.exec(href))){controls=document.getElementsByClassName("studiosVoteShow id_"+match[1]);if(controls.length>0){vote=controls[0].parentNode._voteControl;vote.__execVote(match[1],current.components.voting.ChallengeVoteConstants.UNVOTE);}return ;}};current.stub("current.components.video");current.components.video.Veep=Class.create({initialize:function(target,id,options){this._target=target;this._id=id;this._options=options;this._bgColor="#fff";},init:function(){var showThumbnail=false;var showPlayerCallback=null;if(this._options.showThumbnail!=null){showThumbnail=this._options.showThumbnail&&!this._options.autoplay;if(showThumbnail){showPlayerCallback=this._options.showPlayerCallback;this._options.autoplay=true;}delete this._options.showThumbnail;delete this._options.showPlayerCallback;}var datanodeUrl=current.Constants.getInstance().getSwfDatanodeUrl();var playerUrl=current.utils.Url.getVersionedUrl("/swf/current/veep.swf");var installUrl=current.utils.Url.getVersionedUrl("/swf/barca/expressinstall.swf");this._swf=new SWFObject(datanodeUrl+playerUrl,this._id,this._options.w,this._options.h,"9.0",this._bgColor);this._swf.addVariable("serviceUrl",current.Constants.getInstance().getProxyUrl()+"/broxy.htm");this._swf.addVariable("locale",current.User.getInstance().getLocale());this._swf.addVariable("autoplay","false");this._swf.addVariable("hostname",current.Constants.getInstance().getServerName());this._swf.addVariable("externalContext","cdc");this._swf.addVariable("context","group");this._swf.addVariable("adSite",document.currentAdSite);this._swf.addVariable("adPage",document.currentAdPageType);this._swf.addVariable("adZone",document.currentAdZone);this._swf.addVariable("adOrdinal",document.currentAdOrdinal);this._swf.addVariable("adKeywords",document.currentAdKeywords);this._swf.addVariable("trackingBucket",document.currentTrackingBucket);this._swf.addVariable("trackingProfile",document.currentTrackingFlashProfile);this._swf.addVariable("trackingAppPath",document.currentTrackingAppPath);for(option in this._options){var o=this._options[option];if(o!=null&&o.toString()!=""){this._swf.addVariable(option.toString(),encodeURIComponent(o));}}this._swf.addParam("allowscriptaccess","always");this._swf.addParam("wmode","transparent");this._swf.addParam("allowFullScreen","true");this._swf.useExpressInstall(datanodeUrl+installUrl);if(showThumbnail){var target=$(this._target);if(target){var _this=this;var w=this._options.w;var h=this._options.h;var l=Math.ceil((w-48)/2);var t=Math.ceil((h-38)/2);var anchor=new Element("a",{href:"#"});var out=new Element("div",{style:"overflow: hidden; width: "+w+"px; height: "+h+"px; position: relative; background: #000;"});var div=new Element("div",{"class":"buttonDiv",style:"left: "+l+"px; top: "+t+"px; position: absolute;"});var btn=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/icons/medPlayIcon.png"});var img=new Element("img",{src:this._options.thumbUrl,width:w,height:h});div.insert(btn);out.insert(div);out.insert(img);anchor.insert(out);target.appendChild(anchor);Event.observe(anchor,"click",function(event){Event.stop(event);_this._swf.write(target);if(showPlayerCallback){showPlayerCallback();}return false;});}}else{this._swf.write(this._target);}},getContentId:function(){return this._contentId;},setContentId:function(contentId){this._contentId=contentId;},getWidth:function(){return this._width;},setWidth:function(width){this._width=width;},getHeight:function(){return this._height;},setHeight:function(height){this._height=height;},getVideoUrl:function(){return this._videoUrl;},setVideoUrl:function(videoUrl){this._videoUrl=videoUrl;},getImageUrl:function(){return this._imageUrl;},setImageUrl:function(imageUrl){this._imageUrl=imageUrl;},getBgColor:function(){return this._bgColor;},setBgColor:function(bgColor){this._bgColor=bgColor;}});current.stub("current.components.video");current.components.video.Carousel=Class.create({MOVIE_EMBED_NAME:"videoCarouselEmbed",initialize:function(){this._applyThumbnailCover=false;this._autoplay=false;this._currentIndex=0;this._firstBuild=false;this._fixedHeight=0;this._hideLogo=false;this._hideThumbnailCover=false;this._isSwfReady=false;this._pageContext="groups";this._playlistItems=new Array();this._playlistTimer=6;this._previousIndex=-1;this._secondClick=false;this._sizeThumbnail=false;this._skipLoadTracking=false;this._spinCarousel=true;this._startIndex=0;this._useIE6Hack=true;this._useScheduleJpeg=false;this._ignoreVideoStateChange=false;this._volume=-1;this._nonVideoTimer;this._bgColor="#fff";this._hideInfo=false;},init:function(carouselName,carouselArray,playlistCount){this._infoTarget=carouselName+"PlayerInfo";this._cacheTarget=carouselName+"PlayerCache";this._limit=carouselArray.length;this._linkClass=carouselName+"Links";this._playlistArray=carouselArray;this._playlistCount=playlistCount;this._videoTarget=carouselName+"Player";this._getLinks();},playByIndex:function(index){var pbi=this.__getCarouselItemByIndex(index);this.__setVideoParams(pbi);this.play();},onVideoStateChange:function(state,arg1,arg2){if(!this._ignoreVideoStateChange){switch(state){case current.PlayerStates.FINISHED:if(this._spinCarousel){clearTimeout(this._nonVideoTimer);setTimeout(this.__advanceSlideShow.bind(this),500);}if($("nx_"+this._currentIndex)&&this._hideInfo){$("nx_"+this._currentIndex).show();if($("carouselReadout")){$("carouselReadout").show();}}break;case current.PlayerStates.STARTED:if(this._spinCarousel){clearTimeout(this._nonVideoTimer);}if($("nx_"+this._currentIndex)&&this._hideInfo){$("nx_"+this._currentIndex).hide();if($("carouselReadout")){$("carouselReadout").hide();}}break;case current.PlayerStates.AUDIO_ON:this.__setSessionAudioFlag();break;default:break;}}},setHideInfo:function(val){this._hideInfo=val;},setTimer:function(timer){this._playlistTimer=timer;},setPlayerWidth:function(width){this._playerWidth=width;this.setThumbWidth(width);},setPlayerHeight:function(height){this._playerHeight=height;this.setThumbHeight(height);},setPlayerBgColor:function(bgColor){this._bgColor=bgColor;},setThumbWidth:function(thumbWidth){this._thumbWidth=thumbWidth;},setThumbHeight:function(thumbHeight){this._thumbHeight=thumbHeight;},setMaxWidth:function(maxWidth){this._maxWidth=maxWidth;},setMaxHeight:function(maxHeight){this._maxHeight=maxHeight;},setFixedHeight:function(fixedHeight){this._fixedHeight=fixedHeight;},setHideLogo:function(hideLogo){this._hideLogo=hideLogo;},setAutoplay:function(autoplay){this._autoplay=autoplay;},setVolume:function(volume){this._volume=volume;},sizeThumbnail:function(bool){this._sizeThumbnail=bool;},skipLoadTracking:function(value){this._skipLoadTracking=value;},setAdKeywords:function(keywords){this._adKeywords=keywords;},setPageContext:function(pageContext){this._pageContext=pageContext;},applyThumbnailCover:function(value){this._applyThumbnailCover=value;},hideThumbnailCover:function(value){this._hideThumbnailCover=value;},useScheduleJpeg:function(value){this._useScheduleJpeg=value;},useIE6Hack:function(hack){this._useIE6Hack=hack;},ignoreVideoStateChange:function(bool){this._ignoreVideoStateChange=bool;},_getLinks:function(){var l=$$("."+this._linkClass);this.__buildLinkList(l);},__buildLinkList:function(list){var s,p;var c=list.length;if(c==0){return ;}for(var i=0;i<this._playlistCount;i++){p=(this._playlistArray[i])?this._playlistArray[i]:null;if(p!=null){var d=p.evalJSON();s=new current.components.video.CarouselItem(d,i,list[i].id,list[i].rel);s.useIE6Hack(this._useIE6Hack);s.init(this._thumbWidth,this._thumbHeight);s.observe(current.components.video.CarouselEvents.CAROUSEL_CLICK,this.__onCarouselClick.bindAsEventListener(this));s.bindEvents();this._playlistItems.push(s);if(i==0){s.displayItemInfo();}}}if(!this._firstBuild){this.__cacheThumbnails();this.__onCarouselAdvance(this._playlistItems[0]);}this._firstBuild=true;},__cacheThumbnails:function(){var cache=$(this._cacheTarget);if(cache){cache.innerHTML="";for(var i=0;i<this._playlistCount;i++){var item=this._playlistItems[i];if(item){var thumbUrl=this._playlistItems[i].thumbUrl;if(this._useScheduleJpeg){if(thumbUrl.indexOf("/")!=-1){thumbUrl=thumbUrl.substring(0,thumbUrl.lastIndexOf("/"));}thumbUrl=thumbUrl+"/schedule.jpg";}cache.insert(new Element("img",{src:thumbUrl,style:"display: none;"}));}}}},createPagination:function(){Event.observe("carouselArrowPrev","click",this.__prevSlideShow.bindAsEventListener(this));Event.observe("carouselArrowNext","click",this.__nextSlideShow.bindAsEventListener(this));},getCurrentIndex:function(){return this._currentIndex;},__onCarouselClick:function(i){clearTimeout(this._nonVideoTimer);this._spinCarousel=false;this.__onCarouselAdvance(i);},__prevSlideShow:function(event){Event.stop(event);clearTimeout(this._nonVideoTimer);this._spinCarousel=false;this.__rewindIndex();this.__onCarouselAdvance(this.__getCarouselItemByIndex(this._currentIndex));},__nextSlideShow:function(event){Event.stop(event);clearTimeout(this._nonVideoTimer);this._spinCarousel=false;this.__advanceIndex();this.__onCarouselAdvance(this.__getCarouselItemByIndex(this._currentIndex));},__advanceSlideShow:function(){clearTimeout(this._nonVideoTimer);this.__advanceIndex();this.__onCarouselAdvance(this.__getCarouselItemByIndex(this._currentIndex));},__onCarouselAdvance:function(i){if(!i){return ;}this._currentIndex=i.index;if(this._previousIndex!=this._currentIndex){if($("nx_"+this._currentIndex)&&this._hideInfo){$("nx_"+this._currentIndex).show();if($("carouselReadout")){$("carouselReadout").show();}}this._playlistItems.invoke("setActive",false);i.setActive(true);this.__setCarouselItem(i);this.__displayCarouselItem();if(i.assetType=="V"&&!(i.contentSource=="internet"||i.contentSource=="bundle"||i.contentSource=="feed")&&i.transcodeStatus==1){this.__playWhenReady();}this._previousIndex=this._currentIndex;}else{if(!this._spinCarousel&&this._secondClick){this.__goToItem(this._currentIndex);}}if(!this._spinCarousel){this._secondClick=true;}else{this._secondClick=false;}},__getCarouselItemByIndex:function(index){return this._playlistItems[index];},__setCarouselItem:function(i){var item=this.__getCarouselItemByIndex(this._currentIndex);this._videoUrl=item.assetUrl;this._thumbUrl=item.thumbUrl;this._title=item.contentTitle;this._id=item.id;this._username=item.username;this._permalink=item.permalink;this._assetWidth=item.assetWidth;this._assetHeight=item.assetHeight;item.clearItemInfo();item.displayItemInfo();},__setAsset:function(item,w,h){var callback=this;var asset=new current.components.assets.AssetDisplay(item,w,h,this._maxWidth,this._maxHeight);asset.setAssetDivId("videoPlayback");asset.setMovieId(this.MOVIE_EMBED_NAME);asset.setAutoplay(this._autoplay);asset.setShowThumbnailForVideo(true,function(){callback.stopSpin();});asset.setDisableEndSlate("true");asset.setEnableMenu("true");asset.setPageContext(this._pageContext);asset.setSkipOverlay("true");asset.setPlayerWidth(w);asset.setPlayerHeight(h);asset.setFixedHeight(this._fixedHeight);asset.setHideLogo(this._hideLogo);asset.skipLoadTracking(this._skipLoadTracking);asset.useThumbUrl("true");asset.setThumbUrl(this._thumbUrl);asset.setPermalink(item.permalink);asset.setPlayerBgColor(this._bgColor);if(getCookieValue(current.Cookies.PLAYER_AUDIO_ON)){asset.setVolume(getCookieValue(current.Cookies.PLAYER_AUDIO_ON));}else{asset.setVolume(this._volume);}if(item.id==89842424){asset.setVolume(75);}asset.skipLoadTracking(this._skipLoadTracking);asset.setAdKeywords(this._adKeywords);return asset;},__goToItem:function(i){var item=this.__getCarouselItemByIndex(i);location.href=item.permalink;},__playWhenReady:function(){var ready=false;try{var obj=current.utils.Compatibility.getFlashMovieObject(this.MOVIE_EMBED_NAME);if(!obj||!obj.isReady){setTimeout(this.__playWhenReady.bind(this),250);return ;}ready=obj.isReady();}catch(e){setTimeout(this.__playWhenReady.bind(this),250);}if(typeof ready=="undefined"){setTimeout(this.__playWhenReady.bind(this),250);}if(ready){this.__play();}},__play:function(){var obj=current.utils.Compatibility.getFlashMovieObject(this.MOVIE_EMBED_NAME);if(!obj){return ;}obj.playVideo(this._videoUrl,this._thumbUrl,this._title,this._id,this._username,this._permalink,null,this._assetWidth,this._assetHeight,this._autoplay);},__displayCarouselItem:function(){var asset=null;var item=this.__getCarouselItemByIndex(this._currentIndex);var videoClass="nonVideoPlayer";var videoStyle="";var bigPlayButtonUrl=(this._pageContext=="homepage")?current.Constants.getInstance().getDatanodeUrl()+"/images/current/icons/medPlayIcon.png":current.Constants.getInstance().getDatanodeUrl()+"/images/current/icons/bigPlayIcon.gif";var applyThumbnailCover=false;if(item.assetType=="V"&&!(item.contentSource=="internet"||item.contentSource=="bundle"||item.contentSource=="feed")){videoClass="videoPlayer";}if((item.assetType=="V"||item.assetType=="M")&&(item.contentSource=="internet"||item.contentSource=="bundle"||item.contentSource=="feed")){applyThumbnailCover=true;}if(this._useScheduleJpeg){if(this._thumbUrl.indexOf("/")!=-1){this._thumbUrl=this._thumbUrl.substring(0,this._thumbUrl.lastIndexOf("/"));}this._thumbUrl=this._thumbUrl+"/schedule.jpg";bigPlayButtonUrl=this._thumbUrl;}if(item.pageAsset!=null){purge($(this._videoTarget));$(this._videoTarget).innerHTML="";asset=this.__setAsset(item,this._playerWidth,this._playerHeight);asset.setAsset();if(applyThumbnailCover||this._applyThumbnailCover){var th_toggle=new Element("a",{href:"#",id:"ac_"+item.id});var th_cover=new Element("div",{style:"overflow: hidden; width: "+this._playerWidth+"px; height: "+this._playerHeight+"px; position: relative; background: #000;",id:"bc_"+item.id});var th_imageDiv=new Element("div",{style:"width: "+this._playerWidth+"px; height: "+this._playerHeight+"px; position: absolute; top: 0; left: 0; z-index: 1000; text-align: center;",id:"cc_"+item.id});var th_image;if(this._sizeThumbnail){th_image=new Element("img",{src:item.thumbUrl,width:this._playerWidth,height:this._playerHeight,id:"dc_"+item.id});}else{th_image=new Element("img",{src:item.thumbUrl,id:"dc_"+item.id});}th_imageDiv.insert(th_image);th_cover.insert(th_imageDiv);var th_buttonDiv=new Element("div",{"class":"buttonDiv",style:"width: "+this._playerWidth+"px; height: "+this._playerHeight+"px; position: absolute; z-index: 2001;",id:"ec_"+item.id});var bigPlayButton=new Element("img",{src:bigPlayButtonUrl,id:"fc_"+item.id});th_buttonDiv.insert(bigPlayButton);th_cover.insert(th_buttonDiv);if(!this._hideThumbnailCover){th_toggle.insert(th_cover);$(this._videoTarget).appendChild(th_toggle);Event.observe(th_toggle,"click",this.__hideThumbRevealPlayer.bindAsEventListener(this));}else{if(this._useScheduleJpeg){th_toggle.insert(th_cover);$(this._videoTarget).appendChild(th_toggle);Event.observe(th_toggle,"click",this.__hideThumbRevealPlayerAll.bindAsEventListener(this,"c_"+item.id));}else{$(this._videoTarget).appendChild(th_cover);}}videoStyle="display: none;";}if(!item.itemIsExpired){$(this._videoTarget).appendChild(new Element("div",{id:"tc_"+item.id,"class":videoClass,style:videoStyle}).insert(asset.getAsset()));asset.init();}else{$(this._videoTarget).appendChild(new Element("div",{id:"tc_"+item.id,"class":videoClass,style:videoStyle}).insert(new Element("div",{"class":"floatLeft",style:"font-size: 1.6em; color: #fff; text-align: center; padding-top: "+parseInt(this._playerHeight/2)+"px; width: "+this._playerWidth+"px; height: "+this._playerHeight+"px; background: #000;"}).insert(current.locale.Bundle.get("item.video_no_longer_available"))));}}else{$(this._videoTarget).innerHTML="";var t_image=new Element("img",{src:item.thumbUrl});$(this._videoTarget).appendChild(new Element("div",{"class":"nonVideoPlayer"}).insert(t_image));}this._isSwfReady=false;if(this._spinCarousel&&(!(item.assetType=="V"&&!(item.contentSource=="internet"||item.contentSource=="bundle"||item.contentSource=="feed")&&item.transcodeStatus==1)||(item.assetType=="V"&&!this._autoplay)||(item.assetType=="V"&&this._useScheduleJpeg)||item.assetType!="V")){this._nonVideoTimer=setTimeout(this.__advanceSlideShow.bind(this),this._playlistTimer*1000);}},stopSpin:function(){clearTimeout(this._nonVideoTimer);this._spinCarousel=false;},revealPlayer:function(id){clearTimeout(this._nonVideoTimer);this._spinCarousel=false;$("b"+id).hide();$("x"+id).up(".opOverlayInfo").hide();$("carouselReadout").hide();$("t"+id).show();},__hideThumbRevealPlayer:function(event){Event.stop(event);var elm=Event.element(event);clearTimeout(this._nonVideoTimer);this._spinCarousel=false;elm.up("a").hide();var string=elm.id.substring(1);$("t"+string).show();if($("nx_"+this._currentIndex)&&this._hideInfo){$("nx_"+this._currentIndex).hide();if($("carouselReadout")){$("carouselReadout").hide();}}},__hideThumbRevealPlayerAll:function(event,id){this.__hideThumbRevealPlayer(event);this.revealPlayer(id);},__rewindIndex:function(){this._currentIndex--;if(this._currentIndex<0){this._currentIndex=this._limit-1;}},__advanceIndex:function(){this._currentIndex++;if(this._currentIndex>(this._limit-1)){this._currentIndex=0;}},__setSessionAudioFlag:function(){setSessionCookie(current.Cookies.PLAYER_AUDIO_ON,-1);}});Object.Event.extend(current.components.video.Carousel);current.components.video.Carousel.getInstance=function(){if(!document.__currentVideoCarousel__){document.__currentVideoCarousel__=new current.components.video.Carousel();}return document.__currentVideoCarousel__;};current.components.video.CarouselItem=Class.create({initialize:function(data,index,id,isFeatured){this._data=data;this._index=index;this._userInfoBlock="nx_"+this._index;this._assetId=id;this._itemIsFeatured=isFeatured;},useIE6Hack:function(hack){this._useIE6Hack=hack;},init:function(thumbWidth,thumbHeight){this.index=this._index;this.id=this._data.id;this.contentTitle=this._data.contentTitle;this.contentText=this._data.contentText;this.contentSource=this._data.contentSource;this.contentUrl=this._data.contentUrl;this.pageAsset=this._data.pageAsset;this.addedUser=this._data.addedUser;this.username=this._data.addedUser.username;this.userThumbnail=this._data.addedUser.thumbnail;this.richCommentCount=this._data.richCommentCount;this.assetUrl=this.__getAssetUrl();this.assetWidth=this.__getAssetWidth();this.assetHeight=this.__getAssetHeight();this.assetType=this.__getAssetType();this.itemIsExpired=this.__getItemIsExpired();this.permalink=this.__getPermalink();this.transcodeStatus=this.__getTranscodeStatus();var thumb=new current.components.assets.ThumbUrl(this._data);this.thumbUrl=thumb.getThumbnailBySize(thumbWidth,thumbHeight,".jpg");},bindEvents:function(){$(this._assetId).observe("click",this.__onClick.bindAsEventListener(this));},isIE6:function(){if(document.compatMode&&document.all){return true;}else{return false;}},setActive:function(bool){if(bool){this.__getListAsset().addClassName("active");this.__getListAsset().up("li").addClassName("active");}else{this.__getListAsset().removeClassName("active");this.__getListAsset().up("li").removeClassName("active");}},displayItemInfo:function(){if(this._useIE6Hack&&this.isIE6()){$("carouselReadout").innerHTML=$(this._userInfoBlock).innerHTML;}else{$("carouselReadout").show();$(this._userInfoBlock).addClassName("carouselPlayerInfoShow");$(this._userInfoBlock).show();}},clearItemInfo:function(){if(this._useIE6Hack&&this.isIE6()){$("carouselReadout").innerHTML="";}else{$$(".carouselPlayerInfoShow").each(function(nx){nx.removeClassName("carouselPlayerInfoShow");});}},clearInfo:function(){$$(".carouselPlayerInfo").each(function(nx){nx.hide();});},__getListAsset:function(){return $(this._assetId).up(".carouselListingAsset");},__getAssetUrl:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.assetUrl!=null)?this._data.pageAsset.assetUrl:"";},__getAssetType:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.assetType!=null)?this._data.pageAsset.assetType:"I";},__getAssetWidth:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.width!=null)?this._data.pageAsset.width:0;},__getAssetHeight:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.height!=null)?this._data.pageAsset.height:0;},__getItemIsExpired:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.videoRightsExpired!=null)?this._data.pageAsset.videoRightsExpired:false;},__getPermalink:function(){return current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm";},__getTranscodeStatus:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=""&&this._data.pageAsset.transcodeStatus!=null)?this._data.pageAsset.transcodeStatus:0;},__onClick:function(event){Event.stop(event);this.notify(current.components.video.CarouselEvents.CAROUSEL_CLICK,this);}});Object.Event.extend(current.components.video.CarouselItem);current.components.video.CarouselEvents={CAROUSEL_CLICK:"onCarouselClick"};current.stub("current.components.video");current.components.video.VideoLanding=Class.create({initialize:function(){this._playlistIndex=0;this._videoIndex=0;this._currentPlaylistIndex=0;this._currentVideoIndex=0;this._currentVideoId=0;this._startIndex=0;this._videoPlaylistItems=new Array();this._isFetching=false;this._currentSort="";this._isPlaying=false;this._vplayer=null;this._playlistPageLimit=20;this._playlistTarget="videoLandingList";this._playlistNav="videoLandingNav";this._pagingId="videoLandingPaging";this._ajaxProgress="ajaxProgress";this._isRibbonPage=false;this._isFirstRibbon=true;this._ribbonId=0;this._currentRibbonId=0;this._ribbonDrop=null;},init:function(vpNavElements,vpSeedItems){this._videoPlaylist=vpNavElements;this._videoPlaylistItems[this._playlistIndex]=vpSeedItems;if(this._videoPlaylist[0]){this.__setCurrentSort(this._videoPlaylist[0].sort);}this.__createPagination();this.__updatePagination();if(this._isFirstRibbon){this.__injectVideoItem(null,0);}this.__observePlaylistLinks();},setIsRibbonPage:function(bool){this._isRibbonPage=bool;},setRibbonId:function(id){this._ribbonId=id;},setRibbonDrop:function(id){this._ribbonDrop=id;},setIsFirstRibbon:function(bool){this._isFirstRibbon=bool;if(!bool){this._isPlaying=true;}},setPlaylistTarget:function(id){this._playlistTarget=id;},setPlaylistNav:function(id){this._playlistNav=id;},setPagingId:function(id){this._pagingId=id;},setAjaxProgress:function(id){this._ajaxProgress=id;},setPagePlaylistLimit:function(lim){this._playlistPageLimit=lim;},setPlaylistItems:function(items){this._videoPlaylistItems=items;},setPlayerPath:function(path){this._playerPath=path;},setFrontController:function(fc){this._frontController=fc;},onPlaylistClick:function(index){this.__injectVideoItem(null,index);},onVideoStateChange:function(state,arg1,arg2){switch(state){case current.PlayerStates.FINISHED:if(!this._incrementTimer){var scope=this;this._incrementTimer=setTimeout(function(){scope._incrementTimer=null;scope.__incrementCounters();},250);this._isPlaying=false;}else{}break;case current.PlayerStates.PLAYING:this._isPlaying=true;break;default:break;}},isVideoPlaying:function(id,bool){this._currentRibbonId=id;this._isPlaying=bool;},onManualStateChange:function(){this.__incrementCounters();},__setCurrentSort:function(sort){this._currentSort=sort;$$(".sortLink").each(function(sl){sl.removeClassName("active");});var el=$("sortLink_"+sort);if(el){el.addClassName("active");}},__createPagination:function(){this._paging=new current.components.pagination.PagingButtons($(this._pagingId));this._paging.observe(current.components.pagination.PaginationEvent.NEXT_CLICK,this.__onNextClick.bindAsEventListener(this));this._paging.observe(current.components.pagination.PaginationEvent.BACK_CLICK,this.__onBackClick.bindAsEventListener(this));this._paging.init();},__updatePagination:function(){var s=this._videoPlaylist[this._playlistIndex].start;var t=this._videoPlaylist[this._playlistIndex].total;var c=this._videoPlaylist[this._playlistIndex].countPerPage;var p=this._videoPlaylist[this._playlistIndex].currentPage;var e=(s+c>t)?t:s+c;var tp=Math.ceil(t/c);this._paging.setRange(s+1,e,t);this._paging.setButtonsAvailable(p,tp);if(t<this._playlistPageLimit+1){$(this._pagingId).hide();}else{$(this._pagingId).show();}},__injectVideoItem:function(event,slot){this._videoIndex=((event==null)?((slot<0)?this._videoIndex:slot):event.element().rel);if(event!=null){event.stop();}var v=this._videoPlaylistItems[this._playlistIndex][this._videoIndex];if(!v||!v.id){return ;}this.__insertPlayer(v.id);this.__insertItemInfo();this.__hideNowPlayingIcons();this.__showNowPlayingIcon(v.id);},__injectVideoItemFromAsset:function(event){event.stop();var el=event.element();var link=el.up("div").down(".videoItemAssetLink");var index=link.rel;this.__injectVideoItem(null,index);},__switchPlaylists:function(event,slot){var index=((event==null)?((slot<0)?this._playlistIndex:slot):event.element().rel);if(event!=null){event.stop();}if(index==this._playlistIndex){return ;}if(this._isFetching){return ;}var el=(($("playlistLink_"+index))?$("playlistLink_"+index):null);this.__fetchVideos(el,index);},__incrementCounters:function(){var items=this._videoPlaylistItems[this._playlistIndex];var limit=((items.length<this._playlistPageLimit)?(items.length-1):(this._playlistPageLimit-1));if(this._videoPlaylist[this._playlistIndex].currentPage>1&&this._videoPlaylist[this._playlistIndex].total%this._playlistPageLimit!=0){limit=(this._videoPlaylist[this._playlistIndex].total%this._playlistPageLimit)-1;}var v=parseInt(this._videoIndex);var p=parseInt(this._playlistIndex);this._videoIndex=((v+1>limit)?0:v+1);if(v+1>limit){var pLimit=this._videoPlaylist.length-1;var index=((p+1>pLimit)?0:p+1);if(!this._isRibbonPage){this.__switchPlaylists(null,index);}else{if(index==0){document.__currentVideoRibbons__.onRibbonAdvance(index);}else{this.__switchPlaylists(null,index);}}}else{this.__injectVideoItem(null,-1);}},__hideNowPlayingIcons:function(){$$(".nowPlaying").each(function(np){np.hide();});$$(".nowPlayingCover").each(function(np){np.hide();});},__showNowPlayingIcon:function(id){if($("videoItem_"+id)){$("videoItem_"+id).down(".nowPlayingCover").show();$("videoItem_"+id).down(".nowPlaying").show();}},__observePlaylistLinks:function(){$$("#"+this._playlistNav+" .playlistLink").invoke("observe","click",this.__switchPlaylists.bindAsEventListener(this,null));$$("#"+this._playlistTarget+" .videoItemLink").invoke("observe","click",this.__injectVideoItem.bindAsEventListener(this,null));$$("#"+this._playlistTarget+" .videoItemAssetLink").invoke("observe","click",this.__injectVideoItemFromAsset.bindAsEventListener(this,null));$$(".sortLink").invoke("observe","click",this.__fetchVideosFromSort.bindAsEventListener(this));if(this._ribbonDrop!=null&&$(this._ribbonDrop)){$(this._ribbonDrop).observe("change",this.__ribbonDrop.bindAsEventListener(this,null));}},__ribbonDrop:function(event,slot){var index=event.element().selectedIndex;this.__switchPlaylists(null,index);},__onVideoPlaylistClick:function(i){var index=i.getVideoItemIndex();this.__injectVideoItem(null,index);},__deactivateNavItems:function(){$$(".playlistLink").each(function(ni){ni.removeClassName("active");ni.next().setStyle({visibility:"hidden"});});},__fetchVideos:function(el,index){this._isFetching=true;if(this._videoPlaylistItems[index]!=null){this.__buildPlaylistFromCache(index);}else{var slug=this._videoPlaylist[index].slug;var sort=this._videoPlaylist[index].sort;var start=this._videoPlaylist[index].start;this._startIndex=start;var type=this._videoPlaylist[index].type;this.__showAjaxProgress();if(type=="group"){ContentItemService.fetchVideoPlaylist(slug,sort,start,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,index),this.__onPlaylistFail.bindAsEventListener(this));}else{ContentItemService.fetchVideoPlaylistFromTag(slug,sort,start,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,index),this.__onPlaylistFail.bindAsEventListener(this));}}},__fetchVideosFromSort:function(event){event.stop();var el=event.element();var sort=el.rel;if(sort!=this._currentSort){this._currentSort=sort;this._videoPlaylist[this._playlistIndex].sort=sort;$$(".sortLink").each(function(sl){sl.removeClassName("active");});el.addClassName("active");this._isFetching=true;var slug=this._videoPlaylist[this._playlistIndex].slug;var type=this._videoPlaylist[this._playlistIndex].type;this._startIndex=0;this.__showAjaxProgress();if(type=="group"){ContentItemService.fetchVideoPlaylist(slug,sort,this._startIndex,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,null),this.__onPlaylistFail.bindAsEventListener(this));}else{ContentItemService.fetchVideoPlaylistFromTag(slug,sort,this._startIndex,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,null),this.__onPlaylistFail.bindAsEventListener(this));}}},__fetchVideosFromPagination:function(){this._isFetching=true;var slug=this._videoPlaylist[this._playlistIndex].slug;var sort=this._videoPlaylist[this._playlistIndex].sort;var type=this._videoPlaylist[this._playlistIndex].type;this.__showAjaxProgress();if(type=="group"){ContentItemService.fetchVideoPlaylist(slug,sort,this._startIndex,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,null),this.__onPlaylistFail.bindAsEventListener(this));}else{ContentItemService.fetchVideoPlaylistFromTag(slug,sort,this._startIndex,this._playlistPageLimit,this.__onPlaylistData.bindAsEventListener(this,null),this.__onPlaylistFail.bindAsEventListener(this));}},__updatePlaylistIndex:function(index){this._playlistIndex=index;this.__deactivateNavItems();if($("playlistLink_"+this._playlistIndex)){$("playlistLink_"+this._playlistIndex).addClassName("active");$("playlistLink_"+this._playlistIndex).next().setStyle({visibility:"visible"});}if(this._ribbonDrop!=null&&$(this._ribbonDrop)){$(this._ribbonDrop).selectedIndex=index;}},__showAjaxProgress:function(){$(this._ajaxProgress).show();},__hideAjaxProgress:function(){$(this._ajaxProgress).hide();},__onPlaylistFail:function(){this.__hideAjaxProgress();this._isFetching=false;},__onPlaylistData:function(data,index){this.__hideAjaxProgress();var c=data.totalCount;if(parseInt(c)<1){return ;}if(index!=null){this.__updatePlaylistIndex(index);}this.__buildPlaylist(data.items);this._videoPlaylist[this._playlistIndex].start=data.startIndex;this._videoPlaylist[this._playlistIndex].total=data.totalCount;this._videoPlaylist[this._playlistIndex].countPerPage=data.countPerPage;this._videoPlaylist[this._playlistIndex].currentPage=data.currentPage;this.__updatePagination();this.__setCurrentSort(this._videoPlaylist[this._playlistIndex].sort);if(this._isPlaying){var v=this._videoPlaylistItems[this._currentPlaylistIndex][this._currentVideoIndex];if(this._playlistIndex==this._currentPlaylistIndex&&v.id==this._currentVideoId){if(this._ribbonId==this._currentRibbonId){this._videoIndex=this._currentVideoIndex;this.__hideNowPlayingIcons();this.__showNowPlayingIcon(v.id);}}else{this._videoIndex=-1;}}else{this.__injectVideoItem(null,0);}this._isFetching=false;},__buildPlaylist:function(items){$(this._playlistTarget).innerHTML="";var s,p,r=0;var c=items.length;if(c==0){return ;}if(this._videoPlaylistItems[this._playlistIndex]==null){this._videoPlaylistItems[this._playlistIndex]=new Array();}for(var i=0;i<c;i++){p=(items[i])?items[i]:null;if(p!=null){s=new current.components.video.VideoPlaylistItem(p,r,this._isRibbonPage);s.init();if(s.transcodeStatus==1&&!s.itemIsExpired&&s.contentStatus!="STATUS_HIDDEN"){$(this._playlistTarget).appendChild(s.getVideoItem());s.observe(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,this.onPlaylistClick.bindAsEventListener(this));s.bindEvents();this._videoPlaylistItems[this._playlistIndex][r]={id:s.id,slug:s.slug,title:s.contentTitle,parentGroupName:s.parentGroupName,parentGroupSlug:s.parentGroupSlug,parentGroupDescription:s.parentGroupDescription,parentGroupSchedule:s.parentGroupSchedule,commentCount:s.richCommentCount,description:s.contentText,url:s.contentUrl,duration:s.duration,thumbnail:s.thumbUrl,permalink:s.permalink,itemIsExpired:s.itemIsExpired,transcodeStatus:s.transcodeStatus,rrbPath:s.rrbPath};r++;}}else{}}},__buildPlaylistFromCache:function(index){this.__updatePlaylistIndex(index);var items=this._videoPlaylistItems[this._playlistIndex];if(items.length<1){return ;}$(this._playlistTarget).innerHTML="";var s,r=0;for(var i=0;i<items.length;i++){var vi=items[i];s=new current.components.video.VideoPlaylistItem(null,r,this._isRibbonPage);s.setId(vi.id);s.setSlug(vi.slug);s.setTitle(vi.title);s.setDescription(vi.description);s.setUrl(vi.url);s.setCommentCount(vi.commentCount);s.setParentGroupName(vi.parentGroupName);s.setParentGroupSlug(vi.parentGroupSlug);s.setParentGroupDescription(vi.parentGroupDescription);s.setParentGroupSchedule(vi.parentGroupSchedule);s.setDuration(vi.duration);s.setPermalink(vi.permalink);s.setItemIsExpired(vi.itemIsExpired);s.setTranscodeStatus(vi.transcodeStatus);s.setThumbnail(vi.thumbnail);s.setRRBPath(vi.rrbPath);$(this._playlistTarget).appendChild(s.getVideoItem());s.observe(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,this.onPlaylistClick.bindAsEventListener(this));s.bindEvents();r++;}this._startIndex=this._videoPlaylist[this._playlistIndex].start;this.__updatePagination();this.__setCurrentSort(this._videoPlaylist[this._playlistIndex].sort);if(this._isPlaying){var v=this._videoPlaylistItems[this._currentPlaylistIndex][this._currentVideoIndex];if(this._playlistIndex==this._currentPlaylistIndex&&v.id==this._currentVideoId){if(this._ribbonId==this._currentRibbonId){this._videoIndex=this._currentVideoIndex;this.__hideNowPlayingIcons();this.__showNowPlayingIcon(v.id);}}else{this._videoIndex=-1;}}else{this.__injectVideoItem(null,0);}this._isFetching=false;},__onNextClick:function(event,pagerCount){this._startIndex=this._startIndex+this._playlistPageLimit;if(this._startIndex>this._videoPlaylist[this._playlistIndex].total){return ;}this.__fetchVideosFromPagination();},__onBackClick:function(){this._startIndex=this._startIndex-this._playlistPageLimit;if(this._startIndex<0){return ;}this.__fetchVideosFromPagination();},__insertItemInfo:function(){var v=this._videoPlaylistItems[this._playlistIndex][this._videoIndex];var dateDiv=$("show-player-info-date");var titleDiv=$("show-player-info-title");var respDiv=$("show-player-info-responses");var descDiv=$("show-player-info-description");var moreLink=' <a href="'+v.permalink+'" class="moreLink">'+current.locale.Bundle.get("more")+"</a>";if(dateDiv){dateDiv.innerHTML=v.parentGroupName;}if(titleDiv){titleDiv.innerHTML='<a href="'+v.permalink+'" class="vlTitleLink">'+v.title+"</a>";}if(respDiv){respDiv.innerHTML='<a href="'+v.permalink+'#responses">'+current.locale.Bundle.get("comment_on_video")+" ("+v.commentCount+")</a>";}if(descDiv){descDiv.innerHTML=v.description+moreLink;}this.__updateRRB(v.rrbPath,v.parentGroupName,v.parentGroupSlug,v.parentGroupDescription,v.parentGroupSchedule);},__insertPlayer:function(id){if(!id){return ;}if(this._vplayer==null){var so=new SWFObject(this._playerPath,"videoLandingPlayer","625","352","9.0","#000000");so.addParam("allowScriptAccess","always");so.addParam("wmode","transparent");so.addParam("allowFullScreen","true");so.addVariable("autoplay","true");so.addVariable("contentId",id);so.addVariable("hostname",current.Constants.getInstance().getServerName());so.addVariable("serviceUrl",current.Constants.getInstance().getProxyUrl()+"/broxy.htm");so.addVariable("frontController",this._frontController);so.addVariable("trackingBucket",document.currentTrackingBucket);so.addVariable("trackingProfile",document.currentTrackingFlashProfile);so.addVariable("trackingAppPath",document.currentTrackingAppPath);so.addVariable("forceAdManager","true");so.addVariable("externalPlayControl","true");so.addVariable("externalContext","cdc");so.addVariable("context","showpage");so.addVariable("adSite",current.Constants.getInstance().getAdSite());so.addVariable("adPage","groups");so.addVariable("adOrdinal",current.Constants.getInstance().getAdOrdinal());so.addVariable("adSize","300x240");so.addVariable("referer",window.location.href);so.write("show-player");this._vplayer=document.getElementById("videoLandingPlayer");this._currentPlaylistIndex=this._playlistIndex;this._currentVideoIndex=this._videoIndex;this._currentVideoId=id;this._isPlaying=true;}else{try{this.__updatePlayer(id);}catch(e){this._vplayer=null;this.__insertPlayer(id);}}},__updatePlayer:function(id){this._vplayer.playVideo(id);this._currentPlaylistIndex=this._playlistIndex;this._currentVideoIndex=this._videoIndex;this._currentVideoId=id;this._isPlaying=true;},__updateRRB:function(rrbPath,name,slug,description,schedule){if($("rightRailBanner")){if(rrbPath!=""){var rrb=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+slug+"/"}).insert(new Element("img",{src:rrbPath}));}else{var rrb=new Element("div",{"class":"videoLandingGroupInfo"});rrb.insert(new Element("h3",{"class":"videoLandingGroupLink"}).insert(new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+slug+"/"}).insert(name)));rrb.insert(new Element("span",{"class":"videoLandingGroupSchedule"}).insert(schedule));var more=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+slug+"/","class":"videoLandingGroupMore"}).insert(current.locale.Bundle.get("more"));var p=new Element("p",{"class":"videoLandingGroupDescription"}).insert(truncateText(description,100,"...",true));p.insert(" ");p.insert(more);rrb.insert(p);}$("rightRailBanner").update(rrb);}}});Object.Event.extend(current.components.video.VideoLanding);current.components.video.VideoLanding.getInstance=function(){if(!document.__currentVideoLanding__){document.__currentVideoLanding__=new current.components.video.VideoLanding();}return document.__currentVideoLanding__;};current.components.video.VideoPlaylistItem=Class.create({initialize:function(data,index,bool){this._data=data;this._index=index;this._width=((bool)?120:145);this._height=((bool)?90:109);this._rowCount=((bool)?7:5);},init:function(){this.id=this._data.id;this.slug=this._data.slug;this.contentTitle=truncateText(this._data.contentTitle,66,"...",true);this.contentText=truncateText(this._data.contentText,156,"...",true);this.contentStatus=this._data.contentStatus;this.contentUrl=this._data.contentUrl;this.pageAsset=this._data.pageAsset;this.richCommentCount=this._data.richCommentCount;this.parentGroupName=this._data.parentGroup.name;this.parentGroupSlug=this._data.parentGroup.slug;this.parentGroupDescription=((this._data.parentGroup.skin!=null&&this._data.parentGroup.skin.channelDescription!=null)?this._data.parentGroup.skin.channelDescription:"");this.parentGroupSchedule=((this._data.parentGroup.skin!=null&&this._data.parentGroup.skin.channelSchedule!=null)?this._data.parentGroup.skin.channelSchedule:"");this.duration=this._data.pageAsset.duration;this.permalink=this.__getPermalink();this.itemIsExpired=this.__getItemIsExpired();this.transcodeStatus=this.__getTranscodeStatus();var thumb=new current.components.assets.ThumbUrl(this._data);this.thumbUrl=thumb.getThumbnailBySize(this._width,this._height,".jpg");this.rrbPath=this.__getRRBPath();},reInit:function(v){this.id=v.id;this.slug=v.slug;this.contentTitle=v.title;this.contentText=v.description;this.contentUrl=v.url;this.contentStatus=v.contentStatus;this.richCommentCount=v.commentCount;this.parentGroupName=v.parentGroupName;this.parentGroupSlug=v.parentGroupSlug;this.parentGroupDescription=v.channelDescription;this.parentGroupSchedule=v.channelSchedule;this.duration=v.duration;this.permalink=v.permalink;this.itemIsExpired=v.itemIsExpired;this.transcodeStatus=v.transcodeStatus;this.thumbUrl=v.thumbnail;this.rrbPath=v.rrbPath;},setId:function(id){this.id=id;},setSlug:function(slug){this.slug=slug;},setTitle:function(title){this.contentTitle=title;},setDescription:function(description){this.contentText=description;},setContentStatus:function(status){this.contentStatus=status;},setUrl:function(url){this.contentUrl=url;},setCommentCount:function(commentCount){this.richCommentCount=commentCount;},setParentGroupName:function(parentGroupName){this.parentGroupName=parentGroupName;},setParentGroupSlug:function(parentGroupSlug){this.parentGroupSlug=parentGroupSlug;},setParentGroupDescription:function(parentGroupDescription){this.parentGroupDescription=parentGroupDescription;},setParentGroupSchedule:function(parentGroupSchedule){this.parentGroupSchedule=parentGroupSchedule;},setDuration:function(duration){this.duration=duration;},setPermalink:function(permalink){this.permalink=permalink;},setItemIsExpired:function(itemIsExpired){this.itemIsExpired=itemIsExpired;},setTranscodeStatus:function(transcodeStatus){this.transcodeStatus=transcodeStatus;},setThumbnail:function(thumbnail){this.thumbUrl=thumbnail;},setRRBPath:function(path){this.rrbPath=path;},getVideoItem:function(){var classStr=(((this._index+1)%this._rowCount!=0)?"videoItem":"videoItem lastItem");var v=new Element("div",{id:"videoItem_"+this.id,"class":classStr});var va=new Element("div",{"class":"videoItemAsset"});var a=new Element("a",{href:"#","class":"videoItemAssetLink",id:"videoItemAssetLink_"+this.id,rel:this._index}).insert(new Element("img",{src:this.thumbUrl,width:this._width,height:this._height}));var co=new Element("div",{"class":"nowPlayingCover",style:"display: none;"});var b=new Element("div",{"class":"nowPlaying",style:"display: none;"}).insert(new Element("span",{"class":"Sprites nowPlayingBadge"}));var h=new Element("h4").insert(this.parentGroupName);var l=new Element("a",{href:"#","class":"videoItemLink",id:"videoItemLink_"+this.id,rel:this._index}).insert(this.contentTitle);var em=new Element("em");var cmtStr=((this.richCommentCount==1)?"1 "+current.locale.Bundle.get("comment")+" | ":this.richCommentCount+" "+current.locale.Bundle.get("comments")+" | ");em.insert(cmtStr);em.insert(msToHHMMSS(this.duration));va.insert(a);va.insert(co);va.insert(b);va.insert(h);va.insert(l);va.insert(em);v.insert(va);return v;},bindEvents:function(){$("videoItemLink_"+this.id).observe("click",this.__onClick.bindAsEventListener(this));$("videoItemAssetLink_"+this.id).observe("click",this.__onAssetClick.bindAsEventListener(this));},getVideoItemIndex:function(){return this._index;},__getItemIsExpired:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.videoRightsExpired!=null)?this._data.pageAsset.videoRightsExpired:false;},__getPermalink:function(){return current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm";},__getTranscodeStatus:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=""&&this._data.pageAsset.transcodeStatus!=null)?this._data.pageAsset.transcodeStatus:0;},__onClick:function(event){event.stop();var el=event.element();var index=el.rel;this.notify(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,index);},__onAssetClick:function(event){event.stop();var el=event.element().up("div").down(".videoItemLink");var index=el.rel;this.notify(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,index);},__getRRBPath:function(){if(this._data.parentGroup.skin!=null&&this._data.parentGroup.skin.rightRailBanner!=null){return current.Constants.getInstance().getDatanodeUrl()+this._data.parentGroup.skin.rightRailBanner;}else{return"";}}});Object.Event.extend(current.components.video.VideoPlaylistItem);current.components.video.VideoPlaylistEvents={PLAYLIST_ITEM_CLICK:"onPlaylistClick"};current.stub("current.components.video");current.components.video.VideoRibbons=Class.create({initialize:function(){this._vRibbons=new Array();this._currentRibbon=0;},init:function(){for(var i=0;i<this._drops.length;i++){if(this._drops[i].length==1){continue;}for(var j=0;j<this._drops[i].length;j++){var title=this._drops[i][j][1];if($("ribbonDrop_"+this._drops[i][j][0])){var opt=new Element("option",{value:i}).update(title);$("ribbonDrop_"+this._drops[i][j][0]).insert(opt);}}if($("ribbonDrop_"+i)){$("ribbonDrop_"+i).show();}}for(var i=0;i<this._seeds.length;i++){this._vRibbons[i]=new current.components.video.VideoLanding();this._vRibbons[i].setPlayerPath(this._playerPath);this._vRibbons[i].setFrontController(this._frontController);this._vRibbons[i].setPagePlaylistLimit(7);this._vRibbons[i].setPlaylistTarget("videoRibbonList_"+i);this._vRibbons[i].setPagingId("videoRibbonPaging_"+i);this._vRibbons[i].setIsRibbonPage(true);this._vRibbons[i].setAjaxProgress("ajaxProgress_"+i);this._vRibbons[i].setRibbonDrop("ribbonDrop_"+i);this._vRibbons[i].setRibbonId(i);if(i>0){this._vRibbons[i].setIsFirstRibbon(false);}this._vRibbons[i].init(this._navs[i],this._seeds[i]);}},setDropdowns:function(vpDropdowns){this._drops=vpDropdowns;},setNavElements:function(vpNavElements){this._navs=vpNavElements;},setSeedItems:function(vpSeedItems){this._seeds=vpSeedItems;},setPlayerPath:function(path){this._playerPath=path;},setFrontController:function(fc){this._frontController=fc;},onVideoStateChange:function(state,arg1,arg2){this._vRibbons[this._currentRibbon].onVideoStateChange(state,arg1,arg2);},onRibbonChange:function(id){this._currentRibbon=id;},onRibbonAdvance:function(index){this._currentRibbon++;if(this._currentRibbon>(this._seeds.length-1)){this._currentRibbon=0;}this._vRibbons[this._currentRibbon].onPlaylistClick(0);},isVideoPlaying:function(id,bool){for(var i=0;i<this._seeds.length;i++){if(this._vRibbons[i]){this._vRibbons[i].isVideoPlaying(id,bool);}}}});Object.Event.extend(current.components.video.VideoRibbons);current.components.video.VideoRibbons.getInstance=function(){if(!document.__currentVideoRibbons__){document.__currentVideoRibbons__=new current.components.video.VideoRibbons();}return document.__currentVideoRibbons__;};current.stub("current.components.video");current.components.video.RightRailVideo=Class.create({MOVIE_EMBED_NAME:"videoRightRailVideoEmbed",initialize:function(){this._volume=-1;},init:function(){var video=new current.components.video.RightRailVideoItem(this._data.evalJSON(),0);video.init(this._width,this._height);var asset=null;this._player.innerHTML="";asset=this.__setAsset(video);asset.setAsset();this._player.appendChild(new Element("div",{id:video.id,"class":"videoPlayer",style:""}).insert(asset.getAsset()));asset.init();},setItemData:function(data){this._data=data;},setPlayerSpace:function(id){this._player=$(id);},setPlayerSize:function(w,h){this._width=w;this._height=h;},setMaxPlayerSize:function(maxWidth,maxHeight){this._maxWidth=maxWidth;this._maxHeight=maxHeight;},setFixedHeight:function(fixedHeight){this._fixedHeight=fixedHeight;},setHideLogo:function(hideLogo){this._hideLogo=hideLogo;},setAutoplay:function(autoplay){this._autoplay=autoplay;},setVolume:function(volume){this._volume=volume;},skipLoadTracking:function(value){this._skipLoadTracking=value;},setAdKeywords:function(keywords){this._adKeywords=keywords;},setPageContext:function(pageContext){this._pageContext=pageContext;},onVideoStateChange:function(state,arg1,arg2){if(!this._ignoreVideoStateChange){switch(state){case current.PlayerStates.AUDIO_ON:this.__setSessionAudioFlag();break;default:break;}}},__setAsset:function(item){var asset=new current.components.assets.AssetDisplay(item,this._width,this._height,this._maxWidth,this._maxHeight);asset.setAssetDivId("videoRightRailPlayback");asset.setMovieId(this.MOVIE_EMBED_NAME);asset.setAutoplay(this._autoplay);asset.setDisableEndSlate("true");asset.setEnableMenu("true");asset.setPageContext(this._pageContext);asset.setSkipOverlay("false");asset.setPlayerWidth(this._width);asset.setPlayerHeight(this._height);asset.setFixedHeight(this._fixedHeight);asset.setHideLogo(this._hideLogo);asset.skipLoadTracking(this._skipLoadTracking);asset.useThumbUrl("true");asset.setThumbUrl(item.thumbUrl);asset.setPermalink(item.permalink);asset.setPlayerBgColor("#fff");asset.setVolume(this._volume);asset.setAdKeywords(this._adKeywords);return asset;},__setSessionAudioFlag:function(){setSessionCookie(current.Cookies.PLAYER_AUDIO_ON,-1);}});Object.Event.extend(current.components.video.RightRailVideo);current.components.video.RightRailVideo.getInstance=function(){if(!document.__currentRightRailVideo__){document.__currentRightRailVideo__=new current.components.video.RightRailVideo();}return document.__currentRightRailVideo__;};current.components.video.RightRailVideoItem=Class.create({initialize:function(data,index){this._data=data;this._index=index;},init:function(thumbWidth,thumbHeight){this.index=this._index;this.id=this._data.id;this.contentTitle=this._data.contentTitle;this.contentText=this._data.contentText;this.contentSource=this._data.contentSource;this.contentUrl=this._data.contentUrl;this.pageAsset=this._data.pageAsset;this.addedUser=this._data.addedUser;this.username=this._data.addedUser.username;this.userThumbnail=this._data.addedUser.thumbnail;this.richCommentCount=this._data.richCommentCount;this.assetUrl=this.__getAssetUrl();this.assetWidth=this.__getAssetWidth();this.assetHeight=this.__getAssetHeight();this.assetType=this.__getAssetType();this.itemIsExpired=this.__getItemIsExpired();this.permalink=this.__getPermalink();this.transcodeStatus=this.__getTranscodeStatus();var thumb=new current.components.assets.ThumbUrl(this._data);this.thumbUrl=thumb.getThumbnailBySize(thumbWidth,thumbHeight,".jpg");},__getAssetUrl:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.assetUrl!=null)?this._data.pageAsset.assetUrl:"";},__getAssetType:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.assetType!=null)?this._data.pageAsset.assetType:"I";},__getAssetWidth:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.width!=null)?this._data.pageAsset.width:0;},__getAssetHeight:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.height!=null)?this._data.pageAsset.height:0;},__getItemIsExpired:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.videoRightsExpired!=null)?this._data.pageAsset.videoRightsExpired:false;},__getPermalink:function(){return current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm";},__getTranscodeStatus:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=""&&this._data.pageAsset.transcodeStatus!=null)?this._data.pageAsset.transcodeStatus:0;},__onClick:function(event){Event.stop(event);}});Object.Event.extend(current.components.video.RightRailVideoItem);current.stub("current.components.video");current.components.video.EndSlate=Class.create({initialize:function(player){this._video=$(player);this._target=this._video.next(".vjs-end-slate");this._nextItems=[];this._itemHolders=this._target.down(".slate-items").childElements();this._caption=this._target.down(".slate-items-caption");this._captionArrow=this._target.down(".greenArrowDown");this._replayButton=this._target.down(".replayButton");this._replayButton.observe("click",this.invokePlay.bindAsEventListener(this));},initNextItems:function(slug,start,limit,sort,id){this._setGroup(slug);this._setStart(start);this._setLimit(limit);this._apiReqLimit=parseInt(parseInt(limit)+1);this._setSort(sort);this._contentId=id;},_setLimit:function(limit){this._limit=limit;},_getLimit:function(){return this._limit;},_setGroup:function(group){this._id=group;},_getGroup:function(){return this._id;},_setStart:function(start){this._start=start;},_getStart:function(){return this._start;},_setSort:function(sort){this._sort=sort;},_getSort:function(){return this._sort;},invokePlay:function(event){event.stop();this._video.load();this._video.play();return false;},showEndSlate:function(){this._target.appear({duration:0.25});if(this._nextItems.length<1){this.getNextItems();}},hideEndSlate:function(){this._target.hide();},getNextItems:function(){console.log("getItems: "+this._apiReqLimit);ContentService.fetchItemsFromGroup(this._getGroup(),this._getStart(),this._apiReqLimit,this._getSort(),this.__onItemData.bindAsEventListener(this),this.__onItemDataFail.bindAsEventListener(this));},fillNextItems:function(){var i=0;while(i<this._getLimit()){var item=this._nextItems[i];var holder=this._itemHolders[i];holder.href=item.url;var titleText=item.contentTitle.replace("'","'");titleText=titleText.replace('"','"');holder.rel=titleText;var thumb=new current.components.assets.ThumbUrl(item);holder.down("img").src=thumb.getThumbnailBySize("120","90",".jpg");this._itemHolders[i].observe("mouseover",this.__onItemHover.bindAsEventListener(this));this._itemHolders[i].observe("mouseout",this.__onItemExit.bindAsEventListener(this));i++;}},__onItemData:function(data){if(data.totalCount<1){console.log("0 items returned");return ;}var d=1;for(var i=0;i<this._apiReqLimit;i++){if(data.items[i].id!==this._contentId){console.log("nextItemId: "+i+" "+data.items[i].id);this._nextItems.push(data.items[i]);}}this._nextItems.length=this._getLimit();this.fillNextItems();},__onItemDataFail:function(data){console.log("item data failure");console.log(data);},__onItemHover:function(event){this._caption.update(event.element().up().rel);var leftPos=parseInt(event.element().offsetLeft);leftPos=parseInt(leftPos+57);this._captionArrow.setStyle({left:leftPos+"px"});this._captionArrow.show();},__onItemExit:function(event){this._caption.update("&nbsp;");this._captionArrow.hide();}});current.components.video.EndSlate.getInstance=function(target){if(!document.__videoEndSlate__){document.__videoEndSlate__=new current.components.video.EndSlate(target);}return document.__videoEndSlate__;};Flag=new Class.create({initialize:function(noObserving){this._textareaId="current_flagTextArea";this._submitButtonId="current_flagSubmit";this._open=false;if(!noObserving){this.addFlagLinks($(document.getElementsByTagName("body")[0]));}},addFlagLinks:function(target){target.select(".flaggable").invoke("observe","click",this.__onFlaggableClick.bindAsEventListener(this));},setContentId:function(str){this._contentId=str;},getContentId:function(){return this._contentId;},setContentType:function(str){this._contentType=str;},getContentType:function(){return this._contentType;},__onFlaggableClick:function(event){if(event){if(event.currentTarget){event.preventDefault();}else{event.stop();}}var u=current.User.getInstance();if(!u.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.FLAG);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}this.openFlag();},openFlag:function(){if(this._open){return false;}Control.Modal.open(false,{contents:this.getFlagContents(),width:325,containerClassName:"flagModalContainer",afterOpen:this.__onFlagOpen.bindAsEventListener(this),beforeClose:this.__onFlagClose.bindAsEventListener(this)});return true;},__onFlagOpen:function(event){this._clickListener=this.__onSubmit.bindAsEventListener(this);$("flagSubmitButton").observe("click",this._clickListener);},__onFlagClose:function(){this._open=false;Event.stopObserving($("flagSubmitButton"),"click",this._clickListener);},__onSubmit:function(event){Event.stop(event);if(!Validation.validate($("flagTextarea"))){return ;}var c=this.getContentId();var t=this.getContentType();if(!isUndefined(c)){if(t=="item"){ContentService.flagItem($F("flagTextarea"),c,this.__onFlagComplete.bindAsEventListener(this));}else{if(t=="comment"){ContentService.flagComment($F("flagTextarea"),c,this.__onFlagComplete.bindAsEventListener(this));}else{if(t=="storyline"){ContentService.flagStoryline($F("flagTextarea"),c,this.__onFlagComplete.bindAsEventListener(this));}else{if(t=="scene"){ContentService.flagScene($F("flagTextarea"),c,this.__onFlagComplete.bindAsEventListener(this));}else{if(t=="scenecomment"){ContentService.flagSceneComment($F("flagTextarea"),c,this.__onFlagComplete.bindAsEventListener(this));}}}}}}else{ContentService.flagContent($F("flagTextarea"),document.location.href,this.__onFlagComplete.bindAsEventListener(this));}},__onFlagComplete:function(data){this.__onFlagClose();Control.Modal.close();if(this._open){return false;}Control.Modal.open(false,{contents:this.getFlagConfirmation(),width:325,containerClassName:"flagModalContainer",afterOpen:this.__onFlagConfirmOpen.bindAsEventListener(this),beforeClose:this.__onFlagConfirmClose.bindAsEventListener(this)});return true;},__onFlagConfirmOpen:function(event){this._clickConfirmListener=this.__onConfirmClose.bindAsEventListener(this);$("confirmClose").observe("click",this._clickConfirmListener);},__onFlagConfirmClose:function(){this._open=false;Event.stopObserving($("confirmClose"),"click",this._clickConfirmListener);},getFlagContents:function(){var c='<div class="flagHeader"><h2>'+current.locale.Bundle.get("flagJS.isSomethingInappropriate")+"</h2>\n";c+="<span>"+current.locale.Bundle.get("flagJS.tellUsAboutIt")+"</span></div>";c+='<div class="floatLeft"><textarea id="flagTextarea" class="required validate-max200" maxlength="200"></textarea></div>';c+='<div class="clearBoth floatLeft" style="width: 320px; margin-top: 1.0em;">';c+='<a href="#" id="flagSubmitButton" class="Sprites Button smButton smGrayButton floatLeft" onclick="return false;">'+current.locale.Bundle.get("send")+"</a>";c+='<a href="#" class="Sprites Button smButton smGrayButton floatLeft" onclick="Control.Modal.close(); return false;">'+current.locale.Bundle.get("cancel")+"</a>";c+="</div>";return c;},getFlagConfirmation:function(){var c='<div class="flagHeader"><h2>'+current.locale.Bundle.get("flagJS.flag_received")+'<span class="Sprites flagGreyButton nudgeRight floatRight" style="margin-top: 3px;"></span></h2>\n';c+="<span>"+current.locale.Bundle.get("flagJS.flag_received_text")+"</span></div>";c+='<div class="clearBoth floatLeft" style="width: 320px; margin-top: 1.0em;">';c+='<a href="#" id="confirmClose" class="Sprites Button smButton smGrayButton floatLeft">'+current.locale.Bundle.get("messages.Close")+"</a>";c+="</div>";return c;},__onConfirmClose:function(){Control.Modal.close();}});Object.Event.extend(Flag);Flag.getInstance=function(noObserving){if(!document.__currentFlag__){document.__currentFlag__=new Flag(noObserving);}return document.__currentFlag__;};ShareBuilder=Class.create({initialize:function(target){this.setTargets(target);this._shareItems=new Array();this._setShareList(this._shareItems);this._connectionsLoaded=false;this._recipients=new Array();},addShareList:function(payload,num){var list;var items;var divStyle="";var c=0;if(num==1){list=eval("("+payload+")");items=list.items;c=items.length;}else{if(num==2){items=payload;c=items.length;this.getTarget(2).innerHTML="";divStyle="color: #252525;";this.getTarget(2).up("div").down("h2").innerHTML=c+" recipients <span>(click to remove)</span>";}}if(c>0){for(var i=0;i<c;i++){var item=items[i];var optionClass=(i!=c-1)?"":"last";var option=null;if(item.username!=null){option=new Element("li",{id:item.username+"_"+num+"_li","class":optionClass});var div=new Element("div",{id:item.username+"_"+num+"_div",title:item.username,style:divStyle}).insert(item.username);if(item.thumbnail!=null){var image=new Element("img",{id:item.username+"_"+num+"_thumb",alt:item.username,src:current.Constants.getInstance().getDatanodeUrl()+item.thumbnail+"_16x16.jpg",width:"16",height:"16"});option.insert(image);}option.insert(div);}this.getTarget(num).insert(option);Event.observe(option,"click",this.onOptionSelect.bindAsEventListener(this));}}},onOptionSelect:function(event){var elm=Event.element(event);if(elm.nodeName=="IMG"){elm=elm.up("li").down("div");}else{if(elm.nodeName=="LI"){elm=elm.down("div");}}var l=this.getShareListValues();var inList=false;for(var i=0;i<l.length;i++){if(l[i]==elm.title){inList=true;l.splice(i,1);this._recipients.splice(i,1);if($(elm.title+"_1_li")){$(elm.title+"_1_li").show();}}}if(!inList){var p=l.length;l[p]=elm.title;var r=new Object();r.username=elm.title;r.thumbnail=elm.up("li").down("img").src;if(r.thumbnail.indexOf(current.Constants.getInstance().getDatanodeUrl())!=-1){r.thumbnail=r.thumbnail.replace(current.Constants.getInstance().getDatanodeUrl(),"");}if(r.thumbnail.indexOf("_16x16.jpg")!=-1){r.thumbnail=r.thumbnail.replace("_16x16.jpg","");}this._recipients[p]=r;elm.up("li").hide();}this._shareItems=l;this.setShareListValues();this.addShareList(this._recipients,2);},setTargets:function(target){this._targetConnections="connectionsList_"+target;this._targetEmailAddresses="emailsList_"+target;this._targetTextarea="shareThisTextarea_"+target;this._parentId=target;this.__setObjectId(target);},getTarget:function(num){switch(num){case 1:return $(this._targetConnections);case 2:return $(this._targetEmailAddresses);case 3:return $(this._targetTextarea);default:return(this._parentId);}},__setObjectId:function(objectId){this._objectId=objectId;},__setObjectSlug:function(objectSlug){this._objectSlug=objectSlug;},setShareType:function(type){this._shareType=type;},getShareType:function(){return this._shareType;},setEmailAddresses:function(addresses){this._addresses=addresses.sort();},getEmailAddresses:function(){return this._addresses;},setConnections:function(connections){this._connections=Object.toJSON(connections);},getConnections:function(){return this._connections;},setUserId:function(id){this._userId=id;},getUserDataOnce:function(){if(!this._connectionsLoaded){if(this.getConnections()==null){this.fetchConnections();this._connectionsLoaded=true;}this.showConnections();}},__assembleSharingList:function(){var t=(this.getTarget(3)&&this.getTarget(3).value&&this.getTarget(3).value!=""&&this.getTarget(3).value.indexOf("and/or")==-1)?this.getTarget(3).value.split(", "):new Array();this._shareItems=t;this.setShareListValues();},fetchConnections:function(){SharingService.fetchUserInfoForSharing(current.User.getInstance().getUsername(),0,100,"connectionUserName",this.__onUserConnectionsData.bindAsEventListener(this));},__onUserConnectionsData:function(dataConnections){this.setConnections(dataConnections);this.showConnections();},showConnections:function(){this.addShareList(this.getConnections(),1);},fetchEmailAddresses:function(){SharingService.fetchEmailAddressesForSharing(current.User.getInstance().getUsername(),0,100,this.__onEmailAddressData.bind(this));},__onEmailAddressData:function(dataEmailAddresses){this.setEmailAddresses(dataEmailAddresses);this.showEmailAddresses();},showEmailAddresses:function(){this.addShareList(this.getEmailAddresses(),2);},setShareListValues:function(dataShare){this._setShareList(dataShare);},getShareListValues:function(){return this._shareItems;},_setShareList:function(dataShare){if(this._shareItems.length>0&&this.getTarget(3)){this.getTarget(3).value=this._shareItems.join(", ");}else{this._shareItems=new Array();if(this.getTarget(3)){this.getTarget(3).value="";}}},onClipperSubmit:function(event){$("shareEmailAdresses").value=this.getShareListValues().join(", ");}});function sizeTextarea(textarea){if(document.all&&!window.opera){var iveGrown=false;while((textarea.scrollHeight>textarea.clientHeight)&&(textarea.rows<12)){textarea.rows+=1;iveGrown=true;}if(iveGrown){textarea.scrollTop=0;if(textarea.style){textarea.style.display="none";textarea.style.display="";}try{textarea.focus();}catch(e){}}}else{if(textarea){var numRowsStart=textarea.rows;var newLines=textarea.value.split("\n");var numRowsEnd=1;for(var i=0;i<newLines.length;i++){if(newLines[i].length>100){numRowsEnd+=Math.ceil(newLines[i].length/100);}}numRowsEnd+=newLines.length;if(numRowsEnd>2){textarea.rows=Math.min(numRowsEnd,12);}else{textarea.rows=1;}}}}var counterArray=new Array();var hideCharCountUntilWarning=false;CharacterCounter=new Class.create({initialize:function(opt){hideCharCountUntilWarning=opt;this.__addCounters($(document.getElementsByTagName("body")[0]));this.__activateCounters();},__addCounters:function(){var counterFields=$$(".characterCount");if(counterFields.length<1){return ;}counterFields.each(function(c){var number=c.className;if(number.indexOf("max")!=-1){number=number.substring(number.indexOf("max")+3);if(number.indexOf(" ")!=-1){number=number.substring(0,number.indexOf(" "));}}var countDisplay=new Template(current.locale.Bundle.get("counter.characters_remaining"));var data={count:number};var style=(hideCharCountUntilWarning)?"display: none;":"";var div=new Element("div",{"class":"characterCounter",style:style}).insert("["+countDisplay.evaluate(data)+"]");c.up().appendChild(div);c.observe("keyup",characterCount.bindAsEventListener(this,c,number));c.observe("blur",characterCount.bindAsEventListener(this,c,number));counterArray.push(new Array(this,c,number));});},__activateCounters:function(){for(var i=0;i<counterArray.length;i++){characterCount(counterArray[i][0],counterArray[i][1],counterArray[i][2]);}},addCounter:function(id){var c=$(id);if(c){var number=c.className;if(number.indexOf("max")!=-1){number=number.substring(number.indexOf("max")+3);if(number.indexOf(" ")!=-1){number=number.substring(0,number.indexOf(" "));}}var countDisplay=new Template(current.locale.Bundle.get("counter.characters_remaining"));var data={count:number};var style=(hideCharCountUntilWarning)?"display: none;":"";var div=new Element("div",{"class":"characterCounter",style:style}).insert("["+countDisplay.evaluate(data)+"]");c.up().appendChild(div);c.observe("keyup",characterCount.bindAsEventListener(this,c,number));c.observe("blur",characterCount.bindAsEventListener(this,c,number));counterArray.push(new Array(this,c,number));}}});Object.Event.extend(CharacterCounter);CharacterCounter.getInstance=function(opt){if(!document.__currentCharCount__){if(typeof opt=="undefined"){opt=false;}document.__currentCharCount__=new CharacterCounter(opt);}return document.__currentCharCount__;};function characterCount(obj,textTarget,maximum){if(textTarget.value!=textTarget.title){var len=textTarget.value.length;if(len>maximum){textTarget.value=textTarget.value.substring(0,maximum);len=maximum;}textTarget.next(".characterCounter").down(".count").innerHTML=maximum-len;if(maximum-len<11){textTarget.next(".characterCounter").addClassName("characterCounterWarning");if(hideCharCountUntilWarning){textTarget.next(".characterCounter").show();}}else{textTarget.next(".characterCounter").removeClassName("characterCounterWarning");if(hideCharCountUntilWarning){textTarget.next(".characterCounter").hide();}}}}var Share=Class.create(ShareBuilder,{initialize:function($super,target,slug){$super(target);this._parentId=target;this._shareThis=$("shareThis_"+target);this._open=false;this._submitting=false;this._connectionsLoaded=false;this._slug=(typeof slug=="undefined"||slug==null)?"":slug;this.__setObjectSlug(this._slug);this._modalWidth=715;this._headline=current.locale.Bundle.get("share.invite_a_friend");if(this._slug){this._headline=current.locale.Bundle.get("share.invite_a_friend_to_group");}},openShare:function(event){if(this._open){return false;}this._eventElement=current.utils.Compatibility.getEventElement(event);this._winWidth=document.viewport.getWidth();this._posLeft=parseFloat(parseFloat(parseFloat(this._winWidth)-parseFloat(this._modalWidth))/2);if(this._posLeft<10){this._posLeft=10;}this._posTop=(this._eventElement.cumulativeOffset()["top"]-80);if(this._posTop<80){this._posTop=80;}var wrapper='<div class="accountModalTitle" style="width: 660px;"><a id="shareThisCloseButton_'+this._parentId+'" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="shareModalBody" style="width: 660px;"><br/><img src="'+current.Constants.getInstance().getDatanodeUrl()+'/images/current/icons/loadingIcon.gif"/><br/><br/></div>';if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._posLeft=this._posLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._posLeft,offsetTop:this._posTop,overlayDisplay:false,width:this._modalWidth,closeButton:false,containerClassName:"shareModalContainer",disableWindowObserver:true,afterOpen:this.__onOpen.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});return true;},setShareLink:function(elemId){this._shareLink=elemId;$(this._shareLink).observe("click",this._onShareClick.bindAsEventListener(this));},getShareLink:function(){return this._shareLink;},_onShareClick:function(event){event.stop();if(!$(this._shareLink)){return ;}if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.SHARE);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}this.openShare(event);},_getShareValue:function(){if(this._shareValue==null){this._shareValue=this._shareThis.innerHTML+'<br class="clearBoth"/>';this._shareThis.remove();}return this._shareValue;},__onAjaxLoaded:function(data){$("shareModalBody").update(data.responseText);this._open=true;document.__modalOpenL1__=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});this.setTargets(this._parentId);this._dialogue=$("shareThisDialogue_"+this._parentId);this._submit=$("shareThisSubmitButton_"+this._parentId);this._close=$("shareThisCloseButton_"+this._parentId);this._cancel=$("shareThisCancelButton_"+this._parentId);this._failLink=$("shareThisFailLink_"+this._parentId);this._failClose=$("shareThisFailureClose_"+this._parentId);$(this._submit.id).observe("click",this.submit.bindAsEventListener(this));$(this._close.id).observe("click",this.close.bindAsEventListener(this));$(this._cancel.id).observe("click",this.close.bindAsEventListener(this));if(this._failLink!==null){this._failClose.observe("click",this._onCloseFailureClick.bindAsEventListener(this));this._failLink.observe("click",this.openDialogue.bindAsEventListener(this));}this.getTarget(3).observe("blur",this.__assembleSharingList.bindAsEventListener(this));this.getTarget(3).observe("focus",this.__shareFocus.bindAsEventListener(this));this.getTarget(3).observe("keyup",this.__shareKeyUp.bindAsEventListener(this));$("shareThisMessage_"+this._parentId).observe("keyup",this.__onTextKeyUp.bindAsEventListener(this));this.getTarget(3).resetHint();this.getUserDataOnce();},__onOpen:function(){this._ajaxUrl=current.Constants.getInstance().getScriptName()+"/utils/sharing/form?id="+this._parentId;if(this._slug){this._ajaxUrl=current.Constants.getInstance().getScriptName()+"/utils/sharing/form?id="+this._parentId+"&slug="+this._slug;}new Ajax.Request(this._ajaxUrl,{method:"get",evalJS:false,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});},__shareFocus:function(){if(this._shareItems.length<1){this.getTarget(3).style.color="#000";this.getTarget(3).value="";}sizeTextarea($(this._targetTextarea));},__shareKeyUp:function(){this.getTarget(3).style.color="#000";sizeTextarea($(this._targetTextarea));},__onTextKeyUp:function(){current.utils.Compatibility.adjustRows($("shareThisMessage_"+this._parentId),5);},close:function(event){if(!isUndefined(event)){Event.stop(event);}this.__resetWindow();Control.Modal.close();},__resetWindow:function(){this._draggable.destroy();document.__modalOpenL1__=false;this._shareItems=new Array();this.setShareListValues();this._open=false;this._connectionsLoaded=false;this._submitting=false;this._recipients=new Array();},submit:function(event){event.stop();if(this._submitting||!Validation.validate($("shareThisTextarea_"+this._parentId))||!Validation.validate($("shareThisMessage_"+this._parentId))){return ;}var shareList=this.getShareListValues().join(",");console.log(shareList);if(shareList<1){alert(current.locale.Bundle.get("validate.selection"));return ;}this._targetShareMessage=($("shareThisMessage_"+this._parentId))?$("shareThisMessage_"+this._parentId).value:"";this._submitting=true;if(this.getShareType()=="C"){SharingService.shareItem(this._objectId,current.User.getInstance().getUsername(),shareList,this._targetShareMessage,this.__onShareComplete.bindAsEventListener(this),this.__onShareFail.bindAsEventListener(this));}else{SharingService.shareGroup(this._objectSlug,current.User.getInstance().getUsername(),shareList,this._targetShareMessage,this.__onShareComplete.bindAsEventListener(this),this.__onShareFail.bindAsEventListener(this));}},__onShareComplete:function(data){current.tracking.Track.getInstance().onShare();this.close();},__onShareFail:function(data){var sh=$(this._dialogue).id;var em=new Element("h2",{style:"width: 650px; margin: 0 0 0.5em; color: #900;"}).insert("Whoops! An error ocurred.");$(sh).down(".shareThisContent").insert({before:em});}});var RemoveCredit=Class.create({initialize:function(userId,contentId,creditId){this._userId=userId;this._contentId=contentId;this._creditId=creditId;this._target=$("credit_"+userId);this._parent=$("credit_"+userId);this._u=current.User.getInstance();this.createRemoveLink();},createRemoveLink:function(){var r=new Element("a",{href:"#",title:current.locale.Bundle.get("delete"),"class":"removeMeLink"}).insert(" [x]");this._target.down("span").insert({after:r});Event.observe(r,"click",this.__onSubmitClick.bindAsEventListener(this));},__onSubmitClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}ContentService.unCreditContent(this._contentId,this._creditId,this.__onSubmitComplete.bindAsEventListener(this));},__onSubmitComplete:function(booleanValue){if(booleanValue){this._target.up(".top").remove();}}});SendMessage=new Class.create({initialize:function(){this.addSendMessageLinks($(document.getElementsByTagName("body")[0]));},addSendMessageLinks:function(target){target.select(".sendMessage").invoke("observe","click",this.__onSendMessageClick.bindAsEventListener(this));},__onSendMessageClick:function(event){event.stop();var url=current.Constants.getInstance().getServerName()+event.element().rel;var u=current.User.getInstance();if(!u.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.SEND,true);setTimedCookie(current.Cookies.LOGIN_REDIRECT,url,30);return ;}else{if(!current.User.getInstance().isEmailVerified()){event.stop();new current.components.account.VerifyWindow(event).init();setTimedCookie(current.Cookies.LOGIN_REDIRECT,url,30);return ;}}this.goToInbox(url);},goToInbox:function(url){location.href=url;}});Object.Event.extend(SendMessage);SendMessage.getInstance=function(){if(!document.__currentSendMessage__){document.__currentSendMessage__=new SendMessage();}return document.__currentSendMessage__;};current.stub("current.content.badges");current.content.badges.BadgeCreatePage=Class.create({initialize:function(){this._feedbackClass=".badgeFeedback";this._tempTitle="";this._tempSlug="";this._slugFocus=false;this._titleAvailable=false;},init:function(titleField,slugField){this._titleTarget=titleField;this._slugTarget=slugField;$(this._titleTarget).observe("keyup",this.__onTitleChange.bindAsEventListener(this));$(this._titleTarget).observe("blur",this.__onTitleChange.bindAsEventListener(this));$(this._slugTarget).observe("keyup",this.__onSlugChange.bindAsEventListener(this));$(this._slugTarget).observe("blur",this.__onSlugChange.bindAsEventListener(this));$(this._slugTarget).observe("focus",this.__inspectSlug.bindAsEventListener(this));$(this.getForm()).observe("submit",this.__onSubmit.bindAsEventListener(this));CharacterCounter.getInstance();},setForm:function(form){this._form=form;},getForm:function(){return this._form;},__onTitleChange:function(event){this._tempTitle=event.element().value;var genSlug=this.__slugify(this._tempTitle);$(this._slugTarget).value=genSlug;if(this._tempTitle.length>2){if(!this._slugFocus){this.__checkSlug();}}else{$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._titleTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._titleTarget).up("li").down(this._feedbackClass).show();}},__onSlugChange:function(event){if(this._tempSlug!=$(this._slugTarget).value){this._slugFocus=true;}this._tempSlug=event.element().value;this._tempSlug=this.__slugify(this._tempSlug);$(this._slugTarget).value=this._tempSlug;this.__checkSlug();},__inspectSlug:function(){this._tempSlug=$(this._slugTarget).value;},__checkSlug:function(){if($(this._slugTarget).value.length>2){current.proxy.CCCP.execute("badge","get",{id:$(this._slugTarget).value},this.__onBadgeSlugData.bindAsEventListener(this),this.__onBadgeSlugFail.bindAsEventListener(this),"get");}},__onBadgeData:function(title){if(title==null||title.toLowerCase()!=$(this._titleTarget).value.toLowerCase()){$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._titleTarget).up("li").down(this._feedbackClass).addClassName("green");this._titleAvailable=true;}if(title!=null&&title.toLowerCase()==$(this._titleTarget).value.toLowerCase()){$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._titleTarget).up("li").down(this._feedbackClass).removeClassName("green");this._titleAvailable=false;}$(this._titleTarget).up("li").down(this._feedbackClass).show();},__onBadgeSlugData:function(data){$(this._slugTarget).up("li").down("#badgeSlugFeedback").innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._slugTarget).up("li").down("#badgeSlugFeedback").removeClassName("green");$(this._slugTarget).up("li").down("#badgeSlugFeedback").show();this._titleAvailable=false;this.__onBadgeData(data.title);},__onBadgeSlugFail:function(data){$(this._slugTarget).up("li").down("#badgeSlugFeedback").innerHTML=current.locale.Bundle.get("group.available");$(this._slugTarget).up("li").down("#badgeSlugFeedback").addClassName("green");$(this._slugTarget).up("li").down("#badgeSlugFeedback").show();this._titleAvailable=true;this.__onBadgeData(null);},__onSubmit:function(event){if(!this._titleAvailable){event.stop();return ;}var c=Validation.validate("badgeForm_callout");var n=Validation.validate("badgeForm_notification");if(!c||!n){event.stop();return ;}},__slugify:function(original){original=this.__doLatin1Map(original);original=original.strip().toLowerCase();original=original.toLowerCase();original=original.replace(new RegExp("&[a-z]+;","g")," ");original=original.replace(new RegExp("'","g"),"");original=original.replace(new RegExp("[^ a-z0-9]","g")," ");original=original.strip();original=original.replace(new RegExp("\\s+","g"),"-");return original;},__doLatin1Map:function(original){var key;if(!this.__latin1Search){var concat=null,map={};for(key in this.__latin1Map){var val=this.__latin1Map[key];concat=(concat)?concat+"|"+val:val;map[key]=new RegExp(val,"g");}this.__latin1Search=new RegExp(concat);this.__latin1RegexpMap=map;}if(original.search(this.__latin1Search)!=-1){for(key in this.__latin1RegexpMap){original=original.replace(this.__latin1RegexpMap[key],key);}}return original;},__latin1Map:{A:"\u00C0|\u00C1|\u00C2|\u00C3|\u00C4|\u00C5",AE:"\u00C6",C:"\u00C7",E:"\u00C8|\u00C9|\u00CA|\u00CB",I:"\u00CC|\u00CD|\u00CE|\u00CF",IJ:"\u0132",D:"\u00D0",N:"\u00D1",O:"\u00D2|\u00D3|\u00D4|\u00D5|\u00D6|\u00D8",OE:"\u0152",TH:"\u00DE",U:"\u00D9|\u00DA|\u00DB|\u00DC",Y:"\u00DD|\u0178",a:"\u00E0|\u00E1|\u00E2|\u00E3|\u00E4|\u00E5",ae:"\u00E6",c:"\u00E7",e:"\u00E8|\u00E9|\u00EA|\u00EB",i:"\u00EC|\u00ED|\u00EE|\u00EF",ij:"\u0133",d:"\u00F0",n:"\u00F1",o:"\u00F2|\u00F3|\u00F4|\u00F5|\u00F6|\u00F8",oe:"\u0153",ss:"\u00DF",th:"\u00FE",u:"\u00F9|\u00FA|\u00FB|\u00FC",y:"\u00FD|\u00FF",ff:"\uFB00",fi:"\uFB01",fl:"\uFB02",ffi:"\uFB03",ffl:"\uFB04",ft:"\uFB05",st:"\uFB06"}});current.stub("current.content.badges");current.content.badges.BadgeEditPage=Class.create({initialize:function(prefix){this._feedbackClass=".badgeFeedback";this._tempTitle="";this._tempSlug="";this._slugFocus=false;this._titleAvailable=true;this._imageField=$(prefix+"_image");this._thumbField=$(prefix+"_thumb");this._imageDel=$(prefix+"_deleteImage");this._thumbDel=$(prefix+"_deleteThumb");this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();},init:function(titleField,slugField,image,thumb){this._titleTarget=titleField;this._slugTarget=slugField;this._origTitle=$(this._titleTarget).value;this._origSlug=$(this._slugTarget).value;$(this._titleTarget).observe("keyup",this.__onTitleChange.bindAsEventListener(this));$(this._titleTarget).observe("blur",this.__onTitleChange.bindAsEventListener(this));$(this.getForm()).observe("submit",this.__onSubmit.bindAsEventListener(this));this._image=image;this._thumb=thumb;this.__displayImage(this._image);this.__displayThumb(this._thumb);CharacterCounter.getInstance();},setForm:function(form){this._form=form;},getForm:function(){return this._form;},__displayImage:function(path){if(path==""){return ;}$(this._imageField).hide();$(this._imageField).up().insert(new Element("a",{href:"#",id:"imageRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var imageHolder=new Element("div",{id:"imageHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));imageHolder.insert(new Element("a",{href:"#",id:"imageReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$(this._imageField).up().insert(imageHolder);Event.observe($("imageRevertLink"),"click",this.__hideImageForm.bindAsEventListener(this));Event.observe($("imageReplaceLink"),"click",this.__showImageForm.bindAsEventListener(this));},__hideImageForm:function(){$(this._imageDel).value="false";$(this._imageField).removeClassName("required");$(this._imageField).hide();$("imageRevertLink").hide();if($("advice-required-badgeForm_image")){$("advice-required-badgeForm_image").hide();}$("imageHolder").show();},__showImageForm:function(){$(this._imageDel).value="true";$("imageHolder").hide();$(this._imageField).show();$(this._imageField).addClassName("required");$("imageRevertLink").show();},__displayThumb:function(path){if(path==""){return ;}$(this._thumbField).hide();$(this._thumbField).up().insert(new Element("a",{href:"#",id:"thumbRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var thumbHolder=new Element("div",{id:"thumbHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));thumbHolder.insert(new Element("a",{href:"#",id:"thumbReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete thumb"));$(this._thumbField).up().insert(thumbHolder);Event.observe($("thumbRevertLink"),"click",this.__hideThumbForm.bindAsEventListener(this));Event.observe($("thumbReplaceLink"),"click",this.__showThumbForm.bindAsEventListener(this));},__hideThumbForm:function(){$(this._thumbDel).value="false";$(this._thumbField).removeClassName("required");$(this._thumbField).hide();$("thumbRevertLink").hide();if($("advice-required-badgeForm_thumb")){$("advice-required-badgeForm_thumb").hide();}$("thumbHolder").show();},__showThumbForm:function(){$(this._thumbDel).value="true";$("thumbHolder").hide();$(this._thumbField).show();$(this._thumbField).addClassName("required");$("thumbRevertLink").show();},__onTitleChange:function(event){this._tempTitle=event.element().value;if(this._tempTitle.length>2){if(!this._slugFocus){this.__checkSlug();}}else{$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._titleTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._titleTarget).up("li").down(this._feedbackClass).show();}},__checkSlug:function(){var genSlug=this.__slugify(this._tempTitle);current.proxy.CCCP.execute("badge","get",{id:genSlug},this.__onBadgeSlugData.bindAsEventListener(this),this.__onBadgeSlugFail.bindAsEventListener(this),"get");},__onBadgeData:function(title){if(title==null||title.toLowerCase()!=$(this._titleTarget).value.toLowerCase()||title.toLowerCase()==this._origTitle.toLowerCase()){$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._titleTarget).up("li").down(this._feedbackClass).addClassName("green");this._titleAvailable=true;}else{if(title!=null&&title.toLowerCase()==$(this._titleTarget).value.toLowerCase()){$(this._titleTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._titleTarget).up("li").down(this._feedbackClass).removeClassName("green");this._titleAvailable=false;}}$(this._titleTarget).up("li").down(this._feedbackClass).show();},__onBadgeSlugData:function(data){this.__onBadgeData(data.title);},__onBadgeSlugFail:function(data){this._titleAvailable=true;this.__onBadgeData(null);},__onSubmit:function(event){if(!this._titleAvailable){event.stop();return ;}var c=Validation.validate("badgeForm_callout");var n=Validation.validate("badgeForm_notification");if(!c||!n){event.stop();return ;}},__slugify:function(original){original=this.__doLatin1Map(original);original=original.strip().toLowerCase();original=original.toLowerCase();original=original.replace(new RegExp("&[a-z]+;","g")," ");original=original.replace(new RegExp("'","g"),"");original=original.replace(new RegExp("[^ a-z0-9]","g")," ");original=original.strip();original=original.replace(new RegExp("\\s+","g"),"-");return original;},__doLatin1Map:function(original){var key;if(!this.__latin1Search){var concat=null,map={};for(key in this.__latin1Map){var val=this.__latin1Map[key];concat=(concat)?concat+"|"+val:val;map[key]=new RegExp(val,"g");}this.__latin1Search=new RegExp(concat);this.__latin1RegexpMap=map;}if(original.search(this.__latin1Search)!=-1){for(key in this.__latin1RegexpMap){original=original.replace(this.__latin1RegexpMap[key],key);}}return original;},__latin1Map:{A:"\u00C0|\u00C1|\u00C2|\u00C3|\u00C4|\u00C5",AE:"\u00C6",C:"\u00C7",E:"\u00C8|\u00C9|\u00CA|\u00CB",I:"\u00CC|\u00CD|\u00CE|\u00CF",IJ:"\u0132",D:"\u00D0",N:"\u00D1",O:"\u00D2|\u00D3|\u00D4|\u00D5|\u00D6|\u00D8",OE:"\u0152",TH:"\u00DE",U:"\u00D9|\u00DA|\u00DB|\u00DC",Y:"\u00DD|\u0178",a:"\u00E0|\u00E1|\u00E2|\u00E3|\u00E4|\u00E5",ae:"\u00E6",c:"\u00E7",e:"\u00E8|\u00E9|\u00EA|\u00EB",i:"\u00EC|\u00ED|\u00EE|\u00EF",ij:"\u0133",d:"\u00F0",n:"\u00F1",o:"\u00F2|\u00F3|\u00F4|\u00F5|\u00F6|\u00F8",oe:"\u0153",ss:"\u00DF",th:"\u00FE",u:"\u00F9|\u00FA|\u00FB|\u00FC",y:"\u00FD|\u00FF",ff:"\uFB00",fi:"\uFB01",fl:"\uFB02",ffi:"\uFB03",ffl:"\uFB04",ft:"\uFB05",st:"\uFB06"}});current.stub("current.content.configure");current.content.configure.AdSlotConfigurePage=Class.create({LIST_KEY:"FE_config_list",initialize:function(paramName,paramValue,paramStatus){this._select=paramName;this._status=$(paramStatus);this._value=$(paramValue);this._value.value="";this._value.up("form").observe("submit",this.__onFormSubmit.bindAsEventListener(this,0));$(this._select).selectedIndex=0;$(this._select).observe("change",this.__onParamNameChange.bindAsEventListener(this));if($("manual")){$("manual").observe("click",this.__onManualShift.bindAsEventListener(this));}if($("reselect")){$("reselect").observe("click",this.__onReselect.bindAsEventListener(this));}if($("manualSave")){$("manualSave").observe("click",this.__onFormSubmit.bindAsEventListener(this,1));}this._resizeable=false;this._currentSlot="";this._state=false;},__onFormSubmit:function(event,bool){event.stop();if(!this._hasValue){return ;}var vw=Validation.validate("width");var vh=Validation.validate("height");var vr=Validation.validate("refresh");if(!vw||!vh||!vr){return ;}var currentSet=((this._value.value!="")?this._value.value.evalJSON():new Object());if(typeof currentSet=="undefined"){return ;}var useThisParamValue=this._value.value;if(!this._value.visible()){var obj=new Object();obj.show=(($("show").checked)?"true":"false");obj.w=Math.abs(parseInt($("width").value));obj.h=Math.abs(parseInt($("height").value));obj.expand=(($("expand").checked)?"true":"false");obj.type=$("adtype")[$("adtype").selectedIndex].value;obj.refreshMs=Math.abs(parseInt($("refresh").value));if(this._currentSlot=="TopEdge"){currentSet.TopEdge=obj;}if(this._currentSlot=="Top"){currentSet.Top=obj;}if(this._currentSlot=="Top1"){currentSet.Top1=obj;}if(this._currentSlot=="Right"){currentSet.Right=obj;}if(this._currentSlot=="Right1"){currentSet.Right1=obj;}if(this._currentSlot=="Bottom"){currentSet.Bottom=obj;}if(this._currentSlot=="Buzzbox"){obj.scriptCode=$("scriptCode").value;currentSet.Buzzbox=obj;}useThisParamValue=Object.toJSON(currentSet);}current.proxy.CCCP.execute("data","config_post",{paramName:this._name,paramValue:useThisParamValue},this.__onSaveSuccess.bindAsEventListener(this,bool),this.__onSaveFail.bindAsEventListener(this));},__onSaveSuccess:function(data,bool){this._status.update("SAVED");this._hasValue=true;this._value.value=(data===undefined||data==null)?"":data;this.__adsInit(data);if(bool){$("currentSlot").innerHTML=this._name;this.__deactivateAds();$("configureInputs").hide();this.__resetForm();}},__onSaveFail:function(data){this._status.update("FAILED");},__onParamNameChange:function(event){this._name=event.element().options[event.element().selectedIndex].innerHTML;this._value.value="";this._hasValue=false;if(event.element().selectedIndex==0){return ;}this.__resetAds();current.proxy.CCCP.execute("data","config",{paramName:this._name},this.__onConfigData.bindAsEventListener(this));this._status.update("FETCHING");},__onConfigData:function(data){this._hasValue=true;this._value.value=(data===undefined||data==null)?"":data;this._status.update("");$("currentSlot").innerHTML=this._name;if(this._name!="player_ads"){$("configurationBox").show();this.__adsInit(data);if(!this._state){this.__awakenAds();}}else{$("configurationBox").hide();$(this._select).hide();$(this._select).up().down("h3").show();this._value.show();$("manualSave").show();$("assignmentContainer").show();}},__adsInit:function(data){if(navigator.appVersion.indexOf("AppleWebKit")>0&&typeof data==="object"){data=null;}var currentSet=((typeof data=="undefined"||data==null||data=="")?new Object():data.evalJSON());$(this._select).hide();$(this._select).up().down("h3").show();this.__fillInAdSlotInfo("TopEdge",currentSet.TopEdge);this.__fillInAdSlotInfo("Top",currentSet.Top);this.__fillInAdSlotInfo("Top1",currentSet.Top1);this.__fillInAdSlotInfo("Right",currentSet.Right);this.__fillInAdSlotInfo("Right1",currentSet.Right1);this.__fillInAdSlotInfo("Bottom",currentSet.Bottom);this.__fillInAdSlotInfo("Buzzbox",currentSet.Buzzbox);if(this._name.indexOf("items")!=-1){$("scaryBox").show();}},__onReselect:function(event){event.stop();this.__resetAds();this.__resetForm();$("currentSlot").innerHTML="";$(this._select).up().down("h3").hide();this._status.update("");$(this._select).show();this.__deactivateAds();this.__killAds();if(this._value.visible()){this.__onManualShift(event);}Effect.Appear("configurationBox");$(this._select).selectedIndex=0;},__updateAdDim:function(id){var el=$(id);el.up(".ad").down(".displayDim").innerHTML=", "+el.getWidth()+" x "+el.getHeight();if($("width")){$("width").value=el.getWidth();}if($("height")){$("height").value=el.getHeight();}},__resetAds:function(){$$(".adSlot").each(function(a){a.removeClassName("on");a.removeClassName("active");});$$(".adDisplay").each(function(d){d.innerHTML="";});$("configureInputs").hide();$("scaryBox").hide();this.__resetForm();},__deactivateAds:function(){$$(".adSlot").each(function(a){a.removeClassName("active");a.up(".ad").down("h3").removeClassName("hilite");});},__awakenAds:function(){$$(".adSlot").each(function(a){a.removeClassName("dead");a.up(".ad").down("h3").removeClassName("dead");});$("assignmentContainer").show();},__killAds:function(){$$(".adSlot").each(function(a){a.addClassName("dead");a.up(".ad").down("h3").addClassName("dead");});},__resetForm:function(){$("show").checked=false;$("width").value=0;$("height").value=0;$("expand").checked=false;$("adtype").selectedIndex=0;$("refresh").value=0;$("scriptCode").value="";},__onAdSlotSelect:function(event,obj){var el=event.element();this.__resetForm();this.__deactivateAds();el.addClassName("active");el.up(".ad").down("h3").addClassName("hilite");this._status.update("");Effect.Appear("configureInputs");$("currentSlot").innerHTML=this._name+" &raquo; "+el.id;this.__fillInConfigInputs(el.id,obj);this._currentSlot=el.id;},__fillInAdSlotInfo:function(id,obj){if($(id)&&obj){if(obj.show&&obj.show=="true"){$(id).addClassName("on");$(id).up(".ad").down(".displayState").innerHTML="on";}else{$(id).removeClassName("on");$(id).up(".ad").down(".displayState").innerHTML="off";}if(obj.expand&&obj.expand=="true"){$(id).up(".ad").down(".displayExpand").innerHTML=", expandable";}else{$(id).up(".ad").down(".displayExpand").innerHTML="";}if(obj.type){$(id).up(".ad").down(".displayType").innerHTML=", "+obj.type;}if(obj.w&&obj.h){$(id).up(".ad").down(".displayDim").innerHTML=", "+obj.w+"&nbsp;x&nbsp;"+obj.h;}if(obj.refreshMs===0||(obj.refreshMs&&obj.refreshMs.toString()!="undefined")){$(id).up(".ad").down(".displayRefresh").innerHTML=", "+obj.refreshMs+"&nbsp;ms";}$(id).observe("click",this.__onAdSlotSelect.bindAsEventListener(this,obj));}else{if($(id)){$(id).removeClassName("on");$(id).up(".ad").down(".displayState").innerHTML="";$(id).up(".ad").down(".displayExpand").innerHTML="";$(id).up(".ad").down(".displayType").innerHTML="";$(id).up(".ad").down(".displayDim").innerHTML="";$(id).up(".ad").down(".displayRefresh").innerHTML="";$(id).observe("click",this.__onAdSlotSelect.bindAsEventListener(this,null));}}},__fillInConfigInputs:function(id,obj){if(obj==null){this.__resetForm();return ;}if(obj.show&&obj.show=="true"){$("show").checked=true;}if(obj.expand&&obj.expand=="true"){$("expand").checked=true;}if(obj.type){if(obj.type=="js"){$("adtype").selectedIndex=1;}if(obj.type=="iframe"){$("adtype").selectedIndex=2;}}if(obj.w&&obj.h){$("width").value=obj.w;$("height").value=obj.h;}if(obj.refreshMs===0||(obj.refreshMs&&obj.refreshMs.toString()!="undefined")){$("refresh").value=obj.refreshMs;}if(obj.scriptCode){$("scriptCode").value=obj.scriptCode;}},__onManualShift:function(event){if(event!=null){event.stop();}this._value.toggle();$("manualSave").toggle();if($("configureInputs").visible()){Effect.Fade("configureInputs");$("currentSlot").innerHTML=this._name;this.__resetForm();this.__deactivateAds();}}});current.stub("current.content.configure");current.content.configure.ConfigurePage=Class.create({LIST_KEY:"FE_config_list",initialize:function(paramName,paramValue,paramStatus){this._status=$(paramStatus);this._value=$(paramValue);this._value.value="";this._value.up("form").observe("submit",this.__onFormSubmit.bindAsEventListener(this));$(paramName).selectedIndex=0;$(paramName).observe("change",this.__onParamNameChange.bindAsEventListener(this));},__onFormSubmit:function(event){event.stop();if(!this._hasValue){return ;}current.proxy.CCCP.execute("data","config_post",{paramName:this._name,paramValue:this._value.value},this.__onSaveSuccess.bindAsEventListener(this),this.__onSaveFail.bindAsEventListener(this));},__onSaveSuccess:function(data){this._status.update("SAVED");},__onSaveFail:function(data){this._status.update("FAILED");},__onParamNameChange:function(event){this._name=event.element().options[event.element().selectedIndex].innerHTML;this._value.value="";this._hasValue=false;if(event.element().selectedIndex==0){return ;}current.proxy.CCCP.execute("data","config",{paramName:this._name},this.__onConfigData.bindAsEventListener(this));this._status.update("FETCHING");},__onConfigData:function(data){this._hasValue=true;this._value.value=(data===undefined||data==null)?"":data;this._status.update("");}});current.stub("current.content.configure");current.content.configure.CachePage=Class.create({initialize:function(paramPrefixText,paramPrefixSelect,paramName,paramValue,paramStatus,getButton,deleteButton){this._pTxt=$(paramPrefixText);this._pSel=$(paramPrefixSelect);this._key=$(paramName);this._status=$(paramStatus);this._value=$(paramValue);this._value.value="";this._verb="get";$(getButton).observe("click",this.__cacheGet.bindAsEventListener(this));$(deleteButton).observe("click",this.__cacheDelete.bindAsEventListener(this));},_getPrefix:function(){var pFix=($(this._pTxt).value!="")?$(this._pTxt).value:$(this._pSel).options[$(this._pSel).selectedIndex].value;return pFix.gsub("/","--");},__onSuccess:function(data){Effect.Pulsate(this._status,{pulses:2,duration:1});this.__onData(data);},__onFailure:function(data){this._status.update("FAILED");Effect.Pulsate(this._status,{pulses:5,duration:1.5});},__cacheGet:function(event){this._value.value="";this._verb="get";if(!this._key.value.empty()){this.__AjaxRequest(this._verb,this._key.value);}else{this.__onFailure("");}},__cacheDelete:function(event){this._value.value="";this._verb="delete";if(!this._key.value.empty()){this.__AjaxRequest(this._verb,this._key.value);}else{this.__onFailure("");}},__AjaxRequest:function(verb,key){new Ajax.Request(current.Constants.getInstance().getScriptName()+"/cache/proxy/"+verb+"/"+this._getPrefix()+"/"+key.gsub("/","--"),{method:"get",evalJS:false,onSuccess:this.__onSuccess.bindAsEventListener(this),onFailure:this.__onFailure.bindAsEventListener(this)});this._status.update("WORKING");},__onData:function(data){this._hasValue=true;this._value.value=(data===undefined)?"":data.responseText;if(data.responseText!="-1"){if(this._verb=="delete"){this._status.update("DELETED");}else{this._status.update("RETRIEVED");}}else{this._value.value="";this._status.update("NOT FOUND");}}});current.stub("current.content.configure");current.content.configure.UserSessionPage=Class.create({initialize:function(paramName,paramValue,paramStatus,pokeButton,kickButton){this._key=$(paramName);this._status=$(paramStatus);this._value=$(paramValue);this._verb="get";$(pokeButton).observe("click",this.__userPoke.bindAsEventListener(this));$(kickButton).observe("click",this.__userKick.bindAsEventListener(this));},__onSuccess:function(data){Effect.Pulsate(this._value,{pulses:1,duration:0.5});this.__onData(data);},__onFailure:function(data){this._status.update("AJAX ERROR");Effect.Pulsate(this._value,{pulses:1,duration:0.5});Effect.Pulsate(this._status,{pulses:5,duration:1.5});},__userKick:function(event){this._value.value="";this._verb="kick";if(!this._key.value.empty()){this.__AjaxRequest(this._verb,this._key.value);}else{this.__onFailure("");}},__userPoke:function(event){this._value.value="";this._verb="poke";if(!this._key.value.empty()){this.__AjaxRequest(this._verb,this._key.value);}else{this.__onFailure("");}},__AjaxRequest:function(verb,key){new Ajax.Request(current.Constants.getInstance().getScriptName()+"/cache/users/"+verb+"/"+key,{method:"get",evalJS:false,onSuccess:this.__onSuccess.bindAsEventListener(this),onFailure:this.__onFailure.bindAsEventListener(this)});this._status.update("WORKING");},__onData:function(data){this._hasValue=true;$(this._status).update("");$(this._value).update((data===undefined)?"":data.responseText);}});current.stub("current.content.configure");current.content.configure.SystemTagManager=Class.create({initialize:function(paramName,paramValue,tagSubmitButton,changeTagButton,group,channelListing,paramStatus){this._chooser=$(paramName);this._value=$(paramValue);this._status=$(paramStatus);this._groupSlug=$(group);this._channelListing=$(channelListing);this._sortActionButton=$("submitSortedList");this._bulkTagGroups=$("bulkTagLink");this._tagId=0;this._hasValue=false;this._hasGroupValue=false;this._value.value="";this._groupSlug.value="";this._sortActionButton.observe("click",this.__onSubmitSortClick.bindAsEventListener(this));this._chooser.observe("change",this.__onParamNameChange.bindAsEventListener(this));this._chooser.up("form").observe("submit",this.__onFormSubmit.bindAsEventListener(this));this._bulkTagGroups.observe("click",this.bulkTagGroups.bindAsEventListener(this));},setGroupSlug:function(idVal){this._groupSlug.value=idVal;if(idVal!=null&&idVal!=""){this._hasGroupValue=true;}},__onFormSubmit:function(event){event.stop();if(!this._hasGroupValue){return ;}var pos="";var listLen=Sortable.sequence("channelListing").length;if(listLen>0){pos=listLen;}current.proxy.CCCP.execute("tag","groups_post",{id:this._tagId,groupSlug:this._groupSlug.value,state:"system",action:"add",pos:pos},this.__onSaveSuccess.bindAsEventListener(this),this.__onSaveFail.bindAsEventListener(this));},__onParamNameChange:function(event){this._name=event.element().options[event.element().selectedIndex].innerHTML;this._value.value=event.element().options[event.element().selectedIndex].value;this._hasValue=false;if(event.element().selectedIndex==0){return ;}this._tagName=this._name;this.__onConfigData(this._value.value);this._status.update("FETCHING");},__onConfigData:function(data){this._value.value=(data===undefined)?"":data;$("tagName").innerHTML=this._tagName;this._channelListing.innerHTML="";this._hasValue=true;if(data==null||data==""){this.__setUpTagMissing();this._status.update('<span style="color: #f00;">The desired system tag does not appear to be set.</span>');}else{this._status.update("");this.__setUpTagPresent();this._tagId=this._value.value;this.__getCurrentChannels();}},__getCurrentChannels:function(){current.proxy.CCCP.execute("tag","groups",{id:this._tagId,state:"system",sort:"sortNum"},this.__onCurrentChannelData.bindAsEventListener(this));},__onCurrentChannelData:function(data){this._sortActionButton.hide();var logList="";if(data!=null){this._status.update("");for(var i=0;i<data.length;i++){logList+=data[i].slug+",";var newGroup=new current.content.configure.Systemtag(data[i]);this._channelListing.appendChild(newGroup.init());}this._addDeChannelLinks(this._channelListing);Sortable.create("channelListing",{handles:$$("#channelListing .voteActionIcon"),onUpdate:this.__onChannelListSort.bindAsEventListener(this)});console.log(this._tagId+" => "+logList);}else{this._status.update("No associated groups found.");}},__onChannelListSort:function(){this._sortActionButton.show();},_addDeChannelLinks:function(target){target.select(".deChannel").invoke("observe","click",this.__deChannelGroup.bindAsEventListener(this));},__onSaveSuccess:function(data){this._clearTagCache();this._status.update("Group has been tagged.");this.__onConfigData(this._value.value);},__onSaveFail:function(data){this._status.update("FAILED");},__onSortSuccess:function(data){this._clearTagCache();this._status.update("Group order has been saved.");},__setUpTagPresent:function(){this._value.addClassName("readOnly");this._value.disable();$("groupSelector").value="";$("groupId").value="";$("tagSelect").show();$("groupSelect").show();$("groupIdSelect").show();$("channelSubmit").show();},__setUpTagMissing:function(){this._value.removeClassName("readOnly");this._value.enable();$("tagSelect").show();$("groupSelect").hide();$("groupIdSelect").hide();$("channelSubmit").hide();},__deChannelGroup:function(event){event.stop();if(confirm("This will remove the Group from this list. Are you sure you wish to do so?")){var el=event.element();var slugs=Sortable.sequence("channelListing");var slugsNew=slugs.reject(function(s){return s==el.rel;});slugsNew=slugsNew.join(",");current.proxy.CCCP.execute("tag","groups_post",{id:this._tagId,groupSlugs:slugsNew,state:"system",action:"set"},this.__onDeChannelData.bindAsEventListener(this,el),this.__onSaveFail.bindAsEventListener(this));}},__onDeChannelData:function(data,el){if(data==true){this._clearTagCache();this._status.update("group removed");this.__onConfigData(this._value.value);}else{this._status.update("THERE WAS AN ERROR");}},bulkTagGroups:function(){var groupList=prompt("Paste a comma-separated list of the group slugs you wish to tag. THIS WILL REPLACE ALL EXISTING LISTED GROUPS FOR THIS TAG:");if(groupList==""){alert("At least one group required");return ;}else{if(groupList==null){return ;}}current.proxy.CCCP.execute("tag","groups_post",{id:this._tagId,groupSlugs:groupList,state:"system",action:"set"},this.__onSaveSuccess.bindAsEventListener(this),this.__onSaveFail.bindAsEventListener(this));},__onSubmitSortClick:function(event){event.stop();var slugs=Sortable.sequence("channelListing").join(",");current.proxy.CCCP.execute("tag","groups_post",{id:this._value.value,groupSlugs:slugs,state:"system",action:"set"},this.__onSortSuccess.bindAsEventListener(this),this.__onSaveFail.bindAsEventListener(this));},_clearTagCache:function(){var ccUrl=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/configure/poke_systemtags/"+this._tagId;new Ajax.Request(ccUrl,{onSuccess:function(data){console.log(data.responseText);}});}});current.content.configure.Systemtag=Class.create({initialize:function(data){this._data=data;},init:function(){var titleText=this._data.name.replace("'","'");titleText=titleText.replace('"','"');var href=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+this._data.slug+"/";var li=new Element("li",{id:"group_"+this._data.slug});var handle=new Element("div",{"class":"Sprites floatLeft voteActionIcon",style:"margin-right: 0.5em; cursor: move;"});li.insert(handle);var h2=new Element("h2",{"class":"floatLeft"}).insert(new Element("a",{title:titleText,href:href}).insert(this._data.name));li.insert(h2);var deChannelButton=new Element("div",{"class":"deChannelButton floatLeft",style:"padding-left: 1.0em;"});var deChannelLink=new Element("a",{id:"deChannel_"+this._data.id,rel:this._data.slug,href:"#","class":"deChannel floatLeft",style:"color: #f00;",target:"_blank"}).insert("X");deChannelButton.insert(deChannelLink);li.insert(deChannelButton);return li;}});Object.Event.extend(current.content.configure.Systemtag);current.stub("current.content.groups");current.content.groups.GroupPage=Class.create({initialize:function(closed,slug){this._isClosedGroup=closed;this._joinButton=$("joinButton");this._simpleFollowLink=$("simpleFollowLink");this._sumbitButton=$("addToGroupButton");this._page=current.site.Page.getInstance();this._userId=current.User.getInstance().getId();this._groupId=current.site.Page.getInstance().getId();this._slug=slug;this._adminLink=$("administerGroupLink");this._adminLink2=$("administerGroupLandingLink");this._landingMessagePostlink=($("newGroupPostLink"))?$("newGroupPostLink"):null;this._suggestHeaderlink=($("suggestHeader"))?$("suggestHeader").down("a"):null;this._leaveGroupLink=$("leaveGroupLink");this._simpleUnfollowLink=$("simpleUnfollowLink");this._studiosFollowLink=$("studiosFollowLink");this._updatesLink=$("updatesLink");this._inviteLink=$("groupInviteLink");this._updatesLinkArrow=$("updatesLinkArrow");this._closeMessageLink=$("yellowBoxCloseButton");this._messageGroupLink=$("messageGroupLink");this._groupPostLink=$("groupPostLink");this._shareList=$H();this._sharing=$H();this._assignmentId=0;this._assignmentSource="";this._assignmentTitle="";this._isStudios=false;this._studiosFollowLinkHoverObserver=this.__onFollowingHover.bindAsEventListener(this);this._studiosFollowLinkExitObserver=this.__onFollowingExit.bindAsEventListener(this);},getSlug:function(){return this._slug;},setOwner:function(bool){this._isOwner=bool;},setModerator:function(bool){this._isModerator=bool;},setMember:function(bool){this._isMember=bool;},setClassifierGroup:function(id){this._pClassGroup=id;},getClassifierGroup:function(){return this._pClassGroup;},setClassifierGroupSlug:function(str){this._pClassGroupSlug=str;},getClassifierGroupSlug:function(){return this._pClassGroupSlug;},setChallenge:function(bool){this._isStudios=bool;},setQuickAddLinks:function(linkClass){this._qaLinkClass=linkClass;},setAddContentLinks:function(targets){var scope=this;$$("."+targets).each(function(l){l.observe("click",scope.__onAddContentClick.bindAsEventListener(scope));});},setAssignmentId:function(id){this._assignmentId=id;},setAssignmentSource:function(src){this._assignmentSource=src;},setAssignmentTitle:function(title){this._assignmentTitle=title;},init:function(){Flag.getInstance();if($$("body.studios")){this._isStudios=true;}if(this._landingMessagePostlink!=null){this._landingMessagePostlink.observe("click",this.__onAddContentClick.bindAsEventListener(this));}if(this._suggestHeaderlink!=null){this._suggestHeaderlink.observe("click",this.__onAddContentClick.bindAsEventListener(this));}if(this._joinButton!=null){this._joinButton.observe("click",this.__onJoinClick.bindAsEventListener(this,1));}if(this._simpleFollowLink!=null){this._simpleFollowLink.observe("click",this.__onJoinClick.bindAsEventListener(this,0));}if(this._adminLink!=null){this._adminLink.observe("click",this.__onAdminClick.bindAsEventListener(this));}if(this._adminLink2!=null){this._adminLink2.observe("click",this.__onAdminClick.bindAsEventListener(this));}if(this._leaveGroupLink!=null){this._leaveGroupLink.observe("click",this.__onLeaveClick.bindAsEventListener(this,1));}if(this._simpleUnfollowLink!=null){this._simpleUnfollowLink.observe("click",this.__onLeaveClick.bindAsEventListener(this,0));}if(this._studiosFollowLink!=null){this._studiosFollowLink.observe("click",this.__onStudiosFollowLinkClick.bindAsEventListener(this));if(this._studiosFollowLink.hasClassName("active")){this._studiosFollowLink.observe("mouseover",this._studiosFollowLinkHoverObserver);this._studiosFollowLink.observe("mouseout",this._studiosFollowLinkExitObserver);}}if(this._closeMessageLink!=null){this._closeMessageLink.observe("click",this.__removeWelcomeMessage.bindAsEventListener(this));}if(this._messageGroupLink!=null){this._messageGroupLink.observe("click",this.__onComposeMessageClick.bindAsEventListener(this));}if(this._inviteLink!=null){this._inviteLink.observe("click",this.__onInviteClick.bindAsEventListener(this));}if(this._groupPostLink!=null){this._groupPostLink.observe("click",this.__onAddContentClick.bindAsEventListener(this));}if(this._updatesLink!=null){this._buildUpdates();}this._doVotingSetup();this._execDelayedJoin();this._addGroupSharingLinks($(document.getElementsByTagName("body")[0]),".groupSharingMenuLink","page");this._addGroupSharingLinks($(document.getElementsByTagName("body")[0]),".groupSharingItemLink","rel");},__onComposeMessageClick:function(event){messenger=MessagingPortableController.getInstance();messenger.init("composeForm","group");messenger.setGroupSlug(this._slug);messenger.setGroupTitle(this._page.getContentTitle().unescapeHTML());messenger.composeToGroup(event);},__onInviteClick:function(event){this._shareOne=null;this._shareOne=new Share(this._groupId,this._slug);this._shareOne.setShareType("I");this._shareOne.setUserId(this._userId);this._shareOne.setShareLink(event.element());this._shareOne._onShareClick(event);},_execDelayedJoin:function(){if(/\#joinGroup/.exec(document.location.href)){if(!current.User.getInstance().isLoggedIn()||!current.User.getInstance().isEmailVerified()||current.Constants.getInstance().isReadOnlyMode()){return ;}this.__execJoin(true);}},_buildUpdates:function(){try{if(this._updatesLink){this._updatesLink.observe("click",this.__onUpdatesClick.bindAsEventListener(this));}if(this._updatesLinkArrow){this._updatesLinkArrow.observe("click",this.__onUpdatesClick.bindAsEventListener(this));}}catch(e){}},__onUpdatesClick:function(event){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var updatesWindow=new current.components.groups.UpdatesWindow(event,this._slug,(event.element().cumulativeOffset()["left"]-125),(event.element().cumulativeOffset()["top"]+12));updatesWindow.init();},__onAdminClick:function(event){if(!current.User.getInstance().isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP);return ;}if(!current.Authorize.checkWriteMode(event)){event.stop();return ;}},__onAddClick:function(event){if(!current.User.getInstance().isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP,true);return ;}if(!current.Authorize.checkWriteMode(event)){event.stop();return ;}},__onFollowingHover:function(event){event.element().update(current.locale.Bundle.get("unfollow"));},__onFollowingExit:function(event){event.element().update(current.locale.Bundle.get("following"));},__onStudiosFollowLinkClick:function(event){if(event.element().hasClassName("active")){this.__onLeaveClick(event,0);}else{this.__onJoinClick(event,0);}},__onJoinClick:function(event,bool){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.JOIN,true);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}this.__execJoin(bool);},__execJoin:function(bool){var _user=current.User.getInstance();current.proxy.CCCP.execute("user","get",{id:_user.getName()},this.__onUserData.bindAsEventListener(this,bool),"get");},__onUserData:function(data,bool){current.tracking.Track.getInstance().onGroupJoin(this._slug);this._username=data.username;this._userThumbnail=data.thumbnail;var param={id:this._slug,username:current.User.getInstance().getName(),action:"add"};current.proxy.CCCP.execute("group","join_group",param,this.__onJoinData.bindAsEventListener(this,bool),this.__onJoinFail.bindAsEventListener(this,bool));},__onJoinData:function(data,bool){if(isUndefined(data)||typeof data!="boolean"){data=false;}this._isMember=(String(data)==="true");var li=null;if(this._isMember){var _user=current.User.getInstance();var leaveLink=null;if(!bool){if(!this._isStudios){li=$("controls");li.innerHTML="";leaveLink=new Element("a",{href:"#",id:"leaveGroupLink",rel:"nofollow"});leaveLink.insert(new Element("span",{"class":""}).insert(current.locale.Bundle.get("group.leave_group")));li.insert(leaveLink);leaveLink.observe("click",this.__onLeaveClick.bindAsEventListener(this,bool));}else{console.log("follow");var flink=$("studiosFollowLink");flink.addClassName("active");flink.update(current.locale.Bundle.get("following"));leaveLink=flink;leaveLink.observe("mouseover",this._studiosFollowLinkHoverObserver);leaveLink.observe("mouseout",this._studiosFollowLinkExitObserver);}}else{li=this._joinButton.up("li");li.innerHTML="";var div=new Element("div",{id:"groupInteractPanel"});div.insert(new Element("em",{"class":"member"}).insert(current.locale.Bundle.get("group.you_are_a_member")));if(!this._isClosedGroup){var add=new Element("div",{id:"groupAddPanel"});var a=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/clipper.htm?groupSlug="+encodeURIComponent(this._slug),id:"addToGroupButton",rel:"nofollow","class":"Sprites Button lgButton lgBlueButton floatLeft groupAddButton",title:current.locale.Bundle.get("group.post_a_story")}).insert(current.locale.Bundle.get("group.post_a_story"));add.insert(a);div.insert(add);a.observe("click",this.__onAddContentClick.bindAsEventListener(this));}var ul=new Element("ul",{id:"groupInteractList"});var liUpdate=new Element("li");var updateLink=new Element("a",{href:"#",id:"updatesLink",rel:"nofollow"});updateLink.insert(new Element("span",{"class":"Sprites groupMemberUpdates icon"}));updateLink.insert(new Element("span",{"class":"label"}).insert(current.locale.Bundle.get("group.updates")));liUpdate.insert(updateLink);ul.insert(liUpdate);var liInvite=new Element("li");var inviteLink=new Element("a",{href:"#",id:"groupInviteLink",rel:"nofollow"});inviteLink.insert(new Element("span",{"class":"Sprites groupMemberInvite icon"}));inviteLink.insert(new Element("span",{"class":"label"}).insert(current.locale.Bundle.get("group.invite_friend")));liInvite.insert(inviteLink);ul.insert(liInvite);var liLeave=new Element("li",{"class":"wide"});leaveLink=new Element("a",{href:"#",id:"leaveGroupLink",rel:"nofollow"});leaveLink.insert(new Element("span",{"class":"Sprites groupMemberQuit icon"}));leaveLink.insert(new Element("span",{"class":"label"}).insert(current.locale.Bundle.get("group.leave_group")));liLeave.insert(leaveLink);ul.insert(liLeave);div.insert(ul);li.insert(div);updateLink.observe("click",this.__onUpdatesClick.bindAsEventListener(this));inviteLink.observe("click",this.__onInviteClick.bindAsEventListener(this));leaveLink.observe("click",this.__onLeaveClick.bindAsEventListener(this,bool));}if($("aboutGroupInfo")){var img=new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+this._userThumbnail+"_40x40.jpg",width:26,height:26,alt:this._username});var a=new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+this._username+".htm",id:"thumb_"+this._username});if($("memberList")){var curCount=parseInt($("memberCount").innerHTML);$("memberCount").innerHTML=curCount+1;$("memberList").insert(new Element("li",{id:"li_"+this._username}).insert(a.insert(img)));}else{if(bool){var h3=new Element("h3");h3.insert(current.locale.Bundle.get("group.members"));var count=new Element("span",{id:"memberCount"}).insert("1");var span=new Element("span").insert(" (");span.insert(count);span.insert(") | ");var seeAllLink=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/group_members/"+this._slug+"/"}).insert(current.locale.Bundle.get("group.see_all"));span.insert(seeAllLink);h3.insert(span);$("aboutGroupInfo").insert(h3);}var ml=new Element("ul",{id:"memberList","class":"leaderBeans"});ml.insert(new Element("li",{id:"li_"+this._username}).insert(a.insert(img)));$("aboutGroupInfo").insert(ml);}}var session=current.Session.getInstance();session.setUserId(this._userId);session.setFireAndForget(true);session.invalidate();}else{if($("joinGroupJsError")){Effect.Pulsate($("joinGroupJsError"),{pulses:2,duration:1});}else{li.insert(new Element("div").insert(new Element("em",{"class":"error",id:"joinGroupJsError"}).insert(current.locale.Bundle.get("group.there_was_an_error"))));}}},__onJoinFail:function(event,bool){if($("joinGroupJsError")){Effect.Pulsate($("joinGroupJsError"),{pulses:2,duration:1});}else{var li=this._joinButton.up("li");li.insert(new Element("div").insert(new Element("em",{"class":"error",id:"joinGroupJsError"}).insert(current.locale.Bundle.get("group.there_was_an_error"))));}},__onLeaveClick:function(event,bool){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var uname=current.User.getInstance().getName();var el=event.element();var param={id:this._slug,username:uname,action:"delete"};current.proxy.CCCP.execute("group","join_group",param,this.__onLeaveData.bindAsEventListener(this,el,uname,bool));},__onLeaveData:function(data,el,uname,bool){if(isUndefined(data)||typeof data!="boolean"){data=false;return ;}var li=null;if(!bool){if(!this._isStudios){li=$("controls");li.innerHTML="";var a=new Element("a",{href:"#",id:"simpleFollowLink",rel:"nofollow",onclick:"return false","class":"",title:current.locale.Bundle.get("group.follow")}).insert(current.locale.Bundle.get("group.follow"));li.insert(a);a.observe("click",this.__onJoinClick.bindAsEventListener(this,0));this._joinButton=a;}else{console.log("unfollow");var flink=$("studiosFollowLink");flink.removeClassName("active");flink.stopObserving("mouseover",this._studiosFollowLinkHoverObserver);flink.stopObserving("mouseout",this._studiosFollowLinkExitObserver);flink.update(current.locale.Bundle.get("follow"));}}else{li=el.up("li").up("li");li.innerHTML="";var a=new Element("a",{href:"#",id:"joinButton",rel:"nofollow",onclick:"return false","class":"Sprites Button lgButton lgBlueButton floatLeft",title:current.locale.Bundle.get("group.join_this_group")});li.insert(a.insert(current.locale.Bundle.get("group.join_this_group")));var div=new Element("div",{id:"groupInteractPanel"});if(!this._isClosedGroup){div.insert(new Element("p").insert(current.locale.Bundle.get("group.to_add_stories_and_get_updates")));}else{div.insert(new Element("p").insert(current.locale.Bundle.get("group.to_get_updates_on_all_the_latest")));}li.insert(div);a.observe("click",this.__onJoinClick.bindAsEventListener(this,1));this._joinButton=a;}if($("li_"+uname)){$("li_"+uname).remove();}if($("aboutGroupInfo")){if($("memberCount")){var curCount=parseInt($("memberCount").innerHTML);$("memberCount").innerHTML=curCount-1;}}var session=current.Session.getInstance();session.setUserId(this._userId);session.setFireAndForget(true);session.invalidate();},_doVotingSetup:function(){var _user=current.User.getInstance();this._voting=$H();scope=this;var vs=$$("#carousel .voting",".userItemActionBlock .voting");if(vs.length<1){return ;}vs.each(function(v){var vote=new current.components.voting.VoteControls(v);vote.init();scope._voting.set(vote._id.toString(),vote);});if(_user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:_user.getName(),items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});current.components.voting.VoteControls.executeDelayed();},__removeWelcomeMessage:function(){if($("landingMessage")){$("landingMessage").hide();}deleteCookie(current.Cookies.GROUP_MESSAGE_SHOW+"-"+this._groupId);if(Prototype.Browser.IE){window.location.reload();}},_addGroupSharingLinks:function(target,className,type){var _user=current.User.getInstance();scope=this;var sharing=$$(className);if(sharing.length<1){return ;}sharing.each(function(s){s.observe("click",scope.__onExternalPostClick.bindAsEventListener(scope,type));var share=null;if(type=="page"){share=new Share(s.id,scope._slug);share.setShareType("I");}else{share=new Share(s.id);share.setShareType("C");}share.setUserId(scope._userId);scope._shareList.set(s.id,share);});},__onExternalPostClick:function(event,type){event.stop();var el=event.element();var id,url,shortUrl,title,desc;if(type=="page"){id=this._page.getId();url=this._page.getUrl();shortUrl=this._page.getShortUrl();title=this._page.getContentTitle().unescapeHTML();desc=this._page.getContentDesc().unescapeHTML();}if(type=="rel"){var relJSON=el.rel.evalJSON();id=relJSON.id;url=relJSON.url;shortUrl=relJSON.url;title=relJSON.title.unescapeHTML();desc=relJSON.description.unescapeHTML();}if(this._sharing.get(el.id)==null){this._sharing.set(el.id,new ExternalPost(this,event,id,url,shortUrl,title,desc));this._sharing.get(el.id).setShareText(current.locale.Bundle.get("share.Invite_a_friend"));this._sharing.get(el.id).init();}if(this._sharing.get(el.id)._open){return ;}else{this._sharing.set(el.id,new ExternalPost(this,event,id,url,shortUrl,title,desc));this._sharing.get(el.id).setShareText(current.locale.Bundle.get("share.Invite_a_friend"));this._sharing.get(el.id).init();}},__onAddContentClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var clipperWindow=new current.clipper.ClipperWindow(event);clipperWindow.setGroupSlug(this._slug);if(this._assignmentId!=0){clipperWindow.setAssignmentId(this._assignmentId);}if(this._assignmentSource!=""){clipperWindow.setContentSource(this._assignmentSource);}if(this._assignmentTitle!=""){clipperWindow.setClipperTitle(this._assignmentTitle);}clipperWindow.setEditString(false);clipperWindow.init();}});current.content.groups.GroupPage.getInstance=function(closed,slug){if(!document.__currentGroupPage__){document.__currentGroupPage__=new current.content.groups.GroupPage(closed,slug);}return document.__currentGroupPage__;};current.stub("current.content.groups");current.content.groups.SlideShow=Class.create({initialize:function(prefix,controlPrefix,controlClass,delay,zTop,zMiddle,zBottom,limit){this._prefix=prefix;this._controlPrefix=controlPrefix;this._controlClass=controlClass;this._delay=delay;this._zTop=zTop;this._zMiddle=zMiddle;this._zBottom=zBottom;this._limit=limit;this._currentIndex=0;},init:function(){var scope=this;this.__observeControlLinks();var val=parseInt(this._currentIndex)+1;var loadDelay=parseInt(this._delay)+3000;this._slideTimer=setTimeout(function(){scope.__slideMe(val);},loadDelay);this._shuffleTimer=null;},slideMe:function(event){event.stop();var el=event.element();var id=el.id;var relVal=el.rel;clearTimeout(this._slideTimer);this._slideTimer=null;if(id=="+"){var val=parseInt(this._currentIndex)+1;if(val==this._limit){val=0;}relVal=val;}if(id=="-"){var val=parseInt(this._currentIndex)-1;if(val<0){val=this._limit-1;}relVal=val;}this.__slideMe(relVal);},__observeControlLinks:function(){var scope=this;$$("."+this._controlClass).each(function(c){c.observe("click",scope.slideMe.bindAsEventListener(scope));});},__slideMe:function(val){var scope=this;if(val==this._currentIndex){return false;}if(!$(this._prefix+val)){return false;}$(this._prefix+val).hide();$(this._prefix+val).setStyle({zIndex:this._zTop});this.__setActive(val);Effect.Appear(this._prefix+val,{duration:0.7});this._shuffleTimer=setTimeout(function(){scope.__shuffleCards(val);},800);return false;},__shuffleCards:function(val){$(this._prefix+this._currentIndex).setStyle({zIndex:this._zBottom});$(this._prefix+val).setStyle({zIndex:this._zMiddle});this._currentIndex=val;this._shuffleTimer=null;if(this._slideTimer){this.__autoSlide();}},__setActive:function(val){$$("."+this._controlClass).each(function(c){c.removeClassName("active");});$(this._controlPrefix+val).addClassName("active");},__autoSlide:function(){var scope=this;var val=parseInt(this._currentIndex)+1;if(val==this._limit){val=0;}this._slideTimer=setTimeout(function(){scope.__slideMe(val);},this._delay);}});Object.Event.extend(current.content.groups.SlideShow);current.content.groups.SlideShow.getInstance=function(prefix,controlPrefix,controlClass,delay,zTop,zMiddle,zBottom,limit){if(!document.__customSlideShow__){document.__customSlideShow__=new current.content.groups.SlideShow(prefix,controlPrefix,controlClass,delay,zTop,zMiddle,zBottom,limit);}return document.__customSlideShow__;};current.stub("current.content.groups");current.content.groups.NewestItems=Class.create({initialize:function(target,id,w,h){this._target=target;this._id=id;this._limit=3;this._isDataSet=false;this._width=w;this._height=h;this._itemList=new Array();},init:function(){this._fetchItems();},setLimit:function(limit){this._limit=limit;},_fetchItems:function(){if(!this._isDataSet){ContentService.fetchItemsFromGroup(this._id,0,this._limit,"new",this.__onItemData.bindAsEventListener(this),this.__onItemDataFail.bindAsEventListener(this));}},__onItemData:function(data){$(this._target).setOpacity(0);for(var i=0;i<this._limit;i++){var newItem=new current.content.groups.NewestItem(data.items[i],this._width,this._height);if(!newItem.getVideoRightsExpired()&&newItem.getThumbUrl!=null){$(this._target).appendChild(newItem.init());}}$(this._target).setStyle({visibility:"visible"});new Effect.Opacity($(this._target),{to:1,duration:0.5});},__onItemDataFail:function(){}});Object.Event.extend(current.content.groups.NewestItems);current.content.groups.NewestItem=Class.create({initialize:function(data,w,h){this._data=data;this._width=w;this._height=h;var thumb=new current.components.assets.ThumbUrl(this._data);this._thumbUrl=thumb.getThumbnailBySize(this._width,this._height,".jpg");},init:function(){var titleText=this._data.contentTitle.replace("'","'");titleText=titleText.replace('"','"');var assetDiv=new Element("div",{"class":"featuredAsset"});var link=new Element("a",{"class":"featuredThumb",title:titleText,href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm"});link.insert(new Element("img",{src:this._thumbUrl,alt:titleText}));assetDiv.insert(new Element("div",{"class":"Sprites videoPlayIconSmall placement_80x60"}));assetDiv.insert(link);return assetDiv;},getVideoRightsExpired:function(){if(this._data.pageAsset!=null&&this._data.pageAsset.videoRightsExpired!=null){return this._data.pageAsset.videoRightsExpired;}return false;},getThumbUrl:function(){return this._thumbUrl;}});Object.Event.extend(current.content.groups.NewestItem);current.stub("current.content.groups");current.content.groups.PendingItems=Class.create({initialize:function(slug,target,isOwner,policy,w,h){this._groupSlug=slug;this._target=target;this._isOwner=isOwner;this._twoStep=(policy=="MODERATED_ASSIGNMENT_TWO_STEP")?true:false;this._width=w;this._height=h;},init:function(){this._limit=1000;this._offset=0;this._isFetching=false;this._isFirstGo=true;this._itemList=new Array();this._approvedCount=0;this._rejectedCount=0;this._approvedList=new Array();this._rejectedList=new Array();this._statusMessageBox=$("pendingItemsStatus");this._statusMessage=$("pendingCountMsg");this._fetchItems();},_updateStatus:function(el,status){el.up().select(".Sprites").invoke("hide");switch(status){case 0:el.up().down(".pendDnn").show();break;case 1:el.up().down(".pendUpp").show();break;case 2:el.up().down(".pendUp").show();el.up().down(".pendDn").show();break;}},_updatePendingStatus:function(action){var message=(this._statusMessage.innerHTML=="")?"":"<br />";var itemCount=(action=="approve")?this._approvedCount:this._rejectedCount;var list=(action=="approve")?this._approvedList:this._rejectedList;if(itemCount>0&&action!="fail"){for(var i=0;i<itemCount;i++){if($("pendingListItem_"+list[i])){$("pendingListItem_"+list[i]).hide();}}this._statusMessageBox.show();if(itemCount>1){data={count:itemCount};templ=(action=="approve")?new Template(current.locale.Bundle.get("group.pendingAddMsg.many")):new Template(current.locale.Bundle.get("group.pendingRejectMsg.many"));message+=templ.evaluate(data);}else{message+=(action=="approve")?current.locale.Bundle.get("group.pendingAddMsg.one"):current.locale.Bundle.get("group.pendingRejectMsg.one");}this._statusMessage.insert(message);}if(action=="fail"){message+=current.locale.Bundle.get("group.pendingMsg.Error");this._statusMessage.insert(message);}},_addPendingLinks:function(target){if(this._isOwner||!this._twoStep){target.select(".pendUp").invoke("observe","click",this.__approveItem.bindAsEventListener(this));target.select(".pendDn").invoke("observe","click",this.__rejectItem.bindAsEventListener(this));target.select(".pendUpp").invoke("observe","click",this.__approveItem.bindAsEventListener(this));target.select(".pendDnn").invoke("observe","click",this.__rejectItem.bindAsEventListener(this));}else{target.select(".pendUp").invoke("observe","click",this.__onLikeClick.bindAsEventListener(this));target.select(".pendDn").invoke("observe","click",this.__onDislikeClick.bindAsEventListener(this));target.select(".pendUpp").invoke("observe","mouseover",this.__onCancelAdviceOver.bindAsEventListener(this));target.select(".pendDnn").invoke("observe","mouseover",this.__onCancelAdviceOver.bindAsEventListener(this));target.select(".pendUpp").invoke("observe","mouseout",this.__onCancelAdviceOut.bindAsEventListener(this));target.select(".pendDnn").invoke("observe","mouseout",this.__onCancelAdviceOut.bindAsEventListener(this));target.select(".pendUpp").invoke("observe","click",this.__onCancelAdviceClick.bindAsEventListener(this));target.select(".pendDnn").invoke("observe","click",this.__onCancelAdviceClick.bindAsEventListener(this));}},_addPublishLink:function(){$("publishApprovedSubmissions").observe("click",this.__publishItems.bindAsEventListener(this));},setLimit:function(limit){this._limit=limit;},_loadMore:function(event){event.stop();this._fetchItems();},_fetchItems:function(){if(!this._isFetching){this._isFetching=true;ContentService.fetchPendingItemsFromGroup(this._groupSlug,this._offset,this._limit,this.__onItemData.bindAsEventListener(this),this.__onItemDataFail.bindAsEventListener(this));}},_isApproved:function(id){if((this._approvedList.size()>0)&&(this._approvedList.include(id))){return true;}return false;},_isRejected:function(id){if((this._rejectedList.size()>0)&&(this._rejectedList.include(id))){return true;}return false;},__onItemData:function(data){if(data.items.length<1){if($("pendingItems")){$("pendingItems").hide();}return ;}if(data.items.length<this._limit||(data.totalCount-(this._offset+this._limit)==0)){this._limit=data.items.length;}if(this._isFirstGo){$(this._target).setOpacity(0);}data.items=data.items.reverse();for(var i=0;i<this._limit;i++){var newItem=new current.content.groups.PendingItem(i,data.items[i],this._width,this._height,this._twoStep,this._isOwner);$(this._target).appendChild(newItem.init());}if(this._isFirstGo){$(this._target).setStyle({visibility:"visible"});new Effect.Opacity($(this._target),{to:1,duration:0.5});}this._offset=this._offset+this._limit;this._isFetching=false;this._isFirstGo=false;this._addPendingLinks($(this._target));this._addPublishLink();},__onItemDataFail:function(){this._isFetching=false;},__approveItem:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._isApproved(event.element().rel)){for(var i=0;i<this._approvedList.length;i++){if(this._approvedList[i]==event.element().rel){this._approvedList.splice(i,1);this._approvedCount--;break;}}this._updateStatus(event.element(),2);}else{this._approvedList.push(event.element().rel);this._approvedCount++;this._updateStatus(event.element(),1);}},__rejectItem:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._isRejected(event.element().rel)){for(var i=0;i<this._rejectedList.length;i++){if(this._rejectedList[i]==event.element().rel){this._rejectedList.splice(i,1);this._rejectedCount--;break;}}this._updateStatus(event.element(),2);}else{this._rejectedList.push(event.element().rel);this._rejectedCount++;this._updateStatus(event.element(),0);}},__publishItems:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._approvedCount>0){var items=new Array();for(var i=0;i<this._approvedCount;i++){items[i]=this._approvedList[i];}current.proxy.CCCP.execute("group","items_add_post",{id:this._groupSlug,action:"add",item:items.toString(),forceToArray:"item"},this.__onAddItemsData.bindAsEventListener(this),this.__onAddItemsFail.bindAsEventListener(this));}if(this._rejectedCount>0){var items=new Array();for(var i=0;i<this._rejectedCount;i++){items[i]=this._rejectedList[i];}current.proxy.CCCP.execute("group","items_reject_post",{id:this._groupSlug,action:"add",item:items.toString(),forceToArray:"item"},this.__onRejectItemsData.bindAsEventListener(this),this.__onRejectItemsFail.bindAsEventListener(this));}},__onAddItemsData:function(data){this._updatePendingStatus("approve");this._approvedCount=0;this._approvedList=new Array();},__onAddItemsFail:function(data){this._updatePendingStatus("fail");},__onRejectItemsData:function(data){this._updatePendingStatus("reject");this._rejectedCount=0;this._rejectedList=new Array();},__onRejectItemsFail:function(data){this._updatePendingStatus("fail");},__onLikeClick:function(event){event.stop();var item=event.element();current.proxy.CCCP.execute("group","item_advice_post",{id:this._groupSlug,item:item.rel,advice:"Y"},this.__onAdviceData.bindAsEventListener(this,event,1),this.__onAdviceFail.bindAsEventListener(this));},__onDislikeClick:function(event){event.stop();var item=event.element();current.proxy.CCCP.execute("group","item_advice_post",{id:this._groupSlug,item:item.rel,advice:"N"},this.__onAdviceData.bindAsEventListener(this,event,0),this.__onAdviceFail.bindAsEventListener(this));},__onCancelAdviceClick:function(event){event.stop();var item=event.element();current.proxy.CCCP.execute("group","item_advice_post",{id:this._groupSlug,item:item.rel,advice:"C"},this.__onAdviceData.bindAsEventListener(this,event,2),this.__onAdviceFail.bindAsEventListener(this));},__onAdviceData:function(data,event,val){this._updateStatus(event.element(),val);},__onAdviceFail:function(data){},__onCancelAdviceOver:function(event){event.stop();var item=event.element();item.addClassName("groupItemUndoButton");},__onCancelAdviceOut:function(event){event.stop();var item=event.element();item.removeClassName("groupItemUndoButton");}});Object.Event.extend(current.content.groups.PendingItems);current.content.groups.PendingItem=Class.create({initialize:function(index,data,w,h,twoStep,isOwner){this._index=index+1;this._data=data;this._width=w;this._height=h;this._twoStep=twoStep;this._isOwner=isOwner;var thumb=new current.components.assets.ThumbUrl(this._data);this._thumbUrl=thumb.getThumbnailBySize(120,90,".jpg");},init:function(){var titleText=this._data.contentTitle.replace("'","'");titleText=titleText.replace('"','"');var href=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm";var userHref=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/users/"+this._data.addedUser.username+".htm";var text="";if(this._data.contentText!=null){text=this._data.contentText;text=text.stripTags();text=text.escapeHTML();}if(this._data.contentUrl!=null&&this._data.contentUrl!=""&&text.startsWith(this._data.contentUrl)){text=text.replace(this._data.contentUrl,"");}text=(text.length>84)?text.substring(0,83)+"...":text;var li=new Element("li",{id:"pendingListItem_"+this._data.id});var pendingItemDiv=new Element("div",{"class":"pendingItem"});var pendingItemCount=new Element("div",{"class":"pendingItemCount"}).insert(this._index+"");var pendingItemAsset=new Element("div",{"class":"quickAddItemAsset"});var thumbLink=new Element("a",{title:titleText,href:href});thumbLink.insert(new Element("img",{src:this._thumbUrl,alt:titleText,width:this._width,height:this._height}));pendingItemAsset.insert(thumbLink);var h2=new Element("h2").insert(new Element("a",{title:titleText,href:href}).insert(this._data.contentTitle));var userLink=new Element("a",{title:this._data.addedUser.username,href:userHref}).insert(this._data.addedUser.username);var userSpan=new Element("span").insert(" // added by ");userSpan.insert(userLink);h2.insert(userSpan);var p=new Element("p").insert(text);pendingItemDiv.insert(pendingItemCount);pendingItemDiv.insert(pendingItemAsset);pendingItemDiv.insert(h2);pendingItemDiv.insert(p);var pendingAction=new Element("div",{"class":"pendingAction"});var classUp=(this._isOwner||!this._twoStep)?"Sprites groupItemApproveButton pendUp floatLeft":"Sprites groupItemLikeButton pendUp floatLeft";var styleUp=(this._isOwner||!this._twoStep)?"":(this._data.advice!=null)?"display: none;":"";var classDn=(this._isOwner||!this._twoStep)?"Sprites groupItemRejectButton pendDn floatLeft":"Sprites groupItemDislikeButton pendDn floatLeft";var styleDn=(this._isOwner||!this._twoStep)?"margin-left: 3px;":(this._data.advice!=null)?"margin-left: 6px; display: none;":"margin-left: 6px;";var classUpp=(this._isOwner||!this._twoStep)?"Sprites groupItemApprovedButton pendUpp floatLeft":"Sprites groupItemLikedButton pendUpp floatLeft";var styleUpp=(this._isOwner||!this._twoStep)?"display: none;":(this._data.advice!=null&&this._data.advice=="Y")?"":"display: none;";var classDnn=(this._isOwner||!this._twoStep)?"Sprites groupItemRejectedButton pendDnn floatLeft":"Sprites groupItemDislikedButton pendDnn floatLeft";var styleDnn=(this._isOwner||!this._twoStep)?"display: none;":(this._data.advice!=null&&this._data.advice=="N")?"":"display: none;";this._pendingApproveLink=new Element("a",{id:"pendingApprove_"+this._data.id,rel:this._data.id,href:"#","class":classUp,style:styleUp});pendingAction.insert(this._pendingApproveLink);this._pendingRejectLink=new Element("a",{id:"pendingReject_"+this._data.id,rel:this._data.id,href:"#","class":classDn,style:styleDn});pendingAction.insert(this._pendingRejectLink);this._pendingApprovedLink=new Element("a",{id:"pendingApproved_"+this._data.id,rel:this._data.id,href:"#","class":classUpp,style:styleUpp});pendingAction.insert(this._pendingApprovedLink);this._pendingRejectedLink=new Element("a",{id:"pendingRejected_"+this._data.id,rel:this._data.id,href:"#","class":classDnn,style:styleDnn});pendingAction.insert(this._pendingRejectedLink);li.insert(pendingItemDiv);li.insert(pendingAction);if(this._twoStep&&this._isOwner){var adviceDiv=new Element("div",{"class":"moderatorAdvice floatLeft"});var advice=(this._data.advice==null)?current.locale.Bundle.get("group.pendingAdviceMsg.Not_reviewed"):(this._data.advice=="Y")?current.locale.Bundle.get("group.pendingAdviceMsg.Mod")+': <span class="y">'+current.locale.Bundle.get("group.pendingAdviceMsg.Liked")+"</span>":current.locale.Bundle.get("group.pendingAdviceMsg.Mod")+': <span class="n">'+current.locale.Bundle.get("group.pendingAdviceMsg.Disliked")+"</span>";adviceDiv.insert(advice);li.insert(adviceDiv);}return li;}});Object.Event.extend(current.content.groups.PendingItem);current.stub("current.content.groups");current.content.groups.GroupCreatePage=Class.create({initialize:function(){this._feedbackClass=".groupNameFeedback";this._tempName="";this._tempSlug="";this._slugFocus=false;this._nameAvailable=false;this._isAdmin=false;},init:function(name,url,tags,tagsHolder){this._nameTarget=name;this._slugTarget=url;$(this._nameTarget).observe("keyup",this.__onNameChange.bindAsEventListener(this));$(this._nameTarget).observe("blur",this.__onNameChange.bindAsEventListener(this));$(this._slugTarget).observe("keyup",this.__onUrlChange.bindAsEventListener(this));$(this._slugTarget).observe("blur",this.__onUrlChange.bindAsEventListener(this));$(this._slugTarget).observe("focus",this.__inspectSlug.bindAsEventListener(this));var suggest=new current.TagsBrowser(tags,tagsHolder,{minChars:2,tokens:",",disablePreselect:true,choices:12});$(this.getForm()).observe("submit",this.__onSubmit.bindAsEventListener(this));CharacterCounter.getInstance();},setForm:function(form){this._form=form;},getForm:function(){return this._form;},showProgressMessage:function(){$("groupCreateProgress").show();$("groupAdminEdit").hide();$("groupCreateHeadline").hide();},__onNameChange:function(event){this._tempName=event.element().value;if(!this._isAdmin){var genSlug=this.__slugify(this._tempName);$(this._slugTarget).value=genSlug;}if(this._tempName.length>2){current.proxy.CCCP.execute("groups","name_available",{name:this._tempName},this.__onGroupData.bindAsEventListener(this),null,"get");if(!this._slugFocus&&!this._isAdmin){this.__checkSlug();}}else{$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._nameTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._nameTarget).up("li").down(this._feedbackClass).show();if(!this._isAdmin){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();}}},__onUrlChange:function(event){if(this._tempSlug!=$(this._slugTarget).value){this._slugFocus=true;}this._tempSlug=event.element().value;this._tempSlug=this.__slugify(this._tempSlug);$(this._slugTarget).value=this._tempSlug;this.__checkSlug();},__inspectSlug:function(){this._tempSlug=$(this._slugTarget).value;},__checkSlug:function(){if($(this._slugTarget).value.length>2){current.proxy.CCCP.execute("group","get",{id:"groups/"+$(this._slugTarget).value},this.__onGroupUrlData.bindAsEventListener(this),this.__onGroupUrlFail.bindAsEventListener(this),"get");}else{if(this._isAdmin){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();}}},__onGroupData:function(data){if(data!=null&&data==true){$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._nameTarget).up("li").down(this._feedbackClass).addClassName("green");this._nameAvailable=true;}else{$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._nameTarget).up("li").down(this._feedbackClass).removeClassName("green");this._nameAvailable=false;}$(this._nameTarget).up("li").down(this._feedbackClass).show();},__onGroupUrlData:function(data){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();this._nameAvailable=false;},__onGroupUrlFail:function(data){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._slugTarget).up("li").down(this._feedbackClass).addClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();},__onSubmit:function(event){if(!this._nameAvailable){event.stop();return ;}if(this._isAdmin&&$("groupCreate_description")){var d=Validation.validate("groupCreate_description");if(!d){event.stop();return ;}}else{if($("groupCreate_description")&&$("tagSelect_tags")){var d=Validation.validate("groupCreate_description");var t=Validation.validate("tagSelect_tags");if(!d||!t){event.stop();return ;}}}current.tracking.Track.getInstance().onGroupCreate($(this._slugTarget).value);this.showProgressMessage();},__slugify:function(original){original=this.__doLatin1Map(original);original=original.strip().toLowerCase();original=original.toLowerCase();original=original.replace(new RegExp("&[a-z]+;","g")," ");original=original.replace(new RegExp("'","g"),"");original=original.replace(new RegExp("[^ a-z0-9-]","g")," ");original=original.strip();original=original.replace(new RegExp("\\s+","g"),"-");return original;},__doLatin1Map:function(original){var key;if(!this.__latin1Search){var concat=null,map={};for(key in this.__latin1Map){var val=this.__latin1Map[key];concat=(concat)?concat+"|"+val:val;map[key]=new RegExp(val,"g");}this.__latin1Search=new RegExp(concat);this.__latin1RegexpMap=map;}if(original.search(this.__latin1Search)!=-1){for(key in this.__latin1RegexpMap){original=original.replace(this.__latin1RegexpMap[key],key);}}return original;},__latin1Map:{A:"\u00C0|\u00C1|\u00C2|\u00C3|\u00C4|\u00C5",AE:"\u00C6",C:"\u00C7",E:"\u00C8|\u00C9|\u00CA|\u00CB",I:"\u00CC|\u00CD|\u00CE|\u00CF",IJ:"\u0132",D:"\u00D0",N:"\u00D1",O:"\u00D2|\u00D3|\u00D4|\u00D5|\u00D6|\u00D8",OE:"\u0152",TH:"\u00DE",U:"\u00D9|\u00DA|\u00DB|\u00DC",Y:"\u00DD|\u0178",a:"\u00E0|\u00E1|\u00E2|\u00E3|\u00E4|\u00E5",ae:"\u00E6",c:"\u00E7",e:"\u00E8|\u00E9|\u00EA|\u00EB",i:"\u00EC|\u00ED|\u00EE|\u00EF",ij:"\u0133",d:"\u00F0",n:"\u00F1",o:"\u00F2|\u00F3|\u00F4|\u00F5|\u00F6|\u00F8",oe:"\u0153",ss:"\u00DF",th:"\u00FE",u:"\u00F9|\u00FA|\u00FB|\u00FC",y:"\u00FD|\u00FF",ff:"\uFB00",fi:"\uFB01",fl:"\uFB02",ffi:"\uFB03",ffl:"\uFB04",ft:"\uFB05",st:"\uFB06"}});current.stub("current.content.groups");current.content.groups.GroupItemFeature=Class.create({initialize:function(){this._featureListener=this.__onFeatureClick.bindAsEventListener(this);this._unfeatureListener=this.__onUnfeatureClick.bindAsEventListener(this);this._removeTopicListener=this.__onRemoveGroupClick.bindAsEventListener(this);this._moveUpListener=this.__onMoveUpClick.bindAsEventListener(this);this._moveDownListener=this.__onMoveDownClick.bindAsEventListener(this);},init:function(slug,featuredItemsList){this.setSlug(slug),this.setFeaturedItemsList(featuredItemsList);this.addChannelAdminLinks($(document.getElementsByTagName("body")[0]));},addChannelAdminLinks:function(target){target.select(".itemFeatureLink").invoke("observe","click",this._featureListener);target.select(".itemUnfeatureLink").invoke("observe","click",this._unfeatureListener);target.select(".itemRemoveTopicLink").invoke("observe","click",this._removeTopicListener);target.select(".itemMoveUpLink").invoke("observe","click",this._moveUpListener);target.select(".itemMoveDownLink").invoke("observe","click",this._moveDownListener);},setFeaturedItemsList:function(str){this._featuredItemsList=str;},getFeaturedItemsList:function(){return this._featuredItemsList;},setSlug:function(str){this._slug=str;},getSlug:function(){return this._slug;},setItemId:function(str){this._itemId=str;},getItemId:function(){return this._itemId;},__checkUser:function(event){var u=current.User.getInstance();if(!u.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.FLAG);return false;}if(!current.Authorize.checkWriteMode(event)){return false;}return true;},__onFeatureClick:function(event){Event.stop(event);if(!this.__checkUser(event)){return ;}this._getRel(event.element());GroupService.addFeaturedItem(this.getSlug(),this.getItemId(),"0",this.__onEditSuccess.bind(this),this.__onEditFailure.bind(this));},__onUnfeatureClick:function(event){Event.stop(event);if(!this.__checkUser(event)){return ;}this._getRel(event.element());GroupService.removeFeaturedItem(this.getSlug(),this.getItemId(),this.__onEditSuccess.bind(this),this.__onEditFailure.bind(this));},__onRemoveGroupClick:function(event){Event.stop(event);if(!this.__checkUser(event)){return ;}this._getRel(event.element());current.proxy.CCCP.execute("item","group_post",{id:this._itemId,groupSlugs:this.getSlug(),action:"delete"},this.__onEditSuccess.bindAsEventListener(this),this.__onEditFailure.bindAsEventListener(this));current.uncache();},__onMoveUpClick:function(event){Event.stop(event);if(!this.__checkUser(event)){return ;}this._getRel(event.element());this.reorderItemList(this.getItemId(),-1);GroupService.reorderFeaturedItems(this.getSlug(),this._newList,this.__onEditSuccess.bind(this),this.__onEditFailure.bind(this));},__onMoveDownClick:function(event){Event.stop(event);if(!this.__checkUser(event)){return ;}this._getRel(event.element());this.reorderItemList(this.getItemId(),1);GroupService.reorderFeaturedItems(this.getSlug(),this._newList,this.__onEditSuccess.bind(this),this.__onEditFailure.bind(this));},_getRel:function(el){if(typeof el.rel=="undefined"||typeof el.up("a").rel!="undefined"){this.setItemId(el.up("a").rel);}else{this.setItemId(el.rel);}},__onEditSuccess:function(){var url=(document.location.href.indexOf("#")!=-1)?document.location.href.substring(0,document.location.href.indexOf("#")):document.location.href;document.location=url;},__onEditFailure:function(){alert(current.locale.Bundle.get("verify.An_error_has_occurred"));},reorderItemList:function(id,delta){this._items=this.getFeaturedItemsList().split(",");this._oldIndex=this._items.indexOf(id);this._newIndex=(this._oldIndex+delta);if((this._newIndex<0)||(this._newIndex>=this._items.length)){return alert("Oops! You can't move that item any further in that direction.");}this._items.splice(this._oldIndex,1);this._items.splice(this._newIndex,0,id);this._newList=this._items.join(",");}});Object.Event.extend(current.content.groups.GroupItemFeature);current.content.groups.GroupItemFeature.getInstance=function(){if(!document.__currentGroupItemFeature__){document.__currentGroupItemFeature__=new current.content.groups.GroupItemFeature();}return document.__currentGroupItemFeature__;};current.stub("current.content.groups");current.content.groups.GroupAdminCreatePage=Class.create({initialize:function(){this._feedbackClass=".groupNameFeedback";this._tempName="";this._tempSlug="";this._nameAvailable=false;this._slugAvailable=false;this._isAdmin=false;this._pageType=1;this._familyId=0;this._familySlug="";this._familyText="";this._parentId=0;this._parentSlug="";this._parentText="";this._pathString="";this._isChallenge=false;this._challengeEdit=false;this._aMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this._aDays=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");this._pitchStart="";this._recommendedStart="";this._voteStart="";this._creditedStart="";this._isGallery=false;},init:function(){$(this._nameTarget).observe("keyup",this.__onNameChange.bindAsEventListener(this));$(this._nameTarget).observe("blur",this.__onNameChange.bindAsEventListener(this));$(this._slugTarget).observe("keyup",this.__onUrlChange.bindAsEventListener(this));$(this._slugTarget).observe("blur",this.__onUrlChange.bindAsEventListener(this));$(this._slugTarget).observe("focus",this.__inspectSlug.bindAsEventListener(this));var suggest=new current.TagsBrowser(this._tags,this._tagsHolder,{minChars:2,tokens:",",disablePreselect:true,choices:12});$(this.getForm()).observe("submit",this.__onSubmit.bindAsEventListener(this));CharacterCounter.getInstance();this._isAdmin=true;this._pageTypeSelect.observe("change",this.__onPageTypeSelector.bindAsEventListener(this));this._familySelect.observe("change",this.__onFamilySelector.bindAsEventListener(this));this._parentSelect.observe("change",this.__onParentSelector.bindAsEventListener(this));this.__setPath();if($("challengeCheckbox")){$("challengeCheckbox").observe("click",this.__makeChallenge.bindAsEventListener(this));}var cals=$$(".isDateTime");for(var i=0;i<cals.length;i++){this.__onLoadDate(cals[i]);}var sels=$$(".dateTimeSelect");for(var i=0;i<sels.length;i++){Event.observe(sels[i],"change",this.__setDate.bindAsEventListener(this));}if($("galleryCheckbox")){$("galleryCheckbox").observe("click",this.__makeGallery.bindAsEventListener(this));}if($(this._nameTarget).value.length>0){this.__onNameChange();}if($(this._slugTarget).value.length>0){this.__checkSlug();}if(this._startSlug!=null){this.__startSlug();}},setForm:function(form){this._form=form;},getForm:function(){return this._form;},setPageTypeSelect:function(pageTypeSelector){this._pageTypeSelect=$(pageTypeSelector);},setTargetName:function(name){this._nameTarget=name;},setSlugTarget:function(url){this._slugTarget=url;},setFamilySelect:function(familySelector){this._familySelect=$(familySelector);},setParentSelect:function(parentSelector){this._parentSelect=$(parentSelector);},setGroupSelect:function(groupSelector){this._groupSelect=$(groupSelector);},setPath:function(path){this._path=$(path);},setPathDisplay:function(pathDisplay){this._pathDisplay=$(pathDisplay);},setTags:function(tags){this._tags=tags;},setTagsHolder:function(tagsHolder){this._tagsHolder=tagsHolder;},setParentSlug:function(slug){this._pathString=slug;this._path.value=this._pathString;this._familySelect.up("li").show();if($("challengeCheckbox")){$("challengeCheckbox").up("div").show();}if($("galleryCheckbox")){$("galleryCheckbox").up("div").show();}for(var i=0;i<this._familySelect.options.length;i++){if(i>0&&slug.indexOf(this._familySelect[i].id)!=-1){this._familySelect[i].selected=true;this._familySelect.selectedIndex=i;break;}}this._pageTypeSelect.up("ul").hide();this._parentSelect.up("ul").hide();this._pathDisplay.update(this._pathString+"/");},__setPath:function(){this._familyId=this._familySelect[this._familySelect.selectedIndex].value;this._familySlug=this._familySelect[this._familySelect.selectedIndex].id;this._familyText=this._familySelect[this._familySelect.selectedIndex].text;this._parentId=this._parentSelect[this._parentSelect.selectedIndex].id;this._parentSlug=this._parentSelect[this._parentSelect.selectedIndex].value;this._parentText=this._parentSelect[this._parentSelect.selectedIndex].text;this._pathString=((this._parentSelect.selectedIndex==0)?this._familySlug:this._parentSlug);this._path.value=this._pathString;if(this._familyId!=0){this._pathDisplay.update(this._pathString+"/");}else{this._pathDisplay.update(this._pathString);}if(this._pathString.length>0){this.__checkSlug();}},__onPageTypeSelector:function(event){this.__pageTypeReset(event);event.stop();var el=event.element();this._pageType=el.selectedIndex;switch(this._pageType){case 0:this._groupSelect.up("li").show();break;case 1:this._familySelect.up("li").show();if($("challengeCheckbox")){$("challengeCheckbox").up("div").show();}if($("galleryCheckbox")){$("galleryCheckbox").up("div").show();}break;case 2:this._groupSelect.up("li").show();if($("galleryCheckbox")){$("galleryCheckbox").up("div").show();}break;default:break;}this.__setPath();},__pageTypeReset:function(event){this._familySelect.up("li").hide();this._familySelect.selectedIndex=0;this._parentSelect.up("li").hide();this._parentSelect.selectedIndex=0;this._groupSelect.up("li").hide();this._groupSelect.value="";this.__resetChildren();if($("challengeCheckbox")){$("challengeCheckbox").up("div").hide();$("challengeCheckbox").checked=false;this.__makeChallenge(event);$("galleryCheckbox").up("div").hide();$("galleryCheckbox").checked=false;this.__makeGallery(event);}},__onFamilySelector:function(event){this.__setPath();this._parentSelect.up("li").hide();this.__resetChildren();if(this._familyId!=0){this.__getChildren(this._familySlug);}},__onParentSelector:function(event){this.__setPath();if(this._parentId!=0){this.__getChildren(this._parentSlug);}},__resetChildren:function(){this._parentSelect.innerHTML="";var opt=new Element("option",{id:0,value:""}).insert("No Parent");this._parentSelect.insert(opt);},__getChildren:function(slug){current.proxy.CCCP.execute("group","groups",{id:slug,start:0,len:50},this.__onGetChildrenData.bindAsEventListener(this),null,"get");},__onGetChildrenData:function(data){if(data.items.length<1){return ;}var insertLine=this._parentSelect.selectedIndex;for(i=0;i<data.items.length;i++){var child=data.items[i];if(!$("p_"+child.id)){var childLevel=child.slug.split(/\//g).length-1;var levelString="";for(j=0;j<childLevel;j++){levelString+="-";}var opt=new Element("option",{id:"p_"+child.id,value:child.slug}).insert(levelString+child.name);if($(this._parentId)){Element.insert($(this._parentId),{after:opt});}else{this._parentSelect.insert(opt);}}}this._parentSelect.up("li").show();},showProgressMessage:function(){$("groupCreateProgress").show();$("groupAdminEdit").hide();$("groupCreateHeadline").hide();},__onNameChange:function(){this._tempName=$(this._nameTarget).value;if(this._isAdmin){var genSlug=this.__slugify(this._tempName);$(this._slugTarget).value=genSlug;}if(this._tempName.length>2){current.proxy.CCCP.execute("groups","name_available",{name:this._tempName},this.__onGroupData.bindAsEventListener(this),null,"get");this.__checkSlug();}else{$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._nameTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._nameTarget).up("li").down(this._feedbackClass).show();if(!this._isAdmin){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();}}$("groupCreateButton").setOpacity(1);$("groupCreateButton").value="Create Page";},__onUrlChange:function(event){$(this._slugTarget).value=this.__slugify(event.element().value);this.__checkSlug();},__inspectSlug:function(){this._tempSlug="";if(this._path.value.length>0){this._tempSlug=this._path.value+"/";}this._tempSlug+=$(this._slugTarget).value;},__checkSlug:function(){this.__inspectSlug();if(this._tempSlug.length>2&&$(this._slugTarget).value.length>2){current.proxy.CCCP.execute("group","get",{id:this._tempSlug},this.__onGroupUrlData.bindAsEventListener(this),this.__onGroupUrlFail.bindAsEventListener(this),"get");}else{if(this._isAdmin){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.3_character_minimum");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();}}},__onGroupData:function(data){if(data!=null&&data==true){$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._nameTarget).up("li").down(this._feedbackClass).addClassName("green");this._nameAvailable=true;}else{$(this._nameTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._nameTarget).up("li").down(this._feedbackClass).removeClassName("green");this._nameAvailable=false;}$(this._nameTarget).up("li").down(this._feedbackClass).show();},__onGroupUrlData:function(data){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.Name_Not_Available");$(this._slugTarget).up("li").down(this._feedbackClass).removeClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();this._slugAvailable=false;},__onGroupUrlFail:function(data){$(this._slugTarget).up("li").down(this._feedbackClass).innerHTML=current.locale.Bundle.get("group.available");$(this._slugTarget).up("li").down(this._feedbackClass).addClassName("green");$(this._slugTarget).up("li").down(this._feedbackClass).show();this._slugAvailable=true;},__onSubmit:function(event){$$(".error").invoke("hide");if(!this._nameAvailable){event.stop();return ;}if(!this._slugAvailable){event.stop();return ;}if(this._isAdmin&&$("groupCreate_description")){var d=Validation.validate("groupCreate_description");if(!d){event.stop();return ;}}else{if($("groupCreate_description")&&$("tagSelect_tags")){var d=Validation.validate("groupCreate_description");var t=Validation.validate("tagSelect_tags");if(!d||!t){event.stop();return ;}}}current.tracking.Track.getInstance().onGroupCreate($(this._slugTarget).value);this.showProgressMessage();},__slugify:function(original){original=this.__doLatin1Map(original);original=original.strip().toLowerCase();original=original.toLowerCase();original=original.replace(new RegExp("&[a-z]+;","g")," ");original=original.replace(new RegExp("'","g"),"");original=original.replace(new RegExp("[^ a-z0-9-]","g")," ");original=original.strip();original=original.replace(new RegExp("\\s+","g"),"-");return original;},__doLatin1Map:function(original){var key;if(!this.__latin1Search){var concat=null,map={};for(key in this.__latin1Map){var val=this.__latin1Map[key];concat=(concat)?concat+"|"+val:val;map[key]=new RegExp(val,"g");}this.__latin1Search=new RegExp(concat);this.__latin1RegexpMap=map;}if(original.search(this.__latin1Search)!=-1){for(key in this.__latin1RegexpMap){original=original.replace(this.__latin1RegexpMap[key],key);}}return original;},__latin1Map:{A:"\u00C0|\u00C1|\u00C2|\u00C3|\u00C4|\u00C5",AE:"\u00C6",C:"\u00C7",E:"\u00C8|\u00C9|\u00CA|\u00CB",I:"\u00CC|\u00CD|\u00CE|\u00CF",IJ:"\u0132",D:"\u00D0",N:"\u00D1",O:"\u00D2|\u00D3|\u00D4|\u00D5|\u00D6|\u00D8",OE:"\u0152",TH:"\u00DE",U:"\u00D9|\u00DA|\u00DB|\u00DC",Y:"\u00DD|\u0178",a:"\u00E0|\u00E1|\u00E2|\u00E3|\u00E4|\u00E5",ae:"\u00E6",c:"\u00E7",e:"\u00E8|\u00E9|\u00EA|\u00EB",i:"\u00EC|\u00ED|\u00EE|\u00EF",ij:"\u0133",d:"\u00F0",n:"\u00F1",o:"\u00F2|\u00F3|\u00F4|\u00F5|\u00F6|\u00F8",oe:"\u0153",ss:"\u00DF",th:"\u00FE",u:"\u00F9|\u00FA|\u00FB|\u00FC",y:"\u00FD|\u00FF",ff:"\uFB00",fi:"\uFB01",fl:"\uFB02",ffi:"\uFB03",ffl:"\uFB04",ft:"\uFB05",st:"\uFB06"},__makeGallery:function(event){if($("galleryCheckbox").checked){$("challengeCheckbox").checked=false;this.__makeChallenge(event);this._isGallery=true;$$(".galleryBits").each(function(c){c.show();});}else{this._isGallery=false;$$(".galleryBits").each(function(c){c.hide();});}},__makeChallenge:function(event){if($("challengeCheckbox").checked){$("galleryCheckbox").checked=false;this.__makeGallery(event);this._isChallenge=true;this._challengeType="STORYMAKER";this._challengeSelect=$("groupCreate_challengeType");this._storylineWidthField=$("groupCreate_challengeStartSceneImageWidth");this._storylineHeightField=$("groupCreate_challengeStartSceneImageHeight");this._storylineWidth="400";this._storylineHeight="300";$$(".challengeBits").each(function(c){c.show();});if($("challengeMinScenesSlider")&&!this._minSlider){this._minSlider=new Control.Slider($("challengeMinScenesSlider").down(".handle"),$("challengeMinScenesSlider"),{range:$R(1,22),sliderValue:1,onSlide:function(value){$("groupCreate_challengeMinScenes").value=parseInt(value)+"";},onChange:function(value){$("groupCreate_challengeMinScenes").value=parseInt(value)+"";}});}if($("challengeMaxScenesSlider")&&!this._maxSlider){var maxSlider=new Control.Slider($("challengeMaxScenesSlider").down(".handle"),$("challengeMaxScenesSlider"),{range:$R(1,22),sliderValue:22,onSlide:function(value){$("groupCreate_challengeMaxScenes").value=parseInt(value)+"";},onChange:function(value){$("groupCreate_challengeMaxScenes").value=parseInt(value)+"";}});}if(this._challengeSelect){this._challengeSelect.observe("change",this.__onChallengeTypeChange.bindAsEventListener(this));}if(this._storylineWidthField){this._storylineWidthField.observe("blur",this.__onChallengeWidthChange.bindAsEventListener(this));}if(this._storylineHeightField){this._storylineHeightField.observe("blur",this.__onChallengeHeightChange.bindAsEventListener(this));}$$(".challengeTimeCheckbox").invoke("observe","click",this.__onChallengeTimeChange.bindAsEventListener(this));}else{this._isChallenge=false;$$(".challengeBits").each(function(c){c.hide();});}},__onChallengeTimeChange:function(event){var el=event.element();if(el.checked==true){el.up(".elementContainer").down(".inputs").show();}else{el.up(".elementContainer").down(".inputs").hide();}},__onLoadDate:function(elm){var stringValue=elm.value;now=new Date();localeShift=now.getTimezoneOffset()/60;now.setHours(now.getHours()+localeShift);now.setMinutes(0);now.setSeconds(0);var tempDateString=this.__getRFC822Date(now);var endTime;if(elm.id.indexOf("Pitch")!=-1){this._pitchTime=(stringValue=="")?tempDateString:elm.value;$(elm.id).value=this._pitchTime;if($("challengePitch")){$("challengePitch").checked=true;}endTime=this._pitchTime;}if(elm.id.indexOf("Recommended")!=-1){var shift=new Date(now.getTime()+(14*24*60*60*1000));this._recommendedTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._recommendedTime;endTime=this._recommendedTime;}if(elm.id.indexOf("Vote")!=-1){var shift=new Date(now.getTime()+(28*24*60*60*1000));this._voteTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._voteTime;endTime=this._voteTime;}if(elm.id.indexOf("Credited")!=-1){var shift=new Date(now.getTime()+(36*24*60*60*1000));this._creditedTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._creditedTime;endTime=this._creditedTime;}var end=new Date(endTime);end.setHours(end.getHours()+end.getTimezoneOffset()/60);endTime=end.toString();var month=end.getMonth();var day=end.getDate()-1;var year=end.getFullYear();var hour=end.getHours()-1;if(hour<0){hour=0;}this.__updateTimeSelects(elm.id,month,day,year,hour,endTime);},__updateTimeSelects:function(id,month,day,year,hour,endTime){if($(id+"Month")&&$(id+"Month").options[month]){$(id+"Month").options[month].selected=true;}if($(id+"Day")&&$(id+"Day").options[day]){$(id+"Day").options[day].selected=true;}if($(id+"Year")){for(var i=0;i<$(id+"Year").options.length;i++){if($(id+"Year").options[i].value==year){$(id+"Year").options[i].selected=true;}}}if($(id+"Hour")){for(var i=0;i<$(id+"Hour").options.length;i++){if($(id+"Hour").options[i].value==hour){$(id+"Hour").options[i].selected=true;}}}if($(id+"Eastern")){$(id+"Eastern").innerHTML="* "+getDateAndTimeFromUTC(endTime,-4,"EST",false,false);}if($(id+"Pacific")){$(id+"Pacific").innerHTML="* "+getDateAndTimeFromUTC(endTime,-7,"PST",false,false);}},__getRFC822Date:function(oDate){var rfc822=new String();rfc822=this._aDays[oDate.getDay()]+", ";rfc822+=this.__padWithZero(oDate.getDate())+" ";rfc822+=this._aMonths[oDate.getMonth()]+" ";rfc822+=oDate.getFullYear()+" ";rfc822+=this.__padWithZero(oDate.getHours())+":";rfc822+=this.__padWithZero(oDate.getMinutes())+":";rfc822+=this.__padWithZero(oDate.getSeconds())+" ";rfc822+="GMT";return rfc822;},__padWithZero:function(val){if(parseInt(val)<10){return"0"+val;}return val;},__getTZOString:function(timezoneOffset){var hours=Math.floor(timezoneOffset/60);var modMin=Math.abs(timezoneOffset%60);var s=new String();s+=(hours>0)?"-":"+";var absHours=Math.abs(hours);s+=(absHours<10)?"0"+absHours:absHours;s+=((modMin==0)?"00":modMin);return(s);},__setDate:function(event){var elm=event.element();var checkDate;var target;if(elm.id.indexOf("Pitch")!=-1){checkDate=this._recommendedTime;target="challengePitchTime";}if(elm.id.indexOf("Recommended")!=-1){checkDate=this._voteTime;target="challengeRecommendedTime";}if(elm.id.indexOf("Vote")!=-1){checkDate=this._creditedTime;target="challengeVoteTime";}if(elm.id.indexOf("Credited")!=-1){target="challengeCreditedTime";}var dateText=$(target+"Month").options[$(target+"Month").selectedIndex].value+"/"+$(target+"Day").options[$(target+"Day").selectedIndex].value+"/"+$(target+"Year").options[$(target+"Year").selectedIndex].value+" "+$(target+"Hour").options[$(target+"Hour").selectedIndex].text;$(target+"Eastern").innerHTML="* "+getDateAndTimeFromUTC(dateText,-4,"EST",false,false);$(target+"Pacific").innerHTML="* "+getDateAndTimeFromUTC(dateText,-7,"PST",false,false);var cDate=this.__getRFC822Date(new Date(dateText));$(target).value=cDate;},__onChallengeTypeChange:function(event){if(this._challengeSelect.options[this._challengeSelect.selectedIndex].value=="STORYMAKER"){this._storylineWidthField.value=this._storylineWidth;this._storylineHeightField.value=this._storylineHeight;if($("storymakerBits")){Effect.SlideDown("storymakerBits");}this._challengeType="STORYMAKER";}else{this._storylineWidthField.value="";this._storylineHeightField.value="";if($("storymakerBits")&&this._challengeType=="STORYMAKER"){Effect.SlideUp("storymakerBits");}this._challengeType=this._challengeSelect.options[this._challengeSelect.selectedIndex].value;}},__onChallengeWidthChange:function(event){if(isNaN(this._storylineWidthField.value)){this._storylineWidthField.value=this._storylineWidth;}else{this._storylineWidth=this._storylineWidthField.value;}},__onChallengeHeightChange:function(event){if(isNaN(this._storylineHeightField.value)){this._storylineHeightField.value=this._storylineHeight;}else{this._storylineHeight=this._storylineHeightField.value;}}});current.stub("current.content.groups");current.content.groups.GroupAdminEditPage=Class.create({initialize:function(){this._pageId=current.site.Page.getInstance().getId();this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();this._imageUrl="";this._startSceneImageUrl="";},init:function(tags,tagsHolder,groupSlug){var include=new current.TagsBrowser(tags,tagsHolder,{minChars:2,tokens:",",disablePreselect:true,choices:12});this._slug=groupSlug;CharacterCounter.getInstance();this.addRemoveLinks($(document.getElementsByTagName("body")[0]));},makeChallenge:function(){this._isChallenge=false;this._challengeEdit=true;this._aMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this._aDays=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");this._pitchStart="";this._recommendedStart="";this._voteStart="";this._creditedStart="";this._imageUrlField=$("groupAdminEdit_challengeImage");this._imageUrlDel=$("groupAdminEdit_deleteChallengeImage");this._startSceneImageUrlField=$("groupAdminEdit_challengeStartSceneImage");this._startSceneImageUrlDel=$("groupAdminEdit_deleteChallengeStartSceneImage");this._challengeSelect=$("groupCreate_challengeType");this._storylineWidthField=$("groupCreate_challengeStartSceneImageWidth");this._storylineHeightField=$("groupCreate_challengeStartSceneImageHeight");this._storylineWidth="400";this._storylineHeight="300";this.__makeChallenge();},setChallengeImage:function(imageUrl){this._imageUrl=imageUrl;},setChallengeStartSceneImage:function(startSceneImageUrl){this._startSceneImageUrl=startSceneImageUrl;},setChallengeType:function(type){this._challengeType=type;},__makeChallenge:function(){if(this._imageUrl!=""){this._displayChallengeImage(this._imageUrl);}if(this._startSceneImageUrl!=""){this._displayChallengeStartSceneImage(this._startSceneImageUrl);}console.log("__makeChallenge: "+this._startSceneImageUrl);var cals=$$(".isDateTime");for(var i=0;i<cals.length;i++){this.__onLoadDate(cals[i]);}var sels=$$(".dateTimeSelect");for(var i=0;i<sels.length;i++){Event.observe(sels[i],"change",this.__setDate.bindAsEventListener(this));}if($("challengeMinScenesSlider")&&!this._minSlider){this._minSlider=new Control.Slider($("challengeMinScenesSlider").down(".handle"),$("challengeMinScenesSlider"),{range:$R(1,22),sliderValue:$("groupAdminEdit_challengeMinScenes").value,onSlide:function(value){$("groupAdminEdit_challengeMinScenes").value=parseInt(value)+"";},onChange:function(value){$("groupAdminEdit_challengeMinScenes").value=parseInt(value)+"";}});}if($("challengeMaxScenesSlider")&&!this._maxSlider){var maxSlider=new Control.Slider($("challengeMaxScenesSlider").down(".handle"),$("challengeMaxScenesSlider"),{range:$R(1,22),sliderValue:$("groupAdminEdit_challengeMaxScenes").value,onSlide:function(value){$("groupAdminEdit_challengeMaxScenes").value=parseInt(value)+"";},onChange:function(value){$("groupAdminEdit_challengeMaxScenes").value=parseInt(value)+"";}});}$$(".challengeTimeCheckbox").invoke("observe","click",this.__onChallengeTimeChange.bindAsEventListener(this));},__onChallengeTimeChange:function(event){var el=event.element();if(el.checked==true){el.value=true;el.up(".elementContainer").down(".inputs").show();}else{el.value=false;el.up(".elementContainer").down(".inputs").hide();}},_displayChallengeImage:function(path){if(path==""){return ;}$(this._imageUrlField).hide();$(this._imageUrlField).up().insert(new Element("a",{href:"#",id:"imageUrlRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var imageUrlHolder=new Element("div",{id:"imageUrlHolder","class":"assetHolder",style:"width: 480px; overflow-x: auto;"}).update(new Element("img",{src:this._dataNodeUrl+path}));imageUrlHolder.insert(new Element("a",{href:"#",id:"imageUrlReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$(this._imageUrlField).up().insert(imageUrlHolder);Event.observe($("imageUrlRevertLink"),"click",this._hideChallengeImage.bindAsEventListener(this));Event.observe($("imageUrlReplaceLink"),"click",this._showChallengeImage.bindAsEventListener(this));},_hideChallengeImage:function(){$(this._imageUrlDel).value="false";$(this._imageUrlField).hide();$("imageUrlRevertLink").hide();$("imageUrlHolder").show();},_showChallengeImage:function(){$(this._imageUrlDel).value="true";$("imageUrlHolder").hide();$(this._imageUrlField).show();$("imageUrlRevertLink").show();},_displayChallengeStartSceneImage:function(path){if(path==""){return ;}var newPath=path;if(newPath.indexOf("http")==-1){newPath=this._dataNodeUrl+path;}$(this._startSceneImageUrlField).hide();$(this._startSceneImageUrlField).up().insert(new Element("a",{href:"#",id:"startSceneImageUrlRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var startSceneImageUrlHolder=new Element("div",{id:"startSceneImageUrlHolder","class":"assetHolder",style:"width: 400px; overflow-x: auto;"}).update(new Element("img",{src:newPath}));startSceneImageUrlHolder.insert(new Element("a",{href:"#",id:"startSceneImageUrlReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$(this._startSceneImageUrlField).up().insert(startSceneImageUrlHolder);Event.observe($("startSceneImageUrlRevertLink"),"click",this._hideChallengeStartSceneImage.bindAsEventListener(this));Event.observe($("startSceneImageUrlReplaceLink"),"click",this._showChallengeStartSceneImage.bindAsEventListener(this));},_hideChallengeStartSceneImage:function(){$(this._startSceneImageUrlDel).value="false";$(this._startSceneImageUrlField).hide();$("startSceneImageUrlRevertLink").hide();$("startSceneImageUrlHolder").show();},_showChallengeStartSceneImage:function(){$(this._startSceneImageUrlDel).value="true";$("startSceneImageUrlHolder").hide();$(this._startSceneImageUrlField).show();$("startSceneImageUrlRevertLink").show();},addRemoveLinks:function(target){target.select(".removeIncl").invoke("observe","click",this.__onRemoveIncludeClick.bindAsEventListener(this));target.select(".removeSite").invoke("observe","click",this.__onRemoveWebsiteClick.bindAsEventListener(this));},__onRemoveIncludeClick:function(event){event.stop();var el=event.element();if($("throbber_"+el.id)){$("throbber_"+el.id).show();}current.proxy.CCCP.execute("group","include_tags",{id:this._slug,tagIds:el.id,action:"delete"},this.__onRemoveSuccess.bindAsEventListener(this,el));},__onRemoveWebsiteClick:function(event){event.stop();var el=event.element();if($("throbber_"+el.id)){$("throbber_"+el.id).show();}if(window._s_){window._s_.decrementCount();}var url=el.rel;current.proxy.CCCP.execute("group","post_submitted_sites",{id:this._slug,siteUrls:url,action:"delete"},this.__onRemoveSuccess.bindAsEventListener(this,el));},__onRemoveSuccess:function(data,el){if(data!=null){el.up("li").hide();}},__onLoadDate:function(elm){var stringValue=elm.value;now=new Date();localeShift=now.getTimezoneOffset()/60;now.setHours(now.getHours()+localeShift);now.setMinutes(0);var tempDateString=this.__getRFC822Date(now);var endTime;if(elm.id.indexOf("Pitch")!=-1){this._pitchTime=(stringValue=="")?tempDateString:elm.value;$(elm.id).value=this._pitchTime;endTime=this._pitchTime;}if(elm.id.indexOf("Recommended")!=-1){var shift=new Date(now.getTime()+(7*24*60*60*1000));this._recommendedTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._recommendedTime;endTime=this._recommendedTime;}if(elm.id.indexOf("Vote")!=-1){var shift=new Date(now.getTime()+(14*24*60*60*1000));this._voteTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._voteTime;endTime=this._voteTime;}if(elm.id.indexOf("Credited")!=-1){var shift=new Date(now.getTime()+(21*24*60*60*1000));this._creditedTime=(stringValue=="")?this.__getRFC822Date(shift):elm.value;$(elm.id).value=this._creditedTime;endTime=this._creditedTime;}var end=new Date(endTime);end.setHours(end.getHours()+end.getTimezoneOffset()/60);endTime=end.toString();var month=end.getMonth();var day=end.getDate()-1;var year=end.getFullYear();var hour=end.getHours()-1;if(hour<0){hour=0;}this.__updateTimeSelects(elm.id,month,day,year,hour,endTime);},__updateTimeSelects:function(id,month,day,year,hour,endTime){if($(id+"Month")&&$(id+"Month").options[month]){$(id+"Month").options[month].selected=true;}if($(id+"Day")&&$(id+"Day").options[day]){$(id+"Day").options[day].selected=true;}if($(id+"Year")){for(var i=0;i<$(id+"Year").options.length;i++){if($(id+"Year").options[i].value==year){$(id+"Year").options[i].selected=true;}}}if($(id+"Hour")){for(var i=0;i<$(id+"Hour").options.length;i++){if($(id+"Hour").options[i].value==hour){$(id+"Hour").options[i].selected=true;}}}if($(id+"Eastern")){$(id+"Eastern").innerHTML="* "+getDateAndTimeFromUTC(endTime,-4,"EST",false,false);}if($(id+"Pacific")){$(id+"Pacific").innerHTML="* "+getDateAndTimeFromUTC(endTime,-7,"PST",false,false);}},__getRFC822Date:function(oDate){var rfc822=new String();rfc822=this._aDays[oDate.getDay()]+", ";rfc822+=this.__padWithZero(oDate.getDate())+" ";rfc822+=this._aMonths[oDate.getMonth()]+" ";rfc822+=oDate.getFullYear()+" ";rfc822+=this.__padWithZero(oDate.getHours())+":";rfc822+=this.__padWithZero(oDate.getMinutes())+":";rfc822+=this.__padWithZero(oDate.getSeconds())+" ";rfc822+="GMT";return rfc822;},__padWithZero:function(val){if(parseInt(val)<10){return"0"+val;}return val;},__getTZOString:function(timezoneOffset){var hours=Math.floor(timezoneOffset/60);var modMin=Math.abs(timezoneOffset%60);var s=new String();s+=(hours>0)?"-":"+";var absHours=Math.abs(hours);s+=(absHours<10)?"0"+absHours:absHours;s+=((modMin==0)?"00":modMin);return(s);},__setDate:function(event){var elm=event.element();var checkDate;var target;if(elm.id.indexOf("Pitch")!=-1){checkDate=this._recommendedTime;target="challengePitchTime";}if(elm.id.indexOf("Recommended")!=-1){checkDate=this._voteTime;target="challengeRecommendedTime";}if(elm.id.indexOf("Vote")!=-1){checkDate=this._creditedTime;target="challengeVoteTime";}if(elm.id.indexOf("Credited")!=-1){target="challengeCreditedTime";}var dateText=$(target+"Month").options[$(target+"Month").selectedIndex].value+"/"+$(target+"Day").options[$(target+"Day").selectedIndex].value+"/"+$(target+"Year").options[$(target+"Year").selectedIndex].value+" "+$(target+"Hour").options[$(target+"Hour").selectedIndex].text;$(target+"Eastern").innerHTML="* "+getDateAndTimeFromUTC(dateText,-4,"EST",false,false);$(target+"Pacific").innerHTML="* "+getDateAndTimeFromUTC(dateText,-7,"PST",false,false);var cDate=this.__getRFC822Date(new Date(dateText));$(target).value=cDate;}});current.stub("current.content.groups");current.content.groups.GroupAdminMembersPage=Class.create({initialize:function(){this._pageId=current.site.Page.getInstance().getId();this._view="members";this.addMemberLinks($(document.getElementsByTagName("body")[0]));},setView:function(val){this._view=val;},setSlug:function(slug){this._slug=slug;},addMemberLinks:function(target){target.select(".demoteUser").invoke("observe","click",this.__onPromoteClick.bindAsEventListener(this));target.select(".promoteUser").invoke("observe","click",this.__onPromoteClick.bindAsEventListener(this));target.select(".banUser").invoke("observe","click",this.__onBanClick.bindAsEventListener(this));},__onPromoteClick:function(event){event.stop();var el=event.element();var uname=el.rel;var act="add";if(el.hasClassName("mod")){el.removeClassName("mod");el.addClassName("mem");act="delete";}else{el.removeClassName("mem");el.addClassName("mod");act="add";}var param={id:this._slug,username:uname,action:act};current.proxy.CCCP.execute("group","promote_member",param,this.__onPromoteData.bindAsEventListener(this,el,act));},__onPromoteData:function(data,el,act){if(data){if(act=="add"){el.innerHTML=current.locale.Bundle.get("group.admin.revoke");el.up().down("span").innerHTML=current.locale.Bundle.get("group.admin.moderator");}else{el.innerHTML=current.locale.Bundle.get("group.admin.make_moderator");el.up().down("span").innerHTML=current.locale.Bundle.get("group.admin.member");}var session=current.Session.getInstance();session.setUserId(el.id);session.invalidate();}},__onBanClick:function(event){event.stop();var el=event.element();var uname=el.rel;var act="add";if(el.hasClassName("ban")){el.removeClassName("ban");el.addClassName("unb");act="add";}else{el.removeClassName("unb");el.addClassName("ban");act="delete";}var param={id:this._slug,username:uname,action:act};current.proxy.CCCP.execute("group","ban_user",param,this.__onBanData.bindAsEventListener(this,el,act));},__onBanData:function(data,el,act){if(data){var userId=(el.id.indexOf("ban_")!=-1)?el.id.substring(el.id.indexOf("_")+1):el.id;if(act=="add"){el.hide();if(this._view=="members"){$(userId).up().down("span").innerHTML=current.locale.Bundle.get("group.admin.banned");$(userId).hide();var memCount=parseInt($("memCount").innerHTML);$("memCount").innerHTML=((memCount-1)>0)?memCount-1:0;}var banCount=parseInt($("banCount").innerHTML);$("banCount").innerHTML=banCount+1;}else{el.innerHTML=current.locale.Bundle.get("group.admin.ban");if(this._view=="members"){$(userId).up().down("span").show();$(userId).show();var memCount=parseInt($("memCount").innerHTML);$("memCount").innerHTML=memCount+1;}else{el.up("li").hide();}var banCount=parseInt($("banCount").innerHTML);$("banCount").innerHTML=((banCount-1)>0)?banCount-1:0;}var session=current.Session.getInstance();session.setUserId(userId);session.invalidate();}}});current.stub("current.content.groups");current.content.groups.GroupAdminSidebar=Class.create({initialize:function(slug){this._slug=slug;this._visibilityItem=$j("#changeVisibilityItem");this._visibilityButton=$j("#changeVisibility");this._visibilityDomElement=this._visibilityButton.get(0);this._contentPolicyItem=$j("#changeContentPolicyItem");this._contentPolicyButton=$j("#changeContentPolicy");this._contentPolicyDomElement=this._contentPolicyButton.get(0);this._moderationPolicyItem=$j("#changeModerationPolicyItem");this._moderationPolicyButton=$j("#changeModerationPolicy");this._moderationPolicyDomElement=this._moderationPolicyButton.get(0);this._joinItem=$j("#sidebarJoinItem");this._joinButton=$j("#sidebarJoinButton");this._joinDomElement=this._joinButton.get(0);var thisObj=this;this._visibilityButton.click(function(event){thisObj.__clickHandler(event);});this._contentPolicyButton.click(function(event){thisObj.__clickHandler(event);});this._moderationPolicyButton.click(function(event){thisObj.__clickHandler(event);});if(this._joinButton){this._joinButton.click(function(event){thisObj.__clickHandler(event);});}},__clickHandler:function(event){var subhead,desc,target=event.target;if(target==this._visibilityDomElement){event.preventDefault();subhead=this._visibilityItem.children(".subhead");desc=this._visibilityItem.children(".desc");var visible=subhead.hasClass("green");if(visible){if(confirm("This will hide this page from the general public. Are you sure you want to do this?")){GroupService.setGroupHidden(this._slug,true,function(){subhead.removeClass("red green").addClass("red");subhead.children("span").text("hidden");desc.text("Only staff with admin roles can see this page");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}else{if(confirm("This will make the page visible to the general public. Are you sure you want to do this?")){GroupService.setGroupHidden(this._slug,false,function(){subhead.removeClass("red green").addClass("green");subhead.children("span").text("visible");desc.text("All visitors can see this page");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}}else{if(target==this._contentPolicyDomElement){event.preventDefault();subhead=this._contentPolicyItem.children(".subhead");desc=this._contentPolicyItem.children(".desc");var open=subhead.hasClass("green");if(open){if(confirm("This will prevent the general public from adding items to this group. Are you sure you want to do this?")){GroupService.setGroupClosed(this._slug,true,function(){subhead.removeClass("red green").addClass("red");subhead.children("span").text("posting closed");desc.text("Only staff can add items to this page's group");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}else{if(confirm("This will allow the general public to add items to this group. Are you sure you want to do this?")){GroupService.setGroupClosed(this._slug,false,function(){subhead.removeClass("red green").addClass("green");subhead.children("span").text("posting open");desc.text("Any registered user can add items to this page's group");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}}else{if(target==this._moderationPolicyDomElement){event.preventDefault();subhead=this._moderationPolicyItem.children(".subhead");desc=this._moderationPolicyItem.children(".desc");var unmoderated=subhead.hasClass("green");if(unmoderated){if(confirm("This will change the moderation policy such that items added to the group must be approved by a moderator before they are live. Are you sure you want to do this?")){GroupService.setGroupSubmissionPolicy(this._slug,"MODERATED",function(){subhead.removeClass("red green").addClass("red");subhead.children("span").text("moderated");desc.text("Items added to this page's group must first be approved by a moderator");},this.__onEditFailure.bind(this));}}else{if(confirm("This will change the moderation policy such that items added to the group are instantly live. Are you sure you want to do this?")){GroupService.setGroupSubmissionPolicy(this._slug,"OPEN",function(){subhead.removeClass("red green").addClass("green");subhead.children("span").text("unmoderated");desc.text("Items added to this page's group are instantly live");},this.__onEditFailure.bind(this));}}}else{if(target==this._joinDomElement){event.preventDefault();subhead=this._joinItem.children(".subhead");var member=subhead.hasClass("green");if(member){if(confirm("This remove you from the list of group members. If you are a moderator you will lose moderator status in this group. Are you sure you want to do this?")){var param={id:this._slug,username:current.User.getInstance().getName(),action:"delete"};current.proxy.CCCP.execute("group","join_group",param,function(){subhead.removeClass("red green").addClass("red");subhead.children("span").text("you are not a member");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}else{if(confirm("This will add you to the list of group members. Are you sure you want to do this?")){var param={id:this._slug,username:current.User.getInstance().getName(),action:"add"};current.proxy.CCCP.execute("group","join_group",param,function(){subhead.removeClass("red green").addClass("green");subhead.children("span").text("you are a member");},this.__onEditFailure.bind(this));Effect.Pulsate($(target),{pulses:2,duration:1});}}var session=current.Session.getInstance();session.setUserId(current.User.getInstance().getId());session.setFireAndForget(true);session.invalidate();}}}}},__onEditFailure:function(){alert(current.locale.Bundle.get("verify.An_error_has_occurred"));}});current.content.groups.GroupAdminSidebar.getInstance=function(slug){if(!document.__currentGroupAdminSidebar__){document.__currentGroupAdminSidebar__=new current.content.groups.GroupAdminSidebar(slug);}return document.__currentGroupAdminSidebar__;};current.stub("current.content.groups");current.content.groups.GroupAdminCustomLayoutPage=Class.create({initialize:function(layoutPrefix,ribbonPrefix,itemRibbonPrefix,ugoPrefix,navPrefix,slug,groupType){this._slug=slug;this._groupType=groupType;this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();this._elements=new Array();this._feeds=new Array();this._itemElements=new Array();this._itemFeeds=new Array();this._customLayoutsLength=21;this._customLayoutPrefix=layoutPrefix;this._customRibbonPrefix=ribbonPrefix;this._customItemRibbonPrefix=itemRibbonPrefix;this._customUgoPrefix=ugoPrefix;this._customNavPrefix=navPrefix;this._customItemLayoutsLength=3;},init:function(){var cl=this._customLayoutPrefix+"_layoutType_";var cr=this._customRibbonPrefix+"_ribbon_color";var cli=this._customLayoutPrefix+"_itemLayoutType_custom";this._disassembleJSON();for(var i=0;i<6;i++){if($(cr+i)){attachColorPicker($(cr+i));}}for(var i=1;i<this._customItemLayoutsLength+1;i++){if($(cli+i)){$(cli+i).observe("click",this.__switchItemLayout.bindAsEventListener(this,i));}}$$(".template a").invoke("observe","mouseover",this.__showTemplateExplainer.bindAsEventListener(this));$$(".template a").invoke("observe","mouseout",this.__hideTemplateExplainer.bindAsEventListener(this));this.__showCustomElements();window._r_.toggleAddButton();window._itmr_.toggleAddButton();CharacterCounter.getInstance();},__switchItemLayout:function(event,val){this._itemLayoutType=val;this.__showCustomElements(event);},__showCustomElements:function(event){this.__hideCustomElements();var className=".custom"+this._layoutType+"Element";$$(className).each(function(el){el.show();});className=".customItem"+this._itemLayoutType+"Element";$$(className).each(function(el){el.show();});if(this._groupType=="family"){className=".customFamilyElement";$$(className).each(function(el){el.show();});}},__hideCustomElements:function(event){$$(".customElement").each(function(el){el.hide();});},__showTemplateExplainer:function(event){$("templateExplainer").update(event.element().up("a").title);Effect.Appear($("templateExplainer"),{duration:0.2});},__hideTemplateExplainer:function(){$("templateExplainer").hide();},setLayoutType:function(val){this._layoutType=val;},setItemLayoutType:function(val){this._itemLayoutType=val;this.showCustomElements();},showCustomElements:function(){this.__showCustomElements();},hideCustomElements:function(){this.__hideCustomElements();},_displayFileUpload:function(path,pre,id,type){if(path==""){return ;}var delStr=current.locale.Bundle.get("custom_layouts.delete_css");if(type=="image"){delStr=current.locale.Bundle.get("custom_layouts.delete_image");}if($(pre+"_"+id)){$(pre+"_"+id).hide();$(pre+"_"+id).up().insert(new Element("a",{href:"#",id:"fileRevertLink_"+id,onclick:"return false;","class":"revertLink",style:"display: none"}).update(current.locale.Bundle.get("custom_layouts.cancel")));var fileHolder=new Element("div",{id:"fileHolder_"+id,"class":"assetHolder"}).update(new Element("a",{href:this._dataNodeUrl+path}).update(path));fileHolder.insert(new Element("a",{href:"#",id:"fileReplaceLink_"+id,onclick:"return false;","class":"replaceLink"}).update(delStr));$(pre+"_"+id).up().insert(fileHolder);Event.observe($("fileRevertLink_"+id),"click",this._hideFileUpload.bindAsEventListener(this,pre,id));Event.observe($("fileReplaceLink_"+id),"click",this._showFileUpload.bindAsEventListener(this,pre,id));}},_hideFileUpload:function(event,pre,id){$(pre+"_delete_"+id).value="false";$(pre+"_"+id).hide();$("fileRevertLink_"+id).hide();$("fileHolder_"+id).show();},_showFileUpload:function(event,pre,id){$(pre+"_delete_"+id).value="true";$("fileHolder_"+id).hide();$(pre+"_"+id).show();$("fileRevertLink_"+id).show();},_disassembleJSON:function(){var scope=this;var count=0;this._JSONData=$("versionedData_jsonData").value;if(this._JSONData.isJSON()){this._JSONData=this._JSONData.evalJSON();if(this._JSONData.group.data.headerpath){this._displayFileUpload(this._JSONData.group.data.headerpath,this._customLayoutPrefix,"headerPath","image");if($(this._customLayoutPrefix+"_delete_headerPath")){$(this._customLayoutPrefix+"_delete_headerPath").value="false";}if($(this._customLayoutPrefix+"_old_headerPath")){$(this._customLayoutPrefix+"_old_headerPath").value=this._JSONData.group.data.headerpath;}}if(this._JSONData.group.skin.css){this._displayFileUpload(this._JSONData.group.skin.css,this._customLayoutPrefix,"skinPath","css");if($(this._customLayoutPrefix+"_delete_skinPath")){$(this._customLayoutPrefix+"_delete_skinPath").value="false";}if($(this._customLayoutPrefix+"_old_skinPath")){$(this._customLayoutPrefix+"_old_skinPath").value=this._JSONData.group.skin.css;}}if(this._JSONData.group.skin.js){this._displayFileUpload(this._JSONData.group.skin.js,this._customLayoutPrefix,"jsPath","js");if($(this._customLayoutPrefix+"_delete_jsPath")){$(this._customLayoutPrefix+"_delete_jsPath").value="false";}if($(this._customLayoutPrefix+"_old_jsPath")){$(this._customLayoutPrefix+"_old_jsPath").value=this._JSONData.group.skin.js;}}if($(this._customLayoutPrefix+"_sandbox0")&&this._JSONData.group.sandboxes.s0!=""&&this._JSONData.group.sandboxes.s0!=null){$(this._customLayoutPrefix+"_sandbox0").value=this._JSONData.group.sandboxes.s0;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_0")){$("templ_"+i+"_0").removeClassName("editEmpty");}if($("templ_"+i+"_0")){$("templ_"+i+"_0").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox1")&&this._JSONData.group.sandboxes.s1!=""&&this._JSONData.group.sandboxes.s1!=null){$(this._customLayoutPrefix+"_sandbox1").value=this._JSONData.group.sandboxes.s1;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_1")){$("templ_"+i+"_1").removeClassName("editEmpty");}if($("templ_"+i+"_1")){$("templ_"+i+"_1").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox2")&&this._JSONData.group.sandboxes.s2!=""&&this._JSONData.group.sandboxes.s2!=null){$(this._customLayoutPrefix+"_sandbox2").value=this._JSONData.group.sandboxes.s2;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_2")){$("templ_"+i+"_2").removeClassName("editEmpty");}if($("templ_"+i+"_2")){$("templ_"+i+"_2").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox3")&&this._JSONData.group.sandboxes.s3!=""&&this._JSONData.group.sandboxes.s3!=null){$(this._customLayoutPrefix+"_sandbox3").value=this._JSONData.group.sandboxes.s3;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_3")){$("templ_"+i+"_3").removeClassName("editEmpty");}if($("templ_"+i+"_3")){$("templ_"+i+"_3").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox4")&&this._JSONData.group.sandboxes.s4!=""&&this._JSONData.group.sandboxes.s4!=null){$(this._customLayoutPrefix+"_sandbox4").value=this._JSONData.group.sandboxes.s4;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_4")){$("templ_"+i+"_4").removeClassName("editEmpty");}if($("templ_"+i+"_4")){$("templ_"+i+"_4").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox5")&&this._JSONData.group.sandboxes.s5!=""&&this._JSONData.group.sandboxes.s5!=null){$(this._customLayoutPrefix+"_sandbox5").value=this._JSONData.group.sandboxes.s5;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_5")){$("templ_"+i+"_5").removeClassName("editEmpty");}if($("templ_"+i+"_5")){$("templ_"+i+"_5").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_sandbox6")&&this._JSONData.group.sandboxes.s6!=""&&this._JSONData.group.sandboxes.s6!=null){$(this._customLayoutPrefix+"_sandbox6").value=this._JSONData.group.sandboxes.s6;for(var i=1;i<this._customLayoutsLength+1;i++){if($("templ_"+i+"_6")){$("templ_"+i+"_6").removeClassName("editEmpty");}if($("templ_"+i+"_6")){$("templ_"+i+"_6").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_parentGroup")&&this._JSONData.group.data.parentgroup!=""&&this._JSONData.group.data.parentgroup!=null){$(this._customLayoutPrefix+"_parentGroup").value=this._JSONData.group.data.parentgroup;}if($(this._customLayoutPrefix+"_contentSource")&&this._JSONData.group.data.contentsource!=""&&this._JSONData.group.data.contentsource!=null){$(this._customLayoutPrefix+"_contentSource").value=this._JSONData.group.data.contentsource;}if(this._JSONData.group.data.nav){count=0;this._JSONData.group.data.nav.each(function(v){if(v.title!=""){window._cn_.addOtherNavElement("none",0);$(scope._customNavPrefix+"_customNav_text"+count).value=v.title;$(scope._customNavPrefix+"_customNav_link"+count).value=v.link;$("customNav_"+count).show();count++;}});window._cn_.setNavElementIndex(count);}if(this._JSONData.item.data.headerpath){this._displayFileUpload(this._JSONData.item.data.headerpath,this._customLayoutPrefix,"itemHeaderPath","image");if($(this._customLayoutPrefix+"_delete_itemHeaderPath")){$(this._customLayoutPrefix+"_delete_itemHeaderPath").value="false";}if($(this._customLayoutPrefix+"_old_itemHeaderPath")){$(this._customLayoutPrefix+"_old_itemHeaderPath").value=this._JSONData.item.data.headerpath;}}if(this._JSONData.item.skin.css){this._displayFileUpload(this._JSONData.item.skin.css,this._customLayoutPrefix,"itemSkinPath","css");if($(this._customLayoutPrefix+"_delete_itemSkinPath")){$(this._customLayoutPrefix+"_delete_itemSkinPath").value="false";}if($(this._customLayoutPrefix+"_old_itemSkinPath")){$(this._customLayoutPrefix+"_old_itemSkinPath").value=this._JSONData.item.skin.css;}}if(this._JSONData.item.skin.js){this._displayFileUpload(this._JSONData.item.skin.js,this._customLayoutPrefix,"itemJsPath","js");if($(this._customLayoutPrefix+"_delete_itemJsPath")){$(this._customLayoutPrefix+"_delete_itemJsPath").value="false";}if($(this._customLayoutPrefix+"_old_itemJsPath")){$(this._customLayoutPrefix+"_old_itemJsPath").value=this._JSONData.item.skin.js;}}if($(this._customLayoutPrefix+"_itemSandbox0")&&this._JSONData.item.sandboxes.s0!=""&&this._JSONData.item.sandboxes.s0!=null){$(this._customLayoutPrefix+"_itemSandbox0").value=this._JSONData.item.sandboxes.s0;for(var i=1;i<this._customLayoutsLength+1;i++){if($("itemTempl_"+i+"_0")){$("itemTempl_"+i+"_0").removeClassName("editEmpty");}if($("itemTempl_"+i+"_0")){$("itemTempl_"+i+"_0").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_itemSandbox1")&&this._JSONData.item.sandboxes.s1!=""&&this._JSONData.item.sandboxes.s1!=null){$(this._customLayoutPrefix+"_itemSandbox1").value=this._JSONData.item.sandboxes.s1;for(var i=1;i<this._customLayoutsLength+1;i++){if($("itemTempl_"+i+"_1")){$("itemTempl_"+i+"_1").removeClassName("editEmpty");}if($("itemTempl_"+i+"_1")){$("itemTempl_"+i+"_1").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_itemSandbox2")&&this._JSONData.item.sandboxes.s2!=""&&this._JSONData.item.sandboxes.s2!=null){$(this._customLayoutPrefix+"_itemSandbox2").value=this._JSONData.item.sandboxes.s2;for(var i=1;i<this._customLayoutsLength+1;i++){if($("itemTempl_"+i+"_2")){$("itemTempl_"+i+"_2").removeClassName("editEmpty");}if($("itemTempl_"+i+"_2")){$("itemTempl_"+i+"_2").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_itemSandbox3")&&this._JSONData.item.sandboxes.s3!=""&&this._JSONData.item.sandboxes.s3!=null){$(this._customLayoutPrefix+"_itemSandbox3").value=this._JSONData.item.sandboxes.s3;for(var i=1;i<this._customLayoutsLength+1;i++){if($("itemTempl_"+i+"_3")){$("itemTempl_"+i+"_3").removeClassName("editEmpty");}if($("itemTempl_"+i+"_3")){$("itemTempl_"+i+"_3").addClassName("editFull");}}}if($(this._customLayoutPrefix+"_itemSandbox4")&&this._JSONData.item.sandboxes.s4!=""&&this._JSONData.item.sandboxes.s4!=null){$(this._customLayoutPrefix+"_itemSandbox4").value=this._JSONData.item.sandboxes.s4;for(var i=1;i<this._customLayoutsLength+1;i++){if($("itemTempl_"+i+"_4")){$("itemTempl_"+i+"_4").removeClassName("editEmpty");}if($("itemTempl_"+i+"_4")){$("itemTempl_"+i+"_4").addClassName("editFull");}}}if(this._itemLayoutType==1){if(this._JSONData.item.data.ribbons){count=0;this._JSONData.item.data.ribbons.each(function(r){var ifeedCount=0;if(r.title!=""){window._itmr_.addOtherNavElement("",0);$(scope._customItemRibbonPrefix+"_itemRibbon_headerText"+count).value=r.title;r.ribbon.each(function(f){if(f.label!=""&&f.type!=""&&f.data!=""){window._itmr_.addSubNavElement(count,"");$(scope._customItemRibbonPrefix+"_itemRibbon_itemFeedType"+count+"_"+ifeedCount).selectedIndex=scope.__getTypeDropdownIndex(f.type);window._itmr_.selectSubNavType(count+"_"+ifeedCount);$(scope._customItemRibbonPrefix+"_itemRibbon_itemFeedLabel"+count+"_"+ifeedCount).value=f.label;$(scope._customItemRibbonPrefix+"_itemRibbon_itemFeedData"+count+"_"+ifeedCount).value=f.data;scope._itemElements[scope._itemFeeds.length]="itemRibbonFeed_"+count+"_"+ifeedCount;ifeedCount++;}});count++;}});window._itmr_.setNavElementIndex(count);}}var colorList=new Array();count=0;if(this._JSONData.group.data.ribboncolors!=null&&this._JSONData.group.data.ribboncolors!=""){colorList=this._JSONData.group.data.ribboncolors;colorList.each(function(c){if($(scope._customRibbonPrefix+"_ribbon_color"+count)&&c!=""&&c!=null){$(scope._customRibbonPrefix+"_ribbon_color"+count).value=c;$(scope._customRibbonPrefix+"_ribbon_color"+count).style.backgroundColor=c;$(scope._customRibbonPrefix+"_ribbon_color"+count).style.color=c;$(scope._customRibbonPrefix+"_ribbon_color"+count).title="Color: "+c;}count++;});}if(this._JSONData.group.data.ribbons){count=0;if(this._layoutType==1){this._JSONData.group.data.ribbons.each(function(r){var feedCount=0;if(r.title!=""){window._r_.addOtherNavElement("",0);$(scope._customRibbonPrefix+"_ribbon_headerText"+count).value=r.title;r.ribbon.each(function(f){if(f.label!=""&&f.type!=""&&f.data!=""){window._r_.addSubNavElement(count,"");$(scope._customRibbonPrefix+"_ribbon_feedType"+count+"_"+feedCount).selectedIndex=scope.__getTypeDropdownIndex(f.type);window._r_.selectSubNavType(count+"_"+feedCount);$(scope._customRibbonPrefix+"_ribbon_feedLabel"+count+"_"+feedCount).value=f.label;$(scope._customRibbonPrefix+"_ribbon_feedData"+count+"_"+feedCount).value=f.data;scope._elements[scope._feeds.length]="ribbonFeed_"+count+"_"+feedCount;feedCount++;}});count++;}});window._r_.setNavElementIndex(count);}if(this._layoutType==3){this._JSONData.group.data.ribbons.each(function(v){var playlistCount=0;if(v.title!=""){window._vp_.addOtherNavElement("none",0);$(scope._customRibbonPrefix+"_video_headerText"+count).value=v.title;v.ribbon.each(function(p){if(p.label!=""&&p.sort!=""&&p.data!=""){window._vp_.addSubNavElement(count,"none");$(scope._customRibbonPrefix+"_video_playlistSort"+count+"_"+playlistCount).selectedIndex=scope.__getSortDropdownIndex(p.sort);window._vp_.selectSubNavSort(count+"_"+playlistCount);$(scope._customRibbonPrefix+"_video_playlistType"+count+"_"+playlistCount).selectedIndex=scope.__getTypeDropdownIndex(p.type);window._vp_.selectSubNavType(count+"_"+playlistCount);$(scope._customRibbonPrefix+"_video_playlistLabel"+count+"_"+playlistCount).value=p.label;$(scope._customRibbonPrefix+"_video_playlistData"+count+"_"+playlistCount).value=p.data;scope._elements[scope._feeds.length]="playlist_"+count+"_"+playlistCount;playlistCount++;}});count++;}});window._vp_.setNavElementIndex(count);}}if(this._JSONData.group.data.ugos){count=0;if(this._layoutType==4){this._JSONData.group.data.ugos.each(function(u){if(u.ugo_title!=""||u.ugo_url!=""||u.ugo_thumb!=""){window._vu_.addOtherElement("none");$(scope._customUgoPrefix+"_van_ugo_title"+count).value=u.ugo_title;$(scope._customUgoPrefix+"_van_ugo_desc"+count).value=u.ugo_desc;$(scope._customUgoPrefix+"_van_ugo_url"+count).value=u.ugo_url;scope._displayFileUpload(u.ugo_thumb,scope._customUgoPrefix,"van_ugo_thumb"+count,"image");if($(scope._customUgoPrefix+"_delete_van_ugo_thumb"+count)){$(scope._customUgoPrefix+"_delete_van_ugo_thumb"+count).value="false";}if($(scope._customUgoPrefix+"_old_van_ugo_thumb"+count)){$(scope._customUgoPrefix+"_old_van_ugo_thumb"+count).value=u.ugo_thumb;}scope._elements[scope._elements.length]="van_ugoElement_"+count;}count++;});}}}},__getTypeDropdownIndex:function(type){switch(type){case"group":return 0;case"tag":return 1;default:return 0;}},__getSortDropdownIndex:function(type){switch(type){case"new":return 0;case"popular":return 1;default:return 0;}},addElementEntry:function(val){var next=parseInt(val)+1;if(next<7){var nel=$("jsonElement_"+next);nel.show();}}});current.stub("current.content.groups");current.content.groups.GroupAdminCMSPage=Class.create({initialize:function(slug){this._slug=slug;this._cloneVersion=0;this._tmplPicked=false;this._tmplLocked=false;},init:function(){$$(".versionDeleteLink").invoke("observe","click",this.__onDeleteClick.bindAsEventListener(this));$$(".sortLink").invoke("observe","click",this.__onListSort.bindAsEventListener(this));$$(".newDraftButton").invoke("observe","click",this.__onDraftCreateClick.bindAsEventListener(this));},__onDeleteClick:function(event){event.stop();var el=event.element();if(confirm("This will remove version "+el.rel+" permanently. There is no undo. Are you sure you want to do this?")){this._row=el.up("ul");current.proxy.CCCP.execute("group","versioned_data_version_post",{id:this._slug,action:"delete",version:el.rel},this.__onDelete.bindAsEventListener(this),this.__onError.bindAsEventListener(this));}},setTmplLocked:function(b){this._tmplLocked=true;},__onDelete:function(data){Effect.DropOut(this._row);},__onError:function(data){alert("oops... delete failed");},__onListSort:function(event){setTimedCrumb(current.Cookies.PREFERENCES,"cmsSort",event.element().rel,525948);},__onDraftCreateClick:function(event){event.stop();var el=event.element();this._cloneVersion=el.rel;this.openDraftCreateWindow(event);},openDraftCreateWindow:function(event){this._modalWidth=715;this._headline="create a new version";this._eventElement=current.utils.Compatibility.getEventElement(event);if(!isUndefined(event)&&event!=null){this._posTop=this._eventElement.cumulativeOffset()["top"];}else{this._posTop=80;}this._winWidth=document.viewport.getWidth();this._posLeft=parseFloat(parseFloat(parseFloat(this._winWidth)-parseFloat(this._modalWidth))/2);if(this._posLeft<10){this._posLeft=10;}this._posTop=(this._posTop-120);if(this._posTop<80){this._posTop=80;}var wrapper='<div class="accountModalTitle" style="width: 660px;"><a id="composeCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="shareModalBody" style="width: 660px;"></div>';if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._posLeft=this._posLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._posLeft,offsetTop:this._posTop,overlayDisplay:false,width:this._modalWidth,closeButton:false,containerClassName:"composeModalContainer",disableWindowObserver:true,afterOpen:this.__onModalOpen.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__onModalOpen:function(event){document.__modalOpenL1__=true;this._open=true;this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});var ajaxString="/admin/version-draft-create-ajax/";if(this._slug!=""){ajaxString=ajaxString+this._slug+"/";}ajaxString=ajaxString+"ver/";if(this._cloneVersion!=0){ajaxString=ajaxString+this._cloneVersion+"/";}new Ajax.Updater("shareModalBody",current.Constants.getInstance().getScriptName()+ajaxString,{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});Control.Modal.container.setStyle({height:"auto"});$("composeCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){EventSelectors.start(EventSelectorRules);if(!this._tmplLocked){$$("#templatePicker ul li.label").invoke("observe","click",this.__onLayoutClick.bindAsEventListener(this));$("templateSwitch").observe("click",this.__onTemplateSwitchClick.bindAsEventListener(this));}var pick=false;this._tmplRadioButtons=$$("#templatePicker ul li.radio input");this._tmplRadioButtons.each(function(s){console.log(s.readAttribute("checked")=="checked");s.up("li.radio").hide();s.up("ul").hide();if(s.readAttribute("checked")=="checked"){pick=s;}});this.__onTemplatePick(pick);},__resetWindow:function(){this._open=false;this._draggable.destroy();document.__modalOpenL1__=false;},__onCloseClick:function(){this.__resetWindow();Control.Modal.close();},__onLayoutClick:function(event){if(this._tmplPicked){return false;}var el=event.element();$(el).up("ul").down(".radio").down().checked=true;this._tmplRadioButtons.each(function(s){console.log(s.readAttribute("checked")=="checked");s.up("ul").hide();});this.__onTemplatePick($(el).up("ul").down(".radio").down());},__onTemplatePick:function(el){console.log("onTemplatePick");el.up("ul").show();$("templatePicker").addClassName("picked");if(!this._tmplLocked){$("templateSwitch").show();}$("templateElementBox").setStyle({width:"110px"});this._tmplPicked=true;},__onTemplateSwitchClick:function(event){event.stop();console.log("onTemplateSwitch"+this._tmplRadioButtons.length);var pickerWidth=(parseInt(this._tmplRadioButtons.length)*125);console.log("onTemplateSwitch"+pickerWidth);$("templateElementBox").setStyle({width:pickerWidth+"px"});this._tmplRadioButtons.each(function(s){s.up("ul").show();});$("templatePicker").removeClassName("picked");$("templateSwitch").hide();this._tmplPicked=false;}});current.stub("current.content.groups");current.content.groups.GroupAdminFamilyPage=Class.create({initialize:function(slug){this._slug=slug;$$(".expandFamily").invoke("observe","click",this.__onExpandClick.bindAsEventListener(this));},__onExpandClick:function(event){event.stop();var el=event.element();var slug=el.rel;this._link=el;this._row=el.up("li");this._level=parseInt(el.href.substring(el.href.indexOf("#")+1));if(!this._row.expanded){current.proxy.CCCP.execute("group","groups",{id:slug,start:0,len:250},this.__onExpand.bindAsEventListener(this),this.__onError.bindAsEventListener(this));}else{if(this._row.isHidden){this._row.down("ul.sublist").show();this._link.update("-");this._row.isHidden=false;}else{this._row.down("ul.sublist").hide();this._link.update("+");this._row.isHidden=true;}}},__onExpand:function(data){var ul=new Element("ul",{"class":"navlist sublist"});var addLink,child,li,editLink,expand,link,span,width;var lev=this._level+1;if(!isNaN(lev)){width=943-(15*lev);width=width+"px";}else{width="100%";}if(data.items&&data.items.length){var i,len=data.items.length;for(i=0;i<len;i++){child=data.items[i];li=new Element("li",{style:"width: "+width+";"});expand=new Element("a",{"class":"expandFamily",rel:child.slug,href:"#"+lev});expand.insert("+");expand.observe("click",this.__onExpandClick.bindAsEventListener(this));link=new Element("a",{target:"_blank",href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+child.slug+"/"});link.insert(child.name);editLink=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/admin/page-pub/"+child.slug+"/","class":"Sprites groupFeatureEdit floatRight nudgeRight",title:"edit "+child.name});addLink=new Element("a",{href:current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/admin/page-sub/"+child.slug+"/","class":"Sprites text floatRight nudgeRight",title:"create a new page within "+child.name});span=new Element("span",{"class":"pageExplainer"});span.insert(child.slug);li.insert(addLink);li.insert(editLink);li.insert(expand);li.insert(" ");li.insert(link);li.insert(": ");li.insert(span);ul.insert(li);}}else{li=new Element("li");span=new Element("span",{"class":"pageExplainer"});span.insert("No child pages.");li.insert(span);ul.insert(li);}this._row.insert(ul);this._row.expanded=true;this._link.update("-");},__onError:function(data){alert("Failed to get child pages.");}});current.stub("current.content.groups");current.content.groups.GroupAdminEditCMS=Class.create({initialize:function(layoutPrefix,ugoPrefix,slug,groupType,formId){this._slug=slug;this._groupType=groupType;this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();this._elements=new Array();this._feeds=new Array();this._customLayoutsLength=4;this._customLayoutPrefix=layoutPrefix;this._customUgoPrefix=ugoPrefix;this._openCollections=0;this._openCollectionTypes=new Array();this._collectionMetaData=new Array();this._collections=$$(".vugoCol");this._form=$(formId);this._uploadFormDefaultAction="/utils/cms_file_upload_iframe/field/";},init:function(){if($("addCollection")){$("addCollection").observe("click",this.__onAddCollectionClick.bindAsEventListener(this));$$(".colDelete").invoke("observe","click",this.__onCollectionDeleteClick.bindAsEventListener(this));$$(".addUgo").invoke("observe","click",this.__onAddElementClick.bindAsEventListener(this));$$(".ugoDelete").invoke("observe","click",this.__onElementDeleteClick.bindAsEventListener(this));$$(".ugoMoveDown").invoke("observe","click",this.__onElementMoveDownClick.bindAsEventListener(this));$$(".ugoMoveUp").invoke("observe","click",this.__onElementMoveUpClick.bindAsEventListener(this));$$(".ugoAutofill").invoke("observe","click",this.__onElementFillClick.bindAsEventListener(this));$$(".ugoClone").invoke("observe","click",this.__onElementCloneClick.bindAsEventListener(this));$$(".hideText").invoke("observe","change",this.__onHideTextClick.bindAsEventListener(this));}$$(".versionDeleteLink").invoke("observe","click",this.__onDeleteClick.bindAsEventListener(this));if($("versionedData_publish_DRAFT")){$("versionedData_publish_DRAFT").observe("change",this.__onPublishUnclick.bindAsEventListener(this));}if($("versionedData_publish_NOW")){$("versionedData_publish_NOW").observe("change",this.__onPublishClick.bindAsEventListener(this));}if($("versionedData_publish_SCHEDULED_DRAFT")){$("versionedData_publish_SCHEDULED_DRAFT").observe("change",this.__onPublishScheduleClick.bindAsEventListener(this));}if($("versionedData_publishForScheduled_NOW")){$("versionedData_publishForScheduled_NOW").observe("change",this.__onPublishClick.bindAsEventListener(this));}if($("versionedData_publishForScheduled_SCHEDULED_DRAFT")){$("versionedData_publishForScheduled_SCHEDULED_DRAFT").observe("change",this.__onPublishScheduleClick.bindAsEventListener(this));}this._disassembleJSON();this.__showCustomElements();CharacterCounter.getInstance();},__onDeleteClick:function(event){event.stop();var el=event.element();if(confirm("This will remove version "+el.rel+" permanently. There is no undo. Are you sure you want to do this?")){this._row=el.up("ul");current.proxy.CCCP.execute("group","versioned_data_version_post",{id:this._slug,action:"delete",version:el.rel},this.__onDelete.bindAsEventListener(this),this.__onError.bindAsEventListener(this));}},__onDelete:function(data){window.location.href="/admin/page-pub/"+this._slug+"/";},__onError:function(data){alert("oops... delete failed");},__switchLayout:function(event,val){this._layoutType=val;this.__showCustomElements(event);},__showCustomElements:function(event){this.__hideCustomElements();var className=".custom"+this._layoutType+"Element";$$(className).each(function(el){el.show();});},__hideCustomElements:function(event){$$(".customElement").each(function(el){el.hide();});},setLayoutType:function(val){this._layoutType=val;},setValidCollections:function(array){this._validCollections=array;},getValidCollections:function(){return this._validCollections;},showCustomElements:function(){this.__showCustomElements();},hideCustomElements:function(){this.__hideCustomElements();},_displayFileUpload:function(path,pre,name,type){if(path==""){return ;}var delStr=current.locale.Bundle.get("custom_layouts.delete_css");if(type=="image"){delStr=current.locale.Bundle.get("custom_layouts.delete_image");}var uploadFrame=pre+"upload_frame_"+name;if($(uploadFrame)){$(uploadFrame).hide();$(uploadFrame).up().insert(new Element("a",{href:"#",id:"fileRevertLink_"+pre+name,onclick:"return false;","class":"revertLink",style:"display: none"}).update(current.locale.Bundle.get("custom_layouts.cancel")));var fileHolder=new Element("div",{id:"fileHolder_"+pre+name,"class":"assetHolder"}).update(new Element("a",{href:this._dataNodeUrl+path,target:"_blank"}).update(path));fileHolder.insert(new Element("a",{href:"#",id:"fileReplaceLink_"+pre+name,onclick:"return false;","class":"replaceLink"}).update(delStr));var imgPreview=new Element("img",{height:"30",width:"40","class":"imgPreview",src:this._dataNodeUrl+path});fileHolder.insert(new Element("a",{href:this._dataNodeUrl+path,target:"_blank"}).update(imgPreview));$(uploadFrame).up().insert(fileHolder);Event.observe($("fileRevertLink_"+pre+name),"click",this._cancelFileUpload.bindAsEventListener(this,pre,name));Event.observe($("fileReplaceLink_"+pre+name),"click",this._newFileUploader.bindAsEventListener(this,pre,name));}},_cancelFileUpload:function(event,pre,name){$(pre+name).value=$(pre+"old_"+name).value;$(pre+"upload_frame_"+name).hide();$("fileRevertLink_"+pre+name).remove();this._resetFileUpload(pre,name);this._displayFileUpload($(pre+"old_"+name).value,pre,name,"image");},_newFileUploader:function(event,pre,name){$(pre+"old_"+name).value=$(pre+name).value;$(pre+name).value="";if($("fileHolder_"+pre+name)){$("fileHolder_"+pre+name).remove();}$(pre+"upload_frame_"+name).src=this._uploadFormDefaultAction+name+"/prefix/"+pre+".htm";$(pre+"upload_frame_"+name).show();$("fileRevertLink_"+pre+name).show();},_resetFileUpload:function(pre,name){$(pre+"upload_frame_"+name).show();if($("fileRevertLink_"+pre+name)){$("fileRevertLink_"+pre+name).remove();}if($("fileHolder_"+pre+name)){$("fileHolder_"+pre+name).remove();}},_disassembleJSON:function(){var scope=this;var count=0;var uCount=0;this._JSONData=$("versionedData_jsonData").value;if(this._JSONData.isJSON()&&(this._JSONData!="null")){console.log("json data each:");this._JSONData=this._JSONData.evalJSON();this._collectionsJSON=new Array();if(this._JSONData.group.data.carousel.size()>0){this._collectionsJSON.push({name:"carousel",data:this._JSONData.group.data.carousel});}if(this._JSONData.group.data.minicarousel.size()>0){this._collectionsJSON.push({name:"minicarousel",data:this._JSONData.group.data.minicarousel});}if(this._JSONData.group.data.featured.size()>0){this._collectionsJSON.push({name:"featured",data:this._JSONData.group.data.featured});}if(this._JSONData.group.data.rail.size()>0){this._collectionsJSON.push({name:"rail",data:this._JSONData.group.data.rail});}this._collectionsJSON.each(function(e){console.log(e);scope.customizeElementsPerCollection(parseInt(count+1),e.name);scope.openCollection(count,e.name);var cuid=parseInt(count+1);$("versionedData_collections_"+count+"_name").value=e.name;uCount=0;e.data.each(function(c){var vuid=parseInt(uCount+1);var ugoPrefix="versionedData_collections_"+count+"_vugos_"+uCount+"_";$("vugoC"+cuid+"E"+vuid).show();$(ugoPrefix+"title").value=c.title;$(ugoPrefix+"url").value=c.url;$(ugoPrefix+"sub_title").value=c.sub_title;$(ugoPrefix+"sub_url").value=c.sub_url;$(ugoPrefix+"label").value=c.label;$(ugoPrefix+"desc").value=c.desc;$(ugoPrefix+"hide_text").checked=c.hide_text;$(ugoPrefix+"image").value=c.image;$(ugoPrefix+"m_image").value=c.m_image;$(ugoPrefix+"old_image").value=c.image;$(ugoPrefix+"old_m_image").value=c.m_image;$(ugoPrefix+"play_button").checked=c.play_button;$(ugoPrefix+"inset").checked=c.inset;$(ugoPrefix+"overlay").checked=c.overlay;$(ugoPrefix+"align").value=c.align;$(ugoPrefix+"f_image").value=c.f_image;$(ugoPrefix+"rr_type").value=c.rr_type;scope._displayFileUpload(c.image?c.image:"",ugoPrefix,"image","image");scope._displayFileUpload(c.m_image?c.m_image:"",ugoPrefix,"m_image","image");if(c.hide_text){scope._toggleTextOptions(ugoPrefix,e.name,true);}uCount++;});count++;});}},__onElementMoveDownClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugo");var siblings=parent.nextSiblings();var ugoPrefix=parent.down(".ugo").id;if(siblings.length<1){alert("This element is already in the last position.");return ;}var s=siblings[0];if(s.visible()&&s.hasClassName("vugo")){var nextUgoPrefix=s.down(".ugo").id;this.swapUgoValues(ugoPrefix,nextUgoPrefix);s.scrollTo();}else{alert("This element is already in the last position.");return ;}},__onElementMoveUpClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugo");var siblings=parent.previousSiblings();var ugoPrefix=parent.down(".ugo").id;if(siblings.length<1){alert("This element is already in the first position.");return ;}var s=siblings[0];if(!s.hasClassName("vugo")){alert("This element is already in the first position.");return ;}var nextUgoPrefix=s.down(".ugo").id;this.swapUgoValues(ugoPrefix,nextUgoPrefix);s.scrollTo();},__onElementDeleteClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugo");var siblings=parent.nextSiblings();var ugoPrefix=parent.down(".ugo").id;if(confirm("Are you sure you want to delete this element?")){var scope=this;var prevUgoPrefix=ugoPrefix;var last_sibling=parent.id;siblings.each(function(s){if(s.visible()&&s.hasClassName("vugo")){var nextUgoPrefix=s.down(".ugo").id;scope.swapUgoValues(prevUgoPrefix,nextUgoPrefix);prevUgoPrefix=nextUgoPrefix;last_sibling=s.id;}else{scope.eraseUgoValues(prevUgoPrefix);new Effect.BlindUp(last_sibling);return ;}});}},__onElementCloneClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugo");var siblings=parent.nextSiblings();var ugoPrefix=parent.down(".ugo").id;if(siblings.length<1){alert("This element is already in the last position.");return ;}var nextClosedElement=siblings.find(function(v){return v.visible()==false;});if(!nextClosedElement){alert("No empty positions available in the collection");return ;}else{nextClosedElement.show();new Effect.BlindDown(nextClosedElement.id);this.copyUgoValues(ugoPrefix,$(nextClosedElement).down(".ugo").id);nextClosedElement.scrollTo();}},__onElementFillClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugo");var ugoPrefix=parent.down(".ugo").id;},__onHideTextClick:function(event,element){var e=element;if(!element&&event){e=event.element();}var parent=e.up(".vugo");var ugoPrefix=parent.down(".ugo").id;var parentCol=e.up(".vugoCol");var type=parentCol.down(".colName input").value;this._toggleTextOptions(ugoPrefix,type,e.checked);},_toggleTextOptions:function(prefix,type,hide){if(type=="carousel"){if(hide){$(prefix+"play_button").up("li").hide();$(prefix+"inset").up("li").hide();$(prefix+"overlay").up("li").hide();$(prefix+"align").up("li").hide();$(prefix+"f_image").up("li").hide();$(prefix+"label").up("li").hide();}else{$(prefix+"play_button").up("li").show();$(prefix+"inset").up("li").show();$(prefix+"overlay").up("li").show();$(prefix+"align").up("li").show();$(prefix+"f_image").up("li").show();$(prefix+"label").up("li").show();}}else{if(type=="featured"){if(hide){$(prefix+"sub_title").up("li").hide();$(prefix+"sub_url").up("li").hide();$(prefix+"label").up("li").hide();}else{$(prefix+"sub_title").up("li").show();$(prefix+"sub_url").up("li").show();$(prefix+"label").up("li").show();}}}},eraseUgoValues:function(prefix){$(prefix+"title").value="";$(prefix+"url").value="";$(prefix+"sub_title").value="";$(prefix+"sub_url").value="";$(prefix+"label").value="";$(prefix+"desc").value="";$(prefix+"image").value="";$(prefix+"old_image").value="";$(prefix+"m_image").value="";$(prefix+"old_m_image").value="";$(prefix+"hide_text").checked=false;$(prefix+"play_button").checked=false;$(prefix+"inset").checked=false;$(prefix+"overlay").checked=false;$(prefix+"align").value="";$(prefix+"f_image").value="";$(prefix+"rr_type").value="default";this._resetFileUpload(prefix,"image");this._resetFileUpload(prefix,"m_image");},swapUgoValues:function(prefix1,prefix2){var tempUgo={};tempUgo.title=$(prefix1+"title").value;tempUgo.url=$(prefix1+"url").value;tempUgo.sub_title=$(prefix1+"sub_title").value;tempUgo.sub_url=$(prefix1+"sub_url").value;tempUgo.label=$(prefix1+"label").value;tempUgo.desc=$(prefix1+"desc").value;tempUgo.image=$(prefix1+"image").value;tempUgo.old_image=$(prefix1+"old_image").value;tempUgo.m_image=$(prefix1+"m_image").value;tempUgo.old_m_image=$(prefix1+"old_m_image").value;tempUgo.hide_text=$(prefix1+"hide_text").checked;tempUgo.play_button=$(prefix1+"play_button").checked;tempUgo.inset=$(prefix1+"inset").checked;tempUgo.overlay=$(prefix1+"overlay").checked;tempUgo.align=$(prefix1+"align").value;tempUgo.f_image=$(prefix1+"f_image").value;tempUgo.rr_type=$(prefix1+"rr_type").value;$(prefix1+"title").value=$(prefix2+"title").value;$(prefix1+"title").focus();$(prefix1+"title").blur();$(prefix1+"url").value=$(prefix2+"url").value;$(prefix1+"sub_title").value=$(prefix2+"sub_title").value;$(prefix1+"sub_title").focus();$(prefix1+"sub_title").blur();$(prefix1+"sub_url").value=$(prefix2+"sub_url").value;$(prefix1+"label").value=$(prefix2+"label").value;$(prefix1+"label").focus();$(prefix1+"label").blur();$(prefix1+"desc").value=$(prefix2+"desc").value;$(prefix1+"desc").focus();$(prefix1+"desc").blur();$(prefix1+"image").value=$(prefix2+"image").value;$(prefix1+"old_image").value=$(prefix2+"old_image").value;$(prefix1+"m_image").value=$(prefix2+"m_image").value;$(prefix1+"old_m_image").value=$(prefix2+"old_m_image").value;$(prefix1+"hide_text").checked=$(prefix2+"hide_text").checked;$(prefix1+"play_button").checked=$(prefix2+"play_button").checked;$(prefix1+"inset").checked=$(prefix2+"inset").checked;$(prefix1+"overlay").checked=$(prefix2+"overlay").checked;$(prefix1+"align").value=$(prefix2+"align").value;$(prefix1+"f_image").value=$(prefix2+"f_image").value;$(prefix1+"rr_type").value=$(prefix2+"rr_type").value;this._resetFileUpload(prefix1,"image");if($(prefix1+"image").value){this._displayFileUpload($(prefix1+"image").value,prefix1,"image","image");}this._resetFileUpload(prefix1,"m_image");if($(prefix1+"m_image").value){this._displayFileUpload($(prefix1+"m_image").value,prefix1,"m_image","image");}$(prefix2+"title").value=tempUgo.title;$(prefix2+"title").focus();$(prefix2+"title").blur();$(prefix2+"url").value=tempUgo.url;$(prefix2+"sub_title").value=tempUgo.sub_title;$(prefix2+"sub_title").focus();$(prefix2+"sub_title").blur();$(prefix2+"sub_url").value=tempUgo.sub_url;$(prefix2+"label").value=tempUgo.label;$(prefix2+"label").focus();$(prefix2+"label").blur();$(prefix2+"desc").value=tempUgo.desc;$(prefix2+"desc").focus();$(prefix2+"desc").blur();$(prefix2+"image").value=tempUgo.image;$(prefix2+"old_image").value=tempUgo.old_image;$(prefix2+"m_image").value=tempUgo.m_image;$(prefix2+"old_m_image").value=tempUgo.old_m_image;$(prefix2+"hide_text").checked=tempUgo.hide_text;$(prefix2+"play_button").checked=tempUgo.play_button;$(prefix2+"inset").checked=tempUgo.inset;$(prefix2+"overlay").checked=tempUgo.overlay;$(prefix2+"align").value=tempUgo.align;$(prefix2+"f_image").value=tempUgo.f_image;$(prefix2+"rr_type").value=tempUgo.rr_type;this.__onHideTextClick(false,$(prefix1+"hide_text"));this.__onHideTextClick(false,$(prefix2+"hide_text"));this._resetFileUpload(prefix2,"image");if($(prefix2+"image").value){this._displayFileUpload($(prefix2+"image").value,prefix2,"image","image");}this._resetFileUpload(prefix2,"m_image");if($(prefix2+"m_image").value){this._displayFileUpload($(prefix2+"m_image").value,prefix2,"m_image","image");}},copyUgoValues:function(prefix1,prefix2){var tempUgo={};tempUgo.title=$(prefix1+"title").value;tempUgo.url=$(prefix1+"url").value;tempUgo.sub_title=$(prefix1+"sub_title").value;tempUgo.sub_url=$(prefix1+"sub_url").value;tempUgo.label=$(prefix1+"label").value;tempUgo.desc=$(prefix1+"desc").value;tempUgo.image=$(prefix1+"image").value;tempUgo.old_image=$(prefix1+"old_image").value;tempUgo.m_image=$(prefix1+"m_image").value;tempUgo.old_m_image=$(prefix1+"old_m_image").value;tempUgo.hide_text=$(prefix1+"hide_text").checked;tempUgo.play_button=$(prefix1+"play_button").checked;tempUgo.inset=$(prefix1+"inset").checked;tempUgo.overlay=$(prefix1+"overlay").checked;tempUgo.align=$(prefix1+"align").value;tempUgo.f_image=$(prefix1+"f_image").value;tempUgo.rr_type=$(prefix1+"rr_type").value;$(prefix2+"title").value=tempUgo.title;$(prefix2+"title").focus();$(prefix2+"title").blur();$(prefix2+"url").value=tempUgo.url;$(prefix2+"sub_title").value=tempUgo.sub_title;$(prefix2+"sub_title").focus();$(prefix2+"sub_title").blur();$(prefix2+"sub_url").value=tempUgo.sub_url;$(prefix2+"label").value=tempUgo.label;$(prefix2+"label").focus();$(prefix2+"label").blur();$(prefix2+"desc").value=tempUgo.desc;$(prefix2+"desc").focus();$(prefix2+"desc").blur();$(prefix2+"image").value=tempUgo.image;$(prefix2+"old_image").value=tempUgo.old_image;$(prefix2+"m_image").value=tempUgo.m_image;$(prefix2+"old_m_image").value=tempUgo.old_m_image;$(prefix2+"hide_text").checked=tempUgo.hide_text;$(prefix2+"play_button").checked=tempUgo.play_button;$(prefix2+"inset").checked=tempUgo.inset;$(prefix2+"overlay").checked=tempUgo.overlay;$(prefix2+"align").value=tempUgo.align;$(prefix2+"f_image").value=tempUgo.f_image;$(prefix2+"rr_type").value=tempUgo.rr_type;this.__onHideTextClick(false,$(prefix2+"hide_text"));this._resetFileUpload(prefix2,"image");if($(prefix2+"image").value){this._displayFileUpload($(prefix2+"image").value,prefix2,"image","image");}this._resetFileUpload(prefix2,"m_image");if($(prefix2+"m_image").value){this._displayFileUpload($(prefix2+"m_image").value,prefix2,"m_image","image");}},__getTypeDropdownIndex:function(type){switch(type){case"group":return 0;case"tag":return 1;case"rss":return 2;case"group_list":return 3;default:return 0;}},__getSortDropdownIndex:function(type){switch(type){case"new":return 0;case"popular":return 1;default:return 0;}},setOpenCollections:function(n,type){this._openCollections=n;this._openCollectionTypes.push(type);var colInput=$("versionedData_collections_"+parseInt(this._openCollections-1)+"_name");$(colInput).up("li").down("label").down("small").update(type);var availTypes=new Array();this._validCollections.each(function(e){if(e!==type){availTypes.push(e);}});this.setValidCollections(availTypes);if(availTypes.length<1){$("addCollectionButton").hide();}},openCollection:function(n,type){this.setOpenCollections(parseInt(this._openCollections+1),type);$("vugoCol"+this._openCollections).show();},customizeElementsPerCollection:function(n,type){var col=$("vugoCol"+n);var vugos=$$("#vugoCol"+n+" .vugo");if(type=="carousel"){vugos.each(function(v){var prefix=v.down(".ugo").id;$(prefix+"sub_title").up("li").hide();$(prefix+"sub_url").up("li").hide();});}else{if(type=="featured"){vugos.each(function(v){var prefix=v.down(".ugo").id;$(prefix+"desc").up("li").hide();$(prefix+"inset").up("li").hide();$(prefix+"overlay").up("li").hide();$(prefix+"align").up("li").hide();$(prefix+"f_image").up("li").hide();$(prefix+"image").up("li").setStyle({clear:"left"});});}else{if(type=="minicarousel"){vugos.each(function(v){var prefix=v.down(".ugo").id;$(prefix+"inset").up("li").hide();$(prefix+"play_button").up("li").hide();$(prefix+"align").up("li").hide();$(prefix+"f_image").up("li").hide();$(prefix+"sub_url").up("li").hide();$(prefix+"image").up("li").setStyle({clear:"left"});});}}}},__onAddCollectionClick:function(event){event.stop();var cols=this.getValidCollections();if((this._openCollections<5)&&(cols.length>0)){this.selectCollectionType(event);}if((this._openCollections==5)||(cols.length<1)){$("addCollectionButton").hide();}return false;},__onCollectionTypeSelect:function(event){event.stop();var e=event.element();e.up(".collSelect").hide();var colInput=$("versionedData_collections_"+this._openCollections+"_name");$(colInput).value=e.rel;Effect.Appear($(colInput));$(colInput).up("li").down("label").down("small").update(e.rel);this.customizeElementsPerCollection(parseInt(this._openCollections+1),e.rel);this.openCollection(parseInt(this._openCollections+1),e.rel);},selectCollectionType:function(event){var e=event.element();var cols=this.getValidCollections();var selector=new Element("div",{"class":"collSelect"}).insert("select widget type:");selector.insert(new Element("br"));var scope=this;cols.each(function(s){var a=new Element("a",{rel:s}).insert(s);a.observe("click",scope.__onCollectionTypeSelect.bindAsEventListener(scope));selector.insert(a);});e.insert({after:selector});},__onCollectionDeleteClick:function(event){event.stop();var e=event.element();var parent=e.up(".vugoCol");var children=parent.childElements();if(confirm("Are you sure you want to delete this collection?")){var scope=this;children.each(function(s){if(s.hasClassName("vugo")){var prefix=s.down(".ugo").id;scope.eraseUgoValues(prefix);if(s.visible()){new Effect.BlindUp(s);}}});}},__onAddElementClick:function(event){event.stop();var vList=$$("#vugoCol"+event.element().rel+" .vugo");var nextElement=vList.find(function(v){return v.visible()==false;});if(nextElement){new Effect.BlindDown(nextElement.id);if(nextElement.id=="vugoC"+event.element().rel+"E6"){event.element().hide();}}return false;},__onPublishClick:function(event){if(event){event.stop();}$("publishTime").hide();},__onPublishScheduleClick:function(event){if(event){event.stop();}$("publishTime").show();},__onPublishUnclick:function(event){if(event){event.stop();}$("publishTime").hide();},onImageUpload:function(prefix,field,path){if($(prefix+field).value){$(prefix+"old_"+field).value=$(prefix+field).value;}$(prefix+field).value=path;this._resetFileUpload(prefix,field);this._displayFileUpload(path,prefix,field,"image");}});current.stub("current.content.groups");current.content.groups.GroupAdminRelationPage=Class.create({initialize:function(){this._isFamily=false;this._isOrphan=false;},init:function(){console.log("this._isFamily = "+this._isFamily);console.log("this._isOrphan = "+this._isOrphan);},setFamily:function(bool){this._isFamily=bool;},setOrphan:function(bool){this._isOrphan=bool;}});current.stub("current.content.groups");current.content.groups.GroupEditSkinPage=Class.create({initialize:function(prefix){this._generalImageField=$(prefix+"_generalImage");this._groupThumbnailField=$(prefix+"_groupThumbnail");this._groupListThumbnailField=$(prefix+"_groupListThumbnail");this._scheduleImageField=$(prefix+"_scheduleImage");this._rightRailBannerField=$(prefix+"_rightRailBanner");this._skinField=$(prefix+"_skinPath");this._jsField=$(prefix+"_javascriptPath");this._badgeField=$(prefix+"_badgePath");this._channelThumbnailField=$(prefix+"_channelThumbnail");this._generalImageDel=$(prefix+"_deleteGeneralImage");this._groupThumbnailDel=$(prefix+"_deleteGroupThumbnail");this._groupListThumbnailDel=$(prefix+"_deleteGroupListThumbnail");this._scheduleImageDel=$(prefix+"_deleteScheduleImage");this._rightRailBannerDel=$(prefix+"_deleteRightRailBanner");this._skinDel=$(prefix+"_deleteSkinPath");this._jsDel=$(prefix+"_deleteJavascriptPath");this._badgeDel=$(prefix+"_deleteBadgePath");this._channelThumbnailDel=$(prefix+"_deleteChannelThumbnail");this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();},init:function(skinPath,jsPath,badgePath,channelThumbnail,generalImage,groupThumbnail,groupListThumbnail,scheduleImage,rightRailBanner){this._skinPath=skinPath;this._jsPath=jsPath;this._badgePath=badgePath;this._channelThumbnail=channelThumbnail;this._generalImage=generalImage;this._groupThumbnail=groupThumbnail;this._groupListThumbnail=groupListThumbnail;this._scheduleImage=scheduleImage;this._rightRailBanner=rightRailBanner;this._displaySkin(skinPath);this._displayJs(jsPath);this._displayBadge(this._badgePath);this._displayChannelThumbnail(this._channelThumbnail);this._displayGeneralImage(this._generalImage);this._displayGroupThumbnail(this._groupThumbnail);this._displayGroupListThumbnail(this._groupListThumbnail);this._displayScheduleImage(this._scheduleImage);this._displayRightRailBanner(this._rightRailBanner);CharacterCounter.getInstance();},_displayBadge:function(path){if(path==""){return ;}$(this._badgeField).hide();$(this._badgeField).up().insert(new Element("a",{href:"#",id:"badgeRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var badgeHolder=new Element("div",{id:"badgeHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));badgeHolder.insert(new Element("a",{href:"#",id:"badgeReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete badge"));$(this._badgeField).up().insert(badgeHolder);Event.observe($("badgeRevertLink"),"click",this._hideBadgeForm.bindAsEventListener(this));Event.observe($("badgeReplaceLink"),"click",this._showBadgeForm.bindAsEventListener(this));},_hideBadgeForm:function(){$(this._badgeDel).value="false";$(this._badgeField).hide();$("badgeRevertLink").hide();$("badgeHolder").show();},_showBadgeForm:function(){$(this._badgeDel).value="true";$("badgeHolder").hide();$(this._badgeField).show();$("badgeRevertLink").show();},_displayChannelThumbnail:function(path){if(path==""){return ;}$(this._channelThumbnailField).hide();$(this._channelThumbnailField).up().insert(new Element("a",{href:"#",id:"channelThumbnailRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var channelThumbnailHolder=new Element("div",{id:"channelThumbnailHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));channelThumbnailHolder.insert(new Element("a",{href:"#",id:"channelThumbnailReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete channel thumbnail"));$(this._channelThumbnailField).up().insert(channelThumbnailHolder);Event.observe($("channelThumbnailRevertLink"),"click",this._hideChannelThumbnailForm.bindAsEventListener(this));Event.observe($("channelThumbnailReplaceLink"),"click",this._showChannelThumbnailForm.bindAsEventListener(this));},_hideChannelThumbnailForm:function(){$(this._channelThumbnailDel).value="false";$(this._channelThumbnailField).hide();$("channelThumbnailRevertLink").hide();$("channelThumbnailHolder").show();},_showChannelThumbnailForm:function(){$(this._channelThumbnailDel).value="true";$("channelThumbnailHolder").hide();$(this._channelThumbnailField).show();$("channelThumbnailRevertLink").show();},_displaySkin:function(path){if(path==""){return ;}$(this._skinField).hide();$(this._skinField).up().insert(new Element("a",{href:"#",id:"skinRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var skinHolder=new Element("div",{id:"skinHolder","class":"assetHolder"}).update(new Element("a",{href:this._dataNodeUrl+path}).update(path));skinHolder.insert(new Element("a",{href:"#",id:"skinReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete css"));$(this._skinField).up().insert(skinHolder);Event.observe($("skinRevertLink"),"click",this._hideSkinForm.bindAsEventListener(this));Event.observe($("skinReplaceLink"),"click",this._showSkinForm.bindAsEventListener(this));},_hideSkinForm:function(){$(this._skinDel).value="false";$(this._skinField).hide();$("skinRevertLink").hide();$("skinHolder").show();},_showSkinForm:function(){$(this._skinDel).value="true";$("skinHolder").hide();$(this._skinField).show();$("skinRevertLink").show();},_displayJs:function(path){if(path==""){return ;}$(this._jsField).hide();$(this._jsField).up().insert(new Element("a",{href:"#",id:"jsRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var jsHolder=new Element("div",{id:"jsHolder","class":"assetHolder"}).update(new Element("a",{href:this._dataNodeUrl+path}).update(path));jsHolder.insert(new Element("a",{href:"#",id:"jsReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete javascript"));$(this._jsField).up().insert(jsHolder);Event.observe($("jsRevertLink"),"click",this._hideJsForm.bindAsEventListener(this));Event.observe($("jsReplaceLink"),"click",this._showJsForm.bindAsEventListener(this));},_hideJsForm:function(){$(this._jsDel).value="false";$(this._jsField).hide();$("jsRevertLink").hide();$("jsHolder").show();},_showJsForm:function(){$(this._jsDel).value="true";$("jsHolder").hide();$(this._jsField).show();$("jsRevertLink").show();},_displayGeneralImage:function(path){if(path==""){return ;}$(this._generalImageField).hide();$(this._generalImageField).up().insert(new Element("a",{href:"#",id:"generalImageRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var generalImageHolder=new Element("div",{id:"generalImageHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));generalImageHolder.insert(new Element("a",{href:"#",id:"generalImageReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$(this._generalImageField).up().insert(generalImageHolder);Event.observe($("generalImageRevertLink"),"click",this._hideGeneralImageForm.bindAsEventListener(this));Event.observe($("generalImageReplaceLink"),"click",this._showGeneralImageForm.bindAsEventListener(this));},_hideGeneralImageForm:function(){$(this._generalImageDel).value="false";$(this._generalImageField).hide();$("generalImageRevertLink").hide();$("generalImageHolder").show();},_showGeneralImageForm:function(){$(this._generalImageDel).value="true";$("generalImageHolder").hide();$(this._generalImageField).show();$("generalImageRevertLink").show();},_displayGroupThumbnail:function(path){if(path==""||!$(this._groupThumbnailField)){return ;}$(this._groupThumbnailField).hide();$(this._groupThumbnailField).up().insert(new Element("a",{href:"#",id:"groupThumbnailRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var groupThumbnailHolder=new Element("div",{id:"groupThumbnailHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));groupThumbnailHolder.insert(new Element("a",{href:"#",id:"groupThumbnailReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete group thumbnail"));$(this._groupThumbnailField).up().insert(groupThumbnailHolder);Event.observe($("groupThumbnailRevertLink"),"click",this._hideGroupThumbnailForm.bindAsEventListener(this));Event.observe($("groupThumbnailReplaceLink"),"click",this._showGroupThumbnailForm.bindAsEventListener(this));},_hideGroupThumbnailForm:function(){$(this._groupThumbnailDel).value="false";$(this._groupThumbnailField).hide();$("groupThumbnailRevertLink").hide();$("groupThumbnailHolder").show();},_showGroupThumbnailForm:function(){$(this._groupThumbnailDel).value="true";$("groupThumbnailHolder").hide();$(this._groupThumbnailField).show();$("groupThumbnailRevertLink").show();},_displayGroupListThumbnail:function(path){if(path==""){return ;}$(this._groupListThumbnailField).hide();$(this._groupListThumbnailField).up().insert(new Element("a",{href:"#",id:"groupListThumbnailRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var groupListThumbnailHolder=new Element("div",{id:"groupListThumbnailHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));groupListThumbnailHolder.insert(new Element("a",{href:"#",id:"groupListThumbnailReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete group list thumbnail"));$(this._groupListThumbnailField).up().insert(groupListThumbnailHolder);Event.observe($("groupListThumbnailRevertLink"),"click",this._hideGroupListThumbnailForm.bindAsEventListener(this));Event.observe($("groupListThumbnailReplaceLink"),"click",this._showGroupListThumbnailForm.bindAsEventListener(this));},_hideGroupListThumbnailForm:function(){$(this._groupListThumbnailDel).value="false";$(this._groupListThumbnailField).hide();$("groupListThumbnailRevertLink").hide();$("groupListThumbnailHolder").show();},_showGroupListThumbnailForm:function(){$(this._groupListThumbnailDel).value="true";$("groupListThumbnailHolder").hide();$(this._groupListThumbnailField).show();$("groupListThumbnailRevertLink").show();},_displayScheduleImage:function(path){if(path==""){return ;}$(this._scheduleImageField).hide();$(this._scheduleImageField).up().insert(new Element("a",{href:"#",id:"scheduleImageRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var scheduleImageHolder=new Element("div",{id:"scheduleImageHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));scheduleImageHolder.insert(new Element("a",{href:"#",id:"scheduleImageReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete schedule image"));$(this._scheduleImageField).up().insert(scheduleImageHolder);Event.observe($("scheduleImageRevertLink"),"click",this._hideScheduleImageForm.bindAsEventListener(this));Event.observe($("scheduleImageReplaceLink"),"click",this._showScheduleImageForm.bindAsEventListener(this));},_hideScheduleImageForm:function(){$(this._scheduleImageDel).value="false";$(this._scheduleImageField).hide();$("scheduleImageRevertLink").hide();$("scheduleImageHolder").show();},_showScheduleImageForm:function(){$(this._scheduleImageDel).value="true";$("scheduleImageHolder").hide();$(this._scheduleImageField).show();$("scheduleImageRevertLink").show();},_displayRightRailBanner:function(path){if(path==""){return ;}$(this._rightRailBannerField).hide();$(this._rightRailBannerField).up().insert(new Element("a",{href:"#",id:"rightRailBannerRevertLink",onclick:"return false;","class":"revertLink",style:"display: none"}).update("cancel"));var rightRailBannerHolder=new Element("div",{id:"rightRailBannerHolder","class":"assetHolder"}).update(new Element("img",{src:this._dataNodeUrl+path}));rightRailBannerHolder.insert(new Element("a",{href:"#",id:"rightRailBannerReplaceLink",onclick:"return false;","class":"replaceLink"}).update("delete image"));$(this._rightRailBannerField).up().insert(rightRailBannerHolder);Event.observe($("rightRailBannerRevertLink"),"click",this._hideRightRailBannerForm.bindAsEventListener(this));Event.observe($("rightRailBannerReplaceLink"),"click",this._showRightRailBannerForm.bindAsEventListener(this));},_hideRightRailBannerForm:function(){$(this._rightRailBannerDel).value="false";$(this._rightRailBannerField).hide();$("rightRailBannerRevertLink").hide();$("rightRailBannerHolder").show();},_showRightRailBannerForm:function(){$(this._rightRailBannerDel).value="true";$("rightRailBannerHolder").hide();$(this._rightRailBannerField).show();$("rightRailBannerRevertLink").show();}});current.stub("current.content.groups");current.content.groups.GroupEditItemSkinPage=Class.create({initialize:function(layoutPrefix,navPrefix,ribbonPrefix,slug){this._slug=slug;this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();this._elements=new Array();this._feeds=new Array();this._customLayoutsLength=3;this._customLayoutPrefix=layoutPrefix;this._customNavPrefix=navPrefix;this._customRibbonPrefix=ribbonPrefix;},init:function(){var cl=this._customLayoutPrefix+"_itemLayoutType_custom";this._disassembleJSON();if($(this._customLayoutPrefix+"_itemLayoutType_standard")){$(this._customLayoutPrefix+"_itemLayoutType_standard").observe("click",this.__hideCustomElements.bindAsEventListener(this));}for(var i=1;i<this._customLayoutsLength+1;i++){if($(cl+i)){$(cl+i).observe("click",this.__switchLayout.bindAsEventListener(this,i));}}this.__showCustomElements();window._r_.toggleAddButton();window._cn_.toggleAddButton();CharacterCounter.getInstance();},__switchLayout:function(event,val){this._layoutType=val;this.__showCustomElements(event);},__showCustomElements:function(event){this.__hideCustomElements();var className=".custom"+this._layoutType+"Element";$$(className).each(function(el){el.show();});},__hideCustomElements:function(event){$$(".customElement").each(function(el){el.hide();});},setLayoutType:function(val){this._layoutType=val;},showCustomElements:function(){this.__showCustomElements();},hideCustomElements:function(){this.__hideCustomElements();},_displayFileUpload:function(path,pre,id,type){if(path==""){return ;}var delStr=current.locale.Bundle.get("custom_layouts.delete_css");if(type=="image"){delStr=current.locale.Bundle.get("custom_layouts.delete_image");}if($(pre+"_"+id)){$(pre+"_"+id).hide();$(pre+"_"+id).up().insert(new Element("a",{href:"#",id:"fileRevertLink_"+id,onclick:"return false;","class":"revertLink",style:"display: none"}).update(current.locale.Bundle.get("custom_layouts.cancel")));var fileHolder=new Element("div",{id:"fileHolder_"+id,"class":"assetHolder"}).update(new Element("a",{href:this._dataNodeUrl+path}).update(path));fileHolder.insert(new Element("a",{href:"#",id:"fileReplaceLink_"+id,onclick:"return false;","class":"replaceLink"}).update(delStr));$(pre+"_"+id).up().insert(fileHolder);Event.observe($("fileRevertLink_"+id),"click",this._hideFileUpload.bindAsEventListener(this,pre,id));Event.observe($("fileReplaceLink_"+id),"click",this._showFileUpload.bindAsEventListener(this,pre,id));}},_hideFileUpload:function(event,pre,id){$(pre+"_delete_"+id).value="false";$(pre+"_"+id).hide();$("fileRevertLink_"+id).hide();$("fileHolder_"+id).show();},_showFileUpload:function(event,pre,id){$(pre+"_delete_"+id).value="true";$("fileHolder_"+id).hide();$(pre+"_"+id).show();$("fileRevertLink_"+id).show();},_disassembleJSON:function(){var scope=this;var count=0;this._JSONData=$("customLayout_itemJsonData").value;this._JSONData="["+this._JSONData+"]";if(this._JSONData.isJSON()){this._JSONData.evalJSON().each(function(e){if(e.headerPath!=""){scope._displayFileUpload(e.headerPath,scope._customLayoutPrefix,"headerPath","image");if($(scope._customLayoutPrefix+"_delete_headerPath")){$(scope._customLayoutPrefix+"_delete_headerPath").value="false";}if($(scope._customLayoutPrefix+"_old_headerPath")){$(scope._customLayoutPrefix+"_old_headerPath").value=e.headerPath;}}if(e.skinPath!=""){scope._displayFileUpload(e.skinPath,scope._customLayoutPrefix,"skinPath","css");if($(scope._customLayoutPrefix+"_delete_skinPath")){$(scope._customLayoutPrefix+"_delete_skinPath").value="false";}if($(scope._customLayoutPrefix+"_old_skinPath")){$(scope._customLayoutPrefix+"_old_skinPath").value=e.skinPath;}}if($(scope._customLayoutPrefix+"_sandbox0")&&e.sandbox0!=""&&e.sandbox0!=null){$(scope._customLayoutPrefix+"_sandbox0").value=e.sandbox0;for(var i=1;i<scope._customLayoutsLength+1;i++){if($("templ_"+i+"_0")){$("templ_"+i+"_0").removeClassName("editEmpty");}if($("templ_"+i+"_0")){$("templ_"+i+"_0").addClassName("editFull");}}}if($(scope._customLayoutPrefix+"_sandbox1")&&e.sandbox1!=""&&e.sandbox1!=null){$(scope._customLayoutPrefix+"_sandbox1").value=e.sandbox1;for(var i=1;i<scope._customLayoutsLength+1;i++){if($("templ_"+i+"_1")){$("templ_"+i+"_1").removeClassName("editEmpty");}if($("templ_"+i+"_1")){$("templ_"+i+"_1").addClassName("editFull");}}}if($(scope._customLayoutPrefix+"_sandbox2")&&e.sandbox2!=""&&e.sandbox2!=null){$(scope._customLayoutPrefix+"_sandbox2").value=e.sandbox2;for(var i=1;i<scope._customLayoutsLength+1;i++){if($("templ_"+i+"_2")){$("templ_"+i+"_2").removeClassName("editEmpty");}if($("templ_"+i+"_2")){$("templ_"+i+"_2").addClassName("editFull");}}}if($(scope._customLayoutPrefix+"_sandbox3")&&e.sandbox3!=""&&e.sandbox3!=null){$(scope._customLayoutPrefix+"_sandbox3").value=e.sandbox3;for(var i=1;i<scope._customLayoutsLength+1;i++){if($("templ_"+i+"_3")){$("templ_"+i+"_3").removeClassName("editEmpty");}if($("templ_"+i+"_3")){$("templ_"+i+"_3").addClassName("editFull");}}}if($(scope._customLayoutPrefix+"_sandbox4")&&e.sandbox4!=""&&e.sandbox4!=null){$(scope._customLayoutPrefix+"_sandbox4").value=e.sandbox4;for(var i=1;i<scope._customLayoutsLength+1;i++){if($("templ_"+i+"_4")){$("templ_"+i+"_4").removeClassName("editEmpty");}if($("templ_"+i+"_4")){$("templ_"+i+"_4").addClassName("editFull");}}}if(scope._layoutType==1||scope._layoutType==2){if(e.nav!=null&&e.nav!=""){count=0;e.nav.each(function(v){var navCount=0;if(v.title!=""){window._cn_.addOtherNavElement("none",0);$(scope._customNavPrefix+"_customNav_text"+count).value=v.title;$(scope._customNavPrefix+"_customNav_link"+count).value=v.link;count++;}});window._cn_.setNavElementIndex(count);}if(e.ribbons!=null&&e.ribbons!=""){count=0;e.ribbons.each(function(r){var feedCount=0;if(r.title!=""){window._r_.addOtherNavElement("none",0);$(scope._customRibbonPrefix+"_ribbon_headerText"+count).value=r.title;r.ribbon.each(function(f){if(f.label!=""&&f.type!=""&&f.data!=""){window._r_.addSubNavElement(count,"none");$(scope._customRibbonPrefix+"_ribbon_feedType"+count+"_"+feedCount).selectedIndex=scope.__getTypeDropdownIndex(f.type);window._r_.selectSubNavType(count+"_"+feedCount);$(scope._customRibbonPrefix+"_ribbon_feedLabel"+count+"_"+feedCount).value=f.label;$(scope._customRibbonPrefix+"_ribbon_feedData"+count+"_"+feedCount).value=f.data;scope._elements[scope._feeds.length]="ribbonFeed_"+count+"_"+feedCount;feedCount++;}});count++;}});window._r_.setNavElementIndex(count);}}});}},__getTypeDropdownIndex:function(type){switch(type){case"group":return 0;case"tag":return 1;case"rss":return 2;case"group_list":return 3;default:return 0;}},__getSortDropdownIndex:function(type){switch(type){case"new":return 0;case"popular":return 1;default:return 0;}}});current.stub("current.content.groups");current.content.groups.GroupEditContentPage=Class.create({initialize:function(){this._pageId=current.site.Page.getInstance().getId();},init:function(relatedGroups,relatedGroupsHolder,groupSlug){var related=new current.GroupsBrowser(relatedGroups,relatedGroupsHolder,{minChars:2,tokens:",",disablePreselect:true,choices:12},"slug");this._slug=groupSlug;CharacterCounter.getInstance();this.addRemoveLinks($(document.getElementsByTagName("body")[0]));},addRemoveLinks:function(target){target.select(".removeRelatedGroup").invoke("observe","click",this.__onRemoveRelatedGroupClick.bindAsEventListener(this));},__onRemoveRelatedGroupClick:function(event){event.stop();var el=event.element();if($("throbber_"+el.id)){$("throbber_"+el.id).show();}current.proxy.CCCP.execute("group","marking_groups_post",{id:el.rel,markingGroupSlug:this._slug,markState:"basic",action:"delete"},this.__onRemoveSuccess.bindAsEventListener(this,el));},__onRemoveSuccess:function(data,el){if(data!=null){$("throbber_"+el.id).hide();el.up(".tagHolder").hide();}}});current.stub("current.content.groups");current.content.groups.ChallengePage=Class.create({initialize:function(){this._closeChallenge=$("closeChallengeLink");this._pitchStartLink=$("pitchStartLink");this._challengeType="";this._sandboxHandle="";this._storylineHandle="";this._slug="";this._title="";this._open=true;this._pitchSort=$("pitchSort");this._host=current.Constants.getInstance().getServerName();this._script=current.Constants.getInstance().getScriptName();this._shareLinksList=new Array();this._user=current.User.getInstance();},init:function(){this._challenge=$("challenge_"+this._id);if(this._closeChallenge){this._closeChallenge.observe("click",this.__onToggleChallenge.bindAsEventListener(this));}this.__setPitchStartLinks(".pitchStartLink");this.__setRemixLinks(".pitchRemixLink");this.__setShareLinks(".challengeItemLink");this.__setChallengeShareLinks(".challengeMenuLink");if(this._challengePhase=="voting"){this.__addChallengeSelectionLinks();}},__setPitchStartLinks:function(className){scope=this;var pitchers=$$(className);if(pitchers.length<1){return ;}pitchers.each(function(p){p.observe("click",scope.__onPitchStart.bindAsEventListener(scope));});},__setRemixLinks:function(className){scope=this;var remixers=$$(className);if(remixers.length<1){return ;}remixers.each(function(r){r.observe("click",scope.__openRemixStorymaker.bindAsEventListener(scope));});},__setShareLinks:function(className){scope=this;var sharing=$$(className);if(sharing.length<1){return ;}sharing.each(function(s){var relJSON=s.rel.evalJSON();var share=new Share(relJSON.id);share.setShareType("C");share.setUserId(scope._user.getId());share.setShareLink(s);scope._shareLinksList.push(share);});},__setChallengeShareLinks:function(className){scope=this;var sharing=$$(className);if(sharing.length<1){return ;}sharing.each(function(s){var relJSON=s.rel.evalJSON();var share=new Share(relJSON.id,relJSON.slug);share.setShareType("I");share.setUserId(scope._user.getId());share.setShareLink(s);scope._shareLinksList.push(share);});},setOpen:function(bool){this._open=bool;},setType:function(type){this._challengeType=type;},getType:function(){return this._challengeType;},setPhase:function(phase){this._challengePhase=phase.toLowerCase();},getPhase:function(){return this._challengePhase;},setId:function(id){this._id=id;},getId:function(){return this._id;},setSlug:function(slug){this._slug=slug;},getSlug:function(){return this._slug;},setTitle:function(title){this._title=title;},getTitle:function(){return this._title;},setSandboxHandle:function(handle){this._sandboxHandle=handle;},getSandboxHandle:function(){return this._sandboxHandle;},setStorylineHandle:function(handle){this._storylineHandle=handle;},getStorylineHandle:function(){return this._storylineHandle;},setChallengeSelection:function(id){this._challengeSelectionId=id;},__addChallengeSelectionLinks:function(){var _user=current.User.getInstance();this._voting=$H();scope=this;var vs=$$("#pitchList .challengeVoting");if(vs.length<1){return ;}vs.each(function(v){var vote=new current.components.voting.ChallengeVoteControls(v,scope._slug);vote.init();scope._voting.set(vote._id.toString(),vote);});if(_user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("challenge","storyline_voting",{id:this._slug,user:_user.getName(),items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){if(data&&data.contentId){var vote=this._voting.get(data.contentId);vote.setVoteData("Y");}},flushVoteData:function(){var scope=this;this._voting.each(function(pair){pair.value.setVoteData();});current.components.voting.ChallengeVoteControls.executeDelayed();},__onToggleChallenge:function(event){event.stop();if(this._open){Effect.BlindUp(this._challenge.id);this._closeChallenge.innerHTML="+ OPEN CHALLENGE";this._open=false;}else{Effect.BlindDown(this._challenge.id);this._closeChallenge.innerHTML="X CLOSE CHALLENGE";this._open=true;}},__onPitchStart:function(event){event.stop();if(this.getType()=="STORYMAKER"){if(!current.Authorize.checkInReadOnlyMode(event)){return ;}this._openNewStorymaker();}else{if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.SUBMIT);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var pitchWindow=new current.components.pitcher.PitcherWindow(event);pitchWindow.setGroupSlug(this.getSlug());pitchWindow.setGroupTitle(this.getTitle());pitchWindow.setChallengeType(this.getType());pitchWindow.init();}return false;},_openNewStorymaker:function(){this._storymakerBaseUrl=current.Constants.getInstance().getScriptName()+"/storymaker.htm?sandbox="+this.getSandboxHandle();if(this._storylineHandle!=""){this._storymakerBaseUrl=this._storymakerBaseUrl+"&lines="+this._storylineHandle;}this._winFeatures="width="+screen.width;this._winFeatures+=", height="+screen.height;this._winFeatures+=", top=0, left=0";this._winFeatures+=", fullscreen=yes";this._newWindow=window.open(this._storymakerBaseUrl,"storymaker"+this.getSandboxHandle(),this._winFeatures);if(window.focus){this._newWindow.focus();}return false;},__openRemixStorymaker:function(event){event.stop();var r=event.element();var relJSON=r.rel.evalJSON();var sandbox=relJSON.sandbox;var lines=relJSON.lines;var url=current.Constants.getInstance().getScriptName()+"/storymaker.htm?sandbox="+sandbox;if(lines!=""){url=url+"&lines="+lines;}this._winFeatures="width="+screen.width;this._winFeatures+=", height="+screen.height;this._winFeatures+=", top=0, left=0";this._winFeatures+=", fullscreen=yes";this._newWindow=window.open(url,"storymaker"+sandbox,this._winFeatures);if(window.focus){this._newWindow.focus();}return false;}});current.content.groups.ChallengePage.getInstance=function(){if(!document.__currentChallengePage__){document.__currentChallengePage__=new current.content.groups.ChallengePage();}return document.__currentChallengePage__;};current.stub("current.content.groups");current.content.groups.ChallengesPage=Class.create({initialize:function(){this._challengeSort=$("challengeSort");this._host=current.Constants.getInstance().getServerName();this._script=current.Constants.getInstance().getScriptName();this._shareLinksList=new Array();this._user=current.User.getInstance();},init:function(slug){this._slug=slug;this.__setPitchStartLinks(".pitchStartLink");this.__setShareLinks(".challengeMenuLink");},__setPitchStartLinks:function(className){scope=this;var pitchers=$$(className);if(pitchers.length<1){return ;}pitchers.each(function(p){p.observe("click",scope.__onPitchStart.bindAsEventListener(scope));});},__setShareLinks:function(className){scope=this;var sharing=$$(className);if(sharing.length<1){return ;}sharing.each(function(s){var relJSON=s.rel.evalJSON();var share=new Share(relJSON.id,relJSON.slug);share.setShareType("I");share.setUserId(scope._user.getId());share.setShareLink(s);scope._shareLinksList.push(share);});},__onPitchStart:function(event){event.stop();var el=event.element();var relJSON=el.rel.evalJSON();if(relJSON.type=="STORYMAKER"){if(!current.Authorize.checkInReadOnlyMode(event)){return ;}this._openNewStorymaker(relJSON.sandboxHandle);}else{if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.SUBMIT);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var pitchWindow=new current.components.pitcher.PitcherWindow(event);pitchWindow.setGroupSlug(relJSON.slug);pitchWindow.setGroupTitle(relJSON.title);pitchWindow.setChallengeType(relJSON.type);pitchWindow.init();}return false;},_openNewStorymaker:function(handle){this._storymakerBaseUrl=current.Constants.getInstance().getScriptName()+"/storymaker.htm?sandbox="+handle;this._winFeatures="width="+screen.width;this._winFeatures+=", height="+screen.height;this._winFeatures+=", top=0, left=0";this._winFeatures+=", fullscreen=yes";this._newWindow=window.open(this._storymakerBaseUrl,"storymaker"+handle,this._winFeatures);if(window.focus){this._newWindow.focus();}return false;}});current.content.groups.ChallengesPage.getInstance=function(){if(!document.__currentChallengesPage__){document.__currentChallengesPage__=new current.content.groups.ChallengesPage();}return document.__currentChallengesPage__;};current.stub("current.content.groups");current.content.groups.PhotoGallery=Class.create({initialize:function(){this._user=current.User.getInstance();this._userId=parseInt(this._user.getId());this._username=this._user.getUsername();this._isFetching=false;this._commentLength=5;this._commentStart=0;this._commentSort="";this._itemPage=null;this._currentPhotoId=0;this._currentChildCount=0;this._show=0;this._firstImage=true;},init:function(){this.__getInitialImage();if($(this._clipper+"_menuBox")){$(this._clipper+"_menuBox").hide();}if($(this._clipper+"_contentText")){$(this._clipper+"_contentText").title=current.locale.Bundle.get("item.Add_your_comment");}if($("nextCommentsLink")){$("nextCommentsLink").observe("click",this.__onNextComments.bindAsEventListener(this));}if($("prevCommentsLink")){$("prevCommentsLink").observe("click",this.__onPrevComments.bindAsEventListener(this));}this.__loadGallery();},setHeight:function(num){this._height=num;},setWidth:function(num){this._width=num;},setIds:function(arr){this._ids=arr;},setUserThumbnail:function(path){this._userThumbnailPath=path;},setClipper:function(id){this._clipper=id;},setCommentSort:function(sort){this._commentSort=sort;},setComscoreSite:function(val){this._siteId=val;},__getInitialImage:function(){var show=window.location.hash.substring(1,window.location.hash.indexOf("_"));if(typeof show=="undefined"||show==""){var str=window.location.toString();show=str.substring((str.lastIndexOf("/")+1),str.indexOf("_"));}for(var i=0;i<this._ids.length;i++){var info=this._ids[i];var photo=((typeof info=="object")?info:eval("("+info+")"));if(typeof photo!="undefined"){if(photo.id==show){this._show=i;break;}}}},__loadGallery:function(){var scope=this;$j("#galleryDisplay").galleria({autoplay:false,carousel:true,carouselFollow:true,carouselSpeed:440,carouselSteps:"auto",clicknext:false,dataConfig:function(img){return{image:$j(img).attr("longdesc"),thumb:$j(img).attr("src"),title:$j(img).parent().attr("title"),description:$j(img).attr("alt"),link:$j(img).parent().attr("href"),id:$j(img).attr("id"),author:$j(img).next(".author").html()};},dataSelector:"img",dataSource:$j("#galleryDisplay"),debug:true,easing:"swing",extend:function(){Galleria.log(this);this.bind("image",function(e){Galleria.log(e);scope.__imageGets(e.index);});this.attachKeyboard({right:this.next,left:this.prev});},height:scope._height,idleTime:3000,idleSpeed:200,imageCrop:false,imageMargin:0,imagePan:false,imagePanSmoothness:12,imagePosition:"50%",keepSource:false,lightboxFadeSpeed:200,lightboxTransition_speed:500,linkSourceTmages:true,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:true,popupLinks:false,preload:2,queue:true,show:this._show,showInfo:true,showCounter:true,showImagenav:true,thumbCrop:true,thumbFit:true,thumbMargin:0,thumbQuality:"auto",thumbnails:true,transition:"fade",transitionSpeed:400,width:scope._width});},__imageGets:function(index){var info=this._ids[index];var photo=((typeof info=="object")?info:eval("("+info+")"));if(typeof photo!="undefined"){if(!this._isFetching){this._isFetching=true;this._currentPhotoId=photo.id;this._currentChildCount=photo.childCount;this._commentLength=5;this._commentStart=0;$("prevCommentsLink").hide();$("nextCommentsLink").hide();if($("itemResponseTitle").down(".responseCTA")){$("itemResponseTitle").down(".responseCTA").remove();}var hashTag=photo.url;if(hashTag.lastIndexOf("#")!=-1){hashTag=hashTag.substring(hashTag.lastIndexOf("#")+1);}window.location.hash="#"+hashTag;$("commentList").innerHTML="";var titleSpan=new Element("span",{id:"smallTitle"}).insert(" // "+photo.title);var commentCount=((parseInt(photo.childCount)==1)?"1 comment ":photo.childCount+" comments ");$("itemResponseTitle").down("h2").update(commentCount);$("itemResponseTitle").down("h2").insert(titleSpan);if(this._user.isItemAdminWrite()&&parseInt(photo.childCount)>0){var lockBox;if(photo.commentsLocked){lockBox=new Element("a",{href:"#",id:"itemCommentLock",title:"unlock",rel:"{lockBox: false, id: "+photo.id+"}","class":"isAdmin"}).insert(current.locale.Bundle.get("item.unlock_all"));}else{lockBox=new Element("a",{href:"#",id:"itemCommentLock",title:"lock",rel:"{lockBox: true, id: "+photo.id+"}","class":"isAdmin"}).insert(current.locale.Bundle.get("item.lock_all"));}titleSpan.insert(lockBox);}if(photo.commentsLocked){var responseCTA=new Element("div",{"class":"responseCTA"});var responsesLocked=new Element("div",{"class":"responsesLocked"});var div=new Element("div");var repliesLocked=new Element("span",{"class":"Sprites repliesLocked floatLeft"});div.insert(repliesLocked);div.insert(current.locale.Bundle.get("item.Comments_have_been_locked_on_this_page"));responsesLocked.insert(div);responseCTA.insert(responsesLocked);$("itemResponseTitle").insert(responseCTA);}if($(this._clipper+"_parentContentId")){$(this._clipper+"_parentContentId").value=photo.id;}if($(this._clipper+"_contentText")&&$(this._clipper+"_contentText").hasClassName("validate-max8000")){$(this._clipper+"_contentText").removeClassName("validate-max8000");$(this._clipper+"_contentText").addClassName("validate-max2000");CharacterCounter.getInstance(true);}var shareUrl=current.Constants.getInstance().getServerName()+photo.url.replace("#","%23");$("galleryDisplay").down(".galleria-share-image").innerHTML="";var tweet=encodeURIComponent('Check out "')+photo.title.substring(0,50)+encodeURIComponent('" at ')+shareUrl;var shareBox=new Element("div",{id:"shareImage","class":"shareImage"});var share=new Element("ul",{"class":"options"});share.insert(new Element("li",{}).insert(new Element("span",{"class":"floatLeft"}).insert(current.locale.Bundle.get("share.Share_this_photo")+":")));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_facebook'}",href:"http://www.facebook.com/sharer.php?u="+shareUrl+"&t="+photo.title,id:"contentItemFacebookLink",target:"_blank",title:"Facebook","class":"contentItemShareLink floatLeft nudgeRight"}).insert(new Element("span",{"class":"Sprites facebookIcon floatLeft itemSharingButtonLarge"}))));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_twitter'}",href:"http://twitter.com/home?status="+tweet,id:"contentItemTwitterLink",target:"_blank",title:"Twitter","class":"contentItemShareLink floatLeft"}).insert(new Element("span",{"class":"Sprites twitterIcon floatLeft itemSharingButtonLarge"}))));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_delicious'}",href:"http://del.icio.us/post?v=2&url="+shareUrl+"&title="+photo.title,id:"contentItemDeliciousLink",target:"_blank",title:"Del.icio.us","class":"contentItemShareLink floatLeft"}).insert(new Element("span",{"class":"Sprites deliciousIcon floatLeft itemSharingButtonLarge"}))));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_buzz'}",href:"http://buzz.yahoo.com/article/current616/"+shareUrl,id:"contentItemBuzzLink",target:"_blank",title:"Buzz up!","class":"contentItemShareLink floatLeft"}).insert(new Element("span",{"class":"Sprites yBuzzIcon floatLeft itemSharingButtonLarge"}))));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_digg'}",href:"http://digg.com/submit?phase=2&url="+shareUrl+"&title="+photo.title+"&bodytext=&topic=news",id:"contentItemDiggLink",target:"_blank",title:"Digg","class":"contentItemShareLink floatLeft"}).insert(new Element("span",{"class":"Sprites diggIcon floatLeft itemSharingButtonLarge"}))));share.insert(new Element("li",{}).insert(new Element("a",{name:"{clickmap: 'share_currentShareThis'}",href:"#shareThis",id:"contentItemShareLink_"+photo.id,"class":"contentItemShareLink floatLeft",onclick:"return false;",title:current.locale.Bundle.get("share.Send_to_a_friend")}).insert(new Element("span",{"class":"Sprites shareIcon floatLeft itemSharingButtonLarge"}))));$("galleryDisplay").down(".galleria-share-image").insert(new Element("a",{name:"shareBox"}));shareBox.insert(share);$("galleryDisplay").down(".galleria-share-image").insert(shareBox);if(this._itemPage==null){this._itemPage=current.content.items.ItemPage.getInstance("","","");this._itemPage.setReadOnly((current.Constants.getInstance().isReadOnlyMode())?true:false);this._itemPage.setCommentClip(this._clipper);if(!this._user.isEmailVerified()){this._itemPage.setRichCommentFlag();}if(!this._user.isLoggedIn()){this._itemPage.setUserThumbnail("/images/current/icons/you");}else{this._itemPage.setUserThumbnail(this._userThumbnailPath);}var mtArray=new Array();this._itemPage.setGroups(mtArray);this._itemPage.setGroupSlugs("");this._itemPage.setCommentSort(this._commentSort);}this._itemPage.setPageId(photo.id);this._itemPage.setCommentsLocked(photo.commentsLocked);this._itemPage.setShortUrl(photo.url);this._itemPage.setContentType(photo.source);this._itemPage.setOwnerId(photo.ownerId);this._itemPage.setCommentStart(0);this._itemPage.setCommentLength(this._commentLength);this._itemPage.init();this._itemPage.reloadComments();if(parseInt(photo.childCount)>5){Effect.Appear("nextCommentsLink");}else{$("nextCommentsLink").hide();}this._isFetching=false;if(!this._firstImage){this.__makeTrackingCall(photo.id,photo.url);}this._firstImage=false;}}},__onPhotoCommentsFail:function(data){this._isFetching=false;},__onPrevComments:function(event){event.stop();this._commentStart-=50;this._itemPage.setCommentLength(this._commentLength);this._itemPage.setCommentStart(this._commentStart);this._itemPage.reloadComments();if(this._commentStart>0){$("prevCommentsLink").show();}else{$("prevCommentsLink").hide();this._commentStart=0;}if(this._currentChildCount>(this._commentStart+this._commentLength)){$("nextCommentsLink").show();}},__onNextComments:function(event){if(this._commentLength==5){event.stop();this._commentStart=-50;this._commentLength=50;}this._commentStart+=50;this._itemPage.setCommentLength(this._commentLength);this._itemPage.setCommentStart(this._commentStart);this._itemPage.reloadComments();if(this._currentChildCount>(this._commentStart+this._commentLength)){$("nextCommentsLink").show();}else{$("nextCommentsLink").hide();}if(this._commentStart>0){Effect.Appear("prevCommentsLink");}},__makeTrackingCall:function(id,url){url=url.replace("#","");current.site.Page.getInstance().setId(id);current.site.Page.getInstance().setUrl(url);current.tracking.Track.getInstance().execPageTrack(url);var _comscore=_comscore||[];_comscore.push({c1:2,c2:this._siteId,c4:url});if(typeof COMSCORE=="undefined"){(function(){var s=document.createElement("script"),el=document.getElementsByTagName("script")[0];s.async=true;s.src=(document.location.protocol=="https:"?"https://sb":"http://b")+".scorecardresearch.com/beacon.js";el.parentNode.insertBefore(s,el);})();}COMSCORE.beacon({c1:2,c2:this._siteId,c4:url});}});current.content.groups.PhotoGallery.getInstance=function(){if(!document.__currentPhotoGallery__){document.__currentPhotoGallery__=new current.content.groups.PhotoGallery();}return document.__currentPhotoGallery__;};current.stub("current.content.items");current.content.items.ItemsIndexPage=Class.create({initialize:function(){},init:function(){this._doVotingSetup();},_doVotingSetup:function(){var _user=current.User.getInstance();this._voting=$H();scope=this;$$(".voting").each(function(v){var vote=new current.components.voting.VoteControls(v);vote.init();scope._voting.set(vote._id.toString(),vote);});if(_user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:_user.getName(),items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});}});current.stub("current.content.items");current.content.items.Reply=Class.create({initialize:function(){this.EDIT_HEADER_STRING=new Template(current.locale.Bundle.get("item.Reply_to_username"));},__onReplyableClick:function(event){event.stop();if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var el=event.element();this._prepareClipperForRebuttal(el.rel.evalJSON(),event);},_prepareClipperForRebuttal:function(rel,event){var args={username:rel.username};var clipperWindow=new current.clipper.ClipperWindow(event,event.element().cumulativeOffset()["left"]-42,event.element().cumulativeOffset()["top"]-120);clipperWindow.setParentContentId(current.site.Page.getInstance().getId());clipperWindow.setParentCommentId(rel.id);clipperWindow.setContext(Clipper2Static.CONTEXT_COMMENT);clipperWindow.setClipperTitle(this.EDIT_HEADER_STRING.evaluate(args));clipperWindow.init();}});Object.Event.extend(current.content.items.Reply);current.content.items.Reply.getInstance=function(key){if(!document.__currentReply__){document.__currentReply__=new current.content.items.Reply();}return document.__currentReply__;};var MarkItemWithTag=Class.create({initialize:function(target,addButton,isOwner){this._target=target;this._submitting=false;this._isOwner=isOwner;this._showAllLink=$("showMoreTagsButton");$(addButton).observe("click",this.__onAddClick.bindAsEventListener(this));},__onAddClick:function(event){Event.stop(event);if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.TAG);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}$(Event.element(event)).hide();if(this._showAllLink!=null){this._showAllLink.up().hide();$$(".tagsMore").invoke("show");}$(this._target).show();this.addField();},addField:function(){var a=new Element("input",{type:"text",id:"topicInput",style:"padding-left: .15em; width: 18.0em; height: 1.8em; margin-right: .25em;","class":"required validate-interestNameLength escapeHTML blueBorder floatLeft",name:"topicInput"});var b=new Element("div",{"class":"page_name_auto_complete",id:"topicInputAutcomplete"});var c=new Element("a",{href:"#",onclick:"return false;","class":"Sprites Button smButton smGrayButton floatLeft"});c.update(current.locale.Bundle.get("add"));this.getTarget().appendChild(a);this.getTarget().appendChild(c);$("content").insert(b);$(c).onclick=this.__onSubmitClick.bindAsEventListener(this);var _b=new current.TagsBrowser("topicInput","topicInputAutcomplete",{minChars:2,tokens:",",disablePreselect:true,choices:12});this.setInput(a);},__onOpen:function(){if($("addToInterestFailLink")!==null){$("addToInterestFailureClose").onclick=this._onCloseFailureClick.bindAsEventListener(this);$("addToInterestFailLink").onclick=this.openDialogue.bindAsEventListener(this);}},__onSubmitClick:function(event){Event.stop(event);if(this._submitting){return ;}var result=Validation.validate(this.getInput());if(!result){return ;}this._submitting=true;ContentService.copyContent(this.getParentId(),"add",this.getInput().value,this.__onSubmitInterestsComplete.bindAsEventListener(this,event),this.__onPostFailure.bindAsEventListener(this,this.getInput().value));},__onPostFailure:function(data,value){this._submitting=false;var interestHolder=$("itemTagList");var failedInterests=new Array();var failedObject=new Object();failedObject.interestName=value;failedInterests[0]=failedObject;this._addFailed($("addToInterestFailure"),failedInterests);this.finishSubmit();},__onSubmitInterestsComplete:function(data,event){this._submitting=false;var interestHolder=$("itemTagList");var addedInterests=data.successInterests;var failedInterests=data.errors;if(addedInterests==null&&failedInterests==null){new current.components.alerts.AlertWindow(event,current.locale.Bundle.get("alert.TagAlreadyOnItem")).init();this.finishSubmit();}if(addedInterests!=null&&addedInterests!=null){this._addInterests(interestHolder,addedInterests);}if(failedInterests!=null&&failedInterests.length>0){this._addFailed($("addToInterestFailure"),failedInterests);}this.finishSubmit();},finishSubmit:function(){current.uncache();this.close();},close:function(){this.getInput().value="";},_addInterests:function(target,interests){var c=interests.length;for(var i=0;i<c;i++){var interest=interests[i];if(interest.hidden&&!current.User.getInstance().isTagAdminWrite()){continue;}var tagsExtant=this.getTarget().previousSiblings();var lastTag=1;for(j=1;j<tagsExtant.length;j++){if(tagsExtant[j].hasClassName("tagSpan")){tagsExtant[j].insert(", ");tagsExtant[j].insert("&nbsp;");lastTag=j;break;}}var newSpan=new Element("span",{id:"tag"+interest.id,"class":(interest.hidden)?"tagSpan tag isAdmin":"tagSpan tag"});if(current.User.getInstance().isTagAdminWrite()||this._isOwner){var x=new Element("a",{href:"#","class":"topicRemove",style:"color: #ff0000; margin-right: 0.2em;",rel:interest.id,title:"remove tag '"+interest.name+"'"}).insert("x");var scope=this;x.insert(" ");newSpan.insert(x);x.onclick=function(event){if(!current.Authorize.checkWriteMode(event)){return ;}var target=this;ContentService.unCopyContent(scope.getParentId(),"delete",this.rel,function(){target.up().hide();});current.uncache();return false;};}var tagLink=new Element("a",{href:current.Constants.getInstance().getScriptName()+"/tags/"+interest.id+"_"+interest.slug+"/"}).insert(interest.name);newSpan.insert(tagLink);Element.insert(tagsExtant[lastTag].id,{after:newSpan});}},_addFailed:function(target,interests){var str=current.locale.Bundle.get("topic.addPrivateTagToInterestFailure")+": <strong>"+interests.pluck("interestName").join(", ")+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},_onCloseFailureClick:function(event){new Effect.Fade(Event.element(event).rel,{duration:1});},getTarget:function(){return $(this._target);},setParentId:function(id){this._parentId=id;},getParentId:function(){return this._parentId;},getClosedUser:function(){return this._closed;},setClosedUser:function(bool){this._closed=bool;},setInput:function(topicInput){this._input=topicInput;},getInput:function(){return $(this._input);},getLocaleId:function(){return this._localeId;},setLocaleId:function(id){this._localeId=id;},getContentSource:function(){return this._contentSource;},setContentSource:function(contentSource){this._contentSource=contentSource;}});var MarkItemWithGroup=Class.create({initialize:function(target,addButton,itemGroups,userGroups,isOwner){this._target=target;this._addButton=addButton;this._user=current.User.getInstance();this._page=current.site.Page.getInstance();this._pageId=this._page.getId();this._userGroups=userGroups;this._itemGroups=itemGroups;this._submitting=false;this._showAllLink=$("showMoreGroupsButton");this._isOwner=isOwner;if($(addButton)){$(addButton).observe("click",this.__onAddClick.bindAsEventListener(this));}},getGroups:function(){return this._userGroups;},__onAddClick:function(event){Event.stop(event);if(!current.User.getInstance().isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.ADD_TO_GROUP);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}$(Event.element(event)).hide();if(this._showAllLink!=null){this._showAllLink.up().hide();$$(".groupsMore").invoke("show");}$(this._target).show();this.addField();if($("groupSelect")){$("groupSelect").options[0].selected=true;}},addField:function(){var a=new Element("select",{id:"groupSelect",style:"padding-left: .15em; width: 18.0em; height: 2em; margin-right:.25em;","class":"required blueBorder floatLeft",name:"groupSelect"});var b=new Element("div",{"class":"page_name_auto_complete",id:"groupSelectForm"});var c=new Element("a",{href:"#",onclick:"return false;","class":"Sprites Button smButton smGrayButton floatLeft"}).insert(current.locale.Bundle.get("add"));this.getTarget().appendChild(a);this.getTarget().appendChild(c);$("content").insert(b);$(c).onclick=this.__onSubmitClick.bindAsEventListener(this);var groups=this.getGroups();var extGroups=this._itemGroups;$A(groups).sort(function(a,b){return(a.name.toLowerCase()<b.name.toLowerCase())?-1:1;}).each(function(o,i){groups[i]=o;});groups.each(function(g){if(!extGroups.include(g.id)){a.insert(new Element("option",{value:g.slug,id:"group_opt_"+g.id}).insert(g.name));}});var _b=new Element("a",{href:"#",onclick:"return false;","class":"Sprites Button smButton smGrayButton floatLeft"}).insert(current.locale.Bundle.get("add"));this.setInput(a);},__onOpen:function(){if($("addToInterestFailLink")!==null){$("addToInterestFailureClose").onclick=this._onCloseFailureClick.bindAsEventListener(this);$("addToInterestFailLink").onclick=this.openDialogue.bindAsEventListener(this);}},__onSubmitClick:function(event){Event.stop(event);if(this._submitting||$("groupSelect").selectedIndex==0){return ;}var result=Validation.validate(this.getInput());if(!result){return ;}this._selectedIndex=$("groupSelect").selectedIndex;var inp=this.getInput();this._submitting=true;current.proxy.CCCP.execute("item","group_post",{id:this._pageId,groupSlugs:inp.value,action:"add"},this.__onSubmitSingleInterestComplete.bindAsEventListener(this),this.__onSubmitSingleInterestFailure.bindAsEventListener(this,inp.options[inp.selectedIndex].innerHTML));},__onSubmitSingleInterestComplete:function(data){this._submitting=false;var interestHolder=$("itemInterestList");var addedInterest=data.successInterests[0];if(addedInterest!=null&&addedInterest!=""&&addedInterest.id!=null){this._addInterest(interestHolder,addedInterest);}this.finishSubmit(addedInterest.id);},__onSubmitSingleInterestFailure:function(data,value){this._submitting=false;var interestHolder=$("itemInterestList");var failedInterest=value;this._addFailedInterest($("addToInterestFailure"),failedInterest);this.finishSubmit();},finishSubmit:function(id){this._itemGroups.push(addedInterest.id);$(this._target).hide();$(this._target).update("");$(this._addButton).show();current.uncache();this.close();},close:function(){$("groupSelect").remove(this._selectedIndex);},_addInterest:function(target,group){if(group.hidden&&!current.User.getInstance().isGroupAdminWrite()){return ;}var groupsExtant=this.getTarget().previousSiblings();var lastGroup=0;if(groupsExtant.length>0){for(j=1;j<groupsExtant.length;j++){if(groupsExtant[j].hasClassName("groupSpan")){groupsExtant[j].insert(", ");groupsExtant[j].insert("&nbsp;");lastGroup=j;break;}}}var newSpan=new Element("span",{id:"group"+group.id,"class":(group.hidden)?"groupSpan group isAdmin":"groupSpan group"});var groupLink=new Element("a",{href:current.Constants.getInstance().getScriptName()+"/"+group.slug+"/"}).insert(group.name);if(current.User.getInstance().isGroupAdminWrite()||this._isOwner){var x=new Element("a",{href:"#","class":"groupRemove itemGroupLink",style:"color: #ff0000;",rel:group.slug,title:current.locale.Bundle.get("item.admin.removeFromGroup")+" '"+group.name+"'"}).insert("x");var scope=this;x.insert(" ");newSpan.insert(x);x.onclick=function(event){if(!current.Authorize.checkWriteMode(event)){return ;}var target=this;current.proxy.CCCP.execute("item","group_post",{id:scope._pageId,groupSlugs:this.rel,action:"delete"},function(){target.up().hide();});current.uncache();return false;};}$("group_opt_"+group.id).remove();newSpan.insert(groupLink);Element.insert(groupsExtant[lastGroup].id,{after:newSpan});},_addFailedInterest:function(target,group){$("frame").scrollTo();var str=current.locale.Bundle.get("topic.addPrivateGroupToInterestFailure")+": <strong>"+group+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},_addFailed:function(target,interests){var str=current.locale.Bundle.get("topic.addPrivateGroupToInterestFailure")+": <strong>"+interests.pluck("name").join(", ")+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},_onCloseFailureClick:function(event){new Effect.Fade(Event.element(event).rel,{duration:1});},getTarget:function(){return $(this._target);},setParentId:function(id){this._parentId=id;},getParentId:function(){return this._parentId;},setInput:function(topicInput){this._input=topicInput;},getInput:function(){return $(this._input);}});current.stub("current.content.items");current.content.items.ToggleCommentLock=Class.create({initialize:function(){this._user=current.User.getInstance();this._userId=parseInt(this._user.getId());},__onToggleCommentLock:function(event,topLevel){Event.stop(event);if(!current.Authorize.checkWriteMode(event)){return ;}var el=Event.element(event);var rel=el.rel.evalJSON();var action=(rel.lockBox==true)?"lock":"unlock";if(!topLevel){ContentService.toggleResponseCommentLock(rel.id,action,this.__onLockComplete.bindAsEventListener(this,el,rel));}else{ContentService.toggleItemCommentLock(rel.id,action,this.__onLockItemComplete.bindAsEventListener(this,el,rel));}},__onLockItemComplete:function(data,el,rel){if(data){window.location.reload();}},__onLockComplete:function(data,el,rel){if(data){var container=el.up();container.innerHTML="";var target=container.up(".commentActions").down(".commentReply");target.innerHTML="";var a;if(rel.lockBox){a=new Element("a",{href:"#",title:"unlock",rel:"{'lockBox': false, 'id': "+rel.id+", username: '"+rel.username+"'}","class":"adminToggleCommentLock"}).update("unlock");container.insert(a);target.insert(new Element("span",{"class":"Sprites repliesLocked floatLeft"}));target.insert(new Element("span",{}).update(current.locale.Bundle.get("item.replies_locked")));}else{a=new Element("a",{href:"#",title:"lock",rel:"{'lockBox': true, 'id': "+rel.id+", username: '"+rel.username+"'}","class":"adminToggleCommentLock"}).update("lock");container.insert(a);var replyIcon=new Element("span",{"class":"Sprites replyIconGreen"}).update(" ");var replyLink=new Element("a",{href:"#","class":"replyable",rel:"{id: "+rel.id+", username: '"+rel.username+"'}"});replyLink.insert(replyIcon);replyLink.insert(" "+current.locale.Bundle.get("item.reply"));target.insert(replyLink);}a.onclick=this.__onToggleCommentLock.bindAsEventListener(this,0);}}});Object.Event.extend(current.content.items.ToggleCommentLock);current.content.items.ToggleCommentLock.getInstance=function(){if(!document.__currentToggleCommentLock__){document.__currentToggleCommentLock__=new current.content.items.ToggleCommentLock();}return document.__currentToggleCommentLock__;};current.stub("current.content.items");current.content.items.ItemAdminModal=Class.create({initialize:function(key){this._reasonCodeId="adminReasonCode";this._textareaId="adminTextarea";this._submitButtonId="adminSubmit";this._cancelButtonId="adminCancel";this._open=false;this._u=current.User.getInstance();this._contentType="item";},init:function(){},setOperation:function(str){this._Operation=str;},getOperation:function(){return this._Operation;},setContentType:function(str){this._contentType=str;},getContentType:function(){return this._contentType;},setContentId:function(str){this._contentId=str;},getContentId:function(){return this._contentId;},_blockUnverifiedUsers:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}},setItemVisibility:function(reasonCode,reasonText,callback){var type=this.getContentType();var id=this.getContentId();var op=this.getOperation();if(!callback){callback=this.__onReverseHide.bindAsEventListener(this);}if(type=="storyline"){if(op!="delete"){return ;}ContentService.deleteStoryline(reasonCode,reasonText,id,callback);}else{if(type=="scene"){if(op!="delete"){return ;}ContentService.deleteScene(reasonCode,reasonText,id,callback);}else{ContentService.setItemVisibility(id,op,reasonCode,reasonText,callback);}}},openAdminModal:function(id){if(this._open){return false;}Control.Modal.open(false,{contents:'<div id="adminContent"></div>',width:500,containerClassName:"adminModalContainer",afterOpen:this.__onAdminOpen.bindAsEventListener(this,id),beforeClose:this.__onAdminClose.bindAsEventListener(this)});return true;},__onAdminOpen:function(event,id){this.__getContents(),this._submitListener=this.__onSubmit.bindAsEventListener(this);this._cancelListener=this.__onCancel.bindAsEventListener(this);$(this._submitButtonId).observe("click",this._submitListener);$(this._cancelButtonId).observe("click",this._cancelListener);$(this._textareaId).observe("focus",this.__onTextareaFocus.bindAsEventListener(this));},__onAdminClose:function(){this._open=false;Event.stopObserving($(this._submitButtonId),"click",this._submitListener);Event.stopObserving($(this._cancelButtonId),"click",this._cancelListener);$("adminContent").remove();},__onTextareaFocus:function(){$(this._textareaId).style.color="#000";$(this._textareaId).value="";},__onSubmit:function(event){event.stop();if(!Validation.validate($("adminTextarea"))){return ;}if(!current.Authorize.checkWriteMode(event)){return ;}if($(this._textareaId).value==$(this._textareaId).title){$(this._textareaId).value="";}this.notetext=$(this._textareaId).value.truncate(200,"");this.notetext.stripTags();this.setItemVisibility($(this._reasonCodeId).value,this.notetext,this.__onVisibilityChange.bindAsEventListener(this));},__onVisibilityChange:function(event){this.__closeAdminModal();window.location.reload();},__onReverseHide:function(event){window.location.reload();},__onCancel:function(event){event.stop();this.__closeAdminModal();},__closeAdminModal:function(data){Control.Modal.close();},__buildReasonList:function(reasons){this.selectList=new Element("select",{id:"adminReasonCode",name:"reasonCode",className:"validate-selection floatLeft"});this.optionOne=new Element("option",{selected:"selected",value:"0"}).update(current.locale.Bundle.get("item.admin.chooseReason"));this.selectList.update(this.optionOne);var scope=this;reasons.each(function(reason){scope.selectList.insert(new Element("option",{value:reason.id}).update(reason.description));});$("reasonCodeHolder").update(this.selectList);},__getContents:function(){this.a=$("adminContent");this.b=new Element("h2");this.headingMsg=current.locale.Bundle.get("item.delete.confirm");if(this._u.isItemAdminWrite()&&(this.getOperation()=="hide")){this.headingMsg=current.locale.Bundle.get("item.admin.whyDoYouWantToHide");}else{if(this._u.isItemAdminWrite()&&(this.getOperation()=="delete")){this.headingMsg=current.locale.Bundle.get("item.admin.whyDoYouWantToDelete");}else{if(this._u.isItemAdminWrite()&&(this.getOperation()=="spam")){this.headingMsg=current.locale.Bundle.get("item.admin.whyDoYouWantToMarkAsSpam");}}}this.a.insert(this.b.update(this.headingMsg));this.formBlock=new Element("form",{className:"validate-init"});this.operation=new Element("input",{type:"hidden",name:"operation",value:this.getOperation()});this.contentId=new Element("input",{type:"hidden",name:"contentId",value:this.getContentId()});this.formBlock.insert(this.operation);this.formBlock.insert(this.contentId);this.formBlock.insert(new Element("div",{id:"reasonCodeHolder",className:"clearBoth"}));if(this._u.isItemAdminWrite()&&(this.getOperation()!="spam")){ContentService.getReasonCodes(this.__buildReasonList.bind(this));}else{if(this._u.isItemAdminWrite()&&(this.getOperation()=="spam")){this.reasonCode=new Element("input",{type:"hidden",id:"adminReasonCode",name:"reasonCode",value:"17"});this.formBlock.insert(this.reasonCode);}else{this.reasonCode=new Element("input",{type:"hidden",id:"adminReasonCode",name:"reasonCode",value:"1"});this.formBlock.insert(this.reasonCode);}}this.textBlock=new Element("textarea",{id:"adminTextarea",name:"reasonText",maxlength:"200",style:"color:#999",className:"validate-isNotHint validate-max200 blueBorder floatLeft",title:current.locale.Bundle.get("make.resources.more_info")+" ("+current.locale.Bundle.get("optional")+")"});this.formBlock.insert(this.textBlock);this.d=new Element("div",{className:"clearBoth floatLeft",style:"width: 420px; margin-top: 1.0em;"});this.e=new Element("a",{href:"#",id:"adminSubmit",className:"Sprites Button lgButton lgGrayButton floatLeft",onclick:"return false"});this.e.insert(current.locale.Bundle.get("delete"));if(this._u.isItemAdminWrite()&&(this.getOperation()=="hide")){this.e=new Element("a",{href:"#",id:"adminSubmit",className:"Sprites Button lgButton lgGrayButton floatLeft",onclick:"return false"});this.e.insert(current.locale.Bundle.get("submit"));}if(this._u.isItemAdminWrite()&&(this.getOperation()=="spam")){this.e=new Element("a",{href:"#",id:"adminSubmit",className:"Sprites Button lgButton lgGrayButton floatLeft",onclick:"return false"});this.e.insert(current.locale.Bundle.get("item.admin.mark_as_spam"));}this.f=new Element("a",{href:"#",id:"adminCancel",className:"Sprites Button lgButton lgGrayButton floatLeft",onclick:"return false"});this.f.insert(current.locale.Bundle.get("cancel"));this.d.insert(this.e);this.d.insert(this.f);this.formBlock.insert(this.d);this.a.insert(this.formBlock);EventSelectors.start(EventSelectorRules);}});Object.Event.extend(current.content.items.ItemAdminModal);current.content.items.ItemAdminModal.getInstance=function(){if(!document.__currentItemAdminModal__){document.__currentItemAdminModal__=new current.content.items.ItemAdminModal();}return document.__currentItemAdminModal__;};current.stub("current.content.items");current.content.items.CommentEdit=Class.create({initialize:function(){this._editing=false;},cancel:function(){if(!this._editing){return ;}this._editing=false;new Effect.Opacity(this.getCommentContainer(),{from:0.2,to:1,duration:0.5});},isEditing:function(){return this._editing;},setCommentContainer:function(commentContainer){this._commentContainer=commentContainer;},getCommentContainer:function(){return this._commentContainer;},onEditClick:function(event,relData){event.stop();if(current.Constants.getInstance().isReadOnlyMode()){new current.components.alerts.AlertWindow(event).init();return ;}this._editing=true;this.setCommentContainer(event.element().up(".response"));var data=relData.evalJSON();var clipperWindow=new current.clipper.ClipperWindow(event,event.element().cumulativeOffset()["left"]-142,event.element().cumulativeOffset()["top"]-120);clipperWindow.setItemId(data.id);clipperWindow.setEditString(true);clipperWindow.setContext(Clipper2Static.CONTEXT_COMMENT);clipperWindow.setClipperTitle(current.locale.Bundle.get("shared.editComment"));clipperWindow.setParentContentId(current.site.Page.getInstance().getId());clipperWindow.setParentCommentId(data.parentCommentId);clipperWindow.init();new Effect.Opacity(this.getCommentContainer(),{from:1,to:0.2,duration:0.5});}});current.content.items.CommentEdit.getInstance=function(itemInteractMenuTarget,itemDetails){if(!document.__currentItemCommentEdit__){document.__currentItemCommentEdit__=new current.content.items.CommentEdit();}return document.__currentItemCommentEdit__;};current.stub("current.content.items");current.content.items.CommentObserver=Class.create({initialize:function(){this._user=current.User.getInstance();this._userId=parseInt(this._user.getId());this._adminModal=current.content.items.ItemAdminModal.getInstance();this._commentLock=current.content.items.ToggleCommentLock.getInstance();this._commentEdit=current.content.items.CommentEdit.getInstance();this._reply=current.content.items.Reply.getInstance();this._flag=Flag.getInstance(true);this._voting=current.components.voting.CommentVoteControls.getInstance();this._editListener=this.__onCommentEditClick.bindAsEventListener(this);this._deleteListener=this.__onItemDeleteClick.bindAsEventListener(this);this._hideListener=this.__onItemHideClick.bindAsEventListener(this);this._unhideListener=this.__onItemUnhideClick.bindAsEventListener(this);this._spamListener=this.__onCommentSpamClick.bindAsEventListener(this);this._unspamListener=this.__onCommentUnspamClick.bindAsEventListener(this);this._lockToggleListener=this.__onLockToggleClick.bindAsEventListener(this);this._replyListener=this.__onReplyClick.bindAsEventListener(this);this._flagListener=this.__onFlagClick.bindAsEventListener(this);this._blockUnverifiedListener=this._blockUnverifiedUsers.bindAsEventListener(this);},init:function(target){this._target=target;this.observeAll();},reset:function(){this.stopObservingAll();},observeAll:function(){if($(this._target).down(".commentEditLink")){$(this._target).down(".commentEditLink").observe("click",this._editListener);}if($(this._target).down(".itemDeleteLink")){$(this._target).down(".itemDeleteLink").observe("click",this._deleteListener);}if($(this._target).down(".itemHideLink")){$(this._target).down(".itemHideLink").observe("click",this._hideListener);}if($(this._target).down(".itemUnhideLink")){$(this._target).down(".itemUnhideLink").observe("click",this._unhideListener);}if($(this._target).down(".commentSpamLink")){$(this._target).down(".commentSpamLink").observe("click",this._spamListener);}if($(this._target).down(".commentUnspamLink")){$(this._target).down(".commentUnspamLink").observe("click",this._unspamListener);}if($(this._target).down(".itemCMSLink")){$(this._target).down(".itemCMSLink").observe("click",this._blockUnverifiedListener);}if($(this._target).down(".adminToggleCommentLock")){$(this._target).down(".adminToggleCommentLock").observe("click",this._lockToggleListener);}if($(this._target).down(".replyable")){$(this._target).down(".replyable").observe("click",this._replyListener);}if($(this._target).down(".flaggable")){$(this._target).down(".flaggable").observe("click",this._flagListener);}if($(this._target).down(".voting")){this._voting.init($(this._target).down(".voting"));}},stopObservingAll:function(){if($(this._target).down(".commentEditLink")){$(this._target).down(".commentEditLink").stopObserving("click",this._editListener);}if($(this._target).down(".itemDeleteLink")){$(this._target).down(".itemDeleteLink").stopObserving("click",this._deleteListener);}if($(this._target).down(".itemHideLink")){$(this._target).down(".itemHideLink").stopObserving("click",this._hideListener);}if($(this._target).down(".itemUnhideLink")){$(this._target).down(".itemUnhideLink").stopObserving("click",this._unhideListener);}if($(this._target).down(".commentSpamLink")){$(this._target).down(".commentSpamLink").stopObserving("click",this._spamListener);}if($(this._target).down(".commentUnspamLink")){$(this._target).down(".commentUnspamLink").stopObserving("click",this._unspamListener);}if($(this._target).down(".itemCMSLink")){$(this._target).down(".itemCMSLink").stopObserving("click",this._blockUnverifiedListener);}if($(this._target).down(".adminToggleCommentLock")){$(this._target).down(".adminToggleCommentLock").stopObserving("click",this._lockToggleListener);}if($(this._target).down(".replyable")){$(this._target).down(".replyable").stopObserving("click",this._replyListener);}if($(this._target).down(".flaggable")){$(this._target).down(".flaggable").stopObserving("click",this._flagListener);}if($(this._target).down(".voting")){this._voting.reset();}},_blockUnverifiedUsers:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}},__onCommentEditClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var relData=event.element().up(".commentMain").down(".responseData").rel;this._commentEdit.onEditClick(event,relData);},__onLockToggleClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._commentLock.__onToggleCommentLock(event);},__onReplyClick:function(event){event.stop();this._reply.__onReplyableClick(event);},__onFlagClick:function(event){event.stop();this._flag.setContentType("comment");this._flag.setContentId(event.element().rel);this._flag.__onFlaggableClick(event);},__onItemDeleteClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._adminModal.setOperation("delete");this._adminModal.setContentId(event.element().rel);this._adminModal.openAdminModal(event.element().rel);},__onItemHideClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._adminModal.setOperation("hide");this._adminModal.setContentId(event.element().rel);this._adminModal.openAdminModal(event.element().rel);},__onItemUnhideClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._adminModal.setOperation("unhide");this._adminModal.setContentId(event.element().rel);this._adminModal.setItemVisibility("19","admin unhide");},__onCommentSpamClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._adminModal.setOperation("spam");this._adminModal.setContentId(event.element().rel);this._adminModal.openAdminModal(event.element().rel);},__onCommentUnspamClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}this._adminModal.setOperation("unspam");this._adminModal.setContentId(event.element().rel);this._adminModal.setItemVisibility("20","admin unspam");}});Object.Event.extend(current.content.items.CommentObserver);current.content.items.CommentObserver.getInstance=function(key,target){if(!document.__currentCommentObserver__){document.__currentCommentObserver__=new current.content.items.CommentObserver(key,target);}return document.__currentCommentObserver__;};current.stub("current.content.items");current.content.items.LandingMessage=Class.create({initialize:function(target,pageUrl,pageTitle){this._messageBox=$(target);this._referrerBox=$("refererName");this._pageUrl=pageUrl;this._pageTitle=encodeURI(pageTitle);},setParent:function(parent){this._parent=parent;},init:function(){this.toggleMessage();$("landingMessageCloseButton").observe("click",this.toggleMessage.bindAsEventListener(this));},toggleMessage:function(){if(!this._messageBox.visible()){this._messageBox.show();}else{this._messageBox.hide();}},setReferrerData:function(referrer){$(this._referrerBox).update(referrer);}});current.stub("current.content.items");current.content.items.GroupItems=Class.create({initialize:function(target,id,start,limit,sort,excluded){this._setTarget(target);this._setGroup(id);this._setStart(start);this._setSort(sort);this._excluded=excluded;this._setLimit(limit);this._itemList=new Array();this._noResultsMsg=new Element("div",{"class":"groupItemNoResults"});this._noResultsMsg.insert(current.locale.Bundle.get("interestAutocompleteJS.noResults"));},init:function(){this._fetchItems();},__onDomLoad:function(){},_setLimit:function(limit){this._limit=limit;},_getLimit:function(){return this._limit;},_setGroup:function(group){this._id=group;},_getGroup:function(){return this._id;},_setTarget:function(target){this._target=target;},_getTarget:function(){return this._target;},_setStart:function(start){this._start=start;},_getStart:function(){return this._start;},_setSort:function(sort){this._sort=sort;},_getSort:function(){return this._sort;},_isExcluded:function(id){if((this._excluded.size()>0)&&(this._excluded.include(id))){return true;}return false;},_fetchItems:function(){ContentService.fetchItemsFromGroup(this._getGroup(),this._getStart(),this._getLimit()+this._excluded.size(),this._getSort(),this.__onItemData.bindAsEventListener(this),this.__onItemDataFail.bindAsEventListener(this));},__onItemData:function(data){if(data.totalCount<1){$(this._getTarget()).replace(this._noResultsMsg);return ;}var d=1;for(var i=0;i<this._getLimit()+this._excluded.size();i++){if(!this._isExcluded(data.items[i].id)){var newItem=new current.content.items.GroupItem(data.items[i],60,45);$(this._getTarget()).appendChild(newItem.init());d++;}if(d>this._getLimit()){return ;}}},__onItemDataFail:function(){$(this._getTarget()).replace(this._noResultsMsg);}});Object.Event.extend(current.content.items.GroupItems);current.content.items.GroupItem=Class.create({initialize:function(data,w,h){this._data=data;this._width=w;this._height=h;var thumb=new current.components.assets.ThumbUrl(this._data);this._thumbUrl=thumb.getThumbnailBySize(this._width,this._height,".jpg");},init:function(){var titleText=this._data.contentTitle.replace("'","'");titleText=titleText.replace('"','"');titleTextTrunc=current.utils.Strings.truncateAtWord(titleText,60);altText=titleText.truncate(24,"...");var url=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/"+((this._data.parentGroupSlug!=null)?this._data.parentGroupSlug:"items")+"/"+this._data.id+"_"+this._data.slug+".htm";var ele=new Element("ul");var asset=new Element("li",{"class":"moreFromAsset"});var link=new Element("a",{title:titleText,href:url});link.insert(new Element("img",{src:this._thumbUrl,alt:altText}));if(this.showPlayButton(this._data)){link.insert(new Element("div",{"class":"Sprites videoPlayIconSmall"}));}asset.insert(link);ele.appendChild(asset);var linkLi=new Element("li",{"class":"linkText"});var linkText=new Element("a",{title:titleText,href:url});linkLi.insert(linkText.insert(titleTextTrunc));ele.appendChild(linkLi);var commentLi=new Element("li",{"class":"commentText"});commentLi.insert(new Element("a",{"class":"commentLink",rel:"nofollow",href:url+"#comments"}).insert(this.getCommentString(this._data.richCommentCount)));ele.appendChild(commentLi);return ele;},showPlayButton:function(data){if(data.pageAsset==null||data.pageAsset==""){return false;}if((data.source=="pod")||(data.pageAsset.assetType=="V")||(data.pageAsset.assetType=="M")){return true;}return false;},getCommentString:function(count){if(count==1){return"1 "+current.locale.Bundle.get("comment");}else{return count+" "+current.locale.Bundle.get("comments");}}});Object.Event.extend(current.content.items.GroupItem);current.content.items.GroupsWidget=Class.create({initialize:function(widgetId,excludeItems){this._expandedId=0;this._expandedIds=new Array();this._widgetId=widgetId;this._excludeItems=[excludeItems];this._throbber=new Element("img",{className:"throbber floatLeft clearBoth",style:"padding-left: 0.5em;",src:current.Constants.getInstance().getDatanodeUrl()+"/images/barca/white/icons/loadingIcon.gif"});$(widgetId).select(".moreGroupsLink a").invoke("observe","click",this.__showMoreGroups.bindAsEventListener(this));$(widgetId).select(".groupLink").invoke("observe","click",this.__handleGroupLinkClick.bindAsEventListener(this));$(widgetId).select(".groupLinkIcon").invoke("observe","click",this.__handleGroupArrowClick.bindAsEventListener(this));},__showMoreGroups:function(event){event.stop();event.element().up(1).select(".moreGroups").invoke("show");event.element().up().toggle();},__handleGroupLinkClick:function(event){event.stop();var id=event.element().up().id;if(this.__isExpanded(id)){document.location=event.element().href;return false;}else{if(this.__getExpanded()==0){this.expandGroup(id);return false;}else{this.collapseGroup(this.__getExpanded());this.expandGroup(id);}}},__handleGroupArrowClick:function(event){event.stop();var id=event.element().up().id;if(this.__isExpanded(id)){this.collapseGroup(id);this.__setExpanded(0);return ;}else{if(this.__getExpanded()==0){this.expandGroup(id);return ;}else{this.collapseGroup(this.__getExpanded());this.expandGroup(id);return ;}}},__hasExpanded:function(id){if((this._expandedIds.size()>0)&&(this._expandedIds.indexOf(id)>=0)){return true;}return false;},__isExpanded:function(id){if(id==this._expandedId){return true;}return false;},__getExpanded:function(){return this._expandedId;},__setExpanded:function(id){this._expandedId=id;if(!this.__hasExpanded(id)){this._expandedIds.push(id);}},expandGroup:function(id){var target=$(id+"ItemTray");if(!this.__hasExpanded(id)){this.__setExpanded(id);var groupItems=new current.content.items.GroupItems(target,id,0,4,"new",this._excludeItems);groupItems.init();new Effect.Appear($(target),{duration:0.5});}else{this.__setExpanded(id);new Effect.Appear($(target),{duration:0.5});}},collapseGroup:function(id){if(!id){return false;}var target=$(id+"ItemTray");if(!target){return false;}$(target).hide();this.__setExpanded(0);},toggleGroup:function(id){if(this.__getExpanded()!=id){this.expandGroup(id);return ;}else{this.collapseGroup(id);return ;}}});Object.Event.extend(current.content.items.GroupsWidget);current.stub("current.content.items");current.content.items.ItemPage=Class.create({TYPE:"C",initialize:function(itemInteractMenuTarget,itemDetails,itemAsset){var p=current.site.Page.getInstance();this._user=current.User.getInstance();this._userCanRecommendItems=false;this._userId=parseInt(this._user.getId());this._username=this._user.getUsername();this._ownerId=p.getOwnerId();this._pageId=p.getId();this._contentType=p.getType();this._shortUrl=p.getShortUrl();this._hasCommentJson=false;this._itemInteractMenu=$(itemInteractMenuTarget);this._itemDetails=$(itemDetails);this._itemAsset=$(itemAsset);this._commentList=$("commentList");this._recommended=false;this._readOnly=false;this._recommenders=[];this._commentsLocked=false;this._hasEditOverrride=false;this._groups=new Array();this._ugroups=new Array();this._commentStart=0;this._commentSort="";this._commentFilter="";this._lastCommentSort="";this._commentLength=0;this._commentAnchorRequested=0;this._commentInFocus=false;this._gotoNextVideoPage=false;this._mainVideoPlayer=false;this._videoInWarningTime=false;this._videoPaused=false;this._videoEnded=false;this._nextVideo=null;this._altVideoAsset=false;this._altVideoPlayer=false;this._altVideoController=false;this._altVideoInitialized=false;this._isStudiosItem=false;this._challengeSlug=null;this._challengePhase=null;this._challengeType=null;this._sceneHandle=null;this._storylineHandle=null;this._sandboxHandle=null;this._communityFavorite=false;this._producerPick=false;this._creditedOnAir=false;},init:function(){if(this._user.isLoggedIn()){this._hasEdit=(this._userId==this._ownerId||this._user.isItemAdminWrite());this._doCreditRemove();}this._commentHoverObserver=this.__onCommentHover.bindAsEventListener(this);this._commentExitObserver=this.__onCommentExit.bindAsEventListener(this);this._commentObserver=current.content.items.CommentObserver.getInstance();this._commentLockToggle=current.content.items.ToggleCommentLock.getInstance();this._itemFlag=Flag.getInstance(true);this._itemAdminModal=current.content.items.ItemAdminModal.getInstance();this._doLinkAdding();this._doVoteState();this._doGroupAdd();this._doTagAdd();if(this._user.isItemAdminWrite()&&$("itemCommentLock")){$("itemCommentLock").observe("click",this._commentLockToggle.__onToggleCommentLock.bindAsEventListener(this._commentLockToggle,1));}if($("contentItemFlagLink")){$("contentItemFlagLink").observe("click",this.__onFlagClick.bindAsEventListener(this));}if($("toggleReplies")){$("toggleReplies").observe("click",this.__onCommentSort.bindAsEventListener(this));}if($("newestFilter")){$("newestFilter").observe("click",this.__onCommentSort.bindAsEventListener(this));}if($("oldestFilter")){$("oldestFilter").observe("click",this.__onCommentSort.bindAsEventListener(this));}if($("popularFilter")){$("popularFilter").observe("click",this.__onCommentSort.bindAsEventListener(this));}if($("continuousPlayControl")){this._cPlayControls=$$("#continuousPlayControl .cPlayControl");this._cPlayControls.invoke("observe","click",this.__onContinuousPlayPreferenceClick.bindAsEventListener(this));this._continuousPlayPreferenceInit();}this._share=new Share(this._pageId);this._share.setShareType("C");this._share.setUserId(this._user.getId());this._addSharingLinks($(document.getElementsByTagName("body")[0]));this._addResizeButtons($(document.getElementsByTagName("body")[0]));this._populateCommentCovers();this.observeComments(this._commentList);current.components.voting.CommentVoteControls.executeDelayed();if($("videoPlaybackEmbed-"+this._pageId)&&current.utils.Compatibility.supports_flash()){this.setMainVideoPlayer("videoPlaybackEmbed-"+this._pageId);Event.observe(window,"scroll",this.__onWindowScroll.bindAsEventListener(this));}if(window.location.hash.lastIndexOf("#")!=-1){this._commentAnchorRequested=window.location.hash.substring(window.location.hash.lastIndexOf("#")+1);}if(!isNaN(this._commentAnchorRequested)&&(this._commentAnchorRequested>0)){var anchorsFound=$$("a[name="+this._commentAnchorRequested+"]");if(anchorsFound.length<1){window.location="/comment/"+this._commentAnchorRequested+".htm";}}},__onFlagClick:function(event){if(this._contentType=="storyline"&&this._storylineHandle&&this._storylineHandle!=""){this._itemFlag.setContentType(this._contentType);this._itemFlag.setContentId(this._storylineHandle);}else{if(this._contentType=="scene"&&this._sceneHandle&&this._sceneHandle!=""){this._itemFlag.setContentType(this._contentType);this._itemFlag.setContentId(this._sceneHandle);}else{this._itemFlag.setContentType("item");this._itemFlag.setContentId(this._pageId);}}this._itemFlag.__onFlaggableClick(event);},isOwner:function(){if(this._userId==this._ownerId){return true;}return false;},setContentType:function(type){this._contentType=type;},getContentType:function(){return this._contentType;},setOwnerId:function(num){this._ownerId=num;},getOwnerId:function(){return this._ownerId;},setPageId:function(num){this._pageId=num;},getPageId:function(){return this._pageId;},setShortUrl:function(url){this._shortUrl=url;},getShortUrl:function(){return this._shortUrl;},setStudiosItem:function(bool){this._isStudiosItem=bool;},setChallengeSlug:function(cSlug){this._challengeSlug=cSlug;},setChallengePhase:function(phase){this._challengePhase=phase.toLowerCase();},setChallengeType:function(type){this._challengeType=type.toLowerCase();},setSceneHandle:function(handle){this._sceneHandle=handle;},setStorylineHandle:function(handle){this._storylineHandle=handle;},setSandboxHandle:function(handle){this._sandboxHandle=handle;},setModeratorHasEditOverrride:function(bool){this._hasEditOverrride=bool;},setRichCommentFlag:function(){this._hasCommentJson=true;},setCommentClip:function(key){this._clipperId=key;},getCommentClip:function(){return this._clipperId;},setCommentStart:function(n){this._commentStart=n;},getCommentStart:function(){return this._commentStart;},isCommentClipperInUse:function(){if($(this._clipperId+"_contentText").value!=$(this._clipperId+"_contentText").title){return true;}return false;},setEmbedCode:function(target,id,w,h){var e=new current.Embed(target,id,w,h,false);var field=$(target).down("input");field.value=e.getString();field.observe("focus",this.__onEmbedFocus.bindAsEventListener(this));},setFacebookLike:function(href){if(!this._hasFacebookLiked){current.tracking.Track.getInstance().onFacebookLike();this._hasFacebookLiked=true;}},setMainVideoPlayer:function(id){this._mainVideoPlayer=$(id);},getMainVideoPlayer:function(){return this._mainVideoPlayer;},setUserThumbnail:function(path){this._userThumbnailPath=path;},setUserLevels:function(levels){this._userLevels=levels;},setLandingMessage:function(target,url,title){this._refMatch=current.utils.Referrer.getReferrerMatch(current.Constants.getInstance().getLandingMsgReferrers());if(isUndefined(this._refMatch)){return ;}this._landingMessage=new current.content.items.LandingMessage(target,url,title);this._landingMessage.setReferrerData(this._refMatch);this._landingMessage.setParent(this);this._landingMessage.init();},setPickForTv:function(target){$(target).observe("click",this.__onPickForTvClick.bindAsEventListener(this));},setTagRemoval:function(targets){var scope=this;$$("."+targets).each(function(l){l.observe("click",scope.__onTagRemovalClick.bindAsEventListener(scope));});},setGroupRemoval:function(targets){var scope=this;$$("."+targets).each(function(l){l.observe("click",scope.__onGroupRemovalClick.bindAsEventListener(scope));});},setFeatureInGroup:function(targets){var scope=this;$$("."+targets).each(function(l){l.observe("click",scope.__onFeatureInGroupClick.bindAsEventListener(scope));});},setReadOnly:function(bool){this._readOnly=bool;},setCommentsLocked:function(bool){this._commentsLocked=bool;},setParentGroup:function(id){this._pGroup=id;},getParentGroup:function(){return this._pGroup;},setParentGroupSlug:function(str){this._pGroupSlug=str;},getParentGroupSlug:function(){return this._pGroupSlug;},setClassifierGroup:function(id){this._pClassGroup=id;},getClassifierGroup:function(){return this._pClassGroup;},setClassifierGroupSlug:function(str){this._pClassGroupSlug=str;},getClassifierGroupSlug:function(){return this._pClassGroupSlug;},setGroups:function(arr){this._groups=arr;},getGroups:function(){return this._groups;},setGroupSlugs:function(arr){this._groupSlugs=arr;},getGroupSlugs:function(){return this._groupSlugs;},setUserGroups:function(arr){this._ugroups=arr;},getUserGroups:function(){return this._ugroups;},setUserRecommendItems:function(bool){this._userCanRecommendItems=bool;},getUserRecommendItems:function(){return this._userCanRecommendItems;},setCommentSort:function(sort){this._commentSort=sort;if(!this.getLastCommentSort()){this.setLastCommentSort(sort);}var scope=this;$$("a.sorts").each(function(s){if(s.rel==scope.getCommentSort()){if(s.hasClassName("disabled")){s.removeClassName("disabled");}s.addClassName("active");}else{if(s.hasClassName("active")){s.removeClassName("active");}}});setTimedCrumb(current.Cookies.PREFERENCES,"commentSort",sort,525948);},getCommentSort:function(){return this._commentSort;},setLastCommentSort:function(sort){this._lastCommentSort=sort;},getLastCommentSort:function(){return this._lastCommentSort;},setCommentFilter:function(filter){this._commentFilter=filter;},getCommentFilter:function(){return this._commentFilter;},setCommentLength:function(len){this._commentLength=len;},getCommentLength:function(){return this._commentLength;},setClipperWindow:function(clipperWindow){this._clipperWindow=clipperWindow;},getClipperWindow:function(){return this._clipperWindow;},setCommunityFavorite:function(bool){this._communityFavorite=bool;},setProducerPick:function(bool){this._producerPick=bool;},setCreditedOnAir:function(bool){this._creditedOnAir=bool;},switchToAltPlayer:function(event){if(event){event.stop();}if(this._mainVideoPlayer){this._mainVideoPlayer.pauseVideo();}$("videoPlayback-"+this._pageId).hide();$("html5player").show();$("altPlayerSwitch").hide();if(current.utils.Compatibility.supports_flash()){$("flashPlayerSwitch").show();}$("flashPlayerSwitch").observe("click",this.switchToFlashPlayer.bindAsEventListener(this));if(!this._altVideoInitialized){this._altVideoController=new current.components.video.H5Video.getInstance("h5Player","");this._altVideoPlayer=this._altVideoController.getVideo();this._altVideoPlayer.src=this._altVideoAsset.asset_480p;this._altVideoPlayer.load();this._altVideoController.initEndSlate(this._pageId);this._altVideoInitialized=true;}else{this._altVideoPlayer.load();}this._altVideoPlayer.play();return false;},switchToFlashPlayer:function(event){if(event){event.stop();}this._altVideoPlayer.pause();$("html5player").hide();$("videoPlayback-"+this._pageId).show();$("flashPlayerSwitch").hide();$("altPlayerSwitch").show();return false;},getAltVideoAsset:function(){if(!current.utils.Compatibility.supports_h264_video()){return ;}var ajaxUrl="/item_html5_video_asset/"+this._pageId;new Ajax.Request(current.Constants.getInstance().getScriptName()+ajaxUrl,{method:"get",evalJS:true,onComplete:this.__onAltVideoAssetData.bindAsEventListener(this)});},__onAltVideoAssetData:function(data){this._altVideoAsset=data.responseText.evalJSON();if(isUndefined(this._altVideoAsset.asset_480p)){return ;}$("altPlayerInfo").show();$("altPlayerSwitch").observe("click",this.switchToAltPlayer.bindAsEventListener(this));if(!current.utils.Compatibility.supports_flash()){this.switchToAltPlayer();}},onVideoStateChange:function(state,arg1,arg2){switch(state){case current.PlayerStates.INSIDEWARNINGTIME:this._initNextVideo(arg1,arg2);break;case current.PlayerStates.OUTSIDEWARNINGTIME:break;case current.PlayerStates.PAUSED:break;case current.PlayerStates.RESUMED:case current.PlayerStates.STARTED:break;case current.PlayerStates.FINISHED:this._onVideoEnd();break;default:break;}},_initNextVideo:function(seconds,nextVideo){this._nextVideo=nextVideo;},_onNextVideoAlert:function(seconds,nextVideo){var pref=this.getContinuousPlayPreference();if(pref=="off"){this._nextVideoCountdownCancel();return false;}this._videoInWarningTime=true;if(document.__modalOpenL1__||this.isCommentClipperInUse()){if(this._mainVideoPlayer){this._mainVideoPlayer.setExternalPlayControl(false);return false;}}this._nextVideoIn=seconds;this._nextVideoUrl=nextVideo.itemUrl;var thumbUrl=nextVideo.thumbUrl.replace("_400x300","_80x60");var msg='<div class="onePointFive"><div class="floatLeft" style="margin-right: 2.2em; text-align: right"><div>'+current.locale.Bundle.get("alert.next_video_starts_in")+'</div><h1 id="nextVideoTimer"></h1></div><div class="floatLeft"><img src="'+thumbUrl+'" height="60" width="80"/></div><div class="floatLeft" style="margin-left: 1em;"><h1>'+current.utils.Strings.truncateAtWord(nextVideo.contentTitle,80)+'</h1><div class="normal italic">'+nextVideo.comments+" "+current.locale.Bundle.get("comments")+" | "+msToHHMMSS(parseInt(nextVideo.length*1000))+"</div></div></div>";this._nextVideoAlert=new current.components.alerts.AlertBar(msg,current.locale.Bundle.get("alert.dont_play"),this.__onNextVideoAlertClose.bindAsEventListener(this));this._nextVideoAlert.init();this._gotoNextVideoPage=true;this._nextVideoCountdownStart(parseInt(this._nextVideoIn));},_onVideoRewind:function(){this._videoInWarningTime=false;},_onVideoPause:function(){this._videoPaused=true;},_onVideoResume:function(){this._videoPaused=false;if(this._videoInWarningTime){this._nextVideoCountdown(parseInt(this._nextVideoIn));}},_onVideoEnd:function(){this._onNextVideoAlert(5,this._nextVideo);},__onNextVideoAlertClose:function(){this._gotoNextVideoPage=false;this._nextVideoAlert=null;if(this._mainVideoPlayer){this._mainVideoPlayer.setExternalPlayControl(false);}},_nextVideoCountdownStart:function(n){var pre=(parseInt(n)>9)?":":":0";$("nextVideoTimer").update(pre+n);this._nextVideoCountdown(n);},_nextVideoCountdown:function(n){if(document.__modalOpenL1__||this.isCommentClipperInUse()){this._nextVideoCountdownCancel();return ;}var pref=this.getContinuousPlayPreference();if(pref=="off"){this._nextVideoCountdownCancel();return false;}var scope=this;if((n<=0)&&this._nextVideoUrl){this.gotoNextVideoPage(this._nextVideoUrl);}if(n>0){setTimeout("scope._nextVideoCountUpdate("+n+")",1000);}},_nextVideoCountUpdate:function(n){if((!$("nextVideoTimer")||this._videoPaused)&&!this._videoEnded){this._nextVideoIn=parseInt(n);return ;}this._nextVideoIn=parseInt(n-1);var pre=(parseInt(this._nextVideoIn)>9)?":":":0";$("nextVideoTimer").update(pre+this._nextVideoIn);this._nextVideoCountdown(this._nextVideoIn);},_nextVideoCountdownCancel:function(){this._gotoNextVideoPage=false;if(this._nextVideoAlert){this._nextVideoAlert.__onCloseClick();this._nextVideoAlert=null;}if(this._mainVideoPlayer){this._mainVideoPlayer.setExternalPlayControl(false);}},_nextVideoCountdownEnable:function(){this._gotoNextVideoPage=true;if(this._mainVideoPlayer){this._mainVideoPlayer.setExternalPlayControl(true);}},getContinuousPlayPreference:function(){var pref="on";if(this._user.isLoggedIn()){var cpref=getCrumbValue(current.Cookies.PREFERENCES,"cPlay");if(!isUndefined(cpref)){pref=cpref;}}return pref;},_continuousPlayPreferenceInit:function(){var pref=this.getContinuousPlayPreference();var scope=this;this._cPlayControls.each(function(c){if(c.rel==pref){if(!c.hasClassName("active")){c.addClassName("active");}}else{if(c.hasClassName("active")){c.removeClassName("active");}}});if(pref=="off"){this._nextVideoCountdownCancel();}},__onContinuousPlayPreferenceClick:function(event){event.stop();var pref=event.element().rel;if(event.element().hasClassName("active")){return false;}var scope=this;this._cPlayControls.each(function(c){if(c.rel==pref){if(!c.hasClassName("active")){c.addClassName("active");}}else{if(c.hasClassName("active")){c.removeClassName("active");}}});setTimedCrumb(current.Cookies.PREFERENCES,"cPlay",pref,525948);},gotoNextVideoPage:function(url){if(document.__modalOpenL1__||this.isCommentClipperInUse()||(this._gotoNextVideoPage==false)){this._nextVideoCountdownCancel();return false;}window.location=url;},_doVoteState:function(){this._voting=$H();scope=this;$$("#userItemActionBlock .voting",".itemMostPopularModule .voting").each(function(v){var vote=new current.components.voting.VoteControls(v);vote.init();scope._voting.set(vote._id.toString(),vote);});if(this._user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:this._username,items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});current.components.voting.VoteControls.executeDelayed();},_doCreditRemove:function(){var p=current.site.Page.getInstance();if(this._hasEdit){return ;}if($("credit_"+this._user.getId())){var creditContainer=$("credit_"+this._user.getId());creditId=creditContainer.down("a").id;var removeCredit=new RemoveCredit(this._user.getId(),this._pageId,creditId);}},_doLinkAdding:function(){if(this._hasEdit||this._hasEditOverrride){this._addEditLinks();if(!this._isStudiosItem){if($("itemDetails")&&$("itemDetails").down(".itemDeleteLink")){$("itemDetails").down(".itemDeleteLink").observe("click",this.__onItemDeleteClick.bindAsEventListener(this));}if($("itemDetails")&&$("itemDetails").down(".itemHideLink")){$("itemDetails").down(".itemHideLink").observe("click",this.__onItemHideClick.bindAsEventListener(this));}if($("itemDetails")&&$("itemDetails").down(".itemUnhideLink")){$("itemDetails").down(".itemUnhideLink").observe("click",this.__onItemUnhideClick.bindAsEventListener(this));}if($("itemDetails")&&$("itemDetails").down(".itemSpamLink")){$("itemDetails").down(".itemSpamLink").observe("click",this.__onItemSpamClick.bindAsEventListener(this));}if($("itemDetails")&&$("itemDetails").down(".itemUnspamLink")){$("itemDetails").down(".itemUnspamLink").observe("click",this.__onItemUnspamClick.bindAsEventListener(this));}}else{if($("itemMainCommentInteract")&&$("itemMainCommentInteract").down(".itemDeleteLink")){$("itemMainCommentInteract").down(".itemDeleteLink").observe("click",this.__onItemDeleteClick.bindAsEventListener(this));}if($("adminItemDetails")&&$("adminItemDetails").down(".itemHideLink")){$("adminItemDetails").down(".itemHideLink").observe("click",this.__onItemHideClick.bindAsEventListener(this));}if($("adminItemDetails")&&$("adminItemDetails").down(".itemUnhideLink")){$("adminItemDetails").down(".itemUnhideLink").observe("click",this.__onItemUnhideClick.bindAsEventListener(this));}if($("producerPickLink")){$("producerPickLink").observe("click",this.__onStudiosPromoteClick.bindAsEventListener(this));}if($("creditedOnAirLink")){$("creditedOnAirLink").observe("click",this.__onStudiosPromoteClick.bindAsEventListener(this));}if($("moveToVoteLink")){$("moveToVoteLink").observe("click",this.__onStudiosPromoteClick.bindAsEventListener(this));}}}if(this.getUserRecommendItems()){this._addRecommendLink();}},_doTagAdd:function(){if(!$("itemTagList")){return ;}var suggest=new MarkItemWithTag("addTagToItemInputHolder","addTagToItemButton",this.isOwner());suggest.setParentId(this._pageId);suggest.setLocaleId(this._user.getLocale());suggest.setContentSource(this._contentType);},_doGroupAdd:function(){var GroupSelect=new MarkItemWithGroup("addItemToGroupInputHolder","addItemToGroupButton",this.getGroups(),this.getUserGroups(),this.isOwner());},_addEditLinks:function(){if(this._contentType=="pod"){return ;}var activePitch=false;if(this._challengePhase!=null&&(this._challengePhase=="pitch")){activePitch=true;}if(!this._itemInteractMenu){return ;}if(!this._readOnly){if(this._userId==this._ownerId&&!this._user.isItemAdminWrite()&&this._challengePhase!=null&&(this._challengePhase!="pitch")){return ;}if((!this._communityFavorite&&!this._producerPick&&!this._creditedOnAir&&this._challengePhase!=null&&(this._challengePhase=="pitch"))||this._challengePhase==null||!this._isStudiosItem){var d=Builder.node("li",{},Builder.node("a",{href:"#delete",rel:this._pageId,className:"itemDeleteLink redLink"},current.locale.Bundle.get("delete")));this._itemInteractMenu.insertBefore(d,this._itemInteractMenu.down());if(this._isStudiosItem){var st=Builder.node("span",{},"|");Element.insert($("contentItemFlagLink"),{before:st});}}}var clipperURL=(this._contentType=="blog")?"/blogger.htm?cid="+this._pageId:"/clipper.htm?cid="+this._pageId;if(activePitch){if(this._challengeType=="storymaker"){clipperURL="/storymaker.htm";}else{clipperURL="/pitcher.htm?cid="+this._pageId+"&challengeType="+this._challengeType;}}var a=Builder.node("a",{href:current.Constants.getInstance().getScriptName()+clipperURL,className:"itemEditLink"},current.locale.Bundle.get("edit"));var e=Builder.node("li",{},a);if(this._isStudiosItem){var st=Builder.node("span",{},"|");e.appendChild(st);}this._itemInteractMenu.insertBefore(e,this._itemInteractMenu.down());if((this._contentType!="blog")&&!activePitch){Event.observe(a,"click",this.__onEditClick.bindAsEventListener(this));if($("newItemEdit")){$("newItemEdit").observe("click",this.__onEditClick.bindAsEventListener(this));}}else{if(activePitch){if(this._challengeType=="storymaker"){Event.observe(a,"click",this.__onEditStorymakerPitchClick.bindAsEventListener(this));}else{Event.observe(a,"click",this.__onEditPitchClick.bindAsEventListener(this));}}}},observeComments:function(target){var comments=$(target).select(".response");for(var i=0,len=comments.length,c;i<len;++i){if(!comments[i]._observed){comments[i].observe("mouseover",this._commentHoverObserver);comments[i].observe("mouseout",this._commentExitObserver);comments[i]._observed=true;}}},__onCommentHover:function(event){event.stop();var e=event.element();if(!e.hasClassName("response")){e=e.up(".response");}if(this._commentInFocus==e.id){return ;}if(this._commentInFocus&&$(this._commentInFocus)){this._commentObserver.reset();$(this._commentInFocus).down(".commentActions").hide();this._commentInFocus=false;}this._commentInFocus=e.id;this._commentObserver.init(e);e.down(".commentActions").show();},__onCommentExit:function(e){var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if(!reltg||!this._commentInFocus){return ;}try{if(((reltg.id=="")||(reltg.id==this._commentInFocus))&&(reltg.nodeName!="BODY")){return ;}}catch(e){return false;}this._commentObserver.reset();$(this._commentInFocus).down(".commentActions").hide();this._commentInFocus=false;},reloadComments:function(){var throbber=new Element("img",{className:"throbber floatLeft clearBoth",style:"padding-bottom: 2em;",src:current.Constants.getInstance().getDatanodeUrl()+"/images/barca/white/icons/loadingIcon.gif"});var li=new Element("li",{className:"last",id:"commentThrobber"});this._commentList.insert({top:li.insert(throbber)});var ajaxUrl="/item_comments/"+this._pageId+"?sort="+this.getCommentSort();if(this.getCommentLength()>0){ajaxUrl+="&length="+this.getCommentLength();}if(this.getCommentStart()>0){ajaxUrl+="&start="+this.getCommentStart();}new Ajax.Request(current.Constants.getInstance().getScriptName()+ajaxUrl,{method:"get",evalJS:true,onComplete:this.__onCommentAjaxLoad.bindAsEventListener(this)});},__onWindowScroll:function(event){if(this._mainVideoPlayer){var vpos=this._mainVideoPlayer.viewportOffset();if(vpos.top<-400){this._nextVideoCountdownCancel();}}},__onWindowResize:function(event){},__onCommentSort:function(event){event.stop();if(event.element().hasClassName("disabled")||(event.element().rel==this.getCommentSort())){return ;}var throbber=new Element("img",{className:"throbber floatLeft clearBoth",style:"padding-bottom: 2em;",src:current.Constants.getInstance().getDatanodeUrl()+"/images/barca/white/icons/loadingIcon.gif"});var li=new Element("li",{className:"last",id:"commentThrobber"});this._commentList.insert({top:li.insert(throbber)});$$("a.sorts").each(function(s){s.addClassName("disabled");});this.setCommentSort(event.element().rel);var ajaxUrl="/item_comments/"+this._pageId+"?sort="+this.getCommentSort()+"&start="+this.getCommentStart();if(this._commentLength>0){ajaxUrl+="&length="+this.getCommentLength();}new Ajax.Request(current.Constants.getInstance().getScriptName()+ajaxUrl,{method:"get",evalJS:true,onComplete:this.__onCommentAjaxLoad.bindAsEventListener(this)});},__onCommentAjaxLoad:function(data){if(!data.responseText.startsWith("<!-- ok -->")){this.__onCommentAjaxError();return ;}current.ScrollLoader.getInstance().unobserveImages(this._commentList);this._commentList.update(data.responseText);this.observeComments(this._commentList);current.ScrollLoader.getInstance().observeImages(this._commentList);this.setLastCommentSort(this.getCommentSort());$$("a.sorts").each(function(s){if(s.hasClassName("disabled")){s.removeClassName("disabled");}});},__onCommentAjaxError:function(){this.setCommentSort(this.getLastCommentSort());var errorMsg=new Element("li",{"class":"error",id:"commentError"}).update(current.locale.Bundle.get("verify.An_error_has_occurred"));$("commentThrobber").replace(errorMsg);setTimeout("Effect.Fade('commentError',{ duration: 1 })","2000");},__onEditClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var clipperWindow=new current.clipper.ClipperWindow(event);clipperWindow.setItemId(this._pageId);clipperWindow.setEditString(true);clipperWindow.init();},__onEditPitchClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var pitchWindow=new current.components.pitcher.PitcherWindow(event);pitchWindow.setGroupSlug(this._challengeSlug);pitchWindow.setItemId(this._pageId);pitchWindow.setEditString(true);pitchWindow.setChallengeType(this._challengeType);pitchWindow.init();},__onEditStorymakerPitchClick:function(event){event.stop();this._storymakerBaseUrl=current.Constants.getInstance().getScriptName()+"/storymaker.htm?sandbox="+this._sandboxHandle;if(this._storylineHandle&&this._storylineHandle!=""){this._storymakerBaseUrl=this._storymakerBaseUrl+"&lines="+this._storylineHandle;}this._winFeatures="width="+screen.width;this._winFeatures+=", height="+screen.height;this._winFeatures+=", top=0, left=0";this._winFeatures+=", fullscreen=yes";this._newWindow=window.open(this._storymakerBaseUrl,"storymaker"+this._sandboxHandle,this._winFeatures);if(window.focus){this._newWindow.focus();}return false;},__onItemDeleteClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._contentType=="storyline"){if(this._storylineHandle&&this._storylineHandle!=""){this._itemAdminModal.setContentType(this._contentType);this._itemAdminModal.setContentId(this._storylineHandle);}else{return ;}}else{if(this._contentType=="scene"){if(this._sceneHandle&&this._sceneHandle!=""){this._itemAdminModal.setContentType(this._contentType);this._itemAdminModal.setContentId(this._sceneHandle);}else{return ;}}else{this._itemAdminModal.setContentId(event.element().rel);}}this._itemAdminModal.setOperation("delete");this._itemAdminModal.openAdminModal(event.element().rel);},__onItemHideClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._contentType=="storyline"||this._contentType=="scene"){alert("Hide of studios content not supported.");return ;}this._itemAdminModal.setOperation("hide");this._itemAdminModal.setContentId(event.element().rel);this._itemAdminModal.openAdminModal(event.element().rel);},__onItemUnhideClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._contentType=="storyline"||this._contentType=="scene"){alert("Unhide of studios content not supported.");return ;}this._itemAdminModal.setOperation("unhide");this._itemAdminModal.setContentId(event.element().rel);this._itemAdminModal.setItemVisibility("19","admin unhide");},__onItemSpamClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._contentType=="storyline"||this._contentType=="scene"){alert("Marking as Spam of studios content not supported.");return ;}this._itemAdminModal.setOperation("spam");this._itemAdminModal.setContentId(event.element().rel);this._itemAdminModal.openAdminModal(event.element().rel);},__onItemUnspamClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._contentType=="storyline"||this._contentType=="scene"){alert("Unspamming of studios content not supported.");return ;}this._itemAdminModal.setOperation("unspam");this._itemAdminModal.setContentId(event.element().rel);this._itemAdminModal.setItemVisibility("20","admin unspam");},getRecommenders:function(){return this._userRecommended;},setRecommenders:function(ids){this._userRecommended=(ids.join(",").indexOf(this._userId.toString())>-1);},_addRecommendLink:function(){var li=new Element("li",{className:"last"});var a=new Element("a",{href:"#",className:"defaultColor"});if(this._itemInteractMenu!=null){this._itemInteractMenu.insert(li.insert(a));li.previous().removeClassName("last");}else{if(this._itemDetails!=null){var dl=new Element("dl",{});var dt=new Element("dt",{}).insert(current.locale.Bundle.get("item.manage_this")+": ");var dd=new Element("dd",{});var ul=new Element("ul",{id:"itemMainCommentInteract"});dl.insert(dt);dl.insert(dd.insert(ul.insert(li.insert(a))));this._itemDetails.insert(new Element("li",{}).insert(dl));}}new current.components.recommend.Recommending(this._pageId,"item",a,this._userRecommended);},_addSharingLinks:function(target){$(target).select(".itemSharingMenuLink").invoke("observe","click",this.__onExternalPostClick.bindAsEventListener(this));var shareLinkElement=$("contentItemShareLink_"+this._pageId);if(shareLinkElement&&this._share){this._share.setShareLink(shareLinkElement);}if(shareLinkElement&&this._shareList){this._shareList.get(this._pageId).setShareLink(shareLinkElement);}},_addResizeButtons:function(target){$(target).select(".resizeRadio").invoke("observe","click",this.__onResizeEmbedClick.bindAsEventListener(this));},__onPickForTvClick:function(event){event.stop();$("pickForTvBlock").className=($("pickForTvBlock").className.indexOf("Closed")!=-1)?"pickForTvBlockOpen":"pickForTvBlockClosed";$("pickForTvLink").down("span").className=($("pickForTvLink").down("span").className.indexOf("arrowRight")!=-1)?"Sprites itemLink_arrowDown pickArrow":"Sprites itemLink_arrowRight pickArrow";$("pickForTvInfo").toggle();},__onEmbedFocus:function(event){event.element().select();if(!this._hasTrackedEmbed){current.tracking.Track.getInstance().onEmbedShare();this._hasTrackedEmbed=true;}},__onResizeEmbedClick:function(event){var el=event.element();var size=el.value;var w=(size.substring(0,size.indexOf("x")));var h=(size.substring(size.indexOf("x")+1));this.setEmbedCode("embedForm",this._pageId,w,h);},__onExternalPostClick:function(event){if(this._externalPost==null){var p=current.site.Page.getInstance();this._externalPost=new ExternalPost(this,event,this._pageId,p.getUrl(),this._shortUrl,p.getContentTitle().unescapeHTML(),p.getContentDesc().unescapeHTML());this._externalPost.init();}if(this._externalPost._open){return ;}else{var p=current.site.Page.getInstance();this._externalPost=new ExternalPost(this,event,this._pageId,p.getUrl(),this._shortUrl,p.getContentTitle().unescapeHTML(),p.getContentDesc().unescapeHTML());this._externalPost.init();}},__onGroupRemovalClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(confirm(current.locale.Bundle.get("item.admin.removeFromGroupConfirm"))){var target=event.element();current.proxy.CCCP.execute("item","group_post",{id:this._pageId,groupSlugs:target.rel,action:"delete"},this.__onRemoveComplete.bindAsEventListener(this,target),this.__onRemoveFail.bindAsEventListener(this,target.rel));current.uncache();}},__onTagRemovalClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(confirm("This will immediately remove this tag from this item. Do you wish to proceed?")){var target=event.element();ContentService.unCopyContent(this._pageId,"delete",target.rel,this.__onRemoveComplete.bindAsEventListener(this,target),this.__onRemoveFail.bindAsEventListener(this,target.rel));current.uncache();}},__onRemoveComplete:function(data,target){target.up().hide();},__onRemoveFail:function(data,value){$("frame").scrollTo();var str="Whoops, <strong>"+data+" Error!</strong> Could not remove: <strong>"+value+"</strong><br/>";$("addToInterestFailureCopy").innerHTML=str;new Effect.Appear("addToInterestFailure",{duration:1,delay:0.65});},__onFeatureInGroupClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var featureWindow=new current.components.groups.FeatureInGroupWindow(event);featureWindow.init();},_populateCommentCovers:function(){var scope=this;$$(".commentCover").each(function(target){var obs=target.title;var div;if(!scope._user.isLoggedIn()){div=current.user.UserAttribution.getCover("you",scope._userThumbnailPath,false);$(obs).observe("focus",scope.__onCommentLoginClick.bindAsEventListener(scope));}else{if(current.Constants.getInstance().isReadOnlyMode()){div=current.user.UserAttribution.getCover(scope._username,scope._userThumbnailPath,true);$(obs).observe("focus",scope.__onCommentReadOnlyClick.bindAsEventListener(scope));}else{if(!scope._user.isEmailVerified()){div=current.user.UserAttribution.getCover(scope._username,scope._userThumbnailPath,true);$(obs).observe("focus",scope.__onCommentVerifyClick.bindAsEventListener(scope));}else{div=current.user.UserAttribution.getCover(scope._username,scope._userThumbnailPath,true);}}}if(scope._user.isLoggedIn()){if(target.up("div").down("."+scope._username)){target.up("div").down("."+scope._username).remove();}}else{if(target.up("div").down(".you")){target.up("div").down(".you").remove();}}Element.insert(target.up("div"),{top:div});});},__onCommentLoginClick:function(event){if(event!=null){event.stop();}current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);},__onCommentVerifyClick:function(event){event.stop();var l=event.element().cumulativeOffset()["left"]-10;var t=event.element().cumulativeOffset()["top"];var verily=new current.components.account.VerifyWindow(event,l,t).init();},__onCommentReadOnlyClick:function(event){event.stop();event.element().blur();$$(".commentCover").each(function(cc){cc.show();});new current.components.alerts.AlertWindow(event).init();},__onResetTitle:function(event){event.stop();event.element().value=event.element().title;},__onStudiosPromoteClick:function(event){event.stop();var el=event.element();var rel=el.rel;if(confirm('This cannot be undone. Are you sure you want to do this? ("The goggles, they do nothing.")')){if(rel=="move-to-vote"&&this._challengePhase!=null&&(this._challengePhase=="pitch"||this._challengePhase=="recommended")&&this._challengeSlug!=null){current.proxy.CCCP.execute("challenge","phase_change",{id:this._challengeSlug,item:this._pageId,reason:"producer-pick",action:"add",phase:"VOTING"},this.__onAddBadgeComplete.bindAsEventListener(this,el,0),this.__onAddBadgeFail.bindAsEventListener(this,el));}else{if(this._challengePhase!=null&&this._challengePhase=="pitch"&&this._challengeSlug!=null){current.proxy.CCCP.execute("challenge","phase_change",{id:this._challengeSlug,item:this._pageId,reason:rel,action:"add",phase:"RECOMMENDED"},this.__onAddBadgeComplete.bindAsEventListener(this,el,1),this.__onAddBadgeFail.bindAsEventListener(this,el));}else{current.proxy.CCCP.execute("item","badge_post",{id:this._pageId,badgeSlug:rel},this.__onAddBadgeComplete.bindAsEventListener(this,el,1),this.__onAddBadgeFail.bindAsEventListener(this,el));}}}},__onAddBadgeComplete:function(data,el,badge){if(badge){el.up().insert("badge added.");}else{el.up().insert("phase change committed.");}el.hide();},__onAddBadgeFail:function(data,el){el.up().insert("&nbsp;-&nbsp;there was an error!");}});current.content.items.ItemPage.getInstance=function(itemInteractMenuTarget,itemDetails,itemAsset){if(!document.__currentItemPage__){document.__currentItemPage__=new current.content.items.ItemPage(itemInteractMenuTarget,itemDetails,itemAsset);}return document.__currentItemPage__;};current.stub("current.content.items");current.content.items.CustomRelatedItems=Class.create({PLAYLIST_COUNT:3,initialize:function(){this._pageId=p.getId();this._paging=new Array();this._isFetching=false;},init:function(ribbons){this._ribbonList=ribbons;for(var i=0;i<ribbons.length;i++){this.__createPagination(i);this.__updatePagination(i);}},setFrontController:function(fc){this._frontController=fc;},__createPagination:function(i){this._paging[i]=new current.components.pagination.PagingButtons($("ribbonPager_"+i));$("ribbonPager_"+i).down(".previous").observe("click",this.__onBackClick.bindAsEventListener(this));$("ribbonPager_"+i).down(".next").observe("click",this.__onNextClick.bindAsEventListener(this));this._paging[i].init();},__updatePagination:function(i){var s=this._ribbonList[i].start;var t=this._ribbonList[i].total;var c=this._ribbonList[i].countPerPage;var p=this._ribbonList[i].currentPage;var e=(s+c>t)?t:s+c;var tp=Math.ceil(t/c);this._paging[i].setRange(s+1,e,t);this._paging[i].setButtonsAvailable(p,tp);if(this._ribbonList[i].total<4){$("ribbonPager_"+i).hide();}},__fetchVideosFromPagination:function(i,p){this._isFetching=true;if(this._ribbonList[i].items[p]!=null){this._ribbonList[i].currentPage=p;this.__buildPlaylistFromCache(i,p);}else{var data=this._ribbonList[i].data;var sort=this._ribbonList[i].sort;var type=this._ribbonList[i].type;var start=this._ribbonList[i].start;this.__showAjaxProgress(i);if(type=="group"){ContentItemService.fetchVideoPlaylist(data,sort,start,this.PLAYLIST_COUNT,this.__onPlaylistData.bindAsEventListener(this,i),this.__onPlaylistFail.bindAsEventListener(this,i));}else{ContentItemService.fetchVideoPlaylistFromTag(data,sort,start,this.PLAYLIST_COUNT,this.__onPlaylistData.bindAsEventListener(this,i),this.__onPlaylistFail.bindAsEventListener(this,i));}}},__showAjaxProgress:function(i){if($("ajaxProgress_"+i)){$("ajaxProgress_"+i).show();}},__hideAjaxProgress:function(i){if($("ajaxProgress_"+i)){$("ajaxProgress_"+i).hide();}},__onPlaylistFail:function(data,index){this.__hideAjaxProgress(index);this._isFetching=false;},__onPlaylistData:function(data,index){this.__hideAjaxProgress(index);var c=data.totalCount;if(parseInt(c)<1){return ;}this._ribbonList[index].start=data.startIndex;this._ribbonList[index].total=data.totalCount;this._ribbonList[index].countPerPage=data.countPerPage;this._ribbonList[index].currentPage=data.currentPage;this.__buildPlaylist(data.items,index);this.__updatePagination(index);this._isFetching=false;},__buildPlaylist:function(items,index){$("itemRibbonItems_"+index).innerHTML="";var s,p,r=0;var c=items.length;if(c==0){return ;}var currentPage=this._ribbonList[index].currentPage;var tempArray=new Array();if(this._ribbonList[index].items[currentPage]==null){this._ribbonList[index].items[currentPage]=new Array();}for(var i=0;i<this.PLAYLIST_COUNT;i++){p=(items[i])?items[i]:null;if(p!=null){s=new current.content.items.CustomRelatedItem(p,r);s.init();if(s.transcodeStatus==1&&!s.itemIsExpired&&s.contentStatus!="STATUS_HIDDEN"&&s.id!=this._pageId){$("itemRibbonItems_"+index).appendChild(s.getVideoItem());tempArray[r]={id:s.id,slug:s.slug,title:s.contentTitle,parentGroupName:s.parentGroupName,parentGroupSlug:s.parentGroupSlug,parentGroupDescription:s.parentGroupDescription,parentGroupSchedule:s.parentGroupSchedule,commentCount:s.richCommentCount,description:s.contentText,url:s.contentUrl,duration:s.duration,thumbnail:s.thumbUrl,permalink:s.permalink,itemIsExpired:s.itemIsExpired,transcodeStatus:s.transcodeStatus};r++;}}else{}}this._ribbonList[index].items[currentPage]=tempArray;},__buildPlaylistFromCache:function(index,page){var items=this._ribbonList[index].items[page];if(items.length<1){return ;}$("itemRibbonItems_"+index).innerHTML="";var s,r=0;for(var i=0;i<items.length;i++){var vi=items[i];s=new current.content.items.CustomRelatedItem(null,r);s.setId(vi.id);s.setSlug(vi.slug);s.setTitle(vi.title);s.setDescription(vi.description);s.setUrl(vi.url);s.setCommentCount(vi.commentCount);s.setParentGroupName(vi.parentGroupName);s.setParentGroupSlug(vi.parentGroupSlug);s.setParentGroupDescription(vi.parentGroupDescription);s.setParentGroupSchedule(vi.parentGroupSchedule);s.setDuration(vi.duration);s.setPermalink(vi.permalink);s.setItemIsExpired(vi.itemIsExpired);s.setTranscodeStatus(vi.transcodeStatus);s.setThumbnail(vi.thumbnail);$("itemRibbonItems_"+index).appendChild(s.getVideoItem());r++;}this.__updatePagination(index);this._isFetching=false;},__onNextClick:function(event){event.stop();var el=event.element();var rel=el.rel;if(typeof rel=="undefined"){rel=el.up("a").rel;}if((this._ribbonList[rel].start+this.PLAYLIST_COUNT)>=this._ribbonList[rel].total){return ;}else{this._ribbonList[rel].start=this._ribbonList[rel].start+this.PLAYLIST_COUNT;}this.__fetchVideosFromPagination(rel,(parseInt(this._ribbonList[rel].currentPage)+1));},__onBackClick:function(event){event.stop();var el=event.element();var rel=el.rel;if(typeof rel=="undefined"){rel=el.up("a").rel;}if((this._ribbonList[rel].start-this.PLAYLIST_COUNT)<0){return ;}else{this._ribbonList[rel].start=this._ribbonList[rel].start-this.PLAYLIST_COUNT;}this.__fetchVideosFromPagination(rel,(parseInt(this._ribbonList[rel].currentPage)-1));}});Object.Event.extend(current.content.items.CustomRelatedItems);current.content.items.CustomRelatedItems.getInstance=function(){if(!document.__currentCustomRelatedItems__){document.__currentCustomRelatedItems__=new current.content.items.CustomRelatedItems();}return document.__currentCustomRelatedItems__;};current.content.items.CustomRelatedItem=Class.create({initialize:function(data,index){this._data=data;this._index=index;this._width=145;this._height=109;},init:function(){this.id=this._data.id;this.slug=this._data.slug;this.contentTitle=truncateText(this._data.contentTitle,66,"...",true);this.contentText=truncateText(this._data.contentText,156,"...",true);this.contentStatus=this._data.contentStatus;this.contentUrl=this._data.contentUrl;this.pageAsset=this._data.pageAsset;this.richCommentCount=this._data.richCommentCount;this.parentGroupName=this._data.parentGroup.name;this.parentGroupSlug=this._data.parentGroup.slug;this.parentGroupDescription=((this._data.parentGroup.skin!=null&&this._data.parentGroup.skin.channelDescription!=null)?this._data.parentGroup.skin.channelDescription:"");this.parentGroupSchedule=((this._data.parentGroup.skin!=null&&this._data.parentGroup.skin.channelSchedule!=null)?this._data.parentGroup.skin.channelSchedule:"");this.duration=this._data.pageAsset.duration;this.permalink=this.__getPermalink();this.itemIsExpired=this.__getItemIsExpired();this.transcodeStatus=this.__getTranscodeStatus();var thumb=new current.components.assets.ThumbUrl(this._data);this.thumbUrl=thumb.getThumbnailBySize(this._width,this._height,".jpg");},reInit:function(v){this.id=v.id;this.slug=v.slug;this.contentTitle=v.title;this.contentText=v.description;this.contentUrl=v.url;this.contentStatus=v.contentStatus;this.richCommentCount=v.commentCount;this.parentGroupName=v.parentGroupName;this.parentGroupSlug=v.parentGroupSlug;this.parentGroupDescription=v.channelDescription;this.parentGroupSchedule=v.channelSchedule;this.duration=v.duration;this.permalink=v.permalink;this.itemIsExpired=v.itemIsExpired;this.transcodeStatus=v.transcodeStatus;this.thumbUrl=v.thumbnail;},setId:function(id){this.id=id;},setSlug:function(slug){this.slug=slug;},setTitle:function(title){this.contentTitle=title;},setDescription:function(description){this.contentText=description;},setContentStatus:function(status){this.contentStatus=status;},setUrl:function(url){this.contentUrl=url;},setCommentCount:function(commentCount){this.richCommentCount=commentCount;},setParentGroupName:function(parentGroupName){this.parentGroupName=parentGroupName;},setParentGroupSlug:function(parentGroupSlug){this.parentGroupSlug=parentGroupSlug;},setParentGroupDescription:function(parentGroupDescription){this.parentGroupDescription=parentGroupDescription;},setParentGroupSchedule:function(parentGroupSchedule){this.parentGroupSchedule=parentGroupSchedule;},setDuration:function(duration){this.duration=duration;},setPermalink:function(permalink){this.permalink=permalink;},setItemIsExpired:function(itemIsExpired){this.itemIsExpired=itemIsExpired;},setTranscodeStatus:function(transcodeStatus){this.transcodeStatus=transcodeStatus;},setThumbnail:function(thumbnail){this.thumbUrl=thumbnail;},getVideoItem:function(){var v=new Element("div",{"class":"ribbonItem"});var va=new Element("div",{"class":"ribbonAsset"});var a=new Element("a",{href:this.permalink});var i=new Element("div",{"class":"Sprites videoPlayIcon placement_145x109"});var img=new Element("img",{src:this.thumbUrl,width:this._width,height:this._height});a.insert(i);a.insert(img);va.insert(a);v.insert(va);var classStr=(((this._index+1)%3!=0)?"ribbonInfo":"ribbonInfo ribbonInfoWide");var vi=new Element("div",{"class":classStr});var h=new Element("h4").insert(new Element("a",{href:this.permalink}).insert(this.contentTitle));var c=new Element("span",{"class":"comment"});var b=new Element("br");var cmtStr=((this.richCommentCount==1)?"1 "+current.locale.Bundle.get("comment"):this.richCommentCount+" "+current.locale.Bundle.get("comments"));c.insert(cmtStr);var d=new Element("span",{"class":"length"}).insert("("+msToHHMMSS(this.duration)+")");vi.insert(h);vi.insert(c);vi.insert(b);vi.insert(d);v.insert(vi);return v;},bindEvents:function(){},getVideoItemIndex:function(){return this._index;},__getItemIsExpired:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.videoRightsExpired!=null)?this._data.pageAsset.videoRightsExpired:false;},__getPermalink:function(){return current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/items/"+this._data.id+"_"+this._data.slug+".htm";},__getTranscodeStatus:function(){return(this._data.pageAsset!=null&&this._data.pageAsset.transcodeStatus!=""&&this._data.pageAsset.transcodeStatus!=null)?this._data.pageAsset.transcodeStatus:0;},__onClick:function(event){event.stop();var el=event.element();var index=el.rel;this.notify(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,index);},__onAssetClick:function(event){event.stop();var el=event.element().up("div").down(".videoItemLink");var index=el.rel;this.notify(current.components.video.VideoPlaylistEvents.PLAYLIST_ITEM_CLICK,index);}});Object.Event.extend(current.content.items.CustomRelatedItem);current.content.items.CustomRelatedItemsEvents={PLAYLIST_ITEM_CLICK:"onPlaylistClick"};current.stub("current.content.items");current.content.items.ItemList=Class.create({TYPE:"C",initialize:function(listId,sort){this._user=current.User.getInstance();this._userId=parseInt(this._user.getId());this._username=this._user.getUsername();this._listId=listId;this.setListSort(sort);this._itemInFocus=false;this._itemHoverObserver=this.__onItemHover.bindAsEventListener(this);this._itemExitObserver=this.__onItemExit.bindAsEventListener(this);},init:function(){if(Object.isArray(this._listId)){var scope=this;$A(this._listId).each(function(a){scope.observeItems(a);});}else{this.observeItems(this._listId);this._doVoteState(this._listId);}},enableInlineSorting:function(newSortBtn,popSortBtn,newList,popList){this._newSortBtn=$(newSortBtn);this._popSortBtn=$(popSortBtn);this._newList=$(newList);this._popList=$(popList);if(this._newSortBtn&&!isUndefined(this._newSortBtn)&&this._popSortBtn&&!isUndefined(this._popSortBtn)){this._newSortBtn.observe("click",this.__onListSort.bindAsEventListener(this));this._popSortBtn.observe("click",this.__onListSort.bindAsEventListener(this));}},setListSort:function(sort){this._sort=sort;if(!this.getLastListSort()){this.setLastListSort(sort);}if(!isUndefined(this._newList)&&!isUndefined(this._popList)){if(this._sort=="popular"){this._popList.show();this._newList.hide();this._doVoteState(this._popList.id);if(this._newSortBtn.hasClassName("active")){this._newSortBtn.removeClassName("active");}if(!this._popSortBtn.hasClassName("active")){this._popSortBtn.addClassName("active");}}else{this._newList.show();this._popList.hide();this._doVoteState(this._newList.id);if(this._popSortBtn.hasClassName("active")){this._popSortBtn.removeClassName("active");}if(!this._newSortBtn.hasClassName("active")){this._newSortBtn.addClassName("active");}}}},getListSort:function(){return this._sort;},setLastListSort:function(sort){this._lastSort=sort;},getLastListSort:function(){return this._lastSort;},setItemInFocus:function(i){this._itemInFocus=i;},getItemInFocus:function(){return this._itemInFocus;},_doVoteState:function(target){this._voting=$H();scope=this;var items=$$("#"+target+" .voting");items.each(function(v){var vote=new current.components.voting.VoteControls(v,true);vote.init();scope._voting.set(vote._id.toString(),vote);});if(this._user.isLoggedIn()&&(this._voting.keys().length>0)){current.proxy.CCCP.execute("user","votes",{id:this._username,items:this._voting.keys().join(",")},this.__onVoteData.bindAsEventListener(this));}},__onVoteData:function(data){var scope=this;$A(data).each(function(v){var vote=scope._voting.get(v.contentId);vote.setVoteData(v.voteState);});current.components.voting.VoteControls.executeDelayed();},observeItems:function(target){if($(target)){var items=$(target).select(".item");var scope=this;$A(items).each(function(i){i.observe("mouseover",scope._itemHoverObserver);i.observe("mouseout",scope._itemExitObserver);});}},__onItemHover:function(event){event.stop();var e=event.element();if(!e.hasClassName("item")){e=e.up(".item");}if(this.getItemInFocus()==e.id){return ;}if(this.getItemInFocus()){this.hoverDisplayReset(this.getItemInFocus());this.setItemInFocus(false);}this.setItemInFocus(e.id);this.hoverDisplayShow(e);},__onItemExit:function(e){var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if(!reltg||!this.getItemInFocus()){return ;}try{if(reltg.id==this.getItemInFocus()){return ;}}catch(e){return false;}this.hoverDisplayReset(this.getItemInFocus());this.setItemInFocus(false);},hoverDisplayShow:function(item){$(item).down(".voting").show();},hoverDisplayReset:function(item){if(!$(item).down(".C").visible()){$(item).down(".voting").hide();}},__onListSort:function(event){event.stop();this.setListSort(event.element().rel);return false;}});current.content.items.ItemList.getInstance=function(){if(!document.__currentItemList__){document.__currentItemList__=new current.content.items.ItemList();}return document.__currentItemList__;};current.stub("current.content.profile");current.content.profile.ProfilePage=Class.create({initialize:function(){this._userId=current.site.Page.getInstance().getId();this._isFollowing=false;this._isBlocked=false;},init:function(){this._doConnectionCheck();Flag.getInstance();if($("sendMessageButton")){if(u.getId()!=this._userId){$("sendMessageButton").observe("click",this._onSendMessageClick.bindAsEventListener(this));}}$$(".stopFollowingInterestLink").invoke("observe","click",this._onUnfollowTopicClick.bindAsEventListener(this));if(current.Constants.getInstance().isReadOnlyMode()){$$(".editProfileLink").invoke("observe","click",this._onEditProfileClick.bindAsEventListener(this));}this._leftHeight=$("profileLeft").getHeight();this._titleHeight=$("userProfileTitle").getHeight();this._streamDiv="streamActivityList";this._baseStreamHeight=$("streamActivityList").getHeight();this._streamHeight=this._baseStreamHeight;this.__adjustLeftColumn();},__adjustLeftColumn:function(){if(this._leftHeight>(this._titleHeight+this._streamHeight)){$(this._streamDiv).setStyle({height:(this._leftHeight-this._titleHeight)+"px"});this._streamHeight=this._leftHeight-this._titleHeight;this._baseStreamHeight=this._streamHeight;}},adjustLeftColumn:function(event,str){event.stop();this._leftHeight=((str=="cFers")?this._leftHeight+this._cFAdjHeight:this._leftHeight-this._cFAdjHeight);this.__adjustLeftColumn();},setTheCurseOfRodNaber:function(bool){this._theCurseOfRodNaber=bool;this._cFersHeight=$("connections_Followers").getHeight();this._cFingHeight=$("connections_Following").getHeight();this._cFAdjHeight=this._cFersHeight-this._cFingHeight;$("connectionsNav_Following").observe("click",this.adjustLeftColumn.bindAsEventListener(this,"cFing"));$("connectionsNav_Followers").observe("click",this.adjustLeftColumn.bindAsEventListener(this,"cFers"));},setProfileUsername:function(name){this._username=name;},setScreeningRoom:function(sr){this._screenRoom=sr;},setConnectionButton:function(connectButton){this._cb=$(connectButton);},setMoreBioLink:function(link){this._moreBioLink=link;this._bioHeight=$(this._moreBioLink).up().getHeight();this._moreBioHeight=$(this._moreBioLink).up().previous().getHeight();this._bioAdjHeight=this._moreBioHeight-this._bioHeight;this._bioOpen=false;$(this._moreBioLink).observe("click",this._onShowMoreBio.bindAsEventListener(this));},_onShowMoreBio:function(event){event.stop();$(this._moreBioLink).up().hide();$(this._moreBioLink).up().previous().show();this._leftHeight=this._leftHeight+this._moreBioHeight-this._bioHeight;if(this._leftHeight>(this._titleHeight+this._streamHeight)){$(this._streamDiv).setStyle({height:(this._leftHeight-this._titleHeight)+"px"});this._streamHeight=this._leftHeight-this._titleHeight;this._baseStreamHeight=((!this._moreContentOpen)?this._streamHeight:(this._streamHeight-this._moreContentHeight));}this._bioOpen=true;},_onEditProfileClick:function(event){event.stop();new current.components.alerts.AlertWindow(event).init();return ;},_onSendMessageClick:function(event){if(!u.isLoggedIn()){event.stop();current.Authorize.forceLogin(event,current.components.account.LoginActivity.SEND,true);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}},_onUnfollowTopicClick:function(){if(!current.Authorize.checkWriteMode(event)){return ;}},_doConnectionCheck:function(){if(!this._cb){return ;}if(!u.isLoggedIn()){this._cb.onclick=current.Authorize.forceLogin;return ;}if(u.getId()==this._userId){$("userProfileActions").hide();}else{FriendService.isThisMyFriend(u.getUsername(),this._username,this.__onFollowingData.bindAsEventListener(this));FriendService.getMyBlockedUsers(u.getUsername(),this.__onBlockedUserData.bindAsEventListener(this));}Event.observe(this._cb,"click",this.__onConnectionToggleClick.bindAsEventListener(this));},__onConnectionToggleClick:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(this._isFollowing){FriendService.removeFriendAjax(u.getUsername(),this._username,"delete",this.__onRemoveClick.bindAsEventListener(this));}else{FriendService.addAsFriendAjax(u.getUsername(),this._username,"add",this.__onConnectClick.bindAsEventListener(this));}},__onBlockedUserData:function(data){var scope=this;data.each(function(data){if(data.username==scope._username){scope._isBlocked=true;}});if(scope._isBlocked==true){$("blockMsg").hide();$("unblockMsg").show();}Event.observe($("userBlockLink"),"click",this.__onBlockUserClick.bindAsEventListener(this));},__onBlockUserClick:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}if(this._isBlocked==true){FriendService.unblockUser(u.getUsername(),this._username,this.__onUnblockUser.bindAsEventListener(this));}else{FriendService.blockUser(u.getUsername(),this._username,this.__onBlockUser.bindAsEventListener(this));}},__onBlockUser:function(data){$("blockMsg").hide();$("unblockMsg").show();this._isBlocked=true;},__onUnblockUser:function(data){$("blockMsg").show();$("unblockMsg").hide();this._isBlocked=false;},__onFollowingData:function(data){if((data=="followee")||(data=="both")){this._isFollowing=true;}else{this._isFollowing=false;}if(this._isFollowing==true){this._cb.update(current.locale.Bundle.get("unfollow"));this._cb.addClassName("lgLtGrayButton");this._cb.removeClassName("lgGrayButton");}else{this._cb.update(current.locale.Bundle.get("follow"));this._cb.addClassName("lgGrayButton");this._cb.removeClassName("lgLtGrayButton");}this._cb.setStyle({visibility:"visible"});},__onRemoveClick:function(){this.__onFollowingData("no_connection");},__onConnectClick:function(){this.__onFollowingData("followee");}});current.content.profile.ProfilePage.getInstance=function(){if(!document.__currentProfilePage__){document.__currentProfilePage__=new current.content.profile.ProfilePage();}return document.__currentProfilePage__;};current.stub("current.content.tv");current.content.tv.TvAdminFeaturedShows=Class.create({initialize:function(){this._slots=new Array();},init:function(slots){this._slots=slots;this._timeSlotSetup();},_timeSlotSetup:function(){for(var i=0;i<slots.length;i++){var day=slots[i].substring(0,slots[i].indexOf(","));var time=slots[i].substring(slots[i].indexOf(",")+1);this.__setSelectedIndex("featuredShowsForm_daySelect"+i,day);this.__setSelectedIndex("featuredShowsForm_timeSelect"+i,time);}},__setSelectedIndex:function(sel,v){var s=$(sel);for(var i=0;i<s.options.length;i++){if(s.options[i].value==v){s.options[i].selected=true;return ;}}}});current.stub("current.clipper.credits");current.clipper.credits.Crediting=Class.create({initialize:function(target){this._target=$(target);this._creditingBuildValues=new Array();this._creditUsername=current.User.getInstance().getName();this._creditId=current.User.getInstance().getId();var initObj=[{id:0,userId:this._creditId,username:this._creditUsername,thumbnail:_o.thumbnail,role:current.locale.Bundle.get("added_this")}];this._creditingBuildValues=initObj;if(_o.mode=="edit"&&_o.credits!=null&&_o.credits.length>0){this._creditingBuildValues=_o.credits;this.__onCreditOpenClick(null);}this._connectionsLoaded=false;Event.observe($$("#"+target+"").first(),"click",this.__onCreditOpenClick.bindAsEventListener(this));Event.observe($("creditingTypeSelect"),"change",this.__onCreditSelectChange.bindAsEventListener(this));var memberSearch=new current.components.completers.Member("creditingMembersName","creditingMembersList",null,this);},init:function(){},__onCreditOpenClick:function(event){Element.hide("clipperCreditExpand");Element.show("clipperCredit");this.getUserDataOnce();this._setCreditingList();if(event!=null){Event.stop(event);}},__onCreditSelectChange:function(event){var elm=Event.element(event);$("creditingConnectionsList").hide();$("creditingMembersList").hide();$("creditingMembersInput").hide();$("creditingNonRegisteredInput").hide();switch(elm.selectedIndex){case 0:$("creditingConnectionsList").show();this.getUserDataOnce();break;case 1:$("creditingMembersInput").show();$("creditingMembersName").value="";$("creditingMembersName").resetHint();$("creditingMembersList").innerHTML="";$("creditingMembersList").show();break;case 2:$("creditingNonRegisteredInput").show();Event.observe($("creditingNonRegisteredAdd"),"click",this.onNonRegisteredAdd.bindAsEventListener(this));break;}},_addToSelectList:function(data,listId,type){var list=(type=="payload")?eval("("+data+")"):data;var items=(type=="payload")?list.items:list;var c=items.length;if(c>0){$(listId).parentNode.style.display="block";for(var i=0;i<c;i++){var item=items[i];if(item.username!=null){var userIdString=(item.userId!=null&&item.userId!=0)?item.userId:(item.id!=null&&item.id!=0)?item.id:0;var option=Builder.node("li",{id:"creditingSelectList_"+userIdString,className:((i!=c-1)?"":"last")});var div=Builder.node("div",{id:"creditingSelect_"+userIdString},item.username);if(item.thumbnail!=null){var image=Builder.node("img",{id:"creditingSelectThumbnail_"+userIdString,alt:item.username,src:current.Constants.getInstance().getDatanodeUrl()+((item.thumbnail.indexOf("_60x60.jpg")!=-1)?item.thumbnail:item.thumbnail+"_60x60.jpg"),width:"20",height:"20"});option.appendChild(image);}option.appendChild(div);$(listId).appendChild(option);Event.observe(div,"click",this.onOptionSelect.bindAsEventListener(this));if(!isUndefined(image)||image!=null){Event.observe(image,"click",this.onOptionSelect.bindAsEventListener(this));}}}}},_buildCreditingList:function(list){var c=list.length;if(c>0){$("creditingDisplayList").innerHTML="";$("creditingDisplayList").parentNode.style.display="block";for(var i=0;i<c;i++){var credited=list[i];if((credited.username!=null&&credited.username!=""&&credited.userId!=null&&credited.userId!=0)||(credited.email!=null&&credited.email!=""&&credited.displayname!=null&&credited.displayname!="")){var userIdString=(credited.userId!=null&&credited.userId!=0)?credited.userId:(credited.email!=null&&credited.email!="")?credited.email:i;var nameString=(credited.username!=null&&credited.username!="")?credited.username:(credited.displayname!=null&&credited.displayname!="")?credited.displayname:"J. D'oh!";var detailClass=(credited.userId!=null&&credited.userId!=0)?"creditsDetail":(credited.email!=null&&credited.email!="")?"creditsDetailNoImage":"creditsDetail";var option=Builder.node("li",{id:"creditingList_"+userIdString,className:((i!=0)?"":"first")});var div=Builder.node("div",{id:"crediting_"+userIdString,className:detailClass},[Builder.node("div",{className:detailClass+"Name"},nameString)]);if(credited.thumbnail!=null&&credited.thumbnail!=""&&userIdString!=credited.email&&userIdString!=credited.id){var image=Builder.node("img",{id:"creditingThumbnail_"+userIdString,alt:nameString,src:credited.thumbnail+"_40x40.jpg",width:"20",height:"20"});option.appendChild(image);}var roleDiv=Builder.node("div",{style:"float: left; font-size: 1.0em; padding: 0;"});var role=Builder.node("input",{type:"text",id:"creditingRole_"+userIdString,name:"creditingRole_"+userIdString,className:"creditsTextInput validate-max50",value:((credited.role==null||credited.role=="")?((i>0)?"":current.locale.Bundle.get("added_this")):credited.role)});roleDiv.appendChild(role);div.appendChild(roleDiv);option.appendChild(div);option.appendChild(Builder.node("br",{className:"noSpace clearBoth"}));$("creditingDisplayList").appendChild(option);Event.observe(role,"blur",this._addCreditRole.bindAsEventListener(this));if(i!=0){role.addClassName("required");role.focus();var redDelete=Builder.node("div",{id:"removeRole_"+userIdString,className:"Sprites redDeleteButton floatLeft"},"");div.appendChild(redDelete);Event.observe(redDelete,"click",this.onOptionSelect.bindAsEventListener(this));}}}}},onOptionSelect:function(event){var elm=Event.element(event);var l=this.getCreditingListValues();var inList=false;var testObj=new Object();testObj.userId=(elm.id.indexOf("_")!=-1)?elm.id.substring(elm.id.indexOf("_")+1):elm.id;var pn=$(elm.parentNode);testObj.username=(pn.down("div"))?pn.down("div").innerHTML:"J. D'oh!";testObj.thumbnail=(pn.down("img"))?pn.down("img").src:null;for(var i=0;i<l.length;i++){if(l[i].userId==testObj.userId||l[i].email==testObj.userId){inList=true;l.splice(i,1);}}if(!inList){l[l.length]=testObj;}this._creditingBuildValues=l;this._setCreditingList();},onNonRegisteredAdd:function(event){Event.stop(event);var elm=Event.element(event);if(Validation.validate($("creditingNonRegisteredName"))&&Validation.validate($("creditingNonRegisteredEmail"))){var nameString=$("creditingNonRegisteredName").value;var emailString=$("creditingNonRegisteredEmail").value;var l=this.getCreditingListValues();var inList=false;var addObj=new Object();addObj.displayname=nameString;addObj.email=emailString;for(var i=0;i<l.length;i++){if(l[i].displayname==nameString||l[i].email==emailString){inList=true;alert(current.locale.Bundle.get("messageJS.This_name_and_or_email_address_has_already_been_added"));}}if(!inList){l[l.length]=addObj;this._creditingBuildValues=l;this._setCreditingList();$("creditingNonRegisteredName").value="";$("creditingNonRegisteredName").resetHint();$("creditingNonRegisteredEmail").value="";$("creditingNonRegisteredEmail").resetHint();}}},getUserDataOnce:function(){if(!this._connectionsLoaded){if(this.getConnections()==null){this.fetchConnections();this._connectionsLoaded=true;}else{this.showConnections();}}},getTarget:function(){return this._target;},setConnections:function(connections){this._connections=Object.toJSON(connections);},getConnections:function(){return this._connections;},fetchConnections:function(){SharingService.fetchUserInfoForSharing(current.User.getInstance().getUsername(),0,100,"connectionUserName",this.__onUserConnectionsData.bindAsEventListener(this));},__onUserConnectionsData:function(dataConnections){this.setConnections(dataConnections);this.showConnections();},showConnections:function(){if(this.getConnections().length>0){this._addToSelectList(this.getConnections(),"creditingConnectionsList","payload");}else{this._noCreditingChoicesFound("creditingConnectionsList",current.locale.Bundle.get("messageJS.You_have_no_connections"));}},_noCreditingChoicesFound:function(listId,alertString){$(listId).parentNode.style.display="block";$(listId).innerHTML="";var option=Builder.node("li",{id:"creditingSelectList_MT",className:"last"},[Builder.node("div",{style:"padding-left: 0; cursor: default;"},alertString)]);$(listId).appendChild(option);},setCreditingListValues:function(dataShare){this._setCreditingList(dataShare);},getCreditingListValues:function(){return this._creditingBuildValues;},_setCreditingList:function(){if($("creditingRight")&&this._creditingBuildValues.length>0){this._buildCreditingList(this._creditingBuildValues);}},_addCreditRole:function(event){var elm=Event.element(event);var lc=this.getCreditingListValues();for(var i=0;i<lc.length;i++){var testId=(elm.id.indexOf("_")!=-1)?elm.id.substring(elm.id.indexOf("_")+1):elm.id;if(lc[i].userId==testId||lc[i].email==testId){lc[i].role=elm.value;}}this._creditingBuildValues=lc;$("creditingListOutput").value=Object.toJSON(this._getFinalCreditingList());},validateCredits:function(){var lv=$$("#creditingDisplayList input[type=text]");for(var i=0;i<lv.length;i++){if(!Validation.validate(lv[i])){return false;}}$("creditingListOutput").value=Object.toJSON(this._getFinalCreditingList());return true;},_getFinalCreditingList:function(){this._creditingFinalValues=new Array();var l=this._creditingBuildValues;var output="";if(l.length>0){$("creditingListOutput").value="";for(var i=0;i<l.length;i++){var creditObj=new Object();creditObj.id=l[i].id;creditObj.userId=l[i].userId;creditObj.username=l[i].username;creditObj.thumbnail=l[i].thumbnail;creditObj.displayname=l[i].displayname;creditObj.email=l[i].email;creditObj.role=l[i].role;if((creditObj.username==this._creditUsername||creditObj.displayname==this._creditUsername||i==0)&&creditObj.role==""){}else{this._creditingFinalValues[this._creditingFinalValues.length]=creditObj;}}return this._creditingFinalValues;}}});AbstractClip=Class.create({REQUIRED:[],initialize:function(type,target,clipper){this.setType(type);this.setTarget(target);this._hidden=true;this._clipper=clipper;this._clipperId=this._clipper.getClipperId();this.setContext(clipper.getContext());this._record={};this._isEditMode=false;this._debug=false;ClipperSourceMenu.observe(Events.TabMenu.READY,this.__onBindMenu.bindAsEventListener(this));this._clipper.observe(Events.Clipper2.EDIT_CANCEL,this.__onCancelEdit.bindAsEventListener(this));if(this._context==Clipper2.CONTEXT_COMMENT){if($(this._clipperId+"_contentTitle")){$(this._clipperId+"_contentTitle").up().hide();}if(this._clipper.getModality()==true){if($(this._clipperId+"_commentCover")){$(this._clipperId+"_commentCover").hide();}}}if($(this._debug)&&$(this._clipperId+"_clipperDebug")){$(this._clipperId+"_clipperDebug").show();}},__onBindMenu:function(){var csm=this._clipper.getMenu();csm.observe(Events.TabMenu.CHANGE,this.__onTabChange.bindAsEventListener(this));},setContext:function(context){this._context=context;},init:function(){},setRecord:function(record){this._record=Object.clone(record);this._pushRecord();},show:function(){if(!this.isHidden()){return ;}this._clipper.setActiveClip(this);this._hidden=false;this.getTarget().show();Form.getElements($(this._clipperId+"_clipperForm")).each(Validation.reset);if(!isUndefined(this.getAsset())){this.notify(Events.Clipper2.ASSET,this.getAsset());this._displayAsset();}else{this._clipper.getDisplay().hide();}},_displayAsset:function(){},hide:function(){if(this.isHidden()){return ;}this._hidden=true;this.getTarget().hide();},_pushRecord:function(){},__onTabChange:function(event){var sourceType=event.sourceType;if(sourceType==this.getType()){this.show();}else{this.hide();}},__onSubmit:function(){if(this._context==Clipper2.CONTEXT_COMMENT){}return true;},__onCancelEdit:function(){delete this._asset;},isHidden:function(){return this._hidden;},getRequired:function(){var required=this.REQUIRED;if(this._context!=Clipper2.CONTEXT_FULL){var req=this["REQUIRED_"+this._context];if(!isUndefined(req)&&req!==null){required=req;}}return required;},getAsset:function(){return this._asset;},setAsset:function(asset){this._asset=asset;},setType:function(type){this._type=type;},setTarget:function(target){this._target=$(target);},getTarget:function(){return this._target;}});Object.Event.extend(AbstractClip);AssetBase=Class.create({initialize:function(assetObj){if(assetObj){this._type=assetObj.assetType;this._url=assetObj.assetUrl;this._source=(assetObj.contentSource!=null)?assetObj.contentSource:"internet";this._width=(assetObj.assetWidth!=null)?assetObj.assetWidth:0;this._height=(assetObj.assetHeight!=null)?assetObj.assetHeight:0;this._assetLoaderId=assetObj.assetLoaderId+"_assetLoader";}else{this._type=AssetNone.TYPE;this._url="";this._source="";this._width=0;this._height=0;this._assetLoaderId="yikes";}if(this._source=="internet"||this._source=="bundle"||this._source=="feed"||this._source=="scene"){this._sanitize();}if(this._source=="internet"||this._source=="bundle"||this._source=="feed"||this._source=="scene"||this._type==AssetImage.TYPE){this._fetchSize();}},setWidth:function(width){this._width=width;},getWidth:function(){return this._width;},setHeight:function(height){this._height=height;},getHeight:function(){return this._height;},_sanitize:function(){},_fetchSize:function(){if(typeof this._assetLoader!="undefined"){this._assetLoader=this._createAssetLoader();}else{return ;}if(this._assetLoader==null){return ;}this._assetLoaderListener=this.__onAssetLoad.bindAsEventListener(this);Event.observe(this._assetLoader,"load",this._assetLoaderListener);},_createAssetLoader:function(){return null;},__onAssetLoad:function(){Event.stopObserving(this._assetLoader,"load",this._assetLoaderListener);var d=$(this._assetLoader).getDimensions();this.setWidth(d.width);this.setHeight(d.height);this._assetLoader.remove();},getUrl:function(){return this._url;},setUrl:function(url){this._url=url;},getType:function(){return this._type;},getSource:function(){return this._source;}});var AssetMediaStatic={TYPE:"M"};var AssetVideoStatic={TYPE:"V"};var AssetImageStatic={TYPE:"I"};var AssetNoneStatic={TYPE:"D"};var AssetSwfStatic={TYPE:"S"};var AssetVideo=Class.create(AssetBase,{initialize:function($super,assetObj){$super(assetObj);},_sanitize:function(){var url=this.getUrl();url=url.replace(/style=['|"].*?['|"]/i,"");url=url.replace(/wmode=['|"].*?['|"]/i,"");url=url.replace(/allowscriptaccess=['|"].*?['|"]/i,"");url=url.replace(/id=['|"].*?['|"]/i,"");url=url.replace(/<embed\s+/i,'<embed wmode="transparent" ');this.setUrl(url);},getDisplay:function(){return('<img width="120" height="90" style="z-index: 10002; position: absolute;" alt="add" src="'+current.Constants.getInstance().getDatanodeUrl()+'/images/spacer.gif"/>'+this.getUrl()+'<div class="Sprites videoPlayIcon placement_120x90" style="z-index: 10003"></div>');},_createAssetLoader:function(){var s=$(this._assetLoaderId).appendChild(Builder.node("span",{}));$(s).update(this.getUrl());var e=s.down();e.setStyle({display:"none"});var d=e.getDimensions();this.setWidth(d.width);this.setHeight(d.height);e.remove();return null;}});var AssetMedia=Class.create(AssetVideo,{});var AssetImage=Class.create(AssetBase,{getDisplayFlat:function(){var out="";out+='<img src="'+this.getUrl()+'"';out+='width = "'+120+'"';out+='height = "'+90+'"';out+='" alt=""/>';return out;},getId:function(){return Math.floor(Math.random()*20000);},_createAssetLoader:function(){return $(this._assetLoaderId).appendChild(Builder.node("img",{src:this.getUrl(),style:"display: none;"}));},getDisplay:function(){var datanodeUrl=current.Constants.getInstance().getSwfDatanodeUrl();var thumbUrl=current.utils.Url.getVersionedUrl("/swf/barca/thumbnail.swf");var fs=new SWFObject(datanodeUrl+thumbUrl,this.getId(),120,90,"8","#272727");fs.addParam("wmode","transparent");fs.addParam("scaleMode","noScale");fs.addVariable("url",encodeURIComponent(this.getUrl()));fs.addVariable("fitAll","false");return'<img width="120" height="90" style="z-index: 10002; position: absolute;" alt="add" src="'+current.Constants.getInstance().getDatanodeUrl()+'/images/spacer.gif"/>'+fs.getSWFHTML();}});var AssetNone=Class.create(AssetBase,{getId:function(){return Math.floor(Math.random()*20000);},getDisplay:function(){var datanodeUrl=current.Constants.getInstance().getSwfDatanodeUrl();var thumbUrl=current.utils.Url.getVersionedUrl("/swf/barca/thumbnail.swf");var fs=new SWFObject(datanodeUrl+thumbUrl,this.getId(),120,90,"8","#272727");fs.addParam("wmode","transparent");fs.addParam("scaleMode","noScale");fs.addVariable("url",encodeURIComponent(current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/no_asset/no_image_260x195.jpg"));fs.addVariable("fitAll","false");return'<img width="120" height="90" style="z-index: 10002; position: absolute;" alt="add" src="'+current.Constants.getInstance().getDatanodeUrl()+'/images/spacer.gif"/>'+fs.getSWFHTML();}});var AssetSwf=Class.create(AssetBase,{getDisplay:function(){return"";},_fetchSize:function(){this._width=0;this._height=0;}});Object.extend(AssetSwf,AssetSwfStatic);Object.extend(AssetVideo,AssetVideoStatic);Object.extend(AssetMedia,AssetMediaStatic);Object.extend(AssetImage,AssetImageStatic);Object.extend(AssetNone,AssetNoneStatic);var AssetFactory={getAsset:function(assetObj){switch(assetObj.assetType){case AssetMedia.TYPE:return(new AssetMedia(assetObj));break;case AssetVideo.TYPE:return(new AssetVideo(assetObj));break;case AssetImage.TYPE:return(new AssetImage(assetObj));break;case AssetSwf.TYPE:return(new AssetSwf(assetObj));break;default:return(new AssetNone(assetObj));break;}}};var AssetSelectInput=Class.create({initialize:function(node,key){this._node=node;this._elseType="M";this._firstPass=true;this._inputHash=$H();this._previewHash=$H();this._assetHash=$H();this._clipperId=key;this._inputHash.set(AssetImage.TYPE,this._clipperId+"_elsewhereImageInput");this._inputHash.set(AssetMedia.TYPE,this._clipperId+"_elsewhereEmbedInput");this._previewHash.set(AssetImage.TYPE,this._inputHash.get(AssetImage.TYPE)+"Preview");this._previewHash.set(AssetMedia.TYPE,this._inputHash.get(AssetMedia.TYPE)+"Preview");this._setAssetType(this._getElseType());$(this._clipperId+"_elsewhereAddButton").onclick=this.__onAddClick.bindAsEventListener(this);$(this._clipperId+"_elsewhereAddButton2").onclick=this.__onAddClick.bindAsEventListener(this);},_displayAsset:function(){this._getPreview().innerHTML='<a href="#" onclick="return false" class="assetSelectLink selected" rel="'+this._assetType+'" title="'+escape($F(this._assetInput))+'">'+this._getAsset().getDisplay()+"</a>";},_resetDisplayAsset:function(){$(this._clipperId+"_elsewhereImageInput").value="";$(this._clipperId+"_elsewhereEmbedInput").value="";this._lastAsset="";this._setAsset(new AssetNone());Clipper2Static.setAssetFromVO(new AssetNone(),this._clipperId);this._displayAsset();},_getAssetType:function(){return this._assetType;},_setAssetType:function(type){this._assetType=type;this._assetInput=$(this._inputHash.get(type));this._inputHash.values().without(this._inputHash.get(type)).each(function(node){$(node).up().hide();});this._assetInput.up().show();},_getElseType:function(){return this._elseType;},setElseType:function(type){this._elseType=type;},_getPreview:function(){return $(this._previewHash.get(this._assetType));},_getAsset:function(){return this._assetHash.get(this._assetType);},_setAsset:function(asset){this._assetHash.set(this._assetType,asset);},_getPreview:function(){return $(this._previewHash.get(this._getAssetType()));},_validate:function(){this._assetInput.addClassName("required");if(this._assetType=="I"){this._assetInput.addClassName("validate-url");}var result=Validation.validate(this._assetInput);this._assetInput.removeClassName("required");this._assetInput.removeClassName("validate-url");return result;},__onAddClick:function(event){Event.stop(event);if(!this._validate()||$F(this._assetInput)===this._lastAsset){return ;}this["__onSubmit"+this._assetType](this._assetInput);},__onSubmitM:function(){current.proxy.CCCP.execute("clipper","normalize_embed",{embed:$F(this._assetInput)},this.__onOtherSanitize.bindAsEventListener(this),this.__onSanitizeFail.bindAsEventListener(this));},__onSanitizeFail:function(){this._embedValidation=Validation.throwError($(this._assetInput).up(),current.locale.Bundle.get("messageJS.We_didnt_recognize_your_embed"));},__onOtherSanitize:function(data){if(isUndefined(data)){this._embedValidation=Validation.throwError($(this._assetInput).up(),current.locale.Bundle.get("messageJS.We_didnt_recognize_your_embed"));return ;}else{if(this._embedValidation){this._embedValidation.remove();this._embedValidation=null;}this._assetInput.value=data;this.__onSubmitComplete();}},__onSubmitI:function(){this.__onSubmitComplete();},__onSubmitComplete:function(){this._setAsset(AssetFactory.getAsset({assetUrl:$F(this._assetInput),assetType:this._assetType,assetLoaderId:this._clipperId}));this._displayAsset();this.notify(Events.Clipper2.ASSET,this._getAsset());var clipperInstance=eval("document.__"+this._clipperId+"_clipper__");clipperInstance.getDisplay().setOutput(this._getAsset().getDisplay());this._lastAsset=$F(this._assetInput);clipperInstance.getNextButton().removeClassName("lgDisabledButton");clipperInstance.getNextButton().enable();},__onTypeChange:function(){var newType=this._getElseType();if(this._assetType==newType){if(!this._firstPass){return ;}else{this._firstPass=false;}}this._setAssetType(newType);this._previewHash.values().each(function(s){$(s).hide();});this._showAsset();var clipperInstance=eval("document.__"+this._clipperId+"_clipper__");clipperInstance.getNextButton().disable();clipperInstance.getNextButton().addClassName("lgDisabledButton");},_showAsset:function(){this._getPreview().show();var a=this._getAsset();if(isUndefined(a)||a===null){this._setAsset(new AssetNone());Clipper2Static.setAssetFromVO(new AssetNone(),this._clipperId);this._displayAsset();}else{Clipper2Static.setAssetFromVO(a,this._clipperId);}},__onTabChange:function(event,active){if($(active.rel)!==this._node||this._getAsset()===null){return ;}this._showAsset();}});Object.Event.extend(AssetSelectInput);current.stub("current.clipper");current.clipper.BloggerWindow=Class.create({initialize:function(event,posLeft,posTop){var p=current.site.Page.getInstance();var u=current.User.getInstance();this._pageId=p.getId();this._open=false;this._modalWidth="634";this._modalHeight="420";this._contentWidth="600";this._modalId="clipperWindow";this._el=current.utils.Compatibility.getEventElement(event);this._groupSlug=this._el.rel;this._edit=false;this._slug="";this._itemId=0;this._assignmentId=0;this._clipperTitle="";this._contentSource="";this._parentContentId="";this._parentCommentId="";this._context=Clipper2Static.CONTEXT_FULL;this._clipperContainer="accountModalForm";this._url="";var viewport=document.viewport.getDimensions();this._winWidth=viewport.width;this._winHeight=viewport.height;if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=this._el.cumulativeOffset()["left"];this._modalPosTop=this._el.cumulativeOffset()["top"];}if(this._modalPosLeft>(this._winWidth-983)/2+359){this._modalPosLeft=((this._winWidth-983)/2+359);}if(this._modalPosLeft<(this._winWidth-983)/2){this._modalPosLeft=(this._winWidth-983)/2;}},setEditString:function(edit){this._edit=edit;},setGroupSlug:function(slug){this._slug=slug;},setItemId:function(id){this._itemId=id;},setAssignmentId:function(id){this._assignmentId=id;},setClipperTitle:function(title){this._clipperTitle=title;},setContentSource:function(src){this._contentSource=src;},setContentUrl:function(url){this._url=url;},setParentContentId:function(parentContentId){this._parentContentId=parentContentId;},setParentCommentId:function(parentCommentId){this._parentCommentId=parentCommentId;},setContext:function(context){this._context=context;},init:function(){this._titleWidth=(this._contentWidth-20);this._bodyWidth=this._contentWidth;if(current.utils.Compatibility.isIE6Browser()){this._titleWidth=parseInt(parseInt(this._contentWidth)+parseInt(5));this._bodyWidth=parseInt(parseInt(this._contentWidth)+parseInt(25));}this._title=(!this._edit)?current.locale.Bundle.get("clipper.post_an_item"):current.locale.Bundle.get("clipper.edit_this_item");if(this._clipperTitle!=""){this._title=this._clipperTitle;}var wrapper='<div class="clipperModalTitle" style="width: '+this._titleWidth+'px"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="clipperModalBody" style="width: '+this._bodyWidth+'px;"><div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"accountModalContainer clipperModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._open=false;this._draggable.destroy();document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;this._draggable=new Draggable("modal_container",{handle:"clipperModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});document.__modalOpenL1__=true;var ajaxString="/blogger.htm?modal=true";if(this._slug!=""){ajaxString=ajaxString+"&groupSlug="+this._slug;}if(this._itemId!=0){ajaxString=ajaxString+"&cid="+this._itemId;}if(this._url!=""){ajaxString=ajaxString+"&url="+this._url;}if(this._assignmentId!=""){ajaxString=ajaxString+"&assignmentId="+this._assignmentId;}if(this._contentSource!=""){ajaxString=ajaxString+"&contentSource="+this._contentSource;}if(this._parentContentId!=""){ajaxString=ajaxString+"&parentContentId="+this._parentContentId;}if(this._parentCommentId!=""){ajaxString=ajaxString+"&parentCommentId="+this._parentCommentId;}if(this._context!=""){ajaxString=ajaxString+"&context="+this._context;}new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+ajaxString,{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});Control.Modal.container.setStyle({height:"auto"});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){EventSelectors.start(EventSelectorRules);if(this._edit){$$("#clipperModalBody .clipper2 .itemDataForm .validate-isNotHint").each(function(c){$(c).setStyle({color:"#000"});});if($("c_"+this._itemId+"_commentCover")){$("c_"+this._itemId+"_commentCover").hide();}}},__onCloseClick:function(){if(tinyMCE){tinyMCE.execCommand("mceRemoveControl",false,"g__contentText");tinyMCE.execCommand("mceRemoveControl",false,"g__moreText");}this.__resetWindow();current.content.items.CommentEdit.getInstance().cancel();Control.Modal.close();}});current.stub("Events");var Clipper2=Class.create();Clipper2.prototype={DEFAULT_SOURCE:"text",_editing:false,initialize:function(){if(isUndefined(this._clips)){this._clips=$H();}this._assetLoaded=false;this._isTextOnly=false;this._groupListArray=new Array();this._groupInput=null;this._paneArray=new Array();this._paneArray.all=new Array("duplicateWarning","mainPane","clipperMenu","clipperMenuBottom","clipperInputSubtitle","addToPane","clipperMenuMain","clipperMenuTop","clipperInputPane","mostBestestListItem","mostBestestInfo","considerForTvHolder","clipperMenuNext");this._paneArray.main=new Array("mainPane","clipperMenuMain","clipperMenu");this._paneArray["main+"]=new Array("mainPane","clipperMenuMain","mostBestestListItem","mostBestestInfo","addToPane");this._paneArray["main-"]=new Array("mainPane","clipperMenuMain","clipperMenuBottom","addToPane");this._paneArray.text=new Array("mainPane","clipperMenuMain","clipperMenu","addToPane");this._paneArray.upload=new Array("clipperMenuTop","clipperInputPane","considerForTvHolder","clipperMenuNext");this._paneArray.webcam=new Array("clipperMenuTop","clipperInputPane","clipperMenuNext");this._paneArray.image=new Array("clipperMenuTop","clipperInputPane","clipperMenuNext");this._paneArray.embed=new Array("clipperMenuTop","clipperInputPane","clipperMenuNext");this._paneArray["upload-"]=new Array("clipperInputPane","considerForTvHolder","clipperMenuNext");this._paneArray["webcam-"]=new Array("clipperInputPane","clipperMenuNext");this._paneArray["image-"]=new Array("clipperInputPane","clipperMenuNext");this._paneArray["embed-"]=new Array("clipperInputPane","clipperMenuNext");this._elseSource="";this._isSuperSpecial=false;},init:function(){this._currentMenu=new ClipperSourceMenu(this,this.getClipperId()+"_clipperMenu");this._currentMenu.observe(Events.TabMenu.CHANGE,this.onTypeChange.bind(this));this._display=new MostBestest(this.getClipperId()+"_mostBestestDisplay");this._currentMenu.observe(Events.TabMenu.CHANGE,this._display.clear.bindAsEventListener(this._display));this._currentMenu.init();this._currentMenu.setSource(this.getSource());if(this.isEdit()){this.edit();}else{this.setPane("main");}this._setConfigElements();},_setConfigElements:function(){Event.observe(this.getForm(),"submit",this.__onSubmit.bindAsEventListener(this));this._assetSelectInput=new AssetSelectInput(null,this.getClipperId());this._assetSelectInput.observe(Events.Clipper2.ASSET,this.onAssetReady.bind(this));this.getCancelButton().observe("click",this.__onCancel.bindAsEventListener(this));this.getNextButton().observe("click",this.__onNext.bindAsEventListener(this));this.getCancelAssetButton().observe("click",this.__onCancelAsset.bindAsEventListener(this));this.getRemoveAssetButton().observe("click",this.__onRemoveAsset.bindAsEventListener(this));$(this.getClipperId()+"_input_uploadAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,UploadClip.TYPE));$(this.getClipperId()+"_input_webcamAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,WebcamClip.TYPE));$(this.getClipperId()+"_input_embedAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,LinkClip.TYPE,"embed"));$(this.getClipperId()+"_input_imageAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,LinkClip.TYPE,"image"));$(this.getClipperId()+"_sub_input_embedAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,LinkClip.TYPE,"embed-"));$(this.getClipperId()+"_sub_input_imageAsset").observe("click",this._onSubMenuClick.bindAsEventListener(this,LinkClip.TYPE,"image-"));if(this._isSuperSpecial){$(this.getClipperId()+"_considerForTv").observe("click",this.displayClassificationList.bindAsEventListener(this));}if(this.getOptions().view=="blog"){$(this.getClipperId()+"_contentText").removeClassName("validate-max8000");$(this.getClipperId()+"_clipperMenuMain").hide();$(this.getClipperId()+"_clipperCancelPipe").hide();$(this.getClipperId()+"_clipperCancelNextButton").hide();$(this.getClipperId()+"_clipperMenuNext").show();this.getNextButton().observe("click",this.__onBlogNext.bindAsEventListener(this));}},onAssetReady:function(asset){if(arguments.length>1){asset=arguments[1];}this._asset=asset;Clipper2Static.setAssetFromVO(asset,this.getClipperId());this._assetLoaded=true;},onTypeChange:function(event){this.setSource(event.sourceType);Clipper2Static.setAssetNull(this.getClipperId());this._asset=null;this._assetLoaded=false;},getAssetLoaded:function(){return this._assetLoaded;},setContext:function(context){this._context=context;},getContext:function(){return this._context;},setClipperId:function(uniqueInstanceId){this._clipperId=uniqueInstanceId;},getClipperId:function(){return this._clipperId;},setIsTextOnly:function(bool){this._isTextOnly=bool;},setIsSuperSpecial:function(bool){this._isSuperSpecial=bool;},getIsTextOnly:function(){return this._isTextOnly;},setFromElse:function(asi){this._assetSelectInput=asi;},getFromElse:function(){return this._assetSelectInput;},setModality:function(modalState){this._isModal=modalState;},getModality:function(){return this._isModal;},setAdminEdit:function(editState){this._isAdminEdit=editState;},getAdminEdit:function(){return this._isAdminEdit;},edit:function(){var source=this.getOptions().contentSource;if(source!=this.getSource()){this.forceSourceChange(source);}var url=this.getOptions().contentUrl;if(url!=null&&url!=""&&!isUndefined(url)){this.getOptions().contentUrl=unescape(url);}var clipperId=this.getClipperId();var scope=this;$H(this.getOptions()).each(function(pair){if(!isUndefined($(clipperId+"_"+pair.key))&&$(clipperId+"_"+pair.key)!==null&&pair.value!=null){var s=pair.value;if($(clipperId+"_"+pair.key).hasClassName("escapeHTML")){if(scope.getOptions().view!="blog"){s=s.unescapeHTML();}}$(clipperId+"_"+pair.key).value=s;}});this.getClip(this.getSource()).setRecord(this.getOptions());if(this.getOptions().mode=="edit"){this.getMenu().setLock(true);if(this.getContext()==Clipper2.CONTEXT_COMMENT){}this.setPublish(false);if(!this.isEdit()){this.setEdit(true);}this.__onNext();}else{this.setPublish(true);this.setEdit(false);this.setPane("main");}if(this.getOptions().mode=="url"){this.getMenu().setLock(true);if($(this._clipperId+"_menuBox")){$(this._clipperId+"_menuBox").hide();}this.getClip(LinkClip.TYPE).parseTextEntry();}if(this.getSource()==LinkClip.TYPE&&this.isEdit()){this.getClip(LinkClip.TYPE).setLastFetchUrl($(this.getClipperId()+"_contentUrl").value);}if(this.getSource()==UploadClip.TYPE&&this.getOptions().mode=="contentSource"&&!this.isEdit()){this._onSubMenuClick(null,UploadClip.TYPE);$(this.getClipperId()+"_input_uploadAsset").addClassName("active");}if(this.getSource()==WebcamClip.TYPE&&this.getOptions().mode=="contentSource"&&!this.isEdit()){this._onSubMenuClick(null,WebcamClip.TYPE);$(this.getClipperId()+"_input_webcamAsset").addClassName("active");}},_onSubMenuClick:function(event,newSource,newAsset){var el=null;if(!isUndefined(event)&event!=null){event.stop();el=event.element();}if(this._assetSelectInput){this._assetSelectInput._resetDisplayAsset();}$$("#"+this.getClipperId()+"_clipper2 .subMenuLink").each(function(sub){$(sub).removeClassName("active");});if(newSource!=this.getSource()){this.forceSourceChange(newSource);}if(typeof newAsset!="undefined"){$$("#"+this.getClipperId()+"_clipper2 .elsewhereAsset").each(function(e){e.hide();});var src=(newAsset.indexOf("-")!=-1)?newAsset.substring(0,newAsset.indexOf("-")):newAsset;$(this.getClipperId()+"_elsewhere_"+src).show();this.setPane(newAsset);this._elseSource=src;if(src=="image"){this._assetSelectInput.setElseType("I");$(this.getClipperId()+"_input_imageAsset").addClassName("active");}if(src=="embed"){this._assetSelectInput.setElseType("M");$(this.getClipperId()+"_input_embedAsset").addClassName("active");}this._assetSelectInput.__onTypeChange();}else{this.setPane(newSource);this._elseSource="";}if(el!=null){el.addClassName("active");}},forceSourceChange:function(source){this.setSource(source);this.getMenu().setSource(this.getSource());this.getMenu()._change();},setEdit:function(bool){this._editing=bool;},setPublish:function(show){var p=$(this.getClipperId()+"_publishToBox");if(p){var fb=$(this.getClipperId()+"_publishToFacebook");var tw=$(this.getClipperId()+"_publishToFacebook");if(show){if(fb&&!isUndefined(fb.oldChecked)){fb.checked=fb.oldChecked;}if(tw&&!isUndefined(tw.oldChecked)){tw.checked=tw.oldChecked;}p.show();}else{if(fb){fb.oldChecked=fb.checked;fb.checked=false;}if(tw){tw.oldChecked=tw.checked;tw.checked=false;}p.hide();}}},cancel:function(){this.__onCancel();},__onCancel:function(){if((this.getOptions().mode=="edit")&&(this.getContext()==Clipper2.CONTEXT_COMMENT)){Control.Modal.close();current.content.items.CommentEdit.getInstance().cancel();return ;}Clipper2.setContentUrl("",this.getClipperId());Clipper2.setAssetNull(this.getClipperId());this._asset=null;this._assetLoaded=false;$(this.getClipperId()+"_cid").value="";$(this.getClipperId()+"_parentCommentId").value="";this.setSource(this.DEFAULT_SOURCE);var ieSux=$(this.getClipperId()+"_parentContentId").value;this.getForm().reset();$(this.getClipperId()+"_parentContentId").value=ieSux;this.getCancelButton().hide();this.getSubmitButton().enable();this.getSubmitButton().setOpacity(1);$(this.getClipperId()+"_clipperCancelBorder").hide();this.setPublish(true);this.setEdit(false);var menu=this.getMenu();menu.setLock(false);menu.setSource(this.DEFAULT_SOURCE);menu._change();$$("#"+this.getClipperId()+"_clipper2 .validate-isNotHint, #"+this.getClipperId()+"_clipper2 .validate-isNotEmptyHint, #"+this.getClipperId()+"_clipper2 .hasHinting").invoke("resetHint");this.forceSourceChange(TextClip.TYPE);this.setPane("main");this.getClip(LinkClip.TYPE).resetLinkClip(undefined);this.notify(Events.Clipper2.EDIT_CANCEL);this.setRecord={};this.setOptions({});},__onNext:function(event){if(typeof event!="undefined"){event.stop();}if(this.getOptions().view=="blog"){}if(this._asset!=null||this.getSource()==WebcamClip.TYPE){var choice=this.getSource();switch(choice){case"upload":if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_a_file_upload");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_file_upload");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_file_upload");this.getAssetInfoDiv().down("a").rel="upload";$(this.getClipperId()+"_clipperCancelNextButton").rel="main";}break;case"videoegg":if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_a_file_upload");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_file_upload");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_file_upload");this.getAssetInfoDiv().down("a").rel="upload";$(this.getClipperId()+"_clipperCancelNextButton").rel="main";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;case WebcamClip.TYPE:if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_webcam_recording");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_webcam_recording");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_webcam_recording");this.getAssetInfoDiv().down("a").rel="webcam";$(this.getClipperId()+"_clipperCancelNextButton").rel="webcam";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;case LinkClip.TYPE:if(this._elseSource=="embed"){if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_an_embed_code");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_embed_code");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_embed_code");this.getAssetInfoDiv().down("a").rel="embed";$(this.getClipperId()+"_clipperCancelNextButton").rel="embed";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;}else{if(this._elseSource=="image"){if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_an_image_URL");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_image_URL");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_image_URL");this.getAssetInfoDiv().down("a").rel="image";$(this.getClipperId()+"_clipperCancelNextButton").rel="image";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;}else{if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_an_asset");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_asset");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_asset");this.getAssetInfoDiv().down("a").rel="main";$(this.getClipperId()+"_clipperCancelNextButton").rel="image";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;}}case TextClip.TYPE:if(!this.isEdit()){this.getAssetInfoDiv().down("h4").innerHTML=current.locale.Bundle.get("clipper.Youve_added_an_asset");this.getAssetInfoDiv().down("h4").show();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_remove_this_asset");}else{this.getAssetInfoDiv().down("h4").hide();this.getAssetInfoDiv().down("a").innerHTML=current.locale.Bundle.get("clipper.x_replace_this_asset");this.getAssetInfoDiv().down("a").rel="main";$(this.getClipperId()+"_clipperCancelNextButton").rel="image";}var mb=this.getDisplay();mb.setLock(false);mb.show();break;default:this.getAssetInfoDiv().down("h4").innerHTML="";this.getAssetInfoDiv().down("a").innerHTML="";break;}this.setPane("main+");if(this.isEdit()&&!this.getAdminEdit()){if($(this.getClipperId()+"_addToPane")){$(this.getClipperId()+"_addToPane").hide();}}}else{if(!this.isEdit()){this.setPane("main");}else{this.setPane("main+");if($(this.getClipperId()+"_addToPane")&&!this.getAdminEdit()){$(this.getClipperId()+"_addToPane").hide();}}}if($(this.getClipperId()+"_contentText")&&(!this.isEdit()||this.getSource()==TextClip.TYPE||this.getSource()==LinkClip.TYPE)){$(this.getClipperId()+"_contentText").focus();}},__onBlogNext:function(event){event.stop();if(typeof window.top.checkTinyMCE!="undefined"){window.top.checkTinyMCE();}else{if(typeof window.checkTinyMCE!="undefined"){window.checkTinyMCE();}else{if(typeof checkTinyMCE!="undefined"){checkTinyMCE();}else{}}}$(this.getClipperId()+"_clipperMenuNext").hide();$(this.getClipperId()+"_clipperMenuMain").show();return ;},__onCancelAsset:function(event){event.stop();if(!this.isEdit()){this.forceSourceChange(TextClip.TYPE);this.setPane("main");this.getClip(LinkClip.TYPE).resetLinkClip(event);this.getClip(LinkClip.TYPE).parseTextEntry(event);if($(this.getClipperId()+"_addToPane")){$(this.getClipperId()+"_addToPane").show();}}else{var el=event.element();var rel=el.rel;if(this.getOptions().view!="blog"){this.setPane("main+");}if($(this.getClipperId()+"_addToPane")&&!this.getAdminEdit()){$(this.getClipperId()+"_addToPane").hide();}if(this._asset!=null&&this._asset.getType()!=null){var mb=this.getDisplay();mb.setLock(false);mb.show();}if(this.getSource()==TextClip.TYPE||this.getSource()==LinkClip.TYPE){$(this.getClipperId()+"_clipperMenuBottom").show();}}if($(this.getClipperId()+"_contentText")){$(this.getClipperId()+"_contentText").focus();}},__onRemoveAsset:function(event){if(this._assetSelectInput){this._assetSelectInput._resetDisplayAsset();}if(!this.isEdit()){Clipper2Static.setAssetNull(this.getClipperId());this.__onCancelAsset(event);if($(this.getClipperId()+"_addToPane")&&!Element.visible(this.getClipperId()+"_addToPane")){Effect.Appear(this.getClipperId()+"_addToPane");}var mostBestest=this.getDisplay();mostBestest.clear();mostBestest.hide();this.getAssetInfoDiv().down("h4").innerHTML="";this.getAssetInfoDiv().down("a").innerHTML="";this._asset=null;this._assetLoaded=false;}else{event.stop();var el=event.element();var rel=el.rel;this.setPane(rel+"-");if(this.isEdit()&&!this.getAdminEdit()){if($(this.getClipperId()+"_addToPane")){$(this.getClipperId()+"_addToPane").hide();}}if(this.getSource()==LinkClip.TYPE&&this.getPane()=="main-"){this.getClip(LinkClip.TYPE).setLastFetchUrls(new Array());this.getClip(LinkClip.TYPE).parseTextEntry(event);}if(this.getSource()==UploadClip.TYPE){$(this.getClipperId()+"_considerForTvHolder").hide();}}},forceEditCancel:function(){this.__onCancel();},setGroupListArray:function(array){this._groupListArray=array;},addGroupSelect:function(){$(this._groupSelect).observe("change",this.__onGroupSelect.bindAsEventListener(this));},__onGroupSelect:function(event){},toggleSelectableGroups:function(){if($(this._groupSelect)){var groups=$(this._groupSelect).descendants();var extGroups=this._groupListArray;groups.each(function(g){if(extGroups.include(g.value)){g.hide();}else{g.show();}});}},addRemoveLinks:function(isEdit){var target=$(document.getElementsByTagName("body")[0]);target.select(".groupRemove").invoke("observe","click",this.__onRemoveGroupClick.bindAsEventListener(this,isEdit));target.select(".removeTag").invoke("observe","click",this.__onRemoveTagClick.bindAsEventListener(this));},__onRemoveGroupClick:function(event,isEdit){event.stop();var el=event.element();if($("throbber_"+el.rel)){$("throbber_"+el.rel).show();}for(index=0;index<$(this._groupSelect).length;index++){if($(this._groupSelect)[index].value==el.rel){$(this._groupSelect).selectedIndex=index;}}if(isEdit){current.proxy.CCCP.execute("item","group_post",{id:this.getOptions().cid,groupSlugs:el.rel,action:"delete"},this.__onRemoveGroupSuccess.bindAsEventListener(this,el));}else{this.__onRemoveGroupSuccess(true,el);}},__onRemoveGroupSuccess:function(data,el){if(data!=null){for(var i=0;i<this._groupListArray.length;i++){if(el.rel==this._groupListArray[i]){this._groupListArray.splice(i,1);}}$(this.getClipperId()+"_groupSlugList").value=this._groupListArray.join(",");el.up("li").hide();$(this._groupSelect).show();this.toggleSelectableGroups();$(this._groupSelect).selectedIndex=0;}},__onRemoveTagClick:function(event){event.stop();var el=event.element();if($("throbber_"+el.id)){$("throbber_"+el.id).show();}current.proxy.CCCP.execute("item","tag_post",{id:this.getOptions().cid,tagIds:el.id,action:"delete"},this.__onRemoveTagSuccess.bindAsEventListener(this,el));},__onRemoveTagSuccess:function(data,el){if(data!=null){el.up("li").hide();}},createTagsHolder:function(){var target=($("toolbar"))?$("toolbar"):$("frame");if(target){if(this.getModality()){target.insert(new Element("div",{id:this.getClipperId()+"_clipperTagsInputHolder","class":"addTagsInputHolder clipper2TagsInputHolder",style:"display: none; margin: 0;"}));}else{target.insert(new Element("div",{id:this.getClipperId()+"_clipperTagsInputHolder","class":"addTagsInputHolder clipper2TagsInputHolder nonModalTags",style:"display: none;"}));}}},getSource:function(){if(isUndefined(this._source)||this._source===""||this._source===null){return this.DEFAULT_SOURCE;}else{return this._source;}},getElseSource:function(){if(isUndefined(this._elseSource)||this._elseSource===""||this._elseSource===null){return"";}else{return this._elseSource;}},setSource:function(src){$(this.getClipperId()+"_contentSource").value=src;this._source=src;},isEdit:function(){return this._editing;},setOptions:function(options){this.options=options;},getOptions:function(){return this.options;},getMenu:function(){return this._currentMenu;},setForm:function(form){this._form=form;},getForm:function(){return this._form;},getDisplay:function(){return this._display;},setActiveClip:function(instance){this._active=instance;},getActiveClip:function(){return(typeof this._active!="undefined")?this._active:this.getClip(this.getSource());},getClip:function(type){return this._clips[type];},getSubmitButton:function(){return $(this._submitButton);},getCommentLabel:function(){return $(this.getClipperId()+"_clipperTitleLabel").down();},setGroupSelect:function(groupSelect){this._groupSelect=groupSelect;},setGroupInput:function(groupInput){this._groupInput=groupInput;},setSubmitButton:function(button){this._submitButton=button;},getCancelButton:function(){return $(this._cancelButton);},setCancelButton:function(button){this._cancelButton=button;},getNextButton:function(){return $(this._nextButton);},setNextButton:function(button){this._nextButton=button;},getCancelAssetButton:function(){return $(this._cancelAssetButton);},setCancelAssetButton:function(button){this._cancelAssetButton=button;},getRemoveAssetButton:function(){return $(this._removeAssetButton);},setRemoveAssetButton:function(button){this._removeAssetButton=button;},getElsewhere:function(){return this._else;},setElsewhere:function(elser){this._else=elser;},getClipComponent:function(type){return this._clips[type];},setClipComponent:function(instance){var type=instance.getType();this._clips[type]=instance;},setAssignmentId:function(id){$(this.getClipperId()+"_assignmentId").value=id;},setCreditingInstance:function(crId){this.crediting=crId;},setAssetInfoDiv:function(div){this._assetInfoDiv=$(div);},getAssetInfoDiv:function(){return this._assetInfoDiv;},__onSubmit:function(event){Form.getElements($(this._clipperId+"_clipperForm")).each(Validation.reset);if(this._groupListArray.length>0&&$(this._groupSelect).selectedIndex==0){$(this._groupSelect).hide();}if($(this._groupSelect)&&$(this._groupSelect).selectedIndex!=0){this._groupListArray[this._groupListArray.length]=$(this._groupSelect)[$(this._groupSelect).selectedIndex].value;}if(this._groupInput!=null){$(this._groupInput).value=this._groupListArray.join(",");}var fields=this.getActiveClip().getRequired().concat(this.REQUIRED);if(!this.getClip(LinkClip.TYPE).validateText()){if($("groupList")!=null){if($(this._groupSelect)&&!$("groupList").visible()){$(this._groupSelect).show();}}event.stop();return false;}if(this.getOptions().isComment){fields=fields.reduce().reject(function(s){return s=="contentTitle";});var contentTitle=$(this.getClipperId()+"_contentTitle");if(contentTitle&&contentTitle.value==contentTitle.title){contentTitle.value="";}if($(this.getClipperId()+"_context").value=="FULL"){$(this.getClipperId()+"_context").value="FULL_COMMENT";}}if(this.isEdit()){fields=fields.reduce().reject(function(s){return s=="groupSlugs";});}var scope=this;var invalids=fields.reject(function(f){f=$(scope.getClipperId()+"_"+f);if(f==null){return true;}if(f.hasAttribute("title")){var t=f.readAttribute("title");}var _userTitle=(!f.hasClassName("validate-isNotHint")&&!f.hasClassName("validate-isNotEmptyHint")&&!isUndefined(t)&&t!==null&&t!=="");return Validation.validate(f,{useTitle:_userTitle});});if(invalids.length>0){if($(this._groupSelect)){$(this._groupSelect).show();}event.stop();return ;}if(!this.getActiveClip().__onSubmit()){if($(this._groupSelect)){$(this._groupSelect).show();}event.stop();return ;}else{if(this.getOptions().view=="blog"){var src=this.getSource();this.setSource("blog");}Clipper2Static.setAssetFromVO(this._asset,this.getClipperId());if(this.getContext()==Clipper2Static.CONTEXT_COMMENT){current.tracking.Track.getInstance().onCommentSubmitted(this.getSource());event.stop();this.__doAjaxSubmit(event);return ;}current.tracking.Track.getInstance().onContentCreate(this.getContext(),this.getSource());}this.getSubmitButton().disable();this.getSubmitButton().setOpacity(0.5);},__doAjaxSubmit:function(event){this.getSubmitButton().disable();this.getSubmitButton().setOpacity(0.5);var ajaxInjector=new ClipperAjaxInjector();var user=current.User.getInstance();var clipperAction=($(this._clipperId+"_cid").value!="0"&&$(this._clipperId+"_cid").value!="")?"edit":"add";var content=$(this._clipperId+"_contentText").value.replace(/(<([^>]+)>)/ig,"");var JSONdata={include:"contentAddedUser,contentPageAsset",addedUser:user.getUsername(),userId:user.getId(),contentSource:$(this._clipperId+"_contentSource").value,contentText:content,contentUrl:$(this._clipperId+"_contentUrl").value,parentContentId:$(this._clipperId+"_parentContentId").value,assetType:$(this._clipperId+"_assetType").value,assetWidth:$(this._clipperId+"_assetWidth").value,assetHeight:$(this._clipperId+"_assetHeight").value,considerForTv:"false",html:"false",action:clipperAction,userThumbnail:this._userThumbnail,userStaff:this._userStaff};var publish=[];if(($(this._clipperId+"_publishToFacebook")&&$(this._clipperId+"_publishToFacebook").checked)){publish.push("facebook");}if(($(this._clipperId+"_publishToTwitter")&&$(this._clipperId+"_publishToTwitter").checked)){publish.push("twitter");}JSONdata.publishTo=publish.join(",");if($(this._clipperId+"_assetUrl").value!=$(this._clipperId+"_assetUrlOld").value){JSONdata.assetUrl=$(this._clipperId+"_assetUrl").value;if(JSONdata.assetUrl=="undefined"){JSONdata.assetUrl="";if($(this._clipperId+"_assetUrlOld").value!="undefined"){JSONdata.assetDeleted=true;}}}if($(this._clipperId+"_thumbUrl").value!=$(this._clipperId+"_thumbUrlOld").value){JSONdata.thumbUrl=$(this._clipperId+"_thumbUrl").value;}JSONdata.parentCommentId=(($(this._clipperId+"_parentCommentId").value!="0")?$(this._clipperId+"_parentCommentId").value:"0");JSONdata.id=((clipperAction=="add")?$(this._clipperId+"_parentContentId").value:$(this._clipperId+"_cid").value);ajaxInjector.setClipper(this);ajaxInjector.init(JSONdata);ajaxInjector.executeSubmit();},setPane:function(pane){if(this._pane!=pane){this._pane=pane;var scope=this;this._paneArray.all.each(function(h){if($(scope.getClipperId()+"_"+h)){$(scope.getClipperId()+"_"+h).hide();}});this._paneArray[pane].each(function(s){if($(scope.getClipperId()+"_"+s)){$(scope.getClipperId()+"_"+s).show();}});}if($(this.getClipperId()+"_clipperDebug")){$(this.getClipperId()+"_clipperDebug").innerHTML="Debug:: SOURCE: "+this.getSource()+", PANE: "+this._pane+", IS_EDIT: "+this.isEdit();}},getPane:function(){return this._pane;},displayClassificationList:function(){if($(this.getClipperId()+"_considerForTv").checked){$(this.getClipperId()+"_considerForTvClassificationList").show();}else{$$("#"+this.getClipperId()+"_clipper2 ul#"+this.getClipperId()+"_considerForTvClassificationList .considerForTvChoice").each(function(rad){rad.checked=false;});$(this.getClipperId()+"_considerForTvClassificationList").hide();}},setUserThumbnail:function(val){this._userThumbnail=val;},setStaff:function(bool){this._userStaff=bool;}};var Clipper2List=new Array();var Clipper2Static={setAssetValues:function(type,url,width,height,key){Clipper2.setAssetType(type,key);$(key+"_assetUrl").value=url;$(key+"_assetWidth").value=width;$(key+"_assetHeight").value=height;},setAssetType:function(type,key){$(key+"_assetType").value=((type==null||typeof type=="undefined"||type=="undefined")?"D":type);},setAssetFromVO:function(vo,key){if(vo==null){return ;}Clipper2Static.setAssetValues(vo.getType(),vo.getUrl(),vo.getWidth(),vo.getHeight(),key);},setAssetNull:function(key){Clipper2Static.setAssetValues("","",0,0,key);$(key+"_thumbUrl").value="";$(key+"_thumbUrlOld").value="";$(key+"_assetUrlOld").value="";},setContentUrl:function(url,key){$(key+"_contentUrl").value=url;},setContentText:function(text,key){$(key+"_contentText").value=text;},instance:function(key){return Clipper2List[key];},setInstance:function(inst,key){Clipper2List[key]=inst;},CONTEXT_FULL:"FULL",CONTEXT_COMMENT:"COMMENT",REQUIRED:["textClipSelect"]};Object.extend(Clipper2,Clipper2Static);Object.Event.extend(Clipper2);var ClipperAjaxInjector=Class.create({initialize:function(){this._isReply=false;this._itemPage=current.content.items.ItemPage.getInstance();this._assetDeleted=false;this._assetDisplay=null;},init:function(jsonData){this._data=jsonData;},setClipper:function(clipper){this._clipper=clipper;},getClipper:function(){return this._clipper;},setAction:function(action){this._action=action;},getAction:function(){return this._action;},executeSubmit:function(){if(this._data.assetDeleted){this._assetDeleted=true;delete this._data.assetDeleted;}var cclass="item";var cmethod="comment_post";this.setAction(this._data.action);if(this.getAction()=="edit"){cclass="comment";cmethod="comment_edit_post";}current.proxy.CCCP.execute(cclass,cmethod,this._data,this.__onClipperData.bindAsEventListener(this),this.__onClipperFail.bindAsEventListener(this));},__onClipperData:function(responseData){if(this.getAction()=="edit"){this.__onEditDataComplete(responseData);}else{this.__onResponseDataComplete(responseData);}Control.Modal.close();this.getClipper().cancel();},__onClipperFail:function(responseData){var errorMsg=new Element("li",{"class":"error",id:"commentError"}).update(current.locale.Bundle.get("verify.An_error_has_occurred"));if(this.getAction()=="edit"){var cEdit=current.content.items.CommentEdit.getInstance();cEdit.cancel();$(cEdit.getCommentContainer()).insert({after:errorMsg});setTimeout("Effect.Fade('commentError',{ duration: 2 })","5000");}else{$("itemResponseTitle").scrollTo();$("commentList").insert({top:errorMsg});setTimeout("Effect.Fade('commentError',{ duration: 2 })","5000");}Control.Modal.close();this.getClipper().cancel();},__onEditDataComplete:function(responseData){if(responseData.visibility!="VISIBLE"){return ;}var target=$("contentItem-"+responseData.id);this._isReply=((responseData.parentCommentId!="0")?true:false);if(this._data.assetUrl!=null&&this._data.assetUrl!=""){var assetLi=this._buildCommentAsset(responseData);if(assetLi!=null){if($(target).down(".commentAssetFill")){$(target).down(".commentAssetFill").replace(assetLi);}else{$(target).down(".heading").insert({after:assetLi});}}}if(this._assetDeleted&&$(target).down(".commentAssetFill")){$(target).down(".commentAssetFill").replace("");}var commentLi=this._buildCommentText(responseData);$(target).down(".commentText").replace(commentLi);this._itemPage.observeComments($("commentList"));},__onResponseDataComplete:function(responseData){var p=current.site.Page.getInstance();var u=current.User.getInstance();var target=((responseData.parentCommentId!="0")?"contentItem-"+responseData.parentCommentId:"commentList");this._isReply=((responseData.parentCommentId!="0")?true:false);var statusOK=true;var assetClass="";if(responseData.pageAsset!=null){assetClass=(responseData.pageAsset.assetType!=null)?responseData.pageAsset.assetType:"";}var liClass="contentItem "+assetClass+"Response response response_"+responseData.id;if(this._isReply){liClass+=" reply";}var li=new Element("li",{id:"contentItem-"+responseData.id,"class":liClass});var userIconDiv=new Element("div",{"class":"userIcon"});var userIconSize=((this._isReply)?40:60);var userIcon=new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+u.getUsername()+".htm"}).insert(new Element("img",{alt:u.getUsername(),width:userIconSize,height:userIconSize,src:current.Constants.getInstance().getDatanodeUrl()+this._data.userThumbnail+"_"+userIconSize+"x"+userIconSize+".jpg"}));userIconDiv.insert(userIcon);li.insert(userIconDiv);var ul=new Element("ul",{"class":"commentMain"});var headingLi=new Element("li",{"class":"heading"});var voteDiv=new Element("div",{"class":"vote"});var votingDiv=new Element("div",{id:"commentVoting_"+responseData.id,"class":"voting"});var voteAU=new Element("a",{href:"#commentVoteUp_"+responseData.id,"class":"Y Sprites voteUp comment id_"+responseData.id,rel:"{id: "+responseData.id+"}"});var voteAD=new Element("a",{href:"#commentVoteDown_"+responseData.id,"class":"N Sprites voteDown comment marginLeft id_"+responseData.id});var voteAC=new Element("a",{href:"#commentVoteShow_"+responseData.id,"class":"C Sprites voteShow comment id_"+responseData.id});votingDiv.insert(voteAU);votingDiv.insert(voteAD);votingDiv.insert(voteAC);var scoreDiv=new Element("div",{"class":"score neu"}).update("0");voteDiv.insert(votingDiv);voteDiv.insert(scoreDiv);headingLi.insert(voteDiv);var userLink=new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+u.getUsername()+".htm","class":"username"}).update(u.getUsername());headingLi.insert(userLink);if(this._data.userStaff=="staff"){var staff=new Element("span",{"class":"Sprites staffBadge"}).update("&nbsp;");headingLi.insert(staff);}var commentAnchor=new Element("a",{name:responseData.id,"class":"responseData",rel:"{id: '"+responseData.id+"', parentId: '"+responseData.parentContentId+"', parentCommentId: '"+responseData.parentCommentId+"', userId: '"+u.getId()+"', position: 0, readOnly: false, commentsLocked: false, rebuttalCount: 0, contentStatus: 'STATUS_OK'}",style:"height: 0; width: 0; color: #fff;"}).update("&nbsp;");headingLi.insert(commentAnchor);headingLi.insert(new Element("br",{"class":"clearBoth"}));ul.insert(headingLi);var assetLi=this._buildCommentAsset(responseData);if(assetLi!=null){ul.insert(assetLi);}var commentLi=this._buildCommentText(responseData);ul.insert(commentLi);var foot=new Element("li",{"class":"foot"});var commentTime=new Element("a",{"class":"commentTime",href:window.location.href.split("#")[0]+"#"+responseData.id}).insert(current.locale.Bundle.get("justNow"));var commentActions=new Element("span",{"class":"commentActions",style:"display: none;"});var interactMenu=new Element("ul",{"class":"responseInteractMenu commentInteract floatRight floatList"});var editLink=new Element("li").insert(new Element("a",{"class":"commentEditLink",href:"#",rel:"{cid: "+responseData.id+", pos: 0}"}).insert(current.locale.Bundle.get("edit")));var delLink=new Element("li").insert(new Element("a",{"class":"itemDeleteLink redLink",href:"#",rel:responseData.id}).insert(current.locale.Bundle.get("delete")));var flagLink=new Element("li",{"class":"last"}).insert(new Element("a",{"class":"flaggable defaultColor",href:"#flag",rel:responseData.id}).insert(current.locale.Bundle.get("flag")));var replySpan=new Element("span",{"class":"commentReply"});var replyIcon=new Element("span",{"class":"Sprites replyIconGreen"}).insert(" ");var replyLink=new Element("a",{"class":"replyable",href:"#",rel:"{id: "+responseData.id+", username: '"+u.getUsername()+"'}"});replyLink.insert(replyIcon);replyLink.insert(" "+current.locale.Bundle.get("item.reply"));replySpan.insert(replyLink);interactMenu.insert(editLink);interactMenu.insert(delLink);interactMenu.insert(flagLink);commentActions.insert(interactMenu);commentActions.insert(replySpan);foot.insert(commentTime);foot.insert(commentActions);ul.insert(foot);li.insert(ul);if(responseData.parentCommentId!="0"){$(target).insert({after:li});}else{if(this._itemPage.getCommentSort()=="oldest"){$(target).insert({bottom:li});$("contentItem-"+responseData.id).scrollTo();}else{$(target).insert({top:li});}}this._itemPage.observeComments($("commentList"));new Effect.Opacity($("contentItem-"+responseData.id),{from:0,to:1,duration:1});},_buildCommentAsset:function(responseData){if(responseData.pageAsset==null){return null;}if(responseData.pageAsset.assetType==null||responseData.pageAsset.assetType==""||responseData.pageAsset.assetType=="undefined"){return null;}if(responseData.pageAsset.assetUrl==null||responseData.pageAsset.assetUrl==""||responseData.pageAsset.assetUrl=="undefined"){return null;}var assetLiClass=((responseData.pageAsset.assetType=="V")?"commentAssetFill":"commentAssetFill commentAssetFillVideo");var assetLi=new Element("li",{"class":assetLiClass});if(responseData.pageAsset.assetType!="V"){var assetBanner=new Element("div",{"class":"commentAssetBanner"}).insert(current.locale.Bundle.get("clipper.media_is_being_processed"));assetLi.insert(assetBanner);}this._assetDisplay=null;var w1=530;var h1=298;if(responseData.pageAsset.width>0&&responseData.pageAsset.height>0){h1=parseInt(responseData.pageAsset.height*(w1/responseData.pageAsset.width));}if(h1>298){h1=298;w1=parseInt(responseData.pageAsset.width*(h1/responseData.pageAsset.height));}this._assetDisplay=new current.components.assets.AssetDisplay(responseData,w1,h1,530,298);this._assetDisplay.setAssetDivId("videoPlayback-"+responseData.id);this._assetDisplay.setMovieId("threadedCommentEmbed-"+responseData.id);this._assetDisplay.setAutoplay("false");this._assetDisplay.setDisableEndSlate("true");this._assetDisplay.setPageContext("itemcomments");this._assetDisplay.setSkipOverlay("false");this._assetDisplay.setAsset();assetLi.insert(this._assetDisplay.getAsset());return assetLi;},_buildCommentText:function(responseData){var commentLi=new Element("li",{"class":"commentText"});if(this._isReply){var replyLink=new Element("a",{href:"#"+responseData.parentCommentId,"class":"replyTo floatLeft"});var replyDiv=new Element("div",{"class":"Sprites replyIconGrey floatLeft"}).update("");replyLink.insert(replyDiv);replyLink.insert(responseData.parentUsername+":");commentLi.insert(replyLink);}var cText=responseData.contentText.replace(/(<([^>]+)>)/ig,"");cText=current.utils.Strings.autolinkUrls(cText);cText=cText.replace(/(\r\n|[\r\n])/g,"<br /> ");var content=new Element("p").insert(cText);commentLi.insert(content);return commentLi;}});Events.Clipper2={DATA:"data",SUBMIT:"submitted",DUP:"duplicate",ASSET:"newAsset",EDIT:"edit",EDIT_CANCEL:"editCancel"};Events.TabMenu={CHANGE:"tabChange",READY:"ready"};Events.Upload={START:"uploadInit",FAIL:"uploadFail",COMPLETE:"uploadComplete"};var EventTabStatic={CHANGE:"TAB_CHANGE"};var ClipperSourceMenu=Class.create({initialize:function(clipper,target){this._clipper=clipper;this._clipperId=this._clipper.getClipperId();this._form=clipper.getForm();this._target=target;},init:function(){this._menu=new current.components.menus.TabMenu(this._target,this._clipperId+"_input_internet");this._onMenuClick=this.onClick.bindAsEventListener(this);$(this._target).observe(current.components.menus.TabMenu.SWITCH,this._onMenuClick);var itemStr="#"+this._clipperId+"_clipper2 #"+this._target+' dd a[rel="tab"]';this._items=$$(itemStr);this._reverse=$H();var c=this._items.length;for(var i=0;i<c;i++){var item=this._items[i];this._reverse[this.getItemValue(item)]=item;}this.notify(Events.TabMenu.READY);},setLock:function(bool){var source=this._clipper.getSource();this._menu.setLock(bool);if(bool){this._items.each(function(item){if(item.target.gsub(this._clipperId+"_input_","")!==source){item.up("dd").addClassName("disabled");}});}else{this._items.each(function(item){item.up("dd").removeClassName("disabled");});}},isLocked:function(type){return $(this._clipperId+"_input_"+type+"Tab").hasClassName("disabled");},setSource:function(type){if(this._type==type){return ;}this._type=type;this._draw();},getSource:function(){return this._type;},getDisplayField:function(type){return this._clipperId+"_input_"+type;},getItemValue:function(item){return item.id.gsub(this._clipperId+"_input_","");},_draw:function(){this._items.invoke("up","dd").invoke("removeClassName","active");$(this._clipperId+"_input_"+this.getSource()+"Tab").addClassName("active");},_change:function(){this.notify(Events.TabMenu.CHANGE,{type:Events.TabMenu.CHANGE,sourceType:this._type});},onClick:function(event){var newType=this.getItemValue(this._menu.getActive());if(this.isLocked(newType)){return ;}if(newType===this._type){return ;}this.setSource(newType);this._change();}});Object.Event.extend(ClipperSourceMenu);current.stub("current.clipper");current.clipper.ClipperWindow=Class.create({initialize:function(event,posLeft,posTop){var p=current.site.Page.getInstance();var u=current.User.getInstance();this._pageId=p.getId();this._open=false;this._modalWidth="634";this._modalHeight="420";this._contentWidth="600";this._modalId="clipperWindow";this._el=current.utils.Compatibility.getEventElement(event);this._groupSlug=this._el.rel;this._edit=false;this._slug="";this._itemId=0;this._assignmentId=0;this._clipperTitle="";this._contentSource="";this._parentContentId="";this._parentCommentId="";this._context=Clipper2Static.CONTEXT_FULL;this._clipperContainer="accountModalForm";this._url="";var viewport=document.viewport.getDimensions();this._winWidth=viewport.width;this._winHeight=viewport.height;if(posLeft&&posTop){this._modalPosLeft=posLeft;this._modalPosTop=posTop;}else{this._modalPosLeft=this._el.cumulativeOffset()["left"];this._modalPosTop=this._el.cumulativeOffset()["top"];}if(this._modalPosLeft>(this._winWidth-983)/2+359){this._modalPosLeft=((this._winWidth-983)/2+359);}if(this._modalPosLeft<(this._winWidth-983)/2){this._modalPosLeft=(this._winWidth-983)/2;}},setEditString:function(edit){this._edit=edit;},setGroupSlug:function(slug){this._slug=slug;},setItemId:function(id){this._itemId=id;},setAssignmentId:function(id){this._assignmentId=id;},setClipperTitle:function(title){this._clipperTitle=title;},setContentSource:function(src){this._contentSource=src;},setContentUrl:function(url){this._url=url;},setParentContentId:function(parentContentId){this._parentContentId=parentContentId;},setParentCommentId:function(parentCommentId){this._parentCommentId=parentCommentId;},setContext:function(context){this._context=context;},init:function(){this._titleWidth=(this._contentWidth-20);this._bodyWidth=this._contentWidth;if(current.utils.Compatibility.isIE6Browser()){this._titleWidth=parseInt(parseInt(this._contentWidth)+parseInt(5));this._bodyWidth=parseInt(parseInt(this._contentWidth)+parseInt(25));}this._title=(!this._edit)?current.locale.Bundle.get("clipper.post_an_item"):current.locale.Bundle.get("clipper.edit_this_item");if(this._clipperTitle!=""){this._title=this._clipperTitle;}var wrapper='<div class="clipperModalTitle" style="width: '+this._titleWidth+'px"><a id="accountModalCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._title+'</div><div id="clipperModalBody" style="width: '+this._bodyWidth+'px;"><div id="accountModalForm"></div></div>';if(Prototype.Browser.IE){this._modalPosLeft=this._modalPosLeft+10;this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._modalPosLeft,offsetTop:this._modalPosTop,containerClassName:"accountModalContainer clipperModalContainer",overlayDisplay:false,width:this._modalWidth,height:this._modalHeight,closeButton:false,disableWindowObserver:true,afterOpen:this.__onModalLoaded.bindAsEventListener(this),beforeClose:this.__resetWindow.bindAsEventListener(this)});},__resetWindow:function(){this._open=false;this._draggable.destroy();document.__modalOpenL1__=false;},__onModalLoaded:function(){this._open=true;this._draggable=new Draggable("modal_container",{handle:"clipperModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});document.__modalOpenL1__=true;var ajaxString="/clipper.htm?modal=true";if(this._slug!=""){ajaxString=ajaxString+"&groupSlug="+this._slug;}if(this._itemId!=0){ajaxString=ajaxString+"&cid="+this._itemId;}if(this._url!=""){ajaxString=ajaxString+"&url="+this._url;}if(this._assignmentId!=""){ajaxString=ajaxString+"&assignmentId="+this._assignmentId;}if(this._contentSource!=""){ajaxString=ajaxString+"&contentSource="+this._contentSource;}if(this._parentContentId!=""){ajaxString=ajaxString+"&parentContentId="+this._parentContentId;}if(this._parentCommentId!=""){ajaxString=ajaxString+"&parentCommentId="+this._parentCommentId;}if(this._context!=""){ajaxString=ajaxString+"&context="+this._context;}new Ajax.Updater("accountModalForm",current.Constants.getInstance().getScriptName()+ajaxString,{method:"get",evalScripts:true,onComplete:this.__onAjaxLoaded.bindAsEventListener(this)});Control.Modal.container.setStyle({height:"auto"});$("accountModalCloseButton").observe("click",this.__onCloseClick.bindAsEventListener(this));},__onAjaxLoaded:function(){EventSelectors.start(EventSelectorRules);if(this._edit){$$("#clipperModalBody .clipper2 .itemDataForm .validate-isNotHint").each(function(c){$(c).setStyle({color:"#000"});});if($("c_"+this._itemId+"_commentCover")){$("c_"+this._itemId+"_commentCover").hide();}}},__onCloseClick:function(){this.__resetWindow();current.content.items.CommentEdit.getInstance().cancel();Control.Modal.close();}});var ContentItemVO=new Class.create({initialize:function(contentObj,displayDuplicateButtonLink){if(contentObj){this._assetUrl=(contentObj.pageAsset!=null)?contentObj.pageAsset.assetUrl:"";this._assetType=(contentObj.pageAsset!=null)?contentObj.pageAsset.assetType:null;this._url="/"+((contentObj.parentGroupSlug!=null)?contentObj.parentGroupSlug:"items")+"/"+contentObj.id+"_"+contentObj.slug+".htm";this._contentTitle=contentObj.contentTitle;this._contentText=(contentObj.contentText!=null)?contentObj.contentText:"";this._addedUserThumbnail=current.Constants.getInstance().getDatanodeUrl()+contentObj.addedUser.thumbnail;this._addedUsername=contentObj.addedUser.username;this._actionDate=contentObj.dateAdded;this._richCommentCount=contentObj.richCommentCount;this._id=contentObj.id;this._displayDuplicateButtonLink=displayDuplicateButtonLink;}else{this._assetUrl="";this._assetType="";this._url="";this._contentTitle="";this._contentText="";this._addedUserThumbnail="";this._addedUsername="";this._actionDate="";this._richCommentCount="";this._id="";this._displayDuplicateButtonLink=false;}},getDisplay:function(){var item=Builder.node("li",{id:this._id+"duplicateContentItem",className:"contentItem"});if(this._displayDuplicateButtonLink){var duplicateWarningButton=Builder.node("div",{className:"duplicateItemAsset"},Builder.node("a",{href:this._url,className:"Sprites thatsItButton"}));item.appendChild(duplicateWarningButton);}a=AssetFactory.getAsset({assetUrl:this._assetUrl,assetType:this._assetType});var duplicateThumb=Builder.node("div",{className:"contentItemAsset"});var assetLink=Builder.node("a",{href:this._url});assetLink.innerHTML=a.getDisplay();duplicateThumb.appendChild(assetLink);var actionDate=""+this._actionDate;actionDate=actionDate.substring(5,actionDate.length-6);var duplicateContent=Builder.node("div",{className:"contentItemBody"},[Builder.node("div",{className:"contentItemTitle"},[Builder.node("h2",{},[Builder.node("a",{href:this._url},[((this._contentTitle.length>50)?this._contentTitle.substring(0,50):this._contentTitle)])])]),Builder.node("div",{className:"contentItemDesc"},[((this._contentText.length>175)?this._contentText.substring(0,175):this._contentText)]),Builder.node("dl",{className:"userAttribution"},[Builder.node("dt",{},[Builder.node("span",{},[Builder.node("a",{href:"/users/"+this._addedUsername+".htm"},[Builder.node("img",{src:this._addedUserThumbnail+"_40x40.jpg",width:"20",height:"20"})])]),Builder.node("span",{className:"Sprites actionIcon submitActionIcon"})]),Builder.node("dd",{},[Builder.node("ul",{},[Builder.node("li",{className:"username"},[Builder.node("a",{href:"/users/"+this._addedUsername+".htm"},[this._addedUsername])]),Builder.node("li",{className:"actionString",style:"clear: none; padding-top: 0.1em;"}," added "),Builder.node("li",{className:"actionDate",style:"clear: none; border-left: 0;"},actionDate),Builder.node("li",{className:"responseCount",style:"clear: none;"},[Builder.node("span",{className:"Sprites actionIcon commentActionIcon"}),Builder.node("a",{href:this._url+"#comments"},[((this._richCommentCount===null||typeof this._richCommentCount==="undefined"||this._richCommentCount<0)?0:this._richCommentCount)+" "+current.locale.Bundle.get("comments")])])])])])]);item.appendChild(duplicateThumb);item.appendChild(duplicateContent);return item;},getClipper2Display:function(){var item=Builder.node("li",{id:this._id+"duplicateContentItem",className:"contentItem"});var url=(typeof this._url!="undefined"&&this._url!=null)?this._url:"#";var title=(typeof this._contentTitle!="undefined"&&this._contentTitle!=null)?this._contentTitle:" ";var duplicateContent=Builder.node("div",{className:"contentItemBody"},[Builder.node("div",{className:"contentItemTitle"},[Builder.node("h2",{},[Builder.node("a",{href:url},[((title.length>50)?title.substring(0,50):title)]),Builder.node("span",{className:"responseCount"},[Builder.node("a",{href:url+"#comments"},[((this._richCommentCount===null||typeof this._richCommentCount==="undefined"||this._richCommentCount<0)?0:this._richCommentCount)+" "+current.locale.Bundle.get("clipper.responses")])])])]),Builder.node("div",{className:"contentItemDesc"},[((this._contentText.length>100)?this._contentText.substring(0,100)+"...":this._contentText)])]);item.appendChild(duplicateContent);return item;}});LinkClip=Class.create(AbstractClip,{REQUIRED:["contentText","contentTitle","contentUrl","groupSlugs"],REQUIRED_COMMENT:["contentText","contentUrl"],initialize:function($super,type,target,clip){$super(type,target,clip);this._clipperId=this._clipper.getClipperId();this._assets=[];this._urls=new Array();this._hasList=false;this._assetList=this._clipperId+"_assetSelectionWindow";this._displayCount=4;this._lastFetchUrl=null;this._lastFetchUrls=new Array();this._isEditMode=false;this._curIndex=4;this._isOtherOpen=false;this._duplicateReturnNum=2;this._legacyUrlAdded=false;},init:function(){},show:function($super){$super();Clipper2.setContentUrl(this.getUrl(),this._clipperId);if(!isUndefined(this.getAsset())){this._clipper.getDisplay().getTarget().show();}Event.observe(this.getUrlField(),"focus",this.__onUrlFocus.bindAsEventListener(this));Event.observe(this.getUrlField(),"blur",this.__onUrlBlur.bindAsEventListener(this));Event.observe(this.getUrlField(),"keyup",this.__onUrlKeyPress.bindAsEventListener(this));if(this._clipper.isEdit()){this._lastFetchUrl=this.getUrl();this._lastFetchUrls[0]=this._lastFetchUrl;}this._clipper.setPane("main");},hide:function($super){$super();this._clipper.getDisplay().getTarget().hide();this._onHideDuplicateWarning();this._hideOtherMedia();if(this._parseUrlTimer!=null){clearTimeout(this._parseUrlTimer);}this._toggleThrobbers(1);},setUrl:function(url){if(isUndefined(url)){this._url="";}else{this._url=url;}},getUrl:function(){return this._url;},setLastFetchUrl:function(url){this._lastFetchUrl=url;this._lastFetchUrls[0]=url;},setLastFetchUrls:function(arr){this._lastFetchUrls=arr;},getType:function(){return LinkClip.TYPE;},setAssetType:function(type){$(this._clipperId+"_assetType").value=type;},setAssets:function(assets){this._assets=assets;},setAssetUrl:function(url){$(this._clipperId+"_assetUrl").value=url;},setSubmitButton:function(button){this._submitButton=button;},getSubmitButton:function(){return $(this._submitButton);},setUrlField:function(field){this._urlField=field;},getUrlField:function(){return $(this._urlField);},resetLinkClip:function(event){$(this._assetList).innerHTML="";this.__onUrlChange(event);this.setUrl("");this._urls=new Array();this._lastFetchUrl=null;this._lastFetchUrls=new Array();},setPageTitle:function(){if(this._assets.length<1){$(this._clipperId+"_clipperInputSubtitle").innerHTML=current.locale.Bundle.get("clipper.There_are_no_assets_available_from")+": "+this._urlString;}else{$(this._clipperId+"_clipperInputSubtitle").innerHTML=current.locale.Bundle.get("clipper.url(s)")+": "+this._urlString;}$(this._clipperId+"_clipperInputSubtitle").show();},setThrobber:function(el){this._throbber=el;},getThrobber:function(){return $(this._throbber);},setDuplicateReturnNum:function(value){this._duplicateReturnNum=value;},getDuplicateReturnNum:function(){return this._duplicateReturnNum;},setSubmitter:function(el){this._submitter=el;},getSubmitter:function(){return $(this._submitter);},setAssetUrlOld:function(src){$(this._clipperId+"_assetUrlOld").value=src;},_toggleThrobbers:function(state){switch(state){case 0:if(!this._isOtherOpen){this.getSubmitter().hide();this.getThrobber().show();}else{$(this._clipperId+"_assetChoiceProcessingCover").show();$(this._clipperId+"_throbber_assetChoice").show();}break;default:if(!this._isOtherOpen){this.getSubmitter().show();this.getThrobber().hide();}else{$(this._assetList).innerHTML="";$(this._clipperId+"_assetChoiceProcessingCover").hide();$(this._clipperId+"_throbber_assetChoice").hide();}break;}},_fetchAssets:function(url){$$("#"+this._clipperId+"_clipper2 whenFetched").each(function(node){node.hide();});this._toggleThrobbers(0);this._processing=true;this._urlString="";ClipperService.uberAssets(url,"1",this.__onUberAssetData.bind(this));},__onUberAssetData:function(data){if(this._clipper.getPane().indexOf("main")==-1){return ;}if($(this._clipperId+"_clipperInputSubtitle").up().next(".error")){$(this._clipperId+"_clipperInputSubtitle").up().next(".error").hide();}if(!data==null){Validation.throwError($(this._clipperId+"_clipperInputSubtitle").up(),current.locale.Bundle.get("clipper.error_urlNotFound"));this._toggleThrobbers(1);return ;}var metaDescription=$A(data[1]);var dups=$A(data[2]);var assets=$A(data[3]);if(dups.length>0&&this._context==="FULL"&&!this._isEditMode&&this._clipper.getOptions().view!="blog"){for(var i=0;i<dups.length;i++){var item=new ContentItemVO(dups[i],false);$(this._clipperId+"_duplicateWarningContentList").appendChild(item.getClipper2Display());}Effect.Appear(this._clipperId+"_duplicateWarning");this._dupeHideListener=this._onHideDuplicateWarning.bindAsEventListener(this);Event.observe($(this._clipperId+"_duplicateWarningCloseButton"),"click",this._dupeHideListener);}var a=null;var b=0;var c=assets.length;var d=0;var testUrl="";if(this._isEditMode&&this._clipper.getOptions().view!="blog"){a=this.getAsset();if(a&&a._width!=0&&a._height!=0){this._assets.push(a);testUrl=a.assetUrl;b++;}}for(i=0;i<c;i++){if(assets[i].assetUrl==testUrl){d=i;}assets[i].contentSource=LinkClip.TYPE;assets[i].assetLoaderId=this._clipperId;this._assets.push(AssetFactory.getAsset(assets[i]));}if(b==0&&c>0){d=this._assets.length-c;b=d;}if(this._urls.length<2){this._toggleThrobbers(1);}this._displayMoreLink(c-1);this.selectAssetByIndex(b);Clipper2.setContentUrl(this.getUrl(),this._clipperId);if(c<1){$(this._clipperId+"_assetListItem").hide();$(this._assetList).innerHTML="";}this._urlString=this._urlString+'<em class="primary">'+this.getUrl()+"</em>";if(this._urls.length<2){this._assets.push(AssetFactory.getAsset({assetType:AssetNone.TYPE,assetLoaderId:this._clipperId}));this.__onAssetWindowOpen();if($(this._clipperId+"_assetListItem")&&!Element.visible(this._clipperId+"_assetListItem")){Effect.Appear(this._clipperId+"_assetListItem");}if($(this._clipperId+"_addToPane")&&!this._clipper.isEdit()&&!Element.visible(this._clipperId+"_addToPane")){Effect.Appear(this._clipperId+"_addToPane");}$(this._clipperId+"_assetSelectListPrev").onclick=this._showAssetListPrev.bindAsEventListener(this);$(this._clipperId+"_assetSelectListNext").onclick=this._showAssetListNext.bindAsEventListener(this);this._processing=false;}else{var scope=this;this._urlsPopList=this._urls.clone();for(var i=1;i<this._urls.length;i++){scope._urlString=scope._urlString+", <em>"+scope._urls[i]+"</em>";ClipperService.pageAssets(scope._urls[i],scope.__onPageAssetData.bind(scope));}}},__onPageAssetData:function(data){if(this._clipper.getPane().indexOf("main")==-1){return ;}var assets=$A(data);var c=assets.length;for(i=0;i<c;i++){assets[i].contentSource=LinkClip.TYPE;assets[i].assetLoaderId=this._clipperId;this._assets.push(AssetFactory.getAsset(assets[i]));}this._urlsPopList.pop();if(this._urlsPopList.length==1){this._toggleThrobbers(1);this._assets.push(AssetFactory.getAsset({assetType:AssetNone.TYPE,assetLoaderId:this._clipperId}));this.__onAssetWindowOpen();$(this._clipperId+"_assetChoiceDisplay").up().show();if($(this._clipperId+"_assetListItem")&&!Element.visible(this._clipperId+"_assetListItem")){Effect.Appear(this._clipperId+"_assetListItem");}if($(this._clipperId+"_addToPane")&&!this._clipper.isEdit()&&!Element.visible(this._clipperId+"_addToPane")){Effect.Appear(this._clipperId+"_addToPane");}$(this._clipperId+"_assetSelectListPrev").onclick=this._showAssetListPrev.bindAsEventListener(this);$(this._clipperId+"_assetSelectListNext").onclick=this._showAssetListNext.bindAsEventListener(this);this._processing=false;}},_showAssetList:function(){if(this._clipper.getPane().indexOf("main")==-1){return ;}var c=this._assets.length;var link;var item;var a;for(var i=0;i<c;i++){item=Builder.node("li",{id:i+"assetHolder"},[link=Builder.node("a",{id:this.getAssetName(i),className:"embedConstrain",rel:i,onclick:"return false;"})]);a=this._assets[i];link.innerHTML=a.getDisplay();$(this._assetList).appendChild(item);link.onclick=this._onAssetClick.bindAsEventListener(this,i);if(i>=this._displayCount){$(i+"assetHolder").hide();}}if(!this._isEditMode&&c>0){$(this.getAssetName(0)).addClassName("selected");}if(this._isEditMode&&c>0){$(this.getAssetName(0)).addClassName("selected");}if(c>this._displayCount){$(this._clipperId+"_assetSelectListNext").setStyle({visibility:"visible"});}$(this._clipperId+"_assetSelectFromUrlPagination").show();var mediaCountMsg=new Template(current.locale.Bundle.get("clipper.x_of_x"));var mediaData={viewCount:(this._curIndex-this._displayCount+1)+"-"+(this._curIndex>=c?c:this._curIndex),totalCount:c};$(this._clipperId+"_assetSelectFromUrlPageRange").innerHTML=mediaCountMsg.evaluate(mediaData);},_showAssetListPrev:function(event){Event.stop(event);var c=this._assets.length;if(this._curIndex<=this._displayCount){return ;}this._curIndex=this._curIndex-this._displayCount;for(var i=0;i<c;i++){if($(i+"assetHolder")){$(i+"assetHolder").hide();}}for(var i=(this._curIndex-this._displayCount);i<this._curIndex;i++){if($(i+"assetHolder")){$(i+"assetHolder").show();}}if(this._curIndex-this._displayCount>0){$(this._clipperId+"_assetSelectListPrev").setStyle({visibility:"visible"});}else{$(this._clipperId+"_assetSelectListPrev").setStyle({visibility:"hidden"});}if(this._curIndex<c){$(this._clipperId+"_assetSelectListNext").setStyle({visibility:"visible"});}else{$(this._clipperId+"_assetSelectListNext").setStyle({visibility:"hidden"});}var mediaCountMsg=new Template(current.locale.Bundle.get("clipper.x_of_x"));var mediaData={viewCount:(this._curIndex-this._displayCount+1)+"-"+(this._curIndex),totalCount:c};$(this._clipperId+"_assetSelectFromUrlPageRange").innerHTML=mediaCountMsg.evaluate(mediaData);},_showAssetListNext:function(event){Event.stop(event);var c=this._assets.length;if(this._curIndex>=c){return ;}this._curIndex=this._curIndex+this._displayCount;for(var i=0;i<c;i++){if($(i+"assetHolder")){$(i+"assetHolder").hide();}}for(var i=(this._curIndex-this._displayCount);i<this._curIndex;i++){if($(i+"assetHolder")){$(i+"assetHolder").show();}}if(this._curIndex-this._displayCount>0){$(this._clipperId+"_assetSelectListPrev").setStyle({visibility:"visible"});}else{$(this._clipperId+"_assetSelectListPrev").setStyle({visibility:"hidden"});}if(this._curIndex<c){$(this._clipperId+"_assetSelectListNext").setStyle({visibility:"visible"});}else{$(this._clipperId+"_assetSelectListNext").setStyle({visibility:"hidden"});}var mediaCountMsg=new Template(current.locale.Bundle.get("clipper.x_of_x"));var mediaData={viewCount:(this._curIndex-this._displayCount+1)+"-"+(this._curIndex>=c?c:this._curIndex),totalCount:c};$(this._clipperId+"_assetSelectFromUrlPageRange").innerHTML=mediaCountMsg.evaluate(mediaData);},_displayMoreLink:function(count){var countOutput="";if(count>1){var optionCountMsg=new Template(current.locale.Bundle.get("clipper.x_moreOptions"));var optionData={viewCount:count};countOutput=optionCountMsg.evaluate(optionData);}},_onAssetClick:function(event,index){Event.stop(event);$$("#"+this._clipperId+"_clipper2 .selected").each(function(node){node.removeClassName("selected");});$(this.getAssetName(index)).addClassName("selected");this.selectAssetByIndex(index);},selectAssetByIndex:function(index){if(isUndefined(this._assets[index])||this._assets[index]===null){return ;}this.setAsset(this._assets[index]);this.notify(Events.Clipper2.ASSET,this.getAsset());this._clipper.getDisplay().setOutput(this.getAsset().getDisplay());this._clipper.getDisplay().show();},getAssetName:function(index){return(index+"assetSelect");},__onUrlChange:function(event){if(!isUndefined(event)){Event.stop(event);}Clipper2.setContentUrl("",this._clipperId);this._assets.clear();if($(this._clipperId+"_duplicateWarning").visible()){this._onHideDuplicateWarning();}},__onUrlSubmit:function(event){if(!isUndefined(event)&&event!==null){Event.stop(event);}var url=this._url;if(!url.startsWith("http://")){this.setUrl("http://"+url);}for(var i=0;i<this._urls.length;i++){if(!this._urls[i].startsWith("http://")){this._urls[i]="http://"+this._urls[i];}}var value=this.getUrl();if(!this._validate()){return ;}var nochange=0;for(var i=0;i<this._lastFetchUrls.length;i++){if(this._lastFetchUrls[i]!=this._urls[i]){nochange++;}}if(this._lastFetchUrls.length!=this._urls.length){nochange++;}if(nochange>0){this.__onUrlChange();this._lastFetchUrl=value;this._lastFetchUrls=this._urls.clone();this._fetchAssets(value);}},__onUrlFocus:function(event){if(this._clipper.getSource()!=LinkClip.TYPE){return ;}this.__onUrlKeyPress(event);},__onUrlBlur:function(event){if(this.getUrl()!==""&&this._clipper.getSource()==LinkClip.TYPE){this.__parseTextEntry();}},__onUrlKeyPress:function(event){if(this._clipper.getSource()!=LinkClip.TYPE){return ;}current.utils.Compatibility.adjustRows(this.getUrlField(),3);if(this.getUrlField().value!=""){clearTimeout(this._parseUrlTimer);this._parseUrlTimer=setTimeout("document.__"+this._clipperId+"_linkClip__.__parseTextEntry()",1000);}},_validate:function(){return true;Validation.reset(this.getUrlField());this.getUrlField().addClassName("required");this.getUrlField().addClassName("validate-url");var result=Validation.validate(this.getUrlField());if(result){this.getUrlField().removeClassName("required");this.getUrlField().removeClassName("validate-url");}return result;},_getNullAsset:function(){return'<img src="'+current.Constants.getInstance().getDatanodeUrl()+'" alt="doh" width="120" height="90" style="background-color: #ff0000;">';},_showOtherMedia:function(event){Event.stop(event);var i=new Control.Modal($(this._clipperId+"_assetChoiceLink"),{width:680,height:366,afterOpen:this.__onAssetWindowOpen.bind(this)});i.observe("afterClose",this._hideOtherMedia.bindAsEventListener(this));i.open();},__onAssetWindowOpen:function(){var mb=this._clipper.getDisplay();mb.hide();mb.setLock(true);$(this._clipperId+"_mostBestestListItem").hide();this._isOtherOpen=true;this._showAssetList();},_hideOtherMedia:function(event){if(!this._isOtherOpen){return ;}this._isOtherOpen=false;if(!isUndefined(event)){Event.stop(event);}var mb=this._clipper.getDisplay();mb.setLock(false);mb.show();$(this._clipperId+"_assetListItem").hide();$(this._clipperId+"_clipperInputSubtitle").hide();},_onHideDuplicateWarning:function(){$(this._clipperId+"_duplicateWarning").hide();Event.stopObserving($(this._clipperId+"_duplicateWarningCloseButton"),"click",this._dupHideListener);$(this._clipperId+"_duplicateWarningContentList").innerHTML="";},_displayAsset:function(){this._clipper.getDisplay().setOutput(this.getAsset().getDisplay());this._clipper.getDisplay().show();},_pushRecord:function(){if(!isUndefined(this._record.contentUrl)&&this._record.contentUrl!==null&&this._record.contentUrl!==""){this._isEditMode=true;this._record.assetLoaderId=this._clipperId;this.setAsset(AssetFactory.getAsset(Object.clone(this._record)));this.notify(Events.Clipper2.ASSET,this.getAsset());this._displayAsset();}if(!isUndefined(this._record.assetUrl)){this.setAssetUrlOld(this._record.assetUrl);}var url=this._record.contentUrl;if(!isUndefined(url)){this.setUrl(url);Clipper2.setContentUrl(this.getUrl(),this._clipperId);if(!this._isEditMode){this.__onUrlSubmit();}}},__onCancelEdit:function($super){$super();this.__onUrlChange();},validateText:function(){var testText=$(this._clipperId+"_contentText").value;var scope=this;for(var i=0;i<this._lastFetchUrls.length;i++){var testUrl=scope._lastFetchUrls[i];if(testUrl.indexOf("http://")!=-1){testUrl=testUrl.substring(7);}testText=testText.replace(testUrl,"");}testText=testText.replace(/http:\/\//g,"");testText=testText.replace(/^\s+|\s+$/g,"");if(!testText.match(/\w/)){var advice=$(this._clipperId+"_contentText").up().down(".validation-advice");if(!advice||!advice.visible()){Validation.throwError($(this._clipperId+"_contentText"),current.locale.Bundle.get("clipper.We_need_a_description"));}return false;}else{var advice=$(this._clipperId+"_contentText").up().down(".validation-advice");if(advice){advice.hide();}return true;}},__parseTextEntry:function(){clearTimeout(this._parseUrlTimer);var text=(this._clipper.getOptions().view!="blog")?this.getUrlField().value:this.getUrlField().value.replace(/&amp;/g,"&");var url=$(this._clipperId+"_contentUrl").value.strip();this._urls=current.utils.Strings.extractUrlsFromText(text);this._urls=current.utils.Strings.removeDuplicateElements(this._urls);var maxNoOfUrls=(this._clipper.getOptions().view!="blog")?5:12;if(this._urls!=null&&this._urls.length>0){this._url=this._urls[0];var urlTest=((this._url.indexOf("http://")==-1)?"http://"+this._url:this._url).strip();if(this._urls.length>maxNoOfUrls){this._urls.length=maxNoOfUrls;}this.__onUrlSubmit();}else{if(!this._clipper.isEdit()){if(this._assets==null||this._assets.length==0){$(this._clipperId+"_assetListItem").hide();$(this._clipperId+"_clipperInputSubtitle").hide();}}if($(this._clipperId+"_clipperDebug")){$(this._clipperId+"_clipperDebug").innerHTML="Debug:: SOURCE: "+this._clipper.getSource()+", PANE: "+this._clipper.getPane()+", IS_EDIT: "+this._clipper.isEdit();}}},parseTextEntry:function(){if(this._assets&&this._assets.length>0){this._isOtherOpen=true;if($(this._clipperId+"_assetListItem")&&!Element.visible(this._clipperId+"_assetListItem")){Effect.Appear(this._clipperId+"_assetListItem");}if($(this._clipperId+"_addToPane")&&!this._clipper.isEdit()&&!Element.visible(this._clipperId+"_addToPane")){Effect.Appear(this._clipperId+"_addToPane");}}this.__parseTextEntry();}});LinkClip.TYPE="internet";var MostBestest=Class.create({initialize:function(target){this._target=target;this.hide();},show:function(){if(this.isLocked()){return ;}this.getTarget().show();},hide:function(lock){if(this.isLocked()){return ;}if(!isUndefined(lock)&&lock!==null){this.setLock(lock);}this.getTarget().hide();},setLock:function(bool){this._lock=bool;},isLocked:function(){return this._lock;},setOutput:function(html){this.getTarget().update(html);},clear:function(){this.getTarget().update("");},setMode:function(str){if(str==this._mode){return ;}this._mode=str;},getMode:function(){return this._mode;},getTarget:function(){return $(this._target);},setImage:function(img,width,height){var w="";if(width!=null){w="width: "+width+"px";}var h="";if(height!=null){h=(width!=null)?"; height: "+height+"px":"height: "+height+"px";}this.setOutput('<img src="'+img+'" alt="" style=" '+w+h+'"/>');}});Object.Event.extend(MostBestest);TextClip=Class.create(AbstractClip,{REQUIRED:["contentText","contentTitle","groupSlugs"],REQUIRED_COMMENT:["contentText"],initialize:function($super,type,target,clipper){$super(type,target,clipper);},init:function($super){this._clipper.setActiveClip(this);this._clipperId=this._clipper.getClipperId();Event.observe(this.getTextField(),"blur",this.__onTextBlur.bindAsEventListener(this));Event.observe(this.getTextField(),"focus",this.__onTextFocus.bindAsEventListener(this));Event.observe(this.getTextField(),"keyup",this.__onTextKeyUp.bindAsEventListener(this));},show:function($super){$super();this._clipper.getDisplay().hide();this._clipper.setPane("main");},hide:function($super){$super();if(this._parseTextTimer!=null){clearTimeout(this._parseTextTimer);}},getType:function(){return TextClip.TYPE;},setTextField:function(field){this._textField=field;},getTextField:function(){return $(this._textField);},setAssetUrlOld:function(src){$(this._clipperId+"_assetUrlOld").value=src;},__onSubmit:function($super){var _r=$super();this._clipper.setSource("text");return _r;},__onTextBlur:function(){if(!this._clipper.isEdit()&&this._clipper.getSource()==TextClip.TYPE){var text=this.getTextField().value;if(text!==""){this.__parseTextEntry();}}},__onTextFocus:function(event){if(!current.User.getInstance().isLoggedIn()||!current.User.getInstance().isEmailVerified()){return ;}if(this._clipper.getSource()!=TextClip.TYPE){return ;}if($(this._clipperId+"_commentCover")){$(this._clipperId+"_commentCover").hide();$(this._clipperId+"_clipperMenuMain").removeClassName("commentCoverListItem");}this.__onTextKeyUp(event);},__onTextKeyUp:function(event){if(this._clipper.getSource()!=TextClip.TYPE){return ;}current.utils.Compatibility.adjustRows(this.getTextField(),3);if(this.getTextField().value!=""){clearTimeout(this._parseTextTimer);this._parseTextTimer=setTimeout("document.__"+this._clipperId+"_textClip__.__parseTextEntry()",1000);}},__parseTextEntry:function(){clearTimeout(this._parseTextTimer);if(this._clipper.getIsTextOnly()){return ;}var text=this.getTextField().value;var urls=current.utils.Strings.extractUrlsFromText(text);if(urls!=null&&urls.length>0&&!this._clipper.isEdit()){if(!this._clipper.getAssetLoaded()){this._clipper.forceSourceChange(LinkClip.TYPE);this._clipper.getClip(LinkClip.TYPE).parseTextEntry();}}else{$(this._clipperId+"_assetListItem").hide();if(this._clipper.getSource()!=TextClip.TYPE){this._clipper.forceSourceChange(TextClip.TYPE);}}if($(this._clipperId+"_addToPane")&&!this._clipper.isEdit()&&!Element.visible(this._clipperId+"_addToPane")){Effect.Appear(this._clipperId+"_addToPane");}},parseTextEntry:function(){if(Element.visible(this._clipperId+"_assetListItem")){this._isOtherOpen=true;if($(this._clipperId+"_assetListItem")&&!Element.visible(this._clipperId+"_assetListItem")){Effect.Appear(this._clipperId+"_assetListItem");}if($(this._clipperId+"_addToPane")&&!this._clipper.isEdit()&&!Element.visible(this._clipperId+"_addToPane")){Effect.Appear(this._clipperId+"_addToPane");}}this.__parseTextEntry();},_displayAsset:function(){this._clipper.getDisplay().setOutput(this.getAsset().getDisplay());this._clipper.getDisplay().show();},_pushRecord:function(){if(!isUndefined(this._record.assetUrl)&&this._record.assetUrl!==null&&this._record.assetUrl!==""){this._isEditMode=true;this._record.assetLoaderId=this._clipperId;this.setAssetUrlOld(this._record.assetUrl);this.setAsset(AssetFactory.getAsset(Object.clone(this._record)));this.notify(Events.Clipper2.ASSET,this.getAsset());this._displayAsset();}}});TextClip.TYPE="text";UploadClip=Class.create(AbstractClip,{WIDTH:306,HEIGHT:26,REQUIRED:["contentText","contentTitle","groupSlugs","assetUrl","assetType"],REQUIRED_COMMENT:["contentText","assetUrl","assetType"],initialize:function($super,type,target,clipper){$super(type,target,clipper);this._clipperId=this._clipper.getClipperId();this._uploaded=false;this.PATH_PREFIX=current.Constants.getInstance().getSwfDatanodeUrl();this.SWF_PATH=current.utils.Url.getVersionedUrl("/swf/current/FileUploader.swf");this.PATH=this.PATH_PREFIX+this.SWF_PATH;this.INSTALL_PATH=current.utils.Url.getVersionedUrl("/swf/barca/expressinstall.swf");this.SWF_NAME="FileUploader";this._loaded=false;this._fileFilterType="Images";this._imageTypes="*.jpeg;*.jpg;*.gif;*.png;*.tiff;*.tif;*.bmp";this._videoTypes="";this.BYTES_MAX=(1024*1024);this._thumbUploaded=false;this._thumbLoaded=false;this._special=false;this.THUMB_SWF_NAME="ThumbnailUploader";},init:function(){this._swf=new SWFObject(this.PATH,this.SWF_NAME,this.WIDTH,this.HEIGHT,"9","#FFFFFF");if(this.isSpecial()){this._fileFilterType+="/SWFs";this._videoTypes+=";*.swf";this._swf.addVariable("specialUrl",this.getUploadPath()+this._s());}var upClip="document.__"+this._clipperId+"_uploadClip__";this._swf.addVariable("datanode",current.Constants.getInstance().getSwfDatanodeUrl());this._swf.addVariable("locale",current.Constants.getInstance().getLocale());this._swf.addVariable("uploadURL",this.getUploadPath());this._swf.addVariable("fileFilterType",this._fileFilterType);this._swf.addVariable("fileFilters",encodeURIComponent(this._imageTypes+this._videoTypes));this._swf.addVariable("bytesMax",this.BYTES_MAX);this._swf.addVariable("onUploadDataCallback",upClip+".onUploadData");this._swf.addVariable("onCompleteCallback",upClip+".onComplete");this._swf.addVariable("onUploadFailedCallBack",upClip+".onUploadFailed");this._swf.addVariable("onUploadSizeFailedCallBack",upClip+".onUploadSizeFailed");this._swf.addVariable("onUploadBeginCallback",upClip+".onUploadBegin");this._swf.addVariable("onUploadBrowseFailedCallback",upClip+".onBrowseFailed");this._swf.addParam("wmode","window");this._swf.addParam("allowscriptaccess","always");this._swf.useExpressInstall(this.INSTALL_PATH);this._swf_thumb=new SWFObject(this.PATH,this.THUMB_SWF_NAME,this.WIDTH,this.HEIGHT,"9","#FFFFFF");this._swf_thumb.addVariable("uploadURL",this.getUploadPath());this._swf_thumb.addVariable("fileFilterType","Images");this._swf_thumb.addVariable("fileFilters",encodeURIComponent(this._imageTypes));this._swf_thumb.addVariable("bytesMax",this.BYTES_MAX);this._swf_thumb.addVariable("onUploadDataCallback",upClip+".onThumbUploadData");this._swf_thumb.addVariable("onUploadFailedCallBack",upClip+".onThumbUploadFailed");this._swf_thumb.addVariable("onUploadSizeFailedCallBack",upClip+".onThumbUploadSizeFailed");this._swf_thumb.addVariable("onUploadBeginCallback",upClip+".onThumbUploadBegin");this._swf_thumb.addVariable("onUploadBrowseFailedCallback",upClip+".onThumbBrowseFailed");this._swf_thumb.addParam("wmode","window");this._swf_thumb.addParam("allowscriptaccess","always");this._swf_thumb.useExpressInstall(this.INSTALL_PATH);},getSwf:function(){return $(this.SWF_NAME);},getSwfTarget:function(){return $(this._clipperId+"_uploadSwfHolder");},getThumbSwf:function(){return $(this.THUMB_SWF_NAME);},getThumbSwfTarget:function(){return $(this._clipperId+"_uploadThumbSwfHolder");},getUploadPath:function(){return this._uploadPath;},setUploadPath:function(path){this._uploadPath=path;},setVideoUpload:function(){this._fileFilterType+="/Videos";this._videoTypes=";*.avi;*.mpg;*.wmv;*.asf;*.mpeg;*.mov;*.flv;*.m4v;*.3gp;*.3gpp;*.3g2;*.mp4";this.BYTES_MAX=this.BYTES_MAX*1024;},getType:function(){return UploadClip.TYPE;},show:function($super){$super();Clipper2.setContentUrl("",this._clipperId);if(!this._loaded){this._swf.write(this.getSwfTarget());if(Prototype.Browser.IE){path=this._clipper.getForm();window[this.SWF_NAME]=path[this.SWF_NAME];}}if(!this._thumbLoaded){this._swf_thumb.write(this.getThumbSwfTarget());if(Prototype.Browser.IE){path=this._clipper.getForm();window[this.THUMB_SWF_NAME]=path[this.THUMB_SWF_NAME];}}if(!this._isEditMode){$(this._clipperId+"_considerForTvHolder").show();}if(this._clipper.getOptions().mode!="edit"){$(this._clipperId+"_considerForTvHolder").show();}else{$(this._clipperId+"_considerForTvHolder").hide();}$$("#"+this._clipperId+"_clipper2 .subMenuLink").each(function(sub){$(sub).removeClassName("active");});$(this._clipperId+"_input_uploadAsset").addClassName("active");if(this._clipper.getOptions().mode!="edit"){this.revealUploadSWF();this._clipper.displayClassificationList();this.hideThumbSelector();this._clipper.setPane("upload");this._clipper.getNextButton().disable();this._clipper.getNextButton().addClassName("lgDisabledButton");}else{this._clipper.setPane("main+");}},hide:function($super){$super();$(this._clipperId+"_considerForTvHolder").hide();if($(this._clipperId+"_clipperCreditListItem")){$(this._clipperId+"_clipperCreditListItem").hide();}},_displayAsset:function(){var mostBestest=this._clipper.getDisplay();$(this._clipperId+"_assetSizePicker").hide();switch(this.getAsset().getType()){case AssetImage.TYPE:mostBestest.setOutput(this.getAsset().getDisplay());if(!this._isEditMode){this.setThumbUrl("");}break;case AssetSwf.TYPE:this.hideThumbSelector();var img=current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/thumbnailing/image_transcode_120x90.gif";if(this._record.transcodeStatus==1){img=this._record.thumbUrl+"_200x150.jpg";}mostBestest.setImage(img,120,90);this._doSizeShow();break;case AssetVideo.TYPE:var img=current.Constants.getInstance().getDatanodeUrl()+"/images/current/placeholders/transcoding/transcode_120x90.gif";if(this._record.transcodeStatus==1){img=this._record.thumbUrl+"_200x150.jpg";}mostBestest.setImage(img,120,90);this.revealThumbSelector();break;}$(this._clipperId+"_mostBestestListItem").show();mostBestest.show();this._clipper.getNextButton().removeClassName("lgDisabledButton");this._clipper.getNextButton().enable();},_doSizeShow:function(){$(this._clipperId+"_assetSizePicker").show();if(this._sizeListener==null){this._sizeListener=this.__onSizeClick.bindAsEventListener(this);$$("#"+this._clipperId+"_assetSizePicker input").invoke("observe","click",this._sizeListener);}},__onSizeClick:function(event){var i=event.findElement("input").value;if(i==-1){return ;}var d=i.split("x");this._asset.setWidth(d[0]);this._asset.setHeight(d[1]);Clipper2.setAssetDimensions(d[0],d[1]);},_pushRecord:function(){if(!isUndefined(this._record.assetUrl)&&this._record.assetUrl!==null&&this._record.assetUrl!==""){this._isEditMode=true;$(this._clipperId+"_uploadSwfHolder").hide();$(this._clipperId+"_vecta").hide();this._addReuploadMessage();if(!isUndefined(this._record.thumbUrl)&&this._record.thumbUrl!=""){this.setThumbUrlOld(this._record.thumbUrl);this.hideThumbSWF();this._addReuploadThumbMessage();}if(!isUndefined(this._record.assetUrl)){this.setAssetUrlOld(this._record.assetUrl);}if(this._record.transcodeStatus==1&&this._record.assetType=="V"&&(this._record.contentUrl!=null&&this._record.contentUrl!="")){this._record.contentUrl="";}if(this._record.assetType=="S"){$((this._record.assetHeight==250)?this._clipperId+"_assetSizeSelectDisplay":this._clipperId+"_assetSizeSelectOverlay").checked=true;}this._record.assetLoaderId=this._clipperId;this.setAsset(AssetFactory.getAsset(Object.clone(this._record)));this.notify(Events.Clipper2.ASSET,this.getAsset());$(this._clipperId+"_considerForTvHolder").hide();this._displayAsset();}if(this._record.considerForTv!=null&&this._record.considerForTv){$(this._clipperId+"_considerForTvPrevious").value="true";$(this._clipperId+"_considerForTv").checked=true;$(this._clipperId+"_considerForTvClassificationList").show();}$(this._clipperId+"_considerForTv").value="true";},revealUploadSWF:function(event){if(!isUndefined(event)){Event.stop(event);}if(this.getReuploadMessage()){this.getReuploadMessage().remove();}$(this._clipperId+"_uploadSwfHolder").show();this._clipper.getDisplay().hide();},revealThumbSWF:function(event){if(event){Event.stop(event);}if(this.getReuploadThumbMessage()){this.getReuploadThumbMessage().remove();}this.setThumbUrl("");$(this._clipperId+"_uploadThumbSwfHolder").show();$(this._clipperId+"_thumbCTA").show();},hideThumbSWF:function(){$(this._clipperId+"_uploadThumbSwfHolder").hide();$(this._clipperId+"_thumbCTA").hide();},hideThumbSelector:function(event){if(event){Event.stop(event);}$(this._clipperId+"_uploadThumbHolder").hide();},revealThumbSelector:function(event){if(event){Event.stop(event);}if($(this._clipperId+"_thumbUrl").value!=""){this.hideThumbSWF();}else{this.revealThumbSWF();}$(this._clipperId+"_uploadThumbHolder").show();},setReuploadMessage:function(message){this._reuploadMessage=message;},getReuploadMessage:function(){return $(this._reuploadMessage);},_addReuploadMessage:function(){var uploadToggle=Builder.node("div",{id:"uploadToggle",className:"uploadToggle",style:"width: 298px;"},[Builder.node("a",{id:"reuploadMessageLink",href:"#",onclick:"return false;"},current.locale.Bundle.get("clipper.SelectNewFile")),"."]);this.setReuploadMessage("uploadToggle");if(!$("uploadToggle")){$(this._clipperId+"_uploadSwfHolder").up().appendChild(uploadToggle);}$("reuploadMessageLink").onclick=this.revealUploadSWF.bindAsEventListener(this);},setReuploadThumbMessage:function(message){this._reuploadThumbMessage=message;},getReuploadThumbMessage:function(){return $(this._reuploadThumbMessage);},_addReuploadThumbMessage:function(){var uploadThumbToggle=Builder.node("div",{id:"uploadThumbToggle",className:"uploadToggle"},[Builder.node("a",{id:"reuploadThumbMessageLink",href:"#",onclick:"return false;"},current.locale.Bundle.get("clipper.SelectNewThumbnail")),". "]);this.setReuploadThumbMessage("uploadThumbToggle");if(!$("uploadThumbToggle")){$(this._clipperId+"_uploadThumbSwfHolder").up().appendChild(uploadThumbToggle);}$("reuploadThumbMessageLink").onclick=this.revealThumbSWF.bindAsEventListener(this);},onComplete:function(data){},onUploadData:function(data){var uploadVars=data.toQueryParams();if(uploadVars.status!="success"){this.onUploadFailed(uploadVars);return ;}this._hideErrors(this.SWF_NAME);this.setAsset(AssetFactory.getAsset({assetType:uploadVars.assetType,assetUrl:uploadVars.assetUrl,contentSource:UploadClip.TYPE,transcodeStatus:0,assetLoaderId:this._clipperId}));this.notify(Events.Clipper2.ASSET,this._asset);this._displayAsset();if(uploadVars.assetType=="I"){this.setThumbUrl("");this.hideThumbSelector();}},onUploadBegin:function(s){if(this._failedNotice!=null){this._failedNotice.remove();this._failedNotice=null;}},onUploadFailed:function(data){var uploadVars=data.toQueryParams();this._hideErrors(this.SWF_NAME);if(uploadVars.status=="badmedia"){Validation.throwError($(this.SWF_NAME).up(),current.locale.Bundle.get("clipper.error_badFileFormat"));return ;}else{Validation.throwError($(this.SWF_NAME).up(),current.locale.Bundle.get("clipper.error_uploadClipValidation"));return ;}},onUploadSizeFailed:function(){if(this._failedNotice==null){var sib=($(this.SWF_NAME).up().siblings()[0])?$(this.SWF_NAME).up().siblings()[0]:$(this.SWF_NAME).up();if(this._context!="COMMENT"){this._failedNotice=Validation.throwError(sib,current.locale.Bundle.get("clipper.error_uploadClipTooLargeAdvLink"));}else{this._failedNotice=Validation.throwError(sib,current.locale.Bundle.get("clipper.error_uploadClipTooLarge"));}}},onBrowseFailed:function(){Validation.throwError($(this.SWF_NAME).up(),current.locale.Bundle.get("clipper.error_uploadClipInvalid"));},setThumbUrl:function(src){$(this._clipperId+"_thumbUrl").value=src;},setThumbUrlOld:function(src){$(this._clipperId+"_thumbUrlOld").value=src;},setAssetUrlOld:function(src){$(this._clipperId+"_assetUrlOld").value=src;},_s:function(){return"?swf=ok";},onThumbUploadData:function(data){var uploadThumbVars=data.toQueryParams();if(uploadThumbVars.status!="success"){this.onThumbUploadFailed(uploadVars);return ;}this._hideErrors(this.THUMB_SWF_NAME);this.setThumbUrl(uploadThumbVars.assetUrl);},onThumbUploadBegin:function(s){if(this._failedNotice!=null){this._failedNotice.remove();this._failedNotice=null;}},onThumbUploadFailed:function(data){var uploadThumbVars=data.toQueryParams();this._hideErrors(this.THUMB_SWF_NAME);if(uploadThumbVars.status=="badmedia"){Validation.throwError($(this.THUMB_SWF_NAME).up(),current.locale.Bundle.get("clipper.error_badFileFormat"));return ;}else{Validation.throwError($(this.THUMB_SWF_NAME).up(),current.locale.Bundle.get("clipper.error_uploadClipValidation"));return ;}},onThumbBrowseFailed:function(){Validation.throwError($(this.THUMB_SWF_NAME).up(),current.locale.Bundle.get("clipper.error_uploadClipInvalid"));},_hideErrors:function(id){if($(id).up().next(".error")){$(id).up().next(".error").hide();}},isSpecial:function(){var p=$H(window.location.search.toQueryParams());return((p.get("assignmentId")!=null&&p.get("assignmentId")==88749635||(this._record.assetType==AssetSwf.TYPE)));},__onSubmit:function($super){var n=$(this._clipperId+"_assetSizeSelectDisplay");if(this._asset.getType()==AssetSwf.TYPE&&(this._asset.getWidth()==0||this._asset.getHeight()==0)){n.addClassName("required");result=Validation.validate(n,{useTitle:false});n.removeClassName("required");return false;}n=($(this._clipperId+"_specialTerms"))?$(this._clipperId+"_specialTerms"):null;if((($(this._clipperId+"_clipper_itemType_vcam")&&$(this._clipperId+"_clipper_itemType_vcam").checked)||($(this._clipperId+"_clipper_itemType_other_sponsor")&&$(this._clipperId+"_clipper_itemType_other_sponsor").checked))&&n!=null&&!n.checked){n.addClassName("required");result=Validation.validate(n,{useTitle:true});n.removeClassName("required");return false;}return $super();},parseTextEntry:function(){}});UploadClip.TYPE="upload";var WebcamClip=Class.create(AbstractClip,{SWF_NAME:"webcam_recorder",WIDTH:328,HEIGHT:302,REQUIRED:["contentTitle","contentText","groupSlugs","assetUrl","assetType"],SETTINGS:{recordBandwidth:0,recordQuality:80,fps:20,keyFrameInterval:30,resolutionWidth:320,resolutionHeight:240,recordTimeLimit:(60*1000),favorArea:"false",forceAutoDetect:"false"},SETTINGS_AUDIO:{silenceLevel:0,silenceTimeout:1000,audioRate:11,audioGain:50},REQUIRED_COMMENT:["contentText","assetUrl","assetType"],initialize:function($super,type,target,clipper){$super(type,target,clipper);this._clipperId=this._clipper.getClipperId();this.PATH_PREFIX=current.Constants.getInstance().getSwfDatanodeUrl();this.SWF_PATH=current.utils.Url.getVersionedUrl("/swf/current/WebcamRecorder.swf");this.PATH=this.PATH_PREFIX+this.SWF_PATH;this._recordTimeLimit=60;this.loaded=false;},init:function(){this._swf=new SWFObject(this.PATH,this.SWF_NAME,this.WIDTH,this.HEIGHT,"9.0","#333333");Object.extend(this.SETTINGS,this.SETTINGS_AUDIO);for(var key in this.SETTINGS){this._swf.addVariable(key,this.SETTINGS[key]);}this._swf.addVariable("datanode",current.Constants.getInstance().getSwfDatanodeUrl());this._swf.addVariable("locale",current.Constants.getInstance().getLocale());this._swf.addVariable("onComplete","current_webcamRecordComplete");this._swf.addVariable("onRestart","current_webcamRecordRestart");this._swf.addVariable("myUserId",current.User.getInstance().getId());this._swf.addParam("wmode","window");this._swf.addParam("allowScriptAccess","always");},getSwfTarget:function(){var t=this._target.down(1);return t;},initializeSwf:function(){this._swf.addVariable("playbackUrl",this.getPlaybackUrl());this._swf.addVariable("recordUrl",this.getRecordUrl());this._swf.write($(this._clipper.getClipperId()+"_webcamSwfHolder"));if(Prototype.Browser.IE){path=this._clipper.getForm();window[this.SWF_NAME]=path[this.SWF_NAME];}},show:function($super){$super();if(!this.loaded&&!this._isEditMode){this.initializeSwf();}else{}$$("#"+this._clipperId+"_clipper2 .subMenuLink").each(function(sub){$(sub).removeClassName("active");});$(this._clipper.getClipperId()+"_input_webcamAsset").addClassName("active");this._clipper.setPane("webcam");this._clipper.getNextButton().addClassName("lgDisabledButton");this._clipper.getNextButton().disable();document.__currentClipperId__=this._clipperId;},hide:function($super){$super();document.__currentClipperId__="";},setRecordTimeLimit:function(recordTimeLimit){this._recordTimeLimit=recordTimeLimit;},setPlaybackUrl:function(playbackUrl){this._playbackUrl=playbackUrl;},getPlaybackUrl:function(){return this._playbackUrl;},setRecordUrl:function(recordUrl){this._recordUrl=recordUrl;},getRecordUrl:function(){return this._recordUrl;},getType:function(){return WebcamClip.TYPE;},setAssetUrlOld:function(src){$(this._clipperId+"_assetUrlOld").value=src;},onComplete:function(videoUrl){Clipper2.setContentUrl("",this._clipperId);this.setAsset(AssetFactory.getAsset({contentSource:WebcamClip.TYPE,assetType:AssetVideo.TYPE,assetUrl:this._playbackUrl+videoUrl,assetLoaderId:this._clipperId}));this.notify(Events.Clipper2.ASSET,this._asset);this._displayAsset();},onRestart:function(){Clipper2.setAssetNull(this._clipperId);},_displayAsset:function(){var img=current.Constants.getInstance().getDatanodeUrl()+"/images/barca/white/placeholders/transcoding/transcode_120x90.gif";if(this._record.transcodeStatus==1){img=this._record.thumbUrl+"_200x150.jpg";}mostBestest=this._clipper.getDisplay();mostBestest.setImage(img,120,90);mostBestest.show();this._clipper.getNextButton().removeClassName("lgDisabledButton");this._clipper.getNextButton().enable();},_addRerecordMessage:function(){var message=Builder.node("div",{id:"rerecordMessage",className:"floatLeft twelvePoint",style:"clear: both; padding: 1em 0;"},[Builder.node("a",{id:"rerecordMessageLink",href:"#",onclick:"return false;"},current.locale.Bundle.get("clipper.reRecordYourVideo")),"."]);this.setRerecordMessage("rerecordMessage");if(!$("rerecordMessage")){this.getTarget().appendChild(message);}$("rerecordMessageLink").onclick=this.rerecord.bindAsEventListener(this);},rerecord:function(event){Event.stop(event);Element.remove(this.getRerecordMessage());this._clipper.getDisplay().hide();this.getSwfTarget().show();this.initializeSwf();},setRerecordMessage:function(message){this._rerecordMessage=message;},getRerecordMessage:function(){return $(this._rerecordMessage);},_pushRecord:function(){if(this._record.mode=="contentSource"){return ;}if(!isUndefined(this._record.assetUrl)){this.setAssetUrlOld(this._record.assetUrl);}this._isEditMode=true;this.getSwfTarget().hide();this._addRerecordMessage();this._record.assetLoaderId=this._clipperId;this.setAsset(AssetFactory.getAsset(Object.clone(this._record)));this.notify(Events.Clipper2.ASSET,this.getAsset());this._displayAsset();},parseTextEntry:function(){}});WebcamClip.TYPE="webcam";current.stub("current.proxy.");current.proxy.CCCP={execute:function(service,method,params,callback,failback,httpMethod){if((params!=null)&&!isUndefined(params.action)){params.callAction=params.action;delete params.action;}var query=(params!=null)?"?"+Object.toQueryString(params):"";new Ajax.Request(current.Constants.getInstance().getProxyUrl()+"/"+service+"/"+method+".htm",{method:(!isUndefined(httpMethod))?httpMethod:"post",parameters:params,onSuccess:current.proxy.CCCP.__onSuccess.bind(current.proxy.CCCP),onFailure:current.proxy.CCCP.__onFailure.bind(current.proxy.CCCP),_F:failback,_S:callback});},__onSuccess:function(transport){transport.request.options._S(transport.responseJSON);},__onFailure:function(transport){if(transport.request.options._F){transport.request.options._F(transport.status);}},threadParams:function(keys,values){var h={};keys.each(function(k,i){h[k]=values[i];});return h;}};var AssignmentService={};AssignmentService.getAssignments=function(type,sort,filter,maxresults,callback){var params=current.proxy.CCCP.threadParams(["type","sort","filter","maxresults"],[type,sort,filter,maxresults]);current.proxy.CCCP.execute("assignment","get",params,callback);};var ClipperService={};ClipperService.uberAssets=function(url,len,callback){var params=current.proxy.CCCP.threadParams(["url","len","include"],[url,len,"contentPageAsset,contentAddedUser"]);current.proxy.CCCP.execute("clipper","get",params,callback);};ClipperService.pageAssets=function(url,callback){var params=current.proxy.CCCP.threadParams(["url","include"],[url,"contentPageAsset,contentAddedUser"]);current.proxy.CCCP.execute("clipper","assets",params,callback);};var ContentService={};ContentService.getItem=function(id,includes,callback,failback){var params=current.proxy.CCCP.threadParams(["id","include"],[id,includes]);current.proxy.CCCP.execute("item","get",params,callback,failback);};ContentService.fetchAllInterestsForCurrentUser=function(id,callback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","tags",params,callback);};ContentService.copyContent=function(id,action,tags,callback,failback){var params=current.proxy.CCCP.threadParams(["id","action","tags"],[id,action,tags]);current.proxy.CCCP.execute("item","tag_post",params,callback,failback);};ContentService.unCopyContent=function(id,action,tagIds,callback,failback){var params=current.proxy.CCCP.threadParams(["id","action","tagIds"],[id,action,tagIds]);current.proxy.CCCP.execute("item","tag_post",params,callback,failback);};ContentService.flagContent=function(reason,url,callback){var params=current.proxy.CCCP.threadParams(["reason","url"],[reason,url]);current.proxy.CCCP.execute("data","flag",params,callback);};ContentService.flagComment=function(reason,id,callback){var params=current.proxy.CCCP.threadParams(["reason","id"],[reason,id]);current.proxy.CCCP.execute("comment","flag",params,callback);};ContentService.flagItem=function(reason,id,callback){var params=current.proxy.CCCP.threadParams(["reason","id"],[reason,id]);current.proxy.CCCP.execute("item","flag",params,callback);};ContentService.flagStoryline=function(reason,handle,callback){var params=current.proxy.CCCP.threadParams(["reason","handle"],[reason,handle]);current.proxy.CCCP.execute("storylines","flag",params,callback);};ContentService.flagScene=function(reason,handle,callback){var params=current.proxy.CCCP.threadParams(["reason","handle"],[reason,handle]);current.proxy.CCCP.execute("scenes","flag",params,callback);};ContentService.flagSceneComment=function(reason,handle,callback){var params=current.proxy.CCCP.threadParams(["reason","handle"],[reason,handle]);current.proxy.CCCP.execute("scene_comments","flag",params,callback);};ContentService.unCreditContent=function(id,credit,callback){var params=current.proxy.CCCP.threadParams(["id","credit","action"],[id,credit,"delete"]);current.proxy.CCCP.execute("item","credits_post",params,callback);};ContentService.fetchVideosForUser=function(id,start,len,type,callback){var params=current.proxy.CCCP.threadParams(["id","start","len","type","include"],[id,start,len,type,"contentPageAsset,contentAddedUser"]);current.proxy.CCCP.execute("user","items",params,callback,null,"get");};ContentService.recommendItem=function(id,username,action,callback){var params=current.proxy.CCCP.threadParams(["id","username","action"],[id,username,action]);current.proxy.CCCP.execute("item","recommenders_post",params,callback);};ContentService.recommendComment=function(id,username,action,callback){var params=current.proxy.CCCP.threadParams(["id","username","action"],[id,username,action]);current.proxy.CCCP.execute("comment","recommenders_post",params,callback);};ContentService.toggleItemCommentLock=function(id,action,callback){var params=current.proxy.CCCP.threadParams(["id","action"],[id,action]);current.proxy.CCCP.execute("item","lock_post",params,callback);};ContentService.toggleResponseCommentLock=function(id,action,callback){var params=current.proxy.CCCP.threadParams(["id","action"],[id,action]);current.proxy.CCCP.execute("comment","lock_post",params,callback);};ContentService.getCommentForEdit=function(id,callback){var params=current.proxy.CCCP.threadParams(["id","include"],[id,"contentPageAsset,contentAddedUser"]);current.proxy.CCCP.execute("item","get",params,callback);};ContentService.getReasonCodes=function(callback){var params=null;current.proxy.CCCP.execute("data","reasoncodes",params,callback);};ContentService.setItemVisibility=function(id,clarity,reasonCode,reasonDescription,callback){var params=current.proxy.CCCP.threadParams(["id","clarity","reasonCode","reasonDescription"],[id,clarity,reasonCode,reasonDescription]);current.proxy.CCCP.execute("item","visibility",params,callback);};ContentService.deleteStoryline=function(reasonCode,reasonDescription,handle,callback){var params=current.proxy.CCCP.threadParams(["reasonCode","reasonDescription","handle"],[reasonCode,reasonDescription,handle]);current.proxy.CCCP.execute("storylines","delete",params,callback);};ContentService.deleteScene=function(reasonCode,reasonDescription,handle,callback){var params=current.proxy.CCCP.threadParams(["reasonCode","reasonDescription","handle"],[reasonCode,reasonDescription,handle]);current.proxy.CCCP.execute("scenes","delete",params,callback);};ContentService.deleteSceneComment=function(reasonCode,reasonDescription,handle,callback){var params=current.proxy.CCCP.threadParams(["reasonCode","reasonDescription","handle"],[reasonCode,reasonDescription,handle]);current.proxy.CCCP.execute("scene_comments","delete",params,callback);};ContentService.fetchItemsFromTag=function(id,start,len,sort,filter,callback,failback){var params=current.proxy.CCCP.threadParams(["id","start","len","sort","filter","include"],[id,start,len,sort,filter,"contentPageAsset,contentAddedUser,featuredContent"]);current.proxy.CCCP.execute("tag","items",params,callback,failback,"get");};ContentService.fetchItemsFromGroup=function(id,start,len,sort,callback,failback){var params=current.proxy.CCCP.threadParams(["id","start","len","sort","include"],[id,start,len,sort,"contentPageAsset,contentAddedUser,featuredContent"]);current.proxy.CCCP.execute("group","items",params,callback,failback,"get");};ContentService.fetchPendingItemsFromGroup=function(id,start,len,callback,failback){var params=current.proxy.CCCP.threadParams(["id","start","len","include"],[id,start,len,"contentPageAsset,contentAddedUser,contentAdvice"]);current.proxy.CCCP.execute("group","pending_items",params,callback,failback,"get");};ContentService.isPasswordProtected=function(configKey,callback,failback){var params=current.proxy.CCCP.threadParams(["paramName"],[configKey]);current.proxy.CCCP.execute("data","config",params,callback,failback,"get");};var ContentItemService={};ContentItemService.fetchThreadedComments=function(id,callback){var params=current.proxy.CCCP.threadParams(["id","include"],[id,"contentPageAsset,contentAddedUser,contentFinishedItems,contentRecommenders"]);current.proxy.CCCP.execute("comment","responses",params,callback,null,"get");};ContentItemService.fetchVideoPlaylist=function(id,sort,start,len,callback,failback){var params=current.proxy.CCCP.threadParams(["id","sort","start","len","filter","include"],[id,sort,start,len,"allVeepableVideos","contentPageAsset,contentParentGroup,groupSkin,featuredContent"]);current.proxy.CCCP.execute("group","items",params,callback,failback,"get");};ContentItemService.fetchVideoPlaylistFromTag=function(id,sort,start,len,callback,failback){var params=current.proxy.CCCP.threadParams(["id","sort","start","len","filter","include"],[id,sort,start,len,"allVeepableVideos","contentPageAsset,contentParentGroup,groupSkin,featuredContent"]);current.proxy.CCCP.execute("tag","items",params,callback,failback,"get");};ContentItemService.fetchStorylineItem=function(id,callback){var params=current.proxy.CCCP.threadParams(["id","include"],[id,"contentPageAsset,contentAddedUser,storylineSceneItems,contentParentGroup,groupChallenge,contentBadges"]);current.proxy.CCCP.execute("item","get",params,callback,null,"get");};var FriendService={};FriendService.getMyBlockedUsers=function(id,callback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","blocked",params,callback);};FriendService.blockUser=function(id,connection,callback){var params=current.proxy.CCCP.threadParams(["id","action","connection"],[id,"add",connection]);current.proxy.CCCP.execute("user","blocked_post",params,callback);};FriendService.unblockUser=function(id,connection,callback){var params=current.proxy.CCCP.threadParams(["id","action","connection"],[id,"delete",connection]);current.proxy.CCCP.execute("user","blocked_post",params,callback);};FriendService.isThisMyFriend=function(id,connection,callback){var params=current.proxy.CCCP.threadParams(["id","connection"],[id,connection]);current.proxy.CCCP.execute("user","connected",params,callback);};FriendService.addAsFriendAjax=function(id,connection,action,callback){var params=current.proxy.CCCP.threadParams(["id","connection","action"],[id,connection,action]);current.proxy.CCCP.execute("user","connection_post",params,callback);};FriendService.removeFriendAjax=function(id,connection,action,callback){var params=current.proxy.CCCP.threadParams(["id","connection","action"],[id,connection,action]);current.proxy.CCCP.execute("user","connection_post",params,callback);};var InterestService={};InterestService.searchInterests=function(interestType,q,len,showClosed,callback){var params=current.proxy.CCCP.threadParams(["q","len","showClosed"],[q,len,showClosed]);current.proxy.CCCP.execute(interestType,"get",params,callback,null,"get");};InterestService.searchGroupsBySlug=function(q,len,showClosed,callback){var params=current.proxy.CCCP.threadParams(["q","len","showClosed"],[q,len,showClosed]);current.proxy.CCCP.execute("groups","slugsearch",params,callback,null,"get");};var InterestUserService={};InterestUserService.searchInterestsForUser=function(q,len,showClosed,callback){var params=current.proxy.CCCP.threadParams(["q","len","showClosed"],[q,len,showClosed]);current.proxy.CCCP.execute("tags","get",params,callback,null,"get");};var MessageService={};MessageService.markAsRead=function(id,action,callback){var params=current.proxy.CCCP.threadParams(["id","action"],[id,action]);current.proxy.CCCP.execute("message","post",params,callback);};MessageService.messageDelete=function(id,action,callback){var params=current.proxy.CCCP.threadParams(["id","action"],[id,action]);current.proxy.CCCP.execute("message","post",params,callback);};MessageService.unreadCount=function(id,callback,failback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","messagecount",params,callback,failback);};MessageService.messagePayload=function(id,orderby,folder,start,len,callback){var params=current.proxy.CCCP.threadParams(["id","orderby","folder","start","len"],[id,orderby,folder,start,len]);current.proxy.CCCP.execute("user","messages",params,callback);};var SharingService={};SharingService.shareItem=function(item,fromuser,recipients,message,callback,failback){var params=current.proxy.CCCP.threadParams(["id","fromuser","recipients","message"],[item,fromuser,recipients,message]);current.proxy.CCCP.execute("item","share_post",params,callback,failback);};SharingService.shareGroup=function(group,fromuser,recipients,message,callback,failback){var params=current.proxy.CCCP.threadParams(["id","fromuser","recipients","message"],[group,fromuser,recipients,message]);current.proxy.CCCP.execute("group","share_post",params,callback,failback);};SharingService.fetchEmailAddressesForSharing=function(id,start,len,callback){var params=current.proxy.CCCP.threadParams(["id","start","len"],[id,start,len]);current.proxy.CCCP.execute("user","sharedemails",params,callback);};SharingService.fetchUserInfoForSharing=function(id,start,len,sort,callback){var params=current.proxy.CCCP.threadParams(["id","start","len","sort"],[id,start,len,sort]);current.proxy.CCCP.execute("user","followers",params,callback);};var UserService={};UserService.fetchHeaderInfo=function(id,callback,failback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","roles",params,callback,failback);};UserService.fetchUsersByName=function(q,callback){var params=current.proxy.CCCP.threadParams(["q"],[q]);current.proxy.CCCP.execute("users","get",params,callback,null,"get");};UserService.fetchUniversitiesMatching=function(q,callback){var params=current.proxy.CCCP.threadParams(["q"],[q]);current.proxy.CCCP.execute("data","colleges",params,callback,null,"get");};UserService.changeUserStatus=function(id,action,status,reason,callback){var params=current.proxy.CCCP.threadParams(["id","action","status","reason"],[id,action,status,reason]);current.proxy.CCCP.execute("user","change_status",params,callback);};UserService.addSpecialRole=function(id,action,role,callback,failback){var params=current.proxy.CCCP.threadParams(["id","action","role"],[id,action,role]);current.proxy.CCCP.execute("user","add_role",params,callback,failback);};UserService.newBadgesCheck=function(id,len,filter,callback,failback){var params=current.proxy.CCCP.threadParams(["id","len","filter"],[id,len,filter]);current.proxy.CCCP.execute("user","badges",params,callback,failback);};UserService.fetchUserObject=function(id,callback,failback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","get",params,callback,failback);};UserService.fetchUserAccount=function(id,callback,failback){var params=current.proxy.CCCP.threadParams(["id"],[id]);current.proxy.CCCP.execute("user","account",params,callback,failback);};var GroupService={};GroupService.addFeaturedItem=function(id,itemId,pos,callback,failback){var params=current.proxy.CCCP.threadParams(["id","itemId","pos"],[id,itemId,pos]);current.proxy.CCCP.execute("group","add_featured_item",params,callback);};GroupService.removeFeaturedItem=function(id,itemId,callback,failback){var params=current.proxy.CCCP.threadParams(["id","itemId"],[id,itemId]);current.proxy.CCCP.execute("group","remove_featured_item",params,callback);};GroupService.reorderFeaturedItems=function(id,itemIds,callback,failback){var params=current.proxy.CCCP.threadParams(["id","itemIds"],[id,itemIds]);current.proxy.CCCP.execute("group","reorder_featured_items",params,callback);};GroupService.setGroupHidden=function(id,hidden,callback,failback){var params=current.proxy.CCCP.threadParams(["id","hidden","sensitive"],[id,hidden,hidden]);current.proxy.CCCP.execute("group","hidden_post",params,callback);};GroupService.setGroupClosed=function(id,closed,callback,failback){var params=current.proxy.CCCP.threadParams(["id","closed"],[id,closed]);current.proxy.CCCP.execute("group","closed_post",params,callback);};GroupService.setGroupSubmissionPolicy=function(id,policy,callback,failback){var params=current.proxy.CCCP.threadParams(["id","submissionPolicy"],[id,policy]);current.proxy.CCCP.execute("group","policy_post",params,callback);};current.site={};current.site.Page=Class.create({initialize:function(){this._url=document.location.href;this._shortUrl=null;this._type="";this._contentTitle="";this._contentDesc="";this._pageName="";this._section=document.currentPage;this._franchise="";this._id=0;this._adKeywords="";this._searchResultCount=0;this._searchQuery="";this._searchUserFilter="";this._searchGroupFilter="";this.__safariAnchor();},setUrl:function(url){this._url=url;},getUrl:function(){return this._url;},setShortUrl:function(url){this._shortUrl=url;},getShortUrl:function(){return(this._shortUrl)?this._shortUrl:this._url;},setId:function(id){this._id=id;},getId:function(){return this._id;},setType:function(type){this._type=type;},getType:function(){return this._type;},setPageName:function(pageName){this._pageName=pageName;},getPageName:function(){return this._pageName;},setContentTitle:function(title){this._contentTitle=title;},getContentTitle:function(){return this._contentTitle;},setContentDesc:function(desc){this._contentDesc=desc;},getContentDesc:function(){return this._contentDesc;},setSection:function(section){this._section=section;},setOwnerId:function(id){this._ownerId=id;},getOwnerId:function(){return this._ownerId;},getSection:function(){return this._section;},setSearchResultCount:function(num){this._searchResultCount=num;},getSearchResultCount:function(){return((this._searchResultCount>0)?this._searchResultCount:"zero");},setSearchQuery:function(q){this._searchQuery=q;},getSearchQuery:function(){return this._searchQuery;},setSearchUserFilter:function(filter){this._searchUserFilter=filter;},getSearchUserFilter:function(){return this._searchUserFilter;},setSearchGroupFilter:function(filter){this._searchGroupFilter=filter;},getSearchGroupFilter:function(){return this._searchGroupFilter;},setFranchise:function(franchise){this._franchise=franchise;},getFranchise:function(){return this._franchise;},setAdKeywords:function(keywords){this._adKeywords=keywords;},getAdKeywords:function(){return this._adKeywords;},__safariAnchor:function(){if((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(window.location.href.match(/#(\w.+)/))){window.location.replace(window.location.hash);}}});current.site.Page.getInstance=function(){if(!document.__currentPage__){document.__currentPage__=new current.site.Page();}return document.__currentPage__;};current.stub("current.Authorize");current.Authorize.checkInReadOnlyMode=function(event){if(current.Constants.getInstance().isReadOnlyMode()){if(event){if(event.currentTarget){event.preventDefault();}else{event.stop();}}new current.components.alerts.AlertWindow(event).init();return false;}return true;};current.Authorize.checkWriteMode=function(event){if(!this.checkInReadOnlyMode(event)){return false;}if(!current.User.getInstance().isEmailVerified()){if(event){if(event.currentTarget){event.preventDefault();}else{event.stop();}}new current.components.account.VerifyWindow(event).init();return false;}return true;};current.Authorize.forceLogin=function(event,activity,redirectToElemHref){if(current.User.getInstance().isLoggedIn()){return ;}var redirect=document.location.href;if(event&&redirectToElemHref&&Event.element(event)&&Event.element(event).href){var href=Event.element(event).href;if(href.startsWith("#")){var i=redirect.lastIndexOf("#");if(i!=-1){redirect=redirect.substr(0,i);}redirect+=href;}if(href.startsWith("/")||href.startsWith("http")){redirect=href;}}if(event){var loginWindow=new current.components.account.LoginWindow(event,activity);loginWindow.init();setTimedCookie(current.Cookies.LOGIN_REDIRECT,redirect,30);}else{setTimedCookie(current.Cookies.LOGIN_REDIRECT,redirect,30);window.location.href="/login.htm";}function stopErrors(){return true;}window.onerror=stopErrors;return false;throw"authorization exception";};current.Authorize.getInstance=function(){if(!document.__currentAuthorize__){document.__currentAuthorize__=new current.Authorize();}return document.__currentAuthorize__;};current.stub("current.utils");current.utils.Compatibility={getFlashMovieObject:function(movieName){if(window.document[movieName]){return window.document[movieName];}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[movieName]){return document.embeds[movieName];}}else{return document.getElementById(movieName);}},adjustRows:function(clipTextArea,cutoff){var clipRows=clipTextArea.rows;if(Prototype.Browser.IE&&!this.isIE8Browser()){var ieAdjust=false;while((clipTextArea.scrollHeight>clipTextArea.clientHeight)&&(clipTextArea.rows<30)){clipTextArea.rows+=3;ieAdjust=true;}if(ieAdjust){clipTextArea.scrollTop=0;redraw(clipTextArea);setTimeout(function(){clipTextArea.focus();},1);}}else{var splitRows=clipTextArea.value.split("\n");var splitCount=1;for(var i=0;i<splitRows.length;i++){if(splitRows[i].length>80){splitCount+=Math.ceil(splitRows[i].length/80);}}splitCount+=splitRows.length;if(splitCount>cutoff){clipTextArea.rows=Math.min(splitCount,30);}}},isIE6Browser:function(){Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;return Prototype.Browser.IE6;},isIE7Browser:function(){Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;return Prototype.Browser.IE7;},isIE8Browser:function(){var rv=-1;var ua=navigator.userAgent;var re=new RegExp("Trident/([0-9]{1,}[.0-9]{0,})");if(re.exec(ua)!=null){rv=parseFloat(RegExp.$1);}return(rv==4);},isIpad:function(){return navigator.userAgent.match(/iPad/i)!=null;},supports_video:function(){return !!document.createElement("video").canPlayType;},supports_h264_video:function(){if(!this.supports_video()){return false;}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');},supports_ogg_video:function(){if(!this.supports_video()){return false;}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"');},supports_webm_video:function(){if(!this.supports_video()){return false;}var v=document.createElement("video");return v.canPlayType('video/webm; codecs="vp8, vorbis"');},supports_flash:function(){var installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(installedVer.major>=9){return true;}return false;},logCompatibility:function(){console.log("current.utils.Compatibility.logCompatibility():");console.log("isIE6Browser: "+this.isIE6Browser());console.log("isIE7Browser: "+this.isIE7Browser());console.log("isIE8Browser: "+this.isIE8Browser());console.log("isIpad: "+this.isIpad());console.log("supports_video: "+this.supports_video());console.log("supports_h264_video: "+this.supports_h264_video());console.log("supports_ogg_video: "+this.supports_ogg_video());console.log("supports_webm_video: "+this.supports_webm_video());console.log("supports_flash: "+this.supports_flash());},getEventElement:function(e){if(e.currentTarget){return $(e.currentTarget);}return e.element();},convertElement:function(el){try{if(el.get(0)){return $(el.get(0));}}catch(e){return $(el);}}};current.Cookies={IP:"magnum",LOCALE:"gillis",UNIQUE_SESSION:"tc",USERNAME:"baldwin",DISTANT_EXPIRE:1*60*24*365*5,USER_ID:"zeus",PREVIOUS_PAGE_NAME:"tanaka",CACHE_NAME:"WU",CACHE_VALUE:"x",CACHE_EXPIRES:5,REGISTRATION:"moki",PROFILE_COMPLETION:"wilbur",CLICK_MAP:"bonig",SESSION_ID:"chumley",ACEGI:"ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE",USER_MEMBER:"orville",LOGIN_REDIRECT:"buck",SYSTEM_MESSAGE_HIDE:"hue",SYSTEM_MESSAGE_HIDE_EXPIRE:1*60*24*7,AB_TESTS:"calvin",PLAYER_AUDIO_ON:"sullivan",GROUP_MESSAGE_SHOW:"robin",HOMEPAGE_INTERSTITIAL:"scholl",PREFERENCES:"higgins",URL_PASSWORDS:"icepick",POST_LOGIN_DATA:"hopper"};function setSessionCookie(name,value){document.cookie=name+"="+escape(value)+";path=/";}function setTimedCookie(name,value,expires){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60;}var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+";path=/";}function getCookieValue(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}if(start==-1){return null;}var end=document.cookie.indexOf(";",len);if(end==-1){end=document.cookie.length;}return unescape(document.cookie.substring(len,end));}function getCrumbValue(cookieName,crumbKey){var cookie=getCookieValue(cookieName);if(cookie==null){return null;}var cookieData=null;try{cookieData=cookie.evalJSON(true);}catch(err){}if(cookieData==null){return null;}return cookieData[crumbKey];}function setTimedCrumb(cookieName,crumbKey,crumbValue,expires){var cookie=getCookieValue(cookieName);var cookieData=new Object();if(cookie!=null){try{cookieData=cookie.evalJSON(true);}catch(err){}}cookieData[crumbKey]=crumbValue;setTimedCookie(cookieName,Object.toJSON(cookieData),expires);}function setSessionCrumb(cookieName,crumbKey,crumbValue){var cookie=getCookieValue(cookieName);var cookieData=new Object();if(cookie!=null){try{cookieData=cookie.evalJSON(true);}catch(err){}}cookieData[crumbKey]=crumbValue;setSessionCookie(cookieName,Object.toJSON(cookieData));}function deleteCookie(name){if(getCookieValue(name)){document.cookie=name+"=;expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/";}}var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(value,length){value=String(value);length=parseInt(length)||2;while(value.length<length){value="0"+value;}return value;};return function(date,mask){if(arguments.length==1&&(typeof date=="string"||date instanceof String)&&!/\d/.test(date)){mask=date;date=undefined;}date=date?new Date(date):new Date();if(isNaN(date)){throw"invalid date";}var dF=dateFormat;mask=String(dF.masks[mask]||mask||dF.masks["default"]);var d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),H=date.getHours(),M=date.getMinutes(),s=date.getSeconds(),L=date.getMilliseconds(),o=date.getTimezoneOffset(),flags={d:d,dd:pad(d),ddd:dF.i18n.dayNames[D],dddd:dF.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dF.i18n.monthNames[m],mmmm:dF.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4)};return mask.replace(token,function($0){return($0 in flags)?flags[$0]:$0.slice(1,$0.length-1);});};}();dateFormat.masks={"default":"ddd mmm d yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoFullDateTime:"yyyy-mm-dd'T'HH:MM:ss.lo"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};dateFormat.reorderDateString=function(dateString){var d=dateString.substring(5,dateString.length-24);var m=dateString.substring(8,dateString.length-20);var y=dateString.substring(12,dateString.length-15);return m+" "+d+", "+y;};dateFormat.timespanInWords=function(fromTime){var from_time=new Date(fromTime);var to_time=new Date();var distance_in_minutes=Math.floor(Math.abs(to_time-from_time)/60000);var distance_in_seconds=Math.floor(Math.abs(to_time-from_time)/1000);var num=0;var string="";var dstrings={jn:current.locale.Bundle.get("justNow"),mn:current.locale.Bundle.get("minuteAgo"),mns:current.locale.Bundle.get("minutesAgo"),d:current.locale.Bundle.get("dayAgo"),dd:current.locale.Bundle.get("daysAgo"),h:current.locale.Bundle.get("hourAgo"),hh:current.locale.Bundle.get("hoursAgo"),m:current.locale.Bundle.get("monthAgo"),mm:current.locale.Bundle.get("monthsAgo"),y:current.locale.Bundle.get("yearAgo"),yy:current.locale.Bundle.get("years")};if(distance_in_minutes<=1){if(distance_in_seconds>=1&&distance_in_seconds<=59){string=dstrings.jn;}else{string=dstrings.mn;}}else{if(distance_in_minutes>=2&&distance_in_minutes<=59){num=distance_in_minutes;string=dstrings.mns;}else{if(distance_in_minutes>59&&distance_in_minutes<=119){string=dstrings.h;}else{if(distance_in_minutes>119&&distance_in_minutes<=1439){num=Math.round(distance_in_minutes/60);string=dstrings.hh;}else{if(distance_in_minutes>1439&&distance_in_minutes<=2879){string=dstrings.d;}else{if(distance_in_minutes>2879&&distance_in_minutes<=43199){num=Math.round(distance_in_minutes/1440);string=dstrings.dd;}else{if(distance_in_minutes>43199&&distance_in_minutes<=86399){string=dstrings.m;}else{if(distance_in_minutes>86399&&distance_in_minutes<=525959){num=Math.round(distance_in_minutes/43200);string=dstrings.mm;}else{if(distance_in_minutes>525959&&distance_in_minutes<=1051919){string=dstrings.y;}else{num=Math.floor(distance_in_minutes/525960);string=dstrings.yy;}}}}}}}}}if(num>0){var message=new Template(string);var data={num:num};return message.evaluate(data);}else{return string;}};Date.prototype.format=function(mask){return dateFormat(this,mask);};current.Embed=Class.create({_validFlashVars:["imgPath","vidPath","title","topic","perm","id"],initialize:function(target,id,w,h,embedUser){this._target=$(target);this._id=id;this._w=w;this._h=h;this._embedUser=embedUser;},getString:function(){var swfPath=this.getHostName()+"/e/"+this._id+"/"+current.User.getInstance().getLocale();if(this._embedUser){var u=current.User.getInstance();swfPath=swfPath+"/embedUser="+u.getUsername();}var so=new current.SWFObjectPatch(swfPath,this._id,this._w,this._h,"9.0","#333333");so.addParam("wmode","transparent");so.addParam("allowfullscreen","true");so.addParam("allowscriptaccess","always");return so.getEmbedHTML();},getHostName:function(){return"http://"+window.location.hostname;}});current.SWFObjectPatch=Class.create(deconcept.SWFObject.prototype,{initialize:function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return ;}this.DETECT_KEY=detectKey?detectKey:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(swf){this.setAttribute("swf",swf);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(ver){this.setAttribute("version",new deconcept.PlayerVersion(ver.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute("xiRedirectUrl",xir);this.setAttribute("redirectUrl","");if(redirectUrl){this.setAttribute("redirectUrl",redirectUrl);}},getEmbedHTML:function(){swfNode='<object width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" id="ce_'+this.getAttribute("id")+'">';swfNode+='<param name="movie" value="'+this.getAttribute("swf")+'"></param>';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'"></param>';}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}swfNode+='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}swfNode+="></embed>";swfNode+="</object>";return swfNode;}});var EventSelectorRules={"form.validate-init":function(el){if(el.id===null){return ;}if(typeof (Validation)=="undefined"){return ;}if(!Validation.getInstance(el.id)){(new Validation(el,{onFormValidate:function(result){$$(".disableOnSubmit").each(function(node){node.disabled=result;});}}));}},".alwaysNew":function(el){el.value="";},".validate-isNotHint,.validate-isNotEmptyHint,.hasHinting":function(el){if(isUndefined(el.title)||el.title===null||el.title===""){return ;}if(!$(el).present()){el.setStyle({color:"#999"});el.value=el.title;}el.observe("focus",function(){if(this.value===el.title){this.setStyle({color:"#000"});this.value="";}});el.observe("blur",function(){this.resetHint();});},".deleteConfirm":function(el,event){el.onclick=function(){return(confirm("Are you sure you want to delete this?"));};},"#reCaptcha_renderedFields":function(el){el.down("noscript").remove();},"form:submit":function(el,event){$$(".hasHinting").each(function(field){if(field.value===field.title){field.value="";}});},".searchResultsDesc":function(el){var txt=el.innerHTML;el.innerHTML=highlightTerms(txt,window.location.search.toQueryParams().q);}};document.observe("dom:loaded",function(){EventSelectors.start(EventSelectorRules);});current.stub("current.utils");current.utils.JavaScriptGenerator=Class.create({initialize:function(){this._currentId=0;this._resultsOpened=false;this._errorOpened=false;},init:function(name){this._form=$(name);this._id=$(name+"_id");this._width=$(name+"_width");this._height=$(name+"_height");this._autoplay=$(name+"_autoplay");this._bgColor=$(name+"_bgColor");this._skipOverlay=$(name+"_skipOverlay");this._hideLogo=$(name+"_hideLogo");this._disableEndSlate=$(name+"_disableEndSlate");this._disableAds=$(name+"_disableAds");this._continuousPlay=$(name+"_continuousPlay");this._results=$(name+"_results");this._error=$(name+"_error");this._w=620;this._h=350;this._pageContext="group";this._enableMenu=false;this._useThumbUrl=false;this._showThumbnail=false;if(this._bgColor){attachColorPicker(this._bgColor);}this._form.observe("submit",this.generateCode.bindAsEventListener(this));},generateCode:function(event){event.stop();var iv=Validation.validate(this._id);var wv=Validation.validate(this._width);var hv=Validation.validate(this._height);var cv=Validation.validate(this._bgColor);if(!iv||!wv||!hv||!cv){if(this._resultsOpened){this._results.show();this._results.up("div").fade();this._resultsOpened=false;}if(this._errorOpened){this._error.fade();this._errorOpened=false;}return ;}this._videoId=parseInt(this._id.value);if(this._videoId&&this._videoId!=0){this.__getContentItem();}if(this._errorOpened){this._error.fade();this._errorOpened=false;}},__getContentItem:function(){ContentService.getItem(this._videoId,"contentPageAsset",this.__onItemData.bindAsEventListener(this),this.__onItemDataFail.bindAsEventListener(this));},__onItemData:function(data){if(data.pageAsset){this._results.innerHTML="";this._content=data;this._assetWidth=this._content.pageAsset.width;this._assetHeight=this._content.pageAsset.height;this.__showCode();}else{this.__showError("The item you have selected does not have the correct video asset to use this tool. Only items with embeddable video assets can be generated with this tool.");}},__showCode:function(){if(this._content.pageAsset.assetType!="I"&&(this._content.contentSource=="internet"&&this._content.contentSource=="webcam"||this._content.contentSource=="pod"||this._content.contentSource=="vc2"||(this._content.contentSource=="videoegg"&&this._content.pageAsset.transcodeStatus==1)||(this._content.contentSource=="upload"&&this._content.pageAsset.transcodeStatus==1))){var xD=new Date();var xM=xD.getMilliseconds();var x="__current_video_"+xM;var basb=new StringBuffer();basb.append('&lt;div id="videoContainer_'+this._videoId+"_"+xM+'"&gt;\r\n');basb.append("&lt;/div&gt;\r\n");basb.append('&lt;script type="text/javascript"&gt;\r\n');basb.append("    var "+x+" = new Object();\r\n");basb.append("    "+x+'.contentId = "'+this._content.id+'";\r\n');basb.append("    "+x+".w = "+this._width.value+";\r\n");basb.append("    "+x+".h = "+this._height.value+";\r\n");basb.append("    "+x+".vw = "+this._assetWidth+";\r\n");basb.append("    "+x+".vh = "+this._assetHeight+";\r\n");basb.append("    "+x+".hideLogo = "+this._hideLogo.checked+";\r\n");basb.append("    "+x+".skipOverlay = "+this._skipOverlay.checked+";\r\n");basb.append("    "+x+".disableEndSlate = "+this._disableEndSlate.checked+";\r\n");basb.append("    "+x+".disableAds = "+this._disableAds.checked+";\r\n");basb.append("    "+x+".enableMenu = "+this._enableMenu+";\r\n");basb.append("    "+x+".continuousPlay = "+this._continuousPlay.checked+";\r\n");basb.append("    "+x+".autoplay = "+this._autoplay.checked+";\r\n");basb.append("    "+x+".showThumbnail = "+this._showThumbnail+";\r\n");basb.append("    "+x+".externalContext = 'cdc';\r\n");basb.append("    "+x+".context = 'group';\r\n");basb.append("    "+x+".sitePage = 'group';\r\n");basb.append('    var videoPlayback = new current.components.video.Veep("videoContainer_'+this._videoId+"_"+xM+'", "'+this._videoId+'", '+x+");\r\n");basb.append('    videoPlayback.setBgColor("'+this._bgColor.value+'");\r\n');basb.append("    videoPlayback.init();\r\n");basb.append("&lt;/script&gt;\r\n");var bas=basb.toString();this._results.innerHTML=bas;if(!this._resultsOpened){this._results.up("div").appear();}this._results.appear();this._resultsOpened=true;this._currentId=this._videoId;}else{this.__showError("The item you have selected does not have the correct video asset to use this tool. Only items with embeddable video assets can be generated with this tool.");}},__onItemDataFail:function(data){this.__showError('There is no item with that ID value. Please check the input for any errors, and click "Generate JavaScript" again.');},__showError:function(errStr){if(this._resultsOpened){this._results.up("div").hide();this._results.show();this._resultsOpened=false;}this._error.update(errStr);this._error.appear();this._errorOpened=true;}});Object.Event.extend(current.utils.JavaScriptGenerator);current.utils.JavaScriptGenerator.getInstance=function(){if(!document.__javaScriptGenerator__){document.__javaScriptGenerator__=new current.utils.JavaScriptGenerator();}return document.__javaScriptGenerator__;};current.stub("current.utils");current.utils.Referrer={getReferrer:function(){this._referrer=document.referrer;if(isUndefined(this._referrer)|this._referrer==null){return ;}else{return this._referrer;}},getReferrerMatch:function(tokenArray){this._tokens=tokenArray;this._referrer=this.getReferrer();if(isUndefined(this._referrer)){return ;}else{var scope=this;var result=this._tokens.find(function(token){return scope._referrer.indexOf(token.toString())>=0;});return result;}}};current.stub("current");current.ScrollLoader=new Class.create({initialize:function(){this._threshold=0;this._delayedImages=null;this._delayedTargetWithJS={};Event.observe(window,"scroll",this.__onScroll.bindAsEventListener(this));Event.observe(window,"resize",this.__onResize.bindAsEventListener(this));this._mouseOverImgObserver=this.__onMouseOverImg.bindAsEventListener(this);this._mouseOverJsObserver=this.__onMouseOverJs.bindAsEventListener(this);},init:function(){this.observeImages($(document.getElementsByTagName("body")[0]));},observeImages:function(target){var imgs=target.select(".delayedImage");for(var i=0,len=imgs.length,img;i<len;++i){if(!imgs[i]._scrollLoaderObserved){Event.observe(imgs[i],"mouseover",this._mouseOverImgObserver);imgs[i]._scrollLoaderObserved=true;if(this._delayedImages){this._delayedImages.push(imgs[i]);}}}if(!this._delayedImages){this._delayedImages=imgs;}this.loadVisible();},unobserveImages:function(target){var imgs=target.select(".delayedImage");if(imgs.length>0){var len=imgs.length;var i=this._delayedImages.indexOf(imgs[0]);var j=this._delayedImages.indexOf(imgs[len-1]);if(i>=0&&j>=0&&(j-i==len-1)){for(var k=0;k<len;k++){if(this._delayedImages[i+k]!=imgs[k]){return ;}}this._delayedImages.splice(i,len);}}},observeTargetWithJS:function(targetName,callback){var target=$(targetName);Event.observe(target,"mouseover",this._mouseOverJsObserver);this._delayedTargetWithJS[targetName]=callback;},unobserveTargetWithJS:function(targetName){delete this._delayedTargetWithJS[targetName];},__onScroll:function(event){this.loadVisible();},__onResize:function(event){this.loadVisible();},__onMouseOverImg:function(event){var img=Event.element(event);this.loadImage(img);var i=this._delayedImages.indexOf(img);if(i>=0){img.stopObserving("mouseover",this._mouseOverImgObserver);this._delayedImages.splice(i,1);}},__onMouseOverJs:function(event){var target=Event.element(event);var targetName=target.id;if(this._delayedTargetWithJS[targetName]){this._delayedTargetWithJS[targetName](target);delete this._delayedTargetWithJS[targetName];}},loadVisible:function(event){var y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;var h=window.innerHeight||document.documentElement.clientHeight;var target,offset;for(var i=0,len=this._delayedImages.length;i<len;++i){target=this._delayedImages[i];if(target==undefined){this._delayedImages.splice(i,1);--len;--i;}else{offset=target._cachedOffset;if(offset==undefined){offset=target._cachedOffset=target.cumulativeOffset()[1];}if(((offset-this._threshold)-h)<=y){this.loadImage(target);target.stopObserving("mouseover",this._mouseOverImgObserver);this._delayedImages.splice(i,1);--len;--i;}}}for(var targetName in this._delayedTargetWithJS){target=$(targetName);offset=target._cachedOffset;if(offset==undefined){offset=target._cachedOffset=target.cumulativeOffset()[1];}if(((offset-this._threshold)-h)<=y){this._delayedTargetWithJS[targetName](target);target.stopObserving("mouseover",this._mouseOverJsObserver);delete this._delayedTargetWithJS[targetName];}}},loadImage:function(img){var src=img.readAttribute("longdesc");if(src){img.writeAttribute("src",src);}img.removeClassName("delayedImage");img._scrollLoaderObserved=false;}});current.ScrollLoader.getInstance=function(){if(!document.__currentScrollLoader__){document.__currentScrollLoader__=new current.ScrollLoader();}return document.__currentScrollLoader__;};current.stub("current.Session");current.Session=new Class.create({initialize:function(){this._fireAndForget=false;},setUserId:function(userId){this._userId=userId;},setFireAndForget:function(bool){this._fireAndForget=bool;},invalidate:function(){if(!current.User.getInstance().isLoggedIn()){return false;}new Ajax.Request(current.Constants.getInstance().getScriptName()+"/utils/sessions/invalidate/"+this._userId,{method:"get",evalJS:false,onSuccess:this.__onSuccess.bindAsEventListener(this),onFailure:this.__onFailure.bindAsEventListener(this)});},__onSuccess:function(data){if(!this._fireAndForget){return data.responseText;}},__onFailure:function(data){if(!this._fireAndForget){return false;}}});current.Session.getInstance=function(){if(!document.__currentSession__){document.__currentSession__=new current.Session();}return document.__currentSession__;};current.stub("current.utils");current.utils.Strings={truncateAtWord:function(string,len,trailer){if(isUndefined(len)){len=30;}if(string.length>len){string=string.substring(0,len);string=string.replace(/\s*\w+$/,"");if(isUndefined(trailer)){trailer="...";}return string+trailer;}return string;},extractUrlsFromText:function(text){var pattern=/((http|https)\:\/\/)?(([\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3})|([\w\-]+\.)+(((af|ax|al|dz|as|ad|ao|ai|aq|ag|am|aw|au|at|az|bs|bh|bd|bb|by|be|bz|bj|bm|bt|bo|ba|bw|bv|br|io|bn|bg|bf|kh|cm|ca|cv|ky|cf|td|cl|cn|cx|cc|km|cg|cd|ck|cr|ci|hr|cu|cy|cz|dk|dj|dm|do|ec|eg|sv|gq|er|ee|et|fk|fo|fj|fi|fr|gf|pf|tf|ga|gm|ge|de|gh|gi|gr|gl|gd|gp|gu|gt|gg|gn|gw|gy|ht|hm|va|hn|hk|hu|is|id|ir|iq|ie|im|il|it|jm|jp|je|jo|kz|ke|ki|kp|kr|kw|kg|la|lv|lb|ls|lr|ly|li|lt|lu|mo|mk|mg|mw|my|mv|ml|mt|mh|mq|mr|yt|mx|fm|md|mc|mn|ms|ma|mz|mm|nr|np|nl|an|nc|nz|ni|ng|nu|nf|mp|no|om|pk|pw|ps|pa|pg|py|pe|ph|pn|pl|pt|qa|re|ro|ru|rw|sh|kn|lc|pm|vc|ws|sm|st|sa|sn|cs|sc|sl|sg|sk|si|sb|so|za|gs|es|lk|sd|sr|sj|sz|se|ch|sy|tw|tj|tz|th|tl|tg|tk|to|tt|tn|tr|tm|tc|tv|ug|ua|gb|us|um|uy|uz|vu|ve|vn|vg|vi|wf|eh|ye|zm|zw|uk|com|edu|gov|int|mil|net|org|biz|info|name|pro|aero|coop|museum|arpa|co|in|ne|bi|na|pr|ae|mu|ar))))(:[\d]{1,4})?($|(\/([a-zA-Z0-9\~\,\.\?=/#%&_:\+-])*)*|\/)/g;var urls=text.match(pattern);return urls;},autolinkUrls:function(str){return str.replace(/(ftp|http|https|file):\/\/[\S]+(\b|$)/gim,this._formatLink1).replace(/([^\/])(\swww[\S]+(\b|$))/gim,this._formatLink2);},_formatLink1:function(str,p1,offset,s){var hostname=current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/";var url=str.toString();if(!url.startsWith(hostname)&&url.startsWith("http://")){url=hostname+str;}var truncUrl=(str.length>55)?str.substring(0,51)+"...":str;return' <a href="'+url+'" target="_blank">'+truncUrl.strip()+"</a>";},_formatLink2:function(str,p1,p2,offset,s){var hostname=current.Constants.getInstance().getServerName().sub("http://","")+current.Constants.getInstance().getScriptName()+"/";var url=p2.toString();console.log(url);if(!url.startsWith(hostname)){url=hostname+"http://"+p2.strip();}var truncUrl=(p2.length>55)?p2.substring(0,51)+"...":p2;return p1+' <a href="http://'+url+'" target="_blank">'+truncUrl+"</a>";},addCommas:function(nStr){nStr+="";x=nStr.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1,$2");}return x1+x2;},isInteger:function(s){return(s.toString().search(/^-?[0-9]+$/)==0);},removeDuplicateElements:function(arrayName){var newArray=new Array();if(arrayName==null){return newArray;}label:for(var i=0;i<arrayName.length;i++){for(var j=0;j<newArray.length;j++){if(newArray[j]==arrayName[i]){continue label;}}newArray[newArray.length]=arrayName[i];}return newArray;}};current.stub("current.utils");current.utils.Uploadify=new Class.create({initialize:function(){this._itemCount=0;this._editCount=0;this._poststring="";this._showLabels=false;this._isFetching=false;this._editList=new Array();this._uploaders=new Array();this._userid=current.User.getInstance().getId();this._username=current.User.getInstance().getUsername();this._uploadLimit=0;this._runningUploadLimit=0;this._galleryLimit=0;},init:function(){$(this._form).observe("submit",this.onFormSubmit.bindAsEventListener(this));this.onSortMe();this.addPhotoEditLinks($(document.getElementsByTagName("body")[0]));CharacterCounter.getInstance(true);},setFileUpload:function(uploader){this._uploader=uploader;},setBlob:function(blob){this._blob=blob;},setUploadForm:function(form){this._form=form;},setGalleryLimit:function(lim){this._galleryLimit=lim;},setUploadLimit:function(lim){this._uploadLimit=lim;this._runningUploadLimit=lim;},setQueueLabels:function(labels){this._labels=labels;},setButton:function(submitBtn){this._submitBtn=submitBtn;},setSlug:function(groupSlug){this._slug=groupSlug;},setUploaderPath:function(uploaderPath){this._uploaderPath=uploaderPath;},setUploadCgiPath:function(cgiUploadPath){this._cgiUploadPath=cgiUploadPath;},setStatus:function(status){this._status=status;},setItemCount:function(count){this._itemCount=count;},setSessionId:function(id){this._sessionId=id;},removeQueueItem:function(ID){for(var i=0;i<this._sortOrder.length;i++){if(this._sortOrder[i]==ID){var gone=this._sortOrder.splice(i,1);this._runningUploadLimit++;if(this._runningUploadLimit<0){if(Math.abs(this._runningUploadLimit)==1){this.updateStatus("The last image in your upload queue will be ignored.","error");}else{this.updateStatus("The last "+Math.abs(this._runningUploadLimit)+" images in your upload queue will be ignored.","error");}}else{if(this._runningUploadLimit==0){this.updateStatus(this._runningUploadLimit+" more images can be added to this gallery.","error");}else{if(this._runningUploadLimit==1){this.updateStatus("1 more image can be added to this gallery.","status");}else{this.updateStatus(this._runningUploadLimit+" more images can be added to this gallery.","status");}}}}}},addPhotoEditLinks:function(target){target.select(".photoEditLink").invoke("observe","click",this.__onPhotoEditClick.bindAsEventListener(this));target.select(".hideLink").invoke("observe","click",this.__onVisibilityClick.bindAsEventListener(this));target.select(".photoSaveLink").invoke("observe","click",this.__onSaveChangesClick.bindAsEventListener(this));target.select(".photoCancelLink").invoke("observe","click",this.__onCancelChangesClick.bindAsEventListener(this));target.select(".photoChangeLink").invoke("observe","click",this.__onPhotoChangeClick.bindAsEventListener(this));},updateStatus:function(msg,type){var d=new Date();dStr="["+((d.getHours()<10)?"0":"")+d.getHours()+":"+((d.getMinutes()<10)?"0":"")+d.getMinutes()+":"+((d.getSeconds()<10)?"0":"")+d.getSeconds()+"] ";var span=new Element("span",{"class":"clearBoth floatLeft "+type}).insert(dStr+msg);Element.insert($(this._status),{top:span});},onSortMe:function(){Sortable.create("customQueue",{handles:$$("#customQueue .itemUploadThumbnail"),onUpdate:this.__onGallerySort.bindAsEventListener(this)});this._poststring=Sortable.serialize("customQueue",{tag:"li"});var tempSort=this._poststring.split("&");this._sortOrder=new Array();for(var i=0;i<tempSort.length;i++){this._sortOrder[i]=tempSort[i].substring(tempSort[i].indexOf("=")+1);}},__onGallerySort:function(event){this._poststring=Sortable.serialize("customQueue",{tag:"li"});var tempSort=this._poststring.split("&");this._sortOrder=new Array();for(var i=0;i<tempSort.length;i++){this._sortOrder[i]=tempSort[i].substring(tempSort[i].indexOf("=")+1);}$(this._submitBtn).show();},__onEditMode:function(id,bool){if(bool){this._editCount++;$("photoEdit_"+id).hide();$$("#fileUpload"+id+"_"+id+" .itemParams").each(function(x){x.show();});var labels=new Element("div",{"class":"customQueueHead",style:"display: none;"});labels.insert($(this._labels).innerHTML);Element.insert($("fileUpload"+id+"_"+id),{top:labels});Effect.Appear(labels);var suggest=new current.TagsBrowser($("fileUpload"+id+"_"+id).down(".itemTags"),"addTagsInputHolder",{minChars:2,tokens:",",disablePreselect:true,choices:12});EventSelectors.start(EventSelectorRules);}else{this._editCount--;$$("#fileUpload"+id+"_"+id+" .itemParams").each(function(x){x.hide();});$("tags_"+id).value="";$("fileUpload"+id+"_"+id).removeClassName("active");$("thumb_"+id).show();Effect.Appear($("photoEdit_"+id));$("fileUpload"+id+"_"+id).down(".customQueueHead").remove();$("fileUpload"+id+"_"+id).down(".percentage").innerHTML="";}},__onSaveChangesClick:function(event){event.stop();var el=event.element();var id=el.rel;$("photoEdit_"+id).down(".ajaxError").innerHTML="";var editItem={};editItem.addedUser=this._username;editItem.userId=this._userid;editItem.id=id;editItem.contentTitle=((el.up("li").down(".itemTitle").value!=current.locale.Bundle.get("photogallery.add_a_title"))?el.up("li").down(".itemTitle").value.stripScripts():"");editItem.contentText=((el.up("li").down(".itemCaption").value!=current.locale.Bundle.get("photogallery.add_a_caption"))?el.up("li").down(".itemCaption").value.stripScripts():"");editItem.itemCredits=((el.up("li").down(".itemCredits").value!=current.locale.Bundle.get("photogallery.add_photo_credit"))?el.up("li").down(".itemCredits").value.stripScripts():"");editItem.itemTags=((el.up("li").down(".itemTags").value!=current.locale.Bundle.get("photogallery.add_tags"))?el.up("li").down(".itemTags").value.stripScripts():"");editItem.itemCreditId=el.up("li").down(".itemCreditId").value;editItem.itemAssetUrl=el.up("li").down(".itemAssetUrl").value;editItem.itemAssetUrlOld=el.up("li").down(".itemAssetUrlOld").value;var testStr=editItem.contentTitle.replace(/^\s*/,"").replace(/\s*$/,"");if(testStr==""){el.up("li").down(".itemTitle").value="";Validation.validate(el.up("li").down(".itemTitle"));Validation.reset(el.up("li").down(".itemTitle"));return ;}if(!this._isFetching){new Ajax.Request(current.Constants.getInstance().getServerName()+current.Constants.getInstance().getScriptName()+"/admin/gallery-ajax.htm",{method:"post",parameters:editItem,onSuccess:this.__onSaveChangesData.bind(this),onFailure:this.__onSaveChangesFail.bind(this)});this._isFetching=true;this.__onEditMode(id,false);}this.__showThrobber(id);},__onSaveChangesData:function(data){this._isFetching=false;var item=((typeof data.responseText=="object")?data.responseText:eval("("+data.responseText+")"));if(typeof item=="undefined"){return ;}if(typeof item.id!="undefined"){if(typeof item.contentTitle!="undefined"&&item.contentTitle!=null){$("photoEdit_"+item.id).down(".photoEditLink").update(htmlEntities(item.contentTitle));$("title_"+item.id).value=item.contentTitle;}if(typeof item.contentText!="undefined"&&item.contentText!=null){$("caption_"+item.id).value=item.contentText;}if(typeof item.assetUrl!="undefined"&&item.assetUrl!=null){$("assetUrlOld_"+item.id).value=item.assetUrl;}if(typeof item.itemTags!="undefined"&&item.itemTags!=null){var tags=((typeof item.itemTags=="object")?item.itemTags:eval("("+item.itemTags+")"));if(tags.error==null&&tags.restableType=="MarkingResultVO"&&tags.successInterests!=null){this.__onPhotoTagData(tags.successInterests,item.id,false);}}if(typeof item.itemCredits!="undefined"&&item.itemCredits!=null){this.__onPhotoCreditsData(item.itemCredits,item.id,false);}this.__hideThrobber(item.id);}if(typeof item.error!="undefined"){this.__hideThrobber(item.id);$("photoEdit_"+item.id).down(".ajaxError").update(item.error);$("photoEdit_"+item.id).down(".ajaxError").insert(" ["+item.error_reason+"]");Effect.Appear($("photoEdit_"+item.id).down(".ajaxError"));}},__onSaveChangesFail:function(data){this._isFetching=false;var error=((typeof data.responseText=="object")?data.responseText:eval("("+data.responseText+")"));if(typeof error=="undefined"){return ;}if(typeof error.error!="undefined"){this.__hideThrobber(error.id);$("photoEdit_"+error.id).down(".ajaxError").update(error.error);$("photoEdit_"+error.id).down(".ajaxError").insert(" ["+error.error_reason+"]");Effect.Appear($("photoEdit_"+error.id).down(".ajaxError"));}},__onCancelChangesClick:function(event){event.stop();var el=event.element();var id=el.rel;this.__onEditMode(id,false);this.__resetImage(id);},__onVisibilityClick:function(event){event.stop();var el=event.element();var action=el.href.substring(el.href.lastIndexOf("#")+1);var id=el.rel;this.__showThrobber(id);if(!this._isFetching){current.proxy.CCCP.execute("item","visibility",{id:id,clarity:action,reasonCode:"22",reasonDescription:"photo gallery image update"},this.__onVisibilityData.bindAsEventListener(this,id,action),this.__onVisibilityFail.bindAsEventListener(this,id,action));this._isFetching=true;}},__onVisibilityData:function(data,id,action){this._isFetching=false;var link=$("fileUpload"+id+"_"+id).down(".hideLink");if(link){if(action=="hide"){link.addClassName("unhideLink");link.href="#unhide";link.update(current.locale.Bundle.get("hidden"));var position=0;for(var i=0;i<this._sortOrder.length;i++){if(this._sortOrder[i]==id){position=i;break;}}if(!this._isFetching){current.proxy.CCCP.execute("group","add_featured_item",{id:this._slug,itemId:id,action:"add",pos:position},this.__onFeatureData.bindAsEventListener(this,id,action),this.__onFeatureFail.bindAsEventListener(this,id,action));this._isFetching=true;}}else{link.removeClassName("unhideLink");link.href="#hide";link.update(current.locale.Bundle.get("visible"));}}else{}this.__hideThrobber(id);},__onVisibilityFail:function(data,id){this._isFetching=false;this.__hideThrobber(id);},__onFeatureData:function(data,id,ilk){this._isFetching=false;},__onFeatureFail:function(data,id,ilk){},__onPhotoEditClick:function(event){event.stop();var el=event.element();var id=el.rel;this.__showThrobber(id);$("fileUpload"+id+"_"+id).addClassName("active");if(!this._isFetching&&!in_array(id,this._editList)){this._editList.push(id);current.proxy.CCCP.execute("item","tags",{id:id},this.__onPhotoTagData.bindAsEventListener(this,id,true),this.__onPhotoTagFail.bindAsEventListener(this,id),"get");this._isFetching=true;}else{this.__onEditMode(id,true);this.__hideThrobber(id);}},__onPhotoTagData:function(data,id,playThru){this._isFetching=false;var tags=((typeof data=="object")?data:eval("("+data+")"));if(typeof tags=="undefined"){}else{var newDiv=new Element("div",{id:"tagDisplay_"+id,"class":"",style:"clear: both; float: left; width: 164px;"});var tagCount=0;for(var i=0;i<tags.length;i++){var tagSpa=new Element("span",{"class":"tagSpan tag",style:"font-size: 11px; float: left;"});var tagDel=new Element("a",{href:"#",rel:tags[i].id,"class":"topicRemove",style:"color: #f00;"}).insert("x");var tagAnc=new Element("a",{href:"#","class":"",style:"font-weight: 600;"}).insert(tags[i].name);tagSpa.insert(tagDel);tagSpa.insert("&nbsp;");tagSpa.insert(tagAnc);if(tags.length>1&&i<tags.length-1){tagSpa.insert(",&nbsp;");}newDiv.insert(tagSpa);tagDel.observe("click",this.__onTagRemovalClick.bindAsEventListener(this,id));}Element.insert($("tags_"+id),{after:newDiv});}if(!this._isFetching&&playThru){current.proxy.CCCP.execute("item","credits",{id:id},this.__onPhotoCreditsData.bindAsEventListener(this,id,true),this.__onPhotoCreditsFail.bindAsEventListener(this,id,false),"get");this._isFetching=true;}},__onTagRemovalClick:function(event,id){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}if(confirm("This will immediately remove this tag from this item. Do you wish to proceed?")){if(!this._isFetching){var target=event.element();ContentService.unCopyContent(id,"delete",target.rel,this.__onRemoveComplete.bindAsEventListener(this,target),this.__onRemoveFail.bindAsEventListener(this,target.rel));current.uncache();this._isFetching=true;}}},__onRemoveComplete:function(data,target){this._isFetching=false;target.up().hide();},__onRemoveFail:function(data,value){this._isFetching=false;},__onPhotoTagFail:function(data,id){this._isFetching=false;this.__hideThrobber(id);},__onPhotoCreditsData:function(data,id,playThru){this._isFetching=false;var credits=((typeof data=="object")?data:eval("("+data+")"));if(typeof credits=="undefined"){}else{var newStr=new StringBuffer();var creditCount=0;var creditId=0;for(var i=0;i<credits.length;i++){newStr.append(((creditCount>0)?", ":"")+credits[i].role);creditId=credits[i].id;creditCount++;}if(creditCount>0){$("credits_"+id).value=newStr.toString();$("creditId_"+id).value=creditId;$("credits_"+id).setStyle({color:"#000"});}}if(playThru){this.__onEditMode(id,true);this.__hideThrobber(id);}},__onPhotoCreditsFail:function(data,id){this._isFetching=false;this.__hideThrobber(id);},__onPhotoChangeClick:function(event){event.stop();var el=event.element();var itemId=el.rel;$$("#readout"+itemId+" .readout").invoke("hide");if(!in_array(itemId,array_keys(this._uploaders))){var scope=this;var settings={flash_url:this._uploaderPath,upload_url:this._cgiUploadPath,file_size_limit:"1 MB",file_types:"*.jpg;*.gif;*.png",file_types_description:"Web Image Files",file_upload_limit:1,file_queue_limit:1,custom_settings:{progressTarget:"readout"+itemId,cancelButtonId:"btnCancel",photoId:itemId,multiball:"false"},debug:false,button_image_url:current.Constants.getInstance().getDatanodeUrl()+"/images/current/misc/admin/swf_upload_bg_sprite.png",button_width:"125",button_height:"26",button_placeholder_id:"spanButtonPlaceHolder"+itemId,button_text:'<span class="theFont">'+current.locale.Bundle.get("photogallery.select_a_new_file")+"</span>",button_text_style:".theFont { font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #ffffff; }",button_text_left_padding:12,button_text_top_padding:6,file_queued_handler:currentFileQueued,file_queue_error_handler:currentFileQueueError,file_dialog_complete_handler:currentFileDialogComplete,upload_start_handler:currentUploadStart,upload_progress_handler:currentUploadProgress,upload_error_handler:currentUploadError,upload_success_handler:currentUploadSuccess,upload_complete_handler:currentUploadComplete,queue_complete_handler:currentEditQueueComplete};var swfuTemp=new SWFUpload(settings);this._uploaders[itemId]=swfuTemp.movieName;}else{$(this._uploaders[itemId]).show();}},__resetImage:function(id){if($("assetUrl_"+id)){$("assetUrl_"+id).value=$("assetUrlOld_"+id).value;var thumb=new Element("img",{src:$("thumbUrlOld_"+id).value,width:"32",height:"24"});$("thumb_"+id).update(thumb);$("readout"+id).down(".fileName").innerHTML="";var x=new Element("a",{"class":"photoChangeLink",rel:id,href:"#changePhoto"}).insert("x");$("readout"+id).down(".fileName").insert(x);$("readout"+id).down(".fileName").insert("&nbsp;");var newOldName=$("assetUrlOld_"+id).value;if(newOldName.length>24){newOldName=newOldName.substring(0,24)+"...";}$("readout"+id).down(".fileName").insert(newOldName);x.observe("click",this.__onPhotoChangeClick.bindAsEventListener(this));}},onUploadifyPhotoChangeData:function(data,ID,itemId){var uploadVars=data.toQueryParams();if(uploadVars.status!="success"){this.__onUploadifyFailed(uploadVars);return ;}if($("assetUrl_"+itemId)){var tempSWF=SWFUpload.instances[this._uploaders[itemId]];tempSWF.destroy();delete this._uploaders[itemId];$("assetUrl_"+itemId).value=uploadVars.assetUrl;var thumb=new Element("img",{src:uploadVars.assetUrl,width:"32",height:"24"});$("thumb_"+itemId).update(thumb);if($("fileName"+ID)){var x=new Element("a",{"class":"photoChangeLink",rel:itemId,href:"#changePhoto"}).insert("x");Element.insert($("fileName"+ID),{top:"&nbsp;"});Element.insert($("fileName"+ID),{top:x});x.observe("click",this.__onPhotoChangeClick.bindAsEventListener(this));var placeholder=new Element("span",{id:"spanButtonPlaceHolder"+itemId});Element.insert($("fileName"+ID).up("div"),{after:placeholder});}}},onUploadifyData:function(data,id){var uploadVars=data.toQueryParams();if(uploadVars.status!="success"){this.__onUploadifyFailed(uploadVars);return ;}var suggest=new current.TagsBrowser("tags_"+id,"addTagsInputHolder",{minChars:2,tokens:",",disablePreselect:true,choices:12});if($("assetUrl_"+id)){$("assetUrl_"+id).value=uploadVars.assetUrl;var thumb=new Element("img",{src:uploadVars.assetUrl,width:"32",height:"24"});$("thumb_"+id).update(thumb);}CharacterCounter.getInstance(true);this._itemCount++;},onUploadifyDataComplete:function(num){this._runningUploadLimit=this._uploadLimit-num;if(this._runningUploadLimit<0){if(Math.abs(this._runningUploadLimit)==1){this.updateStatus("The last image in your upload queue will be ignored.","error");}else{this.updateStatus("The last "+Math.abs(this._runningUploadLimit)+" images in your upload queue will be ignored.","error");}this.updateStatus("Only "+this._galleryLimit+" images can be added to a gallery.","error");this.updateStatus("You have exceeded the maximum number of photos for this gallery.","error");}else{if(this._runningUploadLimit==0){this.updateStatus(this._runningUploadLimit+" more images can be added to this gallery.","error");}else{if(this._runningUploadLimit==1){this.updateStatus("1 more image can be added to this gallery.","status");}else{this.updateStatus(this._runningUploadLimit+" more images can be added to this gallery.","status");}}}this.onSortMe();},onUploadifyEditDataComplete:function(num){},onFormSubmit:function(event){var sels=$$(".uploadifyQueueItemBox");var selCount=0;var selLimit=sels.length;var newStr=new StringBuffer();newStr.append('{"items": [');for(var i=0;i<selLimit;i++){if(!sels[i].hasClassName("uploadifyQueueError")){var protoItem=new Object();protoItem.itemTitle=((sels[i].down(".itemTitle").value!=current.locale.Bundle.get("photogallery.add_a_title"))?sels[i].down(".itemTitle").value:"");protoItem.itemCaption=((sels[i].down(".itemCaption").value!=current.locale.Bundle.get("photogallery.add_a_caption"))?sels[i].down(".itemCaption").value:"");protoItem.itemCredits=((sels[i].down(".itemCredits").value!=current.locale.Bundle.get("photogallery.add_photo_credit"))?sels[i].down(".itemCredits").value:"");protoItem.itemTags=((sels[i].down(".itemTags").value!=current.locale.Bundle.get("photogallery.add_tags"))?sels[i].down(".itemTags").value:"");protoItem.itemAssetUrl=sels[i].down(".itemAssetUrl").value;protoItem.itemContentId=sels[i].down(".itemContentId").value;protoItem.itemIsEdit=sels[i].down(".itemIsEdit").value;var protoBlob=((selCount>0)?","+JSON.stringify(protoItem):JSON.stringify(protoItem));newStr.append(protoBlob);selCount++;}else{var gone=this._sortOrder.splice(i,1);}}newStr.append("]");newStr.append(', "order": "'+this._sortOrder.join(",")+'"}');$(this._blob).value=newStr.toString();this.showProgressMessage();return true;},showProgressMessage:function(){$("groupCreateProgress").show();$("groupAdminEdit").hide();},__onUploadifyFailed:function(data){var uploadVars=data.toQueryParams();},__hideThrobber:function(id){$("throbber_"+id).hide();},__showThrobber:function(id){$("throbber_"+id).show();}});current.utils.Uploadify.getInstance=function(){if(!document.__currentUploadify__){document.__currentUploadify__=new current.utils.Uploadify();}return document.__currentUploadify__;};current.stub("current.utils");current.utils.Url={getParam:function(key){var params=document.location.search.toQueryParams();var v=params[key];if(v==""||v==null){return null;}else{return v;}},getHashPairs:function(){var h=$H();var p=$A(window.location.hash.replace("#","").split("/")).grep(/./).partition(function(i,s){return(s%2===0);});p.first().each(function(i,s){h[i]=p.last()[s];});return h;},getHashValue:function(key){var v=current.utils.Url.getHashPairs()[key];return((v==""||v==null)?null:v);},getVersionedUrl:function(url){var v=current.Constants.getInstance().getBuildNumber();if(!v){return url;}var i=url.lastIndexOf(".");if(i!=-1){return url.substr(0,i)+"-cv"+v+url.substr(i);}return url;}};current.stub("current.user.EmailVerification");current.user.EmailVerification=Class.create({initialize:function(link){this._link=$(link);Event.observe(this._link,"click",this._resendEmail.bindAsEventListener(this));},_resendEmail:function(event){current.proxy.CCCP.execute("user","send_verification",{id:current.User.getInstance().getName()},this._setVerification.bindAsEventListener(this));},_setVerification:function(data){if(data&&data!="failed"){this._target.innerHTML="";var span=new Element("span",{className:""}).insert(current.locale.Bundle.get("verify.verification_email_sent_to")+" ");var address=new Element("em",{className:""}).insert(data);span.insert(address);this._target.insert(span);}else{this._target.innerHTML="";var span=new Element("span",{className:"unverified"}).insert(current.locale.Bundle.get("verify.An_error_has_occurred"));this._target.insert(span);}},setTarget:function(target){this._target=$(target);}});current.User=Class.create({initialize:function(){this._ip=getCookieValue(current.Cookies.IP);this._name=getCookieValue(current.Cookies.USERNAME);this._id=getCookieValue(current.Cookies.USER_ID);var locale=getCookieValue(current.Cookies.LOCALE);this._locale=(locale==null)?"en_US":locale;this._country=this._locale.substring(3,6).toLowerCase();this._language=this._locale.substring(0,2).toLowerCase();this._sessionId=this._getSessionCookie();this._isGroupAdminWrite=false;this._isItemAdminWrite=false;this._isTagAdminWrite=false;this._isUserAdminWrite=false;this._recommendItems=false;this._recommendComments=false;this._loggedIn=document.__li;deleteCookie("username");},_getSessionCookie:function(){var sessionId=getCookieValue(current.Cookies.SESSION_ID);if(sessionId==null){sessionId=Math.round(Math.random()*2147483647)+""+new Date().getTime();setTimedCookie(current.Cookies.SESSION_ID,sessionId,current.Cookies.DISTANT_EXPIRE);}return sessionId;},getIp:function(){return this._ip;},getName:function(){return this._name;},getUsername:function(){return this._name;},getId:function(){return this._id;},getLocale:function(){return this._locale;},getCountry:function(){return this._country;},getLanguage:function(){return this._language;},isEmailVerified:function(){return((document.__isVerified__)?true:false);},isGroupAdminWrite:function(){return((document.__isGroupAdminWrite__)?true:false);},setGroupAdminWrite:function(isGroupAdminWrite){this._isGroupAdminWrite=isGroupAdminWrite;},isItemAdminWrite:function(){return((document.__isItemAdminWrite__)?true:false);},setItemAdminWrite:function(isItemAdminWrite){this._isItemAdminWrite=isItemAdminWrite;},isTagAdminWrite:function(){return((document.__isTagAdminWrite__)?true:false);},setTagAdminWrite:function(isTagAdminWrite){this._isTagAdminWrite=isTagAdminWrite;},isUserAdminWrite:function(){return((document.__isUserAdminWrite__)?true:false);},setUserAdminWrite:function(isUserAdminWrite){this._isUserAdminWrite=isUserAdminWrite;},getUnreadMessages:function(){},getInvites:function(){},isLoggedIn:function(){return this._loggedIn;},setRecommendComments:function(recommendComments){this._recommendComments=recommendComments;},canRecommendComments:function(){return this._recommendComments;},setRecommendItems:function(recommendItems){this._recommendItems=recommendItems;},canRecommendItems:function(){return this._recommendItems;},getSessionId:function(){return this._sessionId;},hasCdcAuthProvider:function(){return((document.__hasCdcAuthProvider__)?document.__hasCdcAuthProvider__:false);},isCdcOnly:function(){if(this.hasCdcAuthProvider()&&!this.getFacebookId()&&!this.getTwitterId()){return true;}return false;},getFacebookId:function(){return((document.__facebookId__)?document.__facebookId__:false);},isFacebookOnly:function(){if(this.getFacebookId()&&!this.getTwitterId()&&!this.hasCdcAuthProvider()){return true;}return false;},getTwitterId:function(){return((document.__twitterId__)?document.__twitterId__:false);},isTwitterOnly:function(){if(this.getTwitterId()&&!this.getFacebookId()&&!this.hasCdcAuthProvider()){return true;}return false;}});current.User.getInstance=function(){if(!document.__currentUser__){document.__currentUser__=new current.User();}return document.__currentUser__;};current.User.filterNameByStatus=function(name,status){if((status!="active")&&(status!="timeout")){return name+" ["+current.locale.Bundle.get("removed")+"]";}return name;};current.User.filterThumbByStatus=function(thumb,status){if((status!="active")&&(status!="timeout")){return"/images/current/icons/disabled";}return thumb;};current.stub("current.user.UserAttribution");current.user.UserAttribution.get=function(addedUsername,addedUserThumbnail,addedUserStatus,currentEmployee,onTvLevel,prodLevel,contribLevel,commentLevel,dateAddedToNow){var accountStatusText="";if((addedUserStatus!="active")&&(addedUserStatus!="timeout")){var accountStatusText=" ["+current.locale.Bundle.get("removed")+"]";addedUserThumbnail="/images/current/icons/disabled";}var dl=new Element("dl",{"class":"userAttribution userAttributionComment"});dl.insert(new Element("dt",{}).insert(new Element("span",{}).insert(new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+addedUsername+".htm",title:addedUsername+accountStatusText,rel:"nofollow"}).insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+addedUserThumbnail+"_40x40.jpg",alt:addedUsername,width:"39",height:"39"})))));var userLevels=new Element("dl",{"class":"userLevels"});if(currentEmployee){userLevels.insert(new Element("dd",{}).insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/icons/userlevels/levels_staff.gif",width:"12",height:"39"})));}else{userLevels.insert(new Element("dd",{}).insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/current/userlevels/levels_"+onTvLevel+prodLevel+contribLevel+commentLevel+".gif",width:"11",height:"39"})));}dl.insert(new Element("dd",{}).insert(new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+addedUsername+".htm",title:addedUsername,rel:"nofollow"}).insert(userLevels)));dateAddedToNow=dateFormat.timespanInWords(dateAddedToNow);var usernameDate=new Element("ul",{});usernameDate.insert(new Element("li",{"class":"username"}).insert(new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+addedUsername+".htm"}).update(addedUsername+accountStatusText)));usernameDate.insert(new Element("li",{"class":"actionDate"}).update(dateAddedToNow));dl.insert(new Element("dd",{"class":"userInfo"}).insert(usernameDate));return dl;};current.user.UserAttribution.getCover=function(addedUsername,addedUserThumbnail,loggedIn){var div=new Element("div",{"class":"floatLeft "+addedUsername});if(addedUserThumbnail){if(!loggedIn){div.insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+addedUserThumbnail+"_60x60.jpg",alt:addedUsername,width:"60",height:"60"}));}else{div.insert(new Element("a",{href:current.Constants.getInstance().getServerName()+"/users/"+addedUsername+".htm",title:addedUsername,rel:"nofollow"}).insert(new Element("img",{src:current.Constants.getInstance().getDatanodeUrl()+addedUserThumbnail+"_60x60.jpg",alt:addedUsername,width:"60",height:"60"})));}}return div;};var MessagingModel=Class.create();MessagingModel.prototype={initialize:function(){this._messages=new Array();this._blockList=new Array();this._order="date";},getMessageNode:function(){return $("messageList");},pushMessage:function(messageObject){this._messages.push(messageObject);},getStartIndex:function(){return this._startIndex;},setStartIndex:function(newStartIndex){this._startIndex=newStartIndex;},setMessageLength:function(newLength){this._messageLength=newLength;},getMessageLength:function(){return this._messageLength;},setCurrentPage:function(newCount){this._currentPage=newCount;},getCurrentPage:function(){return this._currentPage;},setTotalPages:function(newCount){this._totalPages=newCount;},getTotalPages:function(){return this._totalPages;},setTotalMessageCount:function(newCount){this._totalMessageCount=newCount;},getTotalMessageCount:function(){return this._totalMessageCount;},getNextIndex:function(){this.getStartIndex()+this.getLength();},setView:function(newView){this._view=newView;},getView:function(){return this._view;},getOrder:function(){return this._order;},setOrder:function(newOrder){this._order=newOrder;},getMessageCount:function(){return this._messages.length;},getMessageElementById:function(messageId){var c=this.getMessageCount();for(var i=0;i<c;i++){if(messageId==this._messages[i].getMessageId()){return this._messages[i].getMessageElement();}}return false;},getMessageIdByElement:function(element){},getMessageIds:function(){},getMessages:function(){return this._messages;},setFriends:function(friendArr){this._friends=friendArr;},getFriends:function(){return this._friends;},setGroups:function(groupsArr){this._groups=groupsArr;},getGroups:function(){return this._groups;},removeAtIndex:function(index){this._messages[i]=null;},setBlockList:function(blockedArr){this._blockList=blockedArr;},getBlockList:function(){return this._blockList;}};MessagingModel.getInstance=function(){if(!document.__messagingModel__){document.__messagingModel__=new MessagingModel();}return document.__messagingModel__;};var MessagingController=Class.create();MessagingController.prototype={initialize:function(){this._model=new MessagingModel();this._bindElementEventListeners();this._handleHash(document.location.hash);FriendService.getMyBlockedUsers(current.User.getInstance().getUsername(),this._onBlockedUserData.bindAsEventListener(this));},VIEW_COMPOSE:String("compose"),_handleHash:function(hash){query=hash.split("#").join("").toQueryParams();if(null!=query.view&&query.view==this.VIEW_COMPOSE&&query.userId!=null&&query.username!=null){this._onComposeToPerson(null,query.userId,query.username,null);}},onMessageOpen:function(event,messageObject,messageElement){$(messageElement).down(".messageBody").toggle();if($(messageElement).down(".messageStatusImage")){if($(messageElement).down(".messageUnread")){MessageService.markAsRead(messageObject.messageId,"read",this.onMarkedAsRead.bindAsEventListener(this));}else{return ;}}else{return ;}},onCloseClick:function(event,message){event.element().up(".messageBody").hide();},onDeleteClick:function(event,message){if(!current.Authorize.checkWriteMode(event)){return ;}if(confirm(current.locale.Bundle.get("messagesJS.deleteConfirmSingle"))){MessageService.messageDelete(message.messageId,"delete",this.onDeleteComplete.bindAsEventListener(this,message.messageId));}},onDeleteSelectedClick:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}var messages=this.fetchCheckedMessages();if(messages.length<1||!confirm(current.locale.Bundle.get("messagesJS.deleteConfirmMultiple"))){return ;}for(var m=0;m<messages.length;m++){MessageService.messageDelete(messages[m],"delete",this.onDeleteSelectedComplete.bindAsEventListener(this,m,messages.length));}},onDeleteComplete:function(data,messageId){this.fetchMessagePayload();},onDeleteSelectedComplete:function(data,m,len){if(m==len-1){this.fetchMessagePayload();}},fetchCheckedMessages:function(){var checkedIds=new Array();var messageNode=this._model.getMessageNode();var checkboxes=$$("#"+messageNode.identify()+" .messageCheckBox");var c=checkboxes.length;if(c<1){return checkedIds;}for(var i=0;i<c;i++){var check=checkboxes[i];if(check.checked){checkedIds.push($F(check));}}return checkedIds;},_onAddComplete:function(data){document.location.reload();},openComposeWindow:function(event){this._modalWidth=715;this._headline=current.locale.Bundle.get("messages.compose_a_message");if(!isUndefined(event)&&event!=null){this._posTop=event.element().cumulativeOffset()["top"];}else{this._posTop=80;}this._winWidth=document.viewport.getWidth();this._posLeft=parseFloat(parseFloat(parseFloat(this._winWidth)-parseFloat(this._modalWidth))/2);if(this._posLeft<10){this._posLeft=10;}this._posTop=(this._posTop-120);if(this._posTop<80){this._posTop=80;}var wrapper='<div class="accountModalTitle" style="width: 660px;"><a id="composeCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="shareModalBody" style="width: 660px;"></div>';if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._posLeft=this._posLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._posLeft,offsetTop:this._posTop,overlayDisplay:false,width:this._modalWidth,closeButton:false,containerClassName:"composeModalContainer",disableWindowObserver:true,afterOpen:this.__onModalOpen.bindAsEventListener(this),beforeClose:this.__resetModalWindow.bindAsEventListener(this)});},__onModalOpen:function(event){document.__modalOpenL1__=true;$("shareModalBody").insert($("compose"));$("compose").show();$("composeCloseButton").observe("click",this.onComposeClose.bindAsEventListener(this));$("composeCancelButton").observe("click",this.onComposeClose.bindAsEventListener(this));$("messageText").observe("keyup",this.__onTextKeyUp.bindAsEventListener(this));this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});},__resetModalWindow:function(event){document.__modalOpenL1__=false;$("compose").hide();Validation.reset("sendToSelect");Validation.reset("messageSubject");Validation.reset("messageText");$("messageText").rows="6";$("composeHolder").insert($("compose"));this._draggable.destroy();return true;},__onTextKeyUp:function(event){current.utils.Compatibility.adjustRows($("messageText"),6);},_onComposeToPerson:function(event,userId,username,subject){var s=$("sendToSelect");s.hide();s.setAttribute("name","sendToBlock");if(subject!=null){if(subject.substring(0,4)!="RE: "){subject="RE: "+subject;}$("messageSubject").value=subject;}var replayName=Builder.node("span",{id:"messageNameHolder"},[Builder.node("input",{type:"hidden",name:"composeMessage[sendTo]",value:"u-"+username}),username]);$("messageNameHolder").parentNode.replaceChild(replayName,$("messageNameHolder"));$("messageText").value="";this.openComposeWindow(event);},onReplyClick:function(event,message){if(!current.Authorize.checkWriteMode(event)){return ;}this._onComposeToPerson(event,message.senderId,message.senderUsername,message.header);},onComposeOpen:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}$("messageNameHolder").innerHTML="";var s=$("sendToSelect");s.setAttribute("name","composeMessage[sendTo]");s.show();$("messageSubject").value="";$("messageText").value="";this.openComposeWindow(event);},onComposeClose:function(event){Control.Modal.close();},onBlockClick:function(event,message){if(!current.Authorize.checkWriteMode(event)){return ;}var confirmMsg=new Template(current.locale.Bundle.get("messagesJS.confirmBlockUser"));var data={username:message.senderUsername};if(message.senderBlocked==true){confirmMsg=new Template(current.locale.Bundle.get("messagesJS.confirmUnblockUser"));if(confirm(confirmMsg.evaluate(data))){FriendService.unblockUser(current.User.getInstance().getUsername(),message.senderUsername,this.__onUnblockUser.bindAsEventListener(this,message));}}else{if(confirm(confirmMsg.evaluate(data))){FriendService.blockUser(current.User.getInstance().getUsername(),message.senderUsername,this.__onBlockUser.bindAsEventListener(this,message));}}},__onBlockUser:function(data,message){var blocklist=this._model.getBlockList();blocklist.push(message.senderUsername);this._model.setBlockList(blocklist);this.fetchMessagePayload();},__onUnblockUser:function(data,message){var blocklist=this._model.getBlockList();blocklist=blocklist.reject(function(b){return b==message.senderUsername;});this._model.setBlockList(blocklist);this.fetchMessagePayload();},onMarkedAsRead:function(data){if(isUndefined(data)){return ;}var messageElement=this._model.getMessageElementById(data.messageId);var statusIcon=$(messageElement).down(".messageStatusImage");$(statusIcon).removeClassName("messageUnread");$(statusIcon).addClassName("messageRead");var subStatus=$(messageElement).down(".messageSubject");$(subStatus).removeClassName("subjectUnread");$(subStatus).addClassName("subjectRead");this._updateCounters();},onSortClick:function(event,node){var type=node.rel;var asc="Asc";var desc="Desc";var newOrder;if(this._model.getOrder()==(type+desc)){newOrder=asc;}else{newOrder=desc;}var sortSpans=$$("#"+$("messageListHeader").identify()+" .sortDirection");sortSpans.each(function(el){el.addClassName("sortDirectionNone");el.removeClassName("sortDirectionAsc");el.removeClassName("sortDirectionDesc");});var activeSpan=$(node.id+"Direction");activeSpan.removeClassName("sortDirectionNone");activeSpan.addClassName("sortDirection"+newOrder);this._model.setOrder(type+newOrder);this._model.setStartIndex(0);this.fetchMessagePayload();},onSelectAll:function(){var checks=$$(".messageCheckBox");if(checks.length<1){return false;}checks.each(function(node){node.checked=!node.checked;});return false;},first:function(){$("messagingPreviousPage").addClassName("previousPagesOff");$("messagingPreviousPageTwo").addClassName("previousPagesOff");this.fetchMessagePayload();},next:function(){var start=this._model.getStartIndex()+this._model.getMessageLength();if(start>=this._model.getTotalMessageCount()){return ;}this._model.setStartIndex(start);this.fetchMessagePayload();},previous:function(){if(this._model.getStartIndex()<=0){return ;}var start=this._model.getStartIndex()-this._model.getMessageLength();if(start<0){start=0;}this._model.setStartIndex(start);this.fetchMessagePayload();},goToPage:function(pageNum){this._model.setStartIndex((pageNum-1)*this._model.getMessageLength());this.fetchMessagePayload();},fetchMessagePayload:function(){var curPage=getCookieValue("Current_MessageInboxPage");if(typeof curPage!="undefined"&&curPage!="undefined"&&curPage!=null){this._model.setStartIndex((curPage-1)*this._model.getMessageLength());deleteCookie("Current_MessageInboxPage");}MessageService.messagePayload(current.User.getInstance().getUsername(),this._model.getOrder(),this._model.getView(),this._model.getStartIndex(),this._model.getMessageLength(),this.onPayloadLoad.bindAsEventListener(this));},onPayloadLoad:function(data){if(this._model.getMessages().length>0){this._removeAll();}var payload=eval(data);this._model.setTotalPages(payload.totalPages);this._model.setCurrentPage(payload.currentPage);this._model.setTotalMessageCount(payload.totalCount);var messageList=payload.items;var count=messageList.length;for(var i=0;i<count;i++){var m=new MessageBuilder("messageList",payload.items[i]);m.getMessage();this._model.pushMessage(m);}this._updateCounters();this._updatePagingButtons();this._updatePageLinks();},_onBlockedUserData:function(data){var scope=this;scope._blocklist=new Array();data.each(function(data){scope._blocklist.push(data.username);});this._model.setBlockList(scope._blocklist);},_isSenderBlocked:function(username){var list=this._model.getBlockList();var scope=this;scope._blocked=false;list.each(function(l){if(l==username){scope._blocked=true;}});return scope._blocked;},_updateBottomLinks:function(){$("messageListNavSouth").update($("messageListNav").innerHTML);},_updateCounters:function(){var start=this._model.getStartIndex();if(this._model.getTotalMessageCount()>0){start++;}if(start>(this._model.getStartIndex()+this._model.getMessageCount())){this.goToPage(this._model.getCurrentPage()-1);return ;}$("messageStartIndex").innerHTML=start;$("messageEndIndex").innerHTML=this._model.getStartIndex()+this._model.getMessageCount();$("totalMessageCount").innerHTML=this._model.getTotalMessageCount();$("messageStartIndexTwo").innerHTML=start;$("messageEndIndexTwo").innerHTML=this._model.getStartIndex()+this._model.getMessageCount();$("totalMessageCountTwo").innerHTML=this._model.getTotalMessageCount();MessageService.unreadCount(current.User.getInstance().getUsername(),onUnreadInboxCountData.bindAsEventListener(document,$("unreadMessageNotice"),$("unreadMessageCount")));},_updatePagingButtons:function(){if(this._model.getCurrentPage()<=1){$("messagingPreviousPage").addClassName("previousPagesOff");$("messagingPreviousPageTwo").addClassName("previousPagesOff");}else{$("messagingPreviousPage").removeClassName("previousPagesOff");$("messagingPreviousPageTwo").removeClassName("previousPagesOff");}if(this._model.getCurrentPage()>=this._model.getTotalPages()){$("messagingNextPage").addClassName("nextPagesOff");$("messagingNextPageTwo").addClassName("nextPagesOff");}else{$("messagingNextPage").removeClassName("nextPagesOff");$("messagingNextPageTwo").removeClassName("nextPagesOff");}},_updatePageLinks:function(){var tot=this._model.getTotalPages();var totMsg=this._model.getTotalMessageCount();var cur=this._model.getCurrentPage();var stInd=this._model.getStartIndex();var pageSets=$$(".pager-list");pageSets.each(function(el){displayPaginationPages(el,tot,totMsg,cur,stInd);});},_removeAll:function(){var m=this._model.getMessages();var c=m.length;for(var i=0;i<c;i++){Element.remove(m[i].getMessageElement());}this._model.getMessages().clear();},getModel:function(){return this._model;},_bindElementEventListeners:function(){Event.observe($("messagingNextPage"),"click",this.next.bindAsEventListener(this));Event.observe($("messagingPreviousPage"),"click",this.previous.bindAsEventListener(this));Event.observe($("messagingNextPageTwo"),"click",this.next.bindAsEventListener(this));Event.observe($("messagingPreviousPageTwo"),"click",this.previous.bindAsEventListener(this));Event.observe($("selectAllLink"),"click",this.onSelectAll.bindAsEventListener(this));Event.observe($("sortByFromLink"),"click",this.onSortClick.bindAsEventListener(this,$("sortByFromLink")));Event.observe($("sortByDateLink"),"click",this.onSortClick.bindAsEventListener(this,$("sortByDateLink")));Event.observe($("composeLink"),"click",this.onComposeOpen.bindAsEventListener(this));Event.observe($("deleteSelectedButton"),"click",this.onDeleteSelectedClick.bindAsEventListener(this));}};displayPaginationPages=function(el,totalPages,totalMessages,currentPage,startIndex){$(el).innerHTML="";totalPages=totalPages-1;var size=10;var maxLinks=10;var lastIndex=(totalPages*size)-size;var linkRange=Math.ceil(maxLinks/2);var isShort=((startIndex>=size&&totalPages>maxLinks)&&(currentPage-linkRange)>1);var startPage=(isShort)?(currentPage-linkRange):1;var isLong=(totalPages>maxLinks&&(currentPage+linkRange)<totalPages);var endPage=Math.min(currentPage+linkRange,totalPages+1);if(totalPages<=1){return ;}if(isShort){var shortish=Builder.node("a",{href:"#",onclick:"messagingController.goToPage(1); return false;"},["1"]);$(el).insert(shortish);$(el).insert(Builder.node("div",{},[Builder.node("span",{className:"dots"},["..."])]));}for(var i=startPage;i<endPage;i++){var s=(i*size)+(startIndex%size);var item;if(s==startIndex+1){item=Builder.node("a",{href:"#",onclick:"messagingController.goToPage("+i+"); return false;",className:"active"},[i]);}else{if(i==currentPage){item=Builder.node("a",{href:"#",onclick:"messagingController.goToPage("+i+"); return false;",className:"active"},[i]);}else{item=Builder.node("a",{href:"#",onclick:"messagingController.goToPage("+i+"); return false;"},[i]);}}$(el).insert(item);}if(isLong){$(el).insert(Builder.node("div",{},[Builder.node("span",{className:"dots"},["..."])]));var longish=Builder.node("a",{href:"#",onclick:"messagingController.goToPage("+totalPages+"); return false;"},[totalPages]);$(el).insert(longish);}};onUnreadInboxCountData=function(data,node,counter){var num=parseInt(data,10);if(isNaN(num)){num=0;}counter.innerHTML="";counter.insert(num+"");};var MessageControlView=Class.create();MessageControlView.prototype={initialize:function(controller,message){this._message=message;this._controller=controller;},getControls:function(){this._node=Builder.node("ul",{className:"messageControl"});if((this._message.senderAccountStatus=="active")||(this._message.senderAccountStatus=="timeout")){this._node.appendChild(this.getReply());}var senderId=this._message.senderId;var friends=this._controller.getModel().getFriends();this._node.appendChild(this.getDelete());this._node.appendChild(this.getClose());return this._node;},getReply:function(){if(this._controller.getModel().getView()=="sent"){return Builder.node("li");}var replyNode=Builder.node("li",{},[this._reply=Builder.node("a",{href:"#",onclick:"return false;"},[Builder.node("span",{className:"Sprites messageControlImage messageControlReply"}),current.locale.Bundle.get("messages.Reply")])]);return replyNode;},getDelete:function(){var deleteNode=Builder.node("li",{},[this._delete=Builder.node("a",{href:"#",onclick:"return false;"},[Builder.node("span",{className:"Sprites messageControlImage messageControlDelete"},""),current.locale.Bundle.get("messages.Delete")])]);return deleteNode;},getClose:function(){var closeNode=Builder.node("li",{},[this._close=Builder.node("a",{href:"#",onclick:"return false;"},[Builder.node("span",{className:"Sprites messageControlImage messageControlClose"},""),current.locale.Bundle.get("messages.Close")])]);return closeNode;},getBlockUser:function(){if(this._controller.getModel().getView()=="sent"){return Builder.node("div");}this._message.senderBlocked=this._controller._isSenderBlocked(this._message.senderUsername);var blockString=current.locale.Bundle.get("messages.block_user");if(this._message.senderBlocked==true){blockString=current.locale.Bundle.get("messages.unblock_user");}var block=Builder.node("div",{className:"blockLinkHolder"},[this._block=Builder.node("a",{href:"#",onclick:"",className:"blockUserLink"},[Builder.node("img",{src:current.Constants.getInstance().getDatanodeUrl()+"/images/spacer.gif",align:"absmiddle",className:"Sprites blockUserIcon nudgeLeft",style:"float: left; text-decoration: none"}),blockString+" "+this._message.senderUsername])]);return block;},addEventListeners:function(){if(this._reply!=null){Event.observe(this._reply,"click",this._controller.onReplyClick.bindAsEventListener(this._controller,this._message));}Event.observe(this._delete,"click",this._controller.onDeleteClick.bindAsEventListener(this._controller,this._message));Event.observe(this._close,"click",this._controller.onCloseClick.bindAsEventListener(this._controller,this._message));if(this._block!=null){Event.observe(this._block,"click",this._controller.onBlockClick.bindAsEventListener(this._controller,this._message));}}};MessageBuilder=Class.create();MessageBuilder.prototype={initialize:function(targetNode,messageObject){this._message=messageObject;this._controller=messagingController;this._element=null;this._targetNode=$(targetNode);this._dataNodeUrl=current.Constants.getInstance().getDatanodeUrl();},getMessage:function(){var holderId=this._message.messageId+"_h";this._element=Builder.node("li",{id:holderId});if(this._controller.getModel().getView()=="sent"){if(this._message.group){this._element.appendChild(Builder.node("img",{src:this._dataNodeUrl+this._message.group.thumbnail,width:"40px",height:"40px"}));}else{this._element.appendChild(Builder.node("img",{src:this._dataNodeUrl+current.User.filterThumbByStatus(this._message.recipientThumbnail,this._message.recipientAccountStatus)+"_40x40.jpg",width:"40px",height:"40px"}));}}else{this._element.appendChild(Builder.node("img",{src:this._dataNodeUrl+current.User.filterThumbByStatus(this._message.senderThumbnail,this._message.senderAccountStatus)+"_40x40.jpg",width:"40px",height:"40px"}));}this._element.appendChild(this.getMessageSubject());this._element.appendChild(this.getMessageStatus());this._element.appendChild(this.getMessageDetails());this._element.appendChild(body=this.getMessageBody());this._targetNode.appendChild(this._element);var controls=new MessageControlView(this._controller,this._message);body.appendChild(controls.getControls());body.appendChild(controls.getBlockUser());controls.addEventListeners();Event.observe(this._openLink,"click",this._controller.onMessageOpen.bindAsEventListener(this._controller,this._message,this._element));},getMessageSubject:function(){var clName="messageSubject";var subjText=this._message.header;if(subjText==""||subjText==null){clName="messageSubjectNone";subjText="<"+current.locale.Bundle.get("messagesJS.noSubject")+">";}clName+=" "+((this._message.read)?"subjectRead":"subjectUnread");var subject=Builder.node("div",{className:clName},[this._openLink=Builder.node("a",{href:"#",onClick:"return false;"},subjText)]);return subject;},getMessageStatus:function(){var stat;var messageStatus=(this._message.read)?"messageRead":"messageUnread";if(this._controller.getModel().getView()!="sent"){stat=Builder.node("span",{className:"Sprites messageStatusImage "+messageStatus}," ");}var statusLine=Builder.node("div",{className:"messageStatus"},[stat,Builder.node("input",{type:"checkbox",name:"checkMessageId",value:this._message.messageId,className:"messageCheckBox"})]);return statusLine;},getMessageDetails:function(){var message=new Template(current.locale.Bundle.get("messagesJS.statusMsgIn"));var data={recipient:this._message.recipientUsername,recipient_display:current.User.filterNameByStatus(this._message.recipientUsername,this._message.recipientAccountStatus),sender:this._message.senderUsername,sender_display:current.User.filterNameByStatus(this._message.senderUsername,this._message.senderAccountStatus),date:this._message.dateCreated};if(this._controller.getModel().getView()=="sent"){if(this._message.group){data={name:this._message.group.name,slug:this._message.group.slug,date:this._message.dateCreated};message=new Template(current.locale.Bundle.get("messagesJS.statusGroupMsgOut"));}else{message=new Template(current.locale.Bundle.get("messagesJS.statusMsgOut"));}}return(new Element("div",{className:"messageDetails"}).update(message.evaluate(data)));},getMessageBody:function(){var text=this._message.body;text=current.utils.Strings.autolinkUrls(text);text=text.replace(/\n/g,"<br/>");var node=new Element("div",{className:"messageBody",style:"display:none"});node.update(text);return node;},getMessageId:function(){return this._message.messageId;},getMessageElement:function(){return this._element;}};var MessagingPortableController=Class.create({initialize:function(){this._subject="";this._groupSlug="";this._groupTitle="";this._toUsername="";},init:function(form,entity){this._entity=entity;this._composeForm=$(form);this._formDisplayArea=$("composeFormFieldList");this._statusMessage=$("composeFormStatusMessage");this._composeCancelLink=$("composeCancelButton");this._composeDoneLink=$("composeDoneButton");this._messageText=$("messageText");},setEntity:function(entity){this._entity=entity;},getEntity:function(){return this._entity;},setSubject:function(subject){this._subject=subject;},getSubject:function(){return this._subject;},setGroupSlug:function(slug){this._groupSlug=slug;},getGroupSlug:function(){return this._groupSlug;},setGroupTitle:function(title){this._groupTitle=title;},getGroupTitle:function(){return this._groupTitle;},setToUsername:function(username){this._toUsername=username;},getToUsername:function(){return this._toUsername;},openComposeWindow:function(event){this._modalWidth=715;this._headline=current.locale.Bundle.get("messages.compose_a_message");this._eventElement=current.utils.Compatibility.getEventElement(event);if(!isUndefined(event)&&event!=null){this._posTop=this._eventElement.cumulativeOffset()["top"];}else{this._posTop=80;}this._winWidth=document.viewport.getWidth();this._posLeft=parseFloat(parseFloat(parseFloat(this._winWidth)-parseFloat(this._modalWidth))/2);if(this._posLeft<10){this._posLeft=10;}this._posTop=(this._posTop-120);if(this._posTop<80){this._posTop=80;}var wrapper='<div class="accountModalTitle" style="width: 660px;"><a id="composeCloseButton" class="Sprites accountModalCloseButton floatRight" href="#" onclick="return false;" title="'+current.locale.Bundle.get("messages.Close")+'"></a>'+this._headline+'</div><div id="shareModalBody" style="width: 660px;"></div>';if(Prototype.Browser.IE){if(!isUndefined(this._modalPosLeft)){this._posLeft=this._posLeft+10;}this._modalWidth=this._modalWidth-10;wrapper='<div class="accountModalBox"><div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>'+wrapper+"</div>";}else{wrapper='<div class="smartModalContainer">'+wrapper+"</div>";}Control.Modal.open(false,{contents:wrapper,position:"relative",offsetLeft:this._posLeft,offsetTop:this._posTop,overlayDisplay:false,width:this._modalWidth,closeButton:false,containerClassName:"composeModalContainer",disableWindowObserver:true,afterOpen:this.__onModalOpen.bindAsEventListener(this),beforeClose:this.__resetModalWindow.bindAsEventListener(this)});},__onModalOpen:function(event){document.__modalOpenL1__=true;$("shareModalBody").insert($("compose"));$("compose").show();this._composeCloseLink=$("composeCloseButton");this.observeModalElements();this._draggable=new Draggable("modal_container",{handle:"accountModalTitle",zindex:9999,scroll:window,starteffect:null,endeffect:null});},__resetModalWindow:function(event){document.__modalOpenL1__=false;$("compose").hide();Validation.reset("sendToSelect");Validation.reset("messageSubject");Validation.reset("messageText");this._messageText.rows="6";$("composeHolder").insert($("compose"));this._reset();this._draggable.destroy();return true;},__onTextKeyUp:function(event){current.utils.Compatibility.adjustRows(this._messageText,6);},composeToPerson:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var s=$("sendToSelect");s.hide();s.setAttribute("name","sendToBlock");var subject=this.getSubject();if(subject!=null){if(subject.substring(0,4)!="RE: "){subject="RE: "+subject;}$("messageSubject").value=subject;}var replayName=Builder.node("span",{id:"messageNameHolder"},[Builder.node("input",{type:"hidden",name:"composeMessage[sendTo]",value:this.getToUsername()}),this.getToUsername()]);$("messageNameHolder").parentNode.replaceChild(replayName,$("messageNameHolder"));$("messageText").value="";this.openComposeWindow(event);},composeToGroup:function(event){event.stop();if(!current.Authorize.checkWriteMode(event)){return ;}var s=$("sendToSelect");s.hide();s.setAttribute("name","sendToBlock");var replayName=Builder.node("span",{id:"messageNameHolder"},[Builder.node("input",{type:"hidden",name:"composeMessage[sendTo]",value:this.getGroupSlug()}),this.getGroupTitle()]);$("messageSubject").value=this.getSubject();$("messageNameHolder").parentNode.replaceChild(replayName,$("messageNameHolder"));$("messageText").value="";this.openComposeWindow(event);},onComposeOpen:function(event){if(!current.Authorize.checkWriteMode(event)){return ;}$("messageNameHolder").innerHTML="";var s=$("sendToSelect");s.setAttribute("name","composeMessage[sendTo]");s.show();$("messageSubject").value="";$("messageText").value="";this.openComposeWindow();},__onComposeClose:function(event){Control.Modal.close();},_reset:function(){this._formDisplayArea.show();this._statusMessage.down("div").innerHTML="";this._statusMessage.down("div").removeClassName("paramError");this._statusMessage.down("div").addClassName("paramStatus");this._statusMessage.hide();this._composeDoneLink.hide();$("messageNameHolder").innerHTML="";$("messageSubject").value="";$("messageText").value="";this.stopObservingModalElements();},observeModalElements:function(){this.composeFormObserver=this.__onFormSubmit.bindAsEventListener(this);this._composeForm.observe("submit",this.composeFormObserver);this.composeCloseLinkObserver=this.__onComposeClose.bindAsEventListener(this);this._composeCloseLink.observe("click",this.composeCloseLinkObserver);this.composeCancelLinkObserver=this.__onComposeClose.bindAsEventListener(this);this._composeCancelLink.observe("click",this.composeCancelLinkObserver);this.composeDoneLinkObserver=this.__onComposeClose.bindAsEventListener(this);this._composeDoneLink.observe("click",this.composeDoneLinkObserver);this.messageTextObserver=this.__onTextKeyUp.bindAsEventListener(this);this._messageText.observe("keyup",this.messageTextObserver);},stopObservingModalElements:function(){this._composeForm.stopObserving("submit",this.composeFormObserver);this._composeCloseLink.stopObserving("click",this.composeCloseLinkObserver);this._composeCancelLink.stopObserving("click",this.composeCancelLinkObserver);this._composeDoneLink.stopObserving("click",this.composeDoneLinkObserver);this._messageText.stopObserving("keyup",this.messageTextObserver);},_displayError:function(){var statusDiv=this._statusMessage.down("div");statusDiv.innerHTML=current.locale.Bundle.get("messages.messageNotSent")+" "+current.locale.Bundle.get("error.tryAgain");statusDiv.removeClassName("paramStatus");statusDiv.addClassName("paramError");this._statusMessage.show();Effect.Pulsate(statusDiv,{pulses:2,duration:1});},__onFormSubmit:function(event){event.stop();var r=Validation.validate("sendToSelect");var s=Validation.validate("messageSubject");var t=Validation.validate("messageText");if(!r||!t||!s){return ;}new Ajax.Request(current.Constants.getInstance().getScriptName()+"/message_send/"+this.getEntity(),{method:"post",parameters:this._composeForm.serialize(true),evalJS:false,onSuccess:this.__onSuccess.bindAsEventListener(this),onFailure:this.__onFailure.bindAsEventListener(this)});},__onSuccess:function(data){if(data.responseText=="false"){this._displayError();return false;}this._formDisplayArea.hide();this._statusMessage.down("div").innerHTML=current.locale.Bundle.get("messages.messageSent");this._statusMessage.show();this._composeDoneLink.show();return false;},__onFailure:function(data){this._displayError();}});Object.Event.extend(MessagingPortableController);MessagingPortableController.getInstance=function(){if(!document.__messagingPortableController__){document.__messagingPortableController__=new MessagingPortableController();}return document.__messagingPortableController__;};(function(){var aa="_gat",s="_gaq",v=true,w=false,x=undefined,ba="4.5.9",z="length",A="cookie",C="location",D="&",E="=",F="__utma=",H="__utmb=",I="__utmc=",ca="__utmk=",K="__utmv=",L="__utmz=",M="__utmx=",da="GASO=";var N=function(f){return x==f||"-"==f||""==f;},ea=function(f){return f[z]>0&&" \n\r\t".indexOf(f)>-1;},Q=function(f,i,b){var j="-",c;if(!N(f)&&!N(i)&&!N(b)){c=f.indexOf(i);if(c>-1){b=f.indexOf(b,c);if(b<0){b=f[z];}j=P(f,c+i.indexOf(E)+1,b);}}return j;},fa=function(f){var i=w,b=0,j,c;if(!N(f)){i=v;for(j=0;j<f[z];j++){c=f.charAt(j);b+="."==c?1:0;i=i&&b<=1&&(0==j&&"-"==c||".0123456789".indexOf(c)>-1);}}return i;},R=function(f,i){var b=encodeURIComponent;return b instanceof Function?i?encodeURI(f):b(f):escape(f);},T=function(f,i){var b=decodeURIComponent,j;f=f.split("+").join(" ");if(b instanceof Function){try{j=i?decodeURI(f):b(f);}catch(c){j=unescape(f);}}else{j=unescape(f);}return j;},U=function(f,i){return f.indexOf(i)>-1;},V=function(f,i){f[f[z]]=i;},W=function(f){return f.toLowerCase();},X=function(f,i){return f.split(i);},ga=function(f,i){return f.indexOf(i);},P=function(f,i,b){b=x==b?f[z]:b;return f.substring(i,b);},ia=function(f,i){return f.join(i);},ja=function(f){var i=1,b=0,j;if(!N(f)){i=0;for(j=f[z]-1;j>=0;j--){b=f.charCodeAt(j);i=(i<<6&268435455)+b+(b<<14);b=i&266338304;i=b!=0?i^b>>21:i;}}return i;},ka=function(){var f=window,i=x;if(f&&f.gaGlobal&&f.gaGlobal.hid){i=f.gaGlobal.hid;}else{i=Y();f.gaGlobal=f.gaGlobal?f.gaGlobal:{};f.gaGlobal.hid=i;}return i;},Y=function(){return Math.round(Math.random()*2147483647);},Z={Ha:function(f,i){this.bb=f;this.nb=i;},t:63072000000,ib:w,_gasoDomain:x,_gasoCPath:x};Z.Gb=function(){var f=this,i=Z.Ha;function b(c){return new i(c[0],c[1]);}function j(c){var p=[];c=c.split(",");var m;for(m=0;m<c.length;++m){p.push(b(c[m].split(":")));}return p;}f.Ia="utm_campaign";f.Ja="utm_content";f.Ka="utm_id";f.La="utm_medium";f.Ma="utm_nooverride";f.Na="utm_source";f.Oa="utm_term";f.Pa="gclid";f.ba=0;f.z=0;f.Ya="15768000";f.sb="1800";f.ta=[];f.va=[];f.nc="cse";f.oc="q";f.ob=5;f.T=j("images.google:q,google:q,yahoo:p,msn:q,bing:q,aol:query,aol:encquery,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,looksmart:qt,about:terms,mamma:query,alltheweb:q,gigablast:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,aol:q,club-internet:query,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,netsprint:q,google.interia:q,szukacz:q,yam:k,pchome:q,kvasir:q,sesam:q,ozu:q,terra:query,nostrum:query,mynet:q,ekolay:q,search.ilse:search_for,rambler:words");f.u=x;f.lb=w;f.h="/";f.U=100;f.oa="/__utm.gif";f.ga=1;f.ha=1;f.v="|";f.fa=1;f.da=1;f.Ra=1;f.b="auto";f.I=1;f.ra=1000;f.Jc=10;f.Pb=10;f.Kc=0.2;f.o=x;f.a=document;f.e=window;};Z.Hb=function(f){var i=this,b=f;i.r=(new Date).getTime();var j=[F,H,I,L,K,M,da];function c(k,n,r,a){var d="",l=0;d=Q(k,"2"+n,";");if(!N(d)){k=d.indexOf("^"+r+".");if(k<0){return["",0];}d=P(d,k+r[z]+2);if(d.indexOf("^")>0){d=d.split("^")[0];}r=d.split(":");d=r[1];l=parseInt(r[0],10);if(!a&&l<i.r){d="";}}if(N(d)){d="";}return[d,l];}i.k=function(){var k=b.a[A];return b.o?i.Wb(k,b.o):k;};i.Wb=function(k,n){var r=[],a,d;for(a=0;a<j[z];a++){d=c(k,j[a],n)[0];N(d)||(r[r[z]]=j[a]+d+";");}return r.join("");};i.l=function(k,n,r){var a=r>0?h(r):"";if(b.o){n=i.kc(b.a[A],k,b.o,n,r);k="2"+k;a=e(r);}q(k+n,a);};i.kc=function(k,n,r,a,d){var l="";d=p(d);a=m([a,i.r+d*1],r);l=Q(k,"2"+n,";");if(!N(l)){k=m(c(k,n,r,v),r);l=ia(l.split(k),"");return l=a+l;}return a;};function p(k){return k||Z.t;}function m(k,n){return"^"+ia([[n,k[1]].join("."),k[0]],":");}function q(k,n){b.a[A]=k+"; path="+b.h+"; "+n+i.fb();}i.fb=function(){return N(b.b)?"":"domain="+b.b+";";};function e(k){return k>0?g():"";}function g(){return h(Z.t);}function h(k){var n=new Date;k=new Date(n.getTime()+k);return"expires="+k.toGMTString()+"; ";}};Z.$=function(f){var i,b,j,c,p,m,q,e=this,g,h=f;e.j=new Z.Hb(f);function k(a){a=a instanceof Array?a.join("."):"";return N(a)?"-":a;}function n(a,d){var l=[];if(!N(a)){l=a.split(".");if(d){for(a=0;a<l[z];a++){fa(l[a])||(l[a]="-");}}}return l;}function r(a,d,l){var t=e.M,o,u;for(o=0;o<t[z];o++){u=t[o][0];u+=N(d)?d:d+t[o][4];t[o][2](Q(a,u,l));}}e.kb=function(){return x==g||g==e.P();};e.k=function(){return e.j.k();};e.ma=function(){return p?p:"-";};e.vb=function(a){p=a;};e.za=function(a){g=fa(a)?a*1:"-";};e.la=function(){return k(m);};e.Aa=function(a){m=n(a);};e.Vb=function(){e.j.l(K,"",-1);};e.lc=function(){return g?g:"-";};e.fb=function(){return N(h.b)?"":"domain="+h.b+";";};e.ja=function(){return k(i);};e.tb=function(a){i=n(a,1);};e.C=function(){return k(b);};e.ya=function(a){b=n(a,1);};e.ka=function(){return k(j);};e.ub=function(a){j=n(a,1);};e.na=function(){return k(c);};e.wb=function(a){c=n(a);for(a=0;a<c[z];a++){if(a<4&&!fa(c[a])){c[a]="-";}}};e.fc=function(){return q;};e.Dc=function(a){q=a;};e.Sb=function(){i=[];b=[];j=[];c=[];p=x;m=[];g=x;};e.P=function(){var a="",d;for(d=0;d<e.M[z];d++){a+=e.M[d][1]();}return ja(a);};e.ua=function(a){var d=e.k(),l=w;if(d){r(d,a,";");e.za(e.P());l=v;}return l;};e.zc=function(a){r(a,"",D);e.za(Q(a,ca,D));};e.Hc=function(){var a=e.M,d=[],l;for(l=0;l<a[z];l++){V(d,a[l][0]+a[l][1]());}V(d,ca+e.P());return d.join(D);};e.Nc=function(a,d){var l=e.M,t=h.h;e.ua(a);h.h=d;for(a=0;a<l[z];a++){N(l[a][1]())||l[a][3]();}h.h=t;};e.Cb=function(){e.j.l(F,e.ja(),Z.t);};e.Ea=function(){e.j.l(H,e.C(),h.sb*1000);};e.Db=function(){e.j.l(I,e.ka(),0);};e.Ga=function(){e.j.l(L,e.na(),h.Ya*1000);};e.Eb=function(){e.j.l(M,e.ma(),Z.t);};e.Fa=function(){e.j.l(K,e.la(),Z.t);};e.Oc=function(){e.j.l(da,e.fc(),0);};e.M=[[F,e.ja,e.tb,e.Cb,"."],[H,e.C,e.ya,e.Ea,""],[I,e.ka,e.ub,e.Db,""],[M,e.ma,e.vb,e.Eb,""],[L,e.na,e.wb,e.Ga,"."],[K,e.la,e.Aa,e.Fa,"."]];};Z.Kb=function(f){var i=this,b=f,j=new Z.$(b),c=function(){},p=function(m){var q=(new Date).getTime(),e;e=(q-m[3])*(b.Kc/1000);if(e>=1){m[2]=Math.min(Math.floor(m[2]*1+e),b.Pb);m[3]=q;}return m;};i.H=function(m,q,e,g,h,k){var n,r=b.I,a=b.a[C];j.ua(e);n=X(j.C(),".");if(n[1]<500||g){if(h){n=p(n);}if(g||!h||n[2]>=1){if(!g&&h){n[2]=n[2]*1-1;}n[1]=n[1]*1+1;m="?utmwv="+ba+"&utmn="+Y()+(N(a.hostname)?"":"&utmhn="+R(a.hostname))+(b.U==100?"":"&utmsp="+R(b.U))+m;if(0==r||2==r){g=2==r?c:k||c;i.$a(b.oa+m,g);}if(1==r||2==r){m=("https:"==a.protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif")+m+"&utmac="+q+"&utmcc="+i.ac(e);if(la){m+="&gaq=1";}i.$a(m,k);}}}j.ya(n.join("."));j.Ea();};i.$a=function(m,q){var e=new Image(1,1);e.src=m;e.onload=function(){e.onload=null;(q||c)();};};i.ac=function(m){var q=[],e=[F,L,K,M],g,h=j.k(),k;for(g=0;g<e[z];g++){k=Q(h,e[g]+m,";");if(!N(k)){if(e[g]==K){k=X(k.split(m+".")[1],"|")[0];if(N(k)){continue;}k=m+"."+k;}V(q,e[g]+k+";");}}return R(q.join("+"));};};Z.n=function(){var f=this;f.Y=[];f.hb=function(i){var b,j=f.Y,c;for(c=0;c<j.length;c++){b=i==j[c].q?j[c]:b;}return b;};f.Ob=function(i,b,j,c,p,m,q,e){var g=f.hb(i);if(x==g){g=new Z.n.Mb(i,b,j,c,p,m,q,e);V(f.Y,g);}else{g.Qa=b;g.Ab=j;g.zb=c;g.xb=p;g.Wa=m;g.yb=q;g.Za=e;}return g;};};Z.n.Lb=function(f,i,b,j,c,p){var m=this;m.Bb=f;m.Ba=i;m.D=b;m.Ua=j;m.pb=c;m.qb=p;m.Ca=function(){return"&"+["utmt=item","tid="+R(m.Bb),"ipc="+R(m.Ba),"ipn="+R(m.D),"iva="+R(m.Ua),"ipr="+R(m.pb),"iqt="+R(m.qb)].join("&utm");};};Z.n.Mb=function(f,i,b,j,c,p,m,q){var e=this;e.q=f;e.Qa=i;e.Ab=b;e.zb=j;e.xb=c;e.Wa=p;e.yb=m;e.Za=q;e.R=[];e.Nb=function(g,h,k,n,r){var a=e.gc(g),d=e.q;if(x==a){V(e.R,new Z.n.Lb(d,g,h,k,n,r));}else{a.Bb=d;a.Ba=g;a.D=h;a.Ua=k;a.pb=n;a.qb=r;}};e.gc=function(g){var h,k=e.R,n;for(n=0;n<k.length;n++){h=g==k[n].Ba?k[n]:h;}return h;};e.Ca=function(){return"&"+["utmt=tran","id="+R(e.q),"st="+R(e.Qa),"to="+R(e.Ab),"tx="+R(e.zb),"sp="+R(e.xb),"ci="+R(e.Wa),"rg="+R(e.yb),"co="+R(e.Za)].join("&utmt");};};Z.Fb=function(f){var i=f,b=i.e,j=this,c="-";j.V=b.screen;j.Sa=!j.V&&b.java?java.awt.Toolkit.getDefaultToolkit():x;j.d=b.navigator;j.W=c;j.xa=c;j.Va=c;j.qa=c;j.pa=1;j.eb=c;function p(){var m,q,e;q="ShockwaveFlash";var g="$version",h=j.d?j.d.plugins:x;if(h&&h[z]>0){for(m=0;m<h[z]&&!e;m++){q=h[m];if(U(q.name,"Shockwave Flash")){e=q.description.split("Shockwave Flash ")[1];}}}else{q=q+"."+q;try{m=new ActiveXObject(q+".7");e=m.GetVariable(g);}catch(k){}if(!e){try{m=new ActiveXObject(q+".6");e="WIN 6,0,21,0";m.AllowScriptAccess="always";e=m.GetVariable(g);}catch(n){}}if(!e){try{m=new ActiveXObject(q);e=m.GetVariable(g);}catch(r){}}if(e){e=X(e.split(" ")[1],",");e=e[0]+"."+e[1]+" r"+e[2];}}return e?e:c;}j.bc=function(){var m;if(b.screen){j.W=j.V.width+"x"+j.V.height;j.xa=j.V.colorDepth+"-bit";}else{if(j.Sa){try{m=j.Sa.getScreenSize();j.W=m.width+"x"+m.height;}catch(q){}}}j.qa=W(j.d&&j.d.language?j.d.language:j.d&&j.d.browserLanguage?j.d.browserLanguage:c);j.pa=j.d&&j.d.javaEnabled()?1:0;j.eb=i.ha?p():c;j.Va=R(i.a.characterSet?i.a.characterSet:i.a.charset?i.a.charset:c);};j.Ic=function(){return D+"utm"+["cs="+R(j.Va),"sr="+j.W,"sc="+j.xa,"ul="+j.qa,"je="+j.pa,"fl="+R(j.eb)].join("&utm");};j.$b=function(){var m=i.a,q=b.history[z];m=j.d.appName+j.d.version+j.qa+j.d.platform+j.d.userAgent+j.pa+j.W+j.xa+(m[A]?m[A]:"")+(m.referrer?m.referrer:"");for(var e=m[z];q>0;){m+=q--^e++;}return ja(m);};};Z.m=function(f,i,b,j){var c=j,p=this;p.c=f;p.rb=i;p.r=b;function m(g){return N(g)||"0"==g||!U(g,"://");}function q(g){var h="";g=W(g.split("://")[1]);if(U(g,"/")){g=g.split("/")[1];if(U(g,"?")){h=g.split("?")[0];}}return h;}function e(g){var h="";h=W(g.split("://")[1]);if(U(h,"/")){h=h.split("/")[0];}return h;}p.ic=function(g){var h=p.gb();return new Z.m.w(Q(g,c.Ka+E,D),Q(g,c.Na+E,D),Q(g,c.Pa+E,D),p.Q(g,c.Ia,"(not set)"),p.Q(g,c.La,"(not set)"),p.Q(g,c.Oa,h&&!N(h.K)?T(h.K):x),p.Q(g,c.Ja,x));};p.jb=function(g){var h=e(g),k=q(g);if(U(h,"google")){g=g.split("?").join(D);if(U(g,D+c.oc+E)){if(k==c.nc){return v;}}}return w;};p.gb=function(){var g,h=p.rb,k,n,r=c.T;if(!(m(h)||p.jb(h))){g=e(h);for(k=0;k<r[z];k++){n=r[k];if(U(g,W(n.bb))){h=h.split("?").join(D);if(U(h,D+n.nb+E)){g=h.split(D+n.nb+E)[1];if(U(g,D)){g=g.split(D)[0];}return new Z.m.w(x,n.bb,x,"(organic)","organic",g,x);}}}}};p.Q=function(g,h,k){g=Q(g,h+E,D);return k=!N(g)?T(g):!N(k)?k:"-";};p.uc=function(g){var h=c.ta,k=w,n;if(g&&"organic"==g.S){g=W(T(g.K));for(n=0;n<h[z];n++){k=k||W(h[n])==g;}}return k;};p.hc=function(){var g="",h="";g=p.rb;if(!(m(g)||p.jb(g))){g=g.split("://")[1];if(U(g,"/")){h=P(g,g.indexOf("/"));h=h.split("?")[0];g=W(g.split("/")[0]);}if(0==g.indexOf("www.")){g=P(g,4);}return new Z.m.w(x,g,x,"(referral)","referral",x,h);}};p.Xb=function(g){var h="";if(c.ba){h=g&&g.hash?g.href.substring(g.href.indexOf("#")):"";h=""!=h?h+D:h;}h+=g.search;return h;};p.dc=function(){return new Z.m.w(x,"(direct)",x,"(direct)","(none)",x,x);};p.vc=function(g){var h=w,k,n=c.va;if(g&&"referral"==g.S){g=W(R(g.X));for(k=0;k<n[z];k++){h=h||U(g,W(n[k]));}}return h;};p.L=function(g){return x!=g&&g.mb();};p.cc=function(g,h){var k="",n="-",r,a=0,d,l,t=p.c;if(!g){return"";}l=g.k();k=p.Xb(c.a[C]);if(c.z&&g.kb()){n=g.na();if(!N(n)&&!U(n,";")){g.Ga();return"";}}n=Q(l,L+t+".",";");r=p.ic(k);if(p.L(r)){k=Q(k,c.Ma+E,D);if("1"==k&&!N(n)){return"";}}if(!p.L(r)){r=p.gb();if(!N(n)&&p.uc(r)){return"";}}if(!p.L(r)&&h){r=p.hc();if(!N(n)&&p.vc(r)){return"";}}if(!p.L(r)){if(N(n)&&h){r=p.dc();}}if(!p.L(r)){return"";}if(!N(n)){a=n.split(".");d=new Z.m.w;d.Zb(a.slice(4).join("."));d=W(d.Da())==W(r.Da());a=a[3]*1;}if(!d||h){h=Q(l,F+t+".",";");l=h.lastIndexOf(".");h=l>9?P(h,l+1)*1:0;a++;h=0==h?1:h;g.wb([t,p.r,h,a,r.Da()].join("."));g.Ga();return D+"utmcn=1";}else{return D+"utmcr=1";}};};Z.m.w=function(f,i,b,j,c,p,m){var q=this;q.q=f;q.X=i;q.ea=b;q.D=j;q.S=c;q.K=p;q.Xa=m;q.Da=function(){var e=[],g=[["cid",q.q],["csr",q.X],["gclid",q.ea],["ccn",q.D],["cmd",q.S],["ctr",q.K],["cct",q.Xa]],h,k;if(q.mb()){for(h=0;h<g[z];h++){if(!N(g[h][1])){k=g[h][1].split("+").join("%20");k=k.split(" ").join("%20");V(e,"utm"+g[h][0]+E+k);}}}return e.join("|");};q.mb=function(){return !(N(q.q)&&N(q.X)&&N(q.ea));};q.Zb=function(e){var g=function(h){return T(Q(e,"utm"+h+E,"|"));};q.q=g("cid");q.X=g("csr");q.ea=g("gclid");q.D=g("ccn");q.S=g("cmd");q.K=g("ctr");q.Xa=g("cct");};};Z.Ib=function(f,i,b,j){var c=this,p=i,m=E,q=f,e=j;c.O=b;c.sa="";c.p={};c.tc=function(){var h;h=X(Q(c.O.k(),K+p+".",";"),p+".")[1];if(!N(h)){h=h.split("|");g(1,c.p,h[1]);c.sa=h[0];c.Z();}};c.Z=function(){c.Qb();var h=c.sa,k,n,r="";for(k in c.p){if((n=c.p[k])&&1===n[2]){r+=k+m+n[0]+m+n[1]+m+1+",";}}N(r)||(h+="|"+r);if(N(h)){c.O.Vb();}else{c.O.Aa(p+"."+h);c.O.Fa();}};c.Ec=function(h){c.sa=h;c.Z();};c.Cc=function(h,k,n,r){if(1!=r&&2!=r&&3!=r){r=3;}var a=w;if(k&&n&&h>0&&h<=q.ob){k=R(k);n=R(n);if(k[z]+n[z]<=64){c.p[h]=[k,n,r];c.Z();a=v;}}return a;};c.mc=function(h){if((h=c.p[h])&&1===h[2]){return h[1];}};c.Ub=function(h){var k=c.p;if(k[h]){delete k[h];c.Z();}};c.Qb=function(){e._clearKey(8);e._clearKey(9);e._clearKey(11);var h=c.p,k,n;for(n in h){if(k=h[n]){e._setKey(8,n,k[0]);e._setKey(9,n,k[1]);(k=k[2])&&3!=k&&e._setKey(11,n,""+k);}}};function g(h,k,n){var r;if(!N(n)){n=n.split(",");for(var a=0;a<n[z];a++){r=n[a];if(!N(r)){r=r.split(m);if(r[z]==4){k[r[0]]=[r[1],r[2],h];}}}}}};Z.N=function(){var f=this,i={},b="k",j="v",c=[b,j],p="(",m=")",q="*",e="!",g="'",h={};h[g]="'0";h[m]="'1";h[q]="'2";h[e]="'3";var k=1;function n(o,u,y,B){if(x==i[o]){i[o]={};}if(x==i[o][u]){i[o][u]=[];}i[o][u][y]=B;}function r(o,u,y){return x!=i[o]&&x!=i[o][u]?i[o][u][y]:x;}function a(o,u){if(x!=i[o]&&x!=i[o][u]){i[o][u]=x;u=v;var y;for(y=0;y<c[z];y++){if(x!=i[o][c[y]]){u=w;break;}}if(u){i[o]=x;}}}function d(o){var u="",y=w,B,O;for(B=0;B<c[z];B++){O=o[c[B]];if(x!=O){if(y){u+=c[B];}u+=l(O);y=w;}else{y=v;}}return u;}function l(o){var u=[],y,B;for(B=0;B<o[z];B++){if(x!=o[B]){y="";if(B!=k&&x==o[B-1]){y+=B.toString()+e;}y+=t(o[B]);V(u,y);}}return p+u.join(q)+m;}function t(o){var u="",y,B,O;for(y=0;y<o[z];y++){B=o.charAt(y);O=h[B];u+=x!=O?O:B;}return u;}f.qc=function(o){return x!=i[o];};f.G=function(){var o="",u;for(u in i){if(x!=i[u]){o+=u.toString()+d(i[u]);}}return o;};f.Ac=function(o){if(o==x){return f.G();}var u=o.G(),y;for(y in i){if(x!=i[y]&&!o.qc(y)){u+=y.toString()+d(i[y]);}}return u;};f._setKey=function(o,u,y){if(typeof y!="string"){return w;}n(o,b,u,y);return v;};f._setValue=function(o,u,y){if(typeof y!="number"&&(x==Number||!(y instanceof Number))||Math.round(y)!=y||y==NaN||y==Infinity){return w;}n(o,j,u,y.toString());return v;};f._getKey=function(o,u){return r(o,b,u);};f._getValue=function(o,u){return r(o,j,u);};f._clearKey=function(o){a(o,b);};f._clearValue=function(o){a(o,j);};};Z.Jb=function(f,i){var b=this;b.Qc=i;b.xc=f;b._trackEvent=function(j,c,p){return i._trackEvent(b.xc,j,c,p);};};Z.aa=function(f,i){var b=this,j=x,c=new Z.Gb,p=w,m=x;b.e=window;b.r=Math.round((new Date).getTime()/1000);b.s=f||"UA-XXXXX-X";b.ab=c.a.referrer;b.ia=x;b.f=x;b.B=x;b.F=w;b.A=x;b.Ta="";b.g=x;b.cb=x;b.c=x;b.i=x;c.o=i?R(i):x;function q(){if("auto"==c.b){var a=c.a.domain;if("www."==P(a,0,4)){a=P(a,4);}c.b=a;}c.b=W(c.b);}function e(){var a=c.b,d=a.indexOf("www.google.")*a.indexOf(".google.")*a.indexOf("google.");return d||"/"!=c.h||a.indexOf("google.org")>-1;}function g(a,d,l){if(N(a)||N(d)||N(l)){return"-";}a=Q(a,F+b.c+".",d);if(!N(a)){a=a.split(".");a[5]=a[5]?a[5]*1+1:1;a[3]=a[4];a[4]=l;a=a.join(".");}return a;}function h(){return"file:"!=c.a[C].protocol&&e();}function k(a){if(!a||""==a){return"";}for(;ea(a.charAt(0));){a=P(a,1);}for(;ea(a.charAt(a[z]-1));){a=P(a,0,a[z]-1);}return a;}function n(a,d,l,t){if(!N(a())){d(t?T(a()):a());U(a(),";")||l();}}function r(a){var d,l=""!=a&&c.a[C].host!=a;if(l){for(d=0;d<c.u[z];d++){l=l&&ga(W(a),W(c.u[d]))==-1;}}return l;}b.wc=function(){var a=w;if(b.B){a=b.B.match(/^[0-9a-z-_.]{10,1200}$/i);}return a;};b.jc=function(){return Y()^b.A.$b()&2147483647;};b.ec=function(){if(!c.b||""==c.b||"none"==c.b){c.b="";return 1;}q();return c.Ra?ja(c.b):1;};b.Yb=function(a,d){if(N(a)){a="-";}else{d+=c.h&&"/"!=c.h?c.h:"";d=a.indexOf(d);a=d>=0&&d<=8?"0":"["==a.charAt(0)&&"]"==a.charAt(a[z]-1)?"-":a;}return a;};b.wa=function(a){var d="",l=c.a;d+=c.fa?b.A.Ic():"";d+=c.da?b.Ta:"";d+=c.ga&&!N(l.title)?"&utmdt="+R(l.title):"";d+="&utmhid="+ka()+"&utmr="+R(b.ia)+"&utmp="+R(b.Bc(a));return d;};b.Bc=function(a){var d=c.a[C];return a=x!=a&&""!=a?R(a,v):R(d.pathname+d.search,v);};b.Lc=function(a){if(b.J()){var d="";if(b.g!=x&&b.g.G()[z]>0){d+="&utme="+R(b.g.G());}d+=b.wa(a);j.H(d,b.s,b.c);}};b.Tb=function(){var a=new Z.$(c);return a.ua(b.c)?a.Hc():x;};b._getLinkerUrl=function(a,d){var l=a.split("#"),t=a,o=b.Tb();if(o){if(d&&1>=l[z]){t+="#"+o;}else{if(!d||1>=l[z]){if(1>=l[z]){t+=(U(a,"?")?D:"?")+o;}else{t=l[0]+(U(a,"?")?D:"?")+o+"#"+l[1];}}}}return t;};b.Fc=function(){var a;if(b.wc()){b.i.Dc(b.B);b.i.Oc();Z._gasoDomain=c.b;Z._gasoCPath=c.h;a=c.a.createElement("script");a.type="text/javascript";a.id="_gasojs";a.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+b.B+D+Y();c.a.getElementsByTagName("head")[0].appendChild(a);}};b.pc=function(){var a=b.r,d=b.i,l=d.k(),t=b.c+"",o=c.e,u=o?o.gaGlobal:x,y,B=U(l,F+t+"."),O=U(l,H+t),ma=U(l,I+t),G,J=[],S="",ha=w;l=N(l)?"":l;if(c.z){y=c.a[C]&&c.a[C].hash?c.a[C].href.substring(c.a[C].href.indexOf("#")):"";if(c.ba&&!N(y)){S=y+D;}S+=c.a[C].search;if(!N(S)&&U(S,F)){d.zc(S);d.kb()||d.Sb();G=d.ja();}n(d.ma,d.vb,d.Eb,true);n(d.la,d.Aa,d.Fa);}if(N(G)){if(B){if(!O||!ma){G=g(l,";",a);b.F=v;}else{G=Q(l,F+t+".",";");J=X(Q(l,H+t,";"),".");}}else{G=ia([t,b.jc(),a,a,a,1],".");ha=b.F=v;}}else{if(N(d.C())||N(d.ka())){G=g(S,D,a);b.F=v;}else{J=X(d.C(),".");t=J[0];}}G=G.split(".");if(o&&u&&u.dh==t&&!c.o){G[4]=u.sid?u.sid:G[4];if(ha){G[3]=u.sid?u.sid:G[4];if(u.vid){a=u.vid.split(".");G[1]=a[0];G[2]=a[1];}}}d.tb(G.join("."));J[0]=t;J[1]=J[1]?J[1]:0;J[2]=x!=J[2]?J[2]:c.Jc;J[3]=J[3]?J[3]:G[4];d.ya(J.join("."));d.ub(t);N(d.lc())||d.za(d.P());d.Cb();d.Ea();d.Db();};b.rc=function(){j=new Z.Kb(c);};b._initData=function(){var a;if(!p){if(!b.A){b.A=new Z.Fb(c);b.A.bc();}b.c=b.ec();b.i=new Z.$(c);b.g=new Z.N;m=new Z.Ib(c,b.c,b.i,b.g);b.rc();}if(h()){b.pc();m.tc();}if(!p){if(h()){b.ia=b.Yb(b.ab,c.a.domain);if(c.da){a=new Z.m(b.c,b.ia,b.r,c);b.Ta=a.cc(b.i,b.F);}}b.cb=new Z.N;p=v;}Z.ib||b.sc();};b._visitCode=function(){b._initData();var a=Q(b.i.k(),F+b.c+".",";");a=a.split(".");return a[z]<4?"":a[1];};b._cookiePathCopy=function(a){b._initData();b.i&&b.i.Nc(b.c,a);};b.sc=function(){var a=c.a[C].hash;if(a&&1==a.indexOf("gaso=")){a=Q(a,"gaso=",D);}else{a=(a=c.e.name)&&0<=a.indexOf("gaso=")?Q(a,"gaso=",D):Q(b.i.k(),da,";");}if(a[z]>=10){b.B=a;b.Fc();}Z.ib=v;};b.J=function(){return b._visitCode()%10000<c.U*100;};b.Gc=function(){var a,d,l=c.a.links;if(!c.lb){a=c.a.domain;if("www."==P(a,0,4)){a=P(a,4);}c.u.push("."+a);}for(a=0;a<l[z]&&(c.ra==-1||a<c.ra);a++){d=l[a];if(r(d.host)){if(!d.gatcOnclick){d.gatcOnclick=d.onclick?d.onclick:b.yc;d.onclick=function(t){var o=!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";o=o&&!b.Rb(t);b.Mc(t,this,o);return o?w:this.gatcOnclick?this.gatcOnclick(t):v;};}}}};b.yc=function(){};b._trackPageview=function(a){if(h()){b._initData();c.u&&b.Gc();b.Lc(a);b.F=w;}};b._trackTrans=function(){var a=b.c,d=[],l,t,o;b._initData();if(b.f&&b.J()){for(l=0;l<b.f.Y[z];l++){t=b.f.Y[l];V(d,t.Ca());for(o=0;o<t.R[z];o++){V(d,t.R[o].Ca());}}for(l=0;l<d[z];l++){j.H(d[l],b.s,a,v);}}};b._setTrans=function(){var a=c.a,d,l,t;a=a.getElementById?a.getElementById("utmtrans"):a.utmform&&a.utmform.utmtrans?a.utmform.utmtrans:x;b._initData();if(a&&a.value){b.f=new Z.n;t=a.value.split("UTM:");c.v=!c.v||""==c.v?"|":c.v;for(a=0;a<t[z];a++){t[a]=k(t[a]);d=t[a].split(c.v);for(l=0;l<d[z];l++){d[l]=k(d[l]);}if("T"==d[0]){b._addTrans(d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8]);}else{"I"==d[0]&&b._addItem(d[1],d[2],d[3],d[4],d[5],d[6]);}}}};b._addTrans=function(a,d,l,t,o,u,y,B){b.f=b.f?b.f:new Z.n;return b.f.Ob(a,d,l,t,o,u,y,B);};b._addItem=function(a,d,l,t,o,u){var y;b.f=b.f?b.f:new Z.n;(y=b.f.hb(a))||(y=b._addTrans(a,"","","","","","",""));y.Nb(d,l,t,o,u);};b._setVar=function(a){if(a&&""!=a&&e()){b._initData();m.Ec(R(a));b.J()&&j.H("&utmt=var",b.s,b.c);}};b._setCustomVar=function(a,d,l,t){b._initData();return m.Cc(a,d,l,t);};b._deleteCustomVar=function(a){b._initData();m.Ub(a);};b._getVisitorCustomVar=function(a){b._initData();return m.mc(a);};b._setMaxCustomVariables=function(a){c.ob=a;};b._link=function(a,d){if(c.z&&a){b._initData();c.a[C].href=b._getLinkerUrl(a,d);}};b._linkByPost=function(a,d){if(c.z&&a&&a.action){b._initData();a.action=b._getLinkerUrl(a.action,d);}};b._setXKey=function(a,d,l){b.g._setKey(a,d,l);};b._setXValue=function(a,d,l){b.g._setValue(a,d,l);};b._getXKey=function(a,d){return b.g._getKey(a,d);};b._getXValue=function(a,d){return b.g.getValue(a,d);};b._clearXKey=function(a){b.g._clearKey(a);};b._clearXValue=function(a){b.g._clearValue(a);};b._createXObj=function(){b._initData();return new Z.N;};b._sendXEvent=function(a){var d="";b._initData();if(b.J()){d+="&utmt=event&utme="+R(b.g.Ac(a))+b.wa();j.H(d,b.s,b.c,w,v);}};b._createEventTracker=function(a){b._initData();return new Z.Jb(a,b);};b._trackEvent=function(a,d,l,t){var o=b.cb;if(x!=a&&x!=d&&""!=a&&""!=d){o._clearKey(5);o._clearValue(5);(a=o._setKey(5,1,a)&&o._setKey(5,2,d)&&(x==l||o._setKey(5,3,l))&&(x==t||o._setValue(5,1,t)))&&b._sendXEvent(o);}else{a=w;}return a;};b.Mc=function(a,d,l){b._initData();if(b.J()){var t=new Z.N;t._setKey(6,1,d.href);var o=l?function(){b.db(a,d);}:x;j.H("&utmt=event&utme="+R(t.G())+b.wa(),b.s,b.c,w,v,o);if(l){var u=this;c.e.setTimeout(function(){u.db(a,d);},500);}}};b.db=function(a,d){if(!a){a=c.e.event;}var l=v;if(d.gatcOnclick){l=d.gatcOnclick(a);}if(l||typeof l=="undefined"){if(!d.target||d.target=="_self"){c.e[C]=d.href;}else{if(d.target=="_top"){c.e.top.document[C]=d.href;}else{if(d.target=="_parent"){c.e.parent.document[C]=d.href;}}}}};b.Rb=function(a){if(!a){a=c.e.event;}var d=a.shiftKey||a.ctrlKey||a.altKey;if(!d){if(a.modifiers&&c.e.Event){d=a.modifiers&c.e.Event.CONTROL_MASK||a.modifiers&c.e.Event.SHIFT_MASK||a.modifiers&c.e.Event.ALT_MASK;}}return d;};b.Pc=function(){return c;};b._setDomainName=function(a){c.b=a;};b._addOrganic=function(a,d,l){c.T.splice(l?0:c.T.length,0,new Z.Ha(a,d));};b._clearOrganic=function(){c.T=[];};b._addIgnoredOrganic=function(a){V(c.ta,a);};b._clearIgnoredOrganic=function(){c.ta=[];};b._addIgnoredRef=function(a){V(c.va,a);};b._clearIgnoredRef=function(){c.va=[];};b._setAllowHash=function(a){c.Ra=a?1:0;};b._setCampaignTrack=function(a){c.da=a?1:0;};b._setClientInfo=function(a){c.fa=a?1:0;};b._getClientInfo=function(){return c.fa;};b._setCookiePath=function(a){c.h=a;};b._setTransactionDelim=function(a){c.v=a;};b._setCookieTimeout=function(a){c.Ya=a;};b._setDetectFlash=function(a){c.ha=a?1:0;};b._getDetectFlash=function(){return c.ha;};b._setDetectTitle=function(a){c.ga=a?1:0;};b._getDetectTitle=function(){return c.ga;};b._setLocalGifPath=function(a){c.oa=a;};b._getLocalGifPath=function(){return c.oa;};b._setLocalServerMode=function(){c.I=0;};b._setRemoteServerMode=function(){c.I=1;};b._setLocalRemoteServerMode=function(){c.I=2;};b._getServiceMode=function(){return c.I;};b._setSampleRate=function(a){c.U=a;};b._setSessionTimeout=function(a){c.sb=a;};b._setAllowLinker=function(a){c.z=a?1:0;};b._setAllowAnchor=function(a){c.ba=a?1:0;};b._setCampNameKey=function(a){c.Ia=a;};b._setCampContentKey=function(a){c.Ja=a;};b._setCampIdKey=function(a){c.Ka=a;};b._setCampMediumKey=function(a){c.La=a;};b._setCampNOKey=function(a){c.Ma=a;};b._setCampSourceKey=function(a){c.Na=a;};b._setCampTermKey=function(a){c.Oa=a;};b._setCampCIdKey=function(a){c.Pa=a;};b._getAccount=function(){return b.s;};b._setAccount=function(a){b.s=a;};b._setNamespace=function(a){c.o=a?R(a):x;};b._getVersion=function(){return ba;};b._setAutoTrackOutbound=function(a){c.u=[];if(a){c.u=a;}};b._setTrackOutboundSubdomains=function(a){c.lb=a;};b._setHrefExamineLimit=function(a){c.ra=a;};b._setReferrerOverride=function(a){b.ab=a;};b._setCookiePersistence=function(a){Z.t=a;};};Z._getTracker=function(f,i){return new Z.aa(f,i);};var $={ca:{},_createAsyncTracker:function(f,i){i=i||"";f=new Z.aa(f);return $.ca[i]=f;},_getAsyncTracker:function(f){f=f||"";var i=$.ca[f];if(!i){i=new Z.aa;$.ca[f]=i;}return i;},push:function(){for(var f=arguments,i=0,b=0;b<f[z];b++){try{if(typeof f[b]==="function"){f[b]();}else{var j="",c=f[b][0],p=c.lastIndexOf(".");if(p>0){j=P(c,0,p);c=P(c,p+1);}var m=$._getAsyncTracker(j);m[c].apply(m,f[b].slice(1));}}catch(q){i++;}}return i;}};window[aa]=Z;var la=window[s];function na(){var f=window[s],i=w;if(f&&typeof f.push=="function"){i=f.constructor==Array;if(!i){return ;}}window[s]=$;i&&$.push.apply($,f);}na();})();current.tracking={};current.tracking.Track=Class.create({initialize:function(gatCode,gatProfile){this.setGatCode(gatCode);this.setGatProfile(gatProfile);this.setGatTracker(gatCode._getTracker(gatProfile));Event.observe(window,"abort",this.__onAbort.bindAsEventListener(this));Event.observe(window,"dom:loaded",this.__onDomReady.bindAsEventListener(this));Event.observe(window,"load",this.__onPageLoad.bindAsEventListener(this));Event.observe(window,"unload",this.__onPageUnload.bindAsEventListener(this));this._clickObserver=this.__onDomClick.bindAsEventListener(this);},setGatProfile:function(profile){this._gatProfile=profile;},getGatProfile:function(){return this._gatProfile;},setGatCode:function(code){this._gatCode=code;},getGatCode:function(){return this._gatCode;},setGatTracker:function(track){this._gatTrack=track;},getGatTracker:function(){return this._gatTrack;},_resetTracking:function(){this.setGatTracker(this.getGatCode()._getTracker(this.getGatProfile()));},setGatProp:function(propArr,value){var t=this.getGatTracker();if(propArr&&propArr.length==3&&value){t._setCustomVar(propArr[0],propArr[1],value,propArr[2]);}},addGatEvent:function(event,label){var t=this.getGatTracker();if(!t.tmpEvents){t.tmpEvents=[];}t.tmpEvents.push([event,(label)?label:null]);},_setPreviousPageName:function(){setSessionCookie(current.Cookies.PREVIOUS_PAGE_NAME,current.site.Page.getInstance().getPageName());},_parseGatCookie:function(){if(this._gatVs){return this._gatVs;}this._gatVs={};var c=getCookieValue("__utmz");if(c){var z=c.split(".");if(z.length>=4){var y=z[4].split("|");for(i=0;i<y.length;i++){var pair=y[i].split("=");this._gatVs[pair[0]]=pair[1];}}}return this._gatVs;},getGatCookieVal:function(key){if(!key){key="utmcsr";}var vals=this._parseGatCookie();return(vals[key])?vals[key]:null;},doPageTracking:function(url){var t=this.getGatTracker();t._setDomainName("none");t._setAllowLinker(true);if(url!=""){t._trackPageview(url);}else{t._trackPageview();}var es=t.tmpEvents;if(es&&es.length){for(var j=0;j<es.length;j++){var e=es[j][0];var l=es[j][1];t._setDomainName("none");t._setAllowLinker(true);if(l){t._trackEvent(e[0],e[1],l+"",1);}else{t._trackEvent(e[0],e[1]);}}}this.__checkAbEvents();this._setPreviousPageName();},doTracking:function(){var t=this.getGatTracker();var es=t.tmpEvents;if(es&&es.length){for(var j=0;j<es.length;j++){var e=es[j][0];var l=es[j][1];t._setDomainName("none");t._setAllowLinker(true);if(l){t._trackEvent(e[0],e[1],l+"",1);}else{t._trackEvent(e[0],e[1]);}}}this.__checkAbEvents();},_fetchUserProperties:function(){var user=current.User.getInstance();var gp=current.tracking.GatProps;this.setGatProp(gp.USER_COUNTRY,user.getCountry());var providers=[];if(user.hasCdcAuthProvider()){providers.push("cdc");}if(user.getFacebookId()){providers.push("fb");}if(user.getTwitterId()){providers.push("tw");}this.setGatProp(gp.USER_TYPE,user.isLoggedIn()?providers.join("-"):"anon");var loginPath=getCookieValue(current.Cookies.USER_MEMBER);if(user.isLoggedIn()&&loginPath!=null){this.addGatEvent(current.tracking.GatEvents.LOGIN,user.getCountry());deleteCookie(current.Cookies.USER_MEMBER);}var registerSuccess=(getCookieValue(current.Cookies.REGISTRATION)!=null);if(user.isLoggedIn()&&registerSuccess){this.addGatEvent(current.tracking.GatEvents.REGISTRATION,user.getCountry());deleteCookie(current.Cookies.REGISTRATION);}},_fetchPageProperties:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var pageName=page.getPageName();var gp=current.tracking.GatProps;this.setGatProp(gp.PAGE_NAME,user.getCountry()+"_"+pageName);if(pageName=="homepage"){}else{if(pageName=="item"){var iPage=current.content.items.ItemPage.getInstance();this.setGatProp(gp.CONTENT_TYPE,page.getType());this.setGatProp(gp.PARENT_GROUP,iPage.getParentGroupSlug());this.setGatProp(gp.CLASSIFIER_PARENT_GROUP,iPage.getClassifierGroupSlug());}else{if(pageName=="group"){var gPage=current.content.groups.GroupPage.getInstance();this.setGatProp(gp.CONTENT_TYPE,page.getType());this.setGatProp(gp.CLASSIFIER_PARENT_GROUP,gPage.getClassifierGroupSlug());}else{if(pageName=="tag"){this.setGatProp(gp.CONTENT_TYPE,page.getType());}else{if(pageName=="tvshows"){}else{if(pageName=="search"){var searchCount=current.site.Page.getInstance().getSearchResultCount();var searchTerm=current.utils.Url.getParam(current.Types.SEARCH_QUERY_PARAM);if(!searchTerm){searchTerm="";}this.setGatProp(gp.SEARCH_TERM,searchTerm.toLowerCase());this.setGatProp(gp.SEARCH_COUNT,searchCount);}else{if(pageName=="people"){this.setGatProp(gp.CONTENT_TYPE,page.getType());}else{if(pageName=="toolbar"){this.setGatProp(gp.CONTENT_TYPE,page.getType());}else{this.setGatProp(gp.CONTENT_TYPE,page.getType());}}}}}}}}},__onAbort:function(){document.currentTrackingAbortTime=new Date().getTime();},__onDomReady:function(){document.currentTrackingDomReadyTime=new Date().getTime();},__onPageLoad:function(){document.currentTrackingPageLoadTime=new Date().getTime();this.doInternalTracking(current.tracking.internal.EventTypeMap.JS_END,null,this._abPageStr,this._abUserStr,false);},__onPageUnload:function(){},__onDomClick:function(event){var a=event.element();if(!a.match("a")){a=a.up("a");}if(!a){return ;}var rel=a.name||a.rel;if(rel==null||rel==""||rel.indexOf("clickmap")==-1){return ;}var click=rel.evalJSON().clickmap;setSessionCookie(current.Cookies.CLICK_MAP,click);this.onLinkClick(click);},execPageTrack:function(url){var url=((!url)?"":url);var prevClick=getCookieValue(current.Cookies.CLICK_MAP);if(this._abTests){this._abPageStr=this.__abTestsStr(this._abPageTests);this._abUserStr=this.__abTestsStr(this._abUserTests.t);}this._fetchUserProperties();this._fetchPageProperties();this.doPageTracking(url);this.doInternalTracking(current.tracking.internal.EventTypeMap.PAGE_LOADED,prevClick,this._abPageStr,this._abUserStr,true);if(prevClick){deleteCookie(current.Cookies.CLICK_MAP);}this.observeLinks($(document.getElementsByTagName("body")[0]));},observeLinks:function(target){var anchors=target.select("a");for(var i=0,len=anchors.length;i<len;++i){if(!anchors[i]._clickObserved){var rel=anchors[i].name||anchors[i].rel;if(rel==null||rel==""||rel.indexOf("clickmap")==-1){continue;}Event.observe(anchors[i],"click",this._clickObserver);anchors[i]._clickObserved=true;}}},doInternalTracking:function(eventType,prevClick,key4,key5,retCount){var p=current.site.Page.getInstance();var i=current.tracking.internal;var t=i.PageTypeMap.get(p.getPageName());if(t==null){t=i.PageTypeMap.get("default");}i.Track.doTrack(p,t,eventType,prevClick,key4,key5,retCount);},onLinkClick:function(clickmap){this._resetTracking();this._fetchUserProperties();this._fetchPageProperties();this.addGatEvent(current.tracking.GatEvents.LINK_CLICK,clickmap);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.LINK_CLICK,null,clickmap,null,false);},abTestsControl:function(abTests){if(abTests){this._abTests=abTests;this._abClickObserver=this.__onAbLinkClick.bindAsEventListener(this);this.__abSelectTests();}},abSection:function(section,variation,isDefault){var ab=this._abUserTests;var isActive=(ab&&ab.t&&ab.t[section]&&ab.t[section].n==variation);if(isActive){this._abPageTests[section]=ab.t[section];}if(isDefault&&!isActive){document.write("<noscript>");}else{if(!isDefault&&isActive){document.write('</noscript a="');}}},abSuccess:function(section,variation,type){var ab=this._abUserTests;var isActive=(ab&&ab.t&&ab.t[section]&&ab.t[section].d!=1)&&(ab.t[section].n==variation||variation=="ALL");if(!isActive){return ;}if(type=="click:anchors"){var scope=this;$$(".abSuccess_"+section+"_"+variation).each(function(node){scope.__observeAbLinks(section,variation,node,false);});}else{var s=type.split(/:/);if(s[0]=="event"){this.__trackAbEvent(section,variation,s[1],s[2]);}}},__abSelectTests:function(){var ab=null;if(this._abTests){var abc=getCookieValue(current.Cookies.AB_TESTS);if(abc!=null){try{ab=abc.evalJSON(true);}catch(err){}}if(!ab||!ab.t||!ab.e){ab={t:{},e:{}};}var s,t;for(s in ab.t){if(!this._abTests[s]){delete ab.t[s];}}for(t in ab.e){s=ab.e[t];t=this._abTests[s];if(!t||(t.version&&t.version!=ab.t[s].v)){delete ab.e[t];}}for(s in this._abTests){t=this._abTests[s];if(!ab.t[s]||!ab.t[s].n||(t.version&&t.version!=ab.t[s].v)){var variant=this.__abSelectVariant(t.defaultVariation,t.variations);var version=(t.version)?t.version:0;ab.t[s]={n:variant[0],d:variant[1],v:version};}}var newAbc=Object.toJSON(ab);if(abc!=newAbc){setTimedCookie(current.Cookies.AB_TESTS,newAbc,current.Cookies.DISTANT_EXPIRE);}this._abPageTests={};}this._abUserTests=ab;},__abSelectVariant:function(defaultVar,vars){var rand=Math.random();var v,sum=0;for(v in vars){sum+=vars[v];if(sum>rand){return[v,0,rand];}}return[defaultVar,1,rand];},__abTestsStr:function(tests){if(tests){var s,str=null;for(s in tests){if(tests[s].d!=1){str=(str)?str+"|":"";str+=s+":"+tests[s].n;}}return str;}return null;},__trackAbEvent:function(section,variation,category,action){var ab=this._abUserTests;if(ab&&ab.e){ab.e[category+"_"+action]=section;var abc=getCookieValue(current.Cookies.AB_TESTS);var newAbc=Object.toJSON(ab);if(abc!=newAbc){setTimedCookie(current.Cookies.AB_TESTS,newAbc,current.Cookies.DISTANT_EXPIRE);this._abUserTests=ab;}}},__checkAbEvents:function(){var ab=this._abUserTests;if(ab&&ab.e){var t=this.getGatTracker();var es=t.tmpEvents;if(es&&es.length){for(var j=0;j<es.length;j++){var e=es[j][0];if(e[0]==current.tracking.GatEvents.AB_SUCCESS[0]&&e[1]==current.tracking.GatEvents.AB_SUCCESS[1]){continue;}var key=e[0]+"_"+e[1];if(ab.e[key]){this.onAbSuccess("event",ab.e[key],key);}}}}},__observeAbLinks:function(section,variation,target,allNodes){var nodes=target.select(allNodes?"*":"a");for(var i=0,len=nodes.length;i<len;++i){if(!nodes[i]._abObserved){Event.observe(nodes[i],"click",this._abClickObserver);nodes[i]._abObserved=true;nodes[i]._abSection=section;}}},__onAbLinkClick:function(event){var a=event.element();if(!a.match("a")&&!a._abObserved){a=a.up("a");}if(!a||!a._abObserved){return ;}var click=null;var rel=a.name||a.rel;if(rel!=null&&rel!=""&&rel.indexOf("clickmap")!=-1){click=rel.evalJSON().clickmap;}this.onAbSuccess("click",a._abSection,click);},onAbSuccess:function(type,section,context){var ab=this._abUserTests;if(ab){this._resetTracking();this._fetchUserProperties();this._fetchPageProperties();var variation=(ab.t&&ab.t[section]&&ab.t[section].n)?ab.t[section].n:"unknown";if(!context){context="";}var abSuccessStr=section+":"+variation+":"+type+":"+context;this.addGatEvent(current.tracking.GatEvents.AB_SUCCESS,abSuccessStr);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.AB_SUCCESS,null,abSuccessStr,this._abUserStr,false);}},onShare:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.addGatEvent(current.tracking.GatEvents.CONTENT_SHARE,user.getCountry());this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.CONTENT_SHARE,null,user.getCountry(),null,false);},onContentCreate:function(context,contentType){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.CREATE_CONTENT_TYPE,contentType);this.setGatProp(gp.CREATE_CONTENT_CONTEXT,context);this.addGatEvent(current.tracking.GatEvents.CONTENT_ADD,context+"_"+contentType);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.CONTENT_ADD,null,context+"_"+contentType,context,false);},onCommentSubmitted:function(contentType){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.COMMENT_CONTENT_TYPE,contentType);this.addGatEvent(current.tracking.GatEvents.COMMENT_ADD,contentType);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.COMMENT_ADD,null,contentType,null,false);},onVote:function(contentId,vote){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.VOTE_VALUE,vote);this.setGatProp(gp.VOTE_CONTEXT,page.getPageName());this.addGatEvent(current.tracking.GatEvents.CONTENT_VOTE,vote);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.CONTENT_VOTE,null,vote,page.getPageName(),false);},onEmbedShare:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.EMBED_CONTEXT,page.getPageName());this.addGatEvent(current.tracking.GatEvents.CONTENT_EMBED_SHARE,page.getPageName());this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.CONTENT_EMBED_SHARE,null,page.getPageName(),null,false);},onFacebookLike:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.FACEOOK_LIKE_CONTEXT,page.getPageName());this.addGatEvent(current.tracking.GatEvents.CONTENT_FACEBOOK_LIKE,page.getPageName());this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.CONTENT_FACEBOOK_LIKE,null,page.getPageName(),null,false);},onGroupCreate:function(groupSlug){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.CREATE_GROUP_NAME,groupSlug);this.addGatEvent(current.tracking.GatEvents.GROUP_CREATE,groupSlug);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.GROUP_CREATE,null,groupSlug,null,false);},onGroupJoin:function(groupSlug){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.JOIN_GROUP_NAME,groupSlug);this.addGatEvent(current.tracking.GatEvents.GROUP_JOIN,groupSlug);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.GROUP_JOIN,null,groupSlug,null,false);},onMessageSend:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.addGatEvent(current.tracking.GatEvents.MESSAGE_SENT,user.getCountry());this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.MESSAGE_SENT,null,user.getCountry(),null,false);},onThreadedCommentsExpand:function(){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.addGatEvent(current.tracking.GatEvents.COMMENTS_EXPAND,user.getCountry());this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.COMMENTS_EXPAND,null,user.getCountry(),null,false);},onPasswordAccess:function(passwordValue){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.GROUP_PASSWORD_ACCESS,passwordValue);this.addGatEvent(current.tracking.GatEvents.PASSWORD_ACCESS,passwordValue);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.PASSWORD_ACCESS,null,passwordValue,null,false);},onPasswordAccessEmail:function(emailValue){var page=current.site.Page.getInstance();var user=current.User.getInstance();var gp=current.tracking.GatProps;this._resetTracking();this._fetchUserProperties();this.setGatProp(gp.GROUP_PASSWORD_ACCESS_EMAIL,emailValue);this.addGatEvent(current.tracking.GatEvents.PASSWORD_ACCESS_EMAIL,emailValue);this.doTracking();this.doInternalTracking(current.tracking.internal.EventTypeMap.PASSWORD_ACCESS_EMAIL,null,emailValue,null,false);},onHomepageOptOut:function(){},onBladeOpen:function(contentId,contentTitle,sponsorId){},onBladeSponsorClick:function(sponsorId){},onAdClick:function(event,sponsorId){},onAdImpression:function(sponsorId){},onViewpointOpen:function(contentId,contentTitle){},onViewpointsTopicChange:function(topicName){}});current.tracking.Track.getInstance=function(){if(!document.__currentTracking__){document.__currentTracking__=new current.tracking.Track(_gat,document.currentTrackingProfile);}return document.__currentTracking__;};current.tracking.GatProps={PAGE_NAME:[1,"Page Name",3],USER_COUNTRY:[1,"User Country",3],USER_TYPE:[2,"User Type",3],COMPLETED_DURATION:[2,"Completed Duration",3],CONTENT_TYPE:[3,"Content Type",3],SEARCH_TERM:[3,"Search Term",3],CREATE_CONTENT_TYPE:[3,"Create Content Type",3],COMMENT_CONTENT_TYPE:[3,"Comment Content Type",3],VOTE_VALUE:[3,"Vote Value",3],EMBED_CONTEXT:[3,"Embed Share Context",3],FACEBOOK_LIKE_CONTEXT:[3,"Facebook Like Context",3],CREATE_GROUP_NAME:[3,"Create Group Name",3],JOIN_GROUP_NAME:[3,"Join Group Name",3],GROUP_PASSWORD_ACCESS:[3,"Group Access Password",3],GROUP_PASSWORD_ACCESS_EMAIL:[3,"Group Access Email",3],VIDEO_DURATION:[3,"Video Duration",3],CLASSIFIER_PARENT_GROUP:[4,"Classifier Group",3],SEARCH_COUNT:[4,"Search Count",3],CREATE_CONTENT_CONTEXT:[4,"Create Content Context",3],VOTE_CONTEXT:[4,"Vote Context",3],PARENT_GROUP:[5,"Parent Group",3]};current.tracking.GatEvents={LOGIN:["User","Login"],REGISTRATION:["User","Register"],CONTENT_ADD:["Item","Create"],CONTENT_SHARE:["Item","Share"],CONTENT_VOTE:["Item","Vote"],CONTENT_EMBED_SHARE:["Item","Embed Share"],CONTENT_FACEBOOK_LIKE:["Item","Facebook Like"],MESSAGE_SENT:["Message","Sent"],COMMENT_ADD:["Comment","Create"],COMMENTS_EXPAND:["Comment","Expand"],GROUP_CREATE:["Group","Create"],GROUP_JOIN:["Group","Join"],PASSWORD_ACCESS:["Group","Access Password"],PASSWORD_ACCESS_EMAIL:["Group","Access Email"],LINK_CLICK:["Link","Click"],AB_SUCCESS:["AB Test","Success"],PLAYER_LOAD:["Player","Load"],PLAYER_START:["Player","Start"],PLAYER_25PERCENT:["Player","25%"],PLAYER_50PERCENT:["Player","50%"],PLAYER_75PERCENT:["Player","75%"],PLAYER_FINISH:["Player","Finish"]};current.tracking.internal={};current.tracking.internal.Track={_getInlineTime:function(){if(document.currentTrackingClientStartTime&&document.currentTrackingClientEndTime){return(document.currentTrackingClientEndTime-document.currentTrackingClientStartTime);}return"";},_getAbortTime:function(){if(document.currentTrackingClientStartTime&&document.currentTrackingAbortTime){return(document.currentTrackingAbortTime-document.currentTrackingClientStartTime);}return"";},_getDomReadyTime:function(){if(document.currentTrackingClientStartTime&&document.currentTrackingDomReadyTime){return(document.currentTrackingDomReadyTime-document.currentTrackingClientStartTime);}return"";},_getPageLoadTime:function(){if(document.currentTrackingClientStartTime&&document.currentTrackingPageLoadTime){return(document.currentTrackingPageLoadTime-document.currentTrackingClientStartTime);}return"";},_getRequestTime:function(){if(document.currentTrackingRequestTime){return document.currentTrackingRequestTime;}return"";},_getSearchTrackArgs:function(p){var searchTrack="&keyword="+p.getSearchQuery()+"&key1="+p.getSearchResultCount();var userFilter=p.getSearchUserFilter();var groupFilter=p.getSearchGroupFilter();if(!userFilter.empty()){searchTrack=searchTrack+"&key2="+userFilter;}if(!groupFilter.empty()){searchTrack=searchTrack+"&key3="+groupFilter;}return searchTrack;},_getItemTrackArgs:function(p,eventType){var m=current.tracking.internal.EventTypeMap;var type=p.getType();var itemTrack="&key1="+type;if(eventType==m.PAGE_LOADED){if(type=="pod"){itemTrack+="&retEventTypes="+encodeURIComponent(m.ONSITE_PLAYER_START+","+m.OFFSITE_PLAYER_START);}}return itemTrack;},doTrack:function(p,objType,eventType,prevClick,key4,key5,retCount){var id=p.getId();var node=$("viewDisplay");var args="";if(document.referrer&&document.referrer!=""){args+="&referer="+encodeURIComponent(document.referrer);}if(prevClick){args+="&refererName="+encodeURIComponent(prevClick);}args+="&requestTime="+this._getRequestTime();args+="&inlineTime="+this._getInlineTime();args+="&abortTime="+this._getAbortTime();args+="&domReadyTime="+this._getDomReadyTime();args+="&clientTime="+this._getPageLoadTime();if(objType==1){args+=this._getItemTrackArgs(p,eventType);}else{if(objType==8){args+=this._getSearchTrackArgs(p);}}if(key4){args+="&key4="+encodeURIComponent(key4);}if(key5){args+="&key5="+encodeURIComponent(key5);}var handler=null;if(retCount&&node){handler=current.tracking.internal.Track.__onViewUpdate;}else{args+="&img=1";}new Ajax.Request(current.Constants.getInstance().getTrackingAppPath()+"?objectType="+objType+"&objectId="+id+"&eventType="+eventType+"&url="+encodeURIComponent(current.site.Page.getInstance().getUrl())+"&sessionId="+current.User.getInstance().getSessionId()+args,{method:"get",onSuccess:handler});},__onViewUpdate:function(data){var node=$("viewDisplay");if(node){var vCount=data.responseText;if(!current.utils.Strings.isInteger(vCount)){return ;}node.setOpacity(0);node.innerHTML=(current.utils.Strings.addCommas(vCount)+" "+current.locale.Bundle.get("views"));node.setStyle({visibility:"visible"});new Effect.Opacity(node,{to:1,duration:0.5});}}};current.tracking.internal.EventTypeMap={HTML_START:50,JS_START:51,PAGE_LOADED:1,JS_END:52,AB_SUCCESS:60,LINK_CLICK:70,CONTENT_ADD:80,COMMENT_ADD:81,CONTENT_SHARE:82,CONTENT_EMBED_SHARE:83,CONTENT_VOTE:84,CONTENT_FACEBOOK_LIKE:85,GROUP_CREATE:90,GROUP_JOIN:91,PASSWORD_ACCESS:92,PASSWORD_ACCESS_EMAIL:93,MESSAGE_SENT:10,COMMENTS_EXPAND:11,ONSITE_PLAYER_LOAD:31,ONSITE_PLAYER_START:3,ONSITE_PLAYER_ADS:32,ONSITE_PLAYER_FIRST_START:33,OFFSITE_PLAYER_LOAD:21,OFFSITE_PLAYER_START:2,OFFSITE_PLAYER_ADS:22,OFFSITE_PLAYER_FIRST_START:23};current.tracking.internal.PageTypeMap=$H({"default":0,item:1,"people:profile":2,group:10,tag:11,toolbar:12,homepage:4,"homepage:uploads:popular":5,"homepage:uploads:newest":5,"homepage:ads:popular":6,"homepage:ads:newest":6,"homepage:tvs:popular":7,"homepage:tvs:newest":7,search:8});current.tracking.ab={};current.tracking.ab.ABTest={doAbTrack:function(){LazyLoader.load("http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php",lazyCallback);}};current.stub("current.components.video");current.components.video.H5Video=Class.create({initialize:function(element,setOptions){this.video=$(element);this.endSlate=false;this.options={num:0,controlsBelow:false,controlsHiding:true,defaultVolume:0.85,flashVersion:9,linksHiding:true};if(typeof setOptions=="object"){this.merge(this.options,setOptions);}if(!isUndefined(localStorage.volume)){this.options.defaultVolume=localStorage.volume;}this.box=this.video.parentNode;this.percentLoaded=0;if(current.utils.Compatibility.isIpad()){this.options.controlsBelow=true;this.options.controlsHiding=false;}if(this.options.controlsBelow){this.box.addClassName("vjs-controls-below");}this.buildPoster();this.positionPoster();this.showPoster();this.video.controls=false;this.buildController();this.showController();this.video.addEventListener("loadeddata",this.onLoadedData.context(this),false);this.video.addEventListener("play",this.onPlay.context(this),false);this.video.addEventListener("pause",this.onPause.context(this),false);this.video.addEventListener("ended",this.onEnded.context(this),false);this.video.addEventListener("volumechange",this.onVolumeChange.context(this),false);this.video.addEventListener("error",this.onError.context(this),false);this.video.addEventListener("progress",this.onProgress.context(this),false);this.watchBuffer=setInterval(this.updateBufferedTotal.context(this),33);this.playControl.addEventListener("click",this.onPlayControlClick.context(this),false);this.video.addEventListener("click",this.onPlayControlClick.context(this),false);if(this.poster){this.poster.addEventListener("click",this.onPlayControlClick.context(this),false);}this.progressHolder.addEventListener("mousedown",this.onProgressHolderMouseDown.context(this),false);this.progressHolder.addEventListener("mouseup",this.onProgressHolderMouseUp.context(this),false);this.volumeControl.addEventListener("mousedown",this.onVolumeControlMouseDown.context(this),false);this.volumeControl.addEventListener("mouseup",this.onVolumeControlMouseUp.context(this),false);this.fullscreenControl.addEventListener("click",this.onFullscreenControlClick.context(this),false);this.video.addEventListener("mousemove",this.onVideoMouseMove.context(this),false);this.video.addEventListener("mouseout",this.onVideoMouseOut.context(this),false);if(this.poster){this.poster.addEventListener("mousemove",this.onVideoMouseMove.context(this),false);}if(this.poster){this.poster.addEventListener("mouseout",this.onVideoMouseOut.context(this),false);}this.controls.addEventListener("mouseout",this.onVideoMouseOut.context(this),false);this.onEscKey=function(event){if(event.keyCode==27){this.fullscreenOff();}}.context(this);this.onWindowResize=function(event){this.positionController();}.context(this);this.fixPreloading();this.setVolume(this.options.defaultVolume);this.updateVolumeDisplay();},initEndSlate:function(id){this.endSlate=current.components.video.EndSlate.getInstance(this.video);this.endSlate.initNextItems("best-of-tv-us","0","4","newest",id);},getVideo:function(){return this.video;},fixPreloading:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")){this.video.autobuffer=true;}},buildController:function(){this.controls=this.createElement("ul",{className:"vjs-controls"});this.video.parentNode.appendChild(this.controls);this.playControl=this.createElement("li",{className:"vjs-play-control vjs-play",innerHTML:"<span></span>"});this.controls.appendChild(this.playControl);this.progressControl=this.createElement("li",{className:"vjs-progress-control"});this.controls.appendChild(this.progressControl);this.progressList=this.createElement("ul");this.progressControl.appendChild(this.progressList);this.progressHolder=this.createElement("li",{className:"vjs-progress-holder"});this.progressList.appendChild(this.progressHolder);this.loadProgress=this.createElement("span",{className:"vjs-load-progress"});this.progressHolder.appendChild(this.loadProgress);this.playProgress=this.createElement("span",{className:"vjs-play-progress"});this.progressHolder.appendChild(this.playProgress);this.progressTime=this.createElement("li",{className:"vjs-progress-time"});this.progressList.appendChild(this.progressTime);this.currentTimeDisplay=this.createElement("span",{className:"vjs-current-time-display",innerHTML:"00:00"});this.progressTime.appendChild(this.currentTimeDisplay);this.timeSeparator=this.createElement("span",{innerHTML:" / "});this.progressTime.appendChild(this.timeSeparator);this.durationDisplay=this.createElement("span",{className:"vjs-duration-display",innerHTML:"00:00"});this.progressTime.appendChild(this.durationDisplay);this.volumeControl=this.createElement("li",{className:"vjs-volume-control",innerHTML:"<ul><li></li><li></li><li></li><li></li><li></li><li></li></ul>"});this.controls.appendChild(this.volumeControl);this.volumeDisplay=this.volumeControl.children[0];this.fullscreenControl=this.createElement("li",{className:"vjs-fullscreen-control",innerHTML:"<ul><li></li><li></li><li></li><li></li></ul>"});this.controls.appendChild(this.fullscreenControl);},showController:function(){this.controls.style.display="block";this.positionController();},positionController:function(){if(this.controls.style.display=="none"){return ;}if(this.options.controlsBelow){if(this.videoIsFullScreen){this.box.style.height="";this.video.style.height=(this.box.offsetHeight-this.controls.offsetHeight)+"px";}else{this.video.style.height="";this.box.style.height=this.video.offsetHeight+this.controls.offsetHeight+"px";}this.controls.style.top=this.video.offsetHeight+"px";}else{this.controls.style.top=(this.video.offsetHeight-this.controls.offsetHeight)+"px";}this.controls.style.width=this.video.offsetWidth+"px";this.sizeProgressBar();},hideController:function(){if(this.options.controlsHiding){this.controls.style.display="none";}},updatePosterSource:function(){if(!this.video.poster){var images=this.video.getElementsByTagName("img");if(images.length>0){this.video.poster=images[0].src;if(images[0].height>0){this.options.posterHeight=images[0].height;}if(images[0].width>0){this.options.posterWidth=images[0].width;}}}},buildPoster:function(){this.updatePosterSource();if(this.video.poster){this.poster=this.createElement("img");this.video.parentNode.appendChild(this.poster);this.poster.src=this.video.poster;this.poster.className="vjs-poster";}else{this.poster=false;}},showPoster:function(){if(!this.poster){return ;}this.poster.style.display="block";this.positionPoster();},positionPoster:function(){if(this.poster==false||this.poster.style.display=="none"){return ;}if(!isUndefined(this.options.posterHeight)){this.poster.style.height=this.options.posterHeight+"px";}else{this.poster.style.height=this.video.offsetHeight+"px";}if(!isUndefined(this.options.posterWidth)){this.poster.style.width=this.options.posterWidth+"px";}else{this.poster.style.width=this.video.offsetWidth+"px";}},hidePoster:function(){if(!this.poster){return ;}this.poster.style.display="none";},canPlaySource:function(){var children=this.video.children;for(var i=0;i<children.length;i++){if(children[i].tagName.toUpperCase()=="SOURCE"){var canPlay=this.video.canPlayType(children[i].type);if(canPlay=="probably"||canPlay=="maybe"){return true;}}}return false;},onPlay:function(event){this.playControl.className="vjs-play-control vjs-pause";this.hidePoster();this.trackPlayProgress();if(this.endSlate){this.endSlate.hideEndSlate();}},onPause:function(event){this.playControl.className="vjs-play-control vjs-play";this.stopTrackingPlayProgress();},onEnded:function(event){this.video.pause();this.onPause();this._customOnEnded();},_customOnEnded:function(){this.showPoster();if(this.endSlate){this.endSlate.showEndSlate();}},onVolumeChange:function(event){this.updateVolumeDisplay();},onError:function(event){console.log(event);console.log(this.video.error);this.displayError();},onLoadedData:function(event){this.showController();},displayError:function(){this.video.next(".vjs-error-slate").show();},onProgress:function(event){if(event.total>0){this.setLoadProgress(event.loaded/event.total);}},updateBufferedTotal:function(){if(this.video.buffered){if(this.video.buffered.length>=1){this.setLoadProgress(this.video.buffered.end(0)/this.video.duration);if(this.video.buffered.end(0)==this.video.duration){clearInterval(this.watchBuffer);}}}else{clearInterval(this.watchBuffer);}},setLoadProgress:function(percentAsDecimal){if(percentAsDecimal>this.percentLoaded){this.percentLoaded=percentAsDecimal;this.updateLoadProgress();}},updateLoadProgress:function(){if(this.controls.style.display=="none"){return ;}this.loadProgress.style.width=(this.percentLoaded*(this.progressHolder.offsetWidth-2))+"px";},onPlayControlClick:function(event){if(this.video.paused){this.video.play();}else{this.video.pause();}},onProgressHolderMouseDown:function(event){this.stopTrackingPlayProgress();if(this.video.paused){this.videoWasPlaying=false;}else{this.videoWasPlaying=true;this.video.pause();}this.blockTextSelection();document.onmousemove=function(event){this.setPlayProgressWithEvent(event);}.context(this);document.onmouseup=function(event){this.unblockTextSelection();document.onmousemove=null;document.onmouseup=null;if(this.videoWasPlaying){this.video.play();this.trackPlayProgress();}}.context(this);},onProgressHolderMouseUp:function(event){this.setPlayProgressWithEvent(event);if(this.video.paused){this.onPause();}else{this.onPlay();}},onVolumeControlMouseDown:function(event){this.blockTextSelection();document.onmousemove=function(event){this.setVolumeWithEvent(event);}.context(this);document.onmouseup=function(){this.unblockTextSelection();document.onmousemove=null;document.onmouseup=null;}.context(this);},onVolumeControlMouseUp:function(event){this.setVolumeWithEvent(event);},onFullscreenControlClick:function(event){if(!this.videoIsFullScreen){this.fullscreenOn();}else{this.fullscreenOff();}},onVideoMouseMove:function(event){this.showController();clearInterval(this.mouseMoveTimeout);this.mouseMoveTimeout=setTimeout(function(){this.hideController();}.context(this),4000);},onVideoMouseOut:function(event){var parent=event.relatedTarget;while(parent&&parent!==this.video&&parent!==this.controls){parent=parent.parentNode;}if(parent!==this.video&&parent!==this.controls){this.hideController();}},sizeProgressBar:function(){this.progressControl.style.width=(this.controls.offsetWidth-this.playControl.offsetWidth-this.volumeControl.offsetWidth-this.fullscreenControl.offsetWidth)-(5*5)+"px";this.progressHolder.style.width=(this.progressControl.offsetWidth-(this.progressTime.offsetWidth+20))+"px";this.updatePlayProgress();this.updateLoadProgress();},trackPlayProgress:function(){this.playProgressInterval=setInterval(function(){this.updatePlayProgress();}.context(this),33);},stopTrackingPlayProgress:function(){clearInterval(this.playProgressInterval);},updatePlayProgress:function(){if(this.controls.style.display=="none"){return ;}this.playProgress.style.width=((this.video.currentTime/this.video.duration)*(this.progressHolder.offsetWidth-2))+"px";this.updateTimeDisplay();},setPlayProgress:function(newProgress){this.video.currentTime=newProgress*this.video.duration;this.playProgress.style.width=newProgress*(this.progressHolder.offsetWidth-2)+"px";this.updateTimeDisplay();},setPlayProgressWithEvent:function(event){var newProgress=this.getRelativePosition(event.pageX,this.progressHolder);this.setPlayProgress(newProgress);if(!this.videoWasPlaying){this.onPlay(event);}},updateTimeDisplay:function(){this.currentTimeDisplay.innerHTML=this.formatTime(this.video.currentTime);if(this.video.duration){this.durationDisplay.innerHTML=this.formatTime(this.video.duration);}},setVolume:function(newVol){this.video.volume=parseFloat(newVol);localStorage.volume=this.video.volume;},setVolumeWithEvent:function(event){var newVol=this.getRelativePosition(event.pageX,this.volumeControl.children[0]);this.setVolume(newVol);},updateVolumeDisplay:function(){var volNum=Math.ceil(this.video.volume*6);for(var i=0;i<6;i++){if(i<volNum){this.volumeDisplay.children[i].style.borderColor="#fff";}else{this.volumeDisplay.children[i].style.borderColor="#555";}}},fullscreenOn:function(){this.videoIsFullScreen=true;this.docOrigOverflow=document.documentElement.style.overflow;document.addEventListener("keydown",this.onEscKey,false);window.addEventListener("resize",this.onWindowResize,false);document.documentElement.style.overflow="hidden";this.box.addClassName("vjs-fullscreen");this.positionController();this.positionPoster();},fullscreenOff:function(){this.videoIsFullScreen=false;document.removeEventListener("keydown",this.onEscKey,false);window.removeEventListener("resize",this.onWindowResize,false);document.documentElement.style.overflow=this.docOrigOverflow;this.box.removeClassName("vjs-fullscreen");this.positionController();this.positionPoster();},merge:function(obj1,obj2){for(attrname in obj2){obj1[attrname]=obj2[attrname];}return obj1;},createElement:function(tagName,attributes){return this.merge(document.createElement(tagName),attributes);},blockTextSelection:function(){document.body.focus();document.onselectstart=function(){return false;};},unblockTextSelection:function(){document.onselectstart=function(){return true;};},formatTime:function(seconds){seconds=Math.round(seconds);minutes=Math.floor(seconds/60);minutes=(minutes>=10)?minutes:"0"+minutes;seconds=Math.floor(seconds%60);seconds=(seconds>=10)?seconds:"0"+seconds;return minutes+":"+seconds;},getRelativePosition:function(x,relativeElement){return Math.max(0,Math.min(1,(x-this.findPosX(relativeElement))/relativeElement.offsetWidth));},findPosX:function(obj){var curleft=obj.offsetLeft;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;}return curleft;}});current.components.video.H5Video.getInstance=function(element,setOptions){if(!document.__h5Video__){document.__h5Video__=new current.components.video.H5Video(element,setOptions);}return document.__h5Video__;};Function.prototype.context=function(obj){var method=this;temp=function(){return method.apply(obj,arguments);};return temp;};
/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this;}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}if(selector==="body"&&!context){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this;}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true);}else{selector=[doc.createElement(ret[1])];}}else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes;}return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector);}this.length=1;this[0]=elem;}this.context=document;this.selector=selector;return this;}}else{if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector);}else{if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return jQuery(context).find(selector);}}}}else{if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);}}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}return jQuery.makeArray(selector,this);},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num]);},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems);}else{jQuery.merge(ret,elems);}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector;}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")";}}return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery);}else{if(readyList){readyList.push(fn);}}return this;},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||jQuery(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}if(length===i){target=this;--i;}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy);}else{if(copy!==undefined){target[name]=copy;}}}}}return target;};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery;}return jQuery;},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13);}jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery);}readyList=null;}if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");}}},bindReady:function(){if(readyBound){return ;}readyBound=true;if(document.readyState==="complete"){return jQuery.ready();}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}}},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false;}if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false;}var key;for(key in obj){}return key===undefined||hasOwnProperty.call(obj,key);},isEmptyObject:function(obj){for(var name in obj){return false;}return true;},error:function(msg){throw msg;},parseJSON:function(data){if(typeof data!=="string"||!data){return null;}data=jQuery.trim(data);if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))();}else{jQuery.error("Invalid JSON: "+data);}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data));}else{script.text=data;}head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object;},trim:function(text){return(text||"").replace(rtrim,"");},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array);}else{jQuery.merge(ret,array);}}return ret;},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem);}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}return -1;},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}first.length=i;return first;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i]);}}return ret;},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}return ret.concat.apply([],ret);},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined;}else{if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined;}}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments);};}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++;}return proxy;},uaMatch:function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version;}if(jQuery.browser.webkit){jQuery.browser.safari=true;}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem);};}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready();};}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready();}};}}function doScrollCheck(){if(jQuery.isReady){return ;}try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return ;}jQuery.ready();}function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}if(elem.parentNode){elem.parentNode.removeChild(elem);}}function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value);}return elems;}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass);}return elems;}return length?fn(elems[0],key):undefined;}function now(){return(new Date).getTime();}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return ;}jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}try{delete script.test;}catch(e){jQuery.support.deleteExpando=false;}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click);});div.cloneNode(true).fireEvent("onclick");}div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none";div=null;});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function";}el=null;return isSupported;};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null;})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{embed:true,object:true,applet:true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return ;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null;}if(!id){id=++uuid;}if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name);}else{if(!cache[id]){elem[expando]=id;cache[id]={};}}thisCache=cache[id];if(data!==undefined){thisCache[name]=data;}return typeof name==="string"?thisCache[name]:thisCache;},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return ;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem);}}}else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando];}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}}delete cache[id];}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0]);}else{if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);}return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});jQuery.extend({queue:function(elem,type,data){if(!elem){return ;}type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[];}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data));}else{q.push(data);}return q;},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift();}if(fn){if(type==="fx"){queue.unshift("inprogress");}fn.call(elem,function(){jQuery.dequeue(elem,type);});}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}if(data===undefined){return jQuery.queue(this[0],type);}return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type);},time);});},clearQueue:function(type){return this.queue(type||"fx",[]);}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr);},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name);}});},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")));});}if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value;}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c];}}elem.className=jQuery.trim(setClass);}}}}return this;},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")));});}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ");}elem.className=jQuery.trim(className);}else{elem.className="";}}}}return this;},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal);});}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className);}}else{if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className);}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||"";}}});},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true;}}return false;},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text;}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value;}values.push(value);}}return values;}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value;}return(elem.value||"").replace(rreturn,"");}return undefined;}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return ;}if(isFunction){val=value.call(this,i,self.val());}if(typeof val==="number"){val+="";}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0;}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0;});if(!values.length){this.selectedIndex=-1;}}else{this.value=val;}}});}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}return elem[name];}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value;}return elem.style.cssText;}if(set){elem.setAttribute(name,""+value);}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}return jQuery.style(elem,name,value);}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch;});};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return ;}if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window;}var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;}if(!handler.guid){handler.guid=jQuery.guid++;}var elemData=jQuery.data(elem);if(!elemData){return ;}var events=elemData.events=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined;};}eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".");}else{namespaces=[];handleObj.namespace="";}handleObj.type=type;handleObj.guid=handler.guid;var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else{if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}handlers.push(handleObj);jQuery.event.global[type]=true;}elem=null;},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return ;}var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.data(elem),events=elemData&&elemData.events;if(!elemData||!events){return ;}if(types&&types.type){handler=types.handler;types=types.type;}if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types);}return ;}types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)");}eventType=events[type];if(!eventType){continue;}if(!handler){for(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1);}}continue;}special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1);}if(special.remove){special.remove.call(elem,handleObj);}}if(pos!=null){break;}}}if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle);}ret=null;delete events[type];}}if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null;}delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem);}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem);}});}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data);}var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false;}}}catch(e){}if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true);}else{if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null;}jQuery.event.triggered=true;target[type]();}}catch(e){}if(old){target["on"+type]=old;}jQuery.event.triggered=false;}}}},handle:function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}if(event.isImmediatePropagationStopped()){break;}}}}return event.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event;}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}if(!event.target){event.target=event.srcElement||document;}if(event.target.nodeType===3){event.target=event.target.parentNode;}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));}return event;},guid:100000000,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}));},remove:function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[],function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;return false;}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler);}}},beforeunload:{setup:function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle;}return false;},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null;}}}}};var removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener(type,handle,false);}:function(elem,type,handle){elem.detachEvent("on"+type,handle);};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src);}if(src&&src.type){this.originalEvent=src;this.type=src.type;}else{this.type=src;}this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}function returnTrue(){return true;}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return ;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return ;}if(e.stopPropagation){e.stopPropagation();}e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode;}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments);};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig);},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement);}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments);}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments);}});}else{return false;}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit");}};}if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked;}else{if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected;}).join("-"):"";}else{if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex;}}}return val;},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return ;}data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val);}if(data===undefined||val===data){return ;}if(data!=null||val){e.type="change";return jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e);}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e);}},beforeactivate:function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem));}},setup:function(data,namespaces){if(this.type==="file"){return false;}for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type]);}return formElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return formElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args);}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true);},teardown:function(){this.removeEventListener(orig,handler,true);}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e);}});}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn);}return this;}if(jQuery.isFunction(data)){fn=data;data=undefined;}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments);}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data);}}return this;};});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key]);}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn);}}return this;},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector);},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live");}else{return this.die(types,null,fn,selector);}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++]);}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined;}types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"");}if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue;}preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces;}else{type=(liveMap[type]||type)+namespaces;}if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType});});}else{context.unbind(liveConvert(type,selector),fn);}}return this;};});function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return ;}event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector);}else{live.splice(j--,1);}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0];}if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj});}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break;}}return stop;}function liveConvert(type,selector){return"live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g,"`").replace(/ /g,"&");}jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem);}catch(e){}}}});
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}if(!selector||typeof selector!=="string"){return results;}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();}set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}if(pop==null){pop=context;}Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}if(!checkSet){checkSet=set;}if(!checkSet){Sizzle.error(cur||selector);}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else{if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}}else{makeArray(checkSet,results);}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}if(!set){set=context.getElementsByTagName("*");}return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue;}if(curLoop===result){result=[];}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else{if(match===true){continue;}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else{if(pass){result.push(item);anyFound=true;}}}}}if(found!==undefined){if(!inplace){curLoop=result;}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}break;}}}if(expr===old){if(anyFound==null){Sizzle.error(expr);}else{break;}}old=expr;}return curLoop;};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase();}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part;}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem);}}else{if(inplace){curLoop[i]=false;}}}}return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){return match[1].toLowerCase();},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}if(match[2]==="~="){match[4]=" "+match[4]+" ";}return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}return false;}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}}return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return !!elem.firstChild;},empty:function(elem){return !elem.firstChild;},has:function(elem,i,match){return !!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else{if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0;}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}return true;}else{Sizzle.error("Syntax error, unrecognized expression: "+name);}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false;}}if(type==="first"){return true;}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false;}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true;}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}parent.sizcache=doneName;}var diff=elem.nodeIndex-last;if(first===0){return diff===0;}else{return(diff%first===0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,function(all,num){return"\\"+(num-0+1);}));}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;}return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}return ret;};}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true;}return a.compareDocumentPosition?-1:1;}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}return ret;};}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true;}return a.sourceIndex?-1:1;}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}return ret;};}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true;}return a.ownerDocument?-1:1;}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}return ret;};}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue;}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes);}}}return ret;}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}results=tmp;}return results;};}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}div=null;})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return ;}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}div=null;})();}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return ;}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return ;}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}if(elem.nodeName.toLowerCase()===cur){match=elem;break;}elem=elem[dir];}checkSet[i]=match;}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}}elem=elem[dir];}checkSet[i]=match;}}}var contains=document.compareDocumentPosition?function(a,b){return !!(a.compareDocumentPosition(b)&16);}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return ;window.Sizzle=Sizzle;})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return !!qualifier.call(elem,i,elem)===keep;});}else{if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else{if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}}}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break;}}}}}return ret;},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector);},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector);},is:function(selector){return !!selector&&jQuery.filter(selector,this).length>0;},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector;}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector];}}cur=cur.parentNode;}}return ret;}var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur;}cur=cur.parentNode;}return null;});},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children());}return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return !node||!node.parentNode||node.parentNode.nodeType===11;}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until;}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}return this.pushStack(ret,name,slice.call(arguments).join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}return jQuery.find.matches(expr,elems);},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);}cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}}return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}return r;}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">";},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"];}jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()));});}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));}return jQuery.text(this);},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;}return elem;}).append(this);}return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild);}});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});}else{if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments);}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});}else{if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set;}}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem]);}if(elem.parentNode){elem.parentNode.removeChild(elem);}}}return this;},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));}while(elem.firstChild){elem.removeChild(elem.firstChild);}}return this;},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0];}else{return this.cloneNode(true);}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"));}return ret;},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null;}else{if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value;}}}catch(e){this.empty().append(value);}}else{if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old);});});}else{this.empty().append(value);}}}return this;},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old));});}if(typeof value!=="string"){value=jQuery(value).detach();}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value);}else{jQuery(parent).append(value);}});}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value);}},detach:function(selector){return this.remove(selector,true);},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true);});}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback);});}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent};}else{results=buildFragment(args,this,scripts);}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild;}else{first=fragment.firstChild;}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment);}}if(scripts.length){jQuery.each(scripts,evalScript);}}return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return ;}var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}}});}function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults;}}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts);}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1;}return{fragment:fragment,cacheable:cacheable};}jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this;}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}return this.pushStack(ret,name,insert.selector);}};});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";}if(!elem){continue;}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem);}else{if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);}elem=div.childNodes;}}if(elem.nodeType){ret.push(elem);}else{ret=jQuery.merge(ret,elem);}}if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));}fragment.appendChild(ret[i]);}}}return ret;},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{removeEvent(elem,type,data.handle);}}}if(deleteExpando){delete elem[jQuery.expando];}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}}delete cache[id];}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name);}if(typeof value==="number"&&!rexclude.test(name)){value+="px";}jQuery.style(elem,name,value);});};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined;}var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity;}return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":"";}if(rfloat.test(name)){name=styleFloat;}name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value;}return style[name];},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return ;}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;}});}if(elem.offsetWidth!==0){getWH();}else{jQuery.swap(elem,props,getWH);}return Math.max(0,Math.round(val));}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret;}if(rfloat.test(name)){name=styleFloat;}if(!force&&style&&style[name]){ret=style[name];}else{if(getComputedStyle){if(rfloat.test(name)){name="float";}name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null;}var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name);}if(name==="opacity"&&ret===""){ret="1";}}else{if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}}}return ret;},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options){elem.style[name]=old[name];}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none";};jQuery.expr.filters.visible=function(elem){return !jQuery.expr.filters.hidden(elem);};}var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url);}else{if(!this.length){return this;}}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null;}else{if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST";}}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText);}if(callback){self.each(callback,[res.responseText,status,res]);}}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest();}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?";}}else{if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}}s.dataType="json";}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);}};}if(s.dataType==="script"&&s.cache===null){s.cache=false;}if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data;}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script);}}};}head.insertBefore(script,head.firstChild);return undefined;}var requestDone=false;var xhr=s.xhr();if(!xhr){return ;}if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);}else{xhr.open(type,s.url,s.async);}try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType);}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]);}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url]);}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}xhr.abort();return false;}if(s.global){trigger("ajaxSend",[xhr,s]);}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete();}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop;}}else{if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(err){status="parsererror";errMsg=err;}}if(status==="success"||status==="notmodified"){if(!jsonp){success();}}else{jQuery.handleError(s,xhr,status,errMsg);}complete();if(isTimeout==="timeout"){xhr.abort();}if(s.async){xhr=null;}}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr);}onreadystatechange("abort");};}catch(e){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout");}},s.timeout);}try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null);}catch(e){jQuery.handleError(s,xhr,null,e);complete();}if(!s.async){onreadystatechange();}function success(){if(s.success){s.success.call(callbackContext,data,status,xhr);}if(s.global){trigger("ajaxSuccess",[xhr,s]);}}function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status);}if(s.global){trigger("ajaxComplete",[xhr,s]);}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}}function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args);}return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e);}if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}catch(e){}return false;},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified;}if(etag){jQuery.etag[url]=etag;}return xhr.status===304||xhr.status===0;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror");}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data);}}}return data;},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix]);}}return s.join("&").replace(r20,"+");function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v);}});}else{if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v);});}else{add(prefix,obj);}}}function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName];}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block";}elem.remove();elemdisplay[nodeName]=display;}jQuery.data(this[i],"olddisplay",display);}}for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||"";}return this;}},hide:function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}}for(var j=0,k=this.length;j<k;j++){this[j].style.display="none";}return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments);}else{if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();});}else{this.animate(genFx("toggle",3),fn,fn2);}}return this;},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete);}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name;}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this);}if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0];}}if(opt.overflow!=null){this.style.overflow="hidden";}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop);}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");}}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([]);}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true);}timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();}if(jQuery.isFunction(opt.old)){opt.old.call(this);}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={};}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13);}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block";}}if(this.options.hide){jQuery(this.elem).hide();}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p]);}}this.options.complete.call(this.elem);}return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}if(!timers.length){jQuery.fx.stop();}},stop:function(){clearInterval(timerId);timerId=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit;}else{fx.elem[fx.prop]=fx.now;}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}if("getBoundingClientRect" in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break;}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevComputedStyle=computedStyle;}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft;}if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);}return{top:top,left:left};};}jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop;},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0;}return{top:top,left:left};},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative";}var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);}var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return null;}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;}return offsetParent;});}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null;}if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop());}else{this[method]=val;}});}else{win=getWindow(elem);return win?("pageXOffset" in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];}};});function getWindow(elem){return("scrollTo" in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null;};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this;}if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()));});}return("scrollTo" in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px");};});window.jQuery=window.$=jQuery;})(window);(function($){var addMethods=function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=$.keys(source);if(!$.keys({toString:true}).length){properties.push("toString","valueOf");}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&$.isFunction(value)&&$.argumentNames(value)[0]=="$super"){var method=value,value=$.extend($.wrap((function(m){return function(){return ancestor[m].apply(this,arguments);};})(property),method),{valueOf:function(){return method;},toString:function(){return method.toString();}});}this.prototype[property]=value;}return this;};$.extend({keys:function(obj){var keys=[];for(var key in obj){keys.push(key);}return keys;},argumentNames:function(func){var names=func.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(/, ?/);return names.length==1&&!names[0]?[]:names;},bind:function(func,scope){return function(){return func.apply(scope,$.makeArray(arguments));};},wrap:function(func,wrapper){var __method=func;return function(){return wrapper.apply(this,[$.bind(__method,this)].concat($.makeArray(arguments)));};},klass:function(){var parent=null,properties=$.makeArray(arguments);if($.isFunction(properties[0])){parent=properties.shift();}var klass=function(){this.initialize.apply(this,arguments);};klass.superclass=parent;klass.subclasses=[];klass.addMethods=addMethods;if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}for(var i=0;i<properties.length;i++){klass.addMethods(properties[i]);}if(!klass.prototype.initialize){klass.prototype.initialize=function(){};}klass.prototype.constructor=klass;return klass;},klassDelegate:function(rules){return function(e){var target=$(e.target),parent=null;for(var selector in rules){if(target.is(selector)||((parent=target.parents(selector))&&parent.length>0)){return rules[selector].apply(this,[parent||target].concat($.makeArray(arguments)));}parent=null;}};}});var bindEvents=function(instance){for(var member in instance){if(member.match(/^on(.+)/)&&typeof instance[member]=="function"){instance.element.bind(RegExp.$1,$.bind(instance[member],instance));}}};var behaviorWrapper=function(behavior){return $.klass(behavior,{initialize:function($super,element,args){this.element=$(element);if($super){$super.apply(this,args);}},trigger:function(eventType,extraParameters){var parameters=[this].concat(extraParameters);this.element.trigger(eventType,parameters);}});};var attachBehavior=function(el,behavior,args){var wrapper=behaviorWrapper(behavior);instance=new wrapper(el,args);bindEvents(instance);if(!behavior.instances){behavior.instances=[];}behavior.instances.push(instance);return instance;};$.fn.extend({attach:function(){var args=$.makeArray(arguments),behavior=args.shift();if($.livequery&&this.selector){return this.livequery(function(){attachBehavior(this,behavior,args);});}else{return this.each(function(){attachBehavior(this,behavior,args);});}},attachAndReturn:function(){var args=$.makeArray(arguments),behavior=args.shift();return $.map(this,function(el){return attachBehavior(el,behavior,args);});},klassDelegate:function(type,rules){return this.bind(type,$.klassDelegate(rules));},attached:function(behavior){var instances=[];if(!behavior.instances){return instances;}this.each(function(i,element){$.each(behavior.instances,function(i,instance){if(instance.element.get(0)==element){instances.push(instance);}});});return instances;},firstAttached:function(behavior){return this.attached(behavior)[0];}});Remote=$.klass({initialize:function(options){if(this.element.attr("nodeName")=="FORM"){this.element.attach(Remote.Form,options);}else{this.element.attach(Remote.Link,options);}}});Remote.Base=$.klass({initialize:function(options){this.options=options;},_makeRequest:function(options){$.ajax(options);return false;}});Remote.Link=$.klass(Remote.Base,{onclick:function(){var options=$.extend({url:this.element.attr("href"),type:"GET"},this.options);return this._makeRequest(options);}});Remote.Form=$.klass(Remote.Base,{onclick:function(e){var target=e.target;if($.inArray(target.nodeName.toLowerCase(),["input","button"])>=0&&target.type.match(/submit|image/)){this._submitButton=target;}},onsubmit:function(){var data=this.element.serializeArray();if(this._submitButton){data.push({name:this._submitButton.name,value:this._submitButton.value});}var options=$.extend({url:this.element.attr("action"),type:this.element.attr("method")||"GET",data:data},this.options);this._makeRequest(options);return false;}});$.ajaxSetup({beforeSend:function(xhr){if(!this.dataType){xhr.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");}}});})(jQuery);(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 p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){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.mouseover(handleHover).mouseout(handleHover);};})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b;}return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b;}return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b;}if(t==d){return b+c;}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b;}return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b;}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b;}return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b;}});jQuery.extend(jQuery.easing,{easeIn:function(x,t,b,c,d){return jQuery.easing.easeInQuad(x,t,b,c,d);},easeOut:function(x,t,b,c,d){return jQuery.easing.easeOutQuad(x,t,b,c,d);},easeInOut:function(x,t,b,c,d){return jQuery.easing.easeInOutQuad(x,t,b,c,d);},expoin:function(x,t,b,c,d){return jQuery.easing.easeInExpo(x,t,b,c,d);},expoout:function(x,t,b,c,d){return jQuery.easing.easeOutExpo(x,t,b,c,d);},expoinout:function(x,t,b,c,d){return jQuery.easing.easeInOutExpo(x,t,b,c,d);},bouncein:function(x,t,b,c,d){return jQuery.easing.easeInBounce(x,t,b,c,d);},bounceout:function(x,t,b,c,d){return jQuery.easing.easeOutBounce(x,t,b,c,d);},bounceinout:function(x,t,b,c,d){return jQuery.easing.easeInOutBounce(x,t,b,c,d);},elasin:function(x,t,b,c,d){return jQuery.easing.easeInElastic(x,t,b,c,d);},elasout:function(x,t,b,c,d){return jQuery.easing.easeOutElastic(x,t,b,c,d);},elasinout:function(x,t,b,c,d){return jQuery.easing.easeInOutElastic(x,t,b,c,d);},backin:function(x,t,b,c,d){return jQuery.easing.easeInBack(x,t,b,c,d);},backout:function(x,t,b,c,d){return jQuery.easing.easeOutBack(x,t,b,c,d);},backinout:function(x,t,b,c,d){return jQuery.easing.easeInOutBack(x,t,b,c,d);}});(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$("ul",div),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v;}var li=$("li",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",cssFloat:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev){$(o.btnPrev).click(function(){return go(curr-o.scroll);});}if(o.btnNext){$(o.btnNext).click(function(){return go(curr+o.scroll);});}if(o.btnGo){$.each(o.btnGo,function(i,val){$(val).click(function(){return go(o.circular?o.visible+i:i);});});}if(o.mouseWheel&&div.mousewheel){div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});}if(o.auto){setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);}function vis(){return li.slice(curr).slice(0,v);}function go(to){if(!running){if(o.beforeStart){o.beforeStart.call(this,vis());}if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll;}else{if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll;}else{curr=to;}}}else{if(to<0||to>itemLength-v){return ;}else{curr=to;}}running=true;ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd){o.afterEnd.call(this,vis());}running=false;});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}return false;}});};function css(el,prop){return parseInt($.css(el[0],prop))||0;}function width(el){return el[0].offsetWidth+css(el,"marginLeft")+css(el,"marginRight");}function height(el){return el[0].offsetHeight+css(el,"marginTop")+css(el,"marginBottom");}})(jQuery);(function($){$.jQTouch=function(options){var $body,$head=$("head"),initialPageId="",hist=[],newPageCount=0,jQTSettings={},currentPage="",orientation="portrait",tapReady=true,lastTime=0,lastAnimationTime=0,touchSelectors=[],publicObj={},tapBuffer=351,extensions=$.jQTouch.prototype.extensions,animations=[],hairExtensions="",defaults={addGlossToIcon:true,backSelector:".back, .cancel, .goback",cacheGetRequests:true,debug:false,fallback2dAnimation:"fade",fixedViewport:true,formSelector:"form",fullScreen:true,fullScreenClass:"fullscreen",hoverDelay:50,icon:null,icon4:null,moveThreshold:10,preloadImages:false,pressDelay:1000,startupScreen:null,statusBar:"default",submitSelector:".submit",touchSelector:"a, .touch",useAnimations:true,useFastTouch:true,animations:[{selector:".cube",name:"cubeleft",is3d:true},{selector:".cubeleft",name:"cubeleft",is3d:true},{selector:".cuberight",name:"cuberight",is3d:true},{selector:".dissolve",name:"fade",is3d:false},{selector:".fade",name:"fade",is3d:false},{selector:".flip",name:"flipleft",is3d:true},{selector:".flipleft",name:"flipleft",is3d:true},{selector:".flipright",name:"flipright",is3d:true},{selector:".pop",name:"pop",is3d:true},{selector:".slide",name:"slideleft",is3d:false},{selector:".slidedown",name:"slidedown",is3d:false},{selector:".slideleft",name:"slideleft",is3d:false},{selector:".slideright",name:"slideright",is3d:false},{selector:".slideup",name:"slideup",is3d:false},{selector:".swap",name:"swapleft",is3d:true},{selector:"#jqt > * > ul li a",name:"slideleft",is3d:false}]};function _debug(message){now=(new Date).getTime();delta=now-lastTime;lastTime=now;if(jQTSettings.debug){if(message){console.log(delta+": "+message);}else{console.log(delta+": Called "+arguments.callee.caller.name);}}}function addAnimation(animation){_debug();if(typeof (animation.selector)==="string"&&typeof (animation.name)==="string"){animations.push(animation);}}function addPageToHistory(page,animation,reverse){_debug();hist.unshift({page:page,animation:animation,hash:"#"+page.attr("id"),id:page.attr("id")});}function clickHandler(e){_debug();if(!tapReady){_debug("ClickHandler handler aborted because tap is not ready");e.preventDefault();return false;}var $el=$(e.target);if(!$el.is(touchSelectors.join(", "))){var $el=$(e.target).closest(touchSelectors.join(", "));}if($el&&$el.attr("href")&&!$el.isExternalLink()){_debug("Need to prevent default click behavior");e.preventDefault();}else{_debug("No need to prevent default click behavior");}if($.support.touch){_debug("Not converting click to a tap event because touch handler is on the job");}else{_debug("Converting click event to a tap event");$(e.target).trigger("tap",e);}}function doNavigation(fromPage,toPage,animation,backwards){_debug();if(toPage.length===0){$.fn.unselect();_debug("Target element is missing.");return false;}if(toPage.hasClass("current")){$.fn.unselect();_debug("You are already on the page you are trying to navigate to.");return false;}$(":focus").blur();fromPage.trigger("pageAnimationStart",{direction:"out"});toPage.trigger("pageAnimationStart",{direction:"in"});if($.support.animationEvents&&animation&&jQTSettings.useAnimations){tapReady=false;if(!$.support.transform3d&&animation.is3d){animation.name=jQTSettings.fallback2dAnimation;}var finalAnimationName;if(backwards){if(animation.name.indexOf("left")>0){finalAnimationName=animation.name.replace(/left/,"right");}else{if(animation.name.indexOf("right")>0){finalAnimationName=animation.name.replace(/right/,"left");}else{if(animation.name.indexOf("up")>0){finalAnimationName=animation.name.replace(/up/,"down");}else{if(animation.name.indexOf("down")>0){finalAnimationName=animation.name.replace(/down/,"up");}else{finalAnimationName=animation.name;}}}}}else{finalAnimationName=animation.name;}fromPage.bind("webkitAnimationEnd",navigationEndHandler);toPage.addClass(finalAnimationName+" in current");fromPage.addClass(finalAnimationName+" out");}else{toPage.addClass("current");navigationEndHandler();}function navigationEndHandler(event){_debug();if($.support.animationEvents&&animation&&jQTSettings.useAnimations){fromPage.unbind("webkitAnimationEnd",navigationEndHandler);fromPage.removeClass(finalAnimationName+" out current");toPage.removeClass(finalAnimationName+" in");}else{fromPage.removeClass(finalAnimationName+" out current");}currentPage=toPage;if(backwards){hist.shift();}else{addPageToHistory(currentPage,animation);}fromPage.unselect();lastAnimationTime=(new Date()).getTime();setHash(currentPage.attr("id"));tapReady=true;toPage.trigger("pageAnimationEnd",{direction:"in",animation:animation});fromPage.trigger("pageAnimationEnd",{direction:"out",animation:animation});}return true;}function getOrientation(){_debug();return orientation;}function goBack(){_debug();if(hist.length<1){_debug("History is empty.");}if(hist.length===1){_debug("You are on the first panel.");}var from=hist[0],to=hist[1];if(doNavigation(from.page,to.page,from.animation,true)){return publicObj;}else{_debug("Could not go back.");return false;}}function goTo(toPage,animation,reverse){_debug();if(reverse){console.warn("The reverse parameter was sent to goTo() function, which is bad.");}var fromPage=hist[0].page;if(typeof animation==="string"){for(var i=0,max=animations.length;i<max;i++){if(animations[i].name===animation){animation=animations[i];break;}}}if(typeof (toPage)==="string"){var nextPage=$(toPage);if(nextPage.length<1){showPageByHref(toPage,{animation:animation});return ;}else{toPage=nextPage;}}if(doNavigation(fromPage,toPage,animation,reverse)){return publicObj;}else{_debug("Could not animate pages.");return false;}}function hashChangeHandler(e){_debug();if(hist[1]===undefined){_debug("There is no previous page in history");}else{if(location.hash===hist[1].hash){goBack();}else{_debug(location.hash+" !== "+hist[1].hash);}}}function init(options){_debug();jQTSettings=$.extend({},defaults,options);if(jQTSettings.preloadImages){for(var i=jQTSettings.preloadImages.length-1;i>=0;i--){(new Image()).src=jQTSettings.preloadImages[i];}}if(jQTSettings.icon||jQTSettings.icon4){var precomposed,appropriateIcon;if(jQTSettings.icon4&&window.devicePixelRatio&&window.devicePixelRatio===2){appropriateIcon=jQTSettings.icon4;}else{if(jQTSettings.icon){appropriateIcon=jQTSettings.icon;}else{appropriateIcon=false;}}if(appropriateIcon){precomposed=(jQTSettings.addGlossToIcon)?"":"-precomposed";hairExtensions+='<link rel="apple-touch-icon'+precomposed+'" href="'+appropriateIcon+'" />';}}if(jQTSettings.startupScreen){hairExtensions+='<link rel="apple-touch-startup-image" href="'+jQTSettings.startupScreen+'" />';}if(jQTSettings.fixedViewport){hairExtensions+='<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>';}if(jQTSettings.fullScreen){hairExtensions+='<meta name="apple-mobile-web-app-capable" content="yes" />';if(jQTSettings.statusBar){hairExtensions+='<meta name="apple-mobile-web-app-status-bar-style" content="'+jQTSettings.statusBar+'" />';}}if(hairExtensions){$head.prepend(hairExtensions);}}function insertPages(nodes,animation){_debug();var targetPage=null;$(nodes).each(function(index,node){var $node=$(this);if(!$node.attr("id")){$node.attr("id","page-"+(++newPageCount));}$("#"+$node.attr("id")).remove();$body.trigger("pageInserted",{page:$node.appendTo($body)});if($node.hasClass("current")||!targetPage){targetPage=$node;}});if(targetPage!==null){goTo(targetPage,animation);return targetPage;}else{return false;}}function mousedownHandler(e){var timeDiff=(new Date()).getTime()-lastAnimationTime;if(timeDiff<tapBuffer){return false;}}function orientationChangeHandler(){_debug();orientation=Math.abs(window.orientation)==90?"landscape":"portrait";$body.removeClass("portrait landscape").addClass(orientation).trigger("turn",{orientation:orientation});}function setHash(hash){_debug();hash=hash.replace(/^#/,""),window.onhashchange=null;location.hash="#"+hash;window.onhashchange=hashChangeHandler;}function showPageByHref(href,options){_debug();var defaults={data:null,method:"GET",animation:null,callback:null,$referrer:null};var settings=$.extend({},defaults,options);if(href!="#"){$.ajax({url:href,data:settings.data,type:settings.method,success:function(data,textStatus){var firstPage=insertPages(data,settings.animation);if(firstPage){if(settings.method=="GET"&&jQTSettings.cacheGetRequests===true&&settings.$referrer){settings.$referrer.attr("href","#"+firstPage.attr("id"));}if(settings.callback){settings.callback(true);}}},error:function(data){if(settings.$referrer){settings.$referrer.unselect();}if(settings.callback){settings.callback(false);}}});}else{if(settings.$referrer){settings.$referrer.unselect();}}}function submitHandler(e,callback){_debug();$(":focus").blur();e.preventDefault();var $form=(typeof (e)==="string")?$(e).eq(0):(e.target?$(e.target):$(e));_debug($form.attr("action"));if($form.length&&$form.is(jQTSettings.formSelector)&&$form.attr("action")){showPageByHref($form.attr("action"),{data:$form.serialize(),method:$form.attr("method")||"POST",animation:animations[0]||null,callback:callback});return false;}return false;}function submitParentForm($el){_debug();var $form=$el.closest("form");if($form.length===0){_debug("No parent form found");}else{_debug("About to submit parent form");var evt=$.Event("submit");evt.preventDefault();$form.trigger(evt);return false;}return true;}function supportForAnimationEvents(){_debug();return(typeof WebKitAnimationEvent!="undefined");}function supportForCssMatrix(){_debug();return(typeof WebKitCSSMatrix!="undefined");}function supportForTouchEvents(){_debug();if(!jQTSettings.useFastTouch){return false;}if(typeof TouchEvent!="undefined"){if(window.navigator.userAgent.indexOf("Mobile")>-1){return true;}else{return false;}}else{return false;}}function supportForTransform3d(){_debug();var head,body,style,div,result;head=document.getElementsByTagName("head")[0];body=document.body;style=document.createElement("style");style.textContent="@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){#jqtTestFor3dSupport{height:3px}}";div=document.createElement("div");div.id="jqtTestFor3dSupport";head.appendChild(style);body.appendChild(div);result=div.offsetHeight===3;style.parentNode.removeChild(style);div.parentNode.removeChild(div);return result;}function tapHandler(e){_debug();if(!tapReady){_debug("Tap is not ready");return false;}var $el=$(e.target);if(!$el.is(touchSelectors.join(", "))){var $el=$(e.target).closest(touchSelectors.join(", "));}if(!$el.length||!$el.attr("href")){_debug("Could not find a link related to tapped element");return false;}var target=$el.attr("target"),hash=$el.attr("hash"),animation=null;if($el.isExternalLink()){$el.unselect();return true;}else{if($el.is(jQTSettings.backSelector)){goBack(hash);}else{if($el.is(jQTSettings.submitSelector)){submitParentForm($el);}else{if(target==="_webapp"){window.location=$el.attr("href");return false;}else{if($el.attr("href")==="#"){$el.unselect();return true;}else{for(var i=0,max=animations.length;i<max;i++){if($el.is(animations[i].selector)){animation=animations[i];break;}}if(!animation){console.warn("Animation could not be found. Using slideleft.");animation="slideleft";}if(hash&&hash!=="#"){$el.addClass("active");goTo($(hash).data("referrer",$el),animation,$(this).hasClass("reverse"));return false;}else{$el.addClass("loading active");showPageByHref($el.attr("href"),{animation:animation,callback:function(){$el.removeClass("loading");setTimeout($.fn.unselect,250,$el);},$referrer:$el});return false;}}}}}}}function touchStartHandler(e){_debug();if(!tapReady){_debug("TouchStart handler aborted because tap is not ready");e.preventDefault();return false;}var $el=$(e.target);if(!$el.length){_debug("Could not find target of touchstart event.");return ;}var startTime=(new Date).getTime(),hoverTimeout=null,pressTimeout=null,touch,startX,startY,deltaX=0,deltaY=0,deltaT=0;if(event.changedTouches&&event.changedTouches.length){touch=event.changedTouches[0];startX=touch.pageX;startY=touch.pageY;}$el.bind("touchmove",touchmove).bind("touchend",touchend).bind("touchcancel",touchcancel);hoverTimeout=setTimeout(function(){$el.makeActive();},jQTSettings.hoverDelay);pressTimeout=setTimeout(function(){$el.unbind("touchmove",touchmove).unbind("touchend",touchend).unbind("touchcancel",touchcancel);$el.unselect();clearTimeout(hoverTimeout);$el.trigger("press");},jQTSettings.pressDelay);function touchcancel(e){_debug();clearTimeout(hoverTimeout);$el.unselect();$el.unbind("touchmove",touchmove).unbind("touchend",touchend).unbind("touchcancel",touchcancel);}function touchend(e){_debug();$el.unbind("touchend",touchend).unbind("touchcancel",touchcancel);clearTimeout(hoverTimeout);clearTimeout(pressTimeout);if(Math.abs(deltaX)<jQTSettings.moveThreshold&&Math.abs(deltaY)<jQTSettings.moveThreshold&&deltaT<jQTSettings.pressDelay){$el.trigger("tap",e);}else{$el.unselect();}}function touchmove(e){updateChanges();var absX=Math.abs(deltaX);var absY=Math.abs(deltaY);var direction;if(absX>absY&&(absX>35)&&deltaT<1000){if(deltaX<0){direction="left";}else{direction="right";}$el.unbind("touchmove",touchmove).unbind("touchend",touchend).unbind("touchcancel",touchcancel);$el.trigger("swipe",{direction:direction,deltaX:deltaX,deltaY:deltaY});}$el.unselect();clearTimeout(hoverTimeout);if(absX>jQTSettings.moveThreshold||absY>jQTSettings.moveThreshold){clearTimeout(pressTimeout);}}function updateChanges(){var firstFinger=event.changedTouches[0]||null;deltaX=firstFinger.pageX-startX;deltaY=firstFinger.pageY-startY;deltaT=(new Date).getTime()-startTime;}}init(options);$(document).ready(function(){$.support.animationEvents=supportForAnimationEvents();$.support.cssMatrix=supportForCssMatrix();$.support.touch=supportForTouchEvents();$.support.transform3d=supportForTransform3d();if(!$.support.touch){console.warn("This device does not support touch interaction, or it has been deactivated by the developer. Some features might be unavailable.");}if(!$.support.transform3d){console.warn("This device does not support 3d animation. 2d animations will be used instead.");}$.fn.isExternalLink=function(){var $el=$(this);return($el.attr("target")=="_blank"||$el.attr("rel")=="external"||$el.is('a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));};$.fn.makeActive=function(){return $(this).addClass("active");};$.fn.press=function(fn){if($.isFunction(fn)){return $(this).live("press",fn);}else{return $(this).trigger("press");}};$.fn.swipe=function(fn){if($.isFunction(fn)){return $(this).live("swipe",fn);}else{return $(this).trigger("swipe");}};$.fn.tap=function(fn){if($.isFunction(fn)){return $(this).live("tap",fn);}else{return $(this).trigger("tap");}};$.fn.unselect=function(obj){if(obj){obj.removeClass("active");}else{$(".active").removeClass("active");}};for(var i=0,max=extensions.length;i<max;i++){var fn=extensions[i];if($.isFunction(fn)){$.extend(publicObj,fn(publicObj));}}if(jQTSettings.cubeSelector){console.warn("NOTE: cubeSelector has been deprecated. Please use cubeleftSelector instead.");jQTSettings.cubeleftSelector=jQTSettings.cubeSelector;}if(jQTSettings.flipSelector){console.warn("NOTE: flipSelector has been deprecated. Please use flipleftSelector instead.");jQTSettings.flipleftSelector=jQTSettings.flipSelector;}if(jQTSettings.slideSelector){console.warn("NOTE: slideSelector has been deprecated. Please use slideleftSelector instead.");jQTSettings.slideleftSelector=jQTSettings.slideSelector;}for(var i=0,max=defaults.animations.length;i<max;i++){var animation=defaults.animations[i];if(jQTSettings[animation.name+"Selector"]!==undefined){animation.selector=jQTSettings[animation.name+"Selector"];}addAnimation(animation);}touchSelectors.push("input");touchSelectors.push(jQTSettings.touchSelector);touchSelectors.push(jQTSettings.backSelector);touchSelectors.push(jQTSettings.submitSelector);$(touchSelectors.join(", ")).css("-webkit-touch-callout","none");$body=$("#jqt");if($body.length===0){console.warn('Could not find an element with the id "jqt", so the body id has been set to "jqt". If you are having any problems, wrapping your panels in a div with the id "jqt" might help.');$body=$("body").attr("id","jqt");}if($.support.transform3d){$body.addClass("supports3d");}if(jQTSettings.fullScreenClass&&window.navigator.standalone==true){$body.addClass(jQTSettings.fullScreenClass+" "+jQTSettings.statusBar);}$body.bind("touchstart",touchStartHandler).bind("click",clickHandler).bind("mousedown",mousedownHandler).bind("orientationchange",orientationChangeHandler).bind("submit",submitHandler).bind("tap",tapHandler).trigger("orientationchange");if(location.hash.length){location.replace(location.href.split("#")[0]);}if($("#jqt > .current").length==0){currentPage=$("#jqt > *:first");}else{currentPage=$("#jqt > .current:first");$("#jqt > .current").removeClass("current");}$(currentPage).addClass("current");initialPageId=$(currentPage).attr("id");if(history.replaceState!==undefined){history.replaceState(null,null,"#"+initialPageId);}else{setHash(initialPageId);}addPageToHistory(currentPage);scrollTo(0,0);});publicObj={animations:animations,hist:hist,settings:jQTSettings,support:$.support,getOrientation:getOrientation,goBack:goBack,goTo:goTo,addAnimation:addAnimation,submitForm:submitHandler};return publicObj;};$.jQTouch.prototype.extensions=[];$.jQTouch.addExtension=function(extension){$.jQTouch.prototype.extensions.push(extension);};})(jQuery);(function(b,a,c){b.fn.jScrollPane=function(f){function d(C,L){var au,N=this,V,ah,v,aj,Q,W,y,q,av,aB,ap,i,H,h,j,X,R,al,U,t,A,am,ac,ak,F,l,ao,at,x,aq,aE,g,aA,ag=true,M=true,aD=false,k=false,Z=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aE=C.css("paddingTop")+" "+C.css("paddingRight")+" "+C.css("paddingBottom")+" "+C.css("paddingLeft");g=(parseInt(C.css("paddingLeft"))||0)+(parseInt(C.css("paddingRight"))||0);an(L);function an(aH){var aL,aK,aJ,aG,aF,aI;au=aH;if(V==c){C.css({overflow:"hidden",padding:0});ah=C.innerWidth()+g;v=C.innerHeight();C.width(ah);V=b('<div class="jspPane" />').wrap(b('<div class="jspContainer" />').css({width:ah+"px",height:v+"px"}));C.wrapInner(V.parent());aj=C.find(">.jspContainer");V=aj.find(">.jspPane");V.css("padding",aE);}else{C.css("width",null);aI=C.outerWidth()+g!=ah||C.outerHeight()!=v;if(aI){ah=C.innerWidth()+g;v=C.innerHeight();aj.css({width:ah+"px",height:v+"px"});}aA=V.innerWidth();if(!aI&&V.outerWidth()==Q&&V.outerHeight()==W){if(aB||av){V.css("width",aA+"px");C.css("width",(aA+g)+"px");}return ;}V.css("width",null);C.css("width",(ah)+"px");aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end();}aL=V.clone().css("position","absolute");aK=b('<div style="width:1px; position: relative;" />').append(aL);b("body").append(aK);Q=Math.max(V.outerWidth(),aL.outerWidth());aK.remove();W=V.outerHeight();y=Q/ah;q=W/v;av=q>1;aB=y>1;if(!(aB||av)){C.removeClass("jspScrollable");V.css({top:0,width:aj.width()-g});n();D();O();w();af();}else{C.addClass("jspScrollable");aJ=au.maintainPosition&&(H||X);if(aJ){aG=ay();aF=aw();}aC();z();E();if(aJ){K(aG);J(aF);}I();ad();if(au.enableKeyboardNavigation){P();}if(au.clickOnTrack){p();}B();if(au.hijackInternalLinks){m();}}if(au.autoReinitialise&&!aq){aq=setInterval(function(){an(au);},au.autoReinitialiseDelay);}else{if(!au.autoReinitialise&&aq){clearInterval(aq);}}C.trigger("jsp-initialised",[aB||av]);}function aC(){if(av){aj.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));R=aj.find(">.jspVerticalBar");al=R.find(">.jspTrack");ap=al.find(">.jspDrag");if(au.showArrows){am=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",az(0,-1)).bind("click.jsp",ax);ac=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",az(0,1)).bind("click.jsp",ax);if(au.arrowScrollOnHover){am.bind("mouseover.jsp",az(0,-1,am));ac.bind("mouseover.jsp",az(0,1,ac));}ai(al,au.verticalArrowPositions,am,ac);}t=v;aj.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight();});ap.hover(function(){ap.addClass("jspHover");},function(){ap.removeClass("jspHover");}).bind("mousedown.jsp",function(aF){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false;});ap.addClass("jspActive");var s=aF.pageY-ap.position().top;b("html").bind("mousemove.jsp",function(aG){S(aG.pageY-s,false);}).bind("mouseup.jsp mouseleave.jsp",ar);return false;});o();}}function o(){al.height(t+"px");H=0;U=au.verticalGutter+al.outerWidth();V.width(ah-U-g);if(R.position().left==0){V.css("margin-left",U+"px");}}function z(){if(aB){aj.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ak=aj.find(">.jspHorizontalBar");F=ak.find(">.jspTrack");h=F.find(">.jspDrag");if(au.showArrows){at=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",az(-1,0)).bind("click.jsp",ax);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",az(1,0)).bind("click.jsp",ax);if(au.arrowScrollOnHover){at.bind("mouseover.jsp",az(-1,0,at));x.bind("mouseover.jsp",az(1,0,x));}ai(F,au.horizontalArrowPositions,at,x);}h.hover(function(){h.addClass("jspHover");},function(){h.removeClass("jspHover");}).bind("mousedown.jsp",function(aF){b("html").bind("dragstart.jsp selectstart.jsp",function(){return false;});h.addClass("jspActive");var s=aF.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aG){T(aG.pageX-s,false);}).bind("mouseup.jsp mouseleave.jsp",ar);return false;});l=aj.innerWidth();ae();}else{}}function ae(){aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth();});F.width(l+"px");X=0;}function E(){if(aB&&av){var aF=F.outerHeight(),s=al.outerWidth();t-=aF;b(ak).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth();});l-=s;v-=s;ah-=aF;F.parent().append(b('<div class="jspCorner" />').css("width",aF+"px"));o();ae();}if(aB){V.width((aj.outerWidth()-g)+"px");}W=V.outerHeight();q=W/v;if(aB){ao=1/y*l;if(ao>au.horizontalDragMaxWidth){ao=au.horizontalDragMaxWidth;}else{if(ao<au.horizontalDragMinWidth){ao=au.horizontalDragMinWidth;}}h.width(ao+"px");j=l-ao;ab(X);}if(av){A=1/q*t;if(A>au.verticalDragMaxHeight){A=au.verticalDragMaxHeight;}else{if(A<au.verticalDragMinHeight){A=au.verticalDragMinHeight;}}ap.height(A+"px");i=t-A;aa(H);}}function ai(aG,aI,aF,s){var aK="before",aH="after",aJ;if(aI=="os"){aI=/Mac/.test(navigator.platform)?"after":"split";}if(aI==aK){aH=aI;}else{if(aI==aH){aK=aI;aJ=aF;aF=s;s=aJ;}}aG[aK](aF)[aH](s);}function az(aF,s,aG){return function(){G(aF,s,this,aG);this.blur();return false;};}function G(aH,aF,aK,aJ){aK=b(aK).addClass("jspActive");var aI,s=function(){if(aH!=0){T(X+aH*au.arrowButtonSpeed,false);}if(aF!=0){S(H+aF*au.arrowButtonSpeed,false);}},aG=setInterval(s,au.arrowRepeatFreq);s();aI=aJ==c?"mouseup.jsp":"mouseout.jsp";aJ=aJ||b("html");aJ.bind(aI,function(){aK.removeClass("jspActive");clearInterval(aG);aJ.unbind(aI);});}function p(){w();if(av){al.bind("mousedown.jsp",function(aH){if(aH.originalTarget==c||aH.originalTarget==aH.currentTarget){var aG=b(this),s=setInterval(function(){var aI=aG.offset(),aJ=aH.pageY-aI.top;if(H+A<aJ){S(H+au.trackClickSpeed);}else{if(aJ<H){S(H-au.trackClickSpeed);}else{aF();}}},au.trackClickRepeatFreq),aF=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aF);};b(document).bind("mouseup.jsp",aF);return false;}});}if(aB){F.bind("mousedown.jsp",function(aH){if(aH.originalTarget==c||aH.originalTarget==aH.currentTarget){var aG=b(this),s=setInterval(function(){var aI=aG.offset(),aJ=aH.pageX-aI.left;if(X+ao<aJ){T(X+au.trackClickSpeed);}else{if(aJ<X){T(X-au.trackClickSpeed);}else{aF();}}},au.trackClickRepeatFreq),aF=function(){s&&clearInterval(s);s=null;b(document).unbind("mouseup.jsp",aF);};b(document).bind("mouseup.jsp",aF);return false;}});}}function w(){F&&F.unbind("mousedown.jsp");al&&al.unbind("mousedown.jsp");}function ar(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");ap&&ap.removeClass("jspActive");h&&h.removeClass("jspActive");}function S(s,aF){if(!av){return ;}if(s<0){s=0;}else{if(s>i){s=i;}}if(aF==c){aF=au.animateScroll;}if(aF){N.animate(ap,"top",s,aa);}else{ap.css("top",s);aa(s);}}function aa(aF){if(aF==c){aF=ap.position().top;}aj.scrollTop(0);H=aF;var aI=H==0,aG=H==i,aH=aF/i,s=-aH*(W-v);if(ag!=aI||aD!=aG){ag=aI;aD=aG;C.trigger("jsp-arrow-change",[ag,aD,M,k]);}u(aI,aG);V.css("top",s);C.trigger("jsp-scroll-y",[-s,aI,aG]);}function T(aF,s){if(!aB){return ;}if(aF<0){aF=0;}else{if(aF>j){aF=j;}}if(s==c){s=au.animateScroll;}if(s){N.animate(h,"left",aF,ab);}else{h.css("left",aF);ab(aF);}}function ab(aF){if(aF==c){aF=h.position().left;}aj.scrollTop(0);X=aF;var aI=X==0,aH=X==j,aG=aF/j,s=-aG*(Q-ah);if(M!=aI||k!=aH){M=aI;k=aH;C.trigger("jsp-arrow-change",[ag,aD,M,k]);}r(aI,aH);V.css("left",s);C.trigger("jsp-scroll-x",[-s,aI,aH]);}function u(aF,s){if(au.showArrows){am[aF?"addClass":"removeClass"]("jspDisabled");ac[s?"addClass":"removeClass"]("jspDisabled");}}function r(aF,s){if(au.showArrows){at[aF?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled");}}function J(s,aF){var aG=s/(W-v);S(aG*i,aF);}function K(aF,s){var aG=aF/(Q-ah);T(aG*j,s);}function Y(aN,aL,aF){var aJ,aH,s=0,aG,aK,aM;try{aJ=b(aN);}catch(aI){return ;}aH=aJ.outerHeight();aj.scrollTop(0);while(!aJ.is(".jspPane")){s+=aJ.position().top;aJ=aJ.offsetParent();if(/^body|html$/i.test(aJ[0].nodeName)){return ;}}aG=aw();aK=aG+v;if(s<aG||aL){aM=s-au.verticalGutter;}else{if(s+aH>aK){aM=s-v+aH+au.verticalGutter;}}if(aM){J(aM,aF);}}function ay(){return -V.position().left;}function aw(){return -V.position().top;}function ad(){aj.unbind(Z).bind(Z,function(aI,aJ,aH,aF){var aG=X,s=H;T(X+aH*au.mouseWheelSpeed,false);S(H-aF*au.mouseWheelSpeed,false);return aG==X&&s==H;});}function n(){aj.unbind(Z);}function ax(){return false;}function I(){V.unbind("focusin.jsp").bind("focusin.jsp",function(s){if(s.target===V[0]){return ;}Y(s.target,false);});}function D(){V.unbind("focusin.jsp");}function P(){var aF,s;C.attr("tabindex",0).unbind("keydown.jsp").bind("keydown.jsp",function(aJ){if(aJ.target!==C[0]){return ;}var aH=X,aG=H,aI=aF?2:16;switch(aJ.keyCode){case 40:S(H+aI,false);break;case 38:S(H-aI,false);break;case 34:case 32:J(aw()+Math.max(32,v)-16);break;case 33:J(aw()-v+16);break;case 35:J(W-v);break;case 36:J(0);break;case 39:T(X+aI,false);break;case 37:T(X-aI,false);break;}if(!(aH==X&&aG==H)){aF=true;clearTimeout(s);s=setTimeout(function(){aF=false;},260);return false;}});if(au.hideFocus){C.css("outline","none");if("hideFocus" in aj[0]){C.attr("hideFocus",true);}}else{C.css("outline","");if("hideFocus" in aj[0]){C.attr("hideFocus",false);}}}function O(){C.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp");}function B(){if(location.hash&&location.hash.length>1){var aG,aF;try{aG=b(location.hash);}catch(s){return ;}if(aG.length&&V.find(aG)){if(aj.scrollTop()==0){aF=setInterval(function(){if(aj.scrollTop()>0){Y(location.hash,true);b(document).scrollTop(aj.position().top);clearInterval(aF);}},50);}else{Y(location.hash,true);b(document).scrollTop(aj.position().top);}}}}function af(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack");}function m(){af();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aF;if(s.length>1){aF=s[1];if(aF.length>0&&V.find("#"+aF).length>0){Y("#"+aF,true);return false;}}});}b.extend(N,{reinitialise:function(aF){aF=b.extend({},aF,au);an(aF);},scrollToElement:function(aG,aF,s){Y(aG,aF,s);},scrollTo:function(aG,s,aF){K(aG,aF);J(s,aF);},scrollToX:function(aF,s){K(aF,s);},scrollToY:function(s,aF){J(s,aF);},scrollBy:function(aF,s,aG){N.scrollByX(aF,aG);N.scrollByY(s,aG);},scrollByX:function(s,aG){var aF=ay()+s,aH=aF/(Q-ah);T(aH*j,aG);},scrollByY:function(s,aG){var aF=aw()+s,aH=aF/(W-v);S(aH*i,aG);},animate:function(aF,aI,s,aH){var aG={};aG[aI]=s;aF.animate(aG,{duration:au.animateDuration,ease:au.animateEase,queue:false,step:aH});},getContentPositionX:function(){return ay();},getContentPositionY:function(){return aw();},getIsScrollableH:function(){return aB;},getIsScrollableV:function(){return av;},getContentPane:function(){return V;},scrollToBottom:function(s){S(i,s);},hijackInternalLinks:function(){m();}});}f=b.extend({},b.fn.jScrollPane.defaults,f);var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h){h.reinitialise(f);}else{h=new d(g,f);g.data("jsp",h);}e=e?e.add(g):g;});return e;};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:10,arrowButtonSpeed:10,arrowRepeatFreq:100,arrowScrollOnHover:false,trackClickSpeed:30,trackClickRepeatFreq:100,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false};})(jQuery,this);
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */
(function($){var types=["DOMMouseScroll","mousewheel"];$.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=types.length;i;){this.addEventListener(types[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=types.length;i;){this.removeEventListener(types[--i],handler,false);}}else{this.onmousewheel=null;}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(event.wheelDelta){delta=event.wheelDelta/120;}if(event.detail){delta=-event.detail/3;}deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta;}if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY/120;}if(orgEvent.wheelDeltaX!==undefined){deltaX=-1*orgEvent.wheelDeltaX/120;}args.unshift(event,delta,deltaX,deltaY);return $.event.handle.apply(this,args);}})(jQuery);
/*
 * jQuery blockUI plugin
 * Version 2.35 (23-SEP-2010)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
(function($){if(/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery)||/^1.1/.test($.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+$.fn.jquery);return ;}$.fn._fadeIn=$.fn.fadeIn;var noOp=function(){};var mode=document.documentMode||0;var setExpr=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var ie6=$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!mode;$.blockUI=function(opts){install(window,opts);};$.unblockUI=function(opts){remove(window,opts);};$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');if(title){$m.append("<h1>"+title+"</h1>");}if(message){$m.append("<h2>"+message+"</h2>");}if(timeout==undefined){timeout=3000;}$.blockUI({message:$m,fadeIn:700,fadeOut:1000,centerY:false,timeout:timeout,showOverlay:false,onUnblock:onClose,css:$.blockUI.defaults.growlCSS});};$.fn.block=function(opts){return this.unblock({fadeOut:0}).each(function(){if($.css(this,"position")=="static"){this.style.position="relative";}if($.browser.msie){this.style.zoom=1;}install(this,opts);});};$.fn.unblock=function(opts){return this.each(function(){remove(this,opts);});};$.blockUI.version=2.35;$.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var pageBlock=null;var pageBlockEls=[];function install(el,opts){var full=(el==window);var msg=opts&&opts.message!==undefined?opts.message:undefined;opts=$.extend({},$.blockUI.defaults,opts||{});opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{});var css=$.extend({},$.blockUI.defaults.css,opts.css||{});var themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{});msg=msg===undefined?opts.message:msg;if(full&&pageBlock){remove(window,{fadeOut:0});}if(msg&&typeof msg!="string"&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg;var data={};$(el).data("blockUI.history",data);data.el=node;data.parent=node.parentNode;data.display=node.style.display;data.position=node.style.position;if(data.parent){data.parent.removeChild(node);}}var z=opts.baseZ;var lyr1=($.browser.msie||opts.forceIframe)?$('<iframe class="blockUI" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'):$('<div class="blockUI" style="display:none"></div>');var lyr2=$('<div class="blockUI blockOverlay" style="z-index:'+(z++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var lyr3,s;if(opts.theme&&full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';}else{if(opts.theme){s='<div class="blockUI '+opts.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+z+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(opts.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';}else{if(full){s='<div class="blockUI '+opts.blockMsgClass+' blockPage" style="z-index:'+z+';display:none;position:fixed"></div>';}else{s='<div class="blockUI '+opts.blockMsgClass+' blockElement" style="z-index:'+z+';display:none;position:absolute"></div>';}}}lyr3=$(s);if(msg){if(opts.theme){lyr3.css(themedCSS);lyr3.addClass("ui-widget-content");}else{lyr3.css(css);}}if(!opts.applyPlatformOpacityRules||!($.browser.mozilla&&/Linux/.test(navigator.platform))){lyr2.css(opts.overlayCSS);}lyr2.css("position",full?"fixed":"absolute");if($.browser.msie||opts.forceIframe){lyr1.css("opacity",0);}var layers=[lyr1,lyr2,lyr3],$par=full?$("body"):$(el);$.each(layers,function(){this.appendTo($par);});if(opts.theme&&opts.draggable&&$.fn.draggable){lyr3.draggable({handle:".ui-dialog-titlebar",cancel:"li"});}var expr=setExpr&&(!$.boxModel||$("object,embed",full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.boxModel){$("html,body").css("height","100%");}if((ie6||!$.boxModel)&&!full){var t=sz(el,"borderTopWidth"),l=sz(el,"borderLeftWidth");var fixT=t?"(0 - "+t+")":0;var fixL=l?"(0 - "+l+")":0;}$.each([lyr1,lyr2,lyr3],function(i,o){var s=o[0].style;s.position="absolute";if(i<2){full?s.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+opts.quirksmodeOffsetHack+') + "px"'):s.setExpression("height",'this.parentNode.offsetHeight + "px"');full?s.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression("width",'this.parentNode.offsetWidth + "px"');if(fixL){s.setExpression("left",fixL);}if(fixT){s.setExpression("top",fixT);}}else{if(opts.centerY){if(full){s.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');}s.marginTop=0;}else{if(!opts.centerY&&full){var top=(opts.css&&opts.css.top)?parseInt(opts.css.top):0;var expression="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+top+') + "px"';s.setExpression("top",expression);}}}});}if(msg){if(opts.theme){lyr3.find(".ui-widget-content").append(msg);}else{lyr3.append(msg);}if(msg.jquery||msg.nodeType){$(msg).show();}}if(($.browser.msie||opts.forceIframe)&&opts.showOverlay){lyr1.show();}if(opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp;var cb1=(opts.showOverlay&&!msg)?cb:noOp;var cb2=msg?cb:noOp;if(opts.showOverlay){lyr2._fadeIn(opts.fadeIn,cb1);}if(msg){lyr3._fadeIn(opts.fadeIn,cb2);}}else{if(opts.showOverlay){lyr2.show();}if(msg){lyr3.show();}if(opts.onBlock){opts.onBlock();}}bind(1,el,opts);if(full){pageBlock=lyr3[0];pageBlockEls=$(":input:enabled:visible",pageBlock);if(opts.focusInput){setTimeout(focus,20);}}else{center(lyr3[0],opts.centerX,opts.centerY);}if(opts.timeout){var to=setTimeout(function(){full?$.unblockUI(opts):$(el).unblock(opts);},opts.timeout);$(el).data("blockUI.timeout",to);}}function remove(el,opts){var full=(el==window);var $el=$(el);var data=$el.data("blockUI.history");var to=$el.data("blockUI.timeout");if(to){clearTimeout(to);$el.removeData("blockUI.timeout");}opts=$.extend({},$.blockUI.defaults,opts||{});bind(0,el,opts);var els;if(full){els=$("body").children().filter(".blockUI").add("body > .blockUI");}else{els=$(".blockUI",el);}if(full){pageBlock=pageBlockEls=null;}if(opts.fadeOut){els.fadeOut(opts.fadeOut);setTimeout(function(){reset(els,data,opts,el);},opts.fadeOut);}else{reset(els,data,opts,el);}}function reset(els,data,opts,el){els.each(function(i,o){if(this.parentNode){this.parentNode.removeChild(this);}});if(data&&data.el){data.el.style.display=data.display;data.el.style.position=data.position;if(data.parent){data.parent.appendChild(data.el);}$(el).removeData("blockUI.history");}if(typeof opts.onUnblock=="function"){opts.onUnblock(el,opts);}}function bind(b,el,opts){var full=el==window,$el=$(el);if(!b&&(full&&!pageBlock||!full&&!$el.data("blockUI.isBlocked"))){return ;}if(!full){$el.data("blockUI.isBlocked",b);}if(!opts.bindEvents||(b&&!opts.showOverlay)){return ;}var events="mousedown mouseup keydown keypress";b?$(document).bind(events,opts,handler):$(document).unbind(events,handler);}function handler(e){if(e.keyCode&&e.keyCode==9){if(pageBlock&&e.data.constrainTabKey){var els=pageBlockEls;var fwd=!e.shiftKey&&e.target==els[els.length-1];var back=e.shiftKey&&e.target==els[0];if(fwd||back){setTimeout(function(){focus(back);},10);return false;}}}var opts=e.data;if($(e.target).parents("div."+opts.blockMsgClass).length>0){return true;}return $(e.target).parents().children().filter("div.blockUI").length==0;}function focus(back){if(!pageBlockEls){return ;}var e=pageBlockEls[back===true?pageBlockEls.length-1:0];if(e){e.focus();}}function center(el,x,y){var p=el.parentNode,s=el.style;var l=((p.offsetWidth-el.offsetWidth)/2)-sz(p,"borderLeftWidth");var t=((p.offsetHeight-el.offsetHeight)/2)-sz(p,"borderTopWidth");if(x){s.left=l>0?(l+"px"):"0";}if(y){s.top=t>0?(t+"px"):"0";}}function sz(el,p){return parseInt($.css(el,p))||0;}})(jQuery);
/*
 * jQuery Countdown plugin v0.9.5
 * http://www.littlewebthings.com/projects/countdown/
 *
 * Copyright 2010, Vassilis Dourdounis
 * 
 * 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($){$.fn.countDown=function(options){config={};$.extend(config,options);diffSecs=this.setCountDown(config);if(config.onComplete){$.data($(this)[0],"callback",config.onComplete);}if(config.omitWeeks){$.data($(this)[0],"omitWeeks",config.omitWeeks);}$("#"+$(this).attr("id")+" .digit").html('<div class="top"></div><div class="bottom"></div>');$(this).doCountDown($(this).attr("id"),diffSecs,500);return this;};$.fn.stopCountDown=function(){clearTimeout($.data(this[0],"timer"));};$.fn.startCountDown=function(){this.doCountDown($(this).attr("id"),$.data(this[0],"diffSecs"),500);};$.fn.setCountDown=function(options){var targetTime=new Date();if(options.targetDate){targetTime.setDate(options.targetDate.day);targetTime.setMonth(options.targetDate.month-1);targetTime.setFullYear(options.targetDate.year);targetTime.setHours(options.targetDate.hour);targetTime.setMinutes(options.targetDate.min);targetTime.setSeconds(options.targetDate.sec);}else{if(options.targetOffset){targetTime.setDate(options.targetOffset.day+targetTime.getDate());targetTime.setMonth(options.targetOffset.month+targetTime.getMonth());targetTime.setFullYear(options.targetOffset.year+targetTime.getFullYear());targetTime.setHours(options.targetOffset.hour+targetTime.getHours());targetTime.setMinutes(options.targetOffset.min+targetTime.getMinutes());targetTime.setSeconds(options.targetOffset.sec+targetTime.getSeconds());}}var nowTime=new Date();diffSecs=Math.floor((targetTime.valueOf()-nowTime.valueOf())/1000);$.data(this[0],"diffSecs",diffSecs);return diffSecs;};$.fn.doCountDown=function(id,diffSecs,duration){$this=$("#"+id);if(diffSecs<=0){diffSecs=0;if($.data($this[0],"timer")){clearTimeout($.data($this[0],"timer"));}}secs=diffSecs%60;mins=Math.floor(diffSecs/60)%60;hours=Math.floor(diffSecs/60/60)%24;if($.data($this[0],"omitWeeks")==true){days=Math.floor(diffSecs/60/60/24);weeks=Math.floor(diffSecs/60/60/24/7);}else{days=Math.floor(diffSecs/60/60/24)%7;weeks=Math.floor(diffSecs/60/60/24/7);}$this.dashChangeTo(id,"seconds_dash",secs,duration?duration:800);$this.dashChangeTo(id,"minutes_dash",mins,duration?duration:1200);$this.dashChangeTo(id,"hours_dash",hours,duration?duration:1200);$this.dashChangeTo(id,"days_dash",days,duration?duration:1200);$this.dashChangeTo(id,"weeks_dash",weeks,duration?duration:1200);$.data($this[0],"diffSecs",diffSecs);if(diffSecs>0){e=$this;t=setTimeout(function(){e.doCountDown(id,diffSecs-1);},1000);$.data(e[0],"timer",t);}else{if(cb=$.data($this[0],"callback")){$.data($this[0],"callback")();}}};$.fn.dashChangeTo=function(id,dash,n,duration){$this=$("#"+id);d2=n%10;d1=(n-n%10)/10;if($("#"+$this.attr("id")+" ."+dash)){$this.digitChangeTo("#"+$this.attr("id")+" ."+dash+" .digit:first",d1,duration);$this.digitChangeTo("#"+$this.attr("id")+" ."+dash+" .digit:last",d2,duration);}};$.fn.digitChangeTo=function(digit,n,duration){if(!duration){duration=800;}if($(digit+" div.top").html()!=n+""){$(digit+" div.top").css({display:"none"});$(digit+" div.top").html((n?n:"0")).slideDown(duration);$(digit+" div.bottom").animate({height:""},duration,function(){$(digit+" div.bottom").html($(digit+" div.top").html());$(digit+" div.bottom").css({display:"block",height:""});$(digit+" div.top").hide().slideUp(10);});}};})(jQuery);(function($){var undef,window=this,doc=window.document,$doc=$(doc),DEBUG=false,NAV=navigator.userAgent.toLowerCase(),HASH=window.location.hash.replace(/#\//,""),CLICK=function(){return Galleria.TOUCH?"touchstart":"click";},IE=(function(){var v=3,div=doc.createElement("div"),all=div.getElementsByTagName("i");do{div.innerHTML="<!--[if gt IE "+(++v)+"]><i></i><![endif]-->";}while(all[0]);return v>4?v:undef;}()),DOM=function(){return{html:doc.documentElement,body:doc.body,head:doc.getElementsByTagName("head")[0],title:doc.title};},_eventlist="data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image",_events=(function(){var evs=[];$.each(_eventlist.split(" "),function(i,ev){evs.push(ev);if(/_/.test(ev)){evs.push(ev.replace(/_/g,""));}});return evs;}()),_legacyOptions=function(options){var n;if(typeof options!=="object"){return options;}$.each(options,function(key,value){if(/^[a-z]+_/.test(key)){n="";$.each(key.split("_"),function(i,k){n+=i>0?k.substr(0,1).toUpperCase()+k.substr(1):k;});options[n]=value;delete options[key];}});return options;},_patchEvent=function(type){if($.inArray(type,_events)>-1){return Galleria[type.toUpperCase()];}return type;},_timeouts={trunk:{},add:function(id,fn,delay,loop){loop=loop||false;this.clear(id);if(loop){var old=fn;fn=function(){old();_timeouts.add(id,fn,delay);};}this.trunk[id]=window.setTimeout(fn,delay);},clear:function(id){var del=function(i){window.clearTimeout(this.trunk[i]);delete this.trunk[i];},i;if(!!id&&id in this.trunk){del.call(_timeouts,id);}else{if(typeof id==="undefined"){for(i in this.trunk){if(this.trunk.hasOwnProperty(i)){del.call(_timeouts,i);}}}}}},_galleries=[],Utils=(function(){return{array:function(obj){return Array.prototype.slice.call(obj);},create:function(className,nodeName){nodeName=nodeName||"div";var elem=doc.createElement(nodeName);elem.className=className;return elem;},forceStyles:function(elem,styles){elem=$(elem);if(elem.attr("style")){elem.data("styles",elem.attr("style")).removeAttr("style");}elem.css(styles);},revertStyles:function(){$.each(Utils.array(arguments),function(i,elem){elem=$(elem).removeAttr("style");if(elem.data("styles")){elem.attr("style",elem.data("styles")).data("styles",null);}});},moveOut:function(elem){Utils.forceStyles(elem,{position:"absolute",left:-10000});},moveIn:function(){Utils.revertStyles.apply(Utils,Utils.array(arguments));},hide:function(elem,speed,callback){elem=$(elem);if(!elem.data("opacity")){elem.data("opacity",elem.css("opacity"));}var style={opacity:0};if(speed){elem.stop().animate(style,speed,callback);}else{elem.css(style);}},show:function(elem,speed,callback){elem=$(elem);var saved=parseFloat(elem.data("opacity"))||1,style={opacity:saved};if(saved===1){elem.data("opacity",null);}if(speed){elem.stop().animate(style,speed,callback);}else{elem.css(style);}},addTimer:function(){_timeouts.add.apply(_timeouts,Utils.array(arguments));return this;},clearTimer:function(){_timeouts.clear.apply(_timeouts,Utils.array(arguments));return this;},wait:function(options){options=$.extend({until:function(){return false;},success:function(){},error:function(){Galleria.raise("Could not complete wait function.");},timeout:3000},options);var start=Utils.timestamp(),elapsed,now,fn=function(){now=Utils.timestamp();elapsed=now-start;if(options.until(elapsed)){options.success();return false;}if(now>=start+options.timeout){options.error();return false;}window.setTimeout(fn,2);};window.setTimeout(fn,2);},toggleQuality:function(img,force){if((IE!==7&&IE!==8)||!img){return ;}if(typeof force==="undefined"){force=img.style.msInterpolationMode==="nearest-neighbor";}img.style.msInterpolationMode=force?"bicubic":"nearest-neighbor";},insertStyleTag:function(styles){var style=doc.createElement("style");DOM().head.appendChild(style);if(style.styleSheet){style.styleSheet.cssText=styles;}else{var cssText=doc.createTextNode(styles);style.appendChild(cssText);}},loadScript:function(url,callback){var done=false,script=$("<script>").attr({src:url,async:true}).get(0);script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;script.onload=script.onreadystatechange=null;if(typeof callback==="function"){callback.call(this,this);}}};DOM().head.appendChild(script);},parseValue:function(val){if(typeof val==="number"){return val;}else{if(typeof val==="string"){var arr=val.match(/\-?\d/g);return arr&&arr.constructor===Array?parseInt(arr.join(""),10):0;}else{return 0;}}},timestamp:function(){return new Date().getTime();},loadCSS:function(href,id,callback){var link,ready=false,length;$("link[rel=stylesheet]").each(function(){if(new RegExp(href).test(this.href)){link=this;return false;}});if(typeof id==="function"){callback=id;id=undef;}callback=callback||function(){};if(link){callback.call(link,link);return link;}length=doc.styleSheets.length;if(DEBUG){href+="?"+Utils.timestamp();}if($("#"+id).length){$("#"+id).attr("href",href);length--;ready=true;}else{link=$("<link>").attr({rel:"stylesheet",href:href,id:id}).get(0);window.setTimeout(function(){var styles=$('link[rel="stylesheet"], style');if(styles.length){styles.get(0).parentNode.insertBefore(link,styles[0]);}else{DOM().head.appendChild(link);}if(IE){link.attachEvent("onreadystatechange",function(e){if(link.readyState==="complete"){ready=true;}});}else{ready=true;}},10);}if(typeof callback==="function"){Utils.wait({until:function(){return ready&&doc.styleSheets.length>length;},success:function(){Utils.addTimer("css",function(){callback.call(link,link);},100);},error:function(){Galleria.raise("Theme CSS could not load");},timeout:1000});}return link;}};}()),_transitions={fade:function(params,complete){$(params.next).css("opacity",0).show().animate({opacity:1},params.speed,complete);if(params.prev){$(params.prev).css("opacity",1).show().animate({opacity:0},params.speed);}},flash:function(params,complete){$(params.next).css("opacity",0);if(params.prev){$(params.prev).animate({opacity:0},(params.speed/2),function(){$(params.next).animate({opacity:1},params.speed,complete);});}else{$(params.next).animate({opacity:1},params.speed,complete);}},pulse:function(params,complete){if(params.prev){$(params.prev).hide();}$(params.next).css("opacity",0).animate({opacity:1},params.speed,complete);},slide:function(params,complete){var image=$(params.next).parent(),images=this.$("images"),width=this._stageWidth,easing=this.getOptions("easing");image.css({left:width*(params.rewind?-1:1)});images.animate({left:width*(params.rewind?1:-1)},{duration:params.speed,queue:false,easing:easing,complete:function(){images.css("left",0);image.css("left",0);complete();}});},fadeslide:function(params,complete){var x=0,easing=this.getOptions("easing"),distance=this.getStageWidth();if(params.prev){x=Utils.parseValue($(params.prev).css("left"));$(params.prev).css({opacity:1,left:x}).animate({opacity:0,left:x+(distance*(params.rewind?1:-1))},{duration:params.speed,queue:false,easing:easing});}x=Utils.parseValue($(params.next).css("left"));$(params.next).css({left:x+(distance*(params.rewind?-1:1)),opacity:0}).animate({opacity:1,left:x},{duration:params.speed,complete:complete,queue:false,easing:easing});}};var Galleria=function(){var self=this;this._theme=undef;this._options={};this._playing=false;this._playtime=5000;this._active=null;this._queue={length:0};this._data=[];this._dom={};this._thumbnails=[];this._initialized=false;this._stageWidth=0;this._stageHeight=0;this._target=undef;this._id=Math.random();var divs="container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description info-author action-strip share-image related-links view-display counter thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader tooltip",spans="current total";$.each(divs.split(" "),function(i,elemId){self._dom[elemId]=Utils.create("galleria-"+elemId);});$.each(spans.split(" "),function(i,elemId){self._dom[elemId]=Utils.create("galleria-"+elemId,"span");});var keyboard=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:false,press:function(e){var key=e.keyCode||e.which;if(key in keyboard.map&&typeof keyboard.map[key]==="function"){keyboard.map[key].call(self,e);}},attach:function(map){var key,up;for(key in map){if(map.hasOwnProperty(key)){up=key.toUpperCase();if(up in keyboard.keys){keyboard.map[keyboard.keys[up]]=map[key];}}}if(!keyboard.bound){keyboard.bound=true;$doc.bind("keydown",keyboard.press);}},detach:function(){keyboard.bound=false;$doc.unbind("keydown",keyboard.press);}};var controls=this._controls={0:undef,1:undef,active:0,swap:function(){controls.active=controls.active?0:1;},getActive:function(){return controls[controls.active];},getNext:function(){return controls[1-controls.active];}};var carousel=this._carousel={next:self.$("thumb-nav-right"),prev:self.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var w=0,h=0,hooks=[0];$.each(self._thumbnails,function(i,thumb){if(thumb.ready){w+=thumb.outerWidth||$(thumb.container).outerWidth(true);hooks[i+1]=w;h=Math.max(h,thumb.outerHeight||$(thumb.container).outerHeight(true));}});self.$("thumbnails").css({width:w,height:h});carousel.max=w;carousel.hooks=hooks;carousel.width=self.$("thumbnails-list").width();carousel.setClasses();self.$("thumbnails-container").toggleClass("galleria-carousel",w>carousel.width);carousel.set(carousel.current);},bindControls:function(){var i;carousel.next.bind(CLICK(),function(e){e.preventDefault();if(self._options.carouselSteps==="auto"){for(i=carousel.current;i<carousel.hooks.length;i++){if(carousel.hooks[i]-carousel.hooks[carousel.current]>carousel.width){carousel.set(i-2);break;}}}else{carousel.set(carousel.current+self._options.carouselSteps);}});carousel.prev.bind(CLICK(),function(e){e.preventDefault();if(self._options.carouselSteps==="auto"){for(i=carousel.current;i>=0;i--){if(carousel.hooks[carousel.current]-carousel.hooks[i]>carousel.width){carousel.set(i+2);break;}else{if(i===0){carousel.set(0);break;}}}}else{carousel.set(carousel.current-self._options.carouselSteps);}});},set:function(i){i=Math.max(i,0);while(carousel.hooks[i-1]+carousel.width>=carousel.max&&i>=0){i--;}carousel.current=i;carousel.animate();},getLast:function(i){return(i||carousel.current)-1;},follow:function(i){if(i===0||i===carousel.hooks.length-2){carousel.set(i);return ;}var last=carousel.current;while(carousel.hooks[last]-carousel.hooks[carousel.current]<carousel.width&&last<=carousel.hooks.length){last++;}if(i-1<carousel.current){carousel.set(i-1);}else{if(i+2>last){carousel.set(i-last+carousel.current+2);}}},setClasses:function(){carousel.prev.toggleClass("disabled",!carousel.current);carousel.next.toggleClass("disabled",carousel.hooks[carousel.current]+carousel.width>=carousel.max);},animate:function(to){carousel.setClasses();var num=carousel.hooks[carousel.current]*-1;if(isNaN(num)){return ;}self.$("thumbnails").animate({left:num},{duration:self._options.carouselSpeed,easing:self._options.easing,queue:false});}};var tooltip=this._tooltip={initialized:false,open:false,init:function(){tooltip.initialized=true;var css=".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}";Utils.insertStyleTag(css);self.$("tooltip").css("opacity",0.8);Utils.hide(self.get("tooltip"));},move:function(e){var mouseX=self.getMousePosition(e).x,mouseY=self.getMousePosition(e).y,$elem=self.$("tooltip"),x=mouseX,y=mouseY,height=$elem.outerHeight(true)+1,width=$elem.outerWidth(true),limitY=height+15;var maxX=self.$("container").width()-width-2,maxY=self.$("container").height()-height-2;if(!isNaN(x)&&!isNaN(y)){x+=10;y-=30;x=Math.max(0,Math.min(maxX,x));y=Math.max(0,Math.min(maxY,y));if(mouseY<limitY){y=limitY;}$elem.css({left:x,top:y});}},bind:function(elem,value){if(!tooltip.initialized){tooltip.init();}var hover=function(elem,value){tooltip.define(elem,value);$(elem).hover(function(){Utils.clearTimer("switch_tooltip");self.$("container").unbind("mousemove",tooltip.move).bind("mousemove",tooltip.move).trigger("mousemove");tooltip.show(elem);Galleria.utils.addTimer("tooltip",function(){self.$("tooltip").stop().show();Utils.show(self.get("tooltip"),400);tooltip.open=true;},tooltip.open?0:500);},function(){self.$("container").unbind("mousemove",tooltip.move);Utils.clearTimer("tooltip");self.$("tooltip").stop();Utils.hide(self.get("tooltip"),200,function(){self.$("tooltip").hide();Utils.addTimer("switch_tooltip",function(){tooltip.open=false;},1000);});});};if(typeof value==="string"){hover((elem in self._dom?self.get(elem):elem),value);}else{$.each(elem,function(elemID,val){hover(self.get(elemID),val);});}},show:function(elem){elem=$(elem in self._dom?self.get(elem):elem);var text=elem.data("tt"),mouseup=function(e){window.setTimeout((function(ev){return function(){tooltip.move(ev);};}(e)),10);elem.unbind("mouseup",mouseup);};text=typeof text==="function"?text():text;if(!text){return ;}self.$("tooltip").html(text.replace(/\s/,"&nbsp;"));elem.bind("mouseup",mouseup);},define:function(elem,value){if(typeof value!=="function"){var s=value;value=function(){return s;};}elem=$(elem in self._dom?self.get(elem):elem).data("tt",value);tooltip.show(elem);}};var fullscreen=this._fullscreen={scrolled:0,active:false,enter:function(callback){fullscreen.active=true;Utils.hide(self.getActiveImage());self.$("container").addClass("fullscreen");fullscreen.scrolled=$(window).scrollTop();Utils.forceStyles(self.get("container"),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:10000});var htmlbody={height:"100%",overflow:"hidden",margin:0,padding:0};Utils.forceStyles(DOM().html,htmlbody);Utils.forceStyles(DOM().body,htmlbody);self.attachKeyboard({escape:self.exitFullscreen,right:self.next,left:self.prev});self.rescale(function(){Utils.addTimer("fullscreen_enter",function(){Utils.show(self.getActiveImage());if(typeof callback==="function"){callback.call(self);}},100);self.trigger(Galleria.FULLSCREEN_ENTER);});$(window).resize(function(){fullscreen.scale();});},scale:function(){self.rescale();},exit:function(callback){fullscreen.active=false;Utils.hide(self.getActiveImage());self.$("container").removeClass("fullscreen");Utils.revertStyles(self.get("container"),DOM().html,DOM().body);window.scrollTo(0,fullscreen.scrolled);self.detachKeyboard();self.rescale(function(){Utils.addTimer("fullscreen_exit",function(){Utils.show(self.getActiveImage());if(typeof callback==="function"){callback.call(self);}},50);self.trigger(Galleria.FULLSCREEN_EXIT);});$(window).unbind("resize",fullscreen.scale);}};var idle=this._idle={trunk:[],bound:false,add:function(elem,to){if(!elem){return ;}if(!idle.bound){idle.addEvent();}elem=$(elem);var from={},style;for(style in to){if(to.hasOwnProperty(style)){from[style]=elem.css(style);}}elem.data("idle",{from:from,to:to,complete:true,busy:false});idle.addTimer();idle.trunk.push(elem);},remove:function(elem){elem=jQuery(elem);$.each(idle.trunk,function(i,el){if(el.length&&!el.not(elem).length){self._idle.show(elem);self._idle.trunk.splice(i,1);}});if(!idle.trunk.length){idle.removeEvent();Utils.clearTimer("idle");}},addEvent:function(){idle.bound=true;self.$("container").bind("mousemove click",idle.showAll);},removeEvent:function(){idle.bound=false;self.$("container").unbind("mousemove click",idle.showAll);},addTimer:function(){Utils.addTimer("idle",function(){self._idle.hide();},self._options.idleTime);},hide:function(){self.trigger(Galleria.IDLE_ENTER);$.each(idle.trunk,function(i,elem){var data=elem.data("idle");if(!data){return ;}elem.data("idle").complete=false;elem.stop().animate(data.to,{duration:self._options.idleSpeed,queue:false,easing:"swing"});});},showAll:function(){Utils.clearTimer("idle");$.each(self._idle.trunk,function(i,elem){self._idle.show(elem);});},show:function(elem){var data=elem.data("idle");if(!data.busy&&!data.complete){data.busy=true;self.trigger(Galleria.IDLE_EXIT);Utils.clearTimer("idle");elem.stop().animate(data.from,{duration:self._options.idleSpeed/2,queue:false,easing:"swing",complete:function(){$(this).data("idle").busy=false;$(this).data("idle").complete=true;}});}idle.addTimer();}};var lightbox=this._lightbox={width:0,height:0,initialized:false,active:null,image:null,elems:{},init:function(){self.trigger(Galleria.LIGHTBOX_OPEN);if(lightbox.initialized){return ;}lightbox.initialized=true;var elems="overlay box content shadow title info close prevholder prev nextholder next counter image",el={},op=self._options,css="",abs="position:absolute;",prefix="lightbox-",cssMap={overlay:"position:fixed;display:none;opacity:"+op.overlayOpacity+";filter:alpha(opacity="+(op.overlayOpacity*100)+");top:0;left:0;width:100%;height:100%;background:"+op.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:abs+"background:#000;width:100%;height:100%;",content:abs+"background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:abs+"bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:abs+"top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:abs+"top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:abs+"width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:abs+"width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:abs+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;line-height:40px;text-align:center;color:#000",next:abs+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;line-height:40px;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},hover=function(elem){return elem.hover(function(){$(this).css("color","#bbb");},function(){$(this).css("color","#444");});},appends={};if(IE===8){cssMap.nextholder+="background:#000;filter:alpha(opacity=0);";cssMap.prevholder+="background:#000;filter:alpha(opacity=0);";}$.each(cssMap,function(key,value){css+=".galleria-"+prefix+key+"{"+value+"}";});Utils.insertStyleTag(css);$.each(elems.split(" "),function(i,elemId){self.addElement("lightbox-"+elemId);el[elemId]=lightbox.elems[elemId]=self.get("lightbox-"+elemId);});lightbox.image=new Galleria.Picture();$.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(key,val){var arr=[];$.each(val.split(" "),function(i,prop){arr.push(prefix+prop);});appends[prefix+key]=arr;});self.append(appends);$(el.image).append(lightbox.image.container);$(DOM().body).append(el.overlay,el.box);hover($(el.close).bind(CLICK(),lightbox.hide).html("&#215;"));$.each(["Prev","Next"],function(i,dir){var $d=$(el[dir.toLowerCase()]).html(/v/.test(dir)?"&#8249;&nbsp;":"&nbsp;&#8250;"),$e=$(el[dir.toLowerCase()+"holder"]);$e.bind(CLICK(),function(){lightbox["show"+dir]();});if(IE<8){$d.show();return ;}$e.hover(function(){$d.show();},function(e){$d.stop().fadeOut(200);});});$(el.overlay).bind(CLICK(),lightbox.hide);},rescale:function(event){var width=Math.min($(window).width()-40,lightbox.width),height=Math.min($(window).height()-60,lightbox.height),ratio=Math.min(width/lightbox.width,height/lightbox.height),destWidth=(lightbox.width*ratio)+40,destHeight=(lightbox.height*ratio)+60,to={width:destWidth,height:destHeight,marginTop:Math.ceil(destHeight/2)*-1,marginLeft:Math.ceil(destWidth/2)*-1};if(event){$(lightbox.elems.box).css(to);}else{$(lightbox.elems.box).animate(to,self._options.lightboxTransitionSpeed,self._options.easing,function(){var image=lightbox.image,speed=self._options.lightboxFadeSpeed;self.trigger({type:Galleria.LIGHTBOX_IMAGE,imageTarget:image.image});image.show();Utils.show(image.image,speed);Utils.show(lightbox.elems.info,speed);});}},hide:function(){lightbox.image.image=null;$(window).unbind("resize",lightbox.rescale);$(lightbox.elems.box).hide();Utils.hide(lightbox.elems.info);Utils.hide(lightbox.elems.overlay,200,function(){$(this).hide().css("opacity",self._options.overlayOpacity);self.trigger(Galleria.LIGHTBOX_CLOSE);});},showNext:function(){lightbox.show(self.getNext(lightbox.active));},showPrev:function(){lightbox.show(self.getPrev(lightbox.active));},show:function(index){lightbox.active=index=typeof index==="number"?index:self.getIndex();if(!lightbox.initialized){lightbox.init();}$(window).unbind("resize",lightbox.rescale);var data=self.getData(index),total=self.getDataLength();Utils.hide(lightbox.elems.info);lightbox.image.load(data.image,function(image){lightbox.width=image.original.width;lightbox.height=image.original.height;$(image.image).css({width:"100.5%",height:"100.5%",top:0,zIndex:99998,opacity:0});lightbox.elems.title.innerHTML=data.title;lightbox.elems.counter.innerHTML=(index+1)+" of "+total;$(window).resize(lightbox.rescale);lightbox.rescale();});$(lightbox.elems.overlay).show();$(lightbox.elems.box).show();}};return this;};Galleria.prototype={constructor:Galleria,init:function(target,options){var self=this;options=_legacyOptions(options);_galleries.push(this);this._original={target:target,options:options,data:null};this._target=this._dom.target=target.nodeName?target:$(target).get(0);if(!this._target){Galleria.raise("Target not found.");return ;}this._options={autoplay:false,carousel:true,carouselFollow:true,carouselSpeed:400,carouselSteps:"auto",clicknext:false,dataConfig:function(elem){return{};},dataSelector:"img",dataSource:this._target,debug:undef,easing:"galleria",extend:function(options){},height:"auto",idleTime:3000,idleSpeed:200,imageCrop:false,imageMargin:0,imagePan:false,imagePanSmoothness:12,imagePosition:"50%",keepSource:false,lightboxFadeSpeed:200,lightboxTransition_speed:500,linkSourceTmages:true,maxScaleRatio:undef,minScaleRatio:undef,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:true,popupLinks:false,preload:2,queue:true,show:0,showInfo:true,showCounter:true,showImagenav:true,thumbCrop:true,thumbEventType:CLICK(),thumbFit:true,thumbMargin:0,thumbQuality:"auto",thumbnails:true,transition:"fade",transitionInitial:undef,transitionSpeed:400,width:"auto"};if(options&&options.debug===true){DEBUG=true;}$(this._target).children().hide();if(typeof Galleria.theme==="object"){this._init();}else{Utils.wait({until:function(){return typeof Galleria.theme==="object";},success:function(){self._init.call(self);},error:function(){Galleria.raise("No theme found.",true);},timeout:5000});}},_init:function(){var self=this;if(this._initialized){Galleria.raise("Init failed: Gallery instance already initialized.");return this;}this._initialized=true;if(!Galleria.theme){Galleria.raise("Init failed: No theme found.");return this;}$.extend(true,this._options,Galleria.theme.defaults,this._original.options);this.bind(Galleria.DATA,function(){this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var $container=this.$("container");var num={width:0,height:0};var testElem=Utils.create("galleria-image");Utils.wait({until:function(){$.each(["width","height"],function(i,m){if(self._options[m]&&typeof self._options[m]==="number"){num[m]=self._options[m];}else{num[m]=Math.max(Utils.parseValue($container.css(m)),Utils.parseValue(self.$("target").css(m)),$container[m](),self.$("target")[m]());}});var thumbHeight=function(){return true;};if(self._options.thumbnails){self.$("thumbnails").append(testElem);thumbHeight=function(){return !!$(testElem).height();};}return thumbHeight()&&num.width&&num.height>10;},success:function(){$(testElem).remove();$container.width(num.width);$container.height(num.height);if(Galleria.WEBKIT){window.setTimeout(function(){self._run();},1);}else{self._run();}},error:function(){Galleria.raise("Width & Height not found.",true);},timeout:2000});});var one=false;this.bind(Galleria.READY,(function(one){return function(){Utils.show(this.get("counter"));if(this._options.carousel){this._carousel.bindControls();}if(this._options.autoplay){this.pause();if(typeof this._options.autoplay==="number"){this._playtime=this._options.autoplay;}this.trigger(Galleria.PLAY);this._playing=true;}if(one){if(typeof this._options.show==="number"){this.show(this._options.show);}return ;}one=true;if(this._options.clicknext){$.each(this._data,function(i,data){delete data.link;});this.$("stage").css({cursor:"pointer"}).bind(CLICK(),function(e){self.next();});}if(Galleria.History){Galleria.History.change(function(e){var val=parseInt(e.value.replace(/\//,""),10);if(isNaN(val)){window.history.go(-1);}else{self.show(val,undef,true);}});}Galleria.theme.init.call(this,this._options);this._options.extend.call(this,this._options);if(/^[0-9]{1,4}$/.test(HASH)&&Galleria.History){this.show(HASH,undef,true);}else{this.show(this._options.show);}};}(one)));this.append({"info-text":["info-title","info-description"],info:["info-text"],"action-strip":["share-image","related-links","counter","view-display"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","info-author","loader","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","info","action-strip","thumbnails-container","tooltip"]});Utils.hide(this.$("counter").append(this.get("current")," of ",this.get("total")));Utils.hide(this.$("view-display").append("&#8211; views"));this.$("view-display").attr("id","viewDisplay");this.setCounter("&#8211;");Utils.hide(self.get("tooltip"));$.each(new Array(2),function(i){var image=new Galleria.Picture();$(image.container).css({position:"absolute",top:0,left:0});self.$("images").append(image.container);self._controls[i]=image;});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"});this.$("image-nav-right, image-nav-left").bind(CLICK(),function(e){if(self._options.clicknext){e.stopPropagation();}if(self._options.pause_on_interaction){self.pause();}var fn=/right/.test(this.className)?"next":"prev";self[fn]();});$.each(["info","counter","image-nav"],function(i,el){if(self._options["show"+el.substr(0,1).toUpperCase()+el.substr(1).replace(/-/,"")]===false){Utils.moveOut(self.get(el.toLowerCase()));}});this.load();if(!this._options.keep_source&&!IE){this._target.innerHTML="";}this.$("target").append(this.get("container"));if(this._options.carousel){this.bind(Galleria.THUMBNAIL,function(){this.updateCarousel();});}return this;},_createThumbnails:function(){var i,src,thumb,data,$container,self=this,o=this._options,active=(function(){var a=self.$("thumbnails").find(".active");if(!a.length){return false;}return a.find("img").attr("src");}()),optval=typeof o.thumbnails==="string"?o.thumbnails.toLowerCase():null,getStyle=function(prop){return doc.defaultView&&doc.defaultView.getComputedStyle?doc.defaultView.getComputedStyle(thumb.container,null)[prop]:$container.css(prop);},fake=function(image,index,container){return function(){$(container).append(image);self.trigger({type:Galleria.THUMBNAIL,thumbTarget:image,index:index});};},onThumbEvent=function(e){if(o.pauseOnInteraction){self.pause();}var index=$(e.currentTarget).data("index");if(self.getIndex()!==index){self.show(index);}e.preventDefault();},onThumbLoad=function(thumb){thumb.scale({width:thumb.data.width,height:thumb.data.height,crop:o.thumbCrop,margin:o.thumbMargin,complete:function(thumb){var top=["left","top"],arr=["Width","Height"],m,css;$.each(arr,function(i,measure){m=measure.toLowerCase();if((o.thumbCrop!==true||o.thumbCrop===m)&&o.thumbFit){css={};css[m]=thumb[m];$(thumb.container).css(css);css={};css[top[i]]=0;$(thumb.image).css(css);}thumb["outer"+measure]=$(thumb.container)["outer"+measure](true);});Utils.toggleQuality(thumb.image,o.thumbQuality===true||(o.thumbQuality==="auto"&&thumb.original.width<thumb.width*3));self.trigger({type:Galleria.THUMBNAIL,thumbTarget:thumb.image,index:thumb.data.order});}});};this._thumbnails=[];this.$("thumbnails").empty();for(i=0;this._data[i];i++){data=this._data[i];if(o.thumbnails===true){thumb=new Galleria.Picture(i);src=data.thumb||data.image;this.$("thumbnails").append(thumb.container);$container=$(thumb.container);thumb.data={width:Utils.parseValue(getStyle("width")),height:Utils.parseValue(getStyle("height")),order:i};if(o.thumbFit&&o.thumbCrop!==true){$container.css({width:0,height:0});}else{$container.css({width:thumb.data.width,height:thumb.data.height});}thumb.load(src,onThumbLoad);if(o.preload==="all"){thumb.add(data.image);}}else{if(optval==="empty"||optval==="numbers"){thumb={container:Utils.create("galleria-image"),image:Utils.create("img","span"),ready:true};if(optval==="numbers"){$(thumb.image).text(i+1);}this.$("thumbnails").append(thumb.container);window.setTimeout((fake)(thumb.image,i,thumb.container),50+(i*20));}else{thumb={container:null,image:null};}}$(thumb.container).add(o.keepSource&&o.linkSourceImages?data.original:null).data("index",i).bind(o.thumbEventType,onThumbEvent);if(active===src){$(thumb.container).addClass("active");}this._thumbnails.push(thumb);}},_run:function(){var self=this;self._createThumbnails();Utils.wait({until:function(){if(Galleria.OPERA){self.$("stage").css("display","inline-block");}self._stageWidth=self.$("stage").width();self._stageHeight=self.$("stage").height();return(self._stageWidth&&self._stageHeight>50);},success:function(){self.trigger(Galleria.READY);},error:function(){Galleria.raise("Stage measures not found",true);}});},load:function(source,selector,config){var self=this;this._data=[];this._thumbnails=[];this.$("thumbnails").empty();if(typeof selector==="function"){config=selector;selector=null;}source=source||this._options.dataSource;selector=selector||this._options.dataSelector;config=config||this._options.dataConfig;if(source.constructor===Array){if(this.validate(source)){this._data=source;this._parseData().trigger(Galleria.DATA);}else{Galleria.raise("Load failed: JSON Array not valid.");}return this;}$(source).find(selector).each(function(i,img){img=$(img);var data={},parent=img.parent(),href=parent.attr("href");if(/\.(png|gif|jpg|jpeg)(\?.*)?$/i.test(href)){data.image=href;}else{if(href){data.link=href;}}self._data.push($.extend({title:img.attr("title"),thumb:img.attr("src"),image:img.attr("src"),description:img.attr("alt"),link:img.attr("longdesc"),author:img.attr("author"),id:img.attr("id"),original:img.get(0)},data,config(img)));});if(this.getDataLength()){this.trigger(Galleria.DATA);}else{Galleria.raise("Load failed: no data found.");}return this;},_parseData:function(){var self=this;$.each(this._data,function(i,data){if("thumb" in data===false){self._data[i].thumb=data.image;}});return this;},splice:function(){Array.prototype.splice.apply(this._data,Utils.array(arguments));return this._parseData()._createThumbnails();},push:function(){Array.prototype.push.apply(this._data,Utils.array(arguments));return this._parseData()._createThumbnails();},_getActive:function(){return this._controls.getActive();},validate:function(data){return true;},bind:function(type,fn){type=_patchEvent(type);this.$("container").bind(type,this.proxy(fn));return this;},unbind:function(type){type=_patchEvent(type);this.$("container").unbind(type);return this;},trigger:function(type){type=typeof type==="object"?$.extend(type,{scope:this}):{type:_patchEvent(type),scope:this};this.$("container").trigger(type);return this;},addIdleState:function(elem,styles){this._idle.add.apply(this._idle,Utils.array(arguments));return this;},removeIdleState:function(elem){this._idle.remove.apply(this._idle,Utils.array(arguments));return this;},enterIdleMode:function(){this._idle.hide();return this;},exitIdleMode:function(){this._idle.showAll();return this;},enterFullscreen:function(callback){this._fullscreen.enter.apply(this,Utils.array(arguments));return this;},exitFullscreen:function(callback){this._fullscreen.exit.apply(this,Utils.array(arguments));return this;},toggleFullscreen:function(callback){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,Utils.array(arguments));return this;},bindTooltip:function(elem,value){this._tooltip.bind.apply(this._tooltip,Utils.array(arguments));return this;},defineTooltip:function(elem,value){this._tooltip.define.apply(this._tooltip,Utils.array(arguments));return this;},refreshTooltip:function(elem){this._tooltip.show.apply(this._tooltip,Utils.array(arguments));return this;},openLightbox:function(){this._lightbox.show.apply(this._lightbox,Utils.array(arguments));return this;},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,Utils.array(arguments));return this;},getActiveImage:function(){return this._getActive().image||undef;},getActiveThumb:function(){return this._thumbnails[this._active].image||undef;},getMousePosition:function(e){return{x:e.pageX-this.$("container").offset().left,y:e.pageY-this.$("container").offset().top};},addPan:function(img){if(this._options.imageCrop===false){return ;}img=$(img||this.getActiveImage());var self=this,x=img.width()/2,y=img.height()/2,destX=parseInt(img.css("left"),10),destY=parseInt(img.css("top"),10),curX=destX||0,curY=destY||0,distX=0,distY=0,active=false,ts=Utils.timestamp(),cache=0,move=0,position=function(dist,cur,pos){if(dist>0){move=Math.round(Math.max(dist*-1,Math.min(0,cur)));if(cache!==move){cache=move;if(IE===8){img.parent()["scroll"+pos](move*-1);}else{var css={};css[pos.toLowerCase()]=move;img.css(css);}}}},calculate=function(e){if(Utils.timestamp()-ts<50){return ;}active=true;x=self.getMousePosition(e).x;y=self.getMousePosition(e).y;},loop=function(e){if(!active){return ;}distX=img.width()-self._stageWidth;distY=img.height()-self._stageHeight;destX=x/self._stageWidth*distX*-1;destY=y/self._stageHeight*distY*-1;curX+=(destX-curX)/self._options.imagePanSmoothness;curY+=(destY-curY)/self._options.imagePanSmoothness;position(distY,curY,"Top");position(distX,curX,"Left");};if(IE===8){img.parent().scrollTop(curY*-1).scrollLeft(curX*-1);img.css({top:0,left:0});}this.$("stage").unbind("mousemove",calculate).bind("mousemove",calculate);Utils.addTimer("pan",loop,50,true);return this;},proxy:function(fn,scope){if(typeof fn!=="function"){return function(){};}scope=scope||this;return function(){return fn.apply(scope,Utils.array(arguments));};},removePan:function(){this.$("stage").unbind("mousemove");Utils.clearTimer("pan");return this;},addElement:function(id){var dom=this._dom;$.each(Utils.array(arguments),function(i,blueprint){dom[blueprint]=Utils.create("galleria-"+blueprint);});return this;},attachKeyboard:function(map){this._keyboard.attach.apply(this._keyboard,Utils.array(arguments));return this;},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,Utils.array(arguments));return this;},appendChild:function(parentID,childID){this.$(parentID).append(this.get(childID)||childID);return this;},prependChild:function(parentID,childID){this.$(parentID).prepend(this.get(childID)||childID);return this;},remove:function(elemID){this.$(Utils.array(arguments).join(",")).remove();return this;},append:function(data){var i,j;for(i in data){if(data.hasOwnProperty(i)){if(data[i].constructor===Array){for(j=0;data[i][j];j++){this.appendChild(i,data[i][j]);}}else{this.appendChild(i,data[i]);}}}return this;},_scaleImage:function(image,options){options=$.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition},options);(image||this._controls.getActive()).scale(options);return this;},updateCarousel:function(){this._carousel.update();return this;},rescale:function(width,height,complete){var self=this;if(typeof width==="function"){complete=width;width=undef;}var scale=function(){self._stageWidth=width||self.$("stage").width();self._stageHeight=height||self.$("stage").height();self._scaleImage();if(self._options.carousel){self.updateCarousel();}self.trigger(Galleria.RESCALE);if(typeof complete==="function"){complete.call(self);}};if(Galleria.WEBKIT&&!width&&!height){Utils.addTimer("scale",scale,5);}else{scale.call(self);}return this;},refreshImage:function(){this._scaleImage();if(this._options.imagePan){this.addPan();}return this;},show:function(index,rewind,_history){if(index===false||(!this._options.queue&&this._queue.stalled)){return ;}index=Math.max(0,Math.min(parseInt(index,10),this.getDataLength()-1));rewind=typeof rewind!=="undefined"?!!rewind:index<this.getIndex();_history=_history||false;if(!_history&&Galleria.History){Galleria.History.value(index.toString());return ;}this._active=index;Array.prototype.push.call(this._queue,{index:index,rewind:rewind});if(!this._queue.stalled){this._show();}return this;},_show:function(){var self=this,queue=this._queue[0],data=this.getData(queue.index);if(!data){return ;}var src=data.image,active=this._controls.getActive(),next=this._controls.getNext(),cached=next.isCached(src),thumb=this._thumbnails[queue.index];var complete=function(){var win;self._queue.stalled=false;Utils.toggleQuality(next.image,self._options.imageQuality);$(active.container).css({zIndex:0,opacity:0});$(next.container).css({zIndex:1,opacity:1});self._controls.swap();if(self._options.imagePan){self.addPan(next.image);}if(data.link){$(next.image).bind(CLICK(),function(){if(self._options.popupLinks){win=window.open(data.link,"_blank");}else{window.location.href=data.link;}});}Array.prototype.shift.call(self._queue);if(self._queue.length){self._show();}self._playCheck();self.trigger({type:Galleria.IMAGE,index:queue.index,imageTarget:next.image,thumbTarget:thumb.image});};if(this._options.carousel&&this._options.carouselFollow){this._carousel.follow(queue.index);}if(this._options.preload){var p,i,n=this.getNext();try{for(i=this._options.preload;i>0;i--){p=new Galleria.Picture();p.add(self.getData(n).image);n=self.getNext(n);}}catch(e){}}Utils.show(next.container);$(self._thumbnails[queue.index].container).addClass("active").siblings(".active").removeClass("active");self.trigger({type:Galleria.LOADSTART,cached:cached,index:queue.index,imageTarget:next.image,thumbTarget:thumb.image});next.load(src,function(next){self._scaleImage(next,{complete:function(next){Utils.show(next.container);if("image" in active){Utils.toggleQuality(active.image,false);}Utils.toggleQuality(next.image,false);self._queue.stalled=true;self.removePan();self.setInfo(queue.index);self.setCounter(queue.index);self.trigger({type:Galleria.LOADFINISH,cached:cached,index:queue.index,imageTarget:next.image,thumbTarget:self._thumbnails[queue.index].image});var transition=active.image===null&&self._options.transitionInitial?self._options.transition_Initial:self._options.transition;if(transition in _transitions===false){complete();}else{var params={prev:active.image,next:next.image,rewind:queue.rewind,speed:self._options.transitionSpeed||400};_transitions[transition].call(self,params,complete);}}});});},getNext:function(base){base=typeof base==="number"?base:this.getIndex();return base===this.getDataLength()-1?0:base+1;},getPrev:function(base){base=typeof base==="number"?base:this.getIndex();return base===0?this.getDataLength()-1:base-1;},next:function(){if(this.getDataLength()>1){this.show(this.getNext(),false);}return this;},prev:function(){if(this.getDataLength()>1){this.show(this.getPrev(),true);}return this;},get:function(elemId){return elemId in this._dom?this._dom[elemId]:null;},getData:function(index){return index in this._data?this._data[index]:this._data[this._active];},getDataLength:function(){return this._data.length;},getIndex:function(){return typeof this._active==="number"?this._active:false;},getStageHeight:function(){return this._stageHeight;},getStageWidth:function(){return this._stageWidth;},getOptions:function(key){return typeof key==="undefined"?this._options:this._options[key];},setOptions:function(key,value){if(typeof key==="object"){$.extend(this._options,key);}else{this._options[key]=value;}return this;},play:function(delay){this._playing=true;this._playtime=delay||this._playtime;this._playCheck();this.trigger(Galleria.PLAY);return this;},pause:function(){this._playing=false;this.trigger(Galleria.PAUSE);return this;},playToggle:function(delay){return(this._playing)?this.pause():this.play(delay);},isPlaying:function(){return this._playing;},isFullscreen:function(){return this._fullscreen.active;},_playCheck:function(){var self=this,played=0,interval=20,now=Utils.timestamp(),timer_id="play"+this._id;if(this._playing){Utils.clearTimer(timer_id);var fn=function(){played=Utils.timestamp()-now;if(played>=self._playtime&&self._playing){Utils.clearTimer(timer_id);self.next();return ;}if(self._playing){self.trigger({type:Galleria.PROGRESS,percent:Math.ceil(played/self._playtime*100),seconds:Math.floor(played/1000),milliseconds:played});Utils.addTimer(timer_id,fn,interval);}};Utils.addTimer(timer_id,fn,interval);}},setIndex:function(val){this._active=val;return this;},setCounter:function(index){if(typeof index==="number"){index++;}else{if(typeof index==="undefined"){index=this.getIndex()+1;}}this.get("current").innerHTML=index;if(IE){var count=this.$("counter"),opacity=count.css("opacity"),style=count.attr("style");if(style&&parseInt(opacity,10)===1){count.attr("style",style.replace(/filter[^\;]+\;/i,""));}else{this.$("counter").css("opacity",opacity);}}return this;},setInfo:function(index){var self=this,data=this.getData(index);$.each(["title","description","author"],function(i,type){var elem=self.$("info-"+type);if(!!data[type]){elem[data[type].length?"show":"hide"]().html(data[type]);}else{elem.empty().hide();}});return this;},hasInfo:function(index){var check="title description".split(" "),i;for(i=0;check[i];i++){if(!!this.getData(index)[check[i]]){return true;}}return false;},jQuery:function(str){var self=this,ret=[];$.each(str.split(","),function(i,elemId){elemId=$.trim(elemId);if(self.get(elemId)){ret.push(elemId);}});var jQ=$(self.get(ret.shift()));$.each(ret,function(i,elemId){jQ=jQ.add(self.get(elemId));});return jQ;},$:function(str){return this.jQuery.apply(this,Utils.array(arguments));}};$.each(_events,function(i,ev){var type=/_/.test(ev)?ev.replace(/_/g,""):ev;Galleria[ev.toUpperCase()]="galleria."+type;});$.extend(Galleria,{IE9:IE===9,IE8:IE===8,IE7:IE===7,IE6:IE===6,IE:!!IE,WEBKIT:/webkit/.test(NAV),SAFARI:/safari/.test(NAV),CHROME:/chrome/.test(NAV),QUIRK:(IE&&doc.compatMode&&doc.compatMode==="BackCompat"),MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!window.opera,IPHONE:/iphone/.test(NAV),IPAD:/ipad/.test(NAV),ANDROID:/android/.test(NAV),TOUCH:!!(/iphone/.test(NAV)||/ipad/.test(NAV)||/android/.test(NAV))});Galleria.addTheme=function(theme){if(!theme.name){Galleria.raise("No theme name specified");}if(typeof theme.defaults!=="object"){theme.defaults={};}else{theme.defaults=_legacyOptions(theme.defaults);}Galleria.theme=theme;return theme;};Galleria.loadTheme=function(src,options){var loaded=false,length=_galleries.length;Galleria.theme=undef;Utils.loadScript(src,function(){loaded=true;});Utils.wait({until:function(){return loaded;},error:function(){Galleria.raise("Theme at "+src+" could not load, check theme path.",true);},success:function(){if(length){var refreshed=[];$.each(Galleria.get(),function(i,instance){var op=$.extend(instance._original.options,{data_source:instance._data},options);instance.$("container").remove();var g=new Galleria();g._id=instance._id;g.init(instance._original.target,op);refreshed.push(g);});_galleries=refreshed;}},timeout:2000});};Galleria.get=function(index){if(!!_galleries[index]){return _galleries[index];}else{if(typeof index!=="number"){return _galleries;}else{Galleria.raise("Gallery index "+index+" not found");}}};Galleria.addTransition=function(name,fn){_transitions[name]=fn;};Galleria.utils=Utils;Galleria.log=function(){try{window.console.log.apply(window.console,Utils.array(arguments));}catch(e){try{window.opera.postError.apply(window.opera,arguments);}catch(er){window.alert(Utils.array(arguments).split(", "));}}};Galleria.raise=function(msg,fatal){if(DEBUG||fatal){var type=fatal?"Fatal error":"Error";throw new Error(type+": "+msg);}};Galleria.Picture=function(id){this.id=id||null;this.image=null;this.container=Utils.create("galleria-image");$(this.container).css({overflow:"hidden",position:"relative"});this.original={width:0,height:0};this.ready=false;this.loaded=false;};Galleria.Picture.prototype={cache:{},add:function(src){var i=0,self=this,image=new Image(),onload=function(){if((!this.width||!this.height)&&i<1000){i++;$(image).load(onload).attr("src",src+"?"+new Date().getTime());}self.original={height:this.height,width:this.width};self.cache[src]=src;self.loaded=true;};$(image).css("display","block");if(self.cache[src]){image.src=src;onload.call(image);return image;}$(image).load(onload).attr("src",src);return image;},show:function(){Utils.show(this.image);},hide:function(){Utils.moveOut(this.image);},clear:function(){this.image=null;},isCached:function(src){return !!this.cache[src];},load:function(src,callback){var self=this;$(this.container).empty(true);this.image=this.add(src);Utils.hide(this.image);$(this.container).append(this.image);Utils.wait({until:function(){return self.loaded&&self.image.complete&&self.original.width&&self.image.width;},success:function(){window.setTimeout(function(){callback.call(self,self);},50);},error:function(){window.setTimeout(function(){callback.call(self,self);},50);Galleria.raise("image not loaded in 10 seconds: "+src);},timeout:10000});return this.container;},scale:function(options){options=$.extend({width:0,height:0,min:undef,max:undef,margin:0,complete:function(){},position:"center",crop:false},options);if(!this.image){return this.container;}var width,height,self=this,$container=$(self.container);Utils.wait({until:function(){width=options.width||$container.width()||Utils.parseValue($container.css("width"));height=options.height||$container.height()||Utils.parseValue($container.css("height"));return width&&height;},success:function(){var newWidth=(width-options.margin*2)/self.original.width,newHeight=(height-options.margin*2)/self.original.height,cropMap={"true":Math.max(newWidth,newHeight),width:newWidth,height:newHeight,"false":Math.min(newWidth,newHeight)},ratio=cropMap[options.crop.toString()];if(options.max){ratio=Math.min(options.max,ratio);}if(options.min){ratio=Math.max(options.min,ratio);}$(self.container).width(width);$(self.container).height(height);$.each(["width","height"],function(i,m){$(self.image)[m](self.image[m]=self[m]=Math.round(self.original[m]*ratio));});var pos={},mix={},getPosition=function(value,measure,margin){var result=0;if(/\%/.test(value)){var flt=parseInt(value,10)/100,m=self.image[measure]||$(self.image)[measure]();result=Math.ceil(m*-1*flt+margin*flt);}else{result=Utils.parseValue(value);}return result;},positionMap={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};$.each(options.position.toLowerCase().split(" "),function(i,value){if(value==="center"){value="50%";}pos[i?"top":"left"]=value;});$.each(pos,function(i,value){if(positionMap.hasOwnProperty(value)){$.extend(mix,positionMap[value]);}});pos=pos.top?$.extend(pos,mix):mix;pos=$.extend({top:"50%",left:"50%"},pos);$(self.image).css({position:"relative",top:getPosition(pos.top,"height",height),left:getPosition(pos.left,"width",width)});self.show();self.ready=true;options.complete.call(self,self);},error:function(){Galleria.raise("Could not scale image: "+self.image.src);},timeout:1000});return this;}};$.extend($.easing,{galleria:function(_,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},galleriaIn:function(_,t,b,c,d){return c*(t/=d)*t*t*t+b;},galleriaOut:function(_,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;}});$.fn.galleria=function(options){return this.each(function(){var gallery=new Galleria();gallery.init(this,options);});};window.Galleria=Galleria;}(jQuery));(function($){Galleria.addTheme({name:"current",author:"Galleria",css:"galleria.css",defaults:{transition:"slide",thumbCrop:"height",_toggleInfo:false},init:function(options){this.addElement("info-link","info-close");this.append({info:["info-link","info-close"]});var info=this.$("info-link,info-close,info-text"),touch=Galleria.TOUCH,click=touch?"touchstart":"click";this.$("loader").show().css("opacity",0.4);if(!touch){this.addIdleState(this.get("image-nav-left"),{left:-100});this.addIdleState(this.get("image-nav-right"),{right:-100});}if(options._toggleInfo===true){info.bind(click,function(){info.toggle();});}else{info.show();this.$("info-link, info-close").hide();}this.bind("thumbnail",function(e){if(!touch){$(e.thumbTarget).css("opacity",0.6).parent().hover(function(){$(this).not(".active").children().stop().fadeTo(100,1);},function(){$(this).not(".active").children().stop().fadeTo(400,0.6);});if(e.index===options.show){$(e.thumbTarget).css("opacity",1);}}});this.bind("loadstart",function(e){if(!e.cached){this.$("loader").show().fadeTo(200,0.4);}this.$("info").toggle(this.hasInfo());$(e.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",0.6);});this.bind("loadfinish",function(e){this.$("loader").fadeOut(200);});}});}(jQuery));var $j=jQuery.noConflict();$j.extend({cdc:{user:current.User.getInstance(),page:current.site.Page.getInstance(),constants:current.Constants.getInstance()}});var cdc=cdc||{};cdc.bfdComment=$j.klass({initialize:function(options){this.o=$j.extend({},options);this.o.e={form:$j(this.element),textarea:$j(this.element).find("textarea").first(),submit:$j(this.element).find("input[type=submit]").first()};this.o.e.textarea.attach(this.textarea,this.o);this.o.e.submit.attach(this.submit,this.o);},textarea:$j.klass({initialize:function(o){this.o=o;},onfocus:function(event){if(!$j.cdc.user.isLoggedIn()){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);$j(this.element).attr("disabled","true");return ;}if(!current.Authorize.checkWriteMode(event)){event.preventDefault();$j(this.element).attr("disabled","true");return ;}}}),submit:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){if(!$j.cdc.user.isLoggedIn()){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return ;}if(!current.Authorize.checkWriteMode(event)){event.preventDefault();return ;}if(!Validation.validate(this.o.e.textarea)){event.preventDefault();return ;}else{$j(this.o.e.form).find(".error").remove();$j(this.element).val(current.locale.Bundle.get("submitting")+"...");$j(this.element).fadeTo(0,0.5);if(this.o.ajax_post){event.preventDefault();var obj=this.o.e;$j.post(current.Constants.getInstance().getScriptName()+"/comments/ajax_post/",$j("#bfdCommentPost").serialize(),function(data){if(data.error){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+data.error+"</div>");return ;}if(data.url){obj.form.after('<div class="bfdSuccessMsg">'+current.locale.Bundle.get("comment.thank_you")+'<br/><a href="'+data.url+'">'+current.locale.Bundle.get("comment.view_discussion")+' <span class="Sprites smBlueArrowRight"></span></a></div>');obj.form.hide();return ;}},"json");$j(this.o.e.form).ajaxError(function(event,request,settings){if(request.status!=="200"){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+current.locale.Bundle.get("verify.An_error_has_occurred")+" "+current.locale.Bundle.get("error.tryAgain")+"</div>");return ;}});return ;}}}})});cdc.bfdCommentModuleInsert=$j.klass({initialize:function(options){this.o=$j.extend({},options);$j(this.element).load(current.Constants.getInstance().getScriptName()+"/group_bfd_module/"+this.o.slug+"/");$j("#bfdCommentPost").live("focus",function(){$j("#bfdCommentPost").attach(cdc.bfdComment,{ajax_post:"true"});$j("#bfdCommentPost").die();});}});cdc.channelFinderForm=$j.klass({initialize:function(options){this.o=$j.extend({},options);this.o.e={form:$j(this.element),zipcode:$j(this.element).find("input[type=text]").first(),submit:$j(this.element).find(".Button").first()};this.o.k2url="http://current2.viewerlink.tv/viewer_results.asp?zipcode=";this.o.e.zipcode.attach(this.zipcode,this.o);this.o.e.form.attach(this.submit,this.o);this.o.e.submit.attach(this.btnClick,this.o);this.o.e.textintival=this.o.e.zipcode.val();},zipcode:$j.klass({initialize:function(o){this.o=o;},onfocus:function(event){if($j(this.element).val()==this.o.e.textintival){$j(this.element).val("");$j(this.element).attr("maxlength",5);}Form.getElements(current.utils.Compatibility.convertElement(this.o.e.form)).each(Validation.reset);},onblur:function(event){if(!$j(this.element).val()){$j(this.element).attr("maxlength",40);$j(this.element).val(this.o.e.textintival);}}}),btnClick:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){this.o.e.form.submit();}}),submit:$j.klass({initialize:function(o){this.o=o;},onsubmit:function(event){var zip=this.o.e.zipcode.val();var rTest=new RegExp("^[0-9]+$","gi");if((zip.length!=5)||(rTest.test(zip)!=true)){event.preventDefault();alert(current.locale.Bundle.get("validate.zipCode"));this.o.e.zipcode.val("");this.o.e.zipcode.focus();return false;}else{event.preventDefault();var cfWindow=new current.components.channelfinder.FinderWindow(event);cfWindow.setIframeUrl(this.o.k2url+this.o.e.zipcode.val());cfWindow.init();this.o.e.zipcode.val("");this.o.e.zipcode.focus();this.o.e.zipcode.blur();return ;}}})});cdc.header=$j.klass({initialize:function(options){this.o=$j.extend({},options);$j("#mainSearch").attach(this.searchInput,this.o);$j("#viewerlinkPopLink").click(function(){var theFeatures="width=495,height=610";var theWin=window.open("http://current2.viewerlink.tv/","popWin",theFeatures);return false;});$j("#viewerlinkForm").attach(cdc.channelFinderForm);$j("#navMenuViewerlinkForm").attach(cdc.channelFinderForm);$j("#headerClipperLink").click(this.clipperClick);$j("#showsHolder").attach(this.dropMenu,this.o);$j("#newsHolder").attach(this.dropMenu,this.o);$j("#communityHolder").attach(this.dropMenu,this.o);$j("#participateHolder").attach(this.dropMenu,this.o);$j("#localeHolder").attach(this.dropMenu,{offLeft:(-186+$j("#localeHolder").outerWidth()),offTop:16});if($j.cdc.user.isLoggedIn()){$j("#headerUsernameLi").attach(this.dropMenu,{offLeft:0,offTop:18});$j("#headerUsernameLi").attach(this.userUpdates);if($j.cdc.user.getFacebookId()){current.auth.Facebook.getInstance().checkLoginStatus();}if($j.cdc.user.getTwitterId()){current.auth.Twitter.getInstance().checkLoginStatus();}}else{if($j("#loginLinkFB")){$j("#loginLinkFB").click(this.loginClick);}if($j("#loginLinkTW")){$j("#loginLinkTW").click(this.loginClick);}if($j("#loginLinkA")){$j("#loginLinkA").click(this.loginClick);}if($j("#regLinkA")){$j("#regLinkA").click(this.registerClick);}}if($j("#studiosNav").get(0)){var oL=0;var oT=37;if(!$j.support.opacity){oL=-2;oT=38;}$j("#studiosDepartmentsHolder").attach(this.dropMenu,{offLeft:oL,offTop:oT});$j("#studiosWelcomeHolder").attach(this.dropMenu,{offLeft:oL,offTop:oT});$j("#localeChangeDropList a").click(this.localeSwitchClickBlock);var utm=current.utils.Url.getParam("utm_source");if(utm){setSessionCookie("utm_source",utm);}else{utm=getCookieValue("utm_source");}if(utm=="cmct"){var h=$j("#studiosHeader");if(h){h.before($j("<div />").append('<iframe scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="http://www.xfinity.com/xpbar/1/default/?highlight=comcastnet" style="height: 30px; width: 968px;" allowtransparency="true"></iframe>'));var f=$j("#smallFooterDiv");if(f){f.after($j("<div />").attr("style","clear: both").append('<iframe scrolling="no" frameborder="0" style="height: 90px; width: 968px; border: medium none;" marginheight="0" marginwidth="0" src="/sl/comcast_footer.htm" id="comcast_footer"></iframe>'));}}}}},loginClick:function(event){event.preventDefault();var loginWindow=new current.components.account.LoginWindow(event,current.components.account.LoginActivity.NONE,($j(event.currentTarget).offset().left-360),($j(event.currentTarget).offset().top+5));loginWindow.init();},localeSwitchClickBlock:function(event){event.preventDefault();new current.components.alerts.AlertWindow(event).init();return false;},registerClick:function(event){event.preventDefault();if(current.Constants.getInstance().isReadOnlyMode()){new current.components.alerts.AlertWindow(event).init();return ;}var regWindow=new current.components.account.RegisterWindow(($j(event.currentTarget).offset().left-370),($j(event.currentTarget).offset().top+5));regWindow.init();},dropMenu:$j.klass({initialize:function(o){this.o=$j.extend({},o);var d={};d.holder=$j(this.element);d.menu=$j(this.element).find("div.modalWrapper");d.link=$j(this.element).find("a").first();d.offLeft=-18;if(!isUndefined(this.o.offLeft)){d.offLeft=this.o.offLeft;}d.offTop=17;if(!isUndefined(this.o.offTop)){d.offTop=this.o.offTop;}if(!$j.support.opacity){d.offTop=(d.offTop+3);if(!isUndefined(d.menu.find(".smartModalContainer").first().get(0))){d.menu.find(".smartModalContainer").first().removeClass("smartModalContainer").addClass("accountModalBox");d.menu2=d.menu.find(".menuDrop").first();d.menu2.before('<div class="modalVertical"></div><div class="modalHorizontal"></div><div class="Sprites modalTopLeft"></div><div class="Sprites modalTopRight"></div><div class="Sprites modalBottomRight"></div><div class="Sprites modalBottomLeft"></div>');}}d.showMenu=function(event){d.menu.offset({top:($j(event.currentTarget).offset().top+d.offTop+$j(window).scrollTop()),left:($j(event.currentTarget).offset().left+d.offLeft+$j(window).scrollLeft())});if(d.menu.find(".dropbridge").first()){d.menu.find(".dropbridge").first().width(d.link.width()+12);}d.menu.show();d.link.addClass("active");};d.hideMenu=function(event){d.menu.offset({top:0,left:0});d.menu.hide();d.link.removeClass("active");};d.config={over:d.showMenu,timeout:300,out:d.hideMenu};d.holder.hoverIntent(d.config);}}),searchInput:$j.klass({initialize:function(o){var s={};s.searchInput=$j(this.element).find("#searchInput");s.searchInputSubmit=$j(this.element).find("#searchSubmitButton");s.initSearchVal=s.searchInput.val();s.searchInput.focus(function(event){if(s.searchInput.val()==s.initSearchVal){s.searchInput.val("");s.searchInput.addClass("active");}});s.searchInput.blur(function(event){if(!s.searchInput.val()){s.searchInput.val(s.initSearchVal);s.searchInput.removeClass("active");}});s.searchInputSubmit.click(function(event){if(!s.searchInput.val()||(s.searchInput.val()==s.initSearchVal)){s.searchInput.focus();s.searchInput.addClass("active");return false;}});}}),clipperClick:function(event){event.preventDefault();if(!$j.cdc.user.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.CLIP);setTimedCookie(current.Cookies.LOGIN_REDIRECT,$j(this.element).attr("href"),30);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}var clipperWindow=new current.clipper.ClipperWindow(event);clipperWindow.setEditString(false);clipperWindow.init();},userUpdates:$j.klass({initialize:function(o){var u={};u.parent=$j(this.element);u.updateCombinedUpdates=function(){if(isNaN(u.updateCount)){return false;}if(u.updateCount<1){return false;}u.parent.find("span.uuCount").text(u.updateCount);u.parent.find("a.userUpdatesCount").show();};u.updateUpdates=function(n){if(isNaN(n)){return false;}if(n<1){return false;}u.parent.find("span.uumCount").text(n);u.parent.find("span.uumCount").show();};u.updateMessages=function(n){if(isNaN(n)){return false;}if(n<1){return false;}u.parent.find("span.umCount").text(n);u.parent.find("span.umCount").show();};u.updateCount=0;$j.post("/proxy/index.php/cccp/user/get.htm",{id:$j.cdc.user.getUsername()},function(data){if(isNaN(data.pendingActivityCount)){return false;}u.updateCount=parseInt(u.updateCount+data.pendingActivityCount);u.updateCombinedUpdates();u.updateUpdates(data.pendingActivityCount);},"json");$j.post("/proxy/index.php/cccp/user/messagecount.htm",{id:$j.cdc.user.getUsername()},function(data){if(isNaN(data)){return false;}u.updateCount=parseInt(u.updateCount+data);u.updateCombinedUpdates();u.updateMessages(data);},"json");}})});cdc.minicarousel=$j.klass({initialize:function(options){this.o=$j.extend({},options);var v={};v.fadeTime=400;if(!isUndefined(this.o.fadeTime)){v.fadeTime=this.o.fadeTime;}v.delayTime=6000;if(!isUndefined(this.o.delayTime)){v.fadeTime=this.o.delayTime;}v.limit=8;if(!isUndefined(this.o.maxItems)){v.limit=this.o.maxItems;}v.index=0;v.parent=$j(this.element);v.scrollNum=4;v.displayCount=4;v.count=v.parent.find(".carousel .items .item").length;if(v.count<v.limit){v.scrollNum=(v.limit-v.count);v.limit=v.count;}if(v.limit<5){v.scrollNum=v.limit;v.displayCount=v.limit;}v.parent.find(".carousel .items").jCarouselLite({btnNext:".next",btnPrev:".prev",speed:300,beforeStart:function(){clearTimeout(v.loop);},scroll:v.scrollNum,start:0,visible:v.displayCount});v.marqueeHover=function(event){if(!v.slideTo($j(event.currentTarget).attr("data-id"))){return false;}};v.hoverConfig={over:v.marqueeHover,timeout:0,sensitivity:2,interval:100,out:function(){}};v.parent.find(".carousel .items a.item").hoverIntent(v.hoverConfig);v.parent.find(".carousel .items a.item").click(function(event){if(!v.slideTo($j(event.currentTarget).attr("data-id"))){return false;}});v.slide=function(){v.parent.find(".carousel .items a.item").removeClass("active");v.parent.find(".carousel .items a.item").closest("li").removeClass("Sprites active");v.parent.find(".carousel .items a.item"+v.index).addClass("active");v.parent.find(".carousel .items a.item"+v.index).closest("li").addClass("Sprites active");v.parent.find(".views .view:visible").fadeOut(v.fadeTime);v.parent.find(".views .view"+v.index).fadeIn(v.fadeTime);};v.slideTo=function(newIndex){if(newIndex==v.index){return false;}clearTimeout(v.loop);v.index=newIndex;if(v.index>v.limit){v.index=1;}v.slide();};v.looper=function(){v.index=v.index+1;if(v.index>v.limit){v.index=1;v.parent.find("a.prev").click();}if(v.index===5){v.parent.find("a.next").click();}v.slide();v.loop=setTimeout(function(){v.looper();},v.delayTime);};v.looper();}});jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;}if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}value=String(value);return(document.cookie=[encodeURIComponent(key),"=",options.raw?value:encodeURIComponent(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join(""));}options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp("(?:^|; )"+encodeURIComponent(key)+"=([^;]*)").exec(document.cookie))?decode(result[1]):null;};cdc.sml=(function(){conf={getSandboxApiUrl:"/proxy/index.php/cccp/sandbox/get.htm",getNextScenesApiUrl:"/proxy/index.php/cccp/scene/next_scenes.htm",cPrev:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTU4QjBDMzUyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTU4QjBDMzQyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGOTdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACBAAACAwEBAAAAAAAAAAAAAAADBAECBQAGAQADAQEAAAAAAAAAAAAAAAACAwQAARAAAgEDAgMHAwMFAQAAAAAAAQIDABEhEgQxQVFhkaEiUhMFgbEyccFC0WKSI1MGEQACAgEEAQQDAAAAAAAAAAABAgARITFBUQMS8CIyE3HBQv/aAAwDAQACEQMRAD8A8HCp5C1Nor2vpHfScQPL96aRL40jxqF7uXpVQgV6nS55+NRoPpHeahsDke+lWeY0BeIRVk9VvrXaJDx49STQQG6DxrrN6V+t62eZscGF9qT1eJ/pXSJaxDtcsL+YW+1/Gh2PpW3TNSyki50AAg8e6iANjImNUcGZ8YX1W76YQIP5eBpeLUeFqZQP0APWmvEJctpj6/eptHyY1w93oKlUndgq2JPDNBnmMFehOSISuI4zqdjZVAuTTQ/8785KGeCKH214l5FJv0srHNHhtCoiRwZGxJILY6hT0p/3U2Xxm4khKBpWUAWzdg2e4Vxez3VVw26vaTZH4nmduWfWsq6JI2KOAL5FEZImUBhwOoGwvxqu3LtNObgksCT26RR/9vZa1Gxp8UMxSi10vaZaFOp8aYR4hzahRs3SmYV3EjiNE1M2ABRsT6MBAZaMJK4jQuztgAVoxrFAhjDlpG/OQk/4rjhUnabnYOLtBJDIlpJEkGpW9NuNvpQ/dR2soJPW+Kn7W2AxuQZT1JizrwYeKDyl1OtRxsb8fpQ99NbaGEN5mkQ56IGvf/Kl5PkDsW1J5nIygbl21lvLNvJDYtpudbXzn+IounqJIc4Ubznf2qo8RljtCbcgtI4cqGay9oUAXopKkD/Zw53FXjiKqFCLYCwGKsUYi+geHWmeQLaRIUhZnpKRbFaPx26Cu6qdLlbg5va+c91IIotk1EgdGWSM2dDdTROqsCt1cFGZSGOQNZ6FkRwsh81xwNyAaixYhFIybDiBnFI7P5H30sdKOv5JbxHZTYEkwIjIJHZio2Qg0cVLlYMLGQZg/JBod1NG+pZFkKvxuADY/amds8KxjQfLbAArbl+Hb5YBllI+QVdOh0WMS2GBrVz5rYyua8/Nttx8ZOVljYR3s6EG6kYzV1r2IAp02kFP19hLf0flHBOPTXHcKOINr/erRxiRQ6G6ngaL7VlsSdJ7an8usHIMo8Xo5mIsxHKiiYsLWoKI/wCtFCsP41UQu0kUtKESo4lQ6WXINa+x3y7hbW0yqPOgAx2jsrNu5FCYyRSCWM6XXINLfr+wUaDDQxnX2/WcWVOo/Ym9ZlOpSVIyCBnvrY3Pye33/wAMzfIxCWeIiMyAAFrjyEkc7XrzUG+O6Swskg/MfuOw00zuNjIHUaTJGdYta6hzm1IRWRwDg7iVOVdLGRsZn7X3UEsUd9KNgA8ARembTWyTflQtq4WWfjbULXxypvWunnwo3Yh/jvEovs+XMzItPWmUC2yRScR7RTCXtixonUwUYDUCMe3Ga5trEy2tQgT0q3uFeRpZVhoY0FDqBFJtpJC4kiurLkHFWbf7qSIxMAtyCdII4Ajt60yZSwswPcagBA16MOcFlDEaGLKDIRiqnUQMCyRqWyWc6msMeNHMgKZHmo6zqPKRXF9ueIOrBFD9hJsqddof1UtB9t5kJyxejr2LSkdHWntELDgvfAIqSx/uFQKuKHELMrqPJu8VcF/+neKtV6HE6Lg7m35D9alkc2YODY5Gnl+tXP4UIcDXRe1THxrNz//Z",cPrevIE:"/images/current/studios/sml/button_challenge_prev.jpg",cPrevHover:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NjlGMDFCNDYyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTU4QjBDMzgyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGOTdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACHAAACAwEBAAAAAAAAAAAAAAADBAECBgUAAQADAQEBAAAAAAAAAAAAAAACAwQBAAUQAAIBAwIEBAQFBAMAAAAAAAECAwARBCESMUFRBWGRoROBsSJScTJCYgbB0SMUkkNTEQACAgIBAwQBBQAAAAAAAAABAgARIQMxQVES8DITBLFhcaHBIv/aAAwDAQACEQMRAD8AwcKnkLU2iva+0edJxA8v600iX02j1qF7uXpVQgV6na55+tRsP2jzNQ2g5HzpVnvGgL2hFWT7rfGvbJDx49STQQG6D1r1m+1fjeuz3nY7GF9qT7vU/wBq9IlrEO1ywv8AULfK/rQ7H7Vt01qWUkXOwAEHj5UQBsZE41RwZz4wv3W86YQIP1ehpeLceFqZQP0APWmvEJcttj6/OptHyY14e70FXihyZpFjiG53NlANBnvGD1iehgORKsMN5JXNlRRck05L/Fv5IAXWCFIwOLyKTfpZGNjXXw1i7WgjSRXypNJphbQHisZvwHrT3cctYOwyyxlA7yoF01uyvrz5ClJ9i9oULanFn+oT6v8ANkkftMLjM770mXZJE21go0uKKyRMoDDgdwNhfjQ8Yu2RkG4JJUk+NqZ/y+FrU9jT4oZi1FpkXyJy0KdT60wjxDm1CjZulN40WVkSrDDHvkc2VRxJo3J9GAgMtBGMiZIId7yubKo4k1oIY8ftcLRBzJlOLSzXNh+xNOHXrURYeV2Rm9z/AF5ElSzzpJd1a/5AONvhSUmQMiUhASTzvpUe5yx8V9lWSDcp1JjyPPQRiKNpWLq29Rxsb8fhRO9zCPtC42+8kkyML/bGG3E/8hS4zI+0r77/AFORpGG1I8dKz+bn5PcsguzMFuQTfgD+ha36+ou4fhE695n2NgRfHlm6T2PYtLIHKqzWU9dotejEqQP8nDncVaKIqgARbAWA00FXKMRfYPTrVRYFuIlVYLOekpFtK0X8byo40yCmmQVG1rG+2/1AEfCs+ii2pqVyJ8OZZoj+U1m7WNiFFNE8TNbFGBbImmy2EjCRju8CSQD8ajEX3JFQEakAcQNdKXgzUzoPcj2qw1eMD1FWi90m0diR4aVAVIBUiiMES4HgjIPWcLvryrn5CSbleOQxlTe6hTY/KrYhhEYZTpyFuFarL7C3fk96KUDuSLtMbosfvbRp9ayEFraC661kMjFyu15BWSNlQG0kbAgqRprevRRk2agEx4ivGecwfXtJbNn3R4Tr9teOQo4g2v8AOrQqsqCSM3VuBovtWWxJ2nxpN6wcgynxcjBnEWYjlRPcLixFCRH/ABooVh+mqiF6SRS0pBNPhzCWM2sbkVo8XKizovciBDgfXGANPEeFcEhmFiKFDPNhTiaI2saTu0/KLFBxwe/6GN1bvjNGyh/iaaGSWCTcpKkG9wNfOu53jNxM/sf+1nRCSdGETuAAWJH0Ekc7A1m4sle4Rh4dqSf9ii2nnyNO5xkTsbrKo2maKzra11WQ6leFSa/Jdqjgk0yyrYFZCeeoMz2GJUM0MZO1G0APC4vTVprak35UDEcLkZHGxK2vpyp3eu3nwqnYxD+3t+IhFtPd3/M5kW3rTKBbakUnEfEUwl7aWNE6mCjAcgRj24zUPiROtrUME9Kt7hXkaWVYcNGAoeQIooyO3ziWG4seFN538jmzcYY3tiMbg7bdLlQQOvWoZ94swPkaGsMQa9GPEkO6AuvBgFWAKI1Iekpjq6KXBJaQ7msNB0GtMGQFNR9VGSZF+m1qkvjniDu0IrPkJayp56Qvi8VoP06zkJy0vR18FpSOjrTmiVhwXvoCKksf3CoFXFDiFmV3Hk3mKuC//p5irVehxNFwdzb8w/GpZHNmDg2Oo28vxq5/JQhwNaL6VOPjWbn/2Q==",cPrevHoverIE:"/images/current/studios/sml/button_challenge_prev_hover.jpg",cPrevActive:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTU4QjBDMzEyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTU4QjBDMzAyMjlBMTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGOTdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACAAAADAQEBAQAAAAAAAAAAAAACAwQBBQAGAQADAQEAAAAAAAAAAAAAAAAAAgMBBBAAAgECBAMGBAYDAAAAAAAAAQIAEQMhMRIEQVETYXGRobFSgSIyQsHRYiMzFPFTBREAAgICAgIDAQEAAAAAAAAAAQIAESFBMRJRA/BxMhOB/9oADAMBAAIRAxEAPwD4Oyp4CkrRXpXSPGR2geH4ypErhpHnOF7ud6VUYFebpc8fOZoPtHiZjYDgfGSs+ZUBfEYq3PdT4z2i4c8+ZJiQG5DznqN7V+NYZ8wx4Mb0rnu8z+U9cSlCHapYV+YU9K+cXQ+1acsZrKSKnQACDn4RgDYyIGqODOfbC+6njKECD7vIye1qOVJSgfkAecq8glwtNvn6zaW+DGeHV5Cepd7PGJnzKCvgmEW/ePCSXd9bVyttDcpmchNvbm9fY7e01FH1uPQTV2yomkUlAAP3vUmzE4TgbjNrdS+moAqQaEU4xrJaZQGGR1A0Fc4nYBh1gtKahn3CV/u9lKRWNPiuYyi0sjU5aFOZ85Qj2hxaKts3KPVrnIeMdifhiIPqFrscWYSa7fuX26Nh20fe59BBv7i7eJs2BgPqb8JXs9uEQfJpNMRXGYaQdiM6EBbnqONme223S2oAqAId6ijOPZgqYYfGRObu6uG1aNAv8lyuCj8zJLbtZ43KtSLQ/wAqBtSD1G1lQXoPgBHEqQP3MuNRGLaCIttEGhRRQaE/GaUYiugeXOU7AtxECkLU56XSKYQ7t49F6Z0MxFFMTHKg44g4EcxGPW4gD0RA2SIqgD8Z00AC/wCZy9J2jj7rDGiOeB9rS+3cJGGXdJe8Em7sGV9JAFVRGoj/AKF1ltkg0qQC3IE5wrV2xbtLbtYIMRhiTxY9pm7m2zoRQEHskFottHCXfmtMcG5RvWAyVsZrzMclXvRxfidAXx7Z47hRmDSvrDSzqAK4g5GM6VFoSdJ7Ynb12MGUK+yjmcRbxHCOW+3KIRH740Kw+2dRC6nIpaPV3cFXoyMKMpyImDqbQjUS1ljRLnI+1oKs4jBf+UrcUPbYUZTkREIPBAIj2OQSDKUfWtKHwEVubKspBGfZJwzbYj7rDGiOcx+lo5r4K5DykuhVrHEoHDLR5gbFr/Se0pJ6bUHdnKqXqYk14Sf/AJ9wA3u1h6S7WunjlB2If8jmai2n61OZa085SgWmJEjtHtEoStMKGM6mKjAcgSjp2zN/rWiMBEgnlC6hXgZMqw4MqCh5AmnajSVpqVsGU5ESS5sN3b/iHUtnKpAYdhrLBfbiD4GF/ZPOar+xdA/cVvX6m2V+pHt7N6whLfU5qQMacBjKDcBTEfNKBuFrQzC+3OYOrAiH9CTZQ86m/wAuopX1uchOGFY9exZJbj1l2kFjwXrgCJpY/qEwQxFxGzB1Hg3iIYL/AOzxEKHFxNFxdTT6h3zWRzRg4NDiNPDvhn6IoZGaL1UD1rNz/9k=",cPrevActiveIE:"/images/current/studios/sml/button_challenge_prev_active.jpg",cNext:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RUMxQUU1NDkyMjk3MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RUMxQUU1NDgyMjk3MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGODdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACNAAACAwEBAAAAAAAAAAAAAAADBAECBQAGAQEAAwEBAAAAAAAAAAAAAAADAQIEAAUQAAIBAgQDBgIHCQAAAAAAAAECAwARITESBEFRcWGBkSITBTIUocFCUoKSI/DR4fFyosIzFREAAgIBAgUEAQUAAAAAAAAAAQIAESESA/AxQVFxgZEiMmGhseHxE//aAAwDAQACEQMRAD8A8ookazCOwI4fzqwV+KEfiFKRxShQdDZD7VhVwshOCN+evOK5+w49Z6YIq6PHpGCp+6fGo0NxU/moN5Rho/vrryHNLfiNVo9x7/zJsdjx6S+k3yPjUFWAyNRpwxX6TUEjIC3ea6jwJ2O8o6sRiDSzodY8vEUww/bGgOPOOo50qXBeqjkCBo9Ra2VvChyidtxDttqBJNObKCbDDnRg8wUAhTYC2FLvLKm+jddKuqGxH9Q61yC3NkH8SzVoFY5TQ/4PvMJtuo4wGF1McisT0UtqNKtCgNi9iM7it3dtHu4NtumKhjHgRmpLMpPZiKzZh8wCbqNwOJtZrcCedGz/ACIHx6RBtUoP26xM6AMJAe+qEIfti/WrH1b20rcVH6tsl8BUiUNfmCdE50uyprGPEc6Yk9QjId1LNr1i9r3pk8w38RhWga1gT40OQou5jYAqGBW5y1YEU4rFUCrJ3ChTwtIhVgXB7MR2g1CuAxv95LIdIoZ8TS28wk2sEerzRqUYdoZj/lVpoNJ1O2m+IBP8KwYN3PsZgXuSpupxAYDnWnHuzu2Mh/2ZMhbEUW9tFSW5qc3H2d1WGnkw6Q00UW6+E2nGF+D9h7azm0KSrFgRgRjetATRqxDAqeZOFX+T3m7EsxMKhQBCusF5AM7jnUbbnkfSzI3U6jqekyGMfNqA2nUMTnTUjOpKlLEYEHnS7tJrHlGYrQh8zM4M1VlXSMAK47lBhSXpyEZmqTKYozI5sBRDZQmi2bjf6sBgSfcJIGiOo9Od+YqnsySbjdxrHf1Cras8lBa5PKwqPb/a977nOBHEzkm0aYj8R7K3/wDmj22J4IJvV3Uo0zMsalQOKLIX1W52WmbTt7ZUm7HKEgfc3Q4GkKcmDFiLHLtxq2lYo2dDpv8ACoJA60Ni0XlcgHpSW99xaMejHpeU5YYLfiaxIhY0JtZwos4qU3+5D7gjNlA1NzNv3WpJpfOM86JFD5CzG5OJJzJPGqMtnAvxrYmkYGamJyzEnlc11sVGHCld7ofcwRyDVELyOmV7ED66NFIPTAGfHwpbcODvFJyWM9MxnQbSkbl9rj7mkp5qeo3Xuke19rh2/tqCD5lT6kmkatGWkMccTWOFN7m5OeWNUlLnb7cKoVBHpVmtjZ3yvjSW437wr6SWac8cDYczUMrO5Azn9JcMqICcCF3+/wDS/SjF5jwIFlHM0lBBbzubk4knMmp2+3udb4k4sTmTTLoCLClAVBpB8nvAJZzqbkPqIGWdVFhalWmuwOGdHlgBpZoTqA7aXbCCHuF+01SkugWYKMKW3MMt1lDgslxxGB6UbUWykPSuMJYfET4UYJDWa9ojAEUL94sfcN2I1iUKSqlQSLkYk4Zc6HBCwJdwSTiScyaZ+XKte1/oohLLw+urFlzpAF85XSTWpia5SqyKBau13yrmfmvdao8hzUjpVNIl9R7yGJ4mgMRrHWjNa2Bt9NLsTrGPHlV1Eo5xNIK5wsBwyqpSQ4BB1vajSfAKGONUz/cTp1g2jbiCOhqhXHBmHWjiqy5VPykGDs33h31zsbWupqldxrsyuJRz2AUux8w60aWl2+IdaRYbz//Z",cNextIE:"/images/current/studios/sml/button_challenge_next.jpg",cNextHover:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QkFGODU4QzQyMjk5MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QkFGODU4QzMyMjk5MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGODdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACOAAACAwEBAAAAAAAAAAAAAAADBAECBQYAAQADAQEBAAAAAAAAAAAAAAACAwQBAAUQAAIBAgQDBgMGBwEAAAAAAAECAwARITESBEFxBVFhgZEiMqETBsFCUoKSFPDh8WJyoiMVEQACAgECBAUDBQAAAAAAAAABAgARAyESMUFRcfCBkSIyYbEToeHxQnL/2gAMAwEAAhEDEQA/AOUUSNZhHYEcP61YK/FCPzClI4pQoOhsh96wq4WQnBG/XXnFdfkPHnPTBFXR8eUYKn8J86jQ3FT+qg3lGGj/AHr15DmlvzGho9R6/vNsdD48pfSb5HzqCrAZGo04Yr8TUEjIC3ia6j4E7TrKOrEYg0s6HWPTxFMMP4xoDj1jmO2mpcS9VHIEDR6i1sreVDmE53EO22oEk05soJsMO2jB5goBCmwFsKWeWVN9E66VdUNiP8hzrkFubIP0hNWwVodJrR/TH1AAWmgQoR6WikVieSltR8KQaFFJVm0lTY3FrEV2Z3SSdK2W5JUMYybi1wS7AnPurJ30CdTQyxlF3yjEGwEgHAm/u7+NTtnP5CpG0XQI4ecYMfsB+X3mCdAGEgPjVCEP3xfnVmEwJUqAwwIPA1H/AFtkvkKaIBr6wTonbS7KmsY8R20xJ8wjIeFLNr1i9r3pyd4t+0YVoGtYE+dClKLuI2AKhgVucr4EU6rFUCrJ4ChTwtIhVgXB7sR3g1iuAxv7zWQ7RXHtOk2Uo3HRdsgb1wq0cgvxDs3xDClmV4JNTNoviAT/ACrB6d1Xc9J3A16nQm5F7BwB8CK2pJE34O6jNyfchbEfCpM+Io5J1RzYbvylGDIHWuDLxHOMbzaQdUT5kB071RjjhKBwJy1dlc84VGKtqVlJDKQQQRwrX2+8WGSzXUjiSQKa3HTt/wBWaXcxrt00qPlASD5kthjcdvZlRYcjA7W+NWCT+kzKn9h5gTmmMfa1AbTqGJzpuUyIxVk0sDYqcCCOBpZ2k1j0jMVWh7yVwZqrKukYAV47lBhSXy5CMzVJlMUZkc2ApQwoTRbW478rAaCT1CSBojqPLtv2ii/TJmm38cMdyZFbWMbDSpbUT4Uv07pO/wCq7hVhiaRmNooxfzPdXWJ0kdDgkhhmE29nXTM6xqVUcY1kaS9r52UXo8uzHhZGO4sKAik35Mquo21xMSmsGtw77mjbOQwgshK39qgsBzpaTWH0va/Kh7rqA2UYUaXmb2qR7b8TjUAQmlGpMuJqydAJX6k3ET7xWW3zSg+cQLXbx42tWI0vrGedG0vKTLIbsxuSc7mhMtnAvxq/CoRQt7io1MiyksxI0B4TXWxUYcKV3uh9zBHINUQu7plexA+2jRSD5YAz4+VLblwd2pOSxnlmM6ViUjJfS47LtKd6nbrv4Nh0OH/z0ELbtWvJpGoRg2KhjjiwNc8xklkubk55Y40ywlk6TslRAqCIqGYAXtI+V8azp97+xj02V9ycsjYfiNIbc+Rq9zWVA6CNXaqDkKsmE3m9TYpa19ww9KECy/3GshVaRzNKdROJJqY43lcyynUzG5JozoCLCqERUFX7j8jEuxf/ACOAgZZ1UWFqVaa7A4Z0eWAGlmhOoDvqjGEERkL9JqlJdAswUYUtuYZSVlDgslxxGB5UbUWykPKvGEsPcT5UsEhrNekYwBFC/WEg+ot1Bs02gjVzGCqMRewLFsBh20iBLJIZZrlibkmjftyrXtf4UQll4fbWAIpYooBfVjM9xADNovCVWRQLV7XfKvM/avhao9BzUjlXbRC3HrIYniaAxGsc6M1rYG3xpdidYx49lGogOdJpBXOFgOGVVKSHAIOd7UaT2ChjjQa/zGcucG0bcQRyNUK44Mw50cVWXKt90wwdm/EPGvOxta6mqV7jXawdJRz3AUux9Q50aWl29w50xYt5/9k=",cNextHoverIE:"/images/current/studios/sml/button_challenge_next_hover.jpg",cNextActive:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6Rjc3RjExNzQwNzIwNjgxMTk1RkVCNDlFOUNGOEIyRjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QkFGODU4QzAyMjk5MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QkFGODU4QkYyMjk5MTFFMDkyNkNCQzUzNEJDMzNCMjkiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGODdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOTVGRUI0OUU5Q0Y4QjJGOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIAGkAPwMBIgACEQEDEQH/xACLAAACAwEBAAAAAAAAAAAAAAADBAECBQAGAQADAQEBAAAAAAAAAAAAAAABAgMABQQQAAIBAgQDBgQFBAMAAAAAAAECAwARITESBEFRcWGBkSIyE6GxQlLwwWKCktHxoiMzFAURAAEDAgUEAAcAAAAAAAAAAAEAEQIhEjFBUXED8IEiE2GRweHxMkL/2gAMAwEAAhEDEQA/APKKJGswjsCOH96sFfihH7hSkcUoUHQ2Q+qwq4WQnBG/nXOMa/sOu66YIZ2PXZMFT9p8ajQ3FT/Kg3lGGj/OuvIc0t+40rHUfP7ouND12V9JvkfGoKsBkajThivxNQSMgLd5rMegtTVUdWIxBpZ0OseXiKYYfjGgOPOOo51WDqM2ZOQIGj1FrZW8KW3+4bbFBHZ2e+eVhTYeYKAQpsBbCkd6C+6i1ADyHLqK0KzLkEaIzawNQ0VNvvtUnt7ke3q9LC9qeMUf3jrak32quhUjCqQbmXbuIJrFTgjn5GjIXVgWbGKWJtpOoyknzoAwkB76oQh+sX61a8hyC/Co/wBtsl8BUwqFvihOic6XZU1jHiOdMSe4RkO6lm16xe171aG6nPZMK0DWsCfGg7kqs0UiqQDdSTzwIp5WKoFWTuFVeL3FaOQF0bPDEdoPMUomAS+G6MuM2hsdlEQDLlQ9ztVdSCuBoae7tZBFN6W/45ODAfmKdBDLgAe40knhJwaZFPFpxYiuYWXDK23f2ZydJ9D/AJGmrxfc1Rvds0iFVAufxel4NzNARBNiD6G/KquJi4Y5hSrA2nDI/RGYx82oDadQxOdNO7fbS7tJrHlGYowO6EwVqrKukYAVx3KDAHGkvbkIzNUmUxRmRzYCpemBLGVXVvbICgR97uoG27JLihxHMMMivbXbFnMSF/VYXrOigfcMJZCVUYov9b1qRKyqMflW5IxhGwF6oQlKcryGoiy201k77TobnmD20/PNoUktgOlAh2rz23E+CZxRnM/rbs5VuEW+RLBbmN3iA5KqZfKBxAoLS+cZ501JCoxuKWZbOBfjVYGOSlISzWutiow4Uj/6nnlhi+mxdh0wHzpqKQe2AM+PhSW/kP8A2ojyQ/MVDjifZtcr8pj697UeFVC4eN66eYIpubAYk3oB3WlblrAVbbwNMV3G5HkziiPH9TDlyFNZW6WCS/8AmOKnbbf3SNzuh/rzhhP1frfs5CmZJBcsbG9S7ljdjcnOgSANQe41oMgnAtFKnMoU24UA5Uo012Bwzo8sANLNCdQHbXo4xAKHIZ6LVKS6BZgowpfcbOWfSwkUOl7XuAQelF1FspD0qfbbPUT4VMOCTQdlSQBDVPdLx7FlYPMVlIxWNblb82uBfpR2eS5Lg37am0inn8KhmcHEH50JG7FisIiIoo90HjUa75VzPzXutUeQ5qR0rWhG46qGJ4mgMRrHWjNa2Bt8aXYnWMePKniEkzRaQVzhYDhlVSkhwCDre1Gk9AoY40lfyqZZobRtxBHQ1QrjgzDrRxVZcqPkgUOzfcO+udja11NUruNaqWio57AKXY+YdaNLS7eodapFTmv/2Q==",cNextActiveIE:"/images/current/studios/sml/button_challenge_next_active.jpg",reload:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAyAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgTWFjaW50b3NoIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjRGQkUwM0RBMjRERjExRTBCNzg5ODM1RUYwQkE2NzdFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjRGQkUwM0RCMjRERjExRTBCNzg5ODM1RUYwQkE2NzdFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEZCRTAzRDgyNERGMTFFMEI3ODk4MzVFRjBCQTY3N0UiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEZCRTAzRDkyNERGMTFFMEI3ODk4MzVFRjBCQTY3N0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAIBgYGBgYIBgYIDAgHCAwOCggICg4QDQ0ODQ0QEQwODQ0ODBEPEhMUExIPGBgaGhgYIyIiIiMnJycnJycnJycnAQkICAkKCQsJCQsOCw0LDhEODg4OERMNDQ4NDRMYEQ8PDw8RGBYXFBQUFxYaGhgYGhohISAhIScnJycnJycnJyf/wAARCAA8ADwDASIAAhEBAxEB/8QAlQAAAgMBAQEAAAAAAAAAAAAAAwQCBQYBAAcBAAMBAQEAAAAAAAAAAAAAAAECAwAEBRAAAgEDAgIGBwUHBQAAAAAAAQIDABEEIRIxBUFRgaETBmFxkcEiIxSx0TJCUvDhYnKiMxWCkvJTkxEAAQMCAwYFBQAAAAAAAAAAAQARAiESMYEDUWFxIkIT8EGRocHxMpLSI//aAAwDAQACEQMRAD8A+bI+4aZFvWRXnjSQfFk+2xqaMgP9oW6ttdkyIolHyAWY2VQNSa8WrhgcmXskULkIP0kZGk9+wD30MwY19ckf0/fV3g+XZuYL9RnEQw8dgOxV/mcka1YjknlZF2SvjlzxOx5P6lRvtqncA6pHgHHqk7cpYRDbyyyYxob2GSCPQF++prixE38e3ZV9k+VcORTLyqZCV4CJt2npjbXuqjZ5MeX6bLx1En5XUCzUb3+0k7jQrWWlpADfiFMbIhdMoH0FRXvHbh4y/wCz99RZor64+vXahXh3f2O6kpixfJPXB10ZcV/xC/rNWnJcGbLlOdFjnK2G0US3NwBqdBpVRHyxmOo91W8WVkRY0WHFktHAig+EFbbc6k2vRIh0F9uJpkmjfI84YJ3mUvO9qPm48kEY0jQx2VR1BQxtSK5UgW7A/wDmaYwoM7mOVDg4UniZE7BIwUIGvFmPQANTWvfkPk7lMi8v5xn5WZzNrLIcZXsrNwCpErW9WpqOpPTgQDC6RDtEPJtrW4KkiRhI5/VYiPNkVg0ZZXGoZUNxR8uVecQGPKBXMT4op/DKliOv+L7a13mLybByDlWVzMZ00+141xFdQDGrmzb9v4z2C1YqPLmVw6zsSuo+XejpakNSN+jFwCz4V/FZrg0perfsq9cg7bOSHGjLfpFR+ojvxqWcivkvIosJDu1G0668KB9N02HtNVthjV9ilzvbRnZ/lWzSjb+K5PWTREDMA3yyLdD2pFzv4m9QhlhVSszohHDct7j1ipaenQsfGSsdVjh7stp5JyYsXzFimcKquHjV9wIDOpC+06dtKc8wvMPJ+fZLx4+UZXmeTGyse7eIHYkFWX81jqKzcQilYmFkYrqSLi3srV4fnnzTh464ySxZCqLK8o3uB/NcE9tS1dKUdQzjbJ42mMzbwLrOZVi+XMjc7g85Q8jgbnfMd0WYQf8AHMA2QpU7gWbb0aX+LptWbhaGNduVj5EjHTekhS3+lRROZZPMucZJzOYs8050B32Cj9KqNAPUKr5YngRpG8RVA/WbVXQFsbTa5L8kaV4IEEBy+Zb4S+W2ydkx2d4+Pz12MCei259B13ofiT/9WnVel1y23FiCb9Zua79aLX6eq1dPbk4Fo4rl7oxuKMkpI4jsrkl9GFiRrYgW9lQX6b/jf3V1ePyd3dbvpY2PTFUlc3NgnY+bymPwHWGFDYN4MSxBrfq8JV3dtR8WAmwEbD12+2kZL9O2/pofwX6O+mNr9Q4O3slF3kx4p5poRwjUn+EmuCNsg2kuF/RuJHfS8ey/3UyL9HdekL9D5u6by52bcpnCiPDTtNC/x6buJt6/fRF8X099c+dt/a9K2ttKP8tgX//Z",reloadIE:"/images/current/studios/sml/button_reload_normal.jpg",reloadHover:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAyAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgTWFjaW50b3NoIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjRGQkUwM0RFMjRERjExRTBCNzg5ODM1RUYwQkE2NzdFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjRGQkUwM0RGMjRERjExRTBCNzg5ODM1RUYwQkE2NzdFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEZCRTAzREMyNERGMTFFMEI3ODk4MzVFRjBCQTY3N0UiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NEZCRTAzREQyNERGMTFFMEI3ODk4MzVFRjBCQTY3N0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAIBgYGBgYIBgYIDAgHCAwOCggICg4QDQ0ODQ0QEQwODQ0ODBEPEhMUExIPGBgaGhgYIyIiIiMnJycnJycnJycnAQkICAkKCQsJCQsOCw0LDhEODg4OERMNDQ4NDRMYEQ8PDw8RGBYXFBQUFxYaGhgYGhohISAhIScnJycnJycnJyf/wAARCAA8ADwDASIAAhEBAxEB/8QAlAAAAgIDAQAAAAAAAAAAAAAAAwYCBQABBAcBAAIDAQAAAAAAAAAAAAAAAAEEAgMFABAAAgEDAgIHBQUHBQAAAAAAAQIDABEEEgUhMUFRYSITFAZxgaHRI5GxwTKi8OFCUmKCM3KS8lMVEQACAQMBBwMDBQAAAAAAAAABAhEAEgMhMUFRgSITBGFxofDBMpGx0VIj/9oADAMBAAIRAxEAPwDzZH1DhkW9pFY8aSDvZP22NTRkB/xC3VprcmRFEo+gCzGyqBxJrF1kQDyitkjQyRQfKRkcJ7+4D8aGYMa/HJH6fnTDtPpPP3n60yFIhxKodCL/AK3JXj76v19DbMiaJjiBzz1B3Ps1JG330W8nGmjZDPpFBcGR9UxyOf2rz8Y0N7DJBHYF+dTXFiJv49vdTVuHoBo0M+3aWCX447Bxb+qM8f00rs8mPL5bLx1En8LqBZqkuVXE42u9NhqJxshh1tNTGiIXTKB7CorPHbl4y/7P31Fmivxx+PXahXh1f4PhQ02wZ5VPXZNbGXFf8wv7TV76Y205+YM1sWXMjiJEcEKliwA43tyvS/HtjMeI/Cn+DJn2zaMXbcfLaGJIw7xCJra27zE8ePOq/IdEAXGSWYxv2cgav8fE+ViXACpqfqRXZuu7bvDEgbClw4V7sSNAyqB1BdZqnG+ZliWDe3w2+Zo23QZu7ZaY0Mxd3NhdCo9p48hTqnp70/hacXMlkyMs2DFb8z/Kqcqz8p8fEYfEHY6njzlaYyZ3XpRyANw0Hw1JWL6hylYFS4YcQViYkfdRN5xYPUmG0nhtHukY1pIIWQS267X7/b001b36ZxNu2+fNjnkLx6fB1fwgmxvb81KW3bpkJPfzTMFPAeCX+6uxssHL42K0qdYP8LUkYZwceZpnQXASPYlqS1yDps5IccGW/SKj5iO/OrD1HixxbvO0S6Y5iJlDKUPfFz3eq96qvLdNh9prSux9vuwfxut+YpLt5e72dJutndwmrZpRp/NcnrJpxzVeaJJQISjICCJbHl1GkRzr5m9Xu1Z+DPt/l87Igglh7q+KgJZRyOoUnmwk2OJ6TqACdvtTvjZwpdDHWNJNv4+pps9Fzxw7oqShQXBVSGB4kcPlRN6wN9xt4bIxFmJLFo5IjcEMeykyF4Rka8KeF2XjdCQPhTZjet95ghEJWOYqLBmOo/bfjS2fC4yXrBkQQ2n7mqnDMxZRPt1fIru35fUMOzKc7KuJ7A4wAMoI48Tbo6eNKW3qQdM0WYWPDXC5W39oU3+2i7pmbnvc3i5Kux5Cz2AHUByFRiwZMCB8zI8eKKNSzN4hA4dpqzDGLFaSpZjsUXcqsw4m2tIA1Jkr9qXvUCywbi0QnkybKDqyU8N1uSdGnXJwHXeq3xJ/+rh1XqGRuUmTky5L6mMjXGsljbkASeyh+dFr9PVatTsv2wlqzbGzSY4Uh307t9zW3cTMT/bbRklJHMe6sLFWWQKrlTfS4up7CKGvlv8Ajf8ACtrz+jq+FvjUhZuoNfHVTVgeo8OeDyk0GLgk2DmKFYVe38zRAav7qK0OFIfpGCROd9YA/VSbJfp037aH3L9HxpR0xliVyZV4gByKYR8oUA40YbjKim6Sfa8O5kWNnHJI3uf01V5mbLuVou9HjDlDrZge06jVVHov8q6Rfo+F65Fxhxa7s+4uG+Jo5GynGbkVU32kH9amcKI8uHvNC/8APTVzNvb+NEXxe341r62n9r0xGbiaX/y4Cv/Z",reloadHoverIE:"/images/current/studios/sml/button_reload_hover.jpg",reloadActive:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAyAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgTWFjaW50b3NoIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkY4QzcwNEYzMjUxOTExRTBCNzg5ODM1RUYwQkE2NzdFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkY4QzcwNEY0MjUxOTExRTBCNzg5ODM1RUYwQkE2NzdFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NEZCRTAzRTAyNERGMTFFMEI3ODk4MzVFRjBCQTY3N0UiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RjhDNzA0RjIyNTE5MTFFMEI3ODk4MzVFRjBCQTY3N0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAIBgYGBgYIBgYIDAgHCAwOCggICg4QDQ0ODQ0QEQwODQ0ODBEPEhMUExIPGBgaGhgYIyIiIiMnJycnJycnJycnAQkICAkKCQsJCQsOCw0LDhEODg4OERMNDQ4NDRMYEQ8PDw8RGBYXFBQUFxYaGhgYGhohISAhIScnJycnJycnJyf/wAARCAA8ADwDASIAAhEBAxEB/8QAkgAAAgIDAQAAAAAAAAAAAAAAAwQFBgABAgcBAQEAAwEAAAAAAAAAAAAAAAMCAQQFABAAAgEDAQQGBgYLAAAAAAAAAQIDABEEEiExUQVBYYGhExRxkcHRIgbwMlJiIzOx4UJygpKisvJTFREAAQQBAgQFBQAAAAAAAAAAAQARAgMSITFBUYETYXEiQgSRsdEyI//aAAwDAQACEQMRAD8A82R9Q2ZFvSRWPGkg+LJ9djXaMgP5Qtw01k+XBjRl3hA4C1q4wdxiC55MuyRoSSGQvKRkbJ79gHtoZgxr7ckf0++o3Izpck/CNC9Cp76X8uXux3nf8NbYqk3qmx5M61ZWgn0xcc9lNDGhvYZII6gvvrtcWIm/j27KhEaWAgruHAeypXF5jHPaOSFdfQQAL1NkJxDgmQ8NFVc4ksQIlNjRELplA9RUVnjtu8Zf5P11yzRX24+3jahXh1fkd1a+m7F+i2NdnWxlxX+sL+k1F5cwysjTpLxpsVQdhPGpGPljMdo9lR0EIGRIjA3WRhu4E09PaBMolzEIrTZICMgwJTcONCUucXT94Fr97VZMT5F51l46zrjpjo4vGk8pWQj90A27a5+V8bFk51gJOt0Mo2MDYkbV39dN/MHNpYvmHIbmKiTy0p8PGlLqmhfqW0kbDv66G2+w2YV745Es/QBwrFUQANNlCcx+WM/lsJnzsRokEngi7glmsW1JbethvqvSRmF9aKylTcE7dtehfM3PeY855Ti+d5WcWBpBLBkFyFkAVlsoIB6b1SMuFSpKvED9klr+sjT30vxbLJxexgXIIBcfdFbCIDj6p6HMEkSvqIJG1b9NZ5iO++kcKO+Kh2bS23+I0z5bpsPWant19zFz+zJO5Z28m9rqX8UHe1yeJNQedG2PnGVTpjn+JSDYX/aHrqSZtRuTel5YUnQxSH4TtBuLqeIofjtCTnYhiE17ziw3BcLMbInV1eKVg6m6lXFwRVvHzkZUiPNOUQ52TELLkMACbfaGlqpLJkYSbcaN4jsGQoLHt1FtJ7KGMxBsBPYxFLZRCxiwl4j8hDG0DSbgjmrDzrnnMecT+PO5jjQaYsdEGhB1XqsZkkjHRfUzGwGkXovmJ5zogEjt1MSKxQ0Da5CZZ+jbsTt40tVYgGAAbYKLLBIMH80aMyxRpCApCAAnr6e+ieJP/q2cL0uMkr0E1vzotfp4WqcJZg4jd3Wcxi2XBmRklJG8dlFWQ/TZ+ill8t/jf2V0m/8AB1d1u+jPbTf04hOxysn1GKnitEDo+11jJ4vGhP8AbSY8b7l/vV0NXTa3bQyEH0OqoktqAnWZ2XRqsv2Vso9S2oLQRMbEChfFf3Vo6+nuvWQJe2R6Arzx4gLbYcTbtnaaF/z01bzb0+2iL4vX31r8bT9L1TWtuVL1cg6//9k=",reloadActiveIE:"/images/current/studios/sml/button_reload_active.jpg",transparent:"R0lGODdhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw==",transparentIE:"/images/spacer.gif",vote:"iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExQUZGRDk5Q0I0MjlFNENDQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpERkNCQTBEQjI1QTkxMUUwOEFGMkM3RDFFRUZFQUM4MCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpERkNCQTBEQTI1QTkxMUUwOEFGMkM3RDFFRUZFQUM4MCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkY5N0YxMTc0MDcyMDY4MTFBRkZEOTlDQjQyOUU0Q0NCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkY3N0YxMTc0MDcyMDY4MTFBRkZEOTlDQjQyOUU0Q0NCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+2/rLmAAABhdJREFUeNrsmwtMU2cUx6Fv5DEEfDGmIAgsPAwbjMEYcwQHi7gRsoVsMs1UHErmJChsBmTDzbGpoNnGYIBbCSAYNGTGsGglNSBu4WFkLISHysJ4TSyP8iq9Lesh3uXatbXAbbll55805+u9N733/r5zzznf992am5mZbTdDGVwsRICgETQKQSNoBI1C0AgahaARNIJGIWgEjULQCBpBoxA0gl5yHT1//S1hl6yy+J7859ym/lORe5JcmXy9bNXHw9Qgx6Z+6Rv85jtJw4N9t4cH+lrtn17/gk/o1ki354Im66tK25l4zRxT9Ga5bJoAeyjYORPsqmecCzc9H2yXkC3M25F2uqf08+RmDB00aFI6JnsEWAD2QU/3dGdTvWRibOR+xO6Dn2KMNrBqSvIKwPqFbXNA0AYSeHXrzeu90A6LSwhC0AbU0F/dU2A3b4mMR9A0aIW1DZ/04scyO5dn3tPWcgVjNE2yXb3uKU3bCfnMbHtTfTM1USLoRcjRzXODtn1jQ39L0aNpkrv/S+9KBnobNZZ+oxIZgqZBZEgQpiXmato/PjqMoOnQ6RudFwa6u8S3a64MadpvY7/GgkyMCHqBiss44w/25K7Xc7V5upOH11oyMSLoBejZoC0rX9uVeOyq8LtM9bKOWt6p4negptIPQeupT0qvCcGWfHaoUdsx4MVrnd22zExPSZh2/SYxe6fyZBewqeFesdoSJHizla09D77/Xisqx2S4gCpDFZvPln2RktR/r2NKlze7+r04N5nUUF3ZgqAXUGWA/aUo566ucg/kE7rVGyxMmWLomIf2nfrxZbA5e6N363O8Z2BoDLVzFqJZpXIGrDmLxau7VHLyh8Pv1y5r0OCpITFxRy7nZh3VVjOrVxffHohNdg8IcWSx2RpraKVCMQv7SEvdZm23yobHF3CVSoWSkMsV1nb2NnB+DpfLzv0oTrzY+4GTMfLvb7DoOikd7UnY7JBozM6FpArxHjow61rrQUdXj/CdG7lvLMsYvTPzmwCw6VH+ycY+NznQWbfR3eLXyxVX1fPAkoaOjIt1O1z9AmN1HTM+PNSRER2U9qSBRHhcwgbVJ726MCd9KQcdAPxh359SuobztIB+EmSQ1UoHd32TFISM8ydS7hi9MngUNsi2giDm2rZrHAW6SkvGJUPw0jHJ0CSXx2erbkLJ5nD+E7q4PB5HXFHUtRTJlwoZwIbEvDf3Us7IYN80IzxaXy2Fl+ojiMcAmQwR0IY8ASEMQt5ivdnoyZBpy0vqCZCUg5OzBUCGdsGRvVn/q0klY0InQ0Xf3XaRrhoeQc9TZHVDejZYGCFCDW2Scx1MW/XQWfmMj/XS+XssYz+WTB3uqzuCpY2ti4KQS9GjaQKsnqAhjDht8rKCdmudqAw9mqaOp3Y+XN/bh497JxVWnYPvNSX5v5kkaCZWGNT6Gez2Ax+fgDYsNNBVcWDVoTbsJu0dcXW+toUGBL0Ir6aGD6VCMc23sLSg+zzo0RSPngPCZgumJqQTtJ9nKQYGTKg2qF5MtmGWDuzIYL/EpD2aCXMdVMhkMiQ/UQkpobC9vaG2x6Q9GiZr1B9V6uNLtXTMmOkbNjwDQ+3jvy76HrZ1Nt8qr68q6zNp0ORfH7Rle6oFzzNUqFHvaBffAEewBSl79tdWFvcapFONCTou48yrEP8UCkLJZnNYYAUrrATEjIwgCDnB4XD/vR7Z5ISspiy/jU7Ppg61qU/Qek+fuQl+Q0E2Omi/sG3753O8zysRorMfxBRoGlGqhyBq3NUUkjSVdKSFF9s7Gm+WGTRM0fEj91saL7n4+sfoOkbloQPZ8dGpMNcL2Z2QyZQcPv+xZAzbxkcezgAA8p+wX4n+CIclMHF5YYemx19TCKKCV18HpFqY09iX/dPcBP+NC+dqDQmatvc6YDlI282S70ks5DdVoCsM/aSJSvKOFx/7sMEkQBtSARHRqwOjYr35ljBiM2fBi1uLrmvZHM7og0FJ7UVha9st8bCh78EkQC8H4VIWgkbQKASNoBE0IkDQCBqFoBE0gkYhaASNQtAIGkGjEDSCRiFoBI2gUQgaQaMQNDP1jwADAA7U7Ir4mrHhAAAAAElFTkSuQmCC",voteIE:"/images/current/studios/sml/vote.png",buttonAdd:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6RkE3RjExNzQwNzIwNjgxMTkwNzhBQTZDNkIxNjM4RTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTJEMDA4NUUyNjhBMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTJEMDA4NUQyNjhBMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIADAAfgMBIgACEQEDEQH/xACbAAACAwEBAAAAAAAAAAAAAAAEBQACBgEDAQEBAQADAAAAAAAAAAAAAAAAAQIDBAUQAAIBAgMEBQoDBAsBAAAAAAECAwAREgQFITFRE0FhIhQVcYGRoTJCUpLSBmIzc/CCQ4Ox0eFyosIjk6OzwyURAAECAwUHAwUAAAAAAAAAAAEAAhEhUTGRAxMU8EFhcRJSYoGhIrHR4UKS/9oADAMBAAIRAxEAPwDGSTTgEixIGwAHbVlyOuyKGsqg7QCpvRmQeKPNLI4DcsFlDbsQ3XFNxrmeP8SHq/04x/krzjiAWNHqIr0xgud+5Hqs74drvFflNTw7XT0p8prR+M6gdqtCfJHH9FTxvN7nWNhwCIPWoU1M7xb/ACFdMe83lZvw7XD0r8prnhut33r6DWl8XU+1lRf8Lyj/ANTXH1ef+CgiHAKH9cuM0zz2i5NN5m9Z3w7XfiX0GoNM11veX0GtENVz3Sf+OL6Kt4vnRvIA/Si+imoNBcmm8jes2dI1w7yvDcap4RrNiTg2X3g9FajxfOH3x/tRfRU8WzoHtKf5Uf0U1LqC5NL5G9ZcaPrB+Db1NxtU8I1gC9k9BrUjV82PeF/0U+iq+MZse+B/Jj+irqXU9k0g7vdZkaTrXwp8p6anhms7CFj3X9k/11pjrOcvsZSP0Yh/SlRdbnvaVFcf3FX/AKwtTUOoLk03kb1mHy+qZcq0yK0bEXKgiwPTtq19vRWo8TidSjwIYn2SIQ7XHUXZivmrN4I+9cvby+Zhv72G9vTWhi9QJhAtnYocEtIHVEOlyVsucExIIPZO8X6RRRl48s+UWNA5QyLOSex2Tt84owyt8QJ8grD2wNVvDfFtJplltIzOZ06TUEeBUjV3ERUlnSLDzGD4rbL8K9l+3s03IEc+XM+ah58MHLZcQtiw8zGRfrtR+R1XRIYtPy80rFY4JUnK/lhp+1IjjDiNiNmHZVk1TTYptOzfeo3GRypjkjUOHaTAFAQYcNt/TXWL8SJgDvh8ecAkXcUth0DNTx5Z0ngEmdV3ghZHF8AuVLh9mz8NCZLJy5+R4YcEciRtIqOCxcqL4Fs4sadZPVdORNJnedB3CObnR2cyYpFCqqdnD5btSPS80INTy87ARokql3B3IT2v8NaaXkOjuslxP4VBM5maMGhZoDE88UaLlxmZmKMxiDezGV5gxOfKKsft/NdtjLE8UeWGbWTAw5kZBOHDjOBtnE0QNTinzOswuyhc8D3eZ7hSYyeWrWBIBB4USNVynLOQxpcad3YS9rlmbDbDfDiw9dqyX4mwT5cUsTQMwxBM0ManKjOljG5wofd/MFyONeGe0+TJCJpCJ4541milhxKCrcVZjb004GqZOGUqHRjDpndlaxKPMPcFxtHlpXrs+WzZyc8JLS93RJ0W6qrqNwXYBv6KrHPLgDZyQdQMZqS/b+ZjaaMzr3jLw94mywV+ym8gTcyzMoO7CPLVpftzNI2dUzq/hyLJIQGHMV1MnY7ezCAeNMMxqGUObz2piQFc5k+THAMXMEjBVKkWwi2Hfer+KaU8eSSSRgJohHnzZrrhgeEdHGQ7qmZiQHLt32kfVSDuKXN9sZtIJ8wcwjjKxrLLEEcNZlxlQxc7QvVQ2eyB01oop2MzTRrMpjDKArXGE3LbdlPJdeyP/wBGXHi508Jjjsw5kcZRW6OlRS37mzmn5rOwtlJS8UcCx3GIeyz7NoHQarH4hcA4GHLgFWxB+6Xq0HwSeulAlHfSLHDzrWvttjpkpTocnzml4MfeCLj83z+1XYZIOkTJTEMSyYEHLss0eMYSlzxqX/FEP28tebMW2WFeZy54euuUNAEDJcJcbbV7l1PTGfP/AG13EvGLzmhu7H4dvWahyp6bCr0iqnUaIkMDvEPmY1a8fwp+61Cd3XiPVU7uPiA9FOkVTMNEYGW+wD5qhlU7+j8VBGGMbMfornKTiT5jU6BU3JmmgvRpkT9mqY7793U1AmOPr9BquBBtufXWsvncpmmgvTIzYdgJ8mKoMzYb38zClZROBNcwJfcRTJGwTPNPdNRmJDuaU+UraujNsuzGw4hwDSrAnXVhElummS3YK57tnJmc61vaU/uChQgxma5vix9W++6hhEgN7E16dm1rNQYYEhGdstyhxSYE7pia/9k=",buttonAddIE:"/images/current/studios/sml/button_add.jpg",buttonAddHover:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6RkE3RjExNzQwNzIwNjgxMTkwNzhBQTZDNkIxNjM4RTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0Y4QTBBODcyNkJDMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0Y4QTBBODYyNkJDMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIADAAfgMBIgACEQEDEQH/xACaAAACAwEBAAAAAAAAAAAAAAAFBgACBAEDAQEBAQEBAAAAAAAAAAAAAAABAAIDBRAAAgECAwMIBwYEBwAAAAAAAQIDABESBAUhMRNBUWFxkSIUFYGhMkJSktLRYjNzgwbhwiOT8LGCokOzJREAAQIBCQcDBQEAAAAAAAAAAQACESExoRJSYgMTFEFRYZEiogRxgdHwseGSU2P/2gAMAwEAAhEDEQA/AEySacAkWJA2AA7asuR12RQ1lUHaAVN6JaKuX8wDzAMIlLqreyWFguLtvTA+uSg7PD9H9JB/JXlv8hrTVDImeaK9ZviveK1eAmngk7y7XedflNTy7XTyp8pptOt5k7VEB6o4/oqeeS+9FE3QEQetQpo1P+Y/UK0bv6dxSj5drh5V+U1zy3W7717DTh51CfayaX+6XH85qr6wf+KFIxzBFb1yYjTqjYHsFaM2z7lKfl2u/EvYag0zXW95ew02DV5+VV/tx/RVvOJhvVR+lF9FGqNigK0Zt9xSidI1w7yvNuNU8o1mxJwbL7weSnLziU/D/ai+mp5vMORD+jH9FOsdZoVor9J+EmjR9YPwbehue1TyjWAL2TsNOQ1iQe6l/wAlPornnMg+AfoR/RVrHWaEaK+OZ+EnjSda+FPlPLU8s1nYQse6/sn7acDrct9gQj8mIf5pXV1w3tLDG4/LUf8AWFq1brFCdGbdJ+Emvl9Uy5VpkVo2IuVBFgeXbVr7eSnmPUMlOpiky0ZikFnXCxJB5iSSvopO4EXmXhrtwePwsXvYceG/XalnkB4casHMEZp1l3juYQCYh5gCvbTG4eacgj8M7xflWtE05vt4Z6xY1h0oyLmnJ7n9M7fStappGv7QJ6hWHshib5AuuG+OENkpW/L6Vmszp8moI8CpGruIipLOkWHiMHxW2X5q9l/b+bbgCPMZczZqHjwwcNlxC2LDxMZF+m1bsjqmiQxafl5pWKxwSpOVtww0/ekRxhxGxGzDsqyappsU2nZvxMbjI5UxyRqHDtJgCgIMOG2/lrgX4kTAb4dPrALMXcUOh0HNTx5Z0ngEmdV3ghZHBOAXKlw+zZ92smSyk2fkeGHBHIkbSKjgsXKi+BcLixo1k9U09E0mZ50HgI5uNHZzJikUKqp3cPXdqB6XmeBqeXnIEaJKpdwdyE97/bW2l5Do7JpOJ/CgXSylaxoebAxPPFGi5cZmVijMYlb2YyvEGJz1rVjoOb77GWJ4o8sM2smBhxIyCcOHGcDbOc1oGpRz5nWYXZQueB8PM9wpMd+GrWBIBB5q1DVMrwzkcaXGneGEve4Zmw2w3w4sPTasF+J9BXVxQxNBzLEEzwxqcqM6WMbnCh938QXI568M9kJckImkInjnjWaKWHEoKtzqzG3bRgapk4ZSodWMOmeGVrEo8w9wXG0ddC9dmy2bOTnhu0vh0SdFuqq6jcF2Ab+StMc8uAM3okVoxlUl0HNRtNGZ18Rl4fETZYK/dTeQJuJZmUHdhHXVpf29m0bOq06v5ciySEBhxFdTJ3O/swgHnohmM/lDm89qQkBXOZPgxwDFxBIwVSpFsOzDvvV/NNLePJJJIwE0Qjz5s11wwPCOTnkO6jMxICTZZ2zkfdHVxQ5v21m0gmzBzCOMrGsssQRw1mXGVDFztC9FZ89km014op2MzTRrMpjDKArXGE3LbdlGpddyP/oy4sXGnhMcdmHEjjKK3JyqKHfuXN5DNZ2FspKXijgWO4xD2WfZtA5DUx2IXAOBh6cAltYGfmvDKyw3Hck9dBBMPODsOHxW6+23Eoplil9jm3WaGAx+ZEXF/Een8Su2EADiSRi1OMScuWZy7FmIVntiQYgQL7r17yRj4ou0fbQ9mLbLCvM5c83rrrlCM8KVxzTCEA6hbig54j6f410Rrzxek/xof4Y/Dt6TUOVPLYVqpeoRmXaUREYO8Q+hqtwo/hT/AEtQzw6849VTw4+IDsoy79CM25SimBb7APmqEA77bPvUKMMY2Y+yucJOcn0GrKvHkrPujmipVP8AD1MF99rdD0JMcfT2Gq4EG259dayTvPJWfdHNGj3dgJ6g9QSEDe/oYUDKJzE1zAl9xFWn40I1N3uR0NK3smU9ZW1dErrsxsOcOAaBYE6asIkty1afj2p1J3dyYUzZRcRddm32R9tCgE8Uc1c/i8To9rFurGIkBvYmvTu2tZqm4FWMCeqQybEOx61WIHSYiVf/2Q==",buttonAddHoverIE:"/images/current/studios/sml/button_add_hover.jpg",buttonAddActive:"/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAoAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6RkE3RjExNzQwNzIwNjgxMTkwNzhBQTZDNkIxNjM4RTQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0Y4QTBBOEIyNkJDMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0Y4QTBBOEEyNkJDMTFFMDk4MUNFQkJFREVCRjk0QkEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGQTdGMTE3NDA3MjA2ODExOTA3OEFBNkM2QjE2MzhFNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/uAA5BZG9iZQBkwAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgXEhQUFBQSFxcbHB4cGxckJCcnJCQ1MzMzNTs7Ozs7Ozs7OzsBDQsLDQ4NEA4OEBQODw4UFBARERAUHRQUFRQUHSUaFxcXFxolICMeHh4jICgoJSUoKDIyMDIyOzs7Ozs7Ozs7O//AABEIADAAfgMBIgACEQEDEQH/xACQAAABBQEAAAAAAAAAAAAAAAABAAMEBQYCAQEBAQEBAAAAAAAAAAAAAAABAAIDBBAAAgAEAgYHBQcFAQAAAAAAAQIAEQMEEhMhMUEiFAVRYYGRUpLSceEyQoKhsWJyouJTwdEjJBUGEQABAwEHAwMFAAAAAAAAAAABABECIfAxQVESAxORoVJhcYHR8SJCBP/aAAwDAQACEQMRAD8Axda4q06bPo3QTqOyIA5jfNrIHUFn/WLC8A4Wr+Rvuhi1t0ZQSG7I8cDDSSYi/Fe6cZ6gBI3KPx18PmHl98Ljr0/OPL74trblda7qZVqjVagGIruroBAnNiBtgjk104dkpaKT5dXEyLhecsO8Rti5NrKI6LJ25+clUcZfeNfLAN1ejTjB9g98XX/BvSGbh8IR8p8bIhFTw7zDp1jRDacqq1K/CpT/ANmZXJbCpmNYmxls6YeXbwEeyuOXkVVcbfeId3vhcXfH5/0++LdOUXbrTdLcstUMyGajdQydmmwwgdJgjk12xIyJYKecxmhGUPnDBiD2aYuXbyirRLyKpjc3p1tPs98DPutsvL+6LsckvpTFESyxWmWQDLb4W0ttjityytQfLr0xTqSBCGTFgdRXASDPqi5oYN8K4pH9iqfOuuruPqhCvdDo8v7ouhyTmJfBwwxYhTljQyc6QrYXOE+2AOSX7KjrbjDVfLpmY0vtX4uow88M49QjjPkVT8TdDw+X90Hibo6dzyn+8XK/+f5mxpgWwnWmKW8kmK/FpxffDHAL0oDtE4OaHofaqRtSN0iq6nfXIqorhSrMFMhI6dHTFhPTsiJd24puhBB311fmES9MUjGkgExEvyiTXBc3igWtXSDuN90CzlgG7LrBlDV0KvD1d2QwtPuji1clQQCR1GMiDQNXqnW87motNyl6FKzvK71cmoctKZnibQ2N5LMdAibzBaL0r+nbVEbOr0qtMZiieIb5BYjUxM4yhdhpkZ+2EGbobvEcTsky1Pan0W3HqtdzOvQvaFdbaqpY3qETdV0LSSmW3yN0GKvml/TbnVS7tmMldSjAaCUCifeIpsZ8L94joOR8zj2yijsiOL0a3RIktVcX1u/NL+lTqIVNm9G2wlcJZlDyVtUyxMC3uqCWS2jMBciyrgiazxVGBSnOcsWjVOMvnsNAdu6Cbhj8xB9kZ4KAPc3ZThaerc2y0alN3Vmp8vpUnTFLfBM1DIdYnsMRL26orzaxr5qm3C0HwABspVOlJzJ0SnFCa58Z7hBz3J+IjsEI2WxU4Wmp3VO0qcxrVGTDWuqT0MJU41WrmkjCTow7Ymrc2NO5dM9Gp2s7qmoIKl3NwWVZbf8AIIxpuSNZB9qwuJWWkrPrWA/zk43/AGU8c1r+W3lvOwpVqyBadJqomQJVBjSR6Jq5jLum80sOs7IjcSDpJT82Eyg8RTl8KHrBIjUdoxJOaQY5qNf6CpkNDrqH4hHWcZavthm7rI1SmAAJuu2fzCJWKnLWsdzSIDOS643zJe5k+1ejtK9Y1ziI1GxHwUh9LVfXDwqtsAgln6PtjEQYUc9VuTSqWPwo+Ta/wnzVPXAybfZRJ+up64kb3hE+smEQ23CI1rOfdZMI5Doo+RT2UO96nrhZNP8Ah/XU9cSPqX7IRJn8agdkImc+5RpjYBRxQT+MD66vrgG2HgA+qr64kFlBlj7oGYNeJj2GHXK1VaYJjhPwjzVPXC4T8P6qnrh1qq7Cw7DHOaBpxMe+HVuWCG27FN8KPCfM/rhcMs9R8z+uOjUX8RjnGs9REaedgskQy7o5A6/NU9cDhl2qfM/rjrMXpaOgyy1tA88+yWhYoLaUgQwSTDUxLGXmYw5wyS1nvhvEuwMYWJehoDrOJ6JAgMAv/9k=",buttonAddActiveIE:"/images/current/studios/sml/button_add_active.jpg",questionMark:"iVBORw0KGgoAAAANSUhEUgAAAMgAAAEOCAYAAADMnliDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTQ4ODlDNUYzQkMxMTFFMEFFMDVDRkNFMzk4NjM5NDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTQ4ODlDNjAzQkMxMTFFMEFFMDVDRkNFMzk4NjM5NDkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFNDg4OUM1RDNCQzExMUUwQUUwNUNGQ0UzOTg2Mzk0OSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFNDg4OUM1RTNCQzExMUUwQUUwNUNGQ0UzOTg2Mzk0OSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqWnTc0AAD87SURBVHja7J0HeFTV1obP9N7TewIk1ICGIiJFQaqCUr1chSuCgigINkR/BdtVbCBSRCxgQ0WQqlIURZDee0nvbTIl08u/15l9kkMMXiCokKzvYT+TzJxMQrLfs9a3dhMEg0EGhULVLzET2NrQ9xBcxrVII+ralrB3HUCuHAoRvB3vUXARcACKAGl+2gK0oVDXQQS5cjikpMlpk9Ln+FAIeXB4aHPSRy9CgmqsgAAIMtJUpGlJ05Gm5EHCQSGkjz7SXKTZSLOQZqfXeDHlQjU2QAT0axQUjAjSIgvySqUOh1scHx+hlStlLCR+ry+Qk1NiDQSCvqSkqKBYKq6gANWkWwJRH/+fGhYsIKAuRQ330Re3JFdwvYRGDyNp8dt/OSy7pdf07DbtJ5ya+dyHWRazLT7oD7Sd++7qomZpY0+2Th9/7vU3vrI5q12x5PpwGnVkV/C9Uai/XYKgf8vlRhzo4JGkJeRmF0clNrv3GP+CwXfcpHvrjYl9CRgr09LipS6XJ3juXIHn7TcnRk+bNhz8SjZpBaSZSXOTKBLECIK6ZiLIFVSxBLzGGXOIIJofN+8HT8Fs//ntXunpKTd8/+Pen+4Z/crhuLjwX86d+mR0ZKQh2ev1O1u1e2De8s+2VE6eNLilVC7VUT/ioYByKVeAwILGHXVNSXgJr4spFGrqOww0vdJbrQ72Fk88RrxWr47t2yejx4L5j7ZYuHhd6dcrf/1dKpUohUKBxOl0B8VikYAIvjaMehdIt0wAGvU0EgILpl2o6wYQQR04TDS1iqaP4bfc3CYOLjxw8MyJM6dyd97Y+eHF3bq2bv7KS/cnPfn0ksyioorT78xb9WVFhdX/7DOjUyUyiYnCAe8RQ1oUBUZDvw9AIsA/C+p68CBiaqbVvKhhoh0a7v4RxIyHHzly/qzH4/P16vME+0bZ5z570GTSxpaWVuVs+H73zvEPvn1y3jsPN3908l0jBCJhGXgPYuQLSOplDYvQw7hIJWkl9BFSLydX3UIPgrqWPYiQ3tW1FIa4zZv3eXfvPV3apk2St3/fjs2UakUESa8EHW96ZJHD4Q7+tGlON4NBEycUixR79p48BHBMmzo0atSInr1IZ5cHvD79m2+v3DRj5tJc+AYznronbMZTo2J0Bg2Q4CPfkny/oI1A673q/3HU9a4gUzvGxjVuZgb32lWX+BLSK3a8Y/6C76xTpy0soq8X9+zeLnftdy9N2Przoe1QpVqzalbG/oPniha9v/6t2S+M6Tlk6Kz9ffvcqH76yVF3tM+Y+MmYe/tEPD5t+MA9e05aBvTrpKmssvtem7OiXKtVCp95ZrQpFD0EeoYdTAx6GBxERF0IBweFj6mdmQHNzYQGnbmpTFe139SXYglo9FDRVCrOWmVPiE8efSoiwiD+6vOZt+YXlJUDAFDSfXHW2JttNqezW7e2/TZs3LXqzrue3zv0rm6655+79+ZmzWJbqzWKqM8+37r8vrGvHX3y8RExz8389yiNRhlRXe0qi028Z25qarx012/zUkUScR7DSG8g/0c7+T+6IMEK/UKCAd4vCdW0AeHggJkZ1UxoVoaNfuyksPh4UeWqplhCXtVKQr0HO5XE6XQrrFZH4NWXH0i4sWPa7aQxv2+fp+/aferWgqLKbVt/fH0C8ReS/v0637Hy6+d9w0e+eDAqyrj/jdcfTIc37nd7xs0ffvC4/4EJb50IBIIrXnt1/EMSiUgpkYgFRr1KLBAIwNd4li9fb8nOLjYXFlY4iLH3FBZVuIuKzd7y8iofgRBLwE1cSqVMcO/o3vq4uHBJl05pke3apURHx4YBIDBLA8bVrKQ5KES+q3FTFc16YQwHh4S5sJwbRqtVkWKRKGLpR9/nFBVVOO4b3bvT19/88qVBr1b16JGuXLhobWFSUrSldcv42AkPvbOIRI/0QQM76x57fPGZXj3S/YUF5Zkdb5q86o3XJtzWtm2y/5lnP8x+eOKdzdas27n5yxU/l7791sQ2LVslJsIPYa6wGhRKhUivV0lVKrlQIhaRcBYMerz+IPE4Ab8fGWnK8nr9zP4DZ10/bztc/dkXWy1vvbOyiqQ7qoS4sAiDUauoJx27fEAEKX9IsQQ8OKDcqqeAGCkgbFl27dodR0iHlZJOGoA0avy4AeEL35syeffuk9sSEiLi5r67ass781YV79k5//ZOXVr1y88tPXz+fGFOrz5P/NqyZYJs7+/vPULuAPr8/LJTG77fs/fhR949M3PGv2JnvzB2rFgqtjKBoLmkpDLH7fZWxcdHeElEgrtCEb07WNkQKuztw27SdAUDaUxozExKsxsDlwXNn/dI1COP3AUfk1SdKQ15WTYVu7xIUifFEjIXzq+Cbxgd9AeSThzLMuz+/UTQ7XTDc6bBg7sNNxm1aoCjc+eWynfemjRWIpOowXt88OH32wAOkka1zshI7cW+sVAgvH3AjO1gwjeufXkIiQgmqG7t3X/mBMBBDHv0yOE92vv9fqGz2qWc8th7m6PiRv0GU1f+M25OcVFBOcAZRX8RUubyFmahGqMRCclBWhVpUAmFaU7FEC0enfpe8Wuvfekl/TWJ3tQ1tN80aPCZW+jEeY6wapsj9qkZH1S0aT/hxE23TDl897BZG+1Wh5C0yi7dpmw1mbSiJQun3vrDpn1byHNFO3Yc2/Tyq5/nf/D+9Jbt2iTFTX9i8bskVcp85b9ffO/1+oI7fpk7iFx7aMpjC+YV5pcde2jS3COPPDwk8onpIwZ06Dhp44svf/Zxaak5f92G3eYuXVopINos/2yL5f0PNpTRKKa6Gv9RVKMExk8azOs7AxkYSd9L3p77LZj1eNp3lDTCXPHNFVIsCRc5SEtetuxH5j/j3si7Y2AXbVpavIrkeUVQrVowf8rgt+eu3Pzo5LtuhS9MSR3zJVwz6/kxN2XnlpTdPaTb8K1bD6zvO/CZ32/r1V5NUqdOer1a3TY9pefaNb99CVWv+/7dx/j4tGFd09IS0uUKqWH5p5uXjb1/znGobj02ZejtxNinWizVBZGxIxclJkaKz55elka+1VnS4G5RTsKfC7sF6g8KbGUEoj5wE20JN/tFC6ZGTZx4J/SVLLbfhIz7paXn9VSxBLzqlXTPnlMwos18umzGWL1Rk0hM9/puPadtIx131YovnrsnKsbUCl5f992L5yDdIh/u+uKzmeNJ+iTr0yfjzqVLplfBAKFe/+0B8h4PwrUD+ncZRK7xjL731aMajWLv229ObE8SSuGgAZ27z3vnYffUaQvPFReb15GP7/H5/Ox/JCrSIGb+wgEgVCOLJv4tHgLJefJh2qTJ84r79rkxOaV5LPgQKAFD+feKxkiEdZ1/TEwYkMhkZhaeLSsxn46ONkURGDr9sv1o9YA7n/3c5/E5iAE/FB8XHrbii2c7rN+420o6/lKXw1353sI1H6vVCil4kVXf7bCs+HrbBpJuZd0z+uV5HdJTktesnt0RJjKeOpV7cO/uk5tIFFrSv2/H9pCeffr5lkpjxNCFETEjlkBqNu2xYTGU/Ms3WqimCgnAANOWmC+/2gZjJCZein5FaRakWGJatQJDnHDyeHZ46/Txx/kXVZWvnrJj57Hft2w9mPfwxMG3EG+yGiYgehzfP7/1pwObyF0/UFpmscM4B6Rdq7+dPZ1AsE+hkCqJId+4acsB+9GDS+4g6Vav4sKKk3l5pbmdb350c8/u7VQb17/6sEIh065ctX0lIZ9dW0LSs6gJDwzQS+VSSK0KaJi0YRULdbEUq6ZDi/pAf25Lmqgwd0VydGwYpOj5tKr1v/tPPSkWtz4ciKts1SZJvWfn/BavzVlRlJld4p39wn1pEBUGDuo6sm2b5ENDhs36FuA4ffyjoRKZRNt/QJfhWzbtWwVw/GdMX9O7cydD2VbdunViZ2LYFwAcJNVqR/xMBvt/IerT/+mtHTo0l7+/6LG+AoEgAJMYR4zomU6iidHvD5hJamejvqOUCY2UujGCoC4xivgIJGATwo8ezQwQQLhqluiSfUidFAs6nocCAnfq3E5dWlm++vL/Yn/fPu+GwYO7JYskYrOz2pU74aG31xw6dM6189e5t+XmlpbYrY7iwvyy47cPmLET5l098/Q9PUmqtA6qWz9u2rth3vzVJQvfm5IaG23UDh85e25FWdX5Tz/f+jOMyn/1+cyB6zbsPvzY9IXLAj4/jHUUanSqMgJHATVXMAZipjkkN30AhboUwbgZs3vvaSetZF3xEm8OEOiAThqGIIfLI1EgR66UFdKOWvHRJz9ugGhAoOmdnBydTKDYMW78m0uJea+AKtRny58ZTe7+/smPzj879v7Xl0ZFGo1ffv5s+kMTBt2n1apUa9fvsvxn3BufD7v7lo455z/7d2rLhK5ut9e/ZOnGcpJyZdJoUUhTqqKatIqbXyPsjREEdamCmyqzafN+6D/sYrwrBYRLsfw0inCwOGiD5wVet1fyyfJNhTAXJiMjtTsMEIJxhyqWUCjYvmTxtDFavTo+PNKQ+s1Xz+eMGPXiIZVKsXvxwqlQ3VJkdErr++03L1QMGzF7f0JCxK9vvTHxAXjflJRoLYu71WGh0QIgKaN3AC5q+BEO1GWKTaWOHM100/RK3JAIwvAgcdNUq4oJLWCCu3gFgcAsl0kEMBcmP7/sJEmrjqa2iIuH9Omrb34xEyA+9Hl89pysogMtmkXHLvv4qTZQlZr53EeQPjkXLVq7JDE+wrRowdQ0qGJ16vrI26+/vuK9sffPOZaUFCVJTIwUUCi4mZkukkd6WFOOcKAu34cE6Y03wFx8589LjiAMD5IgL9cXUFgsxINYn3x8eOSQobOyU1LHfMV9QXnxyoeNRo1i9+6TJWfP5h9onzFxHTxvM695NiJcp0lMiIxavWbHKpha8slHT4rHjxsw2uv1fTblsQVnZ8xcmg3XfrRkeiKJPnb6va64Xo1C/UkQuGJA/teSW6gAwJA9lIDjNqzf5Vu1ertZRHT/2L5pXbu26cEIBWFHD5/fNnDwcz+S6OI7cuD9Qe3aN2NH23/eeuC72/o+9RtMLXlzzoPjZQpZkAkEK0+fzj1WUmKuiIsLZ1Kax7qo9yihaRaA4oXtgHDJLeqSVM/KU9J/Mmg0gdH1o6TlUI/9P3DqfcmAcFuMwhwtmOEbRh+hcWvTwyxmm6RDx0kfZWcXe2HJrUAgEHbsmNa5qspeFp88evmIYT30r7487vZ1G3btn/TQnd2J8bfzvEYZhcJMf3h21BPXpKOuFUD+zLhAquWlZh08CcyahLGJbPoId/3yT5Zv3gRwwDT3tm2T29x6+5PboYpFUinvnNcmJC9dMv1+s9lmmf7E4sxdu04cYULT16FKlU9bMVNbzvUwWM5FXUP6s00buIoWB4uHZ6LhDi+E6tbiJesLMjJSFZ06t+wLE/YhipC0akdycvS2/77ywHiJTKIjRpwtu506k1/e67YbvDSClNAigJN+H26/XgwbqOsCED4kXBlYSB/ZXRYJD6roSIPoxKlcb3FR5TGJRKRIS4tvvmjB1PJJk+edJtcsfebpe4YcOZIJkYNxu71eWq2yMLU7vbPlZQQDdT0CcrHqFkQEq1gqrnr6qVFR/QfNzIqOH7WMV926z2ZzuJ6a8UHOW++sXMw937N7O/AzlQxv3TBuN4q63gGpK268BNKtyn79O8dtWPtSwtff/Frl8/mZkSN7RptMOvvj04ZntGoZr1j93Y6iyEiDeNSInsb2N7RwUb/BAYJRA3VN63J3dwfxq1swCxgqWrDgijtEhzs4h6s9B5jaAcgKGkFq5+njQCCqofoLq1hXEkH41S3Oo9goNNwCrCBz4cCMlweJnWfMUahGl2JRKAT0rBBh6plTuUkvvrwsMyEhwvLqq+Pz6vgV/qZfXqZ2zyKcY4W65nWlGyEEIXiRRqJCwOl2u6p37jppXb9xN/iLcppGVfJSqrqbeiEcqEYbQfiRBLYG9cM096ysotBeqcLebvy1opp6BEGhEBAUCgFBoVAICAqFgKBQCAgKhYCgUAgICoWAoFAICAqFgKBQCAgKhUJAUCgEBIVCQFAoBASFQkBQKAQEhUJAUCgEBIVCQFAoBASFQiEgKBQCgkIhICgUAoJCISAoFAKCQiEgKBQCgkIhICgUikqMv4K/VYI6Hwsv8jwoWM9jsJ7nUQjIdQ8EBwP3KKKPQt7zgjqg1IUCjrHz00fuY/7x3AgMAnJdgcGHgWvw+5bwPhbXA0pdQPhA+Jjasx59vMaBg9EFAbnmowXX2TkApBdpEtrE9UQSpp7IwT8E1c17dNPnvXVgQVAQkGsODH6UgGOx5bQpeI8K+pqMgsKPJPUB4qfNQ5uLNjhK20EfnbznPQgKAnKtpVIiCoWUdnyAQMVravqohNdstgqNtapIabEUy5xOq8ThsAgFRGxPDgYZ+Me+uQDeOxhUKvUBhULrNYUnOQ2GGKtUqqymcMAjnFHPnT/PPe+ikYUDBSFBQP6RqMF5CymFQklB0PKaxuNx6AryjpkqK/OVFRV5EgKFwM8qEAg1vxceA4FgkHskzwZqvhmRSCQSSiQihVQq1oSHxwqjo1M98Yk3mDUaExyzDUdsW3iPNh4oXEQJICQIyD8RNeQUDA1pOtoM8FhcfC4iP/ewvqTkvNTrdTE+n99Pmoclg4UgBIPPB49+FhbyesDrZeEJna9NHkEAiVgMkIiF5eUWcWbmeYny4FZTfHyLyPj4tvbkZp2LmNB59FyrYmrPpnchJAjI3wWHkGe+FTR90lMojNAIGJFnT283mitzxW4PRAe/h0DgD6VPnNh0KgiAhFKrUAsB4wNIAm6310caQMWSxBodoVAgk4lFUqlEpFIppBZLtTQ7+7T89OkdqTdk3GmOjGxeRIGV8ypmAgqJFyFBQP4OOGQ0ldJxUJAWTrxF5KEDa6PKy3OFpGN7IVqwISIYDHKpEnRw4i34noPlBqIFgAAvh573+LxeL3gQBiBxuQhpXjbUBOE95HKpSCaTuDQahVSjUbrsdqe8vPxDVfPm7Vrd2PGuPOJTFDxA+CVkhAQB+UvhkPOiRhhpEQDHiWNbEs+c2al0udwe0qFdkDZBH4TOTOyDkKRHIpIegZUQRkQkCUymBJLyBAP8lM1utwgqKwuZoqJcj9Pp9hDPIYSX4L0ADofDGwBQyOds5yZ+RKhQyNxarUpqszk8er2LfN1+ZUlJdkL3nmOURmOcuB5AEBIE5C8RZ8ZVNJ0CMCKJAY/e/ftXCcXFWcHqale12+3xQtCASCAmVAAU5E4vSUhoLYyLa2ePjW8DJtpJzTO/FMt5GpndXqnNzjygPnJkO/nKchF4D7ZXE0gAEKfT4/d4fIEQJCKh1erwWq3VHofD7SXfHyKPb9MPiw1dugyWEW/Ch4M/Mo+eBAG5atGD67xKXuSIIilVwr4938QUFua4SYrjAs8AyRR0aIBDLpdIUlLSJe3a9zOr1cZyprYky68uBXkRijX95Fpl2/Q+2tSW3QxnTu0w7tixXgygAXSQj0EEAUDsDpffb/P7pDankEQQH4k6fgKJj7zG+padO1dDpGtGIOHDwUHBeRIGIUFAGlqx4lIrLfUbEDlift22NLaiotJhszldJHp4iOUO0ogh1uu1sk6dBvmTUjpmkesr6lSVuNFvP69z8s0/WxWTShUWAoo1Nr5V9Pcb3tdCygWQQITykEBFsjASUdwB8r291dVOfzWNLBBpfGxpLBgkkEB1LYVAwp+ywp/T5cM/MwJyNVIrJTXlJrfbEbXzt+UJZWUV1VVVdgeJHh7SKf3EE5CoIZPodDppn77jnQZDbAG5vpQHSDUvetSdP8UfiQcYLTTaOMj7eAbf9Vjstp8+JYCeYGiJGMZMWFBI5GIIJCwcJHKwz9G6AFsY2L17DYFLkRSX0I6bruKtBxSMIgjIFUUQvjFnATl14qe4vLwsJ8BhNtucxBP4xGKhEACB6NGjx6gg6dRQboVWQlolTa/qwhGopxAgolGGPyLuJWmXv9dt9yVYrfM0kD5BAz/i8bDl4AD5GaA0HCSgQlmZq5qxRQJI+fbtW6vXGaJjNZowN+99uZ/Fg39qBORKK1fcYCCkKsbi4rPRp07tFhE47Gaz1Wm1EjpIZ1UoZGyJKj29mzw2vnUxubaMtnIaPRy86tHF5khxKZ2H+eMERIZAIhww6MGEVSvfVoPPAL8BcIAXIf4jAGmWh9fVyY8jgIFFGDMh6Zno0IG1Md17jrPWAZAfTTCKICCXnV5x5pwdKT97+rcwq9XhsFiqXZWVdhd0UuiICoVUDB4hIaF1gKZGFubCaR/c3frPTDG/yuSuU+ViowuJTJLu3e9O2rz5ayWBwgdRhKR4PgeBBGAhn7OghCpcEg+JaELSoGAgzso6LYmL2xNH/Iid93PVnbOFQkAuq3rFTT5U22zlxsLCzKDNVu0igLhtNgeUVf0ymVQEvgDy/biENtwUdC6F8dRjyP+XgjwD7WTqDFKmtrxFfu7cgVgoDNhsTtJUXrvD7Scfs50cUi2AxGwWexUyKYyViCDCqVRy6ZEjW/QxcW1NMpmyikJSjZBcXLgm/c9/NxdMKcnNPmiEATzomOSu7YVWXQ1pDju9KsjNwuUB1hDxIXHRzlxFDX9lRqdBLp1OKdfr1TKNRiVRKwECqZB4IQHxIUES2QLk5/NXmK3eigqrh6SEboh6ZnOVKydrfxT1U2r6f5Mw9S/Ywk6Av4L/GUG4aeyKysp8OQACqQ2kVpDWQAuZZR87FaSkJJNb68Gt96hvusflQuKlkHCpmzkysllpSkpruUajJIAoJWq1AiKESCqVsn9TqGaBLwFIrHaXj0Q9r8XicNuJYTl/fh9AoeUBIqU/IwoBuWyTXrMqsLQ0RwAguFxegMMHI9ow9kBgYSGBgcJdO9cGacfT8DqgrAEdMMirNDkpJGC0rS1a3OiFtIk0AohcrFTKwYyDMRdAlZcz7lZrtY9ED28o6rk8FRWlHgK7qQ4gYuwPCMiVAMKVXiV0ujobKaCU6vLA/CioIHkJJE4f6YzevLxzruNHt0QydMo7BUVOO6CoAWkMHxJ2oVRSSsdKg0EvA0DkcplIpZDC1BZuHiQ7Oxj8CBh3u93tC6WELg/5mT15OYf1tPjABwRTLATkiiERwkh5aJ1GANZwBKFqBM1iC92hrVYHmGb3vn2bAuQODZAYKSSqqxBFuFSLg4RtcXEtxFChAhMOkxehgQ8BRrg0C8ZIYNQ9FPXYype3rCxHxANEdhUARkCaOCiC0Mz10ExaiCDQQmmMyw93aJgwaDbbXTabw7V/71qAw0QjiZZnhhvSCetC4jKZogMymVQMpVwo6ZJIAvPALnh/j4eFw08HFH2QIpaXFwQ8HoeSwiHBFAsBaWhF6Q8lWrhDQwoDFSOoFlVV2b1ctaigINtz/OjmeB4gygaaYf4mDjU7nIRFJHth/heMwUgkEiGMycDoec0XBRl2ciNEPfBMkB56yQ9NvJSvsrJQzdTussKBixEEAbnsuzbb2LVOAuEFHQjmRMEdGqpFZovDW6daJHe7HcZ6ABE0EJILJh3CzwVgiETsstwaD8JBDPVnKP3CXC2YpxWquPn91qoiflQTYSULAbkSOGo2b5PLlcJQR4QmqumFEEUgfalbLbJYLJ6crH0R9VSzhFcBkJpHACS0MCv0M4EHAVBqfz5fEEChwNDNIWA+l5u/sV1926AiIPgruCQ44E7t1eujg3R1IGuESe7PLWRivQhXLQqZYZeX5Pre/Pzj6jrVoqtlhGumpfBDhoQHLj+KQJpFggadBezn1sILmPq3QUUhIJdcOarZ8lOj0TOhfF/8h3wfICFABFzs9HNY9edlV/bZbaUinhEWXUVAavb95da8X9J/irdxBLvzFvoOBKSBUaTGECsUWh/Mig1N/pOKQvOcpLAVj4DfAckNGvYoCe1SEhQE69ylBVcBDP5G2DXfF6IDRAmIFlxKhWqYcLLin8PBrxi5tNooJwFDrlTKJKSJdTqlxGJTwIg6u9sIwALQhMYiQqv/aPoTYP54fEGDogYHHCz5IN86wAUFqFb96RvAdo0C7ucKXo2fCQFp4ikWAAKzXZ06Q5RdqZTrNBqFzGBQy2A+FpROwRyTtCqg1arEJpNaCruMhEa3pRKxWAbvw83o9TWwQ/5hdL+8NEtGPEU1gAF7adEU6sI/MjHs4JnAn1BqGbq9EH/3+ADCgoBcrrjpHQCIQ6MJM2u1xvjqaqfcYNDCcAJbYtVo5LAxXBAG6oxGLQuPTqeSq9UKeUREMrfJdH3r0K8UkJrjEzwetyC0LZA/EBq8DAS5TeZqjDtJAbmqVqjAIBLC4i7qXfwIBwLSEECgU3OTBC3Nm99U6XD8aIJyKVwAy2xhNi10TPAmWq1SSiBR6nRqpVKpFrds3SuHCU0u5K+7CF4FONhZxpWVRQJu07nQ9BcPbNhQE0Q4MCBqwBZBEO2g0ABLhMNC8NY9NgEhQUAuOcXi9o+CjgTrMcwpzbtk5+cfgwmIGrgTw2xamAAId22obpHPZSQFI9FDqWjVqkepRhPO7Zlr5wESaEAE4U/Bl5aVFbBT7WH3RRgE5OaJXRhBRAJunhZAHBp1F4sNhphq5sIFXQgIAnJFVSw37eCw+YKsS9d7Tp04trVZbu5htUqlkJOO6QOjDLsnEt8hlUjkTHp6/6L4xPRMJrSrSRUvgvgbAAd/+r3MZqtQOhz2mrUo3K4mfA8CTgPWiMAcLVhZGNqyVCrW68NEUqmSn/o1BFwEBH0I28HZCX0ymcp3Q8bg6uapXSPKSjL1TqdVFurAQZ9WG2WOiGpWRq6BlX/lTP2bNlxpiiXiASK3VhUrAU4Yd2F3XQztiRXkRs4hvSJQwLEJArVSLgoBIhFD8SAiIjHA1B6842FwO1IEpAGVLM6HXAAMSZ8qSePmWAnoa26m9mAbSx3/4Wca5j/4R7rJy8uz5SS1soUWccGevaHJkxwcED0ADoAE0iulkl1UJVEopJKoqFRuPbqT+eMGESgE5LJTLW+dj6FzcUescYuN+Mtj+cejXY1DbIQ878Ee6VZUlAXrz2GvXnb7H5jSDhMna/64YvAeUqFGo2THbEIrDxVSnU4ni0toV8ADxIMpFgLSkCjC8KpP/MoWdxCniAcI/yRaz1WqEPHTK3aXFY/HqSopyfUCHJBewb68fIMe8h4SgVIpE8KGDlBp02oVUvK5NDm5vY9GNv4+wbijCQLSYEi4js6lWfxBO35KVvdMc6aBuT0/vWIPAy3IO6aHlYEEDC9MjoQdFmHCJGfQIa2CNeoweKnXqyQhQFQyGJtJaX5TGVO7kbaT5z9QCEiDQeEvXOLu7oI6EATrgetKxd/hkdujS1lenisjaZWVO1wHltTSrUdZ/wHeQ6tVinQaBUmv1FLYHojAIUtNzRBoNGHl1B9xewU3dAATAUHVG1GYv6lTieoCkp19PBiKHrXbD9GxGHYqiUqlgLRKbDRqpAaDRkYAgS2CFGmtepUxf9xpHtOrPwndqGv/b8TfwE5VWZmvs1qt7IE53PZDYNJhBB2+AFIrEi1ERpJamUw6gENG0itFhw63+TUaUwkFxFYnvcLogYBcd6p7LiIbPfJyDmtD/sPDbmDHjX/Ueg+Z0GTQEji0bGplMKgVMTExyuapN8OofiUFhDPoPoQDAbne02DOnMP2Qerc3BMCmN7CbV4N6RVUr2A3E9hdkaRUEphVTKKH3GTSKAgkyvbt+1mlUiWkV2aaXmH0QEAaTXpVEz1IeqUvLy/18P0HFz1gNjGkVuEmjTQ83CAPC9MpjEadqn37HuK4hLb5TO1BPhg90KQ3ivSKb85hxF5N0isdgaMajl2D3RyhvAvry+Vy2BNLKgwnaVVYmF4WFqZVEEBUiYkpilZtbs1jQlNeIL2y8KIHVq4QkEYBCLu7PJdeQfTg0itYAw9rUkj0EIDvCA/XETggtdIpwsNNyo6dh1SS1KqEAgLpVUMnTSIgqGvKnMuZ2uqVobS0xA1bCoXSKzdM3WUXREHlCnwHSalkBBIlMejqTp0GeozGOO6cRO4YOPQe6EEahUQ8c87uFn/+7C62egXpldPp8sHUEhjzADjCjCHfERGhBzhUbdveJElu1imXqT1EFFIrB6ZWGEEaU3pVM/YBkGRlHQ9y1StY+wEXyqUSIUxEJGkVRA7WdyQntyCp1dBs5sIzEjG1wgjSqNIr7vBQ9nzErPN7wy0Wq6e62umB6SWhk2wFDMBhMED00BPPoVdFRYWpe956fzGNHGXMhSfs4qpBBKRRpVc15ryw8IycpFUeGByEpbVwkVIpE+l0KogeUNJlfcetvcdZpFJFcR04sGqFKVajumldUNq12SoMmZlH4ahn2KyRLevCzo4qlVgI86xgMBB8R/fuw/w8U85PrRAOBKRReQ8uvQLvocnLOWiAsxHhXA9YPQhlXdi4TqVSiGEwEHxH+/ZdZUkpnc6S60to9ODg4NakoBCQRmnONVlZh6Uul8cBa8+hrCslxhx2UAkL03CmXNWx87AcXuQw83xHQzerQ0BQ15Q5F/PNeUnJORMcugnRAzaIo8cvsPtvGQxaRUREmKrXbeNKLmLKG7rMFwHBX8E1ac5r0qv83MM6iB6wjSNcQI9aExmNGoXBoFb26PXvamrKucFAbp2HB30HAtKY0yu2epWXd0oAp0GBMYfdEEUiiUCtlsM0dmWnTn1FkZHNOFPODQaiKUdAGnV6VVO9grEPm80GlSs2eoDvUChkEp1OrWjWrLW8dds+WTw4uFm6aMoRkEabXvEHB9XEf6g8Hp8D6rqwzSnsA6xWK2Umk1GR0emucuo5Knim3I2mHAFpCukVAcOhyc8/BcdN12ySTbyHGPb97dDhNp9GY4LVgeU834GTEBGQRqu6C6PUBXnHjT6fn91olzuMR6GQS5OS0qQt0m45z4scOAkRAWkS/oNLr9iVgyUlZ5UEEC/1HiISQcSwp9WNHYeUUzgqeXDgxm8ISKP3H1KeQVdVVOSLSfDwCoVw4A0D++tK27Xr5VerTVw5l7901o++AwFp7OlVzfSS/NxjBrfbEQilV+yx0yKtVitpnto1n6ZVdbftwdTqL/zjoP759IrvPxQVFTlqGPeAHeDomSOSlJROHqlUWcnU7kqCm74hIE3mb8DftZ34j3NSiB5gzMF/qFQaiB7cQTz8TaexpIuANPoIcsGu7TZbhcbptLJ7/cJBm2DO4+LaQPSoCwcYcyzpIiCN/vd/wb675aWZmhrnLoKpJSJRSvMuXFplq5NaIRxo0ht9BKk5cxBMemVlnoJ9gQgA0Wojgmq1iatYOZja3dgxemAEaTIGnYsgMqu1TML+YYj/EBJFRjZ3UTjqngaFcCAgTeL3X7P3rsfjUFqtpYIQIEL2bxMVk1b3LEFc44GANKkIUnPuudlcqK55kS3xyoJGYxw3zwrPEkRAmnSKJbVWFcv5F5hM8f46cHCDgigEpEkAImJ4Z587HBZJHUDcvNTqapyUi0JArt8Ui/gP0QWAhCdx3oN/Ei2mVwhIkwGED4mIPVyQJ+o/XMyFx0lj9EBAmpzY6SIVFXkiHhwAhIOXYuFRzQhIk1SAdn43/0mDIRbSq7oj5xhBEJAmFTX8NHVyURhqpNGYuAVR1bwIgnD8zcKpJv88IC4KgTkj467DAoEQZvL6TeEJ3MIoOy+CYIqFgDS51AoAATMujEtoB+mUlAcOfysfHP9AQJpsBBHQjyGSiHjwcCbdg9EDAWmK4kcFH4VBwIPHy9SWd3GAEAFp0pGEg0TAS8H86D0QkKamPwwQ8pqQB02Afi7gQRLgvY5CQBodGAwPBm4dupR+LKHP86OHl/oPrvl40QYhQUAaXdS4YHktE9oDC5qcPifidX6uwsUZdW41IU5aREAaJRwXbC1KGqw919KmopBIeCmVh0IBA4gwYGhlarf7wcNxEJBG93vmdk3UkWbkms1WFl6Yf9JUWnpexUvDgnK5xhcVlWqJT0yHw3FgwLCcvo+QB4UX0y0E5HqPHlxaBZFDT1oYaZGkhR8/ujnp/LmdGnu12+V2e11wDgjdrFokk0nFubnHws+e3RHe/oZB+SZTgrSOR+FXuVAIyHUNiJymVRA1It1uR9yO7cualZYW+CwWu9lud7kdDpcXTrDlzgKBg3K0WqXM6XQrnM4VCTfd/C+xyRTP0NSKv7oQ0ywE5LqFA9IhbsdESK1MBI5ogKOoKNdTUWG1k+awWKrdNpvTC6fYsn8UAggc8azXqwggHi+cEbJr55cxPXrd79Zowl3MhYuouEmMCAkCct2JfygOmHHjyeM/JULkADhKSsz2sjKLs6LC4iaQkAgSOixHJBIINBqluLpa4/N6/QGBgBHALouHDqyL695zHH8TOW6tCKZZCMh1m15JqTnXEEMelp19QEHSqiqIHABHUVGFs7i0ikQQh4+kUywgEolYoFLJRSSi0M9FQrlcKi4ry9VXVORFkFSrkr6nlX4PAUYQBOR6BoT1IOfP7ookXsNttzshYrghcgAcpaVmD/ncR/w5Q4x6EABxOBQsHMSss+kW8SNurVblzss5bCKAABwy+t7cCDxOR0FArktAag7HsdnKpVCtcjjcXvAckFZB5AA4CDiBII0BJK1iP1IqZUJ4vbra6YOvIRHFR6KQggInpX8/Ef6qEZDGAAk7CAilXKhWkccAeA5IqyByABw+n78mTYJIAg1OKSTPB2jz895TyNTO1UL9RcIlt383MQLh/+zQYrFIcInwoRCQ61rcVHZu4iF7pBoc6Ux8BjzCeIeQmHB2wx8AAxp8DD4EGlS04Foo/cIAYp33xDEQTLGuezi4gT23RhPmUSikUqVSDoOAUr1e5bHanT5IpeALfD72WEKoWglkMpmQmHIYC5Go1QoJ8SMSGF2HKShM7SYO/Nm9KATkugQEOjKMV9ibtbipJCfnUIpGo5AbjRov8R/EVfiDIpFQIJdLhcTAs5UoiCwqlUIUbtJIjUadTK9XywgscgKJLD6xfQkTWprLPycEK1gIyHULiIcCYtVowksTEztEejx7VV6v3w/GWyhk4RDZ7RoYB2GjAQBDoobYZNLJwsK0CpNJq9TpVMrw8AR/VFQLmLxoZ/CsEASkEYg/bR2mrFd0uPHO85WV+a39/oAaDskBP6JWyyV2u8tLIkgNICpVKA0zGrVKEm1UOp1eRr42iwnN7LXQ98TNHBCQ6zqCBPgRhKHjF926jxEfPfxDSnb2ES0c8azRKF0kenhhWgmdzSuUySRiEkVIaqVUGI0RkoxOQ/NJBCoAyHiA4FFsCEijSLPAL3DjIYxMpgp07DzMGRWVGn/ixE9hVmulwu32eGGcA8ZD4GxCqVRCDLlUGhPTypneYeAZmUwJ3qOUAmKv40FQCMh1b9QddaGJS2hXTZq2oiLPVFx4UscwAiHs8A47KyoUWmdsfLtyAgZECzNNraBVUZOOcCAgjc6LMEztpnBc2qU2meJLSYO5VXWX3DpptIBmYy6cwcuZc0yvEJDrPopwkLgpINyG1dDxYW4VN/FQzIOIG+/gr//g0iocJERAGh0k/MalXW6aLkn4HqXONfzGBwPhQEAaJSj89eTQ6bkN5OpOPAwwF24Yh2AgIE0u5eKbbEEdQOrCgGAgIE0WFgTgGhXO5kWhEBAUCgFBoRAQFAoBQaEQEBQKAUGhEBAUCgFBoRAQFAqFgKBQCAgKhYCgUAgICoWAoFAICAqFgKBQCAgKhYCgUAgICoVCQFAoBASFQkBQKAQEhUJAUCgEBIVCQFAoBASFQkBQKBQCgkIhICgUAoJCISAoFAKCQiEgKBQCgkIhICgUAoJCISAoFAoBQaEuV2L8FaCueQW2Ci7j6iACgmoqUIholsM91gVFwIMiQJqftgACgmoKcEhJk9Mmpc/xoRDy4PDQ5oRHtVoutNtdAQQE1RgFIMhIU5GmJU1HmpIHCQeFkD76SHORZiPNQppdr9eIPB5/EAFBXXcSCC5uKYL+LQLaLxUUjAjSIgvySqUOh1scHx+hlStlLCR+ry+Qk1NiDQSCvqSkqKBYKq6gAAWioowSi8Xub+jPilUs1LUm6JMSGj2MpMVv/+Ww7JZe07PbtJ9wauZzH2ZZzLb4oD/Qdu67q4uapY092Tp9/LnX3/jK5qx2xZLrwyHqRIRpJSqVosH9GyMI6poLMBQQSKn0udnFsh63PX6Me/GdeatKz58v/OGtNyb2febZD/Patk2WuVye4HPPf1yiVMqE06YNB6isBoNGAp/XY+wRENT1JZpWcY0z5hBBND9u3g+egtn+89u90tNTbvj+x70/3TP6lcNxceG/nDv1yejISEOy1+t3tmr3wLzln22pnDxpcEupXKpLSIhUmc02LwlIBLagNNTXg5xnwRQLdd3AIaQ3aoBCTX2HgaZXeqvVwRpt4jHitXp1bN8+GT0WzH+0xcLF60q/Xvnr71KpRCkUCiROpzsoFouIvRHA14Y1bx5jvPHGFuRjIXlPoZK+v+Ry+zxGENQ/HTmgD8qoKQdAoGoVBsYc/MQtN7eB1/IPHDxzwuFwVfcbNHPddytf6PPKS/d7n3x6Seboe249/fGyTdsqKqz+pUsebyORSUzkes+4cQNKyKOZYXw55NHOhCpfcvqtPcwlDigiIKh/UiKe3+CihokCAmbb1Llzy5aH9i0yeDw+3w2dJq2GL4qJCUuY8dQ9Xcf9p3/Ohu937yT+I2feOw83H3Jn10Hk5TK4hhj5AEm9ZGERenjPSqa2PAyVLR99/MtTLJbCIBH+rVFXICG9q0PUiAj6A0mbftgjf+mlT0tXrdpe6LA7NQKRMIKkV6mjx7z2i8PhDq7/7qWbiQGPE4pFyj17Tx4a/+DbJ6dNHRo1akTPXqQbyv1en/7111fs1YfdvSs8eviJZ55ZaiOwxDChcrGWRqtL7vcYQVD/dHolp74jYv6C76xTpy0sopcU9+zeLnftdy9N2Przoe3nzhV41qyalbH/4LmiRe+vf2v2C2N6Dhk6a3/fPjeqn35y1B3tMyZ+MubePhGPTxs+cM+ek5YB/TppKqvsvtfmrCjXapXCZ54ZDZHJRtMtB40iwb8SEO7NgxhBUFcAB9+cq6xVdsX/vfBJTvPmsdKvPp95a35BWTkAcN/Y1z5+cdbYm6GK1a1b234bNu5aBd7D7/dvI6nXgGbNYlurNYqoN+c81Ipce5S818aPP3xynEajjKiudpXFJt4zd9V3O6xPPTEySiQR68nr1dSDCJgL524F6wOmoREE3jggFAq50pkA//yoi/eWrUIeGBKeKdc5nW6F1eoIvPryAwk3dky7nTTm9+3z9F27T91aUFS5beuPr08g6Zakf7/Od6z8+nnf8JEvHoyKMu5/4/UH0+Gt+92ecfOHHzzuf2DCWycCgeCK114d/5BEIlJKJGKBUa8SCwSCMAqGj/4MEE1ctLkv5ksa4kG4+TA+jaZmxBJTNtSfwSGh1SotNeORtIXpdOqwyEiDeMVXPxd63V77l1/+tAy+bNnHT7XZv/+Mc8XXv2winqRk3Pg357VumZCwcd3LnaHUu2PHsV+2/3pkfVLze5fc2rN9uw/en97yrXdWFpWXW/JWfL1tFVS3Jk8e0oJ4FvAgUaTF0VYz6k5/JnF9N/iGplhAnEerVXGhSYI9AVUPHPxyroY0PfUdRgpIhFwpi1qy+LF2ErFI+uOmvRtG3/vq0fHjBoQvfG/K5JSkqPCEhIi4557/+NNPP99S+ejkIY4BA28amZf1Rdr584U5PW57/JeWLRNk4eH6uHH/6deW+JJTq9fs2P7wI++emTnjX7ED+3cZQL6HlQkERSUllT632yuKj48wkYhUUae6xVW4rloEgTdzh4XpvPQ5GQllGEVQ9WUq3PwqKOdGQ8XqxLEsw+7fTwTdTjc8Zxo8uNtwk1GrvvOu5/d27txS+c5bk8ZKZBI1eI8PPvx+2zvzVhWTNKp1RkZqL/ZNhQLh7QNmbAcTvnHty0NUKrmJRArF3v1nTgAcxLBHjxzeoz3xK0JntUs55bH3NkfFjfotsdm9x/4zbk5xUUF5JI0qEEWk9UWQhpZ5ARAnIdH28ov3h9NvoMP+gKojAc9zhFXbHLFPzfigok37CSduumXK4buHzdpotzqEpFV26TZlq8mkFS1ZOPXWHzbt20KeKyJp1KaXX/08H9Kndm2S4qY/sfhdc4U185X/fvG91+sL7vhl7iBy7aEpjy2YV5hfduyhSXOPPPLwkMgnpo8Y0KHjpI0vvvzZx6Wl5vx1G3abu3RppYBos/yzLZb3P9hQRqOYigIi/CtSLDA5lp7d28XS5yNIFKnEyhaqDiDQAdkJiCtXbbe8+fY35XcM7KJNS4tXgWf4932vfrBg/pTBMKbx6OS7boUvGjHqxQ3kmsxZz4+5iRjzG+4e0m341q0H1s+bv7rk6NHM5bNfGNtp0kN3dmmbntIzM6uwEKKGxVK9lhj6/mlpCelyhdQAHmbs/XOOE5C27fjlndHE2KeSawoiY0cu+vzLn8yzZo2NYP64GKtGolkvjGnof5wNnwmJkUZzpVWye88pdvHKrFmznNgvUKFbaZaYgwOM8QcfbLDs3XfGtXvnew8OHtJtQN/eN3ienvnh6QMHzpx/562Hh8YnRqYbjJqYjjc2N89+6TPS9SvKnnpi1DDiUwwpydHN4+PDC+fN/67QYrGbHxg3oJ9EKlGT5xNbtUqsfGH2shyhUGjp369jhlgiVsbFmDSxsWFV//fCspyyMkverb06JPp8ft/bc7890DItXjru/v6Q3lWwHgXGRwQpV82DMJxJZ0KDL2WEcBV9PoFEETn2DFSdjIMdFoiJCYM7NpOZWXi2rMR8OjraFLXuuxc7/bL9aPWAO5/93OfxOfJzSw/Fx4WHrfji2Q7rN+62EtO+1OVwV763cM3HarVCCl5k1Xc7LCu+3raBpFtZ94x+eV6H9JTkNatnd4Tq1qlTuQf37j65KSV1zJL+fTu2h/QMDL4xYujCiJgRSyA1m/bYsBgmNGjoYi4ycCgI+rc09D8uprklhKpm8+atEj42fWExE6otnyGZlgf7RpOvYompNwVDnHDyeHZ46/Txx/mXVJWvnrJj57Hft2w9mPfwxMG3EG+yGkq0Hsf3z2/96cAmctcPlJZZ7DDOAanZ6m9nTycQ7FMopEqSWm3ctOWA/ejBJXeQdKtXcWHFyby80tzONz+6maT+qo3rX31YoZBpSWq3ctLkeezaEpKeRU14YIBeKpfmkk8LSCtnYGxE2Nt3tQER0vKdlv4CUp577iMHMVDllMpMAokNe0mTBkTEq2CxkJC7u+i1OSuKMrNLvLNfuC9t0IAufUUScWRudvGhIcNmfXvo0DnX6eMfDU1tmXAzvMWWTftW3T5gxs7/jOlrenfu5LEanSom4PM7iGFfAJ7k02Uz2o0a0XOoRCbREKN+vFW7B5alpMRIV3z2zICEhMgUhUoOlVazzVKd7/cHzHqjBvpkKW2VNMVyE0D8VxsQLopwc2qi3E53wvwFa9xPPr2khL5uJq2IgIK+pGkCIqRGWEV9CIxqG0kqZSCRwUC8BTtYCKXYu4Y+/zFEg52/zr2tutrlvumm1l2t1uqK2MR/fQzzrubPe6Tvlp8OHh1z7+2Dt/925LeBdz63e+F7U1JbpsaFz3131bGPlj4xeulHP3w/Y+bSbABs7fpdh86ezbcuWjC1n1AsgsymhDbOd1ipRYCMx0sACf4VgNSdeAYl39hvv/2V3CW+Kt+377SLXudmQkP8TuYq7l2Eural0SgFycnRolZpcZL09BRFUlKUKiJMpzYY1Bq9Xh3erEUcGPiYBQvWHHlkyvzM37fP602uSYqOH/XhiGE99LNfGNPj42U/7nvy8ZF3lJdbSkh6tmboXd10z838982nzxYUjBzeY8TBg+e2d7xp8iZIv955a1JfqVQsS0iK6vDKK5+/B9Phs8992jUxOdpO06lietN20j7JTUEJEED+cOdvuIC6wFZu6xWGfjPXsGE9wm/vfWPkV9/84v7tt6NOqD3TdAzVhGSzORjiFwT5+aXCQ0cyxbHRRqnRqJXExoaJW7ZMEBBASrxur+ST5ZsKlUqZICMjtTsMEIJxh0FDoVCwfcniaWO0enV8eKQh9Zuvns8ZMerFQyqVYvfihVPHw+BgRqe0vt9+80LFsBGz9yckRPz61hsTH4Abd0pKNKT+jNXqsFAoIKUqo5HDx9RuOFfvsMTViSAcdRdu+MWtENPRsGooKzHLz5zJ9589X+j1+/2MkIj9cqEAJzk2AQlCYkQi+IsLBKSDyww6taZ7z3bH/V5fQq/eT2Tt3nMKvMdImUwit9udtq0/HzoG4xuQXm1Y9+oTBQVlZ6qq7JbDR7OyYXxj6qN3R7795sRH3v9gw6edO6Yl7d1/JocY8dOwmcO9o3tHwwxhAPHw/sWpBLBs8mPkU0Cq681i6kSQqwtILSRcyiWhaZeC5p9K+rGUqV0fjOvimy4ypA+IyE3Ud4J8krh2zW/iIUNnZfOvKC9e+TDxHDt27z5ZMuGBgZ3bZ0xcx0Yl85pnf952aEtiQmTUiVO5OTC795OPnmz973/1HrXo/XWfTXlswVnuPX7aNKf5rb1vBJOeTf0Hl14F/35A/giKiMIi5oEhZmpHLrmGanqAkD4gIIAErLS6Fbdh/S7fqtXbzSKi+8f2TevatU0PRigIO3r4/LaBg5/7MT+/zHfkwPuD2rVvxo62/7z1wHe39X3qN5ha8uacB8fLFDKS7gcrT5/OPVZSYq6IiwtnUprHQupfyIPDzhryfxSQ+mER8h4ZhAMBYWq3GCVpuMBUm5IHNLTaFWYx2yQdOk76KDu72EuiQTeSnQk7dkzrTFKtsvjk0cvByL/68rjb123YtX/SQ3d2lytldp7XKKNQQLPQ1MrNXGxN+l9i0i/FxNeOpKLQi7CPdGWhmzZylw/aaRoOxjqcVpeYT5ZvPgpw7Nk5//akpKhkGAkfele3I2/OeWjgnNcmJD80YdBdp0/nHZ/+xOLMG9o30/W67QaArIhWqwAQqJw6aFrluZx+iFPTUf9g/OgTJJBwI9fcDu02epeHO7wQqluLl6wvyMhIVXTq3LIv0AVRhKRVO5KTo7f995UHxktkEh0BB76GOXUmv5wA4qURBFKqcgoGt2LwohUrBAR1LUPCzesTMrVrxqVQ7IqONIiIEfcWF1Uek0hEirS0+OaLFkwth2oVuWbpM0/fM+TIkcwj8H5utxfgsNJ0ykL9BrcP1mXPMP97PAgKVU+KdTGRPikL+RDWuMf/+MMeef9BM7PqVLfu++iTH399asYHOfznD+5d1LzDjS1g6kgeTa8sTJ1VgpfTlzGCoK5F+ZnaWReV/fp3jtuw9qWEr7/5tcrn8zMjR/aMNpl09senDc9o1TJesfq7HUWwnn3UiJ7G9je0cFFD7mAuYwfFvzaCoFBXV1x1ixtohuqWgak9RIfbhJqrigYoUJBOwRyrSubCitWlQ4IRBHUdCDq8l0YBbu8DG4WG230kyFw4RODlQWLnGfMGCQFBXYvioAjyYLHz4OCiBsODhTuKzcvUTj68rIoVAoK63iDh9jzgqlrC/3E9f7wtyFyFI6EFuLcCCnVx/b8AAwAPeSy8wYng4wAAAABJRU5ErkJggg==",questionMarkIE:"/images/current/studios/sml/question-mark.png",css:"",html:"",challengeSceneArray:[],childSceneArray:[],handleHistory:[],scrollEnable:true,activeScene:{},scrolling:false,imageSearchPage:0,activeSandboxHandle:"",activeSandboxPhase:""};setup=function(){cdc.sml.log("SML starting...");conf.userName=(!$j.cdc.user.getUsername())?"":$j.cdc.user.getUsername();conf.dn=$j.cdc.constants.getDatanodeUrl();$j("head").append('<style id="sml"></style>');if(cdc.sml.isIE){conf.transImage=conf.dn+conf.transparentIE;$j("#cPrev span.normal").css({background:"url("+conf.dn+conf.cPrevIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"});$j("#cPrev span.hover").css({background:"url("+conf.dn+conf.cPrevHoverIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("#cPrev span.active").css({background:"url("+conf.dn+conf.cPrevActiveIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("#cNext span.normal").css({background:"url("+conf.dn+conf.cNextIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"});$j("#cNext span.hover").css({background:"url("+conf.dn+conf.cNextHoverIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("#cNext span.active").css({background:"url("+conf.dn+conf.cNextActiveIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("a.sml-reload span.normal").css({background:"url("+conf.dn+conf.reloadIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"});$j("a.sml-reload span.hover").css({background:"url("+conf.dn+conf.reloadHoverIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("a.sml-reload span.active").css({background:"url("+conf.dn+conf.reloadActiveIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j(".sml-card .vote").css({background:"url("+conf.dn+conf.voteIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("#sml-add span.normal").css({background:"url("+conf.dn+conf.buttonAddIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"});$j("#sml-add span.hover").css({background:"url("+conf.dn+conf.buttonAddHoverIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();$j("#sml-add span.active").css({background:"url("+conf.dn+conf.buttonAddActiveIE+")","background-repeat":"no-repeat","background-position":"center center",cursor:"pointer"}).hide();}else{conf.transImage="data:image/png;base64,"+conf.transparent;$j("#cPrev span.normal").css({background:"url(data:image/png;base64,"+conf.cPrev+")","background-repeat":"no-repeat","background-position":"center center"});$j("#cPrev span.hover").css({background:"url(data:image/png;base64,"+conf.cPrevHover+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("#cPrev span.active").css({background:"url(data:image/png;base64,"+conf.cPrevActive+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("#cNext span.normal").css({background:"url(data:image/png;base64,"+conf.cNext+")","background-repeat":"no-repeat","background-position":"center center"});$j("#cNext span.hover").css({background:"url(data:image/png;base64,"+conf.cNextHover+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("#cNext span.active").css({background:"url(data:image/png;base64,"+conf.cNextActive+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("a.sml-reload span.normal").css({background:"url(data:image/png;base64,"+conf.reload+")","background-repeat":"no-repeat","background-position":"center center"});$j("a.sml-reload span.hover").css({background:"url(data:image/png;base64,"+conf.reloadHover+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("a.sml-reload span.active").css({background:"url(data:image/png;base64,"+conf.reloadActive+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j(".sml-card .vote").css({background:"url(data:image/png;base64,"+conf.vote+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("#sml-add span.normal").css({background:"url(data:image/png;base64,"+conf.buttonAdd+")","background-repeat":"no-repeat","background-position":"center center"});$j("#sml-add span.hover").css({background:"url(data:image/png;base64,"+conf.buttonAddHover+")","background-repeat":"no-repeat","background-position":"center center"}).hide();$j("#sml-add span.active").css({background:"url(data:image/png;base64,"+conf.buttonAddActive+")","background-repeat":"no-repeat","background-position":"center center"}).hide();}$j("#sml-container").append(conf.html).fadeIn(400,function(){if(cdc.sml.isIpad){$j.jQTouch({icon:false,statusBar:false,preloadImages:false,fullScreen:true,fullScreenClass:true,fixedViewport:true});$j("a.sml-login-link").bind("tap",function(event){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return false;});$j("#cPrev, #cNext, a.sml-reload").bind("tap",function(){cdc.sml.hideCards();$j(this).click();return false;});$j("#sml-restart").bind("tap",function(){cdc.sml.restart();return false;});$j("#sml-add").bind("tap",function(){return false;});$j("#sml-challenges").bind("swipe",function(event,info){if(conf.scrollEnable){if(info.direction==="right"){$j("#cPrev").click();}else{$j("#cNext").click();}}});$j(".sml-reload").bind("tap",function(){cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"random");return false;});$j("#sml-left-card .vote, #sml-right-card .vote").bind("tap",function(){if($j(this).attr("data-handle")!==""){var desc=$j(this).parent().find(".desc").html();var thumbUrl=$j(this).parent().find(".image img").attr("src");var handle=$j(this).parent().attr("data-handle");if($j(this).parent().attr("id")==="sml-left-card"){$j("#sml-card-ghost").css({top:190,bottom:20,right:400,left:20}).show().animate({top:53,bottom:357,right:98,left:98},500,"easeInOutQuad").fadeOut(150,function(){cdc.sml.vote(handle,desc,thumbUrl);});}else{$j("#sml-card-ghost").css({top:190,bottom:20,right:20,left:400}).show().animate({top:53,bottom:357,right:98,left:98},500,"easeInOutQuad").fadeOut(150,function(){cdc.sml.vote(handle,desc,thumbUrl);});}}return false;});$j("#sml-restart").bind("tap",function(){cdc.sml.restart();return false;});$j("#sml-add").bind("tap",function(event){conf.scrollEnable=false;cdc.sml.addYourOwn(event);return false;});$j("#sml-add-entry-container").bind("tap",function(event){cdc.sml.checkWriteStatus(event);return false;});$j("#sml-help").bind("tap",function(){return false;});$j("#sml-search-submit").bind("tap",function(){cdc.sml.imageSearch();});$j("#imageSearch").submit(function(){return false;});$j("a.hide-mask-lower").bind("tap",function(event){cdc.sml.hideMasks();return false;});}else{$j("a.sml-login-link").live("click",function(event){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return false;});$j("#cPrev, #cNext, a.sml-reload, #sml-add").live("mouseenter",function(){$j(this).find("span.normal").fadeOut(150);$j(this).find("span.active").fadeOut(150);$j(this).find("span.hover").fadeIn(150);});$j("#cPrev, #cNext, a.sml-reload, #sml-add").live("mouseleave",function(){$j(this).find("span.normal").fadeIn(150);$j(this).find("span.active").fadeOut(150);$j(this).find("span.hover").fadeOut(150);});$j("#cPrev, #cNext, a.sml-reload, #sml-add").live("mousedown",function(){conf.challengeScrollDir=$j(this).attr("id").substr(1).toLowerCase();$j(this).find("span.hover").fadeOut(150);$j(this).find("span.active").fadeIn(150);$j(this).find("span.normal").fadeOut(150);conf.scrolling=true;return false;});$j("#cPrev, #cNext, a.sml-reload, #sml-add").live("mouseup",function(){if(conf.scrolling){$j(this).find("span.normal").fadeOut(150);$j(this).find("span.hover").fadeIn(150);$j(this).find("span.active").fadeOut(150);$j(this).click();}return false;});$j(".sml-reload").live("click",function(){cdc.sml.hideCards();cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"random");return false;});$j("#sml-left-card, #sml-right-card").live("mouseenter",function(){$j(this).addClass("hover");$j(this).find(".inner-hover").fadeIn(150);$j(this).find(".vote").fadeIn(150);});$j("#sml-left-card, #sml-right-card").live("mouseleave",function(){$j(this).removeClass("hover");$j(this).find(".inner-hover").hide();$j(this).find(".vote").hide();});$j(".sml-card-blank").live("click",function(event){cdc.sml.addYourOwn(event);return false;});$j("#sml-left-card .vote, #sml-right-card .vote").live("click",function(){if($j(this).attr("data-handle")!==""){var desc=$j(this).parent().attr("data-desc");var thumbUrl=$j(this).parent().find(".image img").attr("src");var handle=$j(this).parent().attr("data-handle");if($j(this).parent().attr("id")==="sml-left-card"){$j("#sml-card-ghost").css({top:190,bottom:20,right:400,left:20}).show().animate({top:53,bottom:357,right:98,left:98},500,"easeInOutQuad").fadeOut(150,function(){cdc.sml.vote(handle,desc,thumbUrl);});}else{$j("#sml-card-ghost").css({top:190,bottom:20,right:20,left:400}).show().animate({top:53,bottom:357,right:98,left:98},500,"easeInOutQuad").fadeOut(150,function(){cdc.sml.vote(handle,desc,thumbUrl);});}}else{sml.log("no data-handle: "+$j(this).attr("data-handle"));}return false;});$j("#sml-restart").live("click",function(){cdc.sml.restart();return false;});$j(".sml-restart-from-alert").live("click",function(){cdc.sml.restart();return false;});$j("#sml-add").live("click",function(event){console.log("#sml-add click: "+event);conf.scrollEnable=false;cdc.sml.addYourOwn(event);return false;});$j("#sml-help").live("click",function(){return false;});$j("#sml-search-submit").live("click",function(){$j("#smlImageSearchNext").fadeIn(250);conf.imageSearchPage=0;cdc.sml.imageSearch();});$j("#imageSearch").submit(function(){$j("#sml-search-submit").click();return false;});$j("#addOwnCancelButton").live("click",function(){cdc.sml.addYourOwnCancel();return false;});$j("#smlImageSearchNext").live("click",function(){if(conf.imageSearchPage<56){conf.imageSearchPage=conf.imageSearchPage+4;if(conf.imageSearchPage>0){$j("#smlImageSearchPrev").fadeIn();}if(conf.imageSearchPage===56){$j("#smlImageSearchNext").fadeOut();}cdc.sml.log("imageSearchPage: "+conf.imageSearchPage);cdc.sml.imageSearch();}return false;});$j("#smlImageSearchPrev").live("click",function(){if(conf.imageSearchPage>0){conf.imageSearchPage=conf.imageSearchPage-4;if(conf.imageSearchPage===0){$j("#smlImageSearchPrev").fadeOut();}if(conf.imageSearchPage<56){$j("#smlImageSearchNext").fadeIn();}cdc.sml.log("imageSearchPage: "+conf.imageSearchPage);cdc.sml.imageSearch();}return false;});$j("a.sml-search-thumb").live("click",function(){$j("#selectedImgUrl").val($j(this).attr("data-src"));$j("#sml-add-entry-card").find(".image").empty().append('<img src="'+$j(this).attr("data-tburl")+'" width="184" height="139"/>');return false;});$j("#addOwnSubmitButton").live("click",function(){cdc.sml.createImageAsset($j("#selectedImgUrl").val(),$j("#sml-add-entry-text").val());return false;});$j("a.hide-mask-lower").live("click",function(){cdc.sml.hideMasks();return false;});$j("a.smappBtn").live("click",function(event){event.preventDefault();var smappWindow=window.open($j(event.currentTarget).attr("href"),"Storymaker","width="+screen.width+", height="+screen.height+", top=0, left=0, fullscreen=yes");if(window.focus){smappWindow.focus();}return false;});}cdc.sml.getChallengeScenes();});};return{isIE:
/*@cc_on!@*/
false,isiPad:navigator.userAgent.match(/iPad/i),initCarousel:function(){cdc.sml.log("Carousel Initiated");$j("#sml-challenges").jCarouselLite({btnNext:".sml-challenge-next",btnPrev:".sml-challenge-prev",speed:400,scroll:1,circular:true,start:0,visible:1,easing:"easeOutQuad",beforeStart:function(a){cdc.sml.hideCards();},afterEnd:function(a){conf.activeSandboxHandle=$j(a[0]).attr("data-sandbox");conf.activeSandboxPhase=$j(a[0]).attr("data-phase");conf.activeScene.handle=$j(a[0]).attr("data-handle");conf.activeScene.type=$j(a[0]).attr("data-type");conf.activeScene.title=$j(a[0]).find(".title").text();cdc.sml.log("conf.activeSandboxHandle: "+conf.activeSandboxHandle);cdc.sml.resetCookie(conf.activeScene.handle);cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"");}});},rand:function(l,u){return Math.floor((Math.random()*(u-l+1))+l);},hideCards:function(){cdc.sml.log("hideCards this type: "+conf.activeScene.type);$j("#sml-left-card").attr("style","").removeClass("sml-card-blank");$j("#sml-right-card .image").empty();$j("#sml-right-card .text").text("");$j("#sml-left-card .image").empty();$j("#sml-left-card .text").text();$j("#sml-left-card-container").stop().animate({bottom:-340},150);$j("#sml-right-card-container").stop().animate({bottom:-340},150);$j("#sml-textonly-card-container").stop().animate({bottom:-340},150);},showCards:function(){$j("#sml-left-card-container").stop().animate({bottom:20},250,"easeOutQuad",function(){$j("#sml-right-card-container").stop().animate({bottom:20},250,"easeOutQuad",function(){$j("#sml-left-card, #sml-right-card").each(function(i,item){$j(this).find(".jspContainer").jScrollPane();});cdc.sml.checkCards();});});},updateCards:function(parentHandle,type,sort){cdc.sml.log("updateCards");$j("#sml-textonly-card-container").find(".form").empty().remove();cdc.sml.hideMasks();cdc.sml.log("conf.activeSandboxHandle: "+conf.activeSandboxHandle);cdc.sml.log("conf.activeSandboxPhase: "+conf.activeSandboxPhase);if(conf.activeScene.type==="text_only"){if(conf.activeSandboxPhase!=="pitch"){$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="pitchSuccessMsg"><h3>This challenge is now closed to submissions.<br/>Want to find other ways to play?</h3><br/><br/><a href="/studios/create-episodes/"><div class="Sprites Button lgButton lgBlueButton">Browse all challenges</div></a></div></div></div>');$j("#sml-mask-lower").fadeIn(1000);return ;}$j("#sml-textonly-card-container").stop().animate({bottom:30},250,"easeOutQuad",function(){$j("#sml-reload-container, #sml-add-container").fadeOut(250);$j("#sml-textonly-card-container").find(".heading").after('<div class="form">loading challenge...</div>');$j("#sml-textonly-card-container").find(".form").load(current.Constants.getInstance().getScriptName()+"/pitcher.htm?modal=true&groupSlug="+parentHandle+"&groupTitle="+encodeURI(conf.activeScene.title)+"&challengeType=TEXT_ONLY",function(){$j("#pitcherForm").find("textarea").first().removeClass("validate-max8000");$j("#pitcherForm").find("textarea").first().addClass("validate-max3000");$j("#pitcherForm").attach(cdc.smlTextPitcher);});cdc.sml.checkCards();});}else{if(conf.activeSandboxPhase!=="pitch"){$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="pitchSuccessMsg"><h3>This challenge is now closed to submissions.<br/>Want to find other ways to play?</h3><br/><br/><a href="/studios/create-episodes/"><div class="Sprites Button lgButton lgBlueButton">Browse all challenges</div></a></div></div></div>');$j("#sml-mask-lower").fadeIn(1000);return ;}if(sort==""){conf.nextScenesSort=(conf.handleHistory.length<4)?"children":"random";}else{conf.nextScenesSort=sort;}$j.getJSON(conf.getNextScenesApiUrl+"?id="+parentHandle+"&include=mediaAsset&sort="+conf.nextScenesSort+"&start=0&len=2&callback=?",function(data){if(data&&data.items.length>0){cdc.sml.log("scenes found: "+data.items.length);$j("#sml-reload-container, #sml-add-container").fadeIn(250);$j.each(data.items,function(i,item){if(i===0){var card=$j("#sml-right-card").detach();card.attr("data-handle",item.handle);card.attr("data-desc",item.description);card.attr("data-type","storymaker");card.find(".image").empty().append('<img src="'+item.mediaAsset.url+'" width="184" height="139"/>');card.find(".text").attr("style","").empty().append('<div class="desc">'+item.description.replace(/\</gi,"&lt;").replace(/\>/gi,"&gt;")+"</div>");$j("#sml-right-card-container").append(card);if(data.items.length===1){$j("#sml-left-card").find(".desc").text("");$j("#sml-left-card").find(".image").empty();$j("#sml-left-card").attr("data-handle","");$j("#sml-left-card").addClass("sml-card-blank").css({backgroundImage:"url(data:image/png;base64,"+conf.questionMark+")"});cdc.sml.showCards();$j("#sml-right-card").find(".desc").jScrollPane();}}else{var card=$j("#sml-left-card").detach();card.attr("data-handle",item.handle);card.attr("data-desc",item.description);card.attr("data-type","storymaker");card.find(".image").empty().append('<img src="'+item.mediaAsset.url+'" width="184" height="139"/>');card.find(".text").attr("style","").empty().append('<div class="desc">'+item.description.replace(/\</gi,"&lt;").replace(/\>/gi,"&gt;")+"</div>");$j("#sml-left-card-container").append(card);cdc.sml.showCards();$j("#sml-right-card, #sml-left-card").find(".desc").jScrollPane();}});}else{cdc.sml.log("no scenes for: "+parentHandle);if(!cdc.sml.checkWriteStatus(null)){cdc.sml.showLoginMask();}else{cdc.sml.addYourOwn(null);}}});}},vote:function(handle,desc,thumbUrl){cdc.sml.log("activeScene.title:"+conf.activeScene.title);cdc.sml.log("vote registered for: "+handle);cdc.sml.hideCards();cdc.sml.setCookie(handle);$j("#cNext, #cPrev").hide();cdc.sml.log("#chal"+conf.activeSandboxHandle);$j("#chal"+conf.activeSandboxHandle).find(".border img").attr("src",thumbUrl);$j("#chal"+conf.activeSandboxHandle).find(".desc").text(" "+desc);conf.activeScene.handle=handle;cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"");if($j.cdc.user.isLoggedIn()){$j.post("/proxy/index.php/cccp/scene/rate.htm",{id:handle,rating:1},function(response){cdc.sml.log("scene rate response:"+response);});}else{if(conf.handleHistory.length==2){var sml_login_alert=new current.components.alerts.AlertBar('You\'re attempting to change fate! If you want your decisions to count you will need to <a href="/login.htm">login</a>.',"close","");sml_login_alert.init();}}$j.get("/tracking/api.php",{apiKey:"jrhm4c",event:"spinnerSelection",objectId:handle,username:conf.userName},function(response){cdc.sml.log("spinnerSelection:"+response);});},checkCards:function(){cdc.sml.log($j("#sml-left-card-container").css("bottom")+"-"+conf.activeScene.type);if(conf.activeScene.type==="storymaker"&&$j("#sml-textonly-card-container").css("bottom")!="-340px"){cdc.sml.log("hide text-only card");$j("#sml-textonly-card-container").stop().animate({bottom:-340},150);}else{if(conf.activeScene.type==="text_only"&&$j("#sml-left-card-container").css("bottom")!="-340px"){cdc.sml.log("hide cards");$j("#sml-left-card").attr("style","").removeClass("sml-card-blank");$j("#sml-right-card .image").empty();$j("#sml-right-card .text").text("");$j("#sml-left-card .image").empty();$j("#sml-left-card .text").text();$j("#sml-left-card-container").stop().animate({bottom:-340},150);$j("#sml-right-card-container").stop().animate({bottom:-340},150);}}},restart:function(){cdc.sml.log("SML Restarting...");cdc.sml.hideMasks();if(conf.activeScene.type==="storymaker"){var thumbUrl=$j("#chal"+conf.activeSandboxHandle).attr("data-thurl");var desc=$j("#chal"+conf.activeSandboxHandle).attr("data-desc");var title=$j("#chal"+conf.activeSandboxHandle).attr("data-title");conf.activeScene.handle=conf.handleHistory[0];$j("#chal"+conf.activeSandboxHandle).find(".border img").attr("src",thumbUrl);$j("#chal"+conf.activeSandboxHandle).find(".desc").text(" "+desc);}$j("#sml-left-card").attr("style","").removeClass("sml-card-blank");$j("#sml-left-card-container").stop().animate({bottom:-340},150);$j("#sml-right-card-container").stop().animate({bottom:-340},150);$j("#sml-right-card .image").empty();$j("#sml-right-card .text").text("");$j("#sml-left-card .image").empty();$j("#sml-left-card .text").text();$j("#sml-left-card-container").stop().animate({bottom:-340},150);$j("#sml-right-card-container").stop().animate({bottom:-340},150);$j("#sml-textonly-card-container").stop().animate({bottom:-340},150);conf.handleHistory=[conf.activeScene.handle];conf.scrollEnable=true;conf.scrolling=false;conf.imageSearchPage=0;$j("#sml-add-entry-card").stop().animate({bottom:-340},250,"easeOutQuad",function(){$j("#sml-add-entry-container").fadeOut(250,function(){$j("#sml-image-search-results, #sml-add-entry-text, #sml-add-entry-card .image").empty();$j("#imageSearchTerms, #selectedImgUrl, #sml-add-entry-text").val("");$j("#smlImageSearchNext, #smlImageSearchPrev").hide();});});$j("#sml-right-card .image").empty();$j("#sml-right-card .text").text("");$j("#sml-left-card .image").empty();$j("#sml-left-card .text").text();$j("#sml-image-search-results").empty();$j("#cNext, #cPrev").fadeIn();cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"");},log:function(data){if(location.host!=="current.com"){try{console.log(data);}catch(e){}}},getChallengeScenes:function(){var chalReqCount=0;$j.each(conf.sandboxes,function(i,sandbox){if(sandbox[1]=="storymaker"){$j.getJSON(conf.getSandboxApiUrl+"?id="+sandbox[0]+"&include=startScene,mediaAsset&callback=?",function(data){chalReqCount=parseInt(chalReqCount+1);var scene={h:data.startScene.handle,ch:sandbox[0],t:data.title,d:data.startScene.description,a:data.startScene.createdBy,th:data.startScene.mediaAsset.url,tp:"storymaker",p:data.phase.toLowerCase(),c:data.startScene.children};conf.challengeSceneArray.push(scene);if(chalReqCount===conf.sandboxes.length){cdc.sml.renderChallengeCarousel();}});}else{$j.getJSON("/proxy/index.php/cccp/group/get.htm",{id:sandbox[0],include:"groupChallenge"},function(data){if(data){chalReqCount=parseInt(chalReqCount+1);var imageUrl=$j.cdc.constants.getDatanodeUrl()+"/images/current/studios/sml/challenges/logo.jpg";var scene={h:sandbox[0],ch:sandbox[0],t:data.name,d:data.description,a:"",th:imageUrl,tp:"text_only",p:data.challenge.phase.toLowerCase(),c:""};conf.challengeSceneArray.push(scene);if(chalReqCount===conf.sandboxes.length){cdc.sml.renderChallengeCarousel();}}});}});},renderChallengeCarousel:function(){var challengeList=$j("#sml-challenges-list").empty().detach();var tempChallengeSceneArray=conf.challengeSceneArray;conf.challengeSceneArray=[];$j.each(conf.sandboxes,function(s,sandbox){$j.each(tempChallengeSceneArray,function(i,item){if(item.ch===sandbox[0]){conf.challengeSceneArray.push(item);if(conf.challengeSceneArray.length===conf.sandboxes.length){$j.each(conf.challengeSceneArray,function(c,chal){if(c===0){cdc.sml.log(chal);cdc.sml.log("chal.ch: "+chal.ch);conf.activeSandboxHandle=chal.ch;conf.activeScene.handle=chal.h;conf.activeScene.title=chal.t;conf.activeScene.type=chal.tp;cdc.sml.setCookie(chal.h);conf.activeSandboxPhase=chal.p;}if(chal.tp==="text_only"){challengeList.append('<li id="chal'+chal.ch+'" data-handle="'+chal.h+'" data-phase="'+chal.p+'" data-sandbox="'+chal.ch+'" data-type="text_only" data-thurl="'+chal.th+'"><img src="'+conf.transImage+'" height="105" width="514" /><div class="c-thumb"><div class="border"><img src="'+chal.th+'" width="120" height="90"/></div></div><div class="copy jspContainer"><b class="title">'+chal.t+'</b><span class="desc"> '+chal.d+"</span></div></li>");}else{challengeList.append('<li id="chal'+chal.ch+'" data-handle="'+chal.h+'" data-phase="'+chal.p+'" data-sandbox="'+chal.ch+'" data-type="storymaker" data-desc="'+chal.d+'" data-thurl="'+chal.th+'" data-title="'+chal.t+'"><img src="'+conf.transImage+'" height="105" width="514" /><div class="c-thumb"><div class="border"><img src="'+chal.th+'" width="120" height="90"/></div></div><div class="copy jspContainer"><b class="title">'+chal.t+'</b><span class="desc"> '+chal.d+"</span></div></li>");}if((c+1)===conf.sandboxes.length){cdc.sml.log((c+1)+"-"+conf.sandboxes.length);$j("#sml-challenges").append(challengeList);cdc.sml.initCarousel();$j(".jspContainer").jScrollPane({autoReinitialise:true});cdc.sml.updateCards(conf.activeScene.handle,conf.activeScene.type,"");}});}}});});},addYourOwnCancel:function(){$j("#sml-add-entry-card").stop().animate({bottom:-340},250,"easeOutQuad",function(){$j("#sml-add-entry-container").fadeOut(250,function(){$j("#sml-image-search-results, #sml-add-entry-text, #sml-add-entry-card .image").empty();$j("#imageSearchTerms, #selectedImgUrl").val("");$j("#smlImageSearchNext, #smlImageSearchPrev").hide();});});},addYourOwn:function(event){console.log("addYourOwn: "+event);if(!cdc.sml.checkWriteStatus(null)){cdc.sml.showLoginMask();return false;}$j("#cNext, #cPrev").fadeOut(250,function(){$j("#sml-add-entry-container").fadeIn(250,function(){$j("#sml-add-entry-card").animate({bottom:12},250,"easeOutQuad");});});},checkWriteStatus:function(event){if(!event){if(!$j.cdc.user.isLoggedIn()&&!$j.cdc.user.isEmailVerified()){return false;}}if(!$j.cdc.user.isLoggedIn()){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return false;}if(!current.Authorize.checkWriteMode(event)){event.preventDefault();return false;}return true;},displaySearchResults:function(resultArray){$j("#sml-image-search-results").empty();$j.each(resultArray,function(i,image){if(i<4){$j('<a class="sml-search-thumb" data-src="'+image.url+'" data-tburl="'+image.tbUrl+'" href="#"><img src="'+image.tbUrl+'" height="90" width="120"/></a>').appendTo("#sml-image-search-results");}});},imageSearch:function(){$j.getJSON("http://www.google.com/uds/GimageSearch?&rsz=large&hl=en&source=gsc&gss=.com&q="+$j("#imageSearchTerms").val()+"&v=1.0&start="+conf.imageSearchPage+"&nocache=1297894767023&imgsz=small|medium|large|xlarge&as_rights=(cc_publicdomain|cc_attribute|cc_sharealike|cc_noncommercial|cc_nonderived)&callback=?",function(result){if(result){if(result.responseStatus===200){cdc.sml.displaySearchResults(result.responseData.results);}else{cdc.sml.log("Error searching for images!");}}else{cdc.sml.log("Error searching for images!");}});},showLoginMask:function(){$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><h2>Would you like to help develop Bar Karma?</h2><br/> <h3>Unlock the ability to create your own scenes in the story by <a href="#" class="sml-login-link">logging in</a> to Current.com.</h3></div></div>');$j("#sml-mask-lower").fadeIn(250);},showProcessingMask:function(){$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="pitchSuccessMsg"><img class="clearBoth" style="margin: 100px auto;" src="'+conf.dn+'/images/barca/white/icons/loadingIcon.gif" /></div></div></div>');$j("#sml-mask-lower").fadeIn(250);},hideMasks:function(){$j("#sml-mask").empty();$j("#sml-mask").hide();$j("#sml-mask-lower").empty();$j("#sml-mask-lower").hide();},getCookie:function(){if($j.cookie("_sml")){conf.handleHistory=$j.parseJSON($j.cookie("_sml"));}else{conf.handleHistory=[];}},createImageAsset:function(imageUrl,text){cdc.sml.showProcessingMask();if(imageUrl!==""&&text!==""){$j.post("/proxy/index.php/cccp/assets/create.htm",{url:imageUrl,assetType:"image",apiKey:"jrhm4c"},function(response){if(response&&response.handle!==""){cdc.sml.log(response);var mediaAssetHandle=response.handle;cdc.sml.createScene(mediaAssetHandle,text);}else{$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="maskErrorMsg"><h3>Oops!</h3>The picture you selected could not be added.<br/><br/><a href="#" class="hide-mask-lower">Please select another image.</div></div></div>');$j("#sml-mask-lower").fadeIn(250);return false;}});}},createScene:function(mediaAssetHandle,text){if(mediaAssetHandle!==""&&text!==""){$j.post("/proxy/index.php/cccp/scenes/create.htm",{sandboxHandle:conf.activeSandboxHandle,mediaAssetHandle:mediaAssetHandle,sourceSceneHandle:"",description:text,title:"",apiKey:"jrhm4c"},function(response){if(response&&response.handle){cdc.sml.log(response);conf.handleHistory.push(response.handle);cdc.sml.createStoryline(conf.activeSandboxHandle,conf.handleHistory.toString());}else{$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="maskErrorMsg"><h3>Oops!</h3>There was a problem creating your scene. <br/><br/><a href="#" class="hide-mask-lower">Please try again.</div></div></div>');$j("#sml-mask-lower").fadeIn(250);return false;}});}},createStoryline:function(sandboxHandle,sceneHandles){$j.post("/proxy/index.php/cccp/storylines/create.htm",{sandboxHandle:sandboxHandle,sceneHandles:sceneHandles,sourceStorylineHandle:"",apiKey:"jrhm4c"},function(response){if(response&&response.handle){cdc.sml.log(response);$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="pitchSuccessMsg"><h3>Congratulations! You just contributed to the making of Bar Karma. Since you\'ve come this far, why not find other ways to play?</h3><br/><br/><a href="/storymaker.htm?sandbox='+conf.activeSandboxHandle+"&lines="+response.handle+'" class="smappBtn"><div class="Sprites Button lgButton lgBlueButton" style="width:370px">continue your storyline in storymaker</div></a><a href="/studios/create-episodes/"><div class="Sprites Button lgButton lgBlueButton">Browse all challenges</div></a></div></div></div>');$j("#sml-mask-lower").fadeIn(250);}else{$j("#sml-mask-lower").html('<div id="sml-alert-container"><div class="inner"><div class="maskErrorMsg"><h3>Oops!</h3>There was a problem creating your new storyline. <br/><br/><a href="#" class="hide-mask-lower">Please try again.</div></div></div>');$j("#sml-mask-lower").fadeIn(250);return false;}});},setCookie:function(handle){conf.handleHistory.push(handle);$j.cookie("_sml","["+conf.handleHistory+"]",{path:"/",domain:".current.com"});},resetCookie:function(handle){conf.handleHistory.length=0;cdc.sml.setCookie(handle);},init:function(sandboxes){$j(document).ready(function($j){if(sandboxes){conf.sandboxes=sandboxes;setup();}else{alert("No challenge info provided.");}});}};})();cdc.smlTextPitcher=$j.klass({initialize:function(options){this.o=$j.extend({},options);this.o.e={form:$j(this.element),textarea:$j(this.element).find("textarea").first(),submit:$j(this.element).find("input[type=submit]").first()};this.o.e.textarea.attach(this.textarea,this.o);this.o.e.submit.attach(this.submit,this.o);this.o.e.textintival=this.o.e.textarea.val();},textarea:$j.klass({initialize:function(o){this.o=o;if($j.cdc.user.isLoggedIn()){$j(this.element).focus();}else{$j(this.element).blur();}},onblur:function(event){if(!$j(this.element).val()){$j(this.element).val(this.o.e.textintival);}},onfocus:function(event){if(!$j.cdc.user.isLoggedIn()){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);$j(this.element).blur();return ;}if(!current.Authorize.checkWriteMode(event)){event.preventDefault();$j(this.element).blur();return ;}if($j(this.element).val()==this.o.e.textintival){$j(this.element).val("");}}}),submit:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){event.preventDefault();if(!$j.cdc.user.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}if(!Validation.validate(this.o.e.textarea)){$j(this.o.e.textarea).focus();return ;}if(!$j(this.o.e.textarea).val()||($j(this.o.e.textarea).val()==this.o.e.textintival)){$j(this.o.e.textarea).after('<div class="validation-advice error">Enter your response above.</div>');$j(this.o.e.textarea).focus();return ;}else{$j(this.o.e.form).find(".error").remove();$j(this.element).val(current.locale.Bundle.get("submitting")+"...");$j(this.element).fadeTo(0,0.5);var obj=this.o.e;$j.post(current.Constants.getInstance().getScriptName()+"/pitch_ajax_post/",$j(this.o.e.form).serialize(),function(data){if(data.error){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+data.error+"</div>");return ;}if(data.url){obj.form.after('<div class="pitchSuccessMsg">Thanks for adding your response!<br/><br/><a href="'+data.group_url+'"><div class="Sprites Button lgButton lgBlueButton">view all responses</div></a><a href="'+data.url+'"><div class="Sprites Button lgButton lgBlueButton">edit your response</div></a></div>').fadeIn(250);obj.form.fadeOut(200);return ;}},"json");$j(this.o.e.form).ajaxError(function(event,request,settings){if(request.status!=="200"){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+current.locale.Bundle.get("verify.An_error_has_occurred")+" "+current.locale.Bundle.get("error.tryAgain")+"</div>");return ;}});return ;}}})});cdc.smtxtComment=$j.klass({initialize:function(options){this.o=$j.extend({},options);this.o.e={form:$j(this.element),textarea:$j(this.element).find("textarea").first(),submit:$j(this.element).find("input[type=submit]").first(),overlay:$j("#hint_overlay")};this.o.e.textarea.attach(this.textarea,this.o);this.o.e.submit.attach(this.submit,this.o);this.o.e.overlay.attach(this.overlay,this.o);this.o.e.textintival=this.o.e.textarea.val();this.o.e.overlay.show();},overlay:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){this.o.e.overlay.hide();this.o.e.textarea.focus();return false;}}),textarea:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){if(!$j(this.element).val()||($j(this.element).val()==this.o.e.textintival)){$j(this.element).focus();return false;}},onblur:function(event){if(!$j(this.element).val()){$j(this.element).val(this.o.e.textintival);this.o.e.overlay.show();}},onfocus:function(event){if($j(this.element).val()==this.o.e.textintival){$j(this.element).val("");this.o.e.overlay.hide();}if(!$j.cdc.user.isLoggedIn()){event.preventDefault();current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);$j(this.element).blur();return ;}if(!current.Authorize.checkWriteMode(event)){event.preventDefault();$j(this.element).blur();return ;}}}),submit:$j.klass({initialize:function(o){this.o=o;},onclick:function(event){event.preventDefault();if(!$j.cdc.user.isLoggedIn()){current.Authorize.forceLogin(event,current.components.account.LoginActivity.COMMENT);return ;}if(!current.Authorize.checkWriteMode(event)){return ;}if(!Validation.validate(this.o.e.textarea)){$j(this.o.e.textarea).focus();return ;}if(!$j(this.o.e.textarea).val()||($j(this.o.e.textarea).val()==this.o.e.textintival)){$j(this.o.e.textarea).after('<div class="validation-advice error">Enter your response above.</div>');$j(this.o.e.textarea).focus();return ;}else{$j(this.o.e.form).find(".error").remove();$j(this.element).val(current.locale.Bundle.get("submitting")+"...");$j(this.element).fadeTo(0,0.5);var obj=this.o.e;$j.post(current.Constants.getInstance().getScriptName()+"/pitch_ajax_post/",$j(this.o.e.form).serialize(),function(data){if(data.error){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+data.error+"</div>");return ;}if(data.url){obj.form.after('<div class="pitchSuccessMsg">Thanks for adding your response!<br/><br/><a href="'+data.group_url+'"><div class="Sprites Button lgButton lgBlueButton">view all responses</div></a><a href="'+data.url+'"><div class="Sprites Button lgButton lgBlueButton">edit your response</div></a></div>');obj.form.fadeOut(200);obj.overlay.remove();return ;}},"json");$j(this.o.e.form).ajaxError(function(event,request,settings){if(request.status!=="200"){obj.submit.fadeTo(0,1);obj.submit.val(current.locale.Bundle.get("submit"));obj.textarea.after('<div class="validation-advice error">'+current.locale.Bundle.get("verify.An_error_has_occurred")+" "+current.locale.Bundle.get("error.tryAgain")+"</div>");return ;}});return ;}}})});cdc.smtxtCommentInit=$j.klass({initialize:function(options){this.o=$j.extend({},options);$j.getJSON("/proxy/index.php/cccp/group/get.htm?id="+this.o.group+"&include=groupChallenge",function(data){var descTxt="Submit your response and help decide the fate of Bar Karma. If Producers pick your suggestion, it could end up on TV!";$j("#sml-challenges-list").find(".title").first().html(data.name);$j("#sml-challenges-list").find(".desc").first().html(data.description);var imageUrl=$j.cdc.constants.getDatanodeUrl()+"/images/current/studios/sml/challenges/logo.jpg";if(data.challenge.imageUrl){imageUrl=$j.cdc.constants.getDatanodeUrl()+data.challenge.imageUrl;}$j("#sml-challenges-list").find(".border").first().html('<img src="'+imageUrl+'" width="114" />');$j("#sml-textonly-card-container").find(".inner").load(current.Constants.getInstance().getScriptName()+"/pitcher.htm?modal=true&groupSlug="+data.slug+"&groupTitle="+encodeURI(data.name)+"&challengeType=TEXT_ONLY&descHint="+encodeURI(descTxt));});$j("#sml-textonly-card-container").ajaxComplete(function(){$j("#pitcherForm").find("textarea").first().removeClass("validate-max8000");$j("#pitcherForm").find("textarea").first().addClass("validate-max3000");$j("#pitcherForm").attach(cdc.smtxtComment);});}});cdc.linkselector=$j.klass({initialize:function(options){this.o=$j.extend({},options);var v={};v.parent=$j(this.element);v.parentOffset=v.parent.find("ul.options").offset();v.activeOffset=v.parent.find("ul.options").find("a.active").parent().offset();v.top=v.activeOffset.top-v.parentOffset.top;v.parent.find("a.selected").click(function(event){event.preventDefault();$j(this).next().show(0,function(){if(v.top>1){v.top=v.top-6;v.parent.find("ul.options").css({top:"-"+v.top+"px"});}else{v.top=v.top+5;v.parent.find("ul.options").css({top:v.top+"px"});}}).animate({opacity:1},250);return false;});v.parent.find("ul.options li a").click(function(){});v.parent.find("ul.options li a").mousedown(function(){v.parent.find("a.selected span.value").text($j(this).text());v.parent.find("ul.options li a.active").removeClass("active");return false;});v.parent.find("ul.options li a").mouseup(function(){$j(this).addClass("active").parent().parent().animate({opacity:0},150).hide(0);return false;});v.parent.find("ul.options").mouseleave(function(){$j(this).fadeOut();return false;});}});var cdcstudios=cdcstudios||{};cdcstudios.Storyline=function(selectorOrElement,autoplay){this.__domElement=$j(selectorOrElement);this.__autoStart=autoplay;this.__initialize();cdcstudios.Storyline.instances.push(this);};cdcstudios.Storyline.instances=[];cdcstudios.Storyline.SCENE_INDEX_PREVIOUS=-1;cdcstudios.Storyline.SCENE_INDEX_NEXT=-2;cdcstudios.Storyline.AUTOFORWARD_DELAY_SLOW=5000;cdcstudios.Storyline.AUTOFORWARD_DELAY_MEDIUM=2500;cdcstudios.Storyline.AUTOFORWARD_DELAY_FAST=1000;cdcstudios.Storyline.MESSAGE_IMAGE_ERROR="Sorry. We can't find the image.";cdcstudios.Storyline.ANIMATION_DURATION=500;cdcstudios.Storyline.THUMB_INFO_OFFSET_X=-71;cdcstudios.Storyline.THUMB_INFO_OFFSET_Y=-56;cdcstudios.Storyline.INFOTYPE_CREDITS="credits";cdcstudios.Storyline.INFOTYPE_OPTIONS="options";cdcstudios.Storyline.INFOTYPE_SHARE="share";cdcstudios.Storyline.pauseAll=function(){var instanceCount=cdcstudios.Storyline.instances.length;for(var i=0;i<instanceCount;i++){cdcstudios.Storyline.instances[i].pause();}};cdcstudios.Storyline.prototype={__initialize:function(){this.__bodyDomElement=$j(".body",this.__domElement);this.__scrollContainerDomElement=$j(".scroll-container",this.__bodyDomElement);try{var cfg=$j.parseJSON(this.__bodyDomElement.attr("rel"));this._itemId=cfg.id;this._sandboxHandle=cfg.sandboxHandle;this._storylineHandle=cfg.storylineHandle;}catch(e){}if(this.__scrollContainerDomElement.length){this.__finalInit();}},loadData:function(){if(this.__scrollContainerDomElement.length){return ;}if(!this._itemId){return ;}ContentItemService.fetchStorylineItem(this._itemId,this.__populateData.bindAsEventListener(this));},__populateData:function(data){this.__scrollContainerDomElement=$j("<ul />").addClass("scroll-container").appendTo(this.__bodyDomElement);if(data.sceneItems&&data.sceneItems.length){for(var i=0;i<data.sceneItems.length;i++){var itemData=data.sceneItems[i];var user=itemData.addedUser;var assetThumbObj=new current.components.assets.ThumbUrl(itemData);var titleText="Scene "+(i+1);var userText="by ";var userLink=current.Constants.getInstance().getScriptName()+"/users/"+user.username+".htm";var removed=itemData.visibility!="VISIBLE"||itemData.status=="STATUS_REJECTED";var previewUrl,thumbUrl,description,itemClass;if(removed){previewUrl=current.Constants.getInstance().getDatanodeUrl()+"/images/current/studios/icon_banned_60x45.png";thumbUrl=current.Constants.getInstance().getDatanodeUrl()+"/images/current/studios/icon_banned_320x240.png";description="This scene has been removed";itemClass="item removed";}else{previewUrl=assetThumbObj.getThumbnailBySize(60,45,".jpg");thumbUrl=assetThumbObj.getThumbnailBySize(320,240,".jpg");description=itemData.contentText.replace(/<.*?>/g,"");description=description.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");itemClass="item";}var showCredits=data.parentGroup&&data.parentGroup.challenge&&(data.parentGroup.challenge.phase.toLowerCase()!="pitch");var communityFavorite=false;var producerPick=false;var creditedOnAir=false;if(showCredits&&itemData.badges){for(var j=0;j<itemData.badges.length;j++){var badge=itemData.badges[j];if(badge.slug=="community-favorite"){communityFavorite=true;}if(badge.slug=="producer-pick"){producerPick=true;}if(badge.slug=="credited-on-air"){creditedOnAir=true;}}}$j("<li />").attr("rel",'{"id":'+itemData.id+', "handle":"'+itemData.sceneHandle+'"}').addClass(itemClass).append($j("<img />").attr("src",current.Constants.getInstance().getDatanodeUrl()+"/images/current/spacer.gif").attr("longDesc",previewUrl).addClass("preview")).append($j("<img />").attr("src",current.Constants.getInstance().getDatanodeUrl()+"/images/current/spacer.gif").attr("longDesc",thumbUrl).addClass("image")).append($j("<div />").addClass("info").append($j("<span />").addClass("title").text(titleText)).append($j("<span />").addClass("submitted").append($j("<span />").addClass("badges").append($j("<span />").addClass("Sprites studiosCRBadge"+(communityFavorite?"Fill":"")+" floatLeft").attr("title","Community Recommended")).append($j("<span />").addClass("Sprites studiosPPBadge"+(producerPick?"Fill":"")+" floatLeft").attr("title","Producer's Pick")).append($j("<span />").addClass("Sprites studiosCABadge"+(creditedOnAir?"Fill":"")+" floatLeft").attr("title","Credited on Air"))).append($j("<span />").addClass("submittedBy").text(userText).append($j("<a />").attr("href",userLink).text(user.username)))).append($j("<span />").addClass("description").html(description))).appendTo(this.__scrollContainerDomElement);}}this.__finalInit();},__finalInit:function(){this.__previousButtonDomElement=$j(".head .btn-previous",this.__domElement).get(0);this.__nextButtonDomElement=$j(".head .btn-next",this.__domElement).get(0);this.__playButtonDomElement=$j(".navigation .btn-play",this.__domElement).get(0);this.__openButtonDomElement=$j(".head .btn-open",this.__domElement).get(0);this.__settingsDialogDomElement=$j(".settings .dialog",this.__domElement);this.__creditsButtonDomElement=$j(".navigation .settings a.credits",this.__domElement).get(0);this.__optionsButtonDomElement=$j(".navigation .settings a.options",this.__domElement).get(0);this.__shareButtonDomElement=$j(".navigation .settings a.share",this.__domElement).get(0);this.__settingsCloseButtonDomElement=$j(".navigation .settings .btn-close",this.__domElement).get(0);this.__flagDomElement=$j(".body .flag",this.__domElement).get(0);this.__flagButtonDomElement=$j(".body .flag a.flaggable",this.__domElement).get(0);this.__sceneFlag=Flag.getInstance(true);this.__adminDeleteButtonDomElement=$j(".body .flag a.adminDelete",this.__domElement).get(0);this.__adminDeletedLinkDomElement=$j(".body .flag .adminDeletedLink",this.__domElement).get(0);if(this.__adminDeleteButtonDomElement){this.__adminModal=current.content.items.ItemAdminModal.getInstance();}this.__optionsSlowButtonDomElement=$j(".info.options .option.slow",this.__settingsDialogDomElement).get(0);this.__optionsMediumButtonDomElement=$j(".info.options .option.medium",this.__settingsDialogDomElement).get(0);this.__optionsFastButtonDomElement=$j(".info.options .option.fast",this.__settingsDialogDomElement).get(0);this.__thumbInfoDomElement=$j("<div />").addClass("thumb-info").appendTo(this.__domElement);this.__thumbInfoDomElement.append($j("<div />").addClass("load-indicator")).append($j("<div />").addClass("preview")).append($j("<div />").addClass("index"));this.__sceneCount=$j(".item",this.__bodyDomElement).length;var thisObj=this;this.__domElement.click(function(event){thisObj.__clickHandler(event);}).delegate(".thumb:lt("+this.__sceneCount+")","hover",function(event){thisObj.__thumbHoverHandler(event);});this.__itemWidth=$j(".item:eq(0)",this.__bodyDomElement).width();this.__sceneDomElements=[];this.__thumbInfoPositions=[];this.__thumbDomElements=$j(".thumb:lt("+this.__sceneCount+")",this.__domElement).toArray();$j(this.__thumbDomElements).addClass("active");this.__setAutoForwardDelay(cdcstudios.Storyline.AUTOFORWARD_DELAY_MEDIUM);this.__visibleSceneIndex=-1;this.__highlightedSceneIndex=-1;this.__waitingImage=undefined;this.moveToScene(this.__sceneCount-1);this.__domElement.get(0).onselectstart=function(){if(!thisObj.__allowSelection){return false;}};if(this.__autoStart){this.play();}},__clickHandler:function(event){var target=event.target;if(target==this.__previousButtonDomElement){event.preventDefault();cdcstudios.Storyline.pauseAll();this.moveToScene(cdcstudios.Storyline.SCENE_INDEX_PREVIOUS);}else{if(target==this.__nextButtonDomElement){event.preventDefault();cdcstudios.Storyline.pauseAll();this.moveToScene(cdcstudios.Storyline.SCENE_INDEX_NEXT);}else{if($j(target).closest(".thumb.active").length){cdcstudios.Storyline.pauseAll();this.moveToScene(parseInt($j(target).closest(".thumb").text())-1);}else{if(target==this.__openButtonDomElement){event.preventDefault();cdcstudios.Storyline.pauseAll();var url=current.Constants.getInstance().getScriptName()+"/storymaker.htm?sandbox="+this._sandboxHandle+"&lines="+this._storylineHandle;this._winFeatures="width="+screen.width;this._winFeatures+=", height="+screen.height;this._winFeatures+=", top=0, left=0";this._winFeatures+=", fullscreen=yes";this._newWindow=window.open(url,"storymaker"+this._sandboxHandle,this._winFeatures);if(window.focus){this._newWindow.focus();}}else{if($j(target).closest(".btn-play").length){if($j(this.__playButtonDomElement).hasClass("pause")){this.pause();}else{this.play();}}else{if(target==this.__creditsButtonDomElement){this.__showSettingsDialog(this.__currentSettingsDialog===cdcstudios.Storyline.INFOTYPE_CREDITS?null:cdcstudios.Storyline.INFOTYPE_CREDITS);}else{if(target==this.__optionsButtonDomElement){this.__showSettingsDialog(this.__currentSettingsDialog==cdcstudios.Storyline.INFOTYPE_OPTIONS?null:cdcstudios.Storyline.INFOTYPE_OPTIONS);}else{if(target==this.__shareButtonDomElement){this.__showSettingsDialog(this.__currentSettingsDialog==cdcstudios.Storyline.INFOTYPE_SHARE?null:cdcstudios.Storyline.INFOTYPE_SHARE);}else{if(target==this.__flagButtonDomElement){event.preventDefault();this.pause();if(this.__highlightedSceneIndex>=0&&this.__sceneDomElements[this.__highlightedSceneIndex]){var sceneHandle=null;try{sceneHandle=$j.parseJSON($j(this.__sceneDomElements[this.__highlightedSceneIndex]).attr("rel")).handle;}catch(e){return ;}this.__sceneFlag.setContentType("scene");this.__sceneFlag.setContentId(sceneHandle);this.__sceneFlag.__onFlaggableClick(event);}}else{if(this.__adminDeleteButtonDomElement&&target==this.__adminDeleteButtonDomElement){event.preventDefault();this.pause();if(this.__highlightedSceneIndex>=0&&this.__sceneDomElements[this.__highlightedSceneIndex]){var sceneHandle=null;try{sceneHandle=$j.parseJSON($j(this.__sceneDomElements[this.__highlightedSceneIndex]).attr("rel")).handle;}catch(e){return ;}this.__adminModal.setOperation("delete");this.__adminModal.setContentType("scene");this.__adminModal.setContentId(sceneHandle);this.__adminModal.openAdminModal(sceneHandle);}}else{if(target==this.__settingsCloseButtonDomElement){this.__showSettingsDialog(null);}else{if($j(target).closest(".slow").length){this.__setAutoForwardDelay(cdcstudios.Storyline.AUTOFORWARD_DELAY_SLOW);}else{if($j(target).closest(".medium").length){this.__setAutoForwardDelay(cdcstudios.Storyline.AUTOFORWARD_DELAY_MEDIUM);}else{if($j(target).closest(".fast").length){this.__setAutoForwardDelay(cdcstudios.Storyline.AUTOFORWARD_DELAY_FAST);}else{if($j(target).hasClass("share-url")){$j(target).select();}}}}}}}}}}}}}}}},__thumbHoverHandler:function(event){if(event.type=="mouseover"){this.__showThumbInfo($j(event.target).closest(".thumb"));}else{this.__showThumbInfo(null);}},__setAutoForwardDelay:function(delay){this.__autoForwardDelay=delay;switch(delay){case cdcstudios.Storyline.AUTOFORWARD_DELAY_SLOW:$j(this.__optionsSlowButtonDomElement).addClass("selected").siblings(".option").removeClass("selected");break;case cdcstudios.Storyline.AUTOFORWARD_DELAY_MEDIUM:$j(this.__optionsMediumButtonDomElement).addClass("selected").siblings(".option").removeClass("selected");break;case cdcstudios.Storyline.AUTOFORWARD_DELAY_FAST:$j(this.__optionsFastButtonDomElement).addClass("selected").siblings(".option").removeClass("selected");break;default:throw ("__setAutoForwardDelay() accepts the predefined delay values AUTOFORWARD_DELAY_SLOW, AUTOFORWARD_DELAY_MEDIUM, and AUTOFORWARD_DELAY_FAST only.");}},moveToScene:function(targetSceneIndex,callback){if(this.__isAnimating){if(callback){callback.apply(thisObj);}return ;}if(targetSceneIndex==cdcstudios.Storyline.SCENE_INDEX_PREVIOUS){targetSceneIndex=this.__highlightedSceneIndex-1;}else{if(targetSceneIndex==cdcstudios.Storyline.SCENE_INDEX_NEXT){targetSceneIndex=this.__highlightedSceneIndex+1;}}if(targetSceneIndex<0){targetSceneIndex=this.__sceneCount-1;}else{if(targetSceneIndex>this.__sceneCount-1){targetSceneIndex=0;}}if(targetSceneIndex===undefined||targetSceneIndex===this.__highlightedSceneIndex){if(callback){callback.apply(thisObj);}return ;}if(this.__waitingImage!==undefined){this.__showLoaderOverlay(false);this.__waitingImage.unbind().attr("src","");this.__waitingImage=undefined;this.__sceneDomElements[this.__highlightedSceneIndex].css("display","none");}if(targetSceneIndex===this.__visibleSceneIndex){if(this.__highlightedSceneIndex>=0&&this.__thumbDomElements[this.__highlightedSceneIndex]){$j(this.__thumbDomElements[this.__highlightedSceneIndex]).removeClass("highlight");}$j(this.__thumbDomElements[targetSceneIndex]).addClass("highlight");this.__highlightedSceneIndex=targetSceneIndex;if(callback){callback.apply(thisObj);}return ;}var isTargetOnLeft=(this.__visibleSceneIndex==-1&&targetSceneIndex<this.__highlightedSceneIndex)||(this.__visibleSceneIndex>-1&&targetSceneIndex<this.__visibleSceneIndex);var visibleSceneDomElement=this.__visibleSceneIndex>=0?this.__sceneDomElements[this.__visibleSceneIndex]:null;$j(visibleSceneDomElement).css({zIndex:10});if(this.__visibleSceneIndex==-1){this.__scrollContainerDomElement.css("left",-this.__itemWidth);}if(!this.__sceneDomElements[targetSceneIndex]){this.__sceneDomElements[targetSceneIndex]=$j(".item:eq("+targetSceneIndex+")",this.__scrollContainerDomElement).css({zIndex:0,display:"block"});$j(".description",this.__sceneDomElements[targetSceneIndex]).jScrollPane({showArrows:true,hideFocus:true,mouseWheelSpeed:1});}else{this.__sceneDomElements[targetSceneIndex].css({zIndex:0,display:"block"});var jScrollPaneApi=$j(".description",this.__sceneDomElements[targetSceneIndex]).data("jsp");if(jScrollPaneApi){jScrollPaneApi.scrollToY(0);}}var targetSceneDomElement=this.__sceneDomElements[targetSceneIndex];if(this.__highlightedSceneIndex>=0&&this.__thumbDomElements[this.__highlightedSceneIndex]){$j(this.__thumbDomElements[this.__highlightedSceneIndex]).removeClass("highlight");}$j(this.__thumbDomElements[targetSceneIndex]).addClass("highlight");this.__highlightedSceneIndex=targetSceneIndex;var thisObj=this;var __loadScene=function(){var sceneImage=$j(".image",targetSceneDomElement);if(sceneImage.hasClass("loaded")){__switchScene();}else{thisObj.__waitingImage=sceneImage;thisObj.__showLoaderOverlay();sceneImage.attr("src","").load(function(){$j(thisObj).unbind().addClass("loaded").parent().removeClass("error");thisObj.__showLoaderOverlay(false);thisObj.__waitingImage=undefined;__switchScene();}).error(function(){$j(thisObj).unbind().attr("src","").parent().addClass("error");if(!$j(".error-overlay",$j(this).parent()).length){$j(thisObj).parent().append($j("<div />").addClass("error-overlay").html(cdcstudios.Storyline.MESSAGE_IMAGE_ERROR));}thisObj.__showLoaderOverlay(false);thisObj.__waitingImage=undefined;__switchScene();}).attr("src",sceneImage.attr("longDesc"));}};var __switchScene=function(){thisObj.__isAnimating=true;if(isTargetOnLeft){thisObj.__scrollContainerDomElement.css("left",-thisObj.__itemWidth);$j(visibleSceneDomElement).css("left",thisObj.__itemWidth);targetSceneDomElement.css("left",0);}else{thisObj.__scrollContainerDomElement.css("left",0);$j(visibleSceneDomElement).css("left",0);targetSceneDomElement.css("left",thisObj.__itemWidth);}var targetX=(isTargetOnLeft?0:-thisObj.__itemWidth);var removed=targetSceneDomElement.hasClass("removed");if(thisObj.__adminDeleteButtonDomElement){$j(thisObj.__adminDeleteButtonDomElement).hide();}if(thisObj.__adminDeletedLinkDomElement){$j(thisObj.__adminDeletedLinkDomElement).hide();}if(thisObj.__flagDomElement){$j(thisObj.__flagDomElement).hide();}thisObj.__scrollContainerDomElement.stop().animate({left:targetX},cdcstudios.Storyline.ANIMATION_DURATION,null,function(){$j(visibleSceneDomElement).css("display","none");thisObj.__scrollContainerDomElement.css("left",targetX);if(thisObj.__flagDomElement){$j(thisObj.__flagDomElement).show();}if(!removed&&thisObj.__adminDeleteButtonDomElement){$j(thisObj.__adminDeleteButtonDomElement).show();}if(removed&&thisObj.__adminDeletedLinkDomElement){$j(thisObj.__adminDeletedLinkDomElement).show();}thisObj.__isAnimating=false;if(callback){callback.apply(thisObj);}});thisObj.__visibleSceneIndex=targetSceneIndex;};__loadScene();},__showLoaderOverlay:function(show){if(show||show===undefined){if(!this.__loaderOverlayDomElement){this.__loaderOverlayDomElement=$j("<div />").addClass("loader-overlay").append($j("<div />").addClass("backdrop")).append($j("<div />").addClass("indicator")).appendTo(this.__bodyDomElement);}this.__loaderOverlayDomElement.css("display","block");}else{this.__loaderOverlayDomElement.css("display","none");}},play:function(){if(this.__autoForwardTimeoutId||$j(this.__playButtonDomElement).hasClass("pause")){return ;}cdcstudios.Storyline.pauseAll();$j(this.__playButtonDomElement).addClass("pause");var thisObj=this;var __scheduleNextMove=function(){if(!$j(this.__playButtonDomElement).hasClass("pause")){return ;}thisObj.__autoForwardTimeoutId=setTimeout(__autoForward,thisObj.__autoForwardDelay);};var __autoForward=function(){if(thisObj.__isAnimating||thisObj.__waitingImage){return ;}if(thisObj.__highlightedSceneIndex==thisObj.__sceneCount-2){thisObj.moveToScene(cdcstudios.Storyline.SCENE_INDEX_NEXT,thisObj.pause);}else{thisObj.moveToScene(cdcstudios.Storyline.SCENE_INDEX_NEXT,__scheduleNextMove);}};if(this.__highlightedSceneIndex==this.__sceneCount-2){this.moveToScene(cdcstudios.Storyline.SCENE_INDEX_NEXT,this.pause);}else{this.moveToScene(cdcstudios.Storyline.SCENE_INDEX_NEXT,__scheduleNextMove);}},pause:function(){if(this.__autoForwardTimeoutId){clearTimeout(this.__autoForwardTimeoutId);this.__autoForwardTimeoutId=undefined;}$j(this.__playButtonDomElement).removeClass("pause");},__showThumbInfo:function(thumbDomElement){if(thumbDomElement){var thumbIndex=parseInt($j(thumbDomElement).text());$j(".index",this.__thumbInfoDomElement).text(thumbIndex);var sceneDomElement=$j(".item:eq("+(thumbIndex-1)+")",this.__scrollContainerDomElement);if(sceneDomElement){var previewThumbUrl=$j(".preview",sceneDomElement).attr("longDesc");$j(".preview",this.__thumbInfoDomElement).css("background","url("+previewThumbUrl+") no-repeat");}if(!this.__thumbInfoPositions[thumbIndex]){var thumbOffset=$j(thumbDomElement).offset();var domOffset=$j(this.__domElement).offset();this.__thumbInfoPositions[thumbIndex]={x:thumbOffset.left-domOffset.left+cdcstudios.Storyline.THUMB_INFO_OFFSET_X,y:thumbOffset.top-domOffset.top+cdcstudios.Storyline.THUMB_INFO_OFFSET_Y};}this.__thumbInfoDomElement.css({left:this.__thumbInfoPositions[thumbIndex].x,top:this.__thumbInfoPositions[thumbIndex].y,display:"block"});}else{this.__thumbInfoDomElement.css("display","none");}},__showSettingsDialog:function(infoType){if(!infoType){this.__settingsDialogDomElement.css("display","none");this.__currentSettingsDialog=undefined;}else{$j(".info."+infoType,this.__settingsDialogDomElement).css("display","block").siblings(".info").css("display","none");$j(this.__settingsDialogDomElement).css("display","block");this.__currentSettingsDialog=infoType;if(infoType==cdcstudios.Storyline.INFOTYPE_SHARE){this.__allowSelection=true;$j("input",this.__settingsDialogDomElement).focus().select();this.__allowSelection=false;}}}};var cdcstudios=cdcstudios||{};cdcstudios.StudioSlideShow=function(selectorOrElement){this.__domElement=$j(selectorOrElement);this.__initialize();};cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_PREVIOUS=-1;cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_NEXT=-2;cdcstudios.StudioSlideShow.prototype={__initialize:function(){var thisObj=this;$j.blockUI.defaults.css.border="none";$j.blockUI.defaults.css.backgroundColor="transparent";$j.blockUI.defaults.overlayCSS.cursor="normal";$j.blockUI.defaults.css.cursor="normal";$j.blockUI.defaults.css.top="50%";$j.blockUI.defaults.css.left="0";$j.blockUI.defaults.css.marginTop="-270px";$j.blockUI.defaults.css.width="100%";$j.blockUI.defaults.css.height="500px";$j.blockUI.defaults.css.cursor="normal";$j.blockUI.defaults.fadeIn=250;$j.blockUI.defaults.fadeOut=250;$j.blockUI.defaults.overlayCSS.opacity=0.5;this.__contentDomElement=$j(".creation-slideshow-content",this.__domElement);this.__contentTitleDomElement=$j(".title",this.__contentDomElement);this.__contentImageDomElement=$j(".image-wrapper img",this.__contentDomElement);this.__contentInfoDomElement=$j(".info",this.__contentDomElement);this.__metaDomElement=$j(".meta",this.__contentDomElement);this.__itemCount=this.__metaDomElement.children().length;this.__currentItemIndex=-1;this.__imageCache=[];$j(".cta",this.__domElement).click(function(event){thisObj.__openHandler();});$j(".btn-close",this.__contentDomElement).click(function(event){thisObj.__closeHandler();});$j(".btn-previous",this.__contentDomElement).click(function(event){thisObj.__showItem(cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_PREVIOUS);});$j(".btn-next",this.__contentDomElement).click(function(event){thisObj.__showItem(cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_NEXT);});},__openHandler:function(){var thisObj=this;$j.blockUI.defaults.onBlock=function(){setTimeout(function(){thisObj.__showItem(0);},250);};$j.blockUI({message:this.__contentDomElement});},__closeHandler:function(){var cacheLength=this.__imageCache.length;for(var i=0;i<cacheLength;i++){delete this.__imageCache[i];this.__imageCache[i]=null;}this.__imageCache=[];this.__contentTitleDomElement.text("");this.__contentInfoDomElement.text("");this.__contentImageDomElement.attr("src","").css("opacity",0);$j.unblockUI();},__showItem:function(index){if(index==cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_NEXT){index=this.__currentItemIndex+1;}else{if(index==cdcstudios.StudioSlideShow.SHOW_ITEM_INDEX_PREVIOUS){index=this.__currentItemIndex-1;}}if(index<0){index=this.__itemCount-1;}else{if(index>this.__itemCount-1){index=0;}}this.__currentItemIndex=index;var currentItem=$j("li:eq("+index+")",this.__contentDomElement);var currentItemImage=$j("img",currentItem);this.__contentTitleDomElement.text(currentItemImage.attr("title"));this.__contentInfoDomElement.text($j("span",currentItem).text());var cachedImage=this.__imageCache[index];if(cachedImage){this.__contentImageDomElement.unbind().stop().css({opacity:0,marginLeft:cachedImage.css("marginLeft"),marginTop:cachedImage.css("marginTop")}).attr("src",cachedImage.attr("src")).animate({opacity:1});}else{var thisObj=this;this.__contentImageDomElement.unbind().stop().attr("src","").css("opacity",0).load(function(){$j(this).unbind().css({marginLeft:Math.round(-$j(this).width()*0.5),marginTop:Math.round(-$j(this).height()*0.5)}).animate({opacity:1});thisObj.__imageCache[index]=$j(this).clone();}).error(function(){$j(this).unbind();}).attr("src",currentItemImage.attr("longDesc"));}}};
