﻿/* ---------------------------------------
	dynamic flash loader
--------------------------------------- */

	var Flash =
	{	
		version : Browser.Plugins.Flash.version,
		build : Browser.Plugins.Flash.build,

		dimensions : [],

		settings :
		{
			width : null,
			height : null,
			container : null,
			params :
			{
				allowScriptAccess: 'always'
			}
		},

		object : null,
		className : null,
		URL : 'http://www.fones4schools.co.uk',

		load : function()
		{
			if (this.version < 9 || (this.version == 9 && this.build < 115)) return false;

			this.className = $('flash').className;

			switch (this.className)
			{
				case 'landing' : this.dimensions = [960, 520]; break;
				case 'jungle' : this.dimensions = [980, 640]; break;
				case 'tv' : this.dimensions = [960, 800]; break;
			}

			this.settings.width = this.dimensions[0];
			this.settings.height = this.dimensions[1];
			this.settings.container = $('flash');

			if (window.location.hostname == '192.168.0.137' || window.location.hostname == 'localhost') this.URL = 'http://' + window.location.hostname;
			this.object = new Swiff (this.URL + '/media/flash/preload-' + this.className + '.swf', this.settings);
		}		
	}

	window.addEvent('domready', function()
	{
		Flash.load();
	});
	
	function GoogleEventTrack(strReturn)
	{
		if (typeof(pageTracker) == 'object')
		{
			pageTracker._trackPageview(strReturn);
			//console.log(strReturn);
		}
	}