/*****
	JavaScript TribeNinja library for ISAbella Jewellery.
*****/

/***** Start TribeNinja JS *****/

function doNothing() {
}

/***** START - ninjaObject - The TribeNinja object *****/
function ninjaObject(f_TARGET, f_ID, f_ELEM, f_CLTAG, f_CLASS, f_ATTRIBS) {
/*Custom event listener*/
this.waitFor = {
moveAction: null,
movedAction: null,
resizeAction: null,
resizedAction: null,
isMove: function() {
	if(this.moveAction != null) {
	this.moveAction();
	}
},
hasMoved: function() {
	if(this.movedAction != null) {
	this.movedAction();
	}
},
isResize: function() {
	if(this.resizeAction != null) {
	this.resizeAction();
	}
},
hasResized: function() {
	if(this.resizedAction != null) {
	this.resizedAction();
	}
},
imgLoad: function(iObj, iInterval, iJS, iParams) {
iObj = $(iObj);
	iObj.loadAction = function(iObj, iJS, iParams) {
	var hasLoaded = iObj.complete;
		if(hasLoaded == true) {
		var dynJS = iJS;
			if(!iParams) {
			dynJS();
			}
			else {
			dynJS(iParams);
			}
		return true;
		clearInterval(iObj.ninjaLoad);
		}
	}
iObj.ninjaLoad = setInterval(function() { iObj.loadAction(iObj, iJS, iParams); }, iInterval);
},
loading: {
	hasLoader: false,
	closeLoader: function(iObj) {
	clearInterval(iObj.doBubble);
	var thisZ = 1;
		while(thisZ <= iObj.zMax) {
		$('bubble'+ thisZ).style.visibility = 'hidden';
		thisZ++;
		}
	$('bubblesFrame').style.visibility = 'hidden';
	},
	resize: function(iW, iH) {
	wRatio = iW / $('bubblesFrame').offsetWidth;
	hRatio = iH / $('bubblesFrame').offsetHeight;
	$('bubblesFrame').style.width = iW +'px';
	$('bubblesFrame').style.height = iH +'px';
	$('bubblesBG').style.width = iW +'px';
	$('bubblesBG').style.height = iH +'px';
	$('bubbles').style.width = ($('bubbles').offsetWidth * wRatio) +'px';
	$('bubbles').style.height = ($('bubbles').offsetHeight * hRatio) +'px';
	var z = 1;
		while(z <= this.zMax) {
		$('bubble'+ z).style.width = 'hidden';
		z++;
		}
	},
	z: 1,
	zMax: 12,
	zSwitch: function(iObj) {
		if(iObj == 'hidden' || iObj == '' || iObj == 'undefined' || iObj == null) {
		return 'visible';
		}
		else {
		return 'hidden';
		}
	},
	create: function(iType, iTarget) {
		switch(iType) {
		case 'bubbles': var bubblesFrame = new ninjaObject(iTarget, 'bubblesFrame', 'div', 'div', 'loadingframe', 'style="width:420px; height:435px;"');
		bubblesFrame.ninjAppend();
		var bubblesBG = new ninjaObject($('bubblesFrame'), 'bubblesBG', 'div', 'div', 'loadingframe o2', 'style="width:420px; height:435px; background:#e2017c;"');
		bubblesBG.ninjAppend();
		var bubbles = new ninjaObject($('bubblesFrame'), 'bubbles', 'div', 'div', 'loadingframe', 'style="margin:10px;"');
		bubbles.ninjAppend();
		bubbles.ninjaText('plainText', '<img class="loading" id="bubble11" src="loading/11.png" /><img class="loading" id="bubble12" src="loading/12.png" /><img class="loading" id="bubble1" src="loading/1.png" /><img class="loading" id="bubble10" src="loading/10.png" /><img class="loading" id="bubble2" src="loading/2.png" /><img class="loading" id="bubble9" src="loading/9.png" /><img class="loading" id="bubble3" src="loading/3.png" /><img class="loading" id="bubble8" src="loading/8.png" /><img class="loading" id="bubble4" src="loading/4.png" /><img class="loading" id="bubble7" src="loading/7.png" /><img class="loading" id="bubble6" src="loading/6.png" /><img class="loading" id="bubble5" src="loading/5.png" /><img class="loading" id="bubbleTxt" src="loading/loading_en.png" style="position:absolute; top:0px; left:0px;"/>');
		$('bubblesFrame').style.visibility = 'hidden';
		}
	},
	bubbles: function(iLoader) {
	var iObj = this;
	$('bubblesFrame').style.visibility = 'visible';
		if(typeof eval(iLoader) == 'boolean') {
		var bubblesAction = function(iLoader, iObj) {
			if(iObj.z > iObj.zMax) { iObj.z = 1; }
			if(eval(iLoader) == false) {
//			alert($('bubbles').getElementsByTagName('img')[iObj.z].style.visibility);
			$('bubble'+ iObj.z).style.visibility = iObj.zSwitch($('bubble'+ iObj.z).style.visibility);
			iObj.z++;
			}
			if(eval(iLoader) == true) {
			iObj.closeLoader(iObj);
			}
		}
		this.doBubble = setInterval(function() { bubblesAction(iLoader, iObj); }, 30);
		}
	}
}
}
/*Target element where object will be created*/
this.target = f_TARGET;
/*Element type (div, img, etc.)*/
this.tag = f_ELEM;
/*Element closing tag*/
this.cltag = f_CLTAG;
/*Object ID*/
this.ninjID = f_ID;
/*The object (getElementById)*/
this.currObj = function() {
return document.getElementById(f_ID);
}
/*The object top position*/
this.currTop = function() {
return document.getElementById(f_ID).offsetTop;
}
/*The object left position*/
this.currLeft = function() {
return document.getElementById(f_ID).offsetLeft;
}
/*The object width*/
this.currWidth = function() {
return document.getElementById(f_ID).offsetWidth;
}
/*The object height*/
this.currHeight = function() {
return document.getElementById(f_ID).offsetHeight;
}
/*The object CSS class*/
this.clearObj = function(iClear) {
	if(!iClear) {
	this.currObj().innerHTML = '';
	}
	else {
	var currClear = 0;
	var clearMax = iClear.length - 1;
	while(currClear <= clearMax) {
	this.currObj().removeChild(iClear[currClear])
	currClear++
	}
	}
}
/*The object CSS class*/
this.ninjaClass = f_CLASS;
/*Aditional attributes passed to the object*/
this.attribs = f_ATTRIBS;
/*Hide the object*/
this.ninjaHide = function() {
this.currObj().style.visibility = 'hidden';
}
/*Show the object*/
this.ninjaShow = function() {
this.currObj().style.visibility = 'visible';
}
/*create the object*/
this.create = function() {
var toAdd = '';
	if(f_CLTAG == '/>') {
	toAdd = '<'+ f_ELEM +' id="'+ f_ID +'" class="'+ f_CLASS +'" '+ f_ATTRIBS +' '+ f_CLTAG;
	}
	else {
	toAdd = '<'+ f_ELEM +' id="'+ f_ID +'" class="'+ f_CLASS +'" '+ f_ATTRIBS +'></'+ f_CLTAG +'>';
	}
return toAdd;
}
/*Set onLoad and src attributes for an image object*/
if(f_ELEM === 'img') {
	//this.ninjaLoad = function(f_JS, f_PARAMS) {
	//this.currObj().setAttribute('onload', 'var dynJS = '+ f_JS +'; dynJS(\''+ f_PARAMS +'\');');
	//}
	this.ninjaImage = function(f_FILE) {
	this.currObj().src = f_FILE;
	}
}
/*Insert text*/
this.ninjaText = function(f_SOURCE, f_CONTENT) {
var zCurrID = this.ninjID;
	if(f_SOURCE === 'plainText') {
	this.currObj().innerHTML += f_CONTENT;
	}
	else if(f_SOURCE === 'html') {
	var ajaxNinja = new GETAJAXRequest(f_CONTENT);
	ajaxNinja.onreadystatechange = function() {
		if(ajaxNinja.readyState == 4) {
		var theResponse = ajaxNinja.responseText;
		$(zCurrID).innerHTML += theResponse;
		}
	}
	ajaxNinja.send(null);
	}
	else {
	var xmlNinja = new GETXMLRequest(f_SOURCE);
		xmlNinja.onreadystatechange = function() {
			if(xmlNinja.readyState == 4) {
			var theResponse = xmlNinja.responseXML;
			var theRoot = theResponse.documentElement;
			var theNode = theRoot.getElementsByTagName(f_CONTENT)[0].childNodes[0].nodeValue;
			document.getElementById(zCurrID).innerHTML += theNode;
			}
		}
	xmlNinja.send(null);
	}
}
/*Dynamically set opacity of object*/
this.currOpac = function() {
	if(typeof this.currObj().style.opacity != 'undefined') {
		if(this.currObj().style.opacity) {
		return this.currObj().style.opacity;
		}
		else {
		return 1;
		}
	}
	if(typeof this.currObj().style.filter != 'undefined') {
	var theOpac = 'progid:DXImageTransform.Microsoft.BasicImage(opacity=';
	var opacSearch = cImage.currObj().style.filter.indexOf(theOpac);
		if(opacSearch > -1) {
		theOpac = cImage.currObj().style.filter;
		opacSearch = /(opacity=)/;
		var opacStart = theOpac.search(opacSearch) + 8;
		var opacEnd = theOpac.indexOf(')', opacStart);
		theOpac = parseFloat(theOpac.substring(opacStart,opacEnd));
		return theOpac;
		}
		else {
		return 1;
		}
	}
}

}
/***** END - ninjaObject - The TribeNinja object *****/

