// BEGIN WWWSCRIPT 
function ExitNotice() 
{
	alert("You are leaving the DFAS Web Information Service. The appearance of hyperlinks does not constitute endorsement by the Department of Defense or the Defense Finance and Accounting Service of this Web site or the information, products or services contained therein. For other than authorized activities such as military exchanges and Morale, Welfare and Recreation sites, the Department of Defense and the Defense finance and Accounting Service does not exercise any editorial control over these locations. Such links are provided consistent with the stated purpose of this DoD Web site.");
}
//ExitNotice & OutsideDFAS do the same thing. So we'll just have one call the other.
function OutsideDFAS()  
{
	ExitNotice();
}
function gotoSSL()  
{
	alert("You are entering a secured site. Please be sure your browser supports Secured Sockets Layer");
}

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_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_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];}
}

// Set up the image files to be used.
var theImages = new Array(); // create array of images
	theImages[0] = '/dfas/images/home01b.jpg';
	theImages[1] = '/dfas/images/home02b.jpg';
	theImages[2] = '/dfas/images/home03b.jpg';
	theImages[3] = '/dfas/images/home04b.jpg';
	theImages[4] = '/dfas/images/home05b.jpg';
	theImages[5] = '/dfas/images/home06b.jpg';
	theImages[6] = '/dfas/images/home07b.jpg';
	theImages[7] = '/dfas/images/home08b.jpg';
	theImages[8] = '/dfas/images/home09b.jpg';
	theImages[9] = '/dfas/images/home10b.jpg';
	theImages[10] = '/dfas/images/home11b.jpg';
	theImages[11] = '/dfas/images/home12b.jpg';
	theImages[12] = '/dfas/images/home13b.jpg';
	theImages[13] = '/dfas/images/home14b.jpg';
var p = theImages.length; // length of theImages array
var whichImage = Math.round(Math.random()*(p-1)); // random number generator for theImage
function showImage() // function called from body of page to display image
{
	document.write('<img src="' +theImages[whichImage] + '" alt="DFAS Customer">');
}
//  End -->

// Set up the quotes to be used.
theText = new Array();
theText[0] = '<span class="quotation">&quot;Our strategy must place our customers’ needs in the forefront and must be fully informed by the voice of our customers. This strategy must focus less on the outputs of processes and more on the results that matter to our customers.&quot;</span> <br><br><div class="attributation">–Zack E. Gaddy <br><span class="persontitle">Director</span></div>'
theText[1] = '<span class="quotation">&quot;The employees of DFAS are to be commended for their tireless efforts to accomplish the task before them! I retired from the U.S. Army 34 years ago and I have never had a problem with my pay (with more than 20 years active duty and about 10 years civil service without an error). Many thanks to all the hard working people of DFAS and DoD.&quot;</span><br><br><div class="attributation">– Bill Case<br><span class="persontitle">Retired Pay Customer<br></span></div>'
theText[2] = '<span class="quotation"><strong>Mission:</strong><br>Provide responsive, professional finance and accounting services for the people who defend America.<br><strong>Vision:</strong><br>Best value to our customers<br><ul><li>A world-class provider of finance and accounting services</li><li>A trusted, innovative financial partner</li><li>One organization, one identity</li><li>An employer of choice, providing a progressive and professional work environment</li></ul><strong>Values</strong><br>Integrity – Service – Innovation</div>'

var q = theText.length; // get length of theText array
var whichText = Math.round( Math.random() * (q-1) ); // random number generator for theText
function showText() // function called from body of page to display quote
{
	document.write(theText[whichText]);
}

function breadCrumbs(base, delStr, defp, cStyle) 
{
	var crumb = "";
	loc = window.location.toString();
	subs = loc.substr(loc.indexOf(base) + base.length + 1).split("/");
	crumb = ("<p class='sm'><a href='" + getLoc(subs.length-1) + defp + "' class='" + cStyle + "'>Home</a>")
	//lines 78-83 fix the problem with users forgetting to instantiate correct js code.
	var myhost = window.location.host;
	var i ="";
	if (myhost != "www.dod.mil/dfas")//on dev or stage
		i=1;
	else			//on production server.
		i=0;
	for (i; i < (subs.length - 1); i++) 
	{
		subs[i] = makeCaps(unescape(subs[i]));
		crumb = crumb + (delStr + "<a href='" + getLoc(subs.length-i-2) +defp + "' class='" + cStyle +"'>" + subs[i]+"</a>")
	}
	document.write(crumb); 
}
function makeCaps(a) 
{
	g = a.split(" ");
	for (l = 0; l < g.length; l++) 
	{
		g[l] = g[l].toUpperCase().slice(0, 1) + g[l].slice(1);
	}
	return g.join(" ");
}

function getLoc(c) 
{
	var d = "";
	if (c > 0) 
	{
		for (k = 0; k < c; k++) 
		{
			d = d + "../";
		}
	}
	return d;
}
//  End -->