/*
	This file assembled, compressed and cache-managed by
	File Packer, v1.1 (c) 2005 bivia
	
	Each file contained herein is copyright its respective owner.
	By assembling these files, bivia has optimized for delivery
	but has not otherwise edited or changed the files, and bivia
	makes no claims as to their suitability or compatibility
	
	Files included in this package may be accessed directly in this
	directory with the following names:
		DOMAssistant/DOMAssistant.js
		DOMAssistant/DOMAssistantContent.js
		DOMAssistant/DOMAssistantCSS.js
		DOMAssistant/DOMAssistantEvents.js
		DOMAssistant/DOMAssistantLoad.js
		IE_activateFlash.js
		Collapse.js
		Carousel.js
		ClientPortfolio.js
		_global.init.js
*/

/* (1) packer:START(DOMAssistant/DOMAssistant.js) ... */

/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/deed.en)
	For more information, please see http://www.robertnyman.com/domassistant
*/
var DOMAssistant = {
	
	methodsToAdd : [],
	
	init : function (){
		this.applyMethod.call(window, "$", this.$);
		window.DOMAssistant = this;
		this.addBaseMethods();
	},
	
	addBaseMethods : function (){
		document.getElementsByClassName = this.getElementsByClassName;
		document.getElementsByAttribute = this.getElementsByAttribute;
		if(typeof HTMLElement == "function"){
			HTMLElement.prototype.getElementsByClassName = this.getElementsByClassName;
			HTMLElement.prototype.getElementsByAttribute = this.getElementsByAttribute;		
		}
		this.methodsToAdd.push(["getElementsByClassName", this.getElementsByClassName]);
		this.methodsToAdd.push(["getElementsByAttribute", this.getElementsByAttribute]);
	},
	
	applyMethod : function (method, func){
		if(typeof this[method] != "function"){
			this[method] = func;
		}
	},
	
	addMethods : function (elm){
		if(elm){
			var elms = (elm.constructor == Array)? elm : [elm];
			for(var i=0; i<elms.length; i++){	
				for(var j=0; j<this.methodsToAdd.length; j++){
	            	this.applyMethod.call(elms[i], this.methodsToAdd[j][0], this.methodsToAdd[j][1]);
	            }
			}
		}
	},
	
	$ : function (){
		var elm = null;
		if(document.getElementById){
			elm = (arguments.length > 1)? [] : null;
			var current;
			for(var i=0; i<arguments.length; i++){
				current = arguments[i];
				if(typeof current != "object"){
					current = document.getElementById(current);
				}
				if(arguments.length > 1){
					elm.push(current);
				}
				else{
					elm = current;
				}
			}
			DOMAssistant.addMethods(elm);
		}
		return elm;
    },
	
	getElementsByClassName : function (className, tag){
		var elms = ((!tag || tag == "*") && this.all)? this.all : this.getElementsByTagName(tag || "*");
		var returnElms = [];
		var className = className.replace(/\-/g, "\\-");
		var regExp = new RegExp("(^|\\s)" + className + "(\\s|$)");
		var elm;
		for(var i=0; i<elms.length; i++){
			elm = elms[i];		
			if(regExp.test(elm.className)){
				returnElms.push(elm);
			}
		}
		return (returnElms);
	},
	
	getElementsByAttribute : function (attr, attrVal, tag){
	    var elms = ((!tag || tag == "*") && this.all)? this.all : this.getElementsByTagName(tag || "*");
	    var returnElms = [];
	    if(typeof attrVal != "undefined"){
			var attrVal = new RegExp("(^|\\s)" + attrVal + "(\\s|$)");
		}
	    var current;
	    var currentAttr;
	    for(var i=0; i<elms.length; i++){
	        current = elms[i];
	        currentAttr = current.getAttribute(attr);
	        if(typeof currentAttr == "string" && currentAttr.length > 0){	
	            if(typeof attrVal == "undefined" || (attrVal && attrVal.test(currentAttr))){
					returnElms.push(current);
	            }
	        }
	    }
	    return returnElms;
	}	
}
DOMAssistant.init();
/* ... /packer:END(DOMAssistant/DOMAssistant.js) */
/* (2) packer:START(DOMAssistant/DOMAssistantContent.js) ... */

/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/deed.en)
	For more information, please see http://www.robertnyman.com/domassistant
	
	This module by Robert Nyman, http://www.robertnyman.com
