
           <!--
                       
            // |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
            // 
            // Coded by Travis Beckham
            // http://www.squidfingers.com | http://www.podlob.com
            // If want to use this code, feel free to do so, but please leave this message intact.
            // If you do remove this, I will hunt you down :)
            //
            // |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
            // --- myapi version date: 03/29/02 ------------------------------------------------------
            //
            // ---------------------------------------------------------------------------------------
            // Several functions added or modified by Scott Upton, Uptonic.com
            // January 2005
            // ---------------------------------------------------------------------------------------
            
            Detect = function(){
            	var agent = navigator.userAgent.toLowerCase(); 
            	this._mac = agent.indexOf('mac') != -1;
            	this._win = !this._mac;
            	this._w3c = document.getElementById;
            	this._iex = document.all;
            	this._ns4 = document.layers;
            }
            Detect.prototype.getObj = function(name){
            	if(this._w3c){
            		return document.getElementById(name);
            	}else if(this._iex){
            		return document.all[name];
            	}else if(this._ns4){
            		return this.getObjNS4(document,name);
            	}
            }
            Detect.prototype.getObjNS4 = function(obj, name){
            	var d = obj.layers;
            	var result,temp;
            	for(var i=0; i<d.length; i++){
            		if(d[i].id == name){
            		 	result = d[i];
            		}else if(d[i].layers.length){
            			var temp = this.getObjNS4(d[i],name);
            		}
            		if(temp){
            			result = temp;
            		}
            	}
            	return result;
            }
            Detect.prototype.getStyle = function(obj){
            	return (this._ns4) ? obj : obj.style;
            }
            Detect.prototype.getWindowWidth = function(){ // width of the window
            	return this._iex ? document.body.clientWidth : window.innerWidth;
            }
            Detect.prototype.getWindowHeight = function(){ // height of the window
            	return this._iex ? document.body.clientHeight : window.innerHeight;
            }
            Detect.prototype.getScrollTop = function(){ // top scroll position of the window
            	return this._iex ? document.body.scrollTop : window.pageYOffset;
            }
            Detect.prototype.getScrollLeft = function(){ // left scroll position of the window
            	return this._iex ? document.body.scrollLeft : window.pageXOffset;
            }
            Detect.prototype.setScrollTop = function(n){ // set the vertical scroll position of the window
            	window.scrollTo(this.getScrollLeft(),n);
            }
            Detect.prototype.setScrollLeft = function(n){ // set the horizontal scroll position of the window
            	window.scrollTo(n,this.getScrollTop());
            }
            Detect.prototype.setScroll = function(x,y){ // set the x,y scroll position of the window
            	window.scrollTo(x,y);
            }
            
            // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            
            // HTMLobj Constructor
            
            HTMLobj = function(name){
            	if(name){
            		this._inherit = Detect; this._inherit(name);
            		this._id  = name;
            		this._el  = this.getObj(this._id);
            		this._css = this.getStyle(this._el);
            		this._obj = name+'Object'; eval(this._obj+'=this');	
            		this._timer = null;
            		this._glideRunning = false;
            		this._tweenRunning = false;
            		this._fadeRunning = false;	// Added by SU, Couloir
            		this._randNum = null;		// Added by SU, Couloir
            		this._startFade = false;	// Added by SU, Couloir
            		return this;
            	}
            }
            HTMLobj.prototype = new Detect();
            
            HTMLobj.prototype.getLeft = function(){ // left position of the element
            	return parseInt(this._css.left || 0);
            }
            HTMLobj.prototype.getTop = function(){ // top position of the element
            	return parseInt(this._css.top || 0);
            }		
            HTMLobj.prototype.getWidth = function(){ // width of the element
            	if(this._ns4){
            		 return this._el.document.width;
            	}else{
            		return this._el.offsetWidth;
            	}
            }
            HTMLobj.prototype.getHeight = function(){ // height of the element
            	if(this._ns4){
            		 return this._el.document.height;
            	}else{
            		return this._el.offsetHeight;
            	}
            }
            HTMLobj.prototype.getClipWidth = function(){ // clip width of the element
            	if(this._ns4){
            		 return this._el.clip.width;
            	}else{
            		return this._el.offsetWidth;
            	}
            }
            HTMLobj.prototype.getClipHeight = function(){ // clip height of the element
            	if(this._ns4){
            		 return this._el.clip.height;
            	}else{
            		return this._el.offsetHeight;
            	}
            }
            HTMLobj.prototype.setStyle = function(prop, val){ // change the value of any css property
            	if(!this._ns4){
            		this._el.style[prop] = val;
            		if(this._iex && this._mac){
            			this._el.innerHTML = this._el.innerHTML;
            		}
            	}
            }
            HTMLobj.prototype.show = function(){ // show the visibility of the element
            	this._css.visibility = 'visible';
            }
            HTMLobj.prototype.hide = function(){ // hide the visibility of the element
            	this._css.visibility = 'hidden';
            }
            HTMLobj.prototype.showhide = function(){ // toggle the visibility of the element
            	if(this._css.visibility == 'hidden' || this._css.visibility == 'hide'){
            		this._css.visibility = 'visible';
            	}else{
            		this._css.visibility = 'hidden';
            	}
            }
            HTMLobj.prototype.setInner = function(html){ // change the contents of the element
            	if(this._ns4){
            		this._el.document.open();
            		this._el.document.write(html);
            		this._el.document.close();
            	}else{
            		this._el.innerHTML = html;
            	}
            }
            HTMLobj.prototype.moveTo = function(x,y){ // move the element to a new position
            	if(this._ns4){
            		this._el.moveTo(x,y);
            	}else{
            		this._css.left = x;
            		this._css.top  = y;
            	}
            }
            HTMLobj.prototype.moveBy = function(x,y){ // move the element to a new position relative to it's current position
            	if(this._ns4) {
            		this._el.moveBy(x,y);
            	}else{
            		this._css.left = this.getLeft()+x;
            		this._css.top  = this.getTop()+y;
            	}
            }
            HTMLobj.prototype.sizeTo = function(w,h){ // set the size of the element
            	if(!this._ns4){
            		this._css.width = w+'px';
            		this._css.height = h+'px';
            	}
            }
            HTMLobj.prototype.sizeBy = function(w,h){ // set the size of the element relative to it's current size
            	if(!this._ns4){
            		this._css.width = this.getWidth()+w+'px';
            		this._css.height = this.getHeight()+h+'px';
            	}
            }
            HTMLobj.prototype.glideTo = function(x,y,callback){ // ease-out animation, callback function optional
            	if(this._glideRunning){
            		var left = this.getLeft();
            		var top  = this.getTop();
            		if(Math.abs(left-x)<=1 && Math.abs(top-y)<=1){
            			this.moveTo(x,y);
            			this.cancelGlide();
            			if(callback){
            				eval(this._obj+'.'+callback+'()');
            			}
            		}else{
            			this.moveTo(left+(x-left)/2, top+(y-top)/2);
            		}
            	}else{
            		var c = (callback) ? ',\"'+callback+'\"' : '' ;
            		this._timer  = setInterval(this._obj+'.glideTo('+x+','+y+c+')',100);
            		this._glideRunning = true;
            	}
            }
            HTMLobj.prototype.cancelGlide = function(){ // cancel the glideTo method
            	clearInterval(this._timer);
            	this._timer = null;
            	this._glideRunning = false;
            }
            HTMLobj.prototype.swapDepth = function(obj){ // swap the z-index of 2 elements
            	var temp = this._css.zIndex;
            	this._css.zIndex = obj._css.zIndex;
            	obj._css.zIndex = temp;
            }
            // -------------------------------------------
            // Modified by SU, Uptonic.com
            // -------------------------------------------
            HTMLobj.prototype.tweenTo = function(method, start, end, time){ // time-based animation, with multiple easing methods
            // method: a function that takes 4 arguments: time, start, change, and duration
            // start: array of starting width, height dimensions [w, h]
            // end: array of ending width, height dimensions [w, h]
            // time: number of 'frames' it takes to get to the end position
            	if(!this._tweenRunning){
            		this._tweenTime = 0;
            		var s = '['+start.toString()+']';
            		var e = '['+end.toString()+']';
            		this._timer = setInterval(this._obj+'.tweenTo('+method+','+s+','+e+','+time+')', 33);
            		this._tweenRunning = true;
            	}
            	if(++this._tweenTime > time){
            		this.cancelTween();
            	}else{
            		var w = method(this._tweenTime, start[0], end[0]-start[0], time);
            		var h = method(this._tweenTime, start[1], end[1]-start[1], time);
            		this.sizeTo(w,h);
            	}
            }
            HTMLobj.prototype.cancelTween = function(){ // cancel the tweenTo method
            	clearInterval(this._timer);
            	this._timer = null;
            	this._tweenRunning = false;
            	this._startFade = true;
            }
            
            // -> Easing Equations by Robert Penner - robertpenner.com -
            linearTween = function(t, b, c, d){
            	return c*t/d + b;
            }
            easeInQuad = function(t, b, c, d){
            	t /= d;
            	return c*t*t + b;
            }
            easeOutQuad = function(t, b, c, d){
            	t /= d;
            	return -c * t*(t-2) + b;
            }
            easeInOutQuad = function(t, b, c, d){
            	t /= d/2;
            	if (t < 1) return c/2*t*t + b;
            	t--;
            	return -c/2 * (t*(t-2) - 1) + b;
            }
            easeInExpo = function(t, b, c, d){
            	return c * Math.pow( 2, 10 * (t/d - 1) ) + b;
            }
            easeOutExpo = function(t, b, c, d){
            	return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;
            }
            // -------------------------------------------
            // Added by SU, Uptonic.com
            // December 2004 - January 2005
            // -------------------------------------------
            HTMLobj.prototype.getRandom = function(start,end){ // generate new random number
                this._randNum= Math.round(start + ((end-start) * Math.random()));
                return this._randNum;
            }
            HTMLobj.prototype.setOpacity = function(opacity){ // set opacity of the element
            	// Fix for math error in some browsers
            	opacity = (opacity == 100)?99.999:opacity;
            	// IE/Windows
            	this._css.filter = "alpha(opacity:"+opacity+")";
            	// Safari < 1.2, Konqueror
            	this._css.KHTMLOpacity = opacity/100;	
            	// Older Mozilla and Firefox
            	this._css.MozOpacity = opacity/100;
            	// Safari 1.2, newer Firefox and Mozilla, CSS3
            	this._css.opacity = opacity/100;
            }
            HTMLobj.prototype.fadeOut = function(opacity, change, speed){ // gradually decrease the opacity of the element
            // opacity: starting opacity of element
            // change: the size of the increments between steps
            // speed: the rate of the animation
            	if (opacity >= 0){
            	  this._fadeRunning = true;
            	  this.setOpacity(opacity);
            	  opacity -= change;
            	  setTimeout(this._obj+'.fadeOut('+opacity+','+change+','+speed+')', speed);
            	} else {
            		this._fadeRunning = false;
            		this.hide();
            	}
            }
            HTMLobj.prototype.fadeIn = function(opacity, change, speed){ // gradually increase the opacity of the element
            // opacity: starting opacity of element
            // change: the size of the increments between steps
            // speed: the rate of the animation	
            	if (opacity <= 100){
            	  this.show();
            	  this._fadeRunning = true;
            	  this.setOpacity(opacity);
            	  opacity += change;
            	  setTimeout(this._obj+'.fadeIn('+opacity+','+change+','+speed+')', speed);
            	} else {
            		this._fadeRunning = false;
            		this.setOpacity(100);
            	}
            }
            HTMLobj.prototype.displayShow = function(){ // display the element as 'block'
            	this._css.display = 'block';
            }
            HTMLobj.prototype.displayHide = function(){ // do not display the element
            	this._css.display = 'none';
            }
            HTMLobj.prototype.setSrc = function(target){ // set the element's source to target
            	this._el.src = target;
            }
            HTMLobj.prototype.setHref = function(target){ // set the element's link to target
            	this._el.href = target;
            }
            HTMLobj.prototype.setInnerHtml = function(content){ // set the element's inner HTML to content
            	this._el.innerHTML = content;
            }
           
          	var currentPhoto = 28;
          	var photoDir     = "home_images/";
            var photoArray   = new Array("screendoor09_8x4.jpg","screendoor10_8x4.jpg","screendoor11_4x2.jpg","transport01.jpg","transport02.jpg","transport10.jpg","transport11.jpg","transport12.jpg","transport03.jpg","transport04.jpg","transport05.jpg","transport06.jpg","transport07.jpg","transport08.jpg","transport09.jpg","Camden01.jpg","Camden03.jpg","grid01_3x3.jpg","grid02_3x3.jpg","grid03_4x4.jpg","grid04_3x3.jpg","grid05_6x3.jpg","grid06_6x3.jpg","grid07_4x4.jpg","grid08_4x4.jpg","grid09_5x5.jpg","grid10_5x5.jpg","grid11_6x6.jpg","grid17_4x4.jpg","grid18_2x2.jpg","grid19_2x2.jpg","grid20_2x2.jpg","humidity03_3x3.jpg","humidity05_4x4.jpg","humidity06_4x4.jpg","humidity10_5x5.jpg","screendoor01_6x3.jpg","screendoor02_6x3.jpg","screendoor03_6x3.jpg","screendoor04_4x4.jpg","screendoor05_4x4.jpg","screendoor06_4x4.jpg","screendoor07_4x4.jpg","screendoor08_6x6.jpg","travel01.jpg","travel05.jpg","travel06.jpg","travel07.jpg","travel08.jpg","travel09.jpg");
			
			
            var currentArray = new Array("travel07.jpg","transport05.jpg","screendoor05_4x4.jpg","grid07_4x4.jpg","travel09.jpg","screendoor06_4x4.jpg","grid10_5x5.jpg","Camden01.jpg","grid01_3x3.jpg","humidity03_3x3.jpg","screendoor01_6x3.jpg","transport01.jpg","travel01.jpg","Camden03.jpg","grid02_3x3.jpg","humidity05_4x4.jpg","screendoor02_6x3.jpg","transport02.jpg","travel05.jpg","grid03_4x4.jpg","humidity06_4x4.jpg","screendoor03_6x3.jpg","transport03.jpg","travel06.jpg","grid04_3x3.jpg","humidity10_5x5.jpg","screendoor04_4x4.jpg","transport04.jpg");
           
        	// Create access to 'Detect' object and a place to put instances of 'HTMLobj'
        	API = new Detect();
        	
        	// CREATE INSTANCES & LOAD
        	loadAPI = function() {
        		// Instantiate HTMLobj
        		API.Container		= new HTMLobj('Container1');
        		API.Photo			= new HTMLobj('Photo1');
                setTimeout("cyclePhoto()",3000);
        		// Event listeners for onload and onclick events
        		document.getElementById('Photo1').onload = initFade;
        		document.getElementById('Photo2').onload = initFade;
        		document.getElementById('Photo3').onload = initFade;
        		document.getElementById('Photo4').onload = initFade;
        		document.getElementById('Photo5').onload = initFade;
        		document.getElementById('Photo6').onload = initFade;
        		document.getElementById('Photo7').onload = initFade;
        		document.getElementById('Photo8').onload = initFade;
        		document.getElementById('Photo9').onload = initFade;
        		document.getElementById('Photo10').onload = initFade;
        		document.getElementById('Photo11').onload = initFade;
        		document.getElementById('Photo12').onload = initFade;
        		document.getElementById('Photo13').onload = initFade;
        		document.getElementById('Photo14').onload = initFade;
        		document.getElementById('Photo15').onload = initFade;
				document.getElementById('Photo16').onload = initFade;
				document.getElementById('Photo17').onload = initFade;
				document.getElementById('Photo18').onload = initFade;
				document.getElementById('Photo19').onload = initFade;
				document.getElementById('Photo20').onload = initFade;
				document.getElementById('Photo21').onload = initFade;
				document.getElementById('Photo22').onload = initFade;
				document.getElementById('Photo23').onload = initFade;
				document.getElementById('Photo24').onload = initFade;
				document.getElementById('Photo25').onload = initFade;
				document.getElementById('Photo26').onload = initFade;
				document.getElementById('Photo27').onload = initFade;
				document.getElementById('Photo28').onload = initFade;
        	}
            
        	//onload = loadAPI;

            Array.prototype.inArray = function (value)
                {
                    var i;
                    for (i=0; i < this.length; i++) {
                        // Matches identical (===), not just similar (==).
                        if (this[i] === value) {
                            return true;
                        }
                    }
                    return false;
                };
            
            
        	cyclePhoto = function() {

                if (currentArray.inArray(photoArray[currentPhoto])) {
             	    if (currentPhoto<photoArray.length-1) {
                       currentPhoto++;
                	}  else {
                       currentPhoto=0;
                	}
                    setTimeout("cyclePhoto()",10);
                } else {
 
                    //var randomPhoto = Math.floor(Math.random()*5);
                    var randomCell  = Math.floor(Math.random()*28)+1;
                    var newPhoto    = 'Photo' + randomCell;
                    var newImageURL = photoDir+photoArray[currentPhoto];
                    currentArray[randomCell-1] = photoArray[currentPhoto];
                    API.Photo	    = new HTMLobj(newPhoto);
    
            		// Hide photo container and caption temporarily
            		API.Photo.hide();
             		API.Photo.setOpacity(0);
            		//API.Photo.setSrc(photoDir+'spacer.gif');	
                    
            		// Start tween on a delay
            		var borderSize = 0;
    
              		var wCur = parseInt(130);
              		var hCur = parseInt(130);
              		var wNew = parseInt(130);
              		var hNew = parseInt(130);
    
            		// Set source, width, and height of new photo
            		API.Photo.setSrc(newImageURL);		
            		API.Photo.sizeTo(wNew,hNew);
    
                    var myPhoto='Photo' + randomCell
    
                	if (currentPhoto<photoArray.length-1) {
                       currentPhoto++;
                	}  else {
                       currentPhoto=0;
                	}
            		// Set for next random event
                    setTimeout("cyclePhoto()",2000);
                
                }
        	}
            
            
            changeImageAlt = function(id,newAlt) {
              if (document.links.length > 0) {
                if (document.getElementById) {
                  document.getElementById(id).title = newAlt;
                } else if (document.all) {
                  document.all[id].title = newAlt;
                }
              }
            }
                    
                    
            changeLinkHref = function(id,newHref) {
              if (document.links.length > 0) {
                if (document.getElementById) {
                  document.getElementById(id).href = newHref;
                } else if (document.all) {
                  document.all[id].href = newHref;
                }
              }
            }
           
        	// Fade in photo when it is loaded from the server
        	initFade = function(){
        		// Show PhotoContainer again
        		//API.PhotoContainer.show();
        		
        		// Be certain the tween is complete before fading, too
        		var fade_timer = setInterval('startFade()', 200);
        						
        		// Fade photo in when ready and clear listener
        		startFade = function(){
        			if(API.Container._tweenRunning == false){
        				clearInterval(fade_timer);
        				// Fade photo in
        				API.Photo.fadeIn(0,15,63); // opacity, change, speed
        			} else {
        				return;
        			}
        		}
        	}
           
            function run(){

               //MM_preloadImages('files/project_images/2006-04-20044t.jpg','files/project_images/2006-04-20023t.jpg');
               loadAPI();

            }

           //-->

