function init() {
	initImageProtect();
	initLightbox();
	oPortfolio.init();
	oArchitecture.init();
	oIndustry.init();
	oLandscape.init();
	oDocu.init();
	oImpressions.init();
	oNews.init();
	oRepresented.init();
	oClients.init();
	oImprint.init();
	oPrevious.init();
	oForward.init();
	oArchiveThumbsTable.init();
	oLightbox.init();
	obtnClose.init();
	oAddToLightBox.init();
	obtnDelete.init();
	obtnSend.init();
	try {
	  setUnten();
        }
        catch(e) {}
}

//////////// START CROSS FADE ////////////
// JavaScript Document
// IXF1.11 :: Image cross-fade 
// *****************************************************
// DOM scripting by brothercake -- http://www.brothercake.com/
//******************************************************
//global object
var ixf = { 'clock' : null, 'count' : 1 }
/*******************************************************



/*****************************************************************************
 List the images that need to be cached
*****************************************************************************/

ixf.imgs = [
	'_img/default_content.jpg',
	'_img/portfolio/portfolio.jpg',
	'_img/news/news.jpg',
	'_img/represented/represented.jpg',
	'_img/clients/clients.jpg',
	'_img/imprint/imprint.jpg',
	'_img/portfolio/architecture/architecture_1.jpg',
	'_img/portfolio/architecture/architecture_2.jpg',
	'_img/portfolio/architecture/architecture_3.jpg',
	'_img/portfolio/architecture/architecture_4.jpg',
	'_img/portfolio/architecture/architecture_5.jpg',
	'_img/portfolio/architecture/architecture_6.jpg',
	'_img/portfolio/architecture/architecture_7.jpg',
	'_img/portfolio/architecture/architecture_8.jpg',
	'_img/portfolio/architecture/architecture_9.jpg',
	'_img/portfolio/architecture/architecture_10.jpg',
	'_img/portfolio/architecture/architecture_11.jpg',
	'_img/portfolio/architecture/architecture_12.jpg',
	'_img/portfolio/architecture/architecture_13.jpg',
	'_img/portfolio/architecture/architecture_14.jpg',
	'_img/portfolio/architecture/architecture_15.jpg',
	'_img/portfolio/industry/industry_1.jpg',
	'_img/portfolio/industry/industry_2.jpg',
	'_img/portfolio/industry/industry_3.jpg',
	'_img/portfolio/industry/industry_4.jpg',
	'_img/portfolio/industry/industry_5.jpg',
	'_img/portfolio/industry/industry_6.jpg',
	'_img/portfolio/industry/industry_7.jpg',
	'_img/portfolio/industry/industry_8.jpg',
	'_img/portfolio/industry/industry_9.jpg',
	'_img/portfolio/industry/industry_10.jpg',
	'_img/portfolio/industry/industry_11.jpg',
	'_img/portfolio/industry/industry_12.jpg',
	'_img/portfolio/industry/industry_13.jpg',
	'_img/portfolio/industry/industry_14.jpg',
	'_img/portfolio/industry/industry_15.jpg',
	'_img/portfolio/landscape/landscape_1.jpg',
	'_img/portfolio/landscape/landscape_2.jpg',
	'_img/portfolio/landscape/landscape_3.jpg',
	'_img/portfolio/landscape/landscape_4.jpg',
	'_img/portfolio/landscape/landscape_5.jpg',
	'_img/portfolio/landscape/landscape_6.jpg',
	'_img/portfolio/landscape/landscape_7.jpg',
	'_img/portfolio/landscape/landscape_8.jpg',
	'_img/portfolio/landscape/landscape_9.jpg',
	'_img/portfolio/landscape/landscape_10.jpg',
	'_img/portfolio/landscape/landscape_11.jpg',
	'_img/portfolio/landscape/landscape_12.jpg',
	'_img/portfolio/landscape/landscape_13.jpg',
	'_img/portfolio/landscape/landscape_14.jpg',
	'_img/portfolio/landscape/landscape_15.jpg',
	'_img/portfolio/docu/docu_1.jpg',
	'_img/portfolio/docu/docu_2.jpg',
	'_img/portfolio/docu/docu_3.jpg',
	'_img/portfolio/docu/docu_4.jpg',
	'_img/portfolio/docu/docu_5.jpg',
	'_img/portfolio/docu/docu_6.jpg',
	'_img/portfolio/docu/docu_7.jpg',
	'_img/portfolio/docu/docu_8.jpg',
	'_img/portfolio/docu/docu_9.jpg',
	'_img/portfolio/docu/docu_10.jpg',
	'_img/portfolio/docu/docu_11.jpg',
	'_img/portfolio/docu/docu_12.jpg',
	'_img/portfolio/docu/docu_13.jpg',
	'_img/portfolio/docu/docu_14.jpg',
	'_img/portfolio/docu/docu_15.jpg',
	'_img/portfolio/impressions/impressions_1.jpg',
	'_img/portfolio/impressions/impressions_2.jpg',
	'_img/portfolio/impressions/impressions_3.jpg',
	'_img/portfolio/impressions/impressions_4.jpg',
	'_img/portfolio/impressions/impressions_5.jpg',
	'_img/portfolio/impressions/impressions_6.jpg',
	'_img/portfolio/impressions/impressions_7.jpg',
	'_img/portfolio/impressions/impressions_8.jpg',
	'_img/portfolio/impressions/impressions_9.jpg',
	'_img/portfolio/impressions/impressions_10.jpg',
	'_img/portfolio/impressions/impressions_11.jpg',
	'_img/portfolio/impressions/impressions_12.jpg',
	'_img/portfolio/impressions/impressions_13.jpg',
	'_img/portfolio/impressions/impressions_14.jpg',
	'_img/portfolio/impressions/impressions_15.jpg'
	];

/*****************************************************************************
*****************************************************************************/

//cache the images
ixf.imgsLen = ixf.imgs.length;
ixf.cache = [];
for(var i=0; i<ixf.imgsLen; i++) {
	ixf.cache[i] = new Image;
	ixf.cache[i].src = ixf.imgs[i];
}


//crossfade setup function
function crossfade() {
	//if the timer is not already going
	if(ixf.clock == null) {
		//copy the image object 
		ixf.obj = arguments[0];
		
		//copy the image src argument 
		ixf.src = arguments[1];
		
		//store the supported form of opacity
		if(typeof ixf.obj.style.opacity != 'undefined')
		{
			ixf.type = 'w3c';
		}
		else if(typeof ixf.obj.style.MozOpacity != 'undefined')
		{
			ixf.type = 'moz';
		}
		else if(typeof ixf.obj.style.KhtmlOpacity != 'undefined')
		{
			ixf.type = 'khtml';
		}
		else if(typeof ixf.obj.filters == 'object')
		{
			//weed out win/ie5.0 by testing the length of the filters collection (where filters is an object with no data)
			//then weed out mac/ie5 by testing first the existence of the alpha object (to prevent errors in win/ie5.0)
			//then the returned value type, which should be a number, but in mac/ie5 is an empty string
			ixf.type = (ixf.obj.filters.length > 0 && typeof ixf.obj.filters.alpha == 'object' && typeof ixf.obj.filters.alpha.opacity == 'number') ? 'ie' : 'none';
		}
		else
		{
			ixf.type = 'none';
		}
		
		//change the image alt text if defined
		if(typeof arguments[3] != 'undefined' && arguments[3] != '')
		{
			ixf.obj.alt = arguments[3];
		}
		
		//if any kind of opacity is supported
		if(ixf.type != 'none')
		{
			//create a new image object and append it to body
			//detecting support for namespaced element creation, in case we're in the XML DOM
			ixf.newimg = document.getElementsByTagName('body')[0].appendChild((typeof document.createElementNS != 'undefined') ? document.createElementNS('http://www.w3.org/1999/xhtml', 'img') : document.createElement('img'));

			//set image z-index to "80" so that it stays under the light box
			ixf.newimg.style.zIndex = 80;
			
			//set positioning classname
			ixf.newimg.className = 'idupe';
			
			//set src to new image src
			ixf.newimg.src = ixf.src;

			//move it to superimpose original image
			ixf.newimg.style.left = ixf.getRealPosition(ixf.obj, 'x') + 'px';
			ixf.newimg.style.top = ixf.getRealPosition(ixf.obj, 'y') + 'px';
			
			//copy and convert fade duration argument 
			ixf.length = parseInt(arguments[2], 10) * 1000;
			
			//create fade resolution argument as 20 steps per transition
			ixf.resolution = parseInt(arguments[2], 10) * 20;
			
			//start the timer
			ixf.clock = setInterval('ixf.crossfade()', ixf.length/ixf.resolution);
		}
		
		//otherwise if opacity is not supported
		else
		{
			//just do the image swap
			ixf.obj.src = ixf.src;
		}
		
	}
};