*/
DOMAssistant.initContent = function (){
	this.addContentMethods();
};

DOMAssistant.addContentMethods = function (){
	if(typeof HTMLElement == "function"){
		HTMLElement.prototype.prev = DOMAssistant.prev;
		HTMLElement.prototype.next = DOMAssistant.next;
		HTMLElement.prototype.create = DOMAssistant.create;
		HTMLElement.prototype.setAttributes = DOMAssistant.setAttributes;
		HTMLElement.prototype.addContent = DOMAssistant.addContent;
		HTMLElement.prototype.replaceContent = DOMAssistant.replaceContent;
		HTMLElement.prototype.remove = DOMAssistant.remove;
	}
	this.methodsToAdd.push(["prev", this.prev]);
	this.methodsToAdd.push(["next", this.next]);
	this.methodsToAdd.push(["create", this.create]);
	this.methodsToAdd.push(["setAttributes", this.setAttributes]);
	this.methodsToAdd.push(["addContent", this.addContent]);
	this.methodsToAdd.push(["replaceContent", this.replaceContent]);
	this.methodsToAdd.push(["remove", this.remove]);
};

DOMAssistant.prev = function (){
	var prevSib = this.previousSibling;
	while(prevSib && prevSib.nodeType != 1){
		prevSib = prevSib.previousSibling;
	}
	return prevSib;
};

DOMAssistant.next = function (){
	var nextSib = this.nextSibling;
	while(nextSib && nextSib.nodeType != 1){
		nextSib = nextSib.nextSibling;
	}
	return nextSib;
};

DOMAssistant.create = function (name, attr, append, content){
	var elm = document.createElement(name);
	elm = DOMAssistant.$(elm);
	if(attr){
		elm.setAttributes(attr);
	}
	if(typeof content != "undefined"){
		elm.addContent(content);
	}
	if(append){
		this.addContent(elm);	
	}
	return elm;
};

DOMAssistant.setAttributes = function (attr){	
	for(var i in attr){
		if(i.toLowerCase().substring(0,5) == 'class'){
			this.className = attr[i];
		}
		else{
			this.setAttribute(i, attr[i]);
		}	
	}
	return this;
};

DOMAssistant.addContent = function (content){
	var retVal = null;
	if(typeof content == "string"){
		retVal = this.innerHTML += content;
	}
	else{		
		retVal = this.appendChild(content);
	}
	return this;
};

DOMAssistant.replaceContent = function (newContent){
	for(var i=(this.childNodes.length - 1); i>=0; i--){
    	this.childNodes[i].parentNode.removeChild(this.childNodes[i]);
    }
	return this.addContent(newContent);
};

DOMAssistant.remove = function (){
	this.parentNode.removeChild(this);
};

DOMAssistant.initContent();

/* ... /packer:END(DOMAssistant/DOMAssistantContent.js) */
/* (3) packer:START(DOMAssistant/DOMAssistantCSS.js) ... */

/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/deed.en)
	For more information, please see http://www.robertnyman.com/domassistant
	
	This module by Robert Nyman, http://www.robertnyman.com
*/
DOMAssistant.initCSS = function (){
	this.addCSSMethods();
};

DOMAssistant.addCSSMethods = function (){
	if(typeof HTMLElement == "function"){		
		HTMLElement.prototype.addClass = this.addClass;
		HTMLElement.prototype.removeClass = this.removeClass;
		HTMLElement.prototype.hasClass = this.hasClass;
		HTMLElement.prototype.getStyle = this.getStyle;
	}
	this.methodsToAdd.push(["addClass", this.addClass]);
	this.methodsToAdd.push(["removeClass", this.removeClass]);
	this.methodsToAdd.push(["hasClass", this.hasClass]);
	this.methodsToAdd.push(["getStyle", this.getStyle]);
};

DOMAssistant.addClass = function (className){
	if(!new RegExp("\\b" + className + "\\b").test(this.className)){
		this.className = (this.className +" "+ className).replace(/^\s+|\s+$/g, "");;
	}
	return this;
};

DOMAssistant.removeClass = function (className){
	this.className = this.className.replace(new RegExp("\\b" + className + "\\b"), " ").replace(/^\s+|\s+$|( )\s+/g, "$1");
	return this;
},

