function prepareMainMenu() {
	var menuLinks = $$('.menu_mainMenu li');
	for (var i = 0; i < menuLinks.length; i++) {
		new Event.observe(menuLinks[i], 'click', function() {
				var theLink = this.childElements();
				window.location = theLink[0].readAttribute('href');
			}
		);
		new Event.observe(menuLinks[i], 'mouseover', function() {
				this.addClassName('hover');
			}
		);
		new Event.observe(menuLinks[i], 'mouseout', function() {
				this.removeClassName('hover');
			}
		);
	}
}

/*Event.observe(window, 'load', function() {
		prepareMainMenu();
	}
);*/

function video_loadVideo(sourceFile, divId) {
	var s1 = new SWFObject("/staticfiles/mediaplayer/mediaplayer.swf", "ply", "300", "220", "9", "#FFFFFF");
	s1.addParam("allowfullscreen","true");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("flashvars","file=videos/" + sourceFile + "");
	s1.write(divId);
}

function video_loadSmallVideo(sourceFile, divId) {
	var s1 = new SWFObject("/staticfiles/mediaplayer/mediaplayer.swf", "ply", "200", "180", "9", "#FFFFFF");
	s1.addParam("allowfullscreen","true");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("flashvars","file=videos/" + sourceFile + "");
	s1.write(divId);
}

function video_loadBigVideo(sourceFile, divId) {
	var s1 = new SWFObject("/staticfiles/mediaplayer/mediaplayer.swf", "ply", "640", "480", "9", "#FFFFFF");
	s1.addParam("allowfullscreen","true");
	s1.addParam("allowscriptaccess","always");
	s1.addParam("flashvars","file=videos/" + sourceFile + "");
	s1.write(divId);
}

function stripPx(theString) {
	return theString.substring(0, theString.length - 2);
}

function lockScrollers() {
	//document.body.style.overflow = 'hidden';
}

function unlockScrollers() {
	//document.body.style.overflow = 'inherit';
}

function showBigPlayer() {
	var startingSize 	= document.viewport.getDimensions();
	try { 
		if (window.scrollbars.visible)
			startingSize.width -= 15;
	} catch (caught) {}
	
	var screenFader;
	screenFader = document.createElement('div');
	screenFader.setAttribute('id', 'screenFader');
	screenFader.style.width = String(startingSize.width) + 'px';
	screenFader.style.height = String(startingSize.height) + 'px';
	screenFader.style.position = 'fixed';
	screenFader.style.left = '0px';
	screenFader.style.top = '0px';
	screenFader.style.display = 'none';
	screenFader.style.zIndex 	= '955';
	screenFader.style.background = '#000';
	document.body.appendChild(screenFader);
	
	new Event.observe(screenFader, 'click', function() {
		hideBigPlayer();
	});
	
	new Effect.Appear(screenFader, {
		from: 0.0,
		to: .5,
		duration: .4, 
		afterFinish: function() {
			var playerBox;
			playerBox = document.createElement('div');
			playerBox.setAttribute('id', 'playerBox');
			playerBox.style.width = String(640) + 'px';
			playerBox.style.height = String(480) + 'px';
			playerBox.style.background = 'white';
			playerBox.style.border = '2px solid #666';
			playerBox.style.position = 'fixed';
			playerBox.style.left = String(startingSize.width / 2 - 320 - 2) + 'px';
			playerBox.style.top = String(startingSize.height / 2 - 240 - 2) + 'px';
			playerBox.style.display = 'block';
			playerBox.style.zIndex = '955';
			document.body.appendChild(playerBox);
			
			var bigVideoArea;
			bigVideoArea = document.createElement('div');
			bigVideoArea.setAttribute('id', 'bigVideoArea');
			bigVideoArea.style.width = String(640) + 'px';
			bigVideoArea.style.height = String(480) + 'px';
			playerBox.appendChild(bigVideoArea);
			video_loadBigVideo('Title_01.flv', 'bigVideoArea');
		}
	});
}

function hideBigPlayer() {
	$('screenFader').remove();
	$('playerBox').remove();
}