//***********************************************
function init()
//***********************************************
{
DisableImageRightClick();
roundedImages();

//var showLayerHomeDropZone = setTimeout("layerToggle('layerHomeDropZone'); startSound(0);",2000);
//}
//
//function startSound(itemNumber) {
//document.getElementsByTagName('embed').item(itemNumber).play();
//}
//
//function stopSound(itemNumber) {
//document.getElementsByTagName('embed').item(itemNumber).stop();
//}

// Set window focus
if (self.name!="newWin")
self.name="easterWin";
self.focus();
}
{
// Create favorites icon links in document head
var head = document.getElementsByTagName('head').item(0)

//destroy existing dom created iconLink tags so they aren't
//continually replicated
var idIconLink1 = document.getElementById(idIconLink1);
if(idIconLink1) head.removeChild(idIconLink1);
var idIconLink2 = document.getElementById(idIconLink2);
if(idIconLink2) head.removeChild(idIconLink2);

iconLink1 = document.createElement('link');
iconLink1.rel = 'icon';
iconLink1.href = 'http://www.easterseals.org/favicon.ico';
iconLink1.type = 'image/x-icon';
iconLink1.id = 'idIconLink1';
head.appendChild(iconLink1);

iconLink2 = document.createElement('link');
iconLink2.rel = 'shortcut icon';
iconLink2.href = 'http://www.easterseals.org/favicon.ico';
iconLink2.type = 'image/x-icon';
iconLink2.id = 'idIconLink2';
head.appendChild(iconLink2);
}

// Legacy functions
function newWin(url){open(url,"newWin","width=800,height=600,toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,copyhistory=no,resizable=yes,left=5,top=5,screenX=5,screenY=5")}function makeCaps(a){g=a.split(' ');for(l=0;l<g.length;l++)g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);return g.join(" ")}function getLoc(c){var d="";if(c>0)for(k=0;k<c;k++)d=d+"../";return d}function submitForm(strAction){document.frmContent.actionType.value=strAction;document.frmContent.submit()}function load(loc){if(loc==""){return}else{location=loc}}function changeDiv(the_div,the_change){var the_style=getStyleObject(the_div);if(the_style!=false){the_style.display=the_change}}function hideAddress(){changeDiv("Address","none")}function hidePhone(){changeDiv("Phone","none")}function hideEmployment(){changeDiv("Employment","none")}function hideGender(){changeDiv("Gender","none")}function hideBirthdate(){changeDiv("Birthdate","none")}function hideComments(){changeDiv("Comments","none")}function hideSponsoringPledge(){changeDiv("SponsoringPledge","none")}function hideOrganization(){changeDiv("Organization","none")}function getStyleObject(objectId){if(document.getElementById&&document.getElementById(objectId)){return document.getElementById(objectId).style}else if(document.all&&document.all(objectId)){return document.all(objectId).style}else{return false}}function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i]}}}function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p)}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x}function MM_nbGroup(event,grpName){var i,img,nbArr,args=MM_nbGroup.arguments;if(event=="init"&&args.length>2){if((img=MM_findObj(args[2]))!=null&&!img.MM_init){img.MM_init=true;img.MM_up=args[3];img.MM_dn=img.src;if((nbArr=document[grpName])==null)nbArr=document[grpName]=new Array();nbArr[nbArr.length]=img;for(i=4;i<args.length-1;i+=2)if((img=MM_findObj(args[i]))!=null){if(!img.MM_up)img.MM_up=img.src;img.src=img.MM_dn=args[i+1];nbArr[nbArr.length]=img}}}else if(event=="over"){document.MM_nbOver=nbArr=new Array();for(i=1;i<args.length-1;i+=3)if((img=MM_findObj(args[i]))!=null){if(!img.MM_up)img.MM_up=img.src;img.src=(img.MM_dn&&args[i+2])?args[i+2]:args[i+1];nbArr[nbArr.length]=img}}else if(event=="out"){for(i=0;i<document.MM_nbOver.length;i++){img=document.MM_nbOver[i];img.src=(img.MM_dn)?img.MM_dn:img.MM_up}}else if(event=="down"){if((nbArr=document[grpName])!=null)for(i=0;i<nbArr.length;i++){img=nbArr[i];img.src=img.MM_up;img.MM_dn=0}document[grpName]=nbArr=new Array();for(i=2;i<args.length-1;i+=2)if((img=MM_findObj(args[i]))!=null){if(!img.MM_up)img.MM_up=img.src;img.src=img.MM_dn=args[i+1];nbArr[nbArr.length]=img}}}function MM_displayStatusMsg(msgStr){status=msgStr;document.MM_returnValue=true}function MM_reloadPage(init){if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage}}else if(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH)location.reload()}MM_reloadPage(true);highlightcolor="#E6EFF7";ns6=document.getElementById&&!document.all;previous='';var eventobj;intended=/INPUT|TEXTAREA/;function checkel(which){if(which.style&&intended.test(which.tagName)){if(ns6&&eventobj.nodeType==3)eventobj=eventobj.parentNode.parentNode;return true}else return false}function highlight(e){eventobj=ns6?e.target:event.srcElement;if(previous!=''){if(checkel(previous))previous.style.backgroundColor='';previous=eventobj;if(checkel(eventobj))eventobj.style.backgroundColor=highlightcolor}else{if(checkel(eventobj))eventobj.style.backgroundColor=highlightcolor;previous=eventobj}}

function right(e) {
	var msg="Copyright © 2006 The Easter Seal Society, Ontario";
	if(navigator.appName=='Netscape'&&e.which==3){
		alert(msg);
		return false
	}
	if(navigator.appName=='Microsoft Internet Explorer'&&event.button==2) {
		alert(msg);
		return false
	}
	else return true
	}

function DisableImageRightClick() {
	if(document.images) {
		for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown=right;
			document.images[i].onmouseup=right;
		}
	}
}

//Show/Hide and Dray layerOurMission functionality
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
  var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
  var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
  retVal = true; if(IE && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = MM_findObj(objName); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
      } else {
        if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div"); 
          for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
        for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i]; 
    } }
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
    curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
    curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft; 
    if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
    curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop; 
    if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  } else {
    var theEvent = ((NS)?objName.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (NS6) { parentLayer = aLayer.parentNode;
            while (parentLayer != null && parentLayer.style.position) {             
              parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
              parentLayer = parentLayer.parentNode;
          } } else if (IE) { parentLayer = aLayer.parentElement;       
            while (parentLayer != null && parentLayer.style.position) {
              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
          var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
          if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
        curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
        curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
        if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS4&&!NS6) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS4) {left = newLeft; top = newTop;}
        else if (NS6){style.left = newLeft; style.top = newTop;}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
             Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
          if (NS4) {left = MM_targL; top = MM_targT;}
          else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objName);
  } return retVal;
}

function QueryString(key){
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse(){
	var query = window.location.search.substring(1);
	var pairs = query.split("&");
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}
}
QueryString_Parse();

