$(function(){
$('.side-nav ul li:last-child').addClass('lastsidenav');
$('.video-playlist ul li:odd').addClass('playlist-alt');
$('table.sysreq tr:odd').addClass('alt');
$("a[rel='external']").click(function() {
window.open(
$(this).attr("href")
);
return false;
});
//  Home Main Video Background Hover
$(".home-webcast-play").hover(function() {
	$(this).find('.vid-image').fadeTo(120, 0.8);
  	$(this).find('span.play').animate({  opacity: 'show' }, 100);
	}, function() {
  		$(this).find('.vid-image').fadeTo(120, 1.0);
  		$(this).find('span.play').animate({  opacity: 'hide' }, 100);  
});
//  Home Small Video Background Hover
$(".segment-image").hover(function() {
	$(this).find('.segment-vid-image').fadeTo(120, 0.8);
  	$(this).find('span.segment-play').animate({  opacity: 'show' }, 100);
	}, function() {
  		$(this).find('.segment-vid-image').fadeTo(120, 1.0);
  		$(this).find('span.segment-play').animate({  opacity: 'hide' }, 100);  
});
//  Faculty Background Hover
$(".faculty-image").hover(function() {
	$(this).find('.faculty-vid-image').fadeTo(120, 0.8);
  	$(this).find('span.faculty-bio').animate({  opacity: 'show' }, 100);
	}, function() {
  		$(this).find('.faculty-vid-image').fadeTo(120, 1.0);
  		$(this).find('span.faculty-bio').animate({  opacity: 'hide' }, 100);  
});
//register clear focus
$('.ctrl-first input, .ctrl-middle input, .ctrl-last input').focus(function() {
if( this.value == this.defaultValue ) {
this.value = '';
}
}).blur(function() {
if( !this.value.length || this.value == '$' ) {
this.value = this.defaultValue;
}
});


});

//seek and play video
var player=null;var seek=0;var seekFlag=false;var currentTime;function playerReady(obj){player=gid(obj.id);player.addModelListener('TIME','timeMonitor')};function timeMonitor(obj){if((obj.position>0)&&(seekFlag)){seekFlag=false;player.sendEvent('SEEK',seek)}currentTime=obj.position};function seekSome(some){seek=some;if(currentTime>0){player.sendEvent('SEEK',seek)}else{seekFlag=true;player.sendEvent('PLAY','true')}};function gid(name){return document.getElementById(name)};


function popup(page)
{
	window.open(page,'cert','height=680,width=900,menubar=yes,scrollbars=yes');
}
