
/***********************************************
* OO_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
* Object Oriented update 9/19/06
***********************************************/

// With:

/***********************************************
* Thumbnail Viewer III modified from
* Ultimate Fade-In Slideshow (v1.5) & Thumbnail Viewer II:
* both © Dynamic Drive (http://www.dynamicdrive.com)
* modified by jscheuer1 in http://www.dynamicdrive.com/forums
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

// Combination Modifications by jscheuer1 6/30/07

 // Set message to show at end of gallery(s). Enter "" to disable message.
var endofgallerymsg="";


var dynimages=new Array()
dynimages.usespace=0;
dynimages.capid='cap1';
//SET IMAGE PATHS. Extend or contract array as needed
//"Thumnail for Gallery", "Large Image", "optional_link", "optional_target"
//link and target are for large image
dynimages[0]=["GuyanaThumb-2.jpg", "Guyana-2.jpg", "", "", "Bushmasters Guyana", "I returned to Guyana in September 2008, again with Bushmasters on their venture trip to the Kanuku mountains near Lethem. This time I got to see the Kaieteur falls."] 
dynimages[1]=["GuyanaThumb-6.jpg", "Guyana-6.jpg", "", "", "Bushmasters Guyana", "On the first day, we flew in a small plane from Georgetown to Kaieteur (and back). The falls are magnificent. A rainbow forms at the bottom of the falls from time to time."] 
dynimages[2]=["GuyanaThumb-5.jpg", "Guyana-5.jpg", "", "", "Bushmasters Guyana", "The group was Graham Munday, Sam Thomas, Andy Thorogood , Steve Eynon, Adam McCarthy and me. That's Steve on the rock with the falls behind him."] 
dynimages[3]=["GuyanaThumb-4.jpg", "Guyana-4.jpg", "", "", "Bushmasters Guyana", "The forested gorge leading from the falls is very impressive too."] 
dynimages[4]=["GuyanaThumb-3.jpg", "Guyana-3.jpg", "", "", "Bushmasters Guyana", "Little golden frogs live in the giant tank bromeliads that grow beside the falls."] 
dynimages[5]=["GuyanaThumb-7.jpg", "Guyana-7.jpg", "", "", "Bushmasters Guyana", "We then took the overnight bus from Georgetown to Lethem. It's a long, long journey of 15 hours or so, and any sleep is interrupted by police check stops, and the bus getting stuck in the mud and deep ruts from time to time."]  
dynimages[6]=["GuyanaThumb-1.jpg", "Guyana-1.jpg", "", "", "Bushmasters Guyana", "The next morning we drove an hour or so to Nappi village, followed by a two hour walk into the jungle to their Eco Lodge. I think this colourful grasshopper was spotted on the walk in."] 
dynimages[7]=["GuyanaThumb-8.jpg", "Guyana-8.jpg", "", "", "Bushmasters Guyana", "After a night at the lodge, we set off into the Kanuku mountains on an eight day circuit through the jungle via Jordan falls and Panna falls."] 
dynimages[8]=["GuyanaThumb-9.jpg", "Guyana-9.jpg", "", "", "Bushmasters Guyana", "This is the camp at Jordan falls, with (L to R) Ian, Adam and Sam sitting on our hand-machete-made bench and Steve standing next to the fire."] 
dynimages[9]=["GuyanaThumb-10.jpg", "Guyana-10.jpg", "", "", "Bushmasters Guyana", "At Jordan falls, we abseiled down one of the tributary waterfalls."] 
dynimages[10]=["GuyanaThumb-11.jpg", "Guyana-11.jpg", "", "", "Bushmasters Guyana", "Abseiling backwards is OK, though with all the water around, the rocks are pretty slippery. I found abseiling forwards to be much more difficult as you have to lean forwards a lot to be perpendicular to the cliff so as not to slip. This is quite scary when you are looking down."] 
dynimages[11]=["GuyanaThumb-12.jpg", "Guyana-12.jpg", "", "", "Bushmasters Guyana", "The guides spotted a bushmaster snakea bout 30m from our hammocks at the Jordan falls camp. The bushmaster is one of the largest and most dangerous snakes in South America, which is capable of multiple bite strikes and injecting large amounts of highly poisonous venom."] 
dynimages[12]=["GuyanaThumb-13.jpg", "Guyana-13.jpg", "", "", "Bushmasters Guyana", "These snakes see in heat vision, so it was likely that it would be attracted closer to our body heat and cooking fire, thus it was decided to kill it to be on the safe side. A guide beat it to death with a long thick stick from a safe distance."] 
dynimages[13]=["GuyanaThumb-14.jpg", "Guyana-14.jpg", "", "", "Bushmasters Guyana", "It was beheaded, skinned and cooked (not much meat and rather bony). We then set off again, back into the jungle. The terrain is constant up and down, with thick vegetation, so it can be very slow going. At one point we only progressed a few hundred metres in one hour!"] 
dynimages[14]=["GuyanaThumb-17.jpg", "Guyana-17.jpg", "", "", "Bushmasters Guyana", "We stopped for the night by the river. You can feel the primeval life of the forest around you whether walking in the day or cocooned in your hammock at night, through the surrounding sounds, smells and sights."] 
dynimages[15]=["GuyanaThumb-16.jpg", "Guyana-16.jpg", "", "", "Bushmasters Guyana", "The stunning river and rock scenery at Panna falls. Washing in the river was cold but refreshing after a day's sweaty exertions."] 
dynimages[16]=["GuyanaThumb-18.jpg", "Guyana-18.jpg", "", "", "Bushmasters Guyana", "We saw several tarantula spiders along the way, of slightly different colours, This was the most reddish one."] 
dynimages[17]=["GuyanaThumb-15.jpg", "Guyana-15.jpg", "", "", "Bushmasters Guyana", "On the way back to Nappi village Eco Lodge. Balancing on logs is no easy feat with a heavy rucksack."] 
dynimages[18]=["GuyanaThumb-19.jpg", "Guyana-19.jpg", "", "", "Bushmasters Guyana", "Near the lodge we ascended a tree. This looks easy enough when demonstrated, but it is incredibly physically exhausting, having to haul up your entire body weight over and over again. I don't think I sweated as much throughout the entire trip. The fun part is abseiling down again in one heart-stopping freefall!"] 
dynimages[19]=["GuyanaThumb-20.jpg", "Guyana-20.jpg", "", "", "Bushmasters Guyana", "David and his son Mattheus were our Amerindien guides for the next part of the trip. Near their village, they had caught a mountain caiman."] 
dynimages[20]=["GuyanaThumb-21.jpg", "Guyana-21.jpg", "", "", "Bushmasters Guyana", "Adam and Sam giving the caiman some love."] 
dynimages[21]=["GuyanaThumb-25.jpg", "Guyana-25.jpg", "", "", "Bushmasters Guyana", "We walked up river for several days and camped here, just below James mountain. In this photo, we're waiting for the water to boil, something you do a lot of on this trip ;) "] 
dynimages[22]=["GuyanaThumb-22.jpg", "Guyana-22.jpg", "", "", "Bushmasters Guyana", "We climbed up James mountain ... "] 
dynimages[23]=["GuyanaThumb-23.jpg", "Guyana-23.jpg", "", "", "Bushmasters Guyana", "... for some great views of the forested Kanuku mountains on one side, and the Rupunini savannah on the other side..."] 
dynimages[24]=["GuyanaThumb-24.jpg", "Guyana-24.jpg", "", "", "Bushmasters Guyana", "... the humidity is much less on top, as there is a constant cool breeze, so it's a very pleasant micro-climate to spend a few hours sunbathing and drinking in the scenery."] 
dynimages[25]=["GuyanaThumb-26.jpg", "Guyana-26.jpg", "", "", "Bushmasters Guyana", "We walked out of the mountain jungles and across the savannah to be picked up and driven to Lethem."] 
dynimages[26]=["GuyanaThumb-27.jpg", "Guyana-27.jpg", "", "", "Bushmasters Guyana", "Group photo in front of the mountains we'd trekked through, (L to R) Sam, Steve, Adam, Mattheus, Me, Graham, David."] 
dynimages[27]=["GuyanaThumb-29.jpg", "Guyana-29.jpg", "", "", "Bushmasters Guyana", "Back in Lethem, we spent an afternoon riding Ian's horses ... "] 
dynimages[28]=["GuyanaThumb-30.jpg", "Guyana-30.jpg", "", "", "Bushmasters Guyana", "... and playing cowboy."] 
dynimages[29]=["GuyanaThumb-28.jpg", "Guyana-28.jpg", "", "", "Bushmasters Guyana", "My first time on a horse! Thanks again to Ian Craddock and Sarah Jones at Bushmasters for another memorable trip."] 

var fadebgcolor="white"

////NO need to edit beyond here/////////////


function displayarea(theimages, fadewidth, fadeheight, borderwidth){
if(!displayarea.fadearray){
displayarea.fadearray=new Array() //array to cache displayarea instances
displayarea.fadeclear=new Array() //array to cache corresponding clearinterval pointers
}
this.flag=1
this.capid=theimages.capid;
this.dom=(document.getElementById) //modern dom browsers
this.iebrowser=document.all
this.pausecheck=0
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
displayarea.fadearray[displayarea.fadearray.length]=this
this.slideshowid=displayarea.fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
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][1]
}

var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2

if (this.iebrowser&&this.dom||this.dom) {//if IE5+ or modern browsers (ie: Firefox)
var opacity_string=document.body.filters? 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);' : typeof document.body.style.opacity=='string'? 'opacity:1;' : typeof document.body.style.MozOpacity=='string'? '-moz-opacity:1;' : typeof document.body.style.KhtmlOpacity=='string'? '-khtml-opacity:1;' : '';
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;'+opacity_string+'background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;'+opacity_string+'background-color:'+fadebgcolor+'"></div></div>');
if(this.capid){
document.write('<div id="'+this.capid+'">'+(theimages[0][5]? theimages[0][5] : '&nbsp;')+'</div>');
this.caparea=document.getElementById(this.capid);
}
}
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')

if (this.iebrowser&&this.dom||this.dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("displayarea.fadearray["+this.slideshowid+"].rotateimage()", 100)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=5
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(displayarea.fadeclear[obj.slideshowid])
obj.pausecheck=obj.flag=1;
}
}

displayarea.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][2]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][2]+'" target="'+this.theimages[picindex][3]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][2]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}


displayarea.prototype.rotateimage=function(){
var cacheobj=this
if (this.pausecheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (this.iebrowser&&this.dom||this.dom){
this.resetit()
var crossobj=this.tempobj=this.iebrowser? this.iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
displayarea.fadeclear[this.slideshowid]=setInterval("fadepic(displayarea.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
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}

displayarea.prototype.resetit=function(){
this.degree=10
var crossobj=this.iebrowser? this.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
}


displayarea.prototype.startit=function(){
var crossobj=this.iebrowser? this.iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
var cacheobj=this
this.rotateimage()
}

function switchFade(iNum, slideId){
var slideIdNum
if (typeof slideId=='number')
slideIdNum=slideId
else
for (var i_tem = 0; i_tem < displayarea.fadearray.length; i_tem++)
if (displayarea.fadearray[i_tem].theimages==slideId)
slideIdNum=i_tem
if (displayarea.fadearray[slideIdNum].flag){
clearInterval(displayarea.fadearray[slideIdNum].wait)
displayarea.fadearray[slideIdNum].flag=0
clearInterval(displayarea.fadeclear[slideIdNum])
displayarea.fadearray[slideIdNum].pausecheck=0
displayarea.fadearray[slideIdNum].nextimageindex=iNum
displayarea.fadearray[slideIdNum].nextcanvas=(displayarea.fadearray[slideIdNum].curcanvas==displayarea.fadearray[slideIdNum].canvasbase+"_0")? displayarea.fadearray[slideIdNum].canvasbase+"_0" : displayarea.fadearray[slideIdNum].canvasbase+"_1"
displayarea.fadearray[slideIdNum].tempobj=document.all? document.all[displayarea.fadearray[slideIdNum].nextcanvas] : document.getElementById(displayarea.fadearray[slideIdNum].nextcanvas)
displayarea.fadearray[slideIdNum].populateslide(displayarea.fadearray[slideIdNum].tempobj, displayarea.fadearray[slideIdNum].nextimageindex)
setTimeout("displayarea.fadearray["+slideIdNum+"].rotateimage()", 100)
if(displayarea.fadearray[slideIdNum].caparea)
displayarea.fadearray[slideIdNum].caparea.innerHTML=displayarea.fadearray[slideIdNum].theimages[iNum][5]? displayarea.fadearray[slideIdNum].theimages[iNum][5] : '&nbsp;';
}
else{
clearInterval(displayarea.fadearray[slideIdNum].wait)
displayarea.fadearray[slideIdNum].wait=setInterval("switchFade("+iNum+", "+slideIdNum+");", 100)
}
}

function cmotiongallery(gallery, rest, maxs, maxw, startp, width, height, c){
this.iedom=document.all||document.getElementById;
if(!cmotiongallery.cgals)
cmotiongallery.cgals=[];
if(!this.iedom)
return;
this.galid=cmotiongallery.cgals.length;
cmotiongallery.cgals[cmotiongallery.cgals.length]=this;
this.gallery=[];
this.dgallery=gallery
for (var i = 0; i < gallery.length; i++)
this.gallery[i]='<a href="javascript:view('+[i+1]+')" onclick="switchFade('+i+', cmotiongallery.cgals['+this.galid+'].dgallery);return false;"><img src="'+gallery[i][0]+'" title="'+(gallery[i][4]? gallery[i][4] : '')+'"border="1"></a>';
this.usespace=gallery.usespace? ' ' : '';
this.width=/%/.test(width)? width : parseInt(width)+'px';
this.height=height;
this.c=c? 'margin:0 auto;' : '';
this.loadedyes=0;
this.movestate='';
this.scrollspeed=0;
this.rest=rest;
this.maxs=maxs;
this.maxw=maxw;
this.startpos=startp;

for (var i_tem = 0; i_tem < this.gallery.length; i_tem++)
this.gallery[i_tem]=!/on[cC]lick/.test(this.gallery[i_tem])? this.gallery[i_tem].replace(/href="#"/, 'href="#" onclick="return false;"') : this.gallery[i_tem];

document.write('<div class="motioncontainer" id="motioncontainer'+this.galid+'" style="'+this.c+'width:'+this.width+';height:'+this.height+'px;position:relative;left:0;top:0;overflow:hidden;">\n'+
'<div id="motiongallery'+this.galid+'" style="position:absolute;left:0;top:0;white-space: nowrap;">\n'+
'\n'+
'<nobr id="trueContainer'+this.galid+'">'+this.gallery.join(this.usespace)+'<\/nobr>\n'+
'\n'+
'<\/div>\n'+
'<\/div>')
this.fillup();
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

cmotiongallery.prototype.creatediv=function(){
this.statusdiv=document.createElement("div")
this.statusdiv.setAttribute("id","statusdiv"+this.galid)
this.statusdiv.className="statusdiv";
document.body.appendChild(this.statusdiv)
this.statusdiv=document.getElementById("statusdiv"+this.galid)
this.statusdiv.innerHTML=endofgallerymsg
}

cmotiongallery.prototype.positiondiv=function(){
this.mainobjoffset=getposOffset(this.crossmain, "left"),
this.menuheight=parseInt(this.crossmain.offsetHeight),
this.mainobjoffsetH=getposOffset(this.crossmain, "top");
this.statusdiv.style.left=this.mainobjoffset+(this.menuwidth/2)-(this.statusdiv.offsetWidth/2)+"px";
this.statusdiv.style.top=this.menuheight+this.mainobjoffsetH+"px";
}

cmotiongallery.prototype.showhidediv=function(what){
if (endofgallerymsg!="") {
this.positiondiv();
this.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;
}


cmotiongallery.prototype.moveleft=function(){
if (this.loadedyes){
this.movestate="left";
if (this.iedom&&parseInt(this.cross_scroll.style.left)>(this.menuwidth-this.actualwidth)){
this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)-this.scrollspeed+"px";
this.showhidediv("hidden");
}
else
this.showhidediv("visible");
}
this.lefttime=setTimeout("cmotiongallery.cgals["+this.galid+"].moveleft()",10);
}

cmotiongallery.prototype.moveright=function(){
if (this.loadedyes){
this.movestate="right";
if (this.iedom&&parseInt(this.cross_scroll.style.left)<0){
this.cross_scroll.style.left=parseInt(this.cross_scroll.style.left)+this.scrollspeed+"px";
this.showhidediv("hidden");
}
else
this.showhidediv("visible");
}
this.righttime=setTimeout("cmotiongallery.cgals["+this.galid+"].moveright()",10);
}

cmotiongallery.prototype.motionengine=function(e){
this.mainobjoffset=getposOffset(this.crossmain, "left"),
dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft,
dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop,
curposy=window.event? event.clientX : e.clientX? e.clientX: "";
curposy-=this.mainobjoffset-dsocx;
this.leftbound=(this.menuwidth-this.rest)/2;
this.rightbound=(this.menuwidth+this.rest)/2;
if (curposy>this.rightbound){
this.scrollspeed=(curposy-this.rightbound)/((this.menuwidth-this.rest)/2) * this.maxs;
clearTimeout(this.righttime);
if (this.movestate!="left") this.moveleft();
}
else if (curposy<this.leftbound){
this.scrollspeed=(this.leftbound-curposy)/((this.menuwidth-this.rest)/2) * this.maxs;
clearTimeout(this.lefttime);
if (this.movestate!="right") this.moveright();
}
else
this.scrollspeed=0;
}

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

cmotiongallery.prototype.stopmotion=function(e){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!this.crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
clearTimeout(this.lefttime);
clearTimeout(this.righttime);
this.movestate="";
}
}

cmotiongallery.prototype.fillup=function(){
if (this.iedom){
this.crossmain=document.getElementById? document.getElementById("motioncontainer"+this.galid) : document.all["motioncontainer"+this.galid];
if(typeof this.crossmain.style.maxWidth!=='undefined')
this.crossmain.style.maxWidth=this.maxw+'px';
this.menuwidth=this.crossmain.offsetWidth;
this.cross_scroll=document.getElementById? document.getElementById("motiongallery"+this.galid) : document.all["motiongallery"+this.galid];
this.loading=document.getElementsByTagName? document.getElementById('trueContainer'+this.galid).getElementsByTagName('img') : document.all['trueContainer'+this.galid].all.tags('img');
for (var i_tem = 0; i_tem < this.loading.length; i_tem++)
if(typeof this.loading[i_tem].complete=='boolean'&&this.loading[i_tem].complete==false){
setTimeout("cmotiongallery.cgals["+this.galid+"].fillup()", 500);
return;
}
this.actualwidth=document.getElementById? document.getElementById("trueContainer"+this.galid).offsetWidth : document.all['trueContainer'+this.galid].offsetWidth;
if (this.startpos)
this.cross_scroll.style.left=(this.menuwidth-this.actualwidth)/this.startpos+'px';
this.crossmain.onmousemove=new Function("e", "cmotiongallery.cgals["+this.galid+"].motionengine(e)");

this.crossmain.onmouseout=new Function("e", "cmotiongallery.cgals["+this.galid+"].stopmotion(e);cmotiongallery.cgals["+this.galid+"].showhidediv('hidden')");
}
this.loadedyes=1
if (endofgallerymsg!=""){
this.creatediv();
this.positiondiv();
}
}


function cmotionresize(){
for (var i_tem = 0; i_tem < cmotiongallery.cgals.length; i_tem++){
if (document.all&&document.all['motioncontainer'+i_tem]&&document.all['motioncontainer'+i_tem].filters){
document.all['motioncontainer'+i_tem].style.width="0";
document.all['motioncontainer'+i_tem].style.width=cmotiongallery.cgals[i_tem].width;
document.all['motioncontainer'+i_tem].style.width=Math.min(document.all['motioncontainer'+i_tem].offsetWidth, cmotiongallery.cgals[i_tem].maxw)+'px';
}
cmotiongallery.cgals[i_tem].menuwidth=cmotiongallery.cgals[i_tem].crossmain.offsetWidth;

cmotiongallery.cgals[i_tem].cross_scroll.style.left=cmotiongallery.cgals[i_tem].startpos? (cmotiongallery.cgals[i_tem].menuwidth-cmotiongallery.cgals[i_tem].actualwidth)/cmotiongallery.cgals[i_tem].startpos+'px' : 0;
}
}

if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "resize", cmotionresize, false );
else if ( typeof window.attachEvent != "undefined" )
    window.attachEvent( "onresize", cmotionresize );
else {
    if ( window.onresize != null ) {
        var oldOnresize = window.onresize;
        window.onresize = function ( e ) {
            oldOnresize( e );
            cmotionresize();
        };
    }
    else
        window.onresize = cmotionresize;
}