// Original code: NFS-GAME.ru. Do NOT copy!
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() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function delCookie( name, path, domain ) {
if ( getCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)
{
begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
return null;
}
function saveSettings () {
if (document.informer.informer1.checked)
{
if(confirm('Сохранить изменения?')) {
setCookie('Informer1', '<iframe src="http://nfs-game.ru/xml/informer.html" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" width="502px" height="140px"></iframe>', 365, '/', '', '');
window.parent.location.href = "http://nfs-game.ru/";
}
}
else
{
window.alert("Выберите хотя бы один информер!");
}
}
function delSettings () {
if(confirm('Сбросить настройки?')) {
delCookie ('Informer1', '/', '');
window.parent.location.href = "http://nfs-game.ru/";
}
}
