depth = 0;

function hackLists(root, applyHover) {
	if (document.getElementById) {
		var navRoot = document.getElementById(root);
		var menuArray = new Array(navRoot.childNodes.length);
		var node = null;
		
		for (var i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];

			// Fix PNGs for IE
			if ((node.nodeName=="DIV" && depth==1) || (node.nodeName=="LI" && depth>0)) {
				menuArray[i] = new OpacityObject(node.id,"images/75alpha");
				menuArray[i].setBackground();
			}

			// Fix Arbitrary Hover for IE
			if (node.nodeName=="LI") {
				if (browser.isIE && applyHover) {
					node.onmouseover=function() {
						this.className+=" over";
					}
					//node.onmouseout=function() {
					//	this.className=this.className.replace(" over", "");
					//}
				}
				if (browser.isIE && !applyHover) {
					node.onmouseover=function() {
						this.className+=" subover";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" subover", "");
					}
				}
			}
			
			if ((node.nodeName=="LI" || node.nodeName=="UL") && node.id != "") {
				depth += 1;
				hackLists(node.id, false);
			}

		} // endfor
	} // modern browser
	depth -= 1;
}

function popPhoto(uri,width,height,title) {
	window.open('photo.php?title='+title+'&uri='+uri+'.jpg&width='+width+'&height='+height,"pop_"+uri,"toolbar=0,location=0,status=0,scrollbars=0,resizable=1,width="+width+"px,height="+height+"px");
}

function init_photo(uri,height,width) {
	var p = document.getElementById('photo').style;
	p.backgroundImage = 'url('+uri+')';
	p.height = height+'px';
	p.width = width+'px';
}

function init(i) {
	hackLists("navmenu", true);
	switch(i){
	case 2:
		newsimg = new OpacityObject("newsrightimage","images/beach/beach-news.jpg");
		newsimg.setBackground();
		break;
	case 3:
		newsimg = new OpacityObject("frankrightimage","images/tffts-cover");
		newsimg.setBackground();
		break;
	case 4:
		newsimg = new OpacityObject("stylerightimage","images/nitelife");
		newsimg.setBackground();
		break;
	case 5:
		newsimg = new OpacityObject("foreignrightimage","images/p-foreign");
		newsimg.setBackground();
		break;
	case 6:
		newsimg = new OpacityObject("journalismrightimage","images/p-journalism");
		newsimg.setBackground();
		break;
	case 7:
		newsimg = new OpacityObject("travelrightimage","images/p-travel-frontis-sm");
		newsimg.setBackground();
		break;
	case 8:
		newsimg = new OpacityObject("miscrightimage","images/p-misc-frontis-sm");
		newsimg.setBackground();
		break;
	case 9:
		newsimg = new OpacityObject("edurightimage","images/p-edu-frontis-sm");
		newsimg.setBackground();
		break;
	case 10:
		newsimg = new OpacityObject("insearchofrightimage","images/p-iso-frontis");
		newsimg.setBackground();
		break;
	case 11:
		newsimg = new OpacityObject("ctownrightimage","images/p-ctown-frontis");
		newsimg.setBackground();
		break;
	case 12: case 14: case 16:
		newsimg = new OpacityObject("culturalrightimage","images/p-cultural-frontis");
		newsimg.setBackground();
		break;
	case 13:
		newsimg = new OpacityObject("serlingrightimage","images/serling-frontis");
		newsimg.setBackground();
		break;
	case 15:
		newsimg = new OpacityObject("eposrightimage","http://www.sandermedia.com/wordpress/wp-content/plugins/pictpress/resize.php?size=375&path=487%2Fp-greece35.jpg");
		newsimg.setBackground();
		break;
	default:
	}
}