(function(){
var _1=document.location.href.indexOf("player.local/HTM/")>-1||/devMode/.test(document.location.href),ua=navigator.userAgent.toLowerCase(),_2="",_3="",v,_4=document.getElementsByTagName("script");
_4=_4[_4.length-1];
_2=_4.src.substring(0,_4.src.lastIndexOf("/")+1);
window.bvOnScriptsLoaded=function(){
console.warn("bvOnScriptsLoaded",_4.getAttribute("config"));
var b=window.bv;
b.init(_2,_4);
b.onPlayerParams().addCallback(function(_5){
console.warn(" DEV ARGS!!!",_5);
if(b.is_webkit()&&(_5.locationId||Math.max.apply(null,_5.locationId.split(","))<50)){
b.initPlayer(_5);
}else{
_5.swf=_2+"mds_player.swf";
b.insertPlayer(null,null,_5);
}
});
};
})();
(function(){
var _1=window.debug||/debug=true/.test(document.location.href)||false;
var _2=window.loglimit||299;
window.loglimit=_2;
if(!window.console){
console={};
}
var _3="info,error,log,warn";
var _4="debug,time,timeEnd,assert,count,trace,dir,dirxml,group,groupEnd,groupCollapsed,exception";
var _5=function(){
var _6=_3.split(",");
for(var i=0;i<_6.length;i++){
var m=_6[i];
var n="_"+_6[i];
console[n]=console[m];
console[m]=(function(){
var _7=n;
return function(){
_2--;
if(_2==0){
console._log("***LOG LIMIT OF "+loglimit+" HAS BEEN REACHED***");
}
if(_2<1){
return;
}
console[_7](Array.prototype.slice.call(arguments).join(" "));
};
})();
}
try{
console.clear();
}
catch(e){
}
};
var _8=function(){
console._log=console.log;
console.log=console.debug=console.info=console.warn=console.error=function(){
var a=[];
for(var i=0;i<arguments.length;i++){
a.push(arguments[i]);
}
console._log(a.join(" "));
};
};
var _9=function(_a){
var _b=_a.split(",");
for(var i=0;i<_b.length;i++){
console[_b[i]]=function(){
};
}
};
var ua=window.navigator.userAgent;
if(_1&&/Trident/.test(ua)){
_5();
_9(_4);
}else{
if(_1&&/iPad|iPhone/.test(ua)){
_8();
}else{
if((/IE/.test(ua)&&!/Trident/.test(ua))||!_1||!window.console){
_9(_4+","+_3);
}
}
}
})();
(function(){
if(window.bv){
return;
}
var d=document,_1=-1,_2={},_3={},ua=navigator.userAgent,_4,_5;
var _6;
var _7;
var _8=function(){
if(!_5){
_5=d.createElement("div");
}
return _5;
};
var _9={};
var bv={root:undefined,nodeId:"",cacheBust:window.cacheBust||/cache/.test(d.location.href)||false,init:function(rt,sr){
_7=sr;
this.root=_6=rt||"";
},initControls:function(){
this.ready(this,function(){
this.player=new bv.Player();
});
},fixParams:function(o){
console.log("LID OBJECT:",o);
if(this.settings){
this.settings.init({vid:o.videoId,lid:o.locationId,cid:o.clientId,bid:o.lowBandId});
o.src=this.settings.getVideoPath();
o.preview=this.settings.getPreviewPath();
}
o.node=this.byId(o.nodeId)||o.node||(this.mdsEmbed()||_7).parentNode;
console.log("OBJECT:",o);
console.log("SETTINGS:",this.settings);
if(!o.w&&!o.width){
var _a=this.size(o.node);
if(!_a.w||!_a.h){
console.warn("No sizes for node.");
}else{
o.width=_a.w;
o.height=_a.h;
}
}
o.w=o.width;
o.h=o.height;
return o;
},onPlayerParams:function(_b){
_b=_b||new this.Deferred();
var o;
if(_7&&_7.getAttribute("config")){
_b.fire(this.fixParams(this.strToObj(_7.getAttribute("config"))));
}else{
if(this.mdsEmbed()){
_b.fire(this.fixParams(this.strToObj(this.mdsEmbed().getAttribute("src").split("?")[1])));
}else{
if(!this.domReady){
this.ready(this,function(){
this.onPlayerParams(_b);
});
}else{
console.log("No player params found.");
}
}
}
return _b;
},setMobileViewport:function(){
setTimeout(function(){
window.scrollTo(0,1);
},0);
var v=this.g("meta[name=viewport]");
this.connect(window,"orientationchange",function(){
v.setAttribute("content","width=860, user-scalable=0");
});
},makeMainNode:function(){
var n=this.byId(this.nodeId||"player");
console.log("makeMainNode:",this.nodeId);
n.innerHTML="<div id=\"bvVideoNode\" class=\"BVideo\"></div>";
return this.byId("bvVideoNode");
},getMainNode:function(){
return this.player&&this.player.node?this.player.node:this.makeMainNode();
},is_webkit:function(){
return /WebKit/.test(ua);
},is_ipad:function(){
return /iPad/.test(ua);
},is_iphone:function(){
return /iPhone/.test(ua);
},is_android:function(){
return /Android/.test(ua);
},is_chrome:function(){
return /Chrome/.test(ua);
},is_ff:function(){
return /Firefox/.test(ua);
},is_ie:function(){
return /MSIE/.test(ua);
},is_ie6:function(){
return /MSIE 6/.test(ua);
},is_imobile:function(){
return this.is_ipad()||this.is_iphone();
},is_mobile:function(){
return this.is_imobile()||this.is_android();
},is_array:function(it){
return it&&typeof (it)!="string"&&it.length!==undefined;
},query:function(q,_c){
var r=document.querySelectorAll(q);
if(!r||!r.length){
return false;
}
if(_c=="first"){
return r[0];
}
if(_c=="last"){
return r[r.length-1];
}
return r;
},g:function(q){
return this.query(q,"last");
},mdsEmbed:function(){
return this.g("embed[src*=mds_player]");
},_scriptNode:null,getScriptNode:function(){
if(!this._scriptNode){
this._scriptNode=this.query("script[src*=bv]","last")||this.query("script[src*=lib]","last");
}
return this._scriptNode;
},trim:function(_d){
return !_d?_d:_d.trim?_d.trim():_d.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
},strToObj:function(_e){
if(!_e){
return {};
}
var _f=/&/.test(_e)?"&":",",eq=/=/.test(_e)?"=":":",o={},a=_e.split(_f);
var _10=function(v){
if(v=="true"){
return true;
}
if(v=="false"){
return false;
}
if(v.substring(0,1)=="0"){
return v;
}
if(Number(v)==v){
return Number(v);
}
if(/,/.test(v)&&_f=="&"){
v=v.split(",");
for(var i=0;i<v.length;i++){
v[i]=_10(v[i]);
}
}
return v;
};
for(var i=0;i<a.length;i++){
var pr=this.trim(a[i]).split(eq);
if(pr[0]=="file"){
o[this.trim(pr[0])]=_10(a[i].substring(a[i].indexOf(eq)+1));
}else{
o[this.trim(pr[0])]=_10(this.trim(pr[1]));
}
}
return o;
},toQuery:function(o){
var a=[];
for(var nm in o){
if(o[nm]!==""){
a.push(nm+"="+o[nm]);
}
}
return a.join("&");
},cb:function(){
if(!this.cacheBust){
return "";
}
return "?cb="+(new Date().getTime());
},copy:function(o){
var o1={};
for(var nm in o){
if(typeof (o[nm])=="object"){
o1[nm]=this.copy(o[nm]);
}else{
o1[nm]=o[nm];
}
}
return o1;
},mix:function(o1,o2,_11){
if(_11){
o1=this.copy(o1);
}
if(!o2){
o2=o1;
o1=this;
}
for(var nm in o2){
o1[nm]=o2[nm];
}
return o1;
},byId:function(id){
return typeof (id)=="string"?document.getElementById(id):id;
},uid:function(str){
_1++;
return (str||"id")+"_"+_1;
},hitch:function(ctx,_12){
if(typeof (_12)=="string"){
if(!_12){
_12=ctx;
ctx=window;
}
return function(){
ctx[_12].apply(ctx,arguments);
};
}else{
var _13=!!_12?ctx.func||_12:ctx;
var _14=!!_12?ctx:window;
return function(){
_13.apply(ctx,arguments);
};
}
},partial:function(o,f){
f=typeof (f)=="string"?o[f]:!o.f?this.hitch(o,f):o.f;
return function(_15){
f.apply(o,_15);
};
},aop:function(o,e,c,m,_16){
if(!o._lis){
o._lis={};
}
if(!o._lis[e]){
o._lis[e]={before:[],after:[]};
o._lis[e].after.push(this.partial(o,e));
o[e]=function(){
for(var i=o._lis[e].before.length-1;i>=0;i--){
o._lis[e].before[i](arguments);
}
for(var i=0;i<o._lis[e].after.length;i++){
o._lis[e].after[i](arguments);
}
};
}
var uid=this.uid("aop");
_9[uid]={object:o,event:e};
var _17=bv.partial(c,m);
var tp="after";
switch(_16){
case "before":
o._lis[e].before.push(_17);
tp="before";
break;
case "once":
o._lis[e].after.push(function(){
_17(arguments);
bv.unaop(uid);
});
break;
case "onceBefore":
o._lis[e].before.push(function(){
_17(arguments);
bv.unaop(uid);
});
tp="before";
break;
default:
o._lis[e].after.push(_17);
}
_9[uid].type=tp;
_9[uid].index=o._lis[e][tp].length-1;
return uid;
},unaop:function(uid){
var o=_9[uid];
o.object._lis[o.event][o.type].splice(o.index,1);
},Deferred:function(){
_callbacks=[];
this.addCallback=function(obj,_18){
_callbacks.push(bv.hitch(obj,_18));
};
this.fire=function(){
var _19=arguments;
setTimeout(function(){
for(var i=0;i<_callbacks.length;i++){
var c=_callbacks[i];
c.apply(null,_19);
}
},1);
};
},disconnect:function(_1a){
if(_1a===undefined){
return;
}
if(typeof (_1a)=="object"){
for(var i=0;i<_1a.length;i++){
this.disconnect(_1a[i]);
}
return;
}
var o=_2[_1a][0],n=_2[_1a][1],h=_2[_1a][2];
try{
if(o.removeEventListener){
o.removeEventListener(n,h,false);
}
}
catch(e){
console.error("con bug:",_1a,_2[_1a]);
}
},connect:function(_1b,_1c,ctx,_1d){
if(!_1b){
console.warn("no connect object:",_1c,_1d,_1b);
}
if(typeof (_1b)=="string"){
_1b=this.byId(_1b);
}
if(typeof (_1c)!="string"){
var c=ctx;
ctx=_1c;
_1c=c;
}
if(typeof (_1c)!="string"){
for(var nm in _1c){
this.connect(_1b,nm,ctx,_1c[nm]);
}
return 0;
}
var _1e=this.hitch(ctx,_1d);
if(_1b.attachEvent){
_1b.attachEvent("on"+_1c,function(){
_1e(bv.normalizeEvent(window.event));
});
}else{
_1b.addEventListener(_1c,_1e,false);
}
var _1f=this.uid();
_2[_1f]=[_1b,_1c,_1e];
return _1f;
},once:function(_20,_21,ctx,_22){
var _23=this.hitch(ctx,_22);
var _24=this.connect(_20,_21,function(evt){
bv.disconnect(_24);
_23.call(null,evt);
});
},stopEvent:function(evt){
evt.preventDefault();
evt.stopPropagation();
},domReady:false,domHandlers:[],ready:function(a1,a2){
var _25;
if(typeof (a1)=="string"){
if(this.byId(a1)){
a2();
return;
}
_25=a2;
}else{
if(typeof (a1)=="object"&&typeof (a1)!="function"){
_25=this.hitch(a1,a2);
}else{
_25=a1;
}
}
if(this.domReady){
_25();
return;
}
this.domHandlers.push(_25);
},onDomReady:function(){
if(this.domReady){
return;
}
console.log("onDomReady");
this.domReady=true;
if(this.domHandlers.length){
for(var i=0;i<this.domHandlers.length;i++){
this.domHandlers[i]();
}
this.domHandlers=[];
}
},size:function(n){
if(n===window){
var _26=(document.compatMode=="BackCompat")?document.body:document.documentElement;
return {w:_26.clientWidth,h:_26.clientHeight,x:scroll.scrollLeft||0,y:scroll.scrollTop||0,win:true};
}
if(!!n.getBoundingClientRect){
var o=n.getBoundingClientRect();
var w=o.width||o.right-o.left;
var h=o.height||o.bottom-o.top;
return {x:o.left,y:o.top,w:w,h:h,bounding:true};
}else{
var box=window.getComputedStyle(n,null);
var x=0,y=0;
while(n&&n.tagName!="BODY"){
x+=n.clientLeft;
y+=n.clientTop;
n=n.parentNode;
}
return {x:x,y:y,w:parseFloat(box.width,10),h:parseFloat(box.height,10),compat:true};
}
},error:function(msg){
console.error(msg||"An error has occurred.");
},style:function(_27,_28,_29){
_27=this.byId(_27);
if(typeof (_28)=="string"){
if(_29!==undefined){
_27.style[_28]=_29;
}else{
var s=_27.currentStyle||_27.ownerDocument.defaultView.getComputedStyle(_27,null);
if(s[_28]=="auto"){
if(_27[_28]){
return _27[_28];
}
console.error("missing IE auto fix for ",_28);
}
return /px/.test(s[_28])?parseInt(s[_28],10):s[_28];
}
}else{
for(var nm in _28){
this.style(_27,nm,_28[nm]);
}
}
return true;
},css:function(n,_2a,_2b){
if(!n||!_2a){
return;
}
var c="className";
var r=new RegExp(_2a,"g");
if(_2b===undefined||_2b){
if(r.test(n[c])){
return;
}
n[c]+=n[c]?" "+_2a:_2a;
}else{
if(!r.test(n[c])){
return;
}
n[c]=/\s/.test(n[c])?n[c].replace(r,""):"";
}
},create:function(_2c,tag,c,_2d,_2e){
var n;
if(_2e){
n=d.createElement(tag);
_2c.parentNode.replaceChild(n,_2c);
}else{
n=_2c.appendChild(d.createElement(tag));
}
this.css(n,c);
if(_2d){
for(var nm in _2d){
if(nm=="innerHTML"){
n.innerHTML=_2d[nm];
}else{
n.setAttribute(nm,_2d[nm]);
}
}
}
return n;
},destroy:function(n){
var t=_8();
t.appendChild(n.parentNode.removeChild(n));
t.innerHTML="";
},selectable:function(_2f,_30){
_2f=this.byId(_2f);
if(this.is_ff()){
_2f.style.MozUserSelect=_30?"":"none";
}else{
if(this.is_webkit()){
_2f.style.KhtmlUserSelect=_30?"auto":"none";
}else{
if(this.is_ie()){
var v=(_2f.unselectable=_30?"":"on");
var _31=_2f.getElementsByTagName("*");
for(var i=0,len=_31.length;i<len;i++){
_31[i].unselectable=_30?"":"on";
}
}
}
}
},timeCode:function(pos,_32){
if(!isNaN(pos)){
var tc,hh,mm,ss,_33=".0";
if(Math.floor(pos)!=pos){
_33=(((pos-Math.floor(pos)).toString()).substring(1,3));
pos=Math.floor(pos);
}
hh=Math.floor(pos/3600);
mm=Math.floor((pos-hh*3600)/60);
ss=Math.floor(pos-(hh*3600)-(mm*60));
if(hh<10){
hh="0"+hh;
}
if(mm<10&&mm>0){
mm="0"+mm;
}
if(ss<10){
ss="0"+ss;
}
if(pos>3600){
tc=hh+":"+mm+":"+ss;
}else{
if(_32=="mm_ss"){
tc=mm+":"+ss;
}else{
tc=mm+":"+ss+_33;
}
}
}else{
console.warn("toTimeCode failed: "+pos+" ::"+Number(pos));
return "0:00";
}
return tc;
}};
bv.connect(document,"DOMContentLoaded",function(){
bv.onDomReady();
});
window.bv=bv;
console.log("BV loaded!");
})();
(function(){
var _1=7,_2=8,_3=9,_4=10,_5=12,_6=14,_7=15,_8=19,_9=20,_a=21,_b=22,_c=23,DS=24,_d=25,_e=26,_f=27,GAT=28,_10=123,BV=123,_11=1234,a="http://video.bettervideo.com/",b="http://video2.bettervideo.com/",c="http://www.forrentvideo.com/",d="http://video2.bettervideo.com/video/DOM/MP4",ff="http://player.bettervideo.com/";
bv.settings={lidArray:null,lid:0,vid:0,bid:0,cid:0,init:function(o){
for(var nm in o){
if((nm=="locationId"||nm=="lid")&&o[nm].length){
this.lidArray=o[nm];
this.lid=o[nm]=this.lidArray[0];
}else{
this[nm]=o[nm];
}
}
},getBandwidthOptions:function(){
if(!this.bid){
return [];
}
return [{lid:this.lid,text:this.getVideoSizeLabel(this.lid),path:this.getVideoPath(),preview:this.getPreviewPath(),selected:false},{lid:this.bid,text:this.getVideoSizeLabel(this.bid),path:this.getVideoPath({lid:this.bid}),preview:this.getPreviewPath({lid:this.bid}),selected:true}];
},getVideoPath:function(o){
o=o||{};
var vid=o.vid||this.vid,lid=o.lid||this.lid,cid=o.cid||this.cid,bid=o.bid||this.bid,p;
switch(cid){
case _e:
return a+"video/ClubAJAX/"+vid+".mp4";
case _7:
case _5:
case _6:
case _2:
case _1:
p=c;
switch(lid){
case 0:
return p+"mpg4/default/"+vid+".mp4";
case 2:
return p+"flash/large/"+vid+".flv";
case 4:
return p+"mpg4/"+vid+"M.mp4";
case 5:
return "http://video2.bettervideo.com/video/DOM/MP4640x360/"+cid+"."+vid+".mp4";
case 6:
return d+"320x180/"+cid+"."+vid+".mp4";
default:
return p+"flash/small/"+vid+"S.flv";
}
break;
case _10:
p=(bv.is_ff()?ff:b)+"video/BET/MP4";
var ext=bv.is_ff()?".ogv":".mp4";
switch(lid){
case 3:
return p+"480x360/"+vid+ext;
case 2:
return p+"360x270/"+vid+ext;
default:
return p+"480x270/"+vid+ext;
}
}
return a;
},getPreviewPath:function(o){
o=o||{};
var vid=o.vid||this.vid,lid=o.lid||this.lid,cid=o.cid||this.cid,bid=o.bid||this.bid,p;
console.log("PREV:",vid,cid,this.vid,this.cid,o.vid);
switch(cid){
case _1:
case _2:
p=c;
switch(lid){
case 0:
return p+"flash/preview/default/"+vid+".jpg";
case 2:
case 4:
case 5:
return p+"flash/preview/large/"+vid+"PL.jpg";
default:
return p+"flash/preview/small/"+vid+"PS.jpg";
}
case _10:
p=b;
return p+"video/BET/JPG480x270/"+vid+".jpg";
}
return null;
},update:function(o){
},getVideoSizeLabel:function(lid){
var _12=this.getVideoPath({lid:lid});
if(/\d\d\dx\d\d\d/.test(_12)){
return /\d\d\dx\d\d\d/.exec(_12)[0].split("x")[0];
}else{
switch(this.cid){
case _1:
case _2:
case _7:
case _5:
case _6:
switch(lid){
case 2:
case 4:
return "640";
case 0:
default:
return "320";
}
break;
}
}
return "NA";
}};
})();
(function(){
var d=document;
var el=document.createElement("bv");
var b=window.bv;
var _1={embed:!!d.embeds,object:!d.embeds,touch:function(){
return b.is_imobile();
},transitions:function(){
return b.is_webkit()&&!b.is_chrome();
},transitions3D:function(){
return b.is_webkit()&&!b.is_chrome();
},addEventListener:function(){
return !el.attachEvent;
},unicode:function(){
return !b.is_ie()&&!b.is_chrome();
},video:function(){
return b.is_webkit()||(b.is_ff()&&window.ffVideo);
},css:function(_2){
switch(_2){
case "box-shadow":
case "opacity":
return !b.is_ie();
}
return true;
}};
var _3=function(_4,_5){
if(_hasevent[_4]!==undefined){
return _hasevent[_4];
}
var _6=_5||d.createElement("div");
_4="on"+_4;
var _7=_4 in _6;
if(!_7){
if(_6.setAttribute&&_6.removeAttribute){
_6.setAttribute(_4,"");
_7=typeof _6[_4]=="function";
if(typeof _6[_4]!="undefined"){
_6[_4]=void 0;
}
_6.removeAttribute(_4);
}
}
_6=null;
_hasevent[_4]=_7;
return _7;
};
window.bv.supports=_1;
window.bv.hasEvent=_3;
})();
(function(){
var _1=function(_2){
return {mp4:"video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"",ogv:"video/ogg; codecs=\"theora, vorbis\""}[_2];
};
var _1=function(_3){
return {mp4:"video/mp4",ogv:"video/ogg"}[_3];
};
var _4=function(_5){
return /ogv/.test(_5)?_1("ogv"):_1("mp4");
};
var _6;
var d=document;
var _7=[];
var _8=function(_9){
};
bv.Player=function(_a){
bv.addSS();
var v=this.video=this.embed(_a);
bv.onPlaylist(this,"nextVideo");
this.node=bv.byId("bvVideoNode");
this.parent=this.node.parentNode;
this.addControls(_a);
var _b,_c;
bv.connect(v,"loadedmetadata",bv.hitch(this,function(_d){
console.warn("   ---------- > meta pre event:",_d);
_b=_d.target;
if(_c){
this.onMeta(_b);
}
}));
var _e=setInterval(bv.hitch(this,function(t){
if(v.readyState>0){
_c=true;
clearInterval(_e);
if(_b){
this.onMeta(_b);
}
}
}),200);
};
bv.Player.prototype={duration:0,isFull:false,complete:false,onLoaded:function(){
if(bv.byId("ua")){
bv.byId("ua").innerHTML=navigator.userAgent;
}
this.bodyRestoreStyle=bv.style(d.body,"overflow");
window.player=this;
},onComplete:function(){
console.log("-=VIDI FINI=-");
if(!this.nextVideo()){
console.log(" playlist end.");
this.complete=true;
this.onPause();
bv.style(this.preview,"display","block");
bv.style(this.scrBtn,"display","block");
}else{
console.log("play next...");
this.video.play();
}
},onRestart:function(){
this.complete=false;
setTimeout(bv.hitch(this,"onPlay"),1);
setTimeout(bv.hitch(this,function(){
this.video.currentTime=0.1;
this.video.play();
}),260);
},onMeta:function(m){
this.meta=m;
this.duration=m.duration;
this.videoWidth=m.videoWidth;
this.videoHeight=m.videoHeight;
this.videoAspect=this.videoHeight/this.videoWidth;
console.warn("________________________________________________ONMETA / duration:",this.duration);
bv.onSS(bv.hitch(this,function(){
this.durNode.innerHTML=bv.timeCode(m.duration);
this.onResize();
console.warn("-----------------------> onSS META:",m.duration,this.videoWidth,this.videoHeight,{video:m});
}));
},onError:function(_f){
console.error("Video Error:",_f.target.error,_f.target.src);
},onFrame:function(evt){
var p=this.video.currentTime/this.duration;
this.timeNode.innerHTML=bv.timeCode(this.video.currentTime);
if(this.isDragging){
return;
}
this.scrub.update(p);
},onProgress:function(evt){
var p,v=this.video;
if(evt.total){
p=(evt.loaded/evt.total);
}else{
p=((this.video.buffered.end(0)/this.video.duration));
}
this.prog.update(p);
},onResize:function(){
var o=bv.size(this.node);
if(this.isFull){
document.body.scrollTop=0;
o.h-=this.controlsSize.h;
}
var v=this.video;
var p;
if(this.preview&&bv.style(this.preview,"display")!="none"){
p=this.preview;
}
var ah=o.w/this.videoWidth*this.videoHeight||o.h;
var aw=o.h/this.videoWidth*this.videoHeight||o.w;
if(this.videoAspect){
if(o.h/o.w>this.videoAspect){
v.width=o.w;
v.height=o.w/this.videoWidth*this.videoHeight;
v.style.top=(o.h-this.video.height)/2+"px";
v.style.marginTop="0";
}else{
v.height=o.h;
v.width=o.h/this.videoHeight*this.videoWidth;
v.style.marginTop=0;
v.style.top=0;
}
}
if(p){
ah=o.w/this.previewWidth*this.previewHeight;
aw=o.h/this.previewHeight*this.previewWidth;
if(o.h/o.w>this.previewAspect){
bv.style(p,{width:o.w+"px",height:ah+"px",top:"50%",marginTop:"-"+(ah/2)+"px",left:"0",marginLeft:"0"});
}else{
bv.style(p,{height:o.h+"px",width:aw+"px",top:"0px",marginTop:"0px",left:"50%",marginLeft:"-"+(aw/2)+"px"});
}
}
},stopDefault:function(){
var _10=function(evt){
evt.preventDefault();
};
this.defCons=[bv.connect(d.body,"touchmove",_10)];
bv.style(d.body,"overflow","hidden");
},resumeDefault:function(){
for(var i=0;i<this.defCons.length;i++){
bv.disconnect(this.defCons[i]);
}
bv.style(d.body,"overflow",this.bodyRestoreStyle);
},prepFull:function(){
if(!this.posNodes){
this.posNodes={};
var n=this.node.parentNode;
while(n.tagName!="BODY"){
var s=bv.style(n,"position");
if(s=="relative"||s=="absolute"){
this.posNodes[n.id]={node:n,orgPos:s};
}
n=n.parentNode;
}
}
for(var nm in this.posNodes){
bv.style(this.posNodes[nm].node,"position","inherit");
}
},unPrepFull:function(){
for(var nm in this.posNodes){
bv.style(this.posNodes[nm].node,"position",this.posNodes[nm].orgPos);
}
},onFullscreen:function(){
var de=d.documentElement;
if(this.isFull){
console.warn("FULL ON");
this.stopDefault();
}else{
console.warn("FULL OFF");
this.resumeDefault();
}
},onAbort:function(){
_8("abort");
this.onPause();
},onEmpty:function(){
_8("empty");
},onEmptied:function(){
_8("emptied");
},onWaiting:function(){
_8("waiting");
},fullscreen:function(){
var v=this.video;
if(false){
v.webkitEnterFullScreen();
}else{
this.isFull=!this.isFull;
var p=this.isPlaying();
if(this.isFull){
this.prepFull();
}else{
this.unPrepFull();
}
bv.css(this.node,"fullscreen",this.isFull);
if(this.isFull){
_6=bv.connect(window,"resize",this,"onResize");
this.onResize();
}else{
this.onResize();
bv.disconnect(_6);
}
this.onFullscreen();
}
},connect:function(){
if(bv.is_iphone()){
return;
}
var v=this.video;
var t=this;
_7=[bv.connect(v,"play",this,"onPlay"),bv.connect(v,"pause",this,"onPause"),bv.connect(v,"progress",this,"onProgress"),bv.connect(v,"error",this,"onError"),bv.connect(v,"timeupdate",this,"onFrame"),bv.connect(v,"ended",this,"onComplete"),bv.connect(v,"abort",this,"onAbort"),bv.connect(v,"empty",this,"onEmpty"),bv.connect(v,"emptied",this,"onEmptied"),bv.connect(v,"waiting",this,"onWaiting")];
_7.push(bv.connect(v,"seeked",this,function(evt){
if(this.complete&&!v.paused){
this.onRestart();
}
}));
var ss=bv.query("source");
for(var i=0;i<ss.length;i++){
_7.push(bv.connect(ss[i],"error",this,"onError"));
}
},disconnect:function(){
for(var i=0;i<_7.length;i++){
bv.disconnect(_7[i]);
}
},onPlay:function(){
console.log("<< PLAY >>",this.previewShowing());
this.btnPlay.showPause();
if(this.previewShowing()){
bv.style(this.preview,"display","none");
bv.style(this.scrBtn,"display","none");
}
},onPause:function(){
console.log("<< PAUSE >>");
this.btnPlay.showPlay();
},play:function(){
console.log("video play");
this.video.play();
},pause:function(){
this.video.pause();
},previewShowing:function(){
return this.preview&&bv.style(this.preview,"display")!="none";
},onPreview:function(evt){
this.previewWidth=evt.target.naturalWidth;
this.previewHeight=evt.target.naturalHeight;
console.log("onPreview:",this.previewWidth,this.previewHeight);
this.previewAspect=this.previewHeight/this.previewWidth;
var t=bv.is_ipad()?1:1;
this.onResize();
},onPreviewClick:function(evt){
console.warn("CLICK",evt);
this.video.play();
},embed:function(p){
var bo=bv.settings.getBandwidthOptions();
var _11="";
if(bo.length){
_11="<div class=\"box btn bandwidth\">"+"<div class=\"bandwidthFlyoutBack\">";
for(var i=0;i<bo.length;i++){
console.log("BO:",bo[i]);
_11+="<div class=\"box btn "+(bo[i].selected?"selected":"")+"\">"+bo[i].text+"</div>";
if(bo[i].selected){
p.src=bo[i].path;
}
}
_11+="</div><span id=\"bandwidthLabel\"></span></div>";
}
console.log("EMBED:",p);
this.videoHeight=p.h;
this.videoWidth=p.w;
this.videoAspect=this.videoHeight/this.videoWidth;
var n="\n";
var s="<div id=\"bvVideoNode\" class=\"BVideo\">"+n;
s+="<div id=\"screenPlayButton\"></div>"+n;
s+="<img id=\"bvVideoPreview\"  />"+n;
s+="<video id=\"bvVideo\" width=\""+p.w+"\" height=\""+p.h+"\" src=\""+p.src+"\" autobuffer buffer preload=\"metadata\"></video>"+n;
s+="<div class=\"wrap\">"+"<div class=\"controls\">"+"<div class=\"box btn play\" id=\"play\"></div>"+"<div class=\"box slider\">"+"<div class=\"back\">"+"<div class=\"progress\"></div>"+"<div class=\"scrub\"></div>"+"<div class=\"time\">00:00</div>"+"<div class=\"dur\">00:00</div>"+"</div>"+"</div>"+_11+"<div class=\"box btn fullscreen\"></div>"+"<div class=\"box btn volume\">"+"<div class=\"box btn volumeButtonBack\">"+"<div class=\"volumeButtonSlider\">"+"<div class=\"volumeButtonScrub\"></div>"+"</div>"+"</div>"+"</div>"+"</div>"+"</div>";
s+="</div>";
p.node.innerHTML=s;
var v=p.node.getElementsByTagName("video")[0]||p.node.getElementsByTagName("div")[0];
this.preview=bv.byId("bvVideoPreview");
if(this.preview&&p.preview){
this.preview.src=p.preview;
bv.connect(this.preview,"load",this,"onPreview");
bv.connect(this.preview,"click",this,"onPreviewClick");
}else{
}
this.scrBtn=bv.byId("screenPlayButton");
bv.connect(this.scrBtn,"click",this,"onPreviewClick");
if(bv.is_ipad()){
v.src=p.src;
v.load();
}
return v;
},setMedia:function(_12,opt){
opt.videoId=_12||opt.videoId;
console.log("setMedia videoId",opt.videoId,_12);
var o=bv.fixParams(opt);
var p=bv.addVideo(o);
console.log("setMedia:",p);
this.pause();
setTimeout(bv.hitch(this,function(){
if(p.preview){
this.preview.src=p.preview;
}
this.video.src=p.path;
this.video.load();
this.play();
console.warn("NEW VIDEO LOADED",this.video.src,this.video.currentSrc);
}),100);
},nextVideo:function(){
var _13=true;
var p=bv.nextVideo(this);
console.log("NEXT::",p);
if(p=="EOD"){
return false;
}
if(p.preview){
this.preview.src=p.preview;
}
this.video.src=p.path;
this.video.load();
console.log("SET TO:",this.video.src);
return _13;
},addControls:function(p){
var _14=p.node;
bv.onSS(bv.hitch(this,function(){
this.controls=bv.query(".controls","last");
this.controlsSize=bv.size(this.controls);
this.btnPlay=new bv.Play({player:this,node:bv.query(".play","last")});
var h=this.btnPlay.h;
this.slider=new bv.Slider({player:this,h:h,node:bv.query(".slider","last")});
this.prog=new bv.Progress({player:this,h:h,node:bv.query(".progress","last")});
this.scrub=new bv.Scrub({player:this,h:h,node:bv.query(".scrub","last")});
if(bv.settings.getBandwidthOptions().length){
var bnd=new bv.Bandwidth({player:this,h:h,node:bv.query(".bandwidth","last")});
}
var fs=new bv.Fullscreen({player:this,h:h,node:bv.query(".fullscreen","last")});
var vo=new bv.Volume({player:this,h:h,node:bv.query(".volume","last")});
this.volumeScrub=new bv.VolumeScrub({player:this,node:bv.query(".volumeButtonScrub","last")});
var _15=bv.query(".volumeButtonSlider","last");
this.voldragger=new bv.Draggable(_15,bv.hitch(this,"onDragVolume"));
this.dragger=new bv.Draggable(this.slider.node,bv.hitch(this,"onDragSlider"));
this.connect();
this.timeNode=bv.query(".time","last");
this.durNode=bv.query(".dur","last");
this.shyControls();
this.onLoaded();
}));
},shyControls:function(){
if(bv.supports.touch()||!bv.supports.transitions()){
return;
}
var _16=this.controls.parentNode;
var v,_17=false;
var _18=function(){
clearTimeout(v);
bv.style(_16,"bottom","0px");
};
var _19=function(){
clearTimeout(v);
v=setTimeout(function(){
bv.style(_16,"bottom","-30px");
},500);
};
bv.connect(this.node,"mouseover",this,function(){
_17=true;
_18();
});
bv.connect(this.node,"mouseout",this,function(){
_17=false;
console.warn("OUT",this.isPlaying(),this.complete,this.video.paused,this.video);
if(!this.isPlaying()){
return;
}
_19();
});
bv.aop(this,"onPlay",this,function(){
console.warn("AOP PLAY",this.isPlaying());
if(!_17){
_19();
}
});
bv.aop(this,"onPause",this,function(){
console.warn("AOP PAUSE",this.isPlaying());
_18();
});
},setVolume:function(p){
this.video.volume=p;
},isPlaying:function(){
return this.complete?false:!this.video.paused;
},onDragVolume:function(obj,_1a){
var y=obj.y;
var p=y/this.voldragger.box.h;
p=Math.min(p,1);
p=Math.max(p,0);
p=1-p;
this.volumeScrub.update(p,true);
this.volumeScrub.adjustColor(p);
this.setVolume(p);
},onDragSlider:function(obj,_1b){
var x=obj.x;
var p=x/this.dragger.box.w;
p=Math.min(p,1);
p=Math.max(p,0);
if(_1b=="start"){
this.isDragging=true;
}else{
if(_1b=="end"){
this.isDragging=false;
}
}
this.scrub.update(p);
this.video.currentTime=this.duration*p;
}};
bv.Play=function(_1c){
this.type="play";
this.init(_1c);
this.isPlaying=false;
this.pauseicon=bv.canvas.add(this.node,this.w,this.h,"pause");
this.pauseicon.style.display="none";
this.showPlay=function(){
this.icon.style.display="";
this.pauseicon.style.display="none";
this.isPlaying=false;
};
this.showPause=function(){
this.icon.style.display="none";
this.pauseicon.style.display="";
this.isPlaying=true;
};
bv.connect(this.node,"click",this,function(){
if(this.icon.style.display=="none"){
this.player.pause();
}else{
this.player.play();
}
});
};
bv.Progress=function(_1d){
this.type="progress";
this.init(_1d);
};
bv.Scrub=function(_1e){
this.type="progress";
this.init(_1e);
};
bv.Slider=function(_1f){
this.type="slider";
this.init(_1f);
bv.connect(this.node,"click",this,function(evt){
console.log("click:",evt.layerX);
});
};
bv.Bandwidth=function(_20){
this.type="bandwidth";
this.init(_20);
this.labelNode=bv.byId("bandwidthLabel");
this.setLabel=function(v){
this.labelNode.innerHTML=v;
};
this.show=function(s){
_21=s;
bv.style(_22,"display",_21?"block":"none");
};
var _21=false;
var _22=bv.g(".bandwidthFlyoutBack");
var _23=bv.query(".bandwidthFlyoutBack > .btn");
var box=bv.size(_23[0]);
var pad=bv.style(_22,"paddingTop");
bv.style(_22,{height:box.h*_23.length+pad*_23.length+pad+"px",top:"-"+(box.h*_23.length+pad*_23.length+pad*4)+"px"});
var _24=bv.settings.getBandwidthOptions();
for(var i=0;i<_24.length;i++){
_24[i].btn=_23[i];
bv.connect(_24[i].btn,"click",this,function(evt){
var n=evt.target;
console.log("click bandwidth");
});
}
bv.style(_22,"display","none");
bv.connect(this.node,"click",this,function(evt){
this.show(!_21);
console.log(evt.target.className,"::",evt.target);
});
this.setLabel("320");
};
bv.Fullscreen=function(_25){
this.type="fullscreen";
this.init(_25);
bv.connect(this.node,"click",this,function(evt){
console.log("click fullscreen");
this.player.fullscreen();
});
};
bv.Volume=function(_26){
this.type="volume";
this.init(_26);
var _27=bv.query(".volumeButtonBack","last");
var _28;
this.show=function(_29){
if(_29){
console.log("show vol!");
bv.style(_27,"display","block");
}else{
console.log("hide vol!");
bv.style(_27,"display","none");
bv.disconnect(_28);
}
};
this.isOver=function(n){
while(n.tagName!="BODY"){
if(n===this.icon||n===this.node||n===_27){
return true;
}
n=n.parentNode;
}
return false;
};
bv.connect(this.icon,"click",this,function(evt){
if(bv.style(_27,"display")=="none"){
_28=bv.connect(document,"click",this,function(evt){
if(!this.isOver(evt.target)){
this.show(false);
}
});
this.show(true);
}else{
this.show(false);
}
});
};
bv.VolumeScrub=function(_2a){
this.type="voScrub";
this.init(_2a);
this.adjustColor=function(p){
bv.style(this.node,"backgroundColor","rgba(255, "+Math.floor(p*255)+", 0, 1)");
};
};
var _2b={init:function(_2c){
this.node=_2c.node;
this.player=_2c.player;
this.video=this.player.video;
var box=bv.size(this.node);
this.w=box.w;
this.h=_2c.h||box.h;
if(!/scrub|progress|slider|voScrub|bandwidth/.test(this.type)){
this.icon=bv.canvas.add(this.node,this.w,this.h,this.type);
}
},update:function(p,_2d){
var _2e=_2d?"height":"width";
this.node.style[_2e]=(p*100).toFixed(1)+"%";
}};
bv.Play.prototype=_2b;
bv.Slider.prototype=_2b;
bv.VolumeScrub.prototype=_2b;
bv.Progress.prototype=_2b;
bv.Scrub.prototype=_2b;
bv.Bandwidth.prototype=_2b;
bv.Fullscreen.prototype=_2b;
bv.Volume.prototype=_2b;
bv.initPlayer=function(_2f){
this.player=new bv.Player(_2f);
};
})();
(function(){
var _1=[];
var _2;
var _3="video/mp4",_4="video/ogg";
bv.mix({index:-1,playlist:null,addPlaylist:function(_5){
this.playlist=_5.file;
for(var i=0;i<_1.length;i++){
_1[i]();
}
_1=[];
},nextVideo:function(_6){
_2=_6||_2;
if(!this.playlist||this.index>this.playlist.length-1){
this.index=-1;
}
this.index++;
if(!this.playlist||this.index>this.playlist.length-1){
return "EOD";
}
var _7=this.playlist[this.index];
var r=_2.video.canPlayType(_4);
if(r&&r!="no"&&!_7.mp4){
_7.mp4=_7.path;
_7.path=_7.ogg;
}
return _7;
},addVideo:function(o){
var v={videoId:o.videoId,src:o.src,path:o.src,preview:o.preview,locationId:o.locationId};
return v;
},onPlaylist:function(a1,a2){
var cb=this.hitch(a1,a2);
if(this.playlist){
cb();
return;
}
_1.push(cb);
}});
})();
(function(){
bv.canvas={add:function(_1,w,h,_2){
var _3=bv.create(_1,"canvas",null,{width:w,height:h});
var c=_3.getContext("2d");
switch(_2){
case "play":
this.drawPlay(c,w,h);
break;
case "pause":
this.drawPause(c,w,h);
break;
case "fullscreen":
this.drawFS(c,w,h);
break;
case "volume":
this.drawVol(c,w,h);
break;
}
return _3;
},draw:function(c,x,y,w,h,_4){
c.fillStyle="rgb(185,213,223)";
c.beginPath();
for(var i=0;i<_4.length;i++){
var p=_4[i];
if(p.m){
c.closePath();
c.moveTo(x+p.x*w,y+p.y*h);
}else{
c.lineTo(x+p.x*w,y+p.y*h);
}
}
c.fill();
c.closePath();
},drawVol:function(c,w,h){
var _5=1;
var x=(w-(h-_5*2))/2;
var y=_5;
w=h=h-_5*2;
var _6=[{x:0,y:0.378,m:1},{x:0.154,y:0.378},{x:0.328,y:0.141},{x:0.397,y:0.141},{x:0.397,y:0.87},{x:0.328,y:0.87},{x:0.154,y:0.636},{x:0,y:0.636},{x:0.562,y:0.363,m:1},{x:0.584,y:0.434},{x:0.595,y:0.562},{x:0.56,y:0.682},{x:0.729,y:0.25,m:1},{x:0.768,y:0.336},{x:0.768,y:0.465},{x:0.779,y:0.616},{x:0.734,y:0.751},{x:0.897,y:0.106,m:1},{x:0.938,y:0.204},{x:0.973,y:0.326},{x:0.992,y:0.482},{x:0.975,y:0.656},{x:0.938,y:0.792},{x:0.899,y:0.89}];
this.draw(c,x,y,w,h,_6);
},drawFS:function(c,w,h){
h-=2;
var _7=2;
var x=(w-(h-_7*2))/2;
var y=_7;
w=h=h-_7*2;
var _8=[{x:0,y:0,m:1},{x:0.27,y:0},{x:0.135,y:0.072},{x:0.3,y:0.225},{x:0.25,y:0.275},{x:0.08,y:0.13},{x:0,y:0.265},{x:0.748,y:0,m:1},{x:1,y:0},{x:1,y:0.242},{x:0.915,y:0.128},{x:0.765,y:0.258},{x:0.718,y:0.21},{x:0.868,y:0.075},{x:1,y:0.745,m:1},{x:1,y:1},{x:0.752,y:1},{x:0.865,y:0.922},{x:0.72,y:0.78},{x:0.775,y:0.728},{x:0.918,y:0.868},{x:0.27,y:1,m:1},{x:0,y:1},{x:0,y:0.728},{x:0.082,y:0.872},{x:0.24,y:0.72},{x:0.292,y:0.77},{x:0.135,y:0.922}];
this.draw(c,x,y,w,h,_8);
},drawPlay:function(c,w,h){
var _9=[{x:0.25,y:0.15,m:1},{x:0.65,y:0.45},{x:0.25,y:0.75}];
this.draw(c,0,0,w,h,_9);
},drawPause:function(c,w,h){
var ow=w,oh=h,_a=2;
h-=4;
var x=(w-(h-_a*2))/2-2;
var y=_a+1;
w=h=h-_a*2;
var _b=[{x:0,y:0,m:1},{x:0.421,y:0},{x:0.421,y:1},{x:0,y:1},{x:0.564,y:0,m:1},{x:1,y:0},{x:1,y:1},{x:0.564,y:1}];
this.draw(c,x,y,w,h,_b);
}};
})();
(function(){
var _1=0,_2=0;
var _3=function(e){
var _4="";
for(var nm in e){
_4+=nm+": "+e[nm]+"  <br />";
}
_4+=" **DONE** <br />";
bv.byId("log").innerHTML=_4;
};
bv.makeDraggable=function(n,h){
(function(b){
var _5=0,_6=0,_7=n,_8=h,_9=b.size(n);
b.selectable(_8);
new b.Draggable(_8,function(o,_a){
switch(_a){
case "start":
_5=o.layerX===undefined?o.cx-b.style(_7,"left"):o.layerX;
_6=o.layerY===undefined?o.cy-b.style(_7,"top"):o.layerY;
break;
case "move":
o.offX=_5;
o.offY=_6;
o.moveToX=o.cx-_5;
o.moveToY=o.cy=_6;
_9.x+=o.moveX;
_9.y+=o.moveY;
b.style(_7,{top:_9.y+"px",left:_9.x+"px",marginLeft:"0px"});
break;
case "end":
break;
}
});
})(bv);
};
bv.Draggable=function(n,_b,_c){
this.vert=_c||false;
this.node=n;
this.begTime=0;
this.callback=_b;
var nm=bv.is_imobile()?"touchstart":"mousedown";
bv.connect(n,nm,this,"onStart");
};
if(bv.supports.touch()){
bv.Draggable.prototype={handle:function(_d,_e){
_d.preventDefault();
var x,y,cx,cy;
if(_d.targetTouches.length<1){
x=_1;
y=_2;
cx=x;
cy=y;
}else{
cx=_d.targetTouches[0].clientX;
cy=_d.targetTouches[0].clientY;
x=cx-this.box.x;
y=cy-this.box.y;
}
var _f=x-_1;
var _10=y-_2;
_1=x;
_2=y;
this.callback({x:x,y:y,moveX:_f,moveY:_10,cx:cx,cy:cy},_e);
},onMove:function(evt){
this.begTime=0;
this.handle(evt,"move");
},onEnd:function(evt){
this.handle(evt,"end");
if(new Date().getTime()-this.begTime<400){
this.handle(evt,"click");
}
for(var i=0;i<this.cons.length;i++){
bv.disconnect(this.cons[i]);
}
},onStart:function(evt){
if(new Date().getTime()-this.begTime<400){
this.handle(evt,"dblclick");
this.begTime=0;
return;
}
this.begTime=new Date().getTime();
this.box=bv.size(this.node);
this.handle(evt,"start");
this.cons=[bv.connect(this.node,"touchmove",this,"onMove"),bv.connect(this.node,"touchend",this,"onEnd"),bv.connect(this.node,"touchcancel",this,"onEnd")];
}};
}else{
bv.Draggable.prototype={handle:function(evt,_11){
bv.stopEvent(evt);
var x=evt.clientX-this.box.x;
var y=evt.clientY-this.box.y;
var cx=evt.clientX;
var cy=evt.clientY;
var _12=x-_1;
var _13=y-_2;
_1=x;
_2=y;
this.callback({x:x,y:y,moveX:_12,moveY:_13,cx:cx,cy:cy,layerX:evt.layerX,layerY:evt.layerY},_11);
},onMove:function(evt){
this.handle(evt,"move");
},onEnd:function(evt){
this.handle(evt,"end");
for(var i=0;i<this.cons.length;i++){
bv.disconnect(this.cons[i]);
}
},onStart:function(evt){
_1=0;
_2=0;
this.box=bv.size(this.node);
this.handle(evt,"start");
this.cons=[bv.connect(document,"mousemove",this,"onMove"),bv.connect(document,"mouseup",this,"onEnd")];
}};
}
})();
(function(){
bv.mix({isSS:function(){
var ss=this.query("link[href*=bv]","last");
if(!ss){
return false;
}
if(!ss.sheet){
return false;
}
try{
if(!ss.sheet.cssRules){
return false;
}
}
catch(e){
return false;
}
if(!ss.sheet.cssRules.length){
return false;
}
return true;
},onSS:function(m){
console.log("onSS already fired........");
m();
},addSS:function(){
if(this.root===undefined){
console.warn("stylesheet not added. Root undefined.");
return;
}
this.addSS=function(){
};
var _1=this.onSS;
var _2=[];
this.onSS=function(m){
_2.push(m);
};
var _3=2;
var v=setInterval(this.hitch(this,function(){
if(this.isSS()||_3--<=0){
console.warn("______________SS READY",_2.length);
clearInterval(v);
if(_2.length){
for(var i=0;i<_2.length;i++){
console.log("fire...");
_2[i]();
console.log(" < fired");
}
_2=[];
}
this.onSS=_1;
}
}),50);
this.create(document.documentElement.firstChild,"link",null,{href:this.root+"bv.css"+this.cb(),rel:"stylesheet"});
}});
})();
(function(b){
var _1=false;
var _2;
b.mix({overlay:{show:function(){
if(!_2){
_2=b.create(document.body,"div","bvOverlay");
}else{
b.style(_2,"display","block");
}
},hide:function(){
b.style(_2,"display","none");
}}});
})(window.bv);
(function(b){
var _1=false;
var _2={width:320,height:180,padding:{top:100,sides:80,bottom:40},clientId:7,locationId:1,swf:"code/mds_player.swf",title:"BetterVideo Player"};
b.mix({dialog:function(_3,_4){
if(!this.domReady){
this.onReady(this,function(){
this.dialog(_3,_4);
});
return;
}
this.dialogbox.show(_3,_4);
},dialogbox:{built:false,node:null,titleBar:null,closeBtn:null,playerNode:null,containerNode:null,topNode:null,botNode:null,currentId:"",show:function(_5,_6){
var o=_2=b.mix(_2,_6||{});
console.warn("dialog options:",o);
if(this.containerNode){
b.style(this.containerNode,"visibility","visible");
console.log("new id:",_5!=this.currentId,_5);
if(_5!=this.currentId){
this.update(_5,o);
}
return;
}
o.dw=o.width+o.padding.sides*2;
o.dh=o.height+o.padding.top+o.padding.bottom;
this.containerNode=b.create(document.body,"div","bvDialogContainer");
if(!b.supports.css("box-shadow")){
this.ieShadowNode=b.create(this.containerNode,"div","bvIEShadow");
b.style(this.ieShadowNode,{width:_2.width+"px"});
}
this.node=b.create(this.containerNode,"div","bvDialog bvLiteBlueGrad bvShadow bvRndTop bvRndBot");
b.style(this.node,{width:_2.dw+"px"});
b.style(this.containerNode,{marginLeft:(_2.width+_2.padding.sides)*-0.5+"px"});
this.titleBar=b.create(this.node,"div","bvTitleBar bvLiteBlueGrad bvRndTop",{innerHTML:"<span>"+unescape(o.propertyID||o.title)+"</span>"});
this.titleNode=this.titleBar.getElementsByTagName("span")[0];
var _7=b.supports.unicode()?"&#10005 ":"r";
var _8=b.supports.unicode()?"bvCloseButton":"bvCloseButton dingbats";
this.closeBtn=b.create(this.titleBar,"div",_8,{innerHTML:_7});
this.topNode=b.create(this.node,"div","bvDialogTop");
this.playerNode=b.create(this.node,"div","bvDialogPlayer");
b.style(this.playerNode,{width:o.width+"px",height:o.height+"px"});
this.botNode=b.create(this.node,"div","bvDialogBottom");
if(o.clientId==7){
this.cityNode=b.create(this.topNode,"div","bvDialogTopLeft",{innerHTML:unescape(o.cityST)});
this.phoneNode=b.create(this.topNode,"div","bvDialogTopRight",{innerHTML:unescape(o.phoneNum)});
this.moreBtn=b.create(this.botNode,"button","bvLiteBlueGrad bvLeft",{innerHTML:"More Info"});
b.connect(this.moreBtn,"click",function(){
document.location.href=_2.moreInfo;
});
this.availBtn=b.create(this.botNode,"button","bvLiteBlueGrad bvCenter",{innerHTML:"Check Availability"});
b.connect(this.availBtn,"click",b,"launchAvailability");
this.emailBtn=b.create(this.botNode,"button","bvLiteBlueGrad bvRight",{innerHTML:"Email"});
b.connect(this.emailBtn,"click",b,"launchEmailProperty");
}else{
b.style(this.botNode,"height",o.padding.bottom+"px");
}
b.connect(this.closeBtn,"click",this,"hide");
this.built=true;
if(b.supports.video()){
_2.videoId=_5;
_2.node=this.playerNode;
b.initPlayer(b.fixParams(_2));
}else{
b.insertPlayer(_5,this.playerNode,_2);
}
this.currentId=_5;
var s=b.size(this.node);
if(this.ieShadowNode){
b.style(this.ieShadowNode,{height:s.h+"px",width:s.w+"px"});
}else{
if(b.is_mobile()){
var w=b.size(window);
console.log("window:",w.w,w.h,w.x,w.y);
b.style(this.containerNode,{top:w.y+200+"px",left:(w.w-s.w)/2+200+"px",marginLeft:0,marginTop:0});
}
}
b.makeDraggable(this.containerNode,this.titleBar);
},update:function(_9,o){
console.log("....update...");
b.setMedia(_9,o);
if(this.cityNode){
this.cityNode.innerHTML=unescape(o.cityST);
this.phoneNode.innerHTML=unescape(o.phoneNum);
this.titleNode.innerHTML=unescape(o.propertyID);
}
this.currentId=_9;
},hide:function(){
b.style(this.containerNode,"visibility","hidden");
b.doPause();
}}});
})(window.bv);
(function(){
var _1;
var _2;
var _3=null;
var _4=null;
var _5=null;
var _6=function(){
var p=bv.create(_1,"div","bvTransContainer");
_2=bv.create(p,"div","bvForm");
};
var _7=function(s){
return bv.create(_2,"div","bvFormTitle",{innerHTML:s});
};
var _8=function(){
return bv.create(_2,"div","bvFormClose",{innerHTML:"&#10005;"});
};
var _9=function(_a,_b,_c,_d){
var _e=bv.create(_2,"div","bvFormRow");
var _f=bv.create(_e,"div","label",{innerHTML:_a});
var _10=bv.create(_e,"input",_d,{name:_b,required:"",type:_c||"text"});
return {row:_e,label:_f,input:_10};
};
var _11=function(){
var row=bv.create(_2,"div","bvFormRow");
var _12=bv.create(row,"input",className,{name:name,required:"",type:type||"text"});
var lbl=bv.create(row,"div","label",{innerHTML:label});
return {row:row,label:lbl,input:_12};
};
var _13=function(){
return bv.create(_2,"div","bvFormSend",{innerHTML:"Send"});
};
var _14=function(){
this.init();
_7("Check Availability");
_9("First Name","first");
_9("Last Name","last");
_9("Email Address","email","email");
var o=_9("Move Date","date","date","bvFormDate");
var btn=bv.create(o.row,"div","bvFormCalButton",{innerHTML:"<span>"+(new Date().getDate()+"</span>")});
bv.connect(btn,"click",this,function(){
bv.toggleCalendar(o.input);
});
bv.connect(o.input,"focus",this,function(){
bv.showCalendar(o.input);
});
};
var _15=function(){
this.init();
_7("Email a Friend");
_9("First Name","first");
_9("Last Name","last");
_9("Email Address","email","email");
};
var _16=function(){
this.init();
_7("Email this property to a friend");
_9("Your Name","first");
_9("Your Email","email");
_9("Friend's Name","friendname");
_9("Email Address","email","email");
};
var _17=function(){
this.init();
_7("Email this property to a friend");
_9("Your Name","first");
_9("Your Email","email","email");
_9("Friend's Name","friendname");
_9("Friend's Email","friendEmail","email");
var row=bv.create(_2,"div","bvFormRow");
var lbl=bv.create(row,"div","label",{innerHTML:""});
var _18=bv.create(row,"input","bvCheckCopy",{name:"sendCopy",required:"",type:"checkbox"});
bv.create(row,"div","bvCopyLabel",{innerHTML:"Send me  copy of this email"});
};
var _19={closed:true,init:function(){
if(bv.player){
bv.player.pause();
_1=bv.player.node;
}else{
_1=bv.devNode();
}
_6();
bv.connect(_8(),"click",this,"hide");
bv.connect(_13(),"click",this,"hide");
this.node=_2;
bv.style(this.node,"display","none");
},hide:function(){
this.closed=true;
bv.hideCalendar();
bv.hideWidget(this.node);
},show:function(){
this.closed=false;
try{
bv.showWidget(this.node);
}
catch(e){
console.error(e);
}
},toggle:function(){
console.log("toggle form",this.closed);
if(this.closed){
console.log("show form");
this.show();
}else{
console.log("hide form");
this.hide();
}
}};
_14.prototype=_19;
_15.prototype=_19;
_17.prototype=_19;
bv.mix({showWidget:function(_1a){
bv.style(_1a,"display","block");
bv.style(_1a.parentNode,"display","block");
if(this.is_webkit()){
this.css(_1a,"hide",false);
this.css(_1a,"show");
}else{
bv.style(_1a,"opacity",0);
this.kwAni({node:_1a,prop:"opacity",beg:0,end:1});
}
},hideWidget:function(_1b){
var _1c=function(){
if(/bvTransContainer/.test(_1b.parentNode.className)){
bv.style(_1b.parentNode,"display","none");
}else{
bv.style(_1b,"display","none");
}
};
if(this.is_webkit()){
this.css(_1b,"show",false);
this.css(_1b,"hide");
var c=this.connect(_1b,"webkitAnimationEnd",this,function(){
this.disconnect(c);
_1c();
});
}else{
bv.style(_1b,"display","block");
bv.style(_1b,"opacity",1);
this.kwAni({node:_1b,prop:"opacity",beg:1,end:0,onEnd:_1c});
}
},kwAni:function(o){
var _1d=function(){
var dur=o.dur||500;
var _1e=new Date().getTime();
var inv=setInterval(bv.hitch(this,function(){
var t=new Date().getTime();
var ms=t-_1e;
var p=o.beg>o.end?1-(ms/dur):ms/dur;
bv.style(o.node,o.prop,p);
if(t>=dur+_1e){
clearInterval(inv);
o.onEnd&&o.onEnd();
}
}),30);
};
new _1d();
},launchAvailability:function(){
if(!_3){
console.log("new Availability");
_3=new _14();
}
_3.toggle();
},launchShare:function(){
if(!_4){
console.log("new Share");
_4=new _15();
}
_4.toggle();
},launchEmailProperty:function(){
if(!_5){
console.log("new Email");
_5=new _17();
}
_5.toggle();
},showEmailProperty:function(){
if(_5){
_5.show();
}else{
this.launchEmailProperty();
}
},hideEmailProperty:function(){
if(_5){
_5.hide();
}
}});
})();
(function(){
var _1,_2,_3;
Calendar=function(_4){
try{
this.input=_4;
var p=bv.create(bv.getMainNode(),"div","bvTransContainer cal");
this.node=bv.create(p,"div","bvCalendar");
var _5=bv.create(this.node,"div","bvCalHeader");
this.lft=bv.create(_5,"div","bvCalLft",{innerHTML:"&#9668;"});
this.month=bv.create(_5,"div","bvCalMonth",{innerHTML:"November 2010"});
this.rgt=bv.create(_5,"div","bvCalRgt",{innerHTML:"&#9658;"});
var _6=bv.create(this.node,"div","bvCalBody");
this.days=[];
var _7=0;
for(var c=0;c<7;c++){
for(var r=0;r<6;r++){
_7++;
this.days.push(bv.create(_6,"div",null,{innerHTML:_7}));
}
}
var _8=bv.create(this.node,"div","bvCalFooter");
console.log(this.node);
this.date=new Date();
this.selected=new Date();
this.setCalendar();
bv.connect(this.rgt,"click",this,function(){
this.setCalendar(1);
});
bv.connect(this.lft,"click",this,function(){
this.setCalendar(-1);
});
bv.connect(_6,"click",this,"onDayClick");
bv.style(this.node,"display","none");
}
catch(e){
console.error(e);
}
console.log("calendar built");
};
Calendar.prototype={closed:true,setCalendar:function(_9){
_9=_9||0;
var d=this.date;
d.setMonth(d.getMonth()+_9);
_1=d.getFullYear();
_2=d.getMonth();
this.month.innerHTML=this.getMonthName(d)+" "+_1;
var _a=this.getDaysInPrevMonth(d);
var _b=this.getDaysInMonth(d);
var _c=this.getFirstSunday(d);
var tx,_d=0,_e;
console.log("Sunday:",_c);
for(var i=0;i<this.days.length;i++){
tx=_c+1>0&&_c+1<=_b?_c+1:"&nbsp;";
_e=false;
if(_c+1>0&&_c+1<=_b){
tx=_c+1;
_e=true;
}else{
if(_c<0){
tx=_a+_c;
}else{
tx=++_d;
}
}
var _f=this.days[i];
_f.innerHTML=tx;
if(_e){
_f.className=this.dateLarger(_c+1)?this.isSelected(_c+1)?"on selected":"on future":"on";
}else{
_f.className="off";
}
_c++;
}
},hide:function(){
if(this.closed){
return;
}
console.log("hide!");
this.closed=true;
bv.hideWidget(this.node);
},show:function(){
if(!this.closed){
return;
}
console.log("show!");
this.closed=false;
bv.showWidget(this.node);
},toggle:function(){
if(this.closed){
this.show();
}else{
this.hide();
}
},setInput:function(){
var s=this.selected;
this.input.value=s.getMonth()+1+"/"+s.getDate()+"/"+s.getFullYear();
},onDayClick:function(evt){
console.log("onDayClick closed:",this.closed);
if(this.closed){
return;
}
var n=evt.target;
var c=n.className;
var d=n.innerHTML;
var s=this.selected;
console.log("click:",d,c);
if(/future/.test(c)){
s.setFullYear(_1);
s.setMonth(_2);
s.setDate(d);
this.setCalendar(0);
this.setInput();
this.hide();
}
},isSelected:function(_10){
var s=this.selected;
return s.getDate()==_10&&s.getMonth()==_2&&s.getFullYear()==_1;
},dateLarger:function(_11){
var doj=new Date();
var dt=doj.getDate();
var mo=doj.getMonth();
var yr=doj.getFullYear();
if(_11<=0){
return false;
}
if(_1>yr){
return true;
}
if(_1<yr){
return false;
}
if(_2>mo){
return true;
}
if(_2<mo){
return false;
}
return _11>=dt;
},getMonthName:function(_12){
var _13=["January","February","March","April","May","June","July","August","September","October","November","December"];
return _13[_12.getMonth()];
},getFirstSunday:function(d){
var dt=new Date(d.getTime());
dt.setDate(1);
return dt.getDay()*-1;
},isLeapYear:function(_14){
var _15=_14.getFullYear();
return !(_15%400)||(!(_15%4)&&!!(_15%100));
},getDaysInPrevMonth:function(_16){
var d=new Date(_16);
d.setMonth(d.getMonth()-1);
return this.getDaysInMonth(d);
},getDaysInMonth:function(_17){
var _18=_17.getMonth();
var _19=[31,28,31,30,31,30,31,31,30,31,30,31];
if(_18==1&&this.isLeapYear(_17)){
return 29;
}
return _19[_18];
}};
bv.mix({_calendar:null,toggleCalendar:function(_1a){
console.log("toggle",_3);
if(!_3){
_3=new Calendar(_1a);
}
_3.toggle();
},hideCalendar:function(){
if(!_3){
return;
}
console.log("hide",_3);
_3.hide();
},showCalendar:function(_1b){
console.log("show",_3);
if(!_3){
this.launchCalendar(_1b);
}else{
_3.show();
}
}});
setTimeout(function(){
},200);
})();
(function(){
var _1=window.cacheBust||false;
var _2=window.isDebug||window.debug||/debug=true/.test(document.location.href)||false;
window.bv.mix({flashArgs:{width:"220",height:"240",bgcolor:"#ffffff",allowFullScreen:true,allowNetworking:"all",allowScriptAccess:"always",wmode:"opaque"},flashVars:{},players:{},cacheBust:_1,inserting:false,isDebug:_2,getInsertParams:function(_3,_4,_5){
_5=_5||{};
var id=typeof (_4)=="string"?"swf_"+_4:"swf_"+this.uid();
var _6=this.players[id]={type:"inserted",id:id,args:this.mix(this.flashArgs,_5,true),flashVars:this.mix(this.flashVars,_5),node:this.byId(_4)};
if(_5.width&&_5.height){
_6.args.width=_5.width;
_6.node.style.width=_5.width+"px";
_6.args.height=_5.height;
_6.node.style.height=_5.height+"px";
}
_6.flashVars.videoId=_3;
_6=this.mixinParams(_6,!!_5.width);
return _6;
},mixinParams:function(p,_7){
var fv=p.flashVars;
if(_7){
p.node.style.width=p.args.width;
p.node.style.height=p.args.height;
}
if(p.args.width=="220"&&p.args.height=="240"){
p.args.width=this.style(p.node,"width");
p.args.height=this.style(p.node,"height");
}
p.args.movie=p.args.src=p.args.swf+(/\.swf/.test(p.args.swf)?"":".swf");
if(this.cacheBust){
fv.cacheBust=true;
}
return p;
},insertPlayer:function(_8,_9,_a){
this.inserting=true;
var _b,_c=new bv.Deferred(),_d,_e=this;
_9=_9||_a.node;
_8=_8||_a.videoId;
var _f=function(){
_b=_e.getInsertParams(_8,_9,_a);
_e.embed(_b);
_c.fire(_b);
};
if(this.byId(_9)){
_f();
}else{
this.ready(this,function(){
_f();
});
}
return _c;
},minVersion:function(_10){
if(this.is_ie()){
return true;
}
fVersion=(function(){
var _11=navigator.plugins["Shockwave Flash"];
if(_11&&_11.description){
var v=_11.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");
return (v[0]!=null)?parseInt(v[0]):0;
}
return 0;
})();
if(fVersion>8){
return true;
}
_10.node.innerHTML="To play this video you need the latest version of the Adobe Flash Player.<br/><a href='http://www.adobe.com/products/flashplayer/' style='font-weight:bold;'>Get Adobe Flash Player</a>";
return false;
},embed:function(_12){
console.log("embed this:",_12);
if(!this.minVersion(_12)){
return false;
}
var br="";
var tb="";
var _13="allowFullScreen,allowNetworking,allowScriptAccess,wmode,swf,movie,src";
var _14=("swf,movie,src,preview,node,w,h,bgcolor").split(",");
var o=this.mix(_12.args,_12.flashVars);
console.log("embed locationId:",o.locationId,_12.flashVars.locationId);
o.id=_12.id;
if(o.title){
o.title=escape(o.title);
}
o.isDebug=this.isDebug;
var p={};
var swf=o.swf;
if(this.cacheBust){
var c="?cache=CB_"+(new Date()).getTime();
swf+=c;
o.cacheBust=true;
}
for(var i=0;i<_14.length;i++){
delete o[_14[i]];
}
for(var nm in o){
if(this.is_array(o[nm])){
o[nm]=o[nm].join(",");
}else{
if(typeof (o[nm])=="object"){
delete o[nm];
continue;
}
}
if(_13.indexOf(nm)>-1){
p[nm]=o[nm];
delete o[nm];
}
}
console.log("embed this:",o);
console.log("embed locationId:",o.locationId);
var str="<object id=\""+o.id+"\" "+br+tb+"classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" "+br+tb+"codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" "+br+tb+"width=\""+o.width+"\" height=\""+o.height+"\" align=\"middle\">"+br+tb+tb;
for(nm in p){
str+="<param name=\""+nm+"\" value=\""+p[nm]+"\" />"+br+tb+tb;
}
str+="<param name=\"FlashVars\" value=\""+this.toQuery(o)+"\" />"+br+tb+tb;
str+="<param name=\"movie\" value=\""+swf+"\" />"+br+tb+tb;
str+="<embed quality=\"high\" type=\"application/x-shockwave-flash\" "+br+tb+"pluginspage=\"http://www.macromedia.com/go/getflashplayer\" "+br+tb;
str+="src="+swf+" id="+o.id+" "+br+tb;
str+="flashVars="+this.toQuery(o)+" "+br+tb;
str+="width="+o.width+" "+br+tb;
str+="height="+o.height+" "+br+tb;
for(nm in p){
str+=nm+"="+p[nm]+" "+br+tb+tb;
}
str+="/>"+br+"</object>";
_12.embed=str;
_12.node.innerHTML=str;
this.current=o;
return str;
}});
})();
(function(){
var _1,_2,_3,_4,_5,_6=-1,_7=[],b=bv,_8,_9,_a=false,_b,_c={seperation:20,magnification:3.5,heightPercentage:0.9,widthPercentage:0.8,bottom:20},_d,_e=function(){
if(!_d){
_d={w:_2*_c.widthPercentage/_c.magnification,h:_3*_c.heightPercentage/_c.magnification,a:(_3*_c.heightPercentage/_c.magnification)/(_2*_c.widthPercentage/_c.magnification)};
}
return _d;
};
var n;
var _f=function(m){
};
var _10=function(){
return b.is_imobile();
};
var _11=function(_12,_13){
this.index=_12;
this.num=_12<10?"0"+_12:_12+"";
this.node=b.create(_13,"div","bvCoverflowContainer");
var box=this.cBox=_e();
var top=_3-box.h-(b.is_webkit()?_c.bottom*_c.magnification*0.75:_c.bottom);
b.style(this.node,{width:box.w+"px",height:box.h+"px",top:top+"px"});
this.url=_c.path+"/"+_c.prefix+this.num+"."+_c.ext;
this.image=b.create(this.node,"img","bvCoverflowImage",{src:this.url});
b.style(this.image,"display","none");
b.once(this.image,"load",this,function(evt){
b.style(this.image,"display","block");
var a=(this.image.naturalHeight||this.image.height)/(this.image.naturalWidth||this.image.width);
if(a>box.a){
b.style(this.image,"height","100%");
if(!b.is_webkit()){
this.marginLeft=(box.h-b.style(this.image,"width"))/2;
b.style(this.image,"marginLeft",this.marginLeft+"px");
}
}else{
b.style(this.image,"width","100%");
}
});
b.connect(this.node,"click",function(){
});
if(!b.is_webkit()){
this.ani=b.ani({node:this.node,dur:300});
}
};
if(b.is_webkit()){
_11.prototype={setX:function(x,z,_14,s){
b.style(this.node,{zIndex:z,WebkitTransform:"scale(1.0) translateX("+x+"px)"});
b.style(this.image,{WebkitTransform:"rotateY("+_14+"deg) scale(1)"});
},center:function(z){
var x=(_2-_4)/2;
this.grow();
this.setX(0,z,0,1.3);
},left:function(cnt,z){
var x=0;
x-=(_4/2)+cnt*_c.seperation;
this.setX(x,z,75,1);
this.shrink();
},right:function(cnt,z){
var x=0;
x+=(_4/2)+cnt*_c.seperation;
this.setX(x,z,-75,1);
this.shrink();
},grow:function(){
this.aniHandle=b.connect(this.image,"webkitTransitionEnd",this,function(){
b.disconnect(this.aniHandle);
b.style(this.node,{WebkitTransform:"scale("+_c.magnification+")"});
});
},shrink:function(){
if(this.aniHandle){
b.disconnect(this.aniHandle);
}
},log:function(m){
if(this.index>1){
return;
}
}};
}else{
_11.prototype={getSize:function(cnt){
var p=1;
for(var i=0;i<cnt;i++){
p*=0.95;
}
return p;
},initialize:true,setX:function(x,z,s,_15){
var p=this.getSize(s);
b.style(this.node,{zIndex:z});
this.ani.to({onEnd:_15,init:this.initialize,left:x,top:_3-_e().h-_c.bottom,width:this.cBox.w*p,height:this.cBox.h*p,marginTop:(this.cBox.h-(this.cBox.h*p))});
this.initialize=false;
if(this.marginTop){
b.style(this.image,{marginTop:this.marginTop*p+"px"});
}
this.node.setAttribute("size",s);
},center:function(z){
var x=(_2-_4)/2;
console.log("center:",x,_2,_4);
this.setX(x,z,0,b.hitch(this,this.grow));
},left:function(cnt,z){
var x=(_2-_4)/2;
x-=(_4/1)+cnt*_c.seperation;
var s=cnt;
this.setX(x,z,s);
this.shrink();
},right:function(cnt,z){
var x=(_2-_4)/2;
x+=(_4/1)+cnt*_c.seperation;
var s=cnt;
this.setX(x,z,s);
this.shrink();
},grow:function(){
this.ani.to({width:_2*_c.widthPercentage,height:_3*_c.heightPercentage,top:(_3-_3*_c.heightPercentage)/2,left:(_2-_2*_c.widthPercentage)/2});
},shrink:function(){
},log:function(m){
if(this.index>1){
return;
}
console.log(m);
}};
}
var _16=function(){
console.log("new Coverflow");
b.ready(this,"init");
};
_16.prototype={init:function(){
this.node=b.create(b.getMainNode(),"div","bvCoverflow");
if(!b.supports.touch()){
b.connect(this.node,this,{dblclick:function(evt){
this.onDblClick(evt);
},click:function(evt){
this.onClick(evt);
},mouseover:function(){
this.isOver=true;
},mouseout:function(){
this.isOver=false;
},mousemove:function(evt){
if(this.isOver){
this.onMouseMove(evt);
}
}});
}
this.listNode=b.create(this.node,"div","bvCoverflowList");
this.loadImages();
b.onSS(b.hitch(this,"buildScroller"));
},hide:function(){
b.style(this.node,"display","none");
},show:function(){
b.style(this.node,"display","block");
},connectLightbox:function(){
},onClick:function(evt){
var x=_10()?evt.x:evt.offsetX;
if(x<_8){
this.navImages(_6-1);
}else{
if(x>_9){
this.navImages(_6+1);
}
}
},onDblClick:function(){
var t=this.cursor();
if(t=="pointer"){
b.lightbox(_7[_6].url);
}
},onMouseOut:function(){
this.cursor("normal");
},onMouseMove:function(evt){
var x=evt.offsetX===undefined?x:evt.offsetX;
if(x<_8){
this.cursor("w-resize");
}else{
if(x>_9){
this.cursor("e-resize");
}else{
this.cursor("pointer");
}
}
},cursor:function(_17){
var d=this.node;
if(_17){
b.style(d,"cursor",_17);
}
return b.style(d,"cursor");
},navImages:function(idx){
if(_6==idx||idx<0||idx>=_7.length){
return;
}
_6=idx;
for(var i=0;i<_7.length;i++){
var a=_7[i];
if(i==idx){
a.center(_7.length);
}else{
if(i<idx){
a.left(idx-i,i);
}else{
a.right(i-idx,_7.length-i);
}
}
}
},onScroll:function(_18){
var x=_10()?_18:this.fakeList.scrollLeft;
var p=x/(_1-_2);
var _19=Math.abs(Math.ceil(p*100));
var idx=_7.length-1;
for(var i=0;i<_7.length;i++){
if(_19>=_7[i].lo&&_19<_7[i].hi){
idx=i;
break;
}
}
this.navImages(idx);
},setDragger:function(){
var _1a=b.g(".bvCoverflow");
b.style(this.fakeItems,{display:"none"});
_1=_2*3;
this.currentPosition=_2-_1;
this.dragger=new bv.Draggable(_1a,bv.hitch(this,"onDragItems"));
},startX:0,onDragItems:function(obj,_1b){
if(_1b=="start"){
this.startX=obj.x;
return;
}else{
if(_1b=="end"){
return;
}else{
if(_1b=="dblclick"){
b.lightbox(_7[_6].url);
return;
}else{
if(_1b=="click"){
this.onClick(obj);
return;
}else{
var x=obj.x-this.startX;
this.startX=obj.x;
}
}
}
}
var lx=this.currentPosition;
var _1c=_2-_1;
var _1d=x+lx;
if(x){
if(x+lx>0){
_1d=0;
}else{
if(x+lx<_1c){
_1d=_1c;
}
}
this.currentPosition=_1d;
this.onScroll(_1d);
}else{
}
},buildScroller:function(){
var _1e=this.images;
var p=100/_1e.length;
_b=p;
var cnt=0;
_4=b.size(_7[0].node).w;
var x=(_2-_4)/2;
for(var i=0;i<_7.length;i++){
_7[i].lo=cnt;
_7[i].hi=cnt+p;
b.style(_7[i].node,"left",x+"px");
cnt+=p;
}
_1=_4*_7.length;
this.fakeList=b.create(this.node,"div","bvFakeList");
this.fakeItems=b.create(this.fakeList,"div","bvFakeItems");
b.style(this.fakeItems,"width",_1+"px");
if(_10()){
this.setDragger();
}else{
b.connect(this.fakeList,"scroll",this,"onScroll");
}
this.onScroll();
},loadImages:function(){
var amt=_c.end;
this.images=[];
var box=b.size(this.node.parentNode);
_2=box.w;
_3=box.h;
_8=_2*0.33;
_9=_2*0.66;
for(var i=_c.beg;i<=amt;i++){
var a=new _11(i,this.listNode);
this.images.push(a.node);
_7.push(a);
}
}};
var _1f;
bv.mix({initCoverflow:function(opt){
_c=this.mix(_c,opt);
console.log(" --------> initCoverflow",_c);
this.nodeId=_c.nodeId||"";
this.addSS();
},showCoverflow:function(o){
if(_1f){
_1f.show();
}else{
bv.initCoverflow(o||{});
_1f=new _16();
}
},hideCoverflow:function(){
if(_1f){
_1f.hide();
}
}});
})();
(function(){
var _1,_2,_3,_4,_5,b=window.bv;
var _6=function(){
bv.css(document.documentElement,"bvLightboxBody",false);
bv.style(_1,"display","none");
bv.lightboxOpen=false;
};
b.ready(function(){
b.addSS();
if(!b.supports.transitions3D()&&b.supports.embed){
b.onSS(function(){
b.lightbox();
});
}
});
b.mix({lightboxNode:null,lightboxOpen:false,lightbox:function(_7){
console.log("bv.lightbox:",_7);
if(b.supports.touch()){
var w=window.open(_7,"IMAGE","status=0,menubar=0,resizable=1,top=2,left=2,width=800,height=600,scrollbars=1,addressbar=0");
return;
}
if(this.is_ie6()){
document.documentElement.scrollTop=0;
}
setTimeout(this.hitch(this,function(){
if(!_1){
this.css(document.documentElement,"bvLightboxBody");
_1=this.create(document.body,"div","bvScreen");
_2=this.lightboxNode=this.create(_1,"div","bvLightbox s-out");
_3=this.create(_2,"div","bvLightboxScroller");
_4=this.create(_3,"img","bvLightboxImage",{src:_7});
_5=this.create(_2,"div","bvLightboxClose");
this.connect(_5,"click",_6);
this.connect(_1,"click",_6);
}else{
_4.src=_7;
this.style(_1,"display","block");
}
this.lightboxOpen=true;
if(!_7){
_6();
}
}),100);
}});
})();
(function(b){
var _1={};
var _2=document;
if(!b.supports.video()){
b.mix({swf:function(_3){
_3=_3||this.current.id;
if(_2.embeds[_3]){
_1[_3]=_2.embeds[_3];
}else{
if(_2[_3]){
_1[_3]=_2[_3];
}else{
if(window[_3]){
_1[_3]=window[_3];
}else{
if(document[_3]){
_1[_3]=document[_3];
}
}
}
}
return _1[_3];
},doPlay:function(_4){
this.swf().doPlay();
},doPause:function(_5){
this.swf().doPause();
},setMedia:function(_6,_7){
console.log("setMedia: ",_6);
this.swf().setMedia(_6,_7);
},launchAvailability:function(){
this.swf().launchAvailability();
},launchShare:function(){
this.swf().launchShare();
},launchEmail:function(){
this.swf().launchShare();
},launchEmailProperty:function(){
console.warn("launchEmailProperty is deprecated");
this.swf().showShare();
},showEmailProperty:function(){
console.warn("SHOW E");
this.swf().showShare();
},hideEmailProperty:function(){
console.warn("HIDE E");
this.swf().hideShare();
},showEmail:function(){
this.swf().showEmail();
},hideEmail:function(){
this.swf().hideEmail();
},showCoverflow:function(o){
console.log("show cf tell swf...");
this.swf().showCoverflow(o);
},hideCoverflow:function(){
console.log("tell swf...");
this.swf().hideCoverflow();
}});
}else{
b.mix({doPlay:function(_8){
this.player.play();
},doPause:function(_9){
this.player.pause();
},setMedia:function(id,_a){
this.player.setMedia(id,_a);
}});
}
b.mix({emailProperty:{show:function(){
b.showEmailProperty();
},hide:function(){
b.hideEmailProperty();
}},coverflow:{show:function(o){
console.log("CF:",b.showCoverflow.toString());
b.showCoverflow(o);
},hide:function(){
b.hideCoverflow();
}}});
})(window.bv);
(function(){
var d=document;
if(!d.querySelectorAll){
bv.query=function(q,_1){
var r=[];
var i,_2,_3,_4,_5,_6;
if(/\[/.test(q)){
var s=q.substring(q.indexOf("[")+1,q.length-1);
var _7=s.split(/\*=|\*|=/);
_5=_7[0];
_6=_7[1];
}
if(q[0]=="."){
_4=q.split("[")[0];
_4=_4.substring(1);
_2=document.body.getElementsByTagName("*");
for(i=_2.length-1;i>=0;i--){
if(_2[i].className.indexOf(_4)>-1){
if(_5){
console.error("query className + attr not implemented");
}else{
r.push(_2[i]);
}
}
}
}else{
_3=q.split("[")[0];
_2=document.getElementsByTagName(_3);
for(i=_2.length-1;i>=0;i--){
if(_5){
if(_2[i].getAttribute(_5).indexOf(_6)>-1){
r.push(_2[i]);
}
}else{
r.push(_2[i]);
}
}
}
if(!r||!r.length){
return false;
}
if(_1=="first"){
return r[0];
}
if(_1=="last"){
return r[r.length-1];
}
return r;
};
}
bv.normalizeEvent=function(e){
var _8={layerX:"offsetX",layerY:"offsetY",target:"srcElement"};
for(var nm in _8){
e[nm]=e[_8[nm]];
}
return e;
};
if(!bv.supports.addEventListener()){
bv.stopEvent=function(_9){
_9.cancelBubble=true;
_a=false;
};
var _b={};
var _c={};
var _a=true;
bv.connect=function(_d,_e,_f,_10){
if(!_d){
console.warn("no connect object:",_e,_10,_d);
}
if(typeof (_d)=="string"){
_d=bv.byId(_d);
}
var _11=this.hitch(_f,_10);
if(!_d._listenerId){
_d._listenerId=bv.uid("nde");
_b[_d._listenerId]={};
}
var d=_b[_d._listenerId];
if(!d[_e]){
(function(){
var _12=d[_e]={};
_d.attachEvent("on"+_e,function(){
bv.normalizeEvent(arguments[0]);
for(var nm in _12){
_12[nm].apply(null,arguments);
}
if(!_a){
_a=true;
return false;
}
return true;
});
})();
}
var eid=bv.uid("evt");
d[_e][eid]=_11;
uid=bv.uid("hdl");
_c[uid]=[_d._listenerId,_e,eid];
return uid;
};
bv.disconnect=function(_13){
if(_13===undefined){
return;
}
if(typeof (_13)=="object"){
for(var i=0;i<_13.length;i++){
this.disconnect(_13[i]);
}
return;
}
var h=_c[_13];
delete _b[h[0]][h[1]][h[2]];
};
}
bv.connect(window,"load",function(){
bv.onDomReady();
});
})();
if(window.bvOnScriptsLoaded){
window.bvOnScriptsLoaded();
}else{
console.log("missing bvOnScriptsLoaded");
}


