// Imulus Global Javscript Code

// Create an external link icon using an image
$(document).ready(function() {
//	$('a:not(:has(img)|.button|.video|.website)').filter(function() {
//		return this.hostname && this.hostname !== location.hostname;
//	}).after(' <img class="external" src="/images/icons/external.gif" alt="external link"/>');
});




$(document).ready(function() {

	$("a[href^='http:']").not("[href*='get10.com']").attr('target','_blank');

	$("a.video").each(function () {
		var youtube = $(this).attr("href");
		
		videoID = youtube.split("=");
		if (videoID) {
			youtube = videoID[1];
		}

		//var newLink = "javascript:playVideo('youtube','" + youtube + "')";

		//$(this).attr({href: newLink});
		
		$(this).click(function() { playVideo('youtube',youtube); return false; });
		
	});
});

function playVideo(targetDiv, videoID) {
	var html = '';

	html += '<object width="560" height="340">';
	html += '<param name="movie" value="http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&autoplay=1"></param>';
	html += '<param name="allowFullScreen" value="true"></param>';
	html += '<param name="allowscriptaccess" value="always"></param>';
	html += '<param name="wmode" value="transparent"></param>';
	html += '<embed src="http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340" wmode="transparent"></embed>';
	html += '</object>';
	
	$('#' + targetDiv + '').html(html);
	
	return false;
}
	
	
	
	