/***** START - ninjaObject prototypes*****/
ninjaObject.prototype = {
/*Append the object*/
ninjAppend: function() {
this.target.innerHTML += this.create();
},
/*Overwrite with the object*/
ninjOverwrite: function() {
this.target.innerHTML = this.create();
},
/*Process an XML file via HTTPRequest*/
processXML: function(f_FILE, f_XMLNODE, f_TARGET) {
var zCurrObj = this.currObj();
var theTarget = document.getElementById(f_TARGET);
var xmlNinja = new GETXMLRequest(f_FILE);
	xmlNinja.onreadystatechange = function() {
		if(xmlNinja.readyState == 4) {
		var theResponse = xmlNinja.responseXML;
		var theRoot = theResponse.documentElement;
		var theNode = theRoot.getElementsByTagName(f_XMLNODE);
		var childCount = theNode.length - 1;
			for(z = 0; z <= childCount; z++) {
			var theContent = theNode[z].childNodes[0].nodeValue;
			var theContentType = theNode[z].getAttribute('cType');
				switch(theContentType) {
				case 'JS':theTarget.innerHTML = '';
				var theScript = document.createElement('script');
				theScript.text = theContent;
				theTarget.appendChild(theScript);
				var endCase;break
				case 'HTML':theTarget.innerHTML += theContent;
				var endCase;
				}
			}
		}
	}
xmlNinja.send(null);
},
/*Create a custom carousel inside the object*/
ninjaRousel: function(f_PARAMS) {
////Custom elements from collection.xml////
this.cName = new Array();
this.cDesc = new Array();
this.cLength = new Array();
this.cClosing = new Array();
this.cPriceIncl = new Array();
this.priceExcl = new Array();
this.cBTW = new Array();
this.zoomImg = new Array();
this.cNameLBL = new Array();
this.cLengthLBL = new Array();
this.cClosingLBL = new Array();
this.cPriceInclLBL = new Array();
this.priceExclLBL = new Array();
this.cBTWLBL = new Array();
this.cDescLBL = new Array();
this.cCat = new Array();
this.prodID = new Array();

var zTarget = this.target;
var zCurrID = this.ninjID;
var zCurrObj = this.currObj();
var zRefObj = eval(this.ninjID);

zRefObj.xmlNinja = new GETXMLRequest('xml/collection.xml');
	zRefObj.xmlNinja.onreadystatechange = function() {
		if(zRefObj.xmlNinja.readyState == 4) {
		var theResponse = zRefObj.xmlNinja.responseXML;
		var theRoot = theResponse.documentElement;
		var theNode = theRoot.getElementsByTagName('carousel');
		var cDetails = theRoot.getElementsByTagName('cItem');
		var cLang = theRoot.getElementsByTagName(f_PARAMS);
		var cZoom = theRoot.getElementsByTagName('cZoom');
		var currImage = 0;
		zRefObj.imgCount = 0;
		zRefObj.iMax = theNode.length - 1;

		zRefObj.reposIMG = function() {
		zRefObj.imgCount++;
		var reposCount = 1;
		if(zRefObj.imgCount == zRefObj.iMax) {
		zRefObj.theItem[0].style.top = '0px';
		zRefObj.theItem[0].style.position = 'absolute';
				while(reposCount <= zRefObj.iMax) {
//		alert(this.theItem[reposCount].offsetTop);
				var prev = reposCount - 1;
				zRefObj.theItem[reposCount].style.position = 'absolute';
				zRefObj.theItem[reposCount].style.top = (zRefObj.theItem[prev].offsetTop + zRefObj.theItem[prev].offsetHeight + 20) +'px';
				reposCount++;
				}
				enableRousel();
		}
/*
//		f_params = f_params.split(',');
//		var arrNo = parseInt(f_params[1]);
		var iObj = eval(f_params);
		iObj.imgCount++;
		var reposMax = iObj.iMax;
		var reposCount = 0;
			
			if(iObj.imgCount == reposMax) {
			var theItem = $(f_params).getElementsByTagName('img');
				while(reposCount <= iObj.iMax) {
				theItem[reposCount].style.top = theItem[reposCount].offsetTop +'px';
				reposCount++;
				}
				reposCount = 0;
				while(reposCount <= iObj.iMax) {
				theItem[reposCount].style.position = 'absolute';
				reposCount++;
				}
				enableRousel();
				window.location.hash = 'carousel is loaded';
//				window.location.hash = '';
			}*/
		}

			zRefObj.cQuantity = cLang[0].getAttribute('aantal');
			zRefObj.alreadyLoaded = false;
			zRefObj.theItem = $(zCurrID).getElementsByTagName('img');
			var iLoad = '';
			while(currImage <= zRefObj.iMax) {
			zRefObj.prodID[currImage] = cDetails[currImage].getAttribute('ISAnumber');
			zRefObj.cNameLBL[currImage] = cLang[currImage].getAttribute('naam');
			zRefObj.cName[currImage] = cDetails[currImage].getAttribute('naam');
			zRefObj.cCat[currImage] = cDetails[currImage].getAttribute('cCat');
			zRefObj.cDescLBL[currImage] = cLang[currImage].getAttribute('beschrijving');
			zRefObj.cDesc[currImage] = cLang[currImage].childNodes[0].nodeValue;
			zRefObj.cLengthLBL[currImage] = cLang[currImage].getAttribute('lengte');
			zRefObj.cLength[currImage] = cDetails[currImage].getAttribute('lengte');
			zRefObj.cClosingLBL[currImage] = cLang[currImage].getAttribute('sluiting');
			zRefObj.cClosing[currImage] = cDetails[currImage].getAttribute('sluiting');
			zRefObj.cPriceInclLBL[currImage] = cLang[currImage].getAttribute('prijs_incl_btw');
			zRefObj.cPriceIncl[currImage] = cDetails[currImage].getAttribute('prijs_incl_btw');
			zRefObj.priceExclLBL[currImage] = cLang[currImage].getAttribute('prijs_incl_btw');
			zRefObj.priceExcl[currImage] = cDetails[currImage].getAttribute('prijs_incl_btw');
			zRefObj.cBTWLBL[currImage] = cLang[currImage].getAttribute('btw');
			zRefObj.cBTW[currImage] = cDetails[currImage].getAttribute('btw');
			zRefObj.zoomImg[currImage] = cZoom[currImage].getAttribute('file');
			
			var theParams = zCurrID;
			var theImage = new ninjaObject(document.getElementById(zCurrID), theNode[currImage].getAttribute('id'), 'img', '/>', theNode[currImage].getAttribute('imgCSS'), '');
			theImage.ninjAppend();
//			theImage.ninjaLoad(reposIMG, zCurrID +','+ currImage);
			theImage.currObj().setAttribute('onclick', theNode[currImage].getAttribute('onclick') +'(\'xml/nl/collection.xml\', \'Content\', '+ currImage +')');
			theImage.ninjaImage(theNode[currImage].getAttribute('file'));
			//zRefObj.alreadyLoaded = document.getElementById(theNode[currImage].getAttribute('id')).complete;
			iLoad += zCurrID +".waitFor.imgLoad('"+ theNode[currImage].getAttribute('id') +"', 500, "+ zCurrID +".reposIMG); ";
			currImage++;
			}
			runJS('JS', iLoad);
			//if(zRefObj.alreadyLoaded == true) {
			//zRefObj.imgCount = zRefObj.iMax - 1;
			//zRefObj.reposIMG();
			//	enableRousel();
			//}
			//alert(theRoot.nodeName.toLowerCase());
		}
	}
zRefObj.xmlNinja.send(null);
},
/*Scroll the carousel object Minus*/
rScrollMinus: function(iStep, iInterval) {
var zCurrObj = this.currObj().getElementsByTagName('img');
var zCurrObjName = eval(this.currObj().id);

var scrollAction = function() {
var firstLoop = false;
var lastLoop = false;
var hasMoved = false;
zCurrObjName.rCeiling = 0 - zCurrObj[zCurrObjName.firstObj].offsetHeight;
zCurrObjName.firstImg = zCurrObj[zCurrObjName.firstObj];
zCurrObjName.firstImgTop = zCurrObjName.firstImg.offsetTop;
zCurrObjName.lastImg = zCurrObj[zCurrObjName.lastObj];
zCurrObjName.lastImgTop = zCurrObjName.lastImg.offsetTop;
zCurrObjName.lastImgBottom = zCurrObjName.lastImg.offsetHeight + zCurrObjName.lastImgTop + 20;

if(zCurrObjName.firstImgTop <= zCurrObjName.rCeiling && zCurrObjName.lastImgBottom <= zCurrObjName.rFloor) {
zCurrObjName.firstImg.style.top = zCurrObjName.rFloor +'px';
hasMoved = true;
}
if(zCurrObjName.firstImgTop <= zCurrObjName.rCeiling && zCurrObjName.lastImgBottom > zCurrObjName.rFloor) {
zCurrObjName.firstImg.style.top = zCurrObjName.lastImgBottom +'px';
hasMoved = true;
}
if(hasMoved == true) {
	if(zCurrObjName.firstObj == 0) {
	zCurrObjName.lastObj = 0;
	zCurrObjName.firstObj++;
	firstLoop = true;
	}
	if(zCurrObjName.firstObj == zCurrObjName.iMax) {
	zCurrObjName.firstObj = 0;
	zCurrObjName.lastObj = zCurrObjName.iMax;
	lastLoop = true;
	}
	if(firstLoop == false && lastLoop == false) {
		zCurrObjName.firstObj++;
		zCurrObjName.lastObj++;
	}
}

var currImage = 0;
	while(currImage <= zCurrObjName.iMax) {
	zCurrObj[currImage].style.top = (zCurrObj[currImage].offsetTop - iStep) +'px';
	currImage++;
	}

}

zCurrObjName.stopScroll = function() {
clearInterval(zCurrObjName.startScrollMinus);
}

zCurrObjName.startScrollMinus = setInterval(function() { scrollAction() }, iInterval);
},
/*Scroll the carousel object Plus*/
rScrollPlus: function(iObject, iStep, iInterval) {
var zCurrObj = this.currObj().getElementsByTagName('img');
var zCurrObjName = eval(this.currObj().id);

var scrollAction = function() {
var firstLoop = false;
var lastLoop = false;
var hasMoved = false;
zCurrObjName.firstImg = zCurrObj[zCurrObjName.firstObj];
zCurrObjName.firstImgTop = zCurrObjName.firstImg.offsetTop;
zCurrObjName.lastImg = zCurrObj[zCurrObjName.lastObj];
zCurrObjName.lastImgTop = zCurrObjName.lastImg.offsetTop;
zCurrObjName.lastImgHeight = zCurrObjName.lastImg.offsetHeight;
zCurrObjName.lastImgCeil = 0 - zCurrObjName.lastImg.offsetHeight - 20;
zCurrObjName.lastImgRear = zCurrObjName.firstImgTop - zCurrObjName.lastImgHeight - 20;


if(zCurrObjName.lastImgTop >= zCurrObjName.rFloor && zCurrObjName.firstImgTop >= 0) {
zCurrObjName.lastImg.style.top = zCurrObjName.lastImgCeil +'px';
hasMoved = true;
}
if(zCurrObjName.lastImgTop >= zCurrObjName.rFloor && zCurrObjName.firstImgTop < 0) {
zCurrObjName.lastImg.style.top = zCurrObjName.lastImgRear +'px';
hasMoved = true;
}
if(hasMoved == true) {
	if(zCurrObjName.lastObj == zCurrObjName.iMax) {
	zCurrObjName.lastObj = zCurrObjName.iMax - 1;
	zCurrObjName.firstObj = zCurrObjName.iMax;
	lastLoop = true;
	}
	if(zCurrObjName.lastObj == 0) {
	zCurrObjName.firstObj = 0;
	zCurrObjName.lastObj = zCurrObjName.iMax;
	firstLoop = true;
	}
	if(firstLoop == false && lastLoop == false) {
	zCurrObjName.lastObj--;
	zCurrObjName.firstObj--;
	}
}

var currImage = 0;
	while(currImage <= zCurrObjName.iMax) {
	zCurrObj[currImage].style.top = (zCurrObj[currImage].offsetTop + iStep) +'px';
	currImage++;
	}
	
}

zCurrObjName.stopScroll = function() {
clearInterval(zCurrObjName.startScrollPlus);
}

zCurrObjName.startScrollPlus = setInterval(function() { scrollAction() }, iInterval);
},
/*Create zoom in on an image*/
ninjaZoom: function(fType, iParams) {
if(fType === 'Mirror') {
}
},
/*Move object*/
ninjaMove: function(iType, iParamsY, iParamsX, iInterval) {
var iObj = this.currObj();
var nObject = this;

var resetPos = function(f_OBJ) {
var originPos = new Array();
originPos[0] = f_OBJ.offsetTop;
originPos[1] = f_OBJ.offsetLeft;
return originPos;
}
var returnOrigin = resetPos(iObj);
this.returnOriginY = returnOrigin[0];
this.returnOriginX = returnOrigin[1];

this.origin = function() {
//var f_OBJ = eval(this.ninjID);
this.currObj().style.top = this.returnOriginY +'px';
this.currObj().style.left = this.returnOriginX +'px';
}

if(iType === 'currentTo') {
	if(iParamsY != null) {
	iObj.iEndY = iParamsY[0];
	iObj.iStepY = iParamsY[1];
	}
	else {
	iObj.iEndY = iObj.offsetTop;
	iObj.iStepY = 0;
	}
	if(iParamsX != null) {
	iObj.iEndX = iParamsX[0];
	iObj.iStepX = iParamsX[1];
	}
	else {
	iObj.iEndX = iObj.offsetLeft;
	iObj.iStepX = 0;
	}
	var startMove = function(f_OBJ, f_nObject) {
	var currPosY = f_OBJ.offsetTop;
	var currPosX = f_OBJ.offsetLeft;
	var newPosY = currPosY + f_OBJ.iStepY;
	var newPosX = currPosX + f_OBJ.iStepX;
		if(newPosY > f_OBJ.iEndY && newPosY > currPosY || newPosY < f_OBJ.iEndY && newPosY < currPosY) {
		newPosY = f_OBJ.iEndY;
		}
		if(newPosX > f_OBJ.iEndX && newPosX > currPosX || newPosX < f_OBJ.iEndX && newPosX < currPosX) {
		newPosX = f_OBJ.iEndX;
		}
		f_OBJ.style.top = newPosY +'px';
		f_OBJ.style.left = newPosX +'px';
		if(newPosY == f_OBJ.iEndY && newPosX == f_OBJ.iEndX) {
		nObject.waitFor.hasMoved();
		f_nObject.stopMove();
		}
	}
iObj.moveAction = setInterval(function() { startMove(iObj, nObject); }, iInterval);
}

if(iType === 'decelerate') {
	if(iParamsY != null) {
	iObj.iEndY = iParamsY[0];
	iObj.iStepY = iParamsY[1];
	}
	else {
	iObj.iEndY = iObj.offsetTop;
	iObj.iStepY = 0;
	}
	if(iParamsX != null) {
	iObj.iEndX = iParamsX[0];
	iObj.iStepX = iParamsX[1];
	}
	else {
	iObj.iEndX = iObj.offsetLeft;
	iObj.iStepX = 0;
	}
	var startMove = function(f_OBJ, f_nObject) {
	var currPosY = f_OBJ.offsetTop;
	var currPosX = f_OBJ.offsetLeft;
	var moveDiffY = f_OBJ.iEndY - currPosY;
	moveDiffY = parseInt(moveDiffY / f_OBJ.iStepY);
	if(isNaN(moveDiffY)) {
	moveDiffY = 0;
	}
	var moveDiffX = f_OBJ.iEndX - currPosX;
	moveDiffX = parseInt(moveDiffX / f_OBJ.iStepX);
	if(isNaN(moveDiffX)) {
	moveDiffX = 0;
	}
	var newPosY = currPosY + moveDiffY;
	var newPosX = currPosX + moveDiffX;
		if(moveDiffY == 0) {
		newPosY = f_OBJ.iEndY;
		}
		if(moveDiffX == 0) {
		newPosX = f_OBJ.iEndX;
		}
		
	f_OBJ.style.top = newPosY +'px';
	f_OBJ.style.left = newPosX +'px';
		if(newPosY == f_OBJ.iEndY && newPosX == f_OBJ.iEndX) {
		var iObj = eval()
		f_nObject.waitFor.hasMoved();
		f_nObject.stopMove();
		}
	}
iObj.izMoving = true;
iObj.moveAction = setInterval(function() { startMove(iObj, nObject); }, iInterval);
}
},
stopMove: function() {
var iObj = this.currObj();
//iObj.izMoving = false;
clearInterval(iObj.moveAction);
},
/*Resize object*/
ninjaResize: function(iType, iParamsH, iParamsW, iInterval) {
var iObj = this.currObj();
var nObject = this;

var resetSize = function(f_OBJ) {
var originSize = new Array();
originSize[0] = f_OBJ.offsetHeight;
originSize[1] = f_OBJ.offsetWidth;
return originSize;
}
var returnOrigin = resetSize(iObj);
this.returnOriginH = returnOrigin[0];
this.returnOriginW = returnOrigin[1];

this.originSize = function() {
//var f_OBJ = eval(this.ninjID);
this.currObj().style.height = this.returnOriginH +'px';
this.currObj().style.width = this.returnOriginW +'px';
}

if(iType === 'currentTo') {
	if(iParamsH != null) {
	iObj.iEndH = iParamsH[0];
	iObj.iStepH = iParamsH[1];
	}
	else {
	iObj.iEndH = iObj.offsetHeight;
	iObj.iStepH = 0;
	}
	if(iParamsW != null) {
	iObj.iEndW = iParamsW[0];
	iObj.iStepW = iParamsW[1];
	}
	else {
	iObj.iEndW = iObj.offsetWidth;
	iObj.iStepW = 0;
	}
	var startResize = function(f_OBJ, f_nObject) {
	var currPosH = f_OBJ.offsetHeight;
	var currPosW = f_OBJ.offsetWidth;
	var newPosH = currPosH + f_OBJ.iStepH;
	var newPosW = currPosW + f_OBJ.iStepW;
		if(newPosH > f_OBJ.iEndH && newPosH > currPosH || newPosH < f_OBJ.iEndH && newPosH < currPosH) {
		newPosH = f_OBJ.iEndH;
		}
		if(newPosW > f_OBJ.iEndW && newPosW > currPosW || newPosW < f_OBJ.iEndW && newPosW < currPosW) {
		newPosW = f_OBJ.iEndW;
		}
		f_OBJ.style.height = newPosH +'px';
		f_OBJ.style.width = newPosW +'px';
		if(newPosH == f_OBJ.iEndH && newPosW == f_OBJ.iEndW) {
		nObject.waitFor.hasResized();
		f_nObject.stopResize();
		}
	}
iObj.resizeAction = setInterval(function() { startResize(iObj, nObject); }, iInterval);
}

if(iType === 'decelerate') {
	if(iParamsH != null) {
	iObj.iEndH = iParamsH[0];
	iObj.iStepH = iParamsH[1];
	}
	else {
	iObj.iEndH = iObj.offsetHeight;
	iObj.iStepH = 0;
	}
	if(iParamsW != null) {
	iObj.iEndW = iParamsW[0];
	iObj.iStepW = iParamsW[1];
	}
	else {
	iObj.iEndW = iObj.offsetWidth;
	iObj.iStepW = 0;
	}
	var startResize = function(f_OBJ, f_nObject) {
	var currPosH = f_OBJ.offsetHeight;
	var currPosW = f_OBJ.offsetWidth;
	var moveDiffH = f_OBJ.iEndH - currPosH;
	moveDiffH = parseInt(moveDiffH / f_OBJ.iStepH);
	if(isNaN(moveDiffH)) {
	moveDiffH = 0;
	}
	var moveDiffW = f_OBJ.iEndW - currPosW;
	moveDiffW = parseInt(moveDiffW / f_OBJ.iStepW);
	if(isNaN(moveDiffW)) {
	moveDiffW = 0;
	}
	var newPosH = currPosH + moveDiffH;
	var newPosW = currPosW + moveDiffW;
		if(moveDiffH == 0) {
		newPosH = f_OBJ.iEndH;
		}
		if(moveDiffW == 0) {
		newPosW = f_OBJ.iEndW;
		}
		
	f_OBJ.style.height = newPosH +'px';
	f_OBJ.style.width = newPosW +'px';
		if(newPosH == f_OBJ.iEndH && newPosW == f_OBJ.iEndW) {
		var iObj = eval()
		f_nObject.waitFor.hasResized();
		f_nObject.stopResize();
		}
	}
iObj.izMoving = true;
iObj.resizeAction = setInterval(function() { startResize(iObj, nObject); }, iInterval);
}
},
stopResize: function() {
var iObj = this.currObj();
//iObj.izMoving = false;
clearInterval(iObj.resizeAction);
},
/*Fade object in/out*/
ninjaFade: function(f_TYPE) {
var tObj = this.currObj();
if(f_TYPE == 'in') {
tObj.startOpac = 0;
tObj.endOpac = 1;
tObj.startVis = 'hidden';
tObj.endVis = 'visible';
tObj.iStep = 0.04;
}
if(f_TYPE == 'out') {
tObj.startOpac = 1;
tObj.endOpac = 0;
tObj.startVis = 'visible';
tObj.endVis = 'hidden';
tObj.iStep = -0.04;
}

if(typeof tObj.style.filter != 'undefined') {
    tObj.style.visibility = tObj.startVis;
	tObj.style.filter = 'progid:DXImageTransform.Microsoft.Fade(duration=1)';
	tObj.filters.item("DXImageTransform.Microsoft.Fade").apply();
    tObj.style.visibility = tObj.endVis;
	tObj.filters.item("DXImageTransform.Microsoft.Fade").play();
}
else if(typeof tObj.style.webkitTransitionProperty != 'undefined') {
	if(tObj.style.visibility == 'hidden') {
	tObj.style.visibility = 'visible';
	}
tObj.style.opacity = tObj.startOpac;
tObj.style.webkitTransitionProperty = 'opacity';
tObj.style.webkitTransitionTimingFunction = 'linear';
tObj.style.webkitTransitionDuration = '1s';
tObj.style.opacity = tObj.endOpac;
tObj.style.visibility = tObj.endVis;
}
else {
	if(tObj.style.visibility == 'hidden') {
	tObj.style.visibility = 'visible';
	}
tObj.style.opacity = tObj.startOpac;
tObj.fade = function(tObj) {
//var iObj = eval(tObj.ninjID);
	tObj.setOpac = function(oVal) {
	tObj.style.opacity = oVal;
	}
var newOpac = parseFloat(tObj.style.opacity) + tObj.iStep;
	if(newOpac != tObj.endOpac) {
	tObj.setOpac(newOpac);
	}
	else {
	tObj.setOpac(tObj.endOpac);
	tObj.style.visibility = tObj.endVis;
	clearInterval(tObj.fadeAction);
	}
}
tObj.fadeAction = setInterval(function() { tObj.fade(tObj) }, 40);
}
}

}
/***** END - ninjaObject prototypes*****/


