
/*

For shutdown popup need to change 'on' to 'off' or something else, just need to be diferente from 'on'.
Example: 
var popup = 'off'; or var popup = 'onsdhlfsldkjh';  


For svitch on popup, var popup must be 'on'.
Example:
var popup = 'on';


Default on each website is ON.

*/

var popup = 'on';

/*
	^^^^^^^^^^^^^^^^
	||||||||||||||||








*/







var cone=0;
var t;
var timer_is_on=0;

//jQuery.noConflict();

setTimeout("timedCount()",1);

function timedCount(){
	//document.getElementById('txt').value=cone;
	if (cone==60 && !$.cookie('acs') && !$.cookie('acs7') && popup == 'on'){
		$('<div></div>').load('popup.html').modal();
		$.cookie('acs', 'acs', { expires: 12 });
		return;
	}
	cone=cone+1;
	t=setTimeout("timedCount()",1000);
}

jQuery(document).ready(function($) {
	fixExitLinks();
	otvoreno = false;
	
	$(document).mousemove(function(e){
		hei = 0;
		if(hei != e.pageX) {
				  cone=0;
				  hei = e.pageX;
		};
	});
});

function fixExitLinks(){
    var myLinks = document.links;
    var btype=0;
    if (window.attachEvent) {
        b=1;
    } else if (window.addEventListener) {
        b=2;
    }
    for(var i=0;i < myLinks.length;i++) {
        var thehref = myLinks[i].href.toString();
        
            switch (b) {
                case 1:
                    myLinks[i].attachEvent("onClick",isExit = false);
                    break;
                case 2:
                    myLinks[i].setAttribute("onClick","isExit = false;")
                    break;
                default:
                    //do nothing
            
        }
    }
}


function sdays(){
	$.cookie('acs7', 'acs7', { expires: 168 });
	isExit=false;
}
isExit = true;
var AlertBox = "*****************************************************\n\nWait! Stop! Don't Go!\n\n REQUEST INSTANT QUOTE\n\n & Get Access to our Special Report\n\n + Sample Data + $250 Off Coupon Code\n\n*****************************************************";
function ExitPop(isExit) {
	 if(isExit != false && !$.cookie('acs2') && !$.cookie('acs7') && popup == 'on')	{
			isExit=false;
			isPop = true;
			$.cookie('acs2', 'acs2', { expires: 12 });
			$('<div></div>').load('popup.html').modal();	
			return AlertBox;
		} // end if
	}// end function

/*		if(document.cookie && document.cookie != ''){
		}
		else if(isExit != false)	{
			isExit=false;
			isPop = true;
			$.cookie('acs2', 'acs3', { expires: 12 });
			$('<div></div>').load('popup.html').modal();	
			return AlertBox;
		} // end if*/




window.onbeforeunload = function(){
		
		// Lay down an exit pop!!
		return ExitPop(isExit);
	
}// end function onunload


