$(document).ready(function(){

		var popupLink = $("a[rel=lightbox]");
			popupLink.each(function(){
				var thisLink = jQuery(this);
				var thisLinkClass= thisLink.attr("class");
				if (!thisLinkClass =="") {
					thisLink.removeClass().attr("video-src","/basemedia/flash/"+thisLinkClass+".swf");
				}
			}) 
			
			if (popupLink.length >0 ) {
				$("a[rel=lightbox]").colorbox({
				top:'57px',		
				onComplete:function(){
					
					var thisLink = jQuery(this);
					
					var thisLoadedContent = $('#cboxLoadedContent');
						thisLoadedContent.append("<div id ='videoArea'/>");
						
					$("#cboxNext,#cboxPrevious,#cboxCurrent").css("display","none");
					var thisVideoSrc = thisLink.attr("video-src");
					var	width = 316; 
					var height = 300;
					var so = new SWFObject(thisVideoSrc , "sovideo", width, height, "8", "#ffffff");
						so.write("videoArea");
					
				}});
					
			}


		
			
	/**/
	$(".feature-employment").click(
		function()
		{
			//get the href
			href = $(this).find("a").attr("href");
			wl = window.location;
			var substr = href.substring(0, 4);
			if(substr == "http")
			{
				window.location = href;
			}
			else
			{
				window.location = window.location + href;
			}
		}
	)
	
	$(".feature-whatson").click(
		function()
		{
			//get the href
			href = $(this).find("a").attr("href");
			wl = window.location;
			var substr = href.substring(0, 4);
			if(substr == "http")
			{
				window.location = href;
			}
			else
			{
				window.location = window.location + href;
			}
		}
	)
	
	$(".feature-links").click(
		function()
		{
			//get the href
			href = $(this).find("a").attr("href");
			wl = window.location;
			var substr = href.substring(0, 4);
			if(substr == "http")
			{
				window.location = href;
			}
			else
			{
				window.location = window.location + href;
			}
		}
	)
	

});
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};


function urlCleanFormat(s) {
	s = s.replace(/\s/g, "").toLowerCase();
	s = s.replace(/\//g, ""); 
	s = s.replace(/'/g, ""); 
	s = s.replace(/&amp;/g, ""); 
	s = s.replace(/&/g, ""); 
	return s;
};
