function LogIn()
{
	var user   = $('user').value;
	var pass   = $('pass').value;
	var url    = 'login.php';
	var rand   = Math.random(9999);
	var pars   = 'user=' + user + '&pass=' + pass + '&rand=' + rand;
	var myAjax = new Ajax.Updater( 'loginMessage', url, {method: 'get', parameters: pars, onComplete: checkLogin} );
}

function checkLogin(response)
{
	var content = response.responseText;
	if (content == "Success") {
		window.location='members/protected/index.php';
	}
}
function LearnMore()
{
	var url    = 'noprompt.php';
	var rand   = Math.random(9999);
	var pars   = 'rand=' + rand;
	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: showResponse} );
}
function CheckIfAffiliate()
{
      ShowModalDiv('postalcodeprompt');
}

function showResponse()
{
	HideModalDiv('postalcodeprompt');
}

function ShowModalDiv(divId)
{
    new Effect.Appear(divId);
    new Effect.Appear('modal', {to:.4});
}


function HideModalDiv(divId)
{
    new Effect.Fade(divId);
    hidediv('modal');
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


