$(document).ready( function() {
		var options = { path: '/', expires: 999 };
		var DOMAIN = 'http://www.aopaadvertising.org/';
		//var DOMAIN = 'http://localhost/aopamk/';
		var DESTINATION = 'aopa_destination'; //cookie to store where they wanted to go
	   	var COOKIE_NAME = 'aopa'; //permanent cookie name to check whether they've visited before
		makeDestinationCookie();
	   	checkVisitedCookie();
		
		function makeDestinationCookie() {
		   $.cookie(DESTINATION, document.location.href, options);
	   	}
	
	   	function checkVisitedCookie() {
	   		if($.cookie(COOKIE_NAME)==null){
				location.replace(DOMAIN+"registration.php");
			};
	   	}
	});
	// delete cookie for testing
        function deleteCookie() { 
           $.cookie('aopa', null, { path: '/', expires: 999 });
           return false;
};
