


	function page_init() {
		if(typeof sIFR == "function"){		
			sIFR.replaceElement("div#info h1", named({sFlashSrc: "/sifr/akzidenz-lghtcn.swf", sColor: "#616161", sCase: "upper"}));
			sIFR.replaceElement("div#info h2", named({sFlashSrc: "/sifr/akzidenz-cn.swf", sColor: "#85b02d", sCase: "upper"}));
		};
	};

	function menuManager(cont) {
		// hide the screenshot list
		this.container = document.getElementById(cont);
		this.items = this.container.getElementsByTagName('ul')[0].getElementsByTagName('li');
		this.buildMenu();	
		this.setSelected(0);		
	};

	menuManager.prototype.buildMenu = function() {
		//create a js screenshot flipper		
		if(this.items.length > 1) {
			
			//create prev adn next buttons
			var prev = document.createElement('a');
			var next = document.createElement('a');
			
			prev.appendChild(document.createTextNode('prev'));
			next.appendChild(document.createTextNode('next'));
			prev.setAttribute("href", "#");
			next.setAttribute("href", "#");
			prev.setAttribute("id", "prev");
			next.setAttribute("id", "next");
			prev.setAttribute("class", "nav");
			next.setAttribute("class", "nav");
			
			var me = this;
			prev.onclick = function() {
				me.setSelected(me.current - 1);
				return false;
			}
			next.onclick = function() {
				me.setSelected(me.current + 1);
				return false;
			}
			
			//crete menu
			this.menu = document.createElement('ul');
			for(j = 0; j < this.items.length; j++) {
				var li = document.createElement('li');
				
				var a = document.createElement('a');			
				a.appendChild(document.createTextNode(j+1));
				a.setAttribute("href", "#");
				a.setAttribute("title", "Screenshot "+j);
				a.itemNumber = j;
				var me = this;
				a.onclick = function() {
					me.setSelected(this.itemNumber);				
					return false;
				}
				j == 0 ? li.className = "selected" : 0;
				li.appendChild(a);
				this.menu.appendChild(li);			
			}
			this.menu.id = "shotmenu";
			
			this.container.appendChild(prev);
			this.container.appendChild(next);
			this.container.appendChild(this.menu);				
		}
	}

	menuManager.prototype.setSelected = function(index) {
		index < 0 ? index = this.items.length - 1 : 0; 
		index == this.items.length ? index = 0 : 0; 
		
		this.current = index;
		this.clearAll();
		this.items[index].style.display = "block";	
		this.menu.getElementsByTagName('li')[index].className = "selected";			
	}

	menuManager.prototype.clearAll = function() {
		for(k = 0; k < this.items.length; k++) { this.items[k].style.display = "none"; }	
		var links = this.menu.getElementsByTagName('li');
		for(l = 0; l < links.length; l++) {
			links[l].className = null;
		}
	}


	
	var menu = new menuManager('screenshots');
	

