function acctInfo()
{
var nm=(readCookie("nm"));
	if (nm)
	{
	userTop(readCookie("nm"), readCookie("pw"));
	userLogin(readCookie("nm"), readCookie("pw"));
	}
}


function userCreate(name, address1, address2, city, state, zip, phone, country, email, password2)
{
	
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/ecreamery/myaccountcreate.php?name=' + name + '&address1=' + address1+ '&address2=' + address2+ '&city=' + city+ '&state=' + state+ '&zip=' + zip+ '&phone=' + phone+ '&country=' + country+ '&email=' + email+ '&password2=' + password2;

	document.getElementById('Register').appendChild (html);

	userTop(email, password2);
	
	return true;
}

function userUpdate(name, address1, address2, city, state, zip, phone, country, email, password2, uidd)
{
	
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/ecreamery/myaccountupdate.php?name=' + name + '&address1=' + address1+ '&address2=' + address2+ '&city=' + city+ '&state=' + state+ '&zip=' + zip+ '&phone=' + phone+ '&country=' + country+ '&email=' + email+ '&password2=' + password2+ '&uidd=' + uidd;

	document.getElementById('Login').appendChild (html);

	//userTop(email, password2);
	
	return true;
}


function userTop(email, password)
{
	
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/ecreamery/myaccountheader.php?a=' + email + '&b=' + password;

	//document.getElementById('MyAccount').appendChild (html);

	createCookie("nm", email, 100);
	createCookie("pw", password, 100);
	
	
	var o="<iframe class='hideFrame' name='ey' src='https://www.eyhosting.com/client_data/ecreamery/session.php?un="+email+"&pw="+password+"'></iframe>";
	document.getElementById("Session").innerHTML = o;

	
	
	return true;
}


function userLogin(email, password)
{ 
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/ecreamery/myaccountinformation.php?name=' + email + '&password=' + password;

	document.getElementById('Login').appendChild (html);
	
	userTop(email, password);
	
	return true;
}

function erizzase(){
eraseCookie("nm");
eraseCookie("pw");
}


$(document).ready(function(){

var nm=(readCookie("nm"));
var pw=(readCookie("pw"));

	if (!nm)
	{
	//$("#MyAccount").html("Hello Guest <a href=myaccount.html?stat=log onclick=erizzase()>Login</a>&nbsp;|&nbsp;<a href=register.html>Register</a>");
	}
	else{
	userTop(readCookie("nm"), readCookie("pw"));
	}

});