// this main function is responsible for parsing the query string
// and, passed on the values supplied, see what elements our form
// uses from that query string and replace the element values
// based on what is passed us from the query string
function preLoadData(strPassedFormName){
  var strTemp;
  var strFormType;
  var qsName;
  var qsValue;
  var arrPassedString;
  var intI, intJ;
  var urlPassedString = location.search.substring(1);
  var re = /[+]/gi;
  var blnFoundValidItem = 0; 
  // look for at least one item in the query string that corresponds to 
  // PIID, MLID, or MPID.  If we find at least one item with that designation, 
  // then continue the preloading of the form.  Otherwise, do not go into the 
  // preload script 
  arrPassedString = urlPassedString.split("&") 
  for (intI = 0; intI < arrPassedString.length; intI++) {
    qsName = ''; 
    qsName = arrPassedString[intI].substring(0, 4); 
    qsName = qsName.toUpperCase(); 
    if (qsName == 'PIID' || qsName == 'MLID' || qsName == 'MPID') { 
      blnFoundValidItem = 1; 
    } 
  }
  // parse our string of data into it's appropriate name and value pairs
  // once we do so, see if there is a
  if (urlPassedString.length != 0 && blnFoundValidItem == 1)
  {
    for (intJ = 0; intJ < window.document.forms[strPassedFormName].length; intJ++) { 
      varFormElement = window.document.forms[strPassedFormName][intJ]; 
      strFormType    = varFormElement.type; 
      strFormType = strFormType.toUpperCase(); 
      if (strFormType == "TEXT"  || strFormType == "HIDDEN") { 
        strTemp = varFormElement.name; 
        strTemp = strTemp.toUpperCase(); 
        if (strTemp != "WEBFORMID" && strTemp != "PROCESSPAGE" && strTemp != "W") {
          varFormElement.value = "";
        }
      } else if (strFormType == "CHECKBOX" || strFormType == "RADIO") { 
        varFormElement.checked = false; 
      } else if (strFormType == "SELECT-ONE") { 
        varFormElement.selectedIndex = -1; 
      } else if (strFormType == "TEXTAREA") { 
        varFormElement.value = ""; 
      }
    } 
    arrPassedString = urlPassedString.split("&")
    for (intI = 0; intI < arrPassedString.length; intI++) {
      qsValue = '';
      qsName = '';
      qsName = arrPassedString[intI].substring(0, arrPassedString[intI].indexOf("=",1));
      qsValue = arrPassedString[intI].substring(arrPassedString[intI].indexOf("=",1)+1)
      if (qsValue.substring(0, 1) == "+") {
        qsValue = qsValue.substring(1, qsValue.length)
      }
      qsValue = unescape(qsValue.replace(re, " "));
      qsName = unescape(qsName.replace(re, " "));
      if (window.document.forms[strPassedFormName][qsName]) {
        // first, we determine wether we are looking if the same profile item has been
        // listed on the form multiple times (in the case of a checkbox or radio button or select box with multiple options)
        // or if it's just listed once (in the case of everything else)
        if (window.document.forms[strPassedFormName][qsName].length) {         
          strFormType = window.document.forms[strPassedFormName][qsName].type;
          if (strFormType) {
            strFormType = strFormType.toUpperCase();
          }
          if (strFormType == "TEXT"  || strFormType == "HIDDEN") {
            window.document.forms[strPassedFormName][qsName].value = qsValue;
          } else if (strFormType == "RADIO" || strFormType == "CHECKBOX") {
            if (window.document.forms[strPassedFormName][qsName].value == qsValue) {
              window.document.forms[strPassedFormName][qsName].checked = true;
            }     
          } else if (strFormType == "SELECT-ONE") {
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              strTemp = window.document.forms[strPassedFormName][qsName].options[intJ].value;
              if (strTemp == qsValue) {
                window.document.forms[strPassedFormName][qsName].selectedIndex = intJ;
              }
            }
          } else {
            // we have a checkbox or radio button with multiple values.  In each case we know that there will be a
            // value attribute
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              if (window.document.forms[strPassedFormName][qsName][intJ].value == qsValue) {
                window.document.forms[strPassedFormName][qsName][intJ].checked = true;
              }
            }
          }
        } else {
          // in this case, we know that we have either a select box or we have something else
          // do this by testing for the selectedIndex property
          strFormType = window.document.forms[strPassedFormName][qsName].type;
          strFormType = strFormType.toUpperCase();
          if (strFormType == "SELECT-ONE") {
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              strTemp = window.document.forms[strPassedFormName][qsName].options[intJ].value;
              if (strTemp == qsValue) {
                window.document.forms[strPassedFormName][qsName].selectedIndex = intJ;
              }
            }
          } else {
            strFormType = window.document.forms[strPassedFormName][qsName].type;
            strFormType = strFormType.toUpperCase();
            if (strFormType == 'RADIO' || strFormType == 'CHECKBOX') {
              if (window.document.forms[strPassedFormName][qsName].value == qsValue) {
                window.document.forms[strPassedFormName][qsName].checked = true;
              }     
            } else {
              window.document.forms[strPassedFormName][qsName].value = qsValue;
            }
          }
        }
      }
 else {  qsName = qsName + '_0';       if (window.document.forms[strPassedFormName][qsName]) {
        // first, we determine wether we are looking if the same profile item has been
        // listed on the form multiple times (in the case of a checkbox or radio button or select box with multiple options)
        // or if it's just listed once (in the case of everything else)
        if (window.document.forms[strPassedFormName][qsName].length) {         
          strFormType = window.document.forms[strPassedFormName][qsName].type;
          if (strFormType) {
            strFormType = strFormType.toUpperCase();
          }
          if (strFormType == "TEXT"  || strFormType == "HIDDEN") {
            window.document.forms[strPassedFormName][qsName].value = qsValue;
          } else if (strFormType == "RADIO" || strFormType == "CHECKBOX") {
            if (window.document.forms[strPassedFormName][qsName].value == qsValue) {
              window.document.forms[strPassedFormName][qsName].checked = true;
            }     
          } else if (strFormType == "SELECT-ONE") {
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              strTemp = window.document.forms[strPassedFormName][qsName].options[intJ].value;
              if (strTemp == qsValue) {
                window.document.forms[strPassedFormName][qsName].selectedIndex = intJ;
              }
            }
          } else {
            // we have a checkbox or radio button with multiple values.  In each case we know that there will be a
            // value attribute
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              if (window.document.forms[strPassedFormName][qsName][intJ].value == qsValue) {
                window.document.forms[strPassedFormName][qsName][intJ].checked = true;
              }
            }
          }
        } else {
          // in this case, we know that we have either a select box or we have something else
          // do this by testing for the selectedIndex property
          strFormType = window.document.forms[strPassedFormName][qsName].type;
          strFormType = strFormType.toUpperCase();
          if (strFormType == "SELECT-ONE") {
            for (intJ = 0; intJ < window.document.forms[strPassedFormName][qsName].length; intJ++) {
              strTemp = window.document.forms[strPassedFormName][qsName].options[intJ].value;
              if (strTemp == qsValue) {
                window.document.forms[strPassedFormName][qsName].selectedIndex = intJ;
              }
            }
          } else {
            strFormType = window.document.forms[strPassedFormName][qsName].type;
            strFormType = strFormType.toUpperCase();
            if (strFormType == 'RADIO' || strFormType == 'CHECKBOX') {
              if (window.document.forms[strPassedFormName][qsName].value == qsValue) {
                window.document.forms[strPassedFormName][qsName].checked = true;
              }     
            } else {
              window.document.forms[strPassedFormName][qsName].value = qsValue;
            }
          }
        }
      }
    }     }
  }
}

