function eicon(str) {
	thestr = '<a href="mailto:'+str+'@tkscengineering.com"><img src="images/i_mail.gif" alt="email" width="15" height="8" border="0" hspace="5"></a>';
	return thestr;
}

function eaddr(str) {
	thestr = '<a href="mailto:'+str+'@tkscengineering.com">'+str+'@tkscengineering.com</a>';
	return thestr;
}

function pop(width,height,url) {
	var args = 'width='+width+',height='+height+',resizable=yes,scrollbars=yes';
	popWindow = window.open(url,'popup',args);
	window.name = 'main';
	popWindow.focus();
}

function displayDiv(divToOpen) {
	var thechkbox= document.getElementById("chkListRequestType:0")
	var thediv = document.getElementById(divToOpen);
	if (thechkbox.checked){
		thediv.style.display = 'block';
	} else {
		thediv.style.display = 'none';
	}
}

function bghome() {
	var hbgs = 7; // number of styles set up in main.css for home backgrounds
	var picker = Math.floor(Math.random()*hbgs) + 1;
	//document.getElementById('bg').style.backgroundImage = 'url(/images/home_bg'+picker+'.jpg)';
	document.getElementById('bg').className = 'hbg'+picker;
}

function test() {
	//alert('working before');
	document.getElementById('bg').className = 'hbg2';
	//alert('working after');
}

function bgmain() {
	var mbgs = 6; // number of styles set up in main.css for main backgrounds
	var picker = Math.floor(Math.random()*mbgs) + 1;
	document.getElementById('bg').className = 'mbg'+picker;
}

function getbg() {
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/'));
	//alert('sPage = ' + sPage);
	if(sPage == '' || sPage == '/' || sPage == '/index.php') {
		bghome();
	} else {
		bgmain();
	}
}