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 adultConfirmation()
{
    var conf = confirm("Entering in this part of website is prohibited if you are not at least 18 years old (21 in some U.S. States) or if you are visiting this website from the jurisdiction of any municipality, city, state, country, or other governmental entity where viewing mature sexual content is prohibited by law.");
    if (conf == true)
    {
	createCookie("adult","true",365);
	window.location.reload();
    }
    else
    {
	eraseCookie("adult");
	window.location.reload();
    }
}

function adultCheck(location)
{
    var adult=readCookie("adult");

    if (adult=="true")
    	window.location = location;
    else
	adultConfirmation();
}

function switchfull()
{
    if (!document.getElementById) return;
    cnt = document.getElementById("maincolumnflashcontainer");
    cnt.className = (cnt.className == "flashfull") ? "flashnormal" : "flashfull";
}
