var DOM = false;
var NS  = false;
var IE 	= false;
if (document.getElementById && !document.all) DOM=true; if (document.layers) NS=true; else if (document.all) IE=true;

function getObj(n, d){var p,i,x;  if(!d) d=document; if(DOM) return d.getElementById(n)
  if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=getObj(n,d.layers[i].document); return x;
}

function getImg(id,d)
{	if (!d) d=document;
	if (NS && !DOM) return getObj(id,d);
	else return eval("d."+id);
}

function popup(name,url,w,h)
{
	var x =(screen.availWidth-w)/2;
	var y =(screen.availHeight-h)/2;
	var P
	P=self.open(url,"Popup"+name,'dependent=yes,scrollbars=no,status=no,titlebar=no,personalbar=no,menubar=no,toolbar=no,resizable=no,width='+w+',height='+h+',top='+y+',left='+x);    
	P.moveTo(x,y)
	P.focus();
}

function SwapVisibility(id)
{	var o
	if(o=getObj(id))
		o.style.display=(o.style.display!="none"?"none":"block");
}
function SetVisibility(id,m)
{	var o
	if(o=getObj(id))
		o.style.display=m?"block":"none";
}


function SubmitForm(formName)
{	var o
	if( o=getObj(formName))
	{	o.submit();
	}
}
function SetVariable(varname,value)
{	var o
	if(o=getObj(varname)) o.value=value;
}
function RQError(txt)
{	var o;
	if( o=getObj('rqDebug'))
	{
		o.innerHTML += "<div class=\"error\">"+txt+"</div>";
	}
}
function RQDebug(txt)
{	var o;
	if( o=getObj('rqDebug'))
	{
		o.innerHTML += "<div class=\"message\">"+txt+"</div>";
	}
}


function RQMel(host,ext,name,content)
{
	var mel
	mel=name+"@"+host+"."+ext;
	document.write("<a href=\""+"mailto:");
	document.write(mel);
	document.write("\"");
	document.write(">");
	if( !content) content=mel;
	document.write(content);
	document.write("</a>");
}