function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah) 
{
	this.version = "020320 [Menu; mnuPopup.js]";
	this.type = "Menu";
	this.menuWidth = mw;
	this.menuItemHeight = mh;
	this.fontSize = fs;
	this.fontWeight = "plain";
	this.fontFamily = fnt;
	this.fontColor = fclr;
	this.fontColorHilite = fhclr;
	this.bgColor = "#555555";
	this.menuBorder = 1;
	this.menuBgOpaque=opq;
	this.menuItemBorder = 1;
	this.menuItemIndent = idt;
	this.menuItemBgColor = bg;
	this.menuItemVAlign = valgn;
	this.menuItemHAlign = halgn;
	this.menuItemPadding = pad;
	this.menuItemSpacing = space;
	this.menuLiteBgColor = "#ffffff";
	this.menuBorderBgColor = "";
	this.menuHiliteBgColor = bgh;
	this.menuContainerBgColor = "#cccccc";
	this.childMenuIcon = "arrows.gif";
	this.submenuXOffset = sx;
	this.submenuYOffset = sy;
	this.submenuRelativeToItem = srel;
	this.vertical = vert;
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();
	this.hideOnMouseOut = true;
	this.hideTimeout = to;
	this.addMenuItem = addMenuItem;
	this.writeMenus = writeMenus;
	this.showMenu = showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;
	if (!window.menus) window.menus = new Array();
	this.label = " " + label;
	window.menus[this.label] = this;
	window.menus[window.menus.length] = this;
	if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
}

