function init(){
	hide1 = new Animator().addSubject(new CSSStyleSubject($('projectdesc'),"height: 350px;"));
	    $('desclink').onclick = function() {
			hide1.toggle();
			if ($('desclinka').src.match('../images/show_project_description.gif')) {
				$('desclinka').src = '../images/hide_project_description.gif';
			} else {
				$('desclinka').src = '../images/show_project_description.gif';
			}
	   }

}

function swap_image(src)
{
	if ($('thephoto').src.match(src)) {
		
	} else {
		if ($('desclinka').src.match('../images/hide_project_description.gif')) {
			hide1 = new Animator().addSubject(new CSSStyleSubject($('projectdesc'),"height: 0px;"));
			hide1.toggle();
			$('desclinka').src = '../images/show_project_description.gif';
		} else {
			$('desclinka').src = '../images/show_project_description.gif';
		}
		fade1 = new Animator({duration: 300,onComplete: function() {$('photoimage').innerHTML = '<img src="'+src+'" id="thephoto" />';fade2.toggle();}});
		fade1.addSubject(new NumericalStyleSubject($("photoimage"), 'opacity', 1, 0));
		fade2 = new Animator({duration: 300,transition: Animator.makeEaseIn(3)});
		fade2.addSubject(new NumericalStyleSubject($("photoimage"), 'opacity', 0, 1));
		fade1.toggle();
	}
}

var projectimages = new Array();
function preloadImages(){
	for (x=0; x<preloadImages.arguments.length; x++){
		projectimages[x] = new Image();
		projectimages[x].src = preloadImages.arguments[x];
	}
}

function switch_slides(frame, start_frame, end_frame, delay) {
        return (function() {
            Effect.Fade('slideshow' + frame);
            if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
            setTimeout("Effect.Appear('slideshow" + frame + "');", 850);
            setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850);
        })
    }