XML Gallery rhamej + thumbnail bonus

Hello everyone.
I posted this on the respective thread but it seems that it needs a fresh start.
It’s about combining the rhamej script photogallery xml with the script from scotties thumbnail final bonus.
I mean i need to make the rhamej gallery to display the big image when i click on a thumbnail and show numbers 1 2 3 4 for more details of the same image. Bonus images.
So far i havent figure it out. I just pasted the code from scotties script to rhamej but it doesnt seem to work.

Here is the script:

//// DO NOT CHANGE ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING!! I AM NOT RESPONSIBLE IF YOU BREAK IT!!
scroller.InstanceName_1._alpha += 100;
stop();
//set the initial postitions/properties of every thing.
mtClip._alpha = 0;
// define the vars
var frwrd:Boolean = true;
var pictures:Array = new Array();
var thumbs:Array = new Array();
var p:Number = -1;
var z:Number;
var clickCount:Number = 0;
var howMclick:Number;
var slideCount:Number = -1;
var images:Array = new Array();
var numOfBtns:Array = new Array();
var xml:XML = new XML();
var fadeOut:Boolean;
var setIt:Boolean = false;
var playFast:Boolean;
var nextImage;
var mainColor;
var nextLink;
bonusarray=[]
// set the colors
//Load the XML and set all the arrays, blah blah blah....
xml.ignoreWhite = true;
xml.onLoad = function(ok) {
	if (ok) {
		allData = this.firstChild.childNodes;
		for (var i = 0; i<allData.length; i++) {
			bonusarray*=[]
			for(var bonus in xmlNode.childNodes*.attributes){
				bonusarray*.push(xmlNode.childNodes*.attributes[bonus])
			}
			trace(xmlNode.childNodes*.attributes.bonus)
			var newBut:MovieClip = scroller.container.attachMovie("thumbMC", "thumb"+i, i);
			total = xmlNode.childNodes.length;
			newBut.descript = allData*.firstChild.firstChild;
			newBut.image = allData*.firstChild.nextSibling.nextSibling.firstChild;
			thumbs.push(allData*.firstChild.nextSibling.firstChild);
			pictures.push(allData*.firstChild.nextSibling.nextSibling.firstChild);
			numOfBtns* = "but"+i;
			newBut.slideCounter = i;
			newBut.num.numtext = newBut.descript;
			newBut._visible = false;
			newBut.endY = i*(31);
			newBut.endX = 0;
			newBut._x = 0;
			howMclick = Math.floor(scroller.container._height/100);
			newBut.onRelease = function() {
				checkThumbs();
				if (showSlide == false) {
					slideCount = this.slideCounter;
				}
				infoBox.infoText.text = this.descript;
				getButtons();
				nextImage = this.image;
				fadeOut = true;
				fadeMain();
				this.enabled = false;
				if ((this.slideCounter+1)>=10){
				    counterText_mc.loadingText.text = "0" + (this.slideCounter+1);
				}else{
					counterText_mc.loadingText.text = "00" + (this.slideCounter+1);
				} 
				    counterText_mc.totalText.text = "/0" + pictures.length;
			};
			newBut.onRollOver = function() {
				this.num.fadeIn = true;
				this.thumbClip.fadeIn = true;
				this.thumbClip.fade();
				this.num.fade();
			};
			newBut.onRollOut = function() {
				this.num.fadeIn = false;
				this.thumbClip.fadeIn = false;
				this.thumbClip.fade();
				this.num.fade();
			};
		}
		// when all done with above caca, load the first thumb
		if (showShow == true) {
			playFast = true;
			timer_mc.onRelease();
			firstLoad = false;
		}
		nextPic();
	}
};
// slide the info box down
////load each thumb incrementaliy
// Step one, check to see if p is less than pictures array
function nextPic() {
	p++;
	if (p<pictures.length) {
		moveThumbs();
	} else {
		counterText_mc.loadingText.text = "001";
		counterText_mc.totalText.text = "/0" + pictures.length;
		getButtons();
    }
}
next_btn.onRelease = function() {
	moveThumbs();
};
// Step two, call the function to show the thumb
function moveThumbs() {
	var but:MovieClip = scroller.container["thumb"+p];
	but.showThumbs();
}
// Step three, show the thumb by sliding it up or blinking it in. After its showing, preload the image
MovieClip.prototype.showThumbs = function() {
	if (nav == "buttons") {
		if (navani == "slide") {
			this._y = 120;
			this._x = this.endX;
			this._visible = true;
			this.tween("_y", this.endY, thumbUpTweenSpeed, upEaseType, 0, loadThumbs);
		}
		if (navani == "blink") {
			this._visible = true;
			this._x = this.endX;
			loadThumbs();
		}
	} else if (nav == "nobuttons") {
		if (navani == "slide") {
			this._visible = true;
			this._y = 0;
			this._x = this.endX;
			scroller.container.tween("_x", Stage.width/2-scroller.container._width/2, .5, "easeOutQuad");
			this.tween("_y", this.endY, thumbUpTweenSpeed, upEaseType, 0, loadThumbs);
			if (this._x>Stage.width-this._width) {
				setIt = true;
			}
		}
		if (navani == "blink") {
			this._visible = true;
			this._x = 0;
			this._y = this.endY;
			//scroller.container.tween("_x", Stage.width/2-scroller.container._width/2, .5, "easeOutQuad");
			loadThumbs();
			}
	}
};
// load the thumb image
function loadThumbs() {
	var but:MovieClip = scroller.container["thumb"+p];
	but.thumbClip.loadMovie("landscapes/thumbs/"+thumbs[p]);
	var temp:MovieClip = _root.createEmptyMovieClip("temp"+p, p);
	if ((p+1)>=10){
	counterText_mc.loadingText.text = "0"+(p+1);
	}else{
	counterText_mc.loadingText.text = "00"+(p+1);	
	}
	counterText_mc.totalText.text = "/0" + pictures.length;
	temp.onEnterFrame = function() {
		BL = but.thumbClip.getBytesLoaded();
		BT = but.thumbClip.getBytesTotal();
		percent = Math.round(BL/BT*100);
		but.bar.gotoAndStop(percent);
		if (BL == BT && but.thumbClip._width>1 && but.thumbClip._height>1) {
			but.bar.gotoAndStop(1);
			but.thumbClip._width = 30;
			but.thumbClip._height = 30;
			if (firstLoad == 1) {
				but.onRelease();
				but.fadeIn = true;
				but.thumbClip._alpha = 100;
				firstLoad = false;
			} else {
				but.fadeIn = false;
				but.thumbClip.fade();
				but.num.fade();
			}
			nextPic();
			delete temp.onEnterFrame;
		}
	};
}
//re-enable the disabled thumb button when another is clicked
function checkThumbs() {
	for (var j = 0; j<=numOfBtns.length; j++) {
		var theThumb:MovieClip = scroller.container["thumb"+j];
		if (theThumb.enabled == false) {
			theThumb.enabled = true;
			theThumb.thumbClip.fadeIn = false;
			theThumb.num.fadeIn = false;
			theThumb.thumbClip.fade();
			theThumb.num.fade();
		}
	}
}
// fade IN/OUT the thumb image on rollOver rollOut
MovieClip.prototype.fade = function() {
	if (this.fadeIn == true) {
		this.alphaTo(100,0.5,"linear");
	} else {
		this.alphaTo(30,0.3,"linear");
	}
};
/*loadMain image. Even though it already preloaded in the thumb, 
we want to make sure its there before we reveal it, plus we need to make sure all the other crap happens*/
function loadMainImage() {
	mtClip.loadMovie("landscapes/images/"+nextImage);
	var temp:MovieClip = _root.createEmptyMovieClip("temp", 99999);
	preloader_mc._visible = true;
	temp.onEnterFrame = function() {
		IL = mtClip.getBytesLoaded();
		IT = mtClip.getBytesTotal();
		percentage = Math.round(IL/IT*100);
		preloader_mc.gotoAndPlay(percentage);
		if (mtClip._width>5 && mtClip._height>5 && IL == IT) {
			if (showSlide == true) {
				timer_mc.gotoAndPlay(2);
			}
			preloader_mc._visible = false;
			preloader_mc.gotoAndStop(1);
			fadeOut = false;
			fadeMain();
			delete temp.onEnterFrame;
		}
	};
}
// fade IN/OUT the main image
function fadeMain() {
	if (this.fadeOut == true) {
		mtClip.tween("_alpha", 0, fadeOutMainSpeed, "easeOutQuad", 0, loadMainImage);
	} else {
		mtClip.tween("_alpha", 100, fadeInMainSpeed, "easeOutQuad", 0);
		infoBox.alphaTo(100,0.5,"linear");
	}
}
mask._visible =true
function getButtons(){
	mask._width = 100
	var clip =this.createEmptyMovieClip("paper",10000)
	clip._y = 222
	clip._x=20
	for(var i=0;i<bonusarray[p].length;i++){
		var clap =clip.attachMovie("btn","btn"+i,i)
		clap._x =(clap._width+5)*i
		clap.ivar =i
		clap.myText.text =i+1
		clap.onPress =dopress
		
		clap.onRelease = clap.onReleaseOutside =dorelease
		
	}
	mask.onEnterFrame =grow
}
function grow(){
	this._width+=(paper._width-this._width)/5
	if(Math.abs(paper._width-this._width)<2){
		this._width = paper._width
		delete this.onEnterFrame
	}
}
function dopress(){
	this._alpha = 80
	picture.loadMovie(bonusarray[p][this.ivar])
}
function dorelease(){
	this._alpha = 100
}
//slide the thumbs left or right if set to "buttons"
// slide show function
//button actions
// fire it all off!  BAM!
xml.load("landscapes/landscapes.xml");

And an example of the xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<gallery>

<image b="McAir2.jpg">
<description>AIR</description>
<thumb>McAir_sm.jpg</thumb>
<pic>McAir.jpg</pic>
</image>

</gallery>


Can anyone help???