function get(id) {
	return document.getElementById(id);
}

function height() {
	return document.body.clientHeight;
}

function justOneClick() {
     message.Post.disabled=true; // don't click me twice
     setTimeout('alert("Your form has been submitted. Please be patient, I\'m working on it.")', 5000);
     return true; // so the submit will go ahaed
}

function justOneDelete() {
     user.Delete.disabled=true; // don't click me twice
     setTimeout('alert("Your form has been submitted. Please be patient, I\'m working on it.")', 5000);
     return true; // so the submit will go ahaed
}

function confirmRead(ReadForum,ReadThread) {
	if ( userID ) {
		if ( userID != null ) {
			if (confirm("Are you sure you want to mark thread "+ReadThread+" as read?")) {
	
				location = "/cgi/markread.mpl?forum="+ReadForum+"&thread="+ReadThread;
			}
		} else {
			alert("You must log in to Mark Threads as read.")
		}
	} else {
		alert("You must log in to Mark Threads as read.")
	}
}


// from http://www.webreference.com/js/column8/functions.html

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

function setCookie(name, value) {
  var curCookie = name + "=" + escape(value) + "; path=/";
  document.cookie = curCookie;
}

function deleteCookie(name) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    "; domain=.audioasylum.com"  +
    "; path=/"  +
    "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
    document.cookie = name + "=" + 
    "; domain=.videoasylum.com"  +
    "; path=/"  +
    "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
    document.cookie = name + "=" + 
    "; domain=.myasylum.com"  +
    "; path=/"  +
    "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
  }
}

var DS = getCookie("DS");
var DT = getCookie("DT");
var log = getCookie("log");
var M = getCookie("M");
var moniker = getCookie("moniker");
var userID = getCookie("user");