function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function writeMenus(container) { 	

	if (window.triedToWriteMenus) return;

	var agt = navigator.userAgent.toLowerCase();
	window.mmIsOpera = agt.indexOf("opera") != -1;
	if (!container && document.layers) {
		window.delayWriteMenus = this.writeMenus;
		var timer = setTimeout('delayWriteMenus()', 500);
		container = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes || window.mmIsOpera) {
		document.writeln('<span id="menuContainer"></span>');
		container = FIND("menuContainer");
	}


	window.mmHideMenuTimer = null;
	if (!container) return;	
	window.triedToWriteMenus = true; 
	container.isContainer = true;
	container.menus = new Array();
	for (var i=0; i<window.menus.length; i++) 
		container.menus[i] = window.menus[i];
	window.menus.length = 0;
	var countMenus = 0;
	var countItems = 0;
	var top = 0;
	var content = '';
	var lrs = false;
	var theStat = "";
	var tsc = 0;
	if (document.layers) lrs = true;
	for (var i=0; i<container.menus.length; i++, countMenus++) {
		var menu = container.menus[i];
		if (menu.bgImageUp || !menu.menuBgOpaque) {
			menu.menuBorder = 0;
			menu.menuItemBorder = 0;
		}
		if (lrs) {
			var menuLayer = new Layer(100, container);
			var lite = new Layer(100, menuLayer);
			lite.top = menu.menuBorder;
			lite.left = menu.menuBorder;
			var body = new Layer(100, lite);
			body.top = menu.menuBorder;
			body.left = menu.menuBorder;
		} else {
			content += ''+
			'<div id="menuLayer'+ countMenus +'" style="position:absolute;z-index:1;left:10px;top:'+ (i * 100) +'px;visibility:hidden;color:' +  menu.menuBorderBgColor + ';">\n'+
			'  <div id="menuLite'+ countMenus +'" style="position:absolute;z-index:1;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;" onmouseout="mouseoutMenu();">\n'+
			'	 <div id="menuFg'+ countMenus +'" style="position:absolute;left:'+ menu.menuBorder +'px;top:'+ menu.menuBorder +'px;visibility:hide;">\n'+
			'';
		}
		var x=i;
		for (var i=0; i<menu.items.length; i++) {
			var item = menu.items[i];
			var childMenu = false;
			var defaultHeight = menu.fontSize+2*menu.menuItemPadding;
			if (item.label) {
				item = item.label;
				childMenu = true;
			}
			menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
			var itemProps = '';
			if( menu.fontFamily != '' ) itemProps += 'font-family:' + menu.fontFamily +';';
			itemProps += 'font-weight:' + menu.fontWeight + ';font-size:' + menu.fontSize + 'px;';

			if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
			if (document.all || window.mmIsOpera) 
				itemProps += 'font-size:' + menu.fontSize + 'px;" onmouseover="onMenuItemOver(null,this);" onclick="onMenuItemAction(null,this);';
			else if (!document.layers) {
				itemProps += 'font-size:' + menu.fontSize + 'px;';
			}
			var l;
			if (lrs) {
				var lw = menu.menuWidth;
				if( menu.menuItemHAlign == 'right' ) lw -= menu.menuItemPadding;
				l = new Layer(lw,body);
			}
			var itemLeft = 0;
			var itemTop = i*menu.menuItemHeight;
			if( !menu.vertical ) {
				itemLeft = i*menu.menuWidth;
				itemTop = 0;
			}
			var dTag = '<div id="menuItem'+ countItems +'" style="position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';
			var dClose = '</div>'
			if (menu.bgImageUp) dTag = '<div id="menuItem'+ countItems +'" style="background:url('+menu.bgImageUp+');position:absolute;left:' + itemLeft + 'px;top:'+ itemTop +'px;'+ itemProps +'">';

			var left = 0, top = 0, right = 0, bottom = 0;
			left = 1 + menu.menuItemPadding + menu.menuItemIndent;
			right = left + menu.menuWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
			if( menu.menuItemVAlign == 'top' ) top = menu.menuItemPadding;
			if( menu.menuItemVAlign == 'bottom' ) top = menu.menuItemHeight-menu.fontSize-1-menu.menuItemPadding;
			if( menu.menuItemVAlign == 'middle' ) top = ((menu.menuItemHeight/2)-(menu.fontSize/2)-1);
			bottom = menu.menuItemHeight - 2*menu.menuItemPadding;
			var textProps = 'position:absolute;left:' + left + 'px;top:' + top + 'px;';
			if (lrs) {
				textProps +=itemProps + 'right:' + right + ';bottom:' + bottom + ';';
				dTag = "";
				dClose = "";
			}
			
			if(document.all && !window.mmIsOpera) {
				item = '<div align="' + menu.menuItemHAlign + '">' + item + '</div>';
			} else if (lrs) {
				item = '<div style="text-align:' + menu.menuItemHAlign + ';">' + item + '</div>';
			} else {
				var hitem = null;
				if( menu.menuItemHAlign != 'left' ) {
					if(window.mmIsOpera) {
						var operaWidth = menu.menuItemHAlign == 'center' ? -(menu.menuWidth-2*menu.menuItemPadding) : (menu.menuWidth-6*menu.menuItemPadding);
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					} else {
						hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
						item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left+menu.menuWidth-3*menu.menuItemPadding) + 'px;text-align:' 
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
					}
				} else hitem = null;
			}
			if(document.all && !window.mmIsOpera) item = '<div id="menuItemShim' + countItems + '" style="position:absolute;left:0px;top:0px;">' + item + '</div>';
			var dText	= '<div id="menuItemText'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColor +';">'+ item +'&nbsp</div>\n'
						+ '<div id="menuItemHilite'+ countItems +'" style="' + textProps + 'color:'+ menu.fontColorHilite +';visibility:hidden;">' 
						+ (hitem||item) +'&nbsp</div>';
			if (childMenu) content += ( dTag + dText + '<div id="childMenu'+ countItems +'" style="position:absolute;left:0px;top:3px;"><img src="'+ menu.childMenuIcon +'"></div>\n' + dClose);
			else content += ( dTag + dText + dClose);
			if (lrs) {
				l.document.open("text/html");
				l.document.writeln(content);
				l.document.close();	
				content = '';
				theStat += "-";
				tsc++;
				if (tsc > 50) {
					tsc = 0;
					theStat = "";
				}
				status = theStat;
			}
			countItems++;  
		}
		if (lrs) {
			var focusItem = new Layer(100, body);
			focusItem.visiblity="hidden";
			focusItem.document.open("text/html");
			focusItem.document.writeln("&nbsp;");
			focusItem.document.close();	
		} else {
		  content += '	  <div id="focusItem'+ countMenus +'" style="position:absolute;left:0px;top:0px;visibility:hide;" onclick="onMenuItemAction(null,this);">&nbsp;</div>\n';
		  content += '   </div>\n  </div>\n</div>\n';
		}
		i=x;
	}
	if (document.layers) {		
		container.clip.width = window.innerWidth;
		container.clip.height = window.innerHeight;
		container.onmouseout = mouseoutMenu;
		container.menuContainerBgColor = this.menuContainerBgColor;
		for (var i=0; i<container.document.layers.length; i++) {
			proto = container.menus[i];
			var menu = container.document.layers[i];
			container.menus[i].menuLayer = menu;
			container.menus[i].menuLayer.Menu = container.menus[i];
			container.menus[i].menuLayer.Menu.container = container;
			var body = menu.document.layers[0].document.layers[0];
			body.clip.width = proto.menuWidth || body.clip.width;
			body.clip.height = proto.menuHeight || body.clip.height;
			for (var n=0; n<body.document.layers.length-1; n++) {
				var l = body.document.layers[n];
				l.Menu = container.menus[i];
				l.menuHiliteBgColor = proto.menuHiliteBgColor;
				l.document.bgColor = proto.menuItemBgColor;
				l.saveColor = proto.menuItemBgColor;
				l.onmouseover = proto.onMenuItemOver;
				l.onclick = proto.onMenuItemAction;
				l.mmaction = container.menus[i].actions[n];
				l.focusItem = body.document.layers[body.document.layers.length-1];
				l.clip.width = proto.menuWidth || body.clip.width;
				l.clip.height = proto.menuItemHeight || l.clip.height;
				if (n>0) {
					if( l.Menu.vertical ) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder + proto.menuItemSpacing;
					else l.left = body.document.layers[n-1].left + body.document.layers[n-1].clip.width + proto.menuItemBorder + proto.menuItemSpacing;
				}
				l.hilite = l.document.layers[1];
				if (proto.bgImageUp) l.background.src = proto.bgImageUp;
				l.document.layers[1].isHilite = true;
				if (l.document.layers.length > 2) {
					l.childMenu = container.menus[i].items[n].menuLayer;
					l.document.layers[2].left = l.clip.width -13;
					l.document.layers[2].top = (l.clip.height / 2) -4;
					l.document.layers[2].clip.left += 3;
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
			}
			if( proto.menuBgOpaque ) body.document.bgColor = proto.bgColor;
			if( proto.vertical ) {
				body.clip.width  = l.clip.width +proto.menuBorder;
				body.clip.height = l.top + l.clip.height +proto.menuBorder;
			} else {
				body.clip.height  = l.clip.height +proto.menuBorder;
				body.clip.width = l.left + l.clip.width  +proto.menuBorder;
				if( body.clip.width > window.innerWidth ) body.clip.width = window.innerWidth;
			}
			var focusItem = body.document.layers[n];
			focusItem.clip.width = body.clip.width;
			focusItem.Menu = l.Menu;
			focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
			if( proto.menuBgOpaque ) menu.document.bgColor = proto.menuBorderBgColor;
			var lite = menu.document.layers[0];
			if( proto.menuBgOpaque ) lite.document.bgColor = proto.menuLiteBgColor;
			lite.clip.width = body.clip.width +1;
			lite.clip.height = body.clip.height +1;
			menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
			menu.clip.height = body.clip.height + (proto.menuBorder * 3);
		}
	} else {
		if ((!document.all) && (container.hasChildNodes) && !window.mmIsOpera) {
			container.innerHTML=content;
		} else {
			container.document.open("text/html");
			container.document.writeln(content);
			container.document.close();	
		}
		if (!FIND("menuLayer0")) return;
		var menuCount = 0;
		for (var x=0; x<container.menus.length; x++) {
			var menuLayer = FIND("menuLayer" + x);
			container.menus[x].menuLayer = "menuLayer" + x;
			menuLayer.Menu = container.menus[x];
			menuLayer.Menu.container = "menuLayer" + x;
			menuLayer.style.zindex = 1;
		    var s = menuLayer.style;
			s.pixeltop = -300;
			s.pixelleft = -300;
			s.top = '-300px';
			s.left = '-300px';

			var menu = container.menus[x];
			menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
			if( menu.menuBgOpaque ) menuLayer.style.backgroundColor = menu.menuBorderBgColor;
			var top = 0;
			var left = 0;
			menu.menuItemLayers = new Array();
			for (var i=0; i<container.menus[x].items.length; i++) {
				var l = FIND("menuItem" + menuCount);
				l.Menu = container.menus[x];
				l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
				if (l.addEventListener || window.mmIsOpera) {
					l.style.width = menu.menuItemWidth + 'px';
					l.style.height = menu.menuItemHeight + 'px';
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.top = top + 'px';
					l.style.left = left + 'px';
					if(l.addEventListener) {
						l.addEventListener("mouseover", onMenuItemOver, false);
						l.addEventListener("click", onMenuItemAction, false);
						l.addEventListener("mouseout", mouseoutMenu, false);
					}
					if( menu.menuItemHAlign != 'left' ) {
						l.hiliteShim = FIND("menuItemHilite" + menuCount + "Shim");
						l.hiliteShim.style.visibility = "inherit";
						l.textShim = FIND("menuItemText" + menuCount + "Shim");
						l.hiliteShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
						l.textShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						l.textShim.style.width = l.textShim.style.pixelWidth;	
					}
				} else {
					l.style.pixelWidth = menu.menuItemWidth;
					l.style.pixelHeight = menu.menuItemHeight;
					l.style.pixelTop = top;
					l.style.pixelLeft = left;
					if( menu.menuItemHAlign != 'left' ) {
						var shim = FIND("menuItemShim" + menuCount);
						shim[0].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[1].style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
						shim[0].style.width = shim[0].style.pixelWidth + 'px';
						shim[1].style.width = shim[1].style.pixelWidth + 'px';
					}
				}
				if( menu.vertical ) top = top + menu.menuItemHeight+menu.menuItemBorder+menu.menuItemSpacing;
				else left = left + menu.menuItemWidth+menu.menuItemBorder+menu.menuItemSpacing;
				l.style.fontSize = menu.fontSize + 'px';
				l.style.backgroundColor = menu.menuItemBgColor;
				l.style.visibility = "inherit";
				l.saveColor = menu.menuItemBgColor;
				l.menuHiliteBgColor = menu.menuHiliteBgColor;
				l.mmaction = container.menus[x].actions[i];
				l.hilite = FIND("menuItemHilite" + menuCount);
				l.focusItem = FIND("focusItem" + x);
				l.focusItem.style.pixelTop = -30;
				l.focusItem.style.top = '-30px';
				var childItem = FIND("childMenu" + menuCount);
				if (childItem) {
					l.childMenu = container.menus[x].items[i].menuLayer;
					childItem.style.pixelLeft = menu.menuItemWidth -11;
					childItem.style.left = childItem.style.pixelLeft + 'px';
					childItem.style.pixelTop = (menu.menuItemHeight /2) -4;
					childItem.style.top = childItem.style.pixelTop + 'px';
					l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
				}
				l.style.cursor = "hand";
				menuCount++;
			}
			if( menu.vertical ) {
				menu.menuHeight = top-1-menu.menuItemSpacing;
				menu.menuWidth = menu.menuItemWidth;
			} else {
				menu.menuHeight = menu.menuItemHeight;
				menu.menuWidth = left-1-menu.menuItemSpacing;
			}

			var lite = FIND("menuLite" + x);
			var s = lite.style;
			s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2);
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.menuLiteBgColor;

			var body = FIND("menuFg" + x);
			s = body.style;
			s.pixelHeight = menu.menuHeight + menu.menuBorder;
			s.height = s.pixelHeight + 'px';
			s.pixelWidth = menu.menuWidth + menu.menuBorder;
			s.width = s.pixelWidth + 'px';
			if( menu.menuBgOpaque ) s.backgroundColor = menu.bgColor;

			s = menuLayer.style;
			s.pixelWidth  = menu.menuWidth + (menu.menuBorder * 4);
			s.width = s.pixelWidth + 'px';
			s.pixelHeight  = menu.menuHeight+(menu.menuBorder*4);
			s.height = s.pixelHeight + 'px';
		}
	}
	if (document.captureEvents) document.captureEvents(Event.MOUSEUP);
	if (document.addEventListener) document.addEventListener("mouseup", onMenuItemOver, false);
	if (document.layers && window.innerWidth) {
		window.onresize = NS4resize;
		window.NS4sIW = window.innerWidth;
		window.NS4sIH = window.innerHeight;
		setTimeout("NS4resize()",500);
	}
	document.onmouseup = mouseupMenu;
	window.mmWroteMenu = true;
	status = "";
}

