/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* Last updated Mar 15th, 04'. Added "End of Gallery" message.
* This copyright notice must stay intact for legal use
***********************************************/

////NO NEED TO EDIT BELOW THIS LINE////////////

var scrollspeed1=0
var movestate1=""

var actualwidth1=''
var cross_scroll1, ns_scroll1
var loadedyes1=0

function ietruebody1(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function creatediv1(){
statusdiv1=document.createElement("div")
statusdiv1.setAttribute("id","statusdiv1")
document.body.appendChild(statusdiv1)
statusdiv1=document.getElementById("statusdiv1")
statusdiv1.innerHTML=endofgallerymsg
}

function positiondiv1(){
menuheight1=parseInt(crossmain1.offsetHeight)
mainobjoffset1H1=getposOffset(crossmain1, "top")
statusdiv1.style.left=mainobjoffset1+(menuwidth1/2)-(statusdiv1.offsetWidth/2)+"px"
statusdiv1.style.top=menuheight1+mainobjoffset1H1+"px"
}

function showhidediv1(what){
if (endofgallerymsg!="")
statusdiv1.style.visibility=what
}

function moveleft1(){
if (loadedyes1){
movestate1="left"
if (iedom&&parseInt(cross_scroll1.style.left)>(menuwidth1-actualwidth1)){
cross_scroll1.style.left=parseInt(cross_scroll1.style.left)-scrollspeed1+"px"
showhidediv1("hidden")
}
else
showhidediv1("visible")
}
lefttime=setTimeout("moveleft1()",10)
}

function moveright1(){
if (loadedyes1){
movestate1="right"
if (iedom&&parseInt(cross_scroll1.style.left)<0){
cross_scroll1.style.left=parseInt(cross_scroll1.style.left)+scrollspeed1+"px"
showhidediv1("hidden")
}
else
showhidediv1("visible")
}
righttime=setTimeout("moveright1()",10)
}

function motionengine1(e){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody1().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody1().scrollTop;
var curposy=window.event? event.clientX : e.clientX? e.clientX: ""
curposy-=mainobjoffset1-dsocx
var leftbound=(menuwidth1-restarea)/2
var rightbound=(menuwidth1+restarea)/2
if (curposy>rightbound){
scrollspeed1=(curposy-rightbound)/((menuwidth1-restarea)/2) * maxspeed
if (window.righttime) clearTimeout(righttime)
if (movestate1!="left") moveleft1()
}
else if (curposy<leftbound){
scrollspeed1=(leftbound-curposy)/((menuwidth1-restarea)/2) * maxspeed
if (window.lefttime) clearTimeout(lefttime)
if (movestate1!="right") moveright1()
}
else
scrollspeed1=0
}

function stopmotion1(e){
if ((window.event&&!crossmain1.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
movestate1=""
}
}

function fillup1(){
if (iedom){
crossmain1=document.getElementById? document.getElementById("motioncontainer1") : document.all.motioncontainer1
menuwidth1=parseInt(crossmain1.style.width)
mainobjoffset1=getposOffset(crossmain1, "left")
cross_scroll1=document.getElementById? document.getElementById("motiongallery1") : document.all.motiongallery1
actualwidth1=document.all? cross_scroll1.offsetWidth : document.getElementById("trueContainer1").offsetWidth1

crossmain1.onmousemove=function(e){
motionengine1(e)
}

crossmain1.onmouseout=function(e){
stopmotion1(e)
showhidediv1("hidden")
}
}
loadedyes1=1
if (endofgallerymsg!=""){
creatediv1()
positiondiv1()
}
}
//window.onload=fillup1