function keySubmit( e ) {
    var keynum=0;
    if(window.event){
        keynum = e.keyCode;
    }else if(e.which){
        keynum = e.which;
    }
    if ( keynum == 13 ){
        document.plist.submit();
        return false;
    }
    return true;
}

function turnText(target) {
    for (var i = 0; i < 8; i++) {
        var o = document.getElementById("icon-text0" + i).style;
        o.display = (i == target) ? "" : "none";
        o.visibility = (i == target) ? "visible" : "hidden";
    }
}

function turnSearch(target) {
    var objWeb = document.getElementById("web-search").style;
    var objPoint = document.getElementById("point-search").style;
    if (target == "point") {
        objWeb.display = "none";
        objWeb.visibility = "hidden";
        objPoint.display = "";
        objPoint.visibility = "visible";
    } else {
        objWeb.display = "";
        objWeb.visibility = "visible";
        objPoint.display = "none";
        objPoint.visibility = "hidden";    
    }
}

function getCookie(key) {
    key = key + "=";
    var value = "";
    var cookies = document.cookie + ";";
    var start = cookies.indexOf(key);
    if (start != -1) {
        var end = cookies.indexOf(";", start);
        value = unescape(cookies.substring(start + key.length, end));
    }
    return value;
}

function setSearchCookie(target) {
    document.cookie = "search-box=" + escape(target);
    turnSearch(target);
}

function getSearchCookie() {
    var c = getCookie("search-box");
    if (c != "" && c != null) {
    	turnSearch(c);
    }
}


function turnVisible(id) {
    var o = document.getElementById(id);
	if (!o) alart("null");
	o = o.style;
    var visible = (o.visibility == "visible");
    o.display    = visible ? "none" : "";
    o.visibility = visible ? "hidden" : "visible";
}



function turnToggle(id) {
    var o = document.getElementById(id);
    if (o.className == "bt-close") {
	o.className = "bt-open";
    } else {
	o.className = "bt-close";
    }
}


