$("body").hide();
$(document).ready(function() {
	$("#vidHTML").hide();
	/*$("#flashContent").hide();*/
	$("#flashContent").css('visibility','visible');
	
	$("#ticker").css('visibility','visible');
/*checkBrowser();
checkCookie();*/
var mob = checkIfMobile();
if (mob){
	checkCookie();
}
var tab = checkIfTablet();
if (tab){
	setNoFlashVersion();
}
enableVideoClicks();
$("body").show();
});

function enableVideoClicks() {
      var videos = document.getElementsByTagName('video') || [];
      for (var i = 0; i < videos.length; i++) {
        // TODO: use attachEvent in IE
        videos[i].addEventListener('click', function(videoNode) {
          return function() {
            videoNode.play();
          };
        }(videos[i]));
      }
    }

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function checkCookie(){
	var x = readCookie('fullsite');
if (x) {
	setNoFlashVersion();
   } else{
	   window.location = "http://www.jerseyboysinfo.com/vegas/m";
	  }
}

function checkBrowser(){
}

function checkIfMobile(){
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))|| (navigator.userAgent.match(/Android/i)))
   {
	   return true;
	   }
	   else{
		   return false;
		}
}

function setNoFlashVersion(){
	   $("#vidHTML").show();
	   $("#vidHTML").css('visibility','visible');
	   $("#ticker").hide();
	   $("#flashContent").hide();
	   $("#flashContent").css('visibility','hidden');
}

function checkIfTablet(){
if(navigator.userAgent.match(/iPad/i))
   {
	   return true;
	   }
	   else{
		   return false;
		}
}
