/***********************************************
* Scribblers Club version based on...
* 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
***********************************************/

var iedom=document.all||document.getElementById
var scrollspeed=0
var movestate=""
var movestate2=""
var actualwidth=''
var actualwidth2=''
var cross_scroll, ns_scroll, cross_scroll2, ns_scroll2
var loadedyes=0
var loadedyes2=0

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

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"
scrollspeed = 6;
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
}
lefttime=setTimeout("moveleft()",10)
}
}

function moveleft2(){
if (loadedyes2){
movestate2="left"
scrollspeed = 3
if (iedom&&parseInt(cross_scroll2.style.left)>(menuwidth2-actualwidth2)){
cross_scroll2.style.left=parseInt(cross_scroll2.style.left)-scrollspeed+"px"
}
lefttime2=setTimeout("moveleft2()",10)
}
}

function moveright(){
if (loadedyes){
movestate="right"
scrollspeed = 6
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
}
righttime=setTimeout("moveright()",10)
}
}

function moveright2(){
if (loadedyes2){
movestate2="right"
scrollspeed = 3
if (iedom&&parseInt(cross_scroll2.style.left)<0){
cross_scroll2.style.left=parseInt(cross_scroll2.style.left)+scrollspeed+"px"
}
righttime2=setTimeout("moveright2()",10)
}
}

function stopmotion(){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
movestate=""
}

function stopmotion2(){
if (window.lefttime2) clearTimeout(lefttime2)
if (window.righttime2) clearTimeout(righttime2)
movestate2=""
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer
menuwidth=parseInt(crossmain.style.width)
mainobjoffset=getposOffset(crossmain, "left")
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("trueContainer").offsetWidth
}
loadedyes=1
}

function fillup2(){
if (iedom){
crossmain2=document.getElementById? document.getElementById("motioncontainer2") : document.all.motioncontainer2
menuwidth2=parseInt(crossmain2.style.width)
mainobjoffset2=getposOffset(crossmain2, "left")
cross_scroll2=document.getElementById? document.getElementById("motiongallery2") : document.all.motiongallery2
actualwidth2=document.all? cross_scroll2.offsetWidth : document.getElementById("trueContainer2").offsetWidth
}
loadedyes2=1
}