/*** click only once for forms ***/
function oneclick(theform){
if (document.all||document.getElementById){
  for (i=0;i<theform.length;i++){
  var tempobj=theform.elements[i]
    if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
    tempobj.disabled=true
  }
} else
return false
}
/*** broadcast message ***/
/*** did cause object expected error with doctype turned on before new copy from web ***/
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
//drag drop function for NS 4////
/////////////////////////////////
var dragswitch=0
var nsx
var nsy
var nstemp
function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
	}
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
//drag drop function for ie4+ and NS6////
/////////////////////////////////
function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
	}
}
function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}
if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")
////drag drop functions end here//////
function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}
/*** css dropdown - custom ***/
function toggle( targetId ){
   if (document.getElementById){
         target = document.getElementById( targetId );
            if (target.style.display == "none"){
               target.style.display = "";
            } else {
               target.style.display = "none";
            }
      }
      return false;
}
<!--
// Nannette Thacker http://www.shiningstar.net - Added into WebAPP by Aron Shiewitz for Forum Delete Confirmation Add-On.
function confirmSubmit()
{
var agree=confirm("Are you sure you wish to delete this?");
if (agree)
	return true;
else
	return false;
}
// -->

// JavaScript to pop a new window - Aron Shiewitz
function popper(thisUrl,thisWindow,thisWidth,thisHeight,thisTop,thisLeft) {
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=yes,menubar=no,resizable=no,scrollbars=yes');
    mainWin = window.open(thisUrl,thisWindow,optionString);
	mainWin.focus();
}
// JavaScript to pop a new window with no scrollbars - Aron Shiewitz
function noscrollpopper(thisUrl,thisWindow,thisWidth,thisHeight,thisTop,thisLeft) {
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=no');

    mainWin = window.open(thisUrl,thisWindow,optionString);
	mainWin.focus();
}

function doSubmitOnce(currentForm)
{
for(i=0;i<currentForm.length;i++)
{
var currentElement = currentForm.elements[i];
if(currentElement.type.toLowerCase() == "submit")
currentElement.disabled = true;
}
}

if(document.all||document.getElementById) 
{
for(i=0;i<document.forms.length;i++)
{
var currentForm = document.forms[i];
var oldEventCode = (currentForm.onsubmit) ? currentForm.onsubmit : function () {};
currentForm.onsubmit = function () {oldEventCode(); doSubmitOnce(currentForm)};
}
}

