function $(e) { return document.getElementById(e); }

function showVideo(id){
    var embedHTML = "<embed src='http://admin.brightcove.com/destination/player/player.swf' bgcolor='#f7340c' flashVars='allowFullScreen=true&initVideoId="+id+"&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&autoStart=false' base='http://admin.brightcove.com' name='bcPlayer' width='486' height='412' allowFullScreen='true' allowScriptAccess='always' seamlesstabbing='false' type='application/x-shockwave-flash' swLiveConnect='true' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed>";
    $('video').innerHTML = embedHTML;
		$('info').innerHTML = $('info_'+id).innerHTML;
}

function init() {
	if (readCookie('visited') == 'yup') {
		// been here before
		showVideo($('selector').options[$('selector').selectedIndex].value);
	} else {
		// first time visitors get a cookie
		createCookie('visited', 'yup', 720);
		// and they see the first video
		$('selector').selectedIndex = 0;
		showVideo($('selector').options[0].value);
	}
}
