$(document).ready(function() { 


//***********************
//Minimum browser version to user for HTML5 video
//***********************
var ie_min = 9;
var chrome_min = 8;
var firefox_min = 6;
var safari_min = 4;




var img;// = new Image();
var start;
var detectedBandwidth;
var portableDevice;
useflash = false;
var autoplay;
var recordPlay = true;
var currentName;
var bandwidthArray;
var hideBandwidth = false;
var hdbandwidth = 0;
var ldbandwidth = 0;
var displaybandwidth;

playerfullscreen = false;
fullscreenclick = false;
errorcheck = 0;


bandtype = "sd";

playabletype ="";



//***********************
//Check Device type
//***********************

deviceAgent = navigator.userAgent.toLowerCase();

portableDevice = (deviceAgent.match(/(mobile)/)) ?  true : false;

isandroid = (deviceAgent.match(/(android)/)) ?  true : false;

if(isandroid)
{
	portableDevice = true;
}


//***********************
//Check Flash version
//***********************
   
    var version = 0, desc;
    if (typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") {
      desc = navigator.plugins["Shockwave Flash"].description;
      if (desc && !(typeof navigator.mimeTypes != "undefined" && navigator.mimeTypes["application/x-shockwave-flash"] && !navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)) {
        version = parseInt(desc.match(/^.*\s+([^\s]+)\.[^\s]+\s+[^\s]+$/)[1], 10);
      }
    } else if (typeof window.ActiveXObject != "undefined") {
      try {
        var testObject = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
        if (testObject) {
          version = parseInt(testObject.GetVariable("$version").match(/^[^\s]+\s(\d+)/)[1], 10);
        }
      }
      catch(e) {}
    }
    

//version = 0;
//alert(useflash);

/*if(!portableDevice)
{
	autoplay = "";
	//Player();
}else
{
	autoplay = "";
	//Player();
}*/



$('.i2i-img').live('click', function() {
//alert();
	var cid = this.id
	$(this).hide();
	
	$('#i2i-videobox'+cid).show();

});

 $('.i2i-imagelink').live('click', function() {
//alert();
	var cid = this.id
	$(this).hide();
	$("#i2i-videobox"+cid).show();
	$("#i2i-vplayer"+cid).play();
});



$('#i2iplay').live('click', function() {
//alert("play");
	/*var cid = this.id
	$(this).hide();
	$("#i2i-videobox"+cid).show();*/
	//$("#i2i-vplayer0").get(0).play();
	//$('#i2i-videobox0').show();
	$('.i2i-vplayer0').get(0).play();
});


$('.block').live('click', function() {
alert('block click')
});


//***********************
//Find setup info
//***********************

$(function() {
buldPlayer = function()
{
	//alert("build player called");
var counter = 0;
$('.i2ivideo').each(function(index) 
{
 //alert();
 	$(this).attr("id", counter);
	
	Player(this, counter);
	
	counter ++;	
	
});


}
});



$(function(vurl) {
loadhtml5 = function(vurl)
{
	//$('.i2i-vplayer0').attr()
	//alert(vurl)
	
		var myVideo = $('.i2i-vplayer0').get(0);
		if(myVideo)
	{
		//myVideo.stop();
        myVideo.src=vurl;
        myVideo.load();
        myVideo.play();
		$('#i2iv').show();
		$('.hdblock').hide();
		$('#imgholder').hide();
	}
}
});



function Player(element, idnum)
{
	
	if(element)
	{
	 programme = $(element).attr("i2i-programme");
	 logref = $(element).attr("i2i-logref");
	 programmeName = $(element).attr("i2i-programmeName");
	 siteURL = $(element).attr("i2i-siteURL");
	 googleAnalyticsID = $(element).attr("i2i-googleAnalyticsID");
	 pubPoint = $(element).attr("i2i-pubPoint");
	 htmlPubPoint = $(element).attr("i2i-htmlPubPoint");
	 fileType = $(element).attr("i2i-availablefileType");
	 bandwidth = $(element).attr("i2i-Bandwidth");
	 programmeImage = $(element).attr("i2i-programmeImage");
	 pwidth = $(element).attr("i2i-width");
	 pheight = $(element).attr("i2i-height");
	 autoStart = $(element).attr("i2i-autoStart");
	 flashprogessive = $(element).attr("i2i-flashprog");
	
	 i2iligthbox = $(element).attr("i2i-ligthbox");
	 htmlheight = parseInt($(element).attr("i2i-height"));
	 currentName = programmeName;
	
	 bandwidthArray = bandwidth.split(","); 
	
	
	//Set html5 bandwidth values
	hdbandwidth = bandwidthArray[0];
	ldbandwidth = bandwidthArray[bandwidthArray.length-1];

	detectedBandwidth = hdbandwidth;
	
	if(bandwidthArray.length <= 1) // if only one bandwidth available hide change bandwidth button
	{
		hideBandwidth = true;
	}
	
	
	
	if(version >= 10 && portableDevice== false && (fileType.search(/mp4/i)!= -1 || fileType.search(/flv/i)!= -1)) 
	{
		useflash = true; //Dont use flash if mobile device or incorrect flash version
	}

	
	
	if(!useflash) //If flash not available
	{
		
		
	//portableDevice = true;	
		
	
	//***********************
	//Build video tag
	//***********************
	
	displaybandwidth="";
	
	if(!hideBandwidth)
	{
		displaybandwidth='_'+detectedBandwidth+'k';
	}
	
	
		$(element).empty().append( '<div id="i2i-videobox'+idnum+'" class="i2i-videobox"><video id="i2iv" class="i2i-vplayer'+idnum+'"   width="'+pwidth+'" height="'+htmlheight+'"   poster="'+programmeImage+'" > <source src="'+htmlPubPoint+programme+displaybandwidth+'.'+fileType+'" /><source src="'+htmlPubPoint+programme+displaybandwidth+'.webm" type="video/webm" /><source src="'+htmlPubPoint+programme+displaybandwidth+'.ogv" type="video/ogg" /></video><div style="display:none;" id="ving'+idnum+'" class="ving"></div><div style="display:none;" id="verror" class="verror">Sorry something has gone wrong!<br />Please try reing this page</div><div id="imgholder" class="imgholder"><img  class="vid" src="'+programmeImage+'" width="'+pwidth+'" height="'+htmlheight+'"/><img class="picon" src="/images/playicon.png" /></div><div class="hdblock"><img src="images/sd.png" style="margin: 10px 0 0 10px!important;"/></div></div> ');


		videoref = $('.i2i-vplayer0').get(0);
		if(canplayvideo() && checkbrowsers()) //HTML 5 playback available
		{
portableDevice = true;

if(portableDevice) //If mobile device use device player controls
{
	$('#i2iv').attr( 'controls' , 'controls'  );
	$('#i2iv').hide();
	
	$('#imgholder').live('click', function(e) {
		if(isandroid)
		{
			//alert(htmlPubPoint+programme+"_"+detectedBandwidth+"k."+playabletype);
			//$('.i2i-vplayer0').get(0).src=htmlPubPoint+programme+"_"+detectedBandwidth+"k."+playabletype;
			//$('.i2i-vplayer0').get(0).();
			window.location = htmlPubPoint+programme+displaybandwidth+"."+playabletype;
		}else
		{	
			$(this).hide();
			$('#i2iv').show();
	
			$('.i2i-vplayer0').get(0).play()
			$('.hdblock').hide();
		}
	});
	
	
	
	
	
	
	/*$('#imgholder').live('click', function(e) {
	

	});*/
	
	
}else
{
	//***********************
	//Build HTML5 player controls
	//***********************
	
	$('#i2iv').attr( 'autoplay' , 'autoplay'  );
	$('#i2iv').attr( 'pre' , 'auto'  );
	$('#imgholder').hide();
$('.i2i-videobox').append('<div id="playercontrolsholder"><div id="playercontrols"><div id="playbox" class="playboxout"><img src="/images/smallplay.png" /></div><div id="controlboxholder"><div id="timebox" ><p style="margin: 5px 0 0 20px!important; display:inline-block;"><span class="ctime">00:00</span>&nbsp;<span class="timediv">/</span>&nbsp;<span class="cduration">00:00</span></p></div><div id="controlbox" ><div id="scrubborder"><div id="downprogress"></div><div id="playprogress"></div></div><div id="volumebox"></div><div id="fullscreenbox"></div></div></div></div></div>');


$('#controlboxholder').width($('#playercontrols').width()-$('#playbox').width()-30);
$('#controlbox').width($('#controlboxholder').width());
$('#scrubborder').width($('#controlboxholder').width()-40-$('#volumebox').width()-$('#fullscreenbox').width()-5);
$('#downprogress').width($('#scrubborder').width()-2);


$('#scrubborder').live('click', function(e) {
	var offset = $(this).offset();
	var sbarp = (e.clientX - offset.left) / $('#scrubborder').width() * 100;
    var scrubp = Math.round(videoref.duration / 100 * sbarp);
	//alert(scrubp);
	
	videoref.currentTime = scrubp;

});

$('.i2i-videobox').mouseout(function() {
  $('#playercontrolsholder').hide();
	$('.hdblock').hide();
}).mouseover(function() {
  $('#playercontrolsholder').show();
  	if(!playerfullscreen && !hideBandwidth)
	{
		$('.hdblock').show();
	}
});



$(".hdblock").hover(
  function () {
	  
    $(this).addClass("hdblockover");
  }, 
  function () {
    $(this).removeClass("hdblockover");
  }
);




$("#playbox").hover(
  function () {
	  
    $(this).addClass("playboxover");
  }, 
  function () {
    $(this).removeClass("playboxover");
  }
);
	
	
/*$('.i2i-vplayer'+idnum).bind("waiting", function() {
   		$("#ving0").show();
	});
	
	$('.i2i-vplayer'+idnum).bind("playing", function() {
   		$("#ving0").hide();
		//$('.i2i-vplayer0').attr("controls","true");
	});*/
	

	
	//*************************Set Event Listeners**********************
	
	
	
	
	
	$('.i2i-vplayer0').bind("seeking", function() {
   		$(".ving").show();
	});
	
	$('.i2i-vplayer0').bind("seeked", function() {
   		$(".ving").hide();	
	});
	
	
	$('.i2i-vplayer0').bind("edmetadata", function() {
   		//alert($('#scrubborder').width())
		//alert(Math.round($(".i2i-vplayer0").get(0).duration));
		$('.cduration').empty().append(formatTime(videoref.duration))
	});

	
	$('.i2i-vplayer0').bind("playing", function() {
		b = $(".i2i-vplayer0").get(0).buffered
   		$("#playbox").find('img').attr("src","/images/smallpause.png");
		$('.verror').hide();
		errorcheck = 0;
	});
	
	$('.i2i-vplayer0').bind("pause", function() {
		b = $(".i2i-vplayer0").get(0).buffered
   		$("#playbox").find('img').attr("src","/images/smallplay.png");
	});

	$('.i2i-vplayer0').bind("progress", function(e) {
   		//alert();
		//var timep = videoref.buffered.end(0) / videoref.duration *100;
		//var progp = Math.round(($('#scrubborder').width()-1) / 100 * timep);
		//$('#downprogress').width(progp);
		// var endVal = videoref.seekable && videoref.seekable.length ? videoref.seekable.end(0) : 0;
		//$('#vprog').empty().append(endVal+" "+videoref.duration)	
		
	});
	
	$('.i2i-vplayer0').bind("timeupdate", function() {
   		
		var timep = videoref.currentTime / videoref.duration *100;
		var progp = Math.round(($('#scrubborder').width()-1) / 100 * timep);
		$('#playprogress').width(progp);
		$('.ctime').empty().append(formatTime(videoref.currentTime));	
		
			
		
	});
	
	
	
	$('.i2i-vplayer0').bind("stalled", function() {
		//alert('stalled');
	});
	
	$('.i2i-vplayer0').bind("abort", function() {
		//alert('abort');
	});
	
	$('.i2i-vplayer0').bind("suspend", function() {
		//alert('suspend');
	});
	
	
	
	$('.i2i-vplayer0').bind("error", function() {
   		
			
		//alert("error");
		
		if(errorcheck <5)
		{
			 //alert('error '+videoref.error.code);
			errorcheck++;
			$('.i2i-vplayer0').get(0).src=htmlPubPoint+programme+displaybandwidth+"."+playabletype;
			$('.i2i-vplayer0').get(0).load();
			if(!portableDevice)
			{
				$('.i2i-vplayer0').get(0).play();
			}
		}else
		{
			$('.verror').show();
			$('.ving').hide();
		}
			
		
	});
	
	
	$('.i2i-vplayer0').get(0).src=htmlPubPoint+programme+displaybandwidth+"."+playabletype;
			$('.i2i-vplayer0').get(0).load();
			if(!portableDevice)
			{
				$('.i2i-vplayer0').get(0).play();
			}
	
	
	
	$('#playbox').live('click', function() {

		
		if(videoref.paused)
		{
			videoref.play();
		}else
		{
			videoref.pause();
		}
	 
    
    
	});
	
	
	
	
	$('#volumebox').live('click', function() {
		
		if(videoref.muted)
		{
			videoref.muted = false;
			$(this).addClass("volumeover");
			$(this).removeClass("mutevolume");
			$(this).removeClass("mutevolumeover");
		}else
		{
			videoref.muted = true;
			$(this).addClass("mutevolume");
			$(this).addClass("mutevolumeover");
			$(this).removeClass("volumeover");
		}
		
	});
	
	$("#volumebox").hover(
  		function () {
	  		if(videoref.muted)
			{
    			$(this).addClass("mutevolumeover");
			}else
			{
				$(this).addClass("volumeover");
			}
  		}, 
  		function () {
			if(videoref.muted)
			{
    			$(this).removeClass("mutevolumeover");
			}else
			{
				$(this).removeClass("volumeover");
			}
  		}
	);
	
	
	
	
	
	$('#fullscreenbox').live('click', function() {

		$('#playercontrols').css("width",$('#playercontrols').width());
		$('#playercontrols').css("margin","0 auto");
		
		
		/*if(videoref.webkitSupportsFullscreen)
		{
			//alert($(document).webkitIsFullScreen);
			
			if($(document).webkitIsFullScreen)
			{
				$("#i2i-videobox0").get(0).webkitCancelFullScreen();
				$(".i2i-vplayer0").removeClass("fullscreen");
			}else
			{
				$(".i2i-videobox").get(0).webkitRequestFullScreen()
				$(".i2i-vplayer0").addClass("fullscreen");
			}
				
				
			
		}else*/
	 	if(playerfullscreen)
		{
			playerfullscreen = false;
			$(this).removeClass("exitfullscreenover");
			$(this).removeClass("exitfullscreen");
			$('.i2i-videobox').removeClass("bgblack");
			$('.hdblock').show();
			
			
				$(".i2i-videobox").removeClass("fullscreen");
				$(".i2i-vplayer0").removeClass("fullscreen");
			if(i2iligthbox =="true")
			{
				$("#sb-container", top.document).attr("style", ligths1);
				$("#sb-wrapper", top.document).attr("style" , ligths2);
				$("#sb-wrapper-inner", top.document).attr("style", ligths3);
			}
			$("html", top.document).css("height","100.1%" );
			$('.ving').css("left", ($('.i2i-videobox').width()-$('.ving').width())/2+"px" );
			
		}else
		{
			
			playerfullscreen = true;
			$(this).removeClass("fullscreenover");
			$(this).addClass("exitfullscreen");
			$('.i2i-videobox').addClass("bgblack");
			$('.hdblock').hide();
			$(".i2i-videobox").addClass("fullscreen");
			$(".i2i-vplayer0").addClass("fullscreen");
			
			
			if(i2iligthbox =="true")
			{
				
				
				ligths1 = $("#sb-container", top.document).attr("style");
				ligths2 = $("#sb-wrapper", top.document).attr("style");
				ligths3 = $("#sb-wrapper-inner", top.document).attr("style");
				
				$("#sb-container", top.document).attr("style","position:absolute !important; left:0 !important; right:0 !important; top:0 !important; bottom:0 !important; width:100% !important; height:100% !important; overflow:hidden !important; display:inline; visibility:visible");
				$("#sb-wrapper", top.document).attr("style","position:absolute !important; left:0 !important; right:0 !important; top:0 !important; bottom:0 !important; width:100% !important; height:100% !important; overflow:hidden !important; display:inline; visibility:visible");
				
				$("#sb-wrapper-inner", top.document).attr("style","height:100%; overflow:hidden;" );
				
				
				
					
				
			}
			$("html", top.document).css("height","100%" );
			$('.ving').css("left", ($('.i2i-videobox').width()-$('.ving').width())/2+"px" );
			
	//sb-wrapper
	//sb-info
	//sb-container
		}
		//onFullscreenChange();
    
	});
	
	$("#fullscreenbox").hover(
  		function () {
	  		if(playerfullscreen)
			{
    			$(this).addClass("exitfullscreenover");
			}else
			{
				$(this).addClass("fullscreenover");
			}
  		}, 
  		function () {
			if(playerfullscreen)
			{
    			$(this).removeClass("exitfullscreenover");
			}else
			{
				$(this).removeClass("fullscreenover");
			}
  		}
	);
	
	//$(document).bind('webkitfullscreenchange', onFullscreenChange);
	
	function onFullscreenChange()
	{
		//alert("fullscreen change");
		
		/*if(playerfullscreen)
		{
			playerfullscreen = false;
		}else
		{
			playerfullscreen = true;
		}*/
	}
	/*$(".i2i-videobox").get(0).bind("webkitfullscreenchange", function() {
   		
		alert("change fullscreen");	
		
	});*/
	
}


	if(bandwidthArray.length <= 1) // if only one bandwidth available hide change bandwidth button
	{
		$('.hdblock').hide();
		hideBandwidth = true;
	}
	


	$('.hdblock').live('click', function() 
	{
	
	
		if(bandtype == "sd")
		{
	 		bandtype = "ld";
			detectedBandwidth=ldbandwidth;
			$(".hdblock").find('img').attr("src","/images/ld.png");
		}else
		{
			bandtype = "sd";
			detectedBandwidth=hdbandwidth;
			$(".hdblock").find('img').attr("src","/images/sd.png");
		}
		//alert(htmlPubPoint+programme+"_"+detectedBandwidth+"k.mp4");
		$('.i2i-vplayer0').get(0).src=htmlPubPoint+programme+"_"+detectedBandwidth+"k."+playabletype;
		$('.i2i-vplayer0').get(0).load();
		if(!portableDevice)
		{
			$('.i2i-vplayer0').get(0).play();
		}
    // myVideo.play();
	//$('.i2i-vplayer0').get(0).play();
	
	});








		//***********************
		//HTML 5 video player events
		//***********************

		$('.i2i-vplayer0').bind("ended", function() {
 
			if(!portableDevice)
			{
			
				$('.ctime').empty().append("00:00");
				$("#playbox").find('img').attr("src","/images/smallplay.png");
				$('#playprogress').width("1");
			
			}else
			{
				$('#i2iv').hide();
				$('#imgholder').show();
			}

			videoref.pause();
		
		});
	
		$('.i2i-vplayer0').bind("waiting", function() {
   			//alert("wating!!!");
			$(".ving").show();
			//alert('error '+videoref.error.code);
		});
	
		$('.i2i-vplayer0').bind("playing", function() {
   		
			//alert("playing!!!");
			$(".ving").hide();
			//alert('error '+videoref.error.code);
		
		});	

	}else
		{
		//***********************
		//HTML 5 video not supported & incorrect version of flash
		//***********************
	
		$(element).empty().append( '<div id="i2i-videobox'+idnum+'" style="font-size: 18px!important; font-weight: bold; color: #FFF!important;"><p style="font-size: 18px!important; font-weight: bold; color: #FFF!important; padding-top:20px;"><center>Sorry Your browser does not support video playback Please update Flash player to the latest version or upgrade your browser</center></p><br /><br /><a href="http://get.adobe.com/flashplayer/"><center><img src="/images/down_flash_icon.jpg" border="0"/></a></center></div>');
		}
	

		
		}else
		{
			//***********************
			//Build flash player
			//***********************
			
			if(fileType.search(/mp4/i)!= -1) //Set to single file type for flash player
			{
				fileType="mp4";
			}else if(fileType.search(/flv/i)!= -1)
			{
				fileType="flv";
			}
			
			var fpro =""
			if(flashprogessive =="true")
			{
				fpro = '&progressive='+htmlPubPoint+programmeName+'.'+fileType;
			}
			
			
			
			$(element).empty().append( '<div id="i2i-videobox'+idnum+'"><object id="flash_fallback_'+idnum+'" class="vjs-flash-fallback" width="'+pwidth+'" height="'+pheight+'" type="application/x-shockwave-flash" data="'+siteURL+'player.swf"><param name="movie" value="'+siteURL+'player.swf" /><param name="allowfullscreen" value="true" /><param name="fullScreenOnSelection" value="true" /><param name="flashvars" value="programme='+programme+'&programmeName='+programmeName+'&siteURL='+siteURL+'&googleAnalyticsID='+googleAnalyticsID+'&pubPoint='+pubPoint+'&fileType='+fileType+'&bandwidth='+bandwidth+'&portableDevice='+portableDevice+'&programmeImage='+programmeImage+'&autostart='+autoStart+'&width='+pwidth+'&height='+pheight+fpro+'" /></object></div>');
		
		}

	}
}

function checkplaystate()
{
	
}





//***********************
//Check if browser can play video
//***********************


function canplayvideo()
{
	if(isandroid)
	{
		playabletype = "mp4";
		return true;
	}else if(!!document.createElement('video').canPlayType)
  	{
		var canPlay = videoref.canPlayType('video/mp4');
		if ((canPlay == "probably" || canPlay == "maybe") && fileType.search(/mp4/i)!= -1) 
		{
			playabletype = "mp4"; 
			return true;	
		}else
		{
			canPlay = videoref.canPlayType('video/webm');
			if((canPlay == "probably" || canPlay == "maybe") && fileType.search(/webm/i)!= -1)
			{
				playabletype = "webm";
				return true;
			}else
			{
				canPlay = videoref.canPlayType('video/ogg');
				if((canPlay == "probably" || canPlay == "maybe") && fileType.search(/ogv/i)!= -1)
				{
					playabletype = "ogv";
					return true;
				}else
				{
					return false;	
				}
			}
		}
	}else
	{
		return false;
	}
}



//***********************
//Detect browser and version number
//***********************


function checkbrowsers()
{
	
	
	var tdevice = deviceAgent.toUpperCase();
	var vnumber; 
	if(portableDevice)
	{
		return true;
	}else
	{
		
		if(tdevice.match(/(CHROME)/))
		{
			
			vnumber = tdevice.split("CHROME");
			vnumber = vnumber[1].split("/");
			vnumber = vnumber[1].split(" ");
			if(chrome_min <= parseFloat(vnumber[0]))
			{
				
				return true;
			}else
			{
				
				return false;
			}
			
		}else if(tdevice.match(/(MSIE)/))
		{
			vnumber = tdevice.split("MSIE");
			vnumber = vnumber[1].split(" ");
			vnumber = vnumber[1].split(";");
			
			if(ie_min <= parseFloat(vnumber[0]))
			{
				return true;
			}else
			{
				return false;
			}	
			
	
		}else if(tdevice.match(/(FIREFOX)/))
		{
			vnumber = tdevice.split("FIREFOX");
			vnumber = vnumber[1].split("/");
			
			if(firefox_min <= parseFloat(vnumber[1]))
			{
				return true;
			}else
			{
				return false;
			}	
			
				
			
	
		}else if(tdevice.match(/(SAFARI)/))
		{
	
			vnumber = tdevice.split("VERSION/");
			vnumber = vnumber[1].split(" ");
			
			if(safari_min <= parseFloat(vnumber[0]))
			{
				return true;
			}else
			{
				return false;
			}	
				
	
		}else if(isandroid)
		{
			return true;
		}else
		{
			return false;	
		}
	}
}









});


