var cookie_domain='sanpablo.com';
var cookie_prefix='';
function _gel(id)
{
return document.getElementById(id);
}
function ref(instance_or_id){
return(typeof(instance_or_id)=="string")?document.getElementById(instance_or_id):instance_or_id;
}
function _pick(){
for(var i=0;i<arguments.length;i++){
if(arguments[i]!==undefined&&arguments[i]!=null){
return arguments[i];
}
}
return null;
}
function _chop(str){
if(str==null||typeof str!='string')return null;
if(str=="")return "";
return str.substring(0,str.length-1);
}
function _clone(obj,deep){
var result=new Object();
for(var prop in obj){
result[prop]=(deep&&typeof obj[prop]=='object'?_clone(obj[prop],deep):obj[prop]);
}
return result;
}
function _mixin(base,mix){
var base=base||{};
for(var prop in(mix||{})){
base[prop]=mix[prop];
}
return base;
}
function htmlEscape(str){
var result=str;
result=result.replace('&','&amp;');
result=result.replace('<','&lt;');
result=result.replace('>','&gt;');
return result;
}
function redirect(url,params){
document.location.href=buildUrl(url,params);
}
function buildUrl(url,params){
var pairs=new Array();
var result=url;
if(params){
for(var key in params){
pairs.push(key+"="+encodeURIComponent(params[key].toString()));
}
result+="?"+pairs.join("&");
}
return result;
}
function showSheet(content)
{
var sheet=document.getElementById('sheet');
var sheetContent=document.getElementById('sheetContent');
sheetContent.innerHTML=content;
sheet.style.visibility='visible';
return false;
}
function toggleClass(element,className){
var e=ref(element);
if(!e)return;
if(hasClass(e,className)){
removeClass(e,className);
}else{
addClass(e,className);
}
}
function replaceClass(element,currentClass,newClass){
var e=ref(element);
if(!e)return;
if(hasClass(e,currentClass)){
removeClass(e,currentClass);
addClass(e,newClass);
}
}
function toggleVisibility(el,setVisible)
{
setDisplay(setVisible,el);
}
function setInnerHTML(div_id,value)
{
var dstDiv=_gel(div_id);
dstDiv.innerHTML=value;
}
function openPopup(url,name,height,width,opt_show_scrollbars)
{
var scrollbar_param=opt_show_scrollbars?",scrollbars=1":"";
var newwindow=window.open(url,name,'height='+height+',width='+width+scrollbar_param);
if(newwindow&&!newwindow.opener){newwindow.opener=window;}
if(window.focus){newwindow.focus()}
return false;
}
function openDiv(elName){
var theElemenet=_gel(elName);
if(theElemenet){
theElemenet.style.display="block";
}
}
function closeDiv(elName){
setDisplay(false,elName);
}
function showInline(elName){
var theElemenet=_gel(elName);
if(theElemenet){
theElemenet.style.display="inline";
}
}
function hideInline(elName){
setDisplay(false,elName);
}
function blurElement(elName){
var theElement=_gel(elName);
if(theElement){
theElement.blur();
}
}
function selectLink(elName){
var theElement=_gel(elName);
if(theElement){
theElement.className="selectedNavLink";
}
}
function unSelectLink(elName){
var theElement=_gel(elName);
if(theElement){
theElement.className="unSelectedNavLink";
}
}
function toggleDisplay(divName){
var tempDiv=_gel(divName);
if(!tempDiv){
return false;
}
if((tempDiv.style.display=="block")||(tempDiv.style.display==""&&tempDiv.className.indexOf("hid")==0)){
tempDiv.style.display="none";
return false;
}else if((tempDiv.style.display=="none")||(tempDiv.className.indexOf("hid")!=0)){
tempDiv.style.display="block";
return true;
}
}
function toggleDisplay2(){
var elements=Array.prototype.slice.call(arguments);
arrayEach(elements,function(arg){
var element=ref(arg);
if(element){
element.style.display=(element.style.display!="none"?"none":"");
}
});
}
function setDisplay(visible){
var elements=Array.prototype.slice.call(arguments,1);
each(elements,function(arg){
var element=ref(arg);
if(element){
element.style.display=(!visible?"none":"");
}
});
}
function setVisible(divName,onOrOff){
var tempDiv=_gel(divName);
if(!tempDiv){
return;
}
if(onOrOff){
tempDiv.style.visibility="visible";
}else{
tempDiv.style.visibility="hidden";
}
}
function hasClass(element,_className){
if(!element){
return;
}
var upperClass=_className.toUpperCase();
if(element.className){
var classes=element.className.split(' ');
for(var i=0;i<classes.length;i++){
if(classes[i].toUpperCase()==upperClass){
return true;
}
}
}
return false;
}
function addClass(element,_class){
if(!hasClass(element,_class)){
element.className+=element.className?(" "+_class):_class;
}
}
function getClassList(element){
if(element.className){
return element.className.split(' ');
}else{
return[];
}
}
function removeClass(element,_class){
var upperClass=_class.toUpperCase();
var remainingClasses=[];
if(element.className){
var classes=element.className.split(' ');
for(var i=0;i<classes.length;i++){
if(classes[i].toUpperCase()!=upperClass){
remainingClasses[remainingClasses.length]=classes[i];
}
}
element.className=remainingClasses.join(' ');
}
}
function getDisplayStyleByTagName(o){
var n=o.nodeName.toLowerCase();
return(n=="span"||n=="img"||n=="a")?"inline":"block";
}
function hideDiv(divName){
var tempDiv=_gel(divName);
if(!tempDiv){
return;
}
if(tempDiv.style.display=="inline"){
addClass(tempDiv,"wasinline");
}else if(tempDiv.style.display=="block"){
addClass(tempDiv,"wasblock");
}
tempDiv.style.display="none";
}
function showDiv(divName){
var tempDiv=_gel(divName);
if(!tempDiv){
return;
}
if(hasClass(tempDiv,"wasinline")){
tempDiv.style.display="inline";
removeClass(tempDiv,"wasinline");
}else if(hasClass(tempDiv,"wasblock")){
tempDiv.style.display="block";
removeClass(tempDiv,"block");
}else{
tempDiv.style.display=getDisplayStyleByTagName(tempDiv);
}
}
function toggleShowDiv(divId){
var tempDiv=_gel(divId);
if(tempDiv&&tempDiv.style.display=="none"){
showDiv(divId);
}else{
hideDiv(divId);
}
}
function changeBGcolor(tempDiv,onOrOff){
if(onOrOff==1){tempDiv.style.backgroundColor='#DDD';tempDiv.style.cursor='pointer';tempDiv.style.cursor='hand';}
else{tempDiv.style.backgroundColor='#FFF'}
}
function validateURL(inputField){
if(inputField.value.indexOf("http://")==0){
return false;
}else{
inputField.value="http://"+inputField.value;
return true;
}
}
function getDivHeight(div){
if(div.clientHeight){
return div.clientHeight;
}else if(div.offsetHeight){
return div.offsetHeight;
}
}
var addListener=function(){
if(window.addEventListener){
return function(el,type,fn){
el.addEventListener(type,fn,false);
};
}
else if(window.attachEvent){
return function(el,type,fn){
var f=function(){
fn.call(el,window.event);
};
el.attachEvent('on'+type,f);
};
}
else{
return function(el,type,fn){
el['on'+type]=fn;
}
}
}();
function each(array,func){
for(var i=0;i<array.length;i++)func(array[i]);
}
var arrayEach=each;
function focusSearchField(){
if(document.searchForm.search_query){
document.searchForm.search_query.focus();
}
}
function showLoadingIcon(div_id){
var temp_HTML="<img src=/img/icn_loading_animated.gif>";
_gel(div_id).innerHTML=temp_HTML;
}
function showLoading(div_id){
var temp_HTML="<br><br><br><br><br><center><img src=/img/icn_loading_animated.gif></center><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
_gel(div_id).innerHTML=temp_HTML;
document.body.focus();
}
function displayHideCommentLink(comm_id){
var header_div="comment_header_"+comm_id;
var comment_body_div="comment_body_"+comm_id;
var comment_vote_div="comment_vote_"+comm_id;
var span_hide_id="hide_link_"+comm_id;
var span_show_id="show_link_"+comm_id;
showDiv(comment_body_div);
_gel(span_show_id).style.visibility='hidden';
hideDiv(span_show_id);
showDiv(span_hide_id);
_gel(span_hide_id).style.visibility='visible';
if(_gel(header_div)){
_gel(header_div).className="watch-comment-head";
}
_gel(comment_vote_div).className="watch-comment-voting";
}
function displayShowCommentLink(comm_id){
var header_div="comment_header_"+comm_id;
var comment_body_div="comment_body_"+comm_id;
var comment_vote_div="comment_vote_"+comm_id;
var span_hide_id="hide_link_"+comm_id;
var span_show_id="show_link_"+comm_id;
hideDiv(comment_body_div);
_gel(span_hide_id).style.visibility='hidden';
hideDiv(span_hide_id);
showDiv(span_show_id);
_gel(span_show_id).style.visibility='visible';
if(_gel(header_div)){
_gel(header_div).className="watch-comment-head-hidden opacity80";
}
_gel(comment_vote_div).className="watch-comment-voting-off";
}
function showMsg(msg){
return overlib(msg,WIDTH,300);
}
function voteComment(comment_id,vid_id,comment_ref_id,increment){
var url_string="/comment_voting?a="+increment+"&id="+comment_id+"&video_id="+vid_id+"&old_vote="+comment_ref_id;
var vote_div_id="comment_vote_"+comment_id;
var comment_body="comment_body_"+comment_id;
var hide_link_id="hide_link_"+comment_id;
var show_link_id="show_link_"+comment_id;
if(_gel(vote_div_id).className=='watch-comment-voting-off'){
return;
}
getUrlXMLResponseAndFillDiv(url_string,vote_div_id);
if(increment<0){
hideDiv(comment_body);
displayShowCommentLink(comment_id);
}
showLoadingIcon(vote_div_id);
}
function voteCommentHidden(comment_id,vid_id,comment_ref_id,increment){
var comment_body_div="comment_body_"+comment_id;
var vote_div_id="comment_vote_"+comment_id;
var hide_link_id="hide_link_"+comment_id;
var show_link_id="show_link_"+comment_id;
if(_gel(vote_div_id).className=='watch-comment-voting-off'){
return;
}
if(_gel(comment_body_div).style.display=='none'){
displayHideCommentLink(comment_id);
}
else{
voteComment(comment_id,vid_id,comment_ref_id,increment);
}
}
function spam(comment_id,vid_id){
var url_string="&mark_comment_as_spam="+comment_id+"&entity_id="+vid_id;
postUrlXMLResponse('/comment_servlet',url_string,null);
displayShowCommentLink(comment_id);
hideSpam(comment_id);
}
function hasAncestor(element,ancestor){
var el=ref(element);
var an=ref(ancestor);
while(el!=document&&el!=null){
if(el==an)return true;
el=el.parentNode;
}
return false;
}
function callOnChangeClick(){
var inputs=document.getElementsByTagName('input');
var selects=document.getElementsByTagName('select');
for(var i=0;i<inputs.length;++i){
if(inputs[i].type!='submit'&&inputs[i].type!='button'&&inputs[i].onclick)
inputs[i].onclick();
}
for(var i=0;i<selects.length;++i){
if(selects[i].onchange)
selects[i].onchange();
}
}
function getBodyScrollTop(){
if(window.innerHeight){
return window.pageYOffset;
}else if(document&&document.documentElement&&document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}else if(document&&document.body){
return document.body.scrollTop;
}
}
var scrollStep=100;
var scrollStepDelay=50;
function smoothScrollIntoView(node,padding){
if(!padding)
padding=0;
smoothScrollIntoViewWorker(node,padding,null);
}
function smoothScrollIntoViewWorker(node,padding,lastTop){
var nodeTop=getPageOffsetTop(node);
var currentTop=getBodyScrollTop();
var deltaTop=Math.min(nodeTop-currentTop-padding,scrollStep);
window.scrollBy(0,deltaTop);
if(currentTop!=lastTop){
setTimeout(function(){smoothScrollIntoViewWorker(node,padding,currentTop)},scrollStepDelay);
}
}
function getPageOffsetTop(element){
var curtop=0;
if(element.offsetParent){
curtop=element.offsetTop
while(element=element.offsetParent){
curtop+=element.offsetTop
}
}
return curtop;
}
function isPanelExpanded(panel){
return hasClass(panel,'expanded');
}
function expandPanel(panel){
if(!isPanelExpanded(panel)){
addClass(panel,'expanded');
fireInlineEvent(panel,'expanded');
}
}
function collapsePanel(panel){
if(isPanelExpanded(panel)){
removeClass(panel,'expanded');
fireInlineEvent(panel,'collapsed');
}
}
function togglePanel(panel){
if(isPanelExpanded(panel)){
collapsePanel(panel);
}else{
expandPanel(panel);
}
}
function fireInlineEvent(element,eventName){
var target=ref(element);
if(target[eventName]==null){
var attributeName='on'+eventName.toLowerCase();
var attribute=target.attributes.getNamedItem(attributeName);
if(attribute){
target[eventName]=function(){
eval(attribute.value);
}
}
}
if(target[eventName])target[eventName]();
}
function findAncestorByClass(element,className){
var temp=element;
while(temp!=document){
if(hasClass(temp,className))return temp;
temp=temp.parentNode;
}
return null;
}
function findChildByClass(element,className){
for(var i=0;i<element.childNodes.length;i++){
if(hasClass(element.childNodes[i],className))return element.childNodes[i];
}
return null;
}
function findChildrenByClass(element,className){
var result=new Array();
for(var i=0;i<element.childNodes.length;i++){
if(hasClass(element.childNodes[i],className))result.push(element.childNodes[i]);
}
return result;
}
function closeLoginPicker(){
var loginBox=_gel('loginBoxZ');
if(loginBox){
if(loginBox.style.display!='none')
loginBox.style.display='none';
}
}
addListener(document,'click',function(e){
var element=e.target||e.srcElement;
if(!hasAncestor(element,'loginBoxZ')&&element.className.indexOf('loginBoxZ')==-1){
closeLoginPicker();
}
});
function openLoginBoxFromRatings(event){
var loginBox=_gel('loginBoxZ');
var totalOffset=getTotalOffset(_gel('watch-ratings-views'),false);
loginBox.style.left='85px';
loginBox.style.right='auto';
loginBox.style.top=(totalOffset[1]+25)+'px';
openLoginBox(event,true);
return false;
}
function openLoginBoxFromWatchTab(event){
var loginBox=_gel('loginBoxZ');
var totalOffset=getTotalOffset(_gel('watch-actions-area'),false);
loginBox.style.left='85px';
loginBox.style.right='auto';
loginBox.style.top=(totalOffset[1]+75)+'px';
openLoginBox(event,true);
return false;
}
function openLoginBox(event,setPositionManually){
if(event){
stopPropagation(event);
}
var loginBox=_gel('loginBoxZ');
if(!setPositionManually){
loginBox.style.left='auto';
loginBox.style.right='0px';
loginBox.style.top='33px';
}
toggleDisplay('loginBoxZ');
if(_gel('loginNextZ').value=='/signup'){
_gel('loginNextZ').value="/index";
}else if(_gel('loginNextZ').value.indexOf('/signup')==0){
_gel('loginNextZ').value=_gel('loginNextZ').value.substring(13);
}
if(_gel('loginBoxZ').style.display!='none'){
_gel('loginUserZ').focus();
}
_hbLink('LogIn','UtilityLinks');
return false;
}
onLoadFunctionList=new Array();
function performOnLoadFunctions()
{
for(var i=0;i<onLoadFunctionList.length;i++)
{
onLoadFunctionList[i]();
}
}
function readCookie(name,fallback){
var nameEQ=name+"=";
var ca=document.cookie.split(';');
for(var i=0;i<ca.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);
}
if(fallback){
return fallback;
}else{
return null;
}
}
function readIntCookie(name){
val=readCookie(name);
if(val){
return parseInt(val);
}else{
return 0;
}
}
function createCookie(name,value,days){
var cookie="";
var domain=cookie_domain;
var path="/";
cookie+=name+"="+value+";";
cookie+="domain=."+domain+";";
cookie+="path="+path+";";
if(days){
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
cookie+="expires="+date.toGMTString()+";";
}
document.cookie=cookie;
}
function eraseCookie(name){
createCookie(name,"",-1);
}
var dropdownMenu={};
function dropdown(e,menuId,parentId,eventType){
hideDropdown();
dropdownMenu.id=menuId;
dropdownMenu.parentId=(parentId)?parentId:_gel(menuId).parentNode.id;
dropdownMenu.eventType=(eventType)?eventType:"click";
if(!e)e=window.event;
e.cancelBubble=true;
if(e.stopPropagation)e.stopPropagation();
showDiv(dropdownMenu.id);
}
function hideDropdown(){
if(dropdownMenu.id){
hideDiv(dropdownMenu.id);
dropdownMenu={};
}
}
addListener(document,"click",function(e){
hideDropdown()
});
addListener(document,"mouseover",function(e){
var el=e.target||e.srcElement;
if(dropdownMenu&&dropdownMenu.eventType&&dropdownMenu.parentId){
if(e.type.indexOf(dropdownMenu.eventType)!=-1&&!hasAncestor(el,dropdownMenu.parentId))
hideDropdown();
}
});
function selectLocale(loc){
var current_url,next_url,anchor_url;
current_url=location.href;
current_url=current_url.split('#');
anchor_url=(current_url.length==2?'#'+current_url[1]:'');
current_url=current_url[0];
if(current_url.indexOf('?locale=')!=-1){
url_array=current_url.split("?locale=");
current_url=url_array[0];
}else if(current_url.indexOf('&locale=')!=-1){
url_array=current_url.split("&locale=");
current_url=url_array[0];
}
next_url=current_url+(current_url.indexOf('?')==-1?"?":"&")+"locale="+loc+"&persist_locale=1"
+anchor_url;
window.location=next_url;
}
flagImgsLoaded=false;
function loadFlagImgs(){
if(flagImgsLoaded){
return;
}
var flagsHTML='';
for(var x=0;x<gLocales.length;++x){
flagsHTML+='<div class="flagDiv"><a href="#" onclick="selectLocale(\''+gLocales[x][0]+'\'); return false;" class="localePickerFlagLink"><img id="flag_'+gLocales[x][0]+'" src="'+gPixelGif+'" width="17" height="11" class="currentFlag flag_'+gLocales[x][0]+'" alt="" locale="'+gLocales[x][0]+'"></a> <a href="#" id="countryDiv_'+gLocales[x][0]+'" onclick="selectLocale(\''+gLocales[x][0]+'\'); return false;" class="localePickerTitle">'+gLocales[x][1]+'</a></div>';
}
_gel('flagDivInner').innerHTML=flagsHTML;
flagImgsLoaded=true;
}
function closeLocalePicker(){
var localePickerBox=_gel('localePickerBox');
if(!localePickerBox){
localePickerBox=_gel('localePickerBoxProfile');
}
if(localePickerBox){
if(localePickerBox.style.display!='none'){
localePickerBox.style.display='none';
}
}
}
addListener(document,'click',function(e){
var element=e.target||e.srcElement;
if(element.className.indexOf('localePickerLink')==-1&&element.className.indexOf('currentFlag')==-1){
closeLocalePicker();
}
});
function _extend(obj,extension){
for(var prop in extension){
obj[prop]=extension[prop]
}
return obj;
}
var yt=new function(){
var _throwOnNull=function(value){if(value==null)throw "ExpectedNotNull";};
var _throwOnInvalidType=function(obj,type){if(typeof(obj)!=type)throw "InvalidType";};
var _throwOnRegexMatch=function(str,regex){if(regex.test(str))throw "ExpectedRegexMismatch";};
var _throwOnRegexMismatch=function(str,regex){if(!regex.test(str))throw "ExpectedRegexMatch";};
this.UserPrefs=new function(){
var USER_PREFS_COOKIE=cookie_prefix+"PREF";
var prefs=new Object();
var _throwOnInvalidKey=function(value){
_throwOnRegexMismatch(value,/^\w+$/);
_throwOnRegexMatch(value,/^f([1-9][0-9]*)$/);
};
var _setValue=function(key,value){
prefs[key]=value.toString();
};
var _getNumber=function(key){
var value=_getString(key);
return((value!=null&&/^[A-Fa-f0-9]+$/.test(value))?parseInt(value,16):null);
};
var _getString=function(key,def){
var value=(prefs[key]!==undefined?prefs[key].toString():null);
return value;
};
var _setFlag=function(key,flag,bit){
var vector=_getNumber(key);vector=(vector!=null?vector:0);
var value=(bit?vector|flag:vector&~flag);
if(value==0){
_deleteValue(key);
}else{
_setValue(key,value.toString(16));
}
};
var _getFlag=function(key,flag){
var vector=_getNumber(key);
vector=(vector!=null?vector:0);
return((vector&flag)>0);
};
var _deleteValue=function(key){
delete prefs[key];
};
var _parse=function(string){
var pairs=unescape(string).split("&");
for(var i=0;i<pairs.length;i++){
var pair=pairs[i].split("=");
var key=pair[0];
var value=pair[1];
if(value)_setValue(key,value);
}
};
this.get=function(key,def){
_throwOnInvalidKey(key);
var value=_getString(key);
return(value!=null?value:(def?def:""));
};
this.set=function(key,value){
_throwOnInvalidKey(key);
_throwOnNull(value);
_setValue(key,value);
};
this.getFlag=function(flag){return _getFlag('f1',flag);};
this.setFlag=function(flag,bit){return _setFlag('f1',flag,bit);};
this.remove=function(key){
_throwOnInvalidKey(key);
_deleteValue(key);
};
this.save=function(days){
var pairs=new Array();
for(prop in prefs){
pairs.push(prop+"="+escape(prefs[prop]));
}
if(days==null)days=7;
createCookie(USER_PREFS_COOKIE,pairs.join("&"),days);
};
this.clear=function(){
prefs=new Object();
};
this.dump=function(){
var pairs=new Array();
for(prop in prefs){
pairs.push(prop+"="+escape(prefs[prop]));
}
return pairs.join('&');
};
var data=readCookie(USER_PREFS_COOKIE);
if(data){
_parse(data);
}
};
this.EventManager=new function(){
var handlerTable=new Object();
this.fireEvent=function(name,arg){
if(handlerTable[name]==null)return;
var handlers=handlerTable[name];
for(var i=0;i<handlers.length;i++){
handlers[i](arg);
}
}
this.addHandler=function(name,fn){
if(handlerTable[name]==null)handlerTable[name]=new Array();
handlerTable[name].push(fn);
return fn;
}
this.removeHandler=function(name,fn){
if(handlerTable[name]==null)return false;
var index=handlerTable[name].indexOf(fn);
if(index==-1)return false;
handlerTable[name].splice(index,1);
return true;
}
};
};
var EventManager=yt.EventManager;
function findDescendantWithClass(element,className,depth)
{
for(var i=0;i<element.childNodes.length;i++){
var e=element.childNodes[i];
if(e.className&&e.className.indexOf(className)==0)
{
return e;
}
else if(depth)
{
var result=findDescendantWithClass(e,className,depth-1)
if(result)
{
return result
}
}
}
}
function getTotalOffset(target_element,scrolled){
var element=target_element;
var x=element.offsetLeft;
var y=element.offsetTop;
if(element.offsetParent){
while(element=element.offsetParent){
x+=element.offsetLeft;
y+=element.offsetTop;
}
}
element=target_element;
if(scrolled)
{
if(element.parentNode){
while(element=element.parentNode){
if(element.tagName.toUpperCase()=="BODY")
{
break;
}
if(element.scrollLeft||element.scrollTop)
{
x-=element.scrollLeft;
y-=element.scrollTop;
}
}
}
}
return[x,y];
}
function mouseOverQuickAdd(img){
if(!img.className.match('Done')){
removeClass(img,'QLIconImg');
removeClass(img,'QLIconImgDone');
addClass(img,'QLIconImgOver');
}
}
function mouseOutQuickAdd(img){
if(!img.className.match('Done')){
removeClass(img,'QLIconImgOver');
removeClass(img,'QLIconImgDone');
addClass(img,'QLIconImg');
}
}
function addQLIcons(el){
var img=(el?el:document).getElementsByTagName('img');
for(var x=0;x<img.length;++x){
var vId=img[x].getAttribute("qlicon");
var vId2=img[x].getAttribute("qliconalt");
if(!vId&&!vId2){
continue;
}
img[x].parentNode.parentNode.innerHTML+=
'<div class="addtoQL90">'
+'<a href="#" title="'+gQuickListTooltipText+'">'
+'<img id="add_button_'+(vId?vId:vId2)+'" class="QLIconImg" src="pixel-vfl73.gif" border="0" '
+(vId?'onclick="return onQuickAddClick(this, \''+vId+'\')" '
:'onclick="clicked_add_icon(\''+vId2+'\', 0);_hbLink(\'QuickList+AddTo\',\'na\');return false;" ')
+'onmouseover="mouseOverQuickAdd(this)" '
+'onmouseout="mouseOutQuickAdd(this)">'
+'</a>'
+'</div>';
img[x].removeAttribute("qlicon");
img[x].removeAttribute("qliconalt");
}
}
onLoadFunctionList.push(addQLIcons);
function setDisabled(objects,disabled){
for(var i in objects){
objects[i].disabled=disabled;
if(disabled){
_gel(objects[i].id+"_label").style.color="#CCC";
}else{
_gel(objects[i].id+"_label").style.color="";
}
}
}
function browseViewType(viewType){
hideInline(viewType=='L'?"btn-listview-off":"btn-listview-on");
showInline(viewType=='L'?"btn-listview-on":"btn-listview-off");
hideInline(viewType=='L'?"btn-gridview-on":"btn-gridview-off");
showInline(viewType=='L'?"btn-gridview-off":"btn-gridview-on");
if(_gel('video_grid')){
removeClass(_gel('video_grid'),viewType=='L'?'browseGridView':'browseListView');
addClass(_gel('video_grid'),viewType=='L'?'browseListView':'browseGridView');
}
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_GRID_VIEW_VIDEOS_AND_CHANNELS,viewType=='L');
yt.UserPrefs.save();
return false;
}
function membersViewType(viewType){
hideInline(viewType=='L'?"btn-listview-off":"btn-listview-on");
showInline(viewType=='L'?"btn-listview-on":"btn-listview-off");
hideInline(viewType=='L'?"btn-gridview-on":"btn-gridview-off");
showInline(viewType=='L'?"btn-gridview-off":"btn-gridview-on");
if(_gel('video_grid')){
removeClass(_gel('video_grid'),viewType=='L'?'membersGridView':'membersListView');
addClass(_gel('video_grid'),viewType=='L'?'membersListView':'membersGridView');
}
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_GRID_VIEW_VIDEOS_AND_CHANNELS,viewType=='L');
yt.UserPrefs.save();
return false;
}
function searchViewType(viewType){
hideInline(viewType=='L'?"btn-listview-off":"btn-listview-on");
showInline(viewType=='L'?"btn-listview-on":"btn-listview-off");
hideInline(viewType=='L'?"btn-gridview-on":"btn-gridview-off");
showInline(viewType=='L'?"btn-gridview-off":"btn-gridview-on");
if(_gel('video_grid')){
var type=_gel('video_grid').className.indexOf('browse')!=-1?'browse':'members';
removeClass(_gel('video_grid'),viewType=='L'?type+'GridView':type+'ListView');
addClass(_gel('video_grid'),viewType=='L'?type+'ListView':type+'GridView');
}
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_GRID_VIEW_SEARCH_RESULTS,viewType=='G');
yt.UserPrefs.save();
return false;
}
function showSearchRelatedTerms(){
toggleClass(_gel('search-related-extra'),'hid');
toggleClass(_gel('search-related-more'),'hid');
toggleClass(_gel('search-related-less'),'hid');
return false;
}
function hideSearchRelatedTerms(){
toggleClass(_gel('search-related-extra'),'hid');
toggleClass(_gel('search-related-less'),'hid');
toggleClass(_gel('search-related-more'),'hid');
return false;
}
function toggleSearchSettings(){
toggleClass(_gel('search-settings-form'),'hid');
addClass(_gel('search-advanced-form'),'hid');
toggleClass(_gel('search-settings-clr'),'hid');
var setting=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_SAFE_SEARCH);
_gel('search-filter-checkbox').checked=setting;
setting=gGoogleSuggest||yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_SUGGEST_ENABLED);
_gel('search-suggest-checkbox').checked=setting;
return false;
}
function toggleAdvSearch(search_query,search_duration,search_hl,search_categories,search_sort,search_uploaded){
toggleClass(_gel('search-advanced-form'),'hid');
addClass(_gel('search-settings-form'),'hid');
toggleClass(_gel('search-settings-clr'),'hid');
if(_gel('search-advanced-form').innerHTML.toLowerCase().indexOf('<form')!=-1){
return false;
}
var params=new Object();
params['action_advanced']='1';
params['search_query']=search_query;
params['search_duration']=search_duration;
params['search_hl']=search_hl;
params['search_sort']=search_sort;
params['search_uploaded']=search_uploaded;
var url=buildUrl('/results_ajax',params);
var categories=search_categories.split(',');
for(var i=0;i<categories.length;i++){
url+='&search_category='+categories[i];
}
showAjaxDivLoggedIn('search-advanced-form',url);
return false;
}
function toggleAdvSearchCategories(){
if(_gel('search-categories-all').checked){
hideDiv('search-advanced-categories');
}else{
showDiv('search-advanced-categories');
}
}
function submitAdvancedSearchRequest(){
var and_queries=document.advSearchForm.and_queries.value;
var exact_query=document.advSearchForm.exact_query.value;
var or_queries=document.advSearchForm.or_queries.value;
var negative_queries=document.advSearchForm.negative_queries.value;
var search_query=and_queries;
if(exact_query.length>0){
search_query+=' "'+exact_query+'"';
}
var or_queries_array=or_queries.split(' ');
for(var x=or_queries_array.length-1;x>=0;x--){
if(or_queries_array[x]==''){
or_queries_array.splice(x,1);
}
}
if(or_queries_array.length>0){
search_query+=' ('+or_queries_array.join(' OR ')+')';
}
var negative_queries_array=negative_queries.split(' ');
for(var x=negative_queries_array.length-1;x>=0;x--){
if(negative_queries_array[x]==''){
negative_queries_array.splice(x,1);
}else{
negative_queries_array[x]='-'+negative_queries_array[x];
}
}
if(negative_queries_array.length>0){
search_query+=' '+negative_queries_array.join(' ');
}
_gel('adv_search_query').value=search_query;
return true;
}
function setSafeSearchPref(){
var setting=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_SAFE_SEARCH);
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_SAFE_SEARCH,!setting);
yt.UserPrefs.save();
}
function setSearchSuggestPref(){
var setting=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_SUGGEST_ENABLED);
var hasSetting=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_HAS_SUGGEST_ENABLED);
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_SUGGEST_ENABLED,hasSetting?!setting:!gGoogleSuggest);
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_HAS_SUGGEST_ENABLED,true);
yt.UserPrefs.save();
}
function getElementsByTagNameAndClass(tag,className){
var array=document.getElementsByTagName(tag);
var matches=[];
var re=new RegExp("\\b(?!\-)"+className+"(?!\-)\\b","");
for(var i=0;i<array.length;i++){
if(re.test(array[i].className)){
matches.push(array[i]);
}
}
return matches;
}
function truncate(text,opt_max_length){
var max_length=opt_max_length;
if(!max_length){
max_length=30;
}
if(text.length>max_length-3){
return text.substring(0,max_length-3)+"...";
}
return text;
}
function getXmlHttpRequest()
{
var httpRequest=null;
try
{
httpRequest=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
httpRequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
httpRequest=null;
}
}
if(!httpRequest&&typeof XMLHttpRequest!="undefined")
{
httpRequest=new XMLHttpRequest();
}
return httpRequest;
}
function getUrlSync(url)
{
return getUrl(url,false,null);
}
function getUrlAsync(url,handleStateChange)
{
return getUrl(url,true,handleStateChange);
}
function getUrl(url,async,handleStateChange){
var xmlHttpReq=getXmlHttpRequest();
if(!xmlHttpReq)
return;
if(handleStateChange)
{
xmlHttpReq.onreadystatechange=function()
{
handleStateChange(xmlHttpReq);
};
}
else
{
xmlHttpReq.onreadystatechange=function(){;}
}
xmlHttpReq.open("GET",url,async);
xmlHttpReq.send(null);
}
function postUrl(url,data,async,stateChangeCallback)
{
var xmlHttpReq=getXmlHttpRequest();
if(!xmlHttpReq)
return;
xmlHttpReq.open("POST",url,async);
xmlHttpReq.onreadystatechange=function()
{
stateChangeCallback(xmlHttpReq);
};
xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttpReq.send(data);
}
function urlEncodeDict(dict)
{
var result="";
for(var i=0;i<dict.length;i++){
result+="&"+encodeURIComponent(dict[i].name)+"="+encodeURIComponent(dict[i].value);
}
return result;
}
function execOnSuccess(stateChangeCallback,successCallback,div_id)
{
return function(xmlHttpReq)
{
if(xmlHttpReq.readyState==4&&
xmlHttpReq.status==200){
if(div_id){
stateChangeCallback(xmlHttpReq,successCallback,div_id);
}else{
stateChangeCallback(xmlHttpReq,successCallback);
}
}
};
}
function postFormByForm(form,async,successCallback){
var formVars=new Array();
for(var i=0;i<form.elements.length;i++)
{
var formElement=form.elements[i];
if((formElement.type=='radio'||formElement.type=='checkbox')&&!formElement.checked){
continue;
}
var v=new Object;
v.name=formElement.name;
v.value=formElement.value;
formVars.push(v);
}
postUrl(form.action,urlEncodeDict(formVars),async,execOnSuccess(successCallback));
}
function postForm(formName,async,successCallback)
{
var form=document.forms[formName];
return postFormByForm(form,async,successCallback);
}
function replaceDivContents(xmlHttpRequest,dstDivId)
{
var dstDiv=document.getElementById(dstDivId);
dstDiv.innerHTML=xmlHttpRequest.responseText;
}
function getUrlXMLResponseCallback(xmlHttpReq,successCallback){
if(xmlHttpReq.responseXML==null){
alert("Error while processing your request.");
return;
}
var root_node=getRootNode(xmlHttpReq);
var return_code=getNodeValue(root_node,'return_code');
if(return_code==0){
redirect_val=getNodeValue(root_node,'redirect_on_success');
if(redirect_val!=null){
window.location=redirect_val;
}else{
success_message=getNodeValue(root_node,'success_message');
if(success_message!=null){
alert(success_message);
}
if(successCallback!=null){
successCallback(xmlHttpReq);
}
}
}else{
var error_msg=getNodeValue(root_node,'error_message');
if(error_msg==null||error_msg.length==0){
error_msg="An error occured while performing this operation.";
}
alert(error_msg)
}
}
function getUrlXMLResponseCallbackFillDiv(xmlHttpReq,successCallback,div_id){
getUrlXMLResponseCallback(xmlHttpReq);
document.getElementById(div_id).innerHTML=getNodeValue(xmlHttpReq.responseXML,"html_content");
if(successCallback!=null){
successCallback(xmlHttpReq);
}
}
function getUrlXMLResponseCallbackJSON(xmlHttpReq,successCallback){
getUrlXMLResponseCallback(xmlHttpReq);
if(successCallback!=null){
successCallback(eval(getNodeValue(getRootNode(xmlHttpReq),"html_content")));
}
}
function getNodeValue(obj,tag)
{
node=obj.getElementsByTagName(tag);
if(node!=null&&node.length>0){
return node[0].firstChild.nodeValue;
}else{
return null;
}
}
function getRootNode(xmlHttpReq){
return xmlHttpReq.responseXML.getElementsByTagName('root')[0];
}
function getUrlXMLResponse(url,successCallback){
getUrl(url,true,execOnSuccess(getUrlXMLResponseCallback,successCallback))
}
function getUrlXMLResponseAndFillDiv(url,div_id,successCallback){
getUrl(url,true,execOnSuccess(getUrlXMLResponseCallbackFillDiv,successCallback,div_id))
}
function getUrlXMLResponseJSON(url,successCallback){
getUrl(url,true,execOnSuccess(getUrlXMLResponseCallbackJSON,successCallback))
}
getUrlXMLResponseJSON.prototype.getUrlXMLResponseCallbackJSON=getUrlXMLResponseCallbackJSON;
getUrlXMLResponseJSON.prototype.getUrlXMLResponseCallback=getUrlXMLResponseCallback;
function postUrlXMLResponse(url,data,successCallback){
postUrl(url,data,true,execOnSuccess(getUrlXMLResponseCallback,successCallback))
}
function postUrlXMLResponseAndFillDiv(url,data,div_id,successCallback){
postUrl(url,data,true,execOnSuccess(getUrlXMLResponseCallbackFillDiv,successCallback,div_id))
}
function confirmAndPostUrlXMLResponse(url,confirmMessage,data,successCallback){
if(confirm(confirmMessage)){
postUrlXMLResponse(url,data,successCallback);
}
}
function postFormXMLResponse(formName,successCallback){
postForm(formName,true,execOnSuccess(getUrlXMLResponseCallback,successCallback))
}
function postFormXMLResponseAndFillDiv(formName,div_id,successCallback){
postUrl(url,data,async,stateChangeCallback)
}
function toogleWatcher(token,current_video_id,stringOn,stringOff)
{
if(!self.sharing_active)
{
enableWatcherShare(token,current_video_id,stringOn);
}
else
{
disableWatcherShare(token,current_video_id,stringOff);
}
}
function enableWatcherShare(token,current_video_id,stringOn)
{
fadein();
var varg="";
if(current_video_id)
varg="&v="+current_video_id;
getUrlXMLResponse("/watcher?action_start_share=1"+varg+"&t="+token,showEnabledWatcher(stringOn));
}
function disableWatcherShare(token,current_video_id,stringOff)
{
disableFadein();
var varg="";
if(current_video_id)
varg="&v="+current_video_id;
getUrlXMLResponse("/watcher?action_stop_share=1"+varg+"&t="+token,showDisabledWatcher(stringOff));
}
function showEnabledWatcher(newString)
{
self.sharing_active=true;
var img=document.getElementById("sharingImg");
var img2=_gel('watchSharingImg');
removeClass(img,'activeSharingRed');
addClass(img,'activeSharingGreen');
if(img2){
removeClass(img2,'activeSharingRed');
addClass(img2,'activeSharingGreen');
}
if(document.getElementById("watch-active-sharing-status-on")){
hideDiv('watch-active-sharing-status-off');
showDiv('watch-active-sharing-status-on');
}
alert(newString);
img.title=newString;
fadeout();
if(document.getElementById("activesharing_start_button")){
hideDiv('activesharing_start_button');
showDiv('activesharing_stop_button');
}
if(document.getElementById("activesharing_masthead_start")){
hideDiv('activesharing_masthead_start');
showDiv('activesharing_masthead_stop');
}
}
function showDisabledWatcher(newString)
{
self.sharing_active=false;
var img=document.getElementById("sharingImg");
var img2=document.getElementById("watchSharingImg");
removeClass(img,'activeSharingGreen');
addClass(img,'activeSharingRed');
if(img2){
removeClass(img2,'activeSharingGreen');
addClass(img2,'activeSharingRed');
}
if(document.getElementById("watch-active-sharing-status-on")){
hideDiv('watch-active-sharing-status-on');
showDiv('watch-active-sharing-status-off');
}
alert(newString);
img.title=newString;
disableFadeout();
if(document.getElementById("activesharing_start_button")){
showDiv('activesharing_start_button');
hideDiv('activesharing_stop_button');
}
if(document.getElementById("activesharing_masthead_start")){
showDiv('activesharing_masthead_start');
hideDiv('activesharing_masthead_stop');
}
}
function makearray(n){
this.length=n;
for(var i=1;i<=n;i++)
this[i]=0;
return this;
}
hexa=new makearray(16);
for(var i=0;i<10;i++)
hexa[i]=i;
hexa[10]="a";hexa[11]="b";hexa[12]="c";
hexa[13]="d";hexa[14]="e";hexa[15]="f";
function hex(i){
if(i<0)
return "00";
else if(i>255)
return "ff";
else
return ""+hexa[Math.floor(i/16)]+hexa[i%16];
}
function setbgColor(r,g,b){
var hr=hex(r);var hg=hex(g);var hb=hex(b);
document.getElementById('shareSpan').style.backgroundColor="#"+hr+hg+hb;
}
function fade(sr,sg,sb,er,eg,eb,step){
for(var i=0;i<=step;i++){
setbgColor(
Math.floor(sr*((step-i)/step)+er*(i/step)),
Math.floor(sg*((step-i)/step)+eg*(i/step)),
Math.floor(sb*((step-i)/step)+eb*(i/step)));
}
}
function fadein(){
fade(255,255,255,102,204,0,825);
}
function fadeout(){
setTimeout("fade(102,204,0, 255,255,255,2025)",800)
}
function disableFadein(){
fade(255,255,255,255,102,102,825);
}
function disableFadeout(){
setTimeout("fade(255,102,102, 255,255,255,2025)",800)
}
function stripNonNumber(val){
return val.replace(/[^\d]/g,'')
}
bind=function(fn,self,var_args){
var boundArgs=fn.boundArgs_;
if(arguments.length>2){
var args=Array.prototype.slice.call(arguments,2);
if(boundArgs){
args.unshift.apply(args,boundArgs);
}
boundArgs=args;
}
self=fn.boundSelf_||self;
fn=fn.boundFn_||fn;
var newfn;
if(boundArgs){
newfn=function(){
var args=Array.prototype.slice.call(arguments);
args.unshift.apply(args,boundArgs);
return fn.apply(self,args);
}
}else{
newfn=function(){
return fn.apply(self,arguments);
}
}
newfn.boundArgs_=boundArgs;
newfn.boundSelf_=self;
newfn.boundFn_=fn;
return newfn;
};
Function.prototype.bind=function(self,var_args){
if(arguments.length>1){
var args=Array.prototype.slice.call(arguments,1);
args.unshift(this,self);
return bind.apply(null,args);
}else{
return bind(this,self);
}
};
Function.prototype.inherits=function(parentCtor){
inherits(this,parentCtor);
};
inherits=function(childCtor,parentCtor){
function tempCtor(){};
tempCtor.prototype=parentCtor.prototype;
childCtor.superClass_=parentCtor.prototype;
childCtor.prototype=new tempCtor();
childCtor.prototype.constructor=childCtor;
};
var goog=window.goog?window.goog:{};
window.goog=goog;
goog.typeOf=function(value){
var s=typeof value;
if(s=='object'){
if(value){
if(typeof value.length=='number'&&
typeof value.splice=='function'&&
typeof value.propertyIsEnumerable=='function'&&
!value.propertyIsEnumerable('length')){
return 'array';
}
}else{
return 'null';
}
}
return s;
};
function addclass(obj,cl){
if(obj){
if(!checkclass(obj,cl)){
obj.className+=obj.className?' '+cl:cl;
}
}
}
function checkclass(obj,cl){
return obj&&new RegExp('\\b'+cl+'\\b').test(obj.className);
}
function removeclass(obj,cl){
if(obj&&obj.className){
var rep=obj.className.match(' '+cl)?' '+cl:cl;
obj.className=obj.className.replace(rep,'');
}
}
(function(){
var ANIMATION_SLICE_MS=10;
var animations=[];
var timerId;
function animationSorter(a,b){
if(a.startTime==b.startTime){
return a.property?0:1;
}
return(a.startTime-b.startTime);
}
function defragmentAnimations(){
var old=animations;
animations=[];
for(var i=0;i<old.length;++i){
if(old[i]!=null){
animations.push(old[i]);
}
}
}
function animate(){
animations.sort(animationSorter);
if(timerId){
window.clearTimeout(timerId);
timerId=null;
}
timerId=window.setTimeout(animationLoop,0);
}
function animateNow(){
if(timerId){
window.clearTimeout(timerId);
timerId=null;
}
animationLoop();
}
function animationLoop(){
var now=(new Date()).valueOf();
var ani;
var active=false;
var defrag=false;
for(var i=0;i<animations.length;++i){
ani=animations[i];
if(ani.startTime>now){
break;
}
if(ani.endTime<=now){
if(ani.property){
ani.object[ani.property]=ani.interpolator?ani.interpolator(
ani.startValue,
ani.targetValue,
1,
ani.timeline
):ani.targetValue;
}else if(typeof(ani.targetValue)=='function'){
ani.targetValue(ani.object);
}
animations[i]=null;
defrag=true;
continue;
}
var duration=ani.endTime-ani.startTime;
try{
if(ani.property){
ani.object[ani.property]=ani.interpolator(
ani.startValue,
ani.targetValue,
(now-ani.startTime)/ duration,
ani.timeline
);
active=true;
}
}catch(e){
animations[i]=null;
defrag=true;
}
}
if(defrag){
defragmentAnimations();
}
if(active){
timerId=window.setTimeout(animationLoop,ANIMATION_SLICE_MS);
}else if(animations.length>0){
timerId=window.setTimeout(animationLoop,animations[0].startTime-now);
}
}
function animateProperty(
object,property,startValue,targetValue,delay,duration,
interpolator,timeline,opt_restore,opt_hold){
var startTime=(new Date()).valueOf()+delay*1000;
var endTime=startTime+duration*1000;
animations.push({
object:object,
property:property,
startValue:startValue,
targetValue:targetValue,
startTime:startTime,
endTime:endTime,
interpolator:interpolators[interpolator],
timeline:timelines[timeline]
});
if(opt_restore){
opt_hold=opt_hold?opt_hold:0;
animations.push({
object:object,
property:property,
startValue:null,
targetValue:object[property],
startTime:opt_hold*1000+endTime+1,
endTime:opt_hold*1000+endTime+1,
restorer:true
});
}
animate();
};
function delaySetProperty(object,property,targetValue,delay,opt_restore,opt_hold){
animateProperty(object,property,targetValue,
targetValue,delay,0,null,null,opt_restore,opt_hold);
}
function scheduleAction(object,callback,delay,opt_callback_cleanup,opt_hold){
animateProperty(object,null,null,callback,delay,0);
if(opt_hold){
var runTime=(new Date()).valueOf()+delay*1000;
var cleanupTime=runTime+opt_hold*1000;
animations.push({
object:object,
targetValue:opt_callback_cleanup,
startTime:cleanupTime,
endTime:cleanupTime,
restorer:true
});
}
animate();
}
function endAllAnimations(){
animateNow();
var now=(new Date()).valueOf();
for(var i=0;i<animations.length;++i){
var ani=animations[i];
ani.startTime=now;
ani.endTime=now;
}
animateNow();
}
function isAncestorOrSelf(old,young){
var cur=young;
do{
if(cur==old){
return true;
}
}while(cur=cur.parentNode);
return false;
}
function endAnimations(object){
animateNow();
var now=(new Date()).valueOf();
var oldAnimations=animations;
animations=[];
for(var i=0;i<oldAnimations.length;++i){
var ani=oldAnimations[i];
if(isAncestorOrSelf(object,ani.object)){
animations.push(ani);
oldAnimations[i]=null;
}
}
animateNow();
animations=oldAnimations;
defragmentAnimations();
animateNow();
}
function parseRgb(rgb){
if(rgb.indexOf('rgb')==0){
segs=rgb.split(/[^0-9]+/);
return '#'+
pad2(parseInt(segs[1]).toString(16))+
pad2(parseInt(segs[2]).toString(16))+
pad2(parseInt(segs[3]).toString(16));
}else if(rgb.length==4){
return '#'+
rgb.charAt(1)+'0'+rgb.charAt(2)+'0'+rgb.charAt(3)+'0';
}else{
return rgb;
}
}
function parsePx(px){
if(!px)return 0;
return parseInt(px.replace('px',''));
}
var timelines={
linear:function(v0,v1,pos){
return v0*(1-pos)+v1*pos;
},
decelerate:function(v0,v1,pos){
var ypoint=1-0.25*0.25;
pos=pos*(ypoint/ 0.75);
if(pos>ypoint){
pos-=((pos-ypoint)*(pos-ypoint)*
(1/ ((1.25-ypoint)*(1.25-ypoint))));
}
return v0*(1-pos)+v1*pos;
},
sine:function(v0,v1,pos){
var rads=Math.PI/2;
var scomp=Math.sin(pos*rads);
var ccomp=1-Math.sin(rads+pos*rads);
var pos=ccomp*(1-pos)+scomp*pos;
return v0*(1-pos)+v1*pos;
}
};
var interpolators={
rgb3:function(color0,color1,position,timeline){
var i,result='',digit0,digit1,newvalue,newdigit;
for(i=1;i<4;++i){
digit0=parseInt(color0.charAt(i),16);
digit1=parseInt(color1.charAt(i),16);
newvalue=Math.round(timeline(digit0*16,digit1*16,position));
result+=pad2(newvalue.toString(16));
}
return '#'+result;
},
rgb6:function(color0,color1,position,timeline){
var i,result='',digit0,digit1,newvalue,newdigit;
for(i=0;i<3;++i){
digit0=parseInt(color0.substr(i*2+1,2),16);
digit1=parseInt(color1.substr(i*2+1,2),16);
newvalue=Math.round(timeline(digit0,digit1,position));
result+=pad2(newvalue.toString(16));
}
return '#'+result;
},
number:function(num0,num1,position,timeline){
return timeline(num0,num1,position);
},
integer:function(num0,num1,position,timeline){
return Math.round(timeline(num0,num1,position));
},
px:function(px0,px1,position,timeline){
return Math.round(timeline(parsePx(px0),parsePx(px1),position))+'px';
},
filter:function(num0,num1,position,timeline){
return 'alpha(opacity='+timeline(num0*100,num1*100,position)+')';
}
};
window.scheduleAction=scheduleAction;
window.animateProperty=animateProperty;
window.endAnimations=endAnimations;
window.endAllAnimations=endAllAnimations;
window.delaySetProperty=delaySetProperty;
window.parseRgb=parseRgb;
window.parsePx=parsePx;
window.animateProperty.interpolators=interpolators;
window.animateProperty.timelines=timelines;
})();
function ani(){}
ani.DEFAULT_MESSAGE_DELAY=10;
ani.DEFAULT_MESSAGE_FADEOUT=2;
ani.DEFAULT_MESSAGE_SLIDE=0.5;
ani.fadeDuringSlideUp=function(el,delay,duration){
ani.wrap(el,function(wrapper){
endAnimations(wrapper);
animateProperty(wrapper.style,'height',wrapper.offsetHeight+'px',
'1px',delay,duration,'px','sine',true);
animateProperty(wrapper.style,'opacity','1.0','0.0',delay,duration,
'number','sine',true);
animateProperty(wrapper.style,'filter','1.0','0.0',delay,duration,
'filter','sine',true);
delaySetProperty(el.style,'display','none',delay+duration);
},delay,duration);
};
ani.fadeAndSlideUp=function(el,delay,fadeDuration,slideDuration){
ani.wrap(el,function(wrapper){
endAnimations(wrapper);
animateProperty(wrapper.style,'height',wrapper.offsetHeight+'px',
wrapper.offsetHeight+'px',delay,fadeDuration,'px','linear');
animateProperty(wrapper.style,'opacity','1.0','0.0',delay,fadeDuration,
'number','sine',true,slideDuration);
animateProperty(wrapper.style,'filter','1.0','0.0',delay,fadeDuration,
'filter','sine',true,slideDuration);
animateProperty(wrapper.style,'height',wrapper.offsetHeight+'px','1px',
delay+fadeDuration,slideDuration,'px','sine');
delaySetProperty(el.style,'display','none',delay+fadeDuration+
slideDuration);
},delay,fadeDuration+slideDuration);
};
ani.wrap=function(el,callback,delay,duration){
var wrapper=document.createElement('div');
wrapper.style.margin='0px';
wrapper.style.padding='0px';
el.parentNode.insertBefore(wrapper,el);
el.parentNode.removeChild(el);
wrapper.appendChild(el);
wrapper.style.height=wrapper.offsetHeight+10+'px';
wrapper.style.overflow='hidden';
callback(wrapper);
function teardown(el){
wrapper.removeChild(el);
wrapper.parentNode.insertBefore(el,wrapper);
wrapper.parentNode.removeChild(wrapper);
}
scheduleAction(el,null,delay,teardown,duration);
};
ani.hideAndFloatClone=function(el){
var clone=el.cloneNode(true);
clone.id=el.id+"-clone";
var top=el.offsetTop;
var left=el.offsetLeft;
clone.style.position="absolute";
el.style.visibility="hidden";
el.parentNode.appendChild(clone);
clone.style.left=left;
clone.style.top=top;
clone.style.zIndex=el.style.zIndex?el.style.zIndex+"100":"100";
return clone;
};
ani.swapDivs=function(el1,el2,duration){
var el1_top=el1.offsetTop;
var el2_top=el2.offsetTop;
var clone1=ani.hideAndFloatClone(el1);
var clone2=ani.hideAndFloatClone(el2);
endAnimations(clone1);
endAnimations(clone2);
animateProperty(clone1.style,'top',el1_top,el2_top,0,duration,
'number','sine');
animateProperty(clone2.style,'top',el2_top,el1_top,0,duration,
'number','sine');
function halfOpacityAndBack(obj){
animateProperty(obj.style,'opacity','1.0','0.5',0,duration/ 2,
'number','sine');
animateProperty(obj.style,'filter','1.0','0.5',0,duration/ 2,
'filter','sine');
animateProperty(obj.style,'opacity','0.5','1.0',duration/ 2,
duration/ 2,'number','sine');
animateProperty(obj.style,'filter','0.5','1.0',duration/ 2,
duration/ 2,'filter','sine');
}
halfOpacityAndBack(clone1);
halfOpacityAndBack(clone2);
window.setTimeout(function(){
el1.style.visibility='visible';
el2.style.visibility='visible';
removeNode(clone1);
removeNode(clone2);
},duration*1000);
};
function removeNode(el){
el.parentNode.removeChild(el);
}
window.YT_stats_zippy=function(id,ajaxUrl,loginUrl,opt_cookie_flag,opt_onexpand,opt_onminimize){
this.id_=id;
this.url_=ajaxUrl;
this.loginUrl_=loginUrl;
this.div_content_=_gel(id+"-content");
this.div_contentClosed_=_gel(id+"-content-closed");
this.div_arrowRight_=_gel(id+"-arrowRight");
this.div_arrowDown_=_gel(id+"-arrowDown");
this.div_titleText_=_gel(id+"-titleText");
this.div_arrowRight_.onmousedown=function(){this.expand();}.bind(this);
this.div_arrowDown_.onmousedown=function(){this.minimize();}.bind(this);
this.div_titleText_.onmousedown=function(){this.toggleState();}.bind(this);
this.onexpand_=opt_onexpand;
this.onminimize_=opt_onminimize;
this.cookie_flag_=opt_cookie_flag;
if(this.cookie_flag_){
try{
var collapsed=yt.UserPrefs.getFlag(this.get_state_cookie_name());
if(collapsed){
this.minimize();
}else{
this.expand();
}
}catch(e){
}
}
};
YT_stats_zippy.prototype.minimizeForeignZippies=function(zippyList){
for(var i=0;i<zippyList.length;++i){
var cz=zippyList[i];
if(cz&&cz!=this&&cz.isExpanded()){
cz.minimize();
}
}
};
YT_stats_zippy.prototype.get_state_cookie_name=function(){
return yt.UserPrefs.Flags[this.cookie_flag_];
};
YT_stats_zippy.prototype.save_state=function(state){
if(this.cookie_flag_){
try{
yt.UserPrefs.setFlag(this.get_state_cookie_name(),state);
yt.UserPrefs.save();
}catch(e){
}
}
};
YT_stats_zippy.prototype.isExpanded=function(){
return(this.div_arrowRight_.style.display=="none");
};
YT_stats_zippy.prototype.toggleState=function(){
if(this.isExpanded()){
this.minimize();
}else{
this.expand();
}
};
YT_stats_zippy.prototype.expand=function(){
this.save_state(false);
this.div_arrowRight_.style.display="none";
this.div_arrowDown_.style.display="inline";
this.div_content_.style.display="block";
if(this.div_contentClosed_){
this.div_contentClosed_.style.display="none";
}
if(this.div_content_.innerHTML.match(/^\s*$/)&&this.url_){
this.ajax_fetch();
}
if(typeof this.onexpand_=='function'){
this.onexpand_(this);
}
};
YT_stats_zippy.prototype.ajax_fetch=function(){
this.div_content_.innerHTML='<div style="text-align: center; margin: 35px;"><img src="icn_loading_animated-vfl24663.gif"></div>';
var handleResponse=function(xhr){
this.handleAjaxResponse(
xhr,
this.div_content_,
this.loginUrl_
);
}.bind(this);
var fetchContent=function(){
getUrl(this.url_,true,handleResponse);
}.bind(this);
setTimeout(fetchContent,0);
};
YT_stats_zippy.prototype.minimize=function(){
this.save_state(true);
this.div_arrowRight_.style.display="inline";
this.div_arrowDown_.style.display="none";
this.div_content_.style.display="none";
if(this.div_contentClosed_){
this.div_contentClosed_.style.display="";
}
if(typeof this.onminimize_=='function'){
this.onminimize_(this);
}
};
YT_stats_zippy.prototype.handleAjaxResponse=function(xmlHttpRequest,content,loginUrl){
if(xmlHttpRequest.readyState==4){
if(xmlHttpRequest.status==200){
content.innerHTML=xmlHttpRequest.responseText;
}else if(xmlHttpRequest.status==401){
window.location.pathname=loginUrl;
}else{
if(this.error_page_){
var error_page=_gel(this.error_page_);
content.innerHTML=error_page.innerHTML;
}
}
}
};
var feed_module_index=Array()
function next_feed_module_item(tab_id,module_id,num_items){
if(feed_module_index[module_id]==undefined)
feed_module_index[module_id]=0;
addClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
feed_module_index[module_id]+=1;
feed_module_index[module_id]=feed_module_index[module_id]%num_items;
removeClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
}
function previous_feed_module_item(tab_id,module_id,num_items){
if(feed_module_index[module_id]==undefined)
feed_module_index[module_id]=0;
addClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
feed_module_index[module_id]+=num_items-1;
feed_module_index[module_id]=feed_module_index[module_id]%num_items;
removeClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
}
function select_feed_module_item(tab_id,module_id,new_index,num_items){
if(feed_module_index[module_id]==undefined)
feed_module_index[module_id]=0;
addClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
feed_module_index[module_id]=new_index%num_items;
removeClass(_gel('feed-module-'+tab_id+'-'+module_id+'-item-'+feed_module_index[module_id]),'hide');
}
if((navigator.appVersion.indexOf('MSIE')>-1)&&(typeof window.XMLHttpRequest=='undefined')){
imgExt='gif';
}
else
{
imgExt='png';
}
var UT_RATING_IMG='icn_star_full_19x20'+imgExt;
var UT_RATING_IMG_HOVER='star_hover-vfl2056.gif';
var UT_RATING_IMG_HALF='icn_star_half_19x20'+imgExt;
var UT_RATING_IMG_BG='icn_star_empty_19x20'+imgExt;
var UT_RATING_IMG_REMOVED='star_removed-vfl2028.gif';
function UTRating(ratingElementId,maxStars,objectName,formName,ratingMessageId,componentSuffix,size,messages,starCount,callback)
{
this.ratingElementId=ratingElementId;
this.maxStars=maxStars;
this.objectName=objectName;
this.formName=formName;
this.ratingMessageId=ratingMessageId
this.componentSuffix=componentSuffix
this.messages=messages;
this.callback=callback;
this.starTimer=null;
this.starCount=0;
if(starCount){
this.starCount=starCount;
that=this;
onLoadFunctionList.push(function(){that.drawStars(that.starCount,true);});
}
if(size=='S'){
UT_RATING_IMG='icn_star_full_11x11gif'
UT_RATING_IMG_HALF='icn_star_half_11x11gif'
UT_RATING_IMG_BG='icn_star_empty_11x11gif'
}
function showStars(starNum,skipMessageUpdate){
this.clearStarTimer();
this.greyStars();
this.colorStars(starNum);
if(!skipMessageUpdate)
this.setMessage(starNum,messages);
}
function setMessage(starNum){
if(starNum>0){
if(!this.savedMessage){
this.savedMessage=document.getElementById(this.ratingMessageId).innerHTML;
}
document.getElementById(this.ratingMessageId).innerHTML=this.messages[starNum-1];
}else if(this.savedMessage){
document.getElementById(this.ratingMessageId).innerHTML=this.savedMessage;
}
}
function colorStars(starNum){
for(var i=0;i<starNum;i++){
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_HALF);
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_BG);
addClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG);
}
}
function greyStars(){
for(var i=0;i<this.maxStars;i++)
if(i<=this.starCount){
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG);
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_HALF);
addClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_BG);
}
else
{
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG);
removeClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_HALF);
addClass(document.getElementById('star_'+this.componentSuffix+"_"+(i+1)),UT_RATING_IMG_BG);
}
}
function setStars(starNum){
this.starCount=starNum;
this.drawStars(starNum);
document.forms[this.formName]['rating'].value=this.starCount;
var ratingElementId=this.ratingElementId;
that=this;
postForm(this.formName,true,function(req){
replaceDivContents(req,ratingElementId);
if(that.callback){
that.callback();
}
});
}
function drawStars(starNum,skipMessageUpdate){
this.starCount=starNum;
this.showStars(starNum,skipMessageUpdate);
}
function clearStars(){
this.starTimer=setTimeout(this.objectName+".resetStars()",300);
}
function resetStars(){
this.clearStarTimer();
if(this.starCount)
this.drawStars(this.starCount);
else
this.greyStars();
this.setMessage(0);
}
function clearStarTimer(){
if(this.starTimer){
clearTimeout(this.starTimer);
this.starTimer=null;
}
}
this.clearStars=clearStars;
this.clearStarTimer=clearStarTimer;
this.greyStars=greyStars;
this.colorStars=colorStars;
this.resetStars=resetStars;
this.setStars=setStars;
this.drawStars=drawStars;
this.showStars=showStars;
this.setMessage=setMessage;
}
ratingHoverTimers=[]
function ratingHoverOver(componentSuffix){
if(componentSuffix==""){
componentSuffix=="reserved"
}
_clearHoverTimer(componentSuffix);
hideDiv('defaultRatingMessage'+componentSuffix);
showDiv('hoverMessage'+componentSuffix);
}
function ratingHoverOut(componentSuffix){
if(componentSuffix==""){
componentSuffix=="reserved"
}
ratingHoverTimers[componentSuffix]=setTimeout(function(){_ratingHoverClear(componentSuffix);},300);
}
function _ratingHoverClear(componentSuffix){
if(componentSuffix==""){
componentSuffix=="reserved"
}
_clearHoverTimer();
hideDiv('hoverMessage');
showDiv('defaultRatingMessage');
}
function _clearHoverTimer(componentSuffix){
if(componentSuffix==""){
componentSuffix=="reserved"
}
if(ratingHoverTimers[componentSuffix]){
clearTimeout(ratingHoverTimers[componentSuffix]);
ratingHoverTimers[componentSuffix]=null;
}
}
function newRoadBlock(adTag){
a=adTag.split(';');
if(a.length>0){
for(x=0;x<=a.length-1;x++){
if(a[x].indexOf('sz=')==0){
size=a[x].substring(3);
dims=size.split('x');
height=dims[0];
width=dims[1];
loadRBs('myAd_banner',height,width,adTag);
}
}
}
}
function loadRBs(s,w,h,adTag){
document.getElementById(s).innerHTML=
'<iframe src="'+adTag+'" id="ifr_companion" width="'+w+'" height="'+h+
'" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>'+
'</iframe>';
}
function setFlashVars(myObjName){
var pvaTag=document.getElementById("pvaTag").value;
document.getElementById("FLASH_"+myObjName).SetVariable("myAdTag",pvaTag);
var canv=document.getElementById("canv").value;
document.getElementById("FLASH_"+myObjName).SetVariable("canv",canv);
var burl=document.getElementById("burl").value;
document.getElementById("FLASH_"+myObjName).SetVariable("dc_PVAurl",burl);
var hl=document.getElementById("pvaHl").value
document.getElementById("FLASH_"+myObjName).SetVariable("hl",hl);
document.getElementById("FLASH_"+myObjName).SetVariable("rtg","1");
}
function showPVA(){
var banner=document.getElementById("myAd_banner");
if(banner){
banner.style.visibility="visible";
banner.style.height=35;
}
}
function approveComment(comment_id,comment_type,entity_id,token)
{
if(CheckLogin()==false)
return false;
postUrlXMLResponse("/comment_servlet","&field_approve_comment=1&comment_id="+comment_id+"&comment_type="+comment_type+"&entity_id="+entity_id+"&"+token,self.commentApproved);
return false;
}
function removeComment(div_id,deleter_user_id,comment_id,comment_type,entity_id,token)
{
if(CheckLogin()==false)
return;
var callback=function(){toggleVisibility(div_id,false);};
postUrlXMLResponse("/comment_servlet","deleter_user_id="+deleter_user_id+"&remove_comment&comment_id="+comment_id+"&comment_type="+comment_type+"&entity_id="+entity_id+"&"+token,callback);
return false;
}
function hideCommentReplyForm(form_id){
var div_id="div_"+form_id;
var reply_id="reply_"+form_id;
toggleVisibility(reply_id,true);
toggleVisibility(div_id,false);
}
function handleStateChange(xmlHttpReq){
document.getElementById("all_comments_content").innerHTML=getNodeValue(xmlHttpReq.responseXML,"html_content");
style2=document.getElementById("recent_comments").style;
style2.display="none";
var style2=document.getElementById("all_comments").style;
style2.display="";
}
function commentResponse_js(xmlHttpRequest,messages)
{
response_str=xmlHttpRequest.responseText;
response_code=response_str.substr(0,response_str.indexOf(" "));
form_id=response_str.substr(response_str.indexOf(" ")+1);
var form=document.forms[form_id];
var dstDiv=form.add_comment_button;
var discard_button=form.discard_comment_button;
var commentDiv=form.comment;
if(response_code=="OK"){
dstDiv.value=messages["ok"];
dstDiv.disabled=true;
discard_button.disabled=true;
discard_button.style.display="none";
}else if(response_code=="PENDING"){
dstDiv.value=messages["pending"]
dstDiv.disabled=true;
discard_button.disabled=true;
discard_button.style.display="none";
}else if(response_code=="LOGIN"){
dstDiv.disabled=false;
}else if(response_code=="EMAIL"){
if(confirm(messages["email"])){
window.location="/email_confirm"
}
dstDiv.disabled=false;
}else{
if(response_code=="BLOCKED"){
dstDiv.disabled=true;
}else if(response_code=="TOOSOON"){
dstDiv.disabled=false;
alert(messages["toosoon"]);
}else if(response_code=="TOOLONG"){
alert(messages["toolong"]);
dstDiv.disabled=false;
commentDiv.disabled=false;
}else if(response_code=="TOOSHORT"){
alert(messages["tooshort"]);
dstDiv.disabled=false;
commentDiv.disabled=false;
commentDiv.focus();
}else if(response_code=="FAILED"){
dstDiv.disabled=true;
}else if(response_code=="FAILADDED"){
dstDiv.disabled=true;
}else if(response_code=="CAPTCHAFAIL"){
alert(messages["catpchaFail"]);
dstDiv.disabled=false;
}else{
dstDiv.disabled=false;
}
dstDiv.value=messages["default"];
}
}
function ThreadedCommentHandler_js(comment_form,comment_form_id,messages)
{
var comment=comment_form.comment;
var comment_button=comment_form.comment_button;
if(comment.value.length==0||comment.value==null)
{
alert(messages["empty"]);
comment.disabled=false;
comment.focus();
return false;
}
if(comment.value.length>500)
{
alert(messages["toolong"]);
comment.disabled=false;
comment.focus();
return false;
}
postFormByForm(comment_form,true,commentResponse);
return true;
}
function postThreadedComment_js(comment_form_id,messages)
{
if(CheckLogin()==false)
return false;
var form=document.forms[comment_form_id];
if(ThreadedCommentHandler(form,comment_form_id)){
var add_button=form.add_comment_button;
add_button.value=messages["add"];
form.comment.disabled=true;
add_button.disabled=true;
}
}
function load_all_comments_js(video_id,is_watch2,messages){
var remove_btn=document.getElementById('all_comments_button');
if(remove_btn){
remove_btn.value=messages["remove"];
remove_btn.disabled=true;
}
if(is_watch2)
var watch2_str="&watch2"
else
var watch2_str=""
getUrlXMLResponse("/comment_servlet?get_comments&v="+video_id+watch2_str,handleStateChange);
}
function showCommentReplyForm_js(form_id,reply_parent_id,is_main_comment_form,messages){
if(!CheckLogin()){
alert(messages["post"]);
return false;
}
printCommentReplyForm(form_id,reply_parent_id,is_main_comment_form);
}
function updateCharCount_js(charCount_id,label_id,textArea,maxChars,messages){
if(textArea.value.length>maxChars){
if(_gel(label_id).innerHTML!=messages["exceeded"]){
_gel(label_id).innerHTML=messages["exceeded"];
}
_gel(charCount_id).value=textArea.value.length-maxChars;
}else{
if(_gel(label_id).innerHTML!=messages["remaining"]){
_gel(label_id).innerHTML=messages["remaining"];
}
_gel(charCount_id).value=maxChars-textArea.value.length;
}
}
function loginMsg_js(div_id,display_val,messages){
login_msg_div_id="comment_msg_"+div_id;
if(display_val==1){
setInnerHTML(login_msg_div_id,messages["login"]);
}
else{
setInnerHTML(login_msg_div_id,'');
}
}
function printCommentReplyForm_js(form_id,reply_parent_id,is_main_comment_form,comment_type,bidiSupport,id_field_name,id_field_value,comment_xsrf_token,maxChars,messages){
var div_id="div_"+form_id;
var reply_id="reply_"+form_id;
var reply_comment_form="comment_form"+form_id;
var maxCharLabelId="maxCharLabel"+form_id;
var charCountId="charCount"+form_id;
if(is_main_comment_form)
discard_visible="style='display: none'";
else
discard_visible="";
var innerHTMLContent='\
	<form name="'+reply_comment_form+'" id="'+reply_comment_form+'" onSubmit="return false" method="post" action="/comment_servlet" >\
		<input type="hidden" name="'+id_field_name+'" value="'+id_field_value+'">\
		<input type="hidden" name="add_comment" value="">\
		'+comment_xsrf_token+'\
		<input type="hidden" name="form_id" value="'+reply_comment_form+'">\
		<input type="hidden" name="reply_parent_id" value="'+reply_parent_id+'">\
		<input type="hidden" name="comment_type" value="'+comment_type+'">\
		<textarea name="comment" \
		cols="46" rows="5" onkeyup="updateCharCount(\''+charCountId+'\', \''+maxCharLabelId+'\', this); '+bidiSupport+'"\
		onpaste="updateCharCount(\''+charCountId+'\', \''+maxCharLabelId+'\', this);"\
		oninput="updateCharCount(\''+charCountId+'\', \''+maxCharLabelId+'\', this);"\
		></textarea>\
		<br/>\
		<div style="float:left;clear:left">\
		<input align="left" type="button" name="add_comment_button"\
				value="'+messages['post']+'" \
				onclick="postThreadedComment(\''+reply_comment_form+'\');">\
		<input align="left" type="button" name="discard_comment_button"\
				value="'+messages['discard']+'" '+discard_visible+'\
				onclick="hideCommentReplyForm(\''+form_id+'\',false);">\
		<span id="'+maxCharLabelId+'">'+messages["remaining"]+'</span><input readonly="true" class="watch-comment-char-count" type="text" id="'+charCountId+'" value='+maxChars+'>\
		</div>\
	</form><br style="clear:both"><br>';
if(!is_main_comment_form){
toggleVisibility(reply_id,false);
if(reply_parent_id&&_gel("comment_body_"+reply_parent_id).style.display=="none"){
displayHideCommentLink(reply_parent_id);
}
}
setInnerHTML(div_id,innerHTMLContent);
toggleVisibility(div_id,true);
}
function hideSpam(cid){
if(document.getElementById('reply_comment_form_id_'+cid)){
document.getElementById('reply_comment_form_id_'+cid).style.display='none';
}
if(document.getElementById('comment_body_'+cid)){
document.getElementById('comment_body_'+cid).style.display='none';
}
if(document.getElementById('comment_spam_bug_'+cid)){
document.getElementById('comment_spam_bug_'+cid).style.display='inline';
}
}
function showAjaxDivLoggedIn(divName,url,callback){
getUrlXMLResponse(url,showAjaxDivResponseLater(divName,callback));
}
function showAjaxPostDivLoggedIn(divName,url,data,callback){
postUrlXMLResponse(url,data,showAjaxDivResponseLater(divName,callback));
}
function showAjaxDiv(divName,url){
if(isLoggedIn){
showAjaxDivLoggedIn(divName,url)
}else{
alert(MSG_Login);
}
}
function showAjaxPostDiv(divName,url,data){
if(isLoggedIn){
showAjaxPostDivLoggedIn(divName,url,data)
}else{
alert(MSG_Login);
}
}
function showAjaxDivResponseLater(divName,callback){
return function(req){
var nodeValue=getNodeValue(req.responseXML,"html_content");
_gel(divName).innerHTML=nodeValue?nodeValue:'';
if(callback&&typeof callback=="function"){
callback();
}
};
}
function showAjaxDivResponse(req,divName){
_gel(divName).innerHTML=getNodeValue(req.responseXML,"html_content");
openDiv(divName);
}
function postAjaxForm(divName,formName,successCallback){
postFormXMLResponse(formName,closeAjaxDivLater(divName,successCallback));
}
function closeAjaxDivLater(divName,successCallback){
return function(req){
closeDiv(divName);
if(successCallback){
successCallback();
}
}
}
function updateSearchResultsLater(form,searchingDivName,resultsDivName){
return function(req){updateSearchResults(req,form,searchingDivName,resultsDivName)};
}
function updateSearchResults(req,form,searchingDivName,resultsDivName){
if(_gel("watchSearchSubmit")){
_gel("watchSearchSubmit").disabled=false;
}
_gel(resultsDivName).innerHTML=getNodeValue(req.responseXML,"html_content");
if(_gel('resultsBelow')){
_gel('resultsBelow').style.display="none";
}
_gel(resultsDivName).style.textAlign="left";
}
function submitWatchSearchRequest(formName,searchingDivName,resultsDivName){
_gel(resultsDivName).style.textAlign="center";
_gel(resultsDivName).style.display="block";
_gel(resultsDivName).innerHTML="<img src='LoadingGraphic-vfl3869.gif'>";
if(_gel("watchSearchSubmit")){
_gel("watchSearchSubmit").disabled=true;
}
form=document.forms[formName];
postFormXMLResponse(formName,updateSearchResultsLater(form,searchingDivName,resultsDivName));
}
var first_time=1;
function changeBanner(img_url,ref_url,is_flash){
var e=_gel("gad_leaderboardAd");
if(first_time)
{
e.style.height="90px";
first_time=0;
}
var url="";
if(is_flash=="true")
{
url+="<object width='72"+"8' height='9"+"0'>";
url+="<"+"param value='clickTAG="+encodeURIComponent(ref_url)+"' /"+">";
url+="<"+"embed src='"+img_url+"'";
url+=" type='application/x-shockwave-flash' wmode='transparent'";
url+=" flashvars='clickTAG="+encodeURIComponent(ref_url)+"'";
url+=" width='72"+"8' height='9"+"0' /"+">";
url+="</object>";
}
else
{
url="<"+"a href='"+ref_url+"' target='_blank'>";
url+="<img src='"+img_url+"'>";
url+="</a>";
}
e.innerHTML=url;
}
function actionOver(div){
div.className='actionOver';
}
function actionOut(div){
div.className='actionRow';
}
function actionClick(div){
div.className='actionClicked';
}
function actionOverBottom(div){
div.className='actionOverBottom';
}
function actionOutBottom(div){
div.className='actionRowBottom';
}
function actionClickBottom(div){
div.className='actionClickedBottom';
}
function closeDisplay(div){
if(_gel(div)){
_gel(div).style.display="none";
}
}
function shareVideoFromFlash(){
shareVideo(pageVideoId,"en_US");
smoothScrollIntoView(_gel("watch-share-video-div"),20);
}
function closeAll(except){
var divs=['watch-share-video-div','watch-share-blog-quick','shareMessageQuickDiv','watch-customize-embed-div','shareVideoEmailDiv','reportConcernResult1','reportConcernResult2','reportConcernResult3','reportConcernResult4','reportConcernResult5'];
for(var i=0;i<divs.length;i++){
if((divs[i]!=except)&&(_gel(divs[i]))){
var theDiv=_gel(divs[i]);
if(theDiv){
theDiv.style.display="none";
}
}
}
}
function postResponse(){
if(isLoggedIn){
closeAll('postResponseDiv');
toggleDisplay('postResponseDiv');
}
else
{
alert(MSG_LoginPostResponse);
}
}
function closeAfter(divName,delay){
setTimeout(function(){
closeDisplay(divName)
},delay);
}
function postResponseClose(){
toggleDisplay('postResponseDiv');
toggleDisplay('postResponseResult');
closeAfter('postResponseResult',3000);
}
function customizeEmbed(){
closeAll('watch-customize-embed-div');
if(toggleDisplay('watch-customize-embed-div')){
if(_gel('watch-customize-embed-div').innerHTML.toLowerCase().indexOf('<div')!=-1){
return;
}
showAjaxDivLoggedIn('watch-customize-embed-div','/watch_ajax?action_customize_embed=1',applyUserPrefs);
}
}
function addToFaves(formName,event){
watchSelectTab(_gel('watch-tab-favorite'));
if(isLoggedIn){
showDiv('watch-add-faves-result');
showDiv('watch-remove-faves');
hideDiv('watch-add-faves');
showDiv('watch-add-to-faves-switch');
showDiv('watch-remove-faves-btn');
hideDiv('watch-add-faves-btn');
postAjaxForm('watch-add-faves-div',formName);
_gel('watch-action-favorite-link').blur();
urchinTracker('/VideoWatch/ActionTab/AddToFavs/Loggedin');
}
else{
showDiv('addToFavesLogin');
urchinTracker('/VideoWatch/ActionTab/AddToFavs/Loggedout');
}
}
function removeFromFaves(formName,event){
showDiv('watch-add-faves');
hideDiv('watch-remove-faves');
showDiv('watch-add-faves-btn');
hideDiv('watch-remove-faves-btn');
postAjaxForm('watch-remove-faves-div',formName);
_gel('watch-action-favorite-link').blur();
urchinTracker('/VideoWatch/ActionTab/RemoveFromFavs/Loggedin');
}
var gWatchLoading='';
function addToPlaylist(videoId,event){
watchSelectTab(_gel('watch-tab-playlists'));
if(isLoggedIn){
if(!gWatchLoading){
gWatchLoading=_gel('addToPlaylistDiv').innerHTML;
}else{
_gel('addToPlaylistDiv').innerHTML=gWatchLoading;
}
showDiv('addToPlaylistDiv');
showAjaxDivLoggedIn('addToPlaylistDiv','/watch_ajax?video_id='+videoId+'&action_get_playlists_component=1',true);
urchinTracker('/VideoWatch/ActionTab/AddToPlaylists/Loggedin');
}else{
showDiv('addToPlaylistLogin');
urchinTracker('/VideoWatch/ActionTab/AddToPlaylists/Loggedout');
}
}
function submitToPlaylist(self){
if(!self.form.playlist_id.value){
return;
}
self.disabled=true;
postAjaxForm('addToPlaylistDiv',self.form.name,addToPlaylistClose);
}
function addToPlaylistClose(){
toggleDisplay('addToPlaylistResult');
var func=function(){
closeDisplay('addToPlaylistResult');
watchSelectTab(_gel('watch-tab-share'));
};
setTimeout(func,3000);
}
function reportConcern(videoId,event){
closeAllReportConcernsInfo();
watchSelectTab(_gel('watch-tab-flag'));
if(isLoggedIn){
showDiv('inappropriateVidDiv');
if(_gel('inappropriateVidDiv').innerHTML.toLowerCase().indexOf('<div')!=-1){
return;
}
showAjaxDivLoggedIn('inappropriateVidDiv','/watch_ajax?video_id='+videoId+'&action_get_flag_video_component=1',reportConcernCallback);
urchinTracker('/VideoWatch/ActionTab/Flag/Loggedin');
}
else{
showDiv('inappropriateMsgsLogin');
urchinTracker('/VideoWatch/ActionTab/Flag/Loggedout');
}
}
function reportConcernCallback(){
_gel('inappropriateMsgsDiv').innerHTML=_gel('inappropriateMsgs').innerHTML;
_gel('inappropriateMsgs').innerHTML='';
showDiv('inappropriateMsgsDiv');
}
function flagReasonSelection(selID,reason,subreason){
var selCurrent=_gel('selectedFlagReason')
var selNew=_gel(selID);
if(_gel('flag_id').value){
clearSelectionStyles(_gel(_gel('flag_id').value));
clearSelectionStyles(_gel((_gel('flag_id').value).substring(0,2)));
}
setSelectionStyles(selNew);
if(selID.length==5){
setSelectionStyles(_gel(selID.substring(0,2)));
}
_gel('flag_reason').value=reason;
_gel('flag_sub_reason').value=subreason;
_gel('flag_id').value=selID;
selCurrent.innerHTML=_gel(selID).innerHTML;
setVisible('flag_'+selID.substring(0,2),false);
setVisible('flag_main',false);
closeAllFlagMoreInfo();
}
function closeAllFlagMoreInfo(){
var divs=['flagMoreInfo1','flagMoreInfo2','flagMoreInfo3','flagMoreInfo4','flagMoreInfo5','flagMoreInfo6','flagError'];
for(var i=0;i<divs.length;i++){
var theDiv=_gel(divs[i]);
if(theDiv){
theDiv.style.display='none';
}
}
}
function closeAllReportConcernsInfo(){
var divs=['reportConcernResult1','reportConcernResult2','reportConcernResult3','reportConcernResult4','reportConcernResult5'];
for(var i=0;i<divs.length;i++){
var theDiv=_gel(divs[i]);
if(theDiv){
theDiv.style.display='none';
}
}
}
function processFlagForm(elForm){
var formElement=elForm;
if(formElement){
var sel=formElement.flag_id.value;
if(sel){
if(sel=='hc_hv'){
if(formElement.protected_group.options[formElement.protected_group.selectedIndex].value!=''){
toggleDisplay('reportConcernResult3');
}
else{
toggleDisplay('flagError');
return;
}
}
else if(sel=='vc_af'||sel=='sc_su'){
toggleDisplay('reportConcernResult2');
}
else{
toggleDisplay('reportConcernResult1');
}
toggleDisplay('inappropriateVidDiv');
postAjaxForm('inappropriateVidDiv',elForm.name);
_gel('selectedFlagReason').innerHTML='- '+MSG_FlagDefault+' -';
if(_gel('flag_id').value){
clearSelectionStyles(_gel(_gel('flag_id').value));
clearSelectionStyles(_gel((_gel('flag_id').value).substring(0,2)));
_gel('flag_id').value='';
}
closeAllFlagMoreInfo();
addClass(_gel('watch-tab-flag'),'disabled');
}
else{
toggleDisplay('flagError');
}
}
}
function submitToBlog(self){
_gel('submitToBlogBtn').disabled=true;
if((_gel('watch-share-video-div').style.display!='none')){
toggleMoreShare('fewer-options','more-options');
postAjaxForm('watch-share-video-div',self.name,addToBlogClose);
}
else{
postAjaxForm('watch-share-blog-quick',self.name,addToBlogClose);
}
}
function addToBlogClose(){
toggleDisplay('addToBlogResult');
closeAfter('addToBlogResult',3000);
_gel('submitToBlogBtn').disabled=false;
}
function resetSharing(){
closeDiv('watch-share-video-div');
closeDiv('shareMessageQuickDiv');
closeDiv('watch-share-blog-quick');
showDiv('aggregationServicesDiv');
toggleMoreShare('fewer-options','more-options');
}
function readOnlyMode(error_div,error){
_gel(error_div).innerHTML=error;
}
function toggleMoreShare(hide,show){
hideDiv(hide);
showDiv(show);
}
function shareVideo(videoId,locale){
closeAll('watch-share-video-div');
toggleDisplay('watch-share-video-div');
toggleMoreShare('more-options','fewer-options');
showDiv('aggregationServicesDiv');
if(_gel('watch-share-video-div').style.display!="none"){
if(this.loaded===undefined){
showAjaxDivLoggedIn('watch-share-video-div','/watch_ajax?video_id='+videoId+'&locale='+locale+'&action_get_share_video_component=1',true);
this.loaded=true;
}
urchinTracker('/VideoWatch/ShareVideo');
}
if(isLoggedIn){
urchinTracker('/VideoWatch/ActionTab/ShareVideo/Loggedin');
}else{
urchinTracker('/VideoWatch/ActionTab/ShareVideo/Loggedout');
}
}
function closeMoreShareIfOpen(){
if((_gel('watch-share-video-div').style.display!='none')){
toggleMoreShare('fewer-options','more-options');
}
}
function shareBlogQuick(videoId,blogInfoId){
closeMoreShareIfOpen();
closeAll('watch-share-blog-quick');
toggleDisplay('watch-share-blog-quick');
showDiv('aggregationServicesDiv');
if(_gel('watch-share-blog-quick').style.display!="none"){
if(this.loaded_b===undefined){
showAjaxDivLoggedIn('watch-share-blog-quick','/watch_ajax?video_id='+videoId+'&blog_info_id='+blogInfoId+'&action_get_share_blog_component=1',true);
this.loaded_b=true;
this.currBlog=blogInfoId;
}
else{
if(this.currBlog!=blogInfoId){
showAjaxDivLoggedIn('watch-share-blog-quick','/watch_ajax?video_id='+videoId+'&blog_info_id='+blogInfoId+'&action_get_share_blog_component=1',true);
this.currBlog=blogInfoId;
}
}
urchinTracker('/VideoWatch/ShareVideo');
}
}
function shareMessageQuick(videoId){
closeMoreShareIfOpen();
closeAll('shareMessageQuickDiv');
toggleDisplay('shareMessageQuickDiv');
showDiv('aggregationServicesDiv');
if(_gel('shareMessageQuickDiv').style.display!="none"){
if(this.loaded_e===undefined){
showAjaxDivLoggedIn('shareMessageQuickDiv','/watch_ajax?video_id='+videoId+'&view=1'+'&action_get_share_message_component=1',true);
this.loaded_e=true;
}
urchinTracker('/VideoWatch/ShareVideo');
}
}
function shareVideoEmail(videoId){
toggleDisplay('shareVideoEmailDiv');
}
function shareVideoClose(){
if(_gel('watch-share-video-div').style.display!="none"){
toggleDisplay('watch-share-video-div');
}
else{
toggleDisplay('shareMessageQuickDiv');
}
toggleMoreShare('fewer-options','more-options');
toggleDisplay('shareVideoResult');
closeAfter('shareVideoResult',3000);
}
function shareVideoMessageClose(){
toggleDisplay('shareVideoMessageDiv');
toggleDisplay('shareVideoResult');
closeAfter('shareVideoResult',3000);
}
function shareWorld(){
closeAll('shareWorldDiv');
toggleDisplay('watch-share-video-div');
toggleDisplay('shareWorldDiv');
}
function shareWorldClose(){
toggleDisplay('shareWorldDiv');
toggleDisplay('shareWorldResult');
setTimeout("closeDisplay('shareWorldResult')",3000);
}
function embedIt(){
closeAll('embedItDiv');
toggleDisplay('embedItDiv');
}
function showHonorsContent(){
getAndShowNavContent('honors',honorsLink);
}
function writeMoviePlayer(player_div,force){
var v="7";
if(force)
v="0";
var height=swfUrl=='watch-vfl39416.swf'?"386":"395";
var fo=new SWFObject(swfUrl,"movie_player","480",height,v,"#FFFFFF");
fo.addParam("allowFullscreen","true");
for(var x in swfArgs){
fo.addVariable(x,swfArgs[x]);
}
if(watchGamUrl!=null){
fo.addVariable("gam",watchGamUrl);
}
if(watchDCUrl!=null){
fo.addVariable("ad_tag",watchDCUrl);
}
if(!watchIsPlayingAll){
fo.addVariable("playnext",0);
}
if(watchSetWmode){
fo.addParam("wmode","opaque");
}
if(ad_eurl){
fo.addVariable("ad_eurl",ad_eurl);
}
fo.addVariable("enablejsapi",1);
player_written=fo.write(player_div);
}
function setSWFVersion(version_from_swf)
{
if(watchTrackWithHitbox){
_hbPageView("WatchSWFTracker/"+player_written,"FlashTracker3");
}
if(!player_written)
writeMoviePlayer("playerDiv",true);
}
function closeFullStats(){
toggleDisplay('watch-full-stats');
if(_gel('showhide')){
_gel('showhide').innerHTML='Show';
}
}
function toggleLinkStats(){
togglePanel(_gel('watch-refer-div'));
}
function toggleFullStats(){
togglePanel(_gel('watch-honors'));
if(_gel('additionalStatsDiv').innerHTML.toLowerCase().indexOf('<a')==-1){
showAjaxDivLoggedIn('additionalStatsDiv',additionalStatsHonorsUrl,false);
}
}
function toggleWatchMap(){
if(_gel('watch-map')){
togglePanel(_gel('watch-map'));
if(_gel('watch-map-div').src=="about:blank"){
_gel('watch-map-div').src=watchMapUrl;
}
}
}
function openFull(){
var fs=window.open(fullscreenUrl,
"FullScreenVideo","toolbar=no,width="+screen.availWidth+",height="+screen.availHeight
+",status=no,resizable=yes,fullscreen=yes,scrollbars=no");
fs.focus();
}
function isCurrentlyPlayingVideoInPlaylist(component){
var videosInPlaylist=getPlaylistVideoCount(component);
for(i=0;i<videosInPlaylist;i++){
var currentRow=_gel(getId('playlistRow',playnextFrom,i));
if(hasClass(currentRow,'watch-playlist-row-playing')){
return true;
}
}
}
function gotoNext(){
if(playnextFrom){
var nextRow=_gel(getId("playlistRow",playnextFrom,0));
var videosInPlaylist=getPlaylistVideoCount(playnextFrom);
for(i=0;i<videosInPlaylist;i++){
var currentRow=_gel(getId('playlistRow',playnextFrom,i));
if(hasClass(currentRow,'watch-playlist-row-playing')){
if(i+1<videosInPlaylist){
nextRow=_gel(getId('playlistRow',playnextFrom,i+1));
}else{
nextRow=null;
}
break;
}
}
if(nextRow){
window.location=getUrlFromPlaylistRow(nextRow)+"&playnext="+(parseInt(playnextCount)+1)+"&playnext_from="+playnextFrom;
}
}
}
var autoNextComponents=['PL','QL'];
function autoNext(suffix){
playnextFrom=suffix;
for(var i=0;i<autoNextComponents.length;i++){
if(autoNextComponents[i]==suffix){
showDiv(getId("playingall",autoNextComponents[i]));
hideDiv(getId("playall",autoNextComponents[i]));
}else{
hideDiv(getId("playingall",autoNextComponents[i]));
showDiv(getId("playall",autoNextComponents[i]));
}
}
var p=_gel("movie_player");
if(p.GetVariable("movie.is_playing")=="false"&&p.GetVariable("movie.restart")=="true"){
gotoNext();
}else if(!isCurrentlyPlayingVideoInPlaylist(suffix)){
gotoNext();
}else{
p.SetVariable("playnext","1");
}
return false;
}
function autoNextOff(suffix){
playnextFrom="";
_gel("movie_player").SetVariable("playnext","0");
showDiv(getId("playall",suffix));
hideDiv(getId("playingall",suffix));
return false;
}
function CheckLogin(){
return isLoggedIn;
}
function getId(baseId,component,index){
var id=baseId;
if(component!=null)
id+="_"+component;
if(index!=null)
id+="_"+index;
return id;
}
function onQuickAddClick(imgClicked,encryptedId){
imgClicked.blur();
var suffix='QL';
var videosInPlaylist=getPlaylistVideoCount(suffix);
var alreadyInList=false;
for(var i=0;i<videosInPlaylist;i++){
var videoRow=_gel(getId("playlistRow",suffix,i));
if(encryptedId==getNodeVideoId(videoRow)){
alreadyInList=true;
break;
}
}
if(!alreadyInList){
var newRow=_gel("playlistRow_placeholder_QL").cloneNode(true);
var videoCount=getPlaylistVideoCount("QL");
fillQuicklistRow(newRow,videoCount,"","pixel-vfl73.gif",MSG_Loading,"","");
removeClass(newRow,"hide");
setNodeVideoId(newRow,encryptedId);
addClass(newRow,"loading");
var rows=_gel("playlistRows_QL");
var lastRow=_gel(getId('playlistRow','QL',videoCount-1));
if(lastRow){
rows.insertBefore(newRow,lastRow.nextSibling);
}else{
rows.insertBefore(newRow,rows.firstChild);
}
scrollPlaylistToVideo('QL',videoCount);
if(incrementPlaylistVideoCount('QL',1)>4){
var containerNode=_gel(getId("playlistContainer",'QL'));
removeClass(containerNode,"watch-playlist-auto-height");
addClass(containerNode,"watch-playlist-fixed-height175");
}
}
clickedQuickAdd(imgClicked,encryptedId,alreadyInList);
urchinTracker('/VideoWatch/QuickList+AddTo');
showDiv('quicklistDiv');
return false;
}
function showPlaylist(component){
showDiv(getId("playlistOpen",component));
hideDiv(getId("playlistClosed",component));
return false;
}
function hidePlaylist(component){
showDiv(getId("playlistClosed",component));
hideDiv(getId("playlistOpen",component));
return false;
}
var delayLoadRegistry=[];
var delayLoadCompleted=[];
function delayLoad(id,img,src){
delayLoadRegistry[delayLoadRegistry.length]=[id,img,src];
delayLoadCompleted[id]=false;
}
function performDelayLoad(id){
if(!delayLoadCompleted[id]){
delayLoadCompleted[id]=true;
for(var i=0;i<delayLoadRegistry.length;i++){
if(delayLoadRegistry[i][0]==id){
delayLoadRegistry[i][1].onload="";
delayLoadRegistry[i][1].src=delayLoadRegistry[i][2];
}
}
}
}
var showAjaxDivNotLoggedIn=showAjaxDivLoggedIn;
function hideLinkingSitesCallback(){
hideDiv('referersList');
hideInline('hideLinkingSites');
showInline('showLinkingSites');
showInline('watch-linking-sites-disabled');
}
function hideLinkingSites(){
postUrlXMLResponse('/watch_ajax','action_hide_linking_sites=1&video_id='+pageVideoId+'&'+axc,hideLinkingSitesCallback);
return false;
}
function showLinkingSites(){
hideInline('watch-linking-sites-disabled');
showInline('hideLinkingSites');
hideInline('showLinkingSites');
showAjaxPostDivLoggedIn('referersList','/watch_ajax','action_show_linking_sites=1&video_id='+pageVideoId+'&'+axc);
return false;
}
function toggleChannelVideos(username){
if(!_gel('more_channel_videos')){
var callback=function(){addQLIcons(_gel('watch-more-from'));};
showAjaxDivLoggedIn('watch-more-from','/watch_ajax?user='+username+'&video_id='+pageVideoId+'&action_channel_videos',callback);
}
return false;
}
function showRelatedAsList(doAjaxCall){
if(doAjaxCall){
setInnerHTML('watch-related-vids-body',MSG_Loading);
var callback=function(){addQLIcons(_gel('watch-related-vids-body'));};
showAjaxDivLoggedIn('watch-related-vids-body',relatedVideoListUrl,callback);
}
removeClass(_gel('watch-related-vids-body'),'watch-discoverbox-grid-view');
addClass(_gel('watch-related-vids-body'),'watch-discoverbox-list-view');
showInline("btn-listview-on");
hideInline("btn-listview-off");
showInline("btn-gridview-off");
hideInline("btn-gridview-on");
return false;
}
function showRelatedAsGrid(){
removeClass(_gel('watch-related-vids-body'),'watch-discoverbox-list-view');
addClass(_gel('watch-related-vids-body'),'watch-discoverbox-grid-view');
performDelayLoad('related');
hideInline("btn-listview-on");
showInline("btn-listview-off");
hideInline("btn-gridview-off");
showInline("btn-gridview-on");
return false;
}
function showWatchboxAsList(boxIdKey){
removeClass(_gel('watch-related-vids-body'),'watch-discoverbox-grid-view');
addClass(_gel('watch-related-vids-body'),'watch-discoverbox-list-view');
showInline("btn-listview-on");
hideInline("btn-listview-off");
showInline("btn-gridview-off");
hideInline("btn-gridview-on");
return false;
}
function showWatchboxAsGrid(boxIdKey){
removeClass(_gel('watch-related-vids-body'),'watch-discoverbox-list-view');
addClass(_gel('watch-related-vids-body'),'watch-discoverbox-grid-view');
performDelayLoad('related');
hideInline("btn-listview-on");
showInline("btn-listview-off");
hideInline("btn-gridview-off");
showInline("btn-gridview-on");
return false;
}
var defaultRecipientFieldCount=2;
var recipientFieldNamePrefix="recipient";
var recipientFieldCount=defaultRecipientFieldCount;
var lastRecipientFieldId=recipientFieldNamePrefix+recipientFieldCount;
var maxRecipients=10;
function addRecipientFieldIfNeeded(field){
if(field.id==lastRecipientFieldId&&recipientFieldCount<maxRecipients){
newField=field.cloneNode(true);
recipientFieldCount++;
lastRecipientFieldId=recipientFieldNamePrefix+recipientFieldCount;
newField.id=lastRecipientFieldId;
newField.name=lastRecipientFieldId;
_gel('recipients').appendChild(newField);
}
}
function resetRecipients(){
recipientFieldCount=defaultRecipientFieldCount;
lastRecipientFieldId=recipientFieldNamePrefix+recipientFieldCount;
}
function consolidateRecipients(){
hiddenRecipientsField=_gel('recipients');
for(var i=1;i<=recipientFieldCount;i++){
hiddenRecipientsField.value+=(_gel(recipientFieldNamePrefix+""+i).value+",");
}
}
SHARED_RATINGS_INVITE_SHOW_MAX=5
SHARED_RATINGS_INVITE_REJECT_MAX=2
function displayRecentRatingsInvite(){
if(!readCookie("stop_shared_ratings_invite")){
showDiv("watch-recent-ratings-invite");
var timesShown=parseInt(readCookie("shared_ratings_invite_shown","0"));
timesShown=timesShown+1;
createCookie("shared_ratings_invite_shown",timesShown);
if(timesShown>=SHARED_RATINGS_INVITE_SHOW_MAX){
createCookie("stop_shared_ratings_invite","1");
}
}
}
SHARED_RATINGS_INVITE_SHOW_MAX=5
function rejectRecentRatings(){
var timesRejected=parseInt(readCookie("shared_ratings_invite_rejected","0"));
timesRejected=timesRejected+1;
createCookie("shared_ratings_invite_rejected",timesRejected);
if(timesRejected>=SHARED_RATINGS_INVITE_REJECT_MAX){
createCookie("stop_shared_ratings_invite","1");
}
}
function stopPropagation(e)
{
if(!e)var e=window.event;
e.cancelBubble=true;
if(e.stopPropagation)e.stopPropagation();
}
var subscribeTimer;
function subscribe(username,token,show_recommendations){
if(isLoggedIn){
clearTimeout(subscribeTimer);
postUrlXMLResponse('/ajax_subscriptions',
'subscribe_to_user='+username+'&session_token='+token+(show_recommendations?'&show_recommendations':''),
function(result){
var subscribeMsgNode=_gel('subscribeMessage');
subscribeMsgNode.innerHTML=getNodeValue(getRootNode(result),'html_content');
subscribeMsgNode.style.display='block';
addClass(subscribeMsgNode,'greenBG');
addClass(_gel('subscribeDiv'),'hid');
removeClass(_gel('unsubscribeDiv'),'hid');
if(!show_recommendations){
subscribeTimer=setTimeout("closeDisplay('subscribeMessage')",5000);
}
});
urchinTracker('/VideoWatch/Subscription/'+username+'/Loggedin');
}else{
var subscribeMsgNode=_gel('subscribeMessage');
addClass(subscribeMsgNode,'errorBox');
subscribeMsgNode.style.display='block';
urchinTracker('/VideoWatch/Subscription/'+username+'/Loggedout');
}
}
function unsubscribe(username,token){
clearTimeout(subscribeTimer);
postUrlXMLResponse('/ajax_subscriptions','unsubscribe_from_user='+username+'&session_token='+token,
function(result){
var subscribeMsgNode=_gel('subscribeMessage');
subscribeMsgNode.innerHTML=getNodeValue(getRootNode(result),'html_content');
subscribeMsgNode.style.display='block';
addClass(subscribeMsgNode,'greenBG');
removeClass(_gel('subscribeDiv'),'hid');
addClass(_gel('unsubscribeDiv'),'hid');
subscribeTimer=setTimeout("closeDisplay('subscribeMessage')",5000);
});
}
function flagError(elName,errorText){
if(elName){
_gel(elName).innerHTML=errorText;
toggleDisplay(elName);
}
}
function clearSelectionStyles(elName){
if(elName){
elName.style.backgroundColor='';
elName.style.color='';
}
}
function setSelectionStyles(elName){
if(elName){
elName.style.backgroundColor='#6681ba';
elName.style.color='#fff';
}
}
function hideLinkingSiteCallback(){
hideInline('referersList');
showInline('referersList');
}
function hideLinkingSite(video_id,site){
showAjaxPostDivLoggedIn('referersList','/watch_ajax','action_hide_linking_site=1&video_id='+video_id+'&url='+site+'&'+axc,hideLinkingSiteCallback);
return false;
}
function showLinkingSite(video_id,site){
showAjaxPostDivLoggedIn('referersList','/watch_ajax','action_show_linking_site=1&video_id='+video_id+'&url='+site+'&'+axc,hideLinkingSiteCallback);
return false;
}
function checkCurrentVideo(videoId)
{
if(pageVideoId!=videoId){
window.location.href="/watch?v="+videoId;
}
}
var selectedThemeColor='blank';
function onChangeColor(color){
var oldTheme=document.getElementById('theme_color_'+selectedThemeColor+'_img');
var newTheme=document.getElementById('theme_color_'+color+'_img');
yt.UserPrefs.set('emt',color);
yt.UserPrefs.save();
removeClass(oldTheme,'radio_selected');
addClass(newTheme,'radio_selected');
selectedThemeColor=color;
onUpdatePreviewImage();
return false;
}
function generateEmbed(){
var query='';
if(yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_EMBED_INCLUDE_RELATED_VIDEOS)){
query+='&rel=0';
}
var color=yt.UserPrefs.get('emt');
if(color!='blank'&&color!=''){
var hexColors=gCustomEmbedThemes[color].split(' ');
query+='&color1=0x'+hexColors[0]+'&color2=0x'+hexColors[1];
}
var showBorder=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_EMBED_SHOW_BORDER);
query+=showBorder?'&border=1':'';
var height=(showBorder?373:355);
var embedCode='<object width="425" height="'+height+'"><param name="movie" value="'+embedUrl+query+'"><\/param><param name="wmode" value="transparent"><\/param><embed src="'+embedUrl+query+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="'+height+'"><\/embed><\/object>';
document.embedForm.embed_code.value=embedCode;
}
function onUpdatePreviewImage(){
var previewImage=document.getElementById('watch-customize-embed-theme-preview');
var showBorderCheckBox=document.getElementById('show_border_checkbox');
var border=(!showBorderCheckBox.checked?'_nb':'');
previewImage.src='img/preview_embed_'+selectedThemeColor+'_sm'+border+'.gif';
}
function applyUserPrefs(){
if(_gel('watch-customize-embed-theme')){
var showBorderCheckBox=_gel('show_border_checkbox');
showBorderCheckBox.checked=yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_EMBED_SHOW_BORDER);
if(!yt.UserPrefs.getFlag(yt.UserPrefs.Flags.FLAG_EMBED_INCLUDE_RELATED_VIDEOS)){
_gel('embedCustomization1').checked=true;
}else{
_gel('embedCustomization0').checked=true;
}
var color=yt.UserPrefs.get('emt');
if(color!='blank'&&color!=''){
onChangeColor(color);
}
}
if(_gel('watch-customize-embed-div')){
generateEmbed();
}
}
function onChangeBorder(border){
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_EMBED_SHOW_BORDER,(!!border));
yt.UserPrefs.save();
onUpdatePreviewImage();
}
function onChangeRelated(related){
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_EMBED_INCLUDE_RELATED_VIDEOS,!related);
yt.UserPrefs.save();
}
function signup(){
var win=window;
if(window.opener){
win=window.opener;
window.setTimeout(function(){window.close();},1);
}
win.location.href="/signup?next_url="+encodeURIComponent(win.location.href.replace(/http:\/\/[^\/]*/,""));
}
function readPanelState(){
return;
}
function savePanelState(){
if(ref('watch-video-details')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_EXPAND_ABOUT_PANEL,isPanelExpanded(ref('watch-video-details')));}
if(ref('more-from-panel')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_EXPAND_MOREFROM_PANEL,isPanelExpanded(ref('more-from-panel')));}
if(ref('watch-related-videos-panel')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_COLLAPSE_RELATED_PANEL,!isPanelExpanded(ref('watch-related-videos-panel')));}
if(ref('playlist-panel')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_COLLAPSE_PLAYLIST_PANEL,!isPanelExpanded(ref('playlist-panel')));}
if(ref('quicklist-panel')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_COLLAPSE_QUICKLIST_PANEL,!isPanelExpanded(ref('quicklist-panel')));}
if(ref('watch-active-sharing')){yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_EXPAND_ALSOWATCHING_PANEL,isPanelExpanded(ref('watch-active-sharing')));}
yt.UserPrefs.save();
}
function redirectToQuicklistFromWatch(){
autoNext('QL');
}
function setCompanion(ad_tag,show_ad)
{
var ord=Math.random()*10000000000000000;
if(show_ad=='true'){
ad_tag=ad_tag+"?";
openDiv("watch-channel-brand-div");
_gel("ad300x250").innerHTML='<iframe src="'+ad_tag+'" name="ifr_300x250ad" id="ifr_300x250ad" width="300" height="250" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>'+'<'+'/iframe>';
}
}
function setCompanionError()
{
var ord=Math.random()*10000000000000000;
var watchDCDefaultAd=gCompanionAdUrl+'ord='+ord+'?';
openDiv("watch-channel-brand-div");
_gel("ad300x250").innerHTML='<iframe src="'+watchDCDefaultAd+'" name="ifr_300x250ad" id="ifr_300x250ad" width="300" height="250" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>'+'<'+'/iframe>';
}
yt.VideoQualityConstants={
AUTO:0,
LOW:1,
HIGH:2
}
var playerVideoQuality=yt.VideoQualityConstants.AUTO;
function onPlayerFormatChanged(format,vq){
playerVideoQuality=vq;
updateVideoQualitySettings();
}
function updateVideoQualitySettings(){
var videoQualitySettingsElm=_gel("watch-video-quality-setting");
if(videoQualitySettingsElm&&playerVideoQuality&&playerVideoQuality!=yt.VideoQualityConstants.AUTO){
removeClass(videoQualitySettingsElm,"high");
if(playerVideoQuality==yt.VideoQualityConstants.HIGH){
addClass(videoQualitySettingsElm,"high");
}
}
}
function checkVideoQualitySettings(){
var p=_gel("movie_player");
if(p){
var vq=p.GetVariable("vq");
if(vq&&vq!=playerVideoQuality){
playerVideoQuality=vq;
updateVideoQualitySettings();
}
}
setTimeout("checkVideoQualitySettings()",500);
}
function changeVideoQuality(quality){
var p=_gel("movie_player");
p.SetVariable("setVideoQuality",quality);
}
function watchSelectTab(tab){
var el=tab.parentNode.firstChild;
while(el){
removeClass(el,'watch-tab-sel');
el=el.nextSibling;
}
addClass(tab,'watch-tab-sel');
el=_gel(tab.id+'-body').parentNode.firstChild;
while(el){
removeClass(el,'watch-tab-sel');
el=el.nextSibling;
}
addClass(_gel(tab.id+'-body'),'watch-tab-sel')
}
var gExpandedStats=false;
function watchExpandStatBody(){
if(gExpandedStats){
return;
}
toggleFullStats();
toggleWatchMap();
gExpandedStats=true;
}
function recordServiceUsage(service_name,video_id){
getUrl("/sharing_services?name="+encodeURIComponent(service_name)+"&v="+video_id,true);
}
function watchBetaPlayer(on){
yt.UserPrefs.setFlag(yt.UserPrefs.Flags.FLAG_WATCH_BETA_PLAYER,on);
yt.UserPrefs.save();
}
function trackEvent(action,opt_label,opt_value){
annotationsTracker._trackEvent(action,opt_label,opt_value);
}
function trackAnnotationsEvent(action,opt_label,opt_value){
annotationsTracker._trackEvent(action,opt_label,opt_value);
}
function onYouTubePlayerReady(playerId){
player=document.getElementById("movie_player");
player.addEventListener("onStateChange","handleWatchPagePlayerStateChange");
}
function handleWatchPagePlayerStateChange(newState){
if(newState==0){
gotoNext();
}
}
var videolist=new Array();
var removelist=new Array();
var qlUIEnabled=false;
function initWatchQueue(isUIEnabled){
qlUIEnabled=isUIEnabled;
}
function clearWatchQueue(){
postUrlXMLResponse("/watch_queue_ajax","&action_clear_queue",watchQueueCleared);
var suffix="QL";
var videosInPlaylist=getPlaylistVideoCount(suffix);
decrementPlaylistVideoCount(suffix,videosInPlaylist);
for(var i=videosInPlaylist-1;i>=0;i--){
var videoRow=_gel(getId("playlistRow",suffix,i));
videoRow.parentNode.removeChild(videoRow);
}
var container=_gel(getId("playlistContainer",suffix));
addClass(container,"watch-playlist-auto-height");
removeClass(container,"watch-playlist-fixed-height175");
videolist=new Array();
removelist=new Array();
for(var i=0;i<quickAddDoneList.length;i++){
removeClass(quickAddDoneList[i],'QLIconImgOver');
removeClass(quickAddDoneList[i],'QLIconImgDone');
addClass(quickAddDoneList[i],'QLIconImg');
}
quickAddDoneList=new Array();
hideDiv("quicklistDiv");
var qUtil=getQuicklistUtility();
if(qUtil){
qUtil.innerHTML="0";
quicklistMastheadBlink();
}
}
function watch_remove_from_watch_queue(video_id){
removelist.push(video_id);
watch_delete_videos_from_server();
return false;
}
var qlIsEditing=false;
function watch_post_videos_to_server(){
if(videolist.length>0&&!qlIsEditing){
qlIsEditing=true;
var queryParams="&action_add_to_queue&video_id="+videolist.shift();
if(qlUIEnabled){
queryParams+="&ui=1"
}
var request=new getUrlXMLResponseJSON("/watch_queue_ajax?"+queryParams,watchVideoQueued);
}
}
var isRemoving=false;
function watch_delete_videos_from_server(){
if(removelist.length>0){
isRemoving=true;
postUrlXMLResponse("/watch_queue_ajax","&action_remove_from_queue&video_id="+removelist[removelist.length-1],self.watchVideoRemoved);
removelist.pop();
}
isRemoving=false;
if(delayedCompletePlaylistLoad){
completePlaylistLoad();
}
}
function watchQueueCleared(xmlHttpRequest){
}
function watchVideoQueued(videos){
qlIsEditing=false;
if(qlUIEnabled){
if(videos){
handleWatchQueueGet(videos);
}
}
watch_post_videos_to_server();
}
function watchVideoRemoved(xmlHttpRequest){
watch_delete_videos_from_server();
}
function watch_clicked_add_icon(video_ID,fromRelated){
_gel(button_name).blur();
}
var autoScrolledTo=null;
function scrollPlaylistToVideo(suffix,index){
var videoRow=_gel(getId('playlistRow',suffix,index));
_gel(getId("playlistContainer",suffix)).scrollTop=videoRow.offsetTop;
autoScrolledTo=_gel(getId("playlistContainer",suffix)).scrollTop;
}
function registerPlaylistAutoload(component){
if(component=='QL'&&qlAutoscrollDestination>0){
scrollPlaylistToVideo(component,qlAutoscrollDestination);
}
_gel(getId('playlistContainer',component)).onscroll=completePlaylistLoad;
if(autoScrolledTo&&autoScrolledTo!=_gel(getId("playlistContainer",'QL')).scrollTop){
completePlaylistLoad();
}
}
function clickedQuickAdd(img,videoId,alreadyInList){
quickAddDoneList[quickAddDoneList.length]=img;
removeClass(img,'QLIconImg');
removeClass(img,'QLIconImgOver');
addClass(img,'QLIconImgDone');
if(!alreadyInList){
videolist.push(videoId);
watch_post_videos_to_server();
var qUtil=getQuicklistUtility();
if(qUtil){
qUtil.innerHTML=parseInt(qUtil.innerHTML)+1;
}
}
var target=_gel("playlistContainer_QL");
if(!target||!target.offsetParent)
{
target=_gel('quicklist-utility');
}
}
var quickAddDoneList=new Array();
function getUrlFromPlaylistRow(rowNode){
var links=rowNode.getElementsByTagName('a');
return links[0].href;
}
function watchRemoveVideo(suffix,playlistRow){
var playlistRow=findAncestorByClass(playlistRow,"watch-playlist-row");
var vid=getNodeVideoId(playlistRow);
playlistRow.parentNode.removeChild(playlistRow);
var newIndex=0;
var videos=getPlaylistVideoCount(suffix);
for(var i=0;i<videos;i++){
var row=_gel(getId("playlistRow",suffix,i));
var index=_gel(getId("playlistRowIndex",suffix,i));
if(row){
row.id=getId("playlistRow",suffix,newIndex);
index.id=getId("playlistRowIndex",suffix,newIndex);
index.innerHTML=newIndex+1;
newIndex++;
}
}
var newCount=decrementPlaylistVideoCount(suffix,1);
watch_remove_from_watch_queue(vid);
var containerNode=_gel(getId("playlistContainer",'QL'));
if(newCount==0){
hidePlaylist(suffix);
}else if(newCount<4){
addClass(containerNode,"watch-playlist-auto-height");
removeClass(containerNode,"watch-playlist-fixed-height175");
}
if(containerNode.onscroll){
containerNode.onscroll();
}
var qUtil=getQuicklistUtility();
if(qUtil){
qUtil.innerHTML=parseInt(qUtil.innerHTML)-1;
quicklistMastheadBlink();
}
}
var delayedCompletePlaylistLoad=false;
function completePlaylistLoad(){
if(!isRemoving){
suffix="QL";
_gel('playlistContainer_'+suffix).onscroll="";
request=new getUrlXMLResponseJSON("/watch_queue_ajax?v="+pageVideoId+"&action_get_all_queue_videos_component=1&all=1&watch3=1",handleWatchQueueGet);
}else{
delayedCompletePlaylistLoad=true;
}
}
function handleWatchQueueGet(videos){
for(var i=0;i<videos.length;i++){
if(videos[i]){
var newRow=_gel("playlistRow_placeholder_QL").cloneNode(true);
removeClass(newRow,"hide");
videos[i].unshift(newRow);
fillQuicklistRow.apply(this,videos[i]);
newRow.id=getId("playlistRow","QL",videos[i][1]);
var oldNode=_gel(newRow.id);
if(hasClass(oldNode,"loading")){
oldNode.parentNode.replaceChild(newRow,oldNode);
}
}
}
}
function getPlaylistVideoCount(component){
return parseInt(_gel('playlistVideoCount_'+component).innerHTML);
}
function incrementPlaylistVideoCount(component,increment_by){
var node=_gel('playlistVideoCount_'+component);
node.innerHTML=parseInt(node.innerHTML)+increment_by;
return parseInt(node.innerHTML);
}
function decrementPlaylistVideoCount(component,decrement_by){
return incrementPlaylistVideoCount(component,-1*decrement_by);
}
function getNodeVideoId(node){
return getStoredValue(node,"v")
}
function setNodeVideoId(node,id){
return setStoredValue(node,"v",id)
}
function getStoredValue(node,name){
var classes=getClassList(node);
var pattern=classNameForNameValue(name,'');
var found=false;
for(var i=0;i<classes.length;i++){
if(classes[i].substr(0,pattern.length)==pattern){
return classes[i].substr(pattern.length,classes[i].length-pattern.length);
}
}
return '';
}
function setStoredValue(node,name,value){
var classes=getClassList(node);
var pattern=classNameForNameValue(name,'');
var found=false;
for(var i=0;i<classes.length;i++){
if(classes[i].substr(0,pattern.length)==pattern){
classes[i]=classNameForNameValue(name,value);
found=true;
}
}
if(!found){
classes.push(classNameForNameValue(name,value));
}
node.className=classes.join(' ');
}
function classNameForNameValue(name,value){
return name+"*"+value;
}
function TemplateParameters(params){
this.addParameter=addParameter;
this.applyToNode=applyToNode;
this.fill=fill;
this.parameters=new Object();
for(var i=0;i<params.length;i++){
this.addParameter(params[i][0],params[i][1],params[i][2]);
}
function Parameter(attrName,value){
this.attrName=attrName;
this.value=value;
}
function addParameter(className,attrName,value){
if(!this.parameters[className]){
this.parameters[className]=new Array();
}
this.parameters[className].push(new Parameter(attrName,value));
}
function applyToNode(node){
var classList=getClassList(node);
for(var i=0;i<classList.length;i++){
var applyList=this.parameters[classList[i]];
if(applyList){
for(var j=0;j<applyList.length;j++){
if(typeof(applyList[j].value)=="function"){
node[applyList[j].attrName]=applyList[j].value();
}else{
node[applyList[j].attrName]=applyList[j].value;
}
}
}
}
}
function fill(node){
for(var i=0;i<node.childNodes.length;i++){
this.fill(node.childNodes[i]);
}
this.applyToNode(node);
}
}
function fillQuicklistRow(rowDiv,index,videoUrl,imgSrc,title,username,duration,videoId){
var params=new TemplateParameters(
[['watch-playlist-row','id',getId("playlistRow","QL",index)],
['watch-playlist-row','class',function(node){setNodeVideoId(rowDiv,videoId)}],
['phIndex','id',getId("playlistRowIndex","QL",index)],
['phIndex','innerHTML',index+1],
['watch-playlist-row-link','href',videoUrl],
['vimg50','src',imgSrc],
['vtitle','innerHTML',title],
['phUsername','innerHTML',username],
['watch-playlist-item-duration','innerHTML',duration]]);
params.fill(rowDiv);
}
function quickListShowRelated(node){
getUrlXMLResponseAndFillDiv('/related_ajax?view_type=L&watch3=1&video_id='+
getNodeVideoId(findAncestorByClass(node,"watch-playlist-row")),
'watch-related-vids-body',
function(){addQLIcons(_gel('watch-related-vids-body'));});
}
var gQuicklistTimeoutId;
function quicklistMastheadBlink(){
if(gQuicklistTimeoutId){
clearTimeout(gQuicklistTimeoutId);
gQuicklistTimeoutId=null;
}
quicklistMastheadBlinkHelper(1);
}
function quicklistMastheadBlinkHelper(on){
var qUtil=getQuicklistUtility();
qUtil.style.backgroundColor=on%2?'#ff0':'#fff';
++on;
if(on<=10){
gQuicklistTimeoutId=setTimeout(function(){quicklistMastheadBlinkHelper(on);},500);
}
}
function getQuicklistUtility(){
return self.utilLinksFrame?self.utilLinksFrame.document.getElementById('quicklist-utility'):_gel('quicklist-utility');
}
var quicklistVideoIds=[];
function clicked_add_icon(video_ID,fromRelated){
for(var x=0;x<quicklistVideoIds.length;++x){
if(quicklistVideoIds[x]==video_ID){
return;
}
}
var qUtil=getQuicklistUtility();
if(qUtil){
qUtil.innerHTML=parseInt(qUtil.innerHTML)+1;
}
quicklistVideoIds.push(video_ID);
add_to_watch_queue(video_ID);
var button=_gel('add_button_'+video_ID);
removeClass(button,'QLIconImg');
removeClass(button,'QLIconImgOver');
addClass(button,'QLIconImgDone');
button.blur();
}
function add_to_watch_queue(video_id){
videolist.push(video_id);
post_videos_to_server();
return false;
}
function post_videos_to_server(){
if(videolist.length>0){
postUrlXMLResponse("/watch_queue_ajax","&action_add_to_queue&video_id="+videolist[videolist.length-1],self.videoQueued);
videolist.pop();
}
}
function videoQueued(xmlHttpRequest){
xmlObj=xmlHttpRequest.responseXML;
if(xmlObj!=null&&getNodeValue(xmlObj,"msg")!="exists"){
post_videos_to_server();
}
}
function remove_from_watch_queue(video_id){
removelist.push(video_id);
delete_videos_from_server();
return false;
}
function delete_videos_from_server(){
if(removelist.length>0){
postUrlXMLResponse("/watch_queue_ajax","&action_remove_from_queue&video_id="+removelist[removelist.length-1],self.videoRemoved);
removelist.pop();
}
}
function videoRemoved(xmlHttpRequest){
delete_videos_from_server();
}
function clear_watch_queue(){
postUrlXMLResponse("/watch_queue_ajax","&action_clear_queue",function(){window.location="watch_queue?all";});
}
function set_pop_status(pop_status){
postUrlXMLResponse("/watch_queue_ajax","action_set_pop_status&pop_videos="+pop_status,function(){})
}
var imageBrowsers=new Object();
var images_loaded=false;
function shiftLeft(bar_id){
if(images_loaded==false){
return;
}
imageBrowsers[bar_id].shiftPageLeft();
imageBrowsers[bar_id].showImages();
}
function shiftRight(bar_id){
if(images_loaded==false){
return;
}
imageBrowsers[bar_id].shiftPageRight();
imageBrowsers[bar_id].showImages();
}
function ImageBrowser(display_count,step_size,root_div_id){
this.display_count=display_count;
this.step_size=step_size;
this.root_div_id=root_div_id;
this.display_array=new Array();
this.addImage=imageBrowserAddImage;
this.initDisplay=imageBrowserInitDisplay;
this.shiftPageLeft=imageBrowserShiftPageLeft;
this.shiftPageRight=imageBrowserShiftPageRight;
this.shiftLeft=imageBrowserShiftLeft;
this.shiftRight=imageBrowserShiftRight;
this.showImages=imageBrowserShowImages;
this.prefetchNextPrevImages=imageBrowserPrefetchNextPrevImages;
this.printPageNumbers=imageBrowserPrintPageNumbers;
this.incrementIndex=imageBrowserIncrementIndex;
this.decrementIndex=imageBrowserDecrementIndex;
}
function imageBrowserAddImage(ytImg){
if(!this.images){
var images=new Array();
this.images=images;
}
this.images.push(ytImg);
}
function imageBrowserInitDisplay(){
this.real_images_count=this.images.length;
var empty_slots=this.display_count-(this.images.length%this.display_count);
if(empty_slots!=this.display_count){
for(var i=0;i<empty_slots;i++){
this.addImage(new ytImage("pixel-vfl73.gif","","&nbsp;","","&nbsp;","",true));
}
}
for(var i=0;i<this.display_count;i++){
this.display_array[i]=this.images[i];
}
this.head_index=0;
this.tail_index=this.display_array.length-1;
}
function imageBrowserIncrementIndex(index){
index=index+1;
if(index>this.images.length-1){
index=0;
}
return index;
}
function imageBrowserDecrementIndex(index){
index=index-1;
if(index<0){
index=this.images.length-1;
}
return index;
}
function imageBrowserShiftPageRight(){
for(var i=0;i<this.display_array.length;i++){
this.shiftRight();
}
}
function imageBrowserShiftPageLeft(){
for(var i=0;i<this.display_array.length;i++){
this.shiftLeft();
}
}
function imageBrowserShiftRight(){
for(var i=0;i<this.display_array.length;i++){
this.display_array[i]=this.display_array[i+1];
}
this.head_index=this.incrementIndex(this.head_index);
this.tail_index=this.incrementIndex(this.tail_index);
this.display_array[this.display_array.length-1]=this.images[this.tail_index];
}
function imageBrowserShiftLeft(){
for(var i=this.display_array.length-1;i>0;i--){
this.display_array[i]=this.display_array[i-1];
}
this.head_index=this.decrementIndex(this.head_index);
this.tail_index=this.decrementIndex(this.tail_index);
this.display_array[0]=this.images[this.head_index];
}
function imageBrowserShowImages(){
for(var i=0;i<this.display_array.length;i++){
tempDivId="img_"+this.root_div_id+"_"+i;
block=document.getElementById("img_"+this.root_div_id+"_"+i);
title1=document.getElementById("title1_"+this.root_div_id+"_"+i);
title2=document.getElementById("title2_"+this.root_div_id+"_"+i);
title3=document.getElementById("title3_"+this.root_div_id+"_"+i);
block.src=this.display_array[i].getImage();
title1.innerHTML=this.display_array[i].title1;
title2.innerHTML="<span style='color: #333'>"+this.display_array[i].title2+"</span>";
if(title3!=null){
title3.innerHTML="<span style='color: #666'>"+this.display_array[i].title3+"</span>";
}
imgUrl=document.getElementById("href_"+this.root_div_id+"_"+i);
imgUrl.href=this.display_array[i].imageUrl;
if(this.display_array[i].id){
block.setAttribute('qlicon',this.display_array[i].id);
}
if(imgUrl.nextSibling&&imgUrl.nextSibling.nextSibling&&imgUrl.nextSibling.nextSibling.className=='addtoQL90'){
imgUrl.parentNode.removeChild(imgUrl.nextSibling.nextSibling);
}
maindiv=document.getElementById("div_"+this.root_div_id+"_"+i);
maindiv_alternate=document.getElementById("div_"+this.root_div_id+"_"+i+"_alternate");
if(this.display_array[i].is_dummy!=false){
maindiv.style.display="none";
maindiv_alternate.style.display="";
}else{
maindiv.style.display="";
maindiv_alternate.style.display="none";
}
addQLIcons(maindiv);
}
this.printPageNumbers();
}
function imageBrowserPrefetchNextPrevImages(){
prev_index=this.decrementIndex(this.head_index);
this.images[prev_index].loadImage();
next_index=this.incrementIndex(this.tail_index);
this.images[next_index].loadImage();
}
function imageBrowserPrintPageNumbers(){
var counter_index=this.head_index;
for(var i=0;i<this.display_array.length;i++){
counter_index=this.incrementIndex(counter_index);
}
if(counter_index==0){
counter_index=this.real_images_count;
}
counter_div=document.getElementById("counter_"+this.root_div_id);
if(counter_div){
counter_div.innerHTML="["+(this.head_index+1)+" - "+counter_index+" of "+this.real_images_count+"]";
}
}
function ytImage(imgSrc,imgUrl,title1,title1Url,title2,title2Url,title3,is_dummy){
this.smartImage=new smartImageObject(imgSrc,false);
this.imageUrl=imgUrl;
this.is_dummy=is_dummy;
this.title1_full=title1.replace("'","&quot");
this.title2_full=title2.replace("'","&quot");
var max_len=20;
if(title1.length>max_len)
title1=title1.substring(0,max_len-3)+"..."
if(title2.length>max_len)
title2=title2.substring(0,max_len-3)+"..."
if(title3.length>max_len)
title3=title3.substring(0,max_len-3)+"..."
this.title3=title3
if(title1Url.length>0)
this.title1="<a href='"+title1Url+"' title='"+this.title1_full+"'>"+title1+"</a>";
else
this.title1=title1;
if(title2Url.length>0)
this.title2="<a class='dg' href='"+title2Url+"' title='"+this.title2_full+"'>"+title2+"</a>";
else
this.title2=title2;
this.getImage=ytGetImageFromSmartImage;
this.isImageLoaded=ytIsImageLoaded;
this.loadImage=ytLoadImage
}
function customYtImage(imgSrc,imgUrl,title1,title2,title3,is_dummy,id){
this.smartImage=new smartImageObject(imgSrc,false);
this.imageUrl=imgUrl;
this.is_dummy=is_dummy;
this.id=id;
this.title1=title1;
this.title2=title2;
this.title3=title3;
this.getImage=ytGetImageFromSmartImage;
this.isImageLoaded=ytIsImageLoaded;
this.loadImage=ytLoadImage
}
function ytGetImageFromSmartImage(){
return this.smartImage.getImage();
}
function ytIsImageLoaded(){
return this.smartImage.isImageLoaded();
}
function ytLoadImage(){
if(!this.isImageLoaded()){
}
}
function smartImageObject(imgURI,preload){
this.URI=imgURI;
this.imageobj=null;
this.load=smartImageObjectLoad;
this.getImage=smartImageObjectGetImage;
this.isImageLoaded=smartImageIsImageLoaded;
if(preload){
}
}
function smartImageIsImageLoaded(){
if(this.imageobj!=null)
return true;
else
return false;
}
function smartImageObjectLoad(){
this.imageobj=new Image();
this.imageobj.src=this.URI;
}
function smartImageObjectGetImage(){
if(this.imageobj){
return this.imageobj.src;
}else{
return this.URI;
}
}
function opacity(id,opacStart,opacEnd,millisec){
var speed=Math.round(millisec/ 100);
var timer=0;
if(opacStart>opacEnd){
for(i=opacStart;i>=opacEnd;i--){
setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));
timer++;
}
}else if(opacStart<opacEnd){
for(i=opacStart;i<=opacEnd;i++)
{
setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));
timer++;
}
}
}
function changeOpac(opacity,id){
var object=document.getElementById(id).style;
object.opacity=(opacity/ 100);
object.MozOpacity=(opacity/ 100);
object.KhtmlOpacity=(opacity/ 100);
object.filter="alpha(opacity="+opacity+")";
}
function fadeOldImage(id,numColumns){
for(i=0;i<numColumns;i++){
tempDiv="img_"+id+"_"+i;
changeOpac(25,tempDiv);
}
}
(function(){
function checkRef(ref){
var a=ref.split('/',3);
if(a.length>=3&&a[0]=='http:'&&a[1]==''){
a=a[2].split('.').reverse();
if(a.length<2)return false;
var d0=a[0];
var d1=a[1];
if(d1=='youtube'&&d0=='com')return true;
if(d1=='google')return true;
if(a.length<3)return false;
if(a[2]=='google'&&((d1=='co'&&d0=='uk')||(d1=='com'&&d0=='au')))return true;
}
return false;
}
if(window!=window.top){
var ref=document.referrer;
if(!checkRef(ref)){
var data='location='+encodeURIComponent(ref)+'&self='+encodeURIComponent(window.location.href);
postUrl('/roger_rabbit',data,true,processReqChange);
}
}
function processReqChange(req){
if(req.readyState==4){
if(req.status==200){
if(req.responseText=='block'){
window.top.location.href='/';
}
}
}
}
})();
if(yt&&yt.UserPrefs){
yt.UserPrefs.Flags={
FLAG_SAFE_SEARCH:0x1,
FLAG_GRID_VIEW_SEARCH_RESULTS:0x2,
FLAG_EMBED_INCLUDE_RELATED_VIDEOS:0x4,
FLAG_EMBED_SHOW_BORDER:0x8,
FLAG_GRID_VIEW_VIDEOS_AND_CHANNELS:0x10,
FLAG_WATCH_EXPAND_ABOUT_PANEL:0x20,
FLAG_WATCH_EXPAND_MOREFROM_PANEL:0x40,
FLAG_WATCH_COLLAPSE_RELATED_PANEL:0x80,
FLAG_WATCH_COLLAPSE_PLAYLIST_PANEL:0x100,
FLAG_WATCH_COLLAPSE_QUICKLIST_PANEL:0x200,
FLAG_WATCH_EXPAND_ALSOWATCHING_PANEL:0x400,
FLAG_WATCH_EXPAND_RESERVED:0x800,
FLAG_STATMODULES_INBOX_COLLAPSED:0x1000,
FLAG_STATMODULES_ABOUTYOU_COLLAPSED:0x2000,
FLAG_STATMODULES_ABOUTVIDEOS_COLLAPSED:0x4000,
FLAG_PERSONALIZED_HOMEPAGE_EXPERIMENT:0x8000,
FLAG_PERSONALIZED_HOMEPAGE_FEED_FEATURED_COLLAPSED:0x10000,
FLAG_PERSONALIZED_HOMEPAGE_FEED_RECOMMENDED_COLLAPSED:0x20000,
FLAG_PERSONALIZED_HOMEPAGE_FEED_SUBSCRIPTIONS_COLLAPSED:0x40000,
FLAG_PERSONALIZED_HOMEPAGE_FEED_POPULAR_COLLAPSED:0x80000,
FLAG_PERSONALIZED_HOMEPAGE_FEED_FRIENDTIVITY_COLLAPSED:0x100000,
FLAG_SUGGEST_ENABLED:0x200000,
FLAG_HAS_SUGGEST_ENABLED:0x400000,
FLAG_WATCH_BETA_PLAYER:0x800000
}
}
var gCustomEmbedThemes={'blank':'d6d6d6 f0f0f0','storm':'3a3a3a 999999','iceberg':'2b405b 6b8ab6','acid':'006699 54abd6','green':'234900 4e9e00','orange':'e1600f febd01','pink':'cc2550 e87a9f','purple':'402061 9461ca','rubyred':'5d1719 cd311b'};
function dynamic_append_session_token(form_obj,session_token)
{
var token=undefined;
if(session_token==null)
{
token=gXSRF_token;
}
else
{
token=session_token;
}
var token_elem=document.createElement('input');
token_elem.setAttribute('name',gXSRF_field_name);
token_elem.setAttribute('type','hidden');
token_elem.setAttribute('value',token);
form_obj.appendChild(token_elem);
}
session_excluded_forms=new Array();
function populate_session_token()
{
for(var form_pos=0;form_pos<document.forms.length;form_pos++)
{
var skip=false;
for(var exclude_pos=0;
exclude_pos<session_excluded_forms.length;
exclude_pos++)
{
if(document.forms[form_pos].name
==session_excluded_forms[exclude_pos])
{
skip=true;
}
}
var aform=document.forms[form_pos];
if((aform.method.toLowerCase()=='post')&&(skip==false))
{
var found=false;
for(var elem_pos=0;elem_pos<aform.elements.length;
elem_pos++)
{
var form_field=aform.elements[elem_pos];
if(form_field.name==gXSRF_field_name)
{
found=true;
}
}
if(!found)
{
dynamic_append_session_token(aform);
}
}
}
}
(function(){
YT_php_support=function(){
this.default_ordering_=[];
this.ordering_=[];
this.isIE_=document.all&&navigator.userAgent.toLowerCase().indexOf('msie')!=-1;
}
window.YT_php_support=YT_php_support;
YT_php_support.prototype.add_module=function(mod){
this.default_ordering_.push(mod);
}
YT_php_support.prototype.init=function(){
this.update_ordering();
this.reset_updown_buttons();
}
YT_php_support.prototype.adjust_module=function(cmd,dir){
var url="/iyt?module="+cmd+"&dir="+dir;
getUrl(url,true,function(xmlHttpRequest){
if(xmlHttpRequest.readyState==4){
if(xmlHttpRequest.status==200){
}
}
});
}
YT_php_support.prototype.update_ordering=function(){
this.ordering_=[];
for(o in this.default_ordering_){
var order=this.default_ordering_[o];
var module_anchor=_gel("feedmodule-"+order);
if(module_anchor){
this.ordering_.push(order);
}
}
}
YT_php_support.prototype.indexof=function(arr,obj){
for(i in arr){
if(arr[i]==obj){
return i-0;
}
}
return-1;
}
YT_php_support.prototype.reset_updown_buttons=function(){
for(o in this.ordering_){
var order=this.ordering_[o];
var up_btn=_gel("mup-"+order);
var down_btn=_gel("mdown-"+order);
if(o!=0){
up_btn.style.display="inline";
}else{
up_btn.style.display="none";
}
var order_len=this.ordering_.length;
if(o!=(order_len-1)){
down_btn.style.display="inline";
}else{
down_btn.style.display="none";
}
var up_arrow=_gel("mup-arrow-"+order);
var down_arrow=_gel("mdown-arrow-"+order);
up_arrow.style.display="none";
down_arrow.style.display="none";
}
}
YT_php_support.prototype.move_module=function(type,dir){
var cur_pos=this.indexof(this.ordering_,type);
var next=cur_pos+1;
if(dir=='up'){
next=cur_pos-1;
}
var anchor=_gel("feedmodule-"+type);
var next_anchor=_gel("feedmodule-"+this.ordering_[next]);
if(!anchor)return;
if(!next_anchor)return;
var swap=this.ordering_[cur_pos];
this.ordering_[cur_pos]=this.ordering_[next];
this.ordering_[next]=swap;
this.adjust_module(type,dir);
if(this.isIE_){
this.slideSwap(anchor,next_anchor,dir);
}else{
this.fadeSwap(anchor,next_anchor,dir);
}
this.reset_updown_buttons();
}
YT_php_support.prototype.swap_anchors=function(anchor,next_anchor,dir){
if(dir=='up'){
next_anchor.parentNode.insertBefore(anchor,next_anchor);
}else{
anchor.parentNode.insertBefore(next_anchor,anchor);
}
}
YT_php_support.prototype.fadeSwap=function(anchor,next_anchor,dir){
this.make_transparent(anchor);
this.make_transparent(next_anchor);
this.swap_anchors(anchor,next_anchor,dir);
this.fade_in(anchor);
this.fade_in(next_anchor);
}
YT_php_support.prototype.slideSwap=function(anchor,next_anchor,dir){
ani.swapDivs(next_anchor,anchor,0.8);
this.swap_anchors(anchor,next_anchor,dir);
}
YT_php_support.prototype.make_transparent=function(el){
el.style.opacity='0.0';
el.style['-moz-opacity']='0.0';
el.style.filter='alpha(opacity=0)';
}
YT_php_support.prototype.fade_in=function(el){
animateProperty(el.style,'opacity','0.0','1.0',0,0.5,'number','sine',false);
animateProperty(el.style,'-moz-opacity','0.0','1.0',0,0.5,'number','sine',false);
animateProperty(el.style,'filter','0.0','1.0',0,0.5,'filter','sine',false);
}
})();
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}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={};this.variables={};this.attributes=[];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){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(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=[];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")?document.getElementById(_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(!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;
var goog=window.goog?window.goog:{};
goog.i18n={bidi:{}};
goog.i18n.bidi.initialized=false;
goog.i18n.bidi.isSafeUserAgent=-1;
goog.i18n.bidi.safeUserAgent=function(){
if(1==goog.i18n.bidi.isSafeUserAgent)return true;
if(0==goog.i18n.bidi.isSafeUserAgent)return false;
var userAgent=navigator.userAgent.toLowerCase();
var pat=new RegExp("applewebkit/(\\d*)");
var mt=userAgent.match(pat);
if(null==mt){
goog.i18n.bidi.isSafeUserAgent=1;
return true;
}
var ver=userAgent.match(pat)[1];
if(parseInt(ver)>=500){
goog.i18n.bidi.isSafeUserAgent=1;
return true;
}
goog.i18n.bidi.isSafeUserAgent=0;
return false;
}
goog.i18n.bidi.init=function(){
if(goog.i18n.bidi.initialized)return true;
if(!goog.i18n.bidi.safeUserAgent()){
return false;
}
goog.i18n.bidi.ltrChars_=
'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF'+
'\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF';
goog.i18n.bidi.neutralChars_=
'\u0000-\u0020!-@[-`{-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u2BFF';
goog.i18n.bidi.rtlChars_='\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC';
goog.i18n.bidi.ltrDirCheckRe_=new RegExp(
'^[^'+goog.i18n.bidi.rtlChars_+']*['+goog.i18n.bidi.ltrChars_+']');
goog.i18n.bidi.rtlDirCheckRe_=new RegExp(
'^[^'+goog.i18n.bidi.ltrChars_+']*['+goog.i18n.bidi.rtlChars_+']');
goog.i18n.bidi.neutralDirCheckRe_=new RegExp(
'^['+goog.i18n.bidi.neutralChars_+']*$|^http://');
goog.i18n.bidi.initialized=true;
return true;
}
goog.i18n.bidi.isRtlText=function(str){
if(!goog.i18n.bidi.init())return false;
return goog.i18n.bidi.rtlDirCheckRe_.test(str);
}
goog.i18n.bidi.isLtrText=function(str){
if(!goog.i18n.bidi.init())return true;
return goog.i18n.bidi.ltrDirCheckRe_.test(str);
}
goog.i18n.bidi.isNeutralText=function(str){
if(!goog.i18n.bidi.init())return false;
return goog.i18n.bidi.neutralDirCheckRe_.test(str);
}
goog.i18n.bidi.setDirAttribute=function(e,field){
var text=field.value;
var dir='';
if(goog.i18n.bidi.isRtlText(text)){
dir='rtl';
}else if(!goog.i18n.bidi.isRtlText(text)){
dir='ltr';
}
field.dir=dir;
}

