
var nHeld = false;
function keyHit(e)
{
	var keynum;
	if(false && window.event){ // IE
		keynum = e.keyCode;
	} else if(e.which){ // Netscape/Firefox/Opera
		keynum = e.which;
	}

	if(keynum == 78) { //N
		toggleNewWindow();
	}
	
	if(keynum == 83) { // S
		document.location.href = 'secure.php?flip';
	}
}

function showMixedLog() {
	showdiv("mixed_content");
	hidediv("update_content");
	hidediv("travel_content");
	hidediv("map_content");
	hidediv("feature_content");
	return false;
}

function showUpdateLog() {
	hidediv("mixed_content");
	showdiv("update_content");
	hidediv("travel_content");
	hidediv("map_content");
	hidediv("feature_content");
	return false;
}

function showTravelLog() {
	hidediv("mixed_content");
	hidediv("update_content");
	showdiv("travel_content");
	hidediv("map_content");
	hidediv("feature_content");
	return false;
}
function showMap() {
	hidediv("mixed_content");
	hidediv("update_content");
	hidediv("travel_content");
	showdiv("map_content");
	hidediv("feature_content");
	return false;
}

function showFeatureLog() {
	hidediv("mixed_content");
	hidediv("update_content");
	hidediv("travel_content");
	hidediv("map_content");
	showdiv("feature_content");
	return false;
}

function toggleEntry(id, vis) {
	if(vis){
		showdivX('hd'+id);
		hidediv('sh'+id);
		showdiv(id);
	} else {
		hidediv('hd'+id);
		showdivX('sh'+id);
		hidediv(id);
	}
	return false;
}

function toggleNewWindow() {
	if(!nHeld){
		setImgURL("winIMG" , 'images/win_light.jpg');
	}else {
		setImgURL("winIMG", 'images/win_dark.jpg');
	}
	nHeld = !nHeld;
}
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		} 
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function showdivX(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'inline';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'inline';
		} 
		else { // IE 4
			document.all.id.style.display = 'inline';
		}
	}
}


function hoverWinOut() {
	if(nHeld){
		setImgURL('winIMG','images/win_light.jpg');
	} else {
		setImgURL('winIMG','images/win_dark.jpg');
	}
}

function setImgURL(id, url ) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).src = url;
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.src = url;
		} 
		else { // IE 4
			document.all.id.src = url;
		}
	}
}

function viewGalleryAlbum(albumUrl)
{
	if(nHeld){
		window.open('http://mikrasov.com/gallery/index.php?newWin&dir='+albumUrl, '_blank');
		self.focus();
		return false;
	}
}
