// For ns4
var theWidth, theHeight;
if (document.layers) {
	theWidth = window.innerWidth;
	theHeight = window.innerHeight;
	
	window.onresize = function() { 
		if (window.innerWidth != theWidth || window.innerHeight != theHeight) {
			history.go(0); 
		}
	}
}

/*Get the element */
function myElement(id) {
	var myElement = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (myElement) {
		myElement.css = (myElement.style)? myElement.style: myElement;
	}
	return myElement;
}

var currentLayer;	//ID of current visible layer

function swap(id) {
	if (currentLayer) {
		hide(currentLayer);
	}
	show(id);
	currentLayer = id;
}

function show(id) {
	var layer = myElement(id);
	if (layer && layer.css) {
		layer.css.display = "block";
	}
}

function hide(id) {
	var layer = myElement(id);
	if (layer && layer.css) {
		layer.css.display = "none";
	}
}

function showPortfolio() {
	swap('portfolio');
}
						

/* onload function if needed */
function init() {

	var links = document.getElementsByTagName('a');
    for (var i=0;i < links.length;i++) {
        if (links[i].className == 'open') {
            links[i].onclick = function() {
                window.open(this.href);
                return false;
            };
        }
    }
	swap('specific1');
}

window.onload = init;