function testscramble(){

}

function infoscramble(){
	 var a,b,c,d,e,f,g,h,i
	
	a='<a class="headerLink" style="float:right" href="mai'
	b='info'
	c='\">'
	a+='lto:'
	b+='@'
	d='Email us'
	e='</a>'
	b+='prairiearchaeology.com'
		
	document.write(a+b+c+d+e)
}

function webmasterscramble(){
	var a,b,c,d,e
	a='<a href=\"mai'
	b='webmaster'
	c='\">'
	a+='lto:'
	b+='@'
	e='</a>'
	d='webmaster'
	b+='prairiearchaeology.com'
		
	document.write(a+b+c+d+e)
}


function staffscramble( msg, ename ){
	var a,b,c,d,e
	a='<a href=\"mai'
	b=ename
	c='\">'
	a+='lto:'
	b+='@'
	e='</a>'
	d=msg
	b+='prairiearchaeology.com'
		
	document.write(a+b+c+d+e)
}


function toggleReveal(currentReveal) {
	if (document.getElementById) {
		thisReveal = document.getElementById(currentReveal).style
		if (thisReveal.display == "block") {
			thisReveal.display = "none"
		}
		else {
			thisReveal.display = "block"
		}
		return false
	}
	else {
		return true
	}
}

function expandAllReveals(){
	if (document.getElementsByClassName) {
		x = document.getElementsByClassName("reveal" );
		
		//alert("There are " + x.length + " revealables.");
		
		for (var i=0; i<x.length; i++){
			
			x[i].style.display = "block"
		}
		
		return false
	}
	else{
		return true
	}
}

function contractAllReveals(){
	if (document.getElementsByClassName) {
		x = document.getElementsByClassName("reveal" );
		
		//alert("There are " + x.length + " revealables.");
		
		for (var i=0; i<x.length; i++){
			
			x[i].style.display = "none"
		}
		
		return false
	}
	else{
		return true
	}
}


function changeSlide( direction ){
	if ( document.images){
		
		if ( (direction == 1) || (direction == -1) ){
			thisPic = thisPic + direction;
			
			if ( thisPic > imgCt )
				thisPic = imgCt;
			
			if ( thisPic < 0 )
				thisPic = 0;
			
			thisText = thisText + direction;
			
			if ( thisText > txtCt )
				thisText = txtCt;
			
			if ( thisText < 0 )
				thisText = 0;
		}
		else{
			thisPic = direction;
			thisText = direction;
		}
		
		document.slidePicture.src = slidePixArray[thisPic];
		document.slideText.ta.value = slideTxtArray[thisText];
	}
}


/*
 * Get mouse event coordinate converted to canvas coordinate
 * c: The canvas object
 * e: A mouse event
 */
function toCanvasX(c, e) {
  var posx = 0;

  if (e.pageX)   {
    posx = e.pageX;
  } else if (e.clientX)   {
    posx = e.clientX + document.body.scrollLeft
      + document.documentElement.scrollLeft;
  }
  posx = posx - c.offsetLeft;
  return posx;
}

function toCanvasY(c, e) {
  var posy = 0;

  if (e.pageY)   {
    posy = e.pageY;
  } else if (e.clientY)   {
    posy = e.clientY + document.body.scrollTop
      + document.documentElement.scrollTop;
  }
  posy = posy - c.offsetTop;

  return posy;
}

