function $(id){
    return document.getElementById(id)
}

function ghostField(ids){
    var i = ids.length;
    while(i--){
	var f = $(ids[i])
	f.ghostText = f.value
	f.onfocus = function(){ if(this.value==this.ghostText){ this.value=''; this.style.color='#000' }}
	f.onblur = function(){ if(this.value==''){this.value=this.ghostText; this.style.color='#8C8C9E'}}
    }
}

function ajaxCall(url, callBack, method, one){
    var method = (method)?(method):('GET');
    var one = (one)?(one):(false);

    var req = null;

    if(window.XMLHttpRequest){
	req = new XMLHttpRequest();
    }else if(window.ActiveXObject){
	req = new ActiveXObject('Microsoft.XMLHTTP');
    }
    
    if(one)
        callBack.req = req
    else{
	if(!callBack.req)
    	    callBack.req = new Array(req)
	else
    	    callBack.req.push(req)
     }

     req.onreadystatechange = callBack
     req.open(method, url, true)

     req.send(null)
}

function gAlert(t){
    $('alert').style.display='block'
    $('alert_text').innerHTML = t
    setTimeout("$('alert').style.display='none'", 5000)
}

