// GEEN POPUP ZICHTBAAR
var homepagepopupStatus = 0;
var popupStatus = 0;
var timetableStatus = 0;
var videoStatus = 0;

function homepagepopupShow() {
	$("#homepagepopupBackground").show("fast");
	homepagepopupStatus = 1;
}
function homepagepopupHide() {
	$("#homepagepopupBackground").hide("fast");
	homepagepopupStatus = 0;
}

function popUpShow() {
	$("#mainpopupBackground").show("fast");
	popupStatus = 1;
}
function popUpHide() {
	$("#mainpopupBackground").hide("fast");
	popupStatus = 0;
}

function timetableShow() {
	$("#timetablePopup").show("fast");
	timetableStatus = 1;
}
function timetableHide() {
	$("#timetablePopup").hide("fast");
	timetableStatus = 0;
}
function timetableChange(act, arr) {
	for(var i in arr)
	{
		$("#"+arr[i]).hide("fast");
		$("#div_"+arr[i]).removeClass("contentmenu_item_hi");
		$("#a_"+arr[i]).removeClass("contentmenu_item_txt_hi");
		$("#div_"+arr[i]).addClass("contentmenu_item");
		$("#a_"+arr[i]).addClass("contentmenu_item_txt");
		$("#div_"+arr[i]).attr("onmouseover", "javascript:this.className='contentmenu_item_hi';this.childNodes[0].className='contentmenu_item_txt_hi';");
		$("#div_"+arr[i]).attr("onmouseout", "javascript:this.className='contentmenu_item';this.childNodes[0].className='contentmenu_item_txt';");
	}
	$("#div_"+act).removeClass("contentmenu_item");
	$("#a_"+act).removeClass("contentmenu_item_txt");
	$("#div_"+act).addClass("contentmenu_item_hi");
	$("#a_"+act).addClass("contentmenu_item_txt_hi");
	$("#div_"+act).removeAttr("onmouseout", "javascript:this.className='contentmenu_item';this.childNodes[0].className='contentmenu_item_txt';");
	$("#"+act).show("fast");
}

function videoShow() {
	$("#videoPopup").show("fast");
	videoStatus = 1;
	jwplayer().play();
}
function videoHide() {
	$("#videoPopup").hide("fast");
	videoStatus = 0;
	jwplayer().stop();
}

// FIRE WHEN RDY
$(document).ready(function() 
{
	homepagepopupShow();
	popUpHide();
	timetableHide();
	//videoHide();
	$('#slider').nivoSlider({
		controlNavHide: true,
		prevText: 'Vorige', // Prev directionNav text
        nextText: 'Volgende', // Next directionNav text
	});
});

function checkUrl(urlShouldBe, urlReferer)
{
	var urlIs = document.getElementById('mainpopupLogin').contentWindow.location.href;
	if(urlIs != urlShouldBe)
	{
		if(urlIs == "http://www.olympicgym.nl/community/index.php?p=/entry/register&amp;Target=categories/all")
			window.location= "/go/Home/quick/Register";
		else
			window.location= urlReferer;
	}
}