function NS4resize() {
	if (NS4sIW != window.innerWidth || NS4sIH != window.innerHeight) window.location.reload();
}

function onMenuItemOver(e, l) {
	pclearTimeout();
	l = l || this;
	var a = window.ActiveMenuItem;
	if (document.layers) {
		if (a) {
			a.document.bgColor = a.saveColor;
			if (a.hilite) a.hilite.visibility = "hidden";
			if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
			a.focusItem.top = -100;
			a.clicked = false;
		}
		if (l.hilite) {
			l.document.bgColor = l.menuHiliteBgColor;
			l.zIndex = 1;
			l.hilite.visibility = "inherit";
			l.hilite.zIndex = 2;
			l.document.layers[1].zIndex = 1;
			l.focusItem.zIndex = this.zIndex +2;
		}
		if (l.Menu.bgImageOver) l.background.src = l.Menu.bgImageOver;
		l.focusItem.top = this.top;
		l.focusItem.left = this.left;
		l.focusItem.clip.width = l.clip.width;
		l.focusItem.clip.height = l.clip.height;
		l.Menu.hideChildMenu(l);
	} else if (l.style && l.Menu) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
			if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp +")";;
		} 
		l.style.backgroundColor = l.menuHiliteBgColor;
		l.zIndex = 1;
		if (l.Menu.bgImageOver) l.style.background = "url(" + l.Menu.bgImageOver +")";
		if (l.hilite) {
			l.hilite.style.visibility = "inherit";
			if( l.hiliteShim ) l.hiliteShim.style.visibility = "visible";
		}
		l.focusItem.style.pixelTop = l.style.pixelTop;
		l.focusItem.style.top = l.focusItem.style.pixelTop + 'px';
		l.focusItem.style.pixelLeft = l.style.pixelLeft;
		l.focusItem.style.left = l.focusItem.style.pixelLeft + 'px';
		l.focusItem.style.zIndex = l.zIndex +1;
		l.Menu.hideChildMenu(l);
	} else return;
	window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
	l = window.ActiveMenuItem;
	if (!l) return;
	hideActiveMenus();
	if (l.mmaction) eval("" + l.mmaction);
	window.ActiveMenuItem = 0;
}

function pclearTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
	mmDHFlag = false;
}

function pstartTimeout() {
	if( window.ActiveMenu ) {
		mmStart = new Date();
		mmDHFlag = true;
		mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
	}
}

function mmDoHide() {
	if (!mmDHFlag || !window.ActiveMenu) return;
	var elapsed = new Date() - mmStart;
	var timeout = window.ActiveMenu.Menu.hideTimeout;
	if (elapsed < timeout) {
		mmHideMenuTimer = setTimeout("mmDoHide()", timeout+100-elapsed);
		return;
	}
	mmDHFlag = false;
	hideActiveMenus();
	window.ActiveMenuItem = 0;
}

function showMenu(menu, x, y, child, imgname) {

if (!window.mmWroteMenu) return;
	pclearTimeout();
	if (menu) {
		var obj = FIND(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
		x = moveXbySlicePos (x, obj);
		y = moveYbySlicePos (y, obj);
	}
	if (document.layers) {
		if (menu) {
			var l = menu.menuLayer || menu;
			l.top = l.left = 1;
			hideActiveMenus();
			if (this.visibility) l = this;
			window.ActiveMenu = l;
		} else {
			var l = child;
		}
		if (!l) return;
		for (var i=0; i<l.layers.length; i++) { 			   
			if (!l.layers[i].isHilite) l.layers[i].visibility = "inherit";
			if (l.layers[i].document.layers.length > 0) showMenu(null, "relative", "relative", l.layers[i]);
		}
		if (l.parentLayer) {
			if (x != "relative") l.parentLayer.left = x || window.pageX || 0;
			if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
			if (y != "relative") l.parentLayer.top = y || window.pageY || 0;
			if (l.parentLayer.isContainer) {
				l.Menu.xOffset = window.pageXOffset;
				l.Menu.yOffset = window.pageYOffset;
				l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
				l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
				if (l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque ) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
			}
		}
		l.visibility = "inherit";
		if (l.Menu) l.Menu.container.visibility = "inherit";
	} else if (FIND("menuItem0")) {
		var l = menu.menuLayer || menu;	
		hideActiveMenus();
		if (typeof(l) == "string") l = FIND(l);
		window.ActiveMenu = l;
		var s = l.style;
		s.visibility = "inherit";
		if (x != "relative") {
			s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
			s.left = s.pixelLeft + 'px';
		}
		if (y != "relative") {
			s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
			s.top = s.pixelTop + 'px';
		}
		l.Menu.xOffset = document.body.scrollLeft;
		l.Menu.yOffset = document.body.scrollTop;
	}
	if (menu) window.activeMenus[window.activeMenus.length] = l;
	pclearTimeout();
}

function onMenuItemDown(e, l) {
	var a = window.ActiveMenuItem;
	if (document.layers && a) {
		a.eX = e.pageX;
		a.eY = e.pageY;
		a.clicked = true;
    }

}

function mouseupMenu(e) {
	hideMenu(true, e);
	hideActiveMenus();
	return true;
}

function getExplorerVersion() {
	var ieVers = parseFloat(navigator.appVersion);
	if( navigator.appName != 'Microsoft Internet Explorer' ) return ieVers;
	var tempVers = navigator.appVersion;
	var i = tempVers.indexOf( 'MSIE ' );
	if( i >= 0 ) {
		tempVers = tempVers.substring( i+5 );
		ieVers = parseFloat( tempVers ); 
	}
	return ieVers;
}

function mouseoutMenu() {
	if ((navigator.appName == "Microsoft Internet Explorer") && (getExplorerVersion() < 4.5))
		return true;
	hideMenu(false, false);
	return true;
}

function hideMenu(mouseup, e) {
	var a = window.ActiveMenuItem;
	if (a && document.layers) {
		a.document.bgColor = a.saveColor;
		a.focusItem.top = -30;
		if (a.hilite) a.hilite.visibility = "hidden";
		if (mouseup && a.mmaction && a.clicked && window.ActiveMenu) {
 			if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
				setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 500);
			}
		}
		a.clicked = false;
		if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
	} else if (window.ActiveMenu && FIND("menuItem0")) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
			if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp +")";
		}
	}
	if (!mouseup && window.ActiveMenu) {
		if (window.ActiveMenu.Menu) {
			if (window.ActiveMenu.Menu.hideOnMouseOut) pstartTimeout();
			return(true);
		}
	}
	return(true);
}

