function MM_preloadImages() { //v3.0
  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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    document.MM_Time = new Array(2);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 15;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 1;
    document.MM_Time[0][0].value = "MM_showHideLayers('news1','','show')";
    document.MM_Time[0].lastFrame = 1;
    document.MM_Time[1] = new Array(0);
    document.MM_Time["Timeline2"] = document.MM_Time[1];
    document.MM_Time[1].MM_Name = "Timeline2";
    document.MM_Time[1].fps = 15;
    document.MM_Time[1].lastFrame = 0;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(0);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 15;
    document.MM_Time[0].lastFrame = 0;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}

function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

//******************* API **********************

//Checks for the existence of timelines.
//If none exist, returns false so this Action is grayed out.

function canAcceptBehavior(){
  var allScripts,i,theScript,timelineExists;

  timelineExists = false;
  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      timelineExists = true;
      break;
  } }
  return (timelineExists);
}



//Returns a Javascript function to be inserted in HTML head with script tags.

function behaviorFunction(){
  return "MM_timelinePlay";
}



//Returns fn call to insert in HTML tag <TAG... onEvent='thisFn(arg)'>
//Returns one arg: the selected timeline name.

function applyBehavior() {
  menuIndex = document.theForm.menu.selectedIndex;  //get menu selection index
  timelineName = document.theForm.menu.options[menuIndex].text; //gets selected string
  return "MM_timelinePlay('"+timelineName+"')";
}



//Passed the function call above, extracts the args and reloads the UI.
//With arg timelineName, scans the menu for a matching item, and selects it.
//If the name is not found, it gives an error msg.

function inspectBehavior(upStr){
  var timelineName,menuLength,i;
  var argArray = new Array;
  var found = false;

  argArray = extractArgs(upStr); //get args
  if (argArray.length == 2) {  //should be exactly 2 arg (first arg is fn name)
    timelineName = argArray[1];
    menuLength = document.theForm.menu.options.length;
    for (var i=0; i<menuLength; i++) {  //search menu for matching timeline name
      if (document.theForm.menu.options[i].text == timelineName) { //if found
        document.theForm.menu.selectedIndex = i;  //make it selected
        found = true;
        break;
      }
    }
    if (!found) alert(errMsg(MSG_TimelineNotFound,timelineName));
  }
}



//***************** LOCAL FUNCTIONS  ******************


//Load the select menu with timeline names.

function initializeUI(){
  var i,j,startPos,endPos,theName,theScript;
  var menuIndex = 0;
  var allScripts = new Array;

  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      j = theScript.indexOf('].MM_Name');
      while (j != -1) {
        startPos = theScript.indexOf('"',++j);
        endPos = theScript.indexOf('"',++startPos);
        if (0 < startPos && startPos < endPos) {
          theName = theScript.substring(startPos,endPos);
          document.theForm.menu.options[menuIndex++] = new Option(theName);
        }
        j = theScript.indexOf('].MM_Name',j+1);
      }
    }
  }
}



//*************** GLOBALS VARS *****************

var helpDoc = MM.HELP_behStopTimeline;

//******************* BEHAVIOR FUNCTION **********************

//Stops one or all timelines if they are currently playing.
//Accepts the following arguments:
//  tmLnName - (optional) the name of the timeline to stop (ex: Timeline1)
//             if no timeline name is passed, stops all timelines
//
//Designed to work in conjunction with Dreamweaver's Timeline Inspector.
//The Timeline Inspector creates a JS function called MM_initTimelines(),
//which puts all the timeline settings in a multidimensional array, saved
//into a document property called document.MM_Time.
//
//My function stops one or all by setting their IDs to null. Play Timeline
//always checks ID after each iteration, so any outstanding timers will
//stop with the next function call.

function MM_timelineStop(tmLnName) { //v1.2
  //Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  if (tmLnName == null)  //stop all
    for (var i=0; i<document.MM_Time.length; i++) document.MM_Time[i].ID = null;
  else document.MM_Time[tmLnName].ID = null; //stop one
}


//******************* API **********************


//Checks for the existence of timelines.
//If none exist, returns false so this Action is grayed out.

function canAcceptBehavior(){
  var allScripts,i,theScript,timelineExists;

  timelineExists = false;
  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      timelineExists = true;
      break;
  } }
  return (timelineExists);
}



//Returns a Javascript function to be inserted in HTML head with script tags.

function behaviorFunction(){
  return "MM_timelineStop";
}



//Returns fn call to insert in HTML tag <TAG... onEvent='thisFn(arg)'>
//Returns one arg: the selected timeline name. If ** ALL TIMELINES **
//was selected, returns no arguments.

function applyBehavior() {
  menuIndex = document.theForm.menu.selectedIndex;  //get menu selection index
  if (menuIndex == 0) { //stop ALL timelines, return no arg
    return "MM_timelineStop()";
  } else {
    timelineName = document.theForm.menu.options[menuIndex].text; //gets selection
    return "MM_timelineStop('"+timelineName+"')";
  }
}