/***** START - GETAJAXRequest - GET XMLHttpRequest for text file *****/
function GETAJAXRequest(f_FILE) {
var ajaxNinja;
var qString = Math.random();
	try {
	ajaxNinja = new XMLHttpRequest();
	//ajaxNinja.overrideMimeType("text/plain");
	ajaxNinja.open("GET", f_FILE +'?'+ qString, true);
	ajaxNinja.setRequestHeader("Content-Type", "text/plain");
	}
catch(err) {
	ajaxNinja = new ActiveXObject("Microsoft.XMLHTTP");
	ajaxNinja.open("GET", f_FILE +'?'+ qString, true);
	ajaxNinja.setRequestHeader("Content-Type", "text/plain");
	}
return ajaxNinja;
}
/***** END - GETAJAXRequest - GET XMLHttpRequest for text file *****/

/***** START - GETXMLRequest - GET XMLHttpRequest *****/
function GETXMLRequest(f_FILE) {
var xmlNinja;
var qString = Math.random();
	try {
	xmlNinja = new XMLHttpRequest();
	//xmlNinja.overrideMimeType("text/xml");
	xmlNinja.open("GET", f_FILE +'?'+ qString, true);
	xmlNinja.setRequestHeader("Content-Type", "text/xml");
	}
catch(err) {
	xmlNinja = new ActiveXObject("Microsoft.XMLHTTP");
	xmlNinja.open("GET", f_FILE +'?'+ qString, true);
	xmlNinja.setRequestHeader("Content-Type", "text/xml");
	}
return xmlNinja;
}

