/* ### BEGIN Kill Frames ### */
//if (window.self!=window.top) window.top.location=window.self.location;
/* ### END Kill Frames ### */

/* ### BEGIN Standard Cookie Code ### */
var exp = new Date();
exp.setTime(exp.getTime() + (7220 * 24 * 60 * 60 * 1000));

function setCookie(name, value, expires) {
  document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

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 delCookie(name) {
  document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}
/* ### END Standard Cookie Code ### */


/* ### BEGIN Pop-up Window Code ### */
function oWin(Purl, Pname, Pw, Ph) {
	pWin = window.open(Purl, Pname, 'width=' + Pw + ',height=' + Ph + ',toolbar=no,menubar=no,scrollbars=no,status=no,location=no,resizable=no');
	pWin.focus();
}
/* ### END Pop-up Window Code ##3 */


/* ### BEGIN JavaScript E-mail Trick ### */
// Will it hide my e-mail address from spammers?
function emailTrick(varOne,varTwo,varThree) {
	document.location.href = 'mailto:' + varTwo + '@' + varOne + '.' + varThree;
}
/* ### END JavaScript E-mail Trick ### */


/* ### BEGIN Random Number Generator ### */
var now = new Date();
var seed = now.getTime() % 0xffffffff;
function getRandom(n) {
	seed = (0x15a4e35 * seed) % 0x7fffffff;
	return (seed >> 16) % n;
}
/* ### END Random Number Generator ### */


/* ### BEGIN Ajax Scripts ### */
// Build an Ajax object
function makeAjax() {
	try {
		ajaxObj = new XMLHttpRequest();
	} catch(errorOne) {
		try {
			ajaxObj = new ActiveXObject('Msxml2.XMLHTTP');
		} catch(errorTwo) {
			try {
				ajaxObj = new ActiveXObject('Microsoft.XMLHTTP');
			} catch(errorThree) {
				ajaxObj = false;
			}
		}
	}
	return ajaxObj;
}

// Send an Ajax request
// ajaxObj = Ajax object created by the desiring page
// returnFunction = Function the desiring page created for the return of the Ajax
// queryString = the query string the desiring page wants us to send to the Ajax tools page
function sendAjax(ajaxObj, returnFunction, queryString) {
	// URL to our Ajax tool & a datetime stamp to prevent caching
	ajaxToolsURL = '/tools.ajax.php?';
	ajaxNoCache = '&nocache=' + new Date().getTime();
	// Build our URL to send
	sendURL = ajaxToolsURL + queryString + ajaxNoCache;
	// Send the Ajax request
	ajaxObj.open('GET', sendURL, true);
	ajaxObj.onreadystatechange = returnFunction;
	ajaxObj.send(null);
}
/* ### END Ajax Scripts ### */



