/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2008 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 132 2008-05-23 16:05:17Z emartin24 $
 *
 */

var count = 0;

function survey() {
	
	if(count === 0) {
			
		$.modal(document.getElementById('surveyContent'));
		$.ajax({
		  type: "GET",
		  url: siteurl+'homepage/ppc_popup/'+popurl
		});
	}
		
	count = 1;
	
}

function bonus() {
	
	$.ajax({
		type: "GET",
		url: siteurl+'homepage/ppc_click/'+popurl,
		success: function() {
			document.location.href = siteurl+'signup';
		}
	});
	
}

var x = 0;
var y = 0;

function modal_popup(event) {
	
	x = event.clientX;
	y = event.clientY;
	
	if(y <= 5) {
		
		survey();
		
	}
	
}