DOMAssistant.hasClass = function (className){
	return new RegExp("\\b" + className + "\\b").test(this.className);
};

DOMAssistant.getStyle = function (cssRule){
	var cssVal = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		cssVal = document.defaultView.getComputedStyle(this, "").getPropertyValue(cssRule);
	}
	else if(this.currentStyle){
		cssVal = cssRule.replace(/\-(\w)/g, function (match, p1){
			return p1.toUpperCase();
		});
		cssVal = this.currentStyle[cssVal];
	}
	return cssVal;
};

DOMAssistant.initCSS();

/* ... /packer:END(DOMAssistant/DOMAssistantCSS.js) */
/* (4) packer:START(DOMAssistant/DOMAssistantEvents.js) ... */

/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/deed.en)
	For more information, please see http://www.robertnyman.com/domassistant
	
	This module by Robert Nyman, http://www.robertnyman.com
*/
DOMAssistant.initEvents = function (){
	this.addEventMethods();
};

DOMAssistant.addEventMethods = function (){
	if(typeof HTMLElement == "function"){
		HTMLElement.prototype.addEvent = DOMAssistant.addEvent;
		HTMLElement.prototype.handleEvent = DOMAssistant.handleEvent;
		HTMLElement.prototype.removeEvent = DOMAssistant.removeEvent;
	}
	this.methodsToAdd.push(["addEvent", this.addEvent]);
	this.methodsToAdd.push(["handleEvent", this.handleEvent]);	
	this.methodsToAdd.push(["removeEvent", this.removeEvent]);
};

DOMAssistant.addEvent = function (evt, func){
	if(this.addEventListener){
		this.addEventListener(evt, func, false);
	}
	else{
		if(!this.events){
			this.events = {};
		}
		if(!this.events[evt]){
			this.events[evt] = [];
		}							
		this.events[evt].push(func);
		this["on" + evt] = DOMAssistant.handleEvent;
	}
	return this;
};

DOMAssistant.handleEvent = function (evt){
	var evt = evt || event;
	var eventType = evt.type;
	var eventColl = this.events[eventType];
	for (var i=0; i<eventColl.length; i++) {
		eventColl[i].call(this, evt);
	}
	return this;
};

DOMAssistant.removeEvent = function (evt, func){
	if(this.removeEventListener){
		this.removeEventListener(evt, func, false);
	}
	else if(this.events){
		var eventColl = this.events[evt];
		for (var i=0; i<eventColl.length; i++) {
			if(eventColl[i] == func){
				delete eventColl[i]
				eventColl.splice(i, 1);
			}
		}
	}
	return this;
};

DOMAssistant.preventDefault = function (evt){
	if(evt && evt.preventDefault){
		evt.preventDefault();
	}
	else{
		event.returnValue = false;
	}
};

DOMAssistant.cancelBubble = function (evt){
	if(evt && evt.stopPropagation){
		evt.stopPropagation();
	}
	else{
		event.cancelBubble = true;
	}
};

DOMAssistant.initEvents();

/* ... /packer:END(DOMAssistant/DOMAssistantEvents.js) */
/* (5) packer:START(DOMAssistant/DOMAssistantLoad.js) ... */

/*
	DOMAssistant is developed by Robert Nyman, http://www.robertnyman.com, and it is released according to the
	Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/deed.en)
	For more information, please see http://www.robertnyman.com/domassistant
	
	This module by Robert Nyman, http://www.robertnyman.com
	Inspired and influenced by Dean Edwards, Matthias Miller, and John Resig: http://dean.edwards.name/weblog/2006/06/again/
*/
DOMAssistant.functionsToCall = [
	/*
		functionName // name of function
		"functionName()" // name of function with parentheses and optional arguments
	*/
];

DOMAssistant.initLoad = function (){
	this.DOMLoaded = false;
	this.DOMLoadTimer = null;
};

DOMAssistant.DOMHasLoaded = function (){
	if(DOMAssistant.DOMLoaded) return;
	DOMAssistant.DOMLoaded = true;
	DOMAssistant.execFunctions();
};

