"
}
w = Math.min($(window).width() * 0.90, 960);
h = w / 16 * 9;
$.fancybox.open( 'grp', {
fitToView: false, // to show videos in their own size
content: cont,
scrolling: 'no', // don't show scrolling bars in fancybox
title: ttl,
minWidth: w,
minHeight:h,
afterShow: function () {
txt = '';
// console.log(txt)
$("#mediaspace").html(txt);
$('#mediabox').mediaelementplayer({
success: function(media, node, player) {
media.play();
media.addEventListener('ended', function(e){
loadbanner();
});
}
});
},
helpers : {
title : {
type : 'inside'
},
overlay : {
css : {
'background' : 'rgba(50, 50, 50, 0.75)'
}
}
}
});
}
else
{
loadbanner();
}
}
function replay()
{
tload(tvv);
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+ ";path=/" +
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
/*
Instructions for rotating headers:
This code will rotate through a series of header images uploaded to the tour's images/header/ folder.
To change the number of headers it uses:
1) Change var numt = 5 to the number of headers you want to rotate
2) Change setCookie("numheader", rnd, 5) to the number of headers you want to rotate
*/
$(document).ready(function() {
/** Splash page stuff **/
$(window).load(function() {
// If there's no mask, don't run any of this code.
if ($('#mask').size() == 0)
{
$('#login-box').attr('closed', 1);
return false;
}
// If there's a warning cookie in place, fade out the mask.
var warn=getCookie("warn");
if (warn!=null && warn!="")
{
$('#mask').fadeOut('100');
$('#login-box').attr('closed', 1);
return false;
}
//Fade in the Popup
if ($('#login-box').attr('closed') != "1")
{
$('#login-box').fadeIn(300);
}
return false;
});
// When clicking on the button close or the mask layer the popup closed
$('a.close').on('click', function() {
$('#login-box').attr('closed', 1);
$('#mask , .login-popup').fadeOut(300 , function() {
setCookie("warn",1,30);
$('#mask').remove();
});
return false;
});
var numt = 1
if (numt > 1)
{
var oldcook = getCookie("numheader")
if (oldcook == "")
{
rnd = Math.floor(Math.random()*numt) + 1
}
else
{
do
{
rnd = Math.floor(Math.random()*numt) + 1
} while (rnd == oldcook)
}
setCookie("numheader", rnd, 1)
}
else
{
var rnd = 1
}
if ($(".header_image").length > 0)
{
$(".header_image").attr("src", $(".header_image").attr("src").replace("header.jpg", "header" + rnd + ".jpg"))
}
// if ($(".join_header_image").length > 0)
// {
// $(".join_header_image").attr("src", $(".join_header_image").attr("src").replace("header.jpg", "header" + rnd + ".jpg"))
// }
if ($(".tour_header_image").length > 0)
{
$(".tour_header_image").attr("src", $(".tour_header_image").attr("src").replace("header.jpg", "header" + rnd + ".jpg"))
}
});