//crossfade timer function
ixf.crossfade = function() {
	//decrease the counter on a linear scale
	ixf.count -= (1 / ixf.resolution);
	
	//if the counter has reached the bottom
	if(ixf.count < (1 / ixf.resolution))
	{
		//clear the timer
		clearInterval(ixf.clock);
		ixf.clock = null;
		
		//reset the counter
		ixf.count = 1;
		
		//set the original image to the src of the new image
		ixf.obj.src = ixf.src;
	}
	
	//set new opacity value on both elements
	//using whatever method is supported
	switch(ixf.type) {
		case 'ie' :
			ixf.obj.filters.alpha.opacity = ixf.count * 100;
			ixf.newimg.filters.alpha.opacity = (1 - ixf.count) * 100;
			break;
			
		case 'khtml' :
			ixf.obj.style.KhtmlOpacity = ixf.count;
			ixf.newimg.style.KhtmlOpacity = (1 - ixf.count);
			break;
			
		case 'moz' : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf.obj.style.MozOpacity = (ixf.count == 1 ? 0.9999999 : ixf.count);
			ixf.newimg.style.MozOpacity = (1 - ixf.count);
			break;
			
		default : 
			//restrict max opacity to prevent a visual popping effect in firefox
			ixf.obj.style.opacity = (ixf.count == 1 ? 0.9999999 : ixf.count);
			ixf.newimg.style.opacity = (1 - ixf.count);
	}
	
	//now that we've gone through one fade iteration 
	//we can show the image that's fading in
	ixf.newimg.style.visibility = 'visible';
	
	//keep new image in position with original image
	//in case text size changes mid transition or something
	ixf.newimg.style.left = ixf.getRealPosition(ixf.obj, 'x') + 'px';
	ixf.newimg.style.top = ixf.getRealPosition(ixf.obj, 'y') + 'px';
	
	//if the counter is at the top, which is just after the timer has finished
	if(ixf.count == 1)
	{
		//remove the duplicate image
		ixf.newimg.parentNode.removeChild(ixf.newimg);
	}
};



//get real position method
ixf.getRealPosition = function()
{
	this.pos = (arguments[1] == 'x') ? arguments[0].offsetLeft : arguments[0].offsetTop;
	this.tmp = arguments[0].offsetParent;
	while(this.tmp != null)
	{
		this.pos += (arguments[1] == 'x') ? this.tmp.offsetLeft : this.tmp.offsetTop;
		this.tmp = this.tmp.offsetParent;
	}
	
	return this.pos;
};

//////////// END CROSS FADE ////////////

////////// START LIGHTBOX //////////////////
// -----------------------------------------------------------------------------------
//
//	Lightbox v2.02
//	by Lokesh Dhakar - http://www.huddletogether.com
//	3/31/06
//
//	For more information on this script, visit:
//	http://huddletogether.com/projects/lightbox2/
//
//	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
//	
//	Credit also due to those who have helped, inspired, and made their code available to the public.
//	Including: Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.org), Thomas Fuchs(mir.aculo.us), and others.
//
//
// -----------------------------------------------------------------------------------
/*

	Table of Contents
	-----------------
	Configuration
	Global Variables

	Extending Built-in Objects	
	- Object.extend(Element)
	- Array.prototype.removeDuplicates()
	- Array.prototype.empty()

	Lightbox Class Declaration
	- initialize()
	- start()
	- changeImage()
	- resizeImageContainer()
	- showImage()
	- updateDetails()
	- updateNav()
	- enableKeyboardNav()
	- disableKeyboardNav()
	- keyboardAction()
	- preloadNeighborImages()
	- end()
	
	Miscellaneous Functions
	- getPageScroll()
	- getPageSize()
	- getKey()
	- listenKey()
	- showSelectBoxes()
	- hideSelectBoxes()
	- pause()
	- initLightbox()
	
	Function Calls
	- addLoadEvent(initLightbox)
	
*/
// -----------------------------------------------------------------------------------

//
//	Configuration
//
var fileLoadingImage = "_img/loading.gif";		
//var fileBottomNavCloseImage = "_img/closelabel.gif";
var filePreviousButtonImage = "_img/previous_button.gif";
var fileButtonCloseLightboxImage = "_img/btn_close_lightbox.gif";
var fileaForwardButtonImage = "_img/forward_button.gif";
var fileaddToLightBoxButtonImage = "_img/add_to_lightbox_botton_02.gif";

var resizeSpeed = 7;	// controls the speed of the image resizing (1=slowest and 10=fastest)

var borderSize = 1;	//if you adjust the padding in the CSS, you will need to update this variable

// -----------------------------------------------------------------------------------

//
//	Global Variables
//
var imageArray = new Array;
var activeImage;

if(resizeSpeed > 10){ resizeSpeed = 10;}
if(resizeSpeed < 1){ resizeSpeed = 1;}
resizeDuration = (11 - resizeSpeed) * 0.15;

// -----------------------------------------------------------------------------------

//
//	Additional methods for Element added by SU, Couloir
//	- further additions by Lokesh Dhakar (huddletogether.com)
//
Object.extend(Element, {
	getWidth: function(element) {
	   	element = $(element);
	   	return element.offsetWidth; 
	},
	setWidth: function(element,w) {
	   	element = $(element);
    	element.style.width = w +"px";
	},
	setHeight: function(element,h) {
   		element = $(element);
    	element.style.height = h +"px";
	},
	setTop: function(element,t) {
	   	element = $(element);
    	element.style.top = t +"px";
	},
	setSrc: function(element,src) {
    	element = $(element);
    	element.src = src; 
	},
	setHref: function(element,href) {
    	element = $(element);
    	element.href = href; 
	},
	setInnerHTML: function(element,content) {
		element = $(element);
		element.innerHTML = content;
	}
});

// -----------------------------------------------------------------------------------

//
//	Extending built-in Array object
//	- array.removeDuplicates()
//	- array.empty()
//
Array.prototype.removeDuplicates = function () {
	for(i = 1; i < this.length; i++){
		if(this[i][0] == this[i-1][0]){
			this.splice(i,1);
		}
	}
}

// -----------------------------------------------------------------------------------

Array.prototype.empty = function () {
	for(i = 0; i <= this.length; i++){
		this.shift();
	}
}

// -----------------------------------------------------------------------------------

//
//	Lightbox Class Declaration
//	- initialize()
//	- start()
//	- changeImage()
//	- resizeImageContainer()
//	- showImage()
//	- updateDetails()
//	- updateNav()
//	- enableKeyboardNav()
//	- disableKeyboardNav()
//	- keyboardNavAction()
//	- preloadNeighborImages()
//	- end()
//
//	Structuring of code inspired by Scott Upton (http://www.uptonic.com/)
//
var Lightbox = Class.create();

