var bVideo=null;var bWasBuffering=false;var autoPlayFeatured=true;var playerType="wmp";var wmpTimer;var div="tableDiv";var pageNavTopDiv="navCtlHeader";var pageNavDownDiv="navCtlFooter";var maxRows=30;var maxCols=1;var param={callID:"DEF_VID",renderStyle:5,imageIndex:0,div:div,pageNavTopDiv:pageNavTopDiv,pageNavDownDiv:pageNavDownDiv,pageTitleDiv:"navCtlTitle",imageWidth:200,imageHeight:30,maxRows:maxRows,maxCols:maxCols,thumbnailWidth:55,thumbnailHeight:45};var controlParam={videoDiv:"videoSection",videoCtlDiv:"controlDiv",navCtlDiv:"navCtlDiv",featuredDiv:"featuredControlDiv",navCtlWidth:311,videoWidth:628,videoHeight:272};function initializePlayerVar(){setCookie("mode","featured",null,null,null,null);setCookie("VideoCtlPageType","index",null,null,null,null);var isFirstTime=getCookie("FirstTime");if(isFirstTime==null||isFirstTime==""){var rnd=Math.random()*100%4;if(rnd>2){setCookie("VideoNavCtlMode","enlarged",null,null,null,null);reportUserAction("play_nav_resize_max::",null);if(rnd>=2){param.renderStyle=6;}}setCookie("MediaTypeFilter","P",null,null,null,null);}setCookie("FirstTime","false",null,null,null,null);}function PlayPlayer(){try{switch(playerType){case"flash":playFlashMovie(currentURL);break;case"wmp":thisMovie("wmpocx").controls.play();break;default:}}catch(e){}reportUserAction("play_resumed::",null);}function PausePlayer(){try{switch(playerType){case"flash":thisMovie("flashplayer").pauseFlashMovie();break;case"wmp":if(thisMovie("wmpocx").controls.isAvailable("Pause")){thisMovie("wmpocx").controls.pause();}break;default:}}catch(e){}}function StopPlayer(){try{switch(playerType){case"flash":stopFlashMovie();break;case"swf":clearInnerHTML(_elem("flashDiv"));break;case"wmp":clearInterval(wmpTimer);thisMovie("wmpocx").controls.stop();break;default:}_elem("featuredControlDiv").style.zIndex=30;currentURL=null;setTimeout("displayAdsInPlayer()",15000);}catch(e){}bWasBufferring=false;renderFeaturedCtl();}function PlayStateChange(NewState){switch(NewState){case 1:currentURL=null;if(bWasBuffering){bWasBufferring=false;}break;case 6:bWasBufferring=true;break;case 8:currentURL=null;StopPlayer();setTimeout("autoPlay()",10000);break;case 9:case 11:bWasBufferring=false;break;case 3:if(bWasBufferring){if(bVideo){thisMovie("wmpocx").fullScreen=false;}}break;default:}}function fullScreen(){if(playerType=="wmp"){if(bVideo){thisMovie("wmpocx").fullScreen=true;}}else{if(playerType=="flv"||playerType=="swf"){fullScreenFlashMovie();}}}var playVideoDelayedUrl=null;function playVideoDelayedBy(url,delay){if(playVideoDelayedUrl==url){return;}else{playVideoDelayedUrl=url;}playAfterAjaxCall=true;loadNavigation("notification","notificationType=findRelated&url="+encodeURIComponent(url),param);}function playVideoDelayed(url){playVideoDelayedBy(url,5500);}var playAfterAjaxCall=false;function prePlaySelectedVideo(collectionId,index){var collection=findCollection(collectionId);if(collection!=null&&collection.images[index]!=null){playSelectedVideo(collectionId,index);}else{loadNavigation("notification","notificationType=findRelated",getParamFromList(collectionId));}}var currentURL=null;var MAX_ALLOWED_FREE_VIEW=1;function playVideo(url){var contentViewCount=(getCookie("contentViewCount")==null?0:0+getCookie("contentViewCount"));if(!hasSignedIn()&&contentViewCount>MAX_ALLOWED_FREE_VIEW){setCookie("scriptAfterLogin","playVideo('"+url+"');",null,null,null,null);signin();return;}setCookie("contentViewCount",1+contentViewCount);if(url==null){return;}StopPlayer();try{_elem("featuredControlDiv").style.display="none";}catch(e){}try{_elem("adsDiv").style.display="none";}catch(e){}var ext=url.substr(url.lastIndexOf(".")+1);ext=ext.toLowerCase();switch(ext){case"flv":playerType="flash";break;case"swf":playerType="swf";break;case"dcr":playerType="swf";break;case"mp3":if(isIE()){playerType="wmp";}else{playerType="quicktime";}break;case"mov":playerType="quicktime";break;case"avi":playerType="flash";break;case"mp4":playerType="quicktime";break;case"m4v":playerType="quicktime";break;case"jpg":case"gif":case"png":case"bmp":case"tif":playerType="image";break;default:playerType="wmp";}enablePlayer(playerType);switch(playerType){case"flash":playFlashMovie(url);break;case"wmp":playWmp(url,true);break;case"swf":embedSWF(url);break;case"quicktime":playQuicktime(url);break;case"image":playImage(url);break;default:playFlashMovie(url);}if(currentURL!=url){invoke("notification","notificationType=play&url="+encodeURIComponent(url));}currentURL=url;setCookie("autoPlayFeatured","false",null,null,null,null);}function playImage(url){clearInnerHTML(_elem("flashDiv"));this.loading=true;var newImage=null;newImage=new Image();newImage.src=url;newImage.style.height=getPlayerHeight();_elem("flashDiv").appendChild(newImage);if(newImage.complete){this.element.src=newImage.src;this.loaded=true;}else{newImage.onload=function(){this.element.src=newImage.src;this.loaded=true;}.bind(this);}}function playQuicktime(url){clearInnerHTML(_elem("flashDiv"));var htmlStr=QT_GetOBJECT(url,getPlayerWidth(),getPlayerHeight(),"activeXVersion");_elem("flashDiv").innerHTML=htmlStr;}function playWmp(url,video){try{if(thisMovie("wmpocx").playState==3&&bVideo!=null&&bVideo!=video){return;}bVideo=video;if(thisMovie("wmpocx").playState==3){StopPlayer();}else{thisMovie("wmpocx").URL=url;wmpTimer=window.setInterval(updateMPPlayProgress,1000);}}catch(e){if(isFirstMovie){setTimeout("playVideo('"+url+"')",1500);}}}function displayAdsInPlayer(){if(currentURL!=null){return;}_elem("featuredControlDiv").style.zIndex=29;_elem("adsDiv").style.zIndex=30;_elem("adsDiv").style.display="block";}function updateMPPlayProgress(){try{playProgress(thisMovie("wmpocx").controls.currentPosition,thisMovie("wmpocx").controls.currentPosition/thisMovie("wmpocx").currentMedia.duration*100);}catch(e){}}function fwdPlayer(){try{switch(playerType){case"flash":thisMovie("flashplayer").fwdFlashMovie();break;case"wmp":thisMovie("wmpocx").controls.fastForward();break;}}catch(e){}reportUserAction("play_forwarded::",null);}function revPlayer(){try{switch(playerType){case"flash":thisMovie("flashplayer").revFlashMovie();break;case"wmp":thisMovie("wmpocx").controls.fastReverse();break;}}catch(e){}reportUserAction("play_reversed::",null);}function OnDSScriptCommandEvt(bstrType,bstrParam){if(bstrType.toLowerCase()=="caption"){var sCommand;sCommand='document.contentNav.document.writeln("<SPAN ID=content>';sCommand=sCommand+bstrParam;sCommand=sCommand+'");document.contentNav.document.close(); ';timerID=setTimeout(sCommand,0);}}function loadingProgress(percentage){window.setTimeout("indicateBufferingProgess("+(percentage)+")",10);}function indicateBufferingProgess(percentage){_elem("progressIndicator").innerHTML="<div id=prog style='z-index:1000;width:106px;'><div style=\"float:left;background-color:#666666;height:10px;width:"+percentage*106/100+'px;"></div></div>';}function formatNumber(num){if(num<1){return"00";}else{if(num<10){return"0"+num;}}return num;}function ClipPlayState(numState){PlayStateChange(numState);}function playProgress(playheadTime,percentage){window.setTimeout("indicatePlayProgess("+(playheadTime)+","+percentage+")",10);var playDuration=formatNumber(Math.floor(playheadTime/(60*60)))+":"+formatNumber(Math.floor(playheadTime/60))+":"+formatNumber(Math.floor(playheadTime%60));setCookie("playheadTimeValue",playDuration,null,null,null,null);}function indicatePlayProgess(playheadTime,percentage){var playheadTimeValue=formatNumber(Math.floor(playheadTime/60))+":"+formatNumber(Math.floor(playheadTime%60));_elem("timeIndicator").innerHTML="<table   height=10px  cellSpacing=0 cellPadding=0 border=0 ><tr><td  STYLE='text-align:center;font-size: 9px;font-weight: bold;'>"+playheadTimeValue+"</td></tr></table>";var htmlStr;htmlStr="<div id=progI align=left STYLE='position:relative;z-index:5000'><img  id='prgImg' src='video_images/progress.png' align=absbottom height=12px width="+percentage+"% /></div>";_elem("progressIndicator").innerHTML=htmlStr;}function volumeLevel(percentage){try{var maxWidth=40;var maxHeight=20;var htmlStr="<table align=center STYLE=' background-position:bottom center' width="+maxWidth+" height="+maxHeight+"  cellSpacing=0 cellPadding=0 border=0 ><tr>";for(i=1;i<=percentage/10;i++){htmlStr+="<td valign='bottom'> <a href=# OnClick='volumeLevel("+i*10+");return false;'><img  id='volume"+i+"' src='video_images/volumeActive.png' align=absbottom width="+maxWidth/10+" height="+((2/3)*maxHeight/10*i+(1/3*maxHeight))+" /></a></td>";}for(i=percentage/10+1;i<=10;i++){htmlStr+="<td valign='bottom'> <a href=# OnClick='volumeLevel("+i*10+");return false;'><img  id='volume"+i+"' src='video_images/volumeInactive.png'  align=absbottom width="+maxWidth/10+" height="+((2/3)*maxHeight/10*i+(1/3*maxHeight))+" /></a></td>";}htmlStr+="</tr><table>";_elem("volumnDiv").innerHTML=htmlStr;switch(playerType){case"flash":thisMovie("flashplayer").volumeFlashMovie(percentage);break;case"wmp":var ocx=thisMovie("wmpocx");if(ocx!=null){ocx.settings.volume=percentage;}break;}}catch(e){}}function playComplete(playheadTime){PlayStateChange(8);}function PositionChange(oldPosition,newPosition){}function isIE(){return(navigator.appName.indexOf("Microsoft")!=-1);}function thisMovie(movieName){return(isIE())?window[movieName]:document[movieName];}var isFirstMovie=true;function playFlashMovie(url){try{thisMovie("flashplayer").playFlashMovie(url);isFirstMovie=false;}catch(e){if(isFirstMovie){isFirstMovie=false;}else{clearInnerHTML($("flashDiv"));createPlayer("flash");}setTimeout("playVideo('"+url+"')",1500);}}function hideAllPlayers(){clearInnerHTML($("flashDiv"));clearInnerHTML($("wmpDiv"));}function stopFlashMovie(){thisMovie("flashplayer").stopFlashMovie();_elem("flashDiv").style.zIndex=-20;}function fullScreenFlashMovie(){thisMovie("flashplayer").goFullScreen();}var isFirstSlide=true;function initSlideShow(){enablePlayer("flash");isFirstSlide=true;}function initSlideShow(id,url,title,desc){enablePlayer("flash");var htmlStr="<table class='video_nav_table_style'   align='left' ><tr><td class='video_thumbnail'>";htmlStr+="<a href=# OnClick=\"setCookie('autoPlayFeatured','false',null,null,null,null);showSlides('"+id+"');return false;\"><img  id=SlideImg src='"+url+"' width=55 height=45 /></a>";htmlStr+="</td><td ><table ><tr><td>";htmlStr+="<a  class='video_title_style' href=# OnClick=\"setCookie('autoPlayFeatured','false',null,null,null,null);showSlides('"+id+"');return false;\">"+title+" </a>";htmlStr+="</td></tr><tr><td class='video_output_txt'>";htmlStr+="&nbsp;";+(desc==null||desc=="null"?"":desc);htmlStr+="</td><tr></table></td><tr></table>";_elem("slideDiv").innerHTML+=htmlStr;isFirstSlide=false;}function addToSlideShow(id,url,desc,index,canSave,canPrint){try{thisMovie("flashplayer").addToSlideShow(id,url,desc,index,canSave,canPrint);}catch(e){}try{if(isFirstSlide){var htmlStr="<table class='video_nav_table_style'   align='left' ><tr><td class='video_thumbnail'>";htmlStr+="<a href=# OnClick=\"showSlides('"+id+"');return false;\"><img  id=SlideImg src='"+url+"' width=55 height=45 /></a>";htmlStr+="</td><td class='video_output_txt'>";htmlStr+="&nbsp;";+(desc==null||desc=="null"?"":desc);htmlStr+="</td><tr></table>";_elem("slideDiv").innerHTML+=htmlStr;isFirstSlide=false;}}catch(e){}}function showSlides(id){autoPlayFeatured=false;StopPlayer();enablePlayer("flash");thisMovie("flashplayer").playSlideShow(id);}var previousPlayer=null;function createPlayer(playerType){if(playerType=="flash"){var flashPlayerDiv=_elem("flashDiv");if(previousPlayer=="image"||flashPlayerDiv==null||flashPlayerDiv==undefined||flashPlayerDiv.innerHTML==null||flashPlayerDiv.innerHTML==""){var so=new SWFObject("flashPlayer.swf","flashplayer",getPlayerWidth(),getPlayerHeight(),"8","#000000",true);so.addParam("wmode","window");so.addParam("allowFullScreen","true");so.setAttribute("xiRedirectUrl","http://www.multimediaQuest.com");so.write("flashDiv");}}if(playerType=="quicktime"){}if(playerType=="wmp"){if(_elem("wmpocx")==null||_elem("wmpocx")==undefined){try{var oElement=document.createElement("object");oElement.id="wmpocx";if(-1!=navigator.userAgent.indexOf("MSIE")){oElement.classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6";}else{if(-1!=navigator.userAgent.indexOf("Firefox")){oElement.type="application/x-ms-wmp";}}oElement.width=getPlayerWidth();oElement.height=getPlayerHeight();_elem("wmpDiv").appendChild(oElement);_elem("wmpocx").uiMode="none";var htmlStr='&lt;script for="wmpocx" event="PositionChange(oldPosition, newPosition)" language="JScript"&gt;PositionChange(oldPosition, newPosition);&lt;/script&gt;'+'&lt;script for="wmpocx" event="PlayStateChange(NewState)" language="JScript"&gt;PlayStateChange(NewState);&lt;/script&gt;'+'&lt;script for="wmpocx" event="Error()" language="JScript"&gt;StopPlayer();&lt;/script&gt;'+'&lt;SCRIPT FOR="wmpocx" EVENT="ScriptCommand(bstrType, bstrParam)" LANGUAGE="Jscript"&gt;'+' if (bstrType.toLowerCase() == "caption") {  document.all.contentIE.innerHTML = bstrParam; } '+"&lt;/SCRIPT&gt;";_elem("wmpDiv").innerHtml=_elem("wmpDiv").innerHtml+htmlStr;registerWMPEventObservers();}catch(e){}}}}function resizePlayer(){try{var width=getPlayerWidth(),height=getPlayerHeight();var player=_elem("flashplayer");if(player!=null||player!=undefined){player.style.width=width;player.style.height=height;}player=_elem("flashDiv");if(player!=null||player!=undefined){player.style.width=width;player.style.height=height;}player=_elem("wmpocx");if(player!=null||player!=undefined){player.style.width=width;player.style.height=height;}}catch(e){}}function init(){try{initializePlayerVar();initNavigation(param);if(getCookie("ContentSource")==null){setCookie("ContentSource","A",null,null,null,null);}renderVideoResizeCtl();renderFeaturedCtl();volumeLevel(50);setTimeout(autoPlay,100000);hideVideoControlIfPossible();setCookie("navInitialised","false",null,null,null,null);}catch(e){}}function minPlayer(){setCookie("VideoMode","M",null,null,null,null);renderVideoResizeCtl();reportUserAction("play_resize_min::",null);}function maxPlayer(){setCookie("VideoMode","N",null,null,null,null);renderVideoResizeCtl();reportUserAction("play_resize_max::",null);}function renderVideoResizeCtl(){try{resize(controlParam);var div=_elem("resizeCtlDiv");var videoMode=getCookie("VideoMode");var htmlStr=null;if(videoMode=="M"){htmlStr="<a href=#   title='"+getLocaleStr("player_min","Min Player")+"'  onClick=\"maxPlayer(); return false;\" ><img src='video_images/min.png' alt='Min Video'></a>";}else{htmlStr="<a href=# title='"+getLocaleStr("player_max","Max Player")+"'  onClick=\"minPlayer();return false;\" ><img src='video_images/max.png' alt=''></a>";}div.innerHTML=htmlStr;_elem("fullScrCtlDiv").innerHTML="<a href=#   title='"+getLocaleStr("player_full_screen","Full Screen")+"' onClick=\" fullScreen();reportUserAction('play_resize_fullscreen::',null);return false;\" ><img src='video_images/full.png' alt=''></a>";_elem("wholeVideoSection").style.visibility="visible";}catch(e){}}function renderFeaturedCtl(){if(getCookie("mode")=="featured"){_elem("featuredControlDiv").style.display="block";clearInnerHTML(_elem("featuredControlDiv"));var width=_elem("videoSection").offsetWidth;var so=new SWFObject("featuredVideo.swf","featuredVideoplayer",width,"125","8","#336699",true);so.setAttribute("xiRedirectUrl","http://www.multimediaQuest.com");so.addParam("wmode","transparent");so.addParam("allowScriptAccess","sameDomain");so.addParam("enableJSURL","true");so.addParam("enableHREF","true");so.addParam("saveEmbedTags","true");so.write("featuredControlDiv");}else{_elem("featuredControlDiv").style.display="none";}}function embedSWF(url){clearInnerHTML(_elem("flashDiv"));if(url.indexOf(".dcr")==-1){var so=new SWFObject(url,"flashplayer",getPlayerWidth(),getPlayerHeight(),"8","#000000",true);so.addParam("wmode","window");so.addParam("allowFullScreen","true");so.setAttribute("xiRedirectUrl","http://www.multimediaquest.com");so.write("flashDiv");}else{var htmlStr='<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0" width="'+getPlayerWidth()+'" height="'+getPlayerHeight()+'">';
htmlStr+="<param name=\"swRemote\" value=\"swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'\">";htmlStr+='<param name="swStretchStyle" value="meet">';htmlStr+='<param name="bgColor" value="#000000">';htmlStr+='<param name="src" value="'+url+'">';htmlStr+='<embed src="'+url+'" width="'+getPlayerWidth()+'" height="'+getPlayerHeight()+"\" bgColor=\"#000000\" swRemote=\"swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'\" swStretchStyle=\"meet\" type=\"application/x-director\" pluginspage=\"http://www.macromedia.com/shockwave/download/\"></embed>";htmlStr+="</object>";_elem("flashDiv").innerHTML=htmlStr;}}function enablePlayer(playerType){try{createPlayer(playerType);switch(playerType){case"image":case"quicktime":case"flash":_elem("wmpDiv").style.zIndex=-10;_elem("flashDiv").style.zIndex=20;_elem("wmpDiv").style.display="none";_elem("flashDiv").style.display="block";break;case"wmp":_elem("wmpDiv").style.zIndex=20;_elem("flashDiv").style.zIndex=-10;_elem("flashDiv").style.display="none";_elem("wmpDiv").style.display="block";break;case"swf":_elem("wmpDiv").style.zIndex=1;_elem("flashDiv").style.zIndex=2;_elem("wmpDiv").style.display="none";_elem("flashDiv").style.display="block";break;default:_elem("wmpDiv").style.zIndex=1;_elem("flashDiv").style.zIndex=2;_elem("wmpDiv").style.display="none";_elem("flashDiv").style.display="block";}previousPlayer=playerType;_elem("featuredControlDiv").style.zIndex=-30;}catch(e){}}function autoPlay(){if(getCookie("autoPlayFeatured")!="false"){playNextFeaturedMovie();}}function registerWMPEventObservers(){if(navigator.appName=="Netscape"){try{var plugin=document.wmpocx;appObs.setByProxyDSScriptCommandObserver(plugin,true);appObs.setByProxyDSPlayStateChangeObserver(plugin,true);appObs.setByProxyDSReadyStateChangeObserver(plugin,true);}catch(e){}}}function OnDSPlayStateChangeEvt(OldPlayState,NewPlayState){ClipPlayState(NewPlayState);}function OnDSReadyStateChangeEvt(ReadyState){}function playNextFeaturedMovie(){try{thisMovie("featuredVideoplayer").playNextFeaturedMovie();}catch(e){}}function getPlayerWidth(){if(!isIE()){var videoDiv=_elem(controlParam.videoDiv);if(videoDiv!=null){return videoDiv.style.width;}}return"100%";}function getPlayerHeight(){if(!isIE()){var videoDiv=_elem(controlParam.videoDiv);return videoDiv.style.height;}return"100%";}function maxPlayerNav(){setCookie("VideoMode","M");resize(controlParam);}function minPlayerNav(){setCookie("VideoMode","N");resize(controlParam);}function resize(controlParam){try{var videoDiv=_elem(controlParam.videoDiv);var videoCtlDiv=_elem(controlParam.videoCtlDiv);var ctlDiv=_elem(controlParam.navCtlDiv);var featuredDiv=_elem(controlParam.featuredDiv);var navCtlWidth=controlParam.navCtlWidth;var videoWidth=controlParam.videoWidth;var videoHeight=controlParam.videoHeight;var noVideoPlayerExist=_elem("videoSection")==null?true:false;var videoMode=getCookie("VideoMode");if(videoMode=="M"){reportUserAction("play_nav_resize_max::",null);videoDiv.style.height=(125+videoHeight)+"px";clearInnerHTML(featuredDiv);setCookie("VideoNavCtlMode","enlarged",null,null,null,null);}else{if(videoMode==null||videoMode=="N"){reportUserAction("play_nav_resize_min::",null);videoDiv.style.height=videoHeight+"px";}}var navCtlMode=getCookie("VideoNavCtlMode");if(navCtlMode!=null&&navCtlMode=="enlarged"){if(noVideoPlayerExist){_elem("outerNavCtlDiv").style.width="660px";}else{_elem("outerNavCtlDiv").style.width="710px";}_elem("outerNavCtlDiv").style.height="555px";_elem("outerNavCtlDiv").style.overflowY="auto";_elem("outerNavCtlDiv").style.overflowX="hidden";if(noVideoPlayerExist){ctlDiv.style.position="relative";ctlDiv.style.width="100%";ctlDiv.style.left="0px";}else{videoDiv.style.width=(videoWidth+navCtlWidth)+"px";ctlDiv.style.position="absolute";ctlDiv.style.width="712px";ctlDiv.style.left=((_elem("BODYCONTENT").offsetWidth-712))+"px";ctlDiv.style.top=(_elem("player-container").offsetHeight+_elem("player-container").offsetTop)+2+"px";}ctlDiv.style.overflow="hidden";ctlDiv.style.zIndex=1000;if(noVideoPlayerExist){ctlDiv.style.top="0px";}ctlDiv.style.height="660px";ctlDiv.style.borderColor="#363636";ctlDiv.style.borderWidth="1px";ctlDiv.style.borderBottomWidth="3px";ctlDiv.style.borderStyle="solid";ctlDiv.style.backgroundRepeat="no-repeat";ctlDiv.style.backgroundImage="url(images/dot.gif)";ctlDiv.style.backgroundColor="#000";ctlDiv.style.styleFloat="left";ctlDiv.style.opacity=0.98;if(noVideoPlayerExist){_elem("tableDiv").style.width=(ctlDiv.offsetWidth-20)+"px";}else{_elem("tableDiv").style.width="712px";}_elem("navCtlHeader").style.display="block";_elem("navCtlTitle").style.display="block";_elem("navCtlEnlargeDiv").style.display="none";}else{param.renderStyle=5;try{_elem("mainBodyDivCol").style.visibility="visible";_elem("featuredCollectionDiv").style.visibility="visible";}catch(e){}_elem("outerNavCtlDiv").style.height="236px";_elem("outerNavCtlDiv").style.overflowY="auto";_elem("outerNavCtlDiv").style.overflowX="hidden";if(!noVideoPlayerExist){videoDiv.style.width=(videoWidth)+"px";}else{_elem("outerNavCtlDiv").style.width="100%";}ctlDiv.style.height=videoHeight+10+"px";ctlDiv.style.position="relative";ctlDiv.style.left=0+"px";ctlDiv.style.top=0+"px";ctlDiv.style.width=navCtlWidth+"px";ctlDiv.style.backgroundRepeat="no-repeat";ctlDiv.style.borderWidth="0px";ctlDiv.style.borderLeftWidth="1px";ctlDiv.style.borderLeftStyle="dotted";ctlDiv.style.borderColor="#363636";ctlDiv.style.opacity=1;ctlDiv.style.backgroundColor="#000";ctlDiv.style.styleFloat="right";if(location.href.indexOf("collectionPage.html")>0){ctlDiv.style.backgroundImage="url(images/dot.gif)";}_elem("navCtlHeader").style.display="none";_elem("navCtlEnlargeDiv").style.display="block";_elem("navCtlEnlargeDiv").innerHTML="<a href='#'   title='"+getLocaleStr("play_nav_resize_max","Enlarge")+"' onClick=\"setCookie('VideoNavCtlMode','enlarged',null,null,null,null);resize(controlParam);return false;\"><img src='video_images/navMax.png' alt='"+getLocaleStr("player_nav_enlarge","Enlarge")+"'>&nbsp;";if(noVideoPlayerExist){_elem("tableDiv").style.width="100%";}else{_elem("tableDiv").style.width=videoDiv.offsetWidth+"px";}_elem("navCtlTitle").style.display="none";if(currentURL!=null){playVideo(currentURL);}}resizePlayer();renderFeaturedCtl();renderAssociatedDivs();var collection=findCollection(currentCollectionId);if(collection!=null){renderCollectionMedia(collection,param);}}catch(e){}}function showVideoControl(bShow){var vCtl=_elem("controlDiv");if(bShow){vCtl.style.display="block";vCtl.style.zIndex=1010;}else{vCtl.style.display="none";}}var bMouseStillOverVideo=false;function mouseOutVideoSection(){bMouseStillOverVideo=false;}function mouseOverVideoSection(){showVideoControl(true);setTimeout(hideVideoControlIfPossible,3000);bMouseStillOverVideo=true;}function hideVideoControlIfPossible(){if(!bMouseStillOverVideo){showVideoControl(false);}else{setTimeout(hideVideoControlIfPossible,3000);}}function getMore(url,action,parameter,param){location.href=url;setTimeout("loadNavigation(action,parameter,param)",4000);}var paramList=[];function addToParamList(param){for(i=0;i<paramList.length;i++){if(paramList[i].callID==param.callID){paramList[i]=param;return;}}paramList.push(param);}function getParamFromList(callID){for(i=0;i<paramList.length;i++){if(paramList[i].callID==callID){return paramList[i];}}return null;}function removeParamFromList(callID){for(i=0;i<paramList.length;i++){if(paramList[i].callID==callID){paramList.splice(i,1);}}}function initNavigation(param){if(getCookie("navInitialised")==null||getCookie("navInitialised")=="false"){var action=getCookie("action");action=((action==null||action=="null")?"notification":action);var parameter=getCookie("parameter");parameter=((parameter==null||parameter=="null")?"notificationType=findRelated&sort=date&filterOpt="+getCookie("MediaTypeFilter"):parameter);if(currentURL==null){loadNavigation(action,parameter,param);}setCookie("action",null,null,null,null,null);if(getCookie("VideoCtlPageType")!="collectionPage"){setCookie("parameter",null,null,null,null,null);}}setCookie("navInitialised","true",null,null,null,null);}function Collection(id){this.id=id;this.images=[];}function CollectionImage(url,thumbnail,comp_id,date,tags,title,desc,view_count,video_id,name,logo_link,web_link,access_restrict,priced){this.url=url;this.desc=desc;this.title=title;this.thumbnail=thumbnail;this.comp_id=comp_id;this.date=date;this.tags=tags;this.view_count=view_count;this.video_id=video_id;this.name=name;this.logo_link=logo_link;this.web_link=web_link;this.access_restrict=access_restrict;this.priced=(priced=="Y"?true:false);}function getHostname(){var host=location.href.substr(0,location.href.indexOf("/",8));return host;}var req=null;function initRequest(url){if(window.XMLHttpRequest){req=new XMLHttpRequest();}else{if(window.ActiveXObject){var ver=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];for(var i=0;i<ver.length;i++){try{req=new window.ActiveXObject(ver[i]);break;}catch(e){}}}}req.open("GET",url,true);}function loadNavigation(action,urlParameter,parameter){addToParamList(parameter);invoke(action,urlParameter+"&callID="+parameter.callID);}function postLoadNavigation(action,urlParameter,parameter){param=parameter;addToParamList(parameter);setCookie("action",action,null,null,null,null);setCookie("parameter",urlParameter,null,null,null,null);}function invoke(action,parameter){var host=getHostname();var path="action="+action+"&"+parameter;var url="service?"+path;dojo.xhrGet({url:url,handleAs:"xml",load:function(data,evt){processAjaxRequest(data);},error:function(data,evt){reportAjaxCallError(data);}});}function reportAjaxCallError(data){showAjaxCallProggress(false);}function processAjaxRequest(data){try{collection=null;var collections=data.getElementsByTagName("collection");for(var col=0;col<collections.length;col++){var imageCol=collections[col];var colId=imageCol.getAttribute("id");collection=new Collection(colId);for(var childIndex=0;childIndex<collections[col].childNodes.length;childIndex++){var nodeVal=collections[col].childNodes[childIndex];for(var childIndex2=0;childIndex2<nodeVal.childNodes.length;childIndex2++){var nodeVal2=nodeVal.childNodes[childIndex2];var title=nodeVal2.getElementsByTagName("title")[0].firstChild.nodeValue;var url=nodeVal2.getElementsByTagName("url")[0].firstChild.nodeValue;var desc=nodeVal2.getElementsByTagName("desc")[0].firstChild.nodeValue;var date=nodeVal2.getElementsByTagName("date")[0].firstChild.nodeValue;var thumbnail=nodeVal2.getElementsByTagName("thumbnail")[0].firstChild.nodeValue;var comp_id=nodeVal2.getElementsByTagName("comp_id")[0].firstChild.nodeValue;var video_id=nodeVal2.getElementsByTagName("video_id")[0].firstChild.nodeValue;var tags=nodeVal2.getElementsByTagName("tags")[0].firstChild.nodeValue;var view_count=nodeVal2.getElementsByTagName("view_count")[0].firstChild.nodeValue;var name=nodeVal2.getElementsByTagName("name")[0].firstChild.nodeValue;var logo_link=nodeVal2.getElementsByTagName("logo_link")[0].firstChild.nodeValue;var web_link=nodeVal2.getElementsByTagName("web_link")[0].firstChild.nodeValue;var access_restrict=nodeVal2.getElementsByTagName("access_restrict")[0].firstChild.nodeValue;var priced=nodeVal2.getElementsByTagName("priced")[0].firstChild.nodeValue;collection.images.push(new CollectionImage(url,thumbnail,comp_id,date,tags,title,desc,view_count,video_id,name,logo_link,web_link,access_restrict,priced));}}}storeCollection(collection);var paramInfo=getParamFromList(colId);paramInfo.imageIndex=0;renderCollectionMedia(collection,paramInfo);if(playAfterAjaxCall){prePlaySelectedVideo(colId,0);playAfterAjaxCall=false;}}catch(e){}}var collectionStore=[];var poolingForStorage=false;function storeCollection(collection){if(collection==null){return;}try{if(dojoIsLoaded){dojox.storage.put(collection.id,collection,function(status,key,message){if(status==dojox.storage.FAILED){console.debug("Unable to save collection data : "+message);}});if(findCollection(collection.id)!=null){collection=null;poolingForStorage=false;collectionStore=null;return;}}}catch(e){}try{poolingForStorage=true;collectionMemStore(collection);}catch(e){}}function collectionMemStore(collection){if(collectionStore){for(var c=0;c<collectionStore.length;c++){if(collectionStore[c].id==collection.id){collectionStore[c]=null;collectionStore[c]=new Array();}}}collectionStore.push(collection);}function findCollection(id){try{if(collectionStore!=null&&collectionStore.length>0){for(var c=0;c<collectionStore.length;c++){if(collectionStore[c].id==id){return collectionStore[c];}}}}catch(e){}try{var data=null;try{data=dojox.storage.get(id);}catch(e){}return data;}catch(e){}return null;}var paramStore=[];function storeParam(param){for(var c=0;c<paramStore.length;c++){if(paramStore[c].collectionId==param.collectionId){paramStore[c]=param;return;}}paramStore[paramStore.length]=param;}function findParam(collectionId){for(var c=0;c<paramStore.length;c++){if(paramStore[c].collectionId==collectionId){return paramStore[c];}}return null;}var currentIndex=-1;var currentSortOrder="random";var currentViewStyle="list";var currentCollectionId=null;var currentPage=0;var currentTimeFactor="all_time";function ago(date){date.replace(" ","");var lastChar=date.substr(date.length-1);if(isNaN(parseInt(lastChar,10))){return getLocaleStr("ago","ago");}else{return"";}}function randomizeCollectionMedia(collection){try{if(collection==null||collection.images==null){return;}for(var i=0;i<collection.images.length/2;i++){var p1=Math.floor(Math.random()*collection.images.length);var p2=Math.floor(Math.random()*collection.images.length);var tempStore=collection.images[p1];collection.images[p1]=collection.images[p2];collection.images[p2]=tempStore;}}catch(e){console.debug(e.message);}}function beginTranslation(startIndex){for(var i=startIndex;i<100+startIndex;i++){var tDiv=_elem("videoTitle"+i);if(tDiv){translateText("videoTitle"+i,_elem("videoTitle"+i).innerHTML);if(_elem("videoDesc"+i)){translateText("videoDesc"+i,_elem("videoDesc"+i).innerHTML);}}else{break;}}}function renderCollectionMedia(collection,param){try{showAjaxCallProggress(false);renderStyle=param.renderStyle;div=param.div;pageNavTopDiv=param.pageNavTopDiv;pageNavDownDiv=param.pageNavDownDiv;pageTitleDiv=param.pageTitleDiv;imageHeight=param.imageHeight;imageWidth=param.imageWidth;maxRows=param.maxRows;maxCols=param.maxCols;imageIndex=(param.imageIndex==null?0:param.imageIndex);var navCtlMode=getCookie("VideoNavCtlMode");if(renderStyle==7||renderStyle==8){navCtlMode="enlarged";}if(navCtlMode=="enlarged"){if(param.renderStyle==6||param.renderStyle==5){thumbnailHeight=75;thumbnailWidth=100;}else{thumbnailHeight=param.thumbnailHeight;thumbnailWidth=param.thumbnailWidth;}imageWidth="100%";if(renderStyle!=7&&renderStyle!=8){maxRows=4;param.maxRows=maxRows;}else{maxCols=param.maxCols;}if(param.renderStyle==6){imageWidth="100%";maxCols=5;}else{if(param.renderStyle==5){maxCols=1;}}}else{thumbnailWidth=55;thumbnailHeight=45;maxRows=9;maxCols=1;}param.imageWidth=imageWidth;param.maxCols=maxCols;param.maxRows=maxRows;param.thumbnailHeight=thumbnailHeight;param.thumbnailWidth=thumbnailWidth;previewMode=false;previewModeNoText=false;switch(renderStyle){case 8:renderStyle=6;previewMode=true;previewModeNoText=true;break;case 7:renderStyle=6;previewMode=true;break;default:previewMode=false;previewModeNoText=false;}restoreValuesAfterAjaxCall();if(collection==null||collection.images==null||collection.images.length==0){if(currentMediaInfo!=null&&currentMediaInfo.video_id!=undefined){collection.images[0]=currentMediaInfo;}else{return;}}currentCollectionId=collection.id;if(currentSortOrder=="random"){randomizeCollectionMedia(collection);}if(renderStyle==5){try{var idiv=_elem(div);var htmlStrFull="<div align='center'>";var htmlStr="";var htmlStrPart="";var index=imageIndex-1;for(var rowCount=0;
rowCount<maxRows;rowCount++){for(var colCount=0;colCount<maxCols;colCount++){index+=1;if(index>=collection.images.length){break;}htmlStr+="<div id='videoNavSection"+index+"' style='padding:10px;padding-bottom:5px;clear: both;'   align='center'>";if(collection!=null&&collection.images[index]!=null){htmlStr+="<div id='videoThumbnailSection"+index+"' align='left' class='videoNavThumbnailLostFocused' style='float:left' onmouseover='mouseOnThumbnail(\""+collection.id+'","videoThumbnailSection'+index+"\");' onmouseout='mouseOffThumbnail(\"videoThumbnailSection"+index+"\");'>";htmlStr+=navCtlMode=="enlarged"?"<div class='navCtlThumbnail' align='center'>":"<div class='video_thumbnail' align='center'>";htmlStr+="<a href=# OnClick=\"playSelectedVideo('"+collection.id+"',"+index+");reportUserAction('play::','"+collection.images[index].video_id+"');return false;\"><img  id=ThumbnailImg src='"+decodeURIComponent(collection.images[index].thumbnail)+"'  width='"+thumbnailWidth+"' height='"+thumbnailHeight+"' /></a>";htmlStr+="</div>";htmlStr+="</div>";htmlStr+="<div id='videoDescSection"+index+"'  align='left' style='float:left;margin-left:5px;"+(navCtlMode=="enlarged"?"width:450px;":"width:200px;")+"' >";htmlStr+="<div><a class='video_title_style' href=# id='videoTitle"+index+"'   OnClick=\"playSelectedVideo('"+collection.id+"',"+index+");reportUserAction('play::','"+collection.images[index].video_id+"'); return false;\">"+collection.images[index].title+"</a></div>";htmlStr+="<div valign='top'  align='left' style='padding-bottom:5px;padding-right:2px;'> ";htmlStr+="<div  class='imageLabel' style='padding:0px;width:"+imageWidth+";' id='videoDesc"+index+"'>"+enableLinksInText(collection.images[index].desc)+"</div>";htmlStr+="</div>";if(navCtlMode=="enlarged"){var tags=collection.images[index].tags;if(tags!=null){tags=tags.split(",");if(tags.length>0){htmlStr+="<div><span class='navCtlLabelTxt'>"+getLocaleStr("tags","Tags")+":&nbsp;</span>";}for(kount=0;kount<tags.length;kount++){htmlStr+="<a href=# onClick=\"findContentByTags('"+tags[kount]+"','');reportUserAction('search_content_tag::','"+tags[kount]+"');return false;\" ><span class='navCtlTags'>"+tags[kount]+"</span></a>&nbsp;";}if(tags.length>0){htmlStr+="</div>";}}htmlStr+="<div style='clear:both;'><span class='navCtlLabelTxt'>"+getLocaleStr("from","From")+": </span><a href='profile.html?pageId="+collection.images[index].comp_id+"&ownerId="+collection.images[index].comp_id+"' class='navCtlTxt'>"+collection.images[index].name+"</a></div>";htmlStr+="<div><span class='navCtlLabelTxt'>"+getLocaleStr("submitted","Submitted")+": </span><span class='navCtlTxt'>"+collection.images[index].date+"</span>&nbsp;"+ago(collection.images[index].date)+"</div><br>";}htmlStr+="<div id='videoControlPanel'  align='left'>";htmlStr+="<div   style='padding-right:5px;float:left;' ><a "+(hasAccessTo("D",collection.images[index].access_restrict)?"href=# class='video_links_style'  OnClick=\"download("+collection.images[index].video_id+");reportUserAction('download::','"+collection.images[index].video_id+"');\"":" class='video_links_style_disabled'  ")+" >"+getLocaleStr("video_download","Download")+"</a></div> ";if(navCtlMode=="enlarged"){htmlStr+="<div  style='padding-right:5px;float:left;' ><a "+(hasAccessTo("E",collection.images[index].access_restrict)?"class='video_links_style'  href=#  OnClick=\"embedVideo('ComSec"+collection.images[index].video_id+"','"+decodeURIComponent(collection.images[index].url)+"','"+decodeURIComponent(collection.images[index].thumbnail)+"');reportUserAction('share_embed::','"+collection.images[index].video_id+"');return false;\"":"  class='video_links_style_disabled'   ")+">"+getLocaleStr("featured_embed","Embed")+"</a></div> ";htmlStr+="<div  style='padding-right:5px;float:left;' ><a "+(hasAccessTo("S",collection.images[index].access_restrict)?"class='video_links_style' href=#   OnClick=\"linkToVideo('ComSec"+collection.images[index].video_id+"','"+collection.images[index].web_link+"');reportUserAction('share_link::','"+collection.images[index].video_id+"');return false;\"":"  class='video_links_style_disabled'   ")+">"+getLocaleStr("link","Link")+"</a></div> ";}htmlStr+="<div  style='padding-right:5px;float:left;' ><a "+(hasAccessTo("S",collection.images[index].access_restrict)?"class='video_links_style' href=#   OnClick=\"emailContent('"+encodeURIComponent(collection.images[index].desc)+"','"+collection.images[index].thumbnail+"','"+decodeURIComponent(collection.images[index].url)+"','"+encodeURIComponent(collection.images[index].title)+"','"+collection.images[index].video_id+"');return false;\"":"  class='video_links_style_disabled'   ")+">"+getLocaleStr("video_url_link","Email")+"</a></div> ";htmlStr+="<div  style='padding-right:5px;float:left;' ><a class='video_links_style' href=# onClick=\"favourite("+collection.images[index].video_id+");reportUserAction('favourite_content::','"+collection.images[index].video_id+"');return false;\" >"+getLocaleStr("favourite","Favourite")+"</a></div>";if(navCtlMode=="enlarged"){htmlStr+="<div  style='margin-right:5px;float:left;' ><a class='video_links_style' href=# onClick=\"showComments("+collection.images[index].video_id+",'ComSec"+collection.images[index].video_id+"');reportUserAction('comment_content_view::','"+collection.images[index].video_id+"');;return false;\" >"+getLocaleStr("comment","Comment")+"</a><a  id='aComSec"+collection.images[index].video_id+"'></a></div>";getCommentCount(collection.images[index].video_id,"aComSec"+collection.images[index].video_id);htmlStr+="<div  style='margin-left:25px;float:left;"+(hasAccessTo("S",collection.images[index].access_restrict)?"visibility:visible":"visibility:hidden")+"' >"+getWebLinksHtml(collection.images[index].title,collection.images[index].web_link,collection.images[index].logo_link,encodeURIComponent(collection.images[index].desc),collection.images[index].tags)+"</div>";}htmlStr+="</div>";if(navCtlMode=="enlarged"){htmlStr+="<div class='navCtlSep' ></div>";}htmlStr+="</div>";}htmlStr+="</div>";htmlStr+="<div class='mediaComment' id='ComSec"+collection.images[index].video_id+"'></div>";if(collection!=null&&index>collection.images.length){break;}if(currentMediaInfo!=null&&currentMediaInfo.video_id!=undefined&&currentMediaInfo.video_id==collection.images[index].video_id){htmlStrFull+="<div class='videoNavThumbnailFocused'>"+htmlStr+"</div>";}else{htmlStrPart+=htmlStr;}try{if(currentMediaInfo!=null&&currentMediaInfo!=undefined&&(index-imageIndex+2==maxCols*maxRows-1)){var collection_new=swapMediaContent(collection,collection.images[index].video_id,currentMediaInfo.video_id);collection=null;collection=collection_new;}htmlStr="";}catch(e){}}}htmlStrFull+=htmlStrPart+"</div>";}catch(e){}try{while(idiv.firstChild){idiv.removeChild(idiv.firstChild);}}catch(e){}idiv.innerHTML=htmlStrFull;setTimeout(showVideoNavSelected,2000);}if(renderStyle==6){try{var idiv=_elem(div);var htmlStr="";var index=imageIndex;for(var rowCount=0;rowCount<maxRows;rowCount++){htmlStr+='<div style="padding-bottom:5px;clear:both;">';for(var colCount=0;colCount<maxCols;colCount++){if(collection!=null&&collection.images[index]!=null){htmlStr+="<div  "+(!previewModeNoText&&!previewMode?" style='padding:2px;padding-left:5px;padding-right:5px;float:left;'":" style='float:left;'")+">";htmlStr+="<div id='videoThumbnailSection"+index+"'"+(previewModeNoText?"":("  align='left' class='videoNavThumbnailLostFocused'   onmouseover='mouseOnThumbnail(\""+collection.id+'","videoThumbnailSection'+index+"\");' onmouseout='mouseOffThumbnail(\"videoThumbnailSection"+index+"\");'"))+">";htmlStr+=(navCtlMode=="enlarged"?(previewModeNoText?"<div align='center'>":"<div class='navCtlThumbnail' align='center'>"):"<div class='video_thumbnail' align='center'>");htmlStr+="<a href=# OnClick=\"playSelectedVideo('"+collection.id+"',"+index+");reportUserAction('play::','"+collection.images[index].video_id+"');return false;\"><img  id=ThumbnailImg src='"+decodeURIComponent(collection.images[index].thumbnail)+"'  width='"+thumbnailWidth+"' height='"+thumbnailHeight+"'  "+(previewModeNoText?'title ="'+collection.images[index].title+'"':"")+"/></a>";htmlStr+="</div>";htmlStr+="</div>";if(!previewModeNoText){htmlStr+=' <div style="width:'+thumbnailWidth+"px\" ><table cellpadding='0' cellspacing='0' border='0'><tr><td   width='"+thumbnailWidth+"'><a class='video_title_style' href=# id='videoTitle"+index+"'  OnClick=\"playSelectedVideo('"+collection.id+"',"+index+");reportUserAction('play::','"+collection.images[index].video_id+"');return false;\">"+collection.images[index].title+"</a></td></tr>";htmlStr+="</table></div>";}if(!previewMode){htmlStr+='<div style="width:'+thumbnailWidth+"px\"><span class='navCtlLabelTxt'>"+getLocaleStr("from","From")+": </span><a href='profile.html?pageId="+collection.images[index].comp_id+"&ownerId="+collection.images[index].comp_id+"' class='navCtlTxt'>"+collection.images[index].name+"</a></div>";}if(navCtlMode=="enlarged"){}htmlStr+="</div>";index+=1;}}htmlStr+="</div>";if(collection!=null&&index>collection.images.length){break;}}}catch(e){}try{while(idiv.firstChild){idiv.removeChild(idiv.firstChild);}}catch(e){}idiv.innerHTML=htmlStr;}htmlStr=null;setTimeout("beginTranslation("+imageIndex+")",2000);}catch(e){}renderPageNavigation(collection,index);}var previewMode=false,previewModeNoText=false;function signinBeforePlayingVideo(contentId,scriptToRunOnSuccess){if(!hasSignedIn()){alert(getLocaleStr("signin_msg","Please sign in"));setCookie("scriptAfterLogin",scriptToRunOnSuccess,null,null,null,null);signin();return true;}return false;}function accessSecuredContent(contentId,functionToCall,scriptToRunOnSigninSuccess){if(signinBeforePlayingVideo(contentId,scriptToRunOnSigninSuccess)){return;}UploadDownload.getSecureContentInfo(contentId,function(info){if(info){try{eval(functionToCall);return;}catch(e){}}else{purchaseContent(contentId,functionToCall);}});}function playVideoById(videoId){location.href="http://multimq.com/cid/"+videoId;}function playSelectedVideo(collectionId,index){var collection=findCollection(collectionId);if(collection==null){alert(getLocaleStr("error","Opps, something bad happened!!"));return;}try{if(!hasAccessTo("W",collection.images[index].access_restrict)){if(signinBeforePlayingVideo(collection.images[index].video_id)){return;}}if(_elem("videoSection")!=null){if(collection.images[index].priced){accessSecuredContent(collection.images[index].video_id,"playVideo(decodeURIComponent(info.contentUrl));","location.href='index.jsp?cid="+collection.images[index].video_id+"';");return;}playVideo(decodeURIComponent(collection.images[index].url));document.title=collection.images[index].title;if(collection&&collection.images[index]){currentMediaInfo=collection.images[index];}var searchMode=getCookie("searchMode");if(searchMode==null||searchMode==undefined){setCookie("searchMode","",null,null,null,null);}renderSearchModes();}else{location.href=collection.images[index].web_link;}}catch(e){}finally{collection=null;}return false;}function emailContent(desc,thumbnail,url,title,contentId){invoke("notification","notificationType=initSession&ResourceDesc="+desc+"&ResourceLinkThumbnailURL="+thumbnail+"&ResourceLink=http://multimq.com/cid/"+contentId+"&ResourceTitle="+title);_adfspu("video:frmEmail",0,0,"video:cmdEmail");reportUserAction("share_email::",contentId);}function getWebLinksHtml(linkTitle,linkUrl,linkThumbnail,linkDesc,linktags){var linkStr="";try{var diggLinkUrl="http://multimediaquest.com";diggLinkUrl=linkUrl.replace("http://multiMQ.com",diggLinkUrl);var tag="";try{tag=linktags.replaceAll(/,*/," ");}catch(e){}linkStr+='<a target="_blank" class="weblink-image-link windowOpener" title="Share this video on Facebook" href="http://www.facebook.com/sharer.php?u='+linkUrl+"&amp;t="+linkTitle+'" id="facebook"></a> ';linkStr+='<a target="_blank" class="weblink-image-link" title="Del.icio.us" href="http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url='+linkUrl+"&amp;title="+linkTitle+"&amp;tags="+tag+"&amp;notes="+linkDesc+'" id="delicious"></a> ';linkStr+='<a target="_blank" class="weblink-image-link" title="Digg it!" href="http://digg.com/submit?phase=2&amp;url='+diggLinkUrl+"&amp;title="+linkTitle+"&amp;bodytext="+linkDesc+"&amp;thumbnail="+linkThumbnail+'" id="digg"></a> ';linkStr+='<a target="_blank" class="weblink-image-link" title="Stumbleupon" href="http://www.stumbleupon.com/submit?url='+linkUrl+'" id="stumble"></a>';linkStr+='<a target="_blank" class="weblink-image-link" title="Reddit" href="http://reddit.com/submit?url='+linkUrl+"&amp;title="+linkTitle+'" id="reddit"></a>';linkStr+='<a target="_blank" class="weblink-image-link" title="Twitter" href="http://twitter.com/home?status='+linkTitle.replace(/\s+/g,"+")+"+"+linkUrl+'" id="netscape"></a>';}catch(e){}return linkStr;}function hasAccessTo(accessFlag,access_restrict){return((access_restrict==null||access_restrict==undefined||access_restrict=="_"||access_restrict.indexOf(accessFlag))>=0?true:false);}function renderAssociatedDivs(){if(!(param.renderStyle==5||param.renderStyle==6)){return;}renderStyle=param.renderStyle;div=param.div;pageNavTopDiv=param.pageNavTopDiv;pageNavDownDiv=param.pageNavDownDiv;pageTitleDiv=param.pageTitleDiv;imageHeight=param.imageHeight;imageWidth=param.imageWidth;maxRows=param.maxRows;maxCols=param.maxCols;var navCtlMode=getCookie("VideoNavCtlMode");var htmlStr="";var ipagediv=_elem(pageNavTopDiv);htmlStr='<div class="navCtlTitle"><div id="navCtlHeaderTop">';htmlStr+='<div id="navCtlSourceDiv"><label for="sourceList" class="navCtlLabel">'+getLocaleStr("download_source","Source")+'&nbsp;<select name="sourceList" id="sourceList"  onchange="contentSourceChanged();" class="NavCtlComboStyle"></select></label></div>';htmlStr+="<div id='navCtlSearchDiv'><form onSubmit='return searchForContent();' method='GET'><label for='navCtlSearchInput' accesskey='2' id='navCtlSearchLabel'  class='navCtlSearchLabel' >"+getLocaleStr("search","Search")+"</label><input id='navCtlSearchInput' class='NavCtlSearch' type='text' value='' maxlength='100' size='20' onfocus='_elem(\"navCtlSearchLabel\").style.visibility=\"hidden\"' onmouseout='if(_elem(\"navCtlSearchInput\").value==\"\")_elem(\"navCtlSearchLabel\").style.visibility=\"visible\";'><input id='navCtlSearchSubmit'  onclick='searchForContent();reportUserAction(\"search_content_entered_text::\",null);return false;' src=\"images/search.gif\" alt=\"Search\" type=\"image\"></form></div>";htmlStr+="<div id='navCtlSearchOpt'></div>";htmlStr+="<div id='navCtlToggleView'></div>";if(!(_elem("videoSection")==null?true:false)){htmlStr+=" <div id='navCtlHeaderMax'><a  href=# onClick=\"setCookie('VideoNavCtlMode','minimized',null,null,null,null);resize(controlParam);return false;\"><img src='video_images/navMin.png' title='"+getLocaleStr("minimize","Minimize")+"' alt='"+getLocaleStr("minimize","Minimize")+"'></a> </div> ";}htmlStr+="</div>";htmlStr+="<div id='navCtlHeaderBottom'>";htmlStr+=" <div id='contentNavSortOrderDiv'></div>";htmlStr+=" <div id='contentNavAgeOrderDiv'></div>";try{htmlStr+="<div id='resetDiv'><a href=# onClick=\"resetQuery();reportUserAction('search_reset::',null);return false;\" class='navCtlHeader'>("+getLocaleStr("reset","Reset")+")</a> </div>";}catch(e){}htmlStr+="  <div id='nav_ctl_media_type' style='width:180px'></div>";htmlStr+="<div style='clear:both;'></div></div></div>";_elem(pageTitleDiv).display="block";ipagediv=_elem(pageTitleDiv);ipagediv.innerHTML=htmlStr;setTimeout(refreshContentCtlHeader,800);}function searchForContent(){var tags=_elem("navCtlSearchInput").value;findContentByTags(tags,"matchAllSearchTerms=true");return false;}function refreshContentCtlHeader(){initContentSourceSelection();renderSearchModes();renderContentNavAgeOrder();renderContentNavSortOrder();renderNavToggler();renderMediaType();}function renderNavToggler(){try{var htmlStr="<!--<span class='navCtlHeader'>"+getLocaleStr("view_as","View As")+":&nbsp;</span>-->";if(param.renderStyle==6){htmlStr+="<a href=# onClick=\"switchNavViewMode('thumbnail');reportUserAction('play_nav_switch_view_mode::','thumbnail');return false;\"><img src='video_images/list_button.png' title='"+getLocaleStr("thumbnail","Thumbnail")+"' alt='"+getLocaleStr("thumbnail","Thumbnail")+"'></a>&nbsp;&nbsp;";
}else{htmlStr+="<a href=# onClick=\"switchNavViewMode('list');reportUserAction('play_nav_switch_view_mode::','list');return false;\"><img src='video_images/thumb_button.png' title='"+getLocaleStr("list","List")+"' alt='"+getLocaleStr("list","List")+"'></a>&nbsp;&nbsp;";}_elem("navCtlToggleView").innerHTML=htmlStr;}catch(e){}}function contentNavAgeOrderChanged(timeFactor){currentTimeFactor=timeFactor;currentPage=0;renderContentNavAgeOrder();queryForContent();reportUserAction("play_nav_sort-order_age::",timeFactor);}function hideExtraContentNavAgeOrder(flag){contentNavAgeOrderShouldBeHidden=flag;if(flag){contentNavAgeOrderTimerId=setTimeout("dynaContentNavAgeOrder(false)",6000);}else{dynaContentNavAgeOrder(true);}}var contentNavAgeOrderTimerId=0;var contentNavAgeOrderShouldBeHidden=true;function dynaContentNavAgeOrder(flag){try{var htmlStr="";var styleUnsel="navCtlTitleUnSelected";var styleSel="navCtlTitleSelected2";if(flag){}else{if(!contentNavAgeOrderShouldBeHidden){clearTimeout(contentNavAgeOrderTimerId);return;}styleUnsel="navCtlTitleUnSelectedAndHidden";}var timeFactor=["today","week","month","year","all_time"];var timeStr=["today","weekly","monthly","yearly","all_time"];for(fCount=0;fCount<timeFactor.length;fCount++){if(currentTimeFactor==timeFactor[fCount]){htmlStr+="<a class='"+styleSel+"' onmouseover='hideExtraContentNavAgeOrder(false);' onmouseleave='hideExtraContentNavAgeOrder(true);' onmouseout='hideExtraContentNavAgeOrder(true);'>"+getLocaleStr(timeStr[fCount],timeStr[fCount])+"</a>&nbsp;&nbsp;";}else{htmlStr+="<a  class='"+styleUnsel+"' href=# onClick=\"contentNavAgeOrderChanged('"+timeFactor[fCount]+"');return false;\"><span class='"+styleUnsel+"'>"+getLocaleStr(timeStr[fCount],timeStr[fCount])+"</span></a>&nbsp;&nbsp;";}}_elem("contentNavAgeOrderDiv").innerHTML=htmlStr;}catch(e){}}function renderContentNavAgeOrder(){dynaContentNavAgeOrder(false);}function renderSearchModes(){try{var canQuery=false;var sOpt=_elem("navCtlSearchOpt");var searchMode=getCookie("searchMode");if(searchMode==null||searchMode==undefined){sOpt.style.visibility="hidden";return;}else{sOpt.style.visibility="visible";}var htmlStr="";var modes=[];if(_elem("videoSection")!=null){modes.push(new Array("R","search_mode_related","Recommended","search_mode_related_detail","Search for content related to the current content being played"));modes.push(new Array("U","search_mode_user","This User","search_mode_user_detail","Search for content belonging to the owner of the current content being played"));modes.push(new Array("C","search_mode_collection","Collection","search_mode_collection_detail","Retrieve only content contained in the collection the current content belongs to"));}else{modes.push(new Array("F","favourite","Favourite"));}for(var m=0;m<modes.length;m++){if(searchMode.indexOf(modes[m][0])!=-1){htmlStr+='<div id="navCtlSearchModeSel" title="'+getLocaleStr(modes[m][3],modes[m][4])+'" onmouseover="this.style.cursor=\'pointer\'" onclick="SearchModesChanged(\''+modes[m][0]+"');\">"+getLocaleStr(modes[m][1],modes[m][2])+"</div>";}else{htmlStr+='<div id="navCtlSearchModeUnSel" title="'+getLocaleStr(modes[m][3],modes[m][4])+'" onmouseover="this.style.cursor=\'pointer\'" onclick="SearchModesChanged(\''+modes[m][0]+"');\">"+getLocaleStr(modes[m][1],modes[m][2])+"</div>";}}_elem("navCtlSearchOpt").innerHTML=htmlStr;if(currentMediaInfo!=null&&searchMode!=null&&searchMode!=""){var extraParam="";var tags="";if(searchMode.indexOf("R")!=-1){tags=currentMediaInfo.tags;canQuery=true;}if(searchMode.indexOf("U")!=-1){extraParam+="&compId="+currentMediaInfo.comp_id;canQuery=true;}if(searchMode.indexOf("C")!=-1){extraParam+="&getContentInCollection=true&contentId="+currentMediaInfo.video_id;canQuery=true;}}if(searchMode.indexOf("F")!=-1){extraParam+="&compId="+getCookie("compIdForFavourite")+"&getOnlyFavourite=true";canQuery=true;}if(canQuery){findContentByTags(tags,extraParam);}}catch(e){}}function SearchModesChanged(newMode){try{var searchMode=getCookie("searchMode");if(searchMode==null||searchMode==undefined){searchMode="_";}for(var i=0;i<newMode.length;i++){if(searchMode.indexOf(newMode)==-1){searchMode+=newMode;}else{searchMode=searchMode.replace(newMode,"");}}setCookie("searchMode",searchMode,null,null,null,null);renderSearchModes();}catch(e){}reportUserAction("play_nav_search_mode::",newMode);}function renderContentNavSortOrder(){try{var htmlStr="";if(currentSortOrder=="date"){htmlStr+="<span class='navCtlTitleSelected'>"+getLocaleStr("most_recent","Most Recent")+"</span>&nbsp;&nbsp;";}else{htmlStr+="<a href=# onClick=\"contentNavSortChanged('date');return false;\"><span class='navCtlTitleUnSelected'>"+getLocaleStr("most_recent","Most Recent")+"</span></a>&nbsp;&nbsp;";}if(currentSortOrder=="popularity"){htmlStr+="<span class='navCtlTitleSelected'>"+getLocaleStr("most_popular","Most Popular")+"</span>&nbsp;&nbsp;";}else{htmlStr+="<a href=# onClick=\"contentNavSortChanged('popularity');return false;\"><span class='navCtlTitleUnSelected'>"+getLocaleStr("most_popular","Most Popular")+"</span></a>&nbsp;&nbsp;";}_elem("contentNavSortOrderDiv").innerHTML=htmlStr;}catch(e){}}function contentNavSortChanged(sOrder){currentSortOrder=sOrder;currentPage=0;renderContentNavSortOrder();queryForContent();reportUserAction("play_nav_sort-order_popularity::",sOrder);}function queryForContent(){var searchMode=getCookie("searchMode");if(searchMode!=null&&searchMode!=undefined&&searchMode!=""){findRelatedVideos(currentIndex);}else{findContentByTags("","");}}function switchNavViewMode(currentViewStyle){if(currentViewStyle=="list"){param.renderStyle=6;}else{if(currentViewStyle="thumbnail"){param.renderStyle=5;}}currentPage=0;renderNavToggler();renderCollectionMedia(findCollection(currentCollectionId),param);}function enableLinksInText(inputTxt){return inputTxt;var MAX_ALLOWED_LINKS_IN_TXT=10;var txt=inputTxt;if(txt==null||txt==undefined){return txt;}var sPos=0;ePos=0;var linkTxt="";var count=0;while(txt.indexOf("http://")!=-1&&count<MAX_ALLOWED_LINKS_IN_TXT){txt=formatLinkTxt(txt,"http://",true);count+=1;}while(txt.indexOf("www.")!=-1&&count<MAX_ALLOWED_LINKS_IN_TXT){txt=formatLinkTxt(txt,"www.",true);count+=1;}return txt;}function formatLinkTxt(txt,replTxt,isPreceeding){var linkTxt="";var delimiter=" ";var sPos=0;var outTxt="";if(isPreceeding){linkTxt=txt.subStr((sPos=txt.indexOf(replTxt))-replTxt.length,txt.indexOf(delimiter,sPos));if(linkTxt.indexOf(".")!=-1&&txt.indexOf("<a href='",sPos-"<a href='".length+1)==-1){outTxt=txt.replace(linkTxt,"<a href='"+linkTxt+"'  target='_blank'>"+txt.subStr(txt.indexOf(replTxt),txt.indexOf(delimiter,sPos))+"</a>");}}else{}return outTxt;}function renderPageNavigation(collection,index){if(!collection){return;}if(collection.images.length-index>-1){htmlStr="<table width=100%><tr><td></td></tr><tr><td width='25%'></td><td><td align='right'><span class='pageNavTitleStyle' >"+getLocaleStr("pages","Pages")+":</span><td  align=right><A onClick=\"renderPage(-1);return false;\"  href='#'  class='pageNavStyle'><img src='images/arrow_prev.gif' atl='<<'></A>";var totalPageCount=0;for(var pages=0;pages<(collection.images.length)/(maxRows*maxCols);pages++){if(currentPage==pages){htmlStr+="<span class='pageNavStyle2'>"+(pages+1)+"</span>";}else{if(totalPageCount>20){htmlStr+='<A  onClick="renderPage('+pages+");currentPage="+pages+";return false;\"  href='#' class='pageNavStyle'>...</A>";break;}else{htmlStr+='<A  onClick="renderPage('+pages+");currentPage="+pages+";return false;\"  href='#' class='pageNavStyle'>"+(pages+1)+"</A>";}}totalPageCount+=1;}htmlStr+="<A onClick='renderPage(-2);return false;'  href='#'  class='pageNavStyle' > <img src='images/arrow_next.gif' atl='>>'> </A>";htmlStr+="</td></tr><tr><td></td></tr></table>";ipagediv=_elem(pageNavTopDiv);ipagediv.innerHTML=htmlStr;ipagediv=_elem(pageNavDownDiv);ipagediv.style.display="block";ipagediv.innerHTML=htmlStr;}else{if(collection.images.length-index<=0&&collection.images.length<maxRows){clearInnerHTML(_elem(pageNavTopDiv));clearInnerHTML(_elem(pageNavDownDiv));}}}function contentSourceChanged(){var sel=_elem("sourceList");setCookie("ContentSource",sel.value,null,null,null,null);resetQuery();}var currentPage=0;function resetQuery(){showAjaxCallProggress(true);currentIndex=-1;currentSortOrder="random";currentPage=0;currentTimeFactor="all_time";currentMediaInfo=null;setCookie("currentVideoId",null,null,null,null,null);setCookie("searchMode",null,null,null,null,null);renderAssociatedDivs();var extraParam="&filterOpt="+getCookie("MediaTypeFilter");if(getCookie("VideoCtlPageType")!="collectionPage"){var source=getCookie("ContentSource");source=source==null?"":source;source=source.replace("Q","");loadNavigation("notification","notificationType=findRelated&time="+currentTimeFactor+"&tags=_&source="+source+extraParam,param);}else{loadNavigation("notification",getCookie("parameter")+extraParam,param);}}function renderPage(pageNum){try{var navCtlMode=getCookie("VideoNavCtlMode");if(navCtlMode=="enlarged"){maxRows=4;}collectionId=currentCollectionId;var collection=findCollection(collectionId);if(pageNum!=-1&&pageNum!=-2){currentPage=pageNum;}if(pageNum==imageIndex){return;}if(pageNum==-2){currentPage+=1;pageNum=currentPage;}if(pageNum==-1){currentPage-=1;pageNum=currentPage;}var oldIndex=imageIndex;imageIndex=pageNum*maxRows*maxCols;if(param!=null||param!=undefined){param.imageIndex=imageIndex;}renderCollectionMedia(collection,param);if(param!=null||param!=undefined){param.imageIndex=oldIndex;}}catch(e){}}var isMouseOn=false;var isMouseOff=false;var contentProtectedIcon=null;function mouseOnThumbnail(callId,id){if(!isMouseOn){_elem(id).className="videoNavThumbnailFocused";isMouseOn=true;}isMouseOff=false;var collection=findCollection(callId);try{var indexFromThumbnail=id.substr("videoThumbnailSection".length);if(collection.images!=null&&collection.images[indexFromThumbnail]!=null){if(!hasAccessTo("W",collection.images[indexFromThumbnail].access_restrict)){contentProtectedIcon=document.createElement("img");contentProtectedIcon.src="images/viewRestricted.png";contentProtectedIcon.style.styleFloat="right";contentProtectedIcon.style.position="absolute";contentProtectedIcon.style.marginTop="-34px";contentProtectedIcon.style.padding="1px";contentProtectedIcon.style.zIndex=_elem(id).style.zIndex+5;_elem(id).appendChild(contentProtectedIcon);}}}catch(e){}finally{collection=null;}}function mouseOffThumbnail(id){if(!isMouseOff){_elem(id).className="videoNavThumbnailLostFocused";isMouseOff=true;}isMouseOn=false;if(contentProtectedIcon!=null){clearInnerHTML(contentProtectedIcon);}}function showVideoNavSelected(){var collection=findCollection(currentCollectionId);try{var prefix="videoNavSection";var div=null;for(var i=0;i<collection.images.length;i++){div=_elem(prefix+i);if(div==null){continue;}if(i==currentIndex){div.className="videoNavSelected";div.style.height=_elem("videoDescSection"+i).offsetHeight+"px";}else{div.className="videoNavUnSelected";}}_elem("sourceList").value=getCookie("ContentSource");}catch(e){}finally{collection=null;}}function mediaTypeChanged(filter){var newFilter=getCookie("MediaTypeFilter")==null?" ":getCookie("MediaTypeFilter");var mTypes=Array("V","G","P","M");for(var i=0;i<mTypes.length;i++){if(filter==mTypes[i]){if(newFilter.indexOf(mTypes[i])!=-1){newFilter=newFilter.replace(mTypes[i],"");}else{newFilter+=mTypes[i];}}}setCookie("MediaTypeFilter",newFilter,null,null,null,null);renderMediaType();queryForContent();reportUserAction("play_nav_media-type-switch::",filter);}function renderMediaType(){try{var storedFilter=getCookie("MediaTypeFilter");if(storedFilter==null){storedFilter="P";setCookie("MediaTypeFilter",storedFilter,null,null,null,null);}var htmlStr="";if(storedFilter.indexOf("V")!=-1){htmlStr+="<div id='mediaTypeDivVideo' style='float:left;width:40' class='mediaTypeInactive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('V')\" >"+getLocaleStr("content_type_video","Video")+"</div> ";}else{htmlStr+="<div id='mediaTypeDivVideo' style='float:left;width:40;' class='mediaTypeActive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('V')\" >"+getLocaleStr("content_type_video","Video")+"</div> ";}if(storedFilter.indexOf("M")!=-1){htmlStr+="<div id='mediaTypeDivMusic' style='float:left;width:40;' class='mediaTypeInactive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('M')\" >"+getLocaleStr("content_type_music","Music")+"</div> ";}else{htmlStr+="<div id='mediaTypeDivMusic' style='float:left;width:40;' class='mediaTypeActive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('M')\" >"+getLocaleStr("content_type_music","Music")+"</div> ";}if(storedFilter.indexOf("P")!=-1){htmlStr+="<div id='mediaTypeDivImage' style='float:left;width:50;' class='mediaTypeInactive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('P')\" >"+getLocaleStr("content_type_picture","Photo")+"</div>";}else{htmlStr+="<div id='mediaTypeDivImage' style='float:left;width:50;' class='mediaTypeActive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('P')\" >"+getLocaleStr("content_type_picture","Photo")+"</div>";}if(storedFilter.indexOf("G")!=-1){htmlStr+="<div id='mediaTypeDivGame' style='float:left;width:40;' class='mediaTypeInactive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('G')\" >"+getLocaleStr("content_type_game","Game")+"</div> ";}else{htmlStr+="<div id='mediaTypeDivGame' style='float:left;width:40;' class='mediaTypeActive' onmouseover=\"this.style.cursor='pointer'\" onclick=\"mediaTypeChanged('G')\" >"+getLocaleStr("content_type_game","Game")+"</div> ";}_elem("nav_ctl_media_type").innerHTML=htmlStr;}catch(e){}}var currentMediaInfo=null;function findRelatedVideos(index){var collection=findCollection(currentCollectionId);try{if(collection!=null&&collection.images[index]!=null&&(index<0||index>collection.images.length)){setCookie("currentVideoId",collection.images[index].video_id,null,null,null,null);}currentIndex=index;setCookie("autoPlayFeatured","false",null,null,null,null);var tags="";if(collection!=null&&collection.images[index]!=null){tags=(index<0||index>collection.images.length?"":collection.images[index].tags);}try{var title=collection.images[index].title;if(title!=null){title=title.replace("'s","");title=title.replace("'S","");title=title.replace("'","");tags=title+","+tags;}}catch(e){}findContentByTags(tags,"");}catch(e){}finally{collection=null;}}function findContentByTags(tags,extraParam){try{showAjaxCallProggress(true);var callParam="&"+extraParam+"&";if(currentTimeFactor!=null&&currentTimeFactor!="all_time"){callParam="&time="+currentTimeFactor;}callParam+="&sort="+currentSortOrder;callParam+="&filterOpt="+getCookie("MediaTypeFilter");callParam+="&source="+getCookie("ContentSource");if(getCookie("VideoCtlPageType")!="collectionPage"){callParam+="&tags="+tags;loadNavigation("notification","notificationType=findRelated&"+callParam,param);}else{loadNavigation("notification",getCookie("parameter")+callParam,param);}}catch(e){}}document.onmousedown=trackCurrentClickPos;var mousePos;function trackCurrentClickPos(e){mousePos=getMousePos(e);}function showAjaxCallProggress(show){try{var ajaxProgDiv=_elem("ajaxProgDiv");if(!show){if(ajaxProgDiv!=null){clearInnerHTML(ajaxProgDiv);}return;}if(ajaxProgDiv==null){ajaxProgDiv=document.createElement("div");ajaxProgDiv.id="ajaxProgDiv";}ajaxProgDiv.style.top="35px";ajaxProgDiv.style.left=mousePos[0]-360+"px";ajaxProgDiv.style.styleFloat="left";ajaxProgDiv.style.position="absolute";ajaxProgDiv.style.display="block";ajaxProgDiv.style.zIndex=100000;ajaxProgDiv.innerHTML="<img src='images/loader.gif' alt='-----------------------'>";_elem("tableDiv").appendChild(ajaxProgDiv);}catch(e){}}function restoreValuesAfterAjaxCall(){try{var collection=findCollection(currentCollectionId);currentIndex=-1;var videoId=getCookie("currentVideoId");for(var i=0;i<collection.images.length;i++){if(videoId==collection.images[i].video_id){currentIndex=i;
break;}}if(currentMediaInfo!=null){var currentMediaInfoExists=false;for(var i=0;i<collection.images.length;i++){if(currentMediaInfo.video_id==collection.images[i].video_id){currentMediaInfoExists=true;break;}}if(!currentMediaInfoExists){collection[collection.images.length]=currentMediaInfo;storeCollection(collection);}}}catch(e){}finally{}}function indexOfContent(collection,contentId){for(var k=0;k<collection.images.length;k++){if(collection.images[k].video_id==contentId){return k;}}return -1;}function swapMediaContent(collection,contentId1,contentId2){try{var p1=indexOfContent(collection,contentId1);var p2=indexOfContent(collection,contentId2);var tempStore=collection.images[p1];collection.images[p1]=collection.images[p2];collection.images[p2]=tempStore;return collection;}catch(e){}return null;}var isSpamHidden=false;function getCommentCount(videoId,elemId){dojo.xhrGet({url:"service?action=getMediaComments&findTotalComment=true&mediaId="+videoId,handleAs:"xml",load:function(data,evt){var comment=data.getElementsByTagName("comment_data");for(var col=0;col<comment.length;col++){var cInfo=comment[col];_elem(elemId).innerHTML=" <span style='font-weight:normal;'>("+cInfo.getAttribute("comment_count")+")</span>";}}});}function hideSpams(){var comDiv=null;for(var i=0;i<spamLevels.length;i++){comDiv=_elem(spamLevels[i].id);if(comDiv==null){continue;}if(spamLevels[i].value>=MAX_FLAG_COUNT_FOR_A_SPAM&&isSpamHidden){comDiv.style.display="none";}else{comDiv.style.display="block";}}var a=_elem("spamDisplay");if(isSpamHidden){isSpamHidden=false;a.innerHTML=getLocaleStr("show_spam","Show Spam");}else{isSpamHidden=true;a.innerHTML=getLocaleStr("hide_spam","Hide Spam");}}function hideMediaComment(commentDivId){destroyElement(commentDivId);}function destroyElement(id){var elem=_elem(id);if(elem!=null){elem.innerHTML="";}}function hidePostCommentForm(){destroyElement("postMediaCommentFrm");var elem=_elem("postMediaCommentFrm");elem.style.display="none";}function submitMediaCommentForm(videoId,refCommentId){var commentTxt=_elem("mediaCommentCommentTxt").value;if(commentTxt==null||commentTxt==""){alert(getLocaleStr("comment_null_msg","Please enter a comment"));return;}dojo.xhrGet({url:"service?action=postComment&mediaId="+videoId+"&comment="+commentTxt+"&refCommentId="+refCommentId,handleAs:"xml",load:function(data,evt){}});alert(getLocaleStr("comment_submitted","Comment was submited successfully"));destroyElement("postMediaCommentFrm");}function postMediaComment(videoId,refCommentId,parentDivId){if(getCookie("CompId")==null){signin();return;}destroyElement("postMediaCommentFrm");var newDiv=document.createElement("div");newDiv.id="postMediaCommentFrm";newDiv.className="postMediaCommentFrm";newDiv.innerHTML+='<div class="close" onclick="hidePostCommentForm();">&nbsp;</div>';newDiv.innerHTML+='<div align="center" style="padding:3px;width:298px"><textarea cols="40" rows="5" name="mediaCommentCommentTxt" id="mediaCommentCommentTxt" onfocus="if(this.value==\'Comment\')this.value=\'\';" onblur="if(this.value==\'\')this.value=\''+getLocaleStr("comment","Comment")+"';\"></textarea>";newDiv.innerHTML+='<input onclick="submitMediaCommentForm('+videoId+",'"+refCommentId+'\')" name="submitMediaComment" id="submitMediaComment" value="'+getLocaleStr("submit","Submit")+'" class="submit" type="button"></div>';_elem(parentDivId).appendChild(newDiv);}function renderCommentHrd(videoId,refCommentId,commentDiv){if(refCommentId==null||refCommentId==""){var newDiv=document.createElement("div");newDiv.id="CommentHrdDiv";newDiv.className="mediaCommentHrdStyle";commentDiv.appendChild(newDiv);var commentTitleDiv=document.createElement("div");commentTitleDiv.className="mediaCommentTitle";commentTitleDiv.innerHTML=getLocaleStr("comment","Comment");newDiv.appendChild(commentTitleDiv);var commentCloseDiv=document.createElement("div");commentCloseDiv.className="mediaCommentClose";commentCloseDiv.innerHTML="<div class='close' onclick='hideMediaComment(\""+commentDiv.id+"\");return false;'></div>";newDiv.appendChild(commentCloseDiv);var commentCtrlDiv=document.createElement("div");commentCtrlDiv.className="mediaCommentHeaderCtl";commentCtrlDiv.innerHTML="<a id='spamDisplay' href=# onclick='hideSpams();return false;'>"+getLocaleStr("hide_spam","Hide Spam")+"</a>&nbsp;&nbsp;"+"<a href=# onclick='postMediaComment("+videoId+',"","ComPost'+refCommentId+'");reportUserAction("comment_content_submitted::",'+videoId+");return false;'>"+getLocaleStr("post_comment","Post Comment")+"</a>&nbsp;&nbsp;";commentCloseDiv.appendChild(commentCtrlDiv);var dummyDiv=document.createElement("div");dummyDiv.style.clear="both";newDiv.appendChild(dummyDiv);var commentPageCtrlDiv=document.createElement("div");commentPageCtrlDiv.className="mediaCommentPageNav";newDiv.appendChild(commentPageCtrlDiv);var newCommentPostingDiv=document.createElement("div");newCommentPostingDiv.id="ComPost";commentDiv.appendChild(newCommentPostingDiv);}else{}}function renderCommentSubHrd(cInfo,commentDiv){var newDiv=document.createElement("div");newDiv.className="mediaCommentSubHrdStyle";commentDiv.appendChild(newDiv);newDiv.innerHTML="<img class='mediaCommentThumbnail' onclick='visitUserProfile("+cInfo.getAttribute("comp_id")+");return false;' onmouseover=\"this.style.cursor='pointer'\" src='"+cInfo.getAttribute("logo_link")+"' style='width:27px;height:30px' alt=''>";newDiv.innerHTML+="<span style='float:left;text-align:left;'><small><a href=#  onclick='visitUserProfile("+cInfo.getAttribute("comp_id")+");return false;'>"+cInfo.getAttribute("name")+"</a></small><br/>"+"<small>"+cInfo.getAttribute("date")+" "+ago(cInfo.getAttribute("date"))+"</small><br/></span>";newDiv.innerHTML+="<div style='padding:5px;float:right;'><a href=# onclick=\"reportCommentSpam("+cInfo.getAttribute("video_id")+",'"+cInfo.getAttribute("id")+"');return false;\">"+getLocaleStr("spam","Spam")+"</a>"+'&nbsp;&nbsp;<a href=# onclick="rankMediaComment('+cInfo.getAttribute("video_id")+",'"+cInfo.getAttribute("id")+"',1);return false;\"><img src='images/push_up.png' alt='"+getLocaleStr("comment_rank_up","Put On Top")+"'></a><a href=# onclick=\"rankMediaComment("+cInfo.getAttribute("video_id")+",'"+cInfo.getAttribute("id")+"',-1);return false;\"><img src='images/push_down.png' alt='"+getLocaleStr("comment_rank_down","Push Down")+"'></a>"+'&nbsp;&nbsp;<a href=# onclick="postMediaComment('+cInfo.getAttribute("video_id")+","+cInfo.getAttribute("id")+",'ComPost"+cInfo.getAttribute("id")+"');return false;\">"+getLocaleStr("reply","Reply")+"</a></div>";}function visitUserProfile(compId){location.href="profile.html?pageId="+compId+"&ownerId="+compId;}var commentDivsPreffix="VidCom";function renderComment(videoId,commentId,commentDivId){var commentDiv=_elem(commentDivId);commentDiv.style.display="block";renderCommentHrd(videoId,commentId,commentDiv);var url="service?action=getMediaComments&mediaId="+videoId;if(commentId!=null&&commentId!=""){url+="&commentId="+commentId;}dojo.xhrGet({url:url,load:function(data,evt){var comment=data.getElementsByTagName("comment_data");var ul=document.createElement("ul");commentDiv.appendChild(ul);for(var col=0;col<comment.length;col++){var cInfo=comment[col];var newCommentDiv=document.createElement("li");newCommentDiv.id=commentDivsPreffix+cInfo.getAttribute("id");ul.appendChild(newCommentDiv);newCommentDiv.className="mediaCommentBody";renderCommentSubHrd(cInfo,newCommentDiv);var newCommentContentDiv=document.createElement("div");newCommentContentDiv.id=commentDivsPreffix+"C"+cInfo.getAttribute("id");newCommentContentDiv.innerHTML=cInfo.getAttribute("comment");newCommentContentDiv.className="mediaCommentContentStyle";newCommentDiv.appendChild(newCommentContentDiv);var newCommentPostingDiv=document.createElement("div");newCommentPostingDiv.id="ComPost"+cInfo.getAttribute("id");newCommentPostingDiv.className="mediaCommentPostCommentFrm";newCommentDiv.appendChild(newCommentPostingDiv);var newSubCommentDiv=document.createElement("div");newSubCommentDiv.id=commentDivsPreffix+"S"+cInfo.getAttribute("id");newCommentDiv.appendChild(newSubCommentDiv);spamLevels.push(new setSpamLevel(newCommentDiv.id,cInfo.getAttribute("flag_count")));renderComment(videoId,cInfo.getAttribute("id"),newSubCommentDiv.id);}},handleAs:"xml"});}var MAX_FLAG_COUNT_FOR_A_SPAM=1;var spamLevels=[];function setSpamLevel(id,value){this.id=id;this.value=value;}function rankMediaComment(videoId,commentId,rankValue){dojo.xhrGet({url:"service?action=postComment&mediaId="+videoId+"&rank="+rankValue+"&commentId="+commentId,error:function(data,evt){signin();},load:function(data,evt){},handleAs:"xml"});alert(getLocaleStr("comment_ranked_msg","Comment ranking successful"));}function reportCommentSpam(videoId,commentId){dojo.xhrGet({url:"service?action=postComment&mediaId="+videoId+"&spam=true&commentId="+commentId,error:function(data,evt){signin();},load:function(data,evt){},handleAs:"xml"});destroyElement(commentDivsPreffix+commentId);}var currentCommentDiv=null;function showComments(videoId,commentDiv){try{if(currentCommentDiv!=null&&currentCommentDiv!=""){var elem=_elem(currentCommentDiv);if(elem!=null){elem.innerHTML="";elem.style.display="none";}}currentCommentDiv=commentDiv;renderComment(videoId,"",commentDiv);}catch(e){}}function download(videoId){dojo.xhrPost({url:"service?action=notification&notificationType=initSession&SelVideoId="+videoId,load:function(data,evt){location.href="download.jsp";},handleAs:"xml"});}var dojoIsLoaded=false;function dojoLoaded(){dojoIsLoaded=true;try{initContSrc();setTimeout("initContentSourceSelection()",2000);}catch(e){}if(!isIE()){if(poolingForStorage){storeCollection(collection);}}}function initContentSourceSelection(){try{var s=getContentSourceNameId();var sourceList=_elem("sourceList");clearInnerHTML(sourceList);for(j=0;j<s.length;j++){var oOption=document.createElement("OPTION");oOption.text=s[j][0];oOption.value=s[j][1];sourceList.options.add(oOption);}sourceList.value=getCookie("ContentSource");}catch(e){}}function favourite(contentId){signin();dojo.xhrPost({url:"service?action=updateFavouriteContent&operation=add&contentId="+contentId,load:function(data,evt){alert(getLocaleStr("favourite_added","This content has been added to your favourites"));},handleAs:"json"});}function _elem(id){return document.getElementById(id);}if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';_19+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var _1a=this.getParams();for(var key in _1a){_19+=[key]+'="'+_1a[key]+'" ';}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+='flashvars="'+_1c+'"';}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';_19+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var _1d=this.getParams();for(var key in _1d){_19+='<param name="'+key+'" value="'+_1d[key]+'" />';}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+='<param name="flashvars" value="'+_1f+'" />';}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?_elem(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));
}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;