﻿function writeCookie(name, value) {
    document.cookie = name + "=" + value + "; path=/"
}



function readCookie(name) {

    var re = new RegExp(name + "=[^;]+", "i") //construct RE to search for target name/value pair
    if (document.cookie.match(re)) //if cookie found
        return document.cookie.match(re)[0].split("=")[1] //return its value
    return null
    // by .fm 
//    var c = document.cookie;
//    if (c.indexOf(name) != -1) {
//        pos1 = c.indexOf("=", c.indexOf(name)) + 1;
//        pos2 = c.indexOf(";", pos1);
//        // If last cookie 
//        if (pos2 == -1) pos2 = c.length; ;

//        data = c.substring(pos1, pos2);

//        return data;
//    }
}



function deleteCookie() 
{
    var d = new Date();
    document.cookie = "menuImageTitle;expires=" + d.toGMTString() + ";" + ";";    
}

function imageOnClick_Event(that) 
{

    writeCookie("menuImageTitle", that.id);
}

window.onload = function() {

    img1 = document.getElementById("Image19");
    img2 = document.getElementById("Image20");
    img3 = document.getElementById("Image21");
    img4 = document.getElementById("Image22");
    img5 = document.getElementById("Image23");

    var cookieName = readCookie("menuImageTitle");
//    alert(cookieName)

}

