// Meghívó felhívó box JavaScript Document

function createCookie(name,value,days) // fn. for creating cookies
{
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=/";
}

function readCookie(name)
{
var flag = 0;

var dcmntCookie = document.cookie.split(';'); // getting all cookies in the document and splitting them and storing in an array

for(var i=0;i < dcmntCookie.length;i++) // looping through the cookies array
{
var ck = dcmntCookie[i];
while (ck.charAt(0)==' ') // loop for removing space at the begining
{
ck = ck.substring(1,ck.length);
}
if(ck)
{
cparts = ck.split('='); // splitting the cookie. eg: mycookie="some message"

if (cparts[0]==name)
{

flag=1;
document.getElementById('meghivo').style.display="none";
document.getElementById('meghivo').style.visibility="hidden"; // hiding the div
break;
}
}

}

if(!flag) // if no such cookie exist, then create a new one
createCookie(name,"message off",1);
}

function zaras(){
document.getElementById('meghivo').style.visibility="hidden"; // hiding the div
}