<!-- 

/* IE 5.0 does not support the push method, so here goes */
if(Array.prototype.push == null) {
	Array.prototype.push = function(item) {
		this[this.length] = item;
		return this.length;
	};
};
/* same for shift */
if (Array.prototype.shift == null) {
  Array.prototype.shift = function() {
    var response = this[0];
    for (var i=0; i < this.length-1; i++) {
      this[i] = this[i + 1];
    };
    this.length--;
    return response;
  };
};
/*	Implement function.apply for browsers which don't support it natively
	Courtesy of Aaron Boodman - http://youngpup.net */
if (!Function.prototype.apply) {
  Function.prototype.apply = function(oScope, args) {
    var sarg = [];
    var rtrn, call;
    if (!oScope) oScope = window;
    if (!args) args = [];
    for (var i = 0; i < args.length; i++) {
      sarg[i] = "args["+i+"]";
    };
    call = "oScope.__applyTemp__(" + sarg.join(",") + ");";
    oScope.__applyTemp__ = this;
    rtrn = eval(call);
    oScope.__applyTemp__ = null;
	return rtrn;
  };
};

// onload will process an array we can push any functions to that we want
var old = window.onload; // catch any existing onload calls 1st
window.onload = function () {
  if (old) { // execute existing onloads
    old();
  };
  for (var ii = 0; arguments.callee.actions.length > ii; ii++) {
    arguments.callee.actions[ii]();
  };
};
window.onload.actions = [];

getElementsByClassName = function (c) {
    var ret = new Array();
    var j = 0;
    var objs = document.all ? document.all : document.getElementsByTagName("*");
    for(i = 0;i<objs.length;i++){
        if(objs[i].className == c){
            ret[j] = objs[i];
            j++;
        } // if
    } // for
    return ret;
}

sfTarget = function() {
  var sfEls = getElementsByClassName("faq"); 
  var aEls = document.getElementsByTagName("a");
  document.lastTarget = null;
  for (var i=0; i<sfEls.length; i++) {
    if (sfEls[i].id) {
      if (location.hash==("#" + sfEls[i].id)) {
        sfEls[i].className+=" " + "sfTarget";
        document.lastTarget=sfEls[i];
      }
      for (var j=0; j<aEls.length; j++) {
        if (aEls[j].hash==("#" + sfEls[i].id)) 
          aEls[j].targetEl = sfEls[i]; 
          aEls[j].onclick = function() {
            if (document.lastTarget) 
              document.lastTarget.className = 
                document.lastTarget.className.replace(new RegExp(" sfTarget\\b"), "");
            if (this.targetEl) 
              this.targetEl.className+=" sfTarget";
              document.lastTarget=this.targetEl;
          return true;
        }
      }
    }
  }
}
if (window.attachEvent) window.onload.actions.push(sfTarget);

function fixLinks()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var anchors = document.getElementsByTagName("a");
  var i, href, title;
  for(i=0; i < anchors.length; i++){
    if(!anchors[i].href) continue;
    href = anchors[i].href;
    title = anchors[i].title;
    if(href.indexOf(server) == -1){ // Href is not a file on my server
      if(href.indexOf("javascript:") == -1){ // Href is not a javascript call
        if(!anchors[i].onclick){ // Href does not have an onclick event
          if(href.indexOf("mailto:") == -1){ // Href is not a mailto:
            if((href.indexOf("http://") != -1) || (href.indexOf("https://") != -1)){ // Href is not relative (for Safari)
              anchors[i].setAttribute("target","_blank");
              anchors[i].setAttribute("title",title + " [This Link Will Open in a New Window]");
            }
          }
        }
      }
    }
  }
  return null;
}
window.onload.actions.push(fixLinks);



// popQuiz()
// added 3-11-03
// used to open the Quiz window
function popQuiz() {
   OpenWin = this.open("/educate/tools/legal_quiz/legalQuiz.html", "Quiz","WIDTH=550,HEIGHT=413,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}


// popCalc()
// added 3-11-03
// used to open the Loss Calculator window
function popCalc() {
   OpenWin = this.open("/educate/tools/loss_calc/lossCalculator.html", "Calculator", "WIDTH=750,HEIGHT=545,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

// popAnimated()
// added 3-11-03
// used to open the Animated Story window
function popAnimated(who) {
  if(who == "jill") {
    OpenWin = this.open("/educate/tools/anim_story/animatedStory-Jill.html", "CtrlWindow", "WIDTH=550,HEIGHT=413,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
  } else if(who == "jack") {
    OpenWin = this.open("/educate/tools/anim_story/animatedStory-Jack.html", "CtrlWindow", "WIDTH=550,HEIGHT=413,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
  } else if(who == "joe") {
    OpenWin = this.open("/educate/tools/anim_story/animatedStory-Joe.html", "CtrlWindow", "WIDTH=550,HEIGHT=413,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
  } else {
   // do nothing
  }
}

// popIdiot()
// added 3-11-03
// used to open the Idiot's Guide window
function popIdiot() {
   OpenWin = this.open("/educate/tools/idiots_guide/idiotsGuide.html", "IdiotsGuide", "WIDTH=550,HEIGHT=400,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}


// popImpairmentDemo()
// added 05-30-03
// used to open the Impairment Demo window
function popImpairmentDemo() {
   OpenWin = this.open("/educate/tools/impairment/impairment.html", "ImpairmentDemo", "WIDTH=645,HEIGHT=485,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

// blockError
// added 3-10-03
// used to supress javascript errors
function blockError() {
  return true;
}
//window.onerror = blockError;


// openPopup
// added 3-10-03
// used to create a popup
function openPopup(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// externalLink
// added 3-10-03
// used to open an external link
function externalLink(theURL) {
	var windowparams = "width=800,height=525,top=0,left=0,scrollbars,toolbar";
	openPopup(theURL,'',windowparams);
}

// popImage
// added 3-10-03
// used to open a popup for larger versions of files
function popImage(theImage) {
	var windowparams = "width=550,height=509,top=50,left=50";
	var theImageURL = "http://easy-designs.net/bigImage.php?src=" + theImage;
	openPopup(theImageURL,'',windowparams);
}

// popInteractive
// added 3-10-03
// used to open a popup for larger versions of files
function popInteractive(theURL,width,height,color) {
	var windowparams = "width=550,height=509,top=50,left=50";
	var theImageURL = "http://easy-designs.net/bigImage.php?swf=" + theURL + "&width=" + width + "&height=" + height + "&color=" + color;
	openPopup(theImageURL,'',windowparams);
}

//  -->