var doc = window.document;

function $parent(v) { doc = v; }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function $E(v) { return(doc.getElementById(v)); }
function $S(v) { return($E(v).style); }
function $T(v, text) { if(agent('msie')) $E(v).innerText = text; else $E(v).textContent = text; }
function $HTML(v, html) { $E(v).innerHTML = html; }
function $nodisplay(v) { $S(v).display = 'none'; }
function $display(v) { $S(v).display = 'block'; }
function isset(v) { return((typeof(v)=='undefined' || v.length==0)?false:true); }

function $translucent(v) { $S(v).filter = 'alpha(opacity=30)'; }
function $C(text) { alert(text); }
function $SetFocus(v) { doc.getElementById(v).focus(); }
function $SetValue(v,str) { doc.getElementById(v).value = str; }

function ajax(u,change) {
	var r=[function(){ return new XMLHttpRequest(); },function(){ return new ActiveXObject("Msxml2.XMLHTTP"); },function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }];
	for(var i in r) { try { var v=r[i],q=v(); } catch(e) { continue; } }
	if(change) q.onreadystatechange=function(){ if(q.readyState==4 && q.status==200) change(q.responseText); };
	q.open('GET',u,1);
	q.send(null);
}