DOMAssistant.execFunctions = function (){
	if(this.DOMLoaded){
		clearInterval(this.DOMLoadTimer);
	}
	var functionToCall;
	for(var i=0; i<this.functionsToCall.length; i++){
		try{
			functionToCall = this.functionsToCall[i];
			if(typeof functionToCall == "function"){
				functionToCall();
			}
			else if (typeof functionToCall == "string"){
				eval(this.functionsToCall[i]);
			}
		}
		catch(e){
			// Optional: handle error here
		}
	}
};
// ---
/* Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	if(document.getElementById){
		document.write("<script id=\"ieScriptLoad\" defer src=\"//:\"><\/script>");
	    document.getElementById("ieScriptLoad").onreadystatechange = function() {
	        if (this.readyState == "complete") {
	            DOMAssistant.DOMHasLoaded();
	        }
	    };
	}
/*@end @*/
// ---
/* Mozilla/Opera 9 */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", DOMAssistant.DOMHasLoaded, false);
}
// ---
/* Safari */
if(navigator.userAgent.search(/WebKit/i) != -1){
    DOMAssistant.DOMLoadTimer = setInterval(function (){
		if(document.readyState.search(/loaded|complete/i) != -1) {
			DOMAssistant.DOMHasLoaded();
		}
	}, 10);
}
// ---
/* Other web browsers */
window.onload = DOMAssistant.DOMHasLoaded;
// ---
DOMAssistant.initLoad();
/* ... /packer:END(DOMAssistant/DOMAssistantLoad.js) */
/* (6) packer:START(IE_activateFlash.js) ... */

// this is causing a problem with FlashVars not getting read
// var IE_activateFlash = function () {
// 	if (document.all) {
// 		var objects = document.getElementsByTagName("object");
// 		for (var i = 0; i < objects.length; i++) {
// 			objects[i].outerHTML = objects[i].outerHTML;
// 		}
// 	}
// }
// 


// http://activecontent.blogspot.com/
function IE_activateFlash(){
	var theObjects = document.getElementsByTagName('object');
	var theObjectsLen = theObjects.length;
	for (var i = 0; i < theObjectsLen; i++) {
		if(theObjects[i].outerHTML){
			if(theObjects[i].data){
				theObjects[i].removeAttribute('data');
			}
			var theParams = theObjects[i].getElementsByTagName("param");
			var theParamsLength = theParams.length;
			for (var j = 0; j < theParamsLength; j++) {
				if(theParams[j].name.toLowerCase() == 'flashvars'){
					var theFlashVars = theParams[j].value;
				}
			}
			var theOuterHTML = theObjects[i].outerHTML;
			var re = /<param name="FlashVars" value="">/ig;
			theOuterHTML = theOuterHTML.replace(re,"<param name='FlashVars' value='" + theFlashVars + "'>");
			theObjects[i].outerHTML = theOuterHTML;
		}
	}
}

IE_removeFlash = function() {
	var objs = document.getElementsByTagName("object");
	for (i=0; i<objs.length; i++) {
		objs[i].parentNode.removeChild(objs[i]); // self-destruct
	}
}

if (document.all) {
	window.attachEvent('onunload', IE_removeFlash);
	DOMAssistant.functionsToCall.push(IE_activateFlash);
}

/* ... /packer:END(IE_activateFlash.js) */
/* (7) packer:START(Collapse.js) ... */

var Collapse = {
	
	set : { all : null },
	
	init : function () {
		var Trg = document.getElementsByClassName('bnwCollapse','div');
		for (var xx=0, el; el = Trg[xx]; xx++) {
			$(el).addEvent('click', Collapse.makeCollapse(el));
		}
	}, // END: init
	
	makeCollapse : function (el) {
		var host = el;
		if (null !== (set = el.className.match(/\bbnwCollapseSet-(\w+)\b/))) {
			var set = set[1];
		} else var set = null;

		return function () {
			host.addClass('bnwCollapseShow');
			if (set && Collapse.set[set])
				Collapse.set[set].removeClass('bnwCollapseShow');

			if (set && Collapse.set[set] != host) {
				Collapse.set[set] = host;
			} else if (set) {
				Collapse.set[set] = null;
			}
		}
	}, // END: makeCollapse
	
	complete : true
	
}

DOMAssistant.functionsToCall.push(Collapse.init);

/* ... /packer:END(Collapse.js) */
/* (8) packer:START(Carousel.js) ... */

