$(document).ready(function()
{
	$('.logo a').vAlign();
	$('.bookmark').jFav();
	$.externallinks();
	$('input[title!=""]').hint();
	$('textarea').hint();
	$('.sponsors ul ul').innerfade({animationtype: 'fade', speed: 0, timeout: 3000,	type: 'sequence', containerheight: '125px'});
	$('.speakers li').tooltip({
		track: true,
		delay: 0, 
		showURL: false, 
		bodyHandler: function() { 
			return $(this).html();
		},
		fade: 250
	});
	$.ie6nav('.navbar li');
	if ( $("#anchor").length > 0 )
	{
		//$.scrollTo('#anchor', 0, 'x');
	}
	/*$('.speakers li').simpletip({
		persistent: true,
		content: function() { 
			return $(this).html() + "xxx";
		}
	});*/
});

$.externallinks=function(){
	$('a[href^="http://"]')
	.attr({  
		target: "_blank",
		title: function (arr) {
			if ($(this).attr("title").length>0)
			{
				$(this).attr("title",$(this).attr("title") + " (opens in a new window)");
			}
			else
			{
				$(this).attr("title","opens in a new window");
			}
		}
	});
	$('a[href^="http://www.prn.org.uk/"]')
	.attr({
		target: "_self",
		title: function (arr) {
			$(this).attr("title",$(this).attr("title").replace(/ (opens in a new window)/,""));
			$(this).attr("title",$(this).attr("title").replace(/(opens in a new window)/,""));
		}
	});
}

$.ie6nav=function(selector){
	$(selector).mouseover(
		function(){
			if (!$(this).hasClass('over'))
			{
				$(this).addClass('over')
			}
		}
	);

	$(selector).mouseout(
		function(){
			if ($(this).hasClass('over'))
			{
				$(this).removeClass('over')
			}
		}
	);
}