function xmlResponse(iFile, iFunc, iParams) {
var xmlNinja = new GETXMLRequest(iFile);
	xmlNinja.onreadystatechange = function() {
		if(xmlNinja.readyState == 4) {
		xmlNinja.zResponse = xmlNinja.responseXML;
		xmlNinja.zRoot = theResponse.documentElement;
		xmlNinja.zFunc = iFunc;
		}
	}
xmlNinja.send(null);
}
/***** END - GETXMLRequest - GET XMLHttpRequest *****/

/***** START - POSTXMLRequest - POST XMLHttpRequest *****/
function POSTFormRequest(iParams, f_FILE) {
var xmlNinja;
var qString = Math.random();
	try {
	xmlNinja = new XMLHttpRequest();
	xmlNinja.open("POST", f_FILE +'?'+ qString, true);
	xmlNinja.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlNinja.setRequestHeader("Content-length", iParams.length);
	xmlNinja.setRequestHeader("Connection", "close");
	}
catch(err) {
	xmlNinja = new ActiveXObject("Microsoft.XMLHTTP");
	xmlNinja.open("POST", f_FILE +'?'+ qString, true);
	xmlNinja.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlNinja.setRequestHeader("Content-length", iParams.length);
	xmlNinja.setRequestHeader("Connection", "close");
	}
return xmlNinja;
}
/***** END - POSTXMLRequest - POST XMLHttpRequest *****/

/***** START - runJS - Execute JavaScript from a variable stored string *****/
function runJS(f_TARGET, f_JSACTION) {
document.getElementById(f_TARGET).innerHTML = '';
var theScript = document.createElement('script');
theScript.text = f_JSACTION;
document.getElementById(f_TARGET).appendChild(theScript);
}
/***** END - runJS - Execute JavaScript from a variable stored string *****/

/***** START - launchCurrentVersion - Get current version from XML file *****/
function launchCurrentVersion(f_FILE) {
var xmlNinja = new GETXMLRequest('xml/currentversion.xml');
	xmlNinja.onreadystatechange = function() {
		if(xmlNinja.readyState == 4) {
		var theResponse = xmlNinja.responseXML;
		var theRoot = theResponse.documentElement;
		var thePath = theRoot.getElementsByTagName('version')[0].getAttribute('online');
		var theVersion = theRoot.getElementsByTagName('version')[0].getAttribute('id');
		var theURL = window.location.href;
		var checkIndex = theURL.indexOf('index.html');
			if(checkIndex > -1) {
			theURL = theURL.replace('index.html', 'isabella.html?'+ theVersion);
			window.location.href = theURL;
			}
			else {
			window.location.href += 'isabella.html?'+ theVersion;
			}
		}
	}
xmlNinja.send(null);
}
/***** END - launchCurrentVersion - Get current version from XML file *****/





