	var sessionChecker = Seam.Component.getInstance("httpSessionChecker");
    var timeoutMillis = 10*60*1000+3000;
    var sessionTimeoutInterval = null;

    function startSessionTimeoutCheck() {
        sessionTimeoutInterval = setInterval('sessionChecker.isNewSession(alertTimeout)', timeoutMillis);
    }

    function stopSessionTimeoutCheck() {
        if (sessionTimeoutInterval) {
        	clearInterval(sessionTimeoutInterval);
        }
    }

    function resetSessionTimeoutCheck() {
        stopSessionTimeoutCheck();
        startSessionTimeoutCheck();
    }

    function alertTimeout(newSession) {
 		if (newSession) {
			clearInterval(sessionTimeoutInterval);
			showExpirationMessageWithRichModalPanel();
		//	showSessionExpirationMessage();
          //  jQuery(".ajaxSupport")
         //        .removeAttr('onblur')
         //          .removeAttr('onchange')
         //          .removeAttr('onkeyup')
         //          .removeAttr('onclick');
         //   jQuery(".sessionEventTrigger").hide();
         //alert("Ο χρόνος της εφαρμογής έχει λήξει. Θα μεταφερθείτε στην αρχική σελίδα του pasok.gr");
        //   var answer = confirm("");
        //   if (answer) window.location = timeoutURL;
       }
    }
	
	function showExpirationMessageWithRichModalPanel(){
		Richfaces.showModalPanel('expirationMessagePanel');
	}

