<!--

//Variables
var TIP_MYFORUMS_TITLE = "ACDS Forums Tool Tip";
var TIP_JOINFORUMS_CONTENT = "Select the <b>Join ACDS Forums</b> button to the left to join the ACDS Forum.";
var TIP_MYFORUMS_CONTENT = "Once you are logged onto the ACDS Forums you can maintain your Forum Account and Posted Messages by selecting the <b>My ACDS Forums</b> button to the left. More information about the My ACDS Forums button can be found under the <b>Frequently Asked Questions</b> forum.";

var vBrowser = getBrowser();

function getBrowser() {
	var sTemp = "IE";
	if (navigator.appName != "Microsoft Internet Explorer") { sTemp = "NN"; }
	return sTemp;	
}

function PrintThread(id,thread,area,type){
var sLeft=(screen.width / 2) - 400;
var sTop = (screen.height / 2) - 250;
var strFile="print.aspx?id="+id+"&thread="+thread+"&area="+area+"&print="+type;
desktop =window.open(strFile,"name","toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,width=800,height=500,resizable=yes,top="+sTop+",left="+sLeft+"");
}

function PostPreview(){
 var sTopic = document.getElementById('txtTopic');
 var sMessage = document.getElementById('txtMessage');
 var listBox = document.getElementById('lbLinks');
 var sLinks = "";
 var intCount = listBox.options.length; 

	for (i = 0; i < intCount; i++)  
	{
		var sLinkText = listBox.options[i].text;
		var arrTexts = sLinkText.split(";");
		sLinks += "<a href='"+arrTexts[1]+"' target='_blanlk' class='standardlink'><b>"+arrTexts[0]+"</b></a><br />";
	}

	
var ParmA = "";

	if(sTopic !== null)
    {
        ParmA = sTopic.value;
    }
var msgFormatted = sMessage.value;
var ParmB = msgFormatted.replace(/\n/g, "<br />");+"<br /><br /><b>More Info:</b><br />"+sLinks;
var MyArgs = new Array(ParmA, ParmB);
var WinSettings = "center:yes;resizable:no;dialogHeight:400px;dialogWidth:700px"
var desktop = window.showModalDialog("preview.aspx", MyArgs, WinSettings);

}

function WordFilter()
{
var wleft = (screen.width - 700) / 2;
var wtop = (screen.height - 600) / 2;
var win = window.open("wordfilter.aspx","","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=500,height=200,left=" + wleft + ",top" + wtop + ",resizable=no");
win.resizeTo(700, 600);
win.moveTo(wleft, wtop);
win.focus();

}

function ShowLegand(){
var sLeft=(screen.width / 2) - 200;
var sTop = (screen.height / 2) - 200;
desktop =window.open("legand.aspx","name","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=400,height=210,resizable=yes,top="+sTop+",left="+sLeft+"");
}

function DisableButton() {
    document.forms[0].submit();
    window.setTimeout("disableButton('" + 
        window.event.srcElement.id + "')", 0);
}

function disableButton(buttonID) {
    document.getElementById(buttonID).disabled=true;
}


function ToggleLegand(item1,item2,item3,item4,item){
document.getElementById(item1).style.display=''; 
document.getElementById(item2).style.display=''; 
document.getElementById(item3).style.display=''; 
document.getElementById(item4).style.display='none'; 
document.getElementById(item).style.display='none';
}

function getCookie(c_name)
{
if (document.cookie.length>0)
{ 
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{ 
c_start=c_start + c_name.length+1 
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
return unescape(document.cookie.substring(c_start,c_end))
} 
}
return null
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : "; expires="+exdate)
}

function checkCookie()
{
username=getCookie('username')
if (username!=null)
  {alert('Welcome again '+username+'!')}
else 
  {
  username=prompt('Please enter your name:',"")
  if (username!=null && username!="")
    {
    setCookie('username',username,365)
    }
  }
}


function disableListItems(checkBoxListId, checkBoxIndex, numOfItems)
{
    // Get the checkboxlist object.
    objCtrl = document.getElementById(checkBoxListId);
    
    // Does the checkboxlist not exist?
    if(objCtrl == null)
    {
        return;
    }

    var i = 0;
    var objItem = null;
    // Get the checkbox to verify.
    var objItemChecked = 
       document.getElementById(checkBoxListId + '_' + checkBoxIndex);

    // Does the individual checkbox exist?
    if(objItemChecked == null)
    {
        return;
    }

    // Is the checkbox to verify checked?
    var isChecked = objItemChecked.checked;
    
    // Loop through the checkboxes in the list.
    for(i = 0; i < numOfItems; i++)
    {
        objItem = document.getElementById(checkBoxListId + '_' + i);

        if(objItem == null)
        {
            continue;
        }

        // If i does not equal the checkbox that is never to be disabled.
        if(i != checkBoxIndex)
        {
            // Disable/Enable the checkbox.
            objItem.disabled = isChecked;
            // Should the checkbox be disabled?
            if(isChecked)
            {
                // Uncheck the checkbox.
                objItem.checked = false;
            }
        }
    }
}

