$(document).ready(function () {
	$('a.external').click(function(){
		window.open(this.href);
		return false;
	});
	
	$('#register-name').blur(function(){
		playerName = $(this).val();
		$('#name-field').val(playerName)
	});
	
	$('#mce-EMAIL, #email-field').focus(function(){
		if($(this).val() == "Enter Your Email...")
			$(this).val("");
	});
	
	$('#mce-EMAIL, #email-field').blur(function(){
		if($(this).val() == "")
			$(this).val("Enter Your Email...");
	});
	
	$('#flash-banner').flash({
		swf: 'http://sportpartnersusa.com/assets/flash/banner.swf',
		height:'242',
		width:'957',
		wmode: "transparent"
	});
	
	var dataSource = new ctRotatorBridgeLi($('#news-ticker')).getDataSource();
		
	$('#news-ticker').ctRotator(dataSource, {
		showCount: 1,
		speed: 5000,
		fadeOutSpeed: 1000,
		fadeInSpeed: 1000,
	
		itemRenderer: function(item){   
			return '<li class="rotator-item">' +
						'<span class="time">' + item.time + ' - </span>' +
						'<h3><a href="' + item.url + '">' + item.title + '</a></h3>' +
					'</li>';
		}
	});

	$('a#terms-link').colorbox({
		href: "http://sportpartnersusa.com/index.php/events/terms",
		initialHeight: 180,
		initialWidth: 200,
		height: 300,
		width: 657
	}, function(){
		sIFR.replace(avenir, {
			selector: 'h1',
			css: '.sIFR-root {color: #540819;}',
			wmode: 'transparent'
		});
	});
	
	$('#photo-list a').colorbox({
		maxHeight: 700
	});
	
	$('#home script').colorbox({
		open: true,
		iframe: true,
		href: "http://sportpartnersusa.com/video-promo",
		width: 512,
		height: 360,
		scrolling: false
	});
});