Lightbox.prototype = {
	
	// initialize()
	// Constructor runs on completion of the DOM loading. Loops through anchor tags looking for 
	// 'lightbox' references and applies onclick events to appropriate links. The 2nd section of
	// the function inserts html at the bottom of the page which is used to display the shadow 
	// overlay and the image container.
	//
	initialize: function() {	
		if (!document.getElementsByTagName){ return; }
		var anchors = document.getElementsByTagName('a');

		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				anchor.onclick = function () {myLightbox.start(this); return false;}
			}
		}

		// The rest of this code inserts html at the bottom of the page that looks similar to this:
		//
		//	<div id="overlay"></div>
		//	<div id="lightbox">
		//		<div id="outerImageContainer">
		//			<div id="imageContainer">
		//				<img id="lightboxImage">
		//				<div style="" id="hoverNav">
		//					<a href="#" id="prevLink"></a>
		//					<a href="#" id="nextLink"></a>
		//				</div>
		//				<div id="loading">
		//					<a href="#" id="loadingLink">
		//						<img src="images/loading.gif">
		//					</a>
		//				</div>
		//			</div>
		//		</div>
		//		<div id="imageDataContainer">
		//			<div id="imageData">
		//				<div id="imageDetails">
		//					<span id="caption"></span>
		//					<span id="numberDisplay"></span>
		//				</div>
		//				<div id="bottomNav">
		//					<a href="#" id="bottomNavClose">
		//						<img src="images/close.gif">
		//					</a>
		//				</div>
		//			</div>
		//		</div>
		//	</div>


		var objBody = document.getElementsByTagName("body").item(0);
		
		var objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','overlay');
		objOverlay.style.display = 'none';
		objOverlay.onclick = function() { myLightbox.end(); return false; }
		objBody.appendChild(objOverlay);
		
		var objLightbox = document.createElement("div");
		objLightbox.setAttribute('id','lightbox');
		objLightbox.style.display = 'none';
		objBody.appendChild(objLightbox);
	
		var objOuterImageContainer = document.createElement("div");
		objOuterImageContainer.setAttribute('id','outerImageContainer');
		objLightbox.appendChild(objOuterImageContainer);
		
		// create the lightbox controls
		var objlightBoxControls02 = document.createElement("div");
		objlightBoxControls02.setAttribute('id','lightBoxControls02');
		objLightbox.appendChild(objlightBoxControls02);
		
		var objimageCollection02 = document.createElement("div");
		objimageCollection02.setAttribute('id','imageCollection02');
		objlightBoxControls02.appendChild(objimageCollection02);
	
		var objaPrevious = document.createElement("a");
		objaPrevious.setAttribute('id','aPrevious');
		objaPrevious.setAttribute('href','javascript:void%200');
		objaPrevious.onclick = function() { myLightbox.movePrevious(); return false; }
		objimageCollection02.appendChild(objaPrevious);
	
		var objPreviousButtonImage = document.createElement("img");
		objPreviousButtonImage.setAttribute('src', filePreviousButtonImage);
		objaPrevious.appendChild(objPreviousButtonImage);
	
		var objButtonCloseLightboxLink = document.createElement("a");
		objButtonCloseLightboxLink.setAttribute('id','closeLightbox');
		objButtonCloseLightboxLink.setAttribute('href','javascript:void%200');
		objButtonCloseLightboxLink.onclick = function() { myLightbox.end(); return false; }
		objimageCollection02.appendChild(objButtonCloseLightboxLink);
	
		var objButtonCloseLightboxImage = document.createElement("img");
		objButtonCloseLightboxImage.setAttribute('src', fileButtonCloseLightboxImage);
		objButtonCloseLightboxLink.appendChild(objButtonCloseLightboxImage);
	
		var objaForward = document.createElement("a");
		objaForward.setAttribute('id','aForward');
		objaForward.setAttribute('href','javascript:void%200');
		objaForward.onclick = function() { myLightbox.moveForward(); return false; }
		objimageCollection02.appendChild(objaForward);
	
		var objaForwardButtonImage = document.createElement("img");
		objaForwardButtonImage.setAttribute('src', fileaForwardButtonImage);
		objaForward.appendChild(objaForwardButtonImage);
		
		var objaddToLightBox02 = document.createElement("div");
		objaddToLightBox02.setAttribute('id','addToLightBox02');
		objlightBoxControls02.appendChild(objaddToLightBox02);
	
		var objaAddToLightBoxLink = document.createElement("a");
		objaAddToLightBoxLink.setAttribute('id','aAddToLightBox02');
		objaAddToLightBoxLink.setAttribute('href','javascript:void%200');
		objaAddToLightBoxLink.onclick = function() { myLightbox.addThisToLightBox(); return false; }
		objaAddToLightBoxLink.setAttribute('title','click to add images to LIGHTBOX collection');
		objaddToLightBox02.appendChild(objaAddToLightBoxLink);		
	
		var objaddToLightBoxButtonImage = document.createElement("img");
		objaddToLightBoxButtonImage.setAttribute('src', fileaddToLightBoxButtonImage);
		objaAddToLightBoxLink.appendChild(objaddToLightBoxButtonImage);
		//// END

		var objImageContainer = document.createElement("div");
		objImageContainer.setAttribute('id','imageContainer');
		objOuterImageContainer.appendChild(objImageContainer);
	
		var objLightboxImage = document.createElement("img");
		objLightboxImage.setAttribute('id','lightboxImage');
		objLightboxImage.setAttribute('class','baseImg01');
		objImageContainer.appendChild(objLightboxImage);
	
		var objHoverNav = document.createElement("div");
		objHoverNav.setAttribute('id','hoverNav');
		objImageContainer.appendChild(objHoverNav);
	
		var objPrevLink = document.createElement("a");
		objPrevLink.setAttribute('id','prevLink');
		objPrevLink.setAttribute('href','#');
		objHoverNav.appendChild(objPrevLink);
		
		var objNextLink = document.createElement("a");
		objNextLink.setAttribute('id','nextLink');
		objNextLink.setAttribute('href','#');
		objHoverNav.appendChild(objNextLink);
	
		var objLoading = document.createElement("div");
		objLoading.setAttribute('id','loading');
		objImageContainer.appendChild(objLoading);
	
		var objLoadingLink = document.createElement("a");
		objLoadingLink.setAttribute('id','loadingLink');
		objLoadingLink.setAttribute('href','#');
		objLoadingLink.onclick = function() { myLightbox.end(); return false; }
		objLoading.appendChild(objLoadingLink);
	
		var objLoadingImage = document.createElement("img");
		objLoadingImage.setAttribute('src', fileLoadingImage);
		objLoadingLink.appendChild(objLoadingImage);

		var objImageDataContainer = document.createElement("div");
		objImageDataContainer.setAttribute('id','imageDataContainer');
		objImageDataContainer.className = 'clearfix';
		objLightbox.appendChild(objImageDataContainer);

		var objImageData = document.createElement("div");
		objImageData.setAttribute('id','imageData');
		objImageDataContainer.appendChild(objImageData);
	
		var objImageDetails = document.createElement("div");
		objImageDetails.setAttribute('id','imageDetails');
		objImageData.appendChild(objImageDetails);
	
		var objCaption = document.createElement("span");
		objCaption.setAttribute('id','caption');
		objImageDetails.appendChild(objCaption);
	
		var objNumberDisplay = document.createElement("span");
		objNumberDisplay.setAttribute('id','numberDisplay');
		objImageDetails.appendChild(objNumberDisplay);
		
		var objBottomNav = document.createElement("div");
		objBottomNav.setAttribute('id','bottomNav');
		objImageData.appendChild(objBottomNav);
	/*
		var objBottomNavCloseLink = document.createElement("a");
		objBottomNavCloseLink.setAttribute('id','bottomNavClose');
		objBottomNavCloseLink.setAttribute('href','#');
		objBottomNavCloseLink.onclick = function() { myLightbox.end(); return false; }
		objBottomNav.appendChild(objBottomNavCloseLink);
	
		var objBottomNavCloseImage = document.createElement("img");
		objBottomNavCloseImage.setAttribute('src', fileBottomNavCloseImage);
		objBottomNavCloseLink.appendChild(objBottomNavCloseImage);
	*/
	},
	
	//
	//	start()
	//	Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
	//
	start: function(imageLink) {	

		hideSelectBoxes();

		// stretch overlay to fill page and fade in
		var arrayPageSize = getPageSize();
		Element.setHeight('overlay', arrayPageSize[1]);
		new Effect.Appear('overlay', { duration: 0.0, from: 0.0, to: 0.99 });

		imageArray = [];
		imageNum = 0;		

		if (!document.getElementsByTagName){ return; }
		var anchors = document.getElementsByTagName('a');

		// if image is NOT part of a set..
		if((imageLink.getAttribute('rel') == 'lightbox')){
			// add single image to imageArray
			imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));
		} else {
		// if image is part of a set..

			// loop through anchors, find other images in set, and add them to imageArray
			for (var i=0; i<anchors.length; i++){
				var anchor = anchors[i];
				if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))) {
					imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
				}
			}
			imageArray.removeDuplicates();
			while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;}
		}

		// calculate top offset for the lightbox and display 
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15);

		Element.setTop('lightbox', lightboxTop);
		Element.show('lightbox');
		
		this.changeImage(imageNum);
	},

	//
	//	changeImage()
	//	Hide most elements and preload image in preparation for resizing image container.
	//
	changeImage: function(imageNum) {	
		
		activeImage = imageNum;	// update global var

		// hide elements during transition
		Element.show('loading');
		Element.hide('lightboxImage');
		Element.hide('hoverNav');
		Element.hide('prevLink');
		Element.hide('nextLink');
		Element.hide('imageDataContainer');
		Element.hide('numberDisplay');		
		
		imgPreloader = new Image();
		
		// once image is preloaded, resize image container
		imgPreloader.onload=function(){
			Element.setSrc('lightboxImage', imageArray[activeImage][0]);
			myLightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height);
		}
		imgPreloader.src = imageArray[activeImage][0];
	},

	//
	//	resizeImageContainer()
	//
	resizeImageContainer: function( imgWidth, imgHeight) {

		// get current height and width
		this.wCur = Element.getWidth('outerImageContainer');
		this.hCur = Element.getHeight('outerImageContainer');

		// scalars based on change from old to new
		this.xScale = ((imgWidth  + (borderSize * 2)) / this.wCur) * 100;
		this.yScale = ((imgHeight  + (borderSize * 2)) / this.hCur) * 100;

		// calculate size difference between new and old image, and resize if necessary
		wDiff = (this.wCur - borderSize * 2) - imgWidth;
		hDiff = (this.hCur - borderSize * 2) - imgHeight;

		if(!( hDiff == 0)){ new Effect.Scale('outerImageContainer', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); }
		if(!( wDiff == 0)){ new Effect.Scale('outerImageContainer', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); }

		// if new and old image are same size and no scaling transition is necessary, 
		// do a quick pause to prevent image flicker.
		if((hDiff == 0) && (wDiff == 0)){
			if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} 
		}

		Element.setHeight('prevLink', imgHeight);
		Element.setHeight('nextLink', imgHeight);
		Element.setWidth( 'imageDataContainer', imgWidth + (borderSize * 2));

		this.showImage();
	},
	
	//
	//	showImage()
	//	Display image and begin preloading neighbors.
	//
	showImage: function(){
		Element.hide('loading');
		new Effect.Appear('lightboxImage', { duration: 0.5, queue: 'end' });
		//new Effect.Appear('lightboxImage', { duration: 0.5, queue: 'end', afterFinish: function(){	myLightbox.updateDetails(); } });
		this.preloadNeighborImages();
	},
	/*
	//
	//	updateDetails()
	//	Display caption, image number, and bottom nav.
	//
	updateDetails: function() {
	
		Element.show('caption');
		Element.setInnerHTML( 'caption', imageArray[activeImage][1]);
		
		// if image is part of set display 'Image x of x' 
		if(imageArray.length > 1){
			Element.show('numberDisplay');
			Element.setInnerHTML( 'numberDisplay', "Image " + eval(activeImage + 1) + " of " + imageArray.length);
		}

		new Effect.Parallel(
			[ new Effect.SlideDown( 'imageDataContainer', { sync: true, duration: resizeDuration + 0.25, from: 0.0, to: 1.0 }), 
			  new Effect.Appear('imageDataContainer', { sync: true, duration: 1.0 }) ], 
			{ duration: 0.65, afterFinish: function() { myLightbox.updateNav();} } 
		);
	},
	*/
	//
	//	updateNav()
	//	Display appropriate previous and next hover navigation.
	//
	updateNav: function() {

		Element.show('hoverNav');				

		// if not first image in set, display prev image button
		if(activeImage != 0){
			Element.show('prevLink');
			document.getElementById('prevLink').onclick = function() {
				myLightbox.changeImage(activeImage - 1); return false;
			}
		}

		// if not last image in set, display next image button
		if(activeImage != (imageArray.length - 1)){
			Element.show('nextLink');
			document.getElementById('nextLink').onclick = function() {
				myLightbox.changeImage(activeImage + 1); return false;
			}
		}
		
		this.enableKeyboardNav();
	},

	//
	//	enableKeyboardNav()
	//
	enableKeyboardNav: function() {
		document.onkeydown = this.keyboardAction; 
	},

	//
	//	disableKeyboardNav()
	//
	disableKeyboardNav: function() {
		document.onkeydown = '';
	},

	//
	//	keyboardAction()
	//
	keyboardAction: function(e) {
		if (e == null) { // ie
			keycode = event.keyCode;
		} else { // mozilla
			keycode = e.which;
		}

		key = String.fromCharCode(keycode).toLowerCase();
		
		if((key == 'x') || (key == 'o') || (key == 'c')){	// close lightbox
			myLightbox.end();
		} else if(key == 'p'){	// display previous image
			if(activeImage != 0){
				myLightbox.disableKeyboardNav();
				myLightbox.changeImage(activeImage - 1);
			}
		} else if(key == 'n'){	// display next image
			if(activeImage != (imageArray.length - 1)){
				myLightbox.disableKeyboardNav();
				myLightbox.changeImage(activeImage + 1);
			}
		}


	},

	//
	//	preloadNeighborImages()
	//	Preload previous and next images.
	//
	preloadNeighborImages: function(){

		if((imageArray.length - 1) > activeImage){
			preloadNextImage = new Image();
			preloadNextImage.src = imageArray[activeImage + 1][0];
		}
		if(activeImage > 0){
			preloadPrevImage = new Image();
			preloadPrevImage.src = imageArray[activeImage - 1][0];
		}
	
	},

	//
	//	end()
	//
	end: function() {
		this.disableKeyboardNav();
		Element.hide('lightbox');
		new Effect.Fade('overlay', { duration: 0.2});
		showSelectBoxes();
	},
	
	addThisToLightBox: function() {
		new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=addLightbox'});
		new Effect.Highlight('aAddToLightBox02', {startcolor:'#8c8c8c', endcolor:'#dcdbdb', duration: 0.5});
	},
	
	moveForward: function() {
		
		oForward.handleClick();
		setTimeout("getImageSrc();",500); // set 1/2 second timeout so that the images swaps correctly
		
	},
	
	movePrevious: function() {
		oPrevious.handleClick();
		setTimeout("getImageSrc();",500); // set 1/2 second timeout so that the images swaps correctly
	}
}

