//Shows and hides text that belongs to the flag icon
var en_text = document.getElementById("text_en");
en_text.style.display="none";
function show_en() {
    en_text.style.display = "inline";
};
function hide_en() {
    en_text.style.display="none";
};

var nl_text = document.getElementById("text_nl");
nl_text.style.display="none";
function show_nl() {
    nl_text.style.display = "inline";
};
function hide_nl() {
    nl_text.style.display = "none";
};

var es_text = document.getElementById("text_es");
es_text.style.display = "none";
function show_es() {
    es_text.style.display="inline";
};
function hide_es() {
    es_text.style.display="none";
};

//Shows the current page
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
switch(sPage){
    case "":
        document.getElementById("index").className="active";
        break;
    case "index.php":
        document.getElementById("index").className="active";
        break;
    case "info.php":
        document.getElementById("info").className="active";
        break;
    case "houserules.php":
        document.getElementById("info").className="active";
        break;
    case "photos.php":
        document.getElementById("photos").className="active";
        break;
    case "guestbook.php":
        document.getElementById("guestbook").className="active";
        break;
    case "contact.php":
        document.getElementById("contact").className="active";
        break;
    case "controlpanel.php":
        document.getElementById("controlpanel").className="active";
        break;
    case "postnews.php":
        document.getElementById("controlpanel").className="active";
        break;
    case "postphotos.php":
        document.getElementById("controlpanel").className="active";
        break;
}

//Create the language cookie (expires after 30 days)
function create_languagecookie(value) {
        var date = new Date();
        date.setTime(date.getTime()+(30*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
	document.cookie = "language="+value+expires+"; path=/";
        window.location.reload()
}
