document.write("<style type=\"text/css\" media=\"screen\"> @import '/analysis/css/w3c-js.css'; </style>")

var	dom	= document.getElementById ?	true:false;
var	nn4	= document.layers ?	true:false;
var	ie4	= document.all ? true:false;
var	opr = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
var img_init = false;
var _width, _height;
var currentItem = 0;
var exItem = currentItem;
var navY = 0;

function doClick(e){
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
//	alert(targ.nextSibling.nextSibling.tagName);
	if (targ.nextSibling && targ.nextSibling.nextSibling && targ.nextSibling.nextSibling.style){
		if (targ.nextSibling.nextSibling.style.display=="none"){
			resetHighlight();
			myObject = targ.nextSibling.nextSibling;
			myObject.style.display = 'block';
//			setTimeout("myObject.style.display = 'block'", 300);
			targ.className = "current";
		}else{
			targ.nextSibling.nextSibling.style.display = "none";
			targ.className = "";
		}
	}
}
function resetHighlight(){
	temp = document.getElementById("nav");
	if (temp){
//		alert(temp.childNodes.length);
		for(i=0;i<temp.childNodes.length;i++){
			if (temp.childNodes[i].childNodes[0]) temp.childNodes[i].childNodes[0].className = "";
			if (temp.childNodes[i].childNodes[0] && temp.childNodes[i].childNodes[0].nextSibling && temp.childNodes[i].childNodes[0].nextSibling.nextSibling && temp.childNodes[i].childNodes[0].nextSibling.nextSibling.tagName=="UL") {
				temp.childNodes[i].childNodes[0].nextSibling.nextSibling.style.display = "none";
			}
		}
	}
}
function initHighlight(){
	temp = document.getElementById("nav");
	if (temp){
		for(i=0;i<temp.childNodes.length;i++){
			if (temp.childNodes[i].childNodes[0] && temp.childNodes[i].childNodes[0].nextSibling && temp.childNodes[i].childNodes[0].nextSibling.nextSibling && temp.childNodes[i].childNodes[0].nextSibling.nextSibling.tagName=="UL") {
				temp.childNodes[i].childNodes[0].nextSibling.nextSibling.style.display = "none";
			}
		}
	}
	if (document.getElementById("expanded")) document.getElementById("expanded").style.display = "block";
//	 && temp.childNodes[i].childNodes[0].nextSibling.nextSibling.classname=="hdn"
}

function pageInit() {
	
	if (document.getElementById("nav")){
		document.getElementById("nav").onclick = doClick;
	}
	
	if (window.pageSpecificInit) pageSpecificInit();
	initHighlight();

	if (window.doPageLoad) doPageLoad();
}
window.onload = pageInit;

/*************************************/
function goGoGo(par){
	window.location.href = par;
}

var currentPhoto = 1;
function changePhoto(par){
//	alert(currentPhoto);
	if (par){
		if (document.getElementById("p"+(currentPhoto+1))){
			document.getElementById("p"+currentPhoto).style.display = "none";
			document.getElementById("p"+(currentPhoto+1)).style.display = "block";
			currentPhoto = currentPhoto+1;
			document.getElementById("counter").innerHTML = currentPhoto;
		}
	}
	else {
		if (document.getElementById("p"+(currentPhoto-1))){
			document.getElementById("p"+currentPhoto).style.display = "none";
			document.getElementById("p"+(currentPhoto-1)).style.display = "block";
			currentPhoto = currentPhoto-1;
			document.getElementById("counter").innerHTML = currentPhoto;
		}
	}
}
function openPhotoPopup(width,height,type,id){
	my_width = width;
	my_height = height;
	var _width = 0;
	var _height = 0;
	var centered_width = 0;
	var centered_height = 0;
	_width = screen.availWidth;
	_height = screen.availHeight;
	if (_width>my_width) centered_width = (_width-my_width)/2;
	if (_height>my_height) centered_height = (_height-my_height)/2;
	newwin = window.open("/analysis/channel/photo_popup.asp?photoid="+id+"&phototype="+type,"wokno"+parseInt(Math.random(3)*1000),"top="+centered_height+",left="+centered_width+",status=no,scrollbars=no,menubar=no,resizable=yes,width="+my_width+",height="+my_height);
	newwin.focus();
}