// -----------------------------------------------------------------------------------

//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

// -----------------------------------------------------------------------------------

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

// -----------------------------------------------------------------------------------

//
// getKey(key)
// Gets keycode. If 'x' is pressed then it hides the lightbox.
//
function getKey(e){
	if (e == null) { // ie
		keycode = event.keyCode;
	} else { // mozilla
		keycode = e.which;
	}
	key = String.fromCharCode(keycode).toLowerCase();
	
	if(key == 'x'){
	}
}

// -----------------------------------------------------------------------------------

//
// listenKey()
//
function listenKey () {	document.onkeypress = getKey; }
	
// ---------------------------------------------------

function showSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}

// ---------------------------------------------------

function hideSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

// ---------------------------------------------------

//
// pause(numberMillis)
// Pauses code execution for specified time. Uses busy code, not good.
// Code from http://www.faqts.com/knowledge_base/view.phtml/aid/1602
//
function pause(numberMillis) {
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true) {
		now = new Date();
		if (now.getTime() > exitTime)
			return;
	}
}

function getImageSrc() {
	var anchors = document.getElementsByTagName('a');

		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				myLightbox.start(anchor);
				return false;
			}
		}
}

// ---------------------------------------------------



function initLightbox() { myLightbox = new Lightbox(); }
Event.observe(window, 'load', initLightbox, false);
///////////////////////////////////////// END LIGHTBOX //////////////////////////


