if(typeof HD=="undefined"||!HD){var HD={onLoadQueue:[],isYuiLoaded:false,util:{},loader:null,classMap:{},get:function(A){return YAHOO.util.Dom.get(A)
},getByClass:function(C,B,D,A,F,E){return YAHOO.util.Dom.getElementsByClassName.apply(YAHOO.util.Dom,arguments)
},addModules:function(A){for(var B in this.modules){A.addModule(this.modules[B])
}},insert:function(B){var A=this.getLoader();
if(A!==null){A.insert(B)
}},getLoader:function(){if(this.loader===null){this.loader=new YAHOO.util.YUILoader();
this.addModules(this.loader)
}return this.loader
},extend:function(E,F){for(var C=0,A=F.length;
C<A;
C++){var D=F[C];
for(var B in D.prototype){if(!E.prototype[B]){E.prototype[B]=D.prototype[B]
}}}},clone:function(C,B){var A={};
for(var D in C){if(B&&typeof C[D]=="object"){A[D]=this.clone(C[D],B)
}else{A[D]=C[D]
}}return A
},merge:function(C,B,A,E){for(var D in B){C[D]=B[D]
}return C
},register:function(A,B,C){HD.classMap[A]=B
},onLoad:function(A){if(typeof YAHOO!="undefined"){YAHOO.util.Event.onDOMReady(A)
}else{this.onLoadQueue.push(A)
}},addClass:function(A,B){YAHOO.util.Dom.addClass(A,B)
},removeClass:function(A,B){YAHOO.util.Dom.removeClass(A,B)
},replaceClass:function(B,A,C){YAHOO.util.Dom.replaceClass(B,A,C)
},hasClass:function(A,B){return YAHOO.util.Dom.hasClass(A,B)
},show:function(A){HD.removeClass(A,HD.CSS_CLASSES.HIDDEN)
},hide:function(A){HD.addClass(A,HD.CSS_CLASSES.HIDDEN)
},includeJs:function(C,D){var A=D;
var B=document.createElement("script");
B.type="text/javascript";
B.language="javascript";
B.src=C;
if(navigator.userAgent.indexOf("IE")>=0){B.onreadystatechange=function(){if(B&&("loaded"==B.readyState||"complete"==B.readyState)){B.onreadystatechange=null;
A()
}}
}else{B.onload=function(){B.onload=null;
A()
}
}document.getElementsByTagName("head")[0].appendChild(B)
},yuiLoaded:function(){for(var B=0,A=HD.onLoadQueue.length;
B<A;
B++){HD.onLoad(HD.onLoadQueue[B])
}},containsText:function(A,B){if(A===null){return false
}return A.indexOf(B)>-1
},pluck:function(F,D){var E=[];
for(var C=0,B=F.length;
C<B;
C++){var A=F[C];
if(A!=D){E.push(A)
}}F=E
},log:function(B,A){}};
HD.modules={hd:{name:"hd",type:"js",path:"hd.js",requires:[],skinnable:true},hd_common:{name:"hd_common",type:"js",path:"hd_common/hd_common.js",requires:[]},hd_dwr:{name:"hd_dwr",type:"js",path:"hd_dwr/hd_dwr.js",requires:[]},hd_event:{name:"hd_event",type:"js",path:"hd_event/hd_event.js",requires:[]},hd_paging:{name:"hd_paging",type:"js",path:"hd_paging/hd_paging.js",requires:["hd_event"],skinnable:true},hd_widget:{name:"hd_widget",type:"js",path:"hd_widget/hd_widget.js",requires:[],skinnable:true},hd_widget_cluster:{name:"hd_widget",type:"js",path:"hd_widget/hd_widget.js",requires:["hd_event"],skinnable:true},hd_gallery_widget:{name:"hd_gallery_widget",type:"js",path:"hd_gallery_widget/hd_gallery_widget.js",requires:["hd_paging"],skinnable:true},hd_detail_widget:{name:"hd_detail_widget",type:"js",path:"hd_detail_widget/hd_detail_widget.js",requires:[],skinnable:true},hd_upload_widget:{name:"hd_upload_widget",type:"js",path:"hd_upload_widget/hd_upload_widget.js",requires:[],skinnable:true},hd_comments_widget:{name:"hd_comments_widget",type:"js",path:"hd_comments_widget/hd_comments_widget.js",requires:[],skinnable:true},hd_most_popular_widget:{name:"hd_most_popular_widget",type:"js",path:"hd_most_popular_widget/hd_most_popular_widget.js",requires:[],skinnable:true},hd_monthly_widget:{name:"hd_monthly_widget",type:"js",path:"hd_monthly_widget/hd_monthly_widget.js",requires:[],skinnable:true},hd_member_widget:{name:"hd_member_widget",type:"js",path:"hd_member_widget/hd_member_widget.js",requires:[],skinnable:true},hd_email:{name:"hd_email",type:"js",path:"hd_email/hd_email.js",requires:[],skinnable:true}};
HD.SORTS={NEW_TO_OLD:"newToOld",OLD_TO_NEW:"oldToNew",HIGHEST_RATED:"highestRated",MOST_POPULAR:"mostPopular",MOST_VOTED:"mostVoted",MOST_VIEWED:"mostViewed",MOST_COMMENTED:"mostCommented"};
HD.CSS_CLASSES={WIDGET:"hdWidget",GALLERY:"hdGallery",MINI_GALLERY:"hdMiniGallery",DETAIL:"hdDetail",UPLOAD:"hdUpload",HANDLE:"hdHandle",CONTROL:"hdControl",CONTROL_PANEL:"hdControlPanel",CONTENT_PANEL:"hdContentPanel",SORT:"hdSort",MORE:"hdMore",LESS:"hdLess",PAGING:"hdPaging",PAGING_ARROW:"hdPagingArrow",PAGING_NONE:"hdNoPaging",NEXT:"hdNext",CURRENT:"hdCurrent",PREVIOUS:"hdPrevious",TITLE:"hdTitle",AUTHOR:"hdAuthor",LABEL:"hdLabel",VALUE:"hdValue",THUMB:"hdThumb",SMALL_THUMB:"hdSmallThumb",LARGE_THUMB:"hdLargeThumb",SMALL_THUMB_WRAPPER:"hdSmallThumbWrapper",LARGE_THUMB_WRAPPER:"hdLargeThumbWrapper",THUMB_OVERLAY:"hdThumbOverlay",DESCRIPTION:"hdDescription",COMMENTS:"hdComments",SUBMIT_COMMENT:"hdSubmitComment",COMMENT:"hdComment",CONSENT:"hdConsent",ITEM:"hdItem",DATE:"hdDate",SHARE:"hdShare",SEND_FRIEND:"hdSendFriend",SUBSCRIBE:"hdSubscribe",LOADING:"hdLoading",TOOL_TIP:"hdToolTip",HIDDEN:"hdHidden",WRAPPER:"hdWrapper",EMAIL:"hdEmail",EMAIL_FORM:"hdEmailForm",BLOG:"hdBlog",PHOTO:"hdPhoto",VIDEO:"hdVideo",VIDEO_PLAYER:"hdVideoPlayer",RATING:"hdRating",TAG_CLOUD:"hdTagCloud",TAG_LIST:"hdTagList",CATEGORIES:"hdCategories",CATEGORY:"hdCategory",TAG:"hdTag",TAGS:"hdTags",PREVIEW:"hdPreview",FULL:"hdFull",SHORT:"hdShort",MOST_POPULAR:"hdMostPopular",MONTHLY_BREAKDOWN:"hdMonthlyBreakdown",AUTHOR_BREAKDOWN:"hdAuthorBreakdown",STAR_ON:"hdStarOn",STAR_OFF:"hdStarOff",STAR_OVER:"hdStarOver",STAR_HALF:"hdStarHalf",SUBMIT:"hdSubmit",FIRST:"hdFirst",LAST:"hdLast",LEFT:"hdLeft",RIGHT:"hdRight",CENTER:"hdCenter",AGREEMENT:"hdAgreement",RATED:"hdRated",UNRATED:"hdUnrated",STATIC:"hdStatic",EMPTY:"hdEmpty",ERROR:"hdError",NAVIGATION:"hdNavigation",BACK:"hdBack",ACTIVE:"hdActive",LIST:"hdList",FEATURE_STORIES:"hdFeatureStories",CAROUSEL:"hdCarousel",EVENTS:"hdEvents",EVENT:"hdEvent",EVENT_RSVP:"hdEventRSVP",RIDES:"hdRides",RIDE:"hdRide",LOCATION:"hdLocation",VIEW_ALL:"hdViewAll",VIEW:"hdView",CONFIRMATION:"hdConfirmation",MEMBER:"hdMember",CLOSE:"hdClose",ACTION:"hdAction",RIDE_PLANNER:"hdRidePlanner",SHOW_VIEW:"hdShowView",SHOW_ALL:"hdShowAll",SHOW_MAX:"hdShowMax",SHOW_DEFAULT:"hdShowDefault",NO_FLASH:"hdNoFlash",MEDIA:"hdMedia",TYPE:"hdType",CONTEXT:"hdContext",SEPARATOR:"hdSeparator",TWEET:"hdTweet",RETWEET:"hdReTweet",REPLY:"hdReply",FACEOFF:"hdFaceoff"}
};HD.util.Common={observable:null,getObservable:function(){if(this.observable==null){this.observable=new HD.util.Observable()
}return this.observable
},compareString:function(B,A){return(B===A)?0:(B>A)?1:-1
},showOverlay:function(L,O,D,P,H){var J=HD.get("hdwcOverlay");
if(J){this.hideOverlay(H)
}this.getObservable().notifyObservers("overlayOpen");
var B=540>YAHOO.util.Dom.getViewportHeight()&&parseInt(P,10)>450;
if(B){P=YAHOO.util.Dom.getViewportHeight()-40
}if(!(typeof D=="number")){D=parseInt(D.replace(/px/g,""))
}if(!(typeof P=="number")){P=parseInt(P.replace(/px/g,""))
}var C=(YAHOO.util.Dom.getViewportWidth()/2)-(D/2);
var K=YAHOO.util.Dom.getDocumentScrollTop();
var A=((YAHOO.util.Dom.getViewportHeight()+K)/2)-(P/2);
C=Math.round(C);
A=Math.round(A);
var E={constraintoviewport:true,close:true,draggable:true,zIndex:100000,modal:true,visible:false,iframe:true,underlay:"shadow",x:C,y:A,height:typeof P=="number"?P+"px":P||null,width:typeof D=="number"?D+"px":D||null};
var G=new YAHOO.widget.Panel("hdwcOverlay",E);
G.setBody(L);
G.render(document.body);
G.center();
G.show();
var F=this;
var N=function(){var R=F.getObservable.call(F);
R.notifyObservers("overlayClose_Click");
HD.util.Common.hideOverlay(H)
};
var J=HD.get("hdwcOverlay");
var Q=HD.getByClass("hdClose","*",J);
if(Q.length>0){Q[0].onclick=N
}Q=HD.getByClass("container-close","a",J);
for(var I=0,M=Q.length;
I<M;
I++){Q[I].href="javascript:void(0)";
(function(){Q[I].onclick=N
})()
}if(B){YAHOO.util.Event.onContentReady("hdwcBody",function(){var S=HD.get("hdwcBody");
var R=HD.get("scrollableDiv");
if(S){S.style.height=(parseInt(P,10)-65)+"px"
}if(R){R.style.height=(parseInt(P,10)-90)+"px"
}});
YAHOO.util.Event.onContentReady("suggestions",function(){var S=YAHOO.util.Dom.getElementsByClassName("suggestionsContentWrapper","div");
if(S[0]){for(var R=0;
R<S.length;
R++){S[R].style.height=(parseInt(P,10)-65)+"px"
}}})
}this.overlay=G;
return J
},hideOverlay:function(A){if(this.overlay!=null){this.overlay.hide();
if(!A){this.overlay.destroy()
}this.getObservable().notifyObservers("overlayClose")
}},scrollOverlay:function(){if(this.overlay!=null){var D=this.overlay.getFocusableElements();
var C=D[0];
var A=C.contentWindow.document;
var B=A.getElementById("hdwcBody");
B.scrollTop=0
}},closeOverlay:function(C){var B=YAHOO.util.Dom.getElementsByClassName(C);
for(var A=0;
A<B.length;
A++){YAHOO.util.Event.on(B[A],"click",function(){if(window.parent){window.parent.HDWC.util.hideOverlay()
}})
}},createModule:function(D,A,B,E,F){var C=new YAHOO.widget.Module(D,{visible:A});
C.render();
var G=A;
if(B!=null){YAHOO.util.Event.on(B,"click",function(){G=!G;
C[G?"show":"hide"].call(C)
})
}if(E!=null){YAHOO.util.Event.on(E,"click",function(){G=!G;
C.show.call(C)
})
}if(F!=null){YAHOO.util.Event.on(F,"click",function(){G=!G;
C.hide.call(C)
})
}},createTabs:function(C,F){if(C==null||C.length<1||F==null){return null
}var E=new YAHOO.widget.TabView();
for(var B=0,A=C.length;
B<A;
B++){var D=C[B];
E.addTab(new YAHOO.widget.Tab({label:D.header,content:D.body,active:D.isActive||false}))
}E.appendTo(F);
return E
},requestContent:function(C,E,D){if(!this.hasValue(D)){D="GET"
}var A=E;
var B={success:function(F){A(F.responseText)
},failure:function(F){}};
YAHOO.util.Connect.asyncRequest(D,C,B)
},hasValue:function(A){return A!=null&&A!=""
},timestamp:function(){return new Date().getTime()
},generateElementId:function(){return"hdEl"+this.timestamp()+Math.floor(Math.random()*10000)
},uploadFile:function(D,C,E){YAHOO.util.Connect.setForm(D,true);
var A=E;
var B={upload:function(F){A(F.responseText)
},failure:function(F){}};
YAHOO.util.Connect.asyncRequest("POST",C,B)
},getRequestParam:function(B){if(!B){return 
}B=B.replace(/\[/g,"[").replace(/\]/g,"]");
var A="[\\?&]"+B+"=([^&#]*)";
var E=new RegExp(A);
var D=E.exec(window.location.href);
var C=D==null?null:D[1];
return !!C&&C.match(/^(true|1)$/)?true:(!!C&&C.match(/^(false|0)$/)?false:(!!C&&C.match(/^(null|undefined)$/)?null:C))
},log:function(A){},includeJs:function(C,D){var A=D;
var B=document.createElement("script");
B.type="text/javascript";
B.language="javascript";
B.src=C;
if(navigator.userAgent.indexOf("IE")>=0){B.onreadystatechange=function(){if(B&&("loaded"==B.readyState||"complete"==B.readyState)){B.onreadystatechange=null;
A()
}}
}else{B.onload=function(){B.onload=null;
A()
}
}document.getElementsByTagName("head")[0].appendChild(B)
},callbackCounter:0,insertContent:function(B,A,E){var D="hdcb"+this.callbackCounter++;
window[D]=E;
if(A.indexOf("?")<0){A+="?"
}else{if(A.indexOf("&")==A.length-1){}else{A+="&"
}}A+="hdcbid="+D;
var C=this.get(B);
this.requestContent(A,function(F){var G=document.createElement("div");
G.innerHTML=F;
C.appendChild(G)
})
},get:function(A){return YAHOO.util.Dom.get(A)
},trim:function(B,A){if(B.length>A){B=B.substr(0,A).replace(/\s*$/,"")
}return B
},stripHtmlTags:function(L,O,P,K,F){if(O){var B=P||["img","embed"];
var N=document.createElement("div");
N.innerHTML=L;
var I=function(T){var Q=true;
if(T.childNodes&&T.childNodes.length>0){for(var S=0,R=T.childNodes.length;
S<R;
S++){if(!T.childNodes[S].nodeName.match(/^br$/i)){Q=false;
break
}}}return Q
};
var E=function(R,S){if(R&&(S||I(R))){var Q=R.parentNode;
Q.removeChild(R);
arguments.callee(Q)
}};
if(F){var J=0;
var M=new RegExp("^("+B.join("|")+")$","i");
var D=N.getElementsByTagName("*");
var A=[];
for(var H=0,C=D.length;
H<C;
H++){A.push(D[H])
}for(var G=0,C=A.length;
G<C;
G++){if(A[G].nodeName.match(M)){E(A[G],true);
J++
}if(J>=F){break
}}}else{for(var H=0;
H<B.length;
H++){var A=N.getElementsByTagName(B[H]);
for(var G=A.length-1;
G>=0;
G--){E(A[G],true)
}}}return K?N:N.innerHTML
}else{return L.replace(/<\S[^><]*>/g,"")
}},ellipseText:function(G,C,I){if(G.length>C){if(I){var H=this.stripHtmlTags(G,I,null,true);
var F=[];
(function(K){if(K.nodeType==3){F.push(K)
}else{for(var J=0;
J<K.childNodes.length;
J++){arguments.callee(K.childNodes[J])
}}})(H);
var A=0;
var B=null;
for(var D=0;
D<F.length;
D++){if(F[D].data.length+A>C){B=F[D];
B.data=this.trim(B.data,C-A);
var E=B.data.lastIndexOf(" ");
if(E>0){B.data=B.data.substr(0,E)
}B.data+="...";
break
}else{A+=F[D].data.length
}}if(B){(function(J){if(J){while(J.nextSibling){J.parentNode.removeChild(J.nextSibling)
}arguments.callee(J.parentNode)
}})(B)
}G=H.innerHTML
}else{G=this.stripHtmlTags(G,I);
G=this.trim(G,C);
var E=G.lastIndexOf(" ");
if(E>0){G=G.substr(0,E)
}G+="..."
}}return G
},round:function(B,C){if(C==null){C=0
}var D=Math.pow(10,C);
var A=Math.round(B*D);
return A/D
},getAppUrl:function(){return window.location.href.split("?")[0]
},getHostUrl:function(){var A=window.location;
return A.host
},getServerUrl:function(){var A=window.location;
return[A.protocol,"//",A.host].join("")
},setCookie:function(B,C,E){try{var A="";
if(E!=null){A="; expires="+E
}document.cookie=B+"="+C+A+"; path=/"
}catch(D){}},getCookie:function(B,F){try{F=F!=null?F:document;
var E=B+"=";
var A=F.cookie.split(";");
for(var C=0;
C<A.length;
C++){var G=A[C];
while(G.charAt(0)==" "){G=G.substring(1,G.length)
}if(G.indexOf(E)==0){return G.substring(E.length,G.length)
}}return null
}catch(D){}},eraseCookie:function(A){setCookie(A,"",-1)
},contains:function(D,C){if(D!=null&&C!=null){for(var B=0,A=D.length;
B<A;
B++){if(D[B]==C){return true
}}}return false
},scrollTo:function(A){var C=0;
var B=0;
while(A!=null){C+=A.offsetLeft;
B+=A.offsetTop;
A=A.offsetParent
}window.scrollTo(C,B)
},scrollToTop:function(){window.scrollTo(0,0)
},addImage:function(A,C){var B=new Image();
if(C){B.onload=C
}B.src=A;
B.style.width="0px";
B.style.height="0px";
document.body.appendChild(B)
},printStackTrace:function(){var I=[];
var B=false;
try{D.dont.exist+=0
}catch(F){if(F.stack){var J=F.stack.split("\n");
for(var D=0,E=J.length;
D<E;
D++){if(J[D].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){I.push(J[D])
}}I.shift();
B=true
}else{if(window.opera&&F.message){var J=F.message.split("\n");
for(var D=0,E=J.length;
D<E;
D++){if(J[D].match(/^\s*[A-Za-z0-9\-_\$]+\(/)){var H=J[D];
if(J[D+1]){H+=" at "+J[D+1];
D++
}I.push(H)
}}I.shift();
B=true
}}}if(!B){var A=arguments.callee.caller;
while(A){var G=A.toString();
I.push(G);
A=A.caller
}}var C=HD.get("hdConsole");
if(C==null){C=document.createElement("div");
C.id="hdConsole";
document.body.appendChild(C)
}C.innerHTML=I.join("<br/>");
return 
},analyticsOpenString:function(){return"default_analyticsOpenString"
},analyticsCloseString:function(){return"default_analyticsCloseString"
}};
HD.register("hd_common",HD.util.Common,{version:"1.0",build:"1"});HD.util.DOM={onDOMReady:function(A){YAHOO.util.Event.onDOMReady(A)
},onAvailable:function(A,B){YAHOO.util.Event.onAvailable(A,B)
},onContentReady:function(A,B){YAHOO.util.Event.onContentReady(A,B)
},hide:function(A){HD.addClass(A,HD.CSS_CLASSES.HIDDEN)
},show:function(A){HD.removeClass(A,HD.CSS_CLASSES.HIDDEN)
}};HD.util.DWR={initSession:function(){try{if(typeof dwr!="undefined"&&typeof dwr.engine!="undefined"){dwr.engine._getJSessionId=function(){var B=HD.util.DWR.document;
if(!B){var C=document.getElementById("dwr");
if(C){B=C.contentWindow||C.contentDocument;
if(B.document){B=B.document
}}else{B=document
}HD.util.DWR.document=B
}var D=HD.util.Common.getCookie(dwr.engine._sessionCookieName,B);
if(D==null){D=""
}return D
}
}}catch(A){}},getDefaultErrorHandler:function(){return function(I,A){var D=[];
for(var H in A){D.push(H+" : "+A[H]+"\n")
}var G=[];
var F=A.stackTrace;
if(F!=null){for(var C=0,E=F.length;
C<E;
C++){var B=F[C];
G.push(B.methodName);
G.push(" in ");
G.push(B.fileName);
G.push(" [");
G.push(B.lineNumber);
G.push("] ");
G.push("\n")
}}}
},setErrorHandler:function(A){var A=!!A?A:this.getDefaultErrorHandler();
dwr.engine.setErrorHandler(A)
}};
HD.register("hd_dwr",HD.util.DWR,{version:"1.0",build:"1"});HD.util.Observable=function(){this.observers=[]
};
HD.util.Observable.prototype={setObservers:function(A){this.observers=A
},addObserver:function(A){this.observers.push(A)
},removeObserver:function(B){var E=[];
var F=this.observers;
for(var D=0,A=F.length;
D<A;
D++){var C=F[D];
if(C!=B){E.push(C)
}}this.setObservers(E)
},notifyObservers:function(A,C){var D=this.observers;
for(var B=D.length-1;
B>-1;
B--){D[B].update(A,C)
}},checkObservers:function(B){var E=this.observers;
for(var D=0,A=E.length;
D<A;
D++){var C=E[D];
if(C==B){return true
}}return false
}};
HD.register("hd_observable",HD.util.Observable,{version:"1.0",build:"1"});HD.util.Template=function(A){this.config=A;
this.loadTemplates(arguments.callee)
};
HD.util.Template.prototype={processTemplate:function(C,B,A){B=HD.merge(this.TEMPLATE_CONTEXT,B||{});
B._MODIFIERS=HD.merge(this.TEMPLATE_MODIFIERS,B._MODIFIERS||{});
return C.process(B,A)
},loadTemplates:function(A,F,C){var B=this,E=HD.util.Common;
if(typeof A=="function"){var D=A;
A=D.templates;
F=D.hooks
}if(C){this.config=this.config||{};
this.config.dateFormat=this.config.dateFormat||C.config.dateFormat||null;
this.config.templates=HD.merge(HD.clone(A||{},true),(C.config||this.config)[C.templates]||{});
this.config.hooks=HD.merge(HD.clone(F||{},true),(C.config||this.config)[C.hooks]||{})
}else{this.config.templates=HD.merge(HD.clone(A||{},true),this.config.templates||{});
this.config.hooks=HD.merge(HD.clone(F||{},true),this.config.hooks||{})
}this.TEMPLATE_CONTEXT={classes:HD.CSS_CLASSES,config:this.config||{},hooks:this.config?this.config.hooks||{}:{},templates:this.config?this.config.templates||{}:{}};
this.TEMPLATE_MODIFIERS={date:function(G){return HD.util.Date.format(G,B.config.dateFormat||"")
},ellipse:function(){return E.ellipseText.apply(E,arguments)
},facade:function(G){return(G&&G.facade.getHtml(B.config,B.model))||""
},round:function(){return E.round.apply(E,arguments)
},strip:function(){return E.stripHtmlTags.apply(E,arguments)
},trim:function(){return E.trim.apply(E,arguments)
}}
}};
HD.register("hd_template",HD.util.Template,{version:"1.0",build:"1"});HD.Widget=function(A){this.config=A;
this.loadTemplates(arguments.callee)
};
HD.Widget.prototype={getParent:function(){return HD.get(this.config.parent)
},render:function(B){var A=this.getParent();
A.innerHTML=this.getHtml(B);
this.setListeners(B)
},setListeners:function(A){},destroy:function(){var A=this.getParent();
A.innerHTML=""
},loading:function(A){var B=this.getParent();
if(A){HD.addClass(B,HD.CSS_CLASSES.LOADING)
}else{HD.removeClass(B,HD.CSS_CLASSES.LOADING)
}},update:function(A,B){},getHtml:function(A){return""
},analyticsString:function(){return""
}};
HD.extend(HD.Widget,[HD.util.Observable,HD.util.Template]);
HD.register("hd_widget",HD.Widget,{version:"1.0",build:"1"});HD.util.Event=function(A){this.name=A;
this.listeners=[]
};
HD.util.Event.prototype.subscribe=function(A){this.listeners.push(A)
};
HD.util.Event.prototype.unsubscribe=function(E){var D=[];
for(var C=0,A=this.listeners.length;
C<A;
C++){var B=this.listeners[C];
if(B!=E){D.push(B)
}}this.listeners=D
};
HD.util.Event.prototype.unsubscribeAll=function(){this.listeners=[]
};
HD.util.Event.prototype.fire=function(D,C){for(var B=0,A=this.listeners.length;
B<A;
B++){this.listeners[B](D,C)
}};
HD.register("hd_event",HD.util.Event,{version:"1.0",build:"1"});HD.Login=function(A){this.model=new HD.Login.Model(A);
this.view=new HD.Login.View(this.model);
this.controller=new HD.Login.Controller(this.model,this.view);
registerWait=new YAHOO.widget.Panel("registerWait",{width:"32px",fixedcenter:true,close:false,draggable:false,zindex:200000,modal:true,underlay:"none",visible:false});
registerWait.setHeader("");
registerWait.setBody('<img src="'+comMediaBaseUrl+'/hd/hd_login/assets/skins/hd/loading.gif"/>');
registerWait.render(document.body)
};
HD.Login.ANONYMOUS_USER_NAME="anonymousUser";
HD.Login.Model=function(A){this.config=A;
this.events={registered:new HD.util.Event("registered"),authenticated:new HD.util.Event("authenticated"),screenNameCreated:new HD.util.Event("screenNameCreated")};
this.ready=true;
this.queue=[];
this.observers=[]
};
HD.Login.Model.prototype={ANONYMOUS:"anonymous",REGISTERED:"registered",AUTHENTICATED:"authenticated",publicSites:[/^https?:\/\/www\.harley-davidson\.com.*/,/^https?:\/\/www\.buell\.com.*/,/^https?:\/\/members\.hog\.com.*/],queueRequest:function(A){if(!this.ready){this.queue.push(A)
}else{A()
}},processQueue:function(A){if(this.ready){while(this.queue.length>0){this.queue.shift()(A)
}}},setRpc:function(){this.rpcType=DWREngine._rpcType;
this.path=UserService._path;
if(this.isPublicSite()){var A=HD.util.Common.getServerUrl();
if(A.indexOf("https")!=0){A=A.replace(/http/,"https")
}UserService._path=A+UserService._path;
DWREngine.setMethod(DWREngine.ScriptTag)
}},resetRpc:function(){DWREngine.setMethod(this.rpcType);
UserService._path=this.path
},isPublicSite:function(){var B=HD.util.Common.getServerUrl();
for(var C=0,A=this.publicSites.length;
C<A;
C++){if(B.match(this.publicSites[C])){return true
}}return false
},getUser:function(C){this.notifyObservers("getUser_Start");
var A=this;
var B={};
this.setFilters(B);
UserService.getLoggedInStatus(B,function(D){if(C){C(D)
}A.notifyObservers.call(A,"getUser_Finish",D)
})
},init:function(D,B){this.forceLogin=!!B;
this.ready=!this.forceLogin||false;
if(this.forceLogin){var C=D||function(){};
D=function(){C();
(function E(){A.getUser(function(F){if(F.loggedInLevel>1){A.ready=true;
A.processQueue(F)
}else{setTimeout(function(){E()
},250)
}})
})()
}
}var A=this;
this.notifyObservers("loginInit_Start");
UserService.getIlCookies(function(E){var G=HD.util.Common.getServerUrl()+"/Community/services/ILInit/?secret="+HD.util.Common.timestamp();
var F=E.profile+"/cpapp/auth/ILTicket.h-d?nologin=1&ret_uri="+escape(G);
HD.util.Common.addImage(F,D||null);
A.notifyObservers("loginInit_Finish",HD.merge(E,{returnUrl:G}))
})
},authenticate:function(C){this.setRpc();
var A=this;
var B={user:C};
this.setFilters(B);
UserService.authenticate(B,function(D){A.handleAuthenticate.call(A,D);
registerWait.hide()
});
registerWait.show();
this.resetRpc()
},handleAuthenticate:function(A){if(A!=null){if((A.user.screenName==null)&&(A.user.ilTicket!=null)){this.events.screenNameCreated.fire(A)
}else{this.events.authenticated.fire(A)
}}},register:function(C){this.setRpc();
var A=this;
var D=C;
var B={user:C};
this.setFilters(B);
UserService.register(B,function(F){A.handleRegister.call(A,F);
registerWait.hide()
});
var E=HD.get("hdwcBody");
registerWait.show();
this.resetRpc()
},handleRegister:function(A){this.events.registered.fire(A)
},checkScreenName:function(C){var A=this;
var D=C;
var B={user:C};
this.setFilters(B);
UserService.checkScreenname(B,function(E){A.handleCheckScreenName.call(A,E);
registerWait.hide()
});
registerWait.show()
},handleCheckScreenName:function(A){this.events.registered.fire(A)
},checkScreenNameCreate:function(C){var A=this;
var D=C;
var B={user:C};
this.setFilters(B);
UserService.checkScreenname(B,function(E){A.handleCheckScreenNameCreate.call(A,E);
registerWait.hide()
});
registerWait.show()
},handleCheckScreenNameCreate:function(A){this.events.screenNameCreated.fire(A)
},createScreenName:function(C){var A=this;
var D=C;
var B={user:C};
this.setFilters(B);
UserService.createScreenName(B,function(E){A.handleCreateScreenName.call(A,E);
registerWait.hide()
});
registerWait.show()
},handleCreateScreenName:function(A){this.events.screenNameCreated.fire(A)
},setFilters:function(A){A.siteName=this.config.siteName
},isUserLoggedIn:function(B){var A={};
this.setFilters(A);
this.queueRequest(function(C){if(!!C){B(C)
}else{UserService.getLoggedInStatus(A,function(D){B(D)
})
}})
}};
HD.extend(HD.Login.Model,[HD.util.Observable]);
HD.Login.View=function(B){this.content=HD.Login.Content;
this.model=B;
this.config=B.config;
this.AUTHENTICATE_FORM_ID="hdAuthenticateForm";
this.AUTHENTICATE_SUBMIT_ID="hdAuthenticateSubmit";
this.REGISTER_FORM_ID="hdRegisterForm";
this.REGISTER_SUBMIT_ID="hdRegisterSubmit";
this.CHECK_SCREENNAME_ID="hdCheckScreenname";
this.events={registerClick:new HD.util.Event("registerClick"),authenticateClick:new HD.util.Event("authenticateClick"),screennameCheckClick:new HD.util.Event("screennameClick"),checkSNCreateClick:new HD.util.Event("checkSNCreateClick"),createScreenNameClick:new HD.util.Event("createScreenNameClick")};
var A=this;
this.model.events.authenticated.subscribe(function(C){A.handleAuthenticated.call(A,C)
});
this.model.events.registered.subscribe(function(C){A.handleRegistered.call(A,C)
});
this.model.events.screenNameCreated.subscribe(function(C){A.handleScreenNameCreated.call(A,C)
});
this.observers=[];
this.model.addObserver(this)
};
HD.Login.View.prototype={update:function(B,C){var A=this;
if(B=="getUser_Finish"){A.loginStatus.call(A,C)
}},loginStatus:function(B){var A="notLogged_In";
if(B!=null){if(B.loggedInLevel>1){A="logged_In"
}}this.model.notifyObservers(A,B)
},showForm:function(D){var A=this;
var B=D;
var C=HD.util.Common.timestamp();
registerWait.show();
HD.util.Common.requestContent(D.getContent()+"?siteName="+comSiteName+"&timestamp="+C,function(E){var F=HD.util.Common.showOverlay(E,B.title,B.width,B.height);
A.setupListeners.call(A,F,B);
registerWait.hide()
})
},showFormScrolled:function(D){var A=this;
var B=D;
var C=HD.util.Common.timestamp();
registerWait.show();
HD.util.Common.requestContent(D.getContent()+"?siteName="+comSiteName+"&timestamp="+C,function(F){var H=HD.util.Common.showOverlay(F,B.title,B.width,B.height);
A.setupListeners.call(A,H,B);
var E=HD.get("hdwcBody");
var G=HD.get("formBottom").offsetTop;
E.scrollTop=G;
registerWait.hide()
})
},setupListeners:function(E,C){var B=HD.get(C.id);
var A=this;
if(B!=null){B.onsubmit=function(){HD.addClass(B,"hdFormLoading");
A[C.callback].call(A,B);
return false
}
}var D=HD.getByClass("hdShowRegister","div",E);
if(D!=null&&D.length>0){D[0].onclick=function(){A.promptRegistration.call(A)
}
}D=HD.getByClass("hdLogout","div",E);
if(D!=null&&D.length>0){D[0].onclick=function(){A.logoutUser.call(A);
HD.util.Common.hideOverlay()
}
}},promptCreateScreenName:function(){HD.util.Analytics.track(this.analyticsScreenNameString());
this.showForm(this.content.SCREENNAME)
},onScreenNameSubmit:function(B){var A=this.collectUserData(B);
if((B.checkingScreenname.value=="true")){this.events.checkSNCreateClick.fire(A)
}else{this.events.createScreenNameClick.fire(A)
}},promptAuthentication:function(){HD.util.Analytics.track(this.analyticsAuthenticateString());
this.showForm(this.content.AUTHENTICATE)
},onAuthenticationSubmit:function(B){var A=this.collectUserAuthenticateData(B);
this.events.authenticateClick.fire(A)
},promptRegistration:function(){HD.util.Analytics.track(this.analyticsRegisterString());
this.showForm(this.content.REGISTER)
},logoutUser:function(){UserService.clearSessionUserInfo();
UserService.logoutUser();
this.loginStatus();
var A=this;
UserService.getIlCookies(function(B){var C=HD.util.Common.timestamp();
HD.util.Common.addImage(B.hdLogout+"?timestamp="+C);
HD.util.Common.addImage(B.buellLogout+"?timestamp="+C);
HD.util.Common.addImage(B.hogLogout+"?timestamp="+C);
HD.util.Common.addImage(B.rideplannerLogout+"?timestamp="+C);
HD.util.Common.addImage(B.profile+"/cpapp/ilCookie/delete/");
A.model.notifyObservers.call(A.model,"notLogged_In")
})
},onRegistrationSubmit:function(B){var A=this.collectUserData(B);
if((B.checkingScreenname.value=="true")){this.events.screennameCheckClick.fire(A)
}else{this.events.registerClick.fire(A)
}},showLogoutOverlay:function(){this.showForm(this.content.LOGOUT)
},handleAuthenticated:function(C){var A=this;
var B=C.user;
if(C.loggedInLevel==0){this.showForm(this.content.AUTHENTICATE)
}else{if(C.loggedInLevel==1){this.showForm(this.content.SCREENNAME)
}else{HD.util.Common.hideOverlay();
A.loginStatus(C);
A.writeCookies(B);
HD.util.Analytics.track(this.analyticsAuthenticateConfirmString())
}}},handleRegistered:function(C){var B=C.user;
var E=C.errors;
var D=C.screenNameCheck;
var A=this;
if((E==null||E.length<1)&&!D){HD.util.Common.hideOverlay();
HD.util.Analytics.track(this.analyticsRegisteredString());
A.showForm(this.content.CONFIRMATION);
A.loginStatus(C)
}else{if(D){this.showFormScrolled(this.content.REGISTER)
}else{this.showForm(this.content.REGISTER)
}}},handleScreenNameCreated:function(B){var A=B.user;
var D=B.errors;
var C=B.screenNameCheck;
if((D==null||D.length<1)&&!C&&(A!=null)&&(A.screenName!=null)){HD.util.Common.hideOverlay();
this.loginStatus(B)
}else{this.showForm(this.content.SCREENNAME)
}},collectUserData:function(C){var B={};
if(C.hdwcPassword!=null){B.password=C.hdwcPassword.value
}if(C.hdwcPassword2!=null){B.passwordConfirm=C.hdwcPassword2.value
}if(C.hdwcFirstName!=null){B.firstName=C.hdwcFirstName.value
}if(C.hdwcMiddleName!=null){B.middleName=C.hdwcMiddleName.value
}if(C.hdwcLastName!=null){B.lastName=C.hdwcLastName.value
}if(C.hdwcEmailAddress!=null){B.email=C.hdwcEmailAddress.value;
B.userName=C.hdwcEmailAddress.value
}if(C.hdwcSelectMonth!=null&&C.hdwcSelectDay!=null&&C.hdwcSelectYear!=null){if(C.hdwcSelectMonth.value.length>0&&C.hdwcSelectDay.value.length>0&&C.hdwcSelectYear.value.length>0){var A=C.hdwcSelectMonth.value.length<2?"0"+C.hdwcSelectMonth.value+"/":C.hdwcSelectMonth.value+"/";
A+=C.hdwcSelectDay.value.length<2?"0"+C.hdwcSelectDay.value+"/":C.hdwcSelectDay.value+"/";
A+=C.hdwcSelectYear.value;
B.dob=A
}}if(C.optIn!=null){B.optIn=C.optIn.checked
}if(C.screenName!=null){B.screenName=C.screenName.value
}if(C.hdwcZip!=null){B.zip=C.hdwcZip.value
}return B
},collectUserAuthenticateData:function(B){var A={};
if(B.password!=null){A.password=B.password.value
}if(B.email!=null){A.email=B.email.value;
A.userName=B.email.value
}return A
},writeCookies:function(B){var A=this;
A.user=B;
UserService.getIlCookies(function(C){var D=HD.util.Common.timestamp();
HD.util.Common.addImage(C.hdLogin+"?timestamp="+D);
HD.util.Common.addImage(C.buellLogin+"?timestamp="+D);
HD.util.Common.addImage(C.hogLogin+"?timestamp="+D);
HD.util.Common.addImage(C.rideplannerLogin+"?timestamp="+D);
HD.util.Common.addImage(C.profile+"/cpapp/ilCookie/add/"+A.user.ilTicket+"/"+A.user.userName)
})
},analyticsAuthenticateString:function(){return"default_analyticsAuthenticateString"
},analyticsRegisterString:function(){return"default_analyticsRegisterString"
},analyticsRegisteredString:function(){return"default_analyticsRegisteredString"
},analyticsScreenNameString:function(){return"default_analyticsScreenNameString"
},analyticsAuthenticateConfirmString:function(){return"default_analyticsAuthenticateConfirmString"
}};
HD.extend(HD.Login.View,[HD.util.Observable]);
HD.Login.Controller=function(C,B){this.model=C;
this.view=B;
var A=this;
this.view.events.registerClick.subscribe(function(D){A.handleRegister.call(A,D)
});
this.view.events.authenticateClick.subscribe(function(D){A.handleAuthenticate.call(A,D)
});
this.view.events.screennameCheckClick.subscribe(function(D){A.handleCheckScreenname.call(A,D)
});
this.view.events.checkSNCreateClick.subscribe(function(D){A.handleCheckSNCreate.call(A,D)
});
this.view.events.createScreenNameClick.subscribe(function(D){A.handleCreateScreenName.call(A,D)
})
};
HD.Login.Controller.prototype={authenticateUser:function(){this.view.promptAuthentication()
},registerUser:function(){this.view.promptRegistration()
},handleRegister:function(A){this.model.register(A)
},handleAuthenticate:function(A){this.model.authenticate(A)
},handleCheckScreenname:function(A){this.model.checkScreenName(A)
},handleCheckSNCreate:function(A){this.model.checkScreenNameCreate(A)
},handleCreateScreenName:function(A){this.model.createScreenName(A)
}};
HD.register("hd_login_widget","HD.Login",{version:"1.0",build:"1"});HD.Login.Content={AUTHENTICATE:{id:"hdAuthenticateForm",title:"Login",callback:"onAuthenticationSubmit",getContent:function(){return comSvcBaseUrl+"/hd/user/assets/authenticate.jsp"
},refresh:"hdCaptchaRefresh",image:"hdCaptchaImage",width:"584px",height:"280px"},REGISTER:{id:"hdRegisterForm",title:"Register",callback:"onRegistrationSubmit",getContent:function(){return comSvcBaseUrl+"/hd/user/assets/register.jsp"
},width:"584px",height:"510px"},SCREENNAME:{id:"hdScreenNameForm",title:"Screen Name",callback:"onScreenNameSubmit",getContent:function(){return comSvcBaseUrl+"/hd/user/assets/screenName.jsp"
},width:"584px",height:"300px"},CONFIRMATION:{id:"hdConfirmation",title:"",callback:"",getContent:function(){return comSvcBaseUrl+"/hd/user/assets/profileCreationConfirmationOverlay.jsp"
},width:"584px",height:"150px"},LOGOUT:{id:"hdLogout",title:"",callback:"",getContent:function(){return comSvcBaseUrl+"/hd/user/assets/logout.jsp"
},width:"584px",height:"150px"}};
HD.register("hd_login_content",HD.Login.Content,{version:"1.0",build:"1"});HD.util.Email=function(A){this.model=new HD.util.Email.Model(A);
this.view=new HD.util.Email.View(this.model);
this.controller=new HD.util.Email.Controller(this.model,this.view);
this.model.addObserver(this.view)
};
HD.util.Email.prototype={init:function(A){this.view.init(A)
}};
HD.util.Email.Model=function(A){this.config=A;
this.observers=[]
};
HD.util.Email.Model.prototype={sendEmail:function(B){this.notifyObservers("sendEmail_Start");
var A=this;
EmailService.sendEmail(B,function(D){var C=D.success?"sendEmail_Finish":"sendEmail_Error";
A.notifyObservers.call(A,C)
})
}};
HD.extend(HD.util.Email.Model,[HD.util.Observable]);
HD.util.Email.View=function(B){this.model=B;
this.config=this.model.config;
this.observers=[];
this.loadTemplates(arguments.callee);
this.triggerEl=HD.get(this.config.trigger);
if(this.triggerEl==null){return 
}var A=this;
this.triggerEl.onclick=function(){A.render.call(A)
}
};
HD.util.Email.View.templates={overlayTitle:"Send via Email",successText:"Your e-mail has been successfully sent!",failureText:"ERROR: Your Email could not be sent at this time, please verify information entered and/or try again later.",fromLabel:"From : ",toLabel:"To : ",subjectLabel:"Subject : ",bodyLabel:"Body : ",submitLabel:"Send",getOverlayTitle:function(){return this.overlayTitle
},getSuccessText:function(){return this.successText
},getFailureText:function(){return this.failureText
},getFromLabel:function(){return this.fromLabel
},getToLabel:function(){return this.toLabel
},getSubjectLabel:function(){return this.subjectLabel
},getBodyLabel:function(){return this.bodyLabel
},getSubmitLabel:function(){return this.submitLabel
},getHtml:function(){return this.html
},html:'		<form onsubmit="return false;" class="${classes.EMAIL_FORM}">			<table>				<tr><td>${templates.getFromLabel()}</td><td><input name="from" type="text"></input></td></tr>				<tr><td>${templates.getToLabel()}</td><td><input name="to" type="text"></input><br/></td></tr>				<tr><td>${templates.getSubjectLabel()}</td><td><input name="subject" type="text"></input><br/></td></tr>				<tr><td>${templates.getBodyLabel()}</td><td><textarea name="body" cols="30" rows="5"></textarea><br/></td></tr>				<tr><td></td><td><input type="Submit" value="${templates.getSubmitLabel()}"></input></td></tr>			</table>		</form>'};
HD.util.Email.View.prototype={render:function(){var C=this.getHtml();
var F=HD.util.Common.showOverlay(C,HD.util.Email.View.templates.getOverlayTitle(),"500px","300px");
var B=F.getElementsByTagName("form")[0];
this.parentEl=B;
var E=B.getElementsByTagName("input");
var D=E[E.length-1];
var A=this.model;
D.onclick=function(){var G={to:B.to.value,from:B.from.value,subject:B.subject.value,body:B.body.value};
A.sendEmail.call(A,G)
}
},getParent:function(){return this.parentEl
},update:function(B,D){var A=HD.util.Common,C=HD.util.Email.View.templates;
if(B=="sendEmail_Start"){this.loading(true)
}else{if(B=="sendEmail_Finish"){this.loading(false);
A.showOverlay(C.getSuccessText(),C.getOverlayTitle(),"500px","300px");
setTimeout("HD.util.Common.hideOverlay()",3000)
}else{if(B=="sendEmail_Error"){this.loading(false);
A.showOverlay(C.getFailureText(),C.getOverlayTitle(),"500px","300px");
setTimeout("HD.util.Common.hideOverlay()",5000)
}}}},getHtml:function(){return this.processTemplate(this.config.templates.getHtml())
}};
HD.extend(HD.util.Email.View,[HD.Widget]);
HD.util.Email.Controller=function(B,A){this.model=B;
this.view=A
};
HD.util.Email.Controller.prototype={};
HD.register("hd_email",HD.util.Email,{version:"1.0",build:"1"});HD.util.StarRating=function(A){this.observers=[];
this.config=A||{};
if(A.captionParent!=null){this.captionParent=HD.get(A.captionParent)
}if(A.starRatingParent!=null){this.starRatingParent=HD.get(A.starRatingParent)
}if(A.textRatingParent!=null){this.textRatingParent=HD.get(A.textRatingParent)
}if(A.numOfVotesParent!=null){this.numOfVotesParent=HD.get(A.numOfVotesParent)
}if(A.numOfDecimals==null||A.numOfDecimals<0){this.config.numOfDecimals=0
}this.config.requiresLogin=this.config.requiresLogin||false;
this.config.showRatingHalves=this.config.showRatingHalves||false;
this.config.showYourRatingText=this.config.showYourRatingText||false;
this.queue=new HD.util.Queue();
this.render();
HD.util.StarRating.monitor.add(this)
};
HD.util.StarRating.monitor={init:false,ratings:[],user:null,update:function(A,C){if(A=="logged_In"||A=="notLogged_In"){this.user=C&&C.loggedInLevel>1?C.user&&C.user.userName:null;
this.clean();
for(var B=0;
B<this.ratings.length;
B++){this.ratings[B].render()
}}},add:function(A){if(!this.init){login.model.addObserver(HD.util.StarRating.monitor);
this.init=true
}this.ratings.push(A)
},clean:function(){for(var A=this.ratings.length-1;
A>=0;
A--){if(!this.isLiveElement(this.ratings[A].starRatingParent)){this.ratings.splice(A,1)
}}},isLiveElement:function(A){while(A!=null&&A.nodeName.toLowerCase()!="body"){A=A.parentNode
}return !!A
}};
HD.util.StarRating.CSS_CLASSES={CAPTION:"hdCaption",STAR_RATING:"hdStarRating",TEXT_RATING:"hdTextRating",NUM_OF_VOTES:"hdNumOfVotes",AVERAGE_RATING:"hdAverageRating",MY_RATING:"hdMyRating"};
HD.util.StarRating.templates={oneStarLabel:"Poor",twoStarLabel:"Fair",threeStarLabel:"Good",fourStarLabel:"Great",fiveStarLabel:"Excellent",rateThisLabel:"Rate this: ",yourRatingLabel:"Your rating: ",ratingLabel:"Rating: ",rateThisText:"Not yet rated",yourRatingText:"${rating} stars",getOneStarLabel:function(){return this.oneStarLabel
},getTwoStarLabel:function(){return this.twoStarLabel
},getThreeStarLabel:function(){return this.threeStarLabel
},getFourStarLabel:function(){return this.fourStarLabel
},getFiveStarLabel:function(){return this.fiveStarLabel
},getRateThisLabel:function(){return this.rateThisLabel
},getYourRatingLabel:function(){return this.yourRatingLabel
},getRatingLabel:function(){return this.ratingLabel
},getRateThisText:function(){return this.rateThisText
},getYourRatingText:function(A){return this.yourRatingText.replace(/\$\{rating\}/,A)
}};
HD.util.StarRating.prototype={render:function(){var D=HD.util.StarRating.templates;
this.stars=[new HD.util.StarRatingImage("star1",D.getOneStarLabel()),new HD.util.StarRatingImage("star2",D.getTwoStarLabel()),new HD.util.StarRatingImage("star3",D.getThreeStarLabel()),new HD.util.StarRatingImage("star4",D.getFourStarLabel()),new HD.util.StarRatingImage("star5",D.getFiveStarLabel())];
this.checkIfRated(this.config.itemId);
var B=this.config.isStatic;
var G=this.config.isRated;
if(B){HD.addClass(this.starRatingParent,HD.CSS_CLASSES.STATIC)
}else{HD.removeClass(this.starRatingParent,HD.CSS_CLASSES.STATIC);
if(G){HD.addClass(this.starRatingParent,HD.CSS_CLASSES.RATED);
HD.removeClass(this.starRatingParent,HD.CSS_CLASSES.UNRATED)
}else{HD.removeClass(this.starRatingParent,HD.CSS_CLASSES.RATED);
HD.addClass(this.starRatingParent,HD.CSS_CLASSES.UNRATED)
}}this.starRatingParent.innerHTML="";
for(var A=0;
A<this.stars.length;
A++){var E=this.stars[A];
if(!B&&!G){this.attachEvents(E,A)
}E.out();
this.starRatingParent.appendChild(E.image)
}if(B){this.selectedIndex=this.config.averageRating-1
}else{if(G){this.selectedIndex=this.config.myRating-1
}else{this.selectedIndex=-1
}}if(this.selectedIndex>=0){this.over(this.selectedIndex)
}var C=D.getRateThisLabel();
var F=this.config.averageRating;
if(G&&!B){C=D.getYourRatingLabel()
}if(B){C=D.getRatingLabel()
}if(this.config.showYourRatingText&&!B){F=D.getRateThisText();
if(G){F=D.getYourRatingText(this.config.myRating)
}}this.setNumOfVotes(this.config.numOfVotes);
this.setTextRating(F,this.config.showYourRatingText&&!B);
this.setCaption(C)
},attachEvents:function(B,A){var C=this;
B.image.onmouseover=function(){C.overUnrated(A)
};
B.image.onmouseout=function(){C.out(A)
};
B.image.onclick=function(){C.click(A)
}
},overUnrated:function(C){if(this.config.showRatingHalves){C=Math.min(Math.round(C*100),(this.stars.length-1)*100);
for(var D=0;
D<=(this.stars.length-1)*100;
D+=100){var A=C-D+100;
if(A>=26&&A<=75){this.stars[Math.floor(D/100)].half()
}else{if(A>75){this.stars[Math.floor(D/100)].overUnrated()
}else{this.stars[Math.floor(D/100)].out()
}}}}else{C=Math.min(Math.round(C),this.stars.length-1);
for(var D=0;
D<=C;
D++){this.stars[D].overUnrated()
}for(var B=C+1;
B<this.stars.length;
B++){this.stars[B].out()
}}},click:function(B){var C=B;
var A=this;
this.queue.add(function(){if(!A.checkIfRated(A.config.itemId)){A.executeClick.call(A,C)
}});
if(this.config.requiresLogin){login.model.isUserLoggedIn(function(E){if(E&&E.loggedInLevel>1){HD.util.StarRating.monitor.user=(E.user&&E.user.userName)||null;
A.queue.execute()
}else{HD.util.StarRating.monitor.user=null;
var D={update:function(F,G){if(F=="logged_In"&&G&&G.loggedInLevel>1){HD.util.StarRating.monitor.user=(G&&G.loggedInLevel>1&&G.user&&G.user.userName)||null;
A.queue.execute();
login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}else{if(F=="overlayClose_Click"){login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}}}};
HD.util.Common.getObservable().addObserver(D);
login.model.addObserver(D);
if(E.loggedInLevel>0){login.view.promptCreateScreenName()
}else{login.view.promptAuthentication()
}}})
}else{this.queue.execute()
}},executeClick:function(A){this.selectedIndex=A;
this.markRated(A+1);
this.config.isRated=true;
this.notifyObservers("starRating_Selected",A+1);
this.render()
},out:function(B){if(this.selectedIndex>=0){this.over(this.selectedIndex)
}else{for(var A=0;
A<=B;
A++){this.stars[A].out()
}}},over:function(C){if(this.config.showRatingHalves){C=Math.min(Math.round(C*100),(this.stars.length-1)*100);
for(var D=0;
D<=(this.stars.length-1)*100;
D+=100){var A=C-D+100;
if(A>=26&&A<=75){this.stars[Math.floor(D/100)].half()
}else{if(A>75){this.stars[Math.floor(D/100)].over()
}else{this.stars[Math.floor(D/100)].out()
}}}}else{C=Math.min(Math.round(C),this.stars.length-1);
for(var D=0;
D<=C;
D++){this.stars[D].over()
}for(var B=C+1;
B<this.stars.length;
B++){this.stars[B].out()
}}},setCaption:function(A){if(this.captionParent!=null){this.captionParent.innerHTML=A
}},setTextRating:function(B,A){if(this.textRatingParent!=null){this.textRatingParent.innerHTML=!!A?B:HD.util.Common.round(B,this.config.numOfDecimals)
}},setNumOfVotes:function(A){if(this.numOfVotesParent!=null){this.numOfVotesParent.innerHTML=A
}},setRating:function(A){this.selectedIndex=A-1
},getRating:function(){return this.selectedIndex+1
},getUser:function(){return(this.config.requiresLogin&&!this.config.isStatic&&HD.util.StarRating.monitor.user)||"-"
},markRated:function(B){var A=this.getRatingCookie("ratedItems");
this.getRatingFromCookie(A,this.config.itemId,this.getUser()).rating=B;
this.setRatingCookie("ratedItems",A)
},checkIfRated:function(C){this.config.isRated=false;
var A=this.getRatingCookie("ratedItems");
var B=this.getRatingFromCookie(A,C,this.getUser());
if(B.rating>0){this.config.isRated=true;
this.config.myRating=B.rating
}return this.config.isRated
}};
HD.util.StarRatingCookie=function(){};
HD.util.StarRatingCookie.prototype={getRatingCookie:function(G){var A=HD.util.Common;
G=G||"ratedItems";
var D=(decodeURIComponent(A.getCookie(G))||"").split("|");
for(var C=0;
C<D.length;
C++){var F=D[C].split("=");
F={id:F[0]||"",ratings:F[1]||""};
F.ratings=F.ratings.split(",");
for(var B=0;
B<F.ratings.length;
B++){var E=F.ratings[B].split(":");
E={username:E[0]||"",rating:E[1]||0};
F.ratings[B]=E
}D[C]=F
}return D
},setRatingCookie:function(B,A){HD.util.Common.setCookie(B||"ratedItems",this.serializeRatingCookie(A))
},serializeRatingCookie:function(C){for(var B=0;
B<C.length;
B++){for(var A=0;
A<C[B].ratings.length;
A++){C[B].ratings[A]=C[B].ratings[A].username+":"+C[B].ratings[A].rating
}C[B]=C[B].id+"="+C[B].ratings.join(",")
}return encodeURIComponent(C.join("|"))
},getRatingFromCookie:function(C,D,E){E=E||"-";
for(var B=0;
B<C.length;
B++){if(C[B].id==D){for(var A=0;
A<C[B].ratings.length;
A++){if(C[B].ratings[A].username==E){return C[B].ratings[A]
}}C[B].ratings.push({username:E,rating:0});
return C[B].ratings[C[B].ratings.length-1]
}}C.push({id:D,ratings:[{username:E,rating:0}]});
return C[C.length-1].ratings[0]
}};
HD.extend(HD.util.StarRating,[HD.util.Observable,HD.util.StarRatingCookie]);
HD.util.StarRatingImage=function(C,A,B){this.id=C;
this.caption=A;
this.image=document.createElement("span");
this.image.innerHTML="&nbsp;";
this.image.className=HD.CSS_CLASSES.STAR_OFF
};
HD.util.StarRatingImage.prototype={over:function(){this.image.className=HD.CSS_CLASSES.STAR_ON
},out:function(){this.image.className=HD.CSS_CLASSES.STAR_OFF
},half:function(){this.image.className=HD.CSS_CLASSES.STAR_HALF
},overUnrated:function(){this.image.className="hdStarOver"
}};
HD.register("hd_star_rating","HD.util.StarRating",{version:"1.0",build:"1"});HD.util.Date={format:function(B,C){var A=function(){var D=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,E=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,G=/[^-+\dA-Z]/g,F=function(I,H){I=String(I);
H=H||2;
while(I.length<H){I="0"+I
}return I
};
return function(O,Y,U){var K=A;
if(arguments.length==1&&(typeof O=="string"||O instanceof String)&&!/\d/.test(O)){Y=O;
O=undefined
}O=O?new Date(O):new Date();
if(isNaN(O)){throw new SyntaxError("invalid date")
}Y=String(K.masks[Y]||Y||K.masks["default"]);
if(Y.slice(0,4)=="UTC:"){Y=Y.slice(4);
U=true
}var W=U?"getUTC":"get",R=O[W+"Date"](),I=O[W+"Day"](),P=O[W+"Month"](),T=O[W+"FullYear"](),V=O[W+"Hours"](),Q=O[W+"Minutes"](),X=O[W+"Seconds"](),S=O[W+"Milliseconds"](),J=U?0:O.getTimezoneOffset(),N={d:R,dd:F(R),ddd:K.i18n.dayNames[I],dddd:K.i18n.dayNames[I+7],m:P+1,mm:F(P+1),mmm:K.i18n.monthNames[P],mmmm:K.i18n.monthNames[P+12],yy:String(T).slice(2),yyyy:T,h:V%12||12,hh:F(V%12||12),H:V,HH:F(V),M:Q,MM:F(Q),s:X,ss:F(X),l:F(S,3),L:F(S>99?Math.round(S/10):S),t:V<12?"a":"p",tt:V<12?"am":"pm",T:V<12?"A":"P",TT:V<12?"AM":"PM",Z:U?"UTC":(String(O).match(E)||[""]).pop().replace(G,""),o:(J>0?"-":"+")+F(Math.floor(Math.abs(J)/60)*100+Math.abs(J)%60,4),S:["th","st","nd","rd"][R%10>3?0:(R%100-R%10!=10)*R%10]};
return Y.replace(D,function(H){return H in N?N[H]:H.slice(1,H.length-1)
})
}
}();
A.masks={"default":"ddd mmm dd 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",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};
A.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","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"]};
return A(B,C)
}};HD.util.Paging=function(A){this.model=new HD.util.Paging.Model(A);
this.view=new HD.util.Paging.View(this.model);
this.controller=new HD.util.Paging.Controller(this.model,this.view);
this.init(A)
};
HD.util.Paging.prototype={init:function(A){this.model.startingPage=A.startingPage;
this.view.containers=A.containers;
this.model.viewAllMax=A.viewAllMax;
this.model.defaultPageSize=A.defaultPageSize;
this.model.showPageSizeSwitch=A.showPageSizeSwitch
}};
HD.util.Paging.Model=function(A){this.config=A;
this.totalPages=0;
this.pageNumber=this.startingPage||0;
this.observers=[];
this.showPageSizeSwitch=this.showPageSizeSwitch||false;
this.viewAllMax=this.viewAllMax||50;
this.defaultPageSize=this.defaultPageSize||this.pageSize
};
HD.util.Paging.Model.prototype={};
HD.extend(HD.util.Paging.Model,[HD.util.Observable]);
HD.util.Paging.View=function(A){this.model=A;
this.config=A.config;
this.containers=this.config.containers;
this.observers=[];
this.model.addObserver(this);
this.loadTemplates(arguments.callee)
};
HD.util.Paging.View.templates={nextText:"Next&gt;",previousText:"&lt;Prev",ellipsisText:" ... ",showAllText:"View All",showPageSizeText:"View ${number} per Page",getNextText:function(){return this.nextText
},getPreviousText:function(){return this.previousText
},getEllipsisText:function(){return this.ellipsisText
},getShowAllText:function(){return this.showAllText
},getShowPageSizeText:function(A){return this.showPageSizeText.replace(/\$\{number\}/,A)
},getHtml:function(){return this.html
},html:'		<span class="${classes.PAGING}">		{if hasPrevious}			<span class="${hooks.PREVIOUS} ${hooks.PAGING_ARROW}">${templates.getPreviousText()}</span> 			{if previousPages == 1}				 <span class="${hooks.PAGING_ARROW}">${pageNumber - 1}</span>			{elseif previousPages == 2}				 <span class="${hooks.PAGING_ARROW}">${startPage}</span>				 <span class="${hooks.PAGING_ARROW}">${pageNumber - 1}</span>			{elseif previousPages > 2}				 <span class="${hooks.PAGING_ARROW}">${startPage}</span>				${templates.getEllipsisText()}				{if !hasNext}					 <span class="${hooks.PAGING_ARROW}">${pageNumber - 2}</span>				{/if}				 <span class="${hooks.PAGING_ARROW}">${pageNumber - 1}</span>			{/if}		{/if}		 <span class="${classes.CURRENT}">${pageNumber}</span> 		{if hasNext}			{if nextPages == 1}				 <span class="${hooks.PAGING_ARROW}">${pageNumber + 1}</span>			{elseif nextPages == 2}				 <span class="${hooks.PAGING_ARROW}">${pageNumber + 1}</span>				 <span class="${hooks.PAGING_ARROW}">${totalPages}</span>			{elseif nextPages > 2}				 <span class="${hooks.PAGING_ARROW}">${pageNumber + 1}</span>				{if !hasPrevious}					 <span class="${hooks.PAGING_ARROW}">${pageNumber + 2}</span>				{/if}				${templates.getEllipsisText()}				 <span class="${hooks.PAGING_ARROW}">${totalPages}</span>			{/if}			 <span class="${hooks.NEXT} ${hooks.PAGING_ARROW}">${templates.getNextText()}</span>		{/if}		{if showPageSize}			<span class="${classes.SHOW_VIEW}">			{if pageSize == viewAllMax}		    	<span class="${classes.SHOW_DEFAULT}">${templates.getShowPageSizeText(defaultPageSize)}</span>			{elseif totalMedia < viewAllMax}		    	<span class="${classes.SHOW_MAX}">${templates.getShowPageSizeText(viewAllMax)}</span>			{else}		    	<span class="${classes.SHOW_ALL}">${templates.getShowAllText()}</span>			{/if}			</span>		{/if}		</span>'};
(function(){var A=HD.CSS_CLASSES;
HD.util.Paging.View.hooks={NEXT:A.NEXT,PREVIOUS:A.PREVIOUS,PAGING_ARROW:A.PAGING_ARROW}
})();
HD.util.Paging.View.prototype={render:function(){var D=HD.CSS_CLASSES;
var H=this.model.startingPage;
var L=this.model.pageNumber;
var G=this.model.totalPages;
if(L==H&&L==G){for(var E=0,I=this.containers.length;
E<I;
E++){var B=HD.get(this.containers[E]);
HD.addClass(B.parentNode,D.PAGING_NONE)
}return""
}var J=L-H;
var F=J>0;
var C=G-L;
var A=C>0;
var K=this.processTemplate(this.config.templates.getHtml(),{startPage:H,pageNumber:L,totalPages:G,hasPrevious:F,hasNext:A,previousPages:J,nextPages:C,showPageSize:this.model.showPageSizeSwitch,pageSize:this.model.pageSize,viewAllMax:this.model.viewAllMax,totalMedia:this.model.totalMedia,defaultPageSize:this.model.defaultPageSize});
for(var E=0,I=this.containers.length;
E<I;
E++){var B=HD.get(this.containers[E]);
B.innerHTML=K;
HD.removeClass(B.parentNode,D.PAGING_NONE)
}this.setListeners()
},setListeners:function(){for(var B=0,A=this.containers.length;
B<A;
B++){this.setListener(HD.get(this.containers[B]))
}},setListener:function(B){var I=this.config.hooks;
var C=this;
var E=HD.getByClass(I.PREVIOUS,"*",B,function(J){J.onclick=function(){C.notifyObservers.call(C,"paging_Previous")
}
});
var D=HD.getByClass(I.NEXT,"*",B,function(J){J.onclick=function(){C.notifyObservers.call(C,"paging_Next")
}
});
var G=HD.getByClass(I.PAGING_ARROW,"*",B,function(J){if(!HD.hasClass(J,I.PREVIOUS)&&!HD.hasClass(J,I.NEXT)){J.onclick=function(){C.notifyObservers.call(C,"paging_Page",parseInt(this.innerHTML))
}
}});
var H=HD.getByClass(I.SHOW_ALL,"*",B,function(J){J.onclick=function(){C.notifyObservers.call(C,"show_All")
}
});
var A=HD.getByClass(I.SHOW_MAX,"*",B,function(J){J.onclick=function(){C.notifyObservers.call(C,"show_Max")
}
});
var F=HD.getByClass(I.SHOW_DEFAULT,"*",B,function(J){J.onclick=function(){C.notifyObservers.call(C,"show_Default")
}
})
},update:function(A,B){if(A=="paging_Update"){this.render()
}}};
HD.extend(HD.util.Paging.View,[HD.util.Observable,HD.util.Template]);
HD.util.Paging.Controller=function(B,A){this.model=B;
this.view=A
};
HD.util.Paging.Controller.prototype={updatePagingData:function(A){this.model.pageNumber=A.pageNumber;
this.model.totalPages=A.totalPages;
this.model.totalMedia=A.totalMedia;
this.model.pageSize=A.pageSize;
this.model.notifyObservers("paging_Update")
}};
HD.register("hd_paging",HD.util.Paging,{version:"1.0",build:"1"});HD.Content=function(A){this.model=new HD.Content.Model(A);
this.view=new HD.Content.View(this.model);
this.controller=new HD.Content.Controller(this.model,this.view);
this.model.addObserver(this.view)
};
HD.Content.prototype={addObserver:function(A){this.model.addObserver(A)
}};
HD.Content.Model=function(A){this.config=A;
this.observers=[]
};
HD.Content.Model.prototype={getContent:function(B){this.notifyObservers("getContent_Start");
var B=HD.util.Common.hasValue(B)?B:this.config.source;
var A=this;
HD.util.Common.requestContent(B,function(D){var C=HD.util.Common.hasValue(D)?"getContent_Finish":"getContent_Error";
A.notifyObservers.call(A,C,D)
})
}};
HD.extend(HD.Content.Model,[HD.util.Observable]);
HD.Content.View=function(A){this.model=A;
this.config=this.model.config;
var B=HD.get(this.config.trigger);
var C=function(){A.getContent.call(A)
};
if(this.config.onclick!=null){C=this.config.onclick
}B.onclick=C;
this.observers=[]
};
HD.Content.View.prototype={update:function(C,F){if(C=="getContent_Start"){this.loading(true)
}else{if(C=="getContent_Finish"){var G=HD.util.Common.generateElementId();
var D=['<div id="',G,'">',F,"</div>"].join("");
var E=this.getParent();
var B=this.model;
var A=this;
HD.util.DOM.onContentReady(G,function(){B.notifyObservers.call(B,"getContent_Rendered");
A.loading.call(A,false)
});
this.render(D)
}}},getHtml:function(A){return A
}};
HD.extend(HD.Content.View,[HD.Widget]);
HD.Content.Controller=function(B,A){this.model=B;
this.view=A
};
HD.Content.Controller.prototype={};
HD.register("hd_content","HD.Content",{version:"1.0",build:"1"});HD.util.Player=function(A){A=A||{};
A.renderMode=A.renderMode||"media";
this.model=new HD.util.Player.Model(A);
this.view=new HD.util.Player.View(this.model);
this.controller=new HD.util.Player.Controller(this.model,this.view);
this.model.addObserver(this.view)
};
HD.util.Player.Model=function(A){this.config=A;
this.observers=[]
};
HD.util.Player.Model.prototype={};
HD.extend(HD.util.Player.Model,[HD.util.Observable]);
HD.util.Player.View=function(B){this.model=B;
this.config=this.model.config;
this.observers=[];
this.player=null;
this.playerId=HD.util.Common.generateElementId();
this.loadTemplates(arguments.callee);
var A=this
};
HD.util.Player.View.templates={placeholderText:'<a href="http://get.adobe.com/flashplayer/"><img src="/en_US/Media/images/content/pictorial/dark_custom_v2/img_no_flash.jpg" alt="" /></a>',getPlaceholderText:function(){return this.placeholderText
},getHtml:function(){return this.html
},html:'		<div id="${playerId}-container" class="${classes.VIDEO_PLAYER}">			<div class="${classes.NO_FLASH}">${templates.getPlaceholderText()}</div>		</div>'};
HD.util.Player.View.prototype={EVENTS:{PLAY:"PLAY",STOP:"STOP"},setStyle:function(A){this.playerStyle=A
},setListeners:function(F){var D=this.getParent();
var E=D.getElementsByTagName("div")[0];
var C=HD.util.Common.generateElementId();
this.data=F||null;
var B;
if(this.config.renderMode=="youtube"){B=F.videoUrl
}else{B=comMediaBaseUrl+"/hd/hd_player/assets/player.swf"
}var A=new SWFObject(B,C,this.config.width,this.config.height,"9");
A.addParam("allowfullscreen","true");
A.addParam("wmode","transparent");
A.addParam("allowscriptaccess","always");
if(this.config.renderMode=="youtube"){A.addParam("flashvars","rel=0"+(this.playerStyle||""))
}else{A.addParam("flashvars","file="+F.videoUrl+"&image="+F.thumbUrl+(this.playerStyle||"")+"&type=video")
}A.write(E.id);
HD.util.Player.View.views[C]=this;
this.playerId=C
},destroy:function(){var B=this.getParent();
B.innerHTML="";
var A=HD.util.Player.View.views;
if(A[this.playerId]){delete A[this.playerId]
}},update:function(A,B){if(A=="doSomething_Start"){this.loading(true)
}else{if(A=="doSomething_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{playerId:this.playerId})
},setPlayerListeners:function(){},play:function(){if(this.player){var A=YAHOO.util.Dom.get(this.player.id);
if(A&&A.sendEvent){A.sendEvent("PLAY","true")
}}},pause:function(){if(this.player){var A=YAHOO.util.Dom.get(this.player.id);
if(A&&A.sendEvent){A.sendEvent("PLAY","false")
}}},stop:function(){if(this.player){var A=YAHOO.util.Dom.get(this.player.id);
if(A&&A.sendEvent){A.sendEvent("STOP")
}}}};
HD.extend(HD.util.Player.View,[HD.Widget]);
window.playerReady=function(A){if(A.id!=undefined){HD.util.Player.View.views[A.id].player=A;
HD.util.Player.View.views[A.id].setPlayerListeners()
}};
HD.util.Player.View.views={};
HD.util.Player.View.stopAll=function(C){var A=HD.util.Player.View.views;
if(C){for(var B=0;
B<C.length;
B++){if(A[C[B]]){A[C[B]].stop()
}}}else{for(var D in A){A[D].stop()
}}};
HD.util.Player.Controller=function(B,A){this.model=B;
this.view=A
};
HD.util.Player.Controller.prototype={};
if(YAHOO.env.ua.ie>0){document.onpropertychange=function(){try{if(document&&typeof document.title!=="undefined"&&document.location.hash&&document.title.indexOf(document.location.hash)>-1){document.title=document.title.replace(document.location.hash,"")
}}catch(A){}}
}HD.register("hd_player",HD.util.Player,{version:"1.0",build:"1"});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(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return 
}this.DETECT_KEY=J?J:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(K){this.setAttribute("swf",K)
}if(B){this.setAttribute("id",B)
}if(L){this.setAttribute("width",L)
}if(D){this.setAttribute("height",D)
}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))
}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true
}if(I){this.addParam("bgcolor",I)
}var A=F?F:"high";
this.addParam("quality",A);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var G=(E)?E:window.location;
this.setAttribute("xiRedirectUrl",G);
this.setAttribute("redirectUrl","");
if(C){this.setAttribute("redirectUrl",C)
}};
deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;
this.setAttribute("useExpressInstall",true)
},setAttribute:function(A,B){this.attributes[A]=B
},getAttribute:function(A){return this.attributes[A]
},addParam:function(B,A){this.params[B]=A
},getParams:function(){return this.params
},addVariable:function(B,A){this.variables[B]=A
},getVariable:function(A){return this.variables[A]
},getVariables:function(){return this.variables
},getVariablePairs:function(){var C=new Array();
var B;
var A=this.getVariables();
for(B in A){C[C.length]=B+"="+A[B]
}return C
},getSWFHTML:function(){var B="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath)
}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';
B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';
var F=this.getParams();
for(var E in F){B+=[E]+'="'+F[E]+'" '
}var D=this.getVariablePairs().join("&");
if(D.length>0){B+='flashvars="'+D+'"'
}B+="/>"
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath)
}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';
B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';
var C=this.getParams();
for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'
}var A=this.getVariablePairs().join("&");
if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'
}B+="</object>"
}return B
},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(A)&&!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 C=(typeof B=="string")?document.getElementById(B):B;
C.innerHTML=this.getSWFHTML();
return true
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))
}}return false
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];
if(A&&A.description){E=new deconcept.PlayerVersion(A.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 B=1;
var C=3;
while(B){try{C++;
B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);
E=new deconcept.PlayerVersion([C,0,0])
}catch(D){B=null
}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
E=new deconcept.PlayerVersion([6,0,21]);
B.AllowScriptAccess="always"
}catch(D){if(E.major==6){return E
}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))
}}}return E
};
deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;
this.minor=A[1]!=null?parseInt(A[1]):0;
this.rev=A[2]!=null?parseInt(A[2]):0
};
deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false
}if(this.major>A.major){return true
}if(this.minor<A.minor){return false
}if(this.minor>A.minor){return true
}if(this.rev<A.rev){return false
}return true
};
deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;
if(C==null){return D
}if(D){var B=D.substring(1).split("&");
for(var A=0;
A<B.length;
A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))
}}}return""
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");
for(var C=B.length-1;
C>=0;
C--){B[C].style.display="none";
for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=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(A){return document.all[A]
}
}var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;HD.WidgetView=function(A){this.config=A;
this.observers=[];
this.navigationEl=HD.get(this.config.navigation);
this.canvasEl=HD.get(this.config.canvas)
};
HD.WidgetView.prototype={showDiv:function(C,A,B){this.setActiveDiv(HD.get(C));
this.setupNav(A,B)
},setActiveDiv:function(B){var E=this.canvasEl;
if(E.hasChildNodes()){var F=E.childNodes;
for(var D=0,A=F.length;
D<A;
D++){var C=F[D];
if(C.id!=null){HD.hide(C)
}}}HD.show(B)
},setupNav:function(B,C){var A=HD.CSS_CLASSES;
HD.addClass(this.navigationEl,A.CONTROL);
this.setNavText(B);
if(C!=null){HD.addClass(this.navigationEl,A.CONTROL);
this.navigationEl.onclick=C
}else{HD.removeClass(this.navigationEl,A.CONTROL)
}},revertNavText:function(){this.navigationEl.innerHTML=this.previousNavHTML
},setNavText:function(A){this.previousNavHTML=this.navigationEl.innerHTML;
this.navigationEl.innerHTML=A
}};
HD.extend(HD.WidgetView,[HD.util.Observable]);
HD.register("hd_widget_view",HD.WidgetView,{version:"1.0",build:"1"});HD.WidgetCluster=function(C,A,B){this.model=C;
this.view=A;
this.config=B;
this.widgets=[]
};
HD.WidgetCluster.prototype={init:function(A,B){this.addWidgets(A);
if(B!=null){B()
}},loadDependencies:function(C,D){var A=this;
var B=widgetsConfig;
HD.insert({filter:"raw",require:C,base:this.config.baseUrl+"/hd/",loadOptional:true,skin:{base:"assets/skins/",defaultSkin:"hd"},onSuccess:function(E){A.addWidgets.call(A,B);
if(D!=null){D()
}}})
},addWidgets:function(C){for(var B=0,A=C.length;
B<A;
B++){this.addWidget(C[B])
}},addWidget:function(A){var C=this.getClass(HD.classMap[A.type]);
if(C!=null){var B=new C(A);
if(this.model!=null){this.model.addObserver(B);
B.model=this.model
}if(this.view!=null){this.view.addObserver(B);
B.view=this.view
}this.widgets.push(B);
return B
}},removeWidget:function(E){this.model.removeObserver(E);
var B=[];
var D=this.widgets;
for(var C=0,A=D.length;
C<A;
C++){var F=D[C];
if(F!=E){B.push(F)
}}this.widgets=B
},getWidget:function(A){return this.widgets[A]
},getClass:function(D){if(D==null){return null
}var E=D.split(".");
var B=window;
for(var C=0,A=E.length;
C<A;
C++){B=B[E[C]]
}return B
}};
HD.register("hd_widget_cluster",HD.WidgetCluster,{version:"1.0",build:"1"});HD.CommunityDAO=function(A){this.config=A||{};
this.config.secure=this.config.secure||false;
if(this.config.secure&&typeof this.config.secure=="boolean"){this.config.secure="https://www.harley-davidson.com/"
}this.mediaBaseUrl="http://media.kickstatic.com/";
this.mediaUrlFields=["thumbUrl","url"];
this.pageNumber=A.startIndex;
this.initialPageIndex=A.startIndex;
this.totalPages=A.startIndex;
this.totalMedia=0;
this.activeItem=null;
this.filters=A.filters||{};
this.activeItemIndexOnPage=0;
this.activeItemPage=A.startIndex;
this.observers=[];
this.ratings=[];
if(!!this.config.restoreState){this.restoreState(typeof this.config.restoreState=="string"?this.config.restoreState:null,true)
}};
HD.CommunityDAO.prototype={getMedia:function(C,H,F,B){this.notifyObservers("getMedia_Start");
this.pageIndex=C;
var E={pageNumber:C};
this.setFilters(E);
var A=this;
var G=H;
var F=F||false;
var D={callback:function(P){var N=P.success?"getMedia_Finish":"getMedia_Error";
var J=P.media;
var K=[];
var L=null;
for(var M=0,O=J.length;
M<O;
M++){var R=J[M];
if(R!=null){if(L!=null){R.previous=L
}if(M<O-1){R.next=J[M+1]
}A.setFacade.call(A,R);
K.push(R)
}L=R
}var Q=B||(G?J.length-1:0);
if(K.length>0&&!F){A.activeItem=K[Q]
}A.totalPages=P.totalPages;
A.pageNumber=P.pageNumber;
A.totalMedia=P.totalMedia;
A.media=K;
P.media=K;
A.notifyObservers.call(A,N,P);
if(K.length>0){var I=K[Q];
if(!F){A.activeItem=null;
A.setActiveItem.call(A,I)
}}},parameters:{siteName:this.config.siteName}};
if(this.config.preloadedMedia==null){CommunityService.getMedia(E,D)
}else{D.callback(this.config.preloadedMedia.getMedia());
this.config.preloadedMedia=null
}},applySecureUrl:function(A){if(this.config.secure){for(var B=0;
B<this.mediaUrlFields.length;
B++){var C=[this.mediaUrlFields[B]];
if(A[C]){A[C]=A[C].replace(this.mediaBaseUrl,this.config.secure)
}}}return A
},hasNextPage:function(){return this.pageNumber<this.totalPages
},hasPreviousPage:function(){return this.pageNumber>this.initialPageIndex
},getNextPage:function(A){if(this.hasNextPage()){this.getMedia(++this.pageNumber,null,A)
}},getSamePage:function(){this.getMedia(this.pageNumber)
},getPreviousPage:function(B,A){if(this.hasPreviousPage()){this.getMedia(--this.pageNumber,B,A)
}},getActiveItem:function(){return this.activeItem
},hasNextItem:function(){if(this.activeItem&&this.activeItem.next!=null){return true
}return this.hasNextPage()
},hasPreviousItem:function(){if(this.activeItem&&this.activeItem.previous!=null){return true
}return this.hasPreviousPage()
},getNextItem:function(){if(this.activeItem.next!=null){this.setActiveItem(this.activeItem.next)
}else{if(this.hasNextPage()){this.getNextPage();
this.notifyObservers("activeItem_PageChange")
}}},getPreviousItem:function(){if(this.activeItem.previous!=null){this.setActiveItem(this.activeItem.previous)
}else{if(this.hasPreviousPage()){this.getPreviousPage(true);
this.notifyObservers("activeItem_PageChange")
}}},setActiveItem:function(A){if(this.activeItem!=null&&this.activeItem.mediaId==A.mediaId){return 
}this.activeItem=A;
this.notifyObservers("activeItem_Change",A)
},setFacade:function(A){if(A!=null){this.applySecureUrl(A);
var D=/^hd:([a-zA-Z0-9_]+?)(=(.+))?$/;
if(A.tags&&A.tags.length>0){A.metaTags={};
for(var B=A.tags.length-1;
B>=0;
B--){var C=A.tags[B].match(D);
if(C){A.tags.splice(B,1);
A.metaTags[C[1]]=C[3]||true
}}}if(HD.community.isBlog(A.contentType)){A.facade=new HD.community.Blog(A)
}else{if(HD.community.isPhoto(A.contentType)){A.facade=new HD.community.Photo(A)
}else{if(HD.community.isVideo(A.contentType)){A.facade=new HD.community.Video(A)
}}}}},getMedium:function(E,G,F){this.notifyObservers("getMedium_Start");
var C={mediaId:E};
this.setFilters(C);
if(F!=null){C.contentType=F
}var A=this;
var D=G;
var B={callback:function(K){var J=K.media;
var I=K.success?"getMedium_Finish":"getMedium_Error";
var H=J[0];
A.setFacade.call(A,H);
A.insertItem.call(A,H);
if(D!=null){D(H)
}A.addCachedMedium.call(A,H);
A.setActiveItem.call(A,H);
A.notifyObservers.call(A,I,H)
},parameters:{siteName:this.config.siteName}};
CommunityService.getMedium(C,B)
},getMultipleMedium:function(C,G,F){this.notifyObservers("getMultipleMedium_Start");
var D={mediaId:(C||[]).join(","),contentType:F||this.config.contentType};
this.setFilters(D);
if(F!=null){D.contentType=F
}var A=this;
var E=G;
var B={callback:function(K){var J=K.media;
var H=K.success?"getMultipleMedium_Finish":"getMultipleMedium_Error";
for(var I=0;
I<J.length;
I++){A.setFacade.call(A,J[I]);
A.insertItem.call(A,J[I]);
A.addCachedMedium.call(A,J[I])
}if(!!E){E(J)
}A.notifyObservers.call(A,H,J)
},parameters:{siteName:this.config.siteName}};
CommunityService.getMultipleMedium(D,B)
},getTags:function(D){this.notifyObservers("getTags_Start");
var C={itemsLimit:D};
this.setFilters(C);
if(C.tags){delete C.tags
}var A=this;
var B={callback:function(H){var E=H.success?"getTags_Finish":"getTags_Error";
var G=/^hd:([a-zA-Z0-9_]+?)(=(.+))?$/;
for(var F=H.tags.length-1;
F>=0;
F--){if(H.tags[F].tagName.match(G)){H.tags.splice(F,1)
}}A.notifyObservers.call(A,E,H)
},parameters:{siteName:this.config.siteName}};
CommunityService.getTags(C,B)
},getMonthly:function(D){this.notifyObservers("getMonthly_Start");
var C={itemsLimit:D};
this.setFilters(C);
var A=this;
var B={callback:function(F){var E=F.success?"getMonthly_Finish":"getMonthly_Error";
A.notifyObservers.call(A,E,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getMonthly(C,B)
},getAllBlogAuthors:function(D){this.notifyObservers("getAllBlogAuthors_Start");
var C={itemsLimit:D};
this.setFilters(C);
var A=this;
var B={callback:function(F){var E="getAllBlogAuthors_Finish";
A.notifyObservers.call(A,E,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getAllBlogAuthors(B)
},getFacebookEvents:function(){this.notifyObservers("getFacebookEvents_Start");
var A=this;
var B={callback:function(D){var C="getFacebookEvents_Finish";
A.notifyObservers.call(A,C,D)
},parameters:{siteName:this.config.siteName}};
CommunityService.getAllFacebookEvents(B)
},getFutureFacebookEvents:function(){this.notifyObservers("getFutureFacebookEvents_Start");
var A=this;
var B={callback:function(D){var C="getFutureFacebookEvents_Finish";
A.notifyObservers.call(A,C,D)
},parameters:{siteName:this.config.siteName}};
CommunityService.getFutureFacebookEvents(B)
},getAllFacebookAttendeesForEvent:function(D,B){this.notifyObservers("getFacebookAttendeesForEvent_Start");
var A=this;
var C={callback:function(F){var E="getFacebookAttendeesForEvent_Finish";
A.notifyObservers.call(A,E,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getAllFacebookAttendeesForEvent(D,B,C)
},getYoutubeMedia:function(D){this.notifyObservers("getYoutube_Start");
var B={numberToReturn:D};
var A=this;
var C={callback:function(F){var E="getYoutube_Finish";
A.notifyObservers.call(A,E,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getYoutubeMedia(B,C)
},getTwitterFeed:function(){this.notifyObservers("getTwitterFeed_Start");
var A=this;
var B={callback:function(D){var C="getTwitterFeed_Finish";
A.notifyObservers.call(A,C,D)
},parameters:{siteName:this.config.siteName}};
CommunityService.getTwitterFeed(B)
},getPopular:function(D,E){this.notifyObservers("getPopular_Start");
var C={itemsLimit:D};
this.setFilters(C);
if(!HD.util.Common.hasValue(E)){E=HD.SORTS.HIGHEST_RATED
}C.sortType=E;
var A=this;
var B={callback:function(L){var I=L.success?"getPopular_Finish":"getPopular_Error";
var K=L.media;
var G=null;
for(var J=0,F=K.length;
J<F;
J++){var H=K[J];
if(H!=null){if(G!=null){H.previous=G
}if(J<F-1){H.next=K[J+1]
}}A.setFacade.call(A,H);
G=H
}L.media=K;
A.notifyObservers.call(A,I,L)
},parameters:{siteName:this.config.siteName}};
CommunityService.getPopularMedia(C,B)
},getComments:function(D,E){this.notifyObservers("getComments_Start");
var C={mediaId:D};
this.setFilters(C);
if(HD.util.Common.hasValue(E)){C.contentType=E
}var A=this;
var B={callback:function(L){var G=L.success?"getComments_Finish":"getComments_Error";
var J=L.media;
var F=J[0];
var K=F.comments;
for(var H=0;
H<K.length;
H++){var I=K[H].submittedBy;
if(I.match(/^anonymoususer/i)){K[H].submittedBy="anonymous"
}}A.notifyObservers.call(A,G,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getComments(C,B)
},getFaceoff:function(D){this.notifyObservers("getFaceoff_Start");
this.notifyObservers("getComments_Start");
var A=this;
var C={mediaId:D};
this.setFilters(C);
var B={callback:function(F){if(F.success){A.setFacade(F.faceoff);
for(var G=0;
G<F.media.length;
G++){A.setFacade(F.media[G])
}}var E=F.success?"_Finish":"_Error";
A.notifyObservers("getComments"+E,F.faceoff||null);
A.notifyObservers("getFaceoff"+E,F)
},parameters:{siteName:this.config.siteName}};
CommunityService.getFaceoff(C,B)
},submitMedium:function(D){this.notifyObservers("submitMedium_Start");
var C="";
var B=D;
if(D.type.value!=null&&D.type.value!=""){C="?type="+D.type.value
}var A=this;
HD.util.Common.uploadFile(D,this.config.baseUrl+"/fileUpload"+C,function(G){var E=(G.indexOf("success")>=0)?"submitMedium_Finish":"submitMedium_Error";
var F=new Array(4);
F[0]=G;
F[1]=B.title.value;
F[2]=B.story.value;
F[3]=B.type.value||"";
clearTimeout(HD.UploadWidget.progressTimer);
A.notifyObservers.call(A,E,F)
})
},submitComment:function(D,F,E){this.notifyObservers("submitComment_Start",E);
var C={mediaId:D,comment:E,contentType:F};
this.setFilters(C);
var A=this;
var B={callback:function(I){var H=I.success?"submitComment_Finish":"submitComment_Error";
var G=null;
if(I.success){G=I.media[0];
A.setFacade.call(A,G)
}else{G=I.errors
}HD.util.Analytics.track(A.analyticsCommentString.call(A,G));
A.notifyObservers.call(A,H,G)
},parameters:{siteName:this.config.siteName}};
CommunityService.submitComment(C,B)
},rateMedia:function(E,F,D){this.notifyObservers("rateMedia_Start");
var C={mediaId:E,rating:D,contentType:F};
this.setFilters(C);
var A=this;
var B={callback:function(J){var H=J.success&&J.media!=null?"rateMedia_Finish":"rateMedia_Error";
var G=null;
var I=J.media;
if(I!=null){G=I[0];
A.setFacade.call(A,G);
A.insertItem.call(A,G);
A.addCachedMedium.call(A,G);
HD.util.Analytics.track(A.analyticsRatingString.call(A,G))
}A.notifyObservers.call(A,H,G)
},parameters:{siteName:this.config.siteName}};
CommunityService.rateMedia(C,B)
},insertItem:function(B){var D=this.media;
if(D!=null){for(var C=0,A=D.length;
C<A;
C++){if(D[C]!=null&&D[C].mediaId==B.mediaId){if(C>0){B.previous=D[C-1]
}if(C<A-1){B.next=D[C+1]
}D[C]=B
}}}this.media=D
},getMemberProfile:function(B){this.notifyObservers("getMember_Start");
var D={memberId:B};
this.setFilters(D);
var A=this;
var C={callback:function(F){var G=F.profile;
var E=F.success?"getMember_Finish":"getMember_Error";
A.notifyObservers.call(A,E,G)
},parameters:{siteName:this.config.siteName}};
CommunityService.getMemberProfile(D,C)
},getRatings:function(B){this.notifyObservers("getRatings_Start");
if(B==null){B=this.media
}var H=this.config.siteName;
var C=[];
for(var E=0,G=B.length;
E<G;
E++){var J=B[E];
C.push({mediaId:J.mediaId,contentType:J.contentType,siteName:H})
}var A={ratings:C};
this.setFilters(A);
var D=this;
var F=B;
var I={callback:function(R){var M=R.success?"getRatings_Finish":"getRatings_Error";
var P=R.ratings;
var Q=F;
for(var N=0,K=Q.length;
N<K;
N++){var L=Q[N];
var O=P[N];
if(L!=null&&O!=null){L.currentUserRating=O.rating;
D.addCachedMedium(L);
L.facade.updateRatingWidgets(L)
}}},parameters:{siteName:this.config.siteName}};
CommunityService.getRatings(A,I)
},getCachedMedium:function(F){var B=this.ratings[F];
if(B==null&&this.media!=null){var E=this.media;
for(var D=0,A=E.length;
D<A;
D++){var C=E[D];
if(C!=null&&C.mediaId==F){B=C;
break
}}}return B
},addCachedMedium:function(A){this.ratings[A.mediaId]=A
},setFilters:function(C){var B=this.filters;
var A=this.config;
C.siteName=A.siteName;
if(B.startDate!=null){C.startDate=B.startDate
}if(B.endDate!=null){C.endDate=B.endDate
}if(B.sortType!=null){C.sortType=B.sortType
}if(B.tags!=null){C.tags=B.tags
}if(B.members!=null){C.members=B.members
}if(B.metaTags!=null){C.tags=(C.tags||[]).concat(B.metaTags)
}if(B.author!=null){C.author=B.author
}if(B.contentSubtype!=null){C.contentSubtype=B.contentSubtype
}if(B.numberToReturn!=null){C.numberToReturn=B.numberToReturn
}if(A.categories!=null){C.categories=A.categories
}if(A.contentType!=null&&C.contentType==null){C.contentType=A.contentType
}if(A.pageSize!=null){C.pageSize=A.pageSize
}if(A.thumbWidth!=null){C.thumbWidth=A.thumbWidth
}if(A.mediaWidth!=null){C.mediaWidth=A.mediaWidth
}},setDateRange:function(C,B,A){this.notifyObservers("dateRange_Set",C);
this.filters.startDate=C.startDate;
this.filters.endDate=C.endDate;
if(!B){this.getMedia(1,null,!A)
}},clearDateRange:function(B,A){this.notifyObservers("dateRange_Clear");
delete this.filters.startDate;
delete this.filters.endDate;
if(!B){this.getMedia(1,null,!A)
}},setMetaTags:function(A,C,B){this.filters.metaTags=typeof A=="string"?[A]:A;
if(this.filters.metaTags.length==0){return this.clearMetaTags(C)
}this.notifyObservers("metaTags_Set",this.filters.metaTags);
if(!C){this.getMedia(1,null,!B)
}},clearMetaTags:function(B,A){delete this.filters.metaTags;
this.notifyObservers("metaTags_Clear",[]);
if(!B){this.getMedia(1,null,!A)
}},setTags:function(A,C,B){this.filters.tags=typeof A=="string"?[A]:A;
if(this.filters.tags.length==0){return this.clearTags(C)
}this.notifyObservers("tags_Set",this.filters.tags);
if(!C){this.getMedia(1,null,!B)
}},clearTags:function(B,A){delete this.filters.tags;
this.notifyObservers("tags_Clear",[]);
if(!B){this.getMedia(1,null,!A)
}},setAuthor:function(A,C,B){this.filters.author=A.userName;
if(this.filters.author.length==0){return this.clearAuthor(C)
}this.notifyObservers("author_Set",A);
if(!C){this.getMedia(1,null,!B)
}},clearAuthor:function(B,A){delete this.filters.author;
this.notifyObservers("author_Clear",[]);
if(!B){this.getMedia(1,null,!A)
}},setContentSubtype:function(A,C,B){this.filters.contentSubtype=A;
if(this.filters.contentSubtype.length==0){return this.clearContentSubtype(C)
}this.notifyObservers("contentSubtype_Set",this.filters.contentSubtype);
if(!C){this.getMedia(1,null,!B)
}},clearContentSubtype:function(B,A){delete this.filters.contentSubtype;
this.notifyObservers("contentSubtype_Clear",[]);
if(!B){this.getMedia(1,null,!A)
}},setCategories:function(A,C,B){this.config.categories=A.slice(0);
this.notifyObservers("categories_Set",A);
if(!C){this.getMedia(1,null,!B)
}},setSort:function(A){this.notifyObservers("sortType_Change",A);
this.filters.sortType=A;
this.pageNumber=this.initialPageIndex;
this.getSamePage()
},getSort:function(A){return this.filters.sortType
},isInCurrentPage:function(D){var B=false;
var C=this.media;
for(var A=0;
A<C.length;
A++){if(C[A].mediaId==D){B=true;
break
}}return B
},_generateState:function(){var A={categories:this.config.categories.join(";")};
if(this.filters.tags){A.tags=this.filters.tags.join(";")
}if(this.filters.members){A.members=this.filters.members.join(";")
}if(this.filters.author){A.author=this.filters.author.join(";")
}if(this.filters.contentSubtype){A.contentSubtype=this.filters.contentSubtype.join(";")
}if(this.filters.startDate){A.startDate=this.filters.startDate
}if(this.filters.endDate){A.startDate=this.filters.startDate
}if(this.filters.sortType){A.sortType=this.filters.sortType
}return A
},_applyState:function(A,B){if(!A){return false
}if(typeof A=="string"){A=YAHOO.util.Cookie._parseCookieHash(A)
}if(A.categories){this.setCategories(A.categories.split(";"),true)
}if(A.tags){this.setTags(A.tags.split(";"),true)
}if(A.author){this.setAuthor(A.author)
}if(A.contentSubtype){this.setContentSubtype(A.contentSubtype)
}if(A.startDate){this.filters.startDate=A.startDate
}if(A.endDate){this.filters.endDate=A.endDate
}if(A.sortType){this.filters.sortType=A.sortType
}if(!B){this.getMedia(1)
}return true
},exportState:function(){return YAHOO.util.Cookie._createCookieHashString(this._generateState())
},importState:function(A,B){return this._applyState(A,B)
},storeState:function(A){return YAHOO.util.Cookie.setSubs(A||this.config.siteName,this._generateState())
},restoreState:function(A,B){return this._applyState(YAHOO.util.Cookie.getSubs(A||this.config.siteName),B)
},clearState:function(A){return YAHOO.util.Cookie.remove(A||this.config.siteName)
},analyticsRatingString:function(A){return"default_analyticsRatingString"
},analyticsCommentString:function(A){return"default_analyticsCommentString"
}};
HD.extend(HD.CommunityDAO,[HD.util.Observable]);
HD.register("hd_community_model","HD.CommunityDAO",{version:"1.0",build:"1"});HD.CommunityEngine=function(C){this.config=HD.merge({dao:{},view:{},cluster:{},widgets:{},observers:[]},C||{});
var F=[],B={};
for(var E in this.config.widgets){B[E]=F.length;
F.push(this.config.widgets[E])
}this.dao=new HD.CommunityDAO(this.config.dao);
this.view=new HD.WidgetView(this.config.view);
this.cluster=new HD.WidgetCluster(this.dao,this.view,this.config.cluster);
this.cluster.init(F);
this.widgets={dao:this.dao,view:this.view};
for(var A in B){var E=this.cluster.getWidget(B[A]);
this.widgets[A]=E;
E.engine=this
}for(var D=0;
D<this.config.observers.length;
D++){this.addObserver(this.config.observers[D])
}this.observers=[]
};
HD.CommunityEngine.prototype={addObserver:function(A){for(var B=0;
B<A.widgets.length;
B++){try{if(typeof A.widgets[B]=="string"){this.widgets[A.widgets[B]].addObserver(A)
}else{A.widgets[B].addObserver(A)
}}catch(C){}}},removeObserver:function(A){for(var B=0;
B<A.widgets.length;
B++){try{if(typeof A.widgets[B]=="string"){this.widgets[A.widgets[B]].removeObserver(A)
}else{A.widgets[B].removeObserver(A)
}}catch(C){}}},addWidgets:function(B){for(var A in B){var C=this.cluster.addWidget(B[A]);
this.widgets[A]=C;
C.engine=this
}},getWidgetName:function(B){for(var A in this.widgets){if(this.widgets[A]===B){return A
}}return null
},getWidget:function(A){return this.widgets[A]||null
}};
HD.extend(HD.CommunityEngine,[HD.util.Observable]);
HD.register("hd_community_engine","HD.CommunityEngine",{version:"1.0",build:"1"});if(typeof HD.community=="undefined"||!HD.community){HD.community={CONTENT_TYPES:{BLOG:"blog",PHOTO:"photo",VIDEO:"video",BOTH:"both"},getType:function(B){if(B.indexOf(" ")<0){return B
}var A=B.split(" ");
return A[1]
},isPhoto:function(A){return this.getType(A)==this.CONTENT_TYPES.PHOTO
},isVideo:function(A){return this.getType(A)==this.CONTENT_TYPES.VIDEO
},isBlog:function(A){return this.getType(A)==this.CONTENT_TYPES.BLOG
},isBoth:function(A){return this.getType(A)==this.CONTENT_TYPES.BOTH
}}
}HD.register("hd_community","HD.community",{version:"1.0",build:"1"});HD.CarouselWidget=function(A){this.config=A||{};
this.config.compact=this.config.compact||false;
this.config.delay=this.config.delay||10;
this.config.pageSize=this.config.pageSize||5;
this.config.contentFeed=this.config.contentFeed||"getMedia";
this.config.previewLength=this.config.previewLength||140;
this.config.playerHeight=this.config.playerHeight||300;
this.config.playerWidth=this.config.playerWidth||400;
this.renderMode=this.config.contentFeed.match(/youtube/i)?"youtube":"media";
this.offset=0;
this.timeout=null;
this.playerIds=[];
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.CarouselWidget.templates={carouselLabel:"Latest Media",viewAllText:"View All",viewAllUrl:"#featAnchorAll",scrollLeftText:"&lt;",scrollRightText:"&gt;",authorLabel:"By ",getCarouselLabel:function(){return this.carouselLabel
},getViewAllText:function(){return this.viewAllText
},getViewAllUrl:function(){return this.viewAllUrl
},getScrollLeftText:function(){return this.scrollLeftText
},getScrollRightText:function(){return this.scrollRightText
},getAuthorLabel:function(){return this.authorLabel
},getHtml:function(){return this.html
},html:'		{macro youtube(item, isThumb)}			<div class="${classes.ITEM} ${classes.ITEM}-youtube">				{if isThumb}					<div class="${classes.SMALL_THUMB_WRAPPER}">						<div class="${classes.SMALL_THUMB}" style="background-image: url(${item.thumbnailUrl})"></div>					</div>				{else}					<div class="${classes.LARGE_THUMB_WRAPPER}">						<div class="${classes.LARGE_THUMB} ${hooks.YOUTUBE}"></div>					</div>				{/if}				<a class="${classes.TITLE}" href="${item.playerUrl}">${item.title|ellipse:config.titleLength || item.title.length}</a>				{if !!item.uploader}				<div class="${classes.AUTHOR}">				 	<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>				 	<a class="${classes.VALUE}" href="http://www.youtube.com/user/${item.uploader}">${item.uploader}</a>				</div>				{/if}				<div class="${classes.DESCRIPTION}">${item.description|ellipse:config.previewLength || item.description.length}</div>			</div>		{/macro}		{macro thumbs(isCompact)}			{if !isCompact}			<div class="${classes.CAROUSEL}-scroller">				<div class="${hooks.SCROLL_LEFT}">${templates.getScrollLeftText()}</div>				<div class="${hooks.SCROLL_CONTAINER}">			{/if}				<ul class="${hooks.THUMBS_CONTAINER}">					{for item in items}						<li class="${hooks.THUMB}{if item_index==0}${" "}${classes.CAROUSEL}-active{/if}">							{if renderMode=="youtube"}								${youtube(item, true)}							{else}								${item|facade}							{/if}						</li>					{/for}				</ul>			{if !isCompact}				</div>				<div class="${hooks.SCROLL_RIGHT}">${templates.getScrollRightText()}</div>			</div>			{/if}		{/macro}		<div class="${classes.CAROUSEL} ${classes.CAROUSEL}-{if config.compact}compact{else}full{/if} ${classes.WIDGET}">			<span class="${classes.TITLE}">${templates.getCarouselLabel()}</span>			{if config.compact}${thumbs(config.compact)}{/if}			<ul class="${hooks.ITEMS_CONTAINER}">				{for item in items}					<li class="${hooks.ITEM}{if item_index==0}${" "}${classes.CAROUSEL}-active{/if}">						{if renderMode=="youtube"}							${youtube(item)}						{else}							${item|facade}						{/if}					</li>				{/for}			</ul>			{if !config.compact}${thumbs(config.compact)}{/if}			<a href="${templates.getViewAllUrl()}" name="featAnchorAll" class="${classes.VIEW_ALL} ${classes.CONTROL} ${hooks.VIEW_ALL}">${templates.getViewAllText()}</a>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.CarouselWidget.hooks={ITEM:A.CAROUSEL+"-item",THUMB:A.CAROUSEL+"-thumb",YOUTUBE:A.CAROUSEL+"-youtube",SCROLL_LEFT:A.CAROUSEL+"-scroll-left",SCROLL_RIGHT:A.CAROUSEL+"-scroll-right",SCROLL_CONTAINER:A.CAROUSEL+"-scroll-container",ITEMS_CONTAINER:A.CAROUSEL+"-items",THUMBS_CONTAINER:A.CAROUSEL+"-thumbs",VIEW_ALL:A.CAROUSEL+"-viewall"}
})();
HD.CarouselWidget.prototype={update:function(A,B){if(A==this.config.contentFeed+"_Start"){this.loading(true)
}else{if(A==this.config.contentFeed+"_Finish"){this.loading(false);
this.render(B)
}}},scrollMedia:function(E,A){var B=HD.CSS_CLASSES;
var F=this.getParent();
var I=HD.getByClass(this.config.hooks.ITEM,"*",F);
var H=HD.getByClass(this.config.hooks.THUMB,"*",F);
this.offset=E;
if(E>=((this.config.compact&&this.config.pageSize)||I.length)){this.offset=0
}if(E<0){this.offset=((this.config.compact&&this.config.pageSize)||I.length)-1
}if(this.playerIds&&this.playerIds.length>0){HD.util.Player.View.stopAll(this.playerIds)
}if(this.config.compact||!A){for(var C=0;
C<I.length;
C++){if(C==this.offset){HD.addClass(I[C],B.CAROUSEL+"-active");
if(H[C]){HD.addClass(H[C],B.CAROUSEL+"-active")
}}else{HD.removeClass(I[C],B.CAROUSEL+"-active");
if(H[C]){HD.removeClass(H[C],B.CAROUSEL+"-active")
}}}}if(!this.config.compact&&this.scrollContainerEl){var D=(this.thumbWidth+this.thumbOffset)*this.offset;
if(D<this.scrollContainerEl.scrollLeft||(D+this.thumbWidth>this.scrollContainerEl.scrollLeft+this.scrollContainerEl.clientWidth)){if(D+this.thumbWidth>this.scrollContainerEl.scrollLeft+this.scrollContainerEl.clientWidth){D+=this.thumbWidth-this.scrollContainerEl.clientWidth
}if(this.thumbScroll&&this.thumbScroll.isAnimated){this.thumbScroll.stop()
}var G=Math.min(1.25,0.8*Math.abs(this.scrollContainerEl.scrollLeft-D)/100);
this.thumbScroll=new YAHOO.util.Scroll(this.scrollContainerEl,{scroll:{to:[D,0]}},G,YAHOO.util.Easing.easeOut);
this.thumbScroll.animate()
}}this.resetQueue()
},setQueue:function(){var A=this;
this.timeout=setTimeout(function(){A.scrollMedia(A.offset+1)
},1000*this.config.delay)
},clearQueue:function(){if(this.timeout){clearTimeout(this.timeout);
this.timeout=null
}},resetQueue:function(){this.clearQueue();
this.setQueue()
},setListeners:function(H){var L=this,C=this.config;
var I=this.getParent();
var B;
if(this.renderMode=="youtube"){B=H
}else{B=H.media
}var K=HD.getByClass(this.config.hooks.ITEM,"*",I);
var J=HD.getByClass(this.config.hooks.THUMB,"*",I);
var F=HD.getByClass(this.config.hooks.VIEW_ALL,"*",I);
if(!this.config.compact){this.thumbsContainerEl=HD.getByClass(this.config.hooks.THUMBS_CONTAINER,"*",I)[0]||null;
this.itemsContainerEl=HD.getByClass(this.config.hooks.ITEMS_CONTAINER,"*",I)[0]||null;
this.scrollContainerEl=HD.getByClass(this.config.hooks.SCROLL_CONTAINER,"*",I)[0]||null;
this.scrollLeftEl=HD.getByClass(this.config.hooks.SCROLL_LEFT,"*",I)[0]||null;
this.scrollRightEl=HD.getByClass(this.config.hooks.SCROLL_RIGHT,"*",I)[0]||null;
this.thumbWidth=0,this.thumbTotalWidth=0;
if(J[0]&&J[1]){this.thumbWidth=J[0].offsetWidth;
this.thumbOffset=J[1].offsetLeft-J[0].offsetLeft-this.thumbWidth
}if(this.thumbsContainerEl){this.thumbsContainerEl.style.width=((this.thumbWidth+this.thumbOffset)*J.length)+"px"
}if(this.scrollContainerEl){this.scrollContainerEl.style.width=(this.thumbWidth*this.config.pageSize+this.thumbOffset*(this.config.pageSize-1))+"px";
this.scrollContainerEl.scrollLeft=0
}if(this.scrollLeftEl){this.scrollLeftEl.onclick=function(){L.scrollMedia(L.offset-1)
}
}if(this.scrollRightEl){this.scrollRightEl.onclick=function(){L.scrollMedia(L.offset+1)
}
}}for(var G=0,E=Math.min(B.length,(this.config.compact&&this.config.pageSize)||B.length);
G<E;
G++){(function(){var R=B[G];
var Q=G;
if(R&&R.facade){if(K[G]){R.facade.setListener(K[G],L)
}if(J[G]){R.facade.setListener(J[G],L)
}}if(K[G]&&J[G]){K[G].onclick=function(){L.notifyObservers("viewCarouselItem",R);
L.clearQueue();
return false
};
var M=HD.getByClass(HD.community.Media.hooks.MEDIA_TITLE,"*",K[G])[0]||null;
if(M){M.onclick=function(){L.notifyObservers("viewCarouselItemTitle",R);
return false
}
}var O=function(){if(L.timeout){L.resetQueue()
}};
K[G].onmouseover=O;
K[G].onmouseout=O;
K[G].onmousemove=O;
var P=HD.getByClass(L.config.hooks.YOUTUBE,"*",K[G]);
if(P[0]&&L.renderMode=="youtube"){var N=new HD.util.Player({parent:P[0],width:C.playerWidth||400,height:C.playerHeight||300,parentWidget:L,templates:C.playerTemplates||{},hooks:C.playerHooks||{},renderMode:L.renderMode});
N.view.render({videoUrl:R.mediaUrl})
}}if(J[G]){J[G].onclick=function(){L.notifyObservers("scrollCarouselItem",R);
L.notifyObservers("viewCarouselItemThumb",R);
L.scrollMedia(Q);
return false
}
}})()
}var A=HD.getByClass(HD.CSS_CLASSES.VIDEO_PLAYER,"*",I);
this.playerIds=[];
for(var G=0,D=A.length;
G<D;
G++){if(A[G].firstChild&&A[G].firstChild.id){this.playerIds.push(A[G].firstChild.id)
}}if(F[0]){F[0].onclick=function(){L.notifyObservers("viewAllCarouselItems",B);
return false
}
}this.offset=0;
this.setQueue()
},getHtml:function(B){var C;
if(this.renderMode=="youtube"){C=(B&&B.slice(0,Math.min(B.length,(this.config.compact&&this.config.pageSize)||B.length)))||[]
}else{C=(B&&B.media&&B.media.slice(0,Math.min(B.media.length,(this.config.compact&&this.config.pageSize)||B.media.length)))||[];
for(var A=0;
A<C.length;
A++){C[A].description=HD.util.Common.ellipseText(C[A].description,this.config.previewLength)
}}return this.processTemplate(this.config.templates.getHtml(),{items:C,community:HD.community,renderMode:this.renderMode})
}};
HD.extend(HD.CarouselWidget,[HD.Widget]);
HD.register("hd_carousel_widget","HD.CarouselWidget",{version:"1.0",build:"1"});HD.DetailWidget=function(A){this.config=A;
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.DetailWidget.templates={getHtml:function(){return this.html
},html:'		{if data}			<div class="${classes.DETAIL} ${classes.WIDGET}">				${data|facade}			</div>		{/if}'};
HD.DetailWidget.prototype={setListeners:function(A){if(A!=null){HD.util.Analytics.track(this.analyticsString(A));
A.facade.setListener(this.getParent(),this)
}},update:function(A,B){if(A=="getMedium_Start"){this.loading(true)
}else{if(A=="getMedium_Finish"){this.loading(false)
}else{if(A=="activeItem_Change"){this.loading(false);
this.render(B)
}}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{data:A})
},analyticsString:function(A){return"default_analyticsDetailString"
}};
HD.extend(HD.DetailWidget,[HD.Widget]);
HD.register("hd_detail_widget","HD.DetailWidget",{version:"1.0",build:"1"});HD.FeatureStoriesWidget=function(A){this.config=A||{};
this.config.pageSize=this.config.pageSize||3;
this.config.previewLength=this.config.previewLength||140;
this.config.contentFeed=this.config.contentFeed||"getPopular";
this.config.randomize=this.config.randomize||false;
this.config.mediaHooks=this.config.mediaHooks||HD.community.Media.hooks;
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.FeatureStoriesWidget.templates={featureStoriesLabel:"Feature Stories",viewStoryText:"View Story",viewAllStoriesText:"View All Stories",watchVideoText:"Watch Video",getFeatureStoriesLabel:function(){return this.featureStoriesLabel
},getViewStoryText:function(){return this.viewStoryText
},getViewAllStoriesText:function(){return this.viewAllStoriesText
},getWatchVideoText:function(){return this.watchVideoText
},getHtml:function(){return this.html
},html:'		<div class="${classes.FEATURE_STORIES} ${classes.WIDGET}">			<span class="${classes.TITLE}">${templates.getFeatureStoriesLabel()}</span>			<ul class="${classes.LIST}">				{for item in items}					<li class="${hooks.STORY}">${item|facade}						{if community.isVideo(item.contentType)}							<span class="${classes.VIDEO}"><a href="#featAnchor${item_index}" name="featAnchor${item_index}" class="${classes.VIEW} ${classes.CONTROL}">${templates.getWatchVideoText()}</a></span>						{else}							<span class="${classes.PHOTO}"><a href="#featAnchor${item_index}" name="featAnchor${item_index}" class="${classes.VIEW} ${classes.CONTROL}">${templates.getViewStoryText()}</a></span>						{/if}					</li>				{/for}			</ul>			<a href="#featAnchorAll" name="featAnchorAll" class="${classes.VIEW_ALL} ${classes.CONTROL} ${hooks.VIEW_ALL}">${templates.getViewAllStoriesText()}</a>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.FeatureStoriesWidget.hooks={STORY:A.FEATURE_STORIES+"-story",VIEW_ALL:A.FEATURE_STORIES+"-viewall"}
})();
HD.FeatureStoriesWidget.prototype={update:function(A,B){if(A==this.config.contentFeed+"_Start"){this.loading(true)
}else{if(A==this.config.contentFeed+"_Finish"){this.loading(false);
if(this.config.randomize){B.media.sort(function(){return 0.5-Math.random()
})
}this.render(B)
}}},setListeners:function(G){var B=HD.CSS_CLASSES;
var H=this.getParent();
var A=G.media;
var I=HD.getByClass(this.config.hooks.STORY,"*",H);
var D=HD.getByClass(this.config.hooks.VIEW_ALL,"*",H);
var J=this;
var E=0;
for(var F=0,C=Math.min(A.length,this.config.pageSize||3);
F<C;
F++){(function(){var O=A[F];
var Q=function(){J.notifyObservers("viewFeatureStory",O);
return false
};
if(I[F]){I[F].onclick=Q;
var S=HD.getByClass(J.config.mediaHooks.MEDIA_RATING_AVG,"*",I[F])[0]||null;
var T=S&&(HD.getByClass(J.config.mediaHooks.MEDIA_RATING_STAR,"*",S)[0]||null);
var K=S&&(HD.getByClass(J.config.mediaHooks.MEDIA_VOTES,"*",S)[0]||null);
if(T&&K){var R=new HD.util.StarRating({starRatingParent:T,numOfVotesParent:K,numOfVotes:O.numberOfVotes,averageRating:O.rating,isStatic:true,itemId:O.mediaId,numOfDecimals:1,requiresLogin:false})
}}if(!!O.category&&I[F]){var N=HD.getByClass(J.config.mediaHooks.MEDIA_CATEGORY,"*",I[F]);
if(N[0]){N[0].onclick=function(U){J.notifyObservers("viewCategory",O.category);
if(!U){var U=window.event
}U.cancelBubble=true;
if(U.stopPropagation){U.stopPropagation()
}}
}}if(O.tags&&O.tags.length>0&&I[F]){var P=HD.getByClass(J.config.mediaHooks.MEDIA_TAG,"*",I[F]);
for(var L=0,M=P.length;
L<M;
L++){(function(){var U=O.tags[L];
P[L].onclick=function(V){J.notifyObservers("viewTag",U);
if(!V){var V=window.event
}V.cancelBubble=true;
if(V.stopPropagation){V.stopPropagation()
}}
})()
}}})();
E+=2
}if(D[0]){D[0].onclick=function(){J.notifyObservers("viewAllFeatureStories",A);
return false
}
}},getHtml:function(B){var C=(B&&B.media&&B.media.slice(0,Math.min(B.media.length,this.config.pageSize||3)))||[];
for(var A=0;
A<C.length;
A++){C[A].description=HD.util.Common.ellipseText(C[A].description,this.config.previewLength)
}return this.processTemplate(this.config.templates.getHtml(),{ratingClasses:HD.util.StarRating.CSS_CLASSES,items:C,community:HD.community})
}};
HD.extend(HD.FeatureStoriesWidget,[HD.Widget]);
HD.register("hd_feature_stories_widget","HD.FeatureStoriesWidget",{version:"1.0",build:"1"});HD.GalleryWidget=function(A){this.config=A||{};
this.config.titleLength=this.config.titleLength||0;
this.config.viewAllMax=this.config.viewAllMax||50;
this.config.embedShare=this.config.embedShare||false;
this.config.shareConfig=this.config.shareConfig||{};
this.config.embedSendFriend=this.config.embedSendFriend||false;
this.config.sendFriendConfig=this.config.sendFriendConfig||{};
this.config.showMatrix=this.config.showMatrix||false;
this.config.showPageSizeSwitch=this.config.showPageSizeSwitch||false;
this.observers=[];
this.loadTemplates(arguments.callee);
this.config.sorts=this.config.sorts||[{name:this.config.templates.getSortNewToOldText(),value:HD.SORTS.NEW_TO_OLD,isDefault:false},{name:this.config.templates.getSortOldToNewText(),value:HD.SORTS.OLD_TO_NEW,isDefault:true}]
};
HD.GalleryWidget.templates={sortByLabel:"Sort By",sortNewToOldText:"Newest To Oldest",sortOldToNewText:"Oldest To Newest",getSortByLabel:function(){return this.sortByLabel
},getSortNewToOldText:function(){return this.sortNewToOldText
},getSortOldToNewText:function(){return this.sortOldToNewText
},getHtml:function(){return this.html
},html:'		<div class="${classes.GALLERY} ${classes.WIDGET}">		{if community.isBoth(contentType) || community.isPhoto(contentType) || community.isVideo(contentType) || config.showMatrix}			<div class="${classes.CONTROL_PANEL}">				<span class="${classes.SORT}">					<span>${templates.getSortByLabel()}</span>					<select class="${hooks.SORTING}">						{for sort in config.sorts}							{if selectedSort == sort.value || sort.isDefault}								<option value="${sort.value}" selected>${sort.name}</option>							{else}								<option value="${sort.value}">${sort.name}</option>							{/if}						{/for}					</select>				</span>				<span class="${hooks.PAGING}"></span>			</div>			<div class="${classes.CONTENT_PANEL}">				<table>					<tr class="{if rows == 1}${classes.LAST}{else}${classes.FIRST}{/if}">					{var rows = Math.ceil(items.length / config.itemsX)}					{for item in items}						{if item_index > 0 && item_index % config.itemsX == 0}							{if rows == (Math.ceil(item_index / config.itemsX) + 1)}								</tr><tr class="${classes.LAST}">							{else}								</tr><tr>							{/if}						{/if}						<td>${item|facade}</td>					{/for}					</tr>				</table>			</div>			<div class="${classes.CONTROL_PANEL}">				<span class="${hooks.PAGING}"></span>			</div>		{elseif community.isBlog(contentType)}			<div class="${classes.CONTROL_PANEL}">				<span class="${classes.PAGING}"></span>			</div>			<div class="${classes.CONTENT_PANEL}">				{for blog in items}					${blog|facade}				{/for}			</div>			<div class="${classes.CONTROL_PANEL} ${classes.LAST}">				<span class="${classes.PAGING}"></span>			</div>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.GalleryWidget.hooks={PAGING:A.PAGING,SORTING:A.SORT+"-list"}
})();
HD.GalleryWidget.prototype={update:function(A,C){if(A=="getMedia_Start"){this.loading(true)
}else{if(A=="getMedia_Finish"){this.loading(false);
if(this.mediaCache){for(var B=0;
B<this.mediaCache.length;
B++){this.mediaCache[B].facade.destroy()
}}this.mediaCache=C.media;
this.render(C);
if(this.paging!=null){this.paging.controller.updatePagingData(C)
}}}},setListeners:function(A){if(HD.community.isBoth(A.contentType)||HD.community.isPhoto(A.contentType)||HD.community.isVideo(A.contentType)||this.config.showMatrix){return this.setBothListeners(A)
}else{if(HD.community.isBlog(A.contentType)){return this.setBlogListeners(A)
}}},setBothListeners:function(I){var E=HD.CSS_CLASSES;
var F=this.config.viewAllMax;
var O=this.config.itemsX*this.config.itemsY;
var G=this.config.showPageSizeSwitch;
var J=this.getParent();
if(I.media.length>0){var M=HD.getByClass(I.media[0].facade.config.hooks.MEDIA_ITEM,"*",J);
var N=I.media;
for(var H=0,L=N.length;
H<L;
H++){if(N[H]&&M[H]){N[H].facade.setListener(M[H],this,this.config)
}}}var C=HD.getByClass(this.config.hooks.PAGING,"*",J);
if(C.length>0){var B=new HD.util.Paging({startingPage:1,containers:C,viewAllMax:F,defaultPageSize:O,showPageSizeSwitch:G,templates:this.config.pagingTemplates||{},hooks:this.config.pagingHooks||{}});
var D=this;
var A=this.model;
var K={update:function(P,Q){if(P=="paging_Next"){A.getNextPage.call(A)
}else{if(P=="paging_Previous"){A.getPreviousPage.call(A)
}else{if(P=="paging_Page"){A.getMedia.call(A,Q)
}else{if(P=="show_All"||P=="show_Max"){A.config.pageSize=F;
A.getSamePage.call(A)
}else{if(P=="show_Default"){A.config.pageSize=O;
A.getSamePage.call(A)
}}}}}}};
B.view.addObserver(K);
this.paging=B
}HD.getByClass(this.config.hooks.SORTING,"*",J,function(P){P.onchange=function(){var Q=P.options[P.selectedIndex].value;
A.setSort.call(A,Q)
}
})
},setBlogListeners:function(H){var G=HD.CSS_CLASSES;
var K=this.getParent();
var D=H.media;
var E=this.config;
var J=this.model;
var N=HD.getByClass(G.ITEM,"div",K);
for(var I=0,M=N.length;
I<M;
I++){var O=D[I];
if(O!=null){O.facade.setListener(N[I],this,E)
}}var C=HD.getByClass(this.config.hooks.PAGING,"*",K);
if(C.length>0){var B=new HD.util.Paging({startingPage:1,containers:C,templates:this.config.pagingTemplates||{},hooks:this.config.pagingHooks||{}});
var F=this;
var A=this.model;
var L={update:function(P,Q){if(P=="paging_Next"){A.getNextPage.call(A)
}else{if(P=="paging_Previous"){A.getPreviousPage.call(A)
}else{if(P=="paging_Page"){A.getMedia.call(A,Q)
}}}}};
B.view.addObserver(L);
this.paging=B
}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:(A&&A.media)||[],contentType:A.contentType||"",selectedSort:this.model.getSort()||"",sorts:HD.SORTS,community:HD.community})
}};
HD.extend(HD.GalleryWidget,[HD.Widget]);
HD.register("hd_gallery_widget","HD.GalleryWidget",{version:"1.0",build:"1"});HD.MiniGalleryWidget=function(A){this.config=A;
this.observers=[];
this.loadTemplates(arguments.callee);
this.initialPageIndex=0
};
HD.MiniGalleryWidget.templates={getHtml:function(){return this.html
},html:'		<div class="${classes.MINI_GALLERY} ${classes.WIDGET}">	   		<div class="${classes.WRAPPER}">			{if hasPrevious}				<div class="${hooks.PAGING_ARROW} ${hooks.PREVIOUS}">&nbsp;</div>    		{/if}			</div>			{for item in items}				${item|facade}			{/for}	   		<div class="${classes.WRAPPER}">			{if hasNext}				<div class="${hooks.PAGING_ARROW} ${hooks.NEXT}">&nbsp;</div>    		{/if}			</div>    	</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.MiniGalleryWidget.hooks={NEXT:A.NEXT,PREVIOUS:A.PREVIOUS,PAGING_ARROW:A.PAGING_ARROW}
})();
HD.MiniGalleryWidget.prototype={update:function(A,C){if(A=="getMedia_Start"){this.loading(true)
}else{if(A=="getMedia_Finish"){this.loading(false);
if(this.mediaCache){for(var B=0;
B<this.mediaCache.length;
B++){this.mediaCache[B].facade.destroy()
}}this.mediaCache=C.media;
this.separateItems(C);
if(!!this.queueSetActive){this.setActive(this.queueSetActive)
}this.render(C)
}else{if(A=="activeItem_Change"){this.setActive(C)
}}}},getHtml:function(){if(this.model.isLastIndexActive){this.activePage=Math.floor(this.model.config.pageSize/this.config.numOfItems)-1;
this.model.isLastIndexActive=false
}this.hasPreviousMiniPage=this.activePage>this.initialPageIndex;
this.hasPreviousPage=this.model.hasPreviousPage();
this.hasNextMiniPage=this.activePage<this.pages.length-1;
this.hasNextPage=this.model.hasNextPage();
return this.processTemplate(this.config.templates.getHtml(),{hasPrevious:this.hasPreviousMiniPage||this.hasPreviousPage,hasNext:this.hasNextMiniPage||this.hasNextPage,items:this.pages[this.activePage]})
},setActive:function(M){if(!this.pages){this.queueSetActive=M;
return 
}var B=HD.CSS_CLASSES;
var G=this.getParent();
var K=this.activePage;
var A=this.pages;
for(var F=0,H=A.length;
F<H;
F++){var C=A[F];
for(var E=0,D=C.length;
E<D;
E++){var J=C[E];
if(J!=null&&J.mediaId==M.mediaId){this.activePage=F;
break
}}}if(K!=this.activePage){this.render()
}var C=this.pages[this.activePage];
var I=HD.getByClass(B.ITEM,"div",G);
for(var F=0,H=C.length;
F<H;
F++){var J=C[F];
var L=I[F];
if(J!=null&&J.mediaId==M.mediaId){HD.addClass(L,B.ACTIVE)
}else{HD.removeClass(L,B.ACTIVE)
}}},separateItems:function(D){this.pages=[];
this.activePage=this.initialPageIndex;
var B=this.config.numOfItems;
var F=0;
this.pages[F]=[];
var C=D.media;
for(var E=0,A=C.length;
E<A;
E++){if(E>0&&E%B==0){F++;
this.pages[F]=[]
}this.pages[F].push(C[E])
}},setListeners:function(F){var M=this.config.hooks;
var I=this.getParent();
var B=HD.getByClass(M.PAGING_ARROW,"*",I);
var H=null;
var C=null;
for(var G=0,J=B.length;
G<J;
G++){var L=B[G];
if(HD.hasClass(L,M.NEXT)){C=L
}else{if(HD.hasClass(L,M.PREVIOUS)){H=L
}}}var D=this;
var A=this.model;
if(H!=null){H.onclick=function(){if(D.hasPreviousMiniPage){D.activePage--;
D.render.call(D)
}else{if(D.hasPreviousPage){A.getPreviousPage(true,true);
A.isLastIndexActive=true
}}}
}if(C!=null){C.onclick=function(){if(D.hasNextMiniPage){D.activePage++;
D.render.call(D)
}else{if(D.hasNextPage){A.getNextPage(true)
}}}
}var E=this.pages[this.activePage];
if(E.length>0){var K=HD.getByClass(E[0].facade.config.hooks.MEDIA_ITEM,"*",I);
for(var G=0,J=E.length;
G<J;
G++){if(K[G]&&E[G]){this.setItemListener(K[G],E[G])
}}}},setItemListener:function(C,D){var A=this;
var B=D;
C.onclick=function(){A.view.notifyObservers.call(A.view,"itemChange_Start",B);
A.model.setActiveItem.call(A.model,B);
A.model.activeItemPage=A.model.pageNumber
}
}};
HD.extend(HD.MiniGalleryWidget,[HD.Widget]);
HD.register("hd_mini_gallery_widget","HD.MiniGalleryWidget",{version:"1.0",build:"1"});HD.MostPopularWidget=function(A){this.config=A;
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.MostPopularWidget.templates={getHtml:function(){return this.html
},html:'		<div class="${classes.MOST_POPULAR} ${classes.WIDGET}">		{for item in items}			<div class="${classes.TITLE} ${classes.CONTROL} ${hooks.ITEM}">${item.title}</div>		{/for}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.MostPopularWidget.hooks={ITEM:A.ITEM}
})();
HD.MostPopularWidget.prototype={setListeners:function(F){var D=HD.CSS_CLASSES;
var E=this.getParent();
var G=F.media;
var B=HD.getByClass(this.config.hooks.ITEM,"*",E);
for(var C=0,A=G.length;
C<A;
C++){if(B[C]){this.setListener(B[C],G[C])
}}},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
C.onclick=function(){A.model.setActiveItem.call(A.model,B);
A.notifyObservers.call(A,"itemSelected",B)
}
},update:function(A,B){if(A=="getPopular_Start"){this.loading(true)
}else{if(A=="getPopular_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:(A&&A.media)||[]})
}};
HD.extend(HD.MostPopularWidget,[HD.Widget]);
HD.register("hd_most_popular_widget","HD.MostPopularWidget",{version:"1.0",build:"1"});HD.MonthlyWidget=function(A){this.config=A;
this.config.renderMode=this.config.renderMode||"list"||"select";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.MonthlyWidget.templates={defaultSelectLabel:"By date",getDefaultSelectLabel:function(){return this.defaultSelectLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.MONTHLY_BREAKDOWN} ${classes.WIDGET}">		{if config.renderMode == "list"}			{for item in items}				{if item && item.itemCount > 0}					<div>						<span class="${classes.TITLE} ${classes.CONTROL} ${hooks.ITEM}">${item.startDate|date}</span>						<span class="${classes.VALUE}"> (${item.itemCount})</span>					</div>				{/if}			{/for}		{elseif config.renderMode == "select"}			<select class="${hooks.LIST}">			<option class="${hooks.ITEM}" value="" selected="selected">${templates.getDefaultSelectLabel()}</option>			{for item in items}				{if item && item.itemCount > 0}					<option class="${hooks.ITEM}" value="${item_index}">${item.startDate|date}</option>				{/if}			{/for}			</select>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.MonthlyWidget.hooks={ITEM:A.ITEM,LIST:A.LIST}
})();
HD.MonthlyWidget.prototype={setListeners:function(C){var E=this.getParent();
var A=C.media;
if(this.config.renderMode=="list"){var F=HD.getByClass(this.config.hooks.ITEM,"*",E);
var H=0;
for(var D=0,G=A.length;
D<G;
D++){var I=A[D];
if(I!=null&&I.itemCount>0){if(F[H]){this.setListener(F[H],A[D])
}H++
}}}else{if(this.config.renderMode=="select"){var B=this;
HD.getByClass(this.config.hooks.LIST,"*",E,function(J){J.onchange=function(){var K=J.options[J.selectedIndex].value;
if(K!=""&&K>=0){var L=A[K];
var M={startDate:L.startDate,endDate:L.endDate};
B.model.setDateRange.call(B.model,M)
}}
})
}}},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
if(D.itemCount>0){C.onclick=function(){var E={startDate:B.startDate,endDate:B.endDate};
A.model.setDateRange.call(A.model,E)
}
}},update:function(A,B){if(A=="getMonthly_Finish"){this.loading(false);
this.render(B)
}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:(A&&A.media)||[]})
}};
HD.extend(HD.MonthlyWidget,[HD.Widget]);
HD.register("hd_monthly_widget","HD.MonthlyWidget",{version:"1.0",build:"1"});HD.CommentsWidget=function(A){this.config=A||{};
this.config.requiresLogin=this.config.requiresLogin||false;
this.config.submitAbove=this.config.submitAbove||false;
this.config.submitBelow=this.config.submitBelow||false;
this.config.confirmation=this.config.confirmation||false;
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.CommentsWidget.templates={titleLabel:"Comments",postCommentLabel:"Post a Comment",commentFieldLabel:"Comment:",submitLabel:"Submit",loadingText:"Loading comments...",noCommentsText:"This item has no comments, be the first to leave your mark.",confirmationLabel:"Thank You",confirmationValue:"Thank you for your submission. After a quick review, your content will be posted to the website within one or two business days. Content deemed to be off topic, offensive or promoting dangerous riding cannot be posted.",submitAnotherText:"Post another comment",termsConditionsShortPreText:"By submitting my comment I agree to the following",termsConditionsShortHandleText:"Terms and Conditions.",termsConditionsShortPostText:"",termsConditionsText:"By submitting this content, I consent that all videos, photographs, my name, my story and any other reproductions of my information and likeness (the &ldquo;Materials&rdquo;) may be used by Harley-Davidson, Its affiliates (collectively referred to as &ldquo;Harley-Davidson&rdquo;) and/or others with its consent, for the purpose of illustration, advertising, promotions, duplication or publication or for any other purpose in any manner and in any media without further consideration. I represent and warrant that I am the owner of the Materials and have the rights to dispose of my ownership rights as I see fit. I hereby assign to Harley-Davidson all rights, title and interest in the Material and any other tangible medium of expression of my image and information including all copyrights therein that I provide to Harley-Davidson.",getTitleLabel:function(){return this.titleLabel
},getPostCommentLabel:function(){return this.postCommentLabel
},getCommentFieldLabel:function(){return this.commentFieldLabel
},getSubmitLabel:function(){return this.submitLabel
},getLoadingText:function(){return this.loadingText
},getNoCommentsText:function(){return this.noCommentsText
},getConfirmationLabel:function(){return this.confirmationLabel
},getConfirmationValue:function(){return this.confirmationValue
},getSubmitAnotherText:function(){return this.submitAnotherText
},getTermsConditionsShortPreText:function(){return this.termsConditionsShortPreText
},getTermsConditionsShortHandleText:function(){return this.termsConditionsShortHandleText
},getTermsConditionsShortPostText:function(){return this.termsConditionsShortPostText
},getTermsConditionsText:function(){return this.termsConditionsText
},getErrorsHtml:function(){return this.errorsHtml
},getHtml:function(){return this.html
},errorsHtml:'		{if errors}			{for error in errors}				<div class="${classes.ERROR}">${error.errorMessage}</div>			{/for}		{/if}',html:'		{if comments}			{macro commentsForm()}				<li><form class="${hooks.FORM}">					<div class="${classes.TITLE}">${templates.getPostCommentLabel()}</div>					<div class="${classes.WRAPPER} ${hooks.ERROR}"></div>					<div class="${classes.LABEL}">${templates.getCommentFieldLabel()}</div>					<textarea cols="30" rows="5" class="${classes.VALUE} ${hooks.TEXTAREA}"></textarea><br/>					<div class="${classes.AGREEMENT}">						<div class="${classes.LABEL} ${hooks.LEGAL_SM}">							${templates.getTermsConditionsShortPreText()} <span class="${classes.HANDLE} ${classes.CONTROL}  ${hooks.TERMS_BUTTON}">${templates.getTermsConditionsShortHandleText()}</span> ${templates.getTermsConditionsShortPostText()}						</div>						<div class="${classes.VALUE} ${classes.HIDDEN} ${hooks.LEGAL_FULL}">							<div style="margin-top:10px;">${templates.getTermsConditionsText()}</div>						</div>					</div>					<input type="Submit" value="${templates.getSubmitLabel()}"/>				</form></li>				<li class="${classes.HIDDEN}">					<div class="${classes.CONFIRMATION} ${hooks.CONFIRMATION}">						<div class="${classes.LABEL}">${templates.getConfirmationLabel()}</div>						<div class="${classes.VALUE}">${templates.getConfirmationValue()}</div>						<div class="hdSubmitComment hdSubmitAnotherComment ${hooks.SUBMIT_ANOTHER_COMMENT}">${templates.getSubmitAnotherText()}</div>					</div>				</li>			{/macro}			<div class="${classes.COMMENTS} ${classes.WIDGET}">				<ul>				{if config.submitAbove}					${commentsForm()}				{/if}				{if comments.length > 0}					<li class="${classes.TITLE}">${templates.getTitleLabel()}</li>					{for comment in comments}						<li class="${classes.COMMENT}">							<div>								<span class="${classes.DATE}">${comment.createdDate|date}</span> 								<span class="${classes.AUTHOR}">${comment.submittedBy}</span>							</div>							<div class="${classes.VALUE}">${comment.text}</div>						</li>					{/for}				{else}					<li class="${classes.EMPTY}">${templates.getNoCommentsText()}</li>				{/if}				</ul>			</div>			{if config.submitBelow}				${commentsForm()}			{/if}		{else}			${templates.getLoadingText()}		{/if}'};
(function(){var A=HD.CSS_CLASSES;
HD.CommentsWidget.hooks={FORM:A.COMMENTS+"-form",TEXTAREA:A.COMMENTS+"-textarea",LEGAL_SM:A.COMMENTS+"-legal-sm",LEGAL_FULL:A.COMMENTS+"-legal-full",TERMS_BUTTON:A.COMMENTS+"-terms-btn",SUBMIT_ANOTHER_COMMENT:A.COMMENTS+"-submit-comment",COMMENT_SUBMITTED:A.COMMENTS+"-"+A.LOADING,ERROR:A.COMMENTS+"-error",CONFIRMATION:A.COMMENTS+"-confirmation"}
})();
HD.CommentsWidget.prototype={setListeners:function(E){if(E==null){return 
}var B=HD.CSS_CLASSES;
var G=this.getParent();
var K=HD.getByClass(this.config.hooks.FORM,"*",G)[0];
var H=HD.getByClass(this.config.hooks.TEXTAREA,"*",G)[0];
if(K&&H){HD.removeClass(K,B.ERROR);
var A=this.model;
var I=E;
var C=this;
K.onsubmit=function(){var N=HD.util.Common.stripHtmlTags(H.value);
var M=function(){A.submitComment.call(A,I.mediaId,I.contentType,N)
};
if(C.config.requiresLogin){login.model.isUserLoggedIn(function(P){if(P.loggedInLevel>1){M()
}else{var O={update:function(Q,R){if(Q=="logged_In"){M();
login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}else{if(Q=="overlayClose_Click"){login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}}}};
HD.util.Common.getObservable().addObserver(O);
login.model.addObserver(O);
if(P.loggedInLevel>0){login.view.promptCreateScreenName()
}else{login.view.promptAuthentication()
}}})
}else{M()
}return false
};
var J=HD.getByClass(this.config.hooks.LEGAL_SM,"*",G)[0];
var D=HD.getByClass(this.config.hooks.LEGAL_FULL,"*",G)[0];
var L=HD.getByClass(this.config.hooks.TERMS_BUTTON,"*",G)[0];
if(L&&D){L.onclick=function(){if(HD.hasClass(D,B.HIDDEN)){HD.removeClass(D,B.HIDDEN)
}else{HD.addClass(D,B.HIDDEN)
}}
}}var C=this;
var F=HD.getByClass(this.config.hooks.SUBMIT_ANOTHER_COMMENT,"*",G)[0];
if(F!=null){F.onclick=function(){C.hideConfirmation.call(C)
}
}},setAuthorListener:function(B,C){if(B==null||C==null){return 
}var A=this;
B.onclick=function(){A.notifyObservers.call(A,"authorSelected",C);
A.model.getMemberProfile.call(A.model,C)
}
},update:function(A,D){var B=HD.CSS_CLASSES;
var C=this.getParent();
var E=HD.getByClass(this.config.hooks.TEXTAREA,"*",C)[0];
if(A=="getComments_Start"){this.loading(true);
this.render(D)
}else{if(A=="getComments_Finish"){this.loading(false);
this.render(D)
}else{if(A=="submitComment_Start"){if(E){HD.addClass(E,this.config.hooks.COMMENT_SUBMITTED)
}}else{if(A=="submitComment_Finish"){this.loading(false);
if(E){HD.removeClass(E,this.config.hooks.COMMENT_SUBMITTED)
}if(this.config.confirmation){this.showConfirmation(D)
}else{this.render(D)
}}else{if(A=="submitComment_Error"){this.loading(false);
if(E){HD.removeClass(E,this.config.hooks.COMMENT_SUBMITTED)
}this.renderError(D)
}}}}}},showConfirmation:function(){var B=HD.CSS_CLASSES;
var D=this.getParent();
var A=HD.getByClass(this.config.hooks.FORM,"*",D)[0];
var C=HD.getByClass(this.config.hooks.TEXTAREA,"*",D)[0];
var E=HD.getByClass(this.config.hooks.ERROR,"*",D)[0];
var F=HD.getByClass(this.config.hooks.CONFIRMATION,"*",D)[0];
if(C){C.value=""
}if(A){HD.addClass(A.parentNode,B.HIDDEN);
HD.removeClass(A,B.ERROR)
}if(E){E.innerHTML=""
}if(F){HD.removeClass(F.parentNode,B.HIDDEN)
}},hideConfirmation:function(){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.FORM,"*",C)[0];
var D=HD.getByClass(this.config.hooks.CONFIRMATION,"*",C)[0];
if(D){HD.addClass(D.parentNode,B.HIDDEN)
}if(A){HD.removeClass(A.parentNode,B.HIDDEN)
}},renderError:function(E){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.FORM,"*",C)[0];
var D=HD.getByClass(this.config.hooks.ERROR,"*",C)[0];
if(A){HD.addClass(A,B.ERROR)
}if(D){D.innerHTML=this.getErrorsHtml(E)
}},getErrorsHtml:function(A){return this.processTemplate(this.config.templates.getErrorsHtml(),{errors:A})
},getHtml:function(B){var A=this;
return this.processTemplate(this.config.templates.getHtml(),{comments:(B&&B.comments)||null})
}};
HD.extend(HD.CommentsWidget,[HD.Widget]);
HD.register("hd_comments_widget","HD.CommentsWidget",{version:"1.0",build:"1"});HD.MemberWidget=function(A){this.config=A;
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.MemberWidget.templates={noProfileText:"This user does not have a public profile.",getNoProfileText:function(){return this.noProfileText
},getHtml:function(){return this.html
},html:'		<div class="${classes.MEMBER} ${classes.WIDGET}">		{if profile}			<div class="dblRuleBtm"><span class="head">${config.title}</span></div>			<div class="${classes.THUMB}" {if profile.pathToProfilePhoto}style="background: transparent url(${profile.pathToProfilePhoto}) no-repeat 50% 50%;"{/if}></div>			<div class="${classes.DESCRIPTION}">				<div class="${classes.TITLE}">${profile.firstName} ${profile.lastName}</div>				<div class="${classes.VALUE}">${profile.aboutMe}</div>			</div>		{else}			${templates.getNoProfileText()}		{/if}		</div>'};
HD.MemberWidget.prototype={update:function(A,B){if(A=="getMember_Start"){this.loading(true)
}else{if(A=="getMember_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{profile:A})
}};
HD.extend(HD.MemberWidget,[HD.Widget]);
HD.register("hd_member_widget","HD.MemberWidget",{version:"1.0",build:"1"});HD.ShareWidget=function(A){var C=HD.ShareWidget.SERVICES;
this.config=A||{};
this.config.embedMode=this.config.embedMode||false;
this.config.standaloneMode=this.config.standaloneMode||false;
this.config.previewLength=this.config.previewLength||0;
this.config.services=this.config.services||[C.DIGG,C.FACEBOOK,C.TWITTER];
this.config.getPermalink=this.config.getPermalink||function(F,D,E){return F.facade.generatePermalink()
};
this.config.useShareAPI=this.config.useShareAPI==null?true:this.config.useShareAPI;
this.config.callback=this.config.callback||function(D,F,H,E,I,G){};
for(var B=this.config.services.length-1;
B>=0;
B--){if(typeof this.config.services[B]=="string"){this.config.services[B]=this.getService(this.config.services[B]);
if(!this.config.services[B]){this.config.services[B].splice(B,1)
}}}this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.ShareWidget.SERVICES={BLOGGER:{name:"Blogger",url:null,callback:null},DELICIOUS:{name:"Delicious",url:null,callback:null},DIGG:{name:"Digg",url:null,callback:null},FACEBOOK:{name:"Facebook",url:null,callback:null},FRIENDFEED:{name:"Friendfeed",url:null,callback:null},GOOGLE:{name:"Google",url:null,callback:null},LINKEDIN:{name:"Linked In",url:null,callback:null},MAGNOLIA:{name:"Magnolia",url:null,callback:null},MIXX:{name:"Mixx",url:null,callback:null},MYSPACE:{name:"MySpace",url:null,callback:null},NEWSVINE:{name:"NewsVine",url:null,callback:null},REDDIT:{name:"Reddit",url:null,callback:null},SLASHDOT:{name:"Slashdot",url:null,callback:null},STUMBLEUPON:{name:"Stumble Upon",url:null,callback:null},TECHNORATI:{name:"Technorati",url:null,callback:null},TWITTER:{name:"Twitter",url:null,callback:null},WORDPRESS:{name:"Wordpress",url:null,callback:null}};
HD.ShareWidget.templates={shareLabel:"Share: ",getShareLabel:function(){return this.shareLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.SHARE} ${classes.WIDGET}">			<span>${templates.getShareLabel()}</span>			<ul>			{for service in config.services}				<li class="${service|getClass} ${hooks.ITEMSHARE}">					<a class="${hooks.ITEMLINK}" 						{if _MODIFIERS.getUrl(service,media)}							href="${service|getUrl:media}" target="_blank"						{else}							href="javascript:void(0)"						{/if}					></a>					<div><span>${service.name}</span></div></li>			{/for}			</ul>		</div>		<div class="${classes.SHARE}Clear"></div>'};
(function(){var A=HD.CSS_CLASSES;
HD.ShareWidget.hooks={ITEMSHARE:A.SHARE+"-item",ITEMLINK:A.SHARE+"-link"}
})();
HD.ShareWidget.prototype={setListeners:function(D){if(!D){return 
}var A=this;
var B=HD.getByClass(this.config.hooks.ITEMLINK,"*",this.getParent());
var E=HD.getByClass(this.config.hooks.ITEMSHARE,"*",this.getParent());
for(var C=0;
C<this.config.services.length;
C++){if(E[C]){E[C].onmouseover=function(){HD.addClass(this,HD.CSS_CLASSES.SHARE+"Hover")
};
E[C].onmouseout=function(){HD.removeClass(this,HD.CSS_CLASSES.SHARE+"Hover")
}
}(function(){var F=A.config.services[C];
if(B[C]){B[C].onclick=function(){A.notifyObservers("share",{service:F,media:D});
if(F.callback){F.callback(D)
}if(A.config.callback){var G=HD.util.Common.stripHtmlTags(D.description);
if(A.config.useShareAPI&&window.HDSocial){HDSocial.hdSocialShare(A.getServiceHash(F),A.config.getPermalink(D,F,A.config),D.title,HD.util.Common.ellipseText(G,A.config.previewLength||G.length),D.thumbUrl,null,null,D)
}A.config.callback(F,A.config.getPermalink(D,F,A.config),D.title,HD.util.Common.ellipseText(G,A.config.previewLength||G.length),D.thumbUrl,D)
}}
}})()
}},update:function(A,B){if(this.config.standaloneMode){if(A=="loadShare_Start"){this.render(B)
}}else{if(!this.config.embedMode){if(A=="getMedium_Start"){this.loading(true)
}else{if(A=="getMedium_Finish"){this.loading(false);
this.render(B)
}else{if(A=="activeItem_Change"){this.render(B)
}}}}}},getHtml:function(B){if(!B){return 
}var A=this;
return this.processTemplate(this.config.templates.getHtml(),{media:B,_MODIFIERS:{getClass:function(C){return A.getClass(C)
},getUrl:function(C,D){return A.getUrl(C,D)
}}})
},getServiceHash:function(A){return A.name.replace(/\s+/g,"").toLowerCase()||null
},getService:function(A){return HD.ShareWidget.SERVICES[A.replace(/\s+/g,"").toUpperCase()]||null
},getClass:function(A){return HD.CSS_CLASSES.SHARE+A.name.replace(/\s+/g,"")
},getUrl:function(A,C){if(A.url){var B=A.url;
B=B.replace(/\{permalink\}/,encodeURIComponent(this.config.getPermalink(C)));
B=B.replace(/\{title\}/,encodeURIComponent(C.title));
B=B.replace(/\{thumbnail\}/,encodeURIComponent(C.thumbUrl));
B=B.replace(/\{description\}/,encodeURIComponent(HD.util.Common.ellipseText(C.description,this.config.previewLength||C.description.length)));
return B
}else{return null
}}};
HD.extend(HD.ShareWidget,[HD.Widget]);
HD.register("hd_share_widget","HD.ShareWidget",{version:"1.0",build:"1"});HD.SendFriendWidget=function(A){this.config=A||{};
this.config.embedMode=this.config.embedMode||false;
this.config.standaloneMode=this.config.standaloneMode||false;
this.config.showTooltip=this.config.showTooltip||false;
this.config.sendAnother=this.config.sendAnother||false;
this.config.callback=this.config.callback||function(C,B){};
this.config.submission=this.config.submission||{};
this.config.submission.url=this.config.submission.url||"http://hdonline.rsys1.net/servlet/campaignrespondent";
this.config.submission.id=this.config.submission.id||"hdm.526";
this.config.submission.community=this.config.submission.community||window.comSiteName||"Harley-Davidson";
this.config.submission.media=null;
this.config.overlayHeight=this.config.overlayHeight||"290px";
this.config.overlayWidth=this.config.overlayWidth||"425px";
this.config.getParams=this.config.getParams||function(C,B){C.view="detail";
return C
};
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.SendFriendWidget.templates={sendFriendLabel:"Send to a Friend",errorUserNameText:"Your Name is a required field (*)",errorFriendNameText:"Your Friend's Name is a required field (*)",errorFriendEmailText:"Your Friend's Email is a required field (*)",errorFriendEmailInvalidText:"Your Friend's Email address is not valid",errorYourEmailText:"Your Email is a required field (*)",errorYourEmailInvalidText:"Your Email address is not valid",sendFriendInstructionalText:"<p>Send your friend a link to this page so they can become involved in the community.</p><p>Enter the name and Email address of your friend below. We will not use this information for any other purposes. Review our <a onclick=\"javascript:window.open('http://www.harley-davidson.com/wcm/Content/Pages/Utility/privacy_policy.jsp?locale=en_US', '', 'width=598,height=540,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no')\" href=\"javascript:void(0)\">Privacy Policy</a> for more details.</p><p>* Indicates required fields</p>",getSendFriendLabel:function(){return this.sendFriendLabel
},getErrorUserNameText:function(){return this.errorUserNameText
},getErrorFriendNameText:function(){return this.errorFriendNameText
},getErrorFriendEmailText:function(){return this.errorFriendEmailText
},getErrorFriendEmailInvalidText:function(){return this.errorFriendEmailInvalidText
},getErrorYourEmailText:function(){return this.errorYourEmailText
},getErrorYourEmailInvalidText:function(){return this.errorYourEmailInvalidText
},getInstructionalText:function(){return this.sendFriendInstructionalText
},getHtml:function(){return this.html
},html:'		<div class="${classes.SEND_FRIEND} ${classes.WIDGET}">			<span class="${hooks.SENDBUTTON}">${templates.getSendFriendLabel()}</span>			<div class="${hooks.SENDBUTTON_TOOLTIP}">${templates.getSendFriendLabel()}</div>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.SendFriendWidget.hooks={SENDBUTTON:A.SEND_FRIEND+"-button",SENDBUTTON_TOOLTIP:A.SEND_FRIEND+"-tooltip"}
})();
HD.SendFriendWidget.prototype={setListeners:function(D){if(!D){return 
}var A=this;
var C=HD.getByClass(this.config.hooks.SENDBUTTON,"*",this.getParent())[0];
if(C){var B=HD.getByClass(this.config.hooks.SENDBUTTON_TOOLTIP,"*",this.getParent())[0];
if(B){C.onmouseover=function(){HD.addClass(B,HD.CSS_CLASSES.SHARE+"Hover")
};
C.onmouseout=function(){HD.removeClass(B,HD.CSS_CLASSES.SHARE+"Hover")
}
}}C.onclick=function(){A.openForm(D)
}
},update:function(A,B){if(!this.config.embedMode){if(this.config.standaloneMode){if(A=="loadSTAF_Start"){this.render(B)
}}else{if(A=="getMedium_Start"){this.loading(true)
}else{if(A=="getMedium_Finish"){this.loading(false);
this.render(B)
}else{if(A=="activeItem_Change"){this.render(B)
}}}}}},getHtml:function(A){if(!A){return 
}return this.processTemplate(this.config.templates.getHtml(),{})
},openForm:function(B){var A=this;
A.config.callback(B);
HD.util.Analytics.track(A.analyticsSendFriendString(B));
HD.util.Common.requestContent(comSvcBaseUrl+"/hd/hd_send_friend/assets/sendToFriend.jsp?siteName="+comSiteName,function(D){var F=HD.util.Common.showOverlay(D,HD.SendFriendWidget.templates.getSendFriendLabel().toUpperCase(),A.config.overlayWidth,A.config.overlayHeight);
var E=HD.util.Common.get("sendFriendInstructions");
if(E){E.innerHTML=HD.SendFriendWidget.templates.getInstructionalText()
}var C=F.getElementsByTagName("form")[0];
C.onsubmit=function(){A.handleSubmit(C,B);
return false
}
})
},handleSubmit:function(D,F){var K="";
var C=/.+@.+\..+/;
var O=this;
var M=D.userName.value;
var G=D.userEmail.value;
var L=D.friendName.value;
var E=D.friendEmail.value;
var N=HD.SendFriendWidget.templates;
HD.removeClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-UserName"),"hdwcValidationError");
HD.removeClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-FriendName"),"hdwcValidationError");
HD.removeClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-UserEmail"),"hdwcValidationError");
HD.removeClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-FriendEmail"),"hdwcValidationError");
var J=HD.get("hdValidationErrors");
if(!M){K+='<div class="hdwcErrorOverlayLarge">'+N.getErrorUserNameText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-UserName"),"hdwcValidationError")
}if(!L){K+='<div class="hdwcErrorOverlayLarge">'+N.getErrorFriendNameText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-FriendName"),"hdwcValidationError")
}if(!G){K+='<div class="hdwcErrorOverlayLarge">'+N.getErrorYourEmailText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-UserEmail"),"hdwcValidationError")
}else{if(!G.match(C)){K+='<div class="hdwcErrorOverlayLarge">'+N.getErrorYourEmailInvalidText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-UserEmail"),"hdwcValidationError")
}}if(!E){K+='<div class="hdwcErrorOverlayLarge">'+N.getErrorFriendEmailText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-FriendEmail"),"hdwcValidationError")
}else{if(!E.match(C)){K+='<div class="hdwcErrorOverlayLarge">'+N.errorFriendEmailInvalidText()+"</div>";
HD.addClass(HD.get(HD.CSS_CLASSES.SEND_FRIEND+"-FriendEmail"),"hdwcValidationError")
}}if(K){if(!J){J=document.createElement("div");
J.id="hdValidationErrors";
var I=HD.get("submissionInstructions");
I.parentNode.insertBefore(J,I.nextSibling)
}J.innerHTML=K
}else{if(J){J.parentNode.removeChild(J)
}this.config.submission.media=F.mediaId||"";
var H=this.config.getParams(this.config.submission,F)||this.config.submission;
var B=[H.url,"?_ID_=",encodeURIComponent(H.id||""),"&YOURNAME=",encodeURIComponent(M),"&YOUREMAIL=",encodeURIComponent(G),"&FRIENDNAME=",encodeURIComponent(L),"&FRIENDEMAIL=",encodeURIComponent(E),"&communityID=",encodeURIComponent(H.community||""),"&mediaID=",encodeURIComponent(H.media||""),"&viewID=",encodeURIComponent(H.view||"")];
for(var A in H){if(!A.match(/^(id|community|media|view|url)$/)){B.push("&",A,"=",encodeURIComponent(H[A]))
}}HD.util.Analytics.track(this.analyticsSendFriendConfirmationString(F));
HD.util.Common.requestContent(comSvcBaseUrl+"/hd/hd_send_friend/assets/sendToFriend.jsp?siteName="+comSiteName+"&recip="+encodeURIComponent(E)+"&url="+escape(B.join("")),function(Q){var R=HD.util.Common.showOverlay(Q,HD.SendFriendWidget.templates.getSendFriendLabel().toUpperCase(),O.config.overlayWidth,O.config.overlayHeight);
if(O.config.sendAnother){var P=HD.getByClass("hdClose","*",R);
if(P.length>0){P[0].onclick=function(){O.openForm(F)
}
}}})
}},analyticsSendFriendString:function(A){return"default_analyticsSendFriendString"
},analyticsSendFriendConfirmationString:function(A){return"default_analyticsSendFriendConfirmationString"
}};
HD.extend(HD.SendFriendWidget,[HD.Widget]);
HD.register("hd_send_friend_widget","HD.SendFriendWidget",{version:"1.0",build:"1"});HD.EventsWidget=function(A){this.config=A||{};
this.config.pageSize=this.config.pageSize||3;
this.config.location=this.config.location||"";
this.config.subtype=this.config.subtype||"H-D,DLR,HOG";
this.config.showLocation=this.config.showLocation||false;
this.config.handleLinks=this.config.handleLinks==null?false:this.config.handleLinks;
this.config.linkToNewWindow=this.config.linkToNewWindow==null?false:this.config.linkToNewWindow;
this.config.filter=this.config.filter||"";
this.config.orderByDate=this.config.orderByDate||false;
this.observers=[];
this.addObserver(this);
this.loadTemplates(arguments.callee)
};
HD.EventsWidget.templates={eventsLabel:"Events",viewEventText:"View Event",viewAllEventsText:"View All Events",locationLabel:"Look for events in your area:",blankLocationText:"address, state, city or zip",submitLocationText:"Go",getEventsLabel:function(){return this.eventsLabel
},getViewEventText:function(){return this.viewEventText
},getViewAllEventsText:function(){return this.viewAllEventsText
},getLocationLabel:function(){return this.locationLabel
},getBlankLocationText:function(){return this.blankLocationText
},getSubmitLocationText:function(){return this.submitLocationText
},getHtml:function(){return this.html
},html:'		<div class="${classes.EVENTS} ${classes.WIDGET}">			<span class="${classes.TITLE}">${templates.getEventsLabel()}</span>			<ul class="${classes.LIST}">			{for event in events}				<li class="${hooks.ITEMEVENT}">					<div class="${classes.ITEM} ${classes.EVENT}">						<div class="${classes.SMALL_THUMB_WRAPPER} ${classes.CATEGORY} ${classes.CATEGORY}${event.category[0]}">							<div class="${classes.SMALL_THUMB}">	 							<div class="${classes.THUMB_OVERLAY}"></div>							</div>						</div>						<div class="${classes.TITLE}">${event.title[0]}</div>						<div class="${classes.DATE}">${event|date}&nbsp;&#150;&nbsp;${event|location}</div>						<span><a 							{if config.handleLinks}								href="${event.link[0]}" 							{else}								href="#eventAnchor${event_index}" 							{/if}							" 							{if config.handleLinks && config.linkToNewWindow}								target="_blank" 							{/if}						name="eventAnchor${event_index}" class="${classes.VIEW} ${classes.CONTROL}">${templates.getViewEventText()}</a></span>					</div>				</li>			{/for}			</ul>			{if config.showLocation}				<div class="${classes.LOCATION}"><span>${templates.getLocationLabel()}</span>					<form class="${hooks.LOCATIONFORM}"><input type="text" class="${hooks.LOCATIONINPUT}" value="{if data.location}${data.location}{else}${templates.getBlankLocationText()}{/if}"/>					<a href="javascript:void(0)" class="${hooks.LOCATIONLINK}">${templates.getSubmitLocationText()}</a></form>				</div>			{/if}			<a href="#eventsAnchorAll" name="eventsAnchorAll" class="${classes.VIEW_ALL} ${classes.CONTROL}">${templates.getViewAllEventsText()}</a>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.EventsWidget.hooks={ITEMEVENT:A.EVENTS+"-item",LOCATIONFORM:A.EVENTS+"-locform",LOCATIONINPUT:A.EVENTS+"-locinput",LOCATIONLINK:A.EVENTS+"-loclink"}
})();
HD.EventsWidget.prototype={getFeed:function(B,A){var C=this;
B=B||this.config.subtype;
A=A||this.config.location;
this.notifyObservers("getRidePlannerFeed_Events_Start",{subtype:B,location:A});
HD.util.RSS.getRidePlannerFeed("events/"+B+"/"+A+(this.config.filter?"?filter="+this.config.filter:""),function(D){C.notifyObservers("getRidePlannerFeed_Events_Finish",{feed:D,subtype:B,location:A})
})
},update:function(A,B){if(A=="getRidePlannerFeed_Events_Start"){this.loading(true)
}else{if(A=="getRidePlannerFeed_Events_Finish"){this.loading(false);
this.render(B)
}}},setListeners:function(F){if(!F){return 
}var B=HD.CSS_CLASSES;
var H=this.getParent();
var L=this;
var I=HD.getByClass(this.config.hooks.ITEMEVENT,"*",H);
var D=HD.getByClass(B.VIEW_ALL,"*",H)[0];
var K=F.feed.channel[0];
var L=this;
for(var G=0,C=Math.min(K.item.length,this.config.pageSize||3);
G<C;
G++){(function(){var N=K.item[G];
var M=function(){L.notifyObservers("viewEvent",N);
return false
};
I[G].onclick=M
})()
}D.onclick=function(){L.notifyObservers("viewAllEvents",K);
return false
};
var J=HD.getByClass(this.config.hooks.LOCATIONFORM,"*",H)[0];
var A=HD.getByClass(this.config.hooks.LOCATIONLINK,"*",H)[0];
var E=HD.getByClass(this.config.hooks.LOCATIONINPUT,"*",H)[0];
if(A){A.onclick=function(){L.getFeed(null,E.value)
}
}if(E){E.onfocus=function(){if(this.value==HD.EventsWidget.templates.getBlankLocationText()){this.value=""
}};
E.onblur=function(){if(!this.value){this.value=HD.EventsWidget.templates.getBlankLocationText()
}}
}if(J){J.onsubmit=function(){L.getFeed(null,E.value);
return false
}
}},getHtml:function(C){if(!C){return""
}var A=C.feed.channel[0].item;
var F=/^(.+\s+\d+,\s+\d+)/;
var B=/\n\s+(.+)/g;
var E=/\n\s+(.+)/;
var D=function(I){var G=I.match(B);
for(var H=0;
H<G.length;
H++){G[H]=G[H].match(E)[1]
}return G.join(" ")
};
if(this.config.orderByDate){A.sort(function(J,I){J.date=J.description[0].match(F)[0];
I.date=I.description[0].match(F)[0];
var H=Date.parse(J.date);
var G=Date.parse(I.date);
return H-G
})
}return this.processTemplate(this.config.templates.getHtml(),{data:C,events:A.slice(0,Math.min(A.length,this.config.pageSize||3)),_MODIFIERS:{date:function(G){return G.description[0].match(F)[0]
},location:function(G){return D(G.description[0])
}}})
}};
HD.extend(HD.EventsWidget,[HD.Widget]);
HD.register("hd_events_widget","HD.EventsWidget",{version:"1.0",build:"1"});HD.RidesWidget=function(A){this.config=A||{};
this.config.pageSize=this.config.pageSize||1;
this.config.location=this.config.location||"";
this.config.subtype=this.config.subtype||"USR,GR";
this.config.showLocation=this.config.showLocation||false;
this.config.handleLinks=this.config.handleLinks==null?false:this.config.handleLinks;
this.config.linkToNewWindow=this.config.linkToNewWindow==null?false:this.config.linkToNewWindow;
this.observers=[];
this.addObserver(this);
this.loadTemplates(arguments.callee)
};
HD.RidesWidget.templates={ridesLabel:"Rides",viewRideText:"View Ride",locationLabel:"Look for rides in your area:",blankLocationText:"address, state, city or zip",submitLocationText:"Go",getRidesLabel:function(){return this.ridesLabel
},getViewRideText:function(){return this.viewRideText
},getLocationLabel:function(){return this.locationLabel
},getBlankLocationText:function(){return this.blankLocationText
},getSubmitLocationText:function(){return this.submitLocationText
},getHtml:function(){return this.html
},html:'		<div class="${classes.RIDES} ${classes.WIDGET}">			<span class="${classes.TITLE}">${templates.getRidesLabel()}</span>			<ul class="${classes.LIST}">			{for ride in rides}				<li>					<div class="${classes.ITEM} ${hooks.RIDE}">						<div class="${classes.SMALL_THUMB_WRAPPER} ${classes.CATEGORY} ${classes.CATEGORY}${ride.category[0]}">							<div class="${classes.SMALL_THUMB}">	 							<div class="${classes.THUMB_OVERLAY}"></div>							</div>						</div>						<div class="${classes.TITLE}">${ride.title[0]}</div>						<div class="${classes.DATE}">${ride.description[0]}</div>						<span><a 							{if config.handleLinks}								href="${ride.link[0]}" 							{else}								href="#rideAnchor${ride_index}" 							{/if}							" 							{if config.handleLinks && config.linkToNewWindow}								target="_blank" 							{/if}						name="rideAnchor${ride_index}" class="${classes.VIEW} ${classes.CONTROL}">${templates.getViewRideText()}</a></span>					</div>				</li>			{/for}			</ul>			{if config.showLocation}				<div class="${classes.LOCATION}"><span>${templates.getLocationLabel()}</span>					<form class="${hooks.LOCATIONFORM}"><input class="${hooks.LOCATIONINPUT}" type="text" value="{if data.location}${data.location}{else}${templates.getBlankLocationText()}{/if}"/>					<a href="javascript:void(0)" class="${hooks.LOCATIONLINK}">${templates.getSubmitLocationText()}</a></form>				</div>			{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.RidesWidget.hooks={RIDE:A.RIDE,LOCATIONFORM:A.RIDES+"-locform",LOCATIONINPUT:A.RIDES+"-locinput",LOCATIONLINK:A.RIDES+"-loclink"}
})();
HD.RidesWidget.prototype={getFeed:function(B,A){var C=this;
B=B||this.config.subtype;
A=A||this.config.location;
this.notifyObservers("getRidePlannerFeed_Rides_Start",{subtype:B,location:A});
HD.util.RSS.getRidePlannerFeed("roads/"+B+"/"+(A||"53208"),function(D){C.notifyObservers("getRidePlannerFeed_Rides_Finish",{feed:D,subtype:B,location:A})
})
},update:function(A,B){if(A=="getRidePlannerFeed_Rides_Start"){this.loading(true)
}else{if(A=="getRidePlannerFeed_Rides_Finish"){this.loading(false);
this.render(B)
}}},setListeners:function(D){if(!D){return 
}var J=this.config.hooks;
var F=this.getParent();
var K=this;
var G=HD.getByClass(J.RIDE,"*",F);
var I=D.feed.channel[0];
var K=this;
for(var E=0,B=Math.min(I.item.length,this.config.pageSize||3);
E<B;
E++){if(G[E]){(function(){var M=I.item[E];
var L=function(){K.notifyObservers("viewRide",M);
return false
};
G[E].onclick=L
})()
}}var H=HD.getByClass(J.LOCATIONFORM,"*",F)[0]||null;
var A=HD.getByClass(J.LOCATIONLINK,"*",F)[0]||null;
var C=HD.getByClass(J.LOCATIONINPUT,"*",F)[0]||null;
if(H&&A&&C){A.onclick=function(){K.getFeed(null,C.value)
};
C.onfocus=function(){if(this.value==HD.RidesWidget.templates.getBlankLocationText()){this.value=""
}};
C.onblur=function(){if(!this.value){this.value=HD.RidesWidget.templates.getBlankLocationText()
}};
H.onsubmit=function(){K.getFeed(null,C.value);
return false
}
}},getHtml:function(B){if(!B){return""
}var A=B.feed.channel[0].item;
return this.processTemplate(this.config.templates.getHtml(),{data:B,rides:A.slice(0,Math.min(A.length,this.config.pageSize||3))})
}};
HD.extend(HD.RidesWidget,[HD.Widget]);
HD.register("hd_rides_widget","HD.RidesWidget",{version:"1.0",build:"1"});HD.TagCloudWidget=function(A){this.config=A||{};
this.config.multipleSelect=this.config.multipleSelect||false;
this.config.pageSize=this.config.pageSize||0;
this.config.pageType=this.config.pageType||"limit"||"hint";
this.config.minFontSize=Math.max(50,this.config.minFontSize||80);
this.config.maxFontSize=Math.min(300,this.config.maxFontSize||150);
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.TagCloudWidget.templates={moreTagsLabel:"More Tags",lessTagsLabel:"Less Tags",getMoreTagsLabel:function(){return this.moreTagsLabel
},getLessTagsLabel:function(){return this.lessTagsLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.TAG_CLOUD} ${classes.WIDGET} ${thresholdClasses} ${hooks.CLOUD}">		{for tag in tags}			{if tag_index} {/if}			<a href="javascript:void(0)" class="${classes.TAG} ${activeTags|isActive} {if isHint}scale-${tag.fontSize|parse} {elseif isLimit(tag)}scale-limit {/if} ${hooks.TAG}" style="font-size: ${tag.fontSize}">${tag.tagName}</a>		{/for}		{if hasThreshold}			<div>				<a href="javascript:void(0)" class="${classes.MORE} ${hooks.MORE}">${templates.getMoreTagsLabel()}</a>				<a href="javascript:void(0)" class="${classes.LESS} ${hooks.LESS}">${templates.getLessTagsLabel()}</a>			</div>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.TagCloudWidget.hooks={TAG:A.TAG+"-tag",MORE:A.TAG+"-more",LESS:A.TAG+"-less",CLOUD:A.TAG+"-cloud"}
})();
HD.TagCloudWidget.prototype={setListeners:function(C){var K=C.tags;
var B=HD.CSS_CLASSES;
var J=this;
var E=this.getParent();
var I=HD.getByClass(this.config.hooks.TAG,"*",E);
for(var D=0,G=I.length;
D<G;
D++){this.assignListener(I[D],K[D])
}var F=HD.getByClass(this.config.hooks.CLOUD,"*",E)[0];
var A=HD.getByClass(this.config.hooks.MORE,"*",E)[0];
var H=HD.getByClass(this.config.hooks.LESS,"*",E)[0];
if(A&&H&&F){A.onclick=function(){HD.replaceClass(F,B.TAG_CLOUD+"-"+B.LESS,B.TAG_CLOUD+"-"+B.MORE)
};
H.onclick=function(){HD.replaceClass(F,B.TAG_CLOUD+"-"+B.MORE,B.TAG_CLOUD+"-"+B.LESS)
}
}},assignListener:function(C,B){var A=this.model;
var D=this;
var F=B;
var E=HD.CSS_CLASSES;
C.onclick=function(){var K=D.config.multipleSelect;
var H=A.filters.tags||[];
if(HD.hasClass(this,E.ACTIVE)){HD.removeClass(this,E.ACTIVE);
if(!K){A.clearTags()
}else{for(var I=0;
I<H.length;
I++){if(H[I]==F.tagName){H.splice(I,1);
break
}}if(H.length>0){A.setTags(H)
}else{A.clearTags()
}}}else{if(!K){var J=HD.getByClass(D.config.hooks.TAG,"*",D.getParent());
for(var I=0,G=J.length;
I<G;
I++){HD.removeClass(J[I],E.ACTIVE)
}}HD.addClass(this,E.ACTIVE);
A.setTags(K?H.concat([F.tagName]):[F.tagName])
}}
},update:function(B,G){if(B=="getTags_Start"){this.loading(true)
}else{if(B=="getTags_Finish"){this.loading(false);
this.render(G)
}else{if(B=="tags_Set"||B=="tags_Clear"){var E=HD.CSS_CLASSES;
var F=HD.getByClass(this.config.hooks.TAG,"*",this.getParent());
for(var D=0,A=F.length;
D<A;
D++){HD.removeClass(F[D],E.ACTIVE);
for(var C=0;
C<G.length;
C++){if(F[D].innerHTML==G[C]){HD.addClass(F[D],E.ACTIVE);
break
}}}}}}},getHtml:function(C){var A=HD.CSS_CLASSES;
var I=C.tags;
var F=this.setFontSizes(C.tags);
var G=[];
var B=this.config.pageSize;
var E=this.model.filters&&this.model.filters.tags?this.model.filters.tags.slice(0):[];
if(F>0){G.push(A.TAG_CLOUD,"-",A.LESS);
if(this.config.pageType=="hint"){for(var D=F;
D<=this.config.maxFontSize;
D+=10){G.push(" ",A.TAG_CLOUD,"-scale-",D)
}}}var H=this;
return this.processTemplate(this.config.templates.getHtml(),{activeTags:E,data:C,tags:C.tags,thresholdClasses:G.join(""),threshold:F,hasThreshold:F>0,limit:B,isHint:F>0&&this.config.pageType=="hint",isLimit:function(J){if(F>0&&H.config.pageType=="limit"&&(J.count<F||B==0)){return true
}else{B--;
return false
}},_MODIFIERS:{parse:function(J){return parseInt(J,10)
},isActive:function(K){if(K.length>0){for(var J=K.length-1;
J>=0;
J--){if(K[J]==tag.tagName){K.splice(J,1);
return HD.CSS_CLASSES.ACTIVE;
break
}}}return""
}}})
},setFontSizes:function(C){var B=0,G=[],E=[];
var F=function(I,H){return I>H?1:(I<H?-1:0)
};
for(var D=0,A=C.length;
D<A;
D++){if(C[D].count>B){B=C[D].count
}E.push(C[D].count)
}for(var D=0,A=C.length;
D<A;
D++){G.push(Math.max(this.config.minFontSize,Math.floor((this.config.maxFontSize/20)*(1+(1.5*C[D].count-B/2)/B))*10));
C[D].fontSize=G[G.length-1]+"%"
}if(this.config.pageType=="hint"){G=G.sort(F);
return G.length&&this.config.pageSize&&G.length>this.config.pageSize&&G[G.length-this.config.pageSize]>G[0]?G[G.length-this.config.pageSize]:0
}else{if(this.config.pageType=="limit"){E=E.sort(F);
return E.length&&this.config.pageSize&&E.length>this.config.pageSize?E[E.length-this.config.pageSize]:0
}else{return 0
}}}};
HD.extend(HD.TagCloudWidget,[HD.Widget]);
HD.register("hd_tag_cloud_widget","HD.TagCloudWidget",{version:"1.0",build:"1"});HD.CategoriesWidget=function(A){this.config=A||{};
this.config.items=this.config.items||[];
this.config.renderMode=this.config.renderMode||"list"||"select";
this.observers=[];
this.categories=this.config.items.length>0?this.config.items[0].categories.join(";"):"";
this.loadTemplates(arguments.callee);
this.render()
};
HD.CategoriesWidget.templates={categoryLabel:"Category",getCategoryLabel:function(){return this.categoryLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.CATEGORIES} ${classes.WIDGET}"><span>${templates.getCategoryLabel()}</span>		{if config.renderMode == "list"}			<ul class="${hooks.LIST}">			{for item in items}				<li class="${hooks.ITEM}{if item_index == 0} ${classes.ACTIVE}{/if}"><a href="javascript:void(0)">${item.name}</a></li>			{/for}			</ul>		{elseif config.renderMode == "select"}			<select class="${hooks.LIST}">			{for item in items}				<option class="${hooks.ITEM}" value="${item_index}"{if item_index == 0} selected="selected"{/if}>${item.name}</option>			{/for}			</select>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.CategoriesWidget.hooks={ITEM:A.ITEM,LIST:A.LIST}
})();
HD.CategoriesWidget.prototype={setListeners:function(F){var E=HD.CSS_CLASSES;
var C=this;
if(this.config.renderMode=="list"){var B=HD.getByClass(this.config.hooks.ITEM,"*",this.getParent());
for(var D=0,A=B.length;
D<A;
D++){(function(){var G=D;
B[G].onclick=function(){for(var I=0;
I<A;
I++){HD.removeClass(B[I],E.ACTIVE)
}HD.addClass(this,E.ACTIVE);
var H=C.config.items[G].categories;
C.model.setCategories(H);
C.categories=H.join(";")
}
})()
}}else{if(this.config.renderMode=="select"){HD.getByClass(this.config.hooks.LIST,"*",this.getParent(),function(G){G.onchange=function(){var H=C.config.items[parseInt(this.options[this.selectedIndex].value,10)].categories;
C.model.setCategories(H);
C.categories=H.join(";")
}
})
}}},update:function(C,F){if(C=="categories_Set"){if(F.join(";")!=this.categories){var A=F.join(";");
var B=[];
var E=HD.CSS_CLASSES;
if(this.config.renderMode=="list"){B=HD.getByClass(this.config.hooks.ITEM,"*",this.getParent())
}else{if(this.config.renderMode=="select"){B=HD.getByClass(this.config.hooks.LIST,"*",this.getParent())
}}for(var D=0;
D<this.config.items.length;
D++){if(this.config.renderMode=="list"&&B[D]){HD.removeClass(B[D],E.ACTIVE)
}if(this.config.items[D].categories.join(";")==A){if(this.config.renderMode=="list"&&B[D]){HD.addClass(B[D],E.ACTIVE)
}else{if(this.config.renderMode=="select"&&B[0]){B[0].selectedIndex=D;
break
}}}}}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:this.config.items})
}};
HD.extend(HD.CategoriesWidget,[HD.Widget]);
HD.register("hd_categories_widget","HD.CategoriesWidget",{version:"1.0",build:"1"});HD.TagsWidget=function(A){this.config=A||{};
this.config.renderMode=this.config.renderMode||"list"||"select";
this.observers=[];
this.tags="";
this.loadTemplates(arguments.callee)
};
HD.TagsWidget.templates={tagLabel:"Tag",showAllTagsLabel:"Show all tags",getTagLabel:function(){return this.tagLabel
},getShowAllTagsLabel:function(){return this.showAllTagsLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.TAGS} ${classes.WIDGET}"><span>${templates.getTagLabel()}</span>		{if config.renderMode == "list"}			<ul class="${hooks.LIST}">			{for item in items}				{if item_index == 0}					<li class="${hooks.ITEM} ${classes.ACTIVE}"><a href="javascript:void(0)">${templates.getShowAllTagsLabel()}</a></li>				{else}					<li class="${hooks.ITEM}"><a href="javascript:void(0)">${item.tagName}</a></li>				{/if}			{/for}			</ul>		{elseif config.renderMode == "select"}			<select class="${hooks.LIST}">			{for item in items}				{if item_index == 0}					<option class="${hooks.ITEM}" value="${item_index}" selected="selected">${templates.getShowAllTagsLabel()}</option>				{else}					<option class="${hooks.ITEM}" value="${item_index}">${item.tagName}</option>				{/if}			{/for}			</select>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.TagsWidget.hooks={ITEM:A.ITEM,LIST:A.LIST}
})();
HD.TagsWidget.prototype={setListeners:function(F){var E=HD.CSS_CLASSES;
var C=this;
if(this.config.renderMode=="list"){var B=HD.getByClass(this.config.hooks.ITEM,"*",this.getParent());
for(var D=0,A=B.length;
D<A;
D++){(function(){var G=D;
B[G].onclick=function(){for(var I=0;
I<A;
I++){HD.removeClass(B[I],E.ACTIVE)
}HD.addClass(this,E.ACTIVE);
var H=[C.config.items[G].tagName];
C.model.setTags(H);
C.tags=H.join(";")
}
})()
}}else{if(this.config.renderMode=="select"){HD.getByClass(this.config.hooks.LIST,"*",this.getParent(),function(G){G.onchange=function(){var H=[C.config.items[parseInt(this.options[this.selectedIndex].value,10)].tagName];
C.model.setTags(H);
C.tags=H.join(";")
}
})
}}},update:function(C,F){if(C=="getTags_Start"){this.loading(true)
}else{if(C=="getTags_Finish"){this.loading(false);
this.config.items=[""].concat(F.tags).sort(function(H,G){if(H.tagName>G.tagName){return 1
}else{if(H.tagName<G.tagName){return -1
}else{return 0
}}});
this.render()
}}if(C=="tags_Set"||C=="tags_Clear"){if(F.join(";")!=this.tags){var A=F.join(";");
var B=[];
var E=HD.CSS_CLASSES;
if(this.config.renderMode=="list"){B=HD.getByClass(this.config.hooks.ITEM,"*",this.getParent())
}else{if(this.config.renderMode=="select"){B=HD.getByClass(this.config.hooks.LIST,"*",this.getParent())
}}for(var D=0;
D<this.config.items.length;
D++){if(this.config.renderMode=="list"&&B[D]){HD.removeClass(B[D],E.ACTIVE)
}if(this.config.items[D].tagName==A){if(this.config.renderMode=="list"&&B[D]){HD.addClass(B[D],E.ACTIVE)
}else{if(this.config.renderMode=="select"&&B[0]){B[0].selectedIndex=D;
break
}}}}}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:this.config.items})
}};
HD.extend(HD.TagsWidget,[HD.Widget]);
HD.register("hd_tags_widget","HD.TagsWidget",{version:"1.0",build:"1"});HD.FaceoffWidget=function(A){this.config=A||{};
this.config.comments=this.config.comments||{};
this.config.previewLength=this.config.previewLength||0;
this.config.manualSwitching=this.config.manualSwitching||false;
this.observers=[];
this.comments=null;
this.data={faceoffs:null,active:null,mediaId:null};
this.listEl=null;
this.commentsEl=null;
this.mediaEls=null;
this.loadTemplates(arguments.callee);
this.render()
};
HD.FaceoffWidget.templates={voteLabel:"Vote",previousLabel:"Previous",nextLabel:"Next",loadingLabel:"Loading...",goLabel:"Go",getVoteLabel:function(){return this.voteLabel
},getPreviousLabel:function(){return this.previousLabel
},getNextLabel:function(){return this.nextLabel
},getLoadingLabel:function(){return this.loadingLabel
},getGoLabel:function(){return this.goLabel
},getNavigationHtml:function(){return this.navigationHtml
},getMediaHtml:function(){return this.mediaHtml
},getHtml:function(){return this.html
},html:'		<div class="${classes.FACEOFF} ${classes.WIDGET}">			<div class="${hooks.NAVIGATION}"></div>			<div class="${classes.FACEOFF}-content">				<div class="${hooks.MEDIA}"></div>				<div class="${hooks.MEDIA}"></div>				<div class="${hooks.COMMENTS}"></div>			</div>		</div>',navigationHtml:'		<div class="${classes.FACEOFF}-list-container">			<select class="${hooks.LIST}">			{for faceoff in faceoffs}				<option value="${faceoff.mediaId}">${faceoff.title}</option>			{/for}			</select>			{if config.manualSwitching}				<div class="${hooks.GO}">${templates.getGoLabel()}</div>			{/if}		</div>		<div class="${classes.FACEOFF}-results-container"><div class="${hooks.RESULTS}">View Results</div></div>		<div class="${classes.FACEOFF}-step">			<div class="${hooks.NEXT}">${templates.getNextLabel()}</div>			<div class="${hooks.PREVIOUS}">${templates.getPreviousLabel()}</div>		</div>',mediaHtml:'		<div class="${hooks.VOTE}"><div>${templates.getVoteLabel()}</div></div>		<div class="${hooks.VALUE} {if result.won}${" "+classes.FACEOFF+"-won"}{/if}"><div>${result.percentage|round:0}%</div></div>		${media|facade}'};
(function(){var A=HD.CSS_CLASSES;
HD.FaceoffWidget.hooks={MEDIA:A.FACEOFF+"-media",VOTE:A.FACEOFF+"-vote",GO:A.FACEOFF+"-go",PREVIOUS:A.FACEOFF+"-previous",NEXT:A.FACEOFF+"-next",VALUE:A.FACEOFF+"-value",COMMENTS:A.FACEOFF+"-comments",NAVIGATION:A.FACEOFF+"-navigation",RESULTS:A.FACEOFF+"-results",LIST:A.FACEOFF+"-list",SHOW_RESULTS:A.FACEOFF+"-show-results",HAS_PREVIOUS:A.FACEOFF+"-has-previous",HAS_NEXT:A.FACEOFF+"-has-next",HAS_FACEOFF:A.FACEOFF+"-has-faceoff"}
})();
HD.FaceoffWidget.prototype={setListeners:function(C){var B=HD.CSS_CLASSES;
var A=this;
setTimeout(function(){A.loading(true);
A.renderComments();
A.mediaEls=HD.getByClass(A.config.hooks.MEDIA,"*",A.getParent())
},25)
},update:function(B,D){if(B=="getMedia_Finish"){this.loading(false);
this.renderNavigation(D)
}else{if(B=="getFaceoff_Start"){HD.removeClass(this.getParent(),this.config.hooks.HAS_FACEOFF);
if(this.commentsEl){this.loading(true,this.commentsEl)
}if(this.mediaEls){for(var C=0,A=this.mediaEls.length;
C<A;
C++){this.loading(true,this.mediaEls[C]);
this.mediaEls[C].innerHTML=this.config.templates.getLoadingLabel()||""
}}}else{if(B=="getFaceoff_Finish"){HD.addClass(this.getParent(),this.config.hooks.HAS_FACEOFF);
if(this.mediaEls){for(var C=0,A=this.mediaEls.length;
C<A;
C++){this.loading(false,this.mediaEls[C])
}}this.renderFaceoff(D)
}else{if(B=="getFaceoffComments_Finish"){if(this.commentsEl){this.loading(false,this.commentsEl)
}}}}}},switchFaceoff:function(B){this.model.getFaceoff(B);
this.data.mediaId=B;
var A=this.getParent();
this.switchView("results");
if(this.listEl&&this.listEl.options.length>0){if(this.listEl.selectedIndex>0){HD.addClass(A,this.config.hooks.HAS_PREVIOUS)
}else{HD.removeClass(A,this.config.hooks.HAS_PREVIOUS)
}if(this.listEl.selectedIndex<this.listEl.options.length-1){HD.addClass(A,this.config.hooks.HAS_NEXT)
}else{HD.removeClass(A,this.config.hooks.HAS_NEXT)
}}},switchView:function(A){if(!A||A=="results"){HD.addClass(this.getParent(),this.config.hooks.SHOW_RESULTS)
}else{HD.removeClass(this.getParent(),this.config.hooks.SHOW_RESULTS)
}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml())
},renderNavigation:function(I){var J=this;
var F=this.getParent();
this.data.faceoffs=I.media;
var B=HD.getByClass(this.config.hooks.NAVIGATION,"*",F);
if(B&&B[0]){B[0].innerHTML=this.processTemplate(this.config.templates.getNavigationHtml(),{faceoffs:this.data.faceoffs});
var E=HD.getByClass(this.config.hooks.LIST,"*",F);
if(E&&E[0]){this.listEl=E=E[0];
var H=function(){if(J.listEl.options[J.listEl.selectedIndex]&&J.listEl.options[J.listEl.selectedIndex].value){J.switchFaceoff(J.listEl.options[J.listEl.selectedIndex].value)
}};
if(this.config.manualSwitching){var G=HD.getByClass(this.config.hooks.GO,"*",F);
if(G&&G[0]){G[0].onclick=H
}}else{E.onchange=H
}var A=HD.getByClass(this.config.hooks.PREVIOUS,"*",F);
var C=HD.getByClass(this.config.hooks.NEXT,"*",F);
if(A&&A[0]){A[0].onclick=function(){if(E.options.length>0&&E.selectedIndex>0){E.selectedIndex--;
J.switchFaceoff(E.options[E.selectedIndex].value)
}}
}if(C&&C[0]){C[0].onclick=function(){if(E.options.length>0&&E.selectedIndex<E.options.length-1){E.selectedIndex++;
J.switchFaceoff(E.options[E.selectedIndex].value)
}}
}}var D=HD.getByClass(this.config.hooks.RESULTS,"*",F);
if(D&&D[0]){D[0].onclick=function(){J.switchView("results")
}
}this.data.active=this.data.faceoffs[0];
this.switchFaceoff(this.data.active.mediaId)
}},renderFaceoff:function(H){if(H.faceoff.mediaId!=this.data.mediaId){return 
}var K=this;
var E=this.getParent();
this.data.active=H;
var C=this.data.active.faceoff;
var F=this.checkIfVoted(this.data.active.faceoff.mediaId);
var J=(C.metaTags&&C.metaTags.active)||null;
if(!F&&((J&&J.toLowerCase()=="yes")||(J===null&&C.mediaId==this.data.faceoffs[0].mediaId))){this.switchView("vote")
}else{this.switchView("results")
}var I=this.mediaEls;
if(I&&I.length==this.data.active.media.length){for(var D=0,B=I.length;
D<B;
D++){var G=this.data.active.media[D].description||"";
if(this.config.previewLength>0&&HD.util.Common.stripHtmlTags(G).length>this.config.previewLength){G=HD.util.Common.ellipseText(G,this.config.previewLength)
}else{G=HD.util.Common.stripHtmlTags(G,true)
}this.data.active.media[D].description=G;
I[D].innerHTML=this.processTemplate(this.config.templates.getMediaHtml(),{faceoff:this.data.active.faceoff||{},media:this.data.active.media[D]||{},result:this.data.active.results[D]||{}});
(function(){var O=K.data.active.media[D];
var N=function(){K.notifyObservers("itemSelected",O);
K.model.setActiveItem(O)
};
var M=HD.getByClass(HD.community.Media.hooks.MEDIA_THUMB,"*",I[D]);
var L=HD.getByClass(HD.CSS_CLASSES.TITLE,"*",I[D]);
if(M&&M[0]){M[0].onclick=N
}if(L&&L[0]){L[0].onclick=N
}})()
}}var A=HD.getByClass(this.config.hooks.VOTE,"*",E);
if(A&&A.length>=2){for(var D=0,B=Math.min(A.length,2);
D<B;
D++){(function(){var L=D;
A[D].onclick=function(){if(!K.checkIfVoted(K.data.active.faceoff.mediaId)){K.markVoted(L==0?1:5)
}}
})()
}}},renderComments:function(C){var D=HD.getByClass(this.config.hooks.COMMENTS,"*",this.getParent());
if(D&&D[0]&&this.engine&&!this.comments){this.commentsEl=D[0];
this.config.comments=HD.merge({parent:D[0],type:"hd_comments_widget",contentFeed:"getFaceoffComments",submitBelow:true},this.config.comments);
var B={},A=this.engine.getWidgetName(this)+"_comments";
B[A]=this.config.comments;
this.engine.addWidgets(B);
this.comments=this.engine.getWidget(A)
}},markVoted:function(A){var D=this.data.active;
var C=this.getRatingCookie("faceoffItems");
this.getRatingFromCookie(C,D.faceoff.mediaId,"-").rating=A;
this.setRatingCookie("faceoffItems",C);
this.model.rateMedia(D.faceoff.mediaId,null,A);
var B=D.results;
B[A==1?0:1].votes++;
D.faceoff.numberOfVotes=B[0].votes+B[1].votes;
B[0].percentage=B[0].votes/D.faceoff.numberOfVotes*100;
B[1].percentage=B[1].votes/D.faceoff.numberOfVotes*100;
B[0].won=B[0].votes>=B[1].votes;
B[1].won=B[1].votes>=B[0].votes;
D.faceoff.rating=(B[0].votes*1+B[1].votes*5)/D.faceoff.numberOfVotes;
this.renderFaceoff(D)
},checkIfVoted:function(C){this.config.hasVoted=false;
var B=this.getRatingCookie("faceoffItems");
var A=this.getRatingFromCookie(B,C,"-");
if(A.rating>0){this.config.hasVoted=true;
this.config.myVote=A.rating
}return this.config.hasVoted
},loading:function(A,B){B=B||this.getParent();
if(A){HD.addClass(B,HD.CSS_CLASSES.LOADING)
}else{HD.removeClass(B,HD.CSS_CLASSES.LOADING)
}}};
HD.extend(HD.FaceoffWidget,[HD.Widget,HD.util.StarRatingCookie]);
HD.register("hd_faceoff_widget","HD.FaceoffWidget",{version:"1.0",build:"1"});HD.UploadWidget=function(A){this.config=A||{};
this.config.actions=this.config.actions||[];
this.config.dialog=this.config.dialog||{};
this.config.categoriesFriendly=this.config.categoriesFriendly||this.config.categories;
this.config.siteSection=this.config.siteSection||"";
this.observers=[]
};
HD.UploadWidget.templates={overlayTitle:"Upload",unsupportedFileTypeText:["You must submit a photo or a video.<br/>","Photo must use the following format: (.jpg, .gif)<br/>","Video must use the following format: (.flv, .wmv, .asf, .avi, .mov, .3gp, .mpg, .mpeg, .mp4)<br/>"].join(""),suggestionsAndGuidelinesText:"",getOverlayTitle:function(){return this.overlayTitle
},getUnsupportedFileTypeText:function(){return this.unsupportedFileTypeText
},getSuggestionsAndGuidelinesText:function(){return this.suggestionsAndGuidelinesText
}};
HD.UploadWidget.prototype={supportedVideoTypes:[".flv",".wmv",".asf",".avi",".mov",".3gp",".mpg",".mpeg",".mp4"],supportedPhotoTypes:[".jpeg",".jpg",".gif"],getUnsupportedFileTypeError:function(A){return HD.UploadWidget.templates.getUnsupportedFileTypeText()
},renderPhoto:function(){var A=this;
login.model.isUserLoggedIn(function(C){if(C.loggedInLevel>1){A.getPhotoHtml(null)
}else{var B={update:function(D,E){if(D=="logged_In"){A.getPhotoHtml(null);
login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}else{if(D=="overlayClose_Click"){login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}}}};
HD.util.Common.getObservable().addObserver(B);
login.model.addObserver(B);
login.model.addObserver(B);
if(C.loggedInLevel>0){login.view.promptCreateScreenName()
}else{login.view.promptAuthentication()
}}})
},renderVideo:function(){var A=this;
login.model.isUserLoggedIn(function(C){if(C.loggedInLevel>1){A.getVideoHtml(null)
}else{var B={update:function(D,E){if(D=="logged_In"){A.getVideoHtml(null);
login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}else{if(D=="overlayClose_Click"){login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}}}};
HD.util.Common.getObservable().addObserver(B);
login.model.addObserver(B);
if(C.loggedInLevel>0){login.view.promptCreateScreenName()
}else{login.view.promptAuthentication()
}}})
},renderBoth:function(C,B,D){this.category=C;
this.categories=B;
this.categoriesFriendly=D||B;
var A=this;
login.model.isUserLoggedIn(function(F){if(F.loggedInLevel>1){A.getBothHtml(null)
}else{var E={update:function(G,H){if(G=="logged_In"){A.getBothHtml(null);
login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}else{if(G=="overlayClose_Click"){login.model.removeObserver(this);
HD.util.Common.getObservable().removeObserver(this)
}}}};
HD.util.Common.getObservable().addObserver(E);
login.model.addObserver(E);
login.model.addObserver(E);
if(F.loggedInLevel>0){login.view.promptCreateScreenName()
}else{login.view.promptAuthentication()
}}})
},loading:function(A){var B=this.getParent();
if(A){HD.addClass(B,HD.CSS_CLASSES.LOADING)
}else{HD.removeClass(B,HD.CSS_CLASSES.LOADING)
}},update:function(B,D){var C=this.config;
if(B=="submitMedium_Start"){this.loading(true)
}else{if(B=="submitMedium_Finish"){this.loading(false);
var A=this;
HD.util.Common.requestContent(comSvcBaseUrl+"/hd/hd_upload_widget/assets/uploadConfirmation.jsp?siteName="+C.siteName+"&siteSection="+C.siteSection,function(H){var J=HD.util.Common.showOverlay(H,HD.UploadWidget.templates.getOverlayTitle(),C.dialog.confirm?C.dialog.confirm[0]:"580px",C.dialog.confirm?C.dialog.confirm[1]:"150px");
HD.util.Analytics.track(A.analyticsUploadConfirmationString(D[3]||""));
if(A.config.actions.length>0){var I=HD.getByClass("hdwcMedPadBtm","div",J)[0];
var G=document.createElement("div");
G.className="btnOrange "+HD.CSS_CLASSES.ACTION;
G.innerHTML="<a href='#'></a>";
for(var E=0;
E<A.config.actions.length;
E++){var F=G.cloneNode(true);
(function(){var K=A.config.actions[E];
F.firstChild.innerHTML=K;
F.firstChild.onclick=function(){HD.util.Common.hideOverlay();
A.model.notifyObservers("submitMedium_Action",K)
}
})();
I.appendChild(F)
}}})
}else{if(B=="submitMedium_Error"){this.loading(false);
D[0].indexOf("photo")>=0?this.getPhotoHtml(D):this.getVideoHtml(D)
}}}},getPhotoHtml:function(C){var A=this;
var B=this.config;
var D=HD.util.Common.timestamp();
HD.util.Common.requestContent(comSvcBaseUrl+"/hd/hd_upload_widget/assets/photoUpload.jsp?siteName="+B.siteName+"&category="+B.categories[0]+"&timestamp="+D+"&siteSection="+B.siteSection,function(F){HD.util.Common.showOverlay(F,"Upload","590px","525px");
HD.util.Analytics.track(HD.UploadWidget.prototype.analyticsUploadPhotoString());
if(C!=null){var E=document.getElementById("hdUploadPhotoForm");
if(E!=null){E.title.value=C[1];
E.story.value=C[2]
}}A.setPhotoListeners.call(A)
})
},getVideoHtml:function(C){var A=this;
var B=this.config;
var D=HD.util.Common.timestamp();
HD.util.Common.requestContent(comSvcBaseUrl+"/hd/hd_upload_widget/assets/videoUpload.jsp?siteName="+B.siteName+"&category="+B.categories[0]+"&timestamp="+D+"&siteSection="+B.siteSection,function(F){HD.util.Common.showOverlay(F,"Upload","590px","525px");
HD.util.Analytics.track(HD.UploadWidget.prototype.analyticsUploadVideoString());
if(C!=null){var E=document.getElementById("hdUploadVideoForm");
if(E!=null){E.title.value=C[1];
E.story.value=C[2]
}}A.setVideoListeners.call(A)
})
},getBothHtml:function(J,C){var F=this;
var D=this.config;
var I=HD.util.Common.timestamp();
var G="categories=";
for(var H=0;
H<this.categories.length;
H++){var E=this.categories[H];
E=E.replace(/,/g,"acomma");
G+=encodeURIComponent(E);
if(H<(this.categories.length-1)){G+=","
}}var K="categoriesFriendly=";
for(var H=0;
H<this.categoriesFriendly.length;
H++){var E=this.categoriesFriendly[H];
E=E.replace(/,/g,"acomma");
K+=encodeURIComponent(E);
if(H<(this.categoriesFriendly.length-1)){K+=","
}}var B=this.category;
if(C!=null){B=C
}var A=comSvcBaseUrl+"/hd/hd_upload_widget/assets/uploadBoth.jsp?siteName="+D.siteName+"&category="+B+"&timestamp="+I+"&"+G+"&"+K+"&siteSection="+D.siteSection;
HD.util.Common.requestContent(A,function(M){HD.util.Common.showOverlay(M,"Upload","590px","525px");
HD.util.Analytics.track(HD.UploadWidget.prototype.analyticsUploadBothString.call());
if(J!=null){var L=document.getElementById("hdUploadBothForm");
if(L!=null){L.title.value=J[1];
L.story.value=J[2]
}}F.setBothListeners.call(F)
})
},setBothListeners:function(){var B=this;
var A=this.model;
var C=document.getElementById("hdUploadBothForm");
C.onsubmit=function(){var D=C.path.value;
var H=B.getFileExtension.call(B,D);
var F=null;
B.removeErrors(C);
if(B.isSupportedVideoFile(H)){C.type.value="video"
}else{if(B.isSupportedPhotoFile(H)){C.type.value="photo"
}else{C.type.value=""
}}var G=C.category.value;
var E={title:C.title.value,path:C.path.value,story:C.story.value,type:C.type.value,category:G};
ValidationService.validateUpload(E,function(I){if(I.errors.length>0){B.getBothHtml(null,G)
}else{B.startProgress();
A.submitMedium.call(A,C)
}return false
});
return false
};
B.setToggleTerms();
B.setToggleSuggestions()
},setPhotoListeners:function(){var B=this;
var A=this.model;
var C=document.getElementById("hdUploadPhotoForm");
C.onsubmit=function(){B.removeErrors(C);
var D={title:C.title.value,path:C.path.value,story:C.story.value,type:C.type.value,category:C.category.value};
ValidationService.validateUpload(D,function(E){if(E.errors.length>0){B.getPhotoHtml(null)
}else{B.startProgress();
A.submitMedium.call(A,C)
}return false
});
return false
};
B.setToggleTerms();
B.setToggleSuggestions()
},setVideoListeners:function(){var B=this;
var A=this.model;
var C=document.getElementById("hdUploadVideoForm");
C.onsubmit=function(){B.removeErrors(C);
var D={title:C.title.value,path:C.path.value,story:C.story.value,type:C.type.value,category:C.category.value};
ValidationService.validateUpload(D,function(E){if(E.errors.length>0){B.getVideoHtml(null)
}else{B.startProgress();
A.submitMedium.call(A,C)
}return false
});
return false
};
B.setToggleTerms();
B.setToggleSuggestions()
},removeErrors:function(D){var E=HD.get("hdwcErrorOverlayLarge");
if(E){E.parentNode.removeChild(E)
}var B=HD.getByClass("hdwcValidationError","div",D);
for(var C=0,A=B.length;
C<A;
C++){HD.removeClass(B[C],"hdwcValidationError")
}},refreshProgress:function(){var A=this;
UploadMonitor.getUploadInfo(function(B){A.updateProgress.call(A,B);
return false
})
},updateProgress:function(D){if(D.inProgress){try{var B=D.fileIndex;
var A=Math.ceil((D.bytesRead/D.totalSize)*100);
document.getElementById("progressBarText").innerHTML=A+"%";
document.getElementById("progressBarBoxContent").style.width=parseInt(A*3.5)+"px"
}catch(C){}}HD.UploadWidget.progressTimer=window.setTimeout("var uploadJS = new HD.UploadWidget();uploadJS.refreshProgress()",500)
},startProgress:function(){document.getElementById("progressBar").style.display="block";
document.getElementById("progressBarText").innerHTML="0%";
HD.UploadWidget.progressTimer=window.setTimeout("var uploadJS = new HD.UploadWidget();uploadJS.refreshProgress()",500)
},toggleTerms:function(){var A=HD.util.Common.get("termsAndConditions");
var B=HD.util.Common.get("tcSwivel");
if(A.style.display!="block"){YAHOO.util.Dom.setStyle(A,"display","block");
B.innerHTML="v";
document.getElementById("scrollableDiv").scrollTop=400;
if(HD.UploadWidget.prototype.termsAndConditionsString){HD.util.Analytics.track(HD.UploadWidget.prototype.termsAndConditionsString())
}}else{YAHOO.util.Dom.setStyle(A,"display","none");
B.innerHTML="&#62"
}},setToggleTerms:function(){var A=this;
var B=HD.util.Common.get("tcButton");
B.onclick=function(){A.toggleTerms();
return false
}
},toggleSuggestions:function(){var B=HD.util.Common.get("suggestionsAndGuidelines");
var A=HD.util.Common.get("sgSwivel");
if(B.style.display!="block"){B.innerHTML=HD.UploadWidget.templates.getSuggestionsAndGuidelinesText();
YAHOO.util.Dom.setStyle(B,"display","block");
A.innerHTML="v"
}else{YAHOO.util.Dom.setStyle(B,"display","none");
A.innerHTML="&#62"
}},setToggleSuggestions:function(){var A=this;
var B=HD.util.Common.get("sgButton");
if(B){B.onclick=function(){A.toggleSuggestions();
return false
}
}},getFileExtension:function(A){if(A==null){return""
}return A.substring(A.lastIndexOf("."))
},isSupportedVideoFile:function(A){return this.isSupportedType(A,this.supportedVideoTypes)
},isSupportedPhotoFile:function(A){return this.isSupportedType(A,this.supportedPhotoTypes)
},isSupportedType:function(C,D){if(C==null||D==null){return false
}C=C.toLowerCase();
for(var B=0,A=D.length;
B<A;
B++){if(D[B]==C){return true
}}return false
},showError:function(A,B){B=HD.get(B);
B.innerHTML+="<div id='hdwcErrorOverlayLarge'>"+A+"</div>"
},analyticsUploadBothString:function(){return"default_analyticsUploadBothString"
},analyticsUploadPhotoString:function(){return"default_analyticsUploadPhotoString"
},analyticsUploadVideoString:function(){return"default_analyticsUploadVideoString"
},analyticsUploadConfirmationString:function(){return"default_analyticsUploadConfirmationString"
}};
HD.extend(HD.UploadWidget,[HD.Widget]);
HD.register("hd_upload_widget","HD.UploadWidget",{version:"1.0",build:"1"});HD.community.Media=function(A){this.data=A
};
(function(){var A=HD.CSS_CLASSES;
HD.community.Media.hooks={MEDIA_ITEM:A.MEDIA+"-item",MEDIA_RATING_MY:A.MEDIA+"-rating-my",MEDIA_RATING_AVG:A.MEDIA+"-rating-avg",MEDIA_RATING_STAR:A.MEDIA+"-rating-star",MEDIA_RATING_TEXT:A.MEDIA+"-rating-text",MEDIA_CAPTION:A.MEDIA+"-caption",MEDIA_VOTES:A.MEDIA+"-votes",MEDIA_CATEGORY:A.MEDIA+"-category",MEDIA_TAG:A.MEDIA+"-tag",MEDIA_MORE:A.MEDIA+"-more",MEDIA_THUMB:A.MEDIA+"-thumb",MEDIA_THUMB_LG:A.MEDIA+"-thumb-lg",MEDIA_COMMENTS_BTN:A.MEDIA+"-comments-btn",MEDIA_TITLE:A.MEDIA+"-title",MEDIA_AUTHOR:A.MEDIA+"-author",MEDIA_NEXT:A.MEDIA+"-next",MEDIA_PREVIOUS:A.MEDIA+"-previous"}
})();
HD.community.Media.prototype={getHtml:function(A){this.loadTemplates(HD.community.Media.templates,HD.community.Media.hooks,{config:A,templates:"mediaTemplates",hooks:"mediaHooks"});
return this.processTemplate(this.config.templates.getHtml(),{config:A})
},incrementViews:function(){var A=comSvcBaseUrl+"/hd/hd_media/assets/incrementCount.jsp?viewUrl="+this.data.viewUrl;
HD.util.Common.requestContent(A,function(B){})
},updateRating:function(A,B){B.config.numOfVotes=A.numberOfVotes;
B.config.averageRating=A.rating;
B.config.myRating=parseInt(A.currentUserRating);
if(B.config.myRating!=null&&B.config.myRating>0){B.config.isRated=true
}B.render()
},updateRatingWidgets:function(B){var E=this.ratings;
if(E!=null){for(var C=0,A=E.length;
C<A;
C++){var D=E[C];
if(D!=null){this.updateRating(B,D)
}}}},generatePermalink:function(D){var E=this.data;
var G=window.location.href;
D=D||{};
var C=HD.util.Common.getRequestParam("locale");
if(HD.util.Common.hasValue(C)){C="locale="+C+"&"
}else{C=""
}var I="?"+C+"mediaId="+E.mediaId+"&contentType="+E.contentType;
for(var B in D){I+="&"+B+"="+D[B]
}I+="#loc=detail/"+E.contentType+"/"+E.mediaId+"/1";
var A=G.indexOf("?");
var H=G.indexOf("#");
var F=-1;
if(A>-1){F=A
}else{if(H>-1){F=H
}}if(F>-1){G=G.substr(0,F)
}var J=G+I;
return J
}};
HD.extend(HD.community.Media,[HD.util.Template]);
HD.register("hd_media","HD.community.Media",{version:"1.0",build:"1"});HD.community.Blog=function(A){this.data=A;
this.ratings=[]
};
HD.community.Blog.templates={authorLabel:"By ",dateLabel:"Submitted ",tagsLabel:"Tags: ",categoryLabel:"Category: ",moreText:"More",commentsTextFirst:"Add the first comment",commentsText:"Comments ({number})",toTopText:"Back to top",nextLabel:"Next",previousLabel:"Previous",averageVotesText:"Average of ${num_of_votes}&nbsp;ratings:&nbsp;${text_rating}&nbsp;stars",emailText:"Send to a friend",getAuthorLabel:function(){return this.authorLabel
},getDateLabel:function(){return this.dateLabel
},getTagsLabel:function(){return this.tagsLabel
},getCategoryLabel:function(){return this.categoryLabel
},getMoreText:function(){return this.moreText
},getNextLabel:function(){return this.nextLabel
},getPreviousLabel:function(){return this.previousLabel
},getCommentsText:function(A){var B=this.commentsTextFirst;
if(A!=null&&A>0){B=this.commentsText.replace(/\{number\}/,A)
}return B
},getToTopText:function(){return this.toTopText
},getAverageVotesText:function(B,A){return this.averageVotesText.replace(/\$\{num_of_votes\}/,B).replace(/\$\{text_rating\}/,A)
},getEmailText:function(){return this.emailText
},getHtml:function(){return this.html
},getVotesText:function(){return HD.util.StarRating.CSS_CLASSES.NUM_OF_VOTES+" "+HD.community.Blog.hooks.MEDIA_VOTES
},getRatingText:function(){return HD.util.StarRating.CSS_CLASSES.TEXT_RATING+" "+HD.community.Blog.hooks.MEDIA_RATING_TEXT
},html:'		<div class="${classes.ITEM} ${classes.BLOG}{if !blog.previous} ${classes.FIRST}{/if}{if !blog.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">			<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${blog.title|ellipse:config.titleLength || blog.title.length}</div>			{if config.embedBlogDetailNavigation}			<div class="${classes.NAVIGATION}">				<div class="${classes.PREVIOUS} ${hooks.MEDIA_PREVIOUS}">${templates.getPreviousLabel()}</div>				<div class="${classes.NEXT} ${hooks.MEDIA_NEXT}">${templates.getNextLabel()}</div>			</div>			{/if}			<div class="${classes.RATING}">				<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">					<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> 					<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>					(<div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>)				</div>				<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">					<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> 					<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>					<br/><div>						${templates.getAverageVotesText(\'<div class="\'+templates.getVotesText()+\'"></div>\',\'<div class="\'+templates.getRatingText()+\'"></div>\')}					</div>				</div>			</div>			<table class="${classes.WRAPPER}">				<tr>					<td>						<div class="${classes.DATE}">							<div class="${classes.LABEL}">${templates.getDateLabel()}</div>							<div class="${classes.VALUE}">${blog.uploadedDate|date}</div>						</div>					</td>					<td>					{if !blog.hiddenAuthor}						<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">						 	<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>						 	<div class="${classes.VALUE}">${blog.author}</div>						 </div>					{else}						<div/>					{/if}					</td>				</tr>			</table>			<div class="${classes.CATEGORIES}">			{if blog.category}				<div class="${classes.LABEL}">${templates.getCategoryLabel()}</div>				<div class="${classes.VALUE}"><a class="${classes.CATEGORY} ${hooks.MEDIA_CATEGORY}" href="javascript:void(0)">${blog.category}</a></div>			{/if}			</div>			<div class="${classes.TAG_LIST}">			{if hasTags}				<div class="${classes.LABEL}">${templates.getTagsLabel()}</div>				<div class="${classes.VALUE}">				{for tag in blog.tags}{if tag_index > 0}${", "}{/if}<a class="${classes.TAG}{if _MODIFIERS.active(tag)} ${classes.ACTIVE}{/if} ${hooks.MEDIA_TAG}" href="javascript:void(0)">${tag}</a>{/for}				</div>			{/if}			</div>			<div class="${classes.THUMB} ${hooks.MEDIA_THUMB}"></div>			<div class="${classes.DESCRIPTION}">				<div class="${classes.FULL}">${blog.description}</div>				<div class="${classes.SHORT}">${shortDescription}</div>				{if hasMore}					<div class="${classes.MORE} ${hooks.MEDIA_MORE}">${templates.getMoreText()}</div> | 				{/if}				<div class="hdCommentsButton ${hooks.MEDIA_COMMENTS_BTN}">					${templates.getCommentsText(blog.numberOfComments)}				</div>			</div>			{if config.embedShare}				${shareWidget|html}			{/if}			{if config.embedSendFriend}				${sendFriendWidget|html}			{/if}		</div>'};
(function(){HD.community.Blog.hooks=HD.clone(HD.community.Media.hooks)
})();
HD.community.Blog.prototype={getHtml:function(C,B){var F=this.data;
if(F==null){return""
}this.loadTemplates(HD.community.Blog.templates,HD.community.Blog.hooks,{config:C,templates:"blogTemplates",hooks:"blogHooks"});
var E=B.filters&&B.filters.tags?B.filters.tags.slice(0):[];
var D=F.description;
var G=false;
if(HD.util.Common.hasValue(D)){var A=HD.util.Common.stripHtmlTags(D);
if(A.length>C.previewLength){D=HD.util.Common.ellipseText(D,C.previewLength,true);
G=true
}else{D=HD.util.Common.stripHtmlTags(D,true)
}}if(C.embedShare){this.shareWidget=new HD.ShareWidget(HD.merge(C.shareConfig,{embedMode:true}))
}if(C.embedSendFriend){this.sendFriendWidget=new HD.SendFriendWidget(HD.merge(C.sendFriendConfig,{embedMode:true}))
}return this.processTemplate(this.config.templates.getHtml(),{blog:F,config:C,shortDescription:D,hasMore:G,shareWidget:this.shareWidget||null,sendFriendWidget:this.sendFriendWidget||null,hasTags:F.tags&&F.tags.length>0,ratingClasses:HD.util.StarRating.CSS_CLASSES,_MODIFIERS:{active:function(H){var J=false;
for(var I=E.length-1;
I>=0;
I--){if(E[I]==H){J=true;
E.splice(I,1);
break
}}return J
},html:function(H){return H.getHtml(F)
}}})
},destroy:function(){if(this.tooltip){this.tooltip.destroy();
delete this.tooltip
}},setListener:function(L,J){var a=HD.CSS_CLASSES;
var d=HD.util.StarRating.CSS_CLASSES;
var f=this.data;
if(f==null){return""
}var T=this;
var Z=f;
var g=J.config;
var S=function(){J.notifyObservers.call(J,"itemSelected",Z);
J.model.setActiveItem.call(J.model,Z)
};
if(J.config.type=="hd_gallery_widget"){var E=J.config.showMatrix?L:HD.getByClass(this.config.hooks.MEDIA_TITLE,"*",L)[0];
if(E){E.onclick=S
}}var D=HD.getByClass(this.config.hooks.MEDIA_COMMENTS_BTN,"*",L)[0];
if(D){D.onclick=S
}var h=HD.getByClass(this.config.hooks.MEDIA_MORE,"*",L);
if(h.length>0){h[0].onclick=S
}var C=HD.getByClass(this.config.hooks.MEDIA_THUMB,"*",L)[0];
var P=f.description.match(/\<img.+?\>/);
if(C&&f.url.indexOf("videos")>0||f.url.indexOf("VIDEO")>0){var U=new HD.util.Player({parent:C,width:g.playerWidth||400,height:g.playerHeight||300,parentWidget:this,templates:g.playerTemplates||{},hooks:g.playerHooks||{}});
U.view.render({videoUrl:f.url,thumbUrl:f.largeThumbUrl||f.thumbUrl,media:f});
window.playerTest=U
}else{if(C&&P&&P[0]){var N=P[0].match(/src=["'](.+?)["']/);
if(N&&N[1]){var c=new Image();
c.src=N[1];
C.appendChild(c)
}}}if(!!f.category){var b=HD.getByClass(this.config.hooks.MEDIA_CATEGORY,"*",L);
if(b[0]){b[0].onclick=function(){J.model.setCategories([f.category])
}
}}if(f.tags&&f.tags.length>0){var e=HD.getByClass(this.config.hooks.MEDIA_TAG,"*",L);
for(var V=0,X=e.length;
V<X;
V++){(function(){var i=f.tags[V];
e[V].onclick=function(){J.model.setTags([i])
}
})()
}}var B=HD.getByClass(this.config.hooks.MEDIA_RATING_MY,"*",L)[0]||null;
var Y=HD.getByClass(this.config.hooks.MEDIA_RATING_AVG,"*",L)[0]||null;
var M={update:function(i,k){J.model.rateMedia.call(J.model,Z.mediaId,null,k)
}};
if(Y){var Q=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",Y)[0]||null;
var I=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",Y)[0]||null;
var j=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",Y)[0]||null;
var K=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",Y)[0]||null;
if(I){I.onclick=S
}var O=new HD.util.StarRating({captionParent:Q,textRatingParent:j,starRatingParent:I,numOfVotesParent:K,numOfVotes:f.numberOfVotes,averageRating:f.rating,isStatic:true,itemId:f.mediaId,numOfDecimals:1,requiresLogin:g.requiresRatingLogin,showRatingHalves:g.showRatingHalves||false,showYourRatingText:g.showYourRatingText||false});
this.ratings.push(O)
}if(B){var Q=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",B)[0]||null;
var I=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",B)[0]||null;
var j=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",B)[0]||null;
var K=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",B)[0]||null;
var G=new HD.util.StarRating({captionParent:Q,textRatingParent:j,starRatingParent:I,numOfVotesParent:K,numOfVotes:f.numberOfVotes,averageRating:f.rating,isStatic:false,itemId:f.mediaId,numOfDecimals:1,requiresLogin:g.requiresRatingLogin,showRatingHalves:g.showRatingHalves||false,showYourRatingText:g.showYourRatingText||false});
this.ratings.push(G);
G.addObserver(M)
}J.model.addObserver({update:function(i,k){if(i=="rateMedia_Finish"){if(k.mediaId==Z.mediaId){Z.numberOfVotes=k.numberOfVotes;
Z.rating=k.rating;
T.updateRatingWidgets.call(T,k)
}}}});
var H=J.model;
var R=HD.getByClass(this.config.hooks.MEDIA_PREVIOUS,"*",L)[0];
var A=HD.getByClass(this.config.hooks.MEDIA_NEXT,"*",L)[0];
if(R){if(H.hasPreviousItem()){R.onclick=function(){J.view.notifyObservers.call(J.view,"itemChange_Start",f);
H.getPreviousItem.call(H)
}
}else{HD.addClass(R,a.HIDDEN)
}}if(A){if(H.hasNextItem()){A.onclick=function(){J.view.notifyObservers.call(J.view,"itemChange_Start",f);
H.getNextItem.call(H)
}
}else{HD.addClass(A,a.HIDDEN)
}}var W=HD.getByClass(this.config.hooks.MEDIA_AUTHOR,"*",L);
if(W.length>0){var F=W[0];
F.onclick=function(){J.notifyObservers.call(J,"authorSelected",Z);
J.model.getMemberProfile.call(J.model,Z.authorId)
}
}if(J.config.embedShare&&this.shareWidget){this.shareWidget.config.parent=L;
this.shareWidget.setListeners(f)
}if(J.config.embedSendFriend&&this.sendFriendWidget){this.sendFriendWidget.config.parent=L;
this.sendFriendWidget.setListeners(f)
}}};
HD.extend(HD.community.Blog,[HD.community.Media]);
HD.register("hd_blog","HD.community.Blog",{version:"1.0",build:"1"});HD.community.Photo=function(A){this.data=A;
this.ratings=[]
};
HD.community.Photo.templates={authorLabel:"Submitted by: ",dateLabel:"",tagsLabel:"Tags: ",categoryLabel:"Category: ",moreText:"Read the Story",commentsTextFirst:"Comments ({number})",commentsText:"Comments ({number})",nextLabel:"Next",previousLabel:"Previous",averageVotesText:"(Average of ${num_of_votes}&nbsp;ratings:&nbsp;${text_rating}&nbsp;stars)",emailText:"Send to a friend",getAuthorLabel:function(){return this.authorLabel
},getDateLabel:function(){return this.dateLabel
},getTagsLabel:function(){return this.tagsLabel
},getCategoryLabel:function(){return this.categoryLabel
},getMoreText:function(){return this.moreText
},getCommentsText:function(A){var B=this.commentsTextFirst.replace(/\{number\}/,A);
if(A!=null&&A>0){B=this.commentsText.replace(/\{number\}/,A)
}return B
},getNextLabel:function(){return this.nextLabel
},getPreviousLabel:function(){return this.previousLabel
},getAverageVotesText:function(B,A){return this.averageVotesText.replace(/\$\{num_of_votes\}/,B).replace(/\$\{text_rating\}/,A)
},getEmailText:function(){return this.emailText
},getHtml:function(){return this.html
},getVotesText:function(){return HD.util.StarRating.CSS_CLASSES.NUM_OF_VOTES+" "+HD.community.Photo.hooks.MEDIA_VOTES
},getRatingText:function(){return HD.util.StarRating.CSS_CLASSES.TEXT_RATING+" "+HD.community.Photo.hooks.MEDIA_RATING_TEXT
},html:'		<div class="${classes.ITEM} ${classes.PHOTO}{if !photo.previous} ${classes.FIRST}{/if}{if !photo.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">			<div class="${classes.SMALL_THUMB_WRAPPER}">				<div class="${classes.SMALL_THUMB} ${hooks.MEDIA_THUMB}" style="background: transparent url(${photo.thumbUrl}) no-repeat 50% 50%;">					<div class="${classes.THUMB_OVERLAY}"></div>				</div>			</div>			<div class="${classes.LARGE_THUMB_WRAPPER}">				<div class="${classes.LARGE_THUMB}" style="background: transparent url(${photo.url}) no-repeat 50% 50%;"></div>				<div class="${classes.THUMB_OVERLAY}"></div>			</div>			<div class="${classes.LEFT}">				<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${photo.title|ellipse:config.titleLength || photo.title.length}</div>				<div class="${classes.CATEGORIES}">				{if photo.category}					<div class="${classes.LABEL}">${templates.getCategoryLabel()}</div>					<div class="${classes.VALUE}"><a class="${classes.CATEGORY} ${hooks.MEDIA_CATEGORY}" href="javascript:void(0)">${photo.category}</a></div>				{/if}				</div>				<div class="${classes.TAG_LIST}">				{if hasTags}					<div class="${classes.LABEL}">${templates.getTagsLabel()}</div>					<div class="${classes.VALUE}">					{for tag in photo.tags}{if tag_index > 0}${", "}{/if}<a class="${classes.TAG} ${hooks.MEDIA_TAG}" href="javascript:void(0)">${tag}</a>{/for}					</div>				{/if}				</div>				<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">				{if !photo.hiddenAuthor}					<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>					<div class="${classes.VALUE}">${photo.author}</div>				{/if}				</div>				<div class="${classes.DATE}">					<div class="${classes.LABEL}">${templates.getDateLabel()}</div>					<div class="${classes.VALUE}">${photo.uploadedDate|date}</div>				</div>				<div class="${classes.RATING}">					<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">						<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>						<div class="${classes.WRAPPER}">							(<div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>)						</div>					</div>					<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">						<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> 						<div class="${ratingClasses.STAR_RATING}  ${hooks.MEDIA_RATING_STAR}"></div>						<br/><div class="${classes.RATING}Wrapper">							${templates.getAverageVotesText(\'<div class="\'+templates.getVotesText()+\'"></div>\',\'<div class="\'+templates.getRatingText()+\'"></div>\')}						</div>					</div>				</div>			</div>			<div class="${classes.RIGHT}">				<div class="${classes.NAVIGATION}">					<div class="${classes.PREVIOUS} ${hooks.MEDIA_PREVIOUS}">${templates.getPreviousLabel()}</div>					<div class="${classes.NEXT} ${hooks.MEDIA_NEXT}">${templates.getNextLabel()}</div>				</div>				<a class="${classes.COMMENTS}Button ${hooks.MEDIA_COMMENTS_BTN}" id="${commentsButtonId}">${templates.getCommentsText(photo.numberOfComments)}</a>				<div class="${classes.EMAIL}">${templates.getEmailText()}</div>			</div>			<div class="${classes.DESCRIPTION}">				<div>${photo.description}</div>			</div>			{if config.embedShare}				${shareWidget|html}			{/if}			{if config.embedSendFriend}				${sendFriendWidget|html}			{/if}		</div>'};
(function(){HD.community.Photo.hooks=HD.clone(HD.community.Media.hooks)
})();
HD.community.Photo.prototype={getHtml:function(B){var A=this.data;
if(A==null){return""
}this.loadTemplates(HD.community.Photo.templates,HD.community.Photo.hooks,{config:B,templates:"photoTemplates",hooks:"photoHooks"});
this.commentsButtonId=HD.util.Common.generateElementId();
if(B.embedShare){this.shareWidget=new HD.ShareWidget(HD.merge(B.shareConfig,{embedMode:true}))
}if(B.embedSendFriend){this.sendFriendWidget=new HD.SendFriendWidget(HD.merge(B.sendFriendConfig,{embedMode:true}))
}return this.processTemplate(this.config.templates.getHtml(),{photo:A,config:B,shareWidget:this.shareWidget||null,sendFriendWidget:this.sendFriendWidget||null,commentsButtonId:this.commentsButtonId,hasTags:A.tags&&A.tags.length>0,ratingClasses:HD.util.StarRating.CSS_CLASSES,_MODIFIERS:{html:function(C){return C.getHtml(A)
}}})
},destroy:function(){if(this.tooltip){this.tooltip.destroy();
delete this.tooltip
}},setListener:function(X,I){var E=this.data;
if(E==null){return""
}var W=HD.CSS_CLASSES;
var Z=HD.util.StarRating.CSS_CLASSES;
var b=I.config;
var H=b.type.match(/^(hd_gallery_widget|hd_carousel_widget)$/);
if(H){X.onclick=function(){I.notifyObservers.call(I,"itemSelected",E);
I.model.setActiveItem.call(I.model,E)
}
}var O=HD.getByClass(this.config.hooks.MEDIA_THUMB,"*",X);
if(O.length>0){var B=O[0];
if(!H){B.onclick=function(){I.notifyObservers.call(I,"itemSelected",E);
I.model.setActiveItem.call(I.model,E)
}
}if(b.isShowPopups){this.tooltip=new YAHOO.widget.Tooltip(HD.util.Common.generateElementId(),{context:B,text:'<div class="'+HD.CSS_CLASSES.TOOL_TIP+'">'+E.description.substring(0,200)+"</div>",autodismissdelay:60000})
}}var S=this;
I.model.addObserver({update:function(e,f){if(e=="submitComment_Finish"||e=="getComments_Finish"){if(f.mediaId==E.mediaId){S.data=f;
var d=HD.get(S.commentsButtonId);
if(d!=null){d.innerHTML=HD.community.Photo.templates.getCommentsText(f.numberOfComments)
}}}}});
if(!!E.category){var Y=HD.getByClass(this.config.hooks.MEDIA_CATEGORY,"*",X);
if(Y[0]){Y[0].onclick=function(){I.model.setCategories([E.category])
}
}}if(E.tags&&E.tags.length>0){var a=HD.getByClass(this.config.hooks.MEDIA_TAG,"*",X);
for(var T=0,U=a.length;
T<U;
T++){(function(){var d=E.tags[T];
a[T].onclick=function(){I.model.setTags([d])
}
})()
}}var C=HD.getByClass(this.config.hooks.MEDIA_RATING_MY,"*",X)[0]||null;
var V=HD.getByClass(this.config.hooks.MEDIA_RATING_AVG,"*",X)[0]||null;
var K={update:function(d,e){I.model.rateMedia.call(I.model,E.mediaId,E.contentType,e)
}};
var M=E.currentUserRating>0;
var P=null;
if(M){P=parseInt(E.currentUserRating)
}if(V){var N=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",V)[0]||null;
var G=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",V)[0]||null;
var c=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",V)[0]||null;
var J=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",V)[0]||null;
var L=new HD.util.StarRating({captionParent:N,textRatingParent:c,starRatingParent:G,numOfVotesParent:J,numOfVotes:E.numberOfVotes,averageRating:E.rating,isStatic:true,itemId:E.mediaId,myRating:P,isRated:M,numOfDecimals:1,requiresLogin:b.requiresRatingLogin,showRatingHalves:b.showRatingHalves||false,showYourRatingText:b.showYourRatingText||false});
this.ratings.push(L)
}if(C){var N=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",C)[0]||null;
var G=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",C)[0]||null;
var c=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",C)[0]||null;
var J=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",C)[0]||null;
var D=new HD.util.StarRating({captionParent:N,textRatingParent:c,starRatingParent:G,numOfVotesParent:J,numOfVotes:E.numberOfVotes,averageRating:E.rating,isStatic:false,itemId:E.mediaId,myRating:P,isRated:M,numOfDecimals:1,requiresLogin:b.requiresRatingLogin,showRatingHalves:b.showRatingHalves||false,showYourRatingText:b.showYourRatingText||false});
this.ratings.push(D);
D.addObserver(K)
}I.model.addObserver({update:function(d,e){if(d=="rateMedia_Finish"){if(e.mediaId==E.mediaId){E.numberOfVotes=e.numberOfVotes;
E.rating=e.rating;
S.updateRatingWidgets.call(S,e)
}}}});
var F=I.model;
var Q=HD.getByClass(this.config.hooks.MEDIA_PREVIOUS,"*",X)[0];
var A=HD.getByClass(this.config.hooks.MEDIA_NEXT,"*",X)[0];
if(Q){if(F.hasPreviousItem()){Q.onclick=function(){I.view.notifyObservers.call(I.view,"itemChange_Start",E);
F.getPreviousItem.call(F)
}
}else{HD.addClass(Q,W.HIDDEN)
}}if(A){if(F.hasNextItem()){A.onclick=function(){I.view.notifyObservers.call(I.view,"itemChange_Start",E);
F.getNextItem.call(F)
}
}else{HD.addClass(A,W.HIDDEN)
}}var R=HD.get(S.commentsButtonId);
if(R){R.onclick=function(){var d=HD.get("commentsDiv");
if(d!=null){HD.util.Common.scrollTo(d)
}}
}if(I.config.embedShare&&this.shareWidget){this.shareWidget.config.parent=X;
this.shareWidget.setListeners(E)
}if(I.config.embedSendFriend&&this.sendFriendWidget){this.sendFriendWidget.config.parent=X;
this.sendFriendWidget.setListeners(E)
}}};
HD.extend(HD.community.Photo,[HD.community.Media]);
HD.register("hd_photo","HD.community.Photo",{version:"1.0",build:"1"});HD.community.Video=function(A){this.data=A;
this.ratings=[]
};
HD.community.Video.templates={authorLabel:"Submitted by: ",dateLabel:"",tagsLabel:"Tags: ",categoryLabel:"Category: ",moreText:"Watch Video",commentsTextFirst:"Comments ({number})",commentsText:"Comments (${number})",nextLabel:"Next",previousLabel:"Previous",averageVotesText:"(Average of ${num_of_votes}&nbsp;ratings:&nbsp;${text_rating}&nbsp;stars)",emailText:"Send to a friend",getAuthorLabel:function(){return this.authorLabel
},getDateLabel:function(){return this.dateLabel
},getTagsLabel:function(){return this.tagsLabel
},getCategoryLabel:function(){return this.categoryLabel
},getMoreText:function(){return this.moreText
},getCommentsText:function(A){var B=this.commentsTextFirst.replace(/\{number\}/,A);
if(A!=null&&A>0){B=this.commentsText.replace(/\{number\}/,A)
}return B
},getNextLabel:function(){return this.nextLabel
},getPreviousLabel:function(){return this.previousLabel
},getAverageVotesText:function(B,A){return this.averageVotesText.replace(/\$\{num_of_votes\}/,B).replace(/\$\{text_rating\}/,A)
},getEmailText:function(){return this.emailText
},getHtml:function(){return this.html
},getVotesText:function(){return HD.util.StarRating.CSS_CLASSES.NUM_OF_VOTES+" "+HD.community.Video.hooks.MEDIA_VOTES
},getRatingText:function(){return HD.util.StarRating.CSS_CLASSES.TEXT_RATING+" "+HD.community.Video.hooks.MEDIA_RATING_TEXT
},html:'		<div class="${classes.ITEM} ${classes.VIDEO}{if !video.previous} ${classes.FIRST}{/if}{if !video.next} ${classes.LAST}{/if} ${hooks.MEDIA_ITEM}">			<div class="${classes.SMALL_THUMB_WRAPPER}">				<div class="${classes.SMALL_THUMB} ${hooks.MEDIA_THUMB}" style="background: transparent url(${video.thumbUrl}) no-repeat 50% 50%;">					<div class="${classes.THUMB_OVERLAY}"></div>				</div>			</div>			<div class="${classes.LARGE_THUMB_WRAPPER}">				<div class="${classes.LARGE_THUMB} ${hooks.MEDIA_THUMB_LG}"></div>			</div>			<div class="${classes.LEFT}">				<div class="${classes.TITLE} ${hooks.MEDIA_TITLE}">${video.title|ellipse:config.titleLength || video.title.length}</div>				<div class="${classes.CATEGORIES}">				{if video.category}					<div class="${classes.LABEL}">${templates.getCategoryLabel()}</div>					<div class="${classes.VALUE}"><a class="${classes.CATEGORY} ${hooks.MEDIA_CATEGORY}" href="javascript:void(0)">${video.category}</a></div>				{/if}				</div>				<div class="${classes.TAG_LIST}">				{if hasTags}					<div class="${classes.LABEL}">${templates.getTagsLabel()}</div>					<div class="${classes.VALUE}">					{for tag in video.tags}{if tag_index > 0}${", "}{/if}<a class="${classes.TAG} ${hooks.MEDIA_TAG}" href="javascript:void(0)">${tag}</a>{/for}					</div>				{/if}				</div>				<div class="${classes.AUTHOR} ${hooks.MEDIA_AUTHOR}">				{if !video.hiddenAuthor}					<div class="${classes.LABEL}">${templates.getAuthorLabel()}</div>					<div class="${classes.VALUE}">${video.author}</div>				{/if}				</div>				<div class="${classes.DATE}">					<div class="${classes.LABEL}">${templates.getDateLabel()}</div>					<div class="${classes.VALUE}">${video.uploadedDate|date}</div>				</div>				<div class="${classes.RATING}">					<div class="${ratingClasses.AVERAGE_RATING} ${hooks.MEDIA_RATING_AVG}">						<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>						<div class="${classes.WRAPPER}">							(<div class="${ratingClasses.NUM_OF_VOTES} ${hooks.MEDIA_VOTES}"></div>)						</div>					</div>					<div class="${ratingClasses.MY_RATING} ${hooks.MEDIA_RATING_MY}">						<div class="${ratingClasses.CAPTION} ${hooks.MEDIA_CAPTION}"></div> 						<div class="${ratingClasses.STAR_RATING} ${hooks.MEDIA_RATING_STAR}"></div>						<br/><div class="${classes.RATING}Wrapper">							${templates.getAverageVotesText(\'<div class="\'+templates.getVotesText()+\'"></div>\',\'<div class="\'+templates.getRatingText()+\'"></div>\')}						</div>					</div>				</div>			</div>			<div class="${classes.RIGHT}">				<div class="${classes.NAVIGATION}">					<div class="${classes.PREVIOUS} ${hooks.MEDIA_PREVIOUS}">${templates.getPreviousLabel()}</div>					<div class="${classes.NEXT} ${hooks.MEDIA_NEXT}">${templates.getNextLabel()}</div>				</div>				<a class="${classes.COMMENTS}Button ${hooks.MEDIA_COMMENTS_BTN}" id="${commentsButtonId}">${templates.getCommentsText(video.numberOfComments)}</a>				<div class="${classes.EMAIL}">${templates.getEmailText()}</div>			</div>			<div class="${classes.DESCRIPTION}">				<div>${video.description}</div>			</div>			{if config.embedShare}				${shareWidget|html}			{/if}			{if config.embedSendFriend}				${sendFriendWidget|html}			{/if}		</div>'};
(function(){HD.community.Video.hooks=HD.clone(HD.community.Media.hooks)
})();
HD.community.Video.prototype={getHtml:function(A){var B=this.data;
if(B==null){return""
}this.loadTemplates(HD.community.Video.templates,HD.community.Video.hooks,{config:A,templates:"videoTemplates",hooks:"videoHooks"});
this.commentsButtonId=HD.util.Common.generateElementId();
if(A.embedShare){this.shareWidget=new HD.ShareWidget(HD.merge(A.shareConfig,{embedMode:true}))
}if(A.embedSendFriend){this.sendFriendWidget=new HD.SendFriendWidget(HD.merge(A.sendFriendConfig,{embedMode:true}))
}return this.processTemplate(this.config.templates.getHtml(),{video:B,config:A,shareWidget:this.shareWidget||null,sendFriendWidget:this.sendFriendWidget||null,commentsButtonId:this.commentsButtonId,hasTags:B.tags&&B.tags.length>0,ratingClasses:HD.util.StarRating.CSS_CLASSES,_MODIFIERS:{html:function(C){return C.getHtml(B)
}}})
},destroy:function(){if(this.tooltip){this.tooltip.destroy();
delete this.tooltip
}},setListener:function(B,H){var X=this.data;
if(X==null){return""
}var Z=HD.CSS_CLASSES;
var b=HD.util.StarRating.CSS_CLASSES;
var d=H.config;
var G=d.type.match(/^(hd_gallery_widget|hd_carousel_widget)$/);
var N=HD.getByClass(this.config.hooks.MEDIA_THUMB,"*",B)[0];
if(G){B.onclick=function(){H.notifyObservers.call(H,"itemSelected",X);
H.model.setActiveItem.call(H.model,X)
}
}else{if(N){N.onclick=function(){H.notifyObservers.call(H,"itemSelected",X);
H.model.setActiveItem.call(H.model,X)
}
}}if(d.isShowPopups){this.tooltip=new YAHOO.widget.Tooltip(HD.util.Common.generateElementId(),{context:N,text:'<div class="'+HD.CSS_CLASSES.TOOL_TIP+'">'+X.description.substring(0,200)+"</div>",autodismissdelay:60000})
}var P=HD.getByClass(this.config.hooks.MEDIA_THUMB_LG,"*",B)[0];
if(P){var U=new HD.util.Player({parent:P,width:d.playerWidth||400,height:d.playerHeight||300,parentWidget:this,templates:d.playerTemplates||{},hooks:d.playerHooks||{}});
var J=X.viewUrl;
U.view.render({videoUrl:J,thumbUrl:X.largeThumbUrl||X.thumbUrl,media:X})
}var T=this;
H.model.addObserver({update:function(g,h){if(g=="submitComment_Finish"||g=="getComments_Finish"){if(h.mediaId==X.mediaId){T.data=h;
var f=HD.get(T.commentsButtonId);
if(f!=null){f.innerHTML=HD.community.Video.templates.getCommentsText(h.numberOfComments)
}}}}});
if(!!X.category){var a=HD.getByClass(this.config.hooks.MEDIA_CATEGORY,"*",B);
if(a[0]){a[0].onclick=function(){H.model.setCategories([X.category])
}
}}if(X.tags&&X.tags.length>0){var c=HD.getByClass(this.config.hooks.MEDIA_TAG,"*",B);
for(var V=0,W=c.length;
V<W;
V++){(function(){var f=X.tags[V];
c[V].onclick=function(){H.model.setTags([f])
}
})()
}}var C=HD.getByClass(this.config.hooks.MEDIA_RATING_MY,"*",B)[0]||null;
var Y=HD.getByClass(this.config.hooks.MEDIA_RATING_AVG,"*",B)[0]||null;
var K={update:function(f,g){H.model.rateMedia.call(H.model,X.mediaId,X.contentType,g)
}};
var M=X.currentUserRating>0;
var Q=null;
if(M){Q=parseInt(X.currentUserRating)
}if(Y){var O=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",Y)[0]||null;
var F=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",Y)[0]||null;
var e=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",Y)[0]||null;
var I=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",Y)[0]||null;
var L=new HD.util.StarRating({captionParent:O,textRatingParent:e,starRatingParent:F,numOfVotesParent:I,numOfVotes:X.numberOfVotes,averageRating:X.rating,isStatic:true,itemId:X.mediaId,myRating:Q,isRated:M,numOfDecimals:1,requiresLogin:d.requiresRatingLogin,showRatingHalves:d.showRatingHalves||false,showYourRatingText:d.showYourRatingText||false});
this.ratings.push(L)
}if(C){var O=HD.getByClass(this.config.hooks.MEDIA_CAPTION,"*",C)[0]||null;
var F=HD.getByClass(this.config.hooks.MEDIA_RATING_STAR,"*",C)[0]||null;
var e=HD.getByClass(this.config.hooks.MEDIA_RATING_TEXT,"*",C)[0]||null;
var I=HD.getByClass(this.config.hooks.MEDIA_VOTES,"*",C)[0]||null;
var D=new HD.util.StarRating({captionParent:O,textRatingParent:e,starRatingParent:F,numOfVotesParent:I,numOfVotes:X.numberOfVotes,averageRating:X.rating,isStatic:false,itemId:X.mediaId,myRating:Q,isRated:M,numOfDecimals:1,requiresLogin:d.requiresRatingLogin,showRatingHalves:d.showRatingHalves||false,showYourRatingText:d.showYourRatingText||false});
this.ratings.push(D);
D.addObserver(K)
}H.model.addObserver({update:function(f,g){if(f=="rateMedia_Finish"){if(g.mediaId==X.mediaId){X.numberOfVotes=g.numberOfVotes;
X.rating=g.rating;
T.updateRatingWidgets.call(T,g)
}}}});
var E=H.model;
var R=HD.getByClass(this.config.hooks.MEDIA_PREVIOUS,"*",B)[0];
var A=HD.getByClass(this.config.hooks.MEDIA_NEXT,"*",B)[0];
if(R){if(E.hasPreviousItem()){R.onclick=function(){H.view.notifyObservers.call(H.view,"itemChange_Start",X);
E.getPreviousItem.call(E)
}
}else{HD.addClass(R,Z.HIDDEN)
}}if(A){if(E.hasNextItem()){A.onclick=function(){H.view.notifyObservers.call(H.view,"itemChange_Start",X);
E.getNextItem.call(E)
}
}else{HD.addClass(A,Z.HIDDEN)
}}var S=HD.get(T.commentsButtonId);
if(S){S.onclick=function(){var f=HD.get("commentsDiv");
if(f!=null){HD.util.Common.scrollTo(f)
}}
}if(H.config.embedShare&&this.shareWidget){this.shareWidget.config.parent=B;
this.shareWidget.setListeners(X)
}if(H.config.embedSendFriend&&this.sendFriendWidget){this.sendFriendWidget.config.parent=B;
this.sendFriendWidget.setListeners(X)
}}};
HD.extend(HD.community.Video,[HD.community.Media]);
HD.register("hd_video","HD.community.Video",{version:"1.0",build:"1"});HD.util.RSS={_injectValue:function(A,C,B){if(!A[C]){A[C]=[]
}A[C].push(B)
},_parseNode:function(D){var C={};
for(var B=0,A=D.childNodes.length;
B<A;
B++){var F=D.childNodes[B].nodeName.replace(/[:]/g,"__");
if(F!="#text"&&D.childNodes[B].childNodes.length>0){this._injectValue(C,F,this._parseNode(D.childNodes[B]))
}else{if(F=="#text"){var E=null;
if(typeof D.childNodes[B].textContent!="undefined"){E=D.childNodes[B].textContent||null
}else{E=D.childNodes[B].nodeValue||null
}return E
}else{this._injectValue(C,F,D.childNodes[B].textContent||null)
}}}return C
},_parseFeed:function(E,F){var D={channel:[]};
var A=E.responseXML.getElementsByTagName("channel");
for(var C=0,B=A.length;
C<B;
C++){this._injectValue(D,"channel",this._parseNode(A[C]))
}F(D)
},getFeed:function(B,C,D){var A=this;
YAHOO.util.Connect.asyncRequest("GET",comSvcBaseUrl+"/hd/hd_rss/assets/proxy.jsp?feed="+B+"&params="+C,{success:function(E){A._parseFeed(E,D)
},failure:function(E){D(false)
}})
},getRidePlannerFeed:function(A,B){this.getFeed("rideplanner",A,B)
}};
HD.register("hd_rss",HD.util.RSS,{version:"1.0",build:"1"});if(typeof _hbPageView=="undefined"||!_hbPageView){function _hbPageView(){}}if(typeof HDSocial=="undefined"||!HDSocial){var HDSocial={hasAnalytics:function(){return !!HD&&!!HD.util&&!!HD.util.Analytics
},pageLink:function(D,A,C,B){var E=window.open(D,A,C);
if(!E){HDSocial.getSwf(B).openWindowFromSwf(D)
}else{E.focus()
}},getSwf:function(A){if(navigator.appName.indexOf("Microsoft")!=-1){return window[A]
}else{return document[A]
}},hdSocialShare:function(E,C,G,B,H,F,A,D){switch(E){case"facebook":HDSocial.hdFbShare(C,G,F,A,D);
break;
case"myspace":HDSocial.hdMSShare(C,G,B,H,F,A,D);
break;
case"digg":HDSocial.hdDiggShare(C,G,B,F,A,D);
break;
case"wordpress":case"blogger":HDSocial.hdBlogShare(C,G,B,H,F,A,E,D);
break
}},hdFbShare:function(B,F,G,C,A){var H=B;
var I=F;
var D="http://www.facebook.com/sharer.php?u="+encodeURIComponent(H)+"&t="+encodeURIComponent(I);
var E="toolbar=0,status=0,width=626,height=436";
HDSocial.pageLink(D,"Facebook",E,C);
if(this.hasAnalytics()){HD.util.Analytics.track(this.analyticsFacebookString(A))
}else{_hbPageView("Facebook",G)
}},hdMSShare:function(V,W,M,H,G,P,E){var J="0";
var D=V;
var N="_blank";
var I="8";
var S=W;
var R="left";
var L=H;
var O="<a href="+D+"  target="+N+"><img src="+L+" align="+R+" alt="+S+" hspace="+I+" border="+J+"/></a>";
var B=W;
var K=O+M+"<br/>Check it out at <a href='"+D+"' target='"+N+"'>"+B+"</a>";
var A="";
var Q="http://www.myspace.com/index.cfm?fuseaction=postto&t="+encodeURIComponent(B)+"&c="+encodeURIComponent(K)+"&u="+encodeURIComponent(A);
var F="width=1024,height=768,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no";
HDSocial.pageLink(Q,"MySpace",F,P);
if(this.hasAnalytics()){HD.util.Analytics.track(this.analyticsMyspaceString(E))
}else{_hbPageView("MySpace",G)
}},hdDiggShare:function(E,H,D,G,B,F){var A="http://digg.com/submit/?url="+E+"&title="+H+"&bodytext="+D;
var C="width=1024,height=768,scrollbars=yes,resizable=yes,toolbar=no,location=no,menubar=no,directories=no,status=no";
HDSocial.pageLink(A,"Digg",C,B);
if(this.hasAnalytics()){HD.util.Analytics.track(this.analyticsDiggString(F))
}else{_hbPageView("Digg",G)
}},hdBlogShare:function(Q,R,J,F,E,M,P,D){var H="0";
var C=Q;
var L="_blank";
var G="8";
var O=R.replace(/['"]/g,"");
var N="left";
var I=F;
var A="";
var B=R;
var K='<div id="HDSocialBlogPost">';
K+='<div class="dblRuleBtm">';
K+='  <div class="head">POST TO YOUR BLOG</div>';
K+="</div>";
K+='<div class="hdwcMedPadBtm">';
K+='<div id="hdwcInstructions">Copy and paste the embed code below and post it to your blog:</div>';
K+="</div>";
K+='<div id="hdwcBody" class="wrap">';
K+='<div class="htmlEmbedCode hdwcSmlPadBtm">';
K+="	<h2>Embed Code</h2>";
K+='  <textarea name="copyText" id="copyText" >';
K+='<a href="'+C+'"  target="'+L+'"><img src="'+I+'" align="'+N+'" alt="'+O+'" hspace="'+G+'" border="'+H+'"/></a>';
K+=J+'<br/>Check it out at <a href="'+C+'" target="'+L+'">'+B+"</a>";
K+="</textarea>";
K+="</div>";
K+='<div class="btnOrange"><a href="javascript: void(0);" id="hdSocial-closebtn">Close</a></div>';
K+="</div>";
K+="</div>";
HDSocial.showOverlay(K,B,586,254,false);
if(this.hasAnalytics()){if(P=="wordpress"){HD.util.Analytics.track(this.analyticsWordpressString(D))
}else{if(P=="blogger"){HD.util.Analytics.track(this.analyticsBloggerString(D))
}}}else{_hbPageView(P||"Blog",E)
}},showOverlay:function(K,N,D,O,G){var I=YAHOO.util.Dom.get("hdwcOverlay");
if(I){this.hideOverlay()
}var B=540>YAHOO.util.Dom.getViewportHeight()&&parseInt(O,10)>450;
if(B){O=YAHOO.util.Dom.getViewportHeight()-40
}var C=(YAHOO.util.Dom.getViewportWidth()/2)-(D/2);
var J=YAHOO.util.Dom.getDocumentScrollTop();
var A=((YAHOO.util.Dom.getViewportHeight()+J)/2)-(O/2);
C=Math.round(C);
A=Math.round(A);
var E={constraintoviewport:true,close:true,draggable:true,zindex:100000,modal:true,visible:false,iframe:true,underlay:"shadow",x:C,y:A,height:typeof O=="number"?O+"px":O||null,width:typeof D=="number"?D+"px":D||null};
if(G==true){K="<iframe class='hdwcOverlayIframe' src='"+K+"' frameBorder='0' height='"+O+"' width='"+D+"' scrolling='no' allowTransparency='true'></iframe>"
}var F=new YAHOO.widget.Panel("hdwcOverlay",E);
F.setBody(K);
F.render(document.body);
F.show();
if(YAHOO.env.ua.ie>0){YAHOO.util.Dom.setStyle("hdwcOverlay_c","top",A);
YAHOO.util.Dom.setStyle("hdwcOverlay_c","left",C)
}var M=function(){HDSocial.hideOverlay()
};
var P=YAHOO.util.Dom.getElementsByClassName("container-close","a",I);
P.push(document.getElementById("hdSocial-closebtn"));
for(var H=0,L=P.length;
H<L;
H++){(function(){P[H].onclick=M
})()
}if(B){YAHOO.util.Event.onContentReady("hdwcBody",function(){var R=YAHOO.util.Dom.get("hdwcBody");
var Q=YAHOO.util.Dom.get("scrollableDiv");
if(R){R.style.height=(parseInt(O,10)-65)+"px"
}if(Q){Q.style.height=(parseInt(O,10)-90)+"px"
}})
}this.overlay=F;
return I
},hideOverlay:function(){if(this.overlay!=null){this.overlay.hide();
this.overlay.destroy()
}},analyticsFacebookString:function(){return"default_analyticsFacebookString"
},analyticsMyspaceString:function(){return"default_analyticsMyspaceString"
},analyticsBloggerString:function(){return"default_analyticsBloggerString"
},analyticsWordpressString:function(){return"default_analyticsWordpressString"
},analyticsDiggString:function(){return"default_analyticsDiggString"
}}
};HD.util.Queue=function(){this.items=[]
};
HD.util.Queue.prototype={add:function(A){this.items.push(A)
},remove:function(E){var B=[];
var C=this.items;
for(var D=0,A=C.length;
D<A;
D++){var F=C[D];
if(F!=E){B.push(F)
}}this.items=B
},execute:function(){var A=this.items;
for(var B=A.length-1;
B>-1;
B--){A[B]()
}this.clear()
},clear:function(){this.items=[]
},contains:function(D){var B=this.items;
for(var C=0,A=B.length;
C<A;
C++){var E=B[C];
if(E==D){return true
}}return false
}};
HD.register("hd_queue",HD.util.Queue,{version:"1.0",build:"1"});HD.AuthorWidget=function(A){this.config=A;
this.config.renderMode=this.config.renderMode||"list"||"select";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.AuthorWidget.templates={defaultSelectLabel:"By author",getDefaultSelectLabel:function(){return this.defaultSelectLabel
},getHtml:function(){return this.html
},html:'		<div class="${classes.AUTHOR_BREAKDOWN} ${classes.WIDGET}">		{if config.renderMode == "list"}			{for item in items}				{if item }					<div>						<span class="${classes.TITLE} ${classes.CONTROL} ${hooks.ITEM}">${item.userName}</span>						<span class="${classes.VALUE}"> (${item.itemCount})</span>					</div>				{/if}			{/for}		{elseif config.renderMode == "select"}			<select class="${hooks.LIST}">			<option class="${hooks.ITEM}" value="" selected="selected">${templates.getDefaultSelectLabel()}</option>			{for item in items}				{if item}					<option class="${hooks.ITEM}" value="${item.userName}">${item.userName}</option>				{/if}			{/for}			</select>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.AuthorWidget.hooks={ITEM:A.ITEM,LIST:A.LIST}
})();
HD.AuthorWidget.prototype={setListeners:function(F){var C=this.getParent();
var G=F;
if(this.config.renderMode=="list"){var B=HD.getByClass(this.config.hooks.ITEM,"*",C);
var E=0;
for(var D in G){if(B[E]){this.setListener(B[E],D)
}E++
}}else{if(this.config.renderMode=="select"){var A=this;
HD.getByClass(this.config.hooks.LIST,"*",C,function(H){H.onchange=function(){var I=H.options[H.selectedIndex].value;
if(I!=""){A.model.setAuthor.call(A.model,F[I])
}}
})
}}},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
if(D!=""){C.onclick=function(){var E=B;
A.model.setAuthor.call(A.model,E)
}
}},update:function(A,B){if(A=="getAllBlogAuthors_Finish"){this.loading(false);
this.render(B)
}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{items:(A)||[]})
}};
HD.extend(HD.AuthorWidget,[HD.Widget]);
HD.register("hd_author_widget","HD.AuthorWidget",{version:"1.0",build:"1"});HD.ContextWidget=function(A){this.config=A;
this.config.dateFormat=this.config.dateFormat||"mmm yyyy";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.ContextWidget.templates={defaultText:"Blog",tagsText:"Posts tagged ${filter}",authorText:"Posts by ${filter}",dateText:"Posts from ${filter}",backText:"&#60;&#60; Blog",getBackText:function(){return this.backText
},getContextText:function(B,A){if(B.tags!=null&&B.tags.length>0){return this.tagsText.replace(/\$\{filter\}/,B.tags[0])
}else{if(B.author!=null&&B.author.length>0){return this.authorText.replace(/\$\{filter\}/,B.author)
}else{if(B.startDate!=null){return this.dateText.replace(/\$\{filter\}/,HD.util.Date.format(B.startDate,A))
}else{return this.defaultText
}}}},getHtml:function(){return this.html
},html:'		{if data}			<div class="${classes.CONTEXT} ${classes.WIDGET}">				{if filters.tags != null || filters.author != null || filters.startDate != null}					<div class="${classes.BACK} ${hooks.BACK}">					<h2><a href="javascript: void(0);">${templates.getBackText(filters, dateFormat)}</a></h2>					</div>				{/if}				<div class="${classes.TITLE}">				<h1>${templates.getContextText(filters, dateFormat)}</h1>				</div>			</div>		{/if}'};
(function(){var A=HD.CSS_CLASSES;
HD.ContextWidget.hooks={BACK:A.BACK+"-context"}
})();
HD.ContextWidget.prototype={setListeners:function(C){var D=HD.getByClass(this.config.hooks.BACK,"*",this.getParent())[0];
if(D){var A=this.model;
var B=this;
D.onclick=function(){A.clearDateRange(true);
A.clearAuthor(true);
A.clearTags()
}
}},update:function(A,B){if(A=="getMedia_Start"){this.loading(true)
}else{if(A=="getMedia_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){this.filters=this.model.filters;
this.dateFormat=this.config.dateFormat;
return this.processTemplate(this.config.templates.getHtml(),{data:A,filters:this.filters,dateFormat:this.dateFormat})
},analyticsString:function(A){return"default_analyticsDetailString"
}};
HD.extend(HD.ContextWidget,[HD.Widget]);
HD.register("hd_context_widget","HD.ContextWidget",{version:"1.0",build:"1"});HD.FacebookAttendeesWidget=function(A){this.config=A;
this.config.dateFormat=this.config.dateFormat||"d mmm yyyy 'at' hh:MM tt";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.FacebookAttendeesWidget.templates={getHtml:function(){return this.html
},html:'		<div class="${classes.FACEBOOK_ATTENDEES} ${classes.WIDGET}">		{for attendee in attendees}			<div class="${classes.ITEM}">				<div class="${classes.SMALL_THUMB}">				  <img src=${attendee.pic_small} >				</div>				<div class="${classes.THUMB}">				  <img src=${attendee.pic} >				</div>				<div class="${classes.LARGE_THUMB}">				  <img src=${attendee.pic_big} >				</div>				<div class="${classes.TITLE}">					${attendee.name}				</div>			</div>			<div class="${classes.SEPARATOR}"></div>		{/for}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.FacebookAttendeesWidget.hooks={EVENT:A.EVENT}
})();
HD.FacebookAttendeesWidget.prototype={setListeners:function(D){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.EVENT,"*",C)
},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
C.onclick=function(){A.model.setActiveItem.call(A.model,B);
A.notifyObservers.call(A,"itemSelected",B)
}
},update:function(A,B){if(A=="getFacebookAttendeesForEvent_Start"){this.loading(true)
}else{if(A=="getFacebookAttendeesForEvent_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{attendees:(A)||[]})
}};
HD.extend(HD.FacebookAttendeesWidget,[HD.Widget]);
HD.register("hd_facebook_attendees_widget","HD.FacebookAttendeesWidget",{version:"1.0",build:"1"});HD.FacebookEventsWidget=function(A){this.config=A;
this.config.dateFormat=this.config.dateFormat||"d mmm yyyy 'at' hh:MM tt";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.FacebookEventsWidget.templates={rsvpText:"RSVP",hostLabel:"HOSTED BY:",noneLabel:"No Events at this Time",typeLabel:"TYPE:",whereLabel:"WHERE:",whenLabel:"WHEN:",facebookURL:"http://www.facebook.com/darkcustom?v=app_2344061033&viewas=500036834",facebookLinkText:'<a href="${facebookURL}" target="_blank">See more events on our Facebook page</a>',getFacebookLinkText:function(){return this.facebookLinkText.replace(/\$\{facebookURL\}/,this.getFacebookURL())
},getRsvpText:function(){return this.rsvpText
},getHostLabel:function(){return this.hostLabel
},getNoneLabel:function(){return this.noneLabel
},getTypeLabel:function(){return this.typeLabel
},getWhereLabel:function(){return this.whereLabel
},getWhenLabel:function(){return this.whenLabel
},getFacebookURL:function(){return this.facebookURL
},getFacebookTime:function(B){var F="";
if(B){var E=B.getUTCFullYear();
var C=B.getUTCDate();
var G=B.getUTCMonth();
var A=B.getUTCHours();
var D=B.getUTCMinutes();
F=new Date();
F.setFullYear(E,G,C);
F.setHours(A,D,0,0)
}return F
},getHtml:function(){return this.html
},html:'		<div class="${classes.FACEBOOK_EVENTS} ${classes.WIDGET}">		{if events.length == 0}			<div class="${classes.TITLE}">				${templates.getNoneLabel()}			</div>		{else}			{for event in events}				<div class="${classes.ITEM}">					<div class="${classes.SMALL_THUMB}">					  {if event.pic != ""}						<img src="${event.pic}">					  {/if}				    </div>				    <div class="${classes.EVENT_RSVP}"><a href="${event.eventLink}" target="_blank">${templates.getRsvpText()}</a></div>				    <div class="${classes.DETAIL}">					<div class="${classes.TITLE}">						<a href="${event.eventLink}" target="_blank">${event.name}</a>					</div>					<div class="${classes.DESCRIPTION}">						${event.tagline}					</div>					<div class="${classes.AUTHOR}">						<div class="${classes.LABEL}">${templates.getHostLabel()}</div>						<div class="${classes.VALUE}">${event.host}</div>					</div>					<div class="hdType">						<div class="${classes.LABEL}">${templates.getTypeLabel()}</div>						<div class="${classes.VALUE}">${event.eventType}</div>					</div>					<div class="hdLocation">						<div class="${classes.LABEL}">${templates.getWhereLabel()}</div>						<div class="${classes.VALUE}">${event.location}</div>					</div>					<div class="hdDate">						<div class="${classes.LABEL}">${templates.getWhenLabel()}</div>						<div class="${classes.VALUE}">${templates.getFacebookTime(event.startTime)|date} until ${templates.getFacebookTime(event.endTime)|date}</div>					</div>				</div>				<div class="${classes.SEPARATOR}"></div>			</div>			{/for}			<div class="${classes.VIEW_ALL}">${templates.getFacebookLinkText()}</div>		{/if}		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.FacebookEventsWidget.hooks={EVENT:A.EVENT}
})();
HD.FacebookEventsWidget.prototype={setListeners:function(D){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.EVENT,"*",C)
},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
C.onclick=function(){A.model.setActiveItem.call(A.model,B);
A.notifyObservers.call(A,"itemSelected",B)
}
},update:function(A,B){if((A=="getFacebookEvents_Start")||(A=="getFutureFacebookEvents_Start")){this.loading(true)
}else{if((A=="getFacebookEvents_Finish")||(A=="getFutureFacebookEvents_Finish")){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{events:(A)||[]})
}};
HD.extend(HD.FacebookEventsWidget,[HD.Widget]);
HD.register("hd_facebook_events_widget","HD.FacebookEventsWidget",{version:"1.0",build:"1"});HD.TwitterFeedWidget=function(A){this.config=A;
this.config.dateFormat=this.config.dateFormat||"d mmm yyyy 'at' hh:MM tt";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.TwitterFeedWidget.templates={twitterLabel:"TWEETS @ DARKCUSTOM",twitterViewText:"VIEW",twitterReplyText:"REPLY",twitterReTweetText:"RT",twitterViewURL:"http://twitter.com/${tweetAUTHOR}/statuses/${tweetID}",twitterReplyURL:"http://twitter.com/home?status=%40${tweetAUTHOR}&in_reply_to_status_id=${tweetID}&in_reply_to=${tweetAUTHOR}",twitterReTweetURL:"http://twitter.com/home?status=RT+%40${tweetAUTHOR}:${tweetTEXT}",twitterFollowText:'<a href="${twitterFollowURL}" target="_blank">Follow Dark Custom on Twitter</a>',twitterFollowURL:"http://twitter.com/darkcustom",getTwitterLabel:function(){return this.twitterLabel
},getTwitterViewText:function(){return this.twitterViewText
},getTwitterReplyText:function(){return this.twitterReplyText
},getTwitterReTweetText:function(){return this.twitterReTweetText
},getTwitterFollowText:function(A){return this.twitterFollowText.replace(/\$\{twitterFollowURL\}/,this.getTwitterFollowURL())
},getTwitterViewURL:function(B){var A=this.twitterViewURL.replace(/\$\{tweetAUTHOR\}/,B.fromScreenName);
return A.replace(/\$\{tweetID\}/,B.id)
},getTwitterReplyURL:function(B){var A=this.twitterReplyURL.replace(/\$\{tweetAUTHOR\}/g,B.fromScreenName);
return A.replace(/\$\{tweetID\}/,B.id)
},getTwitterReTweetURL:function(B){var A=this.twitterReTweetURL.replace(/\$\{tweetAUTHOR\}/,B.fromScreenName);
return A.replace(/\$\{tweetTEXT\}/,encodeURIComponent(B.text))
},getTwitterFollowURL:function(){return this.twitterFollowURL
},getHtml:function(){return this.html
},html:'		<div class="${classes.TWITTER_TWEET} ${classes.WIDGET}">			<div class="${classes.TITLE}">${templates.getTwitterLabel()}</div>			{var postIndex = 0}			{for tweet in tweets}				{eval}				postIndex++;				{/eval} 				{if postIndex % 2 == 0}					<div class="${classes.TWEET} ${classes.ACTIVE}">				{else}					<div class="${classes.TWEET}">				{/if}					<div class="${classes.AUTHOR}">			          ${tweet.fromScreenName}			        </div>					<div class="${classes.DESCRIPTION}">			          ${tweet.text}			        </div>					<div class="${classes.DATE}">						${tweet.createdAt|date}					</div>					<div class="${classes.WRAPPER}">						<div class="${classes.VIEW}">							<a href="${templates.getTwitterViewURL(tweet)}" target="_blank">${templates.getTwitterViewText()}</a>						</div>						<div class="${classes.REPLY}">							<a href="${templates.getTwitterReplyURL(tweet)}" target="_blank">${templates.getTwitterReplyText()}</a>						</div>						<div class="${classes.RETWEET}">							<a href="${templates.getTwitterReTweetURL(tweet)}" target="_blank">${templates.getTwitterReTweetText()}</a>						</div>					</div>					<div class="${classes.SEPARATOR}"></div>				</div>			{/for}			<div class="${classes.SUBSCRIBE}">				${templates.getTwitterFollowText()}			</div>			<div class="${classes.SEPARATOR}"></div>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.TwitterFeedWidget.hooks={EVENT:A.EVENT}
})();
HD.TwitterFeedWidget.prototype={setListeners:function(D){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.EVENT,"*",C)
},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
C.onclick=function(){A.model.setActiveItem.call(A.model,B);
A.notifyObservers.call(A,"itemSelected",B)
}
},update:function(A,B){if(A=="getTwitterFeed_Start"){this.loading(true)
}else{if(A=="getTwitterFeed_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{tweets:(A)||[]})
}};
HD.extend(HD.TwitterFeedWidget,[HD.Widget]);
HD.register("hd_twitter_feed_widget","HD.TwitterFeedWidget",{version:"1.0",build:"1"});HD.YoutubeWidget=function(A){this.config=A;
this.config.dateFormat=this.config.dateFormat||"d mmm yyyy 'at' hh:MM tt";
this.observers=[];
this.loadTemplates(arguments.callee)
};
HD.YoutubeWidget.templates={youtubeLabel:"Youtube",getHtml:function(){return this.html
},html:'		<div class="${classes.YOUTUBE} ${classes.WIDGET}">		  {for youtubeMedia in youtubeMedias}		  <div class="${classes.TITLE}">${youtubeMedia.title}</div>				<div class="${classes.YOUTUBE_VIDEO}">					<div class="${classes.AUTHOR}">			          <BR>uploader: ${youtubeMedia.uploader}			          <BR>description: ${youtubeMedia.description}			          <BR>uploadedDate: ${youtubeMedia.uploadedDate}			          <BR>duration: ${youtubeMedia.duration}			          <BR>type: ${youtubeMedia.type}			          <BR>mediaUrl: ${youtubeMedia.mediaUrl}			          <BR>playerUrl: ${youtubeMedia.playerUrl}			          <BR>thumbnailUrl: ${youtubeMedia.thumbnailUrl}			          <BR>height: ${youtubeMedia.thumbnailHeight}			          <BR>width: ${youtubeMedia.thumbnailWidth}			        </div>				</div>			{/for}			<div class="${classes.SEPARATOR}"></div>		</div>'};
(function(){var A=HD.CSS_CLASSES;
HD.YoutubeWidget.hooks={EVENT:A.EVENT}
})();
HD.YoutubeWidget.prototype={setListeners:function(D){var B=HD.CSS_CLASSES;
var C=this.getParent();
var A=HD.getByClass(this.config.hooks.EVENT,"*",C)
},setListener:function(C,D){if(C==null||D==null){return 
}var A=this;
var B=D;
C.onclick=function(){A.model.setActiveItem.call(A.model,B);
A.notifyObservers.call(A,"itemSelected",B)
}
},update:function(A,B){if(A=="getYoutube_Start"){this.loading(true)
}else{if(A=="getYoutube_Finish"){this.loading(false);
this.render(B)
}}},getHtml:function(A){return this.processTemplate(this.config.templates.getHtml(),{youtubeMedias:(A)||[]})
}};
HD.extend(HD.YoutubeWidget,[HD.Widget]);
HD.register("hd_youtube_widget","HD.YoutubeWidget",{version:"1.0",build:"1"});if(!HD){var HD={util:{}}
}else{if(!HD.util){HD.util={}
}}HD.util.Analytics={track:function(A){}};