// JavaScript Document<!--	// Item will ultimately be multi-dimentional array    var Item = new Array();	var ColumnSpace = new Array();		// to hold size of blank space between columns    var PgLayout = new Array();		// to hold layout params for each "cat" page	var HItem = new Array();			// to hold title and paragraphs that appear above Items	var category;    var numItems;    var numHItems;    var current;	var kUrl = 0;	var kImage = 1;	var kWidth = 2;	var kHeight = 3;	var kAlign = 4;	var kVAlign = 5;	var kText = 6;	var kIwidth = 7;	var kIheight = 8;	var kTitle = 9;	var kPage = 10;	var kJumptype = 11;		var kCols = 0;	var kStyle = 1;	var kTxtDimen = 2;	var kTxtAlign = 3;	var kRowSpace = 4;	var kTxtStyle = 5;		var kHtype = 0;	var kHtext = 1;	var kHspace = 2;		var kIsPop = 0;	var kIsMenu = 1;	var kIsPage	= 2;		var kTextBelow = 1;	var kTextRight = 0;		var kPgurl_Home			= "home.htm";	var kPgname_Home		= "kCat_home";	var kPgname_Workmenu 	= "kCat_workmenu";	var kPgurl_Workmenu	 	= "workmenu.htm";	var kPgurl_Workproto 	= "work.htm";	var kPgname_Textmenu 	= "kCat_textmenu";	var kPgurl_Textmemu		= "textmenu.htm";	var kPgurl_Textproto	= "text.htm";		var kImgDirectory 		= "images/";	var kTxtDirectory 		= "texts/";		var kDispWidth	= 500;		// pixels for displaying in mainframe    function isArray(obj){ return (typeof(obj) == "undefined") ? false:true; }	    function setgCat(cat) {		//gCategory is global so can pass between pages       	parent.gCategory = cat;	}		function setCat(cat) {		setgCat(cat);		//category = cat;		numItems = Item[cat].length - 1;		numHItems = 0;		if ( isArray(HItem[cat]) ) numHItems = HItem[cat].length;       	current = 0;       	//goto();    }				function addHeadItem(cat, myType, myText, mySpace) {				if ( !isArray(HItem[cat]) ) {	   		HItem[cat] = new Array();			seq = 0;		}		else {       		seq = HItem[cat].length;		}		HItem[cat][seq] = new Array();        HItem[cat][seq][kHtype] = myType;		HItem[cat][seq][kHtext] = myText;		HItem[cat][seq][kHspace] = mySpace;	}	function addWorkmenuHeadItem(myType, myText, mySpace) {		addHeadItem(kPgname_Workmenu, myType, myText, mySpace);	}		function addTextmenuHeadItem(myType, myText, mySpace) {		addHeadItem(kPgname_Textmenu, myType, myText, mySpace);	}	function addItem(cat, myBigimg, myIwidth, myIheight, myImg, myWidth, myHeight, myAlign, myVAlign, myTitle, myText) {        var theDir = kImgDirectory;				if ( !isArray(Item[cat]) ) {	   		Item[cat] = new Array();			seq = 0;		}		else {       		seq = Item[cat].length;		}				Item[cat][seq] = new Array();				if (myBigimg == "") {			Item[cat][seq][kUrl] = "";		}		else {        	Item[cat][seq][kUrl] = theDir + myBigimg;		}		if (myImg == "") {			Item[cat][seq][kImage] = "";		}		else {			Item[cat][seq][kImage] = theDir + myImg;		}		Item[cat][seq][kIwidth] = myIwidth;		Item[cat][seq][kIheight] = myIheight;		Item[cat][seq][kWidth] = myWidth;		Item[cat][seq][kHeight] = myHeight;		Item[cat][seq][kAlign] = myAlign;		Item[cat][seq][kVAlign] = myVAlign;		Item[cat][seq][kTitle] = myTitle;		Item[cat][seq][kText] = myText;		Item[cat][seq][kJumptype] = kIsPop;    }	function addWorkmenuItem(myImg, myWidth, myHeight, myAlign, myVAlign, myText, myPage) {				var cat = kPgname_Workmenu;		var myUrl = kPgurl_Workproto;        var theDir = kImgDirectory;		if (myImg == "") theDir = "";		if ( !isArray(Item[cat]) ) {	   		Item[cat] = new Array();			seq = 0;		}		else {       		seq = Item[cat].length;		}		Item[cat][seq] = new Array();        Item[cat][seq][kUrl] = myUrl;	    Item[cat][seq][kImage] = theDir + myImg;		Item[cat][seq][kWidth] = myWidth;		Item[cat][seq][kHeight] = myHeight;		Item[cat][seq][kAlign] = myAlign;		Item[cat][seq][kVAlign] = myVAlign;		Item[cat][seq][kText] = "";		Item[cat][seq][kTitle] = myText;		Item[cat][seq][kPage] = myPage;		Item[cat][seq][kJumptype] = kIsMenu;    }		function addTextmenuItem(myImg, myWidth, myHeight, myAlign, myVAlign, myText, myUrl) {				var cat = kPgname_Textmenu;        var theTDir = kTxtDirectory;        var theIDir = kImgDirectory;		if (myImg == "") { theTDir = "";  theIDir = ""; }		if ( !isArray(Item[cat]) ) {	   		Item[cat] = new Array();			seq = 0;		}		else {       		seq = Item[cat].length;		}		Item[cat][seq] = new Array();        Item[cat][seq][kUrl] = theTDir + myUrl;	    Item[cat][seq][kImage] = theIDir + myImg;		Item[cat][seq][kWidth] = myWidth;		Item[cat][seq][kHeight] = myHeight;		Item[cat][seq][kAlign] = myAlign;		Item[cat][seq][kVAlign] = myVAlign;		Item[cat][seq][kText] = "";		Item[cat][seq][kTitle] = myText;		Item[cat][seq][kJumptype] = kIsPage;    }		function addColSpace(cat, spacerSize) {		var seq;				if ( !isArray(ColumnSpace[cat]) ) {	   		ColumnSpace[cat] = new Array();			seq = 0;		}		else {       		seq = ColumnSpace[cat].length;		}		ColumnSpace[cat][seq] = spacerSize;    }		function addWorkmenuColSpace(spacerSize) {		addColSpace(kPgname_Workmenu,spacerSize);	}	function addTextmenuColSpace(spacerSize) {		addColSpace(kPgname_Textmenu,spacerSize);	}	function setLayout(cat, theCols, theStyle, theDimen, theAlign, theTxtStyle, theRowSpace) {		var seq;				if ( !isArray(PgLayout[cat]) ) {	   		PgLayout[cat] = new Array();		}		PgLayout[cat][kCols] = theCols;		PgLayout[cat][kStyle] = theStyle;		PgLayout[cat][kTxtDimen] = theDimen;		PgLayout[cat][kTxtAlign] = theAlign;		PgLayout[cat][kTxtStyle] = theTxtStyle;		PgLayout[cat][kRowSpace] = theRowSpace;    }		function setWorkmenuLayout(theCols, theStyle, theDimen, theAlign, theTxtStyle, theRowSpace) {		setLayout(kPgname_Workmenu, theCols, theStyle, theDimen, theAlign, theTxtStyle, theRowSpace);	}	function setTextmenuLayout(theCols, theStyle, theDimen, theAlign, theTxtStyle, theRowSpace) {		setLayout(kPgname_Textmenu, theCols, theStyle, theDimen, theAlign, theTxtStyle, theRowSpace);	}	function setCurrent(n,cat) {		setCat(cat);		current = n;		gotoNext();	}	function gotoNext() {		parent.content.location.href = Item[parent.gCat][current];	}		function startRow() {		document.writeln('<TR'+'>');	}		function endRow() {		document.writeln('</TR'+'>');	}		function insertHeadItem(itemType, theText, theSpace) {		var theWidth = kDispWidth - theSpace;		var theLine;				document.writeln('<table border="'+'0" cellpadding="'+'0" cellspacing="'+'0">');		document.writeln('<tr>');				if (itemType == "title") {			insertSpaceCell(theSpace,1);			theLine = '<td width="' + theWidth + '">';			theLine+= '<p class="baseFont style16pt styleGray1">';			theLine+= theText;			theLine+= '</p>';			theLine+= '</td></tr>';		}		else if (itemType == "paragraph") {			insertSpaceCell(theSpace,1);			theLine = '<td width="' + theWidth + '">';			theLine+= '<p class="baseFont style12pt styleGray1">';			theLine+= theText;			theLine+= '</p><br>';			theLine+= '</td></tr>';		}		else if (itemType == "blankspace") {			//insertSpaceCell(1,theSpace);			insertSpaceCell(kDispWidth,theSpace);			theLine = '</tr>';		}		document.writeln(theLine);		document.writeln('</table'+'>');	}		function insertImage(cat,n) {				var lOnclick;		var lTarget;		var lHref;		var theLine;				if (Item[cat][n][kJumptype] == kIsMenu) {			lOnclick = ' onClick="setAndGo(';			lOnclick += "'" + Item[cat][n][kPage] + "'";			lOnclick += ');return false"';						lHref 	= ' href="'+Item[cat][n][kUrl]+'"';						lTarget = ' target="mainFrame"';		}		else if (Item[cat][n][kJumptype] == kIsPage) {			lOnclick = '';			lHref	= ' href="'+ Item[cat][n][kUrl] +'"';			lTarget = ' target="mainFrame"';		}		else {			lOnclick = '';			lHref	= ' href="javascript:void(wrPopup('+"'"+cat+"',"+n+'))"';			lTarget = "";		}				if (Item[cat][n][kImage] != "") {			theLine = '<TD'+' border="0" width="'+Item[cat][n][kWidth];			theLine+= '" height="'+Item[cat][n][kHeight];			theLine+= '" align="'+Item[cat][n][kAlign];			theLine+= '" valign="'+Item[cat][n][kVAlign];			theLine+= '">';			if (Item[cat][n][kUrl] != "") {				theLine+= '<a '+lHref+lTarget+lOnclick;				theLine+= '><IMG border="0" SRC="'+Item[cat][n][kImage]+'"></a>';			}			else {				theLine+= '<IMG border="0" SRC="'+Item[cat][n][kImage]+'">';			}			theLine+= '</TD>';		}		else {			theLine = '<TD'+' width="'+Item[cat][n][kWidth]+'" height="'+Item[cat][n][kHeight]+'"><'+'/TD>';		}				document.writeln(theLine);				//document.writeln(Item[cat][n][kUrl]);		//document.writeln(cat);		//document.writeln(n);		//document.writeln(kUrl+"<br>");	}		function insertText(cat,n,sty,dim) {		var lWidth;		var lHeight;		var lAlign;		var lVAlign;		var lOnclick;		var lOnclick;		var lTarget;		var theLine;				// sty=1 means text appears below, so use same width.  else use dim (text to right)		if (sty) {			lWidth = Item[cat][n][kWidth];			lHeight = dim;			lAlign = Item[cat][n][kAlign];		}		else {			lWidth = dim;			lHeight = Item[cat][n][kHeight];			lAlign = "left";		}						if (Item[cat][n][kJumptype] == kIsMenu) {			lOnclick = ' onClick="setAndGo(';			lOnclick += "'" + Item[cat][n][kPage] + "'";			lOnclick += ');return false"';						lHref 	= ' href="'+Item[cat][n][kUrl]+'"';			lTarget = ' target="mainFrame"';		}		else if (Item[cat][n][kJumptype] == kIsPage) {			lOnclick = '';			lHref	= ' href="'+ Item[cat][n][kUrl] +'"';			lTarget = ' target="mainFrame"';		}		else {			lOnclick = '';			lHref	= ' href="javascript:void(wrPopup('+"'"+cat+"',"+n+'))"';			lTarget = "";		}				lVAlign = PgLayout[cat][kTxtAlign];		if (Item[cat][n][kTitle] != "") {			theLine = '<TD'+' border="0" width="'+lWidth;			theLine+= '" height="'+lHeight+'" align="'+lAlign;			theLine+= '" valign="'+lVAlign;			theLine+= '">';			if (Item[cat][n][kUrl] != "") theLine+= '<a '+lHref+lTarget+lOnclick + '>';			theLine+= '<P class="baseFont '+PgLayout[cat][kTxtStyle]+ ' styleGray1">'+Item[cat][n][kTitle]+Item[cat][n][kText]+'</P>';			if (Item[cat][n][kUrl] != "") theLine+= '</a>';			theLine+= '</TD>';		}				else {			lWidth = 0;			theLine = '<TD'+' width="'+lWidth+'" height="'+lHeight+'"><'+'/TD>';		}		document.writeln(theLine);	}				function insertAllItems(cat) {				var i=0;		var j=0;		var k=0;		var nRows;		var theCols= PgLayout[cat][kCols];		var styl 	= PgLayout[cat][kStyle];		var dimen	= PgLayout[cat][kTxtDimen];				setCat(cat);				nRows	= parseInt((numItems+1+theCols/2-.5)/theCols+.5);		if (numHItems > 0) {			document.writeln('<table border="'+'0" cellpadding="'+'0" cellspacing="'+'0">');			for (k=0; k<numHItems; k++) insertHeadItem(HItem[cat][k][kHtype],HItem[cat][k][kHtext],HItem[cat][k][kHspace]);			document.writeln('</table>');		}				document.writeln('<table border="'+'0" cellpadding="'+'0" cellspacing="'+'0">');		for (i=0; i<nRows; i++) {			startRow();			k = 0;			if (styl) {				while (k<theCols && j<numItems+1) {					insertColSpacer(cat,j,k,Item[cat][j][kHeight]);					insertImage(cat,j);					k++;					j++;				}				endRow();								// add a separate row for the titles				// dimen contains height for this row				j = j-k;				k = 0;				startRow();				while (k<theCols && j<numItems+1) {					insertColSpacer(cat,j,k,dimen);					insertText(cat,j,styl,dimen);					k++;					j++;				}			}			else {				while (k<theCols && j<numItems+1) {					insertColSpacer(cat,j,k,Item[cat][j][kHeight]);					insertImage(cat,j);					insertText(cat,j,styl,dimen);					k++;					j++;				}			} // end if			endRow();			insertRowSpacer(cat);		} // end for			document.writeln('</table'+'>');	} // end function			function insertRowSpacer(cat) {		var theLine = "";		var theHeight = PgLayout[cat][kRowSpace];				if (theHeight > 0) {			theLine = ' <tr><td height="'+theHeight+'" valign="top">';			theLine+= '<img src="transparent.gif" alt="" height="1">';			theLine+= '</td></tr>';			document.writeln(theLine);		}	}		function insertColSpacer(cat,n,theCol,theHeight) {		insertSpaceCell(ColumnSpace[cat][theCol],theHeight);	}		function insertSpaceCell(theWidth,theHeight) {		var theLine = "";		if (theWidth > 0) {			theLine = ' <td width="'+theWidth+'" height="'+theHeight+'" valign="top">';			theLine+= '<img src="transparent.gif" alt="" width="'+theWidth+'" height="1">';			theLine+= '</td>';			document.writeln(theLine);		}	}		function dumpCat(cat) {				numItems = Item[cat].length - 1;		for (i=0; i<numItems+1; i++) {			document.writeln(Item[cat][i]);			document.writeln('<br>');		}	}		function wrPopup(cat,n) {    	var thePop;		var theTitle = Item[cat][n][kTitle];		var theWidth = Item[cat][n][kIwidth];		var theHeight = Item[cat][n][kIheight];		var theFeatures = 'width='+ theWidth +',height='+ theHeight +',scrollbars=no,resizable=yes';					thePop = window.open("","",theFeatures);						thePop.document.write("<html><head></head>");			thePop.document.write('<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');			thePop.document.write('<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">');			thePop.document.write('<tr><td align="center" valign="middle">');			thePop.document.write('<img src="'+Item[cat][n][kUrl]+'">');			thePop.document.write('</td></tr></table></body></html>');			thePop.document.title = theTitle;		    thePop.document.close();			thePop.focus();	}		// -->