$(document).ready(function() {
	for(var i = 0; i < menu.length; i++) {
		$("#Link" + menu[i]).click(clickPage);
	}
	$("#StartPageDiv div.sign").mouseover(showSign);
	$("#StartPageDiv div.sign").mouseout(hideSign);
	if(document.location.hash && $(document.location.hash.substr(1) + 'Div')) {
		if(actpage != (document.location.hash + '').substr(1)) closePage(actpage);
		openPage((document.location.hash + '').substr(1))
	} else {
		openPage(actpage, 1)
	}
});

function load() {
	document.getElementById('ContactDiv').style.display = 'block';
	document.getElementById('ContactDiv').innerHTML = '<' + 'iframe width="960" height="580" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.com/maps?f=q&amp;source=s_q&amp;hl=sv&amp;geocode=&amp;q=volontaire+stockholm&amp;sll=37.0625,-95.677068&amp;sspn=40.817312,117.949219&amp;ie=UTF8&amp;t=h&amp;cid=59342144,18060484,1253018368017322714&amp;s=AARTsJpW-zOp_g79go5qi4qGUn1By13qiA&amp;ll=59.348552,18.061953&amp;spn=0.013565,0.042915&amp;z=15&amp;iwloc=A&amp;output=embed"' + '></' + 'iframe>';	
}
function closePage(id) {
	$("#" + id + "Div").fadeOut(300);
	$("#Link" + id).removeClass('show');
	$("#Link" + id).parent().removeClass('on');
	actpage = false;
}
function openPage(id, skiphash) {
	$("#" + id + "Div").fadeIn(300);
	$("#Link" + id).addClass('show');
	$("#Link" + id).parent().addClass('on');
	if(skiphash == undefined) {
		document.location.hash = id;
	}
	if(id == 'Contact') load();
	actpage = id;		
}
function clickPage() {
	var id = this.id.substr(4);
	if(id != actpage) {
		closePage(actpage);
		openPage(id);
	}
	this.blur();
	return false;
}
function activatePaper() {
	$("#PaperForm").focus();	
}
function showSign() {
	$(this).children('span').hide();
}
function hideSign() {
	$(this).children('span').show();
}