function el(id){
return document.getElementById(id)
}
function formatEmail() {
	var el=document.getElementById('email');
	if(el) {
		el.innerHTML=el.innerHTML.replace(/ <b> at <\/b> /,'@');
		el.innerHTML=el.innerHTML.replace(/ <b> dot <\/b> /,'.');
	}
}

document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};
function loading() {
	el('status').innerHTML+='.';
	if(el('status').innerHTML.length>21) {
		el('status').innerHTML='Searching Google';
	}
}



function ajaxRequest(file,pars,targ) {
	target=targ;
	aj.getAjaxRequest(file,pars,processRequest);
}
function processRequest(){
	var myajax=aj.ajaxobj
	if(myajax.readyState==4){
		if(myajax.status==200 || window.location.href.indexOf("http")==-1){
			el(target).innerHTML=myajax.responseText;
		}
	}
}
function createAjaxObj(){
var httprequest=false
if(window.XMLHttpRequest){
httprequest=new XMLHttpRequest()
if(httprequest.overrideMimeType)
httprequest.overrideMimeType('text/xml')
}
else if(window.ActiveXObject){
try {
httprequest=new ActiveXObject("Msxml2.XMLHTTP");
} 
catch(e){
try{
httprequest=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){}
}
}
return httprequest
}
var aj=new Object()
aj.basedomain="http://"+window.location.hostname
aj.ajaxobj=createAjaxObj()
aj.getAjaxRequest=function(url,parameters,callbackfunc){
var parameters=parameters+"&rand="+new Date().getTime()
parameters=parameters.replace(/&amp;/g,"&")
aj.ajaxobj=createAjaxObj()
if(this.ajaxobj){
this.ajaxobj.onreadystatechange=callbackfunc
this.ajaxobj.open('GET',url+"?"+parameters,true)
this.ajaxobj.send(null)
}
}



function sortDivs(theID) {
	var currDivs = [];
	var theParentNode = document.getElementById(theID);
	for(var i = 0; i < theParentNode.childNodes.length; i++) {
		if(theParentNode.childNodes[i].nodeType == 1) {
			currDivs.push(theParentNode.childNodes[i].innerHTML);
		}
	}
	currDivs.sort();
	var index = 0;
	for(var i = 0; i < theParentNode.childNodes.length; i++) {
		if(theParentNode.childNodes[i].nodeType == 1) {
			theParentNode.childNodes[i].innerHTML = currDivs[index ++];
		} 
	}
}