var Carousel = {
// settings
	accel : 2.25, // acceleration when pushing
	decel : 0.85, // braking cuts speed by this fraction each frame
	max : 35,     // top speed
	rate : 42,    // miliseconds between frames

	host : null,
	trg  : null,
	speed : 0,
	push : 0,
	current : 0,
	timer : null,

	init : function () {
		Carousel.host = $('carousel');
		if (! Carousel.host) return;
		$(Carousel.host).addClass('slideActive');
		Carousel.trg = Carousel.host.getElementsByTagName('ul')[0];
	// clear out any text childNodes or other junk so that we can easily refer to firstChild and lastChild
		for (var ii=Carousel.trg.childNodes.length -1; ii>=0; ii--) {
			if (Carousel.trg.childNodes[ii].nodeType != 1 || Carousel.trg.childNodes[ii].nodeName.toLowerCase() != 'li')
				Carousel.trg.removeChild(Carousel.trg.childNodes[ii]);
		}

		Carousel.host.create('div', { className : 'slideControl slideControlLeft' }, true, '&nbsp;').addEvent('mouseover', Carousel.less).addEvent('mouseout', Carousel.brake);
		Carousel.host.create('div', { className : 'slideControl slideControlRight' }, true, '&nbsp;').addEvent('mouseover', Carousel.more).addEvent('mouseout', Carousel.brake);
		Carousel.more();
		setTimeout("Carousel.less();", 1000);
		setTimeout("Carousel.brake();", 2250);
	}, // END: init
	
	more : function () {
		Carousel.track(1);
	}, // END: more
	less : function () {
		Carousel.track(-1);
	}, // END: less
	brake : function () {
		Carousel.track(0);
	}, // END: brake
	
	track : function (pushChange) {
		if (Carousel.timer) clearTimeout(Carousel.timer);
// persist any change command
		if (pushChange !== null && !isNaN(parseInt(pushChange))) Carousel.push = parseInt(pushChange);
// calculate speed based on push
		switch (Carousel.push) {
			case 1 :
				Carousel.speed += Carousel.accel;
				if (Carousel.speed > Carousel.max) Carousel.speed = Carousel.max;
				break;
			case -1 :
				Carousel.speed -= Carousel.accel;
				if (Carousel.speed < -1 * Carousel.max) Carousel.speed = -1 * Carousel.max;
				break;
			default :
				var Bump = (Carousel.speed > 0) ? Math.floor : Math.ceil; // round toward zero
				Carousel.speed = Bump(Carousel.speed * Carousel.decel);
		}
// adjust curent position
		Carousel.current += Carousel.speed;
		if (Carousel.current != 0) {
			Carousel.trg.style.marginLeft = (-1 * parseInt(Carousel.current)) +"px";
		} else {
			Carousel.trg.style.marginLeft = "0";
		}
// if new position requires a shuffle, shuffle
		while (Carousel.current < 0) { // there's a gap on the left; move the back slide to the front
			Carousel.trg.insertBefore(Carousel.trg.removeChild(Carousel.trg.lastChild), Carousel.trg.firstChild);
			Carousel.current += Carousel.getOffset(Carousel.trg.childNodes[1]).left;
			Carousel.trg.style.marginLeft = (-1 * parseInt(Carousel.current)) +"px";
		} 
		while (Carousel.current > Carousel.getOffset(Carousel.trg.childNodes[1]).left) { // one slide is completely off left; move the front slide to the back
			Carousel.current -= Carousel.getOffset(Carousel.trg.childNodes[1]).left;
			Carousel.trg.appendChild(Carousel.trg.removeChild(Carousel.trg.firstChild));
			Carousel.trg.style.marginLeft = (-1 * parseInt(Carousel.current)) +"px";
		}
// repeat unless we're stopped and not pushing
		if (Carousel.speed != 0 || Carousel.push != 0) 
			Carousel.timer = setTimeout("Carousel.track()", Carousel.rate);
	}, // END: track


	getOffset : function (el,base) { // no base = offset from parent
		if (!base && el.offsetParent == el.parentNode) {
			return { top : el.offsetTop, left : el.offsetLeft };
		} else if (!base) base = el.parentNode;
		return {
			top  : el.offsetTop  - base.offsetTop,
			left : el.offsetLeft - base.offsetLeft
		};
	},


	complete : true
};
DOMAssistant.functionsToCall.push(Carousel.init);

/* ... /packer:END(Carousel.js) */
/* (9) packer:START(ClientPortfolio.js) ... */

