var _rootPath = '/offices/hr/';

function space(width,height)
{
	document.write('<img src="' + _rootPath + 'images/spacer.gif" width="' + width + '" height="' + height + '" border="0" alt="">');
}

function getSpace(width,height)
{
	return '<img src="' + _rootPath + 'images/spacer.gif" width="' + width + '" height="' + height + '" border="0" alt="">';
}

function gotoPage(sLink)
{
	window.open(_rootPath + sLink,"_parent");
}

function changeStyleClass(obj, className)  
{
    obj.className = className;
}

function openWin(sLink)
{
	window.open(sLink,"_parent");
}

function Page(name)
{
	var p = this;
	p.name = name;
	p.bannerClass = '';	
	p.bannerImage = '';
	p.bodyHeaderClass = '';	
	p.menuHeaderClass = '';	
	p.linkClass = '';
	p.BreadCrumbs = new Array();
	p.index = 0;
	p.showBackToTop = true;
	return p;
}

Page.prototype.addBreadCrumb = function (crumbName, crumbLocation)
{
	this.BreadCrumbs[this.index++] = crumbName;
	this.BreadCrumbs[this.index++] = crumbLocation;	
}

Page.prototype.drawBreadCrumb = function ()
{	
	if (this.BreadCrumbs.length > 0)
	{
		document.write('<tr>');
			document.write('<td colspan="3" class="breadCrumb">');
				document.write('<table cellpadding="3" cellspacing="0" border="0">');	
					document.write('<tr>');		
					for(var x=0; x<this.BreadCrumbs.length; x++)
					{
						if(this.BreadCrumbs[x+1] == null)
						{
							document.write('<td class="breadCrumbSelected">' + this.BreadCrumbs[x] + '</td>');						
						}
						else
						{
							document.write('<td><a href="' + _rootPath + this.BreadCrumbs[x+1] + '" class="breadCrumb" title="' + this.BreadCrumbs[x] + '">' + this.BreadCrumbs[x] + '</a></td>');
							document.write('<td style="padding-top: 4px;"><img src="' + _rootPath + 'images/arrow_gray.gif" alt="Cookie Crumb Link Arrow"></td>');
						}
						x = x + 1;

					}			
					document.write('</tr>');
				document.write('</table>');		
			document.write('</td>');
		document.write('</tr>');
		document.write('<tr><td colspan="3" width="1" bgcolor="#DADADA">' + getSpace(1,1) + '</td></tr>');
	}
}

function Nav(title)
{
	var n = this;
	n.title = title;
	n.MenuItems = new Array();			
	n.currentIndex = 0;
	if (oPage != null) 
		n.headerClass = oPage.menuHeaderClass;
	else		   
		n.headerClass = '';	
	return n;
}

Nav.prototype.addMenu = function (item, location, arrows) 
{
	this.MenuItems[this.currentIndex++] = item;
	this.MenuItems[this.currentIndex++] = location;
}

Nav.prototype.drawMenu = function ()
{	
	document.write('<table cellpadding="0" cellspacing="0" border="0" width="150">');
		document.write('<tr><td class="' + this.headerClass + '" colspan="2">' + this.title + '</td></tr>');
		document.write('<tr><td colspan="2">' + getSpace(1,10) + '</td></tr>');		
		document.write('<tr><td bgcolor="#DADADA" width="150" height="1" colspan="2">' + getSpace(1,1) + '</td></tr>');
		for (var x = 0; x < this.MenuItems.length; x++)
		{	 
					
			if (this.MenuItems[x+1].indexOf("http") >= 0)			
			{
				if (this.MenuItems[x].indexOf(" &raquo;") >= 0)			
				{
					document.write('<tr><td class="menuBGoff" width="140" onclick="javascript:openWin(\'' + this.MenuItems[x+1] + '\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '"><div class="menuContainer"><a href="' + this.MenuItems[x+1] + '" class="menuLink" alt="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '">' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '</a></div></td><td bgcolor="#DADADA" width="10" align="center"><img src="' + _rootPath + 'images/arrow_white.gif"></td></tr>');
				}
				else
				{
					if (this.MenuItems[x].indexOf(" &newWin") >= 0)			
					{
						document.write('<tr><td class="menuBGoff" colspan="2" onclick="javascript:window.open(\'' + this.MenuItems[x+1] + '\',\'newWindow\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '"><div class="menuContainer"><a href="' + this.MenuItems[x+1] + '" class="menuLink" target="newWindow" alt="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '">' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '</a></div></td></tr>');
					}
					else
					{
						document.write('<tr><td class="menuBGoff" colspan="2" onclick="javascript:openWin(\'' + this.MenuItems[x+1] + '\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x]  + '"><div class="menuContainer"><a href="' + this.MenuItems[x+1] + '" class="menuLink" alt="' + this.MenuItems[x]  + '">' + this.MenuItems[x] + '</a></div></td></tr>');
					}
				}
			}	
			else			
			{
				if (this.MenuItems[x].indexOf(" &raquo;") >= 0)			
				{
					document.write('<tr><td class="menuBGoff" width="140" onclick="javascript:gotoPage(\'' + this.MenuItems[x+1] + '\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '"><div class="menuContainer"><a href="javascript:gotoPage(\'' + this.MenuItems[x+1] + '\');" class="menuLink" alt="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '">' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8) + '</a></div></td><td bgcolor="#DADADA" width="10" align="center"><img src="' + _rootPath + 'images/arrow_white.gif"></td></tr>');
				}
				else
				{
					if (this.MenuItems[x].indexOf(" &newWin") >= 0)			
					{
						document.write('<tr><td class="menuBGoff" colspan="2" onclick="javascript:window.open(\'' + this.MenuItems[x+1] + '\',\'newWindow\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '"><div class="menuContainer"><a href="javascript:window.open(\'' + this.MenuItems[x+1] + '\',\'newWindow\');" class="menuLink" alt="' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8)  + '">' + this.MenuItems[x].substring(0,this.MenuItems[x].length - 8) + '</a></div></td></tr>');
					}
					else
					{
						document.write('<tr><td class="menuBGoff" colspan="2" onclick="javascript:gotoPage(\'' + this.MenuItems[x+1] + '\');" onmouseover="changeStyleClass(this,\'menuBGon\');" onmouseout="changeStyleClass(this,\'menuBGoff\');" title="' + this.MenuItems[x]  + '"><div class="menuContainer"><a href="javascript:gotoPage(\'' + this.MenuItems[x+1] + '\');" class="menuLink" alt="' + this.MenuItems[x]  + '">' + this.MenuItems[x] + '</a></div></td></tr>');
					}
				}
			}

			document.write('<tr><td bgcolor="#DADADA" width="150" height="1" colspan="2">' + getSpace(1,1) + '</td></tr>');			
			x = x + 1;
		}
	document.write('</table>');	
}