function getCookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
function setCookie(name, value, expires, path, domain, secure){
    document.cookie= name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function toReload(){
	// static.asp has built in anticaching
	if(document.location.search.indexOf("&reload=1")>-1 && document.location.href.indexOf("static.asp")==-1){
		return true;
	}
	return false;
}
if (getCookie("reloader")!=document.location.href && toReload()){
	var expires = new Date()
    expires.setTime(expires.getTime() + (10000));
	setCookie('reloader', document.location.href, expires);
	window.status = 'reloading to clear cache';
	window.location.reload();
	if(document.execCommand){
		document.execCommand("Stop");
	}else{
		window.stop();
	}
}else{
	window.status =  document.location.search;
}