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 AUTH_COOKIE_NAME="VEOH_GUIDE_AUTH";var VEOH_COOKIE="veohCookie";var RECAPTCHA_PUBLIC_KEY="6LcgyQAAAAAAAOcV5HwRlHcP2Z_SEJ4HDmPaiBJL";var SRC_RECS=0;var SRC_MOST_POPULAR=1;var targetingInfo="";var defaultAdHeight=250;var defaultAdWidth=300;var ad_pcategory='';var timePassed=0;function getShareObjectsCats(){timePassed+=100;var cat=document.getElementById('spudts');if(cat&&cat['hasDataLoaded']&&cat.hasDataLoaded()){getCatsSpudTS();}else if(timePassed<1000){setTimeout("getShareObjectsCats()",100);}else{fallback();}} if(window.attachEvent){window.attachEvent("onload",getShareObjectsCats);}else{window.addEventListener("load",getShareObjectsCats,false);} function fallback(){ad_pcategory="pcategory=;";postLoadAds();} function getCatsSpudTS(){var dcTagsArr='';var cat=document.getElementById('spudts');cats=cat.getCategory();cats=cats.replace("[","");cats=cats.replace("]","");dcTagsArr=cats.split(",");for(i=0;i=0;i--){if(str.charAt(i)!=" "){str=str.substring(0,i+1);break;}} if(str.charAt(0)==" "){return"";}else{return str;}}} function confirmDelete(obj){var msg="Are you sure you want to delete this "+obj+"?";ans=confirm(msg);if(ans){return true;}else{return false;}} function disableSubmit(submit) {frm.submit.disabled=1;} function selectText(strField) {document.getElementById(strField).select();} function getKey(e,textId) {var evtObj;if(window.event) {evtObj=window.event;} else {evtObj=e;} if(evtObj.keyCode==67||evtObj.keyCode==99||evtObj.keyCode==84||evtObj.keyCode==116||evtObj.keyCode==78||evtObj.keyCode==110) {if(evtObj.ctrlKey) {return true;}} else {return false;}} window.defaultStatus=document.title;var IFrameObj;function callToServer(url) {if(!document.createElement) {return true};var IFrameDoc;if(!IFrameObj&&document.createElement) {try {var tempIFrame=document.createElement('iframe');tempIFrame.setAttribute('id','RSIFrame');tempIFrame.style.border='0px';tempIFrame.style.width='0px';tempIFrame.style.height='0px';IFrameObj=document.body.appendChild(tempIFrame);if(document.frames) {IFrameObj=document.frames['RSIFrame'];}}catch(exception) {iframeHTML='\";document.body.appendChild(batch.div);batch.iframe=document.getElementById(idname);batch.iframe.setAttribute("style","width:0px; height:0px; border:0px;");if(batch.verb=="GET"){for(prop in batch.map){if(typeof batch.map[prop]!="function"){query+=encodeURIComponent(prop)+"="+encodeURIComponent(batch.map[prop])+"&";}} query=query.substring(0,query.length-1);batch.iframe.setAttribute("src",batch.path+"/exec/"+urlPostfix+"?"+query);document.body.appendChild(batch.iframe);} else{batch.form=document.createElement("form");batch.form.setAttribute("id","dwr-form");batch.form.setAttribute("action",batch.path+"/exec"+urlPostfix);batch.form.setAttribute("target",idname);batch.form.target=idname;batch.form.setAttribute("method","POST");for(prop in batch.map){var formInput=document.createElement("input");formInput.setAttribute("type","hidden");formInput.setAttribute("name",prop);formInput.setAttribute("value",batch.map[prop]);batch.form.appendChild(formInput);} document.body.appendChild(batch.form);batch.form.submit();}}};DWREngine._stateChange=function(batch){if(!batch.completed&&batch.req.readyState==4){try{var reply=batch.req.responseText;if(reply==null||reply==""){DWREngine._handleMetaDataWarning(null,"No data received from server");} else{var contentType=batch.req.getResponseHeader("Content-Type");if(!contentType.match(/^text\/plain/)&&!contentType.match(/^text\/javascript/)){if(DWREngine._textHtmlHandler&&contentType.match(/^text\/html/)){DWREngine._textHtmlHandler();} else{DWREngine._handleMetaDataWarning(null,"Invalid content type from server: '"+contentType+"'");}} else{if(reply.search("DWREngine._handle")==-1){DWREngine._handleMetaDataWarning(null,"Invalid reply from server");} else{eval(reply);}}} DWREngine._clearUp(batch);} catch(ex){if(ex==null)ex="Unknown error occured";DWREngine._handleMetaDataWarning(null,ex);} finally{if(DWREngine._batchQueue.length!=0){var sendbatch=DWREngine._batchQueue.shift();DWREngine._sendData(sendbatch);DWREngine._batches[DWREngine._batches.length]=sendbatch;}}}};DWREngine._handleResponse=function(id,reply){var handlers=DWREngine._handlersMap[id];DWREngine._handlersMap[id]=null;if(handlers){try{if(handlers.callback)handlers.callback(reply);} catch(ex){DWREngine._handleMetaDataError(handlers,ex);}} if(DWREngine._method==DWREngine.IFrame){var responseBatch=DWREngine._batches[DWREngine._batches.length-1];if(responseBatch.map["c"+(responseBatch.map.callCount-1)+"-id"]==id){DWREngine._clearUp(responseBatch);}}};DWREngine._handleServerError=function(id,error){var handlers=DWREngine._handlersMap[id];DWREngine._handlersMap[id]=null;if(error.message)DWREngine._handleMetaDataError(handlers,error.message,error);else DWREngine._handleMetaDataError(handlers,error);};DWREngine._eval=function(script){return eval(script);} DWREngine._abortRequest=function(batch){if(batch&&!batch.completed){clearInterval(batch.interval);DWREngine._clearUp(batch);if(batch.req)batch.req.abort();var handlers;for(var i=0;i=0xDC00&&c<0xE000)continue;if(c>=0xD800&&c<0xDC00){if(i>=wide.length)continue;s=wide.charCodeAt(i++);if(s<0xDC00||c>=0xDE00)continue;c=((c-0xD800)<<10)+(s-0xDC00)+0x10000;} if(c<0x80){enc+=String.fromCharCode(c);} else if(c<0x800){enc+=String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));} else if(c<0x10000){enc+=String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));} else{enc+=String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F));}} return enc;} DWREngine._hexchars="0123456789ABCDEF";DWREngine._toHex=function(n){return DWREngine._hexchars.charAt(n>>4)+DWREngine._hexchars.charAt(n&0xF);} DWREngine._okURIchars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";window.encodeURIComponent=function(s){s=DWREngine._utf8(s);var c;var enc="";for(var i=0;ithis.length){if(arguments.length>2)ind=this.length;else return[];} if(arguments.length<2)cnt=this.length-ind;cnt=(typeof cnt=="number")?Math.max(0,cnt):0;removeArray=this.slice(ind,ind+cnt);endArray=this.slice(ind+cnt);this.length=ind;for(var i=2;i=0;--j)this[j+i]=this[j];for(j=0;j0)value=DWRUtil.toDescriptiveString(obj,level-1,depth+1);else value=DWRUtil._detailedTypeOf(obj);} else{value=""+obj;value=value.replace(/\/n/g,"\\n");value=value.replace(/\/t/g,"\\t");}} catch(ex){value=""+ex;} if(level!=0){reply+=DWRUtil._indent(level,depth+2)+value+", \n";} else{if(value.length>13)value=value.substring(0,10)+"...";reply+=value+", ";if(i>5){reply+="...";break;}}} if(level!=0)reply+=DWRUtil._indent(level,depth)+"]";else reply+="]";} return reply;} if(typeof data=="string"||typeof data=="number"||DWRUtil._isDate(data)){return data.toString();} if(typeof data=="object"){var typename=DWRUtil._detailedTypeOf(data);if(typename!="Object")reply=typename+" ";if(level!=0)reply+="{\n";else reply="{";var isHtml=DWRUtil._isHTMLElement(data);for(var prop in data){if(isHtml){if(prop.toUpperCase()==prop||prop=="title"||prop=="lang"||prop=="dir"||prop=="className"||prop=="form"||prop=="name"||prop=="prefix"||prop=="namespaceURI"||prop=="nodeType"||prop=="firstChild"||prop=="lastChild"||prop.match(/^offset/)){continue;}} value="";try{obj=data[prop];if(obj==null||typeof obj=="function"){continue;} else if(typeof obj=="object"){if(level>0){value="\n";value+=DWRUtil._indent(level,depth+2);value=DWRUtil.toDescriptiveString(obj,level-1,depth+1);} else{value=DWRUtil._detailedTypeOf(obj);}} else{value=""+obj;value=value.replace(/\/n/g,"\\n");value=value.replace(/\/t/g,"\\t");}} catch(ex){value=""+ex;} if(level==0&&value.length>13)value=value.substring(0,10)+"...";var propStr=prop;if(propStr.length>30)propStr=propStr.substring(0,27)+"...";if(level!=0)reply+=DWRUtil._indent(level,depth+1);reply+=prop+":"+value+", ";if(level!=0)reply+="\n";i++;if(level==0&&i>5){reply+="...";break;}} reply+=DWRUtil._indent(level,depth);reply+="}";return reply;} return data.toString();};DWRUtil._indent=function(level,depth){var reply="";if(level!=0){for(var j=0;j/,">");}} var orig=ele;var nodes,node,i;ele=$(ele);if(ele==null){nodes=document.getElementsByName(orig);if(nodes.length>=1){ele=nodes.item(0);}} if(ele==null){DWRUtil.debug("setValue() can't find an element with id/name: "+orig+".");return;} if(DWRUtil._isHTMLElement(ele,"select")){if(ele.type=="select-multiple"&&DWRUtil._isArray(val)){DWRUtil._selectListItems(ele,val);} else{DWRUtil._selectListItem(ele,val);} return;} if(DWRUtil._isHTMLElement(ele,"input")){if(ele.type=="radio"){if(nodes==null)nodes=document.getElementsByName(orig);if(nodes!=null&&nodes.length>1){for(i=0;i=1){ele=nodes.item(0);} if(ele==null){DWRUtil.debug("getValue() can't find an element with id/name: "+orig+".");return"";} if(DWRUtil._isHTMLElement(ele,"select")){var sel=ele.selectedIndex;if(sel!=-1){var reply=ele.options[sel].value;if(reply==null||reply==""){reply=ele.options[sel].text;} return reply;} else{return"";}} if(DWRUtil._isHTMLElement(ele,"input")){if(ele.type=="radio"){var node;for(i=0;i1)return node.value;else return true;}}}} switch(ele.type){case"checkbox":case"check-box":case"radio":return ele.checked;default:return ele.value;}} if(DWRUtil._isHTMLElement(ele,"textarea")){return ele.value;} if(options.textContent){if(ele.textContent)return ele.textContent;else if(ele.innerText)return ele.innerText;} return ele.innerHTML;};DWRUtil.getText=function(ele){var orig=ele;ele=$(ele);if(ele==null){DWRUtil.debug("getText() can't find an element with id: "+orig+".");return"";} if(!DWRUtil._isHTMLElement(ele,"select")){DWRUtil.debug("getText() can only be used with select elements. Attempt to use: "+DWRUtil._detailedTypeOf(ele)+" from id: "+orig+".");return"";} var sel=ele.selectedIndex;if(sel!=-1){return ele.options[sel].text;} else{return"";}};DWRUtil.setValues=function(map){for(var property in map){if($(property)!=null||document.getElementsByName(property).length>=1){DWRUtil.setValue(property,map[property]);}}};DWRUtil.getValues=function(data){var ele;if(typeof data=="string")ele=$(data);if(DWRUtil._isHTMLElement(data))ele=data;if(ele!=null){if(ele.elements==null){alert("getValues() requires an object or reference to a form element.");return null;} var reply={};var value;for(var i=0;i=1){data[property]=DWRUtil.getValue(property);}} return data;}};DWRUtil.addOptions=function(ele,data){var orig=ele;ele=$(ele);if(ele==null){DWRUtil.debug("addOptions() can't find an element with id: "+orig+".");return;} var useOptions=DWRUtil._isHTMLElement(ele,"select");var useLi=DWRUtil._isHTMLElement(ele,["ul","ol"]);if(!useOptions&&!useLi){DWRUtil.debug("addOptions() can only be used with select/ul/ol elements. Attempt to use: "+DWRUtil._detailedTypeOf(ele));return;} if(data==null)return;var text;var value;var opt;var li;if(DWRUtil._isArray(data)){for(var i=0;i0){ele.removeChild(ele.firstChild);}}};DWRUtil.addRows=function(ele,data,cellFuncs,options){var orig=ele;ele=$(ele);if(ele==null){DWRUtil.debug("addRows() can't find an element with id: "+orig+".");return;} if(!DWRUtil._isHTMLElement(ele,["table","tbody","thead","tfoot"])){DWRUtil.debug("addRows() can only be used with table, tbody, thead and tfoot elements. Attempt to use: "+DWRUtil._detailedTypeOf(ele));return;} if(!options)options={};if(!options.rowCreator)options.rowCreator=DWRUtil._defaultRowCreator;if(!options.cellCreator)options.cellCreator=DWRUtil._defaultCellCreator;var tr,rowNum;if(DWRUtil._isArray(data)){for(rowNum=0;rowNum0){ele.removeChild(ele.firstChild);}};DWRUtil._isHTMLElement=function(ele,nodeName){if(ele==null||typeof ele!="object"||ele.nodeName==null){return false;} if(nodeName!=null){var test=ele.nodeName.toLowerCase();if(typeof nodeName=="string"){return test==nodeName.toLowerCase();} if(DWRUtil._isArray(nodeName)){var match=false;for(var i=0;itail.length) {if(pageTitle.indexOf(tail)!=-1) {newTitle=pageTitle.slice(0,pageTitle.indexOf(tail));}} return newTitle;} function hbxStrip(a){if(a!=null){a=a.split("|").join("");a=a.split("&").join("");a=a.split("'").join("");a=a.split("#").join("");a=a.split("$").join("");a=a.split("%").join("");a=a.split("^").join("");a=a.split("*").join("");a=a.split(":").join("");a=a.split("~").join("");a=a.split(";").join("");a=a.split(" ").join("+");a=a.split("\"").join("");} return a;} function setPageName(pageName){hbx.pn=hbxStrip(pageName);} function setErrorMessage(errorMsg){hbx.pec=hbxStrip(errorMsg);} function logLinkClick(lidValue,lposValue){} function logAjaxCall(lidValue,lposValue){} function logAjaxResponse(pageName,contentCategoryName){} function getSearchType(type){var theType="";switch(type){case'v':theType="Videos";break;case'c':theType="Channels";break;case's':theType="Series";break;case'u':theType="People";break;default:theType="Videos";} return theType;} function getOrder(type,order){var theOrder="";if(order=='') return"Most Relevant";switch(order){case'mr':theOrder="Most Recent";break;case'mp':theOrder="Most Popular";break;case'mc':theOrder="Most Discussed";break;case'ms':theOrder="Most Subscribed";break;case'tr':theOrder="Top Rated";break;case'tf':theOrder="Top Favorite";break;case'rl':theOrder="Run Length";break;} return theOrder;} function getRange(range){var theRange="";switch(range){case't':theRange="Today";break;case'w':theRange="This Week";break;case'm':theRange="This Month";break;case'a':theRange="All Time";break;default:theRange="This Week";} return theRange;} function logSearchCall(query,numResults,attr1,attr2,attr3,attr4){var ev1=_hbEvent("search");attr2=getOrder(attr1,attr2);attr3=getRange(attr3);attr1=getSearchType(attr1);ev1.keywords=hbxStrip(query);ev1.results=hbxStrip(numResults);ev1.attr1=hbxStrip(attr1);ev1.attr2=hbxStrip(attr2);ev1.attr3=hbxStrip(attr3);ev1.attr4=hbxStrip(attr4);}