function hideChildMenu(hcmLayer) {
	pclearTimeout();
	var l = hcmLayer;
	for (var i=0; i < l.Menu.childMenus.length; i++) {
		var theLayer = l.Menu.childMenus[i];
		if (document.layers) theLayer.visibility = "hidden";
		else {
			theLayer = FIND(theLayer);
			theLayer.style.visibility = "hidden";
			if( theLayer.Menu.menuItemHAlign != 'left' ) {
				for(var j = 0; j < theLayer.Menu.menuItemLayers.length; j++) {
					var itemLayer = theLayer.Menu.menuItemLayers[j];
					if(itemLayer.textShim) itemLayer.textShim.style.visibility = "inherit";
				}
			}
		}
		theLayer.Menu.hideChildMenu(theLayer);
	}
	if (l.childMenu) {
		var childMenu = l.childMenu;
		if (document.layers) {
			l.Menu.showMenu(null,null,null,childMenu.layers[0]);
			childMenu.zIndex = l.parentLayer.zIndex +1;
			childMenu.top = l.Menu.menuLayer.top + l.Menu.submenuYOffset;
			if( l.Menu.vertical ) {
				if( l.Menu.submenuRelativeToItem ) childMenu.top += l.top + l.parentLayer.top;
				childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
			} else {
				childMenu.top += l.top + l.parentLayer.top;	
				if( l.Menu.submenuRelativeToItem ) childMenu.left = l.Menu.menuLayer.left + l.left + l.clip.width + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
				else childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2*l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
			}
			if( childMenu.left < l.Menu.container.clip.left ) l.Menu.container.clip.left = childMenu.left;
			var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
			if (w > l.Menu.container.clip.width)  l.Menu.container.clip.width = w;
			var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
			if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
			l.document.layers[1].zIndex = 0;
			childMenu.visibility = "inherit";
		} else if (FIND("menuItem0")) {
			childMenu = FIND(l.childMenu);
			var menuLayer = FIND(l.Menu.menuLayer);
			var s = childMenu.style;
			s.zIndex = menuLayer.style.zIndex+1;
			if (document.all || window.mmIsOpera) {
				s.pixelTop = menuLayer.style.pixelTop + l.Menu.submenuYOffset;
				if( l.Menu.vertical ) {
					if( l.Menu.submenuRelativeToItem ) s.pixelTop += l.style.pixelTop;
					s.pixelLeft = l.style.pixelWidth + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
					s.left = s.pixelLeft + 'px';
				} else {
					s.pixelTop += l.style.pixelTop;
					if( l.Menu.submenuRelativeToItem ) s.pixelLeft = menuLayer.style.pixelLeft + l.style.pixelLeft + l.style.pixelWidth + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
					else s.pixelLeft = (menuLayer.style.pixelWidth-4*l.Menu.menuBorder) + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
					s.left = s.pixelLeft + 'px';
				}
			} else {
				var top = parseInt(menuLayer.style.top) + l.Menu.submenuYOffset;
				var left = 0;
				if( l.Menu.vertical ) {
					if( l.Menu.submenuRelativeToItem ) top += parseInt(l.style.top);
					left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
				} else {
					top += parseInt(l.style.top);
					if( l.Menu.submenuRelativeToItem ) left = parseInt(menuLayer.style.left) + parseInt(l.style.left) + parseInt(l.style.width) + (2*l.Menu.menuBorder) + l.Menu.submenuXOffset;
					else left = (parseInt(menuLayer.style.width)-4*l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
				}
				s.top = top + 'px';
				s.left = left + 'px';
			}
			childMenu.style.visibility = "inherit";
		} else return;
		window.activeMenus[window.activeMenus.length] = childMenu;
	}
}

function hideActiveMenus() {
	if (!window.activeMenus) return;
	for (var i=0; i < window.activeMenus.length; i++) {
		if (!activeMenus[i]) continue;
		if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
			activeMenus[i].visibility = "hidden";
			activeMenus[i].Menu.container.visibility = "hidden";
			activeMenus[i].Menu.container.clip.left = 0;
		} else if (activeMenus[i].style) {
			var s = activeMenus[i].style;
			s.visibility = "hidden";
			s.left = '-200px';
			s.top = '-200px';
		}
	}
	if (window.ActiveMenuItem) hideMenu(false, false);
	window.activeMenus.length = 0;
}

function moveXbySlicePos (x, img) { 
	if (!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
			if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
			if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}
	} else if (img.x) x += img.x;
	return x;
}

function moveYbySlicePos (y, img) {
	if(!document.layers) {
		var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
		var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
		var par = img;
		var lastOffset = 0;
		while(par){
			if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
			if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
			if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
			par = macIE45 ? par.parentElement : par.offsetParent;
		}		
	} else if (img.y >= 0) y += img.y;
	return y;
}

//Smooth link scrolling start

//ss_addEvent(window,"load",ss_fixAllLinks);

function ss_fixAllLinks() { 
 // Get a list of all links in the page 
 var allLinks = document.getElementsByTagName('a'); 
 // Walk through the list 
 for (var i=0;i<allLinks.length;i++) { 
   var lnk = allLinks[i]; 
   if ((lnk.href && lnk.href.indexOf('#') != -1) &&  
       ( (lnk.pathname == location.pathname) || 
   ('/'+lnk.pathname == location.pathname) ) &&  
       (lnk.search == location.search)) { 
     // If the link is internal to the page (begins in #) 
     // then attach the smoothScroll function as an onclick 
     // event handler 
     ss_addEvent(lnk,'click',smoothScroll); 
   } 
 } 
} 

