function DecodeEmail(z)
{
 z=z.replace(/ ~ /,'@');
	return z;
}
function cloneObject(what) {
	for (i in what) {
		this[i] = what[i];
	}
}
function trim(s)
{
 return s.replace(/^\s+|\s+$/g, "");
}
function in_array(k,a)
{
	for(q=0;q<a.length;q++) {
		if (a[q] == k) {
			return true;
		}
	}
	return false;
}
function jsCheckForm(formname,formfields,msg)
{
    var ok = 1>0;
    var fields = formfields.split(',');
    frm = document.forms[formname];
    for (i in fields) {
        if (trim(frm.elements[fields[i]].value) == '') {
            ok = 1<0;
        }
    }
    if (ok == false) {
        alert(msg);
    }
    return ok;
}
ie = (navigator.userAgent.indexOf("MSIE") > -1)?1:0;
js_collapse = (ie?"hidden":"collapse");
function jsHide(what,x)
{
    res = (x?'visible':js_collapse);
    if (document.getElementById(what)) {
        document.getElementById(what).style.visibility = res;
        if (ie) {
            document.getElementById(what).style.display=(x?'block':'none');
        }
    }
}
function jsAttachEvent(to,event,func)
{
 if (ie) {
    eval(to+".attachEvent('on"+event+"',"+func+")");
 } else {
    eval(to+".addEventListener('"+event+"',"+func+",false)");
 }
}
