/**
 * gktools 990930
 * by Jorge Cacho, September 30 1999
 * Copyright (c) 1999 Jorge Cacho
 *
 * Jorge Cacho grants you a royalty free license to use or modify this
 * software provided that this copyright notice appears on all copies.
 * This software is provided "AS IS," without a warranty of any kind.
 */

function GetCookie(name){
var cname = name + "=";
var dc = document.cookie;
    if (dc.length > 0) {
    begin = dc.indexOf(cname);
        if (begin != -1) {
        begin += cname.length;
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        }
    }
return null;
}

function SetCookie(name, value) {
	var now = new Date();
	var then = new Date(now.getTime() + 31536000000);
	document.cookie = name + "=" + escape(value) + "; expires=" + then.toGMTString() + "; path=/";
}

function DeleteCookie (name) {
  	var exp = new Date();
  	exp.setTime (exp.getTime() - 1);  // This cookie is history
  	var cval = GetCookie (name);
  	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var cookieName = "applechatComCookie";

function setInput(theName){
	//alert(theName);
	SetCookie(cookieName,theName);
}// end setInput


function getInput(){
	//document.forms[0].elements[0].value =
	return GetCookie(cookieName);
}// end setInput

function removeCookie(){
	DeleteCookie(cookieName);
}// end setInput

