/* Overriding Javascript's Confirm Dialog */

// NOTE; A callback must be passed. It is executed on "cotinue". 
//  This differs from the standard confirm() function, which returns
//   only true or false!

// If the callback is a string, it will be considered a "URL", and
//  followed.

// If the callback is a function, it will be executed.


function confirm(msg,callback) {
  $('#confirm')
    .jqmShow()
  
}

function makeCookie()
{
	createCookie ('firstvisit', 'this visitor has already visited', 1);
}



$(document).ready(function() {
  $('#confirm').jqm({overlay: 97, modal: true, trigger: false});
  
  // trigger a confirm whenever links of class alert are pressed.
 
  
    //confirm(); 
    return true;

  
});

//uncomment this line to delete the cookie
//createCookie ('firstvisit', 'this visitor has already visited', -1);

function checkPage()
{
	
	var see = document.getElementById("no");
	if (see.checked){
		
    	window.location = ("eu_index.html");		
	}
	else{
		makeCookie();
		hide();
	}
	
}


function checkIfCookieExists(cookiename)
	{
		if (document.cookie.indexOf(cookiename) > -1)
		{
			return true;
		} else
		{
			return false;
		}
	}
	
	
	function createCookie(name,value,days) {
		//alert(days);
		//if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		//}
		
		//else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}


function check(msg,callback) {
  $('#confirm_self')
    .jqmShow()
 
}


function movie(msg,callback) {
  

  
  $('#confirm_vid')
    .jqmShow()
 
}

function movie2(msg,callback) {

  
  $('#confirm_vid2')
    .jqmShow()
 
}

function movie3(msg,callback) {

  
  $('#confirm_vid3')
    .jqmShow()
 
}

function movie4(msg,callback) {

  
  $('#confirm_vid4')
    .jqmShow()
 
}


function hide(msg,callback)
{
		
	$('#confirm')
    .jqmHide()
	
}





$().ready(function() {
  $('#confirm_vid').jqm({overlay: 88, modal: true, trigger: false});
  $('#confirm_vid2').jqm({overlay: 88, modal: true, trigger: false});
  $('#confirm_vid3').jqm({overlay: 88, modal: true, trigger: false});
  $('#confirm_vid4').jqm({overlay: 88, modal: true, trigger: false});
  
  // trigger a confirm whenever links of class alert are pressed.
  $('.confirm_vid').click(function() { 
    movie(); 
	hide();
    return false;
  });
    $('.confirm_vid2').click(function() { 
    movie2(); 
	hide();
    return false;
  });
	$('.confirm_vid3').click(function() { 
    movie3(); 
	hide();
    return false;
  });
	$('.confirm_vid4').click(function() { 
    movie4(); 
	hide();
    return false;
  });
});




   

