// When the page loads:

function init() {
	//toggleSpinDown();
	//Tree('tree_one', 'images/tree_open.gif', 'images/tree_closed.gif', 'images/tree_empty.gif');
	//new Tree('tree_two', 'images/sp_g_arrow_down.gif', 'images/sp_g_arrow_up.gif', 'images/tree_empty.gif');
	mySlide = new slideShow('pressReleases', 4000, 'fade', 'mySlide', true);
	//add page onload functions here
}


// parameters set in the code
function popupWin(param_href, param_width, param_height, param_hasScroll, param_toolbars, param_resize) {
		//set parameters 
		param_width = 300;
		param_height = 300;
		param_hasScroll = 1;
		param_toolbars = 1;
		param_resize = 1;
		popupw = window.open(param_href,"","toolbar="+param_toolbars+",directories=0,status=0,menubar=0,location=0,scrollbars="+param_hasScroll+",resizable="+param_resize+",width="+param_width+",height="+param_height);
}

// parameters passed in to the code
function popupFull(param_href, param_width, param_height, param_hasScroll, param_toolbars, param_resize) {
		//check parameters 
		param_hasScroll = (param_hasScroll?1:0)
		param_toolbars = (param_toolbars?1:0)
		param_resize = (param_resize?1:0)
		popupf = window.open(param_href,"","toolbar="+param_toolbars+",directories=0,status=0,menubar=0,location=0,scrollbars="+param_hasScroll+",resizable="+param_resize+",width="+param_width+",height="+param_height);
}


// write today's date
function writeDate()
{
  var m_names = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
  
  var d = new Date();
  var curr_date = d.getDate();
  var curr_month = d.getMonth();
  var curr_year = d.getFullYear();
  var strDate = ( curr_date + "." + m_names[curr_month] + "." + curr_year);
  document.write(strDate);
}

// write current time
function writeTime()
{
  var a_p = "";
  var d = new Date();
  var curr_hour = d.getHours();
  if (curr_hour < 12)
    a_p = "AM";
  else
    a_p = "PM";
  if (curr_hour == 0)
    curr_hour = 12;
  if (curr_hour > 12)
    curr_hour = curr_hour - 12;
  var curr_min = d.getMinutes();
  curr_min = curr_min + "";
  if (curr_min.length == 1)
    curr_min = "0" + curr_min;
  //document.write(curr_hour + " : " + curr_min + " " + a_p);
  document.write(curr_hour + ":" + curr_min);
}

function writeLastUpdate()
{
	document.write(document.lastModified);
}

// Show/Hide functions for non-pointer layer/objects

// Show by id
function show(id){
	if (document.getElementById && document.getElementById(id) != null) {
		//this.log('[show method - executing show method for object id: ' +  id);
		document.getElementById(id).style.visibility='visible';
		document.getElementById(id).style.display='block'; 
	}
}
//this.show = show;

// Hide by id
function hide(id){
	if (document.getElementById && document.getElementById(id) != null) {
		//this.log('[hide method - executing hide method for object id: ' +  id);  
		document.getElementById(id).style.visibility='hidden';
		document.getElementById(id).style.display='none';
	} 
}
//this.hide = hide;

// Toggle by id
function toggle(id) {
	if(document.getElementById(id).className == '' || document.getElementById(id).className == 'invisible') {
	   document.getElementById(id).className = 'visible';
	} else {
		document.getElementById(id).className = 'invisible';
	}
}


// Spindown control

function toggleSpinDown() 
{
 var bod = document.getElementsByTagName("body").item(0);
 var sect = document.getElementsByTagName("div");
 for(var i=0; i<sect.length; i++)
 {
  if(sect[i].className == "spindown-closed")  
  {
   sect[i].innerHTML = '<a class="link-spindown-closed" href="javascript:void(0)" onclick="javascript:checkSpinDown('+ i +')">&nbsp;</a>'  + sect[i].innerHTML   
  }
  else if(sect[i].className == "spindown-open")
  {
   sect[i].innerHTML = '<a class="link-spindown-open" href="javascript:void(0)" onclick="javascript:checkSpinDown('+ i +')">&nbsp;</a>'  + sect[i].innerHTML     
  }
 }
}
 
 
function checkSpinDown(i){
 var bod = document.getElementsByTagName("body").item(0);
 var sect = document.getElementsByTagName("div");    
 
 if(sect[i].className == "spindown-open") 
  sect[i].className = "spindown-closed";
 else
  sect[i].className = "spindown-open";    
}



