  function getCookie(name) { // use: getCookie("name");
    var bikky = document.cookie
    var index = bikky.indexOf(name + "=");
    if (index == -1) return null;
    index = bikky.indexOf("=", index) + 1;
    var endstr = bikky.indexOf(";", index);
    if (endstr == -1) endstr = bikky.length;
    return unescape(bikky.substring(index, endstr));
  }



function setCookie(key, value) {
	document.cookie = key + "=" + value + ";path=/"
}

function setPermCookie(key, value) {
	var when = new Date()
	when.setMonth(when.getMonth()+12)
	var dt = when.toGMTString().toString()
	document.cookie = key + "=" + value + "; expires=" + dt + ";path=/;"
//alert(key + " = " + value)
//if (key=="dtExit") {alert(document.cookie)}
}




/* THIS FUNCTION DELETES THE COOKIE.  YOU MUST GIVE THE COOKIE NAME AS AN ARGUMENT. */
function delete_cookie(name){
	//var exp = new Date("December 31, 1999")
	//exp.setTime (exp.getDate()-35)
//alert(exp.toString())
	//document.cookie = name + "=" + ";expires=" + exp.toGMTString() + ";path=/"
//alert(document.cookie = name + "=" + ";expires=" + exp.toGMTString() + ";path=/")
document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	
}

function delCookie (NameOfCookie) {
	document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}



/* THIS FUNCTION SEARCHES FOR A COOKIE.  YOU MUST GIVE THE COOKIE NAME YOU ARE SEARCHING
FOR AS AN ARGUMENT.  IT RETURNS "found" IF THE COOKIE IS PRESENT AND "notfound" IF THE
COOKIE IS NOT PRESENT. */
function find_cookiename(name) {
	var str = document.cookie
	var part = str.split(";")
	var part1 = part[0].split("=")
	var arg = part1[0]
	//alert(arg)
if (name == arg) {
	return(true)
}else {
	return(false)
}
}


/*
function GetCookie(cookieName) {

	var result = ""
	var cookieLength = cookieName.length
	var cook = document.cookie
	var start = cook.indexOf(cookieName,0)
	var end = cook.indexOf(";", start)
	if (start != -1) {
		result = (cook.substring(start, end))
	}
	return(result)
}
*/