/////////// START IMAGE-PROTECTION /////////
// Image Protection - drag in ie and mac
var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)
var flag = 0;
var msg = 'This image is protected by copyright.\nWe request you not to copy it.';
var x,y,x1,y1,copyAttempt;

function initImageProtect()
{
	if (!(document.getElementById || document.all || document.layers)) return;
	if (specialcase && document.layers)
	{
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = special;
	}
	for (i=0;i<document.images.length;i++)
	{
		document.images[i].onmousedown = checkIt;
		document.images[i].onmouseup = function() {return false};
		if (specialcase)
		{
			document.images[i].onmousemove = special;
			document.images[i].onclick = clearIt;
		}
	}
}

function checkIt(e)
{
	copyAttempt = 0;
	if (window.Event)
	{
		x = e.screenX;
		y = e.screenY;
		theButt = (e.which == 3);
	}
	else
	{
		x = window.event.clientX;
		y = window.event.clientY;
		theButt = (window.event.button == 2);
	}
	if (theButt)
	{
		copyAttempt = 1;
		flag = 0;
		//alert(msg);
		return false; // NN4 only
	}
	if (specialcase) flag = 1;
	return false;
}

function special(e)
{
	theObj = '';
	if (window.Event)
	{
		x1 = e.screenX;
		y1 = e.screenY;
		if (e.target.parentNode) theObj = e.target.parentNode.tagName;
	}
	else
	{
		x1 = window.event.clientX;
		y1 = window.event.clientY;
		theObj = window.event.srcElement.parentElement.tagName;
	}
	var isLink = (theObj == 'A');
	if (flag && (!isLink || ((Math.abs(x-x1) > 10) || (Math.abs(y-y1) > 10))))
	{
		copyAttempt = 1;
		flag = 0;
		//alert(msg);
		return false;
	}
}

function clearIt()
{
	flag = 0;
	if (copyAttempt)
	{
		copyAttempt = 0;
		return false;
	}
}
/////////// END IMAGE-PROTECTION /////////

/////////// START FADE-O-MATIC ////////

// Fade interval in milliseconds
// Make this larger if you experience performance issues
Fadomatic.INTERVAL_MILLIS = 50;

// Creates a fader
// element - The element to fade
// speed - The speed to fade at, from 0.0 to 100.0
// initialOpacity (optional, default 100) - element's starting opacity, 0 to 100
// minOpacity (optional, default 0) - element's minimum opacity, 0 to 100
// maxOpacity (optional, default 0) - element's minimum opacity, 0 to 100
function Fadomatic (element, rate, initialOpacity, minOpacity, maxOpacity) {
  this._element = element;
  this._intervalId = null;
  this._rate = rate;
  this._isFadeOut = true;

  // Set initial opacity and bounds
  // NB use 99 instead of 100 to avoid flicker at start of fade
  this._minOpacity = 0;
  this._maxOpacity = 99;
  this._opacity = 99;

  if (typeof minOpacity != 'undefined') {
    if (minOpacity < 0) {
      this._minOpacity = 0;
    } else if (minOpacity > 99) {
      this._minOpacity = 99;
    } else {
      this._minOpacity = minOpacity;
    }
  }

  if (typeof maxOpacity != 'undefined') {
    if (maxOpacity < 0) {
      this._maxOpacity = 0;
    } else if (maxOpacity > 99) {
      this._maxOpacity = 99;
    } else {
      this._maxOpacity = maxOpacity;
    }

    if (this._maxOpacity < this._minOpacity) {
      this._maxOpacity = this._minOpacity;
    }
  }
  
  if (typeof initialOpacity != 'undefined') {
    if (initialOpacity > this._maxOpacity) {
      this._opacity = this._maxOpacity;
    } else if (initialOpacity < this._minOpacity) {
      this._opacity = this._minOpacity;
    } else {
      this._opacity = initialOpacity;
    }
  }

  // See if we're using W3C opacity, MSIE filter, or just
  // toggling visiblity
  if(typeof element.style.opacity != 'undefined') {

    this._updateOpacity = this._updateOpacityW3c;

  } else if(typeof element.style.filter != 'undefined') {

    // If there's not an alpha filter on the element already,
    // add one
    if (element.style.filter.indexOf("alpha") == -1) {

      // Attempt to preserve existing filters
      var existingFilters="";
      if (element.style.filter) {
        existingFilters = element.style.filter+" ";
      }
      element.style.filter = existingFilters+"alpha(opacity="+this._opacity+")";
    }

    this._updateOpacity = this._updateOpacityMSIE;
    
  } else {

    this._updateOpacity = this._updateVisibility;
  }

  this._updateOpacity();
}

// Initiates a fade out
Fadomatic.prototype.fadeOut = function () {
  this._isFadeOut = true;
  this._beginFade();
}

// Initiates a fade in
Fadomatic.prototype.fadeIn = function () {
  this._isFadeOut = false;
  this._beginFade();
}

// Makes the element completely opaque, stops any fade in progress
Fadomatic.prototype.show = function () {
  this.haltFade();
  this._opacity = this._maxOpacity;
  this._updateOpacity();
}

// Makes the element completely transparent, stops any fade in progress
Fadomatic.prototype.hide = function () {
  this.haltFade();
  this._opacity = 0;
  this._updateOpacity();
}

// Halts any fade in progress
Fadomatic.prototype.haltFade = function () {

  clearInterval(this._intervalId);
}

// Resumes a fade where it was halted
Fadomatic.prototype.resumeFade = function () {

  this._beginFade();
}

// Pseudo-private members

Fadomatic.prototype._beginFade = function () {

  this.haltFade();
  var objref = this;
  this._intervalId = setInterval(function() { objref._tickFade(); },Fadomatic.INTERVAL_MILLIS);
}

Fadomatic.prototype._tickFade = function () {

  if (this._isFadeOut) {
    this._opacity -= this._rate;
    if (this._opacity < this._minOpacity) {
      this._opacity = this._minOpacity;
      this.haltFade();
    }
  } else {
    this._opacity += this._rate;
    if (this._opacity > this._maxOpacity ) {
      this._opacity = this._maxOpacity;
      this.haltFade();
    }
  }

  this._updateOpacity();
}

Fadomatic.prototype._updateVisibility = function () {
  
  if (this._opacity > 0) {
    this._element.style.visibility = 'visible';
  } else {
    this._element.style.visibility = 'hidden';
  }
}

Fadomatic.prototype._updateOpacityW3c = function () {
  
  this._element.style.opacity = this._opacity/100;
  this._updateVisibility();
}

Fadomatic.prototype._updateOpacityMSIE = function () {
  
  this._element.filters.alpha.opacity = this._opacity;
  this._updateVisibility();
}

Fadomatic.prototype._updateOpacity = null;

/////////// END FADE-O-MATIC ////////


function scaleDown() {
	//$('baseImg').effect.position;
	new Effect.Scale('baseImg', 10, {scaleFromCenter: false, duration: 1.0,
					 scaleMode: { originalHeight: 251, originalWidth: 700 }}).position;
}