// internal tabs
function writeTabStrip(tabs, t_id)
{
  // here we assign the default tab and page to be the first section at all times
  lastIntTab[t_id] = "tab_"+ t_id + "_1";
  lastIntDiv[t_id] = t_id + "_1";

  var t = '';
  t += '<div class="tabs" id="tabstrip_' + t_id + '">\r';
  for(var i=0; i<tabs.length; i++)
  {
    t += '<a id="tab_' + t_id + '_' + (i+1) + '" href="javascript:swapIntTab(\'tab_' + t_id + '_' + (i+1) + '\',\'' + t_id + '_' + (i+1) + '\',\'' + t_id +  '\')" class=';
    if((i+1) == 1)
      t += '"en"';
    else
      t += '"dn"';
    t += '>' + tabs[i] + '</a>\r';
  }
  t += '</div>\r';
  //alert(t);       // debug tab string
  document.write(t);
}

// swap tabs and divs
var lastIntTab = new Array()
var lastIntDiv = new Array()
 
function swapIntTab(tab,div,t_id)
{
  var t = document.getElementById(tab);
  var d = document.getElementById(div);
  if(t.className != "en")
  {
    // set selected tab as enabled
    t.className = "en";
    d.style.display = "block";
    // set last tab as inactive
    lt = document.getElementById(lastIntTab[t_id]);
    lt.className = "dn";
    // set last div hidden
    ld = document.getElementById(lastIntDiv[t_id]);
    ld.style.display = "none";
    // reset previously selected tab
    lastIntTab[t_id] = tab;
    lastIntDiv[t_id] = div;
  }
}

// Begin dropdown view switcher functions
// check for custom attribute in select and execute function
function checkActionTagCombo(combobox)
{
	// new approach using w3 dom to reference select options
	var s = document.getElementById(combobox);
	var o = s.getElementsByTagName("option");
	
	for(var i=0; i<o.length; i++)
	{
		if(o[i].selected == true)
		{
			// declare shortcut vars within loop
			var attrShow = o[i].getAttribute("show");
			var attrHide = o[i].getAttribute("hide");
			var attrWin = o[i].getAttribute("win");
			var attrPop = o[i].getAttribute("pop");
			var attrSwap = o[i].getAttribute("swap");
			
			if(attrShow)
				show(attrShow);
			else if(attrHide)
				hide(attrHide);
			else if(attrWin)
				win(attrWin,o[i].getAttribute("status"),o[i].getAttribute("resizable"),o[i].getAttribute("width"),o[i].getAttribute("height"));
			else if(attrPop)
				pop(attrPop,o[i].getAttribute("link"));
			else if(attrSwap)
				swap(attrSwap,o[i].getAttribute("swap"));
			else
				return false;
		}
	}
}

// generic window script
var winCounter = 0;

function win(url,status,resizable,width,height)
{
	winCounter++;
	var win = window.open(url,"win" + winCounter,"status=" + status + ",resizable=" + resizable + ",width=" + width + ",height=" + height);
	win.document.open();
	win.document.write('this is just a simple example of a pop up window. not the robust version.');
	win.document.write('<br /><br /><br /><center><a href="javascript:self.close()">close</a></center>');
	win.document.close();
	win.focus();
}

// PPK find left position
function findPosX(obj)
{
  var curleft = 0;
  if (obj.offsetParent)
  {
    while (obj.offsetParent)
    {
      curleft += obj.offsetLeft
      obj = obj.offsetParent;
    }
  }
  else if (obj.x)
    curleft += obj.x;
  return curleft;
}

// PPK find top position
function findPosY(obj)
{
  var curtop = 0;
  if (obj.offsetParent)
  {
    while (obj.offsetParent)
    {
      curtop += obj.offsetTop
      obj = obj.offsetParent;
    }
  }
  else if (obj.y)
    curtop += obj.y;
  return curtop;
}


// open sticky popup
function pop(popup,lnk)
{
  var p = document.getElementById(popup);
  var l = document.getElementById(lnk);
  var ypos = findPosY(l);
  var xpos = findPosX(l);
  
  show(popup);
  p.style.display = "block";
  p.style.left = (xpos + 500) + "px";
  p.style.top = (ypos + 20) + "px";
}

