function styleTables(widths){
	$$('table.contentTB tbody tr th').each(function(th){th.addClassName('Left');});
	$$('table.contentTB tbody tr td').each(function(td){td.addClassName('Left');});
	$$('table.contentTB[tbltype="numeric"] tbody tr th').each(function(th){th.removeClassName('Right') ; th.addClassName('Right');});
	$$('table.contentTB[tbltype="numeric"] tbody tr td').each(function(td){td.removeClassName('Right') ; td.addClassName('Right');});
	$$('table.contentTB[tbltype="numeric"] tbody tr th:first-child').each(function(th){th.removeClassName('Right') ; th.addClassName('Left');});
	$$('table.contentTB[tbltype="numeric"] tbody tr td:first-child').each(function(td){td.removeClassName('Right') ; td.addClassName('Left');});
	
	$$('table.contentTB').each(function(tbl){
		if(tbl.getElementsByTagName("th").length > 0){
			$(tbl).getElementsBySelector(' tbody > tr:nth-child(even)').each(function(tr){tr.addClassName('Odd');});
		}else{
			$(tbl).getElementsBySelector(' tbody > tr:nth-child(odd)').each(function(tr){tr.addClassName('Odd');});
		}
	});
}

function setimgpadding(){
	var img, pnodetag
	var pagecontent = getElementById('PageContent')
	img = $A($(pagecontent).getElementsByTagName("img"));
	img.each(function(s){
		pnodetag = $(s).parentNode.tagName.toLowerCase()
		if(pnodetag == 'p'){
			if(s.src.indexOf("upload/images") > -1){$(s).setStyle({padding: "0 0 7 0"});}	
		}else{
			if(s.src.indexOf("upload/images") > -1){$(s).setStyle({padding: "0 0 22 0"});}	
		}
	});
}

function getQS(s){
	var qKeys = {};
	var re = /[?&]([^=&]*)=?([^&]*)/g
	var matchInfo;
	while(matchInfo = re.exec(window.location.search)){qKeys[matchInfo[1]] = matchInfo[2];};
	for (var strKey in qKeys){if(strKey == s){return qKeys[ strKey ]}};
	return false;
}

var spotlightcount = 0 
function spotlightrotate(rtime){
	for (var i = 1; i <= 3; i++){
		if ($('spotlight'+i).style.display == "block"){if (i >= 3){spotlightcount  = 1} else {spotlightcount  = i+1; break;}} else {spotlightcount  = 1}
	}
	for (var i = 1; i <= 3; i++){
		$('spotlight'+i).style.display = (i == spotlightcount ) ? "block" : "none";
	}
	setTimeout('spotlightrotate('+rtime+')', rtime)    
}

function emergencyalert(alerttxt,alertpg){
	var newD = new Element( 'div', {'style': 'color: red; font-weight: bold; font-size: 11pt;'} ).update(alerttxt);
	var newA = new Element( 'a' , {href: alertpg, 'style': 'font-size: 10pt;'}).update('Click here')
	var newS = new Element( 'span', {'style': 'font-size: 10pt;'}).update('&nbsp;for the latest updates');
	var newD2 = new Element( 'div')
	Element.insert( newD2, {'top':newS} );
	Element.insert( newD2, {'top':newA} );
		
	var newT = new Element( 'div', {'class': 'padding10Left', 'style': 'margin-bottom: 20px; margin-top: 20px;'})
	Element.insert( newT, {'top':newD2} );
	Element.insert( newT, {'top':newD} );
		
	$$('div.h_colLeft').each(function(div){
		Element.insert( div, {'top':newT} );
	});
}
