$(function()
{
	function initRollOverImages(selector) {
		var image_cache = new Object();
		$(selector).not('[src*="_h."]').each(function(i) {
			var imgsrc = this.src;
			var dot = this.src.lastIndexOf('.');
			var imgsrc_on = this.src.substr(0, dot) + '_h' + this.src.substr(dot, 4);
			image_cache[this.src] = new Image();
			image_cache[this.src].src = imgsrc_on;
			$(this).parent().not('a').find('img').hover(
				function() { this.src = imgsrc_on; },
				function() { this.src = imgsrc; }
			);
			$(this).parent().filter('a').hover(
				function() { $(this).children('img').attr('src', imgsrc_on); },
				function() { $(this).children('img').attr('src', imgsrc); }
			);
		});
	}

	function breakWord(target) {
		if($.browser.msie) {
			$(target).css('word-break', 'break-all');
		} else {
			$(target).each(function(){
				if(navigator.userAgent.indexOf('Firefox/2') != -1) {
					$(this).html($(this).text().split('').join('<wbr />'));
				} else {
					$(this).html($(this).text().split('').join(String.fromCharCode(8203)));
				}
			});
		}
	}

	initRollOverImages('img.hoverable');
//	breakWord('div.video-article-summary div.video-header .title a');
	$('a.external').attr('target', '_blank');
});

