copyrightNotice="* Portions Copyright (c) 2006-08 jaman.com, Inc.  All rights reserved. *";if(typeof VN_IMAGES=="undefined"){CACHED_HOST="";VN_IMAGES="1234";VN_JAVASCRIPT="1234";VN_FLASHPLAYER="1234"}VNimages=function(B){if(B.substring(0,1)!="/"){B="/"+B}return CACHED_HOST+"/v"+VN_IMAGES+"/images"+B};VNjavascript=function(B){if(B.substring(0,1)!="/"){B="/"+B}return CACHED_HOST+"/v"+VN_JAVASCRIPT+"/javascript"+B};VNflashplayer=function(B){uri=B||"trailerplayer.swf";if(uri.substring(0,1)!="/"){uri="/"+uri}return"/v"+VN_FLASHPLAYER+"/flash"+uri};function dump(B){s="";for(prop in B){s+=prop+" = ";if(typeof B[prop]=="function"||prop=="innerHTML"||prop=="outerText"||prop=="innerText"||prop=="outerHTML"){s+="[function]"}else{s+=B[prop]}s+="; "}alert(s)}function shortDump(B){s="";for(prop in B){s+=prop+"; "}alert(s)}avString="";function avlog(C,B){avString+=B+": "+C+"\n"}function getCookie(D){var C=document.cookie;var F=D+"=";var E=C.indexOf("; "+F);if(E==-1){E=C.indexOf(F);if(E!=0){return null}}else{E+=2}var B=C.indexOf(";",E);if(B==-1){B=C.length}return unescape(C.substring(E+F.length,B))}function setCookie(D,F,G,E){if(G){var C=new Date();C.setTime(C.getTime()+(G*24*60*60*1000));var B="; expires="+C.toGMTString()}else{var B="";if(getCookie(D)==F){return }}if(E){E="; domain="+E}else{E=""}document.cookie=D+"="+F+B+"; path=/"+E}function createXMLElement(B,E){var D="<"+B;if(!E||E.length==0){D+="/>"}else{D+=">";if(typeof E=="string"){D+=escapeXMLValue(E)}else{if(typeof E=="number"){D+=E}else{if(typeof E=="boolean"){D+=(E?"true":"false")}else{if(typeof E=="object"&&E.constructor==Array){for(var C=0;C<E.length;C++){D+=createXMLElement(E[C].name,E[C].value)}}}}}D+="</"+B+">"}return D}function parseXMLString(C){if(window.ActiveXObject){var B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";B.loadXML(C)}else{var D=new DOMParser();var B=D.parseFromString(C,"text/xml")}return B.documentElement}function escapeXMLValue(B){if(B&&B.length>0){B=B.replace(/&/g,"&amp;");B=B.replace(/'/g,"&apos;");B=B.replace(/"/g,"&quot;");B=B.replace(/</g,"&lt;");B=B.replace(/>/g,"&gt;")}return B}function unescapeXMLValue(B){if(B&&B.length>0){B=B.replace(/&apos;/g,"'");B=B.replace(/&quot;/g,'"');B=B.replace(/&lt;/g,"<");B=B.replace(/&gt;/g,">");B=B.replace(/&amp;/g,"&")}return B}function setSelected(E,C,D){for(var B=0;B<E.options.length;B++){if(E.options[B].value==C){E.selectedIndex=B;return }}if(typeof D!="undefined"&&D<E.options.length){E.selectedIndex=D}else{E.selectedIndex=0}}if(typeof (JAMAN)=="undefined"){JAMAN={}}if(typeof (JAMAN.widget)=="undefined"){JAMAN.widget={}}if(typeof (JAMAN.component)=="undefined"){JAMAN.component={}}var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var B;var C;var D;try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");B=C.GetVariable("$version")}catch(D){}if(!B){try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");B="WIN 6,0,21,0";C.AllowScriptAccess="always";B=C.GetVariable("$version")}catch(D){}}if(!B){try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");B=C.GetVariable("$version")}catch(D){}}if(!B){try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");B="WIN 3,0,18,0"}catch(D){}}if(!B){try{C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");B="WIN 2,0,0,11"}catch(D){B=-1}}return B}function GetSwfVer(){var H=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var G=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var B=navigator.plugins["Shockwave Flash"+G].description;var F=B.split(" ");var D=F[2].split(".");var I=D[0];var C=D[1];var E=F[3];if(E==""){E=F[4]}if(E[0]=="d"){E=E.substring(1)}else{if(E[0]=="r"){E=E.substring(1);if(E.indexOf("d")>0){E=E.substring(0,E.indexOf("d"))}}}H=I+"."+C+"."+E}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){H=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){H=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){H=2}else{if(isIE&&isWin&&!isOpera){H=ControlVersion()}}}}}return H}function DetectFlashVer(G,E,D){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var F=versionArray[0];var B=versionArray[1];var C=versionArray[2];if(F>parseFloat(G)){return true}else{if(F==parseFloat(G)){if(B>parseFloat(E)){return true}else{if(B==parseFloat(E)){if(C>=parseFloat(D)){return true}}}}}return false}}}function AC_AddExtension(C,B){if(C.indexOf("?")!=-1){return C.replace(/\?/,B+"?")}else{if(C.indexOf(B)!=-1){return C}else{return C+B}}}function AC_Generateobj(F,E,B){var D="";if(isIE&&isWin&&!isOpera){D+="<object ";for(var C in F){D+=C+'="'+F[C]+'" '}D+=">";for(var C in E){D+='<param name="'+C+'" value="'+E[C]+'" /> '}D+="</object>"}else{D+="<embed ";for(var C in B){D+=C+'="'+B[C]+'" '}D+="> </embed>"}return D}function AC_FL_RunContent(){var B=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return AC_Generateobj(B.objAttrs,B.params,B.embedAttrs)}function AC_GetArgs(C,F,H,E,I){var B=new Object();B.embedAttrs=new Object();B.params=new Object();B.objAttrs=new Object();for(var D=0;D<C.length;D=D+2){var G=C[D].toLowerCase();switch(G){case"classid":break;case"pluginspage":B.embedAttrs[C[D]]=C[D+1];break;case"src":case"movie":C[D+1]=AC_AddExtension(C[D+1],F);B.embedAttrs.src=C[D+1];B.params[H]=C[D+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":B.objAttrs[C[D]]=C[D+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":B.embedAttrs[C[D]]=B.objAttrs[C[D]]=C[D+1];break;default:B.embedAttrs[C[D]]=B.params[C[D]]=C[D+1]}}B.objAttrs.classid=E;if(I){B.embedAttrs.type=I}return B}VideoLib=new function(){this.theOpenPopup=null;this.theOpenPopupLink=null;this.popupDelay=50;this.popupStart=20;this.popupEnd=80;this.isSafari=(navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("AppleWebKit")!=-1);this.isMac=(navigator.platform.indexOf("Mac")!=-1);this.deleteID=null;this.itemsToHide=new Array();this.loginMessage="";this.loggedMsgAtTop=false;this.isPopup=false;this.helpNav;this.helpSecnav;this.videoURL="-1";this.videoURL2=null;this.videoThumbnail="";this.pageCondition=null;this.playerCounter=0;this.mainPlayerCounter=1;this.hasFlashVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);this.hasQuicktime1=RegExp(" AppleWebKit/").test(navigator.userAgent)&&RegExp(" Mobile/").test(navigator.userAgent);this.supportsHTML5Video=!!document.createElement("video").canPlayType;this.currentVideoID=null;this.useVideoID=null;this.GET_FLASH_PLAYER_URL="http://www.adobe.com/go/getflashplayer";this.PLAYER_NONE=0;this.PLAYER_CLOSE=1;this.PLAYER_ALL=2;this.SHOW_ADS=false;this.scrollTo=function(id){var pos=getElementPosition($(id));window.scrollTo(0,pos.y-5)};this.getSessionID=function(){if(TRLib.isEmbedded()){return getCookie(this.TRSESSION_COOKIE_ID)}else{return getCookie(this.SESSION_COOKIE_ID)}};this.getLoginID=function(){if(TRLib.isEmbedded()){return getCookie(this.TRLOGIN_COOKIE_ID)}else{return getCookie(this.LOGIN_COOKIE_ID)}};this.closePopup=function(){if(!this.theOpenPopup){return }TRLib.handleExposed();this.lowerElem(this.theOpenPopup);var inputs=getElementsByTagAndClassName("input",null,$(this.theOpenPopup));for(i in inputs){if((inputs[i].type=="text")||(inputs[i].type=="password")){inputs[i].value=""}}inputs=getElementsByTagAndClassName("textarea",null,$(this.theOpenPopup));for(i in inputs){if(!inputs[i].readOnly){inputs[i].value=""}}$(this.theOpenPopup)["onresize"]=null;if($("backdropIFrame")){$("backdropIFrame").style.display="none"}if((this.theOpenPopup=="infoEditorPopup")&&$("sideMeta")){this.fetchVideo()}this.theOpenPopup=null};this.raiseElem=function(name,x,y){var sty=$(name).style;sty.left=x+"px";sty.top=y+"px";sty.zIndex=10;sty.visibility="visible";sty.display="none";setTimeout(function(){sty.display="block"},10)};this.lowerElem=function(name){$(name).style.zIndex=-1;$(name).style.visibility="hidden";$(name).style.display="none"};this.resizeElem=function(name,x,y){$(name).style.width=x+"px";$(name).style.height=y+"px"};this.openPopup=function(name,anchor,focusElem,xOffset,yOffset){if(this.theOpenPopup){this.closePopup()}if((anchor==null)||(anchor=="null")){anchor=$("player")}xOffset=xOffset||0;yOffset=yOffset||0;focusElem=focusElem||"";var elemDims=getElementPosition(anchor);var x=elemDims.x+xOffset;var y=elemDims.y+yOffset+anchor.offsetHeight;var winDims=Jaman.getWindowInnerRect();$(name).style.left="-1000px";$(name).style.display="block";var width=$(name).offsetWidth+20;if(x+width>(winDims.width+winDims.left)){x=winDims.width+winDims.left-width}var height=$(name).offsetHeight+20;if(y+height>winDims.top+winDims.height){y=winDims.top+winDims.height-height}if(y<0){y=0}TRLib.handleHidden();this.theOpenPopup=name;this.theOpenPopupLink=anchor;if(!$("blankPopup")){var div=DIV({id:"blankPopup","class":"popup"}," ");var elems=getElementsByTagAndClassName("body");appendChildNodes(elems[0],div)}var iframe=this.getBackdropFrame(0);iframe.style.width=$(name).offsetWidth+"px";iframe.style.height=$(name).offsetHeight+"px";iframe.style.left=x+"px";iframe.style.top=y+"px";iframe.style.display="none";this.resizeElem("blankPopup",this.popupStart,this.popupStart*$(name).offsetHeight/$(name).offsetWidth);this.raiseElem("blankPopup",x,y);this.popupProgress=0;setTimeout("VideoLib.stepPopup('"+name+"',"+x+","+y+","+x+","+y+",'"+focusElem+"')",this.popupDelay)};this.stepPopup=function(name,x,y,startX,startY,focusElem){this.popupProgress+=0.34;var size=Math.round(this.popupStart+this.popupProgress*this.popupEnd);this.resizeElem("blankPopup",size,size*$(name).offsetHeight/$(name).offsetWidth);this.raiseElem("blankPopup",Math.round(startX+(x-startX)*this.popupProgress),Math.round(startY+(y-startY)*this.popupProgress));if(this.popupProgress<1){setTimeout("VideoLib.stepPopup('"+name+"',"+x+","+y+","+startX+","+startY+",'"+focusElem+"')",this.popupDelay)}else{this.lowerElem("blankPopup");setTimeout("VideoLib.finalizePopup('"+name+"',"+x+","+y+",'"+focusElem+"')",this.popupDelay)}};this.finalizePopup=function(name,x,y,focusElem){this.raiseElem(name,x,y);if(focusElem.length>0){try{$(focusElem).focus()}catch(e){}}if(!$(name)["onresize"]){$(name)["onresize"]=function(){VideoLib.resizePopup();return false}}if($("backdropIFrame")){$("backdropIFrame").style.display=""}};this.resizePopup=function(){if(!this.theOpenPopup){return }if($("backdropIFrame")){$("backdropIFrame").style.width=$(this.theOpenPopup).offsetWidth+"px";$("backdropIFrame").style.height=$(this.theOpenPopup).offsetHeight+"px"}};this.movePopup=function(x,y){if(!this.theOpenPopup){return }if($("backdropIFrame")){$("backdropIFrame").style.left=x+"px";$("backdropIFrame").style.top=y+"px"}};this.makeUrl=function(uri,secure){var url=this.HTTP_URL;if(secure){url=this.HTTPS_URL}return url+uri};this.prepQuery=function(query){if(!query){query={}}for(prop in query){if(typeof query[prop].length!="undefined"&&query[prop].length>100000){query[prop]=query[prop].substring(0,100000)}}query[this.PARAM_IS_XML_REQUEST_NAME]=this.PARAM_TRUE_VALUE;return query};this.makeRequest=function(uri,query,isSecure){if(this.loggedMsgAtTop){this.clearLogAtTop()}query=this.prepQuery(query);var d=MochiKit.Async.doSimpleXMLHttpRequest(this.makeUrl(uri+"?"+MochiKit.Base.queryString(query),isSecure));d.addErrback(this.sessionErr);return d};this.makePostRequest=function(uri,query){query=this.prepQuery(query);var r=getXMLHttpRequest();r.open("POST",this.makeUrl(uri));var content=MochiKit.Base.queryString(query);r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var d=sendXMLHttpRequest(r,content);d.addErrback(this.sessionErr);return d};this.extractErr=function(err){var xml=err.req.responseXML.documentElement;var faultString=xml.getElementsByTagName("string").item(0);var faultCode=xml.getElementsByTagName("int").item(0);err.faultString=faultString.firstChild.nodeValue;err.faultCode=faultCode.firstChild.nodeValue};this.sessionErr=function(err){VideoLib.extractErr(err);if(err.faultCode==VideoLib.RPCERROR_INVALID_SESSION_CODE){VideoLib.clearCookies();if(TRLib.isEmbedded()){TRLib.handleSessionExpired()}else{VideoLib.handleSignIn()}}else{if(err.faultCode==VideoLib.RPCERROR_STALE_SESSION_CODE){if(TRLib.isEmbedded()){TRLib.handleStaleSession()}else{VideoLib.openVerifyPasswordPopup()}}else{if(err.faultCode==VideoLib.FB_CONNECT_INVALID_SESSION_CODE){JAMAN.FacebookConnect.signin()}}}return err};this.log=function(elemName,value){if(typeof getElementsByTagAndClassName=="function"){var infoBars=getElementsByTagAndClassName("div","infoBar");for(var i=0;i<infoBars.length;i++){var infoBar=infoBars[i];if(infoBar.id&&infoBar.id.search(/err$/i)!=-1){hideElement(infoBar.id)}}}$(elemName).innerHTML=value;showElement(elemName)};this.logAtTop=function(value){if(value.length>0){this.log("generalErr",value);scroll(0,0)}else{hideElement("generalErr")}this.loggedMsgAtTop=true};this.clearLogAtTop=function(){this.logAtTop("")};this.fetchContent=function(contentHolder,uri,query,isSecure){var fcd=this.makeRequest(uri,query,isSecure);fcd.addCallback(function(resp){$(contentHolder).innerHTML=resp.responseText})};this.selectBoxes=function(id){var box;var boxes=getElementsByTagAndClassName(null,"checkbox",id);for(box in boxes){if(boxes[box].checked==false){boxes[box].checked=true}}};this.selectedBoxes=function(id){var ret="";var box;var boxes=getElementsByTagAndClassName(null,"checkbox",id);for(box in boxes){if(boxes[box].checked){ret+=(ret==""?"":",")+boxes[box].value}}return ret};this.selectRange=function(id,start,length){var elem=$(id);if(elem.createTextRange){var range=elem.createTextRange();range.moveStart("character",start);range.moveEnd("character",length-elem.value.length);range.select()}else{if(elem.setSelectionRange){elem.setSelectionRange(start,length)}}};this.selectAll=function(id,isChecked){if(id==null){id=""}var boxes=getElementsByTagAndClassName(null,"checkbox",id);if(boxes!=null){for(var box=0;box<boxes.length;box++){boxes[box].checked=isChecked}}};this.handleSelectAll=function(selectId,gridId){if(document.getElementById(selectId).checked==false){return }var boxes=getElementsByTagAndClassName(null,"checkbox",gridId);if(boxes!=null){for(var box=0;box<boxes.length;box++){if(boxes[box].checked==false){document.getElementById(selectId).checked=false;return }}}};this.getRadio=function(formElem){if(formElem.length){for(var i=0;i<formElem.length;i++){if(formElem[i].checked){return formElem[i].value}}}else{if(formElem.checked){return formElem.value}}return null};this.setRadio=function(formElem,value){for(var i=0;i<formElem.length;i++){formElem[i].checked=(formElem[i].value==value)}};this.getSelect=function(formElem){var arr=new Array();for(var i=0;i<formElem.options.length;i++){if(formElem.options[i].selected){arr.push(formElem.options[i].value)}}return arr};this.setSelect=function(formElem,vals){for(var i=0;i<formElem.options.length;i++){formElem.options[i].selected=false}for(i=0;i<vals.length;i++){formElem.options[vals[i]].selected=true}};this.addSelectOption=function(formElem,name,value){var opts=formElem.options;for(var i=0;i<opts.length;i++){if(opts[i].value==value){return }}opts[opts.length]=new Option(name,value)};this.removeSelectOption=function(formElem,value){var opts=formElem.options;for(var i=0;i<opts.length;i++){if(opts[i].value==value){opts[i]=null}}};this.clickedLabel=function(label){if(VideoLib.isSafari&&label.htmlFor&&$(label.htmlFor)){var input=$(label.htmlFor);if(!input.disabled){if(input.type=="radio"||input.type=="checkbox"){input.checked=(input.type=="radio"?true:!input.checked);if(input.onclick){input.onclick.apply()}}else{setTimeout(function(){input.focus()},100)}}}};this.clickedLabelImg=function(img){if(!MochiKit.DOM.attributeArray.compliant){img.parentNode.click()}};this.insertAtCursor=function(myField,myValue){if(document.selection){myField.focus();if(CMSLib&&CMSLib.targetSelection){sel=CMSLib.targetSelection}else{sel=document.selection.createRange()}sel.text=myValue}else{if(myField.selectionStart||myField.selectionStart=="0"){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;var cursorPos=startPos+myValue.length;myField.value=myField.value.substring(0,startPos)+myValue+myField.value.substring(endPos,myField.value.length);myField.selectionStart=cursorPos;myField.selectionEnd=cursorPos}else{myField.value+=myValue}}myField.focus()};this.loginOkay=function(resp){responses=resp.responseText.split("|");var sessionID=responses[0];setCookie(this.SESSION_COOKIE_ID,sessionID);var login=$("login_alias").value.toLowerCase();setCookie(this.LOGIN_COOKIE_ID,login);this.closePopup();this.updateUnread(responses[1]);this.deferredLogin=null;this.logAtTop(this.loginMessage);this.loginMessage=""};this.updateUnread=function(count){if(count>0){showElement("mailicon-on");hideElement("mailicon");showElement("unreadCount")}else{showElement("mailicon");hideElement("mailicon-on");hideElement("unreadCount")}$("unreadCount").innerHTML="("+count+")"};this.setLoginMessage=function(str){$("login_message").innerHTML=str};this.loginErr=function(err){this.setLoginMessage("Unable to log on: "+err.faultString);this.deferredLogin=null};this.deferredLogin=null;this.handleLogin=function(){if(VideoLib.deferredLogin!=null){return }VideoLib.setLoginMessage("");var f=$("theForm");if(f.login_alias.value.length==0){f.login_alias.focus();return false}var query={login_alias:f.login_alias.value,login_password:f.login_password.value};query[VideoLib.ACTION]=VideoLib.LOGIN_ACTION_VALUE;VideoLib.deferredLogin=VideoLib.makeRequest(VideoLib.LOGIN_ACTION_URL,query);VideoLib.deferredLogin.addCallbacks(function(resp){VideoLib.loginOkay(resp)},function(resp){VideoLib.loginErr(resp)});return false};this.handleLogout=function(needsLogin){if(JAMAN.FacebookConnect.isFBConnectLoggedIn()){JAMAN.FacebookConnect.logout(function(){VideoLib.handleLogoutImpl(needsLogin)})}else{VideoLib.handleLogoutImpl(needsLogin)}};this.handleLogoutImpl=function(needsLogin){if(TRLib.isEmbedded()){needsLogin=TRLib.needsLogin;setCookie(this.TRLOGIN_COOKIE_ID,this.getLoginID())}else{setCookie(this.LOGIN_COOKIE_ID,this.getLoginID())}var url=this.LOGIN_ACTION_URL+"?"+this.ACTION+"="+this.LOGOUT_ACTION_VALUE;if(!needsLogin){var nextPage=location.href;if(nextPage.indexOf("#")>nextPage.indexOf("/")){nextPage=nextPage.substring(0,nextPage.indexOf("#"))}url+="&nextPage="+escape(nextPage)}location.href=this.makeUrl(url)};this.clearCookies=function(){if(TRLib.isEmbedded()){setCookie(this.TRSESSION_COOKIE_ID,"",-1);setCookie(this.TRLOGIN_COOKIE_ID,"",-1)}else{setCookie(this.SESSION_COOKIE_ID,"",-1);setCookie(this.LOGIN_COOKIE_ID,"",-1)}};this.checkSessionExpired=function(){if(this.getSessionID()){return true}if(this.isPopup){location.href=this.makeUrl(this.SESSION_EXPIRED_URL+"?"+this.ACTION+"="+this.SESSION_EXPIRED_ACTION)}else{this.openSigninPopup()}};this.checkLoggedIn=function(nextPage,message,makeUrl){if(this.getSessionID()){return true}if(message==null){message=this.ERROR_LOGIN_REGISTER}if(makeUrl==null){makeUrl=true}if(TRLib.isEmbedded()){if(nextPage){if(makeUrl){nextPage=this.makeUrl(nextPage)}}else{nextPage=location.href}TRLib.afterLoginPage=nextPage;TRLib.handleLoginPrompt(message)}else{if(nextPage){if(makeUrl){this.openSigninPopup(this.makeUrl(nextPage))}else{this.openSigninPopup(nextPage)}}else{if(this.getLoginID()&&this.getLoginID()!=""){setCookie(this.LOGIN_COOKIE_ID,this.getLoginID());this.openSigninPopup()}else{this.logAtTop(message)}}}return false};this.openRegisterPopup=function(nextPage,params){var url=this.makeUrl(this.REGISTER_ACTION_URL,true);url+="?nextPage="+escape(nextPage||location.href);if(params){for(var i=0;i<params.length;i++){url+="&"+params[i].name+"="+encodeURIComponent(params[i].value)}}location.href=url};this.setRegisterMessage=function(str){this.logAtTop(str)};this.checkPasswords=function(f){if(f.register_password.value.length<this.USER_PASSWORD_MINIMUM_LENGTH){this.setRegisterMessage(this.ERROR_USER_PASSWORD_MINIMUM);return false}if(f.register_password.value.length>this.USER_PASSWORD_MAXIMUM_LENGTH){this.setRegisterMessage(this.ERROR_USER_PASSWORD_MAXIMUM);return false}if(f.register_password.value!=f.register_password2.value){this.setRegisterMessage(this.ERROR_USER_PASSWORD_MATCH);return false}return true};this.handleSignIn=function(){if(TRLib.isEmbedded()){TRLib.handleLoginPrompt("")}else{this.openSigninPopup()}};this.openSigninPopup=function(nextPage){var url=this.makeUrl(this.LOGIN_ACTION_URL);url+="?nextPage="+escape(nextPage||location.href);location.href=url};this.openVerifyPasswordPopup=function(nextPage){var url=this.makeUrl(this.LOGIN_ACTION_URL,true);url+="?"+this.ACTION+"="+this.VERIFY_PASSWORD_ACTION_VALUE;url+="&nextPage="+escape(nextPage||location.href);location.href=url};this.handleKeypressEnter=function(field,event,callback){if(window.event){keycode=window.event.keyCode}else{if(event){keycode=event.which}else{return true}}if(keycode==13||keycode==10){return callback()}else{return true}};this.handleFormSubmit=function(){};this.handleEval=function(){eval($("debugConsole").value);return false};this.validateAlias=function(elem,where){var alias=elem.value;alias=alias.trim();if(alias.length<this.USER_ALIAS_MINIMUM_LENGTH){this.log(where,this.ERROR_USER_ALIAS_MINIMUM);elem.focus();return false}var illegalChars=/[^a-zA-Z0-9_.]/;if(illegalChars.test(alias)){this.log(where,this.ERROR_USER_ALIAS_CHARACTERS1);elem.focus();return false}illegalChars=/[_.]{2,}/;if(illegalChars.test(alias)){this.log(where,this.ERROR_USER_ALIAS_CHARACTERS2);elem.focus();return false}illegalChars=/^[_.]|[_.]$/;if(illegalChars.test(alias)){this.log(where,this.ERROR_USER_ALIAS_CHARACTERS3);elem.focus();return false}return true};this.validateCountry=function(sel,where,isGeneric){var val=sel.options[sel.selectedIndex].value;if(val=="-1"||val=="-2"){if(!isGeneric){this.log(where,this.ERROR_VIDEO_INVALID_COUNTRY)}else{this.log(where,this.ERROR_INVALID_COUNTRY)}sel.focus();return false}return true};this.validateCategory=function(sel,where){var val=sel.options[sel.selectedIndex].value;if(val=="-1"){this.log(where,this.ERROR_VIDEO_INVALID_CATEGORY);sel.focus();return false}return true};this.getBaseID=function(id){return id.substring(0,id.length-".edit".length)};this.resetDiv=function(id){hideElement(id+".edit");hideElement(id+".edit.err");showElement(id);if($(id).startClass){$(id).className=$(id).startClass}return id};this.handleInlineEditClick=function(divID){hideElement(divID);var id=divID+".edit";showElement(id);$(id).oldValue=$(id+".value").value;$(id+".value").select();$(id+".value").focus()};this.handleInlineEditCancel=function(divID){$(divID+".value").value=$(divID).oldValue;this.resetDiv(this.getBaseID(divID))};this.handleInlineEditSave=function(divID){var field=divID.substring(0,divID.indexOf("."));var newValue=$(divID+".value").value;var baseID=this.getBaseID(divID);$(baseID).newValue=newValue;var objectID=baseID.substring(divID.indexOf(".")+1);var query={};query[this.ACTION]=this.UPDATE_ACTION_VALUE;query[field]=newValue;if(field=="reviewreply"){query.replyID=objectID;query.summary=newValue;d=this.makePostRequest("/review/",query)}else{if(field=="reply"){query.replyID=objectID;d=this.makePostRequest("/forumDiscussion/",query)}else{if((field=="discussionTitle")||(field=="discussionText")){query.discussionID=objectID;d=this.makePostRequest("/forumDiscussion/",query)}else{if(field=="cgroupName"){query.cgroupID=objectID;query[this.ACTION]=$(divID+".value.action").value;d=this.makePostRequest("/contacts/",query)}else{VideoLib.logAtTop("Action not supported: "+divID);return true}}}}d.addCallbacks(function(resp){VideoLib.inlineEditOkay(resp,baseID)},function(resp){VideoLib.inlineEditErr(resp,divID+".err")});return false};this.inlineEditOkay=function(resp,id){this.resetDiv(id);var field=id.substring(0,id.indexOf("."));if(field=="cgroupName"){location.href=this.makeUrl("/contacts/")}else{if(field=="reviewreply"){VideoLib.refreshReviews(false,id)}else{$(id+".display").innerHTML=VideoLib.escapeHTML($(id).newValue)}}};this.inlineEditErr=function(err,id){log(id);this.log(id,err.faultString)};this.stripDOM=function(elem){var i;if(elem.onclick!=null){elem.onclick=null}if(elem.childNodes){for(i=0;i<elem.childNodes.length;i++){this.stripDOM(elem.childNodes[i])}}};this.handleDelete=function(anchor,id){this.openPopup("confirmDelete",anchor);this.deleteID=id;this.deleteAction=this.REMOVE_ACTION_VALUE};this.handleDeleteConfirm=function(){var f=$("theForm");f.videoID.value=this.deleteID;f.action=this.REMOVE_ACTION_URL;f[this.ACTION].value=this.deleteAction;f.submit()};this.handleDeleteCancel=function(){this.closePopup()};this.handleSearch=function(q,isTag){if(q==null){var elem=$("search_text");if(elem.value==VideoLib.PLACEHOLDER_SEARCH){elem.value=""}q=elem.value}var s=VideoLib.SEARCH_GRID_ACTION_URL+"?"+VideoLib.ACTION+"=";if(isTag){s+=VideoLib.SEARCH_GRID_TAG_ACTION_VALUE;if(this.pageCondition){s+="&pageCondition="+this.pageCondition}}else{s+=VideoLib.SEARCH_GRID_ACTION_VALUE}s+="&inlineSearchFilter="+encodeURIComponent(q);location.href=s;return false};this.handleSearchAll=function(q,isTag){if(q==null){var elem=$("search_text");if(elem.value==VideoLib.PLACEHOLDER_SEARCH){elem.value=""}if(elem.value==""){return false}q=elem.value}var s=VideoLib.SEARCH_ACTION_URL+"?query="+encodeURIComponent(q);s=s.replace(new RegExp("%20","g"),"+");location.href=s;return false};this.handleContact=function(isContact,contactID,alias,msg){if(!this.checkLoggedIn(null,"Please sign in to add to your friends.")){return false}if(!msg){msg=""}var query={is_contact:isContact?this.PARAM_TRUE_VALUE:this.PARAM_FALSE_VALUE,userID:contactID,alias:alias,contactMsg:msg};query[this.ACTION]=this.CONTACT_ACTION_VALUE;var d=this.makeRequest(this.CONTACT_ACTION_URL,query);d.addCallbacks(function(resp){VideoLib.contactOkay(resp,isContact,contactID)},function(resp){VideoLib.contactErr(resp)});return true};this.contactOkay=function(resp,isContact,contactID){if(isContact){this.logAtTop(VideoLib.INFO_CONTACT_ADDED)}else{this.logAtTop(VideoLib.INFO_CONTACT_REMOVED)}if(Jaman&&Jaman.UserMenu){Jaman.UserMenu.setContactInfo(contactID,isContact)}$("toggleContact").innerHTML=resp.responseText};this.contactErr=function(err){this.logAtTop(err.faultString)};this.handleUnblock=function(contactID){if(!this.checkLoggedIn(null,"Please sign in to unblock.")){return false}var query={userID:contactID};query[this.ACTION]=this.CONTACT_UNBLOCK_ACTION_VALUE;d=this.makeRequest(this.CONTACT_ACTION_URL,query);d.addCallbacks(MochiKit.Base.bind(VideoLib.unblockOkay,VideoLib),MochiKit.Base.bind(VideoLib.unblockErr,VideoLib))};this.unblockOkay=function(resp){this.logAtTop(VideoLib.INFO_CONTACT_UNBLOCKED)};this.unblockErr=function(err){this.logAtTop(err.faultString)};this.showUserProfile=function(userID){location.href=this.makeUrl("/people/"+userID+"/")};this.emailToContact=function(userID,alias){var query={email_to_contact:userID,email_to_contact2:alias};query[this.ACTION]=this.EMAIL_TO_CONTACT_ACTION_VALUE;location.href=this.makeUrl("/message/?"+MochiKit.Base.queryString(query))};this.replyCancel=function(){$("reply_summary").value="";hideElement("replyErr");this.closePopup2();if($("postReplyBtn_Table")){Jaman.GraphicButton.enableButton("postReplyBtn")}};this.setReplyMessage=function(str){this.log("replyErr",str)};this.setRating=function(vid,rating){var query={videoID:vid,my_rating:rating};if(this.getSessionID()){query[this.ACTION]=this.PUT_RATING_XML_ACTION;return VideoLib.makeRequest(this.LOG_AUTOPLAY_ACTION_URL,query)}else{query[this.ACTION]=this.PUT_RATING_ACTION;query.nextPage=location.href;location.href=this.makeUrl(this.LOG_AUTOPLAY_ACTION_URL+"?"+MochiKit.Base.queryString(query));return null}};this.setRatingAndMsg=function(vid,rating,imgid){var d=this.setRating(vid,rating);if(d){d.addCallbacks(function(){showElement("rating.msg."+imgid);Jaman.Rater.setRatingForObj(vid,rating,imgid)},function(err){VideoLib.logAtTop(err.faultString);if(Jaman.Rater){Jaman.Rater.resetRatingFor(imgid)}})}};this.clickedView=function(){var vid=this.useVideoID||this.currentVideoID;if(vid){var query={videoID:vid};query[this.ACTION]=this.LOG_VIEWED_XML_ACTION;this.makeRequest(this.LOG_AUTOPLAY_ACTION_URL,query)}};this.clickedViewProfile=function(vid){if(vid){var query={videoID:vid};query[this.ACTION]=this.LOG_VIEWED_PROFILE_XML_ACTION;this.makeRequest(this.LOG_AUTOPLAY_ACTION_URL,query)}};this.injectBreaks=function(s){s=s.replace(/(([^\s\/]+\-)|([^\s\/]{15}))(?=[^\s\/])/g,"$1"+this.WBR_HOLDER);return s};this.escapeHTML=function(s){s=this.injectBreaks(s);s=escapeHTML(s);s=s.replace(new RegExp(this.WBR_HOLDER,"g"),this.isSafari?this.WBR_SAFARI:this.WBR);return s};this.escapeAndLinkify=function(s){s=this.escapeHTML(s);s=s.replace(/((http(s?):\/\/|(www\.))([^\s]*[a-z0-9\/]{1}))/gi,this.renderCleanURL);return s};this.renderCleanURL=function(matches0,matches1,matches2,matches3,matches4,matches5){if(!matches3){matches3=""}if(!matches4){matches4=""}var target=new RegExp(this.isSafari?"\\&shy;":"\\<wbr\\>");matches4=matches4.replace(target,"");matches5=matches5.replace(target,"");var isInternal=matches5.match(/^\w+\.jaman\.com/);return'<a href="http'+matches3+"://"+matches4+matches5+'"'+(isInternal?"":' target="_blank"')+">"+matches1+"</a>"};this.renderEmbedCode=function(videoLink,videoID,videoTitle,height,width){var embedCode='<span style="width:'+width+'px;"><a href="'+videoLink+'">'+videoTitle+'</a></span><br/><object width="'+width+'" height="'+height+'"><param name="movie" value="'+VideoLib.HTTP_URL+"/embed/"+videoID+'"></param><param name="wmode" value="transparent"></param><param name="allowFullScreen" value="true"></param><embed src="'+VideoLib.HTTP_URL+"/embed/"+videoID+'/" type="application/x-shockwave-flash" wmode="transparent" allowFullScreen="true" width="'+width+'" height="'+height+'" ></embed></object>';return embedCode};this.pluringular=function(n,sing,plural){if(n==1){return n+" "+sing}else{return n+" "+plural}};this.handlePageSize=function(size,cookieName){if(typeof this.tableCallback=="function"){this.tableCallback()}setCookie(cookieName,size,365*5);var f=$("theForm");f.pageSize.value=size;f.method="get";f.submit()};this.handlePageOffset=function(n,formName){if(typeof this.tableCallback=="function"){this.tableCallback()}var f=$(formName||"theForm");f.pageOffset.value=n;f.method="get";f.submit()};this.handlePageSort=function(what){var arr=what.split("|");this.handleSort(arr[0],arr[1])};this.handleSort=function(criteria,order){if(typeof this.tableCallback=="function"){this.tableCallback()}var f=$("theForm");f.sortCriteria.value=criteria;f.sortOrder.value=order;f.method="get";f.submit()};this.handlePageCondition=function(condition){if(typeof this.tableCallback=="function"){this.tableCallback()}var f=$("theForm");f.pageCondition.value=condition;f.method="get";f.submit()};this.thisMovie=function(){var theMovie="player"+this.mainPlayerCounter;var elem;if(navigator.appName.indexOf("Microsoft")!=-1){elem=window[theMovie]}else{elem=document[theMovie]}if(typeof elem!="undefined"){try{if(elem.PercentLoaded()==100){return elem}}catch(e){}}return null};this.clickedVolume=function(v){setCookie("volume",Math.round(v*100),365*5)};this.movieSetVideo=function(){if(VideoLib.hasFlashVersion){var m=VideoLib.thisMovie();if(m!=null){if(VideoLib.videoURL==""){VideoLib.movieNoTrailer()}else{if(VideoLib.videoURL=="-1"){VideoLib.movieNoVideo()}else{VideoLib.thisMovie().setVideo(VideoLib.videoURL,VideoLib.videoThumbnail,VideoLib.videoSize,VideoLib.videoDuration)}}}}else{if(VideoLib.hasQuicktime1&&VideoLib.videoURL2&&VideoLib.videoURL2!=""){var theMovieDiv=$("player"+VideoLib.mainPlayerCounter+"div");if(theMovieDiv){theMovieDiv.innerHTML='<embed src="'+VideoLib.videoThumbnail+'" id="player'+VideoLib.mainPlayerCounter+'" href="'+VideoLib.videoURL2+'" type="video/mp4" height="'+theMovieDiv.offsetHeight+'" width="'+theMovieDiv.offsetWidth+'" target="myself" bgcolor="#000000"/>'}}}};this.movieNoTrailer=function(){var m=VideoLib.thisMovie();if(m!=null){m.setTrailerNotAvailable(true)}};this.movieNoVideo=function(){var m=VideoLib.thisMovie();if(m!=null){m.setVideoNotAvailable(true)}};this.renderPlayer=function(width,height,videoUrl,fileSize,videoDuration,playerStyle,useSSL,thumbnailUrl,forceThumbnail){var params={thumbnailUrl:thumbnailUrl||"",forceThumbnail:forceThumbnail||false,playerStyle:playerStyle};this.renderTrailer(width,height,videoUrl,params,useSSL)};this.renderTrailer=function(width,height,src,params,useSSL){var quickTimeUrl1=params.quickTimeUrl1;var oeTags;if(this.hasFlashVersion&&src&&src!=""){var wmode=params.wmode||((navigator.userAgent.indexOf("Macintosh")!=-1&&navigator.userAgent.indexOf("Firefox")!=-1)?"window":"opaque");var fullScreen=0;if(params.playerStyle==this.PLAYER_CLOSE){fullScreen=-1}else{if(params.playerStyle==this.PLAYER_ALL||wmode=="window"||DetectFlashVer(9,0,115)){fullScreen=1}else{fullScreen=0}}var volume=getCookie("volume")||0.5;if(Math.abs(volume)>1){volume=volume/100}var flashVars="&Thumbnail="+escape(params.thumbnailUrl);if(!this.SHOW_ADS){flashVars+="&noAd=1"}if(src==""){flashVars+="&NoTrailer=1"}else{flashVars+="&TheVideo="+escape(src)}flashVars+="&VideoVolume="+volume;flashVars+="&FullScreen="+fullScreen;var autoplay=getCookie(VideoLib.AUTOPLAY_COOKIE_ID)||VideoLib.AUTOPLAY_ON;if(autoplay==VideoLib.AUTOPLAY_OFF||params.forceThumbnail||(TRLib.isEmbedded()&&!TRLib.getIsVisible())){flashVars+="&ForceThumbnail=1";if(TRLib.isEmbedded()&&!TRLib.getIsVisible()){TRLib.isPlayingBeforeHide=(autoplay==VideoLib.AUTOPLAY_OFF&&!params.forceThumbnail)}}this.playerCounter++;if(params.isMainTrailer){this.mainPlayerCounter=this.playerCounter}oeTags=AC_FL_RunContent("src",VNflashplayer(),"width",width,"height",height,"id","player"+this.playerCounter,"name","player"+this.playerCounter,"class","player","align","middle","menu","false","quality","high","scale","noscale","bgcolor","#000000","wmode",wmode,"allowScriptAccess","always","allowFullScreen","true","flashvars",flashVars,"codebase",(useSSL?"https":"http")+"://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage",this.GET_FLASH_PLAYER_URL)}else{if(this.hasQuicktime1&&quickTimeUrl1){this.playerCounter++;oeTags='<div id="player'+this.playerCounter+'div" style="width: '+width+"px; height: "+height+'px;">';oeTags+='<embed src="'+params.thumbnailUrl+'" id="player'+this.playerCounter+'" href="'+quickTimeUrl1+'" type="video/mp4" height="'+height+'" width="'+width+'" target="myself" bgcolor="#000000"/>';oeTags+="</div>"}else{oeTags='<div style="width: '+width+"px; height: "+height+'px; overflow: hidden;">';var fclass="header";if(params.thumbnailUrl&&params.thumbnailUrl!=""){oeTags+='<img src="'+params.thumbnailUrl+'" width="'+width+'" height="'+height+'"/>';fclass="mediumHeader1"}if(!this.hasFlashVersion&&!this.hasQuicktime1){oeTags+='<div class="'+fclass+'" style="position: relative; top: -30px; height: 20px; padding: 5px 10px; background-color: #000000; color: #FFFFFF; opacity: .7; filter: alpha(opacity=70);">Get the latest Flash Player to watch trailers. <a href="'+this.GET_FLASH_PLAYER_URL+'" target="_blank">Get Flash</a></div>'}oeTags+="</div>"}}if(!TRLib.isEmbedded()&&this.hasFlashVersion&&$("player")){addLoadEvent(function(){$("player").innerHTML=oeTags})}else{if($("player")){$("player").innerHTML=""}document.write(oeTags)}};this.setVideo=function(url,tn,size,id,title,duration,url2){if(url=="null"||typeof url=="undefined"){url=""}VideoLib.videoURL=url;VideoLib.videoThumbnail=tn||"";VideoLib.videoSize=size;VideoLib.videoID=id;VideoLib.videoTitle=title;VideoLib.videoDuration=duration;VideoLib.videoURL2=url2;VideoLib.movieSetVideo();if(id!=null){this.highlightThumbnail(id,title)}};this.highlightID=null;this.highlightThumbnail=function(id,title){if(this.highlightID!=null){this.highlightSet("home",this.highlightID,"homeThumbnail");this.highlightSet(this.THUMBNAIL_MAIN,this.highlightID,"thumbnail2surround");this.highlightSet(this.THUMBNAIL_OWNER,this.highlightID,"thumbnail2surround");this.highlightSetGroups(this.highlightID,"thumbnail2surround")}this.highlightSet("home",id,"homeThumbnailCurrent");this.highlightSet(this.THUMBNAIL_MAIN,id,"thumbnail2current");this.highlightSet(this.THUMBNAIL_OWNER,id,"thumbnail2current");this.highlightSetGroups(this.highlightID,"thumbnail2current");this.highlightID=id;if($("nowPlaying")&&title){if(title.length>this.NOW_LIMIT){title=title.substring(0,this.NOW_LIMIT)+" ..."}$("nowPlaying").innerHTML=title;$("nowPlaying").onClick=function(){location.href="/video/"+id+"/";return false}}};this.highlightSetGroups=function(id,className){if(!$("groups")){return }var elems=$("groups").getElementsByTagName("td");for(i=0;i<elems.length;i++){if((elems[i].id.indexOf("thumbnail.")==0)&&(elems[i].id.indexOf(id)!=-1)){elems[i].className=className}}};this.highlightSet=function(which,id,className){var divID="thumbnail."+which+"."+id;if($(divID)){$(divID).className=className}};this.handleAutoplay=function(on){setCookie(VideoLib.AUTOPLAY_COOKIE_ID,(on?VideoLib.AUTOPLAY_ON:VideoLib.AUTOPLAY_OFF),365*5);if(on){showElement("autoplayOn_Disabled");hideElement("autoplayOn_Enabled");showElement("autoplayOff_Enabled");hideElement("autoplayOff_Disabled")}else{hideElement("autoplayOn_Disabled");showElement("autoplayOn_Enabled");hideElement("autoplayOff_Enabled");showElement("autoplayOff_Disabled")}var query={};query[VideoLib.ACTION]=VideoLib.LOG_AUTOPLAY_ACTION_VALUE;VideoLib.makeRequest(VideoLib.LOG_AUTOPLAY_ACTION_URL,query)};this.handleBrowseOkay=function(resp,elemName){$(elemName).innerHTML=resp.responseText};this.handleBrowseErr=function(err){VideoLib.logAtTop(err)};this.launchURL=function(url){if(url.indexOf("http://")==-1){url=this.HTTP_URL+url}if(TRLib.isEmbedded()){location.href=url;return }try{var src="jaman"+url.substr(4);var iframe=$("launchIFrame");if(!iframe){if(!MochiKit.DOM.attributeArray.compliant){iframe=document.createElement('<iframe id="launchIFrame" style="position: absolute; left: -10px; width: 1px; height: 1px;;" src="'+src+'" frameborder="0" scrolling="no"></iframe>')}else{iframe=document.createElement("iframe");iframe.setAttribute("id","launchIFrame");iframe.setAttribute("scrolling","no");iframe.setAttribute("frameborder","0");iframe.setAttribute("src",src);with(iframe.style){position="absolute";left="-10px";width="1px";height="1px"}}appendChildNodes(getElementsByTagAndClassName("body")[0],iframe)}else{iframe.src=src}}catch(e){}};this.openWindow=function(url,width,height,name,extraOptions,dontResize,omitPopupParam){var omitPopup=omitPopupParam||false;if(!omitPopup||TRLib.isEmbedded()){if(url.indexOf("?")==-1){url+="?"}else{url+="&"}url+=this.PARAM_IS_POPUP_NAME+"="+this.PARAM_TRUE_VALUE}if(TRLib.isEmbedded()){url="/initPopupWindow/?actualURL="+escape(url);if(dontResize){url+="&resizef=no"}}var top=(screen.availHeight-height)/2;var left=(screen.availWidth-width)/2;if(document.all){top=top-18;left=left-5}var options="resizable,height="+height+",width="+width+",top="+top+",left="+left;if(extraOptions){options+=","+extraOptions}if(name){name=name.replace(/-/g,"")}else{name=""}var nw=window.open(url,name,options);if(!nw){if(TRLib.isEmbedded()){return nw}alert(this.ERROR_OPEN_POPUP_WINDOW)}else{nw.focus()}return nw};this.WINDOW_HEIGHT_OFFSET=70;this.WINDOW_WIDTH_OFFSET=10;this.fitWindowToContent=function(isMoved){var dims=Jaman.getWindowInnerRect();var w=dims.contentWidth+this.WINDOW_WIDTH_OFFSET;var h=dims.contentHeight+this.WINDOW_HEIGHT_OFFSET;var deltaX=dims.contentWidth-dims.width;var deltaY=dims.contentHeight-dims.height;setTimeout(function(){window.resizeBy(deltaX,deltaY)},100);if(!isMoved){window.moveTo((screen.availWidth-w)/2,(screen.availHeight-h)/2)}return{width:w,height:h}};this.showDownloadClient=function(){var url=this.SHOW_DOWNLOAD_CLIENT_ACTION_URL+"?"+this.ACTION+"="+this.SHOW_DOWNLOAD_CLIENT_ACTION_NAME;if(this.currentVideoID&&this.currentVideoID!=""){url+="&videoID="+encodeURIComponent(this.currentVideoID)}location.href=url};this.showHelp=function(topic){var width=360;var height=520;var top=(screen.height-height)/2;var left=(screen.width-width)/2;var url="/help/index.html";if(this.helpNav){url+="#"+this.helpNav;if(this.helpSecnav){url+="_"+this.helpSecnav;if(topic){url+="_"+topic}}}var options="resizable,scrollbars,height="+height+",width="+width+",top="+top+",left="+left;var hw=window.open(url,"jhelp",options)};this.showThumbnailInfo=function(anchor,videoID,title){if(Jaman&&Jaman.MovieInfo){Jaman.MovieInfo.showInPopup(videoID,title)}};this.initUserMenu=function(id,userID,alias,iconSrc,iconSrc2,isContactsPage,activityLevel,popularityLevel,showUnblock){if(Jaman&&Jaman.UserMenu){var umenu=new Jaman.UserMenu(id,userID,alias,iconSrc,iconSrc2,isContactsPage,activityLevel,popularityLevel,showUnblock);umenu.connect();umenu.onImageMouseOver()}};this.onTrailerError=function(url){var d=MochiKit.Async.doSimpleXMLHttpRequest(url);d.addErrback(function(err){VideoLib.onTrailerErrorErr(err)})};this.onTrailerErrorErr=function(err){var msg="Sorry, could not find the video.";if(err.number=="403"){if(err.req.responseText!=""){var arr=err.req.responseText.split("\n");if(arr.length==2){msg=arr[1];if(arr[0]=="796"){if(this.getSessionID()){msg=this.ERROR_VIDEO_MATURE_CONTENT2}else{msg=this.ERROR_VIDEO_MATURE_CONTENT}}else{if(arr[0]=="797"){msg=this.ERROR_VIDEO_PRIVATE}}}}}var m=this.thisMovie();if(m!=null){m.showErrorMsg(msg)}};this.movieSetVideos=function(act){var m=this.thisMovie();if(m!=null){m.setVideos(act)}};this.setList=function(id,act){var theMovie="listviewer";var elem;if(navigator.appName.indexOf("Microsoft")!=-1){elem=window[theMovie]}else{elem=document[theMovie]}if(id&&id!=""){elem.fetchList(id)}else{elem.fetchAction(act)}};this.renderList=function(width,height,listID,action,useSSL){var html="";var hasFlashVersion2=DetectFlashVer(8,0,0);if(hasFlashVersion2){var flashVars="";if(listID&&listID!=""){flashVars+="&listID="+listID}else{flashVars+="&theAction="+action}flashVars+="&furl="+escape(CACHED_HOST+"/v"+VN_FLASHPLAYER+"/flash/embedded/jamanviewer.swf");flashVars+="&host="+this.HTTP_URL.substring(7);var oeTags=AC_FL_RunContent("src",CACHED_HOST+"/v"+VN_FLASHPLAYER+"/flash/widgets/listviewer.swf","width",width,"height",height,"name","listviewer","align","middle","menu","false","quality","high","scale","noscale","wmode","opaque","allowScriptAccess","always","allowFullScreen","true","flashvars",flashVars,"codebase",(useSSL?"https":"http")+"://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage",this.GET_FLASH_PLAYER_URL);html='<div id="listViewer.'+listID+'" style="width: '+width+"px; height: "+height+'px;"> </div>';addLoadEvent(function(){$("listViewer."+listID).innerHTML=oeTags})}else{html='<div style="padding:10px; border:1px solid #808080" class="header">Flash Player 8 or later is required to watch movies. <a href="'+this.GET_FLASH_PLAYER_URL+'" target="_blank">Get Flash</a>.</div>'}document.write(html)};this.renderWidget=function(width,height,movieSrc,params,altmsg,useSSL){var html="";var hasFlashVersion2=DetectFlashVer(8,0,0);if(hasFlashVersion2){var args=new Array("src",CACHED_HOST+(movieSrc.indexOf("/flash/")==0?"/v"+VN_FLASHPLAYER:"")+movieSrc,"width",width,"height",height,"align","middle","codebase",(useSSL?"https":"http")+"://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage",this.GET_FLASH_PLAYER_URL);if(params!=null){for(var key in params){args.push(key);args.push(params[key])}}html=AC_FL_RunContent.apply(this,args)}else{html='<div style="padding:10px; border:1px solid #808080" class="header" style="width: '+width+"px; height: "+height+'px;">'+altmsg+' <a href="'+this.GET_FLASH_PLAYER_URL+'" target="_blank">Get Flash</a>.</div>'}document.write(html)};this.openPopup2=function(name,anchor,closeFunc){TRLib.handleHidden();Jaman.Popup.showContent($(name),anchor,function(){TRLib.handleExposed();if(closeFunc){closeFunc()}})};this.closePopup2=function(){Jaman.Popup.hideContent()};this.getBackdropFrame=function(opa){var iframe=$("backdropIFrame");if(!iframe){if(!MochiKit.DOM.attributeArray.compliant){iframe=document.createElement('<iframe id="backdropIFrame" style="position: absolute; z-index: 7;" src="/empty.html" frameborder="0" scrolling="no"></iframe>')}else{iframe=document.createElement("iframe");iframe.setAttribute("id","backdropIFrame");iframe.setAttribute("scrolling","no");iframe.setAttribute("frameborder","0");iframe.setAttribute("src","/empty.html");iframe.style.position="absolute";iframe.style.opacity=0.7;iframe.style.zIndex=7}appendChildNodes(getElementsByTagAndClassName("body")[0],iframe)}if(!MochiKit.DOM.attributeArray.compliant){iframe.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opa+")"}else{iframe.style.opacity=opa/100}return iframe};this.openStreaming=function(url,watchNowURL,width,height,loadingMsg){var nw=VideoLib.openWindow(watchNowURL?"/loading/"+(loadingMsg?"?showMsg="+loadingMsg:""):url,width,height,"streamWindow","status=0,toolbar=0,location=0,menubar=0,scrollbars=0",true,true);if(nw){if(watchNowURL){location.href=watchNowURL;window.focus()}else{TRLib.handleHidden();if(MochiKit.DOM.attributeArray.compliant){window.blur()}}}};this.goToFeedbackPage=function(){var url=VideoLib.FEEDBACK_ACTION_URL+"?nextPage="+encodeURIComponent(location.href);location.href=VideoLib.makeUrl(url)};this.showCarouselPage=function(id,idx,max){var currIdx=$(id).getAttribute("cidx")||1;hideElement(id+"_page"+currIdx+"_1");showElement(id+"_page"+currIdx+"_2");$(id+"_page"+currIdx).style.display="none";$(id).setAttribute("cidx",idx);$(id+"_page"+idx).style.display="block";hideElement(id+"_page"+idx+"_2");showElement(id+"_page"+idx+"_1");hideElement(id+"_page_prev_"+(idx==1?2:1));showElement(id+"_page_prev_"+(idx==1?1:2));hideElement(id+"_page_next_"+(idx==max?2:1));showElement(id+"_page_next_"+(idx==max?1:2))};this.showCarouselPage2=function(id,num,max){var currIdx=$(id).getAttribute("cidx")||1;this.showCarouselPage(id,currIdx+num,max)};this.toggleElements=function(elem1,elem2,effecttype){if(effecttype&&MochiKit.Visual){if(effecttype=="size"){}else{if(effecttype=="slide"){}else{if(effecttype=="blinds"){effecttype="blind"}else{effecttype="appear"}}}MochiKit.Visual.toggle(elem1,effecttype);MochiKit.Visual.toggle(elem2,effecttype)}else{showElement(elem2);hideElement(elem1)}}};copyrightNotice="* Copyright (c) 2006-07 jaman.com, Inc.  All rights reserved. *";Jaman={};Jaman.isSafari=((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("AppleWebKit")!=-1));Jaman.jamDetectorActiveXInstalled=function(){try{var C=new ActiveXObject("JamDetectorLib.JamDetector");return C.IsJamanAvailable}catch(B){return false}};Jaman.jamDetectorActiveXVersion=function(){try{var C=new ActiveXObject("JamDetectorLib.JamDetector");if(C.IsJamanAvailable){return C.JamanVersion}}catch(B){return""}};Jaman.mozillaPluginDetected=function(){var B=Jaman.mozillaPluginVersion();return B?true:false};Jaman.mozillaPluginVersion=function(){try{var D=document.createElement("DIV");D.innerHTML='<object id="jamanPlugin" type="application/jaman-plugin" />';document.body.appendChild(D);var E=document.getElementById("jamanPlugin");var B=E.jamanVersion;document.body.removeChild(D);return B}catch(C){return""}return""};Jaman.destroyObject=function(C){if(!C){return }if(C.onmouseover){C.onmouseover=null}if(C.onmouseout){C.onmouseout=null}if(C.onmousedown){C.onmousedown=null}if(C.onmouseup){C.onmouseup=null}if(C.onclick){C.onclick=null}if(C.childNodes){for(var B=0;B<C.childNodes.length;B++){Jaman.destroyObject(C.childNodes[B])}}};Jaman.imagePNG=function(E,D,B,C){if(!MochiKit.DOM.attributeArray.compliant){var F=IMG({src:VNimages("/blank.gif"),width:D,height:B,"class":C});F.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VNimages(E)+"', sizingMethod='scale')";return F}else{return IMG({src:VNimages(E),width:D,height:B,"class":C})}};Jaman.setPNGSrc=function(B,C){if(!MochiKit.DOM.attributeArray.compliant){B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VNimages(C)+"', sizingMethod='scale')"}else{B.src=VNimages(C)}};Jaman.setPNGBG=function(C,B){if(!MochiKit.DOM.attributeArray.compliant){C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VNimages(B)+"', sizingMethod='scale')"}else{C.style.backgroundImage="url('"+VNimages(B)+"')"}};Jaman.createButton=function(H,E,G,D,B){var F=Button.buttonArray[E];if(F){var C=new Button(H,F.normalImageSrc,F.overImageSrc,F.downImageSrc,G,D,B);return C}return null};Jaman.GRAPHIC_BUTTON_GRAY_NARROW="_secondary";Jaman.GRAPHIC_BUTTON_GRAY="_secondary";Jaman.GRAPHIC_BUTTON_BLUE="_secondary";Jaman.GRAPHIC_BUTTON_RUST="";Jaman.GRAPHIC_BUTTON_RUST_DL="";Jaman.GRAPHIC_BUTTON_GREEN="";Jaman.GRAPHIC_BUTTON_OUTLINE="";Jaman.GRAPHIC_BUTTON_SIZE_SMALL="sm";Jaman.GRAPHIC_BUTTON_SIZE_MEDIUM="md";Jaman.GRAPHIC_BUTTON_SIZE_LARGE="lg";Jaman.GRAPHIC_BUTTON_SIZE_XLARGE="xl";Jaman.GRAPHIC_BUTTON_SIZE_NARROW="nr";Jaman.createGraphicButton=function(C,G,H,D,J,B){var I=null;if(B){I=IMG({src:VNimages("/button_images/pulldown"+G+"_right.gif"),id:C+"_RightImg"});I.style.margin="2px 0px 3px 5px";I.style.verticalAlign="middle"}var E="";if(G!=""){E=" graphicButton"+G}var F=A({href:"#","class":"graphicButton graphicButton_"+J+E,id:C+"_A"},STRONG(null,STRONG(null,STRONG(null,H,I))));F.onclick=D;return F};Jaman.createSimpleButton=function(F,B,E,D){var C=A({href:"#","class":D},B);if(this.id){C.setAttribute("id",this.id)}C.onclick=E;return C};Jaman.createEditButtons=function(C,I,F,K,B){var E={border:"0","class":"graphicButtonSet"};if(!B){E.width="100%"}var G=null;if(!B){G={width:"100%",align:"right"}}var J=TD(G,Jaman.createGraphicButton(C+"cancel",Jaman.GRAPHIC_BUTTON_GRAY,"cancel",I,Jaman.GRAPHIC_BUTTON_SIZE_SMALL));J.style.paddingRight="5px";var H=TD(null,Jaman.createGraphicButton(C+"save",Jaman.GRAPHIC_BUTTON_BLUE,"save",F,Jaman.GRAPHIC_BUTTON_SIZE_SMALL));var D=null;if(K&&K.length>0){D=TR(null,TD({"class":"ago",width:"100%"},createDOM("I",null,K)),J,H)}else{D=TR(null,J,H)}return TABLE(E,TBODY(null,D))};Jaman.pluringular=function(D,B,C){if(D==1){return D+" "+B}else{return D+" "+C}};Jaman.renderAgo=function(C){var B=(new Date()).getTime()/1000;var D=B-C;if(D<60){return"just now"}else{if(D<60*60){return Jaman.pluringular(Math.round(D/60),"minute ago","minutes ago")}else{if(D<60*60*24){return Jaman.pluringular(Math.round(D/(60*60)),"hour ago","hours ago")}else{if(D<60*60*24*7){return Jaman.pluringular(Math.round(D/(60*60*24)),"day ago","days ago")}else{if(D<60*60*24*30){return Jaman.pluringular(Math.round(D/(60*60*24*7)),"week ago","weeks ago")}else{if(D<60*60*24*365){return Jaman.pluringular(Math.round(D/(60*60*24*30)),"month ago","months ago")}else{return Jaman.pluringular(Math.round(D/(60*60*24*365)),"year ago","years ago")}}}}}}};Jaman.formatTime=function(E){var F="";var B=Math.floor(E/3600);var D=E-B*3600;var C=Math.floor(D/60);D=D-C*60;if(B<10){F+="0"}F+=B+":";if(C<10){F+="0"}F+=C+":";if(D<10){F+="0"}F+=D;return F};Jaman.renderHShim=function(B){return IMG({"class":"spacer",src:VNimages("/blank.gif"),height:"1",width:B})};Jaman.renderVShim=function(B){return IMG({"class":"spacer",src:VNimages("/blank.gif"),height:B,width:"1"})};Jaman.enhancedArray=function(){var B=new Array();B.remove=function(C){if(this.length==0||C>=this.length){return null}var D=this[C];this[C]=null;if(C<(this.length-1)){while(C<(this.length-1)){this[C]=this[C+1];C++}}this.length=this.length-1;return D};B.move=function(D,F){if(this.length==0||D>=this.length||F>=this.length){return false}if(D!=F){var E=this.remove(D);for(var C=this.length;C>F;C--){this[C]=this[C-1]}this[F]=E}return true};if(!B.pop){B.pop=function(){if(this.length==0){return null}var C=this[this.length-1];this.length=this.length-1;return C}}return B};if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/(^\s+)|\s+$/g,"")}}String.prototype.truncate=function(C,B){C=C||30;B=B===undefined?"...":B;return this.length>C?this.slice(0,C-B.length)+" "+B:this};Jaman.getFormElement=function(D,B){for(var C=0;C<D.elements.length;C++){if(D.elements[C].name==B){return D.elements[C]}}return null};Jaman.setFloat=function(elem,val){with(elem.style){styleFloat=val;cssFloat=val}};Jaman.createTextNode=function(E,B,H){if(!E||E.length==0||(H&&H==0)||(B&&B==0)){return null}var F=E.replace(/\r/g,"").split("\n");if(!H||H>F.length){H=F.length}if(B){var I=0;for(var D=0;D<H;D++){if(F[D].length+I>B){H=D+1;F[D]=F[D].substring(0,B-I);if(H==F.length){F[D]=F[D]+"..."}break}I+=F[D].length}}if(H<F.length){F[H-1]=F[H-1]+"..."}for(var D=0;D<F.length;D++){F[D]=F[D].replace(/\s+/g," ")}if(F.length==1||H==1){return Jaman.injectBreaks(document.createTextNode(F[0]))}else{var J=Jaman.enhancedArray();for(var D=0;D<H;D++){var G=Jaman.injectBreaks(document.createTextNode(F[D]));for(var C=0;C<G.length;C++){J.push(G[C])}if(D<H-1){J.push(BR(null))}}return J}};Jaman.injectBreaks=function(G){var B=Jaman.enhancedArray();var D=G.data.search(/([^\s\/]{10})(?=[^\s\/])/);if(D==-1){B.push(G)}else{if(Jaman.isSafari){var F=G.data.replace(/([^\s\/]{10})(?=[^\s\/])/g,"$1&8203;");var C=SPAN(null);C.innerHTML=F;while(C.firstChild){B.push(C.removeChild(C.firstChild))}}else{B.push(G);var E=G;while(D>=0){E=E.splitText(D+10);B.push(document.createElement("WBR"));B.push(E);D=E.data.search(/([^\s\/]{10})(?=[^\s\/])/)}}}return B};Jaman.replaceInnerText=function(G,B,C,D){while(G.firstChild){G.removeChild(G.firstChild)}var E=Jaman.createTextNode(B,C,D);for(var F=0;F<E.length;F++){G.appendChild(E[F])}};Jaman.getWindowInnerRect=function(){var B={top:0,left:0,width:0,height:0,contentWidth:0,contentHeight:0};if(window.innerWidth){B.left=window.pageXOffset;B.top=window.pageYOffset;B.width=window.innerWidth;B.height=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientWidth){B.left=document.documentElement.scrollLeft;B.top=document.documentElement.scrollTop;B.width=document.documentElement.clientWidth;B.height=document.documentElement.clientHeight}else{if(document.body){B.left=document.body.scrollLeft;B.top=document.body.scrollTop;B.width=document.body.clientWidth;B.height=document.body.clientHeight}}}if(document.body.scrollHeight>document.body.offsetHeight||document.body.scrollWidth>document.body.offsetWidth){B.contentWidth=document.body.scrollWidth;B.contentHeight=document.body.scrollHeight}else{B.contentWidth=document.body.offsetWidth;B.contentHeight=document.body.offsetHeight}return B};Jaman.getOffset=function(C,E){var D=E.charAt(0).toUpperCase()+E.substring(1);var F=0;var B=MochiKit.Style.getStyle(C,"padding"+D);if(B){B=parseInt(B);if(!isNaN(B)){F=B}}B=MochiKit.Style.getStyle(C,"border"+D+"Width");if(B){B=parseInt(B);if(!isNaN(B)){F+=B}}return F};Jaman.setCookie=function(D,F,B,I,E,H){var C=new Date();C.setTime(C.getTime());if(B){B=B*1000*60*60*24}var G=new Date(C.getTime()+B);document.cookie=D+"="+escape(F)+(B?";expires="+G.toGMTString():"")+(I?";path="+I:"")+(E?";domain="+E:"")+(H?";secure":"")};Jaman.getCookie=function(B){var G=document.cookie.split(";");var C="";var E="";var F="";var D=false;for(i=0;i<G.length;i++){C=G[i].split("=");E=C[0].replace(/^\s+|\s+$/g,"");if(E==B){D=true;F=unescape(C[1].replace(/^\s+|\s+$/g,""));return F;break}C=null;E=""}if(!D){return null}};Jaman.emailRegex=/^[\w\.\-\!\#\$\%\&\'\*\+\-\/\=\?\^\_\`\{\|\}\~]{1,80}@[\w\-\.]{1,80}\.[a-z]{2,10}$/i;Jaman.isValidEmail=function(B){return Jaman.emailRegex.test(B)};Jaman.breakWord=function(C){if(!C||C.nodeType!==1){return false}else{if(C.currentStyle&&typeof C.currentStyle.wordBreak==="string"){breakWord=function(D){D.runtimeStyle.wordBreak="break-all";return true};return breakWord(C)}else{if(document.createTreeWalker){var B=function(F){F=F.replace(/^\s\s*/,"");var D=/\s/,E=F.length;while(D.test(F.charAt(--E))){}return F.slice(0,E+1)};breakWord=function(D){var E=document.createTreeWalker(D,NodeFilter.SHOW_TEXT,null,false);var G,F,H=String.fromCharCode("8203");while(E.nextNode()){G=E.currentNode;F=B(G.nodeValue).split("").join(H);G.nodeValue=F}return true};return breakWord(C)}else{return false}}}};Button=function(H,E,D,G,F,C,B){this.id=H;this.callback=F;this.className=C||"";this.label=B;this.normalImageSrc=E;this.overImageSrc=D;this.downImageSrc=G;this.imgDOM=null;this.dom=null;this.labelDOM=null;this.imgLinkDOM=null};Button.prototype.destroy=function(){if(this.imgLinkDOM){this.imgLinkDOM.onclick=null;this.imgLinkDOM.onmouseover=null;this.imgLinkDOM.onmouseout=null;this.imgLinkDOM.onmousedown=null;this.imgLinkDOM.onmouseup=null}this.imgDOM=null;this.dom=null;if(this.labelDOM){this.labelDOM.onclick=null}this.labelDOM=null;this.imgLinkDOM=null};Button.prototype.getDOM=function(){if(this.dom){return this.dom}var B=this;this.imgDOM=IMG({src:this.normalImageSrc,border:"0"});if(Button.isIE&&(Button.IEVersion<7)&&(this.normalImageSrc.toLowerCase().indexOf(".png")>0)){this.imgDOM.src=VNimages("/blank.gif");this.imgDOM.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.normalImageSrc+"', sizingMethod='image')"}this.imgLinkDOM=A({href:"#"},this.imgDOM);this.imgLinkDOM.onclick=this.callback;this.imgLinkDOM.onmouseover=function(){return B.changeOver()};this.imgLinkDOM.onmouseout=function(){return B.changeNormal()};this.imgLinkDOM.onmousedown=function(){return B.changeDown()};this.imgLinkDOM.onmouseup=function(){return B.changeOver()};if(this.id){this.imgDOM.setAttribute("id",this.id+"-img");this.imgLinkDOM.setAttribute("id",this.id)}if(!this.label||this.label==""){this.dom=this.imgLinkDOM}else{this.labelDOM=A({href:"#","class":this.className},this.label);this.labelDOM.onclick=this.callback;this.dom=SPAN(null,this.imgLinkDOM," ",this.labelDOM);this.dom.style.whiteSpace="nowrap";if(this.id){this.dom.setAttribute("id",this.id+"-span");this.labelDOM.setAttribute("id",this.id+"-label")}}return this.dom};Button.prototype.generateHTML=function(){var B='<a href="#" id="'+this.id+'" onMouseOver="return this.button.changeOver();" onMouseOut="return this.button.changeNormal();" onMouseDown="return this.button.changeDown();" onMouseUp="return this.button.changeOver();" onClick="'+this.callback+'";>';B+='<img id="'+this.id+'-img" src="'+this.normalImageSrc+'" border="0"></a>';return B};Button.prototype.write=function(){document.write(this.generateHTML());$(this.id).button=this};Button.prototype.setSource=function(B){if(this.id){this.imgDOM=$(this.id+"-img")}if(Button.isIE&&(Button.IEVersion<7)&&(B.toLowerCase().indexOf(".png")>0)){this.imgDOM.filters(0).src=B}else{this.imgDOM.src=B}};Button.prototype.changeNormal=function(){this.setSource(this.normalImageSrc);return true};Button.prototype.changeDown=function(){this.setSource(this.downImageSrc);return true};Button.prototype.changeOver=function(){this.setSource(this.overImageSrc);return true};Button.prototype.show=function(){if(this.dom){showElement(this.dom)}};Button.prototype.hide=function(){if(this.dom){hideElement(this.dom)}};Button.buttonArray=new Array();Button.buttonChangeNormal=function(C,B){Button.buttonArray[B].id=C;Button.buttonArray[B].changeNormal();return true};Button.buttonChangeDown=function(C,B){Button.buttonArray[B].id=C;Button.buttonArray[B].changeDown();return true};Button.buttonChangeOver=function(C,B){Button.buttonArray[B].id=C;Button.buttonArray[B].changeOver();return true};Button.hideButton=function(B){hideElement(B);if(typeof B=="string"){hideElement(B+"-span")}};Button.showButton=function(B){showElement(B);if(typeof B=="string"){showElement(B+"-span")}};Button.BUTTON_EDIT="0";Button.BUTTON_TOGGLE_PLUS="1";Button.BUTTON_TOGGLE_MINUS="2";Button.BUTTON_REPLY="3";Button.BUTTON_NAV_NEXT="4";Button.BUTTON_NAV_PREV="5";Button.BUTTON_POPUP="6";Button.BUTTON_DELETE="7";Button.BUTTON_LEARN="10";Button.BUTTON_GETSEEN="11";Button.BUTTON_CLOSE="12";bPath=VNimages("/xs_button_images/");Button.buttonArray[Button.BUTTON_EDIT]=new Button("",bPath+"edit_static.gif",bPath+"edit_over.gif",bPath+"edit_down.gif","");Button.buttonArray[Button.BUTTON_TOGGLE_PLUS]=new Button("",bPath+"plus_static.gif",bPath+"plus_over.gif",bPath+"plus_down.gif","");Button.buttonArray[Button.BUTTON_TOGGLE_MINUS]=new Button("",bPath+"minus_static.gif",bPath+"minus_over.gif",bPath+"minus_down.gif","");Button.buttonArray[Button.BUTTON_REPLY]=new Button("",bPath+"reply_static.gif",bPath+"reply_over.gif",bPath+"reply_down.gif","");Button.buttonArray[Button.BUTTON_NAV_NEXT]=new Button("",bPath+"nav_next_static.gif",bPath+"nav_next_over.gif",bPath+"nav_next_down.gif","");Button.buttonArray[Button.BUTTON_NAV_PREV]=new Button("",bPath+"nav_prev_static.gif",bPath+"nav_prev_over.gif",bPath+"nav_prev_down.gif","");Button.buttonArray[Button.BUTTON_POPUP]=new Button("",bPath+"popup_static.gif",bPath+"popup_over.gif",bPath+"popup_down.gif","");Button.buttonArray[Button.BUTTON_DELETE]=new Button("",bPath+"delete_static.gif",bPath+"delete_over.gif",bPath+"delete_down.gif","");Button.buttonArray[Button.BUTTON_LEARN]=new Button("",bPath+"button_learn_static.png",bPath+"button_learn_over.png",bPath+"button_learn_down.png","");Button.buttonArray[Button.BUTTON_GETSEEN]=new Button("",bPath+"button_getseen_static.png",bPath+"button_getseen_over.png",bPath+"button_getseen_down.png","");Button.buttonArray[Button.BUTTON_CLOSE]=new Button("",bPath+"btn_closebox_static.png",bPath+"btn_closebox_over.png",bPath+"btn_closebox_down.png","");Button.isIE=(navigator.userAgent.indexOf("MSIE")!=-1);if(Button.isIE){version=navigator.userAgent.split("MSIE");Button.IEVersion=parseInt(version[1])}VideoLib.DateTime=new function(){this.MONTHS="overwrite in PHP file";this.toShortDate=function(C){var B=this.MONTHS[C.getMonth()]+" "+C.getDate();B+=", "+C.getFullYear();return B}};var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(D){var B="";var K,I,G,J,H,F,E;var C=0;D=Base64._utf8_encode(D);while(C<D.length){K=D.charCodeAt(C++);I=D.charCodeAt(C++);G=D.charCodeAt(C++);J=K>>2;H=((K&3)<<4)|(I>>4);F=((I&15)<<2)|(G>>6);E=G&63;if(isNaN(I)){F=E=64}else{if(isNaN(G)){E=64}}B=B+this._keyStr.charAt(J)+this._keyStr.charAt(H)+this._keyStr.charAt(F)+this._keyStr.charAt(E)}return B},decode:function(D){var B="";var K,I,G;var J,H,F,E;var C=0;D=D.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(C<D.length){J=this._keyStr.indexOf(D.charAt(C++));H=this._keyStr.indexOf(D.charAt(C++));F=this._keyStr.indexOf(D.charAt(C++));E=this._keyStr.indexOf(D.charAt(C++));K=(J<<2)|(H>>4);I=((H&15)<<4)|(F>>2);G=((F&3)<<6)|E;B=B+String.fromCharCode(K);if(F!=64){B=B+String.fromCharCode(I)}if(E!=64){B=B+String.fromCharCode(G)}}B=Base64._utf8_decode(B);return B},_utf8_encode:function(C){C=C.replace(/\r\n/g,"\n");var B="";for(var E=0;E<C.length;E++){var D=C.charCodeAt(E);if(D<128){B+=String.fromCharCode(D)}else{if((D>127)&&(D<2048)){B+=String.fromCharCode((D>>6)|192);B+=String.fromCharCode((D&63)|128)}else{B+=String.fromCharCode((D>>12)|224);B+=String.fromCharCode(((D>>6)&63)|128);B+=String.fromCharCode((D&63)|128)}}}return B},_utf8_decode:function(B){var C="";var D=0;var E=c1=c2=0;while(D<B.length){E=B.charCodeAt(D);if(E<128){C+=String.fromCharCode(E);D++}else{if((E>191)&&(E<224)){c2=B.charCodeAt(D+1);C+=String.fromCharCode(((E&31)<<6)|(c2&63));D+=2}else{c2=B.charCodeAt(D+1);c3=B.charCodeAt(D+2);C+=String.fromCharCode(((E&15)<<12)|((c2&63)<<6)|(c3&63));D+=3}}}return C}};TRLib=new function(){this.isPlayingBeforeHide={};this.afterLoginPage=null;this.needsLogin=false;this.hideTimer=null;this.TRAILER_COOKIE_ID="overwrite in PHP file";this.isEmbedded=function(){if(getCookie(this.TRAILER_COOKIE_ID)!=null){return true}else{return false}};this.checkLoggedIn=function(){if(this.isEmbedded()){var B=this.getSessionID();if((B!="")&&(B!=getCookie(VideoLib.TRSESSION_COOKIE_ID))){this.setLoginCookies()}}};this.setLoginCookies=function(){s=escape(this.getSessionID());s=s.replace(/\+/g,"%2B");setCookie(VideoLib.TRSESSION_COOKIE_ID,s);setCookie(VideoLib.TRLOGIN_COOKIE_ID,TRLib.getAlias())};this.handleLoggedIn=function(){var B=this.getSessionID();if(B==""){return }this.setLoginCookies();if(this.afterLoginPage){location.href=this.afterLoginPage}else{location.reload(true)}};this.handleLoginCancelled=function(){setTimeout("TRLib.afterLoginPage = null",250)};this.handleLoginDone=function(){var B=TRLib.getSessionID();if(B==""){return }TRLib.setLoginCookies();if(TRLib.afterFacebookLoginDone){TRLib.afterFacebookLoginDone()}else{if(TRLib.afterLoginPage){location.href=TRLib.afterLoginPage}else{location.reload(true)}}};this.handleDoLogin=function(){var B=this.getClient();if(B!=null&&B.TR_clientStorage!=null){var C=B.TR_clientStorage;if(C&&C!=""){B.TR_doLogin=C}else{this.handleLoginPrompt()}}};this.handleFacebookLogin=function(){if(TRLib.afterLoginPage){JAMAN.FacebookConnect.signinAndRedirect(TRLib.afterLoginPage)}else{JAMAN.FacebookConnect.signin()}};this.afterFacebookLogin=function(D,E,F){TRLib.afterFacebookLoginDone=F;var B=TRLib.getClient();if(B!=null&&B.TR_clientStorage!=null){var C=new Array();C.push({name:"alias",value:D});C.push({name:"password",value:Base64.encode(E)});B.TR_doLogin=createXMLElement("doLogin",C)}};this.handleRegister=function(B){VideoLib.openRegisterPopup(this.afterLoginPage)};this.handleConfirmedPurchase=function(){MainLib.handleStoredAuth()};this.handleJoinedDomain=function(){};this.handleJoinedDomainContext=function(B){};this.handleJoinDomainFailed=function(){VideoLib.logAtTop("Failed to join domain.")};this.handleJoinDomainFailedContext=function(B){VideoLib.logAtTop("Failed to join domain: "+B)};this.handleLoggedOut=function(){this.afterLoginPage=null;VideoLib.handleLogout()};this.handleHidden=function(){clearTimeout(this.hideTimer);var E=false;for(var C=0;C<VideoLib.playerCounter;C++){var B=this.getPlayer("player"+(C+1));try{if(B&&B.PercentLoaded()==100){if(VideoLib.mainPlayerCounter==(C+1)){E=true}this.isPlayingBeforeHide["player"+(C+1)]=B.getIsPlaying();B.handlePause()}}catch(D){}}if(!E){this.hideTimer=setTimeout("TRLib.handleHidden()",1000)}};this.handleExposed=function(){clearTimeout(this.hideTimer);for(var C=0;C<VideoLib.playerCounter;C++){if(this.isPlayingBeforeHide["player"+(C+1)]){var B=this.getPlayer("player"+(C+1));if(B){B.handlePlay()}}}};this.getClient=function(){if((window.external)&&(typeof window.external.TR_getAlias=="string")){return window.external}return null};this.getAlias=function(){var B=this.getClient();if(B!=null){return B.TR_getAlias}else{return""}};this.getSessionID=function(){var B=this.getClient();if(B!=null){return B.TR_getSessionID}else{return""}};this.getDRMVersion=function(){var B=this.getClient();if(B!=null){return B.TR_getDRMVersion}};this.getClientVersion=function(){var B=this.getClient();if(B!=null){var C=B.TR_getClientVersion;if(C.indexOf(".")==-1){C="0.7"}return C}};this.getIsVisible=function(){var B=this.getClient();if(B!=null){return(B.TR_browserIsVisible==1)}return true};this.handleLoginPrompt=function(E,D){var B=this.getClient();if(B!=null){var C=new Array();C.push({name:"reason",value:E});if(D&&D.length>0){C.push({name:"alias",value:D})}B.TR_handleLoginPrompt=createXMLElement("loginPrompt",C)}};this.handleSessionExpired=function(){var B=this.getClient();if(B!=null){B.TR_handleSessionExpired=""}};this.handleStaleSession=function(){var B=this.getClient();if(B!=null){if(B.TR_handleStaleSession){B.TR_handleStaleSession=""}else{B.TR_handleSessionExpired=""}}};this.handleConfirmPurchase=function(C){var B=this.getClient();if(B!=null){B.TR_handleConfirmPurchase=C}};this.handleJoinDomain=function(){var B=this.getClient();if(B!=null){B.TR_handleJoinDomain=""}};this.handleJoinDomainContext=function(D){var B=this.getClient();if(B!=null){var C=new Array();C.push({name:"makeShippingComputer",value:(D?1:0)});B.TR_handleJoinDomainContext=createXMLElement("context",C)}};this.submitUserFeedback=function(F,C,E,G){var B=this.getClient();if(B!=null){var D=new Array();D.push({name:"name",value:F});D.push({name:"email",value:C});D.push({name:"subject",value:E});D.push({name:"comments",value:G});log(createXMLElement("context",D));B.TR_submitUserFeedback=createXMLElement("context",D)}};this.handleDownload=function(F,C,I,H,E,G){var B=this.getClient();if(B!=null){var D=new Array();D.push({name:"videoID",value:I});D.push({name:"title",value:H});D.push({name:"downloadToken",value:F});D.push({name:"downloadVideoTorrentURL",value:C});D.push({name:"confirmationNumber",value:G});D.push({name:"videoSize",value:E});B.TR_handleDownload=createXMLElement("download",D)}};this.handleRenewal=function(C,F,E){var B=this.getClient();if(B!=null){var D=new Array();D.push({name:"videoID",value:F});D.push({name:"licenseID",value:C});D.push({name:"confirmationNumber",value:E});log(createXMLElement("licenseInfo",D));B.TR_handleRenewal=createXMLElement("licenseInfo",D)}};this.handleShowLibrary=function(C){var B=this.getClient();B.TR_handleShowLibrary=C};this.handleDownloadOrPurchaseOkay=function(){hideElement("DP_Progress")};this.handleDownloadOrPurchaseError=function(){hideElement("DP_Progress");showElement("DP_Error")};this.handleRegisterStore=function(C,E){var B=this.getClient();if(B!=null&&B.TR_clientStorage!=null){var D=new Array();D.push({name:"alias",value:C});D.push({name:"password",value:E});B.TR_clientStorage=createXMLElement("doLogin",D)}};this.handleUpdateRegisterStore=function(C){var B=this.getClient();if(B!=null&&B.TR_clientStorage!=null){var E=B.TR_clientStorage;if(E&&E!=""){var D=parseXMLString(E);pvalue=D.childNodes[1].childNodes[0].nodeValue;this.handleRegisterStore(C,pvalue)}}};this.getInstalledBy=function(C,D){var B=this.getClient();if(B!=null&&B.TR_getInstalledByName!=null){return B.TR_getInstalledByName}return null};this.checkForUpdates=function(){var B=this.getClient();if(B!=null){B.TR_checkForUpdates="1"}};this.getPlayer=function(C){var B=null;if(navigator.userAgent.indexOf("MSIE")!=-1){B=window[C]}else{B=document[C]}return B}};addLoadEvent(function(){setTimeout("TRLib.checkLoggedIn()",500)});Jaman.GraphicButton=function(F,D,E,B,C){this.id=F;this.size=D;this.type=E;this.isSecondary=B;this.disableOnClick=C;this.label="";this.dom=null;this.msgDOM=null;this.isDisabled=false;this.onClickFunc=null;this.baseZIndex=0;Jaman.GraphicButton.buttons.push(this)};Jaman.GraphicButton.prototype.destroy=function(){if(this.dom){Jaman.destroyObject(this.dom)}this.dom=null};Jaman.GraphicButton.prototype.connect=function(C){if(!C&&this.dom){return }var B=this;this.dom=$(this.id+"_A");if(!this.dom){return }this.onClickFunc=this.dom.onclick;if(this.disableOnClick){this.dom.onclick=function(){B.onSelect();return false}}this.msgDOM=$(this.id+"_rollover");if(this.msgDOM){this.dom.onmouseover=function(){B.showMsg();return false};this.dom.onmouseout=function(){B.hideMsg();return false}}};Jaman.GraphicButton.prototype.show=function(){showElement(this.id+"_A")};Jaman.GraphicButton.prototype.hide=function(){hideElement(this.id+"_A")};Jaman.GraphicButton.prototype.disable=function(){MochiKit.DOM.addElementClass(this.dom,"graphicButton_disabled");this.dom.onclick=function(){return false};this.isDisabled=true};Jaman.GraphicButton.prototype.enable=function(){MochiKit.DOM.removeElementClass(this.dom,"graphicButton_disabled");if(this.disableOnClick){var B=this;this.dom.onclick=function(){B.onSelect();return false}}else{this.dom.onclick=this.onClickFunc}this.isDisabled=false};Jaman.GraphicButton.prototype.setHandler=function(B){this.onClickFunc=B};Jaman.GraphicButton.prototype.setLabel=function(B){this.label=B;if(this.dom){this.dom.firstChild.firstChild.firstChild.innerHTML=B}};Jaman.GraphicButton.prototype.getMsgDOM=function(){if(!this.msgDOM){this.msgDOM=DIV({"class":"graphicButtonInfo",id:this.id+"_rollover"}," ");this.msgDOM.style.display="none";if(this.dom){var B=this;this.dom.onmouseover=function(){B.showMsg();return false};this.dom.onmouseout=function(){B.hideMsg();return false}}}return this.msgDOM};Jaman.GraphicButton.prototype.setMsg=function(B){if(!this.msgDOM){return }this.msgDOM.innerHTML=B};Jaman.GraphicButton.prototype.getDOM=function(){if(this.dom){return this.dom}var C=this;var B="";if(this.type!=""){B=" graphicButton"+this.type}this.dom=A({href:"#","class":"graphicButton graphicButton_"+this.size+B,id:this.id+"_A"},STRONG(null,STRONG(null,STRONG(null,this.label))));this.dom.onclick=function(){C.onSelect();return false};if(this.msgDOM){this.dom.onmouseover=function(){C.showMsg();return false};this.dom.onmouseout=function(){C.hideMsg();return false}}return this.dom};Jaman.GraphicButton.prototype.onSelect=function(){if(!this.isDisabled){if(this.disableOnClick){this.disable()}return this.onClickFunc.apply(this.dom,arguments)}return false};Jaman.GraphicButton.prototype.needsEnabled=function(){return(this.disableOnClick&&this.isDisabled)};Jaman.GraphicButton.prototype.showMsg=function(){if(!this.msgDOM){return }with(this.msgDOM.style){position="absolute";zIndex=this.baseZIndex+5}if(this.isDisabled){this.msgDOM.style.display="none"}else{this.dom.style.zIndex=this.baseZIndex+6;var pos=getElementPosition(this.dom);if(this.msgDOM.parentNode==this.dom.parentNode&&getStyle(this.msgDOM.offsetParent,"position")!="static"){pos.x=this.dom.offsetLeft;pos.y=this.dom.offsetTop}var topPad=this.dom.offsetHeight+15;with(this.msgDOM.style){width=this.dom.offsetWidth+"px";left=pos.x-8+"px";top=pos.y-9+"px";paddingTop=topPad+10+"px";backgroundPosition="50% "+topPad+"px";display="block"}}};Jaman.GraphicButton.prototype.hideMsg=function(){if(this.msgDOM){this.msgDOM.style.display="none"}if(!this.isDisabled){this.dom.style.zIndex=this.baseZIndex+1}};Jaman.GraphicButton.buttons=new Array();Jaman.GraphicButton.enableAllButtons=function(){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){if(Jaman.GraphicButton.buttons[B].needsEnabled()){Jaman.GraphicButton.buttons[B].enable()}}};Jaman.GraphicButton.enableButton=function(C){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){if(Jaman.GraphicButton.buttons[B].id==C){Jaman.GraphicButton.buttons[B].enable();return }}};Jaman.GraphicButton.disableButton=function(C){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){if(Jaman.GraphicButton.buttons[B].id==C){Jaman.GraphicButton.buttons[B].disable();return }}};Jaman.GraphicButton.reconnectButton=function(C){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){if(Jaman.GraphicButton.buttons[B].id==C){Jaman.GraphicButton.buttons[B].connect(true);return }}};Jaman.GraphicButton.connectButtons=function(){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){Jaman.GraphicButton.buttons[B].connect()}};Jaman.GraphicButton.disconnectButtons=function(){for(var B=0;B<Jaman.GraphicButton.buttons.length;B++){Jaman.GraphicButton.buttons[B].destroy()}};addToCallStack(window,"onunload",Jaman.GraphicButton.disconnectButtons,true);Jaman.Popup=function(C){this.id=C;this.dom=null;this.topLeft=null;this.topCenter=null;this.topRight=null;this.middleLeft=null;this.middleCenter=null;this.middleRight=null;this.bottomLeft=null;this.bottomCenter=null;this.bottomRight=null;this.closeBtnDOM=null;this.closeBtn=null;this.currentContent=null;this.contents=new Array();var B=this;addToCallStack(window,"onunload",function(){B.destroy()},true)};Jaman.Popup.prototype.destroy=function(){if(this.dom){this.closeBtn.destroy();Jaman.destroyObject(this.topLeft);Jaman.destroyObject(this.topCenter);Jaman.destroyObject(this.topRight);Jaman.destroyObject(this.middleLeft);Jaman.destroyObject(this.middleCenter);Jaman.destroyObject(this.middleRight);Jaman.destroyObject(this.bottomLeft);Jaman.destroyObject(this.bottomCenter);Jaman.destroyObject(this.bottomRight);Jaman.destroyObject(this.closeBtnDOM);Jaman.destroyObject(this.dom)}this.dom=null;this.topLeft=null;this.topCenter=null;this.topRight=null;this.middleLeft=null;this.middleCenter=null;this.middleRight=null;this.bottomLeft=null;this.bottomCenter=null;this.bottomRight=null;this.closeBtnDOM=null;this.closeBtn=null;this.currentContent=null;this.contents=null;this.oncloseFunc=null};Jaman.Popup.prototype.show=function(C,B){if(this.currentContent){this.currentContent.hide()}this.setCurrentContent(C,B);this.getDOM();this.currentContent.show(0,-1000);this.fitToContent()};Jaman.Popup.prototype.hide=function(){if(this.currentContent){this.currentContent.hide(true);this.currentContent=null}this.currentContent=this.contents.pop();if(this.currentContent){this.currentContent.show(0,-1000);this.fitToContent()}else{if(this.dom){with(this.dom.style){left="-1000px";display="none"}}this.showBackdrop(false)}};Jaman.Popup.prototype.fitToContent=function(){if(!this.currentContent){return }var w=this.currentContent.content.scrollWidth+2*Jaman.Popup.PADDING;var h=this.currentContent.content.scrollHeight+2*Jaman.Popup.PADDING;var l=0;var t=0;var winDims=Jaman.getWindowInnerRect();if(this.currentContent.anchor){var aPos=getElementPosition(this.currentContent.anchor);l=aPos.x+10;t=aPos.y+10;if((l+w+2*Jaman.Popup.BORDER_SIZE)>(winDims.width+winDims.left)){l=winDims.width+winDims.left-w-2*Jaman.Popup.BORDER_SIZE}if((t+h+2*Jaman.Popup.BORDER_SIZE)>(winDims.top+winDims.height)){t=winDims.top+winDims.height-h-2*Jaman.Popup.BORDER_SIZE}}else{l=winDims.left+(winDims.width-w-2*Jaman.Popup.BORDER_SIZE)/2;t=winDims.top+(winDims.height-h-2*Jaman.Popup.BORDER_SIZE)/2}if(l<0){l=0}if(t<0){t=0}with(this.dom.style){width=w+2*Jaman.Popup.BORDER_SIZE+"px";height=h+2*Jaman.Popup.BORDER_SIZE+"px";left=l+"px";top=t+"px"}this.topCenter.style.width=w+"px";this.bottomCenter.style.width=w+"px";this.middleLeft.style.height=h+"px";this.middleRight.style.height=h+"px";with(this.middleCenter.style){width=w+"px";height=h+"px"}this.closeBtnDOM.style.left=Jaman.Popup.BORDER_SIZE+w-14+2+"px";this.dom.style.display="block";this.currentContent.show(t+Jaman.Popup.BORDER_SIZE,l+Jaman.Popup.BORDER_SIZE+Jaman.Popup.PADDING);var dims=winDims;if(this.currentContent.anchor){var dims={contentWidth:w+2*(Jaman.Popup.BORDER_SIZE-Jaman.Popup.BORDER_OFFSET),contentHeight:h+2*(Jaman.Popup.BORDER_SIZE-Jaman.Popup.BORDER_OFFSET),contentLeft:Jaman.Popup.BORDER_OFFSET+this.dom.offsetLeft,contentTop:Jaman.Popup.BORDER_OFFSET+this.dom.offsetTop}}else{dims.contentLeft=0;dims.contentTop=0}this.showBackdrop(true,dims)};Jaman.Popup.prototype.setCurrentContent=function(C,B){if(this.currentContent){this.contents.push(this.currentContent)}this.currentContent=new Jaman.Popup.Content(C,B)};Jaman.Popup.prototype.setCloseFunc=function(B){if(this.currentContent){this.currentContent.closeFunc=B}};Jaman.Popup.prototype.getDOM=function(){if(this.dom){return this.dom}var currentObj=this;this.topLeft=this.createBG("popup_top_left.png",false);this.topCenter=this.createBG("popup_top_middle.png",true);this.topRight=this.createBG("popup_top_right.png",false);this.middleLeft=this.createBG("popup_left.png",false);with(this.middleLeft.style){clear="left";backgroundRepeat="repeat-y"}this.middleCenter=this.createBG("popup_middle.png",false);with(this.middleCenter.style){backgroundRepeat="repeat"}this.middleRight=this.createBG("popup_right.png",false);with(this.middleRight.style){backgroundRepeat="repeat-y"}this.bottomLeft=this.createBG("popup_bottom_left.png",false);this.bottomCenter=this.createBG("popup_bottom_middle.png",true);this.bottomRight=this.createBG("popup_bottom_right.png",false);var btn=Button.buttonArray[Button.BUTTON_CLOSE];this.closeBtn=new Button(this.id+"_close",btn.normalImageSrc,btn.overImageSrc,btn.downImageSrc,function(){return true});this.closeBtnDOM=DIV(null,this.closeBtn.getDOM());with(this.closeBtnDOM.style){position="absolute";top=Jaman.Popup.BORDER_SIZE+"px";left="0px";zIndex=Jaman.Popup.POPUP_DEPTH+2;cursor="pointer";cursor="hand"}this.closeBtnDOM.onclick=function(){currentObj.hide();return false};this.dom=DIV(null,this.topLeft,this.topCenter,this.topRight,DIV({"class":"clear"}),this.closeBtnDOM,this.middleLeft,this.middleCenter,this.middleRight,DIV({"class":"clear"}),this.bottomLeft,this.bottomCenter,this.bottomRight,DIV({"class":"clear"}));with(this.dom.style){position="absolute";left="-500px";top="0px";width=3*Jaman.Popup.BORDER_SIZE+"px";zIndex=Jaman.Popup.POPUP_DEPTH}document.body.appendChild(this.dom);return this.dom};Jaman.Popup.prototype.createBG=function(imgSrc,isCenter){var bgDOM=DIV(null,Jaman.renderHShim(Jaman.Popup.BORDER_SIZE));with(bgDOM.style){styleFloat="left";cssFloat="left";height=Jaman.Popup.BORDER_SIZE+"px";margin="0px";if(isCenter){backgroundRepeat="repeat-x"}}Jaman.setPNGBG(bgDOM,"/popup_images/"+imgSrc);return bgDOM};Jaman.Popup.prototype.showBackdrop=function(B,D){var C=$("backdropIFrame");if(!C){if(!B){return }if(!MochiKit.DOM.attributeArray.compliant){C=document.createElement('<iframe id="backdropIFrame" style="position: absolute; z-index: 7;" src="/empty.html" frameborder="0" scrolling="no"></iframe>')}else{C=document.createElement("iframe");C.setAttribute("id","backdropIFrame");C.setAttribute("scrolling","no");C.setAttribute("frameborder","0");C.setAttribute("src","/empty.html");C.style.position="absolute";C.style.opacity=0.7;C.style.zIndex=7}appendChildNodes(getElementsByTagAndClassName("body")[0],C)}if(!MochiKit.DOM.attributeArray.compliant){C.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=85)"}else{C.style.opacity=0.85}if(B){C.style.width=D.contentWidth+"px";C.style.height=D.contentHeight+"px";C.style.left=D.contentLeft+"px";C.style.top=D.contentTop+"px";C.style.display="block"}else{C.style.display="none"}};Jaman.Popup.BORDER_SIZE=15;Jaman.Popup.POPUP_DEPTH=9;Jaman.Popup.PADDING=7;Jaman.Popup.BORDER_OFFSET=10;Jaman.Popup.Content=function(D,B,C){this.content=D;this.anchor=B;this.closeFunc=C};Jaman.Popup.Content.prototype.show=function(t,l){with(this.content.style){position="absolute";display="block";zIndex=Jaman.Popup.POPUP_DEPTH+1;top=t+"px";left=l+"px"}};Jaman.Popup.Content.prototype.hide=function(B){this.content.style.display="none";if(B&&this.closeFunc){this.closeFunc()}};Jaman.Popup.popupInstance=null;Jaman.Popup.showContent=function(C,B,D){if(!C){return }if(!Jaman.Popup.popupInstance){Jaman.Popup.popupInstance=new Jaman.Popup("globalPopup")}Jaman.Popup.popupInstance.show(C,B);Jaman.Popup.popupInstance.setCloseFunc(D);Jaman.Popup.setCloseButtonVisibility(true)};Jaman.Popup.resize=function(){if(Jaman.Popup.popupInstance){Jaman.Popup.popupInstance.fitToContent()}};Jaman.Popup.hideContent=function(){if(Jaman.Popup.popupInstance){Jaman.Popup.popupInstance.oncloseFunc=null;Jaman.Popup.popupInstance.hide()}};Jaman.Popup.setCloseButtonVisibility=function(B){if(Jaman.Popup.popupInstance){Jaman.Popup.popupInstance.closeBtnDOM.style.display=B?"block":"none"}};Jaman.SimpleTooltip=function(B){this.id=B;this.dom=null;this.stemTopDOM=null;this.stemBottomDOM=null;this.contentDOM=null;this.hideTimer=null};Jaman.SimpleTooltip.prototype.show=function(B,C,F){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=null}this.getDOM();this.contentDOM.innerHTML=F;this.dom.style.display="block";var E=0;var D=0;if(B){hideElement(this.stemTopDOM);this.stemBottomDOM.style.display="block";E=B.clientX-18;if(C){var G=getElementPosition(C);D=G.y-this.dom.offsetHeight-5}else{D=B.clientY+5}}else{if(C){hideElement(this.stemBottomDOM);this.stemTopDOM.style.display="block";var G=getElementPosition(C);D=G.y+C.offsetHeight+5;E=G.x-2}}this.dom.style.top=D+"px";this.dom.style.left=E+"px"};Jaman.SimpleTooltip.prototype.hide=function(){if(this.hideTimer){clearTimeout(this.hideTimer)}var B=this;this.hideTimer=setTimeout(function(){B.hideNow()},250)};Jaman.SimpleTooltip.prototype.hideNow=function(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=null}hideElement(this.dom)};Jaman.SimpleTooltip.prototype.getDOM=function(){if(this.dom){return this.dom}this.dom=DIV({id:this.id});this.dom.style.position="absolute";this.dom.style.zIndex=11;this.stemTopDOM=Jaman.imagePNG("/popup_images/stem_top-middle.png",15,8);with(this.stemTopDOM.style){position="absolute";left="10px";marginBottom="-1px"}this.dom.appendChild(this.stemTopDOM);this.contentDOM=DIV({"class":"simpleTooltip"});this.dom.appendChild(this.contentDOM);this.stemBottomDOM=Jaman.imagePNG("/popup_images/stem_bottom-middle.png",15,8);with(this.stemBottomDOM.style){position="absolute";left="10px";marginTop="-1px"}this.dom.appendChild(this.stemBottomDOM);document.body.appendChild(this.dom);return this.dom};Jaman.SimpleTooltip.tooltip=new Jaman.SimpleTooltip("globalTooltip");Jaman.SimpleTooltip.showTooltip=function(B,C,D){Jaman.SimpleTooltip.tooltip.show(B,C,D)};Jaman.SimpleTooltip.hideTooltip=function(){Jaman.SimpleTooltip.tooltip.hide()};Jaman.Rater=function(H,D,F,E,B,G,C){this.id=H;this.numOfSlices=D;this.clickFunc=F;this.size=E;this.ratingUser=B;this.ratingCommunity=G;this.objectID=C;this.dom=null;this.parentDOM=null;this.prevTop=0;this.currTop=0;this.raterHeight=0;this.overFunc;this.outFunc;this.showHelpText=true;Jaman.Rater.raters.push(this)};Jaman.Rater.prototype.destroy=function(){if(this.dom){Jaman.destroyObject(this.dom)}this.dom=null};Jaman.Rater.prototype.setHandlers=function(C,B){this.overFunc=C;this.outFunc=B};Jaman.Rater.prototype.setHelpVisible=function(B){this.showHelpText=B};Jaman.Rater.prototype.connect=function(){this.dom=$(this.id);this.dom.onmouseover=null;this.currTop=parseInt(MochiKit.Style.getStyle(this.dom,"top"));this.prevTop=this.currTop;this.raterHeight=parseInt(MochiKit.Style.getStyle(this.dom,"height"))/(3*this.numOfSlices+1);this.attachMap()};Jaman.Rater.prototype.onMouseOverFunc=function(C,D){if(this.overFunc){this.overFunc()}var B=parseInt(D.getAttribute("idx"));this.dom.style.top=(-1*this.raterHeight*(this.numOfSlices+B))+"px";if(this.showHelpText){C=C||window.event;Jaman.SimpleTooltip.showTooltip(C,this.dom.offsetParent,Jaman.Rater.tooltipMsgs[B])}};Jaman.Rater.prototype.onMouseOutFunc=function(B){this.dom.style.top=this.currTop+"px";if(this.showHelpText){Jaman.SimpleTooltip.hideTooltip()}if(this.outFunc){this.outFunc()}};Jaman.Rater.prototype.onClickFunc=function(C){var B=parseInt(C.getAttribute("idx"));this.clickFunc(B*this.numOfSlices,this.objectID);this.prevTop=this.currTop;this.currTop=-1*this.raterHeight*(2*this.numOfSlices+B);this.dom.style.top=this.currTop+"px"};Jaman.Rater.prototype.setAssociatedObject=function(B){this.objectID=B};Jaman.Rater.prototype.resetRatings=function(B,D){B=parseInt(B);D=parseInt(D);var C=B||D||0;this.currTop=-1*this.raterHeight*Math.round(C/this.numOfSlices);if(B){this.currTop-=2*this.raterHeight*this.numOfSlices}this.dom.style.top=this.currTop+"px"};Jaman.Rater.prototype.setRating=function(B){B=parseInt(B);this.currTop=-1*this.raterHeight*Math.round(B/this.numOfSlices);if(B){this.currTop-=2*this.raterHeight*this.numOfSlices}this.dom.style.top=this.currTop+"px"};Jaman.Rater.prototype.resetRating=function(){this.currTop=this.prevTop;this.dom.style.top=this.currTop+"px"};Jaman.Rater.prototype.getDOM=function(){if(this.dom){return this.parentDOM}var info=Jaman.Rater.infos[this.size];this.dom=IMG({id:this.id,src:VNimages(info.src),width:info.width,height:info.height,border:"0"});this.raterHeight=Math.round(info.height/(3*this.numOfSlices+1));var currRating=this.ratingUser||this.ratingCommunity||0;this.currTop=-1*this.raterHeight*Math.round(currRating/this.numOfSlices);if(this.ratingUser){this.currTop-=2*this.raterHeight*this.numOfSlices}with(this.dom.style){cursor="pointer";cursor="hand";position="absolute";top=this.currTop+"px";left="0px"}this.parentDOM=DIV({"class":"rater"},this.dom);with(this.parentDOM.style){height=this.raterHeight+"px"}var currObj=this;this.dom.onmouseover=function(){currObj.connect()};return this.parentDOM};Jaman.Rater.prototype.attachMap=function(){var E="raterMap_"+this.id;if(!$(E)){var B=this;var D=document.createElement("map");D.setAttribute("id",E);D.name=E;var G=Math.round(parseInt(MochiKit.Style.getStyle(this.dom,"width"))/this.numOfSlices);for(var C=0;C<this.numOfSlices;C++){var F=document.createElement("area");F.shape="rect";F.coords="0, 0, "+(G*(C+1))+", "+parseInt(MochiKit.Style.getStyle(this.dom,"height"));F.onHref="true";F.setAttribute("idx",C+1);F.onmouseover=function(H){B.onMouseOverFunc(H,this);return true};F.onmouseout=function(){B.onMouseOutFunc(this);return true};F.onclick=function(){B.onClickFunc(this);return true};D.appendChild(F)}document.body.appendChild(D)}this.dom.useMap="#"+E};Jaman.Rater.SIZE_LARGE=1;Jaman.Rater.SIZE_XLARGE=2;Jaman.Rater.SIZE_LARGE_BLUE=3;Jaman.Rater.infos=new Array();Jaman.Rater.infos[Jaman.Rater.SIZE_LARGE]={src:"/stars/ratingstars_11.gif",width:60,height:341};Jaman.Rater.infos[Jaman.Rater.SIZE_XLARGE]={src:"/stars/ratingstars_22.gif",width:119,height:682};Jaman.Rater.infos[Jaman.Rater.SIZE_LARGE_BLUE]={src:"/stars/ratingstars_11_blue.gif",width:60,height:341};Jaman.Rater.tooltipMsgs=["","Wouldn't Recommend","Wouldn't Recommend","OK","OK","Good","Good","Great","Great","Must See!","Must See!"];Jaman.Rater.raters=new Array();Jaman.Rater.attachRater=function(G,C,B,F){var E=null;for(var D=0;D<Jaman.Rater.raters.length;D++){if(Jaman.Rater.raters[D].id==G){E=Jaman.Rater.raters[D];break}}if(!E){E=new Jaman.Rater(G,C,F);E.setAssociatedObject(B)}E.connect()};Jaman.Rater.setRatingFor=function(F,E,D){for(var B=0;B<Jaman.Rater.raters.length;B++){if(Jaman.Rater.raters[B].id==F){var C=Jaman.Rater.raters[B];if(D){C.resetRatings(E,D)}else{C.setRating(E)}break}}};Jaman.Rater.resetRatingFor=function(D){for(var B=0;B<Jaman.Rater.raters.length;B++){if(Jaman.Rater.raters[B].id==D){var C=Jaman.Rater.raters[B];C.resetRating();break}}};Jaman.Rater.setRatingForObj=function(E,G,B){var H=MochiKit.DOM.getElementsByTagAndClassName("div","rater");var F,C;for(var D=0;D<H.length;D++){F=H[D];oID=F.getAttribute("objID");if(oID&&oID==E&&F.firstChild.onmouseover){F.firstChild.onmouseover()}}for(var D=0;D<Jaman.Rater.raters.length;D++){if(Jaman.Rater.raters[D].objectID==E&&Jaman.Rater.raters[D].id!=B){Jaman.Rater.raters[D].setRating(G)}}};Jaman.Rater.disconnectRaters=function(){for(var B=0;B<Jaman.Rater.raters.length;B++){Jaman.Rater.raters[B].destroy()}};addToCallStack(window,"onunload",Jaman.Rater.disconnectRaters,true);if(typeof (JAMAN)=="undefined"){JAMAN={}}JAMAN.FacebookConnect=function(){var XD_RECEIVER="/fbconnect/xd_receiver.htm";var FB_SRC="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php";var FB_SRC_SECURE="https://www.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php";var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var mApiKey;var mIsSecure;var mNeedsLogin;var mIsFBConnectLoggedIn;var mTicketsRegister;var mIsFBConnectEnabled;var mLoadedEvent;var mLoaded=false;var mSigningIn=false;var mSigninCallback;var mPopupDOM;var mFbmlPopup;var mHasEmailPermission;var mUnsyncPopupDOM;var mUpgradePopupDOM;var mClientVersion;var ensureInit=function(f){if(mLoaded){FB.ensureInit(f)}else{getLoadedEvent().subscribe(function(){FB.ensureInit(f)})}};var getLoadedEvent=function(){if(!mLoadedEvent){mLoadedEvent=new YAHOO.util.CustomEvent("facebookconnect_loaded")}return mLoadedEvent};var isClientVersionOK=function(){if(TRLib.isEmbedded()){if(!mClientVersion){mClientVersion=TRLib.getClientVersion()}return mClientVersion>"2.0"}return true};var showClientUpgradeDialog=function(){if(mUpgradePopupDOM==null){mUpgradePopupDOM=document.createElement("DIV");mUpgradePopupDOM.style.width="350px";mUpgradePopupDOM.innerHTML="Please upgrade your Jaman Player to use Facebook.";var upgradeBtn=new Jaman.GraphicButton("upgradeClientButton",Jaman.GRAPHIC_BUTTON_SIZE_MEDIUM,Jaman.GRAPHIC_BUTTON_GREEN);upgradeBtn.setLabel("OK");var upgradeBtnDOM=document.createElement("DIV");upgradeBtnDOM.appendChild(upgradeBtn.getDOM());with(upgradeBtnDOM.style){marginLeft="auto";marginRight="auto";width="50px";marginTop="15px"}mUpgradePopupDOM.appendChild(upgradeBtnDOM);document.body.appendChild(mUpgradePopupDOM);upgradeBtn.setHandler(function(){Jaman.Popup.hideContent();setTimeout(function(){TRLib.checkForUpdates()},100);return false})}Jaman.Popup.showContent(mUpgradePopupDOM)};var ensureSignedIn=function(callback){var fired=false;ensureInit(function(){FB.Connect.ifUserConnected(function(){if(!fired){fired=true;callback()}},function(){if(!fired){fired=true;doSignin(callback)}})})};var doLogout=function(callback){ensureInit(function(){FB.Connect.logout(callback)})};var doSwitchUser=function(){ensureInit(function(){FB.Connect.logout(function(){doSignin()})})};var doSignin=function(callback,query){if(!isClientVersionOK()){showClientUpgradeDialog();return }mSigningIn=true;mSigninCallback=callback?callback:function(){location.reload(true)};ensureInit(function(){FB.Connect.requireSession(function(){afterConnect(query)})})};var afterConnect=function(query){if(!query){query={}}query[VideoLib.ACTION]="fetch_register_XML";query.nextPage2=location.href;var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(fetchRegisterOkay,fetchRegisterErr)};var fetchRegisterOkay=function(resp){var responseObject=MochiKit.Base.evalJSON(resp.responseText);if(responseObject.status=="loggedin"){signinOkay(responseObject.alias,responseObject.fbSessionKey)}else{if(responseObject.status=="selectProfile"){initSelectProfileView(responseObject.view,responseObject.alias,responseObject.fbSessionKey)}else{initRegisterView(responseObject.view,responseObject.bHasEmailPermission)}}};var fetchRegisterErr=function(err){VideoLib.logAtTop(err.faultString)};var initSelectProfileView=function(view,alias,fbSessionKey){showInPopup(view,true);Event.on("facebookProfileButton","click",function(){saveProfileType(alias,fbSessionKey,true)});Event.on("jamanProfileButton_A","click",function(){saveProfileType(alias,fbSessionKey,false)})};var saveProfileType=function(alias,fbSessionKey,bSyncFacebook){var query={theAction:"save_profile_type_XML"};query.syncFacebook=bSyncFacebook;var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(function(resp){Jaman.Popup.hideContent();signinOkay(alias,fbSessionKey)},function(err){Jaman.Popup.hideContent();signinOkay(alias,fbSessionKey)})};var initRegisterView=function(view,bHasEmailPermission){mHasEmailPermission=bHasEmailPermission;showInPopup(view,true);setTimeout(Jaman.Popup.resize,250);Event.on("skipFriendsButton_A","click",registerContinue);Event.on("inviteFriendsButton_A","click",inviteConnectUsers);Event.on("continueRegisterButton_A","click",registerContinue);Event.on("mergeAccountsLink","click",showMergeAccounts);Event.on("showChooseUsernameLink","click",showChooseUsername);makeDynamic("quizButton",onQuizButtonClick,"md","",false,true);makeDynamic("doneButton",onRegisterButtonClick,"md","_secondary",true,true);makeDynamic("registerButton",onRegisterButtonClick,"md","",true,true);fixIEFocusIssue()};var makeDynamic=function(buttonID,handler,size,type,secondary){var dom=Dom.get(buttonID+"_A");if(dom){dom.onclick=handler;var button=new Jaman.GraphicButton(buttonID,size,type,secondary,true);button.connect()}};var fixIEFocusIssue=function(){if(YAHOO.env.ua.ie){var focusedOnce=false;Event.on("aliasInput","focus",function(){if(!focusedOnce){focusedOnce=true;$("fb_accept_terms").focus();setTimeout(function(){$("aliasInput").focus()},10)}});Event.on("bdayYear","focus",function(){if(!focusedOnce){focusedOnce=true;$("fb_accept_terms").focus();setTimeout(function(){$("bdayYear").focus()},10)}})}};var registerContinue=function(ev){$("thankyouDiv").style.display="none";Jaman.Popup.popupInstance.dom.style.display="none";if(!mHasEmailPermission){doEmailPermission(function(perms){Jaman.Popup.popupInstance.dom.style.display="block";showChooseUsername(ev)})}};var showChooseUsername=function(ev){$("chooseUsernameDiv").style.display="block";$("mergeAccountsDiv").style.display="none";Jaman.Popup.resize();Event.preventDefault(ev)};var inviteConnectUsers=function(ev){MochiKit.Style.hideElement("inviteDiv");MochiKit.Style.showElement("continueDiv");Event.preventDefault(ev);ensureInit(function(){FB.Connect.inviteConnectUsers()})};var showMergeAccounts=function(ev){$("mergeAccountsDiv").style.display="block";$("chooseUsernameDiv").style.display="none";Jaman.Popup.resize();Event.preventDefault(ev)};var onQuizButtonClick=function(){mSigninCallback=function(){location.href="/moviequiz/?nextPage="+encodeURIComponent("/movies/")};handleRegister();return false};var onRegisterButtonClick=function(){handleRegister();return false};var handleRegister=function(){Jaman.GraphicButton.disableButton("quizButton");Jaman.GraphicButton.disableButton("doneButton");Jaman.GraphicButton.disableButton("registerButton");var f=$("FBRegisterForm");var query={register_alias:f.alias.value,accept_terms:f.accept_terms.checked?1:0};if($("FBBdaySelector")){var daySel=$("FBBdayDay");if(daySel.selectedIndex!=-1){query.bdayDay=daySel.options[daySel.selectedIndex].value}var monthSel=$("FBBdayMonth");if(monthSel.selectedIndex!=-1){query.bdayMonth=monthSel.options[monthSel.selectedIndex].value}query.bdayYear=f.bdayYear.value}else{query.bdayDay=f.bdayDay.value;query.bdayMonth=f.bdayMonth.value;query.bdayYear=f.bdayYear.value}query[VideoLib.ACTION]="fbconnectRegisterXML";var d=VideoLib.makeRequest("/register/",query,mIsSecure);d.addCallbacks(handleRegisterOkay,handleRegisterErr)};var handleRegisterOkay=function(resp){var responseObject=MochiKit.Base.evalJSON(resp.responseText);var alias=responseObject.alias;var fbSessionKey=responseObject.fbSessionKey;if(TRLib.isEmbedded()){signinOkay(alias,fbSessionKey)}else{$("chooseUsernameDiv").style.display="none";$("registerOkayDiv").style.display="block";Jaman.Popup.resize();Event.on("registerOkayButton_A","click",function(ev){signinOkay(alias,fbSessionKey);Event.preventDefault(ev)})}};var handleRegisterErr=function(err){Jaman.GraphicButton.enableButton("quizButton");Jaman.GraphicButton.enableButton("doneButton");Jaman.GraphicButton.enableButton("registerButton");$("FBRegisterErr").innerHTML=err.faultString;showElement("FBRegisterErr");Jaman.Popup.resize()};var signinOkay=function(alias,fbSessionKey){if(TRLib.isEmbedded()){TRLib.afterFacebookLogin(alias,fbSessionKey,mSigninCallback)}else{if(mSigninCallback){mSigninCallback()}}mSigningIn=false};var doUnlink=function(){var url="/fbconnect/?theAction=show_unlink&parentSSL="+(mIsSecure?1:0);url+="&nextPage="+encodeURIComponent(location.href);showInPopup('<iframe src="'+VideoLib.makeUrl(url,true)+'" frameborder="0" scrolling="no" style="width: 390px; height: 270px;"></iframe>',false)};var doEmailPermission=function(callback){ensureInit(function(){FB.Connect.showPermissionDialog("email",callback)})};var doShowUnsyncDialog=function(){if(mUnsyncPopupDOM==null){mUnsyncPopupDOM=document.createElement("DIV");mUnsyncPopupDOM.style.width="400px";mUnsyncPopupDOM.innerHTML='<div class="largeHeader2">Stop Synchronizing Profile with Facebook</div><div>If you would like to make changes to your profile, you will have to make the changes on Facebook. Or you can choose to stop synchronizing your profile from Facebook and maintain a separate one on Jaman.</div>';var unsyncBtn=new Jaman.GraphicButton("unsyncBtn",Jaman.GRAPHIC_BUTTON_SIZE_MEDIUM,Jaman.GRAPHIC_BUTTON_GREEN);unsyncBtn.setLabel("Stop Synchronizing");var unsyncBtnDOM=document.createElement("DIV");unsyncBtnDOM.appendChild(unsyncBtn.getDOM());with(unsyncBtnDOM.style){cssFloat="right";styleFloat="right"}var cancelBtn=new Jaman.GraphicButton("unsyncCancelBtn",Jaman.GRAPHIC_BUTTON_SIZE_MEDIUM,Jaman.GRAPHIC_BUTTON_GRAY);cancelBtn.setLabel("Cancel");var cancelBtnDOM=document.createElement("DIV");cancelBtnDOM.appendChild(cancelBtn.getDOM());with(cancelBtnDOM.style){cssFloat="right";styleFloat="right"}var clearDOM=document.createElement("DIV");clearDOM.style.clear="both";var buttonsDOM=document.createElement("DIV");buttonsDOM.appendChild(unsyncBtnDOM);buttonsDOM.appendChild(cancelBtnDOM);buttonsDOM.appendChild(clearDOM);mUnsyncPopupDOM.appendChild(buttonsDOM);document.body.appendChild(mUnsyncPopupDOM);cancelBtn.setHandler(function(){Jaman.Popup.hideContent();return false});unsyncBtn.setHandler(function(){JAMAN.FacebookConnect.syncProfile(false);return false})}Jaman.Popup.showContent(mUnsyncPopupDOM)};var doSyncProfile=function(bSync){var query={theAction:"syncFacebook"};query.syncFacebook=bSync;var d=VideoLib.makeRequest("/userProfile/",query,mIsSecure);d.addCallbacks(function(resp){location.reload(true)},function(err){Jaman.Popup.hideContent();VideoLib.logAtTop(err.faultString)})};var doInviteFriends=function(){var query={theAction:"invitation_url_XML"};var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(function(resp){handleInviteFriendsOkay(resp.responseText)},function(err){VideoLib.logAtTop(err.faultString)})};var handleInviteFriendsOkay=function(invitationUrl){var title="Invite Friends";var type="jaman";var content="I've been using Jaman to watch all sorts of great and unique movies. You can watch them online or on your TV and they have a lot of really interesting movies - not the normal stuff you get at the theatre or blockbuster. ";if(mTicketsRegister){content+="Try them out - you can use your facebook login and you get your first movie for free."}else{content+="Try them out - you can even use your facebook login."}content+="<fb:req-choice url='"+invitationUrl+"' label='Try out Jaman' />";doShare(title,{type:type,content:content,invite:true})};var doGift=function(p){var query={theAction:"facebook_invitation_XML"};query.showRecommendations=p.showRecommendations?"1":"0";query.nowPlaying=p.nowPlaying?"1":"0";query.videoID=p.videoId;if(p.confirmation){query.confirmation=p.confirmation}var d=VideoLib.makeRequest("/gift/",query,mIsSecure);d.addCallbacks(function(resp){var responseObject=MochiKit.Base.evalJSON(resp.responseText);var nextPage=responseObject.nextPage;nextPage=nextPage+"&cancelPage="+escape(location.href);handleGiftOkay(responseObject.invitationUrl,responseObject.title,responseObject.maxInvites,nextPage)},function(err){VideoLib.logAtTop(err.faultString)})};var handleGiftOkay=function(invitationUrl,movieTitle,maxInvites,nextPage){var title="Select Facebook Friends";var type="Movie Gift";var content="I just saw &quot;"+movieTitle+"&quot; and think you would love it. Here is a free rental ticket so you can check it out yourself. Let me know if you like it! <fb:req-choice url='"+invitationUrl+"' label='Redeem my ticket' />";doShare(title,{type:type,content:content,action:nextPage,invite:true},null,{max:maxInvites})};var substitute=function(template,map,transform,thisObject){var dGlobal=window;var getProp=function(parts,create,context){var obj=context||dGlobal;for(var i=0,p;obj&&(p=parts[i]);i++){obj=(p in obj?obj[p]:(create?obj[p]={}:undefined))}return obj};var getObject=function(name,create,context){return getProp(name.split("."),create,context)};thisObject=thisObject||dGlobal;transform=(!transform)?function(v){return v}:dojo.hitch(thisObject,transform);return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(match,key,format){var value=getObject(key,false,map);if(format){value=getObject(format,false,thisObject).call(thisObject,value,key)}return transform(value,key).toString()})};var streamPublish=function(user_message,attachment,actionLinks,callback){ensureSignedIn(function(){FB.Connect.streamPublish(user_message,attachment,actionLinks,null,null,callback,false,null)})};var publishMovie=function(data){var user_message=substitute(data.user_message,data);var description=substitute(data.description,data);var attachment={name:data.movie_name,href:data.movie_url,description:description,caption:"{*actor*} "+user_message,media:[{type:"image",src:data.movie_thumbnail,href:data.movie_url}]};streamPublish(user_message,attachment,data.actionLinks,data.callback)};var publishFanning=function(data){data.user_message="became a fan of the movie ${movie_name} on Jaman.com";data.description="${movie_name}: ${movie_desc}";data.actionLinks=[{text:"Become a fan too",href:data.movie_url+"?theAction=become_a_fan"}];publishMovie(data)};var publishGifting=function(data){data.user_message="gave a friend a ticket to watch the movie ${movie_name} on Jaman.com for FREE!";data.description="${movie_name}: ${movie_desc}";data.actionLinks=[{text:"Watch the movie",href:data.movie_url}];publishMovie(data)};var publishReview=function(data){data.user_message="wrote a movie review of ${movie_name} on Jaman.com";data.description="Review of ${movie_name}: ${review_excerpt}";data.actionLinks=[{text:"Read Review",href:data.review_url}];publishMovie(data)};var publishPost=function(data){var user_message=substitute("wrote about ${post_title}",data);var actionLinks=[{text:"Read Post",href:data.post_url}];var attachment={name:data.post_title,href:data.post_url,description:data.post_excerpt,caption:"{*actor*} "+user_message};streamPublish(user_message,attachment,data.actionLinks,data.callback)};var doShare=function(title,formParams,nextPage,friendParams){var args=arguments;ensureSignedIn(function(){doShareSignedIn.apply(null,args)})};var doShareSignedIn=function(title,formParams,nextPage,friendParams){if(!formParams.method){formParams.method="post"}if(!formParams.action){formParams.action=VideoLib.makeUrl("/fbconnect/")+"?theAction=post_share&nextPage="+encodeURIComponent(nextPage||location.href)}if(!formParams.invite){formParams.invite=false}var formParamArray=[];for(var p in formParams){formParamArray.push(p+'="'+formParams[p]+'"')}var sfbml="<fb:request-form "+formParamArray.join(" ")+">";var friendParamArray=[];for(var p in friendParams){friendParamArray.push(p+'="'+friendParams[p]+'"')}sfbml+='<fb:multi-friend-selector actiontext=" " showborder="false" rows="5" bypass="cancel" '+friendParamArray.join(" ")+"/>";sfbml+="</fb:request-form>";showFBML(title,sfbml,650,550)};var showFBML=function(title,fbml,width,height){if(mFbmlPopup){mFbmlPopup.close(false)}mFbmlPopup=new FB.UI.FBMLPopupDialog(title,fbml);mFbmlPopup.setContentWidth(width);mFbmlPopup.setContentHeight(height);mFbmlPopup.show();mFbmlPopup.add_closing(function(){mFbmlPopup=null})};var getVideoShareContent=function(link,title){var facebookContent="I saw the movie "+title+" on Jaman and thought you might like it. Jaman let's you watch movies online and through your tv.";if(mTicketsRegister){facebookContent+=" You get one for free when you sign up so check it out."}facebookContent+="<fb:req-choice url='"+link+"' label='Watch the Movie' />";facebookContent+="<fb:req-choice url='"+link+"#communitySection' label='Read the Movie Reviews' />";return facebookContent};var getListShareContent=function(link){var facebookContent="I use Jaman to watch a lot of great movies and I have a list of movies I thought you'd like to check out.";if(mTicketsRegister){facebookContent+="Check out the list and you can even watch one for free."}facebookContent+="<fb:req-choice url='"+link+"' label='View My List' />";return facebookContent};var showInPopup=function(html,isDeadEnd){var dom=getPopupDOM();dom.innerHTML=html;Jaman.Popup.showContent(dom);Jaman.Popup.resize();fixIEBottomRightCorner();Jaman.Popup.setCloseButtonVisibility(!isDeadEnd)};var getPopupDOM=function(){if(!mPopupDOM){mPopupDOM=document.createElement("div");if($("popupsDiv")){$("popupsDiv").appendChild(mPopupDOM)}else{document.body.appendChild(mPopupDOM)}mPopupDOM.style.width="400px"}return mPopupDOM};var fixIEBottomRightCorner=function(){if(YAHOO.env.ua.ie){Jaman.Popup.popupInstance.bottomRight.style.margin="0px -2px 0px 0px"}};var checkSingleSignon=function(){if(!mIsFBConnectEnabled){return }if(!isClientVersionOK()){return }var loginTime=getCookie("LT");if(loginTime){setCookie("LT","",-1);return }FB.ensureInit(function(){FB.Connect.ifUserConnected(function(){if(!mSigningIn){if(!mIsFBConnectLoggedIn){doSingleSignonLogin()}else{var session=FB.Facebook.get_sessionState().result;if(session){var jamanSessionID=VideoLib.getSessionID();var fbSessionKey=session.session_key;if(jamanSessionID.substr(3,fbSessionKey.length)!==fbSessionKey){doSingleSignonRenew(fbSessionKey)}}}}},function(){if(!mSigningIn){if(mIsFBConnectLoggedIn){doSingleSignonLogout()}}})})};var doSingleSignonLogin=function(){var query={};query[VideoLib.ACTION]="singleSignonXML";query[VideoLib.ACTION2]="login";var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(function(resp){if(TRLib.isEmbedded()){var callback=function(){location.reload(true)};doSignin(callback)}else{location.reload(true)}},function(err){})};var doSingleSignonLogout=function(){var query={};query[VideoLib.ACTION]="singleSignonXML";query[VideoLib.ACTION2]="logout";query.needsLogin=mNeedsLogin?1:0;var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(function(resp){if(TRLib.isEmbedded()){TRLib.handleSessionExpired()}else{location.reload(true)}},function(err){})};var doSingleSignonRenew=function(fbSessionKey){var query={};query[VideoLib.ACTION]="singleSignonXML";query[VideoLib.ACTION2]="renew";var d=VideoLib.makeRequest("/fbconnect/",query,mIsSecure);d.addCallbacks(function(resp){if(TRLib.isEmbedded()){TRLib.afterFacebookLogin(VideoLib.getLoginID(),fbSessionKey,function(){})}else{}},function(err){})};var onFBLoaded=function(){if(!mLoaded){FB.init(mApiKey,XD_RECEIVER);checkSingleSignon();mLoaded=true;getLoadedEvent().fire()}};var initButtons=function(){var buttons=Dom.getElementsByClassName("global-btn-facebook-short");if(buttons.length>0){Event.on(buttons,"click",function(){doSignin()})}};return{init:function(params){mApiKey=params.apiKey;mIsSecure=params.isSecure;mNeedsLogin=params.needsLogin;mIsFBConnectLoggedIn=params.isFBConnectLoggedIn;mIsFBConnectEnabled=params.isFBConnectEnabled;mTicketsRegister=params.ticketsRegister;initButtons();var fbHiddenDiv=document.createElement("div");fbHiddenDiv.id="FB_HiddenContainer";fbHiddenDiv.style.position="absolute";fbHiddenDiv.style.left="-10000px";fbHiddenDiv.style.top="-10000px";fbHiddenDiv.style.width="0px";fbHiddenDiv.style.height="0px";window.document.body.insertBefore(fbHiddenDiv,window.document.body.firstChild);var loader=new YAHOO.util.YUILoader({onSuccess:onFBLoaded});loader.addModule({name:"facebookconnect",type:"js",fullpath:mIsSecure?FB_SRC_SECURE:FB_SRC,varName:"JamanFacebookConnect"});loader.require("facebookconnect");loader.insert()},shareVideo:function(link,title){doShare("Share This Movie with Your Friends",{type:"Movie",content:getVideoShareContent(link,title),invite:true})},shareList:function(link){doShare("Share This Movie List with Your Friends",{type:"See My Movie List",content:getListShareContent(link)})},isFBConnectLoggedIn:function(){return mIsFBConnectLoggedIn},isFBConnectEnabled:function(){return mIsFBConnectEnabled},logout:doLogout,switchUser:doSwitchUser,signin:function(callback,query){doSignin(callback,query)},signinAndRedirect:function(nextPage){if(nextPage){var callback=function(){location.href=nextPage};var query={nextPage:nextPage};doSignin(callback,query)}else{doSignin()}},unlink:function(){doUnlink()},showEmailPermissionDialog:function(){doEmailPermission()},showUnsyncDialog:doShowUnsyncDialog,syncProfile:doSyncProfile,postLoginCallback:function(alias,fbSessionKey){signinOkay(alias,fbSessionKey)},inviteFriends:doInviteFriends,gift:doGift,publishMovie:publishMovie,publishFanning:publishFanning,publishGifting:publishGifting,publishReview:publishReview,publishPost:publishPost,streamPublish:streamPublish,getApiClient:function(){return new FB.ApiClient(mApiKey)}}}();VERIFY_IMAGE_ATTR_NAME="verifyImgTxt";if(!window.MainLib){MainLib={}}MainLib.ACQUIRE_TYPE_OWN="1";MainLib.ACQUIRE_TYPE_RENT="2";MainLib.FLAG_VIDEO_ACTION_URL="/video/";MainLib.FLAG_VIDEO_ACTION_VALUE="flagasinappropriate";MainLib.SHOW_EDIT_ACTION_VALUE="showVideoEdit";MainLib.SHOW_EDIT_ACTION_URL="/video/";MainLib.RESEND_CONFIRM_EMAIL_ACTION_VALUE="resendconfirmemail";MainLib.RESEND_CONFIRM_EMAIL_ACTION_URL="/video/";TRLib.TRAILER_COOKIE_ID="TR";VideoLib.SESSION_COOKIE_ID="sessionID";VideoLib.LOGIN_COOKIE_ID="LOGIN";VideoLib.TRSESSION_COOKIE_ID="TRSessionID";VideoLib.TRLOGIN_COOKIE_ID="TRLOGIN";VideoLib.HTTP_URL="http://"+location.host.split(":")[0];VideoLib.HTTPS_URL="https://"+location.host.split(":")[0]+":4443";VideoLib.ACTION="theAction";VideoLib.ACTION2="theAction2";VideoLib.AUTOPLAY_COOKIE_ID="AP";VideoLib.AUTOPLAY_OFF=1;VideoLib.LOGIN_ACTION_URL="/login/";VideoLib.REGISTER_ACTION_URL="/register/";VideoLib.ACCOUNT_ACTION_URL="/account/";VideoLib.PAYMENT_ACTION_VALUE="payment";VideoLib.PARAM_TRUE_VALUE="true";VideoLib.PARAM_FALSE_VALUE="false";VideoLib.RPCERROR_INVALID_SESSION_CODE=10;VideoLib.RPCERROR_STALE_SESSION_CODE=29;VideoLib.FB_CONNECT_INVALID_SESSION_CODE=-1000;VideoLib.FEEDBACK_ACTION_URL="/feedback/";VideoLib.RENDER_ACTION="render";VideoLib.PARAM_IS_XML_REQUEST_NAME="__isXMLRequest__";VideoLib.PARAM_IS_POPUP_NAME="__isPopup__";VideoLib.LOGIN_ACTION_VALUE="login_xml";VideoLib.EMBEDDED_LOGIN_ACTION_VALUE="embedded_login_xml";VideoLib.LOGOUT_ACTION_VALUE="logout";VideoLib.VERIFY_PASSWORD_ACTION_VALUE="show_verify_password";VideoLib.SESSION_EXPIRED_URL="/login/";VideoLib.SESSION_EXPIRED_ACTION="show_session_expired";VideoLib.REGISTER_ACTION_VALUE="register_xml";VideoLib.CHECK_CC_INFO_ACTION_VALUE="check_cc_info_xml";VideoLib.USER_ALIAS_MINIMUM_LENGTH=2;VideoLib.USER_PASSWORD_MINIMUM_LENGTH=6;VideoLib.USER_PASSWORD_MAXIMUM_LENGTH=16;VideoLib.UPDATE_ACTION_VALUE="update_xml";VideoLib.REMOVE_ACTION_URL="/library/";VideoLib.REMOVE_ACTION_VALUE="remove";VideoLib.SEARCH_ACTION_URL="/search/";VideoLib.CONTACT_ACTION_URL="/contacts/";VideoLib.CONTACT_ACTION_VALUE="put_contact_xml";VideoLib.CONTACT_RENDER_ACTION_VALUE="render_xml";VideoLib.CONTACT_UNBLOCK_ACTION_VALUE="unblock_contact_xml";VideoLib.LISTS_ACTION_URL="/lists/";VideoLib.LISTS_RENDER_ACTION_VALUE="render_xml";VideoLib.LISTS_PUT_ACTION_URL="/video/";VideoLib.LISTS_PUT_ACTION_VALUE="put_list_xml";VideoLib.SHARE_VIDEO_ACTION_URL="/email/";VideoLib.SHARE_VIDEO_ACTION_VALUE="share_video_xml";VideoLib.SHARE_REVIEW_ACTION_VALUE="share_review_xml";VideoLib.SHARE_MY_REVIEW_ACTION_VALUE="share_my_review_xml";VideoLib.SEND_MESSAGE_ACTION_VALUE="send_message";VideoLib.SEND_MESSAGE_XML_ACTION_VALUE="send_message_xml";VideoLib.THUMBNAIL_MAIN="main";VideoLib.THUMBNAIL_OWNER="owner";VideoLib.CONTROLLER_GROUP="/forum/";VideoLib.CONTROLLER_MESSAGE="/message/";VideoLib.CONTROLLER_MESSAGES="/messages/";VideoLib.PREVIEW_MESSAGE_ACTION_VALUE="preview_message_xml";VideoLib.UPDATE_RECIPIENTS_ACTION_VALUE="update_recipients_xml";VideoLib.UPDATE_RECIPIENTS_SECURE_ACTION_VALUE="update_recipients_xml_secure";VideoLib.EMAIL_TO_CONTACT_ACTION_VALUE="edit_message";VideoLib.SHOW_DOWNLOAD_CLIENT_ACTION_URL="/download/";VideoLib.SHOW_DOWNLOAD_CLIENT_ACTION_NAME="show_download_client";VideoLib.SHOW_ICON_INFO_URL="/download/?theAction=show_icon_info";VideoLib.BECOME_A_FAN_ACTION="becomeAFanXML";VideoLib.BECOME_A_FAN_URL="/video/";VideoLib.VISIBILITY_PUBLIC="1";VideoLib.VISIBILITY_PRIVATE="2";VideoLib.VISIBILITY_UNLISTED="3";VideoLib.DEFAULT_CATEGORY="6";VideoLib.WBR="<wbr>";VideoLib.WBR_SAFARI="&#8203;";VideoLib.WBR_HOLDER="#wbr_tag#";VideoLib.EMPTY_VALUE="-1";VideoLib.NOW_LIMIT="40";VideoLib.DateTime.MONTHS=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");VideoLib.PLACEHOLDER_SEARCH="Movies, actors, directors...";VideoLib.CONTACTS_LOADING_MSG="Loading friends...";VideoLib.SHARE_GROUP_MESSAGE1='Come join "';VideoLib.SHARE_GROUP_MESSAGE2='", a Jaman group!';VideoLib.SHARE_VIDEO_MESSAGE="";VideoLib.ERROR_SHARE_VIDEO_FROM="'From' field cannot be empty.";VideoLib.ERROR_SHARE_VIDEO_TO="No recipients specified.";VideoLib.SENDING_SHARE_VIDEO_MSG="Sending request...";VideoLib.LISTS_LOADING_MSG="Loading lists...";VideoLib.ADDING_TO_LIST="Adding...";VideoLib.FEATURES_URL="/features/";VideoLib.AUTOPLAY_ON=2;VideoLib.LOG_AUTOPLAY_ACTION_URL="/video/";VideoLib.LOG_AUTOPLAY_ACTION_VALUE="log_autoplay_xml";VideoLib.FETCH_THUMBNAIL_XML_ACTION_URL="/video/";VideoLib.FETCH_THUMBNAIL_XML_ACTION_VALUE="fetch_thumbnail_xml";VideoLib.PUT_RATING_XML_ACTION="rating_xml";VideoLib.PUT_RATING_ACTION="put_rating";VideoLib.LOG_VIEWED_XML_ACTION="log_viewed_xml";VideoLib.LOG_VIEWED_PROFILE_XML_ACTION="log_viewed_profile_xml";VideoLib.CONFIRM_DELETE_MESSAGE="Are you sure you want to delete these messages?";VideoLib.CONFIRM_REMOVE_MESSAGE="Are you sure you want to remove this?";VideoLib.ERROR_DISCOURSE_AUTHOR="No author selected.";VideoLib.ERROR_EMAIL_MISSING="Please provide the email address.";VideoLib.ERROR_FLAGGING="Error while flagging this movie: ";VideoLib.ERROR_INVALID_CARD_TYPE="Select a card type.";VideoLib.ERROR_MESSAGE_NONE="Nothing selected.";VideoLib.ERROR_OPEN_POPUP_WINDOW="You must have popup windows enabled to use this feature. Please check your browser settings and enable popups for this site. Don't worry, we won't pop up ads.";VideoLib.ERROR_UPLOAD_PICK_FILE="Please specify the file to upload.";VideoLib.ERROR_USER_ALIAS_MINIMUM="User name must be at least 2 characters.";VideoLib.ERROR_USER_ALIAS_CHARACTERS1="User name must not contain characters other than A-Z, a-z, 0-9, . (dot), and _ (underscore).";VideoLib.ERROR_USER_ALIAS_CHARACTERS2="User name must not contain consecutive dots or underscores.";VideoLib.ERROR_USER_ALIAS_CHARACTERS3="User name must not start or end with a dot or underscore.";VideoLib.ERROR_USER_PASSWORD_MINIMUM="Password must be at least 6 characters.";VideoLib.ERROR_USER_PASSWORD_MAXIMUM="Password cannot be longer than 16 characters.";VideoLib.ERROR_USER_PASSWORD_MATCH="Passwords do not match.";VideoLib.ERROR_INVALID_COUNTRY="Select a country.";VideoLib.ERROR_VIDEO_INVALID_COUNTRY="Select a country for the movie.";VideoLib.ERROR_VIDEO_INVALID_CATEGORY="Select a channel for the movie.";VideoLib.ERROR_VIDEO_MATURE_CONTENT="Hey, you have to sign in to see this movie.";VideoLib.ERROR_VIDEO_MATURE_CONTENT2="Oops, your settings filter mature content.";VideoLib.ERROR_VIDEO_PRIVATE="This movie is marked as private.";VideoLib.INFO_CONTACT_ADDED="Added to friends.";VideoLib.INFO_CONTACT_REMOVED="Removed from friends.";VideoLib.INFO_CONTACT_UNBLOCKED="Unblocked this user.";VideoLib.INFO_EMAIL_SENT="Your message has been sent.";VideoLib.INFO_FLAGGED="Thank you for flagging this movie for our attention.";VideoLib.INFO_MESSAGE_SENT="Message sent.";VideoLib.INFO_RATING_SAVED="Rating saved.";VideoLib.INFO_REVIEW_SENDING="Posting review...";VideoLib.INFO_VIDEO_ADDED_TO_LIST="Added to list.";VideoLib.SHARE_LENGTH_ERROR="Message is too long (100kb maximum).";