function scaleUp() {
	//$('baseImg').effect.position;
	new Effect.Scale('baseImg', 100.0, {scaleFromCenter: false, duration: 1.0,
					 scaleMode: { originalHeight: 251, originalWidth: 700 }}).position;
}



// Portfolio Behaviours
var oPortfolio = new Object();
oPortfolio.init = function() {
	var aPortfolio = document.getElementById("aPortfolio");
    aPortfolio.onclick = oPortfolio.handleClick;
	aPortfolio.onmouseover = oPortfolio.handleMouseOver;
	aPortfolio.onmouseout = oPortfolio.handleMouseOut;
	
    var nav00bWrapper = document.getElementById("nav00bWrapper");
    oPortfolio.fader = new Fadomatic(nav00bWrapper, 1.9, 0);
}

oPortfolio.handleClick = function() {
	oPortfolio.fader.fadeIn();
    //contentFadeOut();
	//crossfadeContent();
	new Ajax.Updater('nav00a', '_portfolio.nav.php?navpoint02=Portfolio&active=0', {
        method:'get', 
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0201', '_portfolio.nav.php?navpoint02=News&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0202', '_portfolio.nav.php?navpoint02=Represented&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0203', '_portfolio.nav.php?navpoint02=Clients&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0204', '_portfolio.nav.php?navpoint02=Imprint&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
// reset submenu
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});	
	
	  //contentAjaxUpdate('imgMainContent', 'Portfolio');
	  crossfadeContent('portfolio', '2', '[new image 01]');	  
	  return false;
    }

	oPortfolio.handleMouseOver = function() {
		//fader.show();
		new Effect.Opacity('imgPortfolio', {duration: 1.0, from: 1.0, to: 0.0});
    }

    oPortfolio.handleMouseOut = function() {
		//oPortfolio.fader.fadeOut();
		new Effect.Opacity('imgPortfolio', {duration: 1.0, from: 0.0, to: 1.0});
    }

// START PORTFOLIO SUB-NAVIGATION ///
// Architecture Behaviours
var oArchitecture = new Object();

oArchitecture.init = function() {

var aArchitecture = document.getElementById("aArchitecture");
		aArchitecture.onclick = oArchitecture.handleClick;
		aArchitecture.onmouseover = oArchitecture.handleMouseOver;
		aArchitecture.onmouseout = oArchitecture.handleMouseOut;

var lightBoxControls = document.getElementById("lightBoxControls");
		oArchitecture.fader = new Fadomatic(lightBoxControls, 5, 0);
}

oArchitecture.handleClick = function() {
	//scontentFadeOut();
	oArchitecture.fader.fadeIn();
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
// reset table	
	
	//contentAjaxUpdate('imgMainContent', 'Architecture');
	crossfadeContent('architecture', '2', '[new image Architecture]');
	return false;
}

oArchitecture.handleMouseOver = function() {
	new Effect.Opacity('imgArchitecture', {duration: 1.0, from: 1.0, to: 0.0});
}

oArchitecture.handleMouseOut = function() {
	new Effect.Opacity('imgArchitecture', {duration: 1.0, from: 0.0, to: 1.0});
}

// Industry Behaviours
var oIndustry = new Object();

oIndustry.init = function() {

var aIndustry = document.getElementById("aIndustry");
		aIndustry.onclick = oIndustry.handleClick;
		aIndustry.onmouseover = oIndustry.handleMouseOver;
		aIndustry.onmouseout = oIndustry.handleMouseOut;

var lightBoxControls = document.getElementById("lightBoxControls");
		oIndustry.fader = new Fadomatic(lightBoxControls, 5, 0);
}

oIndustry.handleClick = function() {
	//contentFadeOut();
	oIndustry.fader.fadeIn();
			
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Industry');
	crossfadeContent('industry', '2', '[new image Industry]');
	return false;
}

oIndustry.handleMouseOver = function() {
	new Effect.Opacity('imgIndustry', {duration: 1.0, from: 1.0, to: 0.0});
}

oIndustry.handleMouseOut = function() {
	new Effect.Opacity('imgIndustry', {duration: 1.0, from: 0.0, to: 1.0});
}

// Landscape Behaviours
var oLandscape = new Object();

oLandscape.init = function() {

var aLandscape = document.getElementById("aLandscape");
		aLandscape.onclick = oLandscape.handleClick;
		aLandscape.onmouseover = oLandscape.handleMouseOver;
		aLandscape.onmouseout = oLandscape.handleMouseOut;

var lightBoxControls = document.getElementById("lightBoxControls");
		oLandscape.fader = new Fadomatic(lightBoxControls, 5, 0);
}

oLandscape.handleClick = function() {
	//contentFadeOut();
	oLandscape.fader.fadeIn();		
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Landscape');
	crossfadeContent('landscape', '2', '[new image Landscape]');
	return false;
}

oLandscape.handleMouseOver = function() {
	new Effect.Opacity('imgLandscape', {duration: 1.0, from: 1.0, to: 0.0});
}

oLandscape.handleMouseOut = function() {
	new Effect.Opacity('imgLandscape', {duration: 1.0, from: 0.0, to: 1.0});
}

// Docu Behaviours
var oDocu = new Object();

oDocu.init = function() {

var aDocu = document.getElementById("aDocu");
		aDocu.onclick = oDocu.handleClick;
		aDocu.onmouseover = oDocu.handleMouseOver;
		aDocu.onmouseout = oDocu.handleMouseOut;

var lightBoxControls = document.getElementById("lightBoxControls");
		oDocu.fader = new Fadomatic(lightBoxControls, 5, 0);
}

oDocu.handleClick = function() {
	//contentFadeOut();
	oDocu.fader.fadeIn();		
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Docu');
	crossfadeContent('docu', '2', '[new image Docu]');
	return false;
}

oDocu.handleMouseOver = function() {
	new Effect.Opacity('imgDocu', {duration: 1.0, from: 1.0, to: 0.0});
}

oDocu.handleMouseOut = function() {
	new Effect.Opacity('imgDocu', {duration: 1.0, from: 0.0, to: 1.0});
}

// Impressions Behaviours
var oImpressions = new Object();

oImpressions.init = function() {

var aImpressions = document.getElementById("aImpressions");
		aImpressions.onclick = oImpressions.handleClick;
		aImpressions.onmouseover = oImpressions.handleMouseOver;
		aImpressions.onmouseout = oImpressions.handleMouseOut;

var lightBoxControls = document.getElementById("lightBoxControls");
		oImpressions.fader = new Fadomatic(lightBoxControls, 5, 0);
}

oImpressions.handleClick = function() {
	//contentFadeOut();
	oImpressions.fader.fadeIn();		
	new Ajax.Updater('linkNav0101', '_portfolio.nav.php?navpoint02=Architecture&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0102', '_portfolio.nav.php?navpoint02=Industry&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0103', '_portfolio.nav.php?navpoint02=Landscape&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0104', '_portfolio.nav.php?navpoint02=Docu&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0105', '_portfolio.nav.php?navpoint02=Impressions&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Impressions');
	crossfadeContent('impressions', '2', '[new image Impressions]');
	return false;
}

oImpressions.handleMouseOver = function() {
	new Effect.Opacity('imgImpressions', {duration: 1.0, from: 1.0, to: 0.0});
}

oImpressions.handleMouseOut = function() {
	new Effect.Opacity('imgImpressions', {duration: 1.0, from: 0.0, to: 1.0});
}
// END PORTFOLIO SUB-NAVIGATION ///

// START SECOUND HALF OF MAIN-NAVIGATION //
// News Behaviours
var oNews = new Object();

oNews.init = function() {

var aNews = document.getElementById("aNews");
		aNews.onclick = oNews.handleClick;
		aNews.onmouseover = oNews.handleMouseOver;
		aNews.onmouseout = oNews.handleMouseOut;
/*
var imgMainContent = document.getElementById("imgMainContent");
		oNews.fader = new Fadomatic(imgMainContent, 7, 100);
*/
}

