/* * *
	INDEX JAVASCRIPT CHECK SCRIPT
	
	work:		osebne knjižice
	author: miha rebernik
	email: 	rasmajx@gmail.com
	site:		majx.org
-------------------------------------------------*/


// Function tests the AJAX capatibilities of the client.
function clientAjax()
{
	var xmlhttp=false;
	
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript conditional compilation, for we to detector older IE.
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (E) {
				xmlhttp = false;
			}
		}
	@end @*/
	
	if (!xmlhttp && typeof XMLHttpRequest!='undefined')
		xmlhttp = new XMLHttpRequest();
	
	if ( !xmlhttp )
		return false;
	else
		return true;

}

// Function tests the client for DOM manip capatibilities.
function clientDOM()
{
	if( document.getElementById && document.childNodes && document.createElement )
		return true;
	else
		return false;
}


// We set the onload handler to perform the chex.
window.onload = function()
{
	if ( clientAjax() && clientDOM() )
		window.location='/home/'
}