//Passed the function call above, extracts the args and reloads the UI.
//With arg timelineName, scans the menu for a matching item, and selects it.
//If the name is not found, it gives an error msg.

function inspectBehavior(upStr){
  var timelineName,menuLength,i;
  var argArray = new Array;
  var found = false;

  argArray = extractArgs(upStr); //get args
  if (argArray.length == 2) {  //should be exactly 2 args
    timelineName = argArray[1];
    menuLength = document.theForm.menu.options.length;
    for (var i=0; i<menuLength; i++) {  //search menu for matching timeline name
      if (document.theForm.menu.options[i].text == timelineName) { //if found
        document.theForm.menu.selectedIndex = i;  //make it selected
        found = true;
        break;
      }
    }
    if (!found) alert(errMsg(MSG_TimelineNotFound,timelineName));
  }
}



//***************** LOCAL FUNCTIONS  ******************


//Load the select menu with timeline names.

function initializeUI(){
  var i,j,startPos,endPos,theScript;
  var theName="";
  var menuIndex = 0;
  var allScripts = new Array;

  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      j = theScript.indexOf('].MM_Name');
      while (j != -1) {
        startPos = theScript.indexOf('"',++j);
        endPos = theScript.indexOf('"',++startPos);
        if (0 < startPos && startPos < endPos) {
          if (theName=="") //first one, insert ALL option
            document.theForm.menu.options[menuIndex++] = new Option("** "+MENUITEM_AllTimelines+" **");
          theName = theScript.substring(startPos,endPos);
          document.theForm.menu.options[menuIndex++] = new Option(theName);
        }
        j = theScript.indexOf('].MM_Name',j+1);
      }
    }
  }
}


//*************** GLOBALS VARS *****************

var helpDoc = MM.HELP_behGoToTimelineFrame;

//******************* BEHAVIOR FUNCTION **********************

//Jumps a timeline to a new frame.
//Accepts the following arguments:
//  tmLnName - the name of the timeline (ex: Timeline1)
//  fNew     - the frame number to jump to
//  numGotos - (optional) the number of times to jump there
//
//Designed to work in conjunction with Dreamweaver's Timeline Inspector.
//The Timeline Inspector creates a JS function called MM_initTimelines(),
//which puts all the timeline settings in a multidimensional array, saved
//into a document property called document.MM_Time.
//
//My function initializes the timeline by calling MM_initTimelines.
//Then it checks the data arrays and sets all sprites to their new positions
//and sets other properties. For behavior sprites it evals the behavior call.
//If numGotos is set, this function will disable itself. For example, if you call:
//  MM_timelineGoto("Timeline1", "1", "3");
//this function will work the first and second time, but not the third, so
//that the timeline can continue after "3" loops.

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
  //Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}


//******************* API **********************


//Checks for the existence of timelines.
//If none exist, returns false so this Action is grayed out.

function canAcceptBehavior(){
  var allScripts,i,theScript,timelineExists;

  timelineExists = false;
  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      timelineExists = true;
      break;
  } }
  return (timelineExists);
}



//Returns a Javascript function to be inserted in HTML head with script tags.

function behaviorFunction(){
  return "MM_timelineGoto";
}



//Returns fn call to insert in HTML tag <TAG... onEvent='thisFn(arg)'>
//Returns two args: the selected timeline name, and the frmNum to goto.

function applyBehavior(x,y,theEvent) {
  var menuIndex, timelineName, frmNum, numGotos, curFrm;
  var eventFromTI = "onFrame";  //event prefix passed to applyBehavior from Timeline Inspector

  menuIndex = document.theForm.menu.selectedIndex;  //get menu selection index
  timelineName = document.theForm.menu.options[menuIndex].text; //gets selected string
  frmNum = parseInt(document.theForm.frmNum.value); //try and get frame num
  if ((document.theForm.frmNum.value != ""+frmNum) ||  //if not a number
      (frmNum < 1))                                    //or if < 1
    return MSG_NegFrameNum;
  else
    if (document.theForm.numGotos.value) { //if not empty
      numGotos = parseInt(document.theForm.numGotos.value); //try and get numGotos
      if ((document.theForm.numGotos.value != ""+numGotos) || //if not a number
          (numGotos < 1))                                     //or if < 1
           return MSG_NegGotoNum;

      else { //user entered a Loop value
        if (theEvent.indexOf(eventFromTI) == -1) { //if event is not from Timeline Inspector
          document.theForm.numGotos.value == ""; //clear loop value
          return MSG_LoopNotFromTI;
        }
        curFrm = parseInt(theEvent.substring(eventFromTI.length,theEvent.length)); //get frame #
        if (frmNum > curFrm) { //if not jumping backward
          document.theForm.numGotos.value == ""; //clear loop value
          return MSG_LoopNotBackward;
        } 
        else { //everything's okay, allow loop value
          return "MM_timelineGoto('"+timelineName+"','"+frmNum+"','"+(numGotos-1)+"')";
        }
      }
    }
    else return "MM_timelineGoto('"+timelineName+"','"+frmNum+"')";
}



