/*-----------------------*/
/* author: cocowerbung   */
/* operator(s): DH       */
/*-----------------------*/
/*---------------------------------------------------------------------*/
/*                        SCRIPT INFORMATION                           */
/*                                                                     */
/* Script Version:              0.5 BETA                               */
/* Required JavaScript-Version: 1.5                                    */
/*                                                                     */
/* This script uses "Script Aculous" and as a result "Prototype".      */
/* For more information visit their websites:                          */
/*   -   http://script.aculo.us/                                       */
/*   -   http://www.prototypejs.org/                                   */
/*---------------------------------------------------------------------*/
/*-------------------------------------------------------*/
/*                     NAVIGATION                        */
/*-------------------------------------------------------*/
function navigationEngine(elemIni,actIni){
	var buttonOverlay = null;
	for(nveaa=0;nveaa<elemIni.childNodes.length;nveaa++){
		if(elemIni.childNodes[nveaa].nodeName.toLowerCase() == "div") buttonOverlay = elemIni.childNodes[nveaa];
	}
	switch(actIni){
		case "over":
			new Effect.Opacity(buttonOverlay, { from: 1.0, to: 0.0, duration: 0.2 });
		break;
		case "out":
			new Effect.Opacity(buttonOverlay, { from: 0.0, to: 1.0, duration: 0.5 });
		break;
	}
}
/*-------------------------------------------------------*/
/*                     QUICKLINKS                        */
/*-------------------------------------------------------*/
function quicklinkEngine(qElemIni,qActIni){
	var qButtonOverlay = null, qTextNodeArray = null, hasText = false, newSup = null, newP = null;
	qTextNodeArray = new Array();
	for(qleaa=0;qleaa<qElemIni.childNodes.length;qleaa++){
		if(qElemIni.childNodes[qleaa].nodeName.toLowerCase() == "div") qButtonOverlay = qElemIni.childNodes[qleaa];
		if(qElemIni.childNodes[qleaa].nodeName.toLowerCase() == "#text"){
			for(qleab=0;qleab<qElemIni.childNodes[qleaa].nodeValue.length;qleab++){
				if(escape(qElemIni.childNodes[qleaa].nodeValue.substr(qleab,1)) != "%20" && escape(qElemIni.childNodes[qleaa].nodeValue.substr(qleab,1)) != "%0A") hasText = true;
			}
			if(hasText){
				qElemIni.childNodes[qleaa].parentNode.removeChild(qElemIni.childNodes[qleaa]);
				qleaa--;
				hasText = false;
			}
		}
		if(qElemIni.childNodes[qleaa].nodeName.toLowerCase() == "sup"){
			qElemIni.childNodes[qleaa].parentNode.removeChild(qElemIni.childNodes[qleaa]);
			qleaa--;
		}
		if(qElemIni.childNodes[qleaa].nodeName.toLowerCase() == "p"){
			qElemIni.childNodes[qleaa].parentNode.removeChild(qElemIni.childNodes[qleaa]);
			qleaa--;
		}
	}
	for(qleac=0;qleac<qButtonOverlay.childNodes.length;qleac++){
		if(qButtonOverlay.childNodes[qleac].nodeName.toLowerCase() == "#text" || qButtonOverlay.childNodes[qleac].nodeName.toLowerCase() == "sup" || qButtonOverlay.childNodes[qleac].nodeName.toLowerCase() == "p") qTextNodeArray[qTextNodeArray.length] = qButtonOverlay.childNodes[qleac];
	}
	for(qlead=0;qlead<qTextNodeArray.length;qlead++){
		switch(qTextNodeArray[qlead].nodeName.toLowerCase()){
			case "#text":
				qElemIni.appendChild(document.createTextNode(qTextNodeArray[qlead].nodeValue));
			break;
			case "p":
				newP = document.createElement("p");
				newP.className = qTextNodeArray[qlead].className;
				for(qleae=0;qleae<qTextNodeArray[qlead].childNodes.length;qleae++){
					if(qTextNodeArray[qlead].childNodes[qleae].nodeName.toLowerCase() == "#text"){
						newP.appendChild(document.createTextNode(qTextNodeArray[qlead].childNodes[qleae].nodeValue));
					}
					if(qTextNodeArray[qlead].childNodes[qleae].nodeName.toLowerCase() == "sup"){
						for(qleaf=0;qleaf<qTextNodeArray[qlead].childNodes[qleae].childNodes.length;qleaf++){
							if(qTextNodeArray[qlead].childNodes[qleae].childNodes[qleaf].nodeName.toLowerCase() == "#text"){
								newSup = document.createElement("sup");
								newSup.appendChild(document.createTextNode(qTextNodeArray[qlead].childNodes[qleae].childNodes[qleaf].nodeValue));
								newP.appendChild(newSup);
							}
						}
					}
				}
				qElemIni.appendChild(newP);
			break;
			case "sup":
				for(qleae=0;qleae<qTextNodeArray[qlead].childNodes.length;qleae++){
					if(qTextNodeArray[qlead].childNodes[qleae].nodeName.toLowerCase() == "#text"){
						newSup = document.createElement("SUP");
						newSup.appendChild(document.createTextNode(qTextNodeArray[qlead].childNodes[qleae].nodeValue));
						qElemIni.appendChild(newSup);
					}
				}
			break;
		}
	}
	switch(qActIni){
		case "over":
			new Effect.Opacity(qButtonOverlay, { from: 1.0, to: 0.0, duration: 0.2 });
		break;
		case "out":
			new Effect.Opacity(qButtonOverlay, { from: 0.0, to: 1.0, duration: 0.4 });
		break;
	}
}
/*-------------------------------------------------------*/
/*                       BANNER                          */
/*-------------------------------------------------------*/
function bannerEngine(e,a){
	a = a || 'check';
	switch(a){
		case 'check':
			exploitSave = 0;
			bannerRdyChckInt = window.setInterval("bannerRdyChck()",100);
		break;
		case 'random':
			var availableImages = 3,
			selectedImage = Math.round(1 + availableImages*(Math.random())),
			newImage = new Image(), b = document.getElementById('jsexBanner');
			if(selectedImage > availableImages) selectedImage = availableImages;
			selectedImage = selectedImage.toString();
			while(selectedImage.length < 3) selectedImage = '0' + selectedImage;
			newImage.src = window.location.protocol + '//' + window.location.host + '/images/photos/animation_banner_' + selectedImage + '.jpg';
			newImage.id = 'jsexBannerImg';
			newImage.style.margin = '0px 0px 0px 0px';
			b.appendChild(newImage);
			bannerEngine(null,'imgCheck');
		break;
		case 'imgCheck':
			expoitSave = 0;
			bannerImgRdyChckInt = window.setInterval("bannerImgRdyChck()",100);
		break;
		case 'setDefaults':
			var bannerImage = document.getElementById('jsexBannerImg');
			positions = {
				minLeft: (637-bannerImage.width)*-1,
				maxLeft: 0,
				newLeft: null,
				minTop: (77-bannerImage.height)*-1,
				maxTop: 0,
				newTop: null
			}
			bannerEngine(null,'animate');
		break;
		case 'animate':
			var bannerImage = document.getElementById('jsexBannerImg');
			positions.newLeft = Math.round(positions.minLeft*Math.random());
			positions.newTop = Math.round(positions.minTop*Math.random());
			new Effect.Morph($('jsexBannerImg'), { style: { marginTop: (positions.newTop*-1) + 'px', marginLeft: (positions.newLeft*-1) + 'px' }, duration: 3.0, afterFinish: function(){
				bannerEngine(null,'animate');
			}});
		break;
	}
}
function bannerRdyChck(){
	exploitSave++;
	if(document.getElementById('jsexBanner')){
		bannerEngine(null,'random');
		window.clearInterval(bannerRdyChckInt);
	}else if(exploitSave > 100){
		window.clearInterval(bannerRdyChckInt);
	}
}
function bannerImgRdyChck(){
	exploitSave++;
	if(document.getElementById('jsexBannerImg')){
		if(document.getElementById('jsexBannerImg').width > 0){
			bannerEngine(null,'setDefaults');
			window.clearInterval(bannerImgRdyChckInt);
		}else if(exploitSave > 100){
			window.clearInterval(bannerImgRdyChckInt);
		}
	}else if(exploitSave > 100){
		window.clearInterval(bannerImgRdyChckInt);
	}
}
window.onload = bannerEngine;
/*-------------------------------------------------------*/
/*                       MEDIA                           */
/*-------------------------------------------------------*/
function mediaEngine(mdElemIni,mdActIni){
	mdButtonOverlay = null;
	for(mdeaa=0;mdeaa<mdElemIni.childNodes.length;mdeaa++){
		if(mdElemIni.childNodes[mdeaa].nodeName.toLowerCase() == "div") mdButtonOverlay = mdElemIni.childNodes[mdeaa];
	}
	switch(mdActIni){
		case "over":
			new Effect.Opacity(mdButtonOverlay, { from: 1.0, to: 0.0, duration: 0.3 });
		break;
		case "out":
			new Effect.Opacity(mdButtonOverlay, { from: 0.0, to: 1.0, duration: 0.5});
		break;
	}
}
/*-------------------------------------------------------*/
/*                   GALLERY THUMBS                      */
/*-------------------------------------------------------*/
function galleryThumbEngine(gtElemIni,gtActIni){
	gtButtonOverlay = null;
	for(gteaa=0;gteaa<gtElemIni.childNodes.length;gteaa++){
		if(gtElemIni.childNodes[gteaa].nodeName.toLowerCase() == "div"){
			for(gteab=0;gteab<gtElemIni.childNodes[gteaa].childNodes.length;gteab++){
				if(gtElemIni.childNodes[gteaa].childNodes[gteab].nodeName.toLowerCase() == "div" && gtElemIni.childNodes[gteaa].childNodes[gteab].className == "overlay"){
					gtButtonOverlay = gtElemIni.childNodes[gteaa].childNodes[gteab];
				}
			}
		}
	}
	switch(gtActIni){
		case "over":
			new Effect.Opacity(gtButtonOverlay, { from: 1.0, to: 0.0, duration: 0.2 });
		break;
		case "out":
			new Effect.Opacity(gtButtonOverlay, { from: 0.0, to: 1.0, duration: 0.4 });
		break;
	}
}
/*-------------------------------------------------------*/
/*                     TEAM DRIVER                       */
/*-------------------------------------------------------*/
function temBioEngine(bioIni){
	var
	getElementBioArea = document.getElementById("jsexTemBioIni" + bioIni),
	getElementDrivArea = document.getElementById("jsexTemDrivIni" + bioIni),
	globalGetIni = 1, globalTempElement, globalTempArea, isActive = false;
	switch(getElementBioArea.style.display){
		case "block":
			isActive = true;
		break;
		case "":
		case "none":
		default:
			isActive = false;
		break;
	}
	while(globalTempElement = document.getElementById("jsexTemBioIni" + globalGetIni.toString())){
		if(globalTempElement.style.display == "block" && globalTempElement != getElementDrivArea){
			globalTempArea = document.getElementById("jsexTemDrivIni" + globalGetIni.toString());
			new Effect.Opacity($(globalTempElement.id), { from: 1.0, to: 0.0, duration: 0.5, afterFinish: function(){
				globalTempElement.style.display = "none";
				new Effect.Morph($(globalTempArea.id), { style: { height: '180px' }, duration: 0.5 });
			} });
			break;
		}
		globalGetIni++;
	}
	if(isActive){
		new Effect.Opacity($(getElementBioArea.id), { from: 1.0, to: 0.0, duration: 0.5, afterFinish: function(){
			getElementBioArea.style.display = "none";
			new Effect.Morph($(getElementDrivArea.id), { style: { height: '180px' }, duration: 0.5 });
		} });
	}else{
		new Effect.Morph($(getElementDrivArea.id), { style: { height: '550px' }, duration: 0.5, afterFinish: function(){
			new Effect.Opacity($(getElementBioArea.id), { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
				getElementBioArea.style.display = "block";
				new Effect.Opacity($(getElementBioArea.id), { from: 0.0, to: 1.0, duration: 0.5, afterFinish: function(){
					new Effect.ScrollTo($("jsexTemDrivAnc" + bioIni), { duration: 0.3, offset: -20 });
				} });
			} });
		} });
	}
}
/*-------------------------------------------------------*/
/*                      TEAM MISC                        */
/*-------------------------------------------------------*/
function temMiscBioEngine(elemLocation){
	var dynamicBoxes = new Array(), isActive = false, contentNode = null, childIni = 0, activeBox = null;
	dynamicBoxes[0] = elemLocation.parentNode.parentNode.parentNode.parentNode;
	dynamicBoxes[4] = elemLocation.parentNode.parentNode.parentNode.firstChild;
	while(dynamicBoxes[4].nodeName.toLowerCase() == "#text"){
		dynamicBoxes[4] = dynamicBoxes[4].nextSibling;
	}
	dynamicBoxes[5] = dynamicBoxes[0].previousSibling;
	while(dynamicBoxes[5].nodeName.toLowerCase() == "#text"){
		dynamicBoxes[5] = dynamicBoxes[5].previousSibling;
	}
	switch(dynamicBoxes[4].style.display){
		case "block":
			isActive = true;
		break;
		case "none":
		default:
			isActive = false;
		break;
	}
	contentNode = dynamicBoxes[0].parentNode;
	while(contentNode.childNodes[childIni]){
		if(contentNode.childNodes[childIni].nodeName.toLowerCase() == "div"){
			if(contentNode.childNodes[childIni].className == "temallrow"){
				for(tmbab=0;tmbab<contentNode.childNodes[childIni].childNodes.length;tmbab++){
					if(contentNode.childNodes[childIni].childNodes[tmbab].nodeName.toLowerCase() == "div"){
						if(contentNode.childNodes[childIni].childNodes[tmbab].className == "temallelementleft" || contentNode.childNodes[childIni].childNodes[tmbab].className == "temallelementmiddle" || contentNode.childNodes[childIni].childNodes[tmbab].className == "temallelementright"){
							for(tmbac=0;tmbac<contentNode.childNodes[childIni].childNodes[tmbab].childNodes.length;tmbac++){
								if(contentNode.childNodes[childIni].childNodes[tmbab].childNodes[tmbac].nodeName.toLowerCase() == "div"){
									if(contentNode.childNodes[childIni].childNodes[tmbab].childNodes[tmbac].className == "temalldetail"){
										if(contentNode.childNodes[childIni].childNodes[tmbab].childNodes[tmbac].style.display == "block" && contentNode.childNodes[childIni].childNodes[tmbab] != elemLocation.parentNode.parentNode.parentNode){
											activeBox = contentNode.childNodes[childIni].childNodes[tmbab];
										}
									}
								}
							}
						}
					}
				}
			}
		}
		childIni++;
	}
	if(activeBox){
		dynamicBoxes[10] = activeBox.parentNode;
		dynamicBoxes[9] = activeBox.firstChild;
		while(dynamicBoxes[9].nodeName.toLowerCase() == "#text"){
			dynamicBoxes[9] = dynamicBoxes[9].nextSibling;
		}
		switch(activeBox.className){
			case "temallelementleft":
				dynamicBoxes[6] = activeBox;
				dynamicBoxes[7] = dynamicBoxes[6].nextSibling;
				while(dynamicBoxes[7].nodeName.toLowerCase() == "#text"){
					dynamicBoxes[7] = dynamicBoxes[7].nextSibling;
					if(!dynamicBoxes[7]) break;
				}
				dynamicBoxes[8] = dynamicBoxes[7].nextSibling;
				while(dynamicBoxes[8].nodeName.toLowerCase() == "#text"){
					dynamicBoxes[8] = dynamicBoxes[8].nextSibling;
					if(!dynamicBoxes[8]) break;
				}
				if(dynamicBoxes[6].nodeName.toLowerCase() != "div") dynamicBoxes[6] = null;
				if(dynamicBoxes[7].nodeName.toLowerCase() != "div") dynamicBoxes[7] = null;
				if(dynamicBoxes[8].nodeName.toLowerCase() != "div") dynamicBoxes[8] = null;
				new Effect.Opacity(dynamicBoxes[9], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[9].style.display = "none";
					if(dynamicBoxes[7]){
						new Effect.Move(dynamicBoxes[7], { x: 190, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
							if(dynamicBoxes[8]){
								new Effect.Move(dynamicBoxes[8], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									if(activeBox.parentNode != dynamicBoxes[0]){
										new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
											temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
										 } });
									}else{
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									}
								} });
							}else{
								if(activeBox.parentNode != dynamicBoxes[0]){
									new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									 } });
								}else{
									temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
								}
							}
						} });
					}else{
						if(dynamicBoxes[8]){
							new Effect.Move(dynamicBoxes[8], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
								if(activeBox.parentNode != dynamicBoxes[0]){
									new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									 } });
								}else{
									temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
								}
							} });
						}else{
							if(activeBox.parentNode != dynamicBoxes[0]){
								new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
									temMiscBioEngineEditThis(elemLocation);
								 } });
							}else{
								temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
							}
						}
					}
				} });
			break;
			case "temallelementmiddle":
				dynamicBoxes[7] = activeBox;
				dynamicBoxes[6] = dynamicBoxes[7].previousSibling;
				while(dynamicBoxes[6].nodeName.toLowerCase() == "#text"){
					dynamicBoxes[6] = dynamicBoxes[6].previousSibling;
					if(!dynamicBoxes[6]) break;
				}
				dynamicBoxes[8] = dynamicBoxes[7].nextSibling;
				while(dynamicBoxes[8].nodeName.toLowerCase() == "#text"){
					dynamicBoxes[8] = dynamicBoxes[8].nextSibling;
					if(!dynamicBoxes[8]) break;
				}
				if(dynamicBoxes[6].nodeName.toLowerCase() != "div") dynamicBoxes[6] = null;
				if(dynamicBoxes[7].nodeName.toLowerCase() != "div") dynamicBoxes[7] = null;
				if(dynamicBoxes[8].nodeName.toLowerCase() != "div") dynamicBoxes[8] = null;
				new Effect.Opacity(dynamicBoxes[9], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[9].style.display = "none";
					if(dynamicBoxes[8]){
						new Effect.Move(dynamicBoxes[8], { x: 380, y: 260, mode: 'absolute', duration: 0.2, afterFinish: function(){
							new Effect.Move(dynamicBoxes[8], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
								if(activeBox.parentNode != dynamicBoxes[0]){
									new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									} });
								}else{
									temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
								}
							} });
						} });
					}else{
						if(activeBox.parentNode != dynamicBoxes[0]){
							new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
								temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
							} });
						}else{
							temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
						}
					}
				} });
			break;
			case "temallelementright":
				dynamicBoxes[8] = activeBox;
				dynamicBoxes[7] = activeBox.previousSibling;
				while(dynamicBoxes[7].nodeName.toLowerCase() == "#text"){
					dynamicBoxes[7] = dynamicBoxes[7].previousSibling;
					if(!dynamicBoxes[7]) break;
				}
				if(dynamicBoxes[7].nodeName.toLowerCase() == "div"){
					dynamicBoxes[6] = dynamicBoxes[7].previousSibling;
					while(dynamicBoxes[6].nodeName.toLowerCase() == "#text"){
						dynamicBoxes[6] = dynamicBoxes[6].previousSibling;
						if(!dynamicBoxes[6]) break;
					}
				}
				if(dynamicBoxes[6].nodeName.toLowerCase() != "div") dynamicBoxes[6] = null;
				if(dynamicBoxes[7].nodeName.toLowerCase() != "div") dynamicBoxes[7] = null;
				if(dynamicBoxes[8].nodeName.toLowerCase() != "div") dynamicBoxes[8] = null;
				new Effect.Opacity(dynamicBoxes[9], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[9].style.display = "none";
					new Effect.Move(dynamicBoxes[8], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
						if(dynamicBoxes[7]){
							new Effect.Move(dynamicBoxes[7], { x: 190, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
								if(dynamicBoxes[6]){
									new Effect.Move(dynamicBoxes[6], { x: 0, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
										if(activeBox.parentNode != dynamicBoxes[0]){
											new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
												temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
											} });
										}else{
											temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
										}
									} });
								}else{
									if(activeBox.parentNode != dynamicBoxes[0]){
										new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
											temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
										} });
									}else{
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									}
								}
							} });
						}else{
							if(dynamicBoxes[6]){
								new Effect.Move(dynamicBoxes[6], { x: 0, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									if(activeBox.parentNode != dynamicBoxes[0]){
										new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
											temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
										} });
									}else{
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									}
								} });
							}else{
								if(activeBox.parentNode != dynamicBoxes[0]){
									new Effect.Morph(dynamicBoxes[10], { style: { height: '255px' }, duration: 0.2, afterFinish: function(){
										temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
									} });
								}else{
									temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
								}
							}
						}
					} });
				} });
			break;
		}
	}else{
		temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive);
	}
}
function temMiscBioEngineEditThis(elemLocation, dynamicBoxes, isActive){
	switch(elemLocation.parentNode.parentNode.parentNode.className){
		case "temallelementleft":
			dynamicBoxes[1] = elemLocation.parentNode.parentNode.parentNode;
			dynamicBoxes[2] = dynamicBoxes[1].nextSibling;
			while(dynamicBoxes[2].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[2] = dynamicBoxes[2].nextSibling;
				if(!dynamicBoxes[2]) break;
			}
			dynamicBoxes[3] = dynamicBoxes[2].nextSibling;
			while(dynamicBoxes[3].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[3] = dynamicBoxes[3].nextSibling;
				if(!dynamicBoxes[3]) break;
			}
			for(tmbaa=1;tmbaa<=3;tmbaa++){
				if(dynamicBoxes[tmbaa].nodeName.toLowerCase() != "div") dynamicBoxes[tmbaa] = null;
			}
			if(!isActive){
				new Effect.Morph(dynamicBoxes[0], { style: { height: '670px' }, duration: 0.3, afterFinish: function(){
					if(dynamicBoxes[3]){
						new Effect.Move(dynamicBoxes[3], { x: 380, y: 260, mode: 'absolute', duration: 0.2, afterFinish: function(){
							if(dynamicBoxes[2]){
								new Effect.Move(dynamicBoxes[2], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
										dynamicBoxes[4].style.display = "block";
										new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
											new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
										} });
									} });
								} });
							}else{
								new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
									dynamicBoxes[4].style.display = "block";
									new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
										new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
									} });
								} });
							}
						} });
					}else{
						new Effect.Move(dynamicBoxes[2], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
							new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
								dynamicBoxes[4].style.display = "block";
								new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
									new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
								} });
							} });
						} });
					}
				} });
			}else{
				new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[4].style.display = "none";
					if(dynamicBoxes){
						new Effect.Move(dynamicBoxes[2], { x: 190, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
							if(dynamicBoxes[3]){
								new Effect.Move(dynamicBoxes[3], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
								} });
							}else{
								new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
							}
						} });
					}else{
						if(dynamicBoxes[3]){
							new Effect.Move(dynamicBoxes[3], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
								new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
							} });
						}else{
							new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
						}
					}
				} });
			}
		break;
		case "temallelementmiddle":
			dynamicBoxes[2] = elemLocation.parentNode.parentNode.parentNode;
			dynamicBoxes[1] = dynamicBoxes[2].previousSibling;
			while(dynamicBoxes[1].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[1] = dynamicBoxes[1].previousSibling;
				if(!dynamicBoxes[1]) break;
			}
			dynamicBoxes[3] = dynamicBoxes[2].nextSibling;
			while(dynamicBoxes[3].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[3] = dynamicBoxes[3].nextSibling;
				if(!dynamicBoxes[3]) break;
			}
			for(tmbaa=1;tmbaa<=3;tmbaa++){
				if(dynamicBoxes[tmbaa].nodeName.toLowerCase() != "div") dynamicBoxes[tmbaa] = null;
			}
			if(!isActive){
				new Effect.Morph(dynamicBoxes[0], { style: { height: '670px' }, duration: 0.3, afterFinish: function(){
					if(dynamicBoxes[3]){
						new Effect.Move(dynamicBoxes[3], { x: 380, y: 260, mode: 'absolute', duration: 0.2, afterFinish: function(){
							new Effect.Move(dynamicBoxes[3], { x: 0, y: 260, mode: 'absolute', duration: 0.2, afterFinish: function(){
								new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
									dynamicBoxes[4].style.display = "block";
									new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
										new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
									} });
								} });
							} });
						} });
					}else{
						new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
							dynamicBoxes[4].style.display = "block";
							new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
								new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
							} });
						} });
					}
				} });
			}else{
				new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[4].style.display = "none";
					if(dynamicBoxes[3]){
						new Effect.Move(dynamicBoxes[3], { x: 380, y: 260, mode: 'absolute', duration: 0.2, afterFinish: function(){
							new Effect.Move(dynamicBoxes[3], { x: 380, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
								new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
							} });
						} });
					}else{
						new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
					}
				} });
			}
		break;
		case "temallelementright":
			dynamicBoxes[3] = elemLocation.parentNode.parentNode.parentNode;
			dynamicBoxes[2] = dynamicBoxes[3].previousSibling;
			while(dynamicBoxes[2].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[2] = dynamicBoxes[2].previousSibling;
			}
			dynamicBoxes[1] = dynamicBoxes[2].previousSibling;
			while(dynamicBoxes[1].nodeName.toLowerCase() == "#text"){
				dynamicBoxes[1] = dynamicBoxes[1].previousSibling;
			}
			for(tmbaa=1;tmbaa<=3;tmbaa++){
				if(dynamicBoxes[tmbaa].nodeName.toLowerCase() != "div") dynamicBoxes[tmbaa] = null;
			}
			if(!isActive){
				new Effect.Morph(dynamicBoxes[0], { style: { height: '670px' }, duration: 0.3, afterFinish: function(){
					if(dynamicBoxes[1]){
						new Effect.Move(dynamicBoxes[1], { x: 0, y: 260, mode: 'absolute', duration: 0.3, afterFinish: function(){
							if(dynamicBoxes[2]){
								new Effect.Move(dynamicBoxes[2], { x: 0, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
									if(dynamicBoxes[3]){
										new Effect.Move(dynamicBoxes[3], { x: 190, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
											new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
												dynamicBoxes[4].style.display = "block";
												new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
													new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
												} });
											} });
										} });
									}else{
										new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
											dynamicBoxes[4].style.display = "block";
											new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
												new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
											} });
										} });
									}
								} });
							}else{
								if(dynamicBoxes[3]){
									new Effect.Move(dynamicBoxes[3], { x: 190, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
										new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
											dynamicBoxes[4].style.display = "block";
											new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
												new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
											} });
										} });
									} });
								}else{
									new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
										dynamicBoxes[4].style.display = "block";
										new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
											new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
										} });
									} });
								}
							}
						} });
					}else{
						if(dynamicBoxes[2]){
							new Effect.Move(dynamicBoxes[2], { x: 0, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
								if(dynamixBoxes[3]){
									new Effect.Move(dynamicBoxes[3], { x: 190, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
										new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
											dynamicBoxes[4].style.display = "block";
											new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
												new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
											} });
										} });
									} });
								}else{
									new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
										dynamicBoxes[4].style.display = "block";
										new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
											new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
										} });
									} });
								}
							} });
						}else{
							if(dynamixBoxes[3]){
								new Effect.Move(dynamicBoxes[3], { x: 190, y: 0, mode: 'absolute', duration: 0.3, afterFinish: function(){
									new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
										dynamicBoxes[4].style.display = "block";
										new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
											new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
										} });
									} });
								} });
							}else{
								new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.1, afterFinish: function(){
									dynamicBoxes[4].style.display = "block";
									new Effect.Opacity(dynamicBoxes[4], { from: 0.0, to: 1.0, duration: 0.3, afterFinish: function(){
										new Effect.ScrollTo($(dynamicBoxes[5]), { duration: 0.2 });
									} });
								} });
							}
						}
					}
				} });
			}else{
				new Effect.Opacity(dynamicBoxes[4], { from: 1.0, to: 0.0, duration: 0.2, afterFinish: function(){
					dynamicBoxes[4].style.display = "none";
					if(dynamicBoxes[3]){
						new Effect.Move(dynamicBoxes[3], { x: 390, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
							if(dynamicBoxes[2]){
								new Effect.Move(dynamicBoxes[2], { x: 190, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									if(dynamicBoxes[1]){
										new Effect.Move(dynamicBoxes[1], { x: 0, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
											new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
										} });
									}else{
										new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
									}
								} });
							}else{
								if(dynamicBoxes[1]){
									new Effect.Move(dynamicBoxes[1], { x: 0, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
										new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
									} });
								}else{
									new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
								}
							}
						} });
					}else{
						new Effect.Move(dynamicBoxes[2], { x: 190, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
							if(dynamicBoxes[1]){
								new Effect.Move(dynamicBoxes[1], { x: 0, y: 0, mode: 'absolute', duration: 0.2, afterFinish: function(){
									new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
								} });
							}else{
								new Effect.Morph(dynamicBoxes[0], { style: { height: '255px' }, duration: 0.2 });
							}
						} });
					}
				} });
			}
		break;
	}
}
