rendered paste bodyvar targetDB = [];
var paneTop;
/**
* Attaches the switch video behaviour to each thumbnail.
*/
jsPlayerAutoAttach = function() {
// Set up player
var path = Drupal.settings.dsplayer.path;
var width = Drupal.settings.dsplayer.width;
var height = Drupal.settings.dsplayer.height;
var so = new SWFObject(
path + '/flowplayer/FlowPlayerDS.swf',
'dsplayer',
width,
height,
"8",
"#000000"
);
so.addVariable("config", "{configFileName: \'dsplayer/config\'}");
so.useExpressInstall(path + '/flowplayer/expressinstall.swf');
so.write("flashcontent");
$('#dsplayer-thumbnails').jScrollPane({
showArrows: true,
animateTo: true});
var $pane = $('#dsplayer-thumbnails');
paneTop = parseInt($pane.offset().top);
$('a.dsthumblink').each(function () {
this.index = this.rel;
$(this).removeAttr('rel');
targetDB[this.index] = $(this).offset().top;
target = this;
$(this).bind("click", function() {
flowplayer = document.getElementById("dsplayer");
flowplayer.ToClip(this.index);
flowplayer.DoPlay();
return false;
});
$(this).hover(function() {
$(this).addClass("over");
},function() {
$(this).removeClass("over");
})
});
// alert('test');
}
function onLoadBegin(clip) {
flowplayer = document.getElementById("dsplayer");
index = flowplayer.getCurrentClip();
if (index != 0) {
target = targetDB[index];
$('#dsplayer-thumbnails')[0].scrollTo(parseInt(target - paneTop));
}
}
// Global killswitch
if (Drupal.jsEnabled) {
// $(document).ready(jsPlayerAutoAttach);
}