document.createElement("article");
document.createElement("aside");
document.createElement("footer");
document.createElement("header");
document.createElement("nav");
document.createElement("section");

$(function () {
	$('a.video').click(function() {
		var videoPath = $(this).attr('href');
		var videoFile = videoPath.split('/');
		var videoName = videoFile[videoFile.length - 1];
		if (videoFile[0] == "..") {
			var playerPath = '../video/player.swf';
		} else {
			var playerPath = 'video/player.swf';
		};
		$('#mediaBox').show();
		$('#coverScreen').animate({"opacity": 0.8}, 1500);
		$('#mediaPlayer').show();
		if ($.flash.available) {
			$('#videoReplace').flash({ 
				// test_flashvars.swf is the flash document 
				swf: playerPath, 
				// these arguments will be passed into the flash document 
				params: { 
					allowfullscreen: 'true', 
					allowscriptaccess: 'always', 
					wmode: 'transparent'			
				}, 
				flashvars: { 
					file: videoName, 
					backcolor: 'ffffff', 
					controlbar: 'over',
					dock: 'false', 
					stretching: 'fill',
					autostart: 'true'			
				},
				height:360,
				width:480,
				id: 'video'
			});
		} else {
			$('#videoReplace').html('<p>You must have <a href="http://get.adobe.com/flashplayer/">Abode Flash</a> installed to view this video</p>');
		}
		return false;
	});
	$('a.flashmap').click(function() {
		var videoPath = $(this).attr('href');
		$('#mediaBox').show().addClass('flashmap');
		$('#coverScreen').animate({"opacity": 0.8}, 1500);
		$('#mediaPlayer').show();
		if ($.flash.available) {
			$('#videoReplace').flash({ 
				// test_flashvars.swf is the flash document 
				swf: videoPath, 
				// these arguments will be passed into the flash document 
				params: { 
					allowfullscreen: 'true', 
					allowscriptaccess: 'always', 
					wmode: 'transparent'			
				}, 
				height:480,
				width:880,
				id: 'video'
			});
		} else {
			$('#videoReplace').html('<p>You must have <a href="http://get.adobe.com/flashplayer/">Abode Flash</a> installed to view this video</p>');
		}
		return false;
	});
	$('img.closeMedia').click (function() {
		$('#coverScreen').animate({"opacity": 0}, 500);
		$('#mediaPlayer').hide().removeClass('flashmap');
		$('#mediaBox').hide(500);
		$('#videoReplace').html('');
	});
	if ($.flash.available) {
		$('#flashReplace').flash({ 
			// test_flashvars.swf is the flash document 
			swf: 'slideshow/flashHome.swf', 
			// these arguments will be passed into the flash document 
			params: { 
				allowfullscreen: 'false', 
				allowscriptaccess: 'always', 
				wmode: 'transparent'			
			},
			flashvars: {
				xmlFile: 'home_images.xml',
				xmlFileType: 'Default'
			},
			width:686,
			height:392,
			id: 'insertFlash'
		});
		$('#flashMap').flash({ 
			// test_flashvars.swf is the flash document 
			swf: 'flash/Savannah.swf', 
			// these arguments will be passed into the flash document 
			params: { 
				allowfullscreen: 'false', 
				allowscriptaccess: 'always', 
				wmode: 'transparent'			
			},
			width:660,
			height:480,
			id: 'interactiveMap'
		});
	} else {
			$('#flashReplace').html('<p>You must have <a href="http://get.adobe.com/flashplayer/">Abode Flash</a> installed to view this slideshow</p>');
			$('#flashMap').html('<p>You must have <a href="http://get.adobe.com/flashplayer/">Abode Flash</a> installed to view this map</p>');
	};
	if ($('#gallery a')) {
		$('#gallery a').lightBox({fixedNavigation:true});
	};
	if ($('.lightbox')) {
		$('.lightbox').lightBox({fixedNavigation:true});
	};
});

