function $(e){
	return document.getElementById(e);}

function Show(page){
	document.location='?p='+page;}

function Load(){
	var page='home';
	var qs=document.location.href.split('?');
	if(qs.length>1){
		var end=qs[1].indexOf('&',qs[1].indexOf('p=')+1);
		if (end>-1){
			page=qs[1].substring(qs[1].indexOf('p=')+2,end);}
		else{
			page=qs[1].substring(qs[1].indexOf('p=')+2);}
	}
	Client.Net.Request(document.location.href.substring(0,document.location.href.indexOf('site.htm'))+page+'.xml',null,function(response){$('content').innerHTML=response.getElementsByTagName('xml').item(0).firstChild.data;});}

function ShowScreenShot(image){
	$('asdf').src='resources/screenshots/'+image;
	
	$('asdf').onclick=function(){
		$('divImageContainer').style.display='none';}

	$('asdf').onload=function(){
		$('progress').style.display='none';
		$('divImageContainer').style.top=(document.body.offsetHeight/2)-($('asdf').height/2);
		$('divImageContainer').style.left=(document.body.offsetWidth/2)-($('asdf').width/2);
		$('asdf').style.display='inline';
		$('divImageContainer').style.display='inline';}
}

var Client=new function(){
	this.Net=new function(){
		var m_HttpRequest=GetHttpRequest();
		
		this.Request=function(url,postData,callback){
			m_HttpRequest.open("GET",url,true);
			m_HttpRequest.onreadystatechange=function(){
				if (m_HttpRequest.readyState == 4){
					if (m_HttpRequest.status == 200){
						callback(m_HttpRequest.responseXML);}}}
			m_HttpRequest.send(postData);}
		
		function GetHttpRequest(){
			if (window.XMLHttpRequest){
				m_HttpRequest=new XMLHttpRequest();}
			else if (window.ActiveXObject){
				m_HttpRequest=new ActiveXObject("Microsoft.XMLHTTP");}
			return m_HttpRequest;}}
}

