function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

// read cookie by name and list value
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// delete cookie by name
function eraseCookie(name) {
	createCookie(name,"",-1);
}


function addToWishList(wl, nm, pw){


//alert(wl);
//alert(nm);
//alert(pw);

var html = document.createElement('script');
html.type = 'text/javascript';
html.src = 'http://www.eyhosting.com/client_data/pressuretek/addtowish.php?wishitem=' + wl + '&email=' + nm+ '&pass=' + pw;
document.getElementById('Login').appendChild (html);



}



function removeItem(wl, nm){


//alert(wl);
//alert(nm);
//alert(pw);

var html = document.createElement('script');
html.type = 'text/javascript';
html.src = 'http://www.eyhosting.com/client_data/pressuretek/removeitem.php?wishitem=' + wl + '&email=' + nm;
document.getElementById('Login').appendChild (html);

}




function userCreate(name, company, address1, address2, city, state, zip, phone, country, email, password2, bname, bcompany, baddress1, baddress2, bcity, bstate, bzip, bphone, bcountry)
{
	
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/pressuretek/myaccountcreate.php?company=' + company + '&name=' + name + '&address1=' + address1+ '&address2=' + address2+ '&city=' + city+ '&state=' + state+ '&zip=' + zip+ '&phone=' + phone+ '&country=' + country+ '&email=' + email+ '&password2=' + password2 + '&bname=' +bname+ '&bcompany=' +bcompany+ '&baddress1=' +baddress1+ '&baddress2=' +baddress2+ '&bcity=' +bcity+ '&bstate=' +bstate+ '&bzip=' +bzip+ '&bphone=' +bphone+ '&bcountry=' +bcountry;

	document.getElementById('Register').appendChild (html);

	//userTop(email, password2);
	
	return true;
}

function userupdate(uid, name, company, address1, address2, city, state, zip, phone, country, email, bname, bcompany, baddress1, baddress2, bcity, bstate, bzip, bphone, bcountry)
{
	
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/pressuretek/myaccountupdate.php?uid='+uid+'&company=' + company + '&name=' + name + '&address1=' + address1+ '&address2=' + address2+ '&city=' + city+ '&state=' + state+ '&zip=' + zip+ '&phone=' + phone+ '&country=' + country+ '&email=' + email+ '&bname=' +bname+ '&bcompany=' +bcompany+ '&baddress1=' +baddress1+ '&baddress2=' +baddress2+ '&bcity=' +bcity+ '&bstate=' +bstate+ '&bzip=' +bzip+ '&bphone=' +bphone+ '&bcountry=' +bcountry;

	document.getElementById('Login').appendChild (html);

	//userTop(email, password2);
	
	return true;
}



function userLogin(email, password)
{ 
	var html = document.createElement('script');
	html.type = 'text/javascript';
	html.src = 'http://www.eyhosting.com/client_data/pressuretek/myaccountinformation2.php?name=' + email + '&password=' + password;

	document.getElementById('Login').appendChild (html);
	
	createCookie("nm", email, 100);
	createCookie("pw", password, 100);

	
	
	return true;
}

function erizzase(){
eraseCookie("nm");
eraseCookie("pw");
}





