//var useRPCs = true;
var useRPCs = false;
function e(e)
{
	return document.getElementById(e);
}
function getHTTPObject()
{
	var xmlhttp;
	/*@cc_on
	@if(@_jscript_version >= 5)
	try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}
	@else
	xmlhttp=false;
	@end @*/
	if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
	return xmlhttp;
}
function rpcCall(url, vars, callback)
{
	if(httpOb.readyState==4 || httpOb.readyState==0)
	{
		httpOb.open("POST",'/'+url+'/?rand='+Math.floor(Math.random()*1000000), true);
		httpOb.onreadystatechange=callback;
		httpOb.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
		httpOb.send(vars);
	}
}
var httpOb=getHTTPObject();

function getPage(page)
{
	if(!useRPCs) return true;
	rpcCall('RPC', 'page='+page, function(){if(httpOb.readyState==4 && httpOb.status==200) document.getElementById('main3').innerHTML = httpOb.responseText;});
	return false;
}

function sendContact()
{
	if(!useRPCs) return true;
	rpcCall('Contact/Sent', 'type=' + e('type').value + '&' + 'name=' + e('name').value + '&' + 'email=' + e('email').value + '&' + 'message=' + e('message').value, function(){if(httpOb.readyState==4 && httpOb.status==200) getPage('ContactRPCDone');});
	return false;
}

function jump(uri)
{
	window.location = uri;
}

var winHeight = 0;
function getWindowHeight() //From Google Maps
{
	if(window.self && self.innerHeight) return self.innerHeight;
	if(document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
	return 0;
}

function setContentHeight()
{
	lWH = getWindowHeight();
	if(lWH != winHeight)
	{
		document.getElementById('main').style.height = (getWindowHeight() - 173) + 'px';
	}
	winHeight = lWH;
}

window.onload = function()
{
	setContentHeight();
	window.setInterval("setContentHeight();", 200);
}