//Passed the function call above, extracts the args and reloads the UI.
//With arg timelineName, scans the menu for a matching item, and selects it.
//If the name is not found, it gives an error msg.
//With arg frmNum, stores in text input.

function inspectBehavior(upStr){
  var timelineName,menuLength,i;
  var argArray = new Array;
  var found = false;

  argArray = extractArgs(upStr); //get args
  if (argArray.length > 2) {  //should be 3 or 4 args (first arg is fn call, ignored)
    timelineName = argArray[1];
    menuLength = document.theForm.menu.options.length;
    for (var i=0; i<menuLength; i++) {  //search menu for matching timeline name
      if (document.theForm.menu.options[i].text == timelineName) { //if found
        document.theForm.menu.selectedIndex = i;  //make it selected
        found = true;
        break;
      }
    }
    if (!found) alert(errMsg(MSG_TimelineNotFound,timelineName));
    document.theForm.frmNum.value = argArray[2];
    if (argArray.length > 3) document.theForm.numGotos.value = parseInt(argArray[3])+1;
  }
}



//***************** LOCAL FUNCTIONS  ******************


//Load the select menu with timeline names.

function initializeUI(){
  var i,j,startPos,endPos,theName,theScript;
  var menuIndex = 0;
  var allScripts = new Array;

  allScripts = getObjectTags("document","script");
  for (i in allScripts) {
    theScript = ""+allScripts[i];
    if (theScript.indexOf("function MM_initTimelines") != -1) {
      j = theScript.indexOf('].MM_Name');
      while (j != -1) {
        startPos = theScript.indexOf('"',++j);
        endPos = theScript.indexOf('"',++startPos);
        if (0 < startPos && startPos < endPos) {
          theName = theScript.substring(startPos,endPos);
          document.theForm.menu.options[menuIndex++] = new Option(theName);
        }
        j = theScript.indexOf('].MM_Name',j+1);
      }
    }
  }
  document.theForm.frmNum.focus(); //set focus on textbox
  document.theForm.frmNum.select(); //set insertion point into textbox
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function insertTimeDate() {
	var currentTime = new Date();
	var tempTime;
	// Set current time in time list boxes
	if (currentTime.getHours() > "11") { document.suggestform.ampm.selectedIndex = "1" }
	else { document.suggestform.ampm.selectedIndex = "0" }
	tempTime = currentTime.getHours() 
	if (tempTime > "12") { tempTime = tempTime - 12 }
	document.suggestform.time.selectedIndex = tempTime - 1;
	// Set current date in date list boxes
	document.suggestform.month.selectedIndex = currentTime.getMonth();
	document.suggestform.day.selectedIndex = currentTime.getDate() - 1;
	document.suggestform.year.options[document.suggestform.year.selectedIndex].value = currentTime.getYear();
}

function todaysDate() {
	var currentTime = new Date();
	document.suggestform.month.selectedIndex = currentTime.getMonth();
	document.suggestform.day.selectedIndex = currentTime.getDate() - 1;
	document.suggestform.year.options[document.suggestform.year.selectedIndex].value = currentTime.getYear();
}

function yesterdayDate() {
	var currentTime = new Date();
	var now = new Date();
	var yester = new Date(now - 24 * 60 * 60 * 1000);
	document.suggestform.month.selectedIndex = yester.getMonth();
	document.suggestform.day.selectedIndex = yester.getDate() - 1;
	document.suggestform.year.options[document.suggestform.year.selectedIndex].value = currentTime.getYear();
}

function popupmodal(filename) {
	window.open(filename,"popup1","height=600,width=500,top=100,left=100,scrollbars=yes,modal=yes")
}

function popupmodalsmall(filename) {
	window.open(filename,"popup1","height=300,width=350,top=100,left=500,scrollbars=yes,modal=yes")
}

function MM() {
}

function calcinstalls() {
	var tempvalue = 0;
	if (document.swrequestform.Library200.checked) { tempvalue = 26 }	
	if (document.swrequestform.LibraryBasement.checked) { tempvalue = tempvalue + 20 }	
	if (document.swrequestform.Roush015A.checked) { tempvalue = tempvalue + 20 }	
	if (document.swrequestform.Roush204.checked) { tempvalue = tempvalue + 20 }	
	if (document.swrequestform.Library201.checked) { tempvalue = tempvalue + 20 }	
	if (document.swrequestform.TC.checked) { tempvalue = tempvalue + 13 }	
	document.swrequestform.NumberOfInstalls.value = tempvalue;
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function makehot(rowName) {

}

function makenot(rowName) {

}


function getGuide(x) {
	window.open(x + ".pdf","quickguide","height=600,width=500,top=100,left=100,scrollbars=yes,modal=yes");
}