	

_ajaxConfig = {'_cfscriptLocation':'/include/model/criminaltracking.cfc', '_jsscriptFolder':'/include/jscss/ajaxcfc', 'debug':false};

$(document).ready(function(){
	$('#signuplink').click(function(){
		$.fancybox.close();
		changecontent('#signuppage');
		//$.history({'page':'#signuppage'});
	});
	$('#signupbutton').click(function(){
		frm = document.getElementById('signup');
		
		DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'processsignup', 
			frm.fname.value, 
			frm.lname.value,
			frm.email.value,
			frm.ccnum.value,
			frm.ccexp.value,
			frm.cccvv.value,
			 
		function(data){
			if (data == 1){
				
			} else if (data == 2){
				
			} else {
				//$.history({'page':'#welcomepage'});
				changecontent('#welcomepage');
			}
		});
	});
});


function getteaserresult(zip) {
	DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'getteaser', zip, function(retrn) {
		document.getElementById('rtrn').innerHTML = retrn;
		$.fancybox({'href':'#answerbox','autoDimensions':false, 'width':560, 'height':455,'overlayOpacity':0.5, 'overlayColor':'#F00', 'title':'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You"re in terrible danger!!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'})
	});
}
function changecontent(page){
	$.history({'page':page});
	$('#content').children('div').fadeOut(1000,function(){
		if ($(this).id == '#landingcontent') {
			alert('moving from index page');
			$('#landingcontent').clone(true).appendTo('#holder');
		}
		//$('#holder').children('div').replaceWith($(this));
		$(this).replaceWith($(page).clone(true));
		$(page).fadeTo(0,0);
		$(page).fadeTo(1000,1);
	});
}


$.history.callback = function ( reinstate, cursor ) {
	// check to see if were back to the beginning without any stored data
	if (typeof(reinstate) == 'undefined')
		1=1;
	else {
		//alert(reinstate.page);
	}
		
		//changecontent(reinstate.page);
		
};






