function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		button_1_over = newImage("/images/mainbar_b1_over.gif");
		button_2_over = newImage("/images/mainbar_b2_over.gif");
		button_3_over = newImage("/images/mainbar_b3_over.gif");
		button_4_over = newImage("/images/mainbar_b4_over.gif");
		preloadFlag = true;
	}
}

/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* This copyright notice must stay intact for legal use
* Modified for autowidth and optional starting positions in
* http://www.dynamicdrive.com/forums/showthread.php?t=11839 by jschuer1 8/5/06
***********************************************/

 //1) Set width of the "neutral" area in the center of the gallery.
var restarea=6;
 //2) Set top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var maxspeed=7;
 //3) Set to maximum width for gallery - must be less than the actual length of the image train.
var maxwidth=303;
 //4) Set to 1 for left start, 0 for right, 2 for center.
var startpos=0;
 //5) Set message to show at end of gallery. Enter "" to disable message. <span style="font-size: 11px;">End of Gallery</span>
var endofgallerymsg='';

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
var actualHeight=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById, scrollspeed=0, movestate='', actualwidth='', cross_scroll, ns_scroll, statusdiv, loadedyes=0, lefttime, righttime;

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}

function positiondiv(){
var mainobjoffset=getposOffset(crossmain, "left"),
menuheight=parseInt(crossmain.offsetHeight),
mainobjoffsetH=getposOffset(crossmain, "top");
statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px";
statusdiv.style.top=menuheight+mainobjoffsetH+"px";
}

function showhidediv(what){
if (endofgallerymsg!="") {
positiondiv();
statusdiv.style.visibility=what;
}
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function moveleft(){
if (loadedyes){
movestate="left";
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px";
showhidediv("hidden");
}
else
showhidediv("visible");
}
lefttime=setTimeout("moveleft()",10);
}

function moveright(){
if (loadedyes){
movestate="right";
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px";
showhidediv("hidden");
}
else
showhidediv("visible");
}
righttime=setTimeout("moveright()",10);
}

function motionengine(e){
var mainobjoffset=getposOffset(crossmain, "left"),
dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft,
dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop,
curposy=window.event? event.clientX : e.clientX? e.clientX: "";
curposy-=mainobjoffset-dsocx;
var leftbound=(menuwidth-restarea)/2;
var rightbound=(menuwidth+restarea)/2;
if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restarea)/2) * maxspeed;
clearTimeout(righttime);
if (movestate!="left") moveleft();
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed;
clearTimeout(lefttime);
if (movestate!="right") moveright();
}
else
scrollspeed=0;
}

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
clearTimeout(lefttime);
clearTimeout(righttime);
movestate="";
}
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer;
if(typeof crossmain.style.maxWidth!=='undefined')
crossmain.style.maxWidth=maxwidth+'px';
menuwidth=crossmain.offsetWidth;
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.getElementById? document.getElementById("trueContainer").offsetWidth : document.all['trueContainer'].offsetWidth;
if (startpos)
cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';
crossmain.onmousemove=function(e){
motionengine(e);
}

crossmain.onmouseout=function(e){
stopmotion(e);
showhidediv("hidden");
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv();
positiondiv();
}
if (document.body.filters)
onresize()

if (iedom2){
crossmain2=document.getElementById? document.getElementById("motioncontainer2") : document.all.motioncontainer2
menu_height2=parseInt(crossmain2.style.height)
mainobjoffset2=getposOffset(crossmain2, "top")
cross_scroll2=document.getElementById? document.getElementById("motiongallery2") : document.all.motiongallery2
actualheight2=cross_scroll2.offsetHeight

crossmain2.onmousemove=function(e){
motionengine2(e)
}

crossmain2.onmouseout=function(e){
stopmotion2(e)
showhidediv2("hidden")
}
}
if (window.opera){
cross_scroll2.style.top=menu_height2-actualheight2+'px'
setTimeout('cross_scroll2.style.top=0', 10)
}
loadedyes2=1
if (endofgallerymsg!=""){
creatediv2()
positiondiv2()
}
preloadImages()
}

window.onload=fillup

onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0";
motioncontainer.style.width="";
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, maxwidth)+'px';
}
menuwidth=crossmain.offsetWidth;
cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;
}

var restarea2=6 //1) width of the "neutral" area in the center of the gallery in px
var maxspeed2=7 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed.
//var endofgallerymsg2="<span style='font-size: 11px'>End of Gallery</span>" //3) message to show at end of gallery. Enter "" to disable message.

