function signInUp(formId){	

		var frm = document.getElementById(formId);
		var url;
		var propertyID;		
		var redirectToAcct = (formId == 'formSignUp') ? frm.chkToNewAcct.checked : frm.chkToMyAcct.checked;
		
		url = '/listmailer/ListMailerSignIn/signUp_AJAX.asp?doNotCacheIE=' + Math.random()
		url += (formId == 'formSignUp' ? '&email=' +  $("#"+formId + " #email").val() + '&password=' +  $("#"+formId + " #password").val() + '&password2=' +  $("#"+formId + " #password2").val() + '&firstName=' + $("#"+formId + " #firstName").val() : '&email=' + $("#"+formId + " #emailSignIn").val() + '&password=' +  $("#"+formId + " #passwordSignIn").val());

		$.get(url, function(data) {
			if (data == 'signedUp' || data == 'signedIn')
			{
				if (getCookie('saveProperty')){     /* Save Property */
					propertyID = getCookie('saveProperty').split('|');
					saveProperty(propertyID[0], propertyID[1]);
					savePropertyOnload();
					setCookie('saveProperty', '', '', '/', '', '');
				}
				else if (getCookie('saveSearch')){   /* Save Search */
					saveSearch(getCookie('saveSearch'));
					setCookie('saveSearch', '', '', '/', '', ''); 
				}
				
				updateSignIn();
				$.fn.colorbox.close();
				if(redirectToAcct) location.href = '/listmailer/';
			}
			else
			{   
				if (data == 'wrongEmail'){
					$('#RequiredSignIn').html('Sorry, we have no record of this e-mail address. Please try again or create a new account.');
				}else if (data == 'invalidPassword'){
					$('#RequiredSignIn').html('Sorry, Your password did not match.');
				}else if (data == 'wrongPassword'){
					$('#RequiredSignIn').html('Sorry, Your password did not match. Try again, or click I Forgot My Password and we will e-mail your password.');
				}
			}
		});
	}

function forgotPwd(formId) {
    
    $.get('/_include/listmailercom/AJAX_ForgotPassword.asp', { Subscriber: $("#" + formId + " #emailSignIn").val() }, function(data) {

        if(data == 'passwordSent'){
            $('#RequiredSignIn').html('Your password has been sent to you.');
        } 
        else {
            $('#RequiredSignIn').html('Sorry, we have no record of this e-mail address. Please try again or create a new account.');
        }
    });
}
	
jQuery(document).ready(function(){ 

    $(".quicksignin").colorbox({
        'opacity':0.7,
		'width': 450,
        'height': 240
    }); 
	$(".quicksignup").colorbox({
        'opacity':0.7,
		'width': 450,
        'height': 410
    });
	
});


