// Nav Flyout Color Swap function
function swapNavColor(theID,theCOLOR){
var d=document;
var element = d.getElementById(theID);
var s = element.style;
s.color='#' + theCOLOR;
}
// Pop Up function
function popUpA(page,name,w,h,type)
{ 
	var randomnumber=Math.floor(Math.random()*11)
	name = (name+randomnumber);
	page = page.split(" ").join("%20");
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	
	if (type == 1) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status,location,directories';
	if (type == 2) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status,location';
	if (type == 3) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status';
	if (type == 4) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar';
	if (type == 5) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar';
	if (type == 6) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars';
	if (type == 7) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable';
	if (type == 8) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status,location,directories';
	if (type == 9) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status,location';
	if (type == 10) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status';
	if (type == 11) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar';
	if (type == 12) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar';
	if (type == 13) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status,location,directories';
	if (type == 14) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status,location';
	if (type == 15) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status';
	if (type == 16) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar';
	if (type == 17) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status,location,directories';
	if (type == 18) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status,location';
	if (type == 19) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status';
	if (type == 20) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,location,directories';
	if (type == 21) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,location';
	if (type == 22) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,directories';
	
	if (type == 23) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status,location,directories';
	if (type == 24) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status,location';
	if (type == 25) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status';
	if (type == 26) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar';
	if (type == 27) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar';
	if (type == 28) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars';
	if (type == 29) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status,location,directories';
	if (type == 30) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status,location';
	if (type == 31) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status';
	if (type == 32) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar';
	if (type == 33) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status,location,directories';
	if (type == 34) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status,location';
	if (type == 35) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status';
	if (type == 36) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,location,directories';
	if (type == 37) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,location';
	if (type == 38) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,directories';
	
	if (type == 39) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar';
	if (type == 40) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',menubar';
	if (type == 41) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status';
	if (type == 42) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',location';
	if (type == 43) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',directories';
	
	bar = window.open(page, name, winprop);
	bar.focus();
}
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function inputFocus(theForm,theInput){
var doc=document;
eval("doc."+theForm+"."+theInput+".focus()");
} 

// Javascript Confirm Function
function confirmThis(formorlink,type,msg) {
var doc=document;
	if(!msg || msg.length ==0){ msg = "Are you sure you want to continue?"; }            
	var CoNfirM = confirm(msg)
	if (CoNfirM && type=="form"){ doc.formorlink.submit(); }
	else if (CoNfirM && type=="link"){ doc.location.href=formorlink; }
	else { return false; }
}

function alertThis(msg){
  if(!msg || msg.length ==0){ msg = "Attention!"; }
  alert(msg);
}

function pagePreLoad() {
  var d=document;
  if(d.images){
    if(!d.pL) d.pL=new Array();
    var i,j=d.pL.length,a=pagePreLoad.arguments;
	for(i=0; i<a.length; i++){
      if (a[i].indexOf("#")!=0){
	  d.pL[j]=new Image;
	  d.pL[j++].src=a[i];
	  }
	}
  }
}

function sitePreLoad() {

  var theseImages = new Array(
	'/nav/images/nav_test_link_d.gif',
	'/nav/images/nav_test_link_u.gif',
	'/images/nav_icon.gif',
	'/images/body_bg.jpg',
	'/images/body_drpshwd_l_img_t.gif', 
	'/images/body_drpshwd_r_img_t.gif',
	'/images/body_drpshwd_l_bg.gif',
	'/images/body_drpshwd_r_bg.gif',
	'/images/body_drpshwd_l_img.gif',
	'/images/body_drpshwd_r_img.gif'
	)

  var d=document;
  if(d.images){
    if(!d.pL) d.pL=new Array();
    var i,j=d.pL.length,a=theseImages;
	for(i=0; i<a.length; i++){
      if (a[i].indexOf("#")!=0){
	  d.pL[j]=new Image;
	  d.pL[j++].src=a[i];
	  }
	}
  }
}