//***********************
//Convert seconds to minutes and seconds
//***********************

function formatTime(seconds) {
  seconds = Math.round(seconds);
  minutes = Math.floor(seconds / 60);
  minutes = (minutes >= 10) ? minutes : "0" + minutes;
  seconds = Math.floor(seconds % 60);
  seconds = (seconds >= 10) ? seconds : "0" + seconds;
  return minutes + ":" + seconds;
}

function hidecontrols() {
	alert("!!");
	
    $('#playercontrolsholder').hide();
	$('.hdblock').hide();
  }


//***********************
//Google anaylitics code
//***********************

function anaylitics()
{
	/*alert("anaylitics called");
	_gaq.push(['_trackEvent', 'VIDEO_HTML5']);
	gaq.push(['_trackEvent', 'VIDEO_HTML5']);
	_gaq.push(['_trackEvent', 'VIDEO_START', currentName]);
	_gaq.push(['_trackEvent', 'VIDEO_HTML5']);
	//setTimeout("_gaq.push(['_trackEvent', 'VIDEO_START', currentName])",450);
	//setTimeout("_gaq.push(['_trackEvent', 'VIDEO_HTML5'])",650);
	setTimeout("alert('sdfsdfdsfd')])",450);
	alert("anaylitics called");*/
}

 
