function getQuerystring(key, default_)
	{
	 if (default_==null) default_=""; 
	 key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	 var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
	 var qs = regex.exec(window.location.href);
	 if(qs == null)
	 return default_;
	 else
	 return qs[1];
	}
	
		$(document).ready(function() {
			
			if (getQuerystring("playvideo","false") == "true")
			{
				
				$.fancybox('<div class="video-js-box" style="width:640px; height:360px;"><video id="player" class="video-js" width="640" height="360" controls preload autoplay><source src="'+$(".play-video").attr("title")+'" type=\'video/mp4; codecs="avc1.640029, mp4a.40.2\' /><object id="flash_fallback_1" class="vjs-flash-fallback" width="640" height="360" type="application/x-shockwave-flash" data="http://ise-group.com/iseergonomics/js/flowplayer/flowplayer-3.2.7.swf"><param name="movie" value="http://ise-group.com/iseergonomics/js/flowplayer/flowplayer-3.2.7.swf" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><param name="flashvars" value=\'config={"clip":{"url":"'+$(".play-video").attr("title")+'", "autoPlay":true, "autoBuffering":true}}\' /></object></video></div>',
						{
							'scrolling': false,
							'titleShow': false,
							'padding': 0,
							'onClosed': function() {
								window.location.href="http://www.ise-group.com";
							}
						});
						
								$("#player").VideoJS();
								//$("#player")[0].player.play();
								return false;
						
			}
			
			if ($("a.play-video"))
			{
				$("a.play-video").live("click", function() {
					
					
					$.fancybox('<div class="video-js-box" style="width:640px; height:360px;"><video id="player" class="video-js" width="640" height="360" controls preload autoplay><source src="'+$(".play-video").attr("title")+'" type=\'video/mp4; codecs="avc1.640029, mp4a.40.2\' /><object id="flash_fallback_1" class="vjs-flash-fallback" width="640" height="360" type="application/x-shockwave-flash" data="http://ise-group.com/iseergonomics/js/flowplayer/flowplayer-3.2.7.swf"><param name="movie" value="http://ise-group.com/iseergonomics/js/flowplayer/flowplayer-3.2.7.swf" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><param name="flashvars" value=\'config={"clip":{"url":"'+$(".play-video").attr("title")+'", "autoPlay":true, "autoBuffering":true}}\' /></object></video></div>',
					{
						'scrolling': false,
						'titleShow': false,
						'padding': 0,
						'onClosed': function() {
						    //parent.location.reload(true); 
					}
					});
					
					$("#player").VideoJS()
					//$("#player")[0].player.play();
					return false;
					
				
				});
			}
	 });
	 
	 
	 
