sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

$(document).ready(function(){
	$('#mb_video a').click(function(){
		window.open('/video.php?video='+$(this).attr('href'), 'videoPlayer', 'width=640,height=480,scrollbars=0,statusbar=0,address=0');
		return false;
	});
	// Video Embedding
	var vid = 1;
	$('.video').each(function(){
		var vurl = $(this).attr('onclick');
		if(vurl) vurl = vurl.toString();
		
		vurl = vurl.split('waspPopup')[1];
		vurl = vurl.split('\',')[0].replace('\'', '').replace('(', '');
		$(this).before('<div id="video'+vid+'">'+vurl+'</div>');		
		$(this).remove();
		
		var flashvars = { 
			file: vurl,
			autostart:'false',
			frontcolor: 'ffffff',
			lightcolor: 'cc9900',
			skin: 'http://www.longtailvideo.com/jw/upload/overlay.swf',
			controlbar: 'over'
		};
		
		var params = { wmode:'transparent' };
		var attributes = {  };
		
		if($(this).find('img').attr('src')){
			flashvars.image = $(this).find('img').attr('src');
		}
		swfobject.embedSWF("/scripts/player.swf", "video"+vid, "480", "360", "9.0.0", "/scripts/expressInstall.swf", flashvars, params, attributes);		
		$(this).remove();								
		vid++;			
	});
	
});