
	var AssetLocation			= 	'/_assets/videos/';
	var VideoWidth				= 	'384';
	var VideoHeight				= 	'216';
	var DefaultVideo			= 	'philosophy';
	var Container					=		'videos';

	var VideoData = {
		philosophy : { 
				video 				: 'OURPHILOSOPHY512K.FLV',
				posterframe 	: 'OURPHILOSOPHY512K_pframe.jpg'
		},
		style : { 
				video 				: 'OURSTYLE512K.FLV',
				posterframe 	: 'OURSTYLE512K_pframe.jpg'
		},
		process : { 
				video 				: 'OURPROCESS512K.FLV',
				posterframe 	: 'OURPROCESS512K_pframe.jpg'
		}
		
	}

	
	var FlashVars = {
		//initialURL: escape(document.location),
		file								: 			AssetLocation + VideoData[DefaultVideo].video,
		image								:				AssetLocation + VideoData[DefaultVideo].posterframe,
		bufferlength				:				"20",
		width								:				VideoWidth,
		height							:				VideoHeight
	};
	
	var Params = {
		bgcolor							:				"#000000",
		allowfullscreen			:				"true"
	};

	var Attributes = {
		id									:				'cssvideo'

	};





function videosetup() {

	// Add Click Events for links with gallery control anchors
	// Selector searches for anchor tags containing 'Portfolio'
	$$('#videoselectors a').each(function(el) {
		//Call method once and store value
		LinkHREF = el.getProperty('href');
		
		urlRegEx	=	/#video\/(.*)/;
		var result		=	urlRegEx.exec(LinkHREF)[1];

		//Create function to add event, based on later conditional
		el.addEvent('click', function(evnt) { 
			new Event(evnt).stop();
			FlashVars.file 		= AssetLocation + VideoData[result].video;
			FlashVars.image		= AssetLocation + VideoData[result].posterframe;

			swfobject.embedSWF("/_assets/flvplayer.swf",
												 'cssvideo',
												 VideoWidth,
												 VideoHeight,
												 "8",
												 "/_assets/expressInstall.swf",
												 FlashVars,
												 Params,
												 Attributes
												);
		});

	});
	
	// Set default video
			swfobject.embedSWF("/_assets/flvplayer.swf",
												 Container,
												 VideoWidth,
												 VideoHeight,
												 "8",
												 "/_assets/expressInstall.swf",
												 FlashVars,
												 Params,
												 Attributes
												);
	

}




	//initialize the code
	window.addEvent('domready', videosetup);


