function SizePageElements()
{
	height = document.body.scrollHeight;
	if ( height <= 0 )
	{
		setTimeout("SizePageElements()", 500);
	}
	else
	{
		try
		{
			height = height - 90; // Subtract Off The Header And Stuff
			//document.getElementById( 'wrapper' ).style.height = document.body.scrollHeight;
			//document.getElementById( 'bodyWrapper' ).style.height = height + "px";
			document.getElementById( 'rightBacking' ).style.height = height - 45 + "px";
			document.getElementById( 'rightImage' ).style.height = height + "px";
			document.getElementById( 'leftMenuBacking' ).style.height = height - 45 + "px";
			document.getElementById( 'leftMenuImage' ).style.height = height + "px";
			//document.getElementById( 'leftMenu' ).style.height = height + "px";
			document.getElementById( 'footerSubPages' ).style.top = height + "px";
			document.getElementById( 'footerSubPages' ).style.visibility = "visible";
			
			if ( document.getElementById( 'dataMaxLogo' ) )
			{
				document.getElementById( 'dataMaxLogo' ).style.top = (height + 70) + "px";
			}
		}
		catch ( e )
		{
		}
	}
}

function SizePageElementsPrinters()
{
	height = document.body.scrollHeight;
	if ( height <= 0 )
	{
		setTimeout("SizePageElementsPrinters()", 500);
	}
	else
	{
		try
		{
			height = height - 90; // Subtract Off The Header And Stuff
			//document.getElementById( 'wrapper' ).style.height = document.body.scrollHeight;
			//document.getElementById( 'bodyWrapper' ).style.height = height + "px";
			//document.getElementById( 'rightBacking' ).style.height = height - 45 + "px";
			//document.getElementById( 'rightImage' ).style.height = height + "px";			
			document.getElementById( 'pageContentBacking' ).style.height = height + "px";
			//document.getElementById( 'leftMenuBacking' ).style.height = height - 45 + "px";
			//document.getElementById( 'leftMenuImage' ).style.height = height + "px";
			//document.getElementById( 'leftMenu' ).style.height = height + "px";
			document.getElementById( 'footerSubPages' ).style.top = height + "px";
			document.getElementById( 'footerSubPages' ).style.visibility = "visible";
		}
		catch ( e )
		{
		}
	}
}

function OptionOver( obj, color )
{
	obj.style.color = color;
	document.getElementById( "i" + obj.id.substring( 1 ) ).style.visibility = "visible";
}

function OptionOut( obj, color )
{
	obj.style.color = color;
	document.getElementById( "i" + obj.id.substring( 1 ) ).style.visibility = "hidden";
}

function OptionClick( url )
{
	window.open( url, '_self' );
}

function popDetails(url,wname,w,h)
{
	var win= null;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,location=no,status=no,menubar=no,dependent=no'
	win=window.open(url,wname,settings)
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
	
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; 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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('Please Complete The Following Fields:\n'+errors);
  document.MM_returnValue = (errors == '');
}
