$(function() {
	if ($('ul.slides').length) {
		$('ul.slides').cycle({
			pager:'.slide-ctrl',
			pagerAnchorBuilder:function(i,d) {
				var ni = i+1;
				return '<li><a href="#">'+ni+'</a></li>'
			}
		});
	}
	
	if ($('img.play-button').length) {
		var myPlayer = new Object();
		myPlayer.onInit = function() {
			this.position = 0;
			}
		$('img.play-button').click(function() {
			//$('img.play-button').removeClass('focus');
			//$(this).addClass('focus');
			var url = $(this).attr('alt');
			console.log(url);
			
			document.getElementById("audio-player").SetVariable("method:setUrl",url);
			document.getElementById("audio-player").SetVariable("method:play","");
			document.getElementById("audio-player").SetVariable("enabled","true");
			console.log(myPlayer);
			});
	}
	
	if ($('table.resource-list').length) {
		$('table.resource-list tr:even').addClass('alt');
	}
	
	if ($('div#content img.static-head').length) {
		$('div#header img').attr('src',$('div#content img.static-head').attr('src'));
	}
	
	$('a[href^=https://app.e2ma.net]').click(function() {
		var url = $(this).attr('href');
		window.open(url, 'signup', 'menubar=no, location=no, toolbar=no, scrollbars=yes, height=500');
		return false;
	});
});