// Swap elements (based on groupid_uniqueid)
function swap(obj)
{	  
  var group = obj.substring(0,obj.indexOf("_"));
  var divColl = document.getElementsByTagName("div");
  
  // hide all group members
  for (i=0;i<divColl.length;i++){
  	if (divColl[i].id) {
		divId = divColl[i].id;
		if(divId.indexOf(group)!=-1){
			hide(divId);
		}
	}			  
  }
  
  // show selected item
  show(obj);
}

// End dropdown view switcher functions



// Begin Tree constructor

  /* Tree constructor
    Must be called after close of UL tag or on load.
    tree loads with all nodes closed.
    parameters:
      trunkId -> id of base UL
      openNodeIcon -> src of image to use for open nodes
      closedNodeIcon -> src of image to use for closed nodes
      emptyNodeIcon -> src of image to use for empty/data nodes
      indent -> how much indentation there is at each level.
      [deep] -> optional argument set true to force tree to parse all nodes on load

  */
function Tree(trunkId, openNodeIcon, closedNodeIcon, emptyNodeIcon, indent, deep){

  //properties
  this.openNodeIcon = new Image()
  this.openNodeIcon.src = openNodeIcon
  this.closedNodeIcon = new Image()
  this.closedNodeIcon.src = closedNodeIcon
  this.emptyNodeIcon = new Image()
  this.emptyNodeIcon.src = emptyNodeIcon
  this.trunkId = trunkId
  this.trunk = document.getElementById(trunkId)
  this.indent = indent
  this.deep = deep
  this.cellwidths = false;
  this.resizeCancel = false
  this.treeWidth = this.trunk.offsetWidth

  //methods
  this.treeInit = treeInitTree
  this.nodeInit = treeInitNode
  this.nodeClick = treeClickNode
  this.treeResize =  treeResizeTree
  this.trunk.tree = this

  this.treeInit(this.trunk)
  return this
}
function treeResizeTree(){
  var deepRestore = this.deep
  this.deep = true;
  this.treeWidth = this.trunk.offsetWidth
  this.treeInit(this.trunk)
  this.deep = deepRestore
}
// initialize a level of a tree.
// called from Tree constructor function
// Called internally from treeClickNode as tree is expanded.
function treeInitTree(tree){
  // if id passed get object

  if(tree.constructor == String){
    tree = document.getElementById(tree)
  }
  var children = tree.childNodes
  // find LI tags within tree and initialize them with treeInitNode
  for(var i=0;i<children.length;i++){
    var child = children[i]
    if(child.tagName == 'LI'){
      this.nodeInit(child)
    }
  }
}
// Called only internaly from treeInitTree
// decides weather node has children and inserts either a linked toggle image or a spacer.
// elm is a LI
function treeInitNode(elm){
  // nodeType will be 1 for html tags. treeToggle has no rules but is used to mark A or IMG tag inserted by this function.
  // this keeps the node from getting reinitialized.

  var looking = true;
  var depth = 0
  var lookingElm = elm.parentNode
  while(looking){
    if(lookingElm.id == this.trunkId){
      looking = false;

    }else{
      if(lookingElm.tagName == 'UL'){
        depth ++
      }
      lookingElm = lookingElm.parentNode
    }

  }


  var hasChild = false
  var children = elm.childNodes
  var table = false
  var addImage = true
  // if the LI contains an UL it will have a linked toggle image
  for(var i=0;i<children.length;i++){
    var child = children[i]
    if(child.tagName == 'TABLE'){
      table = child
      if(table.rows[0].cells[0].className != 'treeToggle'){
        var cell = table.rows[0].insertCell(0)
        cell.className = 'treeToggle';
      }else{
        addImage = false;
      }
    }
    if(child.tagName == 'IMG' && child.className == 'treeToggle'){
      addImage = false
    }
    if(child.tagName == 'A' && child.className  == 'treeToggle'){
      addImage = false
    }
    if(child.tagName == 'UL'){
      hasChild = true
      if(this.deep){
        if(child.style.display == 'block'){
          this.treeInit(child)
        }
      }
    }
  }

  if(hasChild && addImage){
    // This is a void A tag so the cursor will be a hand.
    // This is done because NS doesnt support the cursor attribute.
    var togglelnk = document.createElement('A')
    togglelnk.href = 'javascript:void(0)'
    togglelnk.className = 'treeToggle'
    // this is the actual image that gets switched to indicate state.
    var toggleimg = document.createElement('IMG')
    toggleimg.src = this.closedNodeIcon.src
    toggleimg.style.border = 0
    toggleimg.onclick = this.nodeClick
    // reference to the tree object for use by click function
    toggleimg.tree = this
    // insert image into link
    togglelnk.appendChild(toggleimg)
    // insert link before text of LI
    if(cell){
      cell.appendChild(togglelnk)
    }else{

      elm.insertBefore(togglelnk, elm.firstChild)
    }
  }else if(addImage){
    // if no child UL tags, set up image spacer to keep things lined up and insert as above.
    var toggleimg = document.createElement('IMG')
    toggleimg.src = this.emptyNodeIcon.src
    toggleimg.className = 'treeToggle'
    if(cell ){
      cell.appendChild(toggleimg)

    }else{
      elm.insertBefore(toggleimg, elm.firstChild)
    }
  }
  if(table){
    var availwidth = this.treeWidth - (depth * this.indent)
    table.style.width = availwidth

    var cellswidth = 0
    var cells = table.rows[0].cells;
    var stretchcell = false
      for(var i=0;i<cells.length;i++){
        if(cells[i].className == 'col_0'){
          stretchcell = cells[i]
        }else{
          cellswidth += cells[i].offsetWidth
        }
      }
  }
}
// attatched to the onclick event of the toggle image
function treeClickNode(){
  // the tree that the node is attatched to can be accessed by this.tree
  // the parent is the A tag and its parent is the LI
  var elm = this.parentNode
  while(elm.tagName!= 'LI'){
    elm = elm.parentNode;
  }
  var children = elm.childNodes
  var wasopen = false
  // find UL tags inside and toggle their display.
  // also record weather the node was open or closed
  for(var i=0; i<children.length;i++){
    var child = children[i]
    if(child.tagName == 'UL'){
      if(child.style.display == 'block'){
        child.style.display = 'none'
        wasopen = true
      }else{
        this.tree.treeInit(child)
        child.style.display = 'block'
      }
    }
  }
  // swap src of image to indicate new state.
  if(wasopen){
    this.src = this.tree.closedNodeIcon.src
  }else{
    this.src = this.tree.openNodeIcon.src
  }
  return false
}

