ns=0; ie=ieVer=0
ua = window.navigator.userAgent
msie = ua.indexOf('MSIE ');	if(msie<0)	msie=0
aol = ua.indexOf('AOL ');	if(aol<0)	aol=0
gecko = ua.indexOf('Gecko');	if(gecko<0)	gecko=0
opera = ua.indexOf('Opera');	if(opera<0)	opera=0

if(msie && document.all)	ie=true;
if(ie) ieVer = parseFloat (ua.substring (msie+5, ua.indexOf (";", msie )))
ihelp = (ieVer>=5.5 ? 1:0)
dom = (document.getElementById ? 1:0)
helpon=helpclick=0

function changetext(div,txt) {
	if(opera)return;
	obj = document.getElementById(div)
	if(obj==null)	return;
	if(dom) obj.innerHTML = txt;
	else if(ie) {
		eval("obj=document.all['"+div+"']");
		obj.innerHTML = txt;
	}
}
function tgl(obj) {
	if (ie)  obj.style.display = (obj.style.display=='none' ? 'inline' : 'none');
}
function hideHelp() {
	ohc = helpclick
	helpclick=0
	helpoff=1
	if(ohc || !helpon)	return;
	document.getElementById('help').style.visibility='hidden'
	if(ie) {
		var col = document.all.tags("SELECT");
		if (col!=null)
			for (i=0; i<col.length; i++) 
				if(col[i].id!='inhelp') col[i].style.visibility="visible"
	}
	return false
}

abovehelp=75
helpwidth=350
if(ihelp)	window.onscroll=moveHelp;
if(ihelp)	window.onresize=moveHelp;
tooff=0
function moveHelp() {
	var o = document.getElementById('totop')
	if(o !=null) {
		if(!tooff)	tooff=o.offsetTop+100
		var toffset = o.document.body.scrollTop-tooff
		if(toffset<0)	toffset=0
		o.runtimeStyle.top = parseInt(o.style.top)+toffset
	}

	var o = document.getElementById('help')
	if(o !=null) var t=0;	else return;
	if(o.document.body.scrollTop>abovehelp)
		t = parseInt(o.style.top)+o.document.body.scrollTop-abovehelp
	else	t = parseInt(o.style.top)
	o.runtimeStyle.top = t
//	var l = o.document.body.clientWidth-helpwidth
	var l = o.document.body.clientWidth-o.clientWidth
//alert(o.clientWidth+ " :: " +o.document.body.clientWidth);
	if(l>765) l=765
	o.runtimeStyle.left=l
}
function showHelp() {
	moveHelp()
	o = document.getElementById('help')
	o.style.visibility='visible'

	helpon=1
	if(ie) {
		var col = document.all.tags("SELECT");
		if (col!=null)
			for (i=0; i<col.length; i++)
				if(col[i].id!='inhelp')  col[i].style.visibility="hidden"
	}
}


function copyHelp() {
	var o=document.getElementById('help')
	o.innerHTML = CTNhelp.document.body.innerHTML
	showHelp()
}

function openhelp(wid) {
	if(window.name=='CTNhelp') return;	//if already in help window, do not try to open again.
	if(!wid) wid=380;
	helpwin=open('','CTNhelp','height=460,width='+wid+',status=yes,toolbar=no,menubar=no,titlebar=no,location=no,resizable=yes,scrollbars=yes')
	helpwin.focus()
}


function popupLoad(txt,width) {
	if(width==null)	width=350
	else helpwidth=width+40
	if(txt=='')
		txt = '<TABLE bgcolor=#FFFFA5 width='+width+' height=200 border=1 class=drop><TR><TD align=center><B>loading . . .</b></td></tr></table>';
	changetext('help',txt); 
	showHelp()
	setTimeout('showHelp()',100)
}

function popupHelp(cgi) {
	if(window.frames.CTNhelp.location!=cgi) {
		popupLoad('')
		window.frames.CTNhelp.location = cgi
	}
	else 	showHelp()
	return false
}
var didfltr=0
function doFilter() {
	if(didfltr)	return;	didfltr=1
	setTimeout('window.scrollTo(0,0);',50);
	document.getElementById('content').style.visibility = 'hidden';
	document.getElementById('loadblock').style.visibility = 'hidden';
}

