var writeFlash=function(){var b=arguments,d='<object type="application/x-shockwave-flash" ',c;
d+='data="'+b[0]+'" ';
d+='width="'+b[1]+'" height="'+b[2]+'">';
d+='<param name="movie" value="'+b[0]+'"/>';
for(c=3;
c<b.length;
c++){d+='<param name="'+b[c]+'" value="'+b[++c]+'"/>'
}d+="</object>";
document.write(d)
},writeFlashWithName=function(){var b=arguments,d='<object type="application/x-shockwave-flash" ',c;
d+='data="'+b[0]+'" ';
d+='width="'+b[1]+'" height="'+b[2]+'" id="'+b[3]+'">';
d+='<param name="movie" value="'+b[0]+'"/>';
d+='<param name="name" value="'+b[3]+'"/>';
for(c=4;
c<b.length;
c++){d+='<param name="'+b[c]+'" value="'+b[++c]+'"/>'
}d+="</object>";
document.write(d)
},videoStarted=function(a){if("jQuery" in window&&"sfm" in window.$){window.$.sfm.trackVideo(a);
if("_gaq" in window){window._gaq.push(function(){window.$.log("Trying to track video "+a+" play event");
window._gaq._getAsyncTracker("pagetracker")._trackEvent("Video","video started","Start playing video with id "+a)
})
}}else{setTimeout(function(){videoStarted(a)
},500)
}},videoEnded=function(a){if("_gaq" in window){window._gaq.push(function(){window.$.log("Trying to track video "+a+" play event");
window._gaq._getAsyncTracker("pagetracker")._trackEvent("Video","video ended","End playback of video with id "+a)
});
return
}},addListeners=function(a){try{if(a.getPlaylist().length>0){a.addModelListener("STATE","stateMonitor")
}}catch(b){setTimeout(function(){addListeners(a)
},1000)
}},getById=document.getElementById,playerReady=function(a){addListeners(getById(a.id))
},stateMonitor=function(c,d){var a=$("#vid").val(),b=$("#advid").val();
switch(c.newstate){case"PLAYING":if(b){videoStarted(b);
videoEnded(b);
videoStarted(a)
}else{videoStarted(a)
}break;
case"COMPLETED":videoEnded(a);
getById(c.id).sendEvent("STOP");
break
}},_sfm=_sfm||{};