var ClientPortfolio = {
	
	set : { all : null },
	
	init : function () {
		if ($('clickBefore') || $('clickAfter')) {
			if ($('clickBefore')) {
				$('clickBefore').addEvent('click', ClientPortfolio.clickBefore);
				$('clickBefore').addEvent('mouseover', ClientPortfolio.mouseOver);
				$('clickBefore').addEvent('mouseout',  ClientPortfolio.mouseOut);
			}
			if ($('clickAfter')) {
				$('clickAfter').addEvent('click', ClientPortfolio.clickAfter);
				$('clickAfter').addEvent('mouseover', ClientPortfolio.mouseOver);
				$('clickAfter').addEvent('mouseout',  ClientPortfolio.mouseOut);
			}
		}
		var prodDetail = $('projectDetail');
		if (prodDetail) {
			var Ol = prodDetail.getElementsByTagName('ol');
			for (var yy=0; yy<Ol.length; yy++) {
				var Sub = Ol[yy].childNodes;
				for (var xx=0; xx< Sub.length; xx++) {
					if (Sub[xx].nodeName.toLowerCase() != 'li') continue;
					if (/\bactive\b/.test(Sub[xx].className)) {
						var last = Sub[xx].parentNode.getAttribute('active');
						if (last && ! isNaN(parseInt(last)) && Sub[last])
							$(Sub[last]).removeClass('active');
						Sub[xx].parentNode.setAttribute('active',xx);
					}
					Sub[xx].setAttribute('index',xx);
					$(Sub[xx]).addEvent('mouseover', ClientPortfolio.showBiggie);
				}
			}
		}
	}, // END: init
	
	clickBefore : function () {
		this.addClass('active');
		$('clickAfter').removeClass('active');
		if ($('projectBefore')) $('projectBefore').addClass('active');
		if ($('projectAfter'))  $('projectAfter').removeClass('active');
	},
	clickAfter : function () {
		this.addClass('active');
		$('clickBefore').removeClass('active');
		if ($('projectBefore')) $('projectBefore').removeClass('active');
		if ($('projectAfter'))  $('projectAfter').addClass('active');
	},
	mouseOver : function () {
		this.addClass('over');
	},
	mouseOut : function () {
		this.removeClass('over');
	},
	
	showBiggie : function () {
		var Sibs = this.parentNode.childNodes;
		var last = this.parentNode.getAttribute('active');
		if (last != this.getAttribute('index')) {
			if (! isNaN(parseInt(last))) {
				$(Sibs[last]).addClass('fading').removeClass('active');
				if (! /\bfading-\d+/.test(Sibs[last].className)) {
					$(Sibs[last]).addClass('fading-20');
					ClientPortfolio.fade(Sibs[last]);
				}
			}
			this.parentNode.setAttribute('active', this.getAttribute('index'));
			$(this).addClass('fading').addClass('active');
			if (! /\bfading-\d+/.test(Sibs[last].className)) $(Sibs[last]).addClass('fading-1');
			ClientPortfolio.fade(this);
		}
	},
	
	fade : function (el) {
		if (el.timer) clearTimeout(el.timer);
		var step = el.hasClass('active') ? 2 : -2;
		var last = el.className.match(/\bfading-(\d+)/);
		if (! last || ! last[1]) {
			el.removeClass('fading');
		} else {
			var next = parseInt(last[1]) + step;
			if (next < 1 || next > 20) {
				el.removeClass('fading');
				try { delete el.timer; } catch (err) { el.timer = null; }
			} else {
				el.addClass('fading-'+ next);
				el.timer = setTimeout(function (trg) { return function () { ClientPortfolio.fade(trg); }}(el), 20);
			}
			el.removeClass(last[0]);
		}
	},
	
	complete : true
	
}

DOMAssistant.functionsToCall.push(ClientPortfolio.init);

/* ... /packer:END(ClientPortfolio.js) */
/* (10) packer:START(_global.init.js) ... */

if (!document.documentElement)
	document.documentElement = document.getElementsByTagName('html')[0];
$(document.documentElement).addClass('domCapable domLoading');

var bnwDomReady = function () {
	document.documentElement.addClass('domReady').removeClass('domLoading');
}
DOMAssistant.functionsToCall.push(bnwDomReady);

/* ... /packer:END(_global.init.js) */
/* /File Packer, v1.1 */
