<style>
#blanket {
background-color:#111;
opacity: 0.65;
filter:alpha(opacity=65);
position:absolute;
z-index: 9001;
top:0px;
left:0px;
width:100%;
}
#popUpDiv {
position:fixed; 
background-color:#eeeeee;
width:60%;
height:300px;
margin:20px;
padding:20px;
z-index: 9002;
}
</style>
<script src="csspopup.js" type="text/javascript"></script>   
<div id="blanket" style="display:none;"></div>
<div id="popUpDiv" style="display:none;">
<div id="popUpContent" ><iframe id='askQuestionPage'  frameborder="0" scrolling="no" width="100%" height="100%" ></iframe></div></div>
<!--<a href="#" id="popup" onclick="popup('popUpDiv')">Click Here To Open The Pop Up</a>-->
<script>
/*$(document).ready(function(){
  $("#popup").click(function(){	 
    $("#popUpContent").load('../../local/askquestion/index.php');
  });
});*/
t1="12:00";t2="24:00";t3="36:00";t4="48:00";t5="59:00";
//t1="28:40";t2="22:00";t3="15:30";t4="57:30";t5="03:10";


setInterval(function() {
function addZero(i) {
    if (i < 10) {
        i = "0" + i;
    }
    return i;
}
var x = document.getElementById("timer");
var d = new Date();
var s = (d.getSeconds());
var m = (d.getMinutes());
var t = addZero(m) + (":" + addZero(s) );



if(t==t1||t==t2||t==t3||t==t4||t==t5){
	//CountDown.Pause();
	popup('popUpDiv');
	//var iframe = document.getElementById('askQuestionPage');
    //iframe.src = "../../local/askquestion/index.php";
	//document.getElementById('askQuestionPage').contentWindow.location.reload();
	// $("#popUpContent").load('../../local/askquestion/index.php');
}
//x.innerHTML = t;

}, 1000);

// Returns a random integer between min (included) and max (included)
function getRandomInt(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}


</script>
<div align="center" id="timer" style='color:black;font-size:12px;' ></div>
<?php
global $PAGE;
$_SESSION['currenturl'] = $PAGE->url;

if(isset($_SESSION['errors'])){
	//echo $_SESSION['errors']['securityquestion'];
	?>
    <script>
    popup('popUpDiv');
    //document.getElementById('askQuestionPage').contentWindow.location.reload();
    //$("#popUpContent").load('../../local/askquestion/index.php');
	</script>
    <?php
	//unset($_SESSION['errors']);
}
?>
