/* 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.
  if(!checkIfCookieExists("firstvisit")) confirm(); 	 
  
    //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) {
  
	//JC MODIFIED ON 04.24.09
  try{getFlashMovie("hylvideo").JSPlay()} catch(er){}
  //
  
  $('#confirm_vid')
    .jqmShow()
 
}

function movie2(msg,callback) {
  
	//JC MODIFIED ON 04.24.09
  try{getFlashMovie("video2").JSPlay()} catch(er){}
  //
  
  $('#confirm_vid2')
    .jqmShow()
 
}


function hide(msg,callback)
{
		
	$('#confirm')
    .jqmHide()
	
}


$().ready(function() {
				   
  $('#confirm_self').jqm({overlay: 88, modal: true, trigger: false});
  
  // trigger a confirm whenever links of class alert are pressed.
  $('a.confirm_self').click(function() { 
    check(); 
    return false;
  });
});


$().ready(function() {
  $('#confirm_vid').jqm({overlay: 88, modal: true, trigger: false});
  $('#confirm_vid2').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;
  });
});



   	var curMapLogoPage;

	function checkPageurl()
	{
		//alert("-- curMapLogoPage : "+curMapLogoPage);
		var logo=window.open('','_blank');
		logo.location=curMapLogoPage;
	}	
		
	function navigatePopup(pageURL){		
		//alert("--- pageURL ____ : "+pageURL);
		curMapLogoPage = pageURL;
		$('#confirm_vid')
    .jqmShow()	
	}


