	function checkHTML5() {
		var v = document.createElement('video');
		var supported = v.canPlayType('video/mp4; codecs="avc1.58A01E, mp4a.40.2"');
		if ( supported == 'probably') {
			return true;
		}else {
			return false;
		}
	}
	function createFlashVideo(source, vidWidth, vidHeight, destination){
			var videodata = '<object width="' + vidWidth + '" height="' + vidHeight + '">';
			videodata += '<param name="movie" value="strobemediaplayback.swf">';
			videodata += '</param><param name="flashvars" value="src=' + source + '&autoPlay=true">';
			videodata += '</param><param name="allowFullScreen" value="true"></param>';
			videodata += '<param name="allowscriptaccess" value="always"></param>';
			videodata += '<param name=”wmode” value=”transparent”>';
			videodata += '<embed src="strobemediaplayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + vidWidth + '" height="' + vidHeight + '" flashvars="src=' + source + '&autoPlay=true" wmode="transparent" ></embed>';
			videodata += '</object>';
			videodata += '<a href="http://robertellis.aztec360.co.uk" title="Robert Ellis TV" id="listinglinks" >View Listings</a>';
			destination.innerHTML = videodata;
	}
	function createHTML5Video(source, vidWidth,vidHeight, destination) {
		video = document.createElement('video');
		video.height = vidHeight;
		video.width = vidWidth;
		video.id = 'video';
		video.onclick = function () {window.location = 'http://robertellis.aztec360.co.uk';}
		video.setAttribute('controls', 'true');
		video.setAttribute('autobuffer', 'true');
		video.src = source;
		video.type = "video/m4v";
		destination.appendChild(video);
		var thelink = document.createElement('a');
		thelink.href = "http://robertellis.aztec360.co.uk";
		thelink.title = "Robert Ellis TV";
		thelink.id = "listinglinks";
		thelink.innerHTML = "View Listings";
		destination.appendChild(thelink);
		video.load();
		video.play();
	}
	function insertVideo(flash_source, m4v_source, desinationId, vidWidth, vidHeight) {
		var destination = document.getElementById(desinationId);
		destination.style.display = 'block';
		var navvy = navigator.userAgent;
		if ((navvy.search('MSIE') != -1 ) ||((navvy.search('Safari') != -1 )&&(navvy.search('Windows') != -1 )&&(navvy.search('Chrome') == -1 ))){
			createFlashVideo(flash_source, vidWidth, vidHeight, destination);
		}else if (checkHTML5()==true) {
			createHTML5Video(m4v_source, vidWidth, vidHeight, destination);
		}else {
			createFlashVideo(flash_source, vidWidth, vidHeight, destination);
		}
	} 
	function changeProperty(pType, pRef, thisLink) {
		var allDivs = document.getElementsByTagName('div');
		for (var i = 0; i < allDivs.length; i++ ) {
			if (allDivs[i].getAttribute('rel') == "feat_"+pType) {
				allDivs[i].className = 'inactive';
			}
		}
		document.getElementById('feature_' + pRef).className = 'active';
		var allLinks = thisLink.parentNode.childNodes;
		for (var i = 0; i <allLinks.length; i++) {
			if (allLinks[i].nodeName.toLowerCase() == "a") {
				allLinks[i].className = 'inactive';
			}
		}
		thisLink.className = 'active';
	}	
	function eventFire(el, etype){
		if (el.fireEvent) {
			(el.fireEvent('on' + etype));
		} else {
			var evObj = document.createEvent('Events');
			evObj.initEvent(etype, true, false);
			el.dispatchEvent(evObj);
		}
	}

	function timeIt(whatThe, theTime) {
		setTimeout(function () {eventFire(whatThe, 'click');}, theTime);
	}
	function autoScroll(pType) {
		var linkArray = Array();
		linkContainer = document.getElementById('featlinks_'+pType);
		var allLinks = linkContainer.childNodes;
		var theTime = 0;
		for (var i = 0; i <allLinks.length; i++) {
			if (allLinks[i].nodeName.toLowerCase() == "a") {
				var whatThe = allLinks[i];
				theTime += 5000;
				timeIt(whatThe, theTime);				
			}
		}
	}	
	
	
	
	
	
	
	
	
	
	