function smoothScroll(e) { 
 // This is an event handler; get the clicked on element, 
 // in a cross-browser fashion 
 if (window.event) { 
   target = window.event.srcElement; 
 } else if (e) { 
   target = e.target; 
 } else return; 
  
 // Make sure that the target is an element, not a text node 
 // within an element 
 if (target.nodeType == 3) { 
   target = target.parentNode; 
 } 
  
 // Paranoia; check this is an A tag 
 if (target.nodeName.toLowerCase() != 'a') return; 
  
 // Find the <a name> tag corresponding to this href 
 // First strip off the hash (first character) 
 anchor = target.hash.substr(1); 
 // Now loop all A tags until we find one with that name 
 var allLinks = document.getElementsByTagName('a'); 
 var destinationLink = null; 
 for (var i=0;i<allLinks.length;i++) { 
   var lnk = allLinks[i]; 
   if (lnk.name && (lnk.name == anchor)) { 
     destinationLink = lnk; 
     break; 
   } 
 } 
  
 // If we didn't find a destination, give up and let the browser do 
 // its thing 
 if (!destinationLink) return true; 
  
 // Find the destination's position 
 var destx = destinationLink.offsetLeft;  
 var desty = destinationLink.offsetTop; 
 var thisNode = destinationLink; 
 while (thisNode.offsetParent &&  
       (thisNode.offsetParent != document.body)) { 
   thisNode = thisNode.offsetParent; 
   destx += thisNode.offsetLeft; 
   desty += thisNode.offsetTop; 
 } 
  
 // Stop any current scrolling 
 clearInterval(ss_INTERVAL); 
  
 cypos = ss_getCurrentYPos(); 
  
 ss_stepsize = parseInt((desty-cypos)/ss_STEPS); 
 ss_INTERVAL = setInterval('ss_scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10); 
  
 // And stop the actual click happening 
 if (window.event) { 
   window.event.cancelBubble = true; 
   window.event.returnValue = false; 
 } 
 if (e && e.preventDefault && e.stopPropagation) { 
   e.preventDefault(); 
   e.stopPropagation(); 
 } 
} 

function ss_scrollWindow(scramount,dest,anchor) { 
 wascypos = ss_getCurrentYPos(); 
 isAbove = (wascypos < dest); 
 window.scrollTo(0,wascypos + scramount); 
 iscypos = ss_getCurrentYPos(); 
 isAboveNow = (iscypos < dest); 
 if ((isAbove != isAboveNow) || (wascypos == iscypos)) { 
   // if we've just scrolled past the destination, or 
   // we haven't moved from the last scroll (i.e., we're at the 
   // bottom of the page) then scroll exactly to the link 
   window.scrollTo(0,dest); 
   // cancel the repeating timer 
   clearInterval(ss_INTERVAL); 
   // and jump to the link directly so the URL's right 
   location.hash = anchor; 
 } 
} 

function ss_getCurrentYPos() { 
 if (document.body && document.body.scrollTop) 
   return document.body.scrollTop; 
 if (document.documentElement && document.documentElement.scrollTop) 
   return document.documentElement.scrollTop; 
 if (window.pageYOffset) 
   return window.pageYOffset; 
 return 0; 
} 

function ss_addEvent(elm, evType, fn, useCapture) 
// addEvent and removeEvent 
// cross-browser event handling for IE5+,  NS6 and Mozilla 
{ 
 if (elm.addEventListener){ 
   elm.addEventListener(evType, fn, useCapture); 
   return true; 
 } else if (elm.attachEvent){ 
   var r = elm.attachEvent("on"+evType, fn); 
   return r; 
 } 
}  

var ss_INTERVAL; 
var ss_STEPS = 25; 

ss_addEvent(window,"load",ss_fixAllLinks);
// smooth link scrolling end

// actually call the routine to do our replacement of text values
preLoadData('frmMainWebFormLoader')

function testPreLoadToken(strPassedFormName) {
  var urlPassedString = location.search.substring(1);
  var re = /[+]/gi;
  var strWebFormID = "";
  var strTemp = "";
  var intFoundToken = 0;
  var varElement;

  // parse our string of data into it's appropriate name and value pairs
  // once we do so, see if there is a
  if (urlPassedString.length != 0)
  {
    arrPassedString = urlPassedString.split("&")
    for (intI = 0; intI < arrPassedString.length; intI++) {
      qsValue = '';
      qsName = '';
      qsName = arrPassedString[intI].substring(0, arrPassedString[intI].indexOf("=",1));
      qsValue = arrPassedString[intI].substring(arrPassedString[intI].indexOf("=",1)+1)
      if (qsValue.substring(0, 1) == "+") {
        qsValue = qsValue.substring(1, qsValue.length)
      }
      qsValue = unescape(qsValue.replace(re, " "));
      qsName = unescape(qsName.replace(re, " "));
      qsName = qsName.toUpperCase(); 
      if (qsValue == "") qsValue="1";
      if (qsName == "TOKEN" && qsValue != "") {
        intFoundToken = 1;
        // find the original WebForm ID
        if (window.document.forms[strPassedFormName]["W"]) {
          strWebFormID = window.document.forms[strPassedFormName]["W"].value;
        }
        if (strWebFormID != "") {
          strTemp = "http://tdw.thindataworks.com/a/y.x?S=" + qsValue + "&W=" + strWebFormID;
          window.location = strTemp; 
        }        
      }
    }
  }  
}
testPreLoadToken('frmMainWebFormLoader');

<!-- Start of the MIME Selector Code. This will make sure that use can only pick one mime type and subscribe to only one mime type. -->
function TurnOtherOff(intMimeTypeId,lngMailinglistId,objthis,thisform) 
 { 
   var strTextTypeBox = 'MLID_' + lngMailinglistId + '_2';
   var strHTMLTypebox = 'MLID_' + lngMailinglistId + '_4';
   var frmWebform = window.document.forms[thisform]; 

   if(intMimeTypeId==2) 
   { 
     for(i=0;i<frmWebform.length;i++) 
     { 
       if(frmWebform.elements[i].name.indexOf(strHTMLTypebox)!=-1) 
       { 
         if (objthis.checked == true) 
         { 
           frmWebform.elements[i].checked = false; 
         } 
       } 
    } 
  } 

   if(intMimeTypeId==4) 
   { 
     for(i=0;i<frmWebform.length;i++) 
     {        if(frmWebform.elements[i].name.indexOf(strTextTypeBox)!=-1) 
       {          if (objthis.checked == true) 
         { 
            frmWebform.elements[i].checked = false; 
         } 
       } 
     } 
   } 
 }

function roundedImages() {

 /* Only run if the content tag is on the page */
if (document.getElementById('content')) {

	var content = document.getElementById('content');
	var imgs = content.getElementsByTagName('img');
	
	 /* Now add 4 additional divs to each img we have found */
	 for (var i = 0; i < imgs.length; i++) {         // start loop 
	
	   var wrapper = document.createElement('div');  // Create the outer-most div (wrapper)
	   wrapper.className = 'wrapper';                // Give it a classname - wrapper
	   var original = imgs[i];                       // take the next image  
	   wrapper.style.width =  imgs[i].width*.000 + imgs[i].width  +'px'; //( 3 + imgs[i].width  )  +'px';
	   wrapper.style.height = imgs[i].height*.015 + imgs[i].height  +'px';
	   /* Swap out the original img with our wrapper div (we'll put it back later) */
	   original.parentNode.replaceChild(wrapper, original);
		
	   /* Create the four other inner nodes and give them classnames */
	   var tl = document.createElement('div');
	   tl.className = 'tl';
	   var br = document.createElement('div');
	   br.className = 'br';
	   var tr = document.createElement('div');
	   tr.className = 'tr';
	   var bl = document.createElement('div');
	   bl.className = 'bl';
	   /* Glue the nodes back inside the wrapper */
	   wrapper.appendChild(tl);
	   wrapper.appendChild(tr);
	   wrapper.appendChild(bl);
	   wrapper.appendChild(br);
	   /* And glue the img back in after the DIVs */
	   
	   wrapper.appendChild(original);
	 }
	}
}
//***********************************************
function layerToggle(id)
//***********************************************
{
	if(document.getElementById(id)){

		var el = document.getElementById(id);	
		var sel = document.getElementsByTagName("select");
		var obj = document.getElementsByTagName("object");
		
		if ( el.style.display != 'block' ) {
			el.style.display = 'block';
			
			if (document.all) { //IE
				for (var i = 0; i < sel.length; i++) {  
					sel[i].style.display = 'none';
				}
				for (var i = 0; i < obj.length; i++) {  
					obj[i].style.display = 'none';
				}
			}
		}	
		else {
			el.style.display = 'none';
	
			if (document.all) { //IE
				for (var i = 0; i < sel.length; i++) {  
					sel[i].style.display = 'block';
				}
				for (var i = 0; i < obj.length; i++) {  
					obj[i].style.display = 'block';
				}				
			}
		}
	}
	
return true;
}

//***********************************************
function makeHttpRequest(url, searchUrl, callback_function, return_xml)
//***********************************************
{
	layerToggle('bkgdScoreboard');
 
   var http_request = false; 

   if (window.XMLHttpRequest) { // Mozilla, Safari,... 
       http_request = new XMLHttpRequest(); 
	   http_request.generateUniqueUrl = true;
       if (http_request.overrideMimeType) { 
           http_request.overrideMimeType('text/xml'); 
       } 
   } else if (window.ActiveXObject) { // IE 
       try { 
           http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
       } catch (e) { 
           try { 
               http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
           } catch (e) {} 
       } 
   } 

   if (!http_request) { 
       alert('Unfortunately you browser doesn\'t support this feature.'); 
       return false; 
   } 
   http_request.onreadystatechange = function() { 
         if (http_request.readyState == 4) { 
           if (http_request.status == 200) { 
               if (return_xml) { 
                   eval(callback_function + '(http_request.responseXML)'); 
               } else { 
                    document.getElementById('containerScoreboard').innerHTML = http_request.responseText;

					var scoreboardAttributeHref	= document.getElementById('scoreboard').getElementsByTagName("a");
				 		for(var i=0; i < scoreboardAttributeHref.length; i++) {
					  		var a = scoreboardAttributeHref[i];
					  		a.href = searchUrl;
					  		a.setAttribute("href",a.href);
						}  
				}
 
           } else { 
             document.getElementById('containerScoreboard').innerHTML = '<div id="dialogueScoreboard">Oops! Sorry, the scoreboad didn\'t load properly. Please close this window and try again. (Error code: ' + http_request.status + ')</div>'; 
           }
	   } else { 
			document.getElementById('containerScoreboard').innerHTML = '<div id="dialogueScoreboard">Loading scoreboard <img src="/english/PleaseWaitPeriods.gif" /></div>';		
	   }
   } 
   http_request.open('GET', url); 
   http_request.setRequestHeader('Cache-Control', 'no-cache');
   http_request.send(null); 
}
// The following functions are related to the tax calculator
var IsDonation=false;
var IsCredit=false;
var IsNetcost=false;

function IsDec(no){
    return FoundChar(no, ".");
}

function IsNumber(textValue){
 var IsDec = false;
 var k = 0;
     var Find = "";
     for (k = 0; k < textValue.length; k ++){
        Find = textValue.substring(k, k + 1 );
       if ((Find < "0") || (Find > "9"))
  {
          if ((Find == ".") && (!IsDec))
   {
             IsDec = true;
             continue;
          }
   else
   {
             if ((Find == "-") && (k == 0))
    {
     return false;
             }
          }
          return false;
       }
     }
     return true;
}

function FoundChar(text, chr){
     var j;
    for (j = 0; j < text.length; j++){
       if (text.substring(j, j + 1) == chr)
  {
          return true;
       }
     }
 return false;
}

function calcMoney(temp){
 var Final;
 var Dollars;
 var tmpC;
 var chrDol;
 var Cents;
 Dollars=Math.floor(temp);
 chrDol=""+ Math.floor(temp*100);
 tmpC=""+Math.round(temp*100);
 Cents=tmpC.substring(tmpC.length-2, tmpC.length);
 if ((chrDol.substring(chrDol.length-2, chrDol.length)=="99") && (Cents=="00")){
  Dollars = Math.floor(Dollars+1);
 }
 temp=Dollars+"."+Cents;
 Final=temp;
 return Final;
}

function donationChanged(form, donation){
 var temp;
 var crTmp;
 if (donation.value.length==0){
  alert("Negative numbers are invalid. You must enter a positive value.");
       donation.value = form.donation.defaultValue;
 }
     if (!IsNumber(donation.value)){
  alert("Negative numbers are invalid. You must enter a positive value.");
       donation.value = form.donation.defaultValue;
      }
 else{
  donation.value=calcMoney(donation.value);
  form.donation.defaultValue=donation.value;
  if (donation.value > 200)
  {

   temp=44.1+(donation.value-200)*0.4016;
   form.credit.value=calcMoney(temp);
   form.credit.defaultValue = form.credit.value;
   temp=donation.value - form.credit.value;
   form.netcost.value = calcMoney(temp);
   form.netcost.defaultValue = form.netcost.value;
  }
  else{
   temp=donation.value * 0.2205;
   form.credit.value = calcMoney(temp);
   form.credit.defaultValue = form.credit.value;
   temp=donation.value - form.credit.value
   form.netcost.value = calcMoney(temp);
   form.netcost.defaultValue = form.netcost.value;
  }
      }
     IsDonation=false;
}

function creditChanged(form, credit){
 var temp;
 if (credit.value.length==0){
  alert("Negative numbers are invalid. You must enter a positive value.");
       credit.value = form.credit.defaultValue;
 }
     if (!IsNumber(credit.value)){
  alert("Negative numbers are invalid. You must enter a positive value.");
       credit.value = form.credit.defaultValue;
      }
 else{
  credit.value=calcMoney(credit.value);
  form.credit.defaultValue=credit.value;
  if (credit.value > 44.1)
  {
   temp=(credit.value - 44.1)/0.4016 + 44.1/0.2205
   form.donation.value = calcMoney(temp);
   form.donation.defaultValue = form.donation.value;
   temp=form.donation.value - credit.value;
   form.netcost.value = calcMoney(temp);
   form.netcost.defaultValue = form.netcost.value;
  }
  else{
   temp=credit.value/0.2205;
   form.donation.value = calcMoney(temp);
   form.donation.defaultValue = form.donation.value;
   temp=form.donation.value - credit.value;
   form.netcost.value=calcMoney(temp);
   form.netcost.defaultValue = form.netcost.value;
  }
      }
     IsCredit=false;
}

function netcostChanged(form, netcost){
 var temp;
 if (form.netcost.value.length==0){
  alert("Negative numbers are invalid. You must enter a positive value.");
       netcost.value = form.netcost.defaultValue;
 }
     if (!IsNumber(netcost.value)){
  alert("Negative numbers are invalid. You must enter a positive value.");
       netcost.value = form.netcost.defaultValue;
      }
 else{
  netcost.value=calcMoney(netcost.value);
  form.netcost.defaultValue=netcost.value;
  if (netcost.value > 155.9)
  {
   temp = netcost.value/0.5984 - 44.1/0.7795;
   form.donation.value = calcMoney(temp);
   form.donation.defaultValue = form.donation.value;
   temp=form.donation.value - netcost.value;
   form.credit.value = calcMoney(temp);
   form.credit.defaultValue = form.credit.value;
  }
  else{
   temp=netcost.value/0.7795;
   form.donation.value = calcMoney(temp);
   form.donation.defaultValue = form.donation.value;
   temp=form.donation.value - netcost.value;
   form.credit.value = calcMoney(temp);
   form.credit.defaultValue = form.credit.value;
  }
      }
 IsNetcost=false; 
}

function CheckValue(form){
 if (IsDonation==true){
  donationChanged(form, form.donation); 
 }
 else if (IsCredit==true){
  creditChanged(form, form.credit);
 }
 else if (IsNetcost==true){
  netcostChanged(form, form.netcost);
  }
}

function SetChange(chValue){
 if (chValue==1){
  IsDonation=true;
 }
 else if (chValue==2){
  IsCredit=true;
 }
 else if (chValue==3){
  IsNetcost=true;
 }
}
// End tax calculator functions

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

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 deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// Security image pop-up
function loadSecurityImage(pExistingImageID, pImageURL) {
    var img = document.createElement('img');
    img.onload = function (evt) {
        document.getElementById(pExistingImageID).src=this.src;
        document.getElementById(pExistingImageID).width=this.width;
        document.getElementById(pExistingImageID).height=this.height;		
    }
    img.src = pImageURL;	
	document.getElementById('idChkSecurityImage').value='';
	document.getElementById('actionForm').disabled=true;
	checkSecurityImage();
}

function checkSecurityImage() {
if ((document.getElementById('idChkSecurityImage').value.toLowerCase()) == (getCookie('securityImage').toLowerCase())) {
	document.getElementById('idErrSecurityImage').innerHTML='<span style="color:green;font-size:80%;font-weight:bold"><- Correct!</span>';
	document.getElementById('actionForm').disabled=false;
}
else{
	document.getElementById('idErrSecurityImage').innerHTML='<span style="font-size:80%;font-weight:bold"><- Keep Trying</span>';
	document.getElementById('actionForm').disabled=true;
	}
}