// imposta il cookie sNome = sValore
// per la durata di iGiorni
function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) +
		( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
		( ( path ) ? ';path=' + path : '' ) +
		( ( domain ) ? ';domain=' + domain : '' ) +
		( ( secure ) ? ';secure' : '' );
}


function chiudi() {
el = document.getElementById("popup");
el.style.visibility="hidden";
}

var ilpopup = "<div style=\"background:#DFE4D8;border:2px solid #7F7F7F;position:absolute;left:230px;top:300px;visibility:visible;padding:0.5em;\" id=\"popup\" class=\"popup-bg\"> <table class=\"popup-bg-table\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"right\"><a style=\"font-size:12px;color:#ffffff;text-decoration:none;\" href=\"#\" onClick=\"chiudi()\">CHIUDI <img class=\"popup-close\" src=\"http://www.dietagratis.com/close.gif\" width=\"15\" height=\"15\" border=\"0\" onload=\"javascript:setCookie('popup', 'ok', 1, '/', 'www.dietagratis.com');\"></a></td></tr><tr><td class=\"popup-form\" align=\"left\"><form class=\"popup-form\" method=\"post\" action=\"http://autorisponditori.com/ar/subc.php\" class=\"frm_newsletter\"><input type=\"hidden\" name=\"aid\" value=\"1775\"><input type=\"hidden\" name=\"required\" value=\"lemail,lfname\" /><input type=\"hidden\" name=\"filledfrm\" value=\"mysite.htm\" /><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"table2\"><tr><td><input type=\"text\" name=\"lfname\" size=\"15\" id=\"nome\" class=\"popup-input-txt\" /></td></tr><tr><td><input type=\"text\" name=\"lemail\" size=\"15\" id=\"mail\" class=\"popup-input-txt\" /></td></tr><tr><td align=\"left\"><input name=\"submit\" type=\"submit\" value=\"OK\" id=\"iscrivimi\" class=\"popup-input-btn\" /></td></tr></table></form></td></tr></table></div>";