function enlargeimage2(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth2=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
var actualHeight2=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
var winattributes2="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom2=document.all||document.getElementById
var scrollspeed2=0
var movestate2=""

var actualheight2=''
var cross_scroll2
var loadedyes2=0

function ietruebody2(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function creatediv2(){
statusdiv2=document.createElement("div")
statusdiv2.setAttribute("id","statusdiv2")
document.body.appendChild(statusdiv2)
statusdiv2=document.getElementById("statusdiv2")
statusdiv2.innerHTML=endofgallerymsg
}

function positiondiv2(){
menuwidth2=parseInt(crossmain2.offsetWidth)
mainobjoffsetW2=getposOffset(crossmain2, "left")
statusdiv2.style.left=mainobjoffsetW2+(menuwidth2/2)-(statusdiv2.offsetWidth2/2)+"px"
statusdiv2.style.top=menu_height2+mainobjoffset2+10+"px"
}

function showhidediv2(what){
if (endofgallerymsg!="")
statusdiv2.style.visibility=what
}

function getposOffset2(what, offsettype){
var totaloffset2=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl2=what.offsetParent;
while (parentEl2!=null){
totaloffset2=(offsettype=="left")? totaloffset2+parentEl2.offsetLeft : totaloffset2+parentEl2.offsetTop;
parentEl2=parentEl2.offsetParent;
}
return totaloffset2;
}


function moveup2(){
if (loadedyes2){
movestate2="up"
if (iedom2&&parseInt(cross_scroll2.style.top)>(menu_height2-actualheight2)){
cross_scroll2.style.top=parseInt(cross_scroll2.style.top)-scrollspeed2+"px"
showhidediv2("hidden")
}
else
showhidediv2("visible")
}
uptime2=setTimeout("moveup2()",10)
}

function movedown2(){
if (loadedyes2){
movestate2="down"
if (iedom2&&parseInt(cross_scroll2.style.top)<0){
cross_scroll2.style.top=parseInt(cross_scroll2.style.top)+scrollspeed2+"px"
showhidediv2("hidden")
}
else
showhidediv2("visible")
}
downtime2=setTimeout("movedown2()",10)
}

function motionengine2(e){
var dsocx2=(window.pageXOffset)? pageXOffset: ietruebody2().scrollLeft;
var dsocy2=(window.pageYOffset)? pageYOffset : ietruebody2().scrollTop;
var curposy2=window.event? event.clientY : e.clientY? e.clientY: ""
curposy2-=mainobjoffset2-dsocy2
var leftbound2=(menu_height2-restarea2)/2
var rightbound2=(menu_height2+restarea2)/2
if (curposy2>rightbound2){
scrollspeed2=(curposy2-rightbound2)/((menu_height2-restarea2)/2) * maxspeed2
if (window.downtime2) clearTimeout(downtime2)
if (movestate2!="up") moveup2()
}
else if (curposy2<leftbound2){
scrollspeed2=(leftbound2-curposy2)/((menu_height2-restarea2)/2) * maxspeed2
if (window.uptime2) clearTimeout(uptime2)
if (movestate2!="down") movedown2()
}
else
scrollspeed2=0
}

function contains_ns62(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion2(e){
if ((window.event&&!crossmain2.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns62(e.currentTarget, e.relatedTarget))){
if (window.downtime2) clearTimeout(downtime2)
if (window.uptime2) clearTimeout(uptime2)
movestate2=""
}
}

function fillup2(){
if (iedom2){
crossmain2=document.getElementById? document.getElementById("motioncontainer2") : document.all.motioncontainer2
menu_height2=parseInt(crossmain2.style.height)
mainobjoffset2=getposOffset(crossmain2, "top")
cross_scroll2=document.getElementById? document.getElementById("motiongallery2") : document.all.motiongallery2
actualheight2=cross_scroll2.offsetHeight

crossmain2.onmousemove=function(e){
motionengine2(e)
}

crossmain2.onmouseout=function(e){
stopmotion2(e)
showhidediv2("hidden")
}
}
if (window.opera){
cross_scroll2.style.top=menu_height2-actualheight2+'px'
setTimeout('cross_scroll2.style.top=0', 10)
}
loadedyes2=1
if (endofgallerymsg!=""){
creatediv2()
positiondiv2()
}
}

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/imagebar_champs.jpg", "", ""] //plain image syntax
fadeimages[1]=["images/mainbar_mulcher.jpg", "", ""] //image with link and target syntax
fadeimages[2]=["images/imagebar_stankygear.jpg", "", ""] //image with link and target syntax
fadeimages[3]=["images/mainbar_herbgirl.jpg", "", ""] //image with link syntax

var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax

var fadebgcolor="black"
var fadebgimageurl = "/images/mainbar_content.jpg"
////NO need to edit beyond here/////////////

var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers

var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
var fadetmout
var fadeintrvl

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
//if (typeof displayorder!="undefined")
//theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}

var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2

if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;background-image: url('+fadebgimageurl+');"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-image: url('+fadebgimageurl+');"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-image: url('+fadebgimageurl+');"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+fadebgimageurl+'"></div>')

if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
fadeintrvl=setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
fadetmout=setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}

fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}


fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
fadetmout=setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
//confirm('Image Rotated')
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}

fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}


fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}