// End Tree constructor



// Begin slideshow functions

/*
SlideShow Constructor.
Call onload with new operator for each instance.
params:
	id --> unique id of wrapper div
	delay --> default delay between slides in MS
	transition --> default transition between slides (simple, fade, slide)
	name --> variable that the reference to the object is being put into
	autoplay --> sets weather slideshow starts automaticaly or not (boolean)
*/

function slideShow(id, delay, transition, name, autoplay){
	this.id = id
	this.container = document.getElementById(id)
	// currentdelay changes if there is a delay attribute on the current slide
	this.defaultDelay = delay
	this.currentDelay = delay
	// name is used in timeouts and intervals to reference this object
	this.name = name
	// this collection is all the slides in the slideshow
	this.slides = this.container.getElementsByTagName('DIV')	
	this.slideCount = this.slides.length
	// currentslide and nextslide are used internaly to track transitions and playback
	this.currentSlide = 0
	this.nextSlide = 0
	// weather the slideshow is playing or not. this makes it possible to use the playback buttons without the slideshow continueing.
	this.playing = (autoplay)?true:false;
	// timeout is used to cancel slide changes by calling clearTimeout(this.timeout)
	this.timeout = false
	// interval is used to cancel slide transitions by callling clearInterval(this.interval)
	this.interval = false
	
	// METHODS -----------------------------------
	// looks at current slide for delay and transition parameters, sets currentTransition and currentDelay properties.
	this.getSlideParams = slideShowGetSlideParams
	// stops all transitions and displays current slide (returns true if a transition was canceled)
	this.clearActions = slideShowClearActions
	// advances to specific slide (zero based)
	this.showNumber = slideShowShowNumber
	// advances to next slide (pass true value to skip transition)
	this.showNext = slideShowShowNext
	// go to previous slide
	this.showPrevious = slideShowShowPrevious
	// go to first slide
	this.showFirst = slideShowShowFirst
	// go to last slide
	this.showLast = slideShowShowLast
	// stop playback
	this.showStop = slideShowStop
	// start playback
	this.showPlay = slideShowPlay
	// default transition function
	this.defaultTransition = eval('slideShowTransition_' + transition)
	// transition for current slide changes if there is a transition attribute for current slide.
	this.currentTransition = this.defaultTransition
	
	// starts playback if autoplay set to true
	if(this.playing){
		this.timeout = setTimeout(this.name + '.showNext()', this.currentDelay)
	}	

	// slideshow attatched to containter element, not currently used but good hook for other scripts.
	this.container.slideShow = this
	// container is returned
	return this
}

