	function start(pageId, pageClass) 
	{
		// console.log('#'+pageId + '  .' + pageClass);
		if(pageId != 'home')
		{
			// paragraphFancifier(pageId, pageClass);
			if(pageId != 'directory')
				superscripter();
			
			var mainHeight = $('main').getHeight();
			var pageHeight = $('page').getHeight();

 			if(mainHeight < 500 && pageHeight < 500) 
				var newPadding = 500 - mainHeight;
			else
				var newPadding = pageHeight - mainHeight;		

			$('main').style.paddingBottom = newPadding + 'px';
			
			if(pageId == 'photosView')
			{
				initLightbox();
			}
			
		}
	}
	
	function superscripter() 
	{
		$('main').innerHTML = $('main').innerHTML.sub('®', '<sup>&reg;</sup>',20);
	}
	
	function paragraphFancifier(pageId, pageClass)
	{
		var pageExceptions = ['nominateACandidate','foundationStaff', 'submitResume', 'referenceKap','referenceKip','privacyStatement','termsOfUse'];
		
		if(typeof(pageClass) != 'undefined' && pageClass == 'alumni')
			return;
		
		if(pageExceptions.indexOf(pageId) != -1)
			return;
		else
		{
			// var imageStr = '<img src="' + sysUrl + 'template/images/paragraph-separator.png' + '" alt="" class="paragraphSeparator" />';
			var imageStr = '<span class="paragraphSeparatorSpan">&nbsp;</span>';

			$$('br').each(function(b){
				if(b.next() && b.next().tagName == 'BR')
				{
					if(b.previous() && b.previous().className != 'paragraphSeparator' && b.next() && b.next().className != 'paragraphSeparator')
						b.replace(imageStr);
					else
						b.hide();
				}
			});

			$$('#main p').each(function(p) {
				if(p.next() && p.next().tagName == 'P')
				{
					p.insert({"bottom":imageStr});

					p.next().insert({"top":p.innerHTML});
					p.remove();
				}
			});	
		}
	}
	
	function searchFormWatch(e)
	{
		if(e.keyCode == 13)
			$('searchForm').submit();
	}
	
	
	function callFlashHeader(src)
	{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="713" height="251" id="cgk-flash" align="middle">');
		document.write('<param name="allowScriptAccess" value="always">');
		document.write('<param name="movie" value="' + src + '">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#FFFFFF">');
		document.write('<param name="wmode" value="transparent">');
		document.write('<embed src="' + src + '" quality="high" bgcolor="#FFFFFF" width="713" height="251" name="cgk-flash" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('</object>');
	}
	
	function alumniJobSort()
	{
		location.href = sysUrl + 'alumni/jobs/?c=' + $F('sortSelect');
	}
	
	
	
	
	var Slideshow = Class.create();

	Slideshow.prototype = {
		initialize: function() {
			this.transitionDelay = 1.5;
			this.slideDelay      = 3000;
			this.transitionFps   = 20;
		},
		
		start: function() {
			var allImages = new Array();
			var counter = 0;
			$('slideshowImages').descendants().each(function(e) {
				allImages[counter] = e.src;
				counter++;
				e.remove();
			});
			this.allImages = allImages;
			this.currentImageIndex = 0;

			var self = this;
			window.setTimeout(self.changeImage.bindAsEventListener(this), this.slideDelay);
		},
		
		changeImage: function() {
			if((this.currentImageIndex+1) >= this.allImages.size())
				nextImageIndex = 0;
			else
				nextImageIndex = this.currentImageIndex+1;

			if(!$('nextSlideshowImage').visible())
			{
				$('nextSlideshowImage').update('<img src="' + this.allImages[nextImageIndex] + '" />');
				new Effect.Fade('currentSlideshowImage', {duration:this.transitionDelay, fps:this.transitionFps});
				new Effect.Appear('nextSlideshowImage', {duration:this.transitionDelay, fps:this.transitionFps});
			}
			else
			{
				$('currentSlideshowImage').update('<img src="' + this.allImages[nextImageIndex] + '" />');
				new Effect.Appear('currentSlideshowImage', {duration:this.transitionDelay, fps:this.transitionFps});
				new Effect.Fade('nextSlideshowImage', {duration:this.transitionDelay, fps:this.transitionFps});
			}
			
			this.currentImageIndex = nextImageIndex;			
			var self = this;
			window.setTimeout(self.changeImage.bindAsEventListener(this), this.slideDelay);
		}
		
	};

	var slideshow = new Slideshow();
	

	
