$(document).ready(function(){

$(".hovCheck").hover(
		function(){
		$(this).addClass("hovChecks");
		},
		function(){
		$(this).removeClass("hovChecks");
		}
	 );
$('table.striped').each(function() {
		$(this).stripeMe(this); 
	});

});

$.fn.stripeMe = function() { 
	$('tbody tr:odd', this).removeClass('even').addClass('odd');
	$('tbody tr:even', this).removeClass('odd').addClass('even'); 
	return this; 
};


// used by video player to create html chapter links and descriptions
function drawChapters(div,chp) {
var vidPar = $('#'+div);
var chapParId = 'chaps' + div;
vidPar.after('<div class="mediaChapters" id="' + chapParId + '"><div class="mediaChapter mediaChapHide"><span class="txt txtB">Chapters</span> (<span class="txtBlue txtXSmall hideChaps">hide</span>)</div><div class="mediaChapCont"></div></div>')
var chapsShow = true;
$('.hideChaps').click(function() {
if(chapsShow == true) {
$('.mediaChapCont').hide();
$(this).text('show');
chapsShow = false;
} else {
$('.mediaChapCont').show();
$(this).text('hide')
chapsShow =true;
}    
});

for(i=chp.length-1; i>=0; i--) {
$('#' + chapParId).find('.mediaChapCont').append('<div class="mediaChapter dispBlock"><a href="javascript:sendCue(' + chp[i][2] + ')"><span class="txtBlue txtB dispBlock">' + chp[i][0] + '<span class="txt txtXSmall txtP"> (' + chp[i][3] + ')</span></span><span class="txt">' + chp[i][1] + '</span></a></div>')
}
}

// send cuepoint back to video player for chapter jumps
function sendCue(txx,chap) {
	var flash = getMovie('player');
    flash.cp(txx,chap);
}

// get video player for external interface calls
function getMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
} 

// called by the video player to resize its parent div to be the same size
function getDims(wd,ht,id,morph){
	if (wd) {
	$('#'+id).width(wd);	
	}
if (ht) {
	// if sent height is more than current height then run animation
	if (ht > $('#'+id).height() && morph == true) {		
		 $('#'+id).animate( { height:ht}, 1000 )

	} else {
		$('#'+id).height(ht);
	}	
}
}