function getKeyCode(e)// v1.0
{
	if (window.event)
	   return window.event.keyCode;
	else if (e)
	   return e.which;
	else
	   return null;
}
function keyRestrict(e, validchars) { // v3.0
	var key='', keychar='';
	key = getKeyCode(e);
	if (key == null) return true;
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	validchars = validchars.toLowerCase();
	if (validchars.indexOf(keychar) != -1)
		return true;
	if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
		return true;
	return false;
}

/* ================================================================================== */
/* COMMON TOOLTIP FUNCTION                                                            */
/* ================================================================================== */
/* sFrame : iFrame name
 * oMark  : icon object
 * nWidth : tooltip width
 * nHeight: tooltip height
 * sTitle : tooltip title
 * sContent : tooltip content
 */
function hideToolTip(sFrame) {
	document.getElementById(sFrame).style.width=0;
	document.getElementById(sFrame).style.height=0;
}
function showToolTip(sFrame,oMark,nWidth,nHeight,sTitle,sContent) {
	if (sTitle=="") return;
	if (sContent=="") return;
	
	var nTop  = 0;
	var nLeft = 0;
	var nPadding = 5;
	var nScroll  = (vBrowser=="NN")?15:18;
	var nW_Width = (vBrowser=="NN")?window.innerWidth:document.documentElement.offsetWidth;
	var nW_Height= (vBrowser=="NN")?window.innerHeight:document.documentElement.offsetHeight;
	
	if (nW_Height-(nHeight+nPadding+nScroll)<0) {
		nTop = 0;
	} else if (nW_Height-(nHeight)-(oMark.offsetTop+oMark.offsetHeight+nPadding+nScroll)>=0) {
		nTop = oMark.offsetTop+oMark.offsetHeight+nPadding;
	} else {
		nTop = nW_Height-(nHeight+nPadding)-nScroll;
	}
	if (nW_Width-(nWidth+nPadding+nScroll)<0) {
		nLeft = 0;
	} else if (nW_Width-(nWidth)-(oMark.offsetLeft+oMark.offsetWidth+nPadding+nScroll)>=0) {
		nLeft = oMark.offsetLeft+oMark.offsetWidth+nPadding;
	} else {
		nLeft = nW_Width-(nWidth+nPadding)-nScroll;
	}
	if ((oMark.offsetLeft+oMark.offsetWidth>nLeft && oMark.offsetLeft<nLeft+nWidth) && 
		(oMark.offsetTop+oMark.offsetHeight>nTop && oMark.offsetHeight<nTop+nHeight)) {
		if (oMark.offsetTop-(nHeight+nPadding)>0) {
			nTop = oMark.offsetTop-(nHeight+nPadding);
		} else if (oMark.offsetLeft-(nWidth+nPadding)>0) {
			nLeft = oMark.offsetLeft-(nWidth+nPadding);
		}
	}
	document.getElementById(sFrame).style.top=nTop;
	document.getElementById(sFrame).style.left=nLeft;
	document.getElementById(sFrame).style.width=nWidth;
	document.getElementById(sFrame).style.height=nHeight;
	window.frames[sFrame].jsSetToolTip(sTitle,sContent);
}
function showToolTip1(e,sFrame,nWidth,nHeight,sTitle,sContent) {
	if (sTitle=="") return;
	if (sContent=="") return;
	// init
	var nTop  = 0;
	var nLeft = 0;
	var nPadding = 12;
	var nScroll  = (vBrowser=="NN")?15:18;
	var nW_Width = (vBrowser=="NN")?window.innerWidth:document.documentElement.offsetWidth;
	var nW_Height= (vBrowser=="NN")?window.innerHeight:document.documentElement.offsetHeight;
	// default size
	document.getElementById(sFrame).style.width = nWidth;
	document.getElementById(sFrame).style.height = nHeight;
	// set data
	window.frames[sFrame].jsSetToolTip(sTitle,sContent);
	// adjust size
	nWidth = window.frames[sFrame].document.body.scrollWidth + nScroll;
	nHeight = window.frames[sFrame].document.body.scrollHeight + nScroll;
	// adjust position
	if (nW_Height-(nHeight+nPadding+nScroll)<0) {
		nTop = 0;
	} else if (nW_Height-(nHeight)-(e.clientY+nPadding+nScroll)>=0) {
		nTop = e.clientY+nPadding;
	} else {
		nTop = nW_Height-(nHeight+nPadding)-nScroll;
	}
	if (nW_Width-(nWidth+nPadding+nScroll)<0) {
		nLeft = 0;
	} else if (nW_Width-(nWidth)-(e.clientX+nPadding+nScroll)>=0) {
		nLeft = e.clientX+nPadding;
	} else {
		nLeft = nW_Width-(nWidth+nPadding)-nScroll;
	}
	// set size and position
	document.getElementById(sFrame).style.top = nTop;
	document.getElementById(sFrame).style.left = nLeft;
	document.getElementById(sFrame).style.width = nWidth;
	document.getElementById(sFrame).style.height = nHeight;
}


// -->
