/**************************************************\
| AJAX for BIKETOTE.com                                       |
| Designed by Nucleus Systems (nucleussystems.com)     |
| Copyright, All rights reserved                                  |
\**************************************************/

function getAJAX(){// retrieve AJAX
	var ajax = false;
	try {
		ajax = new XMLHttpRequest();
	}catch (e){
		try {
			ajax = new ActiveXObject('Msxml2.XMLHTTP');
		}catch (e){
      try {
        ajax = new ActiveXObject('Microsoft.XMLHTTP');
      }catch (e){
        ajax = false;
      }
		}
	}
	return ajax;
}
function Switch(url){// change Content
	if (getAJAX()){//if ajax returns true
		var doc = document.getElementById('CONTENT');// set var for doc content
		doc.innerHTML = 'Loading...';
		var ajx = getAJAX();
		ajx.open('GET', 'php/page.php?x&p='+url, true);
		var q = setTimeout('window.location="?p='+url+'";', 30000);
		ajx.onreadystatechange = function (){
			clearTimeout(q);
			if (ajx.readyState==4){
				doc.innerHTML = ajx.responseText;
			}
		}
		ajx.send(null);
	}else{//but if not, just goto that url
		window.location = '?p='+url;
	}
}
