$(document).ready(function() {
						   
$(document).mousemove(function(e) {
							   
var str=document.location.pathname;

var x = str.split("/",2);
if(x[1]!='order' && x[1]!='order-confirmation'){

if(e.pageY <= 5)
{

var data = "pass=2";

//start the ajax
		$.ajax({
			//this is the php file that processes the data and send mail
			url: "popup_allow.php",	
			
			//GET method is used
			type: "GET",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {				
				//if process.php returned 1/true (send mail success)
				//alert(html);
				
				if(html>0){
					
				}else{
					 // Launch MODAL BOX
                      $('#exit_content').modal({onOpen: modalOpen, onClose: simplemodal_close});
				}
			}		
		});



/*var data = "pass=1";
//start the ajax
		$.ajax({
			//this is the php file that processes the data and send mail
			url: "popup_tracking.php",	
			
			//GET method is used
			type: "GET",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {				
				//if process.php returned 1/true (send mail success)
				//alert(html);
			}		
		});*/



}//cordinates checking

}//page checking

});

});

/**
 * When the open event is called, this function will be used to 'open'
 * the overlay, container and data portions of the modal dialog.
 *
 * onOpen callbacks need to handle 'opening' the overlay, container
 * and data.
 */
function modalOpen (dialog) {
	dialog.overlay.fadeIn('fast', function () {
		dialog.container.fadeIn('fast', function () {
			dialog.data.hide().slideDown('fast');
		});
	});
	
		
	
	
	
}

   /**
 * When the close event is called, this function will be used to 'close'
 * the overlay, container and data portions of the modal dialog.
 *
 * The SimpleModal close function will still perform some actions that
 * don't need to be handled here.
 *
 * onClose callbacks need to handle 'closing' the overlay, container
 * and data.
 */
function simplemodal_close (dialog) {
	dialog.data.fadeOut('fast', function () {
		dialog.container.hide('fast', function () {
			dialog.overlay.slideUp('fast', function () {
				$.modal.close();
			});
		});
	});
}
