function flash_mute(state) {
	createCookie('muteState', state);
}

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=/";
}

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 showDiv(elem) {
	if (document.getElementById(elem).style.display == 'none')
		document.getElementById(elem).style.display = 'block';
	else
		document.getElementById(elem).style.display = 'none'
		window.focus();
}


makeshowhidenum = 0;
function makeshowhide(id,state,visiblestate,tshow,thide) {
    var hstate;
    var sstate;
    var hidehref;
    var showhref;
    if (!thide) thide = 'Mniej';
    if (!tshow) tshow = 'Wiecej';
    if (!visiblestate) visiblestate = 'block';
    showhref = "javascript: unrolldiv('"+id+"', '"+visiblestate+"');";
    hidehref = "javascript: rolldiv('"+id+"');";
    if (!(state > 0)) {
        sstate = 'display: block;';
        hstate = 'display: none;';
    } else  {
        hstate = 'display: block;';
        sstate = 'display: none;';
    }
    document.write("<a href=\""+hidehref+"\" class='hide' style='"+hstate+"' id='"+id+"_hide'><span>"+thide+"</span></a>");
    document.write("<a href=\""+showhref+"\" class='show' style='"+sstate+"' id='"+id+"_show'><span>"+tshow+"</span></a>");
} 