function ciastko(name,value,days){
var expires;
if(days){
var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires="; expires="+date.toGMTString();
}
else{expires="";}
document.cookie=name+"="+value+expires+"; path=/;";
}
function notes(advInput,id_ogl)
{
if(advInput.getAttribute('title')=='dodaj do notesu')
{
ciastko('notes['+id_ogl+']',id_ogl,'100');
advInput.setAttribute('title','ogłoszenie zapisane w notesie');
advInput.innerHTML='<img src="/images/eye3.png" alt="dodano do notesu"/>';
++licznik;
}
else
{
ciastko('notes['+id_ogl+']',id_ogl,'-1');
advInput.setAttribute('title','dodaj do notesu');
advInput.innerHTML='<img src="/images/eye.png" alt="nie dodano do notesu"/>';
--licznik;
}

document.getElementById('licz').innerHTML=licznik;
}


function notescale(advInput,id_ogl)
{
if(advInput.getAttribute('title')=='dodaj do notesu')
{
ciastko('notes['+id_ogl+']',id_ogl,'100');
advInput.setAttribute('title','ogłoszenie zapisane w notesie');
advInput.innerHTML='Usuń z notesu';
++licznik;
}
else
{
ciastko('notes['+id_ogl+']',id_ogl,'-1');
advInput.setAttribute('title','dodaj do notesu');
advInput.innerHTML='Dodaj do notesu';
--licznik;
}

document.getElementById('licz').innerHTML=licznik;
}





function usun(id_ogl)
{
    ciastko('notes['+id_ogl+']', id_ogl, '-1', '/');
	--licznik;
    document.getElementById('licz').innerHTML=licznik;
	document.getElementById('note'+id_ogl).style.display='none';
    return true;
}
function addTextNode()
{
var newtext = document.createTextNode("Wszystkie ogłoszenia zostały usunięte z notatnika.");
var para = document.getElementById("mojdiv");
para.appendChild(newtext);
}

function createDiv()
    {
	var dupa = document.getElementById("mojdiv").className="notes"
	var para = document.getElementById("mojdiv");
	para.appendChild(dupa);
    }
function usunwszystkie()
{
    for (i in sexi)
        usun(i);
        
    licznik = 0;
    document.getElementById('licz').innerHTML=licznik;
	document.getElementById('notes').style.display='none';
	addTextNode();
	createDiv()
    return true;
}

//Search