function slideShowShowNumber(number){
	// stop any activity
	this.clearActions()
	// set new slide to display
	this.nextSlide = number
	// use simple transition to instantly swap the slides
	this.currentTransition = slideShowTransition_simple;
	this.currentTransition()
}
function slideShowShowNext(fast){
	// stop activity and trap weather transition was canceled
	var canceled = this.clearActions()
	// if transition was canceled we delay for next slide or break if not playing.
	if(canceled){
		if(this.playing){
			this.timeout = setTimeout(this.name + '.showNext()', this.currentDelay)
		}
		return
	}
	// otherwise find next slide by testing for end of array
	if(this.currentSlide + 1 < this.slideCount){
		this.nextSlide = this.currentSlide + 1
	}else{
		this.nextSlide = 0
	}
	// use simple if called with fast argument.
	if(fast){
		this.currentTransition = slideShowTransition_simple;
	}
	this.currentTransition()
}
function slideShowShowPrevious(){
	// stop any activity
	this.clearActions()
	// find previous slide by testing for begining of array
	if(this.currentSlide - 1 >= 0){
		this.nextSlide = this.currentSlide - 1
	}else{
		this.nextSlide = this.slideCount - 1
	}
	// use simple transition to instantly switch slides
	this.currentTransition = slideShowTransition_simple;
	this.currentTransition()
}
function slideShowShowFirst(){
		// cancel activity set to 0 and execute simple transition
		this.clearActions()
		this.nextSlide = 0
		this.currentTransition = slideShowTransition_simple;
		this.currentTransition()
}
function slideShowShowLast(){
		// cancel activity set to slideCount -1 and execute simple transition
		this.clearActions()
		this.nextSlide = this.slideCount - 1
		this.currentTransition = slideShowTransition_simple;
		this.currentTransition()
}

function slideShowTransition_simple(){
	// this is the simple transition
	this.slides[this.currentSlide].style.visibility = 'hidden';
	this.slides[this.nextSlide].style.visibility = 'visible';
	// transition complete so we set currentsSlide to nextSlide
	this.currentSlide = this.nextSlide
	// test currentSlide for params.
	this.getSlideParams()
	// if play enabled timeout for next slide
	if(this.playing){
		this.timeout = setTimeout(this.name + '.showNext()', this.currentDelay)
	}
}
function slideShowTransition_fade(iteration){
	// this is the fading transition
	// sets increment for opacity (1 - 100)
	var step = 5
	// sets delay in ms between frames of animation
	var delay = 20
	// this function calls itself recursively, if iteration param is not se it is first run.
	if(iteration != true){
		// nextslide is layered above other slides
		this.slides[this.nextSlide].style.zIndex = 1;
		// nextslide opacity is set to 0
		setOpacity(this.slides[this.nextSlide], 0)
		// nextslide visibility set to visible
		this.slides[this.nextSlide].style.visibility = 'visible';
		// set up interval to call this function with delay above
		this.interval = setInterval(this.name + '.currentTransition(true)', delay)
		return
	}else{
		// this is executed when looping
		// op is a property of the element created by the setOpacity function for compatibility reasons.
		var op = this.slides[this.nextSlide].op
		// increnment op
		op += step
		// if 100 or more we finish the transition
		if(op >= 100){
			 // set opacity to 100
			 setOpacity(this.slides[this.nextSlide], 100)
			 // hide old current slide
			 this.slides[this.currentSlide].style.visibility = 'hidden';
			 // push new slide back to 0 index
			 this.slides[this.nextSlide].style.zIndex = 0;
			 // cancel loop
			 if(this.interval){
			 	 clearInterval(this.interval)
			 	 this.interval = false
			 }
		}else{
			// otherwise we set the opacity and loop again
			setOpacity(this.slides[this.nextSlide], op)
			return
		}
	}
	// transition complete so we set currentsSlide to nextSlide
	this.currentSlide = this.nextSlide
	// test currentSlide for params.
	this.getSlideParams()
	// if play enabled timeout for next slide
	if(this.playing){
		this.timeout = setTimeout(this.name + '.showNext()', this.currentDelay)
	}
}

