var __inc_stream_dispatcher=true;(function(){var IE=document.all,URL="http://www.adobe.com/go/getflashplayer",JQUERY=typeof jQuery=="function",RE=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,GLOBAL_OPTS={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};
if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function extend(to,from){if(from){for(key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}return to;}function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);
}}return newArr;}window.flashembed=function(root,opts,conf){if(typeof root=="string"){root=document.getElementById(root.replace("#",""));}if(!root){return;}if(typeof opts=="string"){opts={src:opts};}return new Flash(root,extend(extend({},GLOBAL_OPTS),opts),conf);};var f=extend(window.flashembed,{conf:GLOBAL_OPTS,getVersion:function(){var ver;
try{ver=navigator.plugins["Shockwave Flash"].description.slice(16);}catch(e){try{var fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");ver=fo&&fo.GetVariable("$version");}catch(err){}}ver=RE.exec(ver);return ver?[ver[1],ver[3]]:[0,0];},asString:function(obj){if(obj===null||obj===undefined){return null;
}var type=typeof obj;if(type=="object"&&obj.push){type="array";}switch(type){case"string":obj=obj.replace(new RegExp('(["\\\\])',"g"),"\\$1");obj=obj.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+obj+'"';case"array":return"["+map(obj,function(el){return f.asString(el);}).join(",")+"]";case"function":return'"function()"';
case"object":var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+f.asString(obj[prop]));}}return"{"+str.join(",")+"}";}return String(obj).replace(/\s/g," ").replace(/\'/g,'"');},getHTML:function(opts,conf){opts=extend({},opts);var html='<object width="'+opts.width+'" height="'+opts.height+'" id="'+opts.id+'" name="'+opts.id+'" pangoOptionalVideo="true" style="margin: 0px 0px;"';
if(opts.cachebusting){opts.src+=((opts.src.indexOf("?")!=-1?"&":"?")+Math.random());}if(opts.w3c||!IE){html+=' data="'+opts.src+'" type="application/x-shockwave-flash"';}else{html+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';}html+=">";if(opts.w3c||IE){html+='<param name="movie" value="'+opts.src+'" />';
}opts.width=opts.height=opts.id=opts.w3c=opts.src=null;opts.onFail=opts.version=opts.expressInstall=null;for(var key in opts){if(opts[key]){html+='<param name="'+key+'" value="'+opts[key]+'" />';}}var vars="";if(conf){for(var k in conf){if(conf[k]){var val=conf[k];vars+=k+"="+(/function|object/.test(typeof val)?f.asString(val):val)+"&";
}}vars=vars.slice(0,-1);html+='<param name="flashvars" value=\''+vars+"' />";}html+="</object>";return html;},isSupported:function(ver){return VERSION[0]>ver[0]||VERSION[0]==ver[0]&&VERSION[1]>=ver[1];}});var VERSION=f.getVersion();function Flash(root,opts,conf){if(f.isSupported(opts.version)){root.innerHTML=f.getHTML(opts,conf);
}else{if(opts.expressInstall&&f.isSupported([6,65])){root.innerHTML=f.getHTML(extend(opts,{src:opts.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title});}else{if(!root.innerHTML.replace(/\s/g,"")){root.innerHTML="<h2>Flash version "+opts.version+" or greater is required</h2>"+"<h3>"+(VERSION[0]>0?"Your version is "+VERSION:"You have no flash plugin installed")+"</h3>"+(root.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+URL+"'>here</a></p>");
if(root.tagName=="A"){root.onclick=function(){location.href=URL;};}}if(opts.onFail){var ret=opts.onFail.call(this);if(typeof ret=="string"){root.innerHTML=ret;}}}}if(IE){window[opts.id]=document.getElementById(opts.id);}extend(this,{getRoot:function(){return root;},getOptions:function(){return opts;},getConf:function(){return conf;
},getApi:function(){return root.firstChild;}});}if(JQUERY){jQuery.tools=jQuery.tools||{version:"@VERSION"};jQuery.tools.flashembed={conf:GLOBAL_OPTS};jQuery.fn.flashembed=function(opts,conf){return this.each(function(){$(this).data("flashembed",flashembed(this,opts,conf));});};}})();var XssCommunicator={topWindow:false,topWindowUrl:false,topWindowParam:"",documentUrl:"",frameUrls:[],events:[],eventListeners:[],checkMessagesRate:10,checkMessagesIntervalId:null,numClients:0,clientId:null,hostClientIds:"",channel:null,lastRandMessageID:"",relayMessagesToIframe:"",init:function(){XssCommunicator.parseQueryString(window.location.href);
XssCommunicator.saveDocumentUrl();XssCommunicator.initReferenceToTopWindow();XssCommunicator.initCommunicationChannel();},saveDocumentUrl:function(){var fullUrl=location.href;var hashIndex=fullUrl.indexOf("#");if(hashIndex>0){XssCommunicator.documentUrl=fullUrl.substring(0,hashIndex);XssCommunicator.originalHash=fullUrl.substring(hashIndex+1);
}else{XssCommunicator.documentUrl=fullUrl;XssCommunicator.originalHash="";}},initReferenceToTopWindow:function(){try{XssCommunicator.topWindow=(window.location.href==window.top.location);}catch(ex){}XssCommunicator.hasPostMessageSupport=(window.top.postMessage!=null);XssCommunicator.hasFlashSupport=!XssCommunicator.hasPostMessageSupport&&flashembed.isSupported([8,0]);
XssCommunicator.flashConnectionID="";XssCommunicator.flashConnectionIsReady=false;if(XssCommunicator.topWindow){XssCommunicator.topWindowUrl=XssCommunicator.documentUrl;if(XssCommunicator.hasFlashSupport){XssCommunicator.flashConnectionID=Math.floor(100000+100000*Math.random());XssCommunicator.establishFlashLocalConnection(true);
}}else{if(XssCommunicator.hasFlashSupport){XssCommunicator.flashConnectionID=XssCommunicator.isOr(XssCommunicator.qsParams["flashConnectionID"],"");XssCommunicator.establishFlashLocalConnection(false);}XssCommunicator.topWindowUrl=XssCommunicator.qsParams["topWindowUrl"];XssCommunicator.hostClientIds=XssCommunicator.isOr(XssCommunicator.qsParams["hostClientIds"],"");
while(XssCommunicator.hostClientIds.length>0&&XssCommunicator.hostClientIds[0]=="#"){XssCommunicator.hostClientIds=XssCommunicator.hostClientIds.substring(1);}XssCommunicator.hostClientIds=XssCommunicator.hostClientIds.split("#")[0];if(XssCommunicator.hostClientIds=="none"){XssCommunicator.hostClientIds="";
}}XssCommunicator.setTopWindowParam();},establishFlashLocalConnection:function(bReciever){XssCommunicator.localConnection_containerID="localConnection_"+XssCommunicator.flashConnectionID;XssCommunicator.localConnection_flashID="lc_"+(bReciever?"reciever":"sender");if(document.body){var element=document.createElement("div");
element.setAttribute("id",XssCommunicator.localConnection_containerID);document.body.appendChild(element);}else{document.write("<div style='width: 1px; height:1px; background-color: yellow; position: absolute; top:-10px; left: -10px;'><div id='"+XssCommunicator.localConnection_containerID+"'></div></div>");
}var flashSrc="http://static1.pango.tv/swf/AS3LocalConnection.swf?v=315?"+(bReciever?"recieverId":"senderId")+"="+XssCommunicator.flashConnectionID;flashembed(XssCommunicator.localConnection_containerID,{src:flashSrc,"id":XssCommunicator.localConnection_flashID},{"allowScriptAccess":"always"});},setTopWindowParam:function(){var param=XssCommunicator.isOr(XssCommunicator.topWindowUrl,"");
while(param.indexOf("?")>(-1)){param=param.replace("?","__Q__");}while(param.indexOf("&")>(-1)){param=param.replace("&","__AND__");}while(param.indexOf("=")>(-1)){param=param.replace("=","__EQ__");}XssCommunicator.topWindowParam=param;},info:function(){return"clientId: "+XssCommunicator.clientId+"; "+"hostClientIds: "+XssCommunicator.hostClientIds+"; "+"channel: "+XssCommunicator.channel+"; ";
},initCommunicationChannel:function(){if(XssCommunicator.hasPostMessageSupport){if(window.addEventListener){window.addEventListener("message",XssCommunicator.handlePostedMessage,false);}else{window.attachEvent("onmessage",XssCommunicator.handlePostedMessage);}}else{var listenViaFlash=(XssCommunicator.topWindow&&XssCommunicator.hasFlashSupport);
if(!listenViaFlash){if(XssCommunicator.checkMessagesIntervalId==null){XssCommunicator.checkMessagesIntervalId=window.setInterval(XssCommunicator.checkForServerMessages,XssCommunicator.checkMessagesRate);}}}var clientId=XssCommunicator.isOr(XssCommunicator.qsParams["clientId"],"");if(clientId!=""){XssCommunicator.clientId=clientId;
XssCommunicator.channel=XssCommunicator.isOr(XssCommunicator.qsParams["channel"],"");XssCommunicator.videoFrameId=XssCommunicator.isOr(XssCommunicator.qsParams["videoFrameId"],"");XssCommunicator.topWindowUrl=XssCommunicator.getTopWindowLocation();}else{XssCommunicator.clientId="";XssCommunicator.videoFrameId="";
XssCommunicator.channel="";}},destroy:function(){if(XssCommunicator.checkMessagesIntervalId!=null){window.clearInterval(XssCommunicator.checkMessagesIntervalId);}},handlePostedMessage:function(event){if(typeof event.data!="string"||event.data.substring(0,1)!="{"){return;}var message=null;try{eval("message = "+event.data);
}catch(ex){XssCommunicator.log("handlePostedMessage: "+event.data+" ;Exception: "+ex.message);}if(message!=null){var msgID=XssCommunicator.isOr(message.randID,"");if(msgID!=""){if(msgID!=XssCommunicator.lastRandMessageID){XssCommunicator.lastRandMessageID=msgID;}else{return;}}if(XssCommunicator.is(message.callerId)){XssCommunicator.acknowledgeMessage(message.callerId);
}XssCommunicator.handleServerMessage(message);}},checkForServerMessages:function(){var message=XssCommunicator.getHashedMessage();if(message!=null){if(XssCommunicator.is(message.callerId)){XssCommunicator.acknowledgeMessage(message.callerId);}XssCommunicator.handleServerMessage(message);}},getHashedMessage:function(){if(window.location.hash.length==0){return null;
}var hashValue=window.location.hash+"";while(hashValue.indexOf("#")==0){hashValue=hashValue.substring(1);}if((hashValue==null)||(hashValue.length==0)){return null;}if(hashValue!=XssCommunicator.originalHash&&hashValue!="/"){while(hashValue.indexOf("%22")>0){hashValue=hashValue.replace("%22",'"');}try{eval("var message = "+hashValue);
var msgChannel=XssCommunicator.isOr(message.channel,"");var thisChannel=XssCommunicator.isOr(XssCommunicator.channel,"");var msgReceiverId=XssCommunicator.isOr(message.receiverId,"");var thisClientId=XssCommunicator.isOr(XssCommunicator.clientId,"");if((msgChannel==""||thisChannel==""||msgChannel==thisChannel)&&(msgReceiverId==""||msgReceiverId==thisClientId)){window.location.replace(XssCommunicator.documentUrl+"#/");
return message;}}catch(ex){window.location.replace(XssCommunicator.documentUrl+"#/");}}return null;},relayAllMessagesToIframe:function(frameId){XssCommunicator.relayMessagesToIframe=frameId;if(XssCommunicator.relayMessagesToIframe!=""){frameId=XssCommunicator.relayMessagesToIframe;}},handleServerMessage:function(message){var callerId=(message.callerId!=null?message.callerId:null);
if(XssCommunicator.relayMessagesToIframe!=""){XssCommunicator.sendMessageToIframe(XssCommunicator.relayMessagesToIframe,message);return;}if(message.msgType!=null){if(message.msgType=="addEventListener"){XssCommunicator.addServerEventListener(message,callerId);}else{if(message.msgType=="dispatchEvent"){XssCommunicator.dispatchServerEvent(message,callerId);
}else{if(message.msgType=="handleEvent"){XssCommunicator.notifyPage(message,callerId);}else{if(message.msgType=="handleAndPerculateEvent"){XssCommunicator.notifyPage(message,callerId);XssCommunicator.dispatchServerEvent(message,callerId);}else{if(message.msgType=="perculateEvent"){XssCommunicator.dispatchServerEvent(message,callerId);
}else{if(message.msgType=="dispatchResize"){XssCommunicator.handleIFrameResize(message,callerId);}else{if(message.msgType=="messageReceived"){if(XssCommunicator.is(XssCommunicator.messageCallback)){XssCommunicator.messageCallback.call([]);XssCommunicator.messageCallback=null;}}}}}}}}}},notifyPage:function(message,callerId){try{XssCommunicator_OnEvent(message);
}catch(ex){}},acknowledgeMessage:function(callerId){XssCommunicator.sendMessageToIframe(callerId,{"msgType":"messageReceived"});},addServerEventListener:function(message,listenerId){var event=message.event;if(XssCommunicator.events[event]==null){XssCommunicator.events[event]=[];}var listeners=XssCommunicator.events[event];
var listenerAddress=listenerId+(message.targets!=""?","+message.targets:"");if(listeners[listenerAddress]==null){listeners[listeners.length]=listenerAddress;listeners[listenerAddress]=true;}if(message.targets!=""){XssCommunicator.percolateServerEventListener(message,listenerId,message.targets);}},percolateServerEventListener:function(message,listenerId,targets){var arrTargets=targets.split(",");
var currentTarget=arrTargets[arrTargets.length-1];if(arrTargets.length==1){message.targets="";}else{message.targets=targets.replace(","+currentTarget,"");}XssCommunicator.sendMessageToIframe(currentTarget,message);},dispatchServerEvent:function(message,callerId){var event=message.event;var listeners=XssCommunicator.events[event];
if(listeners==null){return;}listeners=XssCommunicator.getDirectListeners(listeners);for(var l=0;l<listeners.length;l++){var listener=listeners[l];var details=listeners[listener];var msgType="";if(details.relays>0){if(details.handleDirectly&&(listener!=callerId)){msgType="handleAndPerculateEvent";}else{msgType="perculateEvent";
}}else{if(listener!=callerId){msgType="handleEvent";}}if(msgType!=""){message.receiverId=listener;message.msgType=msgType;message.event=event;XssCommunicator.sendMessageToIframe(listener,message);}}},getDirectListeners:function(listeners){var directListeners=[];for(var l=0;l<listeners.length;l++){var listener=listeners[l];
var handleDirectly=true;if(listener.indexOf(",")!=(-1)){var arrPath=listener.split(",");listener=arrPath[arrPath.length-1];handleDirectly=false;}if(directListeners[listener]==null){directListeners[directListeners.length]=listener;directListeners[listener]={relays:0,handleDirectly:false};}else{directListeners[listener].relays=directListeners[listener].relays+1;
}if(handleDirectly){directListeners[listener].handleDirectly=true;}}return directListeners;},sendMessageToIframe:function(frameId,message){if(frameId==""){return;}var frame=document.getElementById(frameId);if(frame!=null){var msg=XssCommunicator.stringify(message);if(XssCommunicator.hasPostMessageSupport){var url=XssCommunicator.frameUrls[frameId];
url=url.split("#")[0];frame.contentWindow.postMessage(msg,url);}else{var url=XssCommunicator.frameUrls[frameId]+"#"+msg;frame.contentWindow.location.replace(url);}}else{XssCommunicator.log("1. can't find iframe with id = "+frameId+" .. "+document.location.href);}},createFrame:function(params){if(!XssCommunicator.is(params)){throw new Error("createFrame: params is missing");
}var container=XssCommunicator.isOr(params.container,"");var target="";if(container==""){if(!XssCommunicator.is(params.target)){throw new Error("createFrame: params.target are missing");}target=params.target;container=document.getElementById(target);}if(!XssCommunicator.is(params.url)){throw new Error("createFrame: params.url is missing");
}var url=params.url;var width=XssCommunicator.isOr(params.width,"0px");var scrolling=XssCommunicator.isOr(params.scrolling,"no");var height=XssCommunicator.isOr(params.height,"0px");var channel=XssCommunicator.isOr(params.channel,XssCommunicator.channel);var videoFrameId=XssCommunicator.isOr(params.videoFrameId,"");
var iframeParams=XssCommunicator.isOr(params.iframeParams,"");if(container!=null){XssCommunicator.numClients++;var clientId=target+"_xssFrame_"+XssCommunicator.numClients;var connector=(url.indexOf("#")<0?"#":"&");var hostClientIds=XssCommunicator.isOr(XssCommunicator.clientId,"");if(hostClientIds==""){hostClientIds="none";
}var url=url+connector+"topWindowUrl="+XssCommunicator.topWindowParam+"&clientId="+clientId+"&channel="+channel+"&width="+width+"&height="+height+"&videoFrameId="+videoFrameId+"&flashConnectionID="+XssCommunicator.flashConnectionID+(iframeParams!=""?"&"+iframeParams:"")+"&hostClientIds="+hostClientIds+(XssCommunicator.hostClientIds!=""?","+XssCommunicator.hostClientIds:"");
var iframe=this.createFrameElement(url,clientId,width,height,scrolling);container.appendChild(iframe);XssCommunicator.registerFrame(iframe,width,height);return clientId;}return"";},createFrameElement:function(url,clientId,width,height,scrolling){var iframe=document.createElement("iframe");iframe.id=clientId;
iframe.setAttribute("src",url);iframe.setAttribute("id",clientId);iframe.setAttribute("height",height);iframe.setAttribute("width",width);iframe.setAttribute("allowTransparency","true");iframe.setAttribute("border","0");iframe.setAttribute("frameborder","0");iframe.setAttribute("scrolling",scrolling);
iframe.setAttribute("marginwidth","0");iframe.setAttribute("marginheight","0");iframe.setAttribute("pangoOptionalVideo","false");iframe.style.width=width;iframe.style.height=height;iframe.style.border="none 0px";iframe.style.overflow="hidden";try{iframe.style["-webkit-box-shadow"]="none";iframe.style["-moz-box-shadow"]="none";
}catch(ex){}iframe.frameBorder=0;return iframe;},registerFrame:function(iframe,width,height){XssCommunicator.frameUrls[XssCommunicator.frameUrls.length]=iframe.id;XssCommunicator.frameUrls[iframe.id]=iframe.src.split("#")[0];},refreshFrame:function(frameId){var frame=document.getElementById(frameId);
var url=XssCommunicator.frameUrls[frameId]+"&rnd="+Math.random()+"#";frame.contentWindow.location.replace(url);},stringify:function(obj){var t=typeof(obj);if(t!="object"||obj===null){if(t=="string"){obj='"'+obj+'"';}return String(obj);}else{var n,v,json=[],arr=(obj&&obj.constructor==Array);for(n in obj){v=obj[n];
t=typeof(v);if(t=="string"){v='"'+v+'"';}else{if(t=="object"&&v!==null){v=this.stringify(v);}}json.push((arr?"":'"'+n+'":')+String(v));}return(arr?"[":"{")+String(json)+(arr?"]":"}");}},parseQueryString:function(url){url=new String(url);var queryStringValues=new Object();var querystring=url.substring((url.indexOf("?")+1),url.length).replace("#","&");
var querystringSplit=querystring.split("&");for(i=0;i<querystringSplit.length;i++){var pair=querystringSplit[i].split("=");var name=pair[0];var value=pair[1];queryStringValues[name]=value;}XssCommunicator.qsParams=queryStringValues;},getTopWindowLocation:function(){var param=XssCommunicator.topWindowParam;
while(param.indexOf("__Q__")>(-1)){param=param.replace("__Q__","?");}while(param.indexOf("__AND__")>(-1)){param=param.replace("__AND__","&");}while(param.indexOf("__EQ__")>(-1)){param=param.replace("__EQ__","=");}return param;},addEventListener:function(type,callback){XssCommunicator.eventListeners[type]=callback;
XssCommunicator.sendMessage({"msgType":"addEventListener","event":type,"targets":XssCommunicator.hostClientIds});},dispatchEvent:function(type,eventArgs){if(eventArgs==null){eventArgs={};}XssCommunicator.sendMessage({"msgType":"dispatchEvent","channel":XssCommunicator.channel,"event":type,"args":eventArgs});
},broadcastEvent:function(type,eventArgs){if(eventArgs==null){eventArgs={};}XssCommunicator.sendMessage({"msgType":"dispatchEvent","event":type,"args":eventArgs});},bubbleEvent:function(type,eventArgs){if(eventArgs==null){eventArgs={};}XssCommunicator.sendMessage({"msgType":"dispatchEvent","event":type,"args":eventArgs,"targets":XssCommunicator.hostClientIds});
},dispatchEventToHost:function(type,eventArgs){if(eventArgs==null){eventArgs={};}XssCommunicator.sendMessage({"msgType":"handleEvent","channel":XssCommunicator.channel,"event":type,"args":eventArgs});},dispatchResizeEvent:function(newWidth,newHeight,src,callback,object){if(XssCommunicator.is(callback)&&XssCommunicator.is(object)){XssCommunicator.messageCallback=new CallFunc(callback,object);
}if(newWidth!=0||newHeight!=0){var eventArgs={newWidth:newWidth,newHeight:newHeight};var pathToFrame=XssCommunicator.hostClientIds;pathToFrame=XssCommunicator.clientId+(pathToFrame!=""?","+pathToFrame:"");var message={"msgType":"dispatchResize","event":"contentResized","args":eventArgs,"pathToFrame":pathToFrame};
XssCommunicator.sendMessage(message);}},handleIFrameResize:function(message,callerId){var hostId="";var pathToFrame=message.pathToFrame.split(",");if(pathToFrame.length>1){var frameId=pathToFrame[pathToFrame.length-1];message.pathToFrame=message.pathToFrame.replace(","+frameId,"");XssCommunicator.sendMessageToIframe(frameId,message);
}else{var frameId=pathToFrame[0];var frameSize=XssCommunicator.getFrameSize(frameId);var iframe=document.getElementById(frameId);if(iframe!=null){var newHeight=message.args.newHeight+"px";message.resizedFrameDetails={"frameId":frameId,"height":newHeight};XssCommunicator.notifyPage(message,callerId);}else{XssCommunicator.log("2. can't find iframe with Id="+frameId);
}}},sendMessage:function(message){message.callerId=XssCommunicator.clientId;message.videoFrameId=XssCommunicator.videoFrameId;message.receiverId=null;message.sentOn=(new Date()).getTime();message.randID=Math.floor(Math.random()*100000)+":"+Math.floor(Math.random()*100000);var msg=XssCommunicator.stringify(message);
if(XssCommunicator.hasPostMessageSupport){window.top.postMessage(msg,XssCommunicator.topWindowUrl);}else{if(XssCommunicator.hasFlashSupport){XssCommunicator.sendMessageViaFlashCommunication(msg);}else{window.top.location.replace(XssCommunicator.topWindowUrl+"#"+msg);}}},sendMessageViaFlashCommunication:function(message){if(XssCommunicator.flashConnectionIsReady){document.getElementById(XssCommunicator.localConnection_flashID).send(message);
}else{window.setTimeout("XssCommunicator.sendMessageViaFlashCommunication('"+message+"')",200);}},is:function(){if(arguments.length==1){return((typeof arguments[0]!="undefined")&&arguments[0]!=null);}return false;},isOr:function(){return XssCommunicator.is(arguments[0])?arguments[0]:(XssCommunicator.is(arguments[1])?arguments[1]:"");
},getBodyDimensions:function(){var height=0,width=0;var scrollHeight=0,scrollWidth=0;var offsetHeight=0,offsetWidth=0;if(document.height){height=document.height;width=document.width;}else{if(document.body){if(document.body.scrollHeight){height=scrollHeight=document.body.scrollHeight;width=scrollWidth=document.body.scrollWidth;
}if(document.body.offsetHeight){height=offsetHeight=document.body.offsetHeight;width=offsetWidth=document.body.offsetWidth;}if(scrollHeight&&offsetHeight){height=Math.max(scrollHeight,offsetHeight);width=Math.max(scrollWidth,offsetWidth);}}}return{"height":height,"width":width};},getViewPortDimensions:function(){var height=0,width=0;
if(window.innerHeight){height=window.innerHeight;width=window.innerWidth;}else{if((document.documentElement)&&(document.documentElement.clientHeight)){height=document.documentElement.clientHeight;width=document.documentElement.clientWidth;}else{if((document.body)&&(document.body.clientHeight)){height=document.body.clientHeight;
width=document.body.clientWidth;}}}return{"height":height,"width":width};},getFrameSize:function(frameId){var iframe=document.getElementById(frameId);if(iframe!=null){return{"height":iframe.style.height.replace("px","")*1,"width":iframe.style.width.replace("px","")*1};}else{XssCommunicator.log("3. can't find iframe with Id="+frameId);
return{"height":0,"width":0};}},getFrameSizes:function(){var frameSizes=[];var length=XssCommunicator.frameUrls.length;for(var f=0;f<length;f++){var frameId=XssCommunicator.frameUrls[f];frameSizes[f]=XssCommunicator.getFrameSize(frameId);frameSizes[f].frameId=frameId;}return frameSizes;},log:function(message){if(typeof(console)!="undefined"&&console.log){console.log(message);
}}};XssCommunicator.init();function XssCommunicator_flashReady(){XssCommunicator.flashConnectionIsReady=true;}function XssCommunicator_OnFlashMessage(id,message){if(XssCommunicator.flashConnectionID==id){eval("var oMessage = "+message);XssCommunicator.acknowledgeMessage(oMessage.callerId);XssCommunicator.handleServerMessage(oMessage);
}}(function(){var initializing=false,fnTest=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(prop){var _super=this.prototype;initializing=true;var prototype=new this();initializing=false;for(var name in prop){prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?(function(name,fn){return function(){var tmp=this._super;
this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,prop[name]):prop[name];}function Class(){if(!initializing&&this.init){this.init.apply(this,arguments);}}Class.prototype=prototype;Class.constructor=Class;Class.extend=arguments.callee;return Class;};})();var HTMLStreamDispatcher=Class.extend({init:function(){this.loop_count=5000;this.max_cpu_limit=15;this.min_page_time_invalidation=0;this.time=200;this.scope=this;this.timer=null;this.listeners=[];this.nodesVisited={};this.enable_page_resize=true;this.timer_delay=null;},addListener:function(callback,nodeTypes){this.listeners.push(new StreamListener(callback,nodeTypes));
},removeListener:function(callback){for(var i=0;i<this.listeners.length;i++){if(listeners[i].callback==callback){listeners.splice(i,1);return true;}}return false;},start:function(time){this.stop();this.timerStartTime=new Date().getTime();time=time==null?this.time:time;this.timer_delay=time;var scope=this;
this.timer=window.setInterval(function(){scope.iterateNodes();},time);},stop:function(){if(this.timer==null){return;}window.clearInterval(this.timer);},cpuTimePassed:function(){if(new Date().getTime()-this.startTime>this.max_cpu_limit){return true;}return false;},getCurrentChildIndex:function(elementRef,elementKey){if(elementRef[elementKey]==null){elementRef[elementKey]={count:0};
return 0;}else{var childIndex=elementRef[elementKey].count;return childIndex;}},iterateNodesRec:function(element,elementRef,childIndex){if(element==null){return;}if(this.cpuTimePassed()){return false;}var index=0;var startChild=null;var exitRec=false;var currentElementKey=element.nodeName+"["+childIndex+"]"+element.id;
index=this.getCurrentChildIndex(elementRef,currentElementKey);startChild=element.childNodes[index];if(startChild==null||index>=element.childNodes.length){return;}for(var child=startChild;child!=null;child=child.nextSibling){this.iterated++;index++;if(child.nodeType==1){var allowDrill=this.notifyFound(child);
if(allowDrill==false){continue;}}var returnVar=this.iterateNodesRec(child,elementRef[currentElementKey],index);if(returnVar==false||this.cpuTimePassed()){exitRec=true;break;}}if(elementRef[currentElementKey].count!=index){elementRef[currentElementKey].count=index;}if(exitRec){elementRef[currentElementKey].count=index-1;
return false;}return index;},notifyFound:function(child){var nodeName="|"+child.nodeName.toUpperCase()+"|";var allowDrill=true;for(var i=0;i<this.listeners.length;i++){if(this.listeners[i].acceptsType(nodeName)){this.listeners[i].nodesFound.push(child);allowDrill=allowDrill&&this.listeners[i].disableDrillDownOnFound;
}}return allowDrill;},iterateNodes:function(){this.startTime=new Date().getTime();if(this.loop_count==0){this.stop();}this.loop_count--;this.iterated=0;this.iterateNodesRec(document.body,this.nodesVisited,0);if(this.enable_page_resize&&this.iterated<=1&&new Date().getTime()-this.timerStartTime>this.min_page_time_invalidation){if(this.documentHeight==null){this.documentHeight=this.getDocHeight();
}else{if(this.documentHeight!=this.getDocHeight()){this.documentHeight=this.getDocHeight();this.nodesVisited={};this.start(1000);}}}else{if(this.timer_delay!=this.time){this.start(this.time);}}for(var i=0;i<this.listeners.length;i++){this.listeners[i].notify();}},getDocHeight:function(){var D=document;
if(D!=null&&D.body!=null&&D.documentElement!=null){return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));}return 0;}});function StreamListener(func,fields,disableDrillDownOnFound){this.func=func;
this.fields=fields;this.disableDrillDownOnFound=disableDrillDownOnFound==null?false:disableDrillDownOnFound;this.nodesFound=[];this.clear=function(){this.nodesFound=[];};this.acceptsType=function(nodeName){return this.fields.indexOf(nodeName)>-1;};this.notify=function(){if(this.nodesFound.length==0){return;
}var array=this.nodesFound;this.clear();this.func(array);};}var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;
i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}else{if(dataProp){return data[i].identity;}}}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);
if(index==-1){return;}return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};
BrowserDetect.init();function p_is_array(input){return typeof(input)=="object"&&(input instanceof Array);}function PangoEventDispatcher(){this.listeners=new Array();this.bind=function(event,func,target){this.listeners.push({target:target,func:func,event:event});};this.unbind=function(event,func,target){for(var i=this.listeners.length-1;
i>=0;i--){if(((this.listeners[i].func==func&&func!=null)||(this.listeners[i].target==target&&target!=null))&&this.listeners[i].event==event){this.listeners.splice(i,1);}}};this.hasEventListener=function(event,func,target){for(var i=this.listeners.length-1;i>=0;i--){if(((this.listeners[i].func==func&&func!=null)||(this.listeners[i].target==target&&target!=null))&&this.listeners[i].event==event){return true;
}}return false;};this.trigger=function(event,eventArgs){for(var i=0;i<this.listeners.length;i++){var listener=this.listeners[i];if(listener.target==null&&typeof listener.func=="string"){listener=eval(listener.func+"("+JSON.stringify(eventArgs)+")");}else{if(p_is_array(eventArgs)==false){eventArgs=[eventArgs];
}listener.func.apply(listener.target,eventArgs);}}};}var XssVideoPlayerServer=Class.extend({__constructor:function(videoDetails,xssComChannelId,autoCheckVideoPlayerState){this.init(videoDetails,xssComChannelId,autoCheckVideoPlayerState);},init:function(videoDetails,xssComChannelId,autoCheckVideoPlayerState){this.videoDetails=videoDetails;this.xssComChannelId=xssComChannelId;
this.Type="XssVideoPlayerServer";this.autoCheckVideoPlayerState=pango_isOr(autoCheckVideoPlayerState,false);this.autoCheckInterval=100;this.optionalPauseTimeout=200;this.__getProperPlayer();this.__initState();},setVideoEnhancer:function(videoEnhancer){this.videoEnhancer=videoEnhancer;},handleXssVideoPlayerClientEvent:function(message){var args=pango_isOr(message.args,{});
var action=pango_isOr(args.action,"");var time=pango_isOr(args.time,-1);if(action=="play"){this.Play();}else{if(action=="pause"){this.Pause();}else{if(action=="stop"){this.Stop();}else{if(action=="seek"&&time>(-1)){this.Seek(time);}}}}},__getProperPlayer:function(){this.impVideoPlayer=VideoPlayerFactory.Get(this.videoDetails);
if(this.impVideoPlayer==null){throw new Error("video url is not supported");}},__initState:function(){this.isPlaying=false;this.lastSecondWatched=-1;},__createEventListeners:function(){},render:function(container,width,height){this.videoContainerId="videoContainer_"+Math.floor(Math.random()*100000);if(document.getElementById("pangoAllocatedDivs")!=null){this.videoContainer=document.getElementById("pangoAllocatedDivs").childNodes[0];
this.videoContainer.style.margin="0px 0px";this.videoContainer.id=this.videoContainerId;this.impVideoPlayer.SetDimensions(width,height);this.impVideoPlayer.LoadVideo(this.videoContainer,this.videoContainerId);container.appendChild(document.getElementById("pangoAllocatedDivs").childNodes[0]);}else{this.videoContainer=document.createElement("div");
this.videoContainer.setAttribute("id",this.videoContainerId);this.videoContainer.setAttribute("class","transVideoContainer");this.videoContainer.style.margin="0px 0px";container.appendChild(this.videoContainer);this.impVideoPlayer.SetDimensions(width,height);this.impVideoPlayer.LoadVideo(this.videoContainer,this.videoContainerId);
}this.videoPlayerIsReady=false;return this.videoContainer;},linkToExistingVideo:function(element){return this.impVideoPlayer.linkToExistingVideo(element);},completeInitialization:function(){if(this.autoCheckVideoPlayerState&&this.videoDetails.hasApi){var refToThis=this;window.setInterval(function(){refToThis.checkVideoPlayerState();
},this.autoCheckInterval);}},checkVideoPlayerState:function(){if(!this.videoPlayerIsReady){this.__checkIfVideoPlayerIsReady();}else{var isPlaying=this.IsPlaying();if(this.isPlaying!=isPlaying){this.isPlaying=isPlaying;if(this.isPlaying){this.__onPlay();}else{if(this.HasEnded()){this.__onEnd();}else{if(this.GetCurrentTime()>0){this.__onPossiblePause();
}}}}this.__markWatchedSecond();}},__markWatchedSecond:function(){var second=Math.floor(this.GetCurrentTime());if(second<0){return;}var sequencial=true;if(this.lastSecondWatched!=second){sequencial=(second==this.lastSecondWatched+1);if(!sequencial){this.__onSkip(this.lastSecondWatched);}this.lastSecondWatched=second;
}return sequencial;},__checkIfVideoPlayerIsReady:function(){if(!this.videoPlayerIsReady){this.videoPlayerIsReady=this.impVideoPlayer.IsReady();}if(this.videoPlayerIsReady){this.__onPlayerReady();}},__dispatchEvent:function(eventType,args){args=pango_isOr(args,{});args.duration=this.GetDuration();args.currentTime=this.GetCurrentTime();
this.videoEnhancer.onVideoEvent(eventType,args);},__onPlayerReady:function(){this.videoEnhancer.__onPlayerReady();},__onPlay:function(){this.seeking=false;this.ended=false;if(pango_is(this.__onPauseTimeoutId)){window.clearTimeout(this.__onPauseTimeoutId);}this.__dispatchEvent("play");this.videoEnhancer.showVideo();
},__onPossiblePause:function(){if(this.__isSeekingOrEnded()){return;}var __videoPlayerRef=this;this.__onPauseTimeoutId=window.setTimeout(function(){__videoPlayerRef.__onPause();},this.optionalPauseTimeout);},__isSeekingOrEnded:function(){var seeking=pango_isOr(this.seeking,false);var ended=pango_isOr(this.ended,false);
return(seeking||ended);},__onPause:function(){this.__dispatchEvent("pause");},__onEnd:function(){this.ended=true;this.__dispatchEvent("end");},__onTimeChanged:function(lastTime){this.__dispatchEvent("timeChanged",{lastTime:lastTime});},__onSkip:function(lastTime){this.__dispatchEvent("skip",{lastTime:lastTime});
},Play:function(){return this.impVideoPlayer.Play();},IsBuffering:function(){return this.impVideoPlayer.IsBuffering();},IsPlaying:function(){return this.impVideoPlayer.IsPlaying();},HasEnded:function(){return this.impVideoPlayer.HasEnded();},GetState:function(){return this.impVideoPlayer.GetState();},Pause:function(){return this.impVideoPlayer.Pause();
},Stop:function(){return this.impVideoPlayer.Stop();},Seek:function(time){this.seeking=true;return this.impVideoPlayer.Seek(time);},GetCurrentTime:function(){return this.impVideoPlayer.GetCurrentTime();},GetDuration:function(){return this.impVideoPlayer.GetDuration();},SetDimensions:function(width,height){return this.impVideoPlayer.SetDimensions(width,height);
}});var EnhancedVideo_importedStyles=null;var EnhancedVideo=Class.extend({init:function(videoDetails,toolbarUrl,cssFaceUrl,videoNumber,xssComChannelId,toolbarHeight,createIframe,addVideoContainer,replaceVideo,autoCheckVideoPlayerState){this.__initState(videoDetails,toolbarUrl,cssFaceUrl,videoNumber,xssComChannelId,toolbarHeight,createIframe,addVideoContainer,replaceVideo,autoCheckVideoPlayerState);
this.__createHtmlStructure();if(this.videoDetails.hasApi){this.xssplayer=new XssVideoPlayerServer(this.videoDetails,this.xssComChannelId,this.autoCheckVideoPlayerState);this.xssplayer.setVideoEnhancer(this);}else{this.xssplayer=null;this.linkToExistingVideo=false;this.replaceVideo=false;}this.toolbarUrl=toolbarUrl;
this.cssFaceUrl=cssFaceUrl;if(this.xssplayer!=null&&this.replaceVideo){this.linkToExistingVideo=false;this.hideOriginalVideo();this.xssplayer.render(this.onPageVideoContainer,this.videoWidth,this.videoHeight);this.showVideo(false);}else{this.__ensureVideoIsTransparent(this.originalVideo);if(this.addVideoContainer){this.onPageVideoContainer.appendChild(this.originalVideo);
}this.replaceVideo=false;}},activeVideoContainer:function(){return this.onPageVideoContainer;},activeXssplayer:function(){return this.xssplayer;},videoObj:function(){if(this.xssplayer&&this.xssplayer.impVideoPlayer&&this.xssplayer.impVideoPlayer.videoPlayer){return this.xssplayer.impVideoPlayer.videoPlayer;
}return null;},videoPlayerType:function(){if(this.xssplayer&&this.xssplayer.impVideoPlayer){return this.xssplayer.impVideoPlayer.playerType;}return null;},__initState:function(videoDetails,toolbarUrl,cssFaceUrl,videoNumber,xssComChannelId,toolbarHeight,createIframe,addVideoContainer,replaceVideo,autoCheckVideoPlayerState){this.videoUrlFlags=videoDetails.videoUrlFlags;
this.millisecondsToFocus=1500;this.bottomMargin=10;createIframe=pango_isOr(createIframe,true);this.addVideoContainer=pango_isOr(addVideoContainer,true);this.replaceVideo=pango_isOr(replaceVideo,true);this.autoCheckVideoPlayerState=pango_isOr(autoCheckVideoPlayerState,false);this.initialToolbarHeight=pango_isOr(toolbarHeight,30)*1;
this.toolbarFrameHeight=this.initialToolbarHeight;this.videoDetails=videoDetails;this.originalVideo=videoDetails.element;this.originalParent=pango_isOr(videoDetails.parent,pango_isOr(videoDetails.element.parentElement,videoDetails.element.parentNode));this.iframeClientId="";this.videoUrl=videoDetails.videoUrl;
this.videoNumber=videoNumber;this.toolbarFinishedLoading=false;this.optionalFocusTimerID=0;this.raisedOnVisibleEvent=false;this.raisedOnFocusEvent=false;this.initializationAttempts=0;this.linkToExistingVideo=true;this.linkToExistingVideoTimerID=0;var videoWidth=((this.originalVideo.clientWidth>0?this.originalVideo.clientWidth:this.originalVideo.width)+"").replace("px","")*1;
var videoHeight=((this.originalVideo.clientHeight>0?this.originalVideo.clientHeight:this.originalVideo.height)+"").replace("px","")*1;if(videoDetails.maxVideoWidth>0&&videoWidth>videoDetails.maxVideoWidth){var ratio=videoDetails.maxVideoWidth/videoWidth;videoWidth=videoDetails.maxVideoWidth;videoHeight=Math.round(videoHeight*ratio);
}if(videoDetails.preferedWidth>0&&videoWidth>videoDetails.minWidthToResize&&videoWidth<videoDetails.maxWidthToResize){var ratio=videoDetails.preferedWidth/videoWidth;videoWidth=videoDetails.preferedWidth;videoHeight=Math.round(videoHeight*ratio);}this.videoWidth=videoWidth*1;this.videoHeight=videoHeight*1;
this.actualVideoHeight=0;this.xssComChannelId=xssComChannelId;this.videoPlayerClient=null;this.onVideoComponentContainers=[];this.componentIframeIDs=[];this.adDetails=null;this.autoHideAdvertismentTimer=0;this.activeVideoIsTransparent=true;this.videoInWindowModeExists=false;},createIframe:function(toolbarUrl,cssFaceUrl,validateToolbarVersion){if(toolbarUrl==""||toolbarUrl=="null"||toolbarUrl==null){return;
}this.cssFaceUrl=cssFaceUrl;if(this.iframeClientId!=""){this.raisedOnFocusEvent=false;this.toolbarFinishedLoading=false;while(this.toolbarContainer.childNodes.length>0){this.toolbarContainer.removeChild(this.toolbarContainer.childNodes[0]);}this.iframeClientId="";}if(this.iframeClientId==""){this.toolbarUrl=toolbarUrl;
var params="videoUrl="+this.videoUrl+"&cssFaceUrl="+cssFaceUrl+"&hasJsApi="+this.videoDetails.hasApi+"&validateToolbarVersion="+validateToolbarVersion;this.toolbarContainer.style.visibility="hidden";this.iframeClientId=XssCommunicator.createFrame({container:this.toolbarContainer,url:this.toolbarUrl,iframeParams:params,width:this.videoWidth,height:"100%",channel:this.xssComChannelId});
}},toolbarLoaded:function(fullscreenEnabled){this.toolbarFinishedLoading=true;this.toolbarContainer.style.visibility="visible";this.fullscreenEnabled=fullscreenEnabled;if(!fullscreenEnabled){fullscreen_removeVideo(this);}},checkVideosState:function(quickFocus){if(quickFocus||this.__isVideoInViewPort()){if(this.linkToExistingVideo&&this.linkToExistingVideoTimerID==0){if(!this.__linkToExistingVideo()){var refToThis=this;
this.linkToExistingVideoTimerID=window.setInterval(function(){refToThis.__linkToExistingVideo();},50);}}if(this.toolbarFinishedLoading&&!this.raisedOnVisibleEvent){this.onVisible();}if(this.toolbarFinishedLoading&&!this.raisedOnFocusEvent){if(quickFocus){this.onFocus();}else{this.onOptionalFocus(false);
}}if(this.xssplayer!=null){this.xssplayer.checkVideoPlayerState();}}},getVideoVisibility:function(){return this.addVideoContainer?pango_getElementVisibilityInViewPort(this.onPageVideoWrapper):pango_getElementVisibilityInViewPort(this.originalVideo);},__isVideoInViewPort:function(){return this.addVideoContainer?pango_isInViewPort(this.onPageVideoWrapper):pango_isInViewPort(this.originalVideo);
},__linkToExistingVideo:function(){if(this.xssplayer.linkToExistingVideo(this.originalVideo)){this.linkToExistingVideo=false;window.clearInterval(this.linkToExistingVideoTimerID);return true;}this.initializationAttempts++;return false;},__ensureVideoIsTransparent:function(videoObj){var embedHTML=videoObj.innerHTML;
if(embedHTML.indexOf("window")>(-1)){this.__enableJsApiForVideo(videoObj,"transparent");}else{if(embedHTML.indexOf("transparent")==(-1)&&embedHTML.indexOf("opaque")==(-1)&&embedHTML.indexOf("direct")==(-1)){this.__enableJsApiForVideo(videoObj,"transparent");}}},__enableJsApiForVideo:function(videoObj,wmode){if(this.videoDetails.isIframe){videoObj.src=this.__addUrlflags(videoObj.src,wmode);
}else{videoObj.id="pangoVid_"+this.videoNumber+"_outer_"+Math.floor(Math.random()*1000);videoObj.style.padding="0px";videoObj.style.border="0";videoObj.style.width=this.videoWidth+"px";videoObj.style.height=this.videoHeight+"px";if(pango_isOr(videoObj.getAttribute("src"),"")!=""){videoObj.src=this.__addUrlflags(videoObj.src,wmode);
}if(pango_isOr(videoObj.getAttribute("movie"),"")!=""){videoObj.setAttribute("movie",this.__addUrlflags(videoObj.getAttribute("movie"),wmode));}if(videoObj.nodeName.toUpperCase()=="EMBED"){videoObj.setAttribute("AllowScriptAccess","always");}if(pango_isOr(videoObj.getAttribute("data"),"")!=""){videoObj.data=this.__addUrlflags(videoObj.data,wmode);
}var allowedScriptAccess=false,transparent=false;var misplacedChildren=[];for(var child=videoObj.firstChild;child;child=child.nextSibling){var nodeName="|"+child.nodeName.toUpperCase()+"|";if(nodeName=="|BR|"){misplacedChildren[misplacedChildren.length]=child;}if(child.nodeType==1&&("|PARAM|".indexOf(nodeName)>(-1))){var attrName=child.getAttribute("name");
var paramName=(attrName!=null?attrName.toUpperCase():"");if(paramName=="MOVIE"||paramName=="FLASHVARS"||paramName=="SRC"){child.value=this.__addUrlflags(child.value,wmode);}else{if(paramName=="ALLOWSCRIPTACCESS"){child.value="always";allowedScriptAccess=true;}else{if(paramName=="WMODE"){child.value=wmode;
transparent=true;}}}}else{if("|EMBED|".indexOf(nodeName)>(-1)){child.src=this.__addUrlflags(child.src,wmode);child.setAttribute("allowscriptaccess","always");child.setAttribute("wmode",wmode);child.id="pangoVid_"+this.videoNumber+"_inner_"+Math.floor(Math.random()*1000);child.style.padding="0px";child.style.border="0";
child.style.width=this.videoWidth+"px";child.style.height=this.videoHeight+"px";}}}for(var c=0;c<misplacedChildren.length;c++){videoObj.removeChild(misplacedChildren[c]);}if(videoObj.firstChild!=null){if(!allowedScriptAccess){var param=document.createElement("param");param.setAttribute("name","allowscriptaccess");
param.setAttribute("value","always");videoObj.insertBefore(param,videoObj.firstChild);param=document.createElement("param");param.setAttribute("name","flashvars");param.setAttribute("value","allowScriptAccess=always&wmode="+wmode);videoObj.insertBefore(param,videoObj.firstChild);}if(!transparent){var param=document.createElement("param");
param.setAttribute("name","wmode");param.setAttribute("value",wmode);videoObj.insertBefore(param,videoObj.firstChild);}}}},__addUrlflags:function(src,wmode){var connector="?";if(src.indexOf("&")>0||src.indexOf("?")>0){connector="&";}var flags=this.videoUrlFlags.replace("_VIDEONUM_",this.videoNumber).replace(/&amp;/g,"&");
var rv=src+connector+flags;var re=new RegExp("wmode=[a-zA-Z]*");var m=re.exec(rv);if(m!=null&&m.length==1){rv=rv.replace(m[0],"wmode="+wmode);}return rv;},__onPlayerReady:function(){},completeInitialization:function(){this.__completeInitialization(this.replaceVideo);},__completeInitialization:function(replaceVideo){if(this.addVideoContainer){this.onPageVideoContainer.style.height=this.videoHeight+"px";
}if(this.xssplayer!=null){this.xssplayer.SetDimensions(this.videoWidth,this.videoHeight);this.xssplayer.completeInitialization();}this.actualVideoHeight=this.videoHeight;if(replaceVideo){this.hideOriginalVideo();}this.onPageVideoWrapper.style.height=(this.videoHeight*1)+"px";this.onPageVideoContainer.style.height=this.videoHeight*1+"px";
this.componentsContainer.style.backgroundColor="Black";},hideOriginalVideo:function(){if(BrowserDetect.browser=="Explorer"){this.originalVideo.style.display="none";}this.originalVideo.style.visibility="hidden";this.originalVideo.style.width="0px";this.originalVideo.style.height="0px";this.originalVideo.setAttribute("width","0");
this.originalVideo.setAttribute("height","0");var refToThis=this;window.setTimeout(function(){refToThis.originalVideo.style.display="none";},1000);},getIframeClientId:function(){return this.iframeClientId;},setVideoPlayerClient:function(client){this.videoPlayerClient=client;},onVideoEvent:function(eventType,args){args=pango_isOr(args,{});
if(this.videoPlayerClient!=null){this.videoPlayerClient.handleEvent(eventType,args);}var message={"msgType":"handleEvent","channel":this.xssComChannelId,"event":"video:"+eventType,"args":args};this.sendMessageToToolbar(message);this.sendMessageToOnVideoComponents(message);},sendMessageToToolbar:function(message){if(this.iframeClientId!=""){XssCommunicator.sendMessageToIframe(this.iframeClientId,message);
}},sendMessageToOnVideoComponents:function(message){for(var c=0;c<this.componentIframeIDs.length;c++){XssCommunicator.sendMessageToIframe(this.componentIframeIDs[c],message);}},onMouseEnter:function(e){var mousePosition=pango_getMouseXY(e);var toolbarPosition=pango_getElementPosition(this.toolbarContainer);
var bodyBorder=pango_isOr(pango_getStyle(document.body,"border-left-width"),"").replace("px","");if(bodyBorder!=""){toolbarPosition.left+=(bodyBorder*1);}mousePosition.left-=toolbarPosition.left;mousePosition.top-=toolbarPosition.top;var message={"msgType":"handleEvent","channel":this.xssComChannelId,"event":"toolbar_OnMouseEnter","args":{left:mousePosition.left,top:mousePosition.top}};
this.sendMessageToToolbar(message);},onMouseOut:function(){var message={"msgType":"handleEvent","channel":this.xssComChannelId,"event":"toolbar_OnMouseOut"};this.sendMessageToToolbar(message);},onOptionalFocus:function(timeoutOver){if(!timeoutOver&&this.optionalFocusTimerID!=0){return;}if(this.optionalFocusTimerID>0){window.clearTimeout(this.optionalFocusTimerID);
this.optionalFocusTimerID=0;}if(!timeoutOver){var refToThis=this;this.optionalFocusTimerID=window.setTimeout(function(){refToThis.onOptionalFocus(true);},this.millisecondsToFocus);}else{if(this.__isVideoInViewPort()){this.onFocus();}}},onVisible:function(){this.raisedOnVisibleEvent=true;var message={"msgType":"handleEvent","channel":this.xssComChannelId,"event":"video_OnVisible","args":{videoUrl:this.videoUrl}};
this.sendMessageToToolbar(message);},onFocus:function(){this.raisedOnFocusEvent=true;var message={"msgType":"handleEvent","channel":this.xssComChannelId,"event":"video_OnFocus","args":{videoUrl:this.videoUrl}};this.sendMessageToToolbar(message);},handleXssVideoPlayerClientEvent:function(message){var msgType=pango_isOr(message.msgType,"");
if(msgType=="dispatchResize"){var resizedFrameDetails=pango_isOr(message.resizedFrameDetails,{});if(pango_is(resizedFrameDetails.height)){this.setToolbarHeight(resizedFrameDetails.height.replace("px",""));}return;}var play=pango_isOr(pango_isOr(message.args,{}).eventType)!="XssVideoPlayerClient.action";
this.showVideo(play);if(this.xssplayer!=null){this.xssplayer.handleXssVideoPlayerClientEvent(message);}},setToolbarHeight:function(height){this.toolbarContainer.height=(height*1)+"px";this.toolbarContainer.style.height=(height*1)+"px";},showVideo:function(play){play=pango_isOr(play,true);this.componentsContainer.style.display="none";
if(pango_is(this.visibleComponentIframe)){this.visibleComponentIframe.style.display="none";}if(this.xssplayer!=null&&play&&!this.xssplayer.IsPlaying()){this.xssplayer.Play();}this.__setOnVideoComponentsVisibility(true);},showComponent:function(componentInfo){if(this.xssplayer!=null&&this.xssplayer.IsPlaying()){this.xssplayer.Pause();
}if(pango_is(this.visibleComponentIframe)){this.visibleComponentIframe.style.display="none";}this.visibleComponentIframe=this.__getIFrame(componentInfo);this.visibleComponentIframe.style.display="block";this.componentsContainer.style.display="block";this.__setOnVideoComponentsVisibility(false);},loadOnVideoComponent:function(componentInfo){this.__createOnVideoComponentContainer(componentInfo);
},__createOnVideoComponentContainer:function(componentInfo){var id=componentInfo.id;while(id.indexOf("-")>(-1)){id=id.replace("-","_");}var container=this.__createContainer("vid_com_"+this.videoNumber+"_"+id,"0px",this.videoWidth,18);var componentIframe=this.__getIFrame(componentInfo);container.appendChild(componentIframe);
container.style.zIndex=2;container.style.display="none";container.style.position="absolute";container.style.top=(this.videoHeight-18)+"px";container.style.display="block";this.onVideoComponentContainers[this.onVideoComponentContainers.length]=container;this.onPageVideoWrapper.appendChild(container);},__setOnVideoComponentsVisibility:function(visible){for(var c=0;
c<this.onVideoComponentContainers.length;c++){this.onVideoComponentContainers[c].style.display=visible?"block":"none";}},__getIFrame:function(componentInfo){var contentDefinition=componentInfo.data.content;var cacheContent=pango_isOr(contentDefinition.cache,false);var expiresInSeconds=pango_isOr(contentDefinition.expires,3600);
var lastContentCall=pango_isOr(this["lastContentCall_"+componentInfo.id],(new Date()));var secondsSinceLastCall=Math.abs(((new Date())-lastContentCall)/1000);return this.__getIframeAbstract(this.componentsContainer,componentInfo.id,contentDefinition.url,cacheContent,expiresInSeconds,secondsSinceLastCall,this.videoWidth,this.videoHeight);
},__getIframeAbstract:function(container,componentInfoId,url,cacheContent,expiresInSeconds,secondsSinceLastCall,width,height){var componentIframeId=pango_isOr(this["componentIframeId_"+componentInfoId],"");if(componentIframeId==""){componentIframeId=XssCommunicator.createFrame({container:container,url:url,width:width,height:height,channel:this.xssComChannelId,videoFrameId:this.iframeClientId});
this.componentIframeIDs[this.componentIframeIDs.length]=componentIframeId;this["componentIframeId_"+componentInfoId]=componentIframeId;}else{if(cacheContent&&secondsSinceLastCall<expiresInSeconds){}else{this["lastContentCall_"+componentInfoId]=new Date();XssCommunicator.refreshFrame(componentIframeId);
}}return document.getElementById(componentIframeId);},__createHtmlStructure:function(){this.onPageVideoWrapper=this.__createExtenalContainer("onPageVideoWrapper_");this.onPageVideoContainer=this.__createVideoContainer("onPageVideoContainer_",this.videoHeight);this.onPageVideoContainer.setAttribute("class","transVideoContainer");
this.onPageVideoWrapper.appendChild(this.onPageVideoContainer);this.__createOnVideoComponentsContainer();this.__createToolbarContainer();this.fullscreenVideoWrapper=this.__createExtenalContainer("fullscreenVideoWrapper_");if(pango_is(this.videoDetails.toolbarPlaceHolder)){this.videoDetails.toolbarPlaceHolder.style.display="none";
}if(this.toolbarContainer){this.originalParent.insertBefore(this.toolbarContainer,this.originalVideo.nextSibling);}this.originalParent.insertBefore(this.fullscreenVideoWrapper,this.originalVideo.nextSibling);this.originalParent.insertBefore(this.onPageVideoWrapper,this.originalVideo.nextSibling);},__alignVideoToCenter:function(){return(pango_getStyle(this.originalParent,"text-align")=="center");
},__createExtenalContainer:function(idPrefix){var container=document.createElement("div");container.id=idPrefix+this.videoNumber;container.style.position="relative";container.style.textIndent="0px";container.style.margin="0px 0px";container.style.width=this.videoWidth+"px";if(this.__alignVideoToCenter()){container.style.marginLeft="auto";
container.style.marginRight="auto";}container.width=this.videoWidth+"px";container.setAttribute("pangoOptionalVideo","false");return container;},__createVideoContainer:function(idPrefix,height){var videoContainer=this.__createContainer(idPrefix+this.videoNumber,"0px",this.videoWidth,height);videoContainer.style.backgroundColor="Black";
videoContainer.style.textIndent="0px";videoContainer.style.margin="0px 0px";return videoContainer;},__createOnVideoComponentsContainer:function(){this.componentsContainer=this.__createContainer("componentsContainer_"+this.videoNumber,"0px",this.videoWidth,this.videoHeight);this.componentsContainer.setAttribute("pango","true");
this.componentsContainer.style.zIndex=2;this.componentsContainer.style.display="none";this.onPageVideoWrapper.appendChild(this.componentsContainer);},__createToolbarContainer:function(){this.toolbarContainer=this.__createUnderVideoContainer("toolbarContainer_"+this.videoNumber,this.initialToolbarHeight);
var refToThis=this;pango_addListener(this.toolbarContainer,"mouseover",function(e){refToThis.onMouseEnter(e);});pango_addListener(this.toolbarContainer,"mouseout",function(e){refToThis.onMouseOut();});},__createAdContainer:function(){this.adWrapper=this.__createUnderVideoContainer("adWrapper_"+this.videoNumber);
this.adWrapper.style.display="none";this.adWrapper.style.textAlign="center";this.adContainer=this.__createUnderVideoContainer("adContainer_"+this.videoNumber);this.adWrapper.appendChild(this.adContainer);},__createContainer:function(id,top,width,height){var container=document.createElement("div");container.style.position="absolute";
container.style.top=top;container.style.left="0px";container.id=id;container.style.overflow="hidden";if(pango_is(width)){container.style.width=width+"px";}if(pango_is(height)){container.style.height=height+"px";}return container;},__createUnderVideoContainer:function(id,height){var container=document.createElement("div");
container.id=id;container.style.width=this.videoWidth+"px";if(pango_is(height)){container.style.height=height+"px";}container.style.textIndent="0px";if(this.__alignVideoToCenter()){container.style.marginLeft="auto";container.style.marginRight="auto";}return container;},setLayoutMode:function(mode){pango_setVideoLayoutMode(this,mode);
}});function pango_is(){if(arguments.length==1){return((typeof arguments[0]!="undefined")&&arguments[0]!=null);}return false;}function pango_isOr(){return pango_is(arguments[0])?arguments[0]:(pango_is(arguments[1])?arguments[1]:"");}function pango_isNum(){if(pango_is(arguments[0])){return !isNaN(parseFloat(arguments[0]))&&isFinite(arguments[0]);
}return false;}function pango_isString(){return pango_is(arguments[0])?(typeof arguments[0]=="string"):false;}function pango_isUrl(){if(pango_isString(arguments[0])){return/http:\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(arguments[0]);}return false;}function pango_queryParam(name,url){url=pango_isOr(url,document.location);
if(pango_isString(name)){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?#&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(pango_is(results)){return results[1];}}return"";}function pango_escape(value){value=pango_isOr(value,"");while(value.indexOf("&")>(-1)){value=value.replace("&","__amp;");
}while(value.indexOf("__amp;")>(-1)){value=value.replace("__amp;","&amp;");}while(value.indexOf("<")>(-1)){value=value.replace("<","&lt;");}while(value.indexOf(">")>(-1)){value=value.replace(">","&gt;");}while(value.indexOf("'")>(-1)){value=value.replace("'","&apos;");}while(value.indexOf('"')>(-1)){value=value.replace('"',"&quot;");
}return value;}function pango_unescape(value){value=pango_isOr(value,"");while(value.indexOf("&lt;")>(-1)){value=value.replace("&lt;","<");}while(value.indexOf("&gt;")>(-1)){value=value.replace("&gt;",">");}while(value.indexOf("&amp;")>(-1)){value=value.replace("&amp;","&");}while(value.indexOf("&apos;")>(-1)){value=value.replace("&apos;","'");
}while(value.indexOf("&quot;")>(-1)){value=value.replace("&quot;",'"');}return value;}function pango_getStyle(element,styleProp){var value="";if(!element||element==""){return value;}if(element.currentStyle){value=element.currentStyle[styleProp];}else{if(window.getComputedStyle){value=document.defaultView.getComputedStyle(element,null).getPropertyValue(styleProp);
}}return value;}function pango_getStyleProperty(element,styleProperty){return pango_isOr(pango_getStyleProperties(element,styleProperty)[styleProperty],"");}function pango_capitaliseFirstLetter(string){return string.charAt(0).toUpperCase()+string.slice(1);}function pango_getStyleProperties(element,styleProps){if(!element||(pango_isString(element)&&element=="")){return{};
}var value={},saveAs="",name="",property=null,propertyValue=null;var properties=styleProps.split(",");if(element.currentStyle){for(var p=0;p<properties.length;p++){property=properties[p].split(":");saveAs=(property.length==1?property[0]:property[1]);name=property[0];var parts=name.split("-");name=parts[0];
for(var part=1;part<parts.length;part++){name+=pango_capitaliseFirstLetter(parts[part]);}propertyValue=element.currentStyle[name];if(propertyValue){value[saveAs]=(propertyValue+"").replace(/\"/g,"'");}}}else{if(window.getComputedStyle){var computedStyle=null;try{computedStyle=document.defaultView.getComputedStyle(element,null);
}catch(ex){computedStyle=null;}if(computedStyle!=null){for(var p=0;p<properties.length;p++){property=properties[p].split(":");name=property[0];saveAs=(property.length==1?property[0]:property[1]);propertyValue=computedStyle.getPropertyValue(name);if(propertyValue){value[saveAs]=(propertyValue+"").replace(/\"/g,"'");
}}}}}return value;}function pango_getStyleSheets(){var rv=[];if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var styleSheet=document.styleSheets[i];if(styleSheet.href&&styleSheet.href!=""){rv[rv.length]=styleSheet.href;}}}return rv;}function pango_getCSSRule(ruleName,deleteFlag){ruleName=ruleName.toLowerCase();
if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var styleSheet=document.styleSheets[i];var ii=0;var cssRule=false;do{if(styleSheet.cssRules){cssRule=styleSheet.cssRules[ii];}else{if(styleSheet.rules){cssRule=styleSheet.rules[ii];}}if(cssRule&&cssRule.selectorText){if(cssRule.selectorText.toLowerCase()==ruleName){if(deleteFlag=="delete"){if(styleSheet.cssRules){styleSheet.deleteRule(ii);
}else{styleSheet.removeRule(ii);}return true;}else{return cssRule;}}}ii++;}while(cssRule);}}return null;}function pango_parseColor(color){var re=new RegExp("rgb\\(([0-9]*), ([0-9]*), ([0-9]*)\\)");var parsed=re.exec(color);if(parsed!=null&&parsed.length==4){return pango_colorValue(parsed);}re=new RegExp("rgba\\(([0-9]*), ([0-9]*), ([0-9]*)");
parsed=re.exec(color);if(parsed!=null&&parsed.length==4){return pango_colorValue(parsed);}return null;}function pango_getHoverBackgroundColor(backgroundColor){bg=pango_parseColor(backgroundColor);if(bg!=null){if(pango_isLightColor(bg)){var percent=0.15;return"rgb("+pango_changeColor(bg[0],percent,false)+", "+pango_changeColor(bg[1],percent,false)+", "+pango_changeColor(bg[2],percent,false)+")";
}else{var percent=0.05;return"rgb("+pango_changeColor(bg[0],percent,true)+", "+pango_changeColor(bg[1],percent,true)+", "+pango_changeColor(bg[2],percent,true)+")";}}return backgroundColor;}function pango_adaptColors(foreColor,backgroundColor){if(!pango_is(foreColor)){return"rgb(0,0,0)";}var re=new RegExp("rgb\\(([0-9]*), ([0-9]*), ([0-9]*)\\)");
var bg=re.exec(backgroundColor);var fore=re.exec(foreColor);var rv=foreColor;var MinBright=270;if(bg!=null&&bg.length==4&&fore!=null&&fore.length==4){fore=pango_colorValue(fore);bg=pango_colorValue(bg);var diff=pango_getColorDiff(fore,bg);if(pango_isLightColor(bg)&&pango_isLightColor(fore)){if(diff<150){var percent=(150-diff)/150;
if(percent>0.9){percent=0.9;}rv="rgb("+pango_changeColor(fore[0],percent,false)+", "+pango_changeColor(fore[1],percent,false)+", "+pango_changeColor(fore[2],percent,false)+")";}}else{if(pango_isDarkColor(bg)&&pango_isDarkColor(fore)){if(diff<MinBright){var percent=(MinBright-diff)/MinBright;rv="rgb("+pango_changeColor(fore[0],percent,true)+", "+pango_changeColor(fore[1],percent,true)+", "+pango_changeColor(fore[2],percent,true)+")";
}}}}return rv;}function pango_isLightColor(color){return(color[0]+color[1]+color[2]>500);}function pango_isDarkColor(color){return(color[0]+color[1]+color[2]<150);}function pango_changeColor(base,percent,lighten){var newVal=-1;if(lighten&&Math.round(base+255*percent)>255){percent*=2;lighten=false;}if(lighten){newVal=Math.round(base+255*percent);
}else{newVal=Math.round(base-255*percent);}if(newVal>255){newVal=255;}else{if(newVal<0){newVal=0;}}return newVal;}function pango_getColorDiff(fore,back){return(fore[0]-back[0])+(fore[1]-back[1])+(fore[2]-back[2]);}function pango_colorValue(arr){return[arr[1]*1,arr[2]*1,arr[3]*1];}function pango_addListener(element,type,expression,bubbling){bubbling=bubbling||false;
if(window.addEventListener){element.addEventListener(type,expression,bubbling);return true;}else{if(window.attachEvent){element.attachEvent("on"+type,expression);return true;}else{return false;}}}function pango_getElementPosition(element){var offsetTrail=element;var offsetLeft=0;var offsetTop=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;
offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin;}return{left:offsetLeft,top:offsetTop};}function pango_getMouseXY(e){if(typeof event!="undefined"){tempX=event.clientX+document.body.scrollLeft;
tempY=event.clientY+document.body.scrollTop;}else{tempX=e.pageX;tempY=e.pageY;}if(tempX<0){tempX=0;}if(tempY<0){tempY=0;}return{left:tempX,top:tempY};}function pango_isInViewPort(el){return pango_getElementVisibilityInViewPort(el)>0;}function pango_getElementVisibilityInViewPort(el){if(el==null){return 0;
}var top=el.offsetTop;var left=el.offsetLeft;var width=el.offsetWidth;var height=el.offsetHeight;while(el.offsetParent){el=el.offsetParent;top+=el.offsetTop;left+=el.offsetLeft;}var pageY=typeof(window.pageYOffset)!="undefined"?window.pageYOffset:document.documentElement.scrollTop;var pageX=typeof(window.pageXOffset)!="undefined"?window.pageXOffset:document.documentElement.scrollLeft;
var dimensions=__winDimension();var docHeight=getDocHeight();var isInViewPort=(top<(pageY+dimensions[1])&&left<(pageX+dimensions[0])&&(top+height)>pageY&&(left+width)>pageX);var visibility=(isInViewPort?1:0);if(isInViewPort){var visibleHeight=0,visibleWidth=0;if(top<=pageY){visibleHeight=height-(pageY-top);
if(dimensions[1]<visibleHeight){visibleHeight-=(visibleHeight-dimensions[1]);}}else{visibleHeight=(pageY+dimensions[1]-top);if(visibleHeight>height){visibleHeight=height;}}return Math.round(visibleHeight/(height/100));}return visibility;}function __winDimension(){if(window.innerHeight!==undefined){A=[window.innerWidth,window.innerHeight];
}else{var D=(document.documentElement&&document.documentElement.clientWidth)?document.documentElement:document.body;A=[D.clientWidth,D.clientHeight];}return A;}function getDocHeight(){var D=document;if(D!=null&&D.body!=null&&D.documentElement!=null){return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));
}return 0;}function pango_setPropertyValue(componentInfo,propertyName,propertyValue){var path=propertyName.split(".");var node=componentInfo;for(var n=0;n<path.length-1;n++){if(!pango_is(node[path[n]])){node[path[n]]={};}if(n+1<path.length){if(!pango_is(node[path[n]][path[n+1]])){node[path[n]][path[n+1]]={};
}}node=node[path[n]];}node[path[path.length-1]]=propertyValue;}function pango_getPropertyValue(component,propertyName){var path=propertyName.split(".");var node=component;for(var n=0;n<path.length-1&&node!=null;n++){if(pango_is(node[path[n]])){node=node[path[n]];}}return pango_isOr(node[path[path.length-1]],"");
}function pango_getComponentById(components,id){id=id.toLowerCase();var length=components.length;for(var c=0;c<length;c++){var component=components[c];if(pango_isString(component)){component=components[component];}if(component.id.toLowerCase()==id){return component;}}return null;}function pango_readCookie(name){name+="=";
var parts=document.cookie.split(/;\s*/);for(var i=0;i<parts.length;i++){var part=parts[i];if(part.indexOf(name)==0){return unescape(part.substring(name.length));}}return null;}function pango_writeCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;
}var expires_date=new Date(today.getTime()+(expires));var cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"");document.cookie=cookie;}function pango_readSessionCookie(cookieName){return unescape(pango_readCookie(unescape(cookieName)));
}function pango_writeSessionCookie(cookieName,cookieValue){document.cookie=escape(cookieName)+"="+escape(cookieValue)+"; path=/";}function pango_prettyDate(time){if(!pango_isNum(time)){return time;}var diff=(((new Date()).getTime()-time)/1000);var day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0){return"just now";
}return day_diff==0&&(diff<60&&"just now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago")||day_diff==1&&"Yesterday"||day_diff<7&&day_diff+" days ago"||day_diff<31&&Math.ceil(day_diff/7)+" weeks ago"||day_diff<365&&Math.floor(day_diff/31)+" months ago"||"over a year ago";
}function pango_showOpenIDWin(openid,width,height){width=pango_isOr(width,750);height=pango_isOr(height,310);var w=window.open(openid,"openid_popup","width="+width+",height="+height+",location=1,status=0,resizable=yes,scrollbars=0,menubar=0");}String.prototype.trim=function(){a=this.replace(/^\s+/,"");
return a.replace(/\s+$/,"");};String.prototype.ltrim=function(){return this.replace(/^\s+/,"");};String.prototype.rtrim=function(){return this.replace(/\s+$/,"");};String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,"").replace(/\s+/g," ");};function refreshLoginSocial(isLoggedIn){$(document).trigger("loginRefresh",null);
}function removeLoggoutCookie(){$.cookie("fb_loggedout",null);}function pango_onUpdateToolbar(){}function pango_onPublishToolbar(newVersion){}function pango_setToolbarVersion(version){pango_writeSessionCookie("pango.toolbarversion",version);}function pango_getToolbarVersion(){var version=pango_isOr(pango_readSessionCookie("pango.toolbarversion"),"null")+"";
if(!pango_isNum(version)){version=0;pango_writeSessionCookie("pango.toolbarversion",0);}version*=1;return(version*1);}function pango_addCommas(nStr){nStr+="";var x=nStr.split(".");var x1=x[0];var x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1"+","+"$2");}return x1+x2;
}function pango_secondsToTime(secs){var hours=Math.floor(secs/(60*60));var divisor_for_minutes=secs%(60*60);var minutes=Math.floor(divisor_for_minutes/60);var divisor_for_seconds=divisor_for_minutes%60;var seconds=Math.ceil(divisor_for_seconds);if(hours>0){if(minutes<10){minutes="0"+minutes;}return hours+":"+minutes+":"+seconds;
}else{if(seconds<10){seconds="0"+seconds;}return minutes+":"+seconds;}}function pango_log(message){if(typeof console!="undefined"&&console.log){console(message);}}function pango_getScrollTop(){if(typeof pageYOffset!="undefined"){return pageYOffset;}else{var B=document.body;var D=document.documentElement;
D=(D.clientHeight)?D:B;return D.scrollTop;}}function pango_changeopacity(imageobject,opacity){var object=imageobject.style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}function pango_loadScript(url){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");script.type="text/javascript";script.src=url;head.appendChild(script);}function pango_getARGB(rgba){var valArr=rgba.split("(")[1].split(")")[0].split(","),red=pango_toHex(valArr[0]),green=pango_toHex(valArr[1]),blue=pango_toHex(valArr[2]),alpha=pango_toHex(valArr[3]*255);
return("#"+alpha+red+green+blue);}function pango_getRGBA(argb){var value=argb.substring(1,9),red=parseInt(value.substring(2,4),16),green=parseInt(value.substring(4,6),16),blue=parseInt(value.substring(6,8),16),alpha=Math.round((parseInt(value.substring(0,2),16)/255)*10)/10;return("rgba("+red+","+green+","+blue+","+alpha+")");
}function pango_toHex(val){val=parseInt(val);val=Math.max(0,val);val=Math.min(val,255);val=Math.round(val);return"0123456789ABCDEF".charAt((val-val%16)/16)+"0123456789ABCDEF".charAt(val%16);}function pango_enableJsApiForVideo(videoObj,wmode){if(pango_isOr(videoObj.getAttribute("src"),"")!=""){videoObj.src=pango_addUrlflags(videoObj.src,wmode);
}if(pango_isOr(videoObj.getAttribute("movie"),"")!=""){videoObj.setAttribute("movie",pango_addUrlflags(videoObj.getAttribute("movie"),wmode));}if(videoObj.nodeName.toUpperCase()=="EMBED"){videoObj.setAttribute("AllowScriptAccess","always");}if(pango_isOr(videoObj.getAttribute("data"),"")!=""){videoObj.data=pango_addUrlflags(videoObj.data,wmode);
}var allowedScriptAccess=false,transparent=false;var misplacedChildren=[];for(var child=videoObj.firstChild;child;child=child.nextSibling){var nodeName="|"+child.nodeName.toUpperCase()+"|";if(nodeName=="|BR|"){misplacedChildren[misplacedChildren.length]=child;}if(child.nodeType==1&&("|PARAM|".indexOf(nodeName)>(-1))){var attrName=child.getAttribute("name");
var paramName=(attrName!=null?attrName.toUpperCase():"");if(paramName=="MOVIE"||paramName=="FLASHVARS"||paramName=="SRC"){child.value=pango_addUrlflags(child.value,wmode);}else{if(paramName=="ALLOWSCRIPTACCESS"){child.value="always";allowedScriptAccess=true;}else{if(paramName=="WMODE"){child.value=wmode;
transparent=true;}}}}else{if("|EMBED|".indexOf(nodeName)>(-1)){child.src=pango_addUrlflags(child.src,wmode);child.setAttribute("allowscriptaccess","always");child.setAttribute("wmode",wmode);child.id="pangoVid_"+this.videoNumber+"_inner_"+Math.floor(Math.random()*1000);child.style.padding="0px";child.style.border="0";
}}}for(var c=0;c<misplacedChildren.length;c++){videoObj.removeChild(misplacedChildren[c]);}if(videoObj.firstChild!=null){if(!allowedScriptAccess){var param=document.createElement("param");param.setAttribute("name","allowscriptaccess");param.setAttribute("value","always");videoObj.insertBefore(param,videoObj.firstChild);
param=document.createElement("param");param.setAttribute("name","flashvars");param.setAttribute("value","allowScriptAccess=always&wmode="+wmode);videoObj.insertBefore(param,videoObj.firstChild);}if(!transparent){var param=document.createElement("param");param.setAttribute("name","wmode");param.setAttribute("value",wmode);
videoObj.insertBefore(param,videoObj.firstChild);}}}function pango_addUrlflags(src,wmode){var connector="?";if(src.indexOf("&")>0||src.indexOf("?")>0){connector="&";}var videoUrlFlags="rel=1&amp;version=3&amp;hl=en_US&amp;enablejsapi=1&amp;modestbranding=1&amp;theme=dark";var flags=videoUrlFlags.replace(/&amp;/g,"&");
var rv=src+connector+flags;var re=new RegExp("wmode=[a-zA-Z]*");var m=re.exec(rv);if(m!=null&&m.length==1){rv=rv.replace(m[0],"wmode="+wmode);}return rv;}var VideoPlayerTypes=VideoPlayerTypes||{};VideoPlayerTypes.UNKNOWN=0;VideoPlayerTypes.YOUTUBE=1;var _VideoPlayerFactory=Class.extend({__constructor:function(){this.init();},init:function(){},Get:function(videoDetails){switch(videoDetails.player){case VideoPlayerTypes.YOUTUBE:return new YouTubeVideoPlayer(videoDetails);}}});var VideoPlayerFactory=new _VideoPlayerFactory();var BaseVideoPlayer=Class.extend({__constructor:function(){this.init();return"";},init:function(){this.playerType=VideoPlayerTypes.UNKNOWN;},GetRequiredHelper:function(){return"";},SetDimensions:function(){},GetHTML:function(){},LoadVideo:function(container){},Play:function(){},IsBuffering:function(){},IsPlaying:function(){},HasEnded:function(){},GetState:function(){},Pause:function(){},Stop:function(){},Seek:function(time){},GetCurrentTime:function(){},GetDuration:function(){},SetDuration:function(){}});
var YouTubeVideoPlayer=BaseVideoPlayer.extend({__constructor:function(videoDetails){this.init(videoDetails);},init:function(videoDetails){this.videoDetails=videoDetails;var element=pango_isOr(this.videoDetails.element,{});this.Width=pango_isOr(element.width,0);this.Height=pango_isOr(element.height,0);
this.videoID=this.videoDetails.videoId;this.hasApi=this.videoDetails.hasApi;this.duration=-1;this.videoElementId="";this.playerType=VideoPlayerTypes.YOUTUBE;},SetDimensions:function(width,height){this.Width=width;this.Height=height;if(pango_is(this.videoPlayer)){try{this.videoPlayer.width=width;this.videoPlayer.height=height;
this.videoPlayer.style.width=width;this.videoPlayer.style.height=height;if(typeof(jQuery)!="undefined"){jQuery(this.videoPlayer).width(width).height(height).css({width:width,height:height});}}catch(ex){}}},LoadVideo:function(container,containerId){this.videoElementId=containerId+"_"+Math.floor(Math.random()*100000);
if(this.videoDetails.embedFlashVideo){var params={allowScriptAccess:"always","wmode":"transparent","width":this.Width,"height":this.Height};var atts={"src":"http://www.youtube.com/v/"+this.videoID+"?"+pango_replace_youtube,"id":this.videoElementId,"width":this.Width,"height":this.Height,allowScriptAccess:"always","wmode":"transparent"};
flashembed(containerId,atts,params);}else{if(this.videoDetails.embedVideoIframe){var iframe=XssCommunicator.createFrameElement(this.videoDetails.iframeUrl,this.videoElementId,this.Width,this.Height);container.appendChild(iframe);}else{if(this.videoDetails.hide){container.innerHTML="Can't show video";
}}}},linkToExistingVideo:function(element){this.videoPlayer=null;try{element.setAttribute("pangoOptionalVideo","false");element.setAttribute("wmode","transparent");element.style.margin="0px 0px";this.videoElementId=element.id;element.getPlayerState();this.videoPlayer=element;return true;}catch(ex){for(var child=element.firstChild;
child;child=child.nextSibling){var nodeName="|"+child.nodeName.toUpperCase()+"|";if("|EMBED|".indexOf(nodeName)>(-1)){try{child.setAttribute("pangoOptionalVideo","false");child.style.margin="0px 0px";this.videoElementId=child.id;child.getPlayerState();this.videoPlayer=child;return true;}catch(ex){}}}}return false;
},IsReady:function(){if(this.videoElementId!=""&&!pango_is(this.videoPlayer)){this.videoPlayer=document.getElementById(this.videoElementId);}try{this.videoPlayer.getPlayerState();}catch(ex){return false;}return(this.videoPlayer!=null);},__getVideoPlayer:function(){if(!pango_is(this.videoPlayer)&&this.videoElementId!=""){this.videoPlayer=document.getElementById(this.videoElementId);
}return this.videoPlayer;},Play:function(){if(pango_is(this.__getVideoPlayer())){try{this.videoPlayer.playVideo();}catch(ex){}}},IsBuffering:function(){if(pango_is(this.__getVideoPlayer())){try{return(this.videoPlayer.getPlayerState()==3);}catch(ex){}}return false;},IsPlaying:function(){if(pango_is(this.__getVideoPlayer())){try{var state=this.videoPlayer.getPlayerState();
return(state==1||state==3);}catch(ex){}}return false;},HasEnded:function(){if(pango_is(this.__getVideoPlayer())){try{return(this.videoPlayer.getPlayerState()==0);}catch(ex){}}return false;},GetState:function(){if(pango_is(this.__getVideoPlayer())){try{return this.videoPlayer.getPlayerState();}catch(ex){}}return false;
},Pause:function(){if(pango_is(this.__getVideoPlayer())){try{this.videoPlayer.pauseVideo();}catch(ex){}}},Stop:function(){if(pango_is(this.__getVideoPlayer())){try{this.videoPlayer.seekTo(0,true);this.videoPlayer.pauseVideo();}catch(ex){}}},Seek:function(time){if(pango_is(this.__getVideoPlayer())){try{this.videoPlayer.seekTo(time,true);
}catch(ex){}}},GetCurrentTime:function(){if(pango_is(this.__getVideoPlayer())){try{return this.videoPlayer.getCurrentTime();}catch(ex){}}return 0;},GetDuration:function(){if(this.duration>0){return this.duration;}var duration=pango_isOr(this.duration,36000);if(pango_is(this.__getVideoPlayer())){try{duration=this.videoPlayer.getDuration();
}catch(ex){}}return(duration==0?pango_isOr(this.duration,36000):duration);},SetDuration:function(duration){this.duration=duration;}});var pango_replace_youtube_min="rel=1&amp;enablejsapi=1&amp;modestbranding=1";var pango_replace_youtube="rel=1&amp;version=3&amp;hl=en_US&amp;enablejsapi=1&amp;modestbranding=1&amp;theme=dark&amp;playerapiid=EnhancedVideo__VIDEONUM_";var pango_supported_videos=[{"player":VideoPlayerTypes.YOUTUBE,"regEx":"http://(www.|)youtube.com/v/([^?&]*)","parts":3,"get":2,"videoUrl":"http://www.youtube.com/v/$videoId","iframeUrl":"http://www.youtube.com/embed/$videoId",hasApi:true,videoUrlFlags:pango_replace_youtube_min},{"player":VideoPlayerTypes.YOUTUBE,"regEx":"http://(www.|)youtube-nocookie.com/v/([^?&]*)","parts":3,"get":2,"videoUrl":"http://www.youtube.com/v/$videoId","iframeUrl":"http://www.youtube.com/embed/$videoId",hasApi:true,videoUrlFlags:pango_replace_youtube_min},{"player":VideoPlayerTypes.YOUTUBE,"regEx":"http://(www.|)youtube-nocookie.com/embed/([^?&]*)","parts":3,"get":2,"videoUrl":"http://www.youtube.com/v/$videoId","iframeUrl":"http://www.youtube.com/embed/$videoId",hasApi:true,videoUrlFlags:pango_replace_youtube_min},{"player":VideoPlayerTypes.YOUTUBE,"regEx":"http://(www.|)youtube.com/embed/([^?&]*)","parts":3,"get":2,"videoUrl":"http://www.youtube.com/v/$videoId","iframeUrl":"http://www.youtube.com/embed/$videoId",hasApi:true,videoUrlFlags:pango_replace_youtube_min}];
var minVideoWidth=50;if(typeof tv_pango_toolbar==="undefined"){tv_pango_toolbar=new (function(){this.regExDef=pango_supported_videos;this.log="";this.videosToEnhance=[];this.enhancedVideos=[];this.enhancedVideoByFrameId=[];this.calls=0;this.gotToolbarInfo=false;this.pangoToolbarHeight=0;this.addToolbarToNextVideo_timerID=0;
this.enhancedVideosStateCheck_timerID=0;this.pangoToolbarUrl="";this.cssFaceUrl="";this.cssFaceHash=0;this.forceCssFaceHashRefresh=0;this.videosToEnhanceNumber=0;this.checkVideoStateInterval=100;this.styleSheetsInfo=[];this.getCssFaceInfoDelay=2000;this.toolbarScriptUrl="";this.useSessionToolbarInfo=false;
this.useDevResources=true;this.toolbarVersion=0;this.maxVideoWidth=-1;this.accountId=0;this.isSupportedURL=function(url){return false;};this.initPangoToolbar=function(){this.hasFlashSupport=this.supports_flash();this.hasHtmlVideoSupport=this.supports_video();this.accountId=this.getAccountId();};this.getPangoScriptUrl=function(){if(this.toolbarScriptUrl==""){var scripts=document.getElementsByTagName("script");
for(var s=0;s<scripts.length;s++){var script=scripts[s].src;if((script.indexOf("pango.tv")>0||script.indexOf("pangotv.appspot")>0||script.indexOf("pangotvn.appspot")>0)&&(script.indexOf("pango.toolbar.js")>0||script.indexOf("pango.vidcomm.js")>0)){this.useDevResources=(script.indexOf(":8888")>0);this.toolbarScriptUrl=script;
}}}return this.toolbarScriptUrl;};this.getAccountId=function(){if(typeof(pangoAccountId)!="undefined"){return pangoAccountId;}if(this.accountId>0){return this.accountId;}var accountId=pango_queryParam("id",this.getPangoScriptUrl());if(accountId!=""){return accountId*1;}return 0;};this.getFocusOnFirstVideo=function(){return(pango_queryParam("focusOnFirstVideo",this.getPangoScriptUrl()));
};this.getShowHeader=function(){return(pango_queryParam("header",this.getPangoScriptUrl()));};this.getAddVideoContainer=function(){return(pango_queryParam("addVideoContainer",this.getPangoScriptUrl())!="false");};this.videosDiscovered=function(videos){for(var i=0;i<videos.length;i++){var video=videos[i];
var attr=video.getAttribute("pangoOptionalVideo");var unmarked=(typeof attr=="undefined"||attr==null);if(unmarked){unmarked=video.id.indexOf("pangoVid")<0;}if(unmarked){var videoToEnhance=this.checkPotential(video.parentNode,video);var videoWidth=(videoToEnhance==null?0:(videoToEnhance.element.clientWidth>0?videoToEnhance.element.clientWidth:videoToEnhance.element.width))+"";
videoWidth=videoWidth.replace("px","")*1;if(videoToEnhance!=null&&videoToEnhance.autoplay==false&&videoWidth>minVideoWidth){if(this.videosToEnhance.length==0){this.calcMaxVideoWidth(video);}this.getPangoToolbarInfo("");videoToEnhance.element.setAttribute("pangoOptionalVideo","true");if(video.parentNode.style.height!=""){video.parentNode.style.height="";
}if(video.parentNode.parentNode!=null&&video.parentNode.parentNode.style.height!=""){video.parentNode.parentNode.style.height="";}var toolbarPlaceHolder=this.createPlaceHolder("div","temp",videoWidth+"px",this.pangoToolbarHeight+"px");videoToEnhance.element.parentNode.insertBefore(toolbarPlaceHolder,videoToEnhance.element.nextSibling);
videoToEnhance.toolbarPlaceHolder=toolbarPlaceHolder;if(this.getFocusOnFirstVideo()&&this.videosToEnhance.length==0){var firstVideoHref=document.createElement("a");firstVideoHref.name="first-pango-video";firstVideoHref.id="first-pango-video";videoToEnhance.element.parentNode.insertBefore(firstVideoHref,videoToEnhance.element);
window.setTimeout(function(){document.location.href=document.location.href.split("#")[0]+"#first-pango-video";},2000);}if(typeof(pango_showInvisibleVideos)!="undefined"){pango_showInvisibleVideos();}this.videosToEnhance[this.videosToEnhance.length]=videoToEnhance;tv_pango_toolbar.addToolbarToNextVideo();
}}}};this.calcMaxVideoWidth=function(video){var paddingLeft=0,paddingRight=0;var parent=video.parentNode;while(parent!=null&&parent.nodeType==1){var pLeft=pango_isOr(pango_getStyleProperties(parent,"padding-left")["padding-left"],"").replace("px","");var pRight=pango_isOr(pango_getStyleProperties(parent,"padding-right")["padding-right"],"").replace("px","");
paddingLeft+=pLeft*1;paddingRight+=pRight*1;var overflow=pango_isOr(pango_getStyleProperties(parent,"overflow").overflow,"");if(overflow=="hidden"){this.maxVideoWidth=(parent.offsetWidth-paddingLeft-paddingRight);}parent=parent.parentNode;}};this.getPangoToolbarInfoNow=function(){this.gotToolbarInfo=false;
this.getPangoToolbarInfo("&version="+this.toolbarVersion);};this.getPangoToolbarInfo=function(params){if(this.accountId==0){return;}if(this.gotToolbarInfo){return;}this.gotToolbarInfo=true;var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");var scriptUrl="";script.type="text/javascript";
if(this.useDevResources){scriptUrl="http://www1.pango.tv:8888/api?method=Toolbar.toolbar_info_js&account="+this.accountId+params;}else{scriptUrl="http://www.pango.tv/api?method=Toolbar.toolbar_info_js&account="+this.accountId+params;if(typeof(pango_server_url)!="undefined"){scriptUrl=pango_server_url+"/api?method=Toolbar.toolbar_info_js&account="+this.accountId+params;
}}script.src=scriptUrl;head.appendChild(script);};this.setPangoToolbarInfo=function(urlWithVersion,cssFaceInfo,accountId){this.accountId=accountId;if(urlWithVersion==""||urlWithVersion=="null"||urlWithVersion==null){return;}this.pangoToolbarUrl=urlWithVersion;for(var v=0;v<this.enhancedVideos.length;
v++){var videoPlus=this.enhancedVideos[v];var verifyVideoToolbarUrl=false;videoPlus.createIframe(this.pangoToolbarUrl,this.cssFaceUrl,verifyVideoToolbarUrl);videoPlus.completeInitialization();this.enhancedVideoByFrameId[videoPlus.getIframeClientId()]=videoPlus;}};this.addToolbarToNextVideo=function(){if(this.videosToEnhanceNumber<this.videosToEnhance.length){var videoToEnhanceNumber=this.videosToEnhanceNumber++;
var video=this.videosToEnhance[videoToEnhanceNumber];video.maxVideoWidth=this.maxVideoWidth;video.preferedWidth=0;var replaceVideo=this.getAddVideoContainer()&&(video.replace||(video.isIframe&&video.hasApi));var createToolbar=(this.pangoToolbarUrl!="");var videoPlus=new EnhancedVideo(video,this.pangoToolbarUrl,this.cssFaceUrl,videoToEnhanceNumber,"xssComChannel_"+videoToEnhanceNumber,this.pangoToolbarHeight,createToolbar,this.getAddVideoContainer(),replaceVideo);
videoPlus.originalVideo.setAttribute("video_plus_number",this.enhancedVideos.length);videoPlus.adsEnabled=false;this.enhancedVideos[this.enhancedVideos.length]=videoPlus;var iframeClientID=videoPlus.getIframeClientId();if(iframeClientID!=""){this.enhancedVideoByFrameId[iframeClientID]=videoPlus;}if(this.pangoToolbarUrl!=""){var verifyVideoToolbarUrl=false;
videoPlus.createIframe(this.pangoToolbarUrl,this.cssFaceUrl,verifyVideoToolbarUrl);videoPlus.completeInitialization();this.enhancedVideoByFrameId[videoPlus.getIframeClientId()]=videoPlus;}else{videoPlus.completeInitialization();}fullscreen_addVideo(videoPlus);}else{window.clearInterval(this.addToolbarToNextVideo_timerID);
this.addToolbarToNextVideo_timerID=0;}};this.getEnhancedVideo=function(index){if(index>=0&&this.enhancedVideos.length>index){return this.enhancedVideos[index];}return null;};this.createPlaceHolder=function(tagName,clientId,width,height){var ph=document.createElement(tagName);ph.setAttribute("id",clientId);
ph.setAttribute("height",height);ph.setAttribute("width",width);ph.style.height=height;ph.style.width=width;return ph;};this.supports_flash=function(){return flashembed.isSupported([8,0]);};this.supports_video=function(){return !!document.createElement("video").canPlayType;};this.checkPotential=function(parent,element){var nodeName=element.nodeName.toUpperCase();
if(nodeName=="OBJECT"||nodeName=="EMBED"){return this.checkPotentialObject(parent,element);}else{return this.checkPotentialIFrame(parent,element);}};this.checkPotentialIFrame=function(parent,element){var src=pango_isOr(element.src,"");var result=this.matchUrlToPlayer(true,src);if(result.match){result.parent=parent;
result.element=element;return result;}return null;};this.checkPotentialObject=function(parent,element){var src=pango_isOr(element.getAttribute("src"),"");var result=this.matchUrlToPlayer(false,src);if(!result.match){var data=pango_isOr(element.getAttribute("data"),"");result=this.matchUrlToPlayer(false,data);
}if(!result.match){var params=this.getObjectParams(element);if(params.movie!=""){result=this.matchUrlToPlayer(false,params.movie);}if(!result.match&&params.flashvars!=""){result=this.matchUrlToPlayer(false,params.flashvars);}if(!result.match&&params.src!=""){result=this.matchUrlToPlayer(false,params.src);
}if(!result.match&&params.childSrc!=""){result=this.matchUrlToPlayer(false,params.childSrc);if(result.match){result.replace=true;}}}if(result.match){if(navigator.userAgent.toLowerCase().indexOf("msie")>-1&&element.nodeName.toUpperCase()=="EMBED"){result.replace=true;}result.parent=parent;result.element=element;
return result;}return null;};this.getObjectParams=function(element){var params={"movie":"","flashvars":"","src":"","childSrc":""};for(var child=element.firstChild;child;child=child.nextSibling){var nodeName="|"+child.nodeName.toUpperCase()+"|";if(child.nodeType==1&&("|PARAM|".indexOf(nodeName)>(-1))){var attrName=child.getAttribute("name");
var paramName=(attrName!=null?attrName.toUpperCase():"");if(paramName=="MOVIE"){params.movie=child.getAttribute("value");}else{if(paramName=="FLASHVARS"){params.flashvars=child.getAttribute("value");}else{if(paramName=="SRC"){params.src=child.getAttribute("value");}}}}else{if(child.nodeType==1&&("|EMBED|".indexOf(nodeName)>(-1))){params.childSrc=child.getAttribute("src");
params.element=child;}}}return params;};this.matchUrlToPlayer=function(isIframe,value){var rv={match:false,player:"",videoId:"",videoUrl:"",iframeUrl:"",embedFlashVideo:false,embedVideoIframe:false,hasApi:false,hide:false,replace:false,videoUrlFlags:"",autoplay:false};if(value==""){return rv;}while(value.indexOf("?")>(-1)){value=value.replace("?","_Q_");
}for(var r=0;r<this.regExDef.length;r++){var def=this.regExDef[r];try{var re=new RegExp(def.regEx);var m=re.exec(value);if(m!=null){rv.match=true;rv.player=def.player;rv.videoId=m[def.get].split("_Q_")[0];rv.embedFlashVideo=(this.hasFlashSupport);rv.hasApi=(this.hasFlashSupport&&def.hasApi);rv.videoUrl=def.videoUrl.replace("$videoId",rv.videoId).split("_Q_")[0];
rv.isIframe=isIframe;rv.videoUrlFlags=def.videoUrlFlags;rv.autoplay=(value.indexOf("autoplay=1")>(-1));if((!this.hasFlashSupport&&!isIframe)||isIframe){if(def.iframeUrl!=""&&this.hasHtmlVideoSupport){rv.iframeUrl=def.iframeUrl.replace("$videoId",rv.videoId);rv.embedVideoIframe=true;}else{rv.hide=true;
}}break;}}catch(ex){}}return rv;};this.handleXssVideoPlayerClientEvent=function(message){var callerFrameId=pango_isOr(message.callerId,"")+"";var videoFrameId=pango_isOr(message.videoFrameId,"")+"";var pathToFrame=pango_isOr(message.pathToFrame,"")+"";var videoPlus="";if(videoFrameId!=""){callerFrameId=videoFrameId;
}var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");if(videoPlus==""){this.logMissingEnhancedVideo("handleXssVideoPlayerClientEvent",callerFrameId);return;}videoPlus.handleXssVideoPlayerClientEvent(message);};this.showComponent=function(message){var componentInfo=pango_isOr(message.args.componentInfo,{});
var callerFrameId=pango_isOr(message.callerId,"");var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");if(videoPlus==""){this.logMissingEnhancedVideo("showComponent",callerFrameId);return;}videoPlus.showComponent(componentInfo);};this.toolbarLoaded=function(message){var callerFrameId=pango_isOr(message.callerId,"");
if(this.getShowHeader()){pango_showHeaderInFullScreen();}var fullscreenComponentInfo=pango_isOr(message.args.fullscreenComponentInfo,"");if(fullscreenComponentInfo!=null&&fullscreenComponentInfo!=""){pango_setFullScreenComponentInfo(fullscreenComponentInfo);}var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");
if(videoPlus==""){this.logMissingEnhancedVideo("toolbarLoaded",callerFrameId);return;}var enableFs=(fullscreenComponentInfo.enabled==true);if(enableFs){var supportedRegEx=pango_getPropertyValueOr(fullscreenComponentInfo,"data.core.supported-video-regex","");if(supportedRegEx!=""){var re=new RegExp(supportedRegEx);
var m=re.exec(videoPlus.videoUrl);enableFs=(m!=null);}}videoPlus.toolbarLoaded(enableFs);};this.enableAds=function(message){var callerFrameId=pango_isOr(message.callerId,"");var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");if(videoPlus==""){this.logMissingEnhancedVideo("enableAds",callerFrameId);
return;}videoPlus.adsEnabled=true;};this.applyAdvertismentDetails=function(message){var callerFrameId=pango_isOr(message.callerId,"");var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");if(videoPlus==""){this.logMissingEnhancedVideo("applyAdvertismentDetails",callerFrameId);return;
}videoPlus.applyAdvertismentDetails(message);};this.setLayoutMode=function(message){var callerFrameId=pango_isOr(message.callerId,"");var videoPlus=pango_isOr(this.enhancedVideoByFrameId[callerFrameId],"");if(videoPlus==""){this.logMissingEnhancedVideo("setLayoutMode",callerFrameId);return;}var mode=pango_isOr(message.args.mode,"");
videoPlus.setLayoutMode(mode);};this.getPlayerByYTPlayerID=function(ytPlayerId){var index=ytPlayerId.replace("EnhancedVideo_","");if(pango_isNum(index)){index*=1;if(index>=0&&index<this.enhancedVideos.length){return this.enhancedVideos[index];}}return null;};this.logMissingEnhancedVideo=function(src,callerFrameId){pango_log(src+": can't find video++ with iframeId="+callerFrameId);
};this.setNewToolbarInfo=function(message){var urlWithVersion=pango_isOr(message.args.urlWithVersion,"");if(urlWithVersion!=""&&urlWithVersion!=this.pangoToolbarUrl){this.pangoToolbarUrl=urlWithVersion;}};})(false);if(BrowserDetect.browser=="Explorer"){document.write("<div id='pangoAllocatedDivs' style='display:none'>");
for(var d=0;d<100;d++){document.write("<div class='transVideoContainer'>"+d+"</div>");}document.write("</div>");}document.write("<div id='pangoFullscreenAllocatedDivs' style='display:none'></div>");var tv_pango_toolbar_interval=0;tv_pango_toolbar.initPangoToolbar();var dispatcher=new HTMLStreamDispatcher();
dispatcher.addListener(function(targets){tv_pango_toolbar.videosDiscovered(targets);},"|OBJECT|EMBED|IFRAME|");if(BrowserDetect.browser=="Explorer"||(BrowserDetect.browser=="Firefox"&&BrowserDetect.version<4)){window.setTimeout(function(){dispatcher.start();},200);}else{dispatcher.start();}window.setTimeout(function(){pango_EnsureJQuery();
},500);var ensureJQueryMouseWheelTimer=0;function pango_EnsureJQuery(){if(typeof(jQuery)=="undefined"){pango_loadScript(pango_getScriptUrl("jquery.plus.js"));}ensureJQueryMouseWheelTimer=window.setInterval(function(){pango_EnsureJQueryMouseWheel();},50);}function pango_EnsureJQueryMouseWheel(){if(typeof(jQuery)!="undefined"){window.clearInterval(ensureJQueryMouseWheelTimer);
pango_loadScript(pango_getScriptUrl("jquery.mousewheel.min.js"));}}function pango_getScriptUrl(jsFileName){var url=(this.useDevResources?"/min/js":"http://static1.pango.tv/min/js/")+jsFileName;if(typeof(pango_server_url)!="undefined"){url=pango_server_url+"/min/js/"+jsFileName;}return url;}function XssCommunicator_OnEvent(message){if(pango_fullScreenMode){fullscreen_XssCommunicator_OnEvent(message);
return;}var msgType=pango_isOr(message.msgType,"");var action=pango_isOr(message.args.action,"");if(action=="showComponent"){tv_pango_toolbar.showComponent(message);}else{if(action=="toolbarLoaded"){tv_pango_toolbar.toolbarLoaded(message);}else{if(action=="setNewToolbarInfo"){tv_pango_toolbar.setNewToolbarInfo(message);
}else{if(action=="enableAds"){tv_pango_toolbar.enableAds(message);}else{if(action=="applyAdvertismentDetails"){tv_pango_toolbar.applyAdvertismentDetails(message);}else{if(action=="setLayoutMode"){tv_pango_toolbar.setLayoutMode(message);}else{tv_pango_toolbar.handleXssVideoPlayerClientEvent(message);}}}}}}}function VideoStreamWatcher_OnPlay(){tv_pango_toolbar.handleFlashStreamDetectorEvent("play");
}function VideoStreamWatcher_OnPause(){tv_pango_toolbar.handleFlashStreamDetectorEvent("pause");}function onYouTubePlayerReady(playerId){var enhancedVideo=tv_pango_toolbar.getPlayerByYTPlayerID(playerId);}function onytplayerStateChange(state){alert(this);}}if(typeof tv_pango_fullscreen==="undefined"){tv_pango_fullscreen=new (function(){});var fullscreen_isReady=false;var transitionBetweenFrameDelay=50;var fullscreenToolbarContainerInitialHeight=300;var pageFrameWidth=900;var minHeightForHighRes=820;var fullscreenVideoContainer_paddingBottom=15;var fullscreenMainPanel_marginTopBottom=10;
var fullscreenVideoWrapper_top=0;var fullscreenVideoWrapper_height="100%";var fullscreen_marginBottom=0;var videoHorizontalMargin=30;var videoFsBottomMargin=46;var minContentHeight=50;var lowResSizes=[{width:770,height:420,topHeight:0,paddingBottom:7},{width:920,height:510,topHeight:10},{width:940,height:520,topHeight:10}];
var highResSizes=[{width:900,height:490},{width:1100,height:610},{width:1640,height:820,topHeight:0}];var fullscreenSizes=[lowResSizes,highResSizes];var currentFullscreenSize=fullscreenSizes[0][0];var defaultOpeningSizeIndex=0;var currentFullscreenSizeIndex=0;var pango_fullScreenMode=false;var currentVideo=null,lastMinimizedVideo=null;
var fsFrame=null;var overlayedVideos=0;var fsVideos=[];var noFsVideos=[];var pango_closedVideo=false;var pango_videoReadyInterval=50;var pango_validCheckTimer=0;var currentState=null;var currentVideoUrl=null;var fullscreenZIndex=2147483647;var collidingElementsZIndex=50;var fullScreenComponentInfo=null;
var currentIFrameClientId="";var currentXssComChannelId="";var clickOutsideCloses=false;var enableMinimize=true;var fullscreenVideoId=0;var fullscreenBackground="rgba(0,0,0,0.35)";var fullscreenIconsSpriteUrl="http://static1.pango.tv/sprites/fullscreen.icons.png?v=315";var fullscreenIntroPanelContent=null;
var pango_fullscreen_eventDispatcher=new PangoEventDispatcher();function pango_SetFullscreenIntroContent(content){fullscreenIntroPanelContent=content;fullscreenMainPanel_marginTopBottom=-3;}function pango_closePopup(){if(currentVideo!=null){pango_setVideoLayoutMode(currentVideo,"regular");}}function pango_getSelectedVideoSizesList(){var pango_low=pango_queryParam("pango_low");
return(pango_low=="true"||screen.height<minHeightForHighRes?0:1);}function pango_showHeaderInFullScreen(){fullscreenVideoWrapper_top=52;fullscreenVideoWrapper_height=(__winDimension()[1]-fullscreenVideoWrapper_top)+"px";}function pango_getMarginTopBottom(){var pango_tb_margin=pango_queryParam("pango_tb_margin");
return(pango_tb_margin!=""?pango_tb_margin:fullscreenMainPanel_marginTopBottom);}function pango_getVideoSize(index){return fullscreenSizes[pango_getSelectedVideoSizesList()][index];}function pango_getTopHeight(index){var def=pango_getVideoSize(index);return(typeof(def.topHeight)!="undefined"?def.topHeight:15);
}function pango_getPaddingBottom(index){var def=pango_getVideoSize(index);return(typeof(def.paddingBottom)!="undefined"?def.paddingBottom:fullscreenVideoContainer_paddingBottom);}function pango_getNumVideoSizes(){return fullscreenSizes[pango_getSelectedVideoSizesList()].length;}function pango_getBestFitToScreenIndex(){return fullscreenSizes[pango_getSelectedVideoSizesList()].length-1;
}function pango_setVideoLayoutMode(video,mode){currentVideo=video;currentState=mode;window.clearInterval(pango_validCheckTimer);switch(mode){case"cinema":if(pango_fullScreenMode==false){currentFullscreenSize=pango_getVideoSize(defaultOpeningSizeIndex);currentFullscreenSizeIndex=defaultOpeningSizeIndex;
checkIfFullScreenVideoObjIsReady();modifyPotentionalCollidingElements(video);if(pango_fullScreenMode==false){pango_showVideoInFullScreenMode(video);}pango_fullScreenMode=true;}pango_OnFullScreenEvent({type:"cinema"});break;case"regular":pango_closeFullscreen(video);restorePotentionalCollidingElements();
currentVideo=null;pango_fullScreenMode=false;pango_closedVideo=true;pango_OnFullScreenEvent({type:"regular"});break;case"minimize":pango_minimizeVideo(video);restorePotentionalCollidingElements();lastMinimizedVideo=currentVideo;currentVideo=null;pango_fullScreenMode=false;pango_closedVideo=false;pango_OnFullScreenEvent({type:"minimize"});
break;}}function pango_OnFullScreenEvent(args){try{if(typeof(pango_FullScreenEventTracker)!="undefined"){pango_FullScreenEventTracker(args);}}catch(ex){}}function pango_setFullScreenComponentInfo(info){fullScreenComponentInfo=info;enableMinimize=pango_getPropertyValue(info,"data.display.enable-minimize");
clickOutsideCloses=pango_getPropertyValue(info,"data.display.click-outside-close");defaultOpeningSizeIndex=pango_getPropertyValue(info,"data.display.default-opening-size");currentFullscreenSize=pango_getVideoSize(defaultOpeningSizeIndex);currentFullscreenSizeIndex=defaultOpeningSizeIndex;}function pango_onVideoObjectReady(){switch(currentVideo.videoPlayerType()){case VideoPlayerTypes.YOUTUBE:if(currentState=="cinema"){try{var videoObj=getFullScreenVideoObj();
videoObj.playVideo();currentVideoUrl=videoObj.getVideoUrl();videoObj.addEventListener("onStateChange","pango_onPlayerStateChanged");}catch(ex){}}break;}}function checkIfFullScreenVideoObjIsReady(){if(isFullScreenVideoObjReady()){if(pango_validCheckTimer!=0){window.clearInterval(pango_validCheckTimer);
pango_validCheckTimer=0;pango_onVideoObjectReady();}}else{if(pango_validCheckTimer==0){pango_validCheckTimer=window.setInterval(function(){checkIfFullScreenVideoObjIsReady();},pango_videoReadyInterval);}}}function isFullScreenVideoObjReady(){try{if(getFullScreenVideoObj()!=null){return true;}}catch(ex){}return false;
}function pango_showVideoInFullScreenMode(video){fullscreenVideoId+=1;jQuery(video.fullscreenVideoWrapper).css({"z-index":fullscreenZIndex,"position":"fixed","overflow-x":"hidden","overflow-y":"auto","top":fullscreenVideoWrapper_top+"px","left":"0px","width":"100%","height":fullscreenVideoWrapper_height,"cursor":"default"}).show();
if(!jQuery.browser.mozilla){jQuery(document.body).css({"overflow":"hidden","overflow-x":"hidden","overflow-y":"hidden"});}if(jQuery.browser.msie){var ieFullscreenBackground=pango_getARGB(fullscreenBackground);jQuery(video.fullscreenVideoWrapper).css("background","transparent url(http://www.pango.tv//images/transparent.png)");
jQuery(video.fullscreenVideoWrapper).css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr="+ieFullscreenBackground+",endColorstr="+ieFullscreenBackground+")");jQuery(video.fullscreenVideoWrapper).css("-ms-filter","filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="+ieFullscreenBackground+",endColorstr="+ieFullscreenBackground+")");
}else{jQuery(video.fullscreenVideoWrapper).css({"background-color":fullscreenBackground});}jQuery(video.fullscreenVideoWrapper).empty();if(fullscreenIntroPanelContent!=null){var introContent=jQuery(fullscreenIntroPanelContent);introContent.show();jQuery(video.fullscreenVideoWrapper).append(introContent);
jQuery("#fullscreenIntroPanel").click(function(){return false;});}jQuery(video.fullscreenVideoWrapper).append(jQuery("<div id='fullscreenMainPanel'>"+"<div id='fullscreenVideoContainer_"+fullscreenVideoId+"' class='fullscreenVideoContainer' style='Color: White; padding-bottom: "+pango_getPaddingBottom(currentFullscreenSizeIndex)+"px;'></div>"+"<div id='fullscreenToolbarContainer' style='background-color: #EDEFF0; Color: Black; height: "+fullscreenToolbarContainerInitialHeight+"px;'>"+"<div id='fullscreenToolbarContainer_tempCommentsBG' style='float:left; width: 605px; background-color: #FFF; height: "+fullscreenToolbarContainerInitialHeight+"px;'></div>"+"</div>"+"</div>"));
jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"padding-top":"5px","background-color":"#090909","text-align":"center"});jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).prepend("<div id='fullscreen-top' style='height:"+pango_getTopHeight(currentFullscreenSizeIndex)+"px; padding-top:3px;color:White; text-align:right; font-size: 14px; padding-right:20px;margin-bottom:"+fullscreen_marginBottom+"px;'></div>");
jQuery("#fullscreen-top",jQuery(video.fullscreenVideoWrapper)).append("<div id='fullscreen-close' title='Close Pop-up' style='float:right; cursor:pointer; background: transparent url("+fullscreenIconsSpriteUrl+") 0 -60px; width: 11px; height: 11px;'></div>");if(!jQuery.browser.mozilla&&enableMinimize){jQuery("#fullscreen-top",jQuery(video.fullscreenVideoWrapper)).append("<div id='fullscreen-minimize' title='Continue Watching on Page' style='float:right; cursor:pointer; margin-right:5px; background: transparent url("+fullscreenIconsSpriteUrl+") -20px -60px; width: 12px; height: 10px;'></div>");
}var newSize={width:currentFullscreenSize.width-videoHorizontalMargin,height:currentFullscreenSize.height};if(currentFullscreenSizeIndex==pango_getBestFitToScreenIndex()){jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"margin":"0px auto"});newSize=pango_getBestFitToScreenSize(video);
jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"width":newSize.width+"px"});}else{var width=(currentFullscreenSize.width>=pageFrameWidth?currentFullscreenSize.width:pageFrameWidth);jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"margin":pango_getMarginTopBottom()+"px auto","width":width+"px"});
jQuery("#fullscreenIntroPanel",jQuery(video.fullscreenVideoWrapper)).css({"margin":"5px auto 0 auto","width":width+"px"});}createFullScreenVideoVersion(video,newSize.width,newSize.height);jQuery("#fullscreen-close",jQuery(video.fullscreenVideoWrapper)).click(function(){pango_closedVideo=true;pango_setVideoLayoutMode(video,"regular");
return false;});if(clickOutsideCloses){jQuery(video.fullscreenVideoWrapper).click(function(event){pango_closedVideo=true;pango_setVideoLayoutMode(video,"regular");return false;});jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).click(function(){return false;});}jQuery("#fullscreen-minimize",jQuery(video.fullscreenVideoWrapper)).click(function(){pango_closedVideo=false;
pango_setVideoLayoutMode(video,"minimize");return false;});loadContent(video,null,null);jQuery("#fullscreenToolbarContainer").find("iframe").css({"width":pageFrameWidth+"px","max-width":pageFrameWidth+"px"});jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).find("iframe").css("width",currentFullscreenSize.width+"px");
pango_addMouseWheelWatcher(video);}function pango_addMouseWheelWatcher(video){var mousewheelEventName=(jQuery.browser.mozilla?"DOMMouseScroll":"mousewheel");jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).bind(mousewheelEventName,function(event){var delta=event.wheelDelta;var scrollUp=delta>0?true:false,vel=Math.abs(delta);
var scrollTop=jQuery(video.fullscreenVideoWrapper).scrollTop();jQuery(video.fullscreenVideoWrapper).scrollTop(scrollTop-delta);var height=jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).height()-jQuery(window).height();return false;});}function pango_close(video,context){jQuery("#fullscreen-top",context).remove();
jQuery("#fullscreen-close",context).remove();jQuery("#fullscreen-minimize",context).remove();jQuery("#fullscreenToolbarContainer",context).remove();jQuery(video.fullscreenVideoWrapper).unbind("click");if(!jQuery.browser.mozilla){jQuery(document.body).css({"overflow":"auto","overflow-x":"auto","overflow-y":"auto"});
}}function pango_closeFullscreen(video){pango_pauseVideo(video);jQuery(video.fullscreenVideoWrapper).empty();jQuery(video.fullscreenVideoWrapper).hide();var context=jQuery(video.fullscreenVideoWrapper);jQuery(".fullscreenVideoContainer",context).empty();pango_close(video,context);}function pango_resetLastMinimizedVideo(){var video=lastMinimizedVideo;
jQuery(video.onPageVideoWrapper).show();jQuery(video.fullscreenVideoWrapper).empty();jQuery(video.fullscreenVideoWrapper).hide();}function pango_minimizeVideo(video){var context=jQuery(video.fullscreenVideoWrapper);jQuery(".fullscreenVideoContainer",context).css({"margin-left":"5000px"});window.setTimeout(function(){jQuery(video.onPageVideoWrapper).hide();
pango_close(video,context);jQuery("#fullscreenIntroPanel").remove();var regWidth=video.videoWidth,regHeight=video.videoHeight;jQuery(video.fullscreenVideoWrapper).width(regWidth).height(regHeight).css({"z-index":"0","position":"relative","overflow-x":"hidden","overflow-y":"hidden","width":regWidth+"px","height":regHeight+"px"});
jQuery(".fullscreenVideoContainer",context).width(regWidth).height(regHeight).css({"width":regWidth+"px","height":regHeight+"px"});jQuery("#fullscreenMainPanel",context).css({"margin":"0 0","padding-top":"0px","width":regWidth+"px"});jQuery("object",context).width(regWidth).height(regHeight).css({width:regWidth,height:regHeight});
jQuery("embed",context).width(regWidth).height(regHeight).css({width:regWidth,height:regHeight});jQuery(video.fullscreenVideoWrapper).css({"position":"relative","width":regWidth+"px","height":regHeight+"px"});jQuery(".fullscreenVideoContainer",context).css({"margin-left":"0px"});},10);}function pango_pauseVideo(video){var videoObj=getFullScreenVideoObj();
if(videoObj==null){return;}try{switch(video.videoPlayerType()){case VideoPlayerTypes.UNKNOWN:break;case VideoPlayerTypes.YOUTUBE:videoObj.pauseVideo();break;}}catch(ex){}}function pango_setVideoToSpecSize(index,video){index*=1;currentFullscreenSize=pango_getVideoSize(index);var newSize={width:currentFullscreenSize.width,height:currentFullscreenSize.height};
jQuery("#fullscreen-top",jQuery(video.fullscreenVideoWrapper)).css("height",pango_getTopHeight(index)+"px");jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).css("padding-bottom",pango_getPaddingBottom(index)+"px");if(index==pango_getBestFitToScreenIndex()){jQuery("#fullscreenIntroPanel").hide();
jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"margin":"0px auto"});newSize=pango_getBestFitToScreenSize(video);pango_scaleVideoToFitMode(video,newSize.width,newSize.height);}else{var videoWidth=newSize.width;newSize.width=(newSize.width>=pageFrameWidth?newSize.width:pageFrameWidth);
jQuery("#fullscreenIntroPanel").width(newSize.width).css({width:newSize.width}).show();jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css({"margin":pango_getMarginTopBottom()+"px auto"});pango_scaleVideoToFitMode(video,videoWidth-videoHorizontalMargin,newSize.height);}jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).width(newSize.width).css({width:newSize.width});
jQuery("#fullscreen-video-top-details").width(Math.round(newSize.width));}function pango_getBestFitToScreenSize(video){var dimensions=__winDimension();var width=dimensions[0]-getScrollbarWidth();var height=dimensions[1]-jQuery("#fullscreen-top",jQuery(video.fullscreenVideoWrapper)).height();height-=(jQuery("#fullscreen-top",jQuery(video.fullscreenVideoWrapper)).css("margin-bottom").replace("px","")*1);
height-=(jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).css("padding-bottom").replace("px","")*1);height-=(jQuery("#fullscreenMainPanel",jQuery(video.fullscreenVideoWrapper)).css("padding-top").replace("px","")*1);return{width:width,height:height-videoFsBottomMargin};}var scrollbarWidth=0;
function getScrollbarWidth(){if(!scrollbarWidth){if(jQuery.browser.msie){var textarea1=jQuery('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body"),textarea2=jQuery('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body");
scrollbarWidth=textarea1.width()-textarea2.width();textarea1.add(textarea2).remove();}else{var div=jQuery("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});scrollbarWidth=100-div.width();
div.parent().remove();}}return scrollbarWidth;}function createFullScreenVideoVersion(video,width,height){var videoObj=video.onPageVideoContainer;jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).width(width).height(height);if(jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).children().length==0){jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).css({"margin":"0px 5000px"});
window.setTimeout(function(){pango_enableJsApiForVideo(videoObj.children[0],"window");var embedHTML=videoObj.innerHTML;var reWidth=new RegExp(video.videoWidth,"g");var reHeight=new RegExp(video.videoHeight,"g");embedHTML=embedHTML.replace(/transparent/gi,"window").replace(/opaque/gi,"window").replace(/direct/gi,"window").replace(reWidth,width).replace(reHeight,height);
embedHTML=embedHTML.replace(/autoplay=0/g,"autoplay=1");embedHTML=embedHTML.replace(/rel=0/gi,"rel=1");embedHTML=embedHTML.replace(/<br>/gi,"").replace(/<br\/>/gi,"").replace(/<br >/gi,"").replace(/<br \/>/gi,"");var newVid=jQuery(embedHTML);addAutoHide(video,newVid);jQuery(newVid).attr("class","fullscreenVideo").css({"visibility":"visible"}).show();
jQuery("object",jQuery(newVid)).width(width).height(height).attr("class","fullscreenVideo").css({width:width,height:height,"max-width":"none","max-height":"none"}).attr("width",width).attr("height",height);jQuery("embed",jQuery(newVid)).width(width).height(height).attr("class","fullscreenVideo").css({width:width,height:height,"max-width":"none","max-height":"none"}).attr("width",width).attr("height",height);
var addedIdToRoot=false;if(jQuery("object",jQuery(newVid)).length>0){jQuery("object",jQuery(newVid)).attr("id","fullscreenVideoObject_"+fullscreenVideoId).attr("name","fullscreenVideoObject_"+fullscreenVideoId);}else{jQuery(newVid).attr("id","fullscreenVideoObject_"+fullscreenVideoId).attr("name","fullscreenVideoObject_"+fullscreenVideoId);
addedIdToRoot=true;}if(jQuery("embed",jQuery(newVid)).length>0){jQuery("embed",jQuery(newVid)).attr("id","fullscreenVideoEmbed_"+fullscreenVideoId).attr("name","fullscreenVideoEmbed_"+fullscreenVideoId);}else{if(!addedIdToRoot){jQuery(newVid).attr("id","fullscreenVideoEmbed_"+fullscreenVideoId).attr("name","fullscreenVideoEmbed_"+fullscreenVideoId);
}}if(jQuery.browser.msie&&!flashembed.isSupported([10,3])){var dynDiv=document.createElement("div");dynDiv.id="fsdd_"+fullscreenVideoId;document.getElementById("pangoFullscreenAllocatedDivs").appendChild(dynDiv);embedHTML=jQuery("<p>").append(jQuery(newVid).eq(0).clone()).html();if(embedHTML.toLowerCase().indexOf("<div")==0){embedHTML=jQuery(newVid).html();
}document.getElementById("fsdd_"+fullscreenVideoId).innerHTML=embedHTML;document.getElementById("fullscreenVideoContainer_"+fullscreenVideoId).appendChild(dynDiv);}else{jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).append(newVid);}jQuery("embed",jQuery(video.fullscreenVideoWrapper)).css({"visibility":"visible"});
jQuery("object",jQuery(video.fullscreenVideoWrapper)).css({"visibility":"visible"});window.setTimeout(function(){jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).css({"margin":"0px auto"});},600);},50);}else{jQuery("object",jQuery(video.fullscreenVideoWrapper)).width(fsWidth).height(fsHeight).css({width:fsWidth,height:fsHeight});
jQuery("embed",jQuery(video.fullscreenVideoWrapper)).width(fsWidth).height(fsHeight).css({width:fsWidth,height:fsHeight});}}function addAutoHide(video,videoObj){if(videoObj.attr("src")&&videoObj.attr("src")!=""){videoObj.attr("src",addVideoFlags(videoObj.attr("src"),"autohide=1"));}if(videoObj.attr("data")&&videoObj.attr("data")!=""){videoObj.attr("data",addVideoFlags(videoObj.attr("data"),"autohide=1"));
}jQuery("param",videoObj).each(function(index,item){var attrName=jQuery(item).attr("name");var paramName=(attrName!=null?attrName.toUpperCase():"");if(paramName=="MOVIE"||paramName=="FLASHVARS"||paramName=="SRC"){jQuery(item).attr("value",addVideoFlags(jQuery(item).attr("value"),"autohide=1"));}});var embed=jQuery("embed",videoObj);
if(embed&&embed.length==1){if(embed.attr("src")&&embed.attr("src")!=""){embed.attr("src",addVideoFlags(embed.attr("src"),"autohide=1"));}}}function addVideoFlags(src,flags){var connector="?";if(src.indexOf("&")>0||src.indexOf("?")>0){connector="&";}var rv=src+connector+flags;return rv;}function modifyPotentionalCollidingElements(video){setElementsVisibility("iframe","hidden");
setElementsVisibility("embed","hidden");setElementsVisibility("object","hidden");setElementsVisibility(".twtr-widget","hidden");jQuery("div").each(function(index,item){var element=jQuery(item);var position=element.css("position");if(!element.attr("pango")&&(position=="relative"||position=="fixed")&&element.css("zIndex")!="auto"){element.attr("orgZ",element.css("zIndex"));
element.css({"zIndex":"auto"});}});try{jQuery(".transVideoContainer").find("embed").css({"visibility":"visible"});}catch(ex){}try{jQuery(".transVideoContainer").find("object").css({"visibility":"visible"});}catch(ex){}}function restorePotentionalCollidingElements(){jQuery("div").each(function(index,item){var element=jQuery(item);
element.css({"zIndex":element.attr("orgZ")});});setElementsVisibility("iframe","visible");setElementsVisibility("embed","visible");setElementsVisibility("object","visible");setElementsVisibility(".twtr-widget","visible");}function setElementsVisibility(selector,visibility){try{jQuery(selector).css({"visibility":visibility});
}catch(ex){}}function addVideoInfo(video){switch(video.videoPlayerType()){case VideoPlayerTypes.UNKNOWN:break;case VideoPlayerTypes.YOUTUBE:addVideoInfoFromYouTube(video);break;}}function addVideoInfoFromData(data){jQuery("#fullscreen-video-top-details").append("<div style='float: left; vertical-align: middle; background-color: #333; margin-right: 10px;' class='channel'><img class='channel-image' style='visibility: hidden; width: 32px; height: 32px;' /><span style='vertical-align: top; line-height: 35px; padding: 0px 3px;'>"+data.author+"</span></div>"+"<div style='float: left' class='title'>"+data.title+"</div>");
var url="http://gdata.youtube.com/feeds/api/users/"+data.author+"?fields=media:thumbnail&alt=json";jQuery.ajax({url:url,dataType:"jsonp",success:function(data){try{var entry=data["entry"];if(entry!=null){entry=entry["media$thumbnail"];}var url=(entry!=null?entry.url:"");if(url!=""){jQuery(".channel-image").attr("src",url).css({"visibility":"visible"});
}}catch(ex){}},error:function(data){}});}function getFullScreenVideoObj(){if(jQuery.browser.msie){var obj=getFlashMovieObject("fullscreenVideoObject_"+fullscreenVideoId);if(obj!=null&&checkIfVideoObjIsInitialized(obj)){return obj;}else{obj=getFlashMovieObject("fullscreenVideoEmbed_"+fullscreenVideoId);
if(obj!=null&&checkIfVideoObjIsInitialized(obj)){return obj;}}}else{var currentVideoContext=jQuery(".fullscreenVideoContainer",jQuery(currentVideo.fullscreenVideoWrapper));var obj=jQuery("object",currentVideoContext);if(obj.length>0&&checkIfVideoObjIsInitialized(obj[0])){return obj[0];}obj=jQuery("embed",currentVideoContext);
if(obj.length>0&&checkIfVideoObjIsInitialized(obj[0])){return obj[0];}}return null;}function checkIfVideoObjIsInitialized(obj){if(obj==null){return null;}try{if(obj.getPlayerState!=null&&typeof(obj.getPlayerState())!="undefined"){return obj;}}catch(ex){}return null;}function getFlashMovieObject(movieName){if(window.document[movieName]){return window.document[movieName];
}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[movieName]){return document.embeds[movieName];}}else{return document.getElementById(movieName);}}function addVideoInfoFromYouTube(video){var videoId=getYoutubeVideoIdFromUrl(video.videoObj().getVideoUrl());jQuery.ajax({url:"http://gdata.youtube.com/feeds/api/videos/"+videoId+"?v=2&alt=json",dataType:"jsonp",success:function(data){addVideoInfoFromData({"title":data.entry.title.$t,"description":data.entry.media$group.media$description.$t,"viewcount":data.entry.yt$statistics.viewCount,"author":data.entry.author[0].name.$t});
}});}function loadContent(video,videoUrl,videoDetails){videoUrl=(videoUrl==null?video.videoDetails.videoUrl:videoUrl);currentXssComChannelId=video.xssComChannelId;videoDetails=pango_isOr(videoDetails,{});var username=pango_isOr(videoDetails.username,"");var title=pango_isOr(videoDetails.title,"");var userIconUrl=pango_isOr(videoDetails.userIconUrl,"");
var duration=pango_isOr(videoDetails.duration,"");var numViews=pango_isOr(videoDetails.numViews,"");var url="http://www.pango.tv/vidcomm/"+tv_pango_toolbar.getAccountId()+"?v="+videoUrl;currentIFrameClientId=XssCommunicator.createFrame({container:document.getElementById("fullscreenToolbarContainer"),url:url,width:"100%",height:"300px",channel:currentXssComChannelId,iframeParams:"username="+username+"&userIconUrl="+userIconUrl+"&title="+title+"&duration="+duration+"&numViews="+numViews+"&pango_num_comments="+pango_queryParam("pango_num_comments")+"&pango_num_user_promoted="+pango_queryParam("pango_num_user_promoted")+"&pango_num_vids_mini_panel="+pango_queryParam("pango_num_vids_mini_panel")+"&pango_num_vids_big_panel="+pango_queryParam("pango_num_vids_big_panel")});
jQuery("#fullscreenToolbarContainer_tempCommentsBG").remove();}function pango_showVideoInOriginalMode(video){pango_scaleVideoToFitMode(video,video.videoWidth,video.videoHeight);if(pango_closedVideo){addOverlayToVideo(video);}switch(video.videoPlayerType()){case VideoPlayerTypes.UNKNOWN:break;case VideoPlayerTypes.YOUTUBE:pango_showYouTubeVideoInOriginalMode(video);
break;}}function pango_showYouTubeVideoInOriginalMode(video){try{var id=video.videoDetails.videoUrl;id=id.substring(id.lastIndexOf("/")+1);if(pango_closedVideo){if(id!=getYoutubeVideoIdFromUrl(video.videoObj().getVideoUrl())){video.videoObj().stopVideo();video.videoObj().cueVideoById(id);}else{video.videoObj().cueVideoById(id);
}}video.videoObj().removeEventListener("onStateChange","pango_onPlayerStateChanged");}catch(ex){}}function getYoutubeVideoIdFromUrl(url){url=url.substring(url.indexOf("v=")+2);if(url.indexOf("&")!=-1){url=url.substring(0,url.indexOf("&"));}return url;}function pango_scaleVideoToFitMode(video,width,height){var videoObj=getFullScreenVideoObj();
if(videoObj!=null){video.currentVideoWidth=width;video.currentVideoHeight=height;jQuery(".fullscreenVideoContainer",jQuery(video.fullscreenVideoWrapper)).width(video.currentVideoWidth).height(video.currentVideoHeight);jQuery(videoObj).width(width).height(height).css({width:width,height:height,"max-width":"none","max-height":"none"}).attr("width",width).attr("height",height);
}}function pango_onPlayerStateChanged(state){try{if(currentVideo!=null&&currentVideoUrl!=getFullScreenVideoObj().getVideoUrl()){currentVideoUrl=getFullScreenVideoObj().getVideoUrl();pango_switchYoutubeVideo(null);}}catch(ex){}}function pango_switchYoutubeVideo(videoDetails){var videoObj=getFullScreenVideoObj();
var videoId=getYoutubeVideoIdFromUrl(videoObj.getVideoUrl());if(currentVideo!=null){jQuery("#fullscreenToolbarContainer").find("iframe").addClass("pending-replace");jQuery("#fullscreenToolbarContainer").find("iframe").fadeTo("fast",0.43);loadContent(currentVideo,"http://www.youtube.com/v/"+videoId,videoDetails);
jQuery("#fullscreenToolbarContainer").find("iframe").css("width",pageFrameWidth+"px");}}function fullScreen_XssCommunicator_sendMessageToIFrame(message){if(currentIFrameClientId!=""&&document.getElementById(currentIFrameClientId)!=null){XssCommunicator.sendMessageToIframe(currentIFrameClientId,message);
}}function fullscreen_switchToNewFrame(){var newFrame=jQuery("#fullscreenToolbarContainer").find("iframe:not(.pending-replace)");newFrame.height("0px");window.setTimeout(function(){jQuery("#fullscreenToolbarContainer").find(".pending-replace").remove();newFrame.height("100%");},transitionBetweenFrameDelay);
}function fullscreen_XssCommunicator_OnEvent(message){var msgType=pango_isOr(message.msgType,"");var action=pango_isOr(message.args.action,"");var resizedFrameDetails=pango_isOr(message.resizedFrameDetails,{});if(pango_is(resizedFrameDetails.height)){var height=resizedFrameDetails.height.replace("px","")*1;
if(height>0){jQuery("#fullscreenToolbarContainer").height(height);}}if(action=="fullscreenIFrameLoaded"){fullscreen_switchToNewFrame();var message={"msgType":"handleEvent","channel":currentXssComChannelId,"args":{"fullScreenComponentInfo":fullScreenComponentInfo,"fullscreenSizeIndex":currentFullscreenSizeIndex}};
fullScreen_XssCommunicator_sendMessageToIFrame(message);}else{if(action=="changeYoutubeVideo"){try{var videoObj=getFullScreenVideoObj();var videoDetails=message.args;videoObj.loadVideoById(videoDetails.videoId);jQuery(currentVideo.fullscreenVideoWrapper).scrollTop(0);currentVideoUrl=videoObj.getVideoUrl();
pango_switchYoutubeVideo(videoDetails);}catch(ex){}}else{if(action=="updateVideoSize"){if(message.args.videoSizeIndex>=0&&message.args.videoSizeIndex<pango_getNumVideoSizes()){currentFullscreenSizeIndex=message.args.videoSizeIndex;pango_setVideoToSpecSize(currentFullscreenSizeIndex,currentVideo);}}else{if(action=="scrollToTop"){jQuery(currentVideo.outerContainer).scrollTop(0);
}}}}}function fullscreen_addVideo(video){if(noFsVideos[video.videoNumber]||fsVideos["vid_"+video.videoNumber]){return;}fsVideos["vid_"+video.videoNumber]="pending";fsVideos[fsVideos.length]=video;fullscreen_addVideoOverlays();}var addVideoOverlays_TimerID=0;function fullscreen_addVideoOverlays(){if(addVideoOverlays_TimerID!=0){window.clearTimeout(addVideoOverlays_TimerID);
}if(typeof(jQuery)=="undefined"){addVideoOverlays_TimerID=window.setTimeout(function(){fullscreen_addVideoOverlays();},200);return;}var len=fsVideos.length;for(var i=overlayedVideos;i<len;i++,overlayedVideos++){var video=fsVideos[i];if(noFsVideos[video.videoNumber]==null&&fsVideos["vid_"+video.videoNumber]=="pending"){addOverlayToVideo(video);
fsVideos["vid_"+video.videoNumber]=="added";}}if(!fullscreen_isReady){fullscreen_isReady=true;pango_fullscreen_eventDispatcher.trigger("fullscreen-ready","WAHOO");}}function fullscreen_removeVideo(video){noFsVideos[video.videoNumber]=video;fullscreen_removeVideoOverlays();}function fullscreen_removeVideoOverlays(){if(typeof(jQuery)=="undefined"){window.setTimeout(function(){fullscreen_removeVideoOverlays();
},200);return;}for(var i=0;i<noFsVideos.length;i++){removeOverlayFromVideo(noFsVideos[i]);}}}if(typeof tv_pango_fullscreen_overlay==="undefined"){tv_pango_fullscreen_overlay=new (function(){});var YOUTUBE_TOP_BAR=35,YOUTUBE_BOTTOM_BAR=26,YOUTUBE_PLAY_WIDTH=58;function addOverlayToVideo(video){addOverlayToYouTubeVideo(video);}function removeOverlayFromVideo(video){if(typeof(jQuery)!="undefined"&&video&&video.onPageVideoWrapper){jQuery(".overlay-container",jQuery(video.onPageVideoWrapper)).remove();
}}function addOverlayToYouTubeVideo(video){if(typeof(video.fullscreen_addedOverlay)!="undefined"){return;}video.fullscreen_addedOverlay=true;var topOverlay=addOverlayContainer(video.onPageVideoWrapper,0,0,video.videoWidth,video.videoHeight);jQuery(topOverlay).css({"cursor":"pointer"}).click(function(event){event.cancelBubble=true;
event.preventDefault();pango_setVideoLayoutMode(video,"cinema");return false;});jQuery("object",jQuery(video.onPageVideoWrapper)).attr("pangoFullscreenReady","true");jQuery("embed",jQuery(video.onPageVideoWrapper)).attr("pangoFullscreenReady","true");}function addOverlayContainer(vidContainer,top,left,width,height){if(jQuery.browser.opera){return false;
}var overlay=document.createElement("div");overlay.style.position="absolute";overlay.style.top=top+"px";overlay.style.left=left+"px";overlay.style.overflow="hidden";if(pango_is(width)){overlay.style.width=width+"px";}if(pango_is(height)){overlay.style.height=height+"px";}overlay.setAttribute("pango","true");
overlay.style.zIndex=2;overlay.style.backgroundColor="White";jQuery(overlay).addClass("overlay-container");vidContainer.appendChild(overlay);pango_changeopacity(overlay,0);return overlay;}}if(typeof tv_pango_auto_opener==="undefined"){tv_pango_auto_opener=new (function(){this.autoplayVideo=function(){var video_plus_number=jQuery("object",jQuery("#pangoAutoplayer_VideoContainer")).attr("video_plus_number");if(typeof video_plus_number=="undefined"||typeof video_plus_number=="null"||video_plus_number==""){video_plus_number=jQuery("embed",jQuery("#pangoAutoplayer_VideoContainer")).attr("video_plus_number");
}if(typeof video_plus_number!="undefined"&&typeof video_plus_number!="null"&&video_plus_number!=""){var videoPlus=tv_pango_toolbar.getEnhancedVideo(video_plus_number*1);if(videoPlus!=null){pango_setVideoLayoutMode(videoPlus,"cinema");}}};});var pangoAutoPlay_videoID=pango_queryParam("ptv");if(pangoAutoPlay_videoID!=""){tv_pango_toolbar.getPangoToolbarInfoNow();
document.write("<div id='pangoAutoplayer_VideoContainer' style='position: fixed; top: -1000px; left: 0px; visibiliy: hidden;'>"+"<object width='420' height='345' pangoAutoPlay='true'>"+"<param name='movie' value='http://www.youtube.com/v/"+pangoAutoPlay_videoID+"' />"+"<param name='allowFullScreen' value='true' />"+"<param name='allowScriptAccess' value='always' />"+"<param name='wmode' value='transparent' />"+"<param name='flashvars' value='wmode=transparent' />"+"<param name='bgcolor' value='#000000' />"+"<embed pangoAutoPlay='true' src='http://www.youtube.com/v/"+pangoAutoPlay_videoID+"' type='application/x-shockwave-flash' "+" bgcolor='#000000' allowfullscreen='true' allowScriptAccess='always' width='420' height='345' wmode='transparent' />"+"</object>"+"</div>");
pango_fullscreen_eventDispatcher.bind("fullscreen-ready",function(){tv_pango_auto_opener.autoplayVideo();});}}
