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=/;domain=.stelist.ro";
}
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;
}
function eraseCookie(name) {
    createCookie(name,"",-1);
}
											

function closeIframe(iframe_id)
{ 
    var iframe = document.getElementById(iframe_id);
    iframe.parentNode.removeChild(iframe);
}


function listUsers(container,list,owner)
{
    cnt = document.getElementById(container);
    host_name = window.parent.location.href;
    to_put = "<iframe  height=\"200\" frameborder=\"0\" width=\"200\" scrolling=\"no\" allowtransparency=\"true\" hspace=\"0\" vspace=\"0\" marginheight=\"0\" marginwidth=\"0\" src=\"http://utils.stelist.ro/index/?section=users&mode=ListUsers&list="+list+"&owner="+owner+"&ref="+host_name+"\"></iframe>";
    cnt.innerHTML = to_put;
}

function UserBanner(user,type)
{
    to_put = "<iframe  height=\"300\" frameborder=\"0\" width=\"350\" scrolling=\"no\" allowtransparency=\"true\" hspace=\"0\" vspace=\"0\" marginheight=\"0\" marginwidth=\"0\" src=\"http://utils.stelist.ro/index/?section=users&mode=CreateUserImage&username="+user+"&type="+type+"\"></iframe>";
    document.write(to_put);
}
function showAdminTalk()
{
    za_cookie = readCookie("no_admin_news");
    if(za_cookie == null)
    {
	to_put = "<a style=\"position:absolute;left:98%;top:5px;\" href=\"#\" onClick=\"document.getElementById('admin_news').style.display = 'none';this.style.display = 'none';createCookie('no_admin_news',1,2);return false;\"><img border=\"0\" src=\"http://pebuzz.com/images/close_button.gif\"/></a>";
	to_put += "<iframe id=\"admin_news\"  height=\"30\" width=\"100%\" frameborder=\"0\" width=\"350\" scrolling=\"no\" allowtransparency=\"true\" hspace=\"0\" vspace=\"0\" marginheight=\"0\" marginwidth=\"0\" src=\"http://utils.stelist.ro/index/?section=misc&mode=ShowAdminTalk\"></iframe>";
	document.write(to_put);
    }
}