function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}
function showHideDiv(thisNum, thisDiv, totalDiv){
var doc=document;
var divName = (thisDiv + thisNum);
var element = doc.getElementById(divName);
	for (a=1;a<=totalDiv;a++){
		var divName = (thisDiv + a);
		var element = doc.getElementById(divName);
			if (element){
			var s = element.style;
				if (a == thisNum){ s.display='block'; } else { s.display='none'; }
			}
	}
}
function showHideMultDivSwap(thisNum, thisDiv, totalDiv, swapDiv){
var doc=document;
var divName = (thisDiv + thisNum);
var element = doc.getElementById(divName);
var showDiv;
	if (element){
		var s = element.style;
		if (s.display=='none'){ showDiv=thisNum; } else { showDiv=swapDiv; }
	}

	for (a=1;a<=totalDiv;a++){
		var divName = (thisDiv + a);
		var element = doc.getElementById(divName);
			if (element){
			var s = element.style;
				if (a == showDiv){ s.display='block'; } else { s.display='none'; }
			}
	}
}

function showHideMultDiv(thisNum, thisDiv, totalDiv, showAll, showSelf) {
var doc=document;
	
	if (showAll){
		for (a=1;a<=totalDiv;a++){
		var divName = (thisDiv + a);
		var element = doc.getElementById(divName);
		var s = element.style;
		s.display='block';
		}
	}
	else
	{
		if (showSelf){
			var divName = (thisDiv + thisNum);
			var element = doc.getElementById(divName);
				if (element){
					var s = element.style;
					s.display=='none'? s.display='block' : s.display='none';
				}
		}
		else
		{
			for (a=1;a<=totalDiv;a++){
			var divName = (thisDiv + a);
			var element = doc.getElementById(divName);
				if (element){
				var s = element.style;
					if (a == thisNum){ s.display=='none'? s.display='block' : s.display='none'; } else { s.display='none'; }
				}
			}
		}
	}
}


function showHideMultDivChecked(thisNum, thisDiv, totalDiv, xbutton, showAll, showSelf) {
var doc=document;
	
	if (showAll){
		for (a=1;a<=totalDiv;a++){
		var divname = (thisDiv + a);
		var element = doc.getElementById(divname);
		var s = element.style;
		xbutton.checked? s.display='block' : s.display='none';
		}
	}
	else
	{
		if (showSelf){
		var divname = (thisDiv + thisNum);
		var element = doc.getElementById(divname);
			if (element){
				var s = element.style;
				xbutton.checked? s.display='block' : s.display='none';
			}
		}
		else
		{
			for (a=1;a<=totalDiv;a++){
			var divname = (thisDiv + a);
			var element = doc.getElementById(divname);
				if (element){
				var s = element.style;
					if (a == thisNum){ xbutton.checked? s.display='block' : s.display='none'; } else { s.display='none'; }
				}
			}
		}
	}
}


function swapMoreIcon(thisNum, thisDiv) {
var d=document;
var divname= (thisDiv + thisNum);
	d.getElementById(divname).style.display == 'none'? d.moreicon.src='/images/more_icons_u.gif' : d.moreicon.src='/images/more_icons_d.gif'
	d.getElementById(divname).style.display == 'none'? d.moreicon.title='View More' : d.moreicon.title='Hide'
}

// Start Image Button MouseOver MouseOut Rollover
function returnSrcImage(button,img){
document.getElementById(button.id).src='/images/buttons/' + img;
}
// End Image Button MouseOver MouseOut Rollover

// Start Custom Select Menu Input for Accounts
function resetCSMI(thisID) {
	document.getElementById(thisID).style.display='none';
}
function customSelectMenuInput(thisID,thisInput,thisInputFocus) {
	resetCSMI(thisID);
	var optionNumber = eval('document.theForm.'+thisInput+'.value'); 
	if (optionNumber == "custom"){
	document.getElementById(thisID).style.display='block';
	eval('document.theForm.'+thisInputFocus+'.focus()');
	}
	else
	{
	document.getElementById(thisID).style.display='none';
	eval('document.theForm.'+thisInputFocus+'.value=""');
	}
}
// End Custom Select Menu Input for Accounts