var EUROFIBER = {
	flashFile : 'swf/eurofiber.swf',
	flashID : 'flashcontent',
	flashPlugin : null,
	page : {},
	flashInit : function () {
		var flashvars = {}, id;
		if (window.location.hash) {
			id = window.location.hash.split('=')[1];
			flashvars.section = id;
		}
		swfobject.embedSWF(this.flashFile, "flashcontent", "720", "590", "8", "expressInstall.swf", flashvars, {wmode:'transparent'});
		this.page.splash = document.getElementById('splash');
		this.page.menu = document.getElementById('menu');
		this.page.navigation = document.getElementById('navigation');
		this.page.menu.style.display = 'none';
		this.page.navigation.className = 'collapse';
		if (id) {
			this.dispatcher(id, true);
		}
	},
	dispatcher : function (id, cb) {
		if (id.href) {
			id.blur();
			id = this.hash(id.href);
		}
		if (id.indexOf('=') != -1) {
			id = id.split('=')[1];
		}
		if ('home' == id) {
			this.page.splash.style.display = '';
			this.page.menu.style.display = 'none';
		} else {
			this.page.splash.style.display = 'none';
			this.page.menu.style.display = '';
			var child = this.page.navigation.childNodes, l = child.length, x, u;
			while (l--) {
				x = child[l];
				if (1 == x.nodeType) {
					x.className = (id == x.id) ? 'selected' : '';
					u = x.getElementsByTagName('ul');
					if (u.length) {
						u[0].style.display = (id == x.id) ? 'block' : '';
					}
				}
			}
		}
		if (cb) {
			EUROFIBER.flashDispatcher(id);
			// IE flash link bug
		}
		/*@cc_on
		  document.title = 'Eurofiber';
		  @*/
	},
	hash : function (str) {
		return str.split('#')[1];
	},
	flashDispatcher : function (page) {
		var plugin = this.getFlashObject(this.flashID);
		if (plugin && plugin.dispatcher) {
			plugin.dispatcher(page);
		}
	},
	getFlashObject : function (id) {
		var ie = false;
		/*@cc_on
		  ie = true;
		  @*/
		return ie ? window[id] : document[id];
	},
	useroptions : function () {
		var ui = document.getElementById('user-options');
		if (ui) {
			ui.innerHTML += ' <a class="print" href="#" onclick="window.print()">print</a>';
		}
	},
	goTo : function (id) {
		document.forms[id].submit();
	}
};
