/*
 * Copyright (C) 2011, KIT Digital  
 * */
var kitd = { 
	version: 2,
	bindKITPlayer: function bindKITPlayer(id) {
		document.getElementById(id).addEventListener('click', function() {
			/* Prototype.js
			var 
				v = (this.getElementsBySelector('video'))[0], 
				t = (this.getElementsBySelector('.kewego-html5-poster'))[0],
				b = (this.getElementsBySelector('.kewego-html5-button'))[0];
			//*/

			/* jQuery
			var 
				v = ($('video', $(this))[0], 
				t = ($('.kewego-html5-poster', $(this)))[0],
				b = ($('.kewego-html5-button', $(this)))[0];
			//*/

			//* Native Javascript
			// querySelectorAll() Supported by Android and Safari Mobile
			var
				v = (this.querySelectorAll('.kewego-html5-video'))[0], 
				t = (this.querySelectorAll('.kewego-html5-poster'))[0],
				b = (this.querySelectorAll('.kewego-html5-button'))[0];
			//*/
			if (!v) {
				return false;
			}

			v.setAttribute('src', v.getAttribute('data-src'));
			v.load();
			v.play();
			v.style.height = v.style.width = '100%';

			if (t) {
				t.style.display = 'none';
			}
			if (b) {
				b.style.display = 'none';
			}
		}, true);

	}
}

