var P4 = {

	init: function(){
		P4.initExternalLinks();
		P4.initSlideShow();
		if ($('theteam')) P4.initStaffSlideShow();
	},

	initExternalLinks: function() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
				anchor.target = "_blank";
			}
		}
	},
	
	initSlideShow: function() {
		
		// ie6 chucks a freakin big whobbly and crashes the browser... so let's
		// just avoid that one ay?
		if (!Browser.Engine.trident4) {
		
			if (Browser.Engine.trident && Browser.Engine.version == 5) var duration = 1;
			else duration = 1000;

			var slideshow = new Slideshow('splash', splash_1_images, {
				controller: false,
				width: 900,
				height: 181,
				duration: duration,
				hu: splash_1_dir,
				linked: true,
				overlap: false,
				resize: false
			});
		}
		
	},
	
	initStaffSlideShow: function() {

		var slideshow = new Slideshow('splash_team', splash_team_images, {
				controller: false,
				width: 155,
				height: 232,
				duration: 750,
				hu: splash_team_dir,
				linked: false,
				overlap: false,
				resize: false
			});

		
	}
	
}

window.addEvent('domready', P4.init);

