
﻿
var videoStats;var SentVideoEmailIdKey="sveid";function InsertVideoStats(currentVideoId,startOffset){try{videoStats=new Realization.Video.Infrastructure.Interface.BusinessEntities.VideoViewStats();videoStats.VideoId=currentVideoId;videoStats.StartOffset=startOffset;videoStats.PlayTime=0;videoStats.IpAddress=ipAddress;videoStats.SentVideoEmailUid=GetQueryStringValue(SentVideoEmailIdKey,0);videos.realization.com.Stats._2010._11._26.IVideoViewStatsService.InsertVideoViewStats(videoStats,OnSuccessInsertVideoStats,OnFailureInsertVideoStats);}
catch(e){}}
function OnSuccessInsertVideoStats(result){videoStats.VideoViewId=result;}
function OnSuccessUpdateStats(){}
function OnFailureInsertVideoStats(result){for(var o in result){logMessage(result[o]);}}
function OnFailureUpdateVideoStats(result){for(var o in result){logMessage(result[o]);}}
function UpdateStats(timeElapsed){try{videoStats.PlayTime=parseInt(timeElapsed);videos.realization.com.Stats._2010._11._26.IVideoViewStatsService.UpdateVideoViewStats(videoStats,OnSuccessUpdateStats,OnFailureUpdateVideoStats);}
catch(e){}}
function GetQueryStringValue(key,defaultValue){var lowerCaseKey=key.toLowerCase();var queryString=document.location.search.substring(1);var keyValuePairs=queryString.split("&");for(var i=0;i<keyValuePairs.length;i++){var keyValuePair=keyValuePairs[i].split("=");if(keyValuePair[0].toLowerCase()==lowerCaseKey)
return keyValuePair[1];}
return defaultValue;}
﻿function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(cookieName,keyName){var nameEQ=name+"=";var cookies=document.cookie.split('; ');for(var i=0;i<cookies.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function getCookieValues(cookieName){var cookieNameWithSep=cookieName+"=";var cookies=document.cookie.split('; ');for(var i=0;i<cookies.length;i++){if(cookies[i].indexOf(cookieNameWithSep)==0)
return cookies[i].substring(cookieNameWithSep.length,cookies[i].length);}
return null;}
function getCookieValue(cookieName,keyName){var cookieValues=getCookieValues(cookieName);if(cookieValues==null)
return null;var keyNameWithSep=keyName+"=";var cookieValueStartIndex=cookieValues.indexOf(keyNameWithSep)+keyNameWithSep.length;var indexOfSemicolon=cookieValues.indexOf(';',cookieValueStartIndex);var cookieValueEndIndex=(indexOfSemicolon==-1)?cookieValues.length:indexOfSemicolon;return cookieValues.substring(cookieValueStartIndex,cookieValueEndIndex);}
function eraseCookie(name){createCookie(name,"",-1);}
function getUidsFromCookie(cookieName,keyName){var combinedUids=getCookieValue(cookieName,keyName);var splitUids=combinedUids.split("S");return splitUids;}
function getUidsCountFromCookie(cookieName,keyName){var splitUids=getUidsFromCookie(cookieName,keyName);var count=0;jQuery.each(splitUids,function(index,val){if(trim(val)!="")
++count;});return count;}
function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");}﻿var player=null;var currentItem=0;var previousItem=-1;var selectedIndexInPlaylist;var myPlaylistFileSuffix='SharedVideosPlaylist.asx';var currentPlaylist;var pausedProgrammatically;var currentState;var isNewFileLoaded;var previouslyPlayedVideo;var startPlaying;var previousRowClass;var previousPlayingImg;var isNextOrPrevious=false;var requiredMajor='9';var requiredMinor='0';var requriedRelease='115';var currentVideoId='';var currentPlaylistLinkElementClass='';var isFullVideo=false;var shortVideoId='';var fullVideoId='';var currentPosition=0;var startOffset=0;var previousPositionBeforeZeroPosition=0;function SetCurrentPlaylistLinkClass(playlistLinkClass){currentPlaylistLinkElementClass=playlistLinkClass;}
function playerReady(thePlayer){player=window.document[thePlayer.id];addListeners();if(selectedIndexInPlaylist!=undefined){playFileOfPlaylist(selectedIndexInPlaylist);}
else{setMetaData(0);}}
function createPlayer(theFile){logMessage("inside create player");var flashvars={'file':theFile,'autostart':"false",'shuffle':"false",'playlistsize':"150",'playlist':"none",'bufferlength':5,'plugins':'captions-1','captions.fontsize':'11','logo':logoFilePath};var params={allowfullscreen:"true",allowscriptaccess:"always"};var attributes={id:"player",name:"player"};var requiredPlayerVersion=requiredMajor+"."+requiredMinor+"."+requriedRelease;var playerVersion=swfobject.getFlashPlayerVersion();var output="You have Flash player "+playerVersion.major+"."+playerVersion.minor+"."+playerVersion.release+" installed";if(playerVersion.major>requiredMajor||(playerVersion.major==requiredMajor&&playerVersion.minor>=requiredMinor&&playerVersion.release>=requriedRelease)){swfobject.embedSWF(playerFilePath,"divPlayer","459px","273px",requiredPlayerVersion,false,flashvars,params,attributes);isNewFileLoaded=true;}
else{document.getElementById('divPlayer').innerHTML="Sorry, you have an older version of Adobe Flash Player. To view these videos, you need the latest version of flash player which can be downloaded <a href=\"http://get.adobe.com/flashplayer/\" target=\"_blank\"> here</a>";}}
function addListeners(){if(player){player.addControllerListener("ITEM","itemListener");player.addControllerListener("PLAYLIST","playlistListener");player.addModelListener("STATE","stateListener");player.addViewListener("NEXT","nextListener");player.addViewListener("PREV","previousListener");player.addModelListener("TIME","positionListener");}else{setTimeout("addListeners()",100);}}
function nextListener(obj){if(playlistNeedsModification()){setTimeout("player.sendEvent(\"STOP\")",0);manipulatePlaylist("Next");isNextOrPrevious=true;}}
function previousListener(obj){if(playlistNeedsModification()){setTimeout("player.sendEvent(\"STOP\")",0);manipulatePlaylist("Prev");isNextOrPrevious=true;}}
function playlistListener(obj){var indexOfFile=selectedIndexInPlaylist==undefined?0:selectedIndexInPlaylist;if(typeof(selectedIndexInPlaylist)!="undefined"&&typeof(startPlaying)!="undefined"&&startPlaying.toLowerCase()=='true')
playFileOfPlaylist(selectedIndexInPlaylist);else{setMetaData(indexOfFile);}}
function positionListener(obj){currentPosition=obj.position;if(currentPosition!=0)
previousPositionBeforeZeroPosition=currentPosition;}
function stateListener(obj){currentState=obj.newstate;previousState=obj.oldstate;if(currentState=='IDLE'||currentState=='PAUSED'||currentState=='COMPLETED'){if(currentPosition!=0){logMessage('Update Video Stats');UpdateStats(currentPosition)}
else if(previousPositionBeforeZeroPosition!=0){UpdateStats(previousPositionBeforeZeroPosition);}}
if(currentState=='COMPLETED'){if(playlistNeedsModification()){manipulatePlaylist("Playlist");}
else{playNextUpTillEnd();}}}
function playNextUpTillEnd(){var playlist=player.getPlaylist();if(playlist){if(playlist.length>currentItem+1){setTimeout("player.sendEvent(\"Next\")",0);}}}
function manipulatePlaylist(buttonId){var parents=jQuery('ul.pllist>li>div.image>input.'+currentPlaylistLinkElementClass).parentsUntil('ul.pllist');if(parents.length==2){var nextElementToPlay='';if(buttonId=="Next"||buttonId=="Playlist"){nextElementToPlay=jQuery(parents[1]).next();if(nextElementToPlay.length<=0&&buttonId!="Playlist")
nextElementToPlay=jQuery(parents[1]).prevAll().last();}
else
if(buttonId=="Prev"){nextElementToPlay=jQuery(parents[1]).prev();if(nextElementToPlay.length<=0)
nextElementToPlay=jQuery(parents[1]).nextAll().first();}
if(nextElementToPlay.length>0){var classOfNextElementToPlay=nextElementToPlay.find('div.image>input:image').attr('class');classOfNextElementToPlay=classOfNextElementToPlay.replace('rptCompanyImg','').replace(/^\s+|\s+$/g,'');jQuery('ul.pllist>li>div.image>input.'+classOfNextElementToPlay).click();}}}
function IsPreviousItemUndefined(){if(previousItem==undefined||previousItem==-1)
return true;return false;}
function loadFile(theFile,index,playFile){isNextOrPrevious=false;selectedIndexInPlaylist=index;currentPlaylist=getCurrentPlaylistFileName(theFile);startPlaying=playFile==undefined?true:playFile;createPlayer(theFile);}
function getCurrentPlaylistFileName(theFile){var indexOfQuestionMark=theFile.toString().indexOf("?");if(indexOfQuestionMark>=0){return theFile.toString().substr(0,indexOfQuestionMark);}
else{return theFile;}}
function itemListener(obj){previousItem=currentItem;currentItem=obj.index;setMetaData(currentItem);CalculateVideoStats();}
function setMetaData(theIndex){var plst=null;plst=player.getPlaylist();if(plst){var Company=plst[theIndex].title;var department=plst[theIndex].department;if(department=='0'||department==0)
department='';var source=plst[theIndex].file;isFullVideo=plst[theIndex].isFullVideo;shortVideoId=plst[theIndex].svId;fullVideoId=plst[theIndex].fvId;var selection="div.secondary>div.videoDescription>div";var selectionToHide;var selectionToShow;if(typeof(isFullVideo)!="undefined"&&isFullVideo.toLowerCase()=="true"){currentVideoId=fullVideoId;selectionToShow=selection+".fullVideoView";selectionToHide=selection+".shortVideoView";}
else{currentVideoId=shortVideoId;selectionToShow=selection+".shortVideoView";selectionToHide=selection+".fullVideoView";}
jQuery(selectionToShow).removeClass("hidden");jQuery(selectionToHide).addClass("hidden");previouslyPlayedVideo=source;var index=source.lastIndexOf("/");var sourceURl=source.substring(index);var AfterText=plst[theIndex].after;var shortVideoDuration=plst[theIndex].shortVideoDuration;var fullVideoDuration=plst[theIndex].fullVideoDuration;if(currentState=='BUFFERING'||currentState=='PLAYING'){document.title=Company+" Video (Critical Chain) ";}
jQuery("div.videoDescription h2").html(Company);var departmentElement=jQuery("div.videoDescription h3");departmentElement.html(department);var afterTextArray=AfterText.split("|");var htmlString='<ul class="resultsAfter">';jQuery.each(afterTextArray,function(index,value){htmlString+='<li>'+value+'</li>';});htmlString+='</ul>';if(departmentElement.next("ul.resultsAfter").length>0)
departmentElement.next("ul.resultsAfter").remove();departmentElement.after(htmlString);jQuery("span.shortDuration").html(shortVideoDuration);jQuery("span.longDuration").html(fullVideoDuration);var shortDownload=jQuery("span.shortDownload");var shortDownloadAfter=jQuery("span.shortDownload").next();var fullDownload=jQuery("span.fullDownload");var fullDownloadAfter=jQuery("span.fullDownload").next();var aShortDownload=shortDownload.children("span");var aFullDownload=fullDownload.children("span");jQuery('a#shortDownloadWmv').attr('href',"javascript:DownloadFile('"+shortVideoId+"','WMV');");jQuery('a#shortDownloadMp4').attr('href',"javascript:DownloadFile('"+shortVideoId+"','MP4');");jQuery('a#longDownloadWmv').attr('href',"javascript:DownloadFile('"+fullVideoId+"','WMV');");jQuery('a#longDownloadMp4').attr('href',"javascript:DownloadFile('"+fullVideoId+"','MP4');");var shortDownloadNew=jQuery("<span>").addClass("shortDownload").prepend(aShortDownload).append(shortVideoDuration);var fullDownloadNew=jQuery("<span>").addClass("fullDownload").prepend(aFullDownload).append(fullVideoDuration);fullDownload.remove();shortDownload.remove();shortDownloadAfter.before(shortDownloadNew);fullDownloadAfter.before(fullDownloadNew);changeNowPlayingStyleInPlaylist(theIndex);jQuery('#'+hdCurrentVideoId).attr('value',currentVideoId);var cookieValue=getCookieValue('RealizationViews','WatchedVideos')
var currentShortVideoIdWithSep=shortVideoId+"S";cookieValue=cookieValue.replace(/currentShortVideoIdWithSep/gi,"")
cookieValue=currentShortVideoIdWithSep+cookieValue;createCookie('RealizationViews','WatchedVideos='+cookieValue,180);showHidePlaylistLinkOnVideoLoadForUpperPanel();}}
function playFileOfPlaylist(videoIndex){isNextOrPrevious=false;if(player!=undefined){setTimeout("player.sendEvent('ITEM',"+videoIndex+")",0);}
else{logMessage("player is undefined");}}
function playlistNeedsModification(){if(!currentPlaylist)
return false;return currentPlaylist.endsWith(myPlaylistFileSuffix);}
function changeNowPlayingStyleInPlaylist(indexOfCurrentVideo){var previousNowPlayingRowSelection="ul.pllist li.nowPlaying";var previousNowPlayingRow=jQuery(previousNowPlayingRowSelection);if(previousNowPlayingRow.length>0)
previousNowPlayingRow.removeClass("nowPlaying");if(!playlistNeedsModification())
return;var currentNowPlayingRowSelection="ul.pllist li:eq("+indexOfCurrentVideo+")";var currentNowPlayingRow=jQuery(currentNowPlayingRowSelection);if(currentNowPlayingRow.length>0)
currentNowPlayingRow.addClass("nowPlaying");}
function IsArrayUndefinedOrOfZerolength(arr){if(arr==undefined||arr.length==0)
return true;else
return false;}
function zeroPad(num,count){var numZeropad=num+'';while(numZeropad.length<count){numZeropad="0"+numZeropad;}
return numZeropad;}
function getElementsByClassName(className,container){container=container||document;var allElements=container.all||container.getElementsByTagName('*');var arr=[];for(var k=0;k<allElements.length;++k){if(allElements[k].className==className){arr[arr.length]=allElements[k];}}
return arr;}
function ShowNowPlaying(){if(!playlistNeedsModification())
return;var currentVideoInPlaylistSelection=".pllist li .image ."+currentVideoId;var currentCompanyImg=jQuery(currentVideoInPlaylistSelection);if(currentCompanyImg.length>0){var parents=currentCompanyImg.parentsUntil("ul.pllist");if(parents.length==2){var parent=parents[1];var indexOfCurrentVideo=jQuery(parent).index();if(indexOfCurrentVideo>=0)
changeNowPlayingStyleInPlaylist(indexOfCurrentVideo);}}}
function CalculateVideoStats(){if(previousState=='IDLE'){InsertVideoStats(currentVideoId,startOffset)}}
var linkClicked=false;var linkButtonDropDownAssociation={'EPD':'lnkEpd','CON':'lnkIc','ETO':'lnkEto','MRO':'lnkMro'};var byIndustryCategories={'EPD':'EPD','CON':'CON','ETO':'ETO','MRO':'MRO'};function initSubNav(){$('.subNav li[class!=expanded] ul').hide();$('.subNav li a').click(function(){if($(this).next("ul").length>0){$(this).parent().toggleClass('expanded');$(this).next().slideToggle('normal');}});}
function initVideoSubNav(){$('#videoSubNav li[class!=expanded] ul, .subNavAlt li[class!=expanded] ul').hide();$('#videoSubNav li a, .subNavAlt li a').click(function(){if($(this).next("ul").length>0){$(this).parent().toggleClass('expanded');$(this).next().slideToggle('normal');}});}
$(document).ready(function(){InitializeTest();});function InitializeTest(){if(jQuery().preloadCssImages){$.preloadCssImages();}
if($('#heroimg').length>0){$('#heroimg').cycle({fx:'fade',timeout:5000});}
if($('#subNav, .subNavAlt').length>0){initVideoSubNav();}
try{if($.defaultText){$.defaultText();}}
catch(e){}
if($('a.removeVideo').length>0){$('a.removeVideo').click(function(){$(this).closest("li").fadeOut();});}
if($('a.removeAllVideos').length>0){$('a.removeAllVideos').click(function(){$('ul.videoList li').fadeOut();});}
if(jQuery().equalHeights){$('#footer').equalHeights(true);if($('.eq1').length>0){$('.eq1').equalHeights(true);}
if($('.eq2').length>0){$('.eq2').equalHeights(true);}}
formatSelectedCategoryDisplay();showAddPlaylistOptions();$(".customSelect").JSizedFormSelect();addChangeFunctionToDropDown();Cufon.replace('#nav a',{hover:true});Cufon.now();var linkedInShareUrl='http://www.linkedin.com/shareArticle?url='+encodeURIComponent(window.location.href);$("ul.tools>li.share>a").attr('href',linkedInShareUrl).attr('target','_blank');$("ul.tools>li.print>a").attr('href','javascript:window.print();');$("ul.tools>li.email>a").attr('href','http://www.realization.com/emailthispageform.aspx').attr('target','_blank');if(typeof DD_belatedPNG!=='undefined'){var PNG_fix_selectors=['ul.cta a'];DD_belatedPNG.fix(PNG_fix_selectors.join(','));}
AttachVideosSearchEvent();AttachMainWebSiteSearchEvent();}
function showAddPlaylistOptions(){$(".wrapperAddPlaylist").hover(function(){$(this).parent().addClass('hover');},function(){$(this).parent().removeClass('hover');});}
function formatSelectedCategoryDisplay(){var parent=jQuery('.videoList').parent();var liList=jQuery('.videoList li.test');var htmlString='';liList.each(function(idx,e){switch(idx%4){case 0:htmlString+='<ul class="videoList">';htmlString+='<li class="first">';htmlString+=jQuery(e).html();htmlString+='</li>';break;case 1:case 2:htmlString+='<li>';htmlString+=jQuery(e).html();htmlString+='</li>';break;case 3:htmlString+='<li>';htmlString+=jQuery(e).html();htmlString+='</li>';htmlString+='</ul>';break;}});if(liList.length%4!=0){htmlString+='</ul>';}
jQuery('.videoList').remove();parent.prepend(htmlString);jQuery(".noVideos").prepend("<br/>");}
function addChangeFunctionToDropDown(){jQuery("#view-by").unbind('change').change(function(){var selectetext=jQuery('#view-by').val();switch(selectetext){case"Top Stories":onTopLevelSubCategorySelected('lnkTopStories');break;case"Company Name":onTopLevelSubCategorySelected('lnkCompany');break;case"Industry":addValuesToSecondDropDown(selectetext);addChangeFunctionToSecondDropDown();secondDropDownOnChange();break;case"Recently Viewed":onTopLevelSubCategorySelected('lnkRecentlyWatched');break;}});}
function onTopLevelSubCategorySelected(linkButtonClass){hideSecondDropdown();var linkButtonId=jQuery("."+linkButtonClass).attr("id");setSelectedMenuStyle(linkButtonId);doPostBackForDropdown(linkButtonClass);}
function hideSecondDropdown(){var secondDropDown=jQuery("#view-by-1");secondDropDown.css("display","none");var prevElementBeforeSecondDropDown=secondDropDown.prev();if(prevElementBeforeSecondDropDown.length>0){if(prevElementBeforeSecondDropDown.hasClass('custom-select'))
prevElementBeforeSecondDropDown.remove();}}
function addChangeFunctionToSecondDropDown(){$("#view-by-1").unbind('change').change(function(){secondDropDownOnChange();});}
function secondDropDownOnChange(){var selectedText=$('#view-by-1').val();var linkButtonId=jQuery("."+linkButtonDropDownAssociation[selectedText]).attr("id");setSelectedMenuStyle(linkButtonId);doPostBackForDropdown(linkButtonDropDownAssociation[selectedText]);}
function doPostBackForDropdown(linkButtonClass){var actulLnkButtonName=jQuery("."+linkButtonClass).attr("id").replace('_','$');__doPostBack(actulLnkButtonName,'');}
function changeSecondDropDownClass(){jQuery('#view-by-1').removeClass('customSelect');}
function addValuesToSecondDropDown(selectedTextInFirstDropDown){switch(selectedTextInFirstDropDown){case"Industry":options=byIndustryCategories;break;}
jQuery('#view-by-1>option').remove();var secondDropDown=jQuery('#view-by-1');var prevElementBeforeSecondDropDown=secondDropDown.prev();if(prevElementBeforeSecondDropDown.length>0){if(prevElementBeforeSecondDropDown.hasClass('custom-select'))
prevElementBeforeSecondDropDown.remove();secondDropDown.css('display','block');jQuery.each(options,function(val,text){secondDropDown.append(jQuery('<option></option>').val(val).html(text));});secondDropDown.JSizedFormSelect();}}
function hideError(){jQuery('#Error').css("display","none");jQuery('#ErrorMsg').html("");}
function showError(errorMsg){jQuery('#Error').css("display","block");jQuery('#ErrorMsg').html("An error has occured while trying to process your request.");}
function setSelectedIndexForFirstDropDown(index){var firstDropDown=jQuery('#view-by');firstDropDown.attr('selectedIndex',index);setSelectedValueForDropDown(firstDropDown);}
function setSelectedValueForDropDown(dropDown){if(dropDown.css('display')=='none'){var prevElement=dropDown.prev();if(prevElement.length>0){prevElement.children("a.current-selected").html(dropDown.val());}}}
function linkButtonClicked(linkId){linkClicked=true;showDropDowns();setSelectedMenuStyle(linkId);setDropDownValues(linkId);return true;}
function videosSearchClicked(){setSelectedCategoryToNone();}
function IsDefaultOrEmptyText(selectorText){var requiredTextBox=jQuery(selectorText);if(requiredTextBox.attr("value").toLowerCase()==requiredTextBox.attr("title").toLowerCase()||trim(requiredTextBox.attr("value"))=="")
return true;return false;}
function setSelectedMenuStyle(linkId){jQuery(".subNavAlt").find("li.active").removeClass("active");var clickedElement=jQuery('#'+linkId);if(clickedElement.length<=0)
return;var parents=clickedElement.parentsUntil('.subNavAlt');if(parents.length>1){jQuery(parents[2]).addClass("expanded");jQuery(parents[1]).css('display','block');jQuery(parents[0]).addClass("active");}
else{jQuery(parents[0]).addClass("active");}}
function setDropDownValues(linkId){var clickedElement=jQuery('#'+linkId);var parents=clickedElement.parentsUntil('.subNavAlt');if(parents.length>1){var indexOfSelectedIteminSecondDropDown=jQuery(parents[0]).index();var indexForFirstDropDown=jQuery(parents[2]).index();setSelectedIndexForFirstDropDown(indexForFirstDropDown);var selectedTextInFirstDropDown=jQuery('#view-by').val();var indexForSecondDropDown=jQuery(parents[0]).index();addValuesToSecondDropDown(selectedTextInFirstDropDown)
var secondDropDown=jQuery('#view-by-1');secondDropDown.attr('selectedIndex',indexForSecondDropDown);setSelectedValueForDropDown(secondDropDown);addChangeFunctionToSecondDropDown();}
else{var index=jQuery(parents[0]).index();setSelectedIndexForFirstDropDown(index);var selectedTextInFirstDropDown=jQuery('#view-by').val();hideSecondDropdown();}}
function AttachVideosSearchEvent(){var searchVideosButton=jQuery('.sv_submit');var searchVideosTextBox=jQuery('.sv_input');searchVideosTextBox.keypress(function(event){if(event.which=='13'){event.preventDefault();if(!IsDefaultOrEmptyText('.sv_input'))
searchVideosButton.click();}});}
function AttachMainWebSiteSearchEvent(){var searchButton=jQuery('div#search a#search-btn');if(searchButton.length<=0)
return;var searchTextBox=jQuery('div#search input:text');if(searchTextBox.length<=0)
return;searchButton.unbind('click').bind('click',function(){window.open("http://www.realization.com/search.aspx?q="+encodeURIComponent(searchTextBox.attr("value")));return false;});searchTextBox.keypress(function(event){if(event.which=='13'){event.preventDefault();if(!IsDefaultOrEmptyText('div#search input:text'))
searchButton.click();}});}
function setSelectedCategoryToNone(){hideDropDowns();setSelectedMenuStyle('nonExistingId');}
function hideDropDowns(){jQuery(".filterList").hide();}
function showDropDowns(){jQuery(".filterList").show();}
function movePageToTop(){window.scrollTo(0,0);}
function hideAddToPlaylistImageForIndividualElement(index,isFullVideo,videoId){var ulIndex=Math.floor(index/4);var liIndexInUl=index%4;var selection="ul.videoList:eq("+ulIndex+")>li:eq("+liIndexInUl+")>.wrapperAddPlaylist>.playlistList>";var addPlaylistDivSelection="ul.videoList:eq("+ulIndex+")>li:eq("+liIndexInUl+")>.wrapperAddPlaylist";if(typeof(isFullVideo)!="undefined"&&isFullVideo.toLowerCase()=="true")
selection+=".addFull";else
selection+=".addShort";var playlistLinkElement=jQuery(selection);if(playlistLinkElement.length>0){if(typeof(isFullVideo)!="undefined"&&isFullVideo.toLowerCase()=="true"){playlistLinkElement.removeClass("addFull").addClass("addedFull");if(playlistLinkElement.prev().hasClass("addedShort")){var playlistDiv=jQuery(addPlaylistDivSelection);if(playlistDiv.length>0){playlistDiv.removeClass("wrapperAddPlaylist").addClass("wrapperAddedPlaylist");}}}
else{playlistLinkElement.removeClass("addShort").addClass("addedShort");if(playlistLinkElement.next().hasClass("addedFull")){var playlistDiv=jQuery(addPlaylistDivSelection);if(playlistDiv.length>0){playlistDiv.removeClass("wrapperAddPlaylist").addClass("wrapperAddedPlaylist");}}}}
hideAddToPlaylistImageForUpperPanel(videoId);}
function hideAddToPlaylistImageForUpperPanel(videoId){if(videoId==shortVideoId)
jQuery("div.downloadDetails>p.shortVideo").removeClass("shortVideo").addClass("shortVideoAdded");else
if(videoId==fullVideoId)
jQuery("div.downloadDetails>p.fullVideo").removeClass("fullVideo").addClass("fullVideoAdded");}
function showAddToPlaylistImgeForIndividualElement(index,isFullVideo,videoId){var ulIndex=Math.floor(index/4);var liIndexInUl=index%4;var selection="ul.videoList:eq("+ulIndex+")>li:eq("+liIndexInUl+")>.wrapperAddPlaylist>.playlistList>";var addPlaylistDivSelection="ul.videoList:eq("+ulIndex+")>li:eq("+liIndexInUl+")>.wrapperAddedPlaylist";var playlistDiv=jQuery(addPlaylistDivSelection);if(playlistDiv.length>0){playlistDiv.removeClass("wrapperAddedPlaylist").addClass("wrapperAddPlaylist");}
if(typeof(isFullVideo)!="undefined"&&isFullVideo.toLowerCase()=="true")
selection+=".addedFull";else
selection+=".addedShort";var playlistLinkElement=jQuery(selection);if(playlistLinkElement.length>0){if(typeof(isFullVideo)!="undefined"&&isFullVideo.toLowerCase()=="true"){playlistLinkElement.removeClass("addedFull").addClass("addFull");}
else{playlistLinkElement.removeClass("addedShort").addClass("addShort");}}
showAddToPlaylistImgeForUpperPanel(videoId);}
function showAddToPlaylistImgeForUpperPanel(videoId){if(videoId==shortVideoId)
jQuery("div.downloadDetails>p.shortVideoAdded").removeClass("shortVideoAdded").addClass("shortVideo");else
if(videoId==fullVideoId)
jQuery("div.downloadDetails>p.fullVideoAdded").removeClass("fullVideoAdded").addClass("fullVideo");}
function showHidePlaylistLinkOnVideoLoadForUpperPanel(){showHidePlaylistLinkOnVideoLoadForUpperPanelForElement(shortVideoId);showHidePlaylistLinkOnVideoLoadForUpperPanelForElement(fullVideoId);}
function showHidePlaylistLinkOnVideoLoadForUpperPanelForElement(videoId){var selection='ul.pllist>li>div.image>input.';var selectionElement=selection+videoId;if(jQuery(selectionElement).length>0)
hideAddToPlaylistImageForUpperPanel(videoId);else
showAddToPlaylistImgeForUpperPanel(videoId);}
function RestoreAllPlaylistLinks(){jQuery(".addedFull").removeClass("addedFull").addClass("addFull");jQuery(".addedShort").removeClass("addedShort").addClass("addShort");jQuery(".wrapperAddedPlaylist").removeClass("wrapperAddedPlaylist").addClass("wrapperAddPlaylist");jQuery("div.downloadDetails>p.fullVideoAdded").removeClass("fullVideoAdded").addClass("fullVideo");jQuery("div.downloadDetails>p.shortVideoAdded").removeClass("shortVideoAdded").addClass("shortVideo");}
function DownloadFile(uid,fileType){var iframe=document.getElementById("downloadIframe");if(iframe==undefined){iframe=document.createElement("iframe");iframe.id="downloadIframe";}
iframe.src=downloadPageUrl+'?uid='+uid+"&fileType="+fileType;iframe.style.display="none";document.body.appendChild(iframe);}
function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");}
﻿Sys.Browser.WebKit={};if(navigator.userAgent.indexOf('WebKit/')>-1){Sys.Browser.agent=Sys.Browser.WebKit;Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name='WebKit';}
