<!--
	// -------------------------------------------------
	// Custom functions 
	// -------------------------------------------------

	var _popupDisplayed;
	var NS_COOKIE_FRESSNAPF = 'QuizFressNapf';

	function PopupAGB(theme) {
		return CL_popupDiv('/pages/popupDiv.aspx?title=AGB&url=/pages/custom/agb.aspx&theme='+theme, 800, 600, null, 50);
	}

	function cu_autoShowQuiz()
	{
		if (readCookie(NS_COOKIE_FRESSNAPF)==null)
		{
			$(document).ready(function(){
				cu_showQuiz();
			}
			);
		}		
	}

	function cu_showQuiz()
	{
		cu_generatePopup("/pages/quiz.aspx", 800, 600, "");
	}

	function cu_generatePopup(url,width,height,popupTitle) {		
		if (!_popupDisplayed)
		{
			// block popups
			_popupDisplayed = true;
		
			// create popup
			$("#Main").html("<div id='MainPopup'><iframe src=" + url + " width=" + width + " height=" + height + " scrolling=\"no\" frameborder=\"0\">&nbsp;</iframe></div>");
			$("#Main").dialog({
				bgiframe: true,
				height: height,
				width: width,
				modal: true,
				position: ['center','center'], 
				draggable:false,
				resizable:false,
				dialogClass: "jQueryPopup"
			});
						
			// save close popup
			if (!window.closePopup)
				window.closePopup = cu_removePopup;
		}		
	}
	
	function cu_removePopup()
	{		
		// clear window
		_popupDisplayed = false;
		
		// hide window
		$("#Main").dialog('destroy');
		$("#Main").empty();
		
		// save cookie
		createCookie(NS_COOKIE_FRESSNAPF, 'disabled', 360);
	}
//-->
