if(typeof VEOH=="undefined"||!VEOH){var VEOH={};} VEOH.Util={};VEOH.Util.appendNode=function(element,surrogate){if(surrogate){surrogate.appendChild(element);} else{document.body.appendChild(element);}};VEOH.Util.removeNode=function(element){element.parentNode.removeChild(element);};VEOH.Util.hide=function(element){element.style.display='none';element.style.filter='alpha(opacity=0)';element.style.opacity='0';};VEOH.Util.documentWidth=function(){if(document.documentElement&&document.documentElement.scrollWidth){return document.documentElement.scrollWidth;} else if(document.body.scrollWidth){return document.body.scrollWidth;} else{throw new Error('cannot get document width');}};VEOH.Util.documentHeight=function(){if(document.documentElement&&document.documentElement.scrollHeight){return document.documentElement.scrollHeight;} else if(document.body.scrollHeight){return document.body.scrollHeight;} else{throw new Error('cannot get document height');}};VEOH.Util.xScroll=function(){var xScroll=window.scrollX||document.documentElement.scrollLeft;return xScroll;};VEOH.Util.yScroll=function(){var yScroll=window.scrollY||document.documentElement.scrollTop;return yScroll;};VEOH.Util.extend=function(oSub,oSuper){if(!(oSub&&oSuper)) return;for(sProperty in oSuper){oSub[sProperty]=oSuper[sProperty];}};VEOH.Util.clearHighlight=function(un) {if(!un) return;un.style.border="1px solid #D7D7D7";un.style.backgroundColor="#FFFFFF";un.onBlur="";};VEOH.Util.focusField=function(un) {if(!un) return;un.oldBackgroundColor=un.style.backgroundColor;un.oldBorder=un.style.border;un.style.backgroundColor="#FFF899";un.style.border="1px solid #F46E2A";un.onblur=function(){VEOH.Util.clearHighlight(un);};};VEOH.Util.createMethodReference=function(object,method){if(!(method instanceof Function)) method=object[method];return function(){method.apply(object,arguments);};};VEOH.Util.log=function(message,type,component){if(!message) return;if(typeof YAHOO!="undefined"&&typeof YAHOO.log!="undefined"){YAHOO.log(message,type,component);return;} return;var output=message;if(type) output+=" - "+type;if(component) output+=" - "+component;if(typeof console!="undefined"&&console.log) console.log(output);};var log=VEOH.Util.log;VEOH.Util.getAbsolutePosition=function(element,axis){if(!element){log("no element to get position for","error");return 0;} var curleft=0;var curtop=0;if(!element.parentNode){log("cannot get absolute position: unsupported browser");return 0;} var iterateElement=element;do{if(iterateElement&&iterateElement.offsetLeft){curleft+=iterateElement.offsetLeft;curtop+=iterateElement.offsetTop;}} while(iterateElement=iterateElement.parentNode);if(axis&&axis=="y"){return curtop;} return curleft;};VEOH.Util.queryString=function(qs){var params=new Array();if(qs==null) qs=location.search.substring(1,location.search.length);if(qs.length==0) return null;qs=qs.replace(/\+/g,' ');var args=qs.split('&');for(var i=0;i0){VEOH.Util.removeChildSafe(el.childNodes[el.childNodes.length-1]);}} if(el.parentNode) el.parentNode.removeChild(el);};VEOH.Util.captureMousePosition=function(e){if(!e) this.event=window.event;else this.event=e;this.getXMousePos=function(){if(this.event.pageX){return this.event.pageX;} else if(this.event.clientX){return this.event.clientX+ (document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);} else{return null;}};this.getYMousePos=function(evt){if(this.event.pageY){return this.event.pageY;} else if(this.event.clientY){return this.event.clientY+ (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);} else{return null;}};glbXMousePos=this.getXMousePos();glbYMousePos=this.getYMousePos();}; var BALLOON_RESOURCES_CONTAINER="balloonResources";var BALLOON_ELEMENT_SUFFIX="_balloon" var BALLOON_RESOURCE_ELEMENT_SUFFIX=BALLOON_ELEMENT_SUFFIX+"_resources";var BALLOON_GLOBAL_RESOURCE_NAME="_global"+BALLOON_RESOURCE_ELEMENT_SUFFIX;var BALLOON_DEFAULT_EVENT_NAME="onclick";var BALLOON_DEFAULT_WIDTH="";var BALLOON_DEFAULT_HEIGHT="";var BALLOON_DEFAULT_BACKGROUND="#FeF898";var BALLOON_DEFAULT_BORDER="";var BALLOON_DEFAULT_PADDING="";var BALLOON_DEFAULT_TEXT_ALIGN="left";var BALLOON_DEFAULT_DISPLAY="block";var BALLOON_DEFAULT_VISIBILITY="hidden";var BALLOON_DEFAULT_POSITION="absolute";var BALLOON_DEFAULT_ZINDEX=1000;var BALLOON_CLOSE_BUTTON_BACKGROUND="##CC9900";var BALLOON_CLOSE_BUTTON_X_OFFSET=16;var BALLOON_CLOSE_BUTTON_Y_OFFSET=4;var BALLOON_MIN_X_OFFSET=5;var ARROW_UP_DOWN_HEIGHT=19;var ARROW_LEFT_RIGHT_WIDTH=34;var ARROW_MIN_X_OFFSET=2;var SIGNUP_REDIRECT_ACTION_PARAM_NAME="redirectAction";var VEOH_REGISTRATON_BASE_URI='http://www.veoh.com/register.html?action=1®ister=1&signupRedirect=';var BALLOON_ARROW_URI_PREFIX="http://ll-appserver.veoh.com/images/balloonArrow";var glbXMousePos=0;var glbYMousePos=0;var glbXMousePosMax=0;var glbYMousePosMax=0;var glbBalloons=new Array();if(typeof VEOH=="undefined"||!VEOH) VEOH={};if(typeof VEOH.Widgets=="undefined"||!VEOH.Widgets) VEOH.Widgets={};if(typeof VEOH.Widgets.Balloon=="undefined"||!VEOH.Widgets.Balloon) VEOH.Widgets.Balloon={};if(typeof VEOH.Util=="undefined"||!VEOH.Util) VEOH.Util={};VEOH.Widgets.Balloon=function(res){this.res=res;this.originalRes=this.res;this.name=null;this.element=null;this.triggerElement=null;this.message=null;this.closeButton=null;this.arrow=null;this.width=BALLOON_DEFAULT_WIDTH;this.height=BALLOON_DEFAULT_HEIGHT;this.border=BALLOON_DEFAULT_BORDER;this.background=BALLOON_DEFAULT_BACKGROUND;this.textAlign=BALLOON_DEFAULT_TEXT_ALIGN;this.marginLeft="0px";this.marginRight="0px";this.marginTop="0px";this.marginBottom="0px";this.padding=BALLOON_DEFAULT_PADDING;this.position=BALLOON_DEFAULT_POSITION;this.top=null;this.left=null;this.hiddenElements=new Array();this.update=function(obj){this.element.innerHTML=obj.element.innerHTML;if(this.height[x]";a.href="javascript:void(0);";a.style.position="absolute";a.style.left=closeButtonPosX+"px";a.style.top=closeButtonPosY+"px";a.style.display="block";a.className="panelClose";container.appendChild(a);return a;};this.createArrow=function(){return new VEOH.Widgets.Balloon.Arrow(this);};this.display=function(){VEOH.Widgets.Balloon.popAll();this.top=glbYMousePos;this.left=glbXMousePos;if(!this.left||this.left<1) return;if(!this.element){var element=this.element=this.createElement();} else{var element=this.element;} if(!element) return;for(i in this.hiddenElements) {var el=document.getElementById(this.hiddenElements[i]);if(el) {log('hiding '+this.hiddenElements[i]);el.style.visibility="hidden";}} log("displaying balloon element: "+element.id);if(!document.getElementById(element.id)){document.body.appendChild(element);} if(!this.arrow) this.arrow=this.createArrow();if(this.arrow) this.arrow.display();element.style.visibility="visible";element.style.display=BALLOON_DEFAULT_DISPLAY;this.postProcess();};this.postProcess=function(){};this.pop=function(){log("hiding balloon element: "+this.element.id);if(this.arrow){this.arrow.xMousePos=null;this.arrow.yMousePos=null;} for(i in this.hiddenElements) {var el=document.getElementById(this.hiddenElements[i]);if(el) {log('hiding '+this.hiddenElements[i]);el.style.visibility="visible";}} if(this.element){VEOH.Util.removeChildSafe(this.element);this.element=null;if(this.arrow){this.arrow.destroy();this.arrow=null;}} if(!this.getGlobalElement()) this.updateResource(this.originalRes.id);};this.hide=this.pop;this.getResourceElement=function(){if(!this.res){log("ERROR: res is not defined");return null;} return this.res;};this.updateResource=function(resId){var res=document.getElementById(resId);if(!res){res=document.getElementById(resId+BALLOON_RESOURCE_ELEMENT_SUFFIX);if(!res){log("ERROR: can't find resource");return;}} this.res=res;this.populate();this.updateElement();};this.getName=function(){var resourceId=this.res.id;var iEnd=resourceId.indexOf(BALLOON_RESOURCE_ELEMENT_SUFFIX);var name=resourceId.substring(0,iEnd);if(name.length>0) return name;return null;};this.getTriggerElement=function(){if(!this.res){log("ERROR: res is not defined");return;} var triggerId;if(res.name){triggerId=res.name;} else{triggerId=this.getName();} if(!triggerId) return;var triggerElement=document.getElementById(triggerId);if(!triggerElement) return null;return triggerElement;};this.bind=function(eventName){if(!eventName) eventName=BALLOON_DEFAULT_EVENT_NAME;if(!this.triggerElement){VEOH.Util.log("unable to bind balloon: no triggerElement for "+this.name,"error","balloon");return;} if(!glbBalloons[this.name]) return;this.triggerElement[eventName]=VEOH.Util.createMethodReference(this,this.trigger);if(this.triggerElement.href) {this.triggerElement.href='javascript:void(0);';}};this.trigger=function(event){if(!event) event=window.event;try{event.preventDefault();} catch(e){} this.display();};this.isReady=function(){if(this.res&&this.name&&this.trigger) return true;VEOH.Util.log("Balloon not ready","error","balloon");return false;};this.getHeight=function(){if(!this.element) return 0;var strHeight=this.element.style.height;var iHeight=strHeight.substring(0,strHeight.length-2);return parseInt(iHeight);};this.getWidth=function(){if(!this.element) return 0;var strWidth=this.element.style.width;var iWidth=strWidth.substring(0,strWidth.length-2);return parseInt(iWidth);};this.populate();};VEOH.Widgets.Balloon.Arrow=function(balloon){this.balloon=balloon;this.orientation=null;this.container=null;this.element=null;this.orientation="down";this.left=null;this.top=null;this.createElement=function(orientation,element){if(!orientation) orientation="down";if(orientation=="none") return;var container=document.createElement("div");container.style.width=ARROW_LEFT_RIGHT_WIDTH+"px";container.style.height=ARROW_UP_DOWN_HEIGHT+"px";var arrow=document.createElement("img");arrow.id=this.balloon.name+"_balloon_arrow";arrow.style.display="none";arrow.style.position="absolute";arrow.style.zIndex=100;arrow.width=ARROW_LEFT_RIGHT_WIDTH;arrow.height=ARROW_UP_DOWN_HEIGHT;arrow.src=BALLOON_ARROW_URI_PREFIX+orientation.substring(0,1).toUpperCase()+orientation.substring(1,orientation.length)+".gif";this.element=arrow;container.appendChild(arrow);this.container=container;};this.getTop=function(){var topOffset=0;if("up"==this.orientation){topOffset=2-ARROW_UP_DOWN_HEIGHT;} else if("left"==this.orientation||"right"==this.orientation){try{topOffset=this.balloon.getHeight()/2;} catch(e){log("ERROR: unable to get top offset for arrow: "+e);topOffset=0;}} else if("none"!=this.orientation){var iContainerHeight=this.balloon.getHeight();topOffset=iContainerHeight-2+ARROW_UP_DOWN_HEIGHT;} return topOffset;};this.getLeft=function(){var leftOffset=0;var balloonWidth=this.balloon.getWidth();if("left"==this.orientation){return 2-ARROW_LEFT_RIGHT_WIDTH;} else if("right"==this.orientation){return balloonWidth+ARROW_LEFT_RIGHT_WIDTH-2;} else if("none"!=this.orientation){var absX=VEOH.Util.getAbsolutePosition(this.balloon.element,"x");log("absolute x position of balloon: "+absX);leftOffset=BALLOON_MIN_X_OFFSET;if(absX){if(this.xMousePos-absX>BALLOON_MIN_X_OFFSET){leftOffset=this.xMousePos-absX;}} leftOffset-=this.element.width/2;if(leftOffset0){log("y offset > 0; arrow faces up");return"up";} else{if(iYOffset<0){log("y offset < 0; arrow faces down");return"down";}} if(iXOffset>0){log("x offset > 0; arrow faces right");return"right";} else{if(iXOffset<0){log("x offset < 0; arrow faces left");return"left";}} return"none";};this.insert=function(){if(!this.balloon.element){log("ERROR: no element to position for","error");return;} if(!this.element){log("WARNING: no arrow to insert","error");return;} this.balloon.element.appendChild(this.element);log("inserting arrow into balloon pointing "+this.orientation);};this.position=function(){if(!this.balloon.element){log("ERROR: no element to position for","error");return;} if(!this.element){log("WARNING: no arrow to position","error");return;} this.top=this.getTop();this.left=this.getLeft();this.element.style.top=this.top+"px";this.element.style.left=this.left+"px";};this.display=function(keepPosition){if(!this.element){log("ERROR displaying arrow: element not defined","error");return;} this.discoverPointToPosition();this.insert();if(keepPosition){this.element.style.top=this.top+"px";this.element.style.left=this.left+"px";} else{this.position();} this.element.style.display="block";};this.destroy=function(){if(this.element){try{this.xMousePos=null;this.yMousePos=null;this.balloon.element.removeChild(this.element);} catch(e){log("ERROR destroying arrow: "+e,"error","balloon");}}};this.getHeight=function(){var strHeight=this.element.style.height;var iHeight=strHeight.substring(0,strHeight.length-2);return parseInt(iHeight);};this.getWidth=function(){var strWidth=this.element.style.width;var iWidth=strWidth.substring(0,strWidth.length-2);return parseInt(iWidth);};this.discoverPointToPosition=function(){if(!this.xMousePos) this.xMousePos=glbXMousePos;if(!this.yMousePos) this.yMousePos=glbYMousePos;};this.orientation=this.getOrientation();this.createElement(this.orientation,this.balloon.element);};VEOH.Widgets.Balloon.popAll=function(){var row;for(row in glbBalloons){if(!glbBalloons[row].element) continue;glbBalloons[row].pop();log("popping "+glbBalloons[row].name);}};VEOH.Widgets.Balloon.createBalloons=function(){log("creating balloons","notice","Balloon");var container=document.getElementById(BALLOON_RESOURCES_CONTAINER);if(!container) return;var arrRes=container.getElementsByTagName("input");var arrRes2=container.getElementsByTagName("textarea");for(var i=0;i0) return name[0];return null;};VEOH.Widgets.Balloon.Login=function(res){this.inheritFrom=VEOH.Widgets.Balloon;this.inheritFrom(res);this.postProcess=function(){this.loadLogin();var signupLink=document.getElementById("balloon_signupLink");if(signupLink) signupLink.href=this.getSignupRedirectUri();};this.loadLogin=function(el){var el=this.element;if(!el) return;var name=this.triggerElement.id;var sr=document.getElementById('mlRedirect');var url=window.location.href;if(url.indexOf('?')>-1&&sr) sr.value=url+'&'+SIGNUP_REDIRECT_ACTION_PARAM_NAME+'='+name;else if(sr) sr.value=url+'?'+SIGNUP_REDIRECT_ACTION_PARAM_NAME+'='+name;};this.getSignupRedirectUri=function(){var name=this.triggerElement.id;var url=window.location.href;if(url.indexOf('?')>-1) url=url+'&'+SIGNUP_REDIRECT_ACTION_PARAM_NAME+'='+name;else url=url+'?'+SIGNUP_REDIRECT_ACTION_PARAM_NAME+'='+name;url=encodeURIComponent(url);return VEOH_REGISTRATON_BASE_URI+url;};};VEOH.Widgets.Balloon.HomePage=function(res){this.inheritFrom=VEOH.Widgets.Balloon;this.inheritFrom(res);this.postProcess=function(){var el=this.element;if(!el) return;this.prepareLogin(el);var signupLink=document.getElementById("balloon_signupLink");if(signupLink) signupLink.href=this.getSignupRedirectUri(el);};this.prepareLogin=function(el) {if(!el) return;var id=this.name;var sr=document.getElementById('mlRedirect');var url=this.getAction(id);url=encodeURIComponent(url);sr.value='http://www.veoh.com'+url;var un=document.getElementById("j_username");if(!un) return;un.focus();};this.getSignupRedirectUri=function(el){if(!el) return;var id=this.name;url=this.getAction(id);url=encodeURIComponent(url);return VEOH_REGISTRATON_BASE_URI+url;};this.getAction=function(id){var url;if(id=='friends') url='/invite.html';else if(id=='favorites') url='/browse/videos.html';else if(id=='videos') url='/upload.html';else if(id=='channels') url='/publish/myChannels.html';else if(id=='groups') url='/publish/myGroups.html';else url='';return url;};};VEOH.Widgets.Balloon.Login.postbackAction=function(){var qs=VEOH.Util.queryString();if(qs==null){log("error loading querystring");return;} var action=qs[SIGNUP_REDIRECT_ACTION_PARAM_NAME];if(!action) return;var element=document.getElementById(action);if(!element) return;VEOH.Util.simulateEvent('click',action);log("event performed");};if(document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=VEOH.Util.captureMousePosition;} else{if(document.all){document.onmousedown=VEOH.Util.captureMousePosition;} else if(document.getElementById){document.onmousedown=VEOH.Util.captureMousePosition;}} var secDiv;var safari=false;function removeremoveUserComment(commentId) {ajaxMethodHandler.removeComment(removeremoveUserCommentResponse,commentId);return false;} function removeremoveUserCommentResponse(model) {var element=$('userCommentsPanel');element.innerHTML=model['responseBody'];} var widget;var siteKey='6LfsA0QpAAAAACd5o0EEyDwnupBa_Zz1sWH-aKaP';function generateReCaptchaV2() {widget=grecaptcha.render('recaptcha_id',{'sitekey':siteKey,'theme':'light'});} function ResetReCaptcha() {grecaptcha.reset(widget);} function getReCaptchaResponse(){return grecaptcha.getResponse(widget);} function addCommentToProfilePanel() {var commentForm=document.getElementById('addCommentForm');var commentFormElements=commentForm.elements;$("commentWarning").style.display="none";$("commentWarningLong").style.display="none";$("commentItMsg").style.display="none";$("commentEmptyMsg").style.display="";if(commentFormElements["comment"].value.length==0) {document.getElementById("commentEmptyMsg").style.display="none";Effect.Appear('commentWarning',{duration:2.0,transition:Effect.Transitions.wobble});} else if(commentFormElements["comment"].value.length>1024) {document.getElementById("commentEmptyMsg").style.display="none";Effect.Appear('commentWarningLong',{duration:2.0,transition:Effect.Transitions.wobble});} else {var comment=commentFormElements["comment"].value;var responseKey=getReCaptchaResponse();ajaxMethodHandler.addCommentToUserNew(addCommentToProfileResponse,commentFormElements["userId"].value,null,comment,siteKey,responseKey);}} function addCommentToProfileResponse(model) {ResetReCaptcha();if(model['errors']!=null||model['success']!="true"){return false;} document.getElementById('commentEmptyMsg').style.display='none';if(document.getElementById('commentItMsg').style.display=='none'){document.getElementById('commentItMsg').style.display='';} var element=document.getElementById('userCommentsPanel');element.style.display='';element.innerHTML=model['responseBody'];document.getElementById('comment').value='';var el=document.getElementById('commentNum');var cnt=parseInt(el.innerHTML)+1;if(document.getElementById('linkUserAll').style.display=='none'){if(cnt>5){document.getElementById('linkUserAll').style.display='';}} toggleDisplay2('commentPanel');toggleDisplay2('postCommentButtonHide');el.innerHTML=cnt;location.reload(true);return true;} function showAllComments(userId,offset) {ajaxMethodHandler.showAllUserComments(showAllCommentsResponse,userId,offset,10);} function showAllCommentsResponse(model) {var element=$('secondBody');if(model['errors']!=null) {} else {document.getElementById('commentDiv').style.display='none';document.getElementById('commentHeader').style.display='none';document.getElementById('userCommentsPanel').style.display='none';secDiv=element.innerHTML;element.innerHTML=model['responseBody'];}} function setSafari() {safari=true;} function showPageComments(userId,offset) {ajaxMethodHandler.showAllUserComments(showPageCommentsResponse,userId,offset,10);} function showPageCommentsResponse(model) {var element=$('secondBody');if(model['errors']!=null) {} else {document.getElementById('commentDiv').style.display='none';document.getElementById('commentHeader').style.display='none';document.getElementById('userCommentsPanel').style.display='none';element.innerHTML=model['responseBody'];if(safari) {resizeBy(0,-1);resizeBy(0,1);}}} function toProfile() {var element=$('secondBody');document.getElementById('commentDiv').style.display='';document.getElementById('commentHeader').style.display='';document.getElementById('userCommentsPanel').style.display='';element.innerHTML=secDiv;} function redirectIfneeded(obj){resetInvitePanel();if(obj.options[obj.options.selectedIndex].value=='createNewGroup'){window.location.href='/publish/myGroups.html';return false;}} function inviteUserToGroup(){var elem=document.getElementById('errorGPSpan');if(elem)setEleVis(elem,false);var selectObj=$('groupToAddTo');if(selectObj){var selectedItemValue=selectObj[selectObj.selectedIndex].value;if(selectedItemValue!='select'&&selectedItemValue!='createNewGroup'){var inviteBean={'action':'invite','permalinkId':selectedItemValue,'inviteEmails':null,'inviteUsers':document.getElementById('toBeInvitedUser').value,'inviteMessage':null,'inviteFromFirstName':null,'inviteFromLastName':null};ajaxMethodHandler.forwardToMultiActionController(inviteUserToGroupResponse,'groupControllerAjax',inviteBean);} else{var elem=document.getElementById('errorGPSpan');if(elem){elem.className=elem.className.replace("blueText","redText");elem.innerHTML='Please select a group.';setEleVis(elem,true);}}}} function inviteUserToGroupResponse(model){if(model['errors']!=null){alert(model['errors']);} else{var responses=eval(model["responseJson"])[0];if(responses["success"]==0){var erroreds=responses["errored"];elem=document.getElementById('errorGPSpan');if(elem){elem.innerHTML=erroreds[0];elem.className=elem.className.replace("blueText","redText");setEleVis(elem,true);} return;} elem=document.getElementById('errorGPSpan');if(elem){elem.innerHTML="Your invitation has been sent.";elem.className=elem.className.replace("redText","blueText");setEleVis(elem,true);}}} function setEleVis(elm,vis){if(elm.className.indexOf("useVisibility")>-1){elm.style.visibility=vis?"visible":"hidden";}else{elm.style.display=vis?"block":"none";}} function showGroups(checkEmpty){var elem=document.getElementById('myGroupList');if(elem.innerHTML==''&&checkEmpty){showMoreGroups(15,0,'/snippets/groupListPopup.jsp');}} function showMoreGroups(numResult,offset,template){ajaxMethodHandler.getLoggedInUserGroups(showGroupsResponse,numResult,offset,template);} function showGroupsPanel(){resetInvitePanel();var elem=document.getElementById('myGroupList');if(elem.innerHTML==''){ajaxMethodHandler.getLoggedInUserGroups(function(model){if(model['errors']!=null){alert(model['errors']);} else{showGroupsResponse(model);toggleDisplay2('inviteToGroupPanel');}},15,0,'/snippets/groupListPopup.jsp');} else{toggleDisplay2('inviteToGroupPanel');}} function showGroupsResponse(model){if(model['errors']!=null){alert(model['errors']);} else{var elem=document.getElementById('myGroupList'),btn=document.getElementById("inviteButton");if(elem){elem.innerHTML=model['responseBody'];if(model['totalCollections']>0){if(btn)btn.style.display='';}else{if(btn)btn.style.display='none';document.getElementById("errorGPSpan").style.display="none";elem.style.width="100%";elem.style.textAlign="center";}} elem=btn=null;}} function resetInvitePanel(){elem=document.getElementById('errorGPSpan');if(elem){setEleVis(elem,false);} elem=document.getElementById('inviteButton');if(elem)setEleVis(elem,true);} var WATCH_NOW_GUID_COMMAND="ECAEA07E-21A9-4deb-947E-288816A1F591";var SUBSCRIBE_GUID_COMMAND="B29791E1-A986-405a-8D40-51D7932650AD";var DOWNLOAD_GUID_COMMAND="49347A0A-C783-4e92-ADCE-ED7C93207E58";var DOWNLOAD_ALL_GUID_COMMAND="306AC90D-D92B-4350-8D1B-A22F61F2CB8C";var RSS_FEED_UNSUBSCRIBE="5C8C4ADA-580B-40b6-BAE6-177132734FD7";var buttonChannelSubscriptionClicked=false;var subIdToRemove=0;function onSubscribeClick(hasActiveClient,isAnonymous,type,value,callback,redirectUrl){if(isAnonymous==false||isAnonymous=='false'){if(type=='user') ajaxMethodHandler.addSubscriptionToPublisher(callback,value);if(type=='userfav') ajaxMethodHandler.forwardToMultiActionController(callback,'mySubscriptionsAjax',{action:'addFavorite',userFavoritesId:value});if(type=='channel') ajaxMethodHandler.addSubscription(callback,value);} else{var downloadLink=redirectUrl;if(redirectUrl==''||redirectUrl==null||redirectUrl=='null') downloadLink='/login.html';window.location.href='http://www.veoh.com'+downloadLink;}} function onSubscribeClickResponse_user(model){var username=model['username'];if(model['error']!=null) alert(model['error']);else{if($('addPublisher')) $('addPublisher').hide();if($('addPublisher'+username)) $('addPublisher'+username).hide();if($('subscribedUser')) $('subscribedUser').show();if($('subscribedUser'+username)) $('subscribedUser'+username).show();}} function onSubscribeClickResponse_channel(model){if(model['error']!=null) alert(model['error']);else{if($('addChannel')) $('addChannel').hide();if($('removeChannel')) $('removeChannel').show();}} function onSubscribeClickResponse_channeldetC(model){if(model['error']!=null) alert(model['error']);else{if($('subscribeChannel')) $('subscribeChannel').hide();if($('subscribedChannel')) $('subscribedChannel').show();}} function onSubscribeClickResponse_channeldetU(model){if(model['error']!=null) alert(model['error']);else{if($('subscribeUser')) $('subscribeUser').hide();if($('subscribedUser')) $('subscribedUser').show();}} function onSubscribeClickResponse_userfav(model){if(model['error']!=null) alert(model['error']);else{if($('subscribeFav')) $('subscribeFav').hide();if($('subscribedFav')) $('subscribedFav').show();}} function onSubscribeClickResponse_tv(model){if(model['error']!=null) alert(model['error']);else{if($('subscribetv')) $('subscribetv').hide();if($('subscribedtv')) $('subscribedtv').show();}} function onSubscribeClickResponse(model){if(model['error']!=null) alert(model['error']);else{}} function onSubscribeClickResponse_channelRec(model){if(model['error']!=null) alert(model['error']);else{var collectionId=model['collectionId'];var addSeries='addSeries'+collectionId;var subscribed='subscribed'+collectionId;if($(addSeries)) $(addSeries).hide();if($(subscribed)) $(subscribed).show();}} function onSubscribeClickResponse_userDetU(model){if(model['error']!=null) alert(model['error']);else{if($('subscribedUser')) $('subscribedUser').show();if($('subscribeUser')) $('subscribeUser').hide();}} function onSubscribeClickResponse_userDetF(model){if(model['error']!=null) alert(model['error']);else{if($('subscribedFav')) $('subscribedFav').show();if($('subscribeFav')) $('subscribeFav').hide();}} function onSubscribeClickResponse_userDetC(model){if(model['error']!=null) alert(model['error']);else{if($('subscribedChannel')) $('subscribedChannel').show();if($('subscribeChannel')) $('subscribeChannel').hide();}} function removeSubscription(subscriptionId,callback){subIdToRemove=subscriptionId;ajaxMethodHandler.removeSubscription(callback,subscriptionId);} function removeSubCallback(model){if(model['errorMessages']!=null){alert("Error: "+model['errorMessages']);} else if(model['errors']!=null){alert("Error: "+model['errors']);} else{if($('subscrp'+subIdToRemove)!=null){if($('subscrp'+subIdToRemove)) $('subscrp'+subIdToRemove).className='greyedOut';if($('removeSub'+subIdToRemove)) $('removeSub'+subIdToRemove).style.display='none';}}} function displayUnsubscribeButton(subscriptionId){if($('addSeries')!=null&&$('removeSeries')!=null){}} function displaySubscribeButton(){if($('addSeries')!=null&&$('removeSeries')!=null){}} function displayUnsubscribeFromPublisherButton(subscriptionId){if($('addPublisher')!=null&&$('removePublisher')!=null){}} function displaySubscribeToPublisherButton(){if($('addPublisher')!=null&&$('removePublisher')!=null){}} function getNewChallengeKey(){if(document.getElementById('recaptcha_widget')!=null) {var nodes=document.getElementById('recaptcha_widget').parentNode;var childnodes=nodes.childNodes;for(i=0;i1024){Effect.Appear('commentWarningLong',{duration:2.0,transition:Effect.Transitions.wobble});}else{var comment=commentFormElements["comment"].value;var responseKey=getReCaptchaResponse();if(type=='v'){ajaxMethodHandler.addCommentToVideoNew(addCommentResponse,commentFormElements["mediaId"].value,commentFormElements["permaId"].value,null,comment,siteKey,responseKey);}else{ajaxMethodHandler.addCommentToMediaCollection(addCommentResponse,commentFormElements["mediaId"].value,commentFormElements["permaId"].value,null,comment,siteKey,responseKey);}}} function replyToComment(mediaId,commentId,permaId,isSafari,type) {$('replyCommentWarning'+commentId).style.display='none';$('replyCommentWarningLong'+commentId).style.display='none';if(Form.Element.getValue('reply'+commentId).length==0){Effect.Shake('reply'+commentId);Effect.Appear('replyCommentWarning'+commentId,{duration:2.0,transition:Effect.Transitions.wobble});}else if(Form.Element.getValue('reply'+commentId).length>1024){Effect.Shake('reply'+commentId);Effect.Appear('replyCommentWarningLong'+commentId,{duration:2.0,transition:Effect.Transitions.wobble});}else{var comment=Form.Element.getValue('reply'+commentId);var responseKey=getReCaptchaResponse();if(type=='v'){ajaxMethodHandler.addCommentToVideoNew(addCommentResponse,mediaId,permaId,commentId,comment,siteKey,responseKey);}else if(type=='c'){ajaxMethodHandler.addCommentToMediaCollection(addCommentResponse,mediaId,permaId,commentId,comment,siteKey,responseKey);}}} function toReply(isShown,commentId) {if(isShown=="") {$('replyComment'+commentId).style.display='none';$('replyCommentWarning'+commentId).style.display='none';$('replyCommentAction'+commentId).style.display='none';} else {var openedContainerId=$('currentCommentContainer').value;if(openedContainerId!=''){$('replyComment'+openedContainerId).style.display='none';$('replyCommentAction'+openedContainerId).style.display='none';} $('currentCommentContainer').value=commentId;$('replyCommentWarning'+commentId).style.display='none';$('replyComment'+commentId).style.display='';$('replyCommentAction'+commentId).style.display='';var nodes=$('recaptcha_widget').parentNode;var childnodes=nodes.childNodes;for(i=0;i