function $(tObj) {
if(typeof tObj == 'object') {
return tObj.currObj();
}
else if(typeof tObj == 'string') {
return document.getElementById(tObj);
}
else {
//alert('The object '+ String(tObj) +' does not exist');
}

}

function shoppingCart(f_OBJ, basketTarget, cartTarget) {
this.obj = function() {
return eval(f_OBJ);
}

this.objStr = f_OBJ;
this.cartTarget = cartTarget;
this.basketSource = new Array();
this.basketIndex = new Array();
this.basketProd = new Array();
this.basketName = new Array();
this.basketPrice = new Array();
this.basketQ = new Array();
this.orderNum = null;

this.customer = {
	title: 'Dhr',
	fname: '',
	lname: '',
	email: '',
	street: '',
	nr: '',
	toev: '',
	zip: '',
	city: '',
	payment: [],
	grandTot: ''
}
	
	this.addToCart = function(f_source, xmlIndex, f_basketProd, f_basketName, f_basketPrice, f_basketQ) {
		if(isNaN(f_basketQ)) {
		f_basketQ = 1;
		}
	var searchPatt = new RegExp('^('+ f_basketProd +')');
	var prodArray = this.basketProd.toString();
	var checkIfExist = searchPatt.test(prodArray);
		if(checkIfExist == false) {
		this.basketSource.push(f_source);
		this.basketIndex.push(xmlIndex);
		this.basketProd.push(f_basketProd);
		this.basketName.push(f_basketName);
		this.basketPrice.push(f_basketPrice);
		this.basketQ.push(f_basketQ);
		}
		else {
		var z;
			for(z in this.basketProd) {
				if(this.basketProd[z] == f_basketProd) {
				this.basketQ[z] = parseInt(this.basketQ[z]) + parseInt(f_basketQ);
				}
			}
		}
	var currCount = parseInt($(this.basketCount).innerHTML) + parseInt(f_basketQ);
	$(this.basketCount).innerHTML = currCount;
//	alert(checkIfExist +' : '+ this.basketProd +' : '+ f_basketQ);
	}
	
	this.createBasket = function(basketImg, basketPos, imgSize) {
	basketPos = basketPos.split(',');
	imgSize = imgSize.split(',');
	this.Basket = new ninjaObject(document.getElementById(basketTarget), this.objStr +'Basket', 'div', 'div', '', 'style="position:absolute; top:'+ basketPos[0] +'px; left:'+ basketPos[1] +'px;"');
	this.Basket.ninjAppend();
	this.basketIMG = new ninjaObject($(this.Basket), this.objStr +'BasketIMG', 'img', '/>', '', 'style="cursor:pointer;" onclick="'+ this.objStr +'.showBasket();"');
	this.basketIMG.ninjAppend();
	this.basketIMG.ninjaImage(basketImg);
	this.basketCount = new ninjaObject($(this.Basket), this.objStr +'basketCount', 'span', 'span', '', '');
	this.basketCount.ninjAppend();
	this.basketCount.ninjaText('plainText', 0);
	}
	
/*	this.startCheckout = function() {
	this.xmlNinja = new GETXMLRequest('xml/collection.xml');
		this.xmlNinja.onreadystatechange = function() {
		if(this.xmlNinja.readyState == 4) {
		var theResponse = this.xmlNinja.responseXML;
		var theRoot = theResponse.documentElement;
		var theNode = theRoot.getElementsByTagName('cItem');
		var imgCount = theRoot.getElementsByTagName('cItem').length - 1;
		}
		}
	this.ckeckOut();
	}*/

	this.checkOut = function() {
	this.currStep = null;
	this.toLeft = null;
	this.toRight = null;
	document.getElementById(cartTarget).style.visibility = 'visible';
	this.cart = new ninjaObject(document.getElementById(cartTarget), this.objStr +'cart', 'div', 'div', '', 'style="position:absolute; top:0px; left:0px; width:100%; height:100%;"');
	this.cart.ninjAppend();
	this.cartBG = new ninjaObject($(this.cart), this.objStr +'cartBG', 'img', '/>', 'o14', 'style="position:absolute; top:0px; left:0px; width:100%; height:100%; z-index:989;"');
	this.cartBG.ninjAppend();
	this.cartBG.ninjaImage('black.gif');
	this.cartFrame = new ninjaObject($(this.cart), this.objStr +'cartFrame', 'div', 'div', '', 'style="position:absolute; top:100px; left:100px; width:800px; height:400px;"');
	this.cartFrame.ninjAppend();
	this.cartCanvas = new ninjaObject($(this.cartFrame), this.objStr +'cartCanvas', 'img', '/>', '', 'style="position:absolute; width:100%; height:100%; z-index:990;"');
	this.cartCanvas.ninjAppend();
	this.cartCanvas.ninjaImage('images/webshopframe.png');
	this.cartContent = new ninjaObject($(this.cartFrame), this.objStr +'cartContent', 'div', 'div', '', 'style="position:absolute; z-index:991;"');
	this.cartContent.ninjAppend();
	this.stepLeft = new ninjaObject($(this.cartFrame), this.objStr +'stepLeft', 'a', 'a', 'normtxt', 'href="#" style="position:absolute; z-index:991; bottom:50px; left:100px; text-decoration:none; width:auto; height:auto;" onclick="new '+ this.objStr +'.toLeft();""');
	this.stepLeft.ninjAppend();
	this.stepLeft.ninjaText('plainText', '<< Vorige');
	this.stepRight = new ninjaObject($(this.cartFrame), this.objStr +'stepRight', 'a', 'a', 'normtxt', 'href="#" style="position:absolute; z-index:991; bottom:50px; left:600px; text-decoration:none; width:auto; height:auto;" onclick="new '+ this.objStr +'.toRight();"');
	this.stepRight.ninjAppend();
	this.stepRight.ninjaText('plainText', 'Volgende >>');
	this.orderNow = new ninjaObject($(this.cartFrame), this.objStr +'orderNow', 'a', 'a', 'normtxt', 'style="position:absolute; z-index:991; bottom:50px; left:550px; text-decoration:none; width:auto; height:auto; border:none; font-weight:bold; font-size:30px; cursor:pointer; display:none;" onclick="alert(\'Je moet eerst akkoord gaan met de algemene voorwaarden\')"');
	this.orderNow.ninjAppend();
	this.orderNow.ninjaText('plainText', 'Bestellen');
	
	this.headBorder = new ninjaObject($(this.cartFrame), this.objStr +'headBorder', 'img', '/>', '', 'style="position:absolute; z-index:993; top:90px; left:20px; width:750px; height:4px;"');
	this.headBorder.ninjAppend();
	this.headBorder.ninjaImage('images/groove.png');
	this.headHL = new ninjaObject($(this.cartFrame), this.objStr +'headHL', 'div', 'div', '', 'style="position:absolute; z-index:991; top:25px; left:35px; width:650px; height:50px; background:#000000;"');
	this.headHL.ninjAppend();
	this.headHLarrow = new ninjaObject($(this.headHL), this.objStr +'headHLarrow', 'div', 'div', '', 'style="position:absolute; z-index:991; top:0px; left:0px; width:50px; height:75px;"');
	this.headHLarrow.ninjAppend();
	this.headHLarrow.ninjaText('plainText', '<img src="images/stephl.gif" style="width:50px; height:50px; position:absolute; top:0px; left:0px;"><img src="images/steparrow.gif" style="width:50px; height:10px; position:absolute; top:55px; left:0px; background:#ffffff;">');
	this.headSteps = new ninjaObject($(this.cartFrame), this.objStr +'headSteps', 'div', 'div', '', 'style="position:absolute; z-index:992; top:25px; left:35px; width:800px; height:50px; overflow:hidden; white-space:nowrap;"');
	this.headSteps.ninjAppend();

	this.headStep1 = new ninjaObject($(this.headSteps), this.objStr +'headStep1', 'div', 'div', '', 'style="position:relative; z-index:992; top:0px; left:0px; width:190px; height:50px; overflow:hidden; float:left;"');
	this.headStep1.ninjAppend();
	this.headStep1.ninjaText('plainText', '<img src="images/stepframe.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><img src="images/step1.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><div class="steptitle" style="position:absolute; float:left; top:0px; left:50px; padding:10px; height:100%; width:100%; background:#ffffff;">Bestelling<br />Overzicht</div>');
	this.headStep2 = new ninjaObject($(this.headSteps), this.objStr +'headStep2', 'div', 'div', '', 'style="position:relative; z-index:992; top:0px; left:0px; width:190px; height:50px; overflow:hidden; float:left;"');
	this.headStep2.ninjAppend();
	this.headStep2.ninjaText('plainText', '<img src="images/stepframe.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><img src="images/step2.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><div class="steptitle" style="position:absolute; float:left; top:0px; left:50px; padding:10px; height:100%; width:100%; background:#ffffff;">Contact<br />Gegevens</div>');
	this.headStep3 = new ninjaObject($(this.headSteps), this.objStr +'headStep3', 'div', 'div', '', 'style="position:relative; z-index:992; top:0px; left:0px; width:190px; height:50px; overflow:hidden; float:left;"');
	this.headStep3.ninjAppend();
	this.headStep3.ninjaText('plainText', '<img src="images/stepframe.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><img src="images/step3.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><div class="steptitle" style="position:absolute; float:left; top:0px; left:50px; padding:10px; height:100%; width:100%; background:#ffffff;">Betaal<br />Methode</div>');
	this.headStep4 = new ninjaObject($(this.headSteps), this.objStr +'headStep4', 'div', 'div', '', 'style="position:relative; z-index:992; top:0px; left:0px; width:150px; height:50px; overflow:hidden; float:left;;"');
	this.headStep4.ninjAppend();
	this.headStep4.ninjaText('plainText', '<img src="images/stepframe.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><img src="images/step4.gif" style="position:absolute; top:0px; left:0px; width:50px; height:50px;" /><div class="steptitle" style="position:absolute; float:left; top:0px; left:50px; padding:10px; height:100%; width:100%; background:#ffffff;">Afsluitend<br />Overzicht</div>');
	this.cartClose = new ninjaObject($(this.cartFrame), 'cartClose', 'a', 'a', 'steptitle', 'style="position:absolute; z-index:992; top:12px; right:30px; text-decoration:none;" href="#" onclick="$(\''+ this.cartTarget +'\').innerHTML = \'\'; $(\''+ this.cartTarget +'\').style.visibility = \'hidden\';"');
	this.cartClose.ninjAppend();
	this.cartClose.ninjaText('plainText', 'X');

	this.step1 = new ninjaObject($(this.cartContent), this.objStr +'step1', 'div', 'div', '', 'style="position:absolute; top:120px; left:25px; width:740px; height:300px; overflow:hidden; visibility:hidden;"');
	this.step1.ninjAppend();
	this.step2 = new ninjaObject($(this.cartContent), this.objStr +'step2', 'div', 'div', '', 'style="position:absolute; top:120px; left:25px; width:740px; height:300px; overflow:hidden; visibility:hidden;"');
	this.step2.ninjAppend();
	this.step3 = new ninjaObject($(this.cartContent), this.objStr +'step3', 'div', 'div', '', 'style="position:absolute; top:120px; left:25px; width:740px; height:300px; overflow:hidden; visibility:hidden;"');
	this.step3.ninjAppend();
	this.step4 = new ninjaObject($(this.cartContent), this.objStr +'step4', 'div', 'div', '', 'style="position:absolute; top:120px; left:25px; width:740px; height:300px; overflow:hidden; visibility:hidden;"');
	this.step4.ninjAppend();
	
	this.step = {
		$1: function(iObj, iObjStr) {
			if(iObj().currStep != null) {
			$(iObjStr +'step'+ iObj().currStep).style.visibility = 'hidden';
			}
			iObj().currStep = 1;
			iObj().toLeft = function() {
			iObj().step.$1(iObj, iObjStr);
			}
			iObj().toRight = function() {
			iObj().step.$2(iObj, iObjStr);
			}
			iObj().headHLarrow.stopMove();
			var moveParamsX = new Array(0, 8);
			iObj().headHLarrow.ninjaMove('decelerate', null, moveParamsX, 30);
			$(iObjStr +'step1').style.visibility = 'visible';
			if($(iObjStr +'step1').innerHTML == '') {
			iObj().tHeaders = new ninjaObject($(iObj().step1), iObjStr +'tHeaders', 'div', 'div', '', 'style="border:groove 3px; height:50px; white-space:nowrap; width:99%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:5px;"');
			iObj().tHeaders.ninjAppend();
			iObj().tHeaders.ninjaText('plainText', '<div style="float:left; width:435px; border-right:solid thin;">Product</div>');
			iObj().tHeaders.ninjaText('plainText', '<div style="float:left; width:100px; border-right:solid thin;">Aantal</div>');
			iObj().tHeaders.ninjaText('plainText', '<div style="float:left; width:100px; border-right:solid thin;">Prijs p/stuk</div>');
			iObj().tHeaders.ninjaText('plainText', '<div style="float:left; width:80px;">Totaal</div>');
			var z = 0;
			var prodCount = iObj().basketProd.length - 1;
			this.cartProds = new Array();
				while(z <= prodCount) {
				var regPatt = /\d+/g;
				var regStr = iObj().basketPrice[z];
				var subTot = regStr.match(regPatt);
				subTot = Number(subTot[0] +'.'+ subTot[1]);
				subTot = subTot * parseInt(iObj().basketQ[z]);
				subTot = '&euro; '+ subTot.toFixed(2);
				subTot = subTot.replace('.', ',');
				this.cartProds[z] = new ninjaObject($(iObj().step1), iObjStr +'tRow_'+ z, 'div', 'div', '', 'style="height:50px; white-space:nowrap; width:100%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:5px;"');
				this.cartProds[z].ninjAppend();
				this.cartProds[z].ninjaText('plainText', '<div style="float:left; width:438px;">'+ iObj().basketName[z] +'</div>');
				this.cartProds[z].ninjaText('plainText', '<div style="float:left; width:101px;">'+ iObj().basketQ[z] +'</div>');
				this.cartProds[z].ninjaText('plainText', '<div style="float:left; width:101px;">'+ iObj().basketPrice[z] +'</div>');
				this.cartProds[z].ninjaText('plainText', '<div style="float:left; width:100px;">'+ subTot +'</div>');
				z++
				}
			}
		},
		$2: function(iObj, iObjStr) {
			if(iObj().currStep != null) {
			$(iObjStr +'step'+ iObj().currStep).style.visibility = 'hidden';
			}
			iObj().currStep = 2;
			iObj().toLeft = function() {
			iObj().step.$1(iObj, iObjStr);
			}
			iObj().toRight = function() {
			iObj().step.$3(iObj, iObjStr);
			}
			iObj().headHLarrow.stopMove();
			var moveParamsX = new Array(190, 8);
			iObj().headHLarrow.ninjaMove('decelerate', null, moveParamsX, 30);
			$(iObjStr +'step2').style.visibility = 'visible';
			if($(iObjStr +'step2').innerHTML == '') {
			iObj().scTitle = new ninjaObject($(iObj().step2), iObjStr +'scTitle', 'div', 'div', '', 'style="height:50px; width:auto; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:50px;"');
			iObj().scTitle.ninjAppend();
			iObj().scTitle.ninjaText('plainText', '<span style="margin-right:15px;">Titel: </span>');
			iObj().scTitle.ninjaText('plainText', '<input id="'+ iObjStr +'scTitle_mr" type="radio" name="title" value="Dhr" onfocus="'+ iObjStr +'.customer.title = this.value;" /><label for="'+ iObjStr +'scTitle_mr" style="margin-right:10px;">Dhr</label>');
			iObj().scTitle.ninjaText('plainText', '<input id="'+ iObjStr +'scTitle_mrs" type="radio" name="title" value="Mvr" onfocus="'+ iObjStr +'.customer.title = this.value;" /><label for="'+ iObjStr +'scTitle_mrs" style="margin-right:10px;">Mvr</label>');
			iObj().scTitle.ninjaText('plainText', '<input id="'+ iObjStr +'scTitle_dr" type="radio" name="title" value="Dr" onfocus="'+ iObjStr +'.customer.title = this.value;" /><label for="'+ iObjStr +'scTitle_dr" style="margin-right:10px;">Dr</label>');
			iObj().scTitle.ninjaText('plainText', '<input id="'+ iObjStr +'scTitle_pro" type="radio" name="title" value="Prof" onfocus="'+ iObjStr +'.customer.title = this.value;" /><label for="'+ iObjStr +'scTitle_pro">Prof</label>');
			var z = 0; var zTitle = iObj().customer.title;
			while(z <= 3) {
			var currTitle = $(iObj().scTitle).getElementsByTagName('input')[z].value;
				if(currTitle == zTitle) {
				$(iObj().scTitle).getElementsByTagName('input')[z].setAttribute('checked', 'true');
				z = 3;
				}
			z++;
			}
			iObj().scStreet = new ninjaObject($(iObj().step2), iObjStr +'scStreet', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:right; clear:right; margin-bottom:5px; margin-right:50px;"');
			iObj().scStreet.ninjAppend();
			iObj().scStreet.ninjaText('plainText', '<label for="'+ iObjStr +'orderStreet" style="position:absolute; left:0px;">Straat: </label><input id="'+ iObjStr +'orderStreet" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.street = this.value;" value="'+ iObj().customer.street +'" />');
		
			iObj().scHouse = new ninjaObject($(iObj().step2), iObjStr +'scHouse', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:right; clear:right; margin-bottom:5px; margin-right:50px;"');
			iObj().scHouse.ninjAppend();
			iObj().scHouse.ninjaText('plainText', '<label for="'+ iObjStr +'orderHouse" style="position:absolute; left:0px;">Huis nr: </label><input id="'+ iObjStr +'orderHouse" type="text" style="position:absolute; left:99px; width:30px;" onblur="'+ iObjStr +'.customer.nr = this.value;" value="'+ iObj().customer.nr +'" /><label for="'+ iObjStr +'orderApndx" style="position:absolute; left:176px;">toev: </label><input id="'+ iObjStr +'orderApndx" type="text" style="position:absolute; left:211px; width:30px;" onblur="'+ iObjStr +'.customer.toev = this.value;" value="'+ iObj().customer.toev +'" />');
		
			iObj().scFName = new ninjaObject($(iObj().step2), iObjStr +'scFName', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:50px;"');
			iObj().scFName.ninjAppend();
			iObj().scFName.ninjaText('plainText', '<label for="'+ iObjStr +'orderFName" style="position:absolute; left:0px;">Voornaam: </label><input id="'+ iObjStr +'orderFName" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.fname = this.value;" value="'+ iObj().customer.fname +'" />');
		
			iObj().scZIP = new ninjaObject($(iObj().step2), iObjStr +'scZIP', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:right; clear:right; margin-bottom:5px; margin-right:50px;"');
			iObj().scZIP.ninjAppend();
			iObj().scZIP.ninjaText('plainText', '<label for="'+ iObjStr +'orderZIP" style="position:absolute; left:0px;">Postcode: </label><input id="'+ iObjStr +'orderZIP" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.zip = this.value;" value="'+ iObj().customer.zip +'" />');
		
			iObj().scLName = new ninjaObject($(iObj().step2), iObjStr +'scLName', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:50px;"');
			iObj().scLName.ninjAppend();
			iObj().scLName.ninjaText('plainText', '<label for="'+ iObjStr +'orderLName" style="position:absolute; left:0px;">Achternaam: </label><input id="'+ iObjStr +'orderLName" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.lname = this.value;" value="'+ iObj().customer.lname +'" />');
		
			iObj().scCity = new ninjaObject($(iObj().step2), iObjStr +'scCity', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:right; clear:right; margin-bottom:5px; margin-right:50px;"');
			iObj().scCity.ninjAppend();
			iObj().scCity.ninjaText('plainText', '<label for="'+ iObjStr +'orderCity" style="position:absolute; left:0px;">Stad: </label><input id="'+ iObjStr +'orderCity" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.city = this.value;" value="'+ iObj().customer.city +'" />');
		
			iObj().scEmail = new ninjaObject($(iObj().step2), iObjStr +'scEmail', 'div', 'div', '', 'style="height:50px; width:'+ $(iObj().scTitle).offsetWidth +'px; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:50px;"');
			iObj().scEmail.ninjAppend();
			iObj().scEmail.ninjaText('plainText', '<label for="'+ iObjStr +'orderEmail" style="position:absolute; left:0px;">Email: </label><input id="'+ iObjStr +'orderEmail" type="text" style="position:absolute; right:0px;" onblur="'+ iObjStr +'.customer.email = this.value;" value="'+ iObj().customer.email +'" />');
			}
		},
		$3: function(iObj, iObjStr) {
			iObj().Comment = {
				show: function(f_OBJ, NEWELEM, OLDELEM) {
				var comIzClik = f_OBJ.scPayment.izClicked;
				var prevCom = f_OBJ.scPayment.prevComment;
					if(comIzClik == true && prevCom == OLDELEM) {
					$(OLDELEM).style.visibility = 'hidden';
					}
					if(prevCom == OLDELEM || prevCom == null) {
					var moveParamsY = new Array(30, 2);
					NEWELEM.ninjaMove('decelerate', moveParamsY, null, 40);
					}
				},
				hide: function(f_OBJ, NEWELEM) {
				var prevCom = f_OBJ.scPayment.prevComment;
					NEWELEM.stopMove();
					if(prevCom != NEWELEM || f_OBJ.scPayment.izClicked == false) {
						//alert(NEWELEM.izMoving);
						//if(NEWELEM.izMoving == true) {
						//}
					$(NEWELEM).style.top = NEWELEM.returnOriginY +'px';
						if(prevCom != null) {
						$(prevCom).style.visibility = 'visible';
						}
					}
				},
				tClick: function(f_OBJ, NEWELEM) {
				f_OBJ.scPayment.izClicked = true;
				prevCom = f_OBJ.scPayment.prevComment;
					if(prevCom != null) {
					$(prevCom).style.visibility = 'visible';
					$(prevCom).style.top = prevCom.returnOriginY +'px';
					}
				f_OBJ.scPayment.prevComment = NEWELEM;
				}
			}
			
			if(iObj().currStep != null) {
			$(iObjStr +'step'+ iObj().currStep).style.visibility = 'hidden';
			}
			iObj().currStep = 3;
			iObj().toLeft = function() {
			iObj().step.$2(iObj, iObjStr);
			}
			iObj().toRight = function() {
			iObj().step.$4(iObj, iObjStr);
			}
			iObj().headHLarrow.stopMove();
			var moveParamsX = new Array(380, 8);
			iObj().headHLarrow.ninjaMove('decelerate', null, moveParamsX, 30);
			$(iObjStr +'step3').style.visibility = 'visible';
			var izVis = $(iObj().stepRight).style.visibility;
				if(izVis == 'hidden') {
				$(iObj().stepRight).style.visibility = 'visible';
				$(iObj().orderNow).style.display = 'none';
				}
			if($(iObjStr +'step3').innerHTML == '') {
//			iObj().scPayBG = new ninjaObject($(iObj().step3), iObjStr +'scPayBG', 'div', 'div', '', 'style="height:50px; width:100%; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:100px; background:#ffffff;"');
//			iObj().scPayBG.ninjAppend();
			
			iObj().scPayRem1 = new ninjaObject($(iObj().step3), iObjStr +'scPayRem1', 'div', 'div', 'smalltxt', 'style="height:auto; width:180px; position:absolute; left:121px; overflow:hidden; float:left;clear:left; padding:5px; background:#ffffff; border:solid thin #f00;"');
			iObj().scPayRem1.ninjAppend();
			iObj().scPayRem1.ninjaText('plainText', 'Nadat de betaling ontvangen is zal het product binnen 5 werkdagen verzonden worden.<br /><br />Verzendingscosten: &euro; 7,50');
			$(iObj().scPayRem1).style.top = -$(iObj().scPayRem1).offsetHeight +'px';
			iObj().scPayRem2 = new ninjaObject($(iObj().step3), iObjStr +'scPayRem2', 'div', 'div', 'smalltxt', 'style="height:auto; width:180px; position:absolute; left:366px; overflow:hidden; float:left; clear:left; padding:5px; background:#ffffff; border:solid thin #f00;"');
			iObj().scPayRem2.ninjAppend();
			iObj().scPayRem2.ninjaText('plainText', 'Nadat de bestelling bij ISAbella geregistreerd is zal het product binnen 5 werkdagen verzonden worden.<br /><br />Verzendingscosten: &euro; 15,00');
			$(iObj().scPayRem2).style.top = -$(iObj().scPayRem2).offsetHeight +'px';
			
			iObj().order_pay = null;
			iObj().scPayment = new ninjaObject($(iObj().step3), iObjStr +'scPayment', 'div', 'div', '', 'style="height:auto; width:auto; position:relative; top:0px; left:0px; overflow:hidden; float:left; clear:left; margin-bottom:5px; margin-left:100px; background:#ffffff;"');
			iObj().scPayment.ninjAppend();
			iObj().scPayment.izMoving = false;
			iObj().scPayment.izClicked = false;
			iObj().scPayment.prevComment = null;
			iObj().scPayment.ninjaText('plainText', '<a style="cursor:pointer;" onmouseover="'+ iObjStr +'.Comment.show('+ iObjStr +', '+ iObjStr +'.scPayRem1, '+ iObjStr +'.scPayRem2);" onmouseout="'+ iObjStr +'.Comment.hide('+ iObjStr +', '+ iObjStr +'.scPayRem1);" onmousedown="'+ iObjStr +'.Comment.tClick('+ iObjStr +', '+ iObjStr +'.scPayRem1); '+ iObjStr +'.order_pay = [\'Bank overschrijving\', 7.5];"><input id="'+ iObjStr +'scPay_bank" type="radio" name="payment" value="Bank overschrijving" style="cursor:pointer;" onfocus="'+ iObjStr +'.customer.payment = [this.value, \'€ 7,50\'];" /><label for="'+ iObjStr +'scPay_bank" style="margin-right:100px; cursor:pointer;">Bank overschrijving</label></a>');
			iObj().scPayment.ninjaText('plainText', '<a style="cursor:pointer;" onmouseover="'+ iObjStr +'.Comment.show('+ iObjStr +', '+ iObjStr +'.scPayRem2, '+ iObjStr +'.scPayRem1);" onmouseout="'+ iObjStr +'.Comment.hide('+ iObjStr +', '+ iObjStr +'.scPayRem2);" onclick="'+ iObjStr +'.Comment.tClick('+ iObjStr +', '+ iObjStr +'.scPayRem2); '+ iObjStr +'.order_pay = [\'Rembours pakket\', 15];"><input id="'+ iObjStr +'scPay_post" type="radio" name="payment" value="Rembours pakket" style="cursor:pointer;" onfocus="'+ iObjStr +'.customer.payment = [this.value, \'€ 15,00\'];" /><label for="'+ iObjStr +'scPay_post" style="margin-right:100px; cursor:pointer;">Rembours pakket</label></a>');
//			iObj().scPayment.ninjaText('plainText', '<input id="'+ iObjStr +'scPay_post" type="radio" name="payment" value="Rembours pakket" /><label for="'+ iObjStr +'scPay_post" style="margin-right:10px;">Rembours pakket</label>');
			}
		},
		$4: function(iObj, iObjStr) {
		$(iObj().scPayRem1).style.visibility = 'hidden';
		$(iObj().scPayRem2).style.visibility = 'hidden';
		iObj().orderNum = Math.random();
		iObj().orderNum = iObj().orderNum / Math.random();
			if(iObj().currStep != null) {
			$(iObjStr +'step'+ iObj().currStep).style.visibility = 'hidden';
			}
			iObj().currStep = 4;
			iObj().toLeft = function() {
			iObj().step.$3(iObj, iObjStr);
			}
			iObj().toRight = function() {
			iObj().step.$4(iObj, iObjStr);
			}
			iObj().headHLarrow.stopMove();
			var moveParamsX = new Array(570, 8);
			iObj().headHLarrow.ninjaMove('decelerate', null, moveParamsX, 30);
			$(iObj().stepRight).style.visibility = 'hidden';
			$(iObj().orderNow).style.display = 'inline';
			$(iObjStr +'step4').style.visibility = 'visible';
			$(iObjStr +'step4').innerHTML = '';
			
			var usrDet1 = new ninjaObject($(iObj().step4), iObjStr +'usrDet1', 'div', 'div', '', 'style="width:33%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:20px; float:left;"');
			usrDet1.ninjAppend();
			usrDet1.ninjaText('plainText', '<div style="font-weight:bold; text-decoration:underline;">Persoonlijke Gegevens</div><div>'+ iObj().customer.title +' '+ iObj().customer.fname +' '+ iObj().customer.lname +'</div><div>'+ iObj().customer.email +'</div>');
			var usrDet2 = new ninjaObject($(iObj().step4), iObjStr +'usrDet2', 'div', 'div', '', 'style="width:33%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:20px; float:left;"');
			usrDet2.ninjAppend();
			usrDet2.ninjaText('plainText', '<div style="font-weight:bold; text-decoration:underline;">Bezorgadres</div><div>'+ iObj().customer.street +' '+ iObj().customer.nr +''+ iObj().customer.toev +'</div><div>'+ iObj().customer.zip +', '+ iObj().customer.city +'</div>');
			var usrDet3 = new ninjaObject($(iObj().step4), iObjStr +'usrDet3', 'div', 'div', '', 'style="width:33%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:20px; float:left; clear:right;"');
			usrDet3.ninjAppend();
			usrDet3.ninjaText('plainText', '<div style="font-weight:bold; text-decoration:underline;">Bestelling Nummer</div><div>'+ iObj().orderNum +'</div>');
			
			iObj().zHeaders = new ninjaObject($(iObj().step4), iObjStr +'zHeaders', 'div', 'div', '', 'style="border:groove 3px; height:50px; white-space:nowrap; width:99%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:5px;"');
			iObj().zHeaders.ninjAppend();
			iObj().zHeaders.ninjaText('plainText', '<div style="float:left; width:435px; border-right:solid thin;">Product</div>');
			iObj().zHeaders.ninjaText('plainText', '<div style="float:left; width:100px; border-right:solid thin;">Aantal</div>');
			iObj().zHeaders.ninjaText('plainText', '<div style="float:left; width:100px; border-right:solid thin;">Prijs p/stuk</div>');
			iObj().zHeaders.ninjaText('plainText', '<div style="float:left; width:80px;">Totaal</div>');
			var z = 0;
			var prodCount = iObj().basketProd.length - 1;
			this.cartProds = new Array();
			var bigTot = 0;
				while(z <= prodCount) {
				var regPatt = /\d+/g;
				var regStr = iObj().basketPrice[z];
				var subTot = regStr.match(regPatt);
				subTot = Number(subTot[0] +'.'+ subTot[1]);
				subTot = subTot * parseInt(iObj().basketQ[z]);
				bigTot += subTot;
				subTot = '&euro; '+ subTot.toFixed(2);
				subTot = subTot.replace('.', ',');
				var tTot = new ninjaObject($(iObj().step4), iObjStr +'tTot_'+ z, 'div', 'div', '', 'style="height:50px; white-space:nowrap; width:100%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:5px;"');
				tTot.ninjAppend();
				tTot.ninjaText('plainText', '<div style="float:left; width:438px;">'+ iObj().basketName[z] +'</div>');
				tTot.ninjaText('plainText', '<div style="float:left; width:101px;">'+ iObj().basketQ[z] +'</div>');
				tTot.ninjaText('plainText', '<div style="float:left; width:101px;">'+ iObj().basketPrice[z] +'</div>');
				tTot.ninjaText('plainText', '<div style="float:left; width:100px;">'+ subTot +'</div>');
				z++
				}
			var shipTax = iObj().order_pay[1].toFixed(2);
			shipTax = '&euro; '+ shipTax.replace('.', ',');
			this.cartShip = new ninjaObject($(iObj().step4), iObjStr +'cartShip', 'div', 'div', '', 'style="style="height:50px; white-space:nowrap; width:100%; height:auto; position:relative; top:0px; left:0px; overflow:hidden; margin-bottom:5px;""');
			this.cartShip.ninjAppend();
			this.cartShip.ninjaText('plainText', '<div style="float:left; width:438px;">'+ iObj().order_pay[0] +'</div>');
			this.cartShip.ninjaText('plainText', '<div style="float:left; width:101px;">-</div>');
			this.cartShip.ninjaText('plainText', '<div style="float:left; width:101px;">-</div>');
			this.cartShip.ninjaText('plainText', '<div style="float:left; width:100px;">'+ shipTax +'</div>');
			
			bigTot += iObj().order_pay[1];
			bigTot = bigTot.toFixed(2);
			bigTot = bigTot.replace('.', ',');
			iObj().customer.grandTot = bigTot;
			this.cartProd = new ninjaObject($(iObj().step4), iObjStr +'tRowTot', 'div', 'div', '', 'style="height:50px; white-space:nowrap; width:100%; height:50px; position:relative; top:10px; left:0px; overflow:hidden; border-top:solid thin;"');
			this.cartProd.ninjAppend();
			this.cartProd.ninjaText('plainText', '<div style="float:left; width:438px; height:50px;"></div>');
			this.cartProd.ninjaText('plainText', '<div style="float:left; width:101px; height:50px"></div>');
			this.cartProd.ninjaText('plainText', '<div style="float:left; width:101px; height:50px"></div>');
			this.cartProd.ninjaText('plainText', '<div style="float:left; width:100px; height:50px">&euro; '+ bigTot +'</div>');
			
			this.Terms = new ninjaObject($(iObj().step4), iObjStr +'Terms', 'span', 'span', '', 'style="height:50px; white-space:nowrap; width:auto; height:50px; position:relative; top:10px; left:0px; text-align:right; margin-right:10px;"');
			this.Terms.ninjAppend();
			this.Terms.ninjaText('plainText', '<input id="termsAgree" type="checkbox" onclick="$('+ iObjStr +'.orderNow).setAttribute(\'onclick\', \''+ iObjStr +'.sendOrder()\');" /><span>Ik ga akkoord met de <a href="#">algemene voorwaarden</a></span>');

			iObj().resetCart = function() {
			$(this.cartTarget).innerHTML = '';
			$(this.cartTarget).style.visibility = 'hidden';
			this.basketSource = [];
			this.basketIndex = [];
			this.basketProd = [];
			this.basketName = [];
			this.basketPrice = [];
			this.basketQ = [];
			$(this.basketCount).innerHTML = 0;
			}
			
			iObj().sendOrder = function() {
			var zMax = this.basketName.length - 1;
			var z = 0;
			var thisBasket = 'Customer: \n '+ this.customer.title +' '+ this.customer.fname +' '+ this.customer.lname +' \n '+ this.customer.email +' \n '+ this.customer.street +' '+ this.customer.nr + this.customer.toev +' \n '+ this.customer.zip +', '+ this.customer.city +'\n\nPayment method: '+ this.customer.payment +'\n\nInvoice: '+ this.customer.grandTot +' \n\nInvoice number: '+ this.orderNum;
				while(z <= zMax) {
				thisBasket += '\n\nOrder: \n recNo='+ this.basketIndex +' :: ISAnumber='+ this.basketProd +' :: name='+ this.basketName +' :: quantity='+ this.basketQ +' :: price='+ this.basketPrice +'\n';
				z++;
				}
			alert(this.customer.payment);
			var iParams = 'orderDetails='+ thisBasket +'&payment='+ this.customer.payment;
			var aspNinja = new POSTFormRequest(iParams, 'asp/placeorder.aspx');
			aspNinja.onreadystatechange = function() {
				if(aspNinja.readyState == 4) {
				var theResponse = aspNinja.responseText;
				alert(theResponse);
				iObj().resetCart();
				}
			}
			aspNinja.send(iParams);
			}
		}
	}
	this.step.$1(this.obj, this.objStr);
	}
}

/***** START - waitFor - Custom event listener *****/
/***** End waitFor *****/

/***** End TribeNinja JS *****/