// JavaScript Document
function siylc_ajax(url,id,loader){
	var url = url;
	xmlHttp = null;
	try{
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("Your browser does not support AJAX!");      
				return true;      
			}    
		}
	}
	xmlHttp.onreadystatechange=function (){ 
		if (xmlHttp.readyState==4){ 
			document.getElementById(id).innerHTML = xmlHttp.responseText;
			if(xmlHttp.responseText==""){
				document.getElementById(id).style.display = "none";
			}else{
				document.getElementById(id).style.display = "block";
			}
		}else{
			if(loader!=null){
				document.getElementById(id).style.display = "block";
				document.getElementById(id).innerHTML = loader;
			}
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	return false;
}

function siylc_ajax_nav(url,id,loader){
	siylc_ajax("/inc" + url,id,loader);
	window.location.href = "#" + url;	
	return false;
}

function siylc_swap(show,hide){
	if(show!=""){
		document.getElementById(show).style.display = "block";
	}
	if(hide!=""){
		document.getElementById(hide).style.display = "none";
	}
}

// CHeck URL for AJAX incoming links
ajaxurl = window.location.href.split('#/');
if(ajaxurl[1]!=null){
	window.location.href = "/" + ajaxurl[1];
}