/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function writeCookie(n,v,e)
{
    var a = new Date();
    a = new Date(a.getTime() +e);
    document.cookie = n+'='+v+'; expires='+a.toGMTString()+';';
}
function writeCookie(n,v)
{
    var a = new Date();
    a = new Date(a.getTime() + 31536000000);
    document.cookie = n+'='+v+'; expires='+a.toGMTString()+';';
}

function readCookie(n)
{
    a = document.cookie;
    res = '';
    while(a != '')
    {
        while(a.substr(0,1) == ' '){
            a = a.substr(1,a.length);
        }
        cookiename = a.substring(0,a.indexOf('='));
        if(a.indexOf(';') != -1)
        {
            cookiewert = a.substring(a.indexOf('=')+1,a.indexOf(';'));
        }
        else{
            cookiewert = a.substr(a.indexOf('=')+1,a.length);
        }
        if(n == cookiename){
            res = cookiewert;
        }
        i = a.indexOf(';')+1;
        if(i == 0){
            i = a.length
        }
        a = a.substring(i,a.length);
    }
    return(res)
}

function deleteCookie(n)
{
    document.cookie = n+'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
} 


