var chaps = new Array();
var currentchapter = 1;
var infoon = false;
var embedon = false;
var firstchapter = 'frol02s47afq104a';
function chd (chdar){
chaps.length = 0;
var outp = '
CHAPTERS
';
for(var x = 0; x < chdar.length; x++){
chaps[chdar[x].pki] = chdar[x];
outp += '';
}
outp += '
';
$("#vidchapters").html(outp);
videvts();
}
function vidinfo (chidx, top){
$("#vidinfo").stop();
$("#vidinfobg").stop();
$("#vidinfo").css({ 'opacity':1, 'margin-top':top + 'px' });
$("#vidinfobg").css({ 'opacity':.9, 'margin-top':top + 'px' });
var vidinf = chaps[chidx];
$("#vidinfo").html('' + vidinf.pki + ': ' + vidinf.tit + ' ' + vidinf.dsc + ' (' + vidtime(vidinf.len) + ')');
$("#vidinfobg").fadeIn('fast');
$("#vidinfo").fadeIn('fast');
infoon = true;
}
function videvts () {
$(".vidunsel").mouseenter(function () {
$(this).stop();
$(this).animate({'height': '90px', 'opacity':1}, function () { var pos = $(this).position(); vidinfo($(this).attr('vidc'), pos.top); });
});
$(".vidunsel").mouseleave(function () {
$(this).stop();
vidinfo_off();
$(this).animate({'height': '25px', 'opacity':.7});
});
$(".vidunsel").click(function () {
v_chapter(parseInt($(this).attr('vidc')) - 1);
});
}
function vidtime (timein){
var ret = parseInt(parseInt(timein) / 60);
var sec = parseInt(parseInt(timein) % 60);
if(sec < 10){
ret += ":0" + sec;
} else {
ret += ":" + sec;
}
return ret;
}
function videoembedcode (siz) {
if(siz == -1){
if(embedon){
embedon = false;
$("#embedcode").fadeOut();
} else {
embedon = true;
$("#embedcode").fadeIn();
}
}
if(embedon){
var h = 333;
var w = 512;
if(siz == 1){
h = 250;
w = 384;
}
if(siz == 2){
h = 208;
w = 320;
}
var fval = '