// Function to allow one JavaScript file to be included by another.
// 
// function IncludeJavaScript(ChuckThomasxxx.js) // to include this file
//{
//  document.write('<script type="text/javascript" src="' + jsFile + '"></script>'); 
// }
// IncludeJavaScript('ChuckThomasxxx.js'); // include another js file // include another file, so on...
//

<!--//hide script
<!-- Below is javascript for file read -->

// Does this browser support try-catch?
var tc = false;
try {
    tc = true;
} catch(f) { }

var xmlHttpError = 'XML HTTP Request: OK';  // for trouble shooting

<!-- Below is for scrolling Textbox -->

<!--Begin
//scroller width
var swidth=600 // this can be changed to vary the width;
//scroller height
var sheight=70  // this can be changed to vary the height of the box;
//scroller's speed;
var sspeed=2  //  this can be changed to vary the scrolling speed (1 is slower, 3 is faster);
var filemessage1='http://ChuckThomas.net/miscellaneous/ScrollBoxesContent/ChuckThomasWhatsNewLinks.html'; // WhatsNew scroll box file name
var filemessage2='http://ChuckThomas.net/miscellaneous/ScrollBoxesContent/ChuckThomasFunStuffLinks.html'; // FunStuff scroll box file name
// *** make sure not to put in line breaks in the following line, where the announcement data goes... ;
var mymessage='<script language="JavaScript">window.location.reload();</script>';  // refreshes where the data for the scroll box resides
fileresults='xxx';

<!-- Below is for File Read -->
function getRequestObject() {
    var objRequest; 
    if (window.ActiveXObject) {
        if (tc) {
            try {
                objRequest = new ActiveXObject('Msxml2.XMLHTTP');  // IE 6+
            }
            catch(e) {
                try {
                    objRequest = new ActiveXObject('Microsoft.XMLHTTP');  // IE 5.5
                }
                catch(f) { } 
            }
        } else {
            objRequest = new ActiveXObject('Microsoft.XMLHTTP');  // ? IE 5.0 ?
        }
    } else if (window.XMLHttpRequest) {
        objRequest = new XMLHttpRequest(); // All other browsers, inc. IE 7 and DOM 3
    }
    return objRequest;
}

function ChuckThomasFileReadInclude(pUrl,pElementId,pImageSrc) {
    if (arguments.length==3) {  // if an image source is sent
        if (pImageSrc) {
            document.getElementById(pElementId).innerHTML='<img src="'+pImageSrc+'">'; // load the image while waiting
        }
    }
    if (arguments.length>=3) {  // if a targetElement ID is sent
        if (pImageSrc) {
            document.getElementById(pElementId).innerHTML='<img src="'+pImageSrc+'">';  // load the image while waiting
        }
    }

    var objRequest = getRequestObject();  // create a new request object
    if (typeof(objRequest)=='object') {  // if we have an object, and
        if (objRequest.readyState>=0) {  // if the object supports the correct properties...proceed
            objRequest.onreadystatechange = function() { handleHttpResponse(objRequest, pElementId); };  // specifiy the function to handle the results
                                        // the correct request object is passed for us.
            objRequest.open('GET', pUrl, true);
            objRequest.send(null);
        }else{
            xmlHttpError = 'XML HTTP Request Object Unavailable';
            return false;
        } 
    }else{
        xmlHttpError = 'XML HTTP Request Object Not Supported';
        return false;
    }
}

function handleHttpResponse(pObjRequest, pElementId) {
    if (pObjRequest.readyState==4) {
        if (pObjRequest.status==200) {
//			setTimeout("",500);  // delay by half a second for the read to occur)	
			fileresults=pObjRequest.responseText; // post the text from the file for display
			if (fileresults=="") {
// This if clause is because some IE security does not permit data across domains... or activeX controls...
				fileresults="Your browser security does not permit the selections box to display... try permitting data across domains and ActiveX controls and restarting."}
			mymessage='<div align="left"><font size="-1" style="color: #330000;">' + fileresults + '<br></font></DIV>';
// Remove the comment marker below to place the results into a <div></div> section (Chuck placed remarks)
//            document.getElementById(pElementId).innerHTML=pObjRequest.responseText;  // load the results into the element
            pObjRequest=null;  // dispose of the now un-needed object.
		setTimeout("start()", 500);   // now put it in the scroll box
        }
    }
}
<!-- Above is javascript for file read -->


<!-- The following JavaScript is for the scrolling data box -->

function start(){
	if (document.all) return // IE 4.0 ... done in Background script
	if (document.getElementById){
	document.getElementById("slider").style.visibility="show"
	ns6marquee(document.getElementById('slider'))
	}
	else if(document.layers){
		document.slider1.visibility="show"
		ns4marquee(document.slider1.document.slider2)
		}
	}
	
function ns4marquee(whichlayer){
	ns4layer=eval(whichlayer)
	ns4layer.document.write(mymessage)
	ns4layer.document.close()
	sizeup=ns4layer.document.height
	ns4layer.top-=sizeup
	ns4slide()
	}
	
function ns4slide(){
	if (ns4layer.top>=sizeup*(-1)){
	ns4layer.top-=sspeed
	setTimeout("ns4slide()",100)
	}
	else{
		ns4layer.top=sheight
		ns4slide()
		}
	}
	
function ns6marquee(whichdiv){
	ns6div=eval(whichdiv)
	ns6div.innerHTML=mymessage
	ns6div.style.top=sheight
	sizeup=sheight
	ns6slide()
	}
	
function ns6slide(){
	if (parseInt(ns6div.style.top)>=sizeup*(-1)){
	ns6div.style.top=parseInt(ns6div.style.top)-sspeed
	setTimeout("ns6slide()",100)
	}
	else{
		ns6div.style.top=sheight
		ns6slide()
		}
	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
	}

// -- End
<!-- Above is for scrolling Textbox -->

<!-- Cookie Check -->
<!-- Cookie Functions -->
<!--

function ChuckThomasSetCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
       ((expires) ? "; expires=" + expires.toGMTString() : "") +
       ((path) ? "; path=" + "ChuckThomas.net" : "") +
       ((domain) ? "; domain=" + "ChuckThomas.net" : "") +
       ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function ChuckThomasGetCookie(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 deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + "ChuckThomas.net" : "") +
    ((domain) ? "; domain=" + "ChuckThomas.net" : "") +
    "; expires=Thu, 01-Jan-10 00:00:01 GMT";
  }
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}
// -->
<!-- Above is for Cookie functions -->

// End --->

//stop hiding script --->
