        <div id="skipmodal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">

                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                  <h4 class="modal-title" id="myModalLabel"><?php echo $a043;?></h4>
                </div>
                <div class="modal-body">
                	<p>Your waiting time elapsed. Now select next action.</p>
                </div>
					<div class="modal-footer">
						<!-- LEFT BUTTONS -->
						<button type="button" style="float:left" class="btn btn-default" onclick="continuewatching();">CONTINUE IN WATCHING</button>
						<!-- RIGHT BUTTONS -->
						<a href="javascript:document.frmvideo.submit();" class="btn btn-default" id="buttonv"> SKIP</a>
					</div>

              </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
        
         <div id="banner modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">

                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                  <h4 class="modal-title" id="myModalLabel"><?php echo $a043;?></h4>
                </div>
                <div class="modal-body">
                	<p>Your waiting time elapsed. Now select next action. Demo Advertisement!</p>
                </div>
					<div class="modal-footer">
						<!-- LEFT BUTTONS -->
						<button type="button" style="float:left" class="btn btn-default" onclick="continuewatching();">CONTINUE IN WATCHING</button>
						<!-- RIGHT BUTTONS -->
						<a href="javascript:document.frmvideo.submit();" class="btn btn-default" id="buttonv"> SKIP</a>
					</div>

              </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->

<div id="cookiealert" style="visibility: hidden;position: fixed; width: 100%; bottom: 0px;" class="alert alert-info">
  <button type="button" class="close" data-dismiss="alert" onclick="hideMe()">×</button>
  <p>
    <strong>COOKIES POLICY:</strong> By using our website,  you agree that we may save cookies on your device. Cookies help to improve our service.
  </p>
</div>
  <!-- jQuery CDN and fallback -->
  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  <script>window.jQuery || document.write('<script src="../data/templates/frontend/superhero/assets/js/jquery.js"></script>')</script>
  <script src="../data/templates/frontend/superhero/assets/js/jquery.js"></script>	
  <!-- Main Scripts-->
  <script src="../data/templates/shortend/superhero/assets/js/bootstrap.min.js"></script>
  <script src="../data/templates/shortend/superhero/assets/js/plan.ui.js"></script>
  <!-- Bootstrap Select -->
  <script src="../data/templates/shortend/superhero/assets/js/bootstrap-select.min.js"></script>

  <script src="../system/general/components/jsoncookies/jquery.cookie.js"></script>
<script>
    function runOnLoad(){
        	if($.cookie('alert-box') == null) {
         	$.cookie('alert-box', 'closed', { expires: 7 });
         	document.getElementById("cookiealert").style.visibility = "visible";
        	} else if( $.cookie('alert-box') === 'closed' ){
				document.getElementById("cookiealert").style.visibility = "hidden";
			}
			 $(function(){ 
     			var navMain = $("#main-nav");

    			navMain.on("click", "a", null, function () {
        			navMain.collapse('hide');
    			 });
 });
 	var did = 0;
	var rotate = 0;
	
	}
	$('body').addClass('noscroll');
var timecalculation = 0;
	function calctime()
		{
			timecalculation = timecalculation + 1;
			<?php 
			if($LINK_adtype == 'interstitial'){
			?>
    		if (timecalculation < <?php echo $sa['intdur'];?>){
    			var wait = <?php echo $sa['intdur'];?> - timecalculation;
	  			document.getElementById('buttonint').innerHTML = 'Please wait ' + wait + 's';
  			}else{
  				var Continuea = document.getElementById("areav5");
  				Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Continue</button>';
  				<?php
				if ($sa['autocontinue'] == '1') {
				?>
					document.frmvideo.submit();
					Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Redirecting...</button>';
  				<?php
				}else {
				?>
					Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Continue</button>';
				<?php
				}
				?>	
  			}
  			<?php 
  			}else if($LINK_adtype == 'banner'){
			?>
    		if (timecalculation < <?php echo $sa['bandur'];?>){
    			var wait = <?php echo $sa['bandur'];?> - timecalculation;
	  			document.getElementById('buttonbanner').innerHTML = 'Please wait ' + wait + 's';
  			}else{
  				var Continuea = document.getElementById("areav5");
  				Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Continue</button>';
  				<?php				
  				if ($sa['autocontinue'] == '1') {
				?>
					document.frmvideo.submit();
					Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Redirecting...</button>';
  				<?php
				}else {
				?>
					Continuea.innerHTML = '<button onclick="javascript:document.frmvideo.submit();" id="buttonbanner" style="position: fixed; width: 30%; max-width: 30%; padding: 10px; top: 0px; left: 35%;" class="btn btn-success"><i class="fa fa-angle-double-right"></i> Continue</button>';
				<?php
				}
				?>	
  			}
  			<?php 
  			}
			?>
		}
function ResizeBanner(){
   if (innerWidth > "950") {
   	document.getElementById("bannerimageid").setAttribute("style","position: fixed; width: " + innerWidth/2 + "px; height: " + innerWidth/16 + "px; padding: 10px; bottom: 0px; left: " + innerWidth/4 + "px;");
   }
   if (innerWidth < "951") {
   	document.getElementById("bannerimageid").setAttribute("style","position: fixed; width: " + innerWidth + "px; height: " + innerWidth/6 + "px; padding: 10px; bottom: 0px; left: 0%;");
   }
}

window.setInterval(function(){
  ResizeBanner();
}, 1000);

var loadednum = 0;
var textnumnow = 0;
var loadeddetected = 0;
function checkIframeLoaded() {
	loadednum = loadednum + 1;
	var loadedtxt = 1;
	<?php
	$loadedstatus = $_POST['loaded'];
	if ($loadedstatus == '15') {
	?>
	loadednum = 10;
	<?php
	}
	?>
	if (loadednum > 2) {
		if(!$("#i_frame").contents().find("body").length) {
   		alert("Notloaded1");
   		loadedtxt = 0;
		}
		if(!$("#i_frame").length) {
   	 	alert("Notloaded2");
   	 	loadedtxt = 0;
		}
		if($("#i_frame").contents().find("body").html()==null) {
  		  	alert("Notloaded3");
   	 	loadedtxt = 0;
		}
		if(loadedtxt == 0) {
   	 	document.getElementById("notloaded").setAttribute("style","background: none repeat scroll 0% 0% rgb(255, 255, 255); color: rgb(0, 0, 0); padding: 0px; padding-top: 40px; height: 100%; width: 100%;");
   	 	document.getElementById("i_frame").setAttribute("style","display: none;");
   	 	document.getElementById("loadtext").innerHTML = 'Advertisement could not be loaded, ad contains scripts that would to redirect you out from this window.';
		}else{
			document.getElementById("notloaded").setAttribute("style","display: none;");
			document.getElementById("i_frame").setAttribute("style","padding-top: 40px;");
			loadeddetected = loadeddetected + 1;
			if(loadeddetected == 1){
				aftervertification();
			}
			loadednum = 3;
		}	
	}else {
			document.getElementById("loadtext").innerHTML = '<i class="fa fa-circle-o-notch fa-spin"></i> Loading please wait...';
	}	
	if (loadednum > 5) {
		document.getElementById("loadtext").innerHTML = 'Advertisement could not be loaded, ad contains scripts that would to redirect you out from this window.';
	}
	var atime=setTimeout("checkIframeLoaded()",1000);
}
function aftervertification(){
   calctime();
   var vertime=setTimeout("aftervertification()",1000);
}
</script>
</body></html>