function slideShowTransition_slide(iteration){
	// this is the sliding transition
	// increment for location
	var step = 5
	// delay between animation frames
	var delay = 20
	// this function calls itself recursively so if iteration not set, this is first call
	if(iteration != true){
		// set next slide to display in front
		this.slides[this.nextSlide].style.zIndex = 1;
		// push current slide to back
		this.slides[this.currentSlide].style.zIndex = 0;
		// set next slide to off screen and visible
		var nextSlide = this.slides[this.nextSlide]
		nextSlide.style.left = 0 - nextSlide.offsetWidth
		nextSlide.style.visibility = 'visible';
		// set interval to run animation
		this.interval = setInterval(this.name + '.currentTransition(true)', delay)
		return
	}else{
		// get left and add increment
		var left = parseInt(this.slides[this.nextSlide].style.left)
		left += step
		// if 0 or greater we are done and finish the animation
		if(left >= 0){
			 // set left to 0
			 this.slides[this.nextSlide].style.left = 0
			 // hide old slide
			 this.slides[this.currentSlide].style.visibility = 'hidden';
			 // push new slide back to 0 zIndex
			 this.slides[this.nextSlide].style.zIndex = 0;
			 // cancel loop
			 if(this.interval){
			 	 clearInterval(this.interval)
			 	 this.interval = false
			 }
		}else{
			// otherwise increment left and loop
			this.slides[this.nextSlide].style.left = left
			return
		}
	}
	// transition complete so we set currentsSlide to nextSlide
	this.currentSlide = this.nextSlide
	// test currentSlide for params.
	this.getSlideParams()
	// if play enabled timeout for next slide
	if(this.playing){
		this.timeout = setTimeout(this.name + '.showNext()', this.currentDelay)
	}
}
// checks currentslide for delay and transition attributes.
function slideShowGetSlideParams(){
	var slide = this.slides[this.currentSlide]
	this.currentDelay = this.defaultDelay
	if(slide.getAttribute('delay')){
		this.currentDelay = slide.getAttribute('delay')
	}
	this.currentTransition = this.defaultTransition
	if(slide.getAttribute('transition')){
		this.currentTransition = eval('slideShowTransition_' + slide.getAttribute('transition'))
	}
}
// sets all slides to default position visibility and opacity.
// returns true if there was a transition in progress.
// return value used by showNext to keep from skipping slides.
function slideShowClearActions(){
	// return value
	var canceled = false
	// if interval not false we are in a transition
	if(this.interval){
		// transition is canceled and slide advanced
		clearInterval(this.interval)
		this.interval = false
		this.currentSlide = this.nextSlide
		// return value set true
		canceled = true
	}
	// loop through slides and set to default styles
	for(i=0;i<this.slides.length;i++){
		var slide = this.slides[i]
		// if currentslide show, otherwise hide.
		if(i == this.currentSlide){
			slide.style.visibility = 'visible';
		}else{
			slide.style.visibility = 'hidden';
		}
		// test op before setting to reduce ns funniness
		if(slide.op != 100)	setOpacity(slide, 100);
		slide.style.top = 0
		slide.style.left = 0
		slide.style.zIndex = 0;
	}
	// if timeout not false a slide change is in the works, so we cancel it.
	if(this.timeout){
		clearTimeout(this.timeout)
		this.timeout = false
	}
	// test currentSlide for delay and transition attributes
	this.getSlideParams()
	return canceled
}
// sets playing to true and starts animation if it wasn't already going.
function slideShowPlay(){
	this.playing = true
	if(this.interval){
		return
	}else{
		this.clearActions()
		this.showNext()
	}
}
// sets playing to false and stops animation
function slideShowStop(){
	this.playing = false
	this.clearActions()
}

// sets opacity for elements. created because netscape and ie have different methods of applying opacity.
// note that filter has to be set in stylesheet for the element that will use it.
function setOpacity(elm, opacity){
		elm.op = opacity
		var nn6= (document.getElementById && !document.all)?true:false;
		var ie5= (document.all && document.getElementById)?true:false;
		if(ie5){			
			elm.filters.alpha.opacity = opacity
		}
		if(nn6){
			elm.style.MozOpacity = opacity / 100
		}
	}

// End slideshow functions