window.onload = function(){
	var email = "pzich" + String.fromCharCode(64) + "pzich.com";
	document.getElementById('email-placeholder').href = "mailto:" + email;
	document.getElementById('email-placeholder').innerHTML = email;
	document.getElementById('phone-placeholder').innerHTML = ["773","789","9424"].join(".");
	
	(function(links, dLink){
		var hashchange = function(){
			var hash;
			if(window.location.hash.length > 0){
				hash = window.location.hash.substr(1);
				if(!links[hash])
					hash = dLink;
			}else{
				hash = dLink;
			}
			
			for(var key in links){
				document.getElementById(links[key].link).parentNode.className = "menu-item";
				document.getElementById(links[key].content).style.display = "none";
			}
			
			document.getElementById(links[hash].link).parentNode.className = "menu-item menu-selected";
			document.getElementById(links[hash].content).style.display = "block";
		};
		hashchange();
		window.addEventListener('hashchange', hashchange, true);
	})({
		"about" : {
			"link": "about-link",
			"content": "about-content"
		},
		"portfolio" : {
			"link": "portfolio-link",
			"content": "portfolio-content"
		},
		"iphone" : {
			"link": "iphone-link",
			"content": "iphone-content"
		},
		"contact" : {
			"link": "contact-link",
			"content": "contact-content"
		}
	}, "about");
};