oNews.handleClick = function() {
	//contentFadeOut();
	
	new Ajax.Updater('nav00a', '_portfolio.nav.php?navpoint02=Portfolio&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0201', '_portfolio.nav.php?navpoint02=News&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0202', '_portfolio.nav.php?navpoint02=Represented&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0203', '_portfolio.nav.php?navpoint02=Clients&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0204', '_portfolio.nav.php?navpoint02=Imprint&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'News');
	crossfadeContent('news', '2', '[new image News]');	
	oArchitecture.fader.fadeOut();
	oPortfolio.fader.fadeOut();
	
	return false;
}

oNews.handleMouseOver = function() {
	new Effect.Opacity('imgNews', {duration: 1.0, from: 1.0, to: 0.0});
	return false;
}

oNews.handleMouseOut = function() {
	new Effect.Opacity('imgNews', {duration: 1.0, from: 0.0, to: 1.0});
	return false;
}

// Represented Behaviours
var oRepresented = new Object();

oRepresented.init = function() {

var aRepresented = document.getElementById("aRepresented");
		aRepresented.onclick = oRepresented.handleClick;
		aRepresented.onmouseover = oRepresented.handleMouseOver;
		aRepresented.onmouseout = oRepresented.handleMouseOut;
/*
var imgMainContent = document.getElementById("imgMainContent");
		oRepresented.fader = new Fadomatic(imgMainContent, 7, 100);
*/
}

oRepresented.handleClick = function() {
	//contentFadeOut();
	
	new Ajax.Updater('nav00a', '_portfolio.nav.php?navpoint02=Portfolio&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0201', '_portfolio.nav.php?navpoint02=News&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0202', '_portfolio.nav.php?navpoint02=Represented&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0203', '_portfolio.nav.php?navpoint02=Clients&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0204', '_portfolio.nav.php?navpoint02=Imprint&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Represented');
	crossfadeContent('represented', '2', '[new image Represented]');
	oArchitecture.fader.fadeOut();
	oPortfolio.fader.fadeOut();

	return false;
}

oRepresented.handleMouseOver = function() {
	new Effect.Opacity('imgRepresented', {duration: 1.0, from: 1.0, to: 0.0});
	return false;
}

oRepresented.handleMouseOut = function() {
	new Effect.Opacity('imgRepresented', {duration: 1.0, from: 0.0, to: 1.0});
	return false;
}

// Clients Behaviours
var oClients = new Object();

oClients.init = function() {

var aClients = document.getElementById("aClients");
		aClients.onclick = oClients.handleClick;
		aClients.onmouseover = oClients.handleMouseOver;
		aClients.onmouseout = oClients.handleMouseOut;
/*
var imgMainContent = document.getElementById("imgMainContent");
		oClients.fader = new Fadomatic(imgMainContent, 7, 100);
*/
}

oClients.handleClick = function() {
	
	//contentFadeOut();
	
	new Ajax.Updater('nav00a', '_portfolio.nav.php?navpoint02=Portfolio&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0201', '_portfolio.nav.php?navpoint02=News&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0202', '_portfolio.nav.php?navpoint02=Represented&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0203', '_portfolio.nav.php?navpoint02=Clients&active=0', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0204', '_portfolio.nav.php?navpoint02=Imprint&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	//contentAjaxUpdate('imgMainContent', 'Clients');
	crossfadeContent('clients', '2', '[new image Clients]');
	oArchitecture.fader.fadeOut();
	oPortfolio.fader.fadeOut();

	return false;
}

oClients.handleMouseOver = function() {
	new Effect.Opacity('imgClients', {duration: 1.0, from: 1.0, to: 0.0});
	return false;
}

oClients.handleMouseOut = function() {
	new Effect.Opacity('imgClients', {duration: 1.0, from: 0.0, to: 1.0});
	return false;
}

// Imprint Behaviours
var oImprint = new Object();

oImprint.init = function() {

var aImprint = document.getElementById("aImprint");
		aImprint.onclick = oImprint.handleClick;
		aImprint.onmouseover = oImprint.handleMouseOver;
		aImprint.onmouseout = oImprint.handleMouseOut;
/*
var imgMainContent = document.getElementById("imgMainContent");
		oImprint.fader = new Fadomatic(imgMainContent, 7, 100);
*/
}

oImprint.handleClick = function() {
	
	//contentFadeOut();
		
	new Ajax.Updater('nav00a', '_portfolio.nav.php?navpoint02=Portfolio&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0201', '_portfolio.nav.php?navpoint02=News&active=1', {
		method:'get',
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0202', '_portfolio.nav.php?navpoint02=Represented&active=1', {
		method:'get',
		queue: {position: 'end',
		scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0203', '_portfolio.nav.php?navpoint02=Clients&active=1', {
		method:'get',
		queue: {position: 'end',
		scope: 'menuSwap'}
	});
	
	new Ajax.Updater('linkNav0204', '_portfolio.nav.php?navpoint02=Imprint&active=0', {
		method:'get',
		queue: {position: 'end',
		scope: 'menuSwap'}
	});
	var strNavpoint;
	//contentAjaxUpdate('imgMainContent', 'Imprint');
	crossfadeContent('imprint', '2', '[new image Imprint]');	
	oArchitecture.fader.fadeOut();
	oPortfolio.fader.fadeOut();

	return false;
}

oImprint.handleMouseOver = function() {
	new Effect.Opacity('imgImprint', {duration: 0.5, from: 1.0, to: 0.0});
	return false;
}

oImprint.handleMouseOut = function() {
	new Effect.Opacity('imgImprint', {duration: 0.5, from: 0.0, to: 1.0});
	return false;
}

// START Lightboxcontrols //
// Thumbstable Behaviours
var oArchiveThumbsTable = new Object();

oArchiveThumbsTable.init = function() {

var aArchiveThumbsTable = document.getElementById("aArchiveThumbsTable");
		aArchiveThumbsTable.onclick = oArchiveThumbsTable.handleClick;
}

oArchiveThumbsTable.handleClick = function() {	
		
	new Ajax.Updater('archiveThumbsOverlay', '_portfolio.nav.php?navlightbox=Table', {
		method:'get'
	});
	
	new Effect.Parallel(
		[ new Effect.Move('archiveThumbsWrapper', {x: 137, y: 187, mode: 'absolute', sync: true}), 
		  new Effect.Fade('archiveThumbsWrapper',{ duration: 2, from: 0.0, to: 1.0, sync: true})],
		{duration: 2});
		  
		  //oArchitecture.fader.fadeOut();
		  return false;

}

// LightBox Behaviours
var oLightbox = new Object();

oLightbox.init = function() {

var alightBoxDropArea = document.getElementById("alightBoxDropArea");
		alightBoxDropArea.onclick = oLightbox.handleClick;
}

oLightbox.handleClick = function() {	
		
	new Ajax.Updater('lightboxThumbs', '_portfolio.nav.php?navlightbox=Lightbox', {
		method:'get'
	});
	//y: 167
	new Effect.Parallel(
		[ new Effect.Move('lightboxWrapper', {x: 100, y: 180, mode: 'absolute', sync: true}), 
		  new Effect.Fade('lightboxWrapper',{ duration: 2, from: 0.0, to: 1.0, sync: true})],
		{duration: 2});
		  
		  //oArchitecture.fader.fadeOut();
		  return false;

}


// Add To LIGHTBOX Behaviours
var oAddToLightBox = new Object();

oAddToLightBox.init = function() {
var aAddToLightBox = document.getElementById("aAddToLightBox");
		aAddToLightBox.onclick = oAddToLightBox.handleClick;
}

oAddToLightBox.handleClick = function() {	
	//alert('add image to LIGHTBOX collection?');
	new Effect.Highlight('lightBoxDropArea', {startcolor:'#8c8c8c', endcolor:'#dcdbdb', duration: 0.5});
	
	new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=addLightbox'});
	
	/*
	new Effect.Parallel(
		[ new Effect.Move('lightboxWrapper', {x: 100, y: 180, mode: 'absolute', sync: true}), 
		  new Effect.Fade('lightboxWrapper',{ duration: 2, from: 0.0, to: 1.0, sync: true})],
		{duration: 2});
		  
		  //oArchitecture.fader.fadeOut();
		  return false;
	*/

}

// Prevoious Behaviours
var oPrevious = new Object();

oPrevious.init = function() {

var aPrevious = document.getElementById("aPrevious");
		aPrevious.onclick = oPrevious.handleClick;
		
//var imgMainContent = document.getElementById("imgMainContent");
		//oPrevious.fader = new Fadomatic(imgMainContent, 7, 100);
}

oPrevious.handleClick = function() {
	
	var Imgcount = new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=Previous', onComplete: myFunction});
	function myFunction(request){
  	var param = request.responseText;
	var tmp = param.split(",");
  	//alert(param);
	//crossfadeContent(tmp[0],tmp[1],tmp[2],tmp[3]);
	crossfadeContent(tmp[0],tmp[1],tmp[2],tmp[3],tmp[4]);
	}

}

// Forward Behaviours
var oForward = new Object();

oForward.init = function() {

var aForward = document.getElementById("aForward");
		aForward.onclick = oForward.handleClick;
}

oForward.handleClick = function() {

	var Imgcount = new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=Forward', onComplete: myFunction});
	function myFunction(request){
  	var param = request.responseText;
	var tmp = param.split(",");
  	//alert(param);
	//crossfadeContent(tmp[0],tmp[1],tmp[2],tmp[3]);
	crossfadeContent(tmp[0],tmp[1],tmp[2],tmp[3],tmp[4]);
	}
}

// LightBox Close Button Behaviours
var obtnClose = new Object();

obtnClose.init = function() {

var btnClose = document.getElementById("btnClose");
		btnClose.onclick = obtnClose.handleClick;
}

obtnClose.handleClick = function() {	
	/*	
	new Ajax.Updater('archiveThumbsOverlay', '_portfolio.nav.php?navlightbox=Table', {
		method:'get'
	});
	*/
	new Effect.Move('lightboxWrapper', {x: 100, y: 360, mode: 'absolute'});		  
	//oArchitecture.fader.fadeOut();
	return false;

}

// LightBox delete Button Behaviours
var obtnDelete = new Object();

obtnDelete.init = function() {

var btnDelete = document.getElementById("btnDelete");
		btnDelete.onclick = obtnDelete.handleClick;
}

obtnDelete.handleClick = function() {	
	var tmp = new Ajax.Request('_portfolio.nav.php', {method:'post',parameters:'navlightbox=delete', onComplete: refresh});
	//new Effect.Move('lightboxWrapper', {x: 100, y: 360, mode: 'absolute'});		  
	//oArchitecture.fader.fadeOut();
	return false;

}

// LightBox send Button Behaviours
var obtnSend = new Object();

obtnSend.init = function() {

var btnSend = document.getElementById("btnSend");
		btnSend.onclick = obtnSend.handleClick;
}

obtnSend.handleClick = function() {		
	//alert("test");
	//alert(Form.serialize('lbxForm'));
	var formstring = Form.serialize('lbxForm');
	var tmp = formstring.split("&");
	var name = tmp[0].split("=");
	var mailadr = tmp[1].split("=");
	//alert(name[1]+' '+unescape(mailadr[1]));
	if(name[1] == '' || mailadr[1] == ''){
		alert("Please enter a name and valid email address");
	}else{
	new Effect.Move('lightboxWrapper', {x: 100, y: 360, mode: 'absolute'});
	oImprint.handleClick();
	var tmp = new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=sendmail&name='+name[1]+'&mailadr='+mailadr[1], onSuccess: lightboxdo});
}

function lightboxdo(request){
	var param = request.responseText;
	if(param != "done" && param != "no input" && param != "no image"){
		alert("Unfortunately your message could not be sent at this time. Please try again later.");
		//alert(param);
		} else if(param == "no image") {
			alert("Please select one or more images before sending");
			oPortfolio.handleClick();			
		} else {
		//alert("Your mail has been sent");
		$('inputName').value = "";
		$('inputAddress').value = "";
		}	
	}
}

// refresh funxtion for lightboxThumbs
function refresh(){
		new Ajax.Updater('lightboxThumbs', '_portfolio.nav.php?navlightbox=Lightbox', {method:'get'});
	}

// del-click for storing delete pics from LIGHTBOX Behaviours
function delfromLightbox(navpt,imgc) {
	//alert("strnavpoint="+navpt+" Imagecount="+imgc);
	new Ajax.Request('_portfolio.nav.php', {method:'get',parameters:'navlightbox=delfromLightbox&navpt='+navpt+'&imgc='+imgc, onComplete: refresh});
	
	}


/*
function closeSlideDown(eTarget, xPosition) {//archiveThumbsWrapper
	new Effect.Move(eTarget, {x: xPosition, y: 360, mode: 'absolute'});
	return false;
}
*/
function closeArchiveThumbsTable() {
	new Effect.Move('archiveThumbsWrapper', {x: 137, y: 360, mode: 'absolute'});
	return false;
}
// END LIGHTBOX CONTROLS //


function contentFadeOut() {
	new Effect.Opacity('imgMainContent', {
		duration: 0.5, 
		transition: Effect.Transitions.linear,
		from: 1.0, to: 0.0, 
		queue: {
			position: 'front', 
			scope: 'menuFadeScopeOut'}
	});
}

function contentAjaxUpdate(elTarget, navPoint) {
	new Ajax.Updater(elTarget, '_content.php?npoint01='+navPoint, {
		method:'get',
		onComplete: contentFadeIn,
		queue: {
			position: 'end', 
			scope: 'menuSwap'}
	});
}

function contentFadeIn() {
	new Effect.Opacity('imgMainContent', {
		duration: 0.5,
		transition: Effect.Transitions.linear,
		from: 0.0, to: 1.0, 
		queue: {
			position: 'end', 
			scope: 'menuFadeScopeOut'}
	});
}

function swapHref(aEnlargePath) {
	$('aEnlarge').href = aEnlargePath;
}



function crossfadeContent(strNavpoint,strSpeed,strAltTag,strImage,strHref) {
	var elBaseImg = document.getElementById('baseImg'); // base image for content swap-fade transition

// when not coming from table
	if(typeof strImage == "undefined") {
		var strImage = strNavpoint+'_1';
	}
	var tmp = new Ajax.Request('_portfolio.nav.php', {method:'post',parameters:'navlightbox=Count&Image=' + strImage});
//set ImageCount for the Pic	
	var strImgPath = '_img/portfolio/'+strNavpoint+'/'+strImage;
	if (strNavpoint == 'portfolio' || strNavpoint == 'news' || strNavpoint == 'represented' || strNavpoint == 'clients' || strNavpoint == 'imprint') {
		//alert(strImgPath);
		strImgPath = '_img/'+strNavpoint+'/'+strNavpoint;	
	}
	
	//alert(strImgPath);
	crossfade(elBaseImg, strImgPath+'.jpg', strSpeed, strAltTag);
// when not comming from inside portfolio
	if(typeof strHref == "undefined") {
		swapHref('_img/portfolio/'+strNavpoint+'/enlarge/'+strImage+'.jpg');
		//Element.update('mainContent', '<img class="baseImg01" id="baseImg" src="_img/default_content.jpg" alt="Image: Portfolio Sample" />', {onComplete: crossfade(elBaseImg, strImgPath+'.jpg', strSpeed, strAltTag)});
				
		
	} else {
	
	swapHref(strHref);
	}
	//var elEnlargeImg = document.getElementById('lightboxImage'); // Lightbox image for content swap-fade transition
	//alert(elEnlargeImg);
	//crossfade(elEnlargeImg, '_img/portfolio/'+strNavpoint+'/enlarge/'+strImage+'.jpg', strSpeed, strAltTag);
}

window.onload = init; 
