newURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;
pathArray = window.location.pathname.split('/');
var path="";
path = pathArray;
path = (path.toString());
var p0 = "/";
var p1 = "/firm-overview/";
var p2 = "/news/";
var p3 = "/practice-areas/";
var p4 = "/faq/";
var p5 = "/contact-us/";

path = (path.replace(/,/gi, "/"));

var http = createRequestObject();
function createRequestObject() {
	var objAjax;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		objAjax = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		objAjax = new XMLHttpRequest();
	}
	return objAjax;
}

function getNewContent(){
	http.open('get','/didyouknow.txt');
	http.onreadystatechange = updateNewContent;
	http.send(null);
	return false;
}

function updateNewContent(){
	if(http.readyState == 4){
	var b = http.responseText;
	var temp = new Array();
	temp = b.split('\n\n');

	randno = Math.floor ( Math.random() * temp.length ); 
	var text = (temp[randno]);

	var sep =text.split('--');

	var fact=sep[0];
	var factutl=sep[1];
	
	if(	document.getElementById('fact')){
		document.getElementById('fact').innerHTML =sep[0];
	}
	
	if(document.getElementById('factutl')){
		document.getElementById('factutl').href =sep[1];
	}

	}
}

function hideDiv(div){
	var d = document.getElementById(div);
	d.style.display="none";
}
function showDiv(div){
	var d = document.getElementById(div);
	d.style.display="block";
}

