var light= (getCookie("light")=="" ? true : getCookie("light"));

document.getElementById("light").width=size/4;

if(document.getElementById("logo")!=null)
{
    document.getElementById("logo").width=size*2;
}


function switchLight() {
    light=(light=="true" ? "false" : "true");
    setCookie("light",light,30);
    applyLight(light);
}

function applyLight(li) {
    document.getElementById("light").src="ress/"+(li=="true" ? "dark" : "light")+".png";
    if(document.getElementById("logo")!=null)
    {
        document.getElementById("logo").src="ress/logo_"+(li=="true" ? "clair" : "dark")+".png";
    }

    if(document.getElementById("modal")!=null)
    {
        document.getElementById("modal").classList.add((li=="true" ? "day" : "night"));
        document.getElementById("modal").classList.remove((li=="true" ? "night" : "day"));
    }

    if(document.getElementById("resetGems")!=null)
    {
        document.getElementById("resetGems").src="ress/reset_"+(li=="true" ? "light" : "dark")+".png";
    }
    
    document.getElementsByTagName("body")[0].classList.add((li=="true" ? "day" : "night"));
    document.getElementsByTagName("body")[0].classList.remove((li=="true" ? "night" : "day"));
}

applyLight(light);