function pageReload()
{
	if (ns)
	{
		document.reload();
	}
}


function List(x,y,width,itemH) {
	if (browserVersion >= 4)
	{
		this.name = "List"+(List.count++)
		this.id = this.name+'List'
		this.x = x
		this.left = x
		this.y = y
		this.top = y
		this.w = width
		this.width = width
		this.right = this.left + this.width
		this.bottom = this.top
 
	
		if (arguments.length==4) 
		{
			this.itemH = itemH
			this.itemHset = true
			this.h = -1
		}
		else 
		{
			this.itemH = null
			this.itemHset = false
			if (ie)
			{
				this.h = 1000
			}
			else
			{
				this.h =  -1 
			}
		}
// set up default variable for menus

		this.itemSpacing = 1
		this.fontname = 'Helvetica'
		this.fontsize = 11
		this.visibility = 'inherit'

		this.color = new Object()
		this.color.textNormal = '#ffffff'
		this.color.textSelected = '#ffffff'
		this.color.bgNormal = '#666666'
		this.color.bgSelected = '#000000'
		this.color.bgRollover = '#444444'
		this.color.bg = '#000000'

		this.allowDeselect = false
		this.multiSelect = false
		this.preSelect = null
		this.autohide = true
		this.submenuOnSelect = false

		this.items = new Array()
		this.selectedIndex = null
		this.obj = this.name + "ListObject"
		eval(this.obj + "=this")
		List.Menus[List.count] = this

		this.add = ListAdd
		this.build = ListBuild
		this.activate = ListActivate
		this.over = ListOver
		this.out = ListOut
		this.down = ListDown
		this.select = ListSelect
		this.onSelect = ListRedirect
		this.hideMenu = ListHideMenu
		this.hide = ListForceHide
		this.showMenu = ListShowMenu
		this.bringtofront = ListBringToFront
		this.sendtoback = ListSendToBack
	}
}
function ListAdd(value,text,submenu,handcursor) 
{
	if (browserVersion >= 4)
	{
		var i = this.items.length
		this.items[i] = new Array()
		this.items[i].selected = false
		this.items[i].value = value
		this.items[i].submenu = submenu
		this.items[i].handcursor = handcursor
		this.items[i].text = text
		if (this.items[i].text == "&nbsp;")
		{
			this.items[i].Rollover = false;
		}
		else
		{
			this.items[i].Rollover = true;
		}
		this.items[i].textNormal = '<div class="'+this.name+'TextNormal">'+text+'</div>'
		this.items[i].textSelected = '<div class="'+this.name+'TextSelected">'+text+'</div>'

		if (this.itemH) 
		{
			this.h += this.itemH+this.itemSpacing
			this.items[i].y = i*this.itemH+i*this.itemSpacing
			this.bottom = this.bottom + this.itemH
		}
		else this.items[i].y = 0
	}
}
function ListBuild() 
{
	if (browserVersion >= 4)
	{
		this.css = ''
		this.css += css(this.name+'List',this.x,this.y,this.w,this.h,this.color.bg,(this.itemHset)?this.visibility:'hidden',0)
		for (var i=0;i<this.items.length;i++) 
		{
			this.css += css(this.name+'ListItem'+i,0,this.items[i].y,this.w,this.itemH,this.color.bgNormal)
			if (this.items[i].handcursor != true)
			{
				this.css += css(this.name+'ListItemC'+i,0,this.items[i].y,this.w,this.itemH)
			}
		}
		this.css += '.'+this.name+'TextNormal {font-family:"'+this.fontname+'"; font-size:'+this.fontsize+'px; color:'+this.color.textNormal+'; vertical-align: middle; background-color:transparent;}\n'+
		'.'+this.name+'TextSelected {font-family:"'+this.fontname+'"; font-size:'+this.fontsize+'pt; color:'+this.color.textSelected+'; vertical-align: middle; background-color:transparent;}\n'
	
		writeCSS(this.css)
	
		this.div = '<div id="'+this.name+'List">\n'
		for (var i=0;i<this.items.length;i++) 
		{
			this.div += '<div id="'+this.name+'ListItem'+i+'">'+this.items[i].textNormal+'</div>\n'
			if (this.items[i].handcursor != true)
			{
				this.div += '<div id="'+this.name+'ListItemC'+i+'"></div>\n'
			}
		}
		this.div += '</div>'
	}
}

function ListActivate(me,parent,parent_element) 
{
	if (browserVersion >= 4)
	{
		if (ie)
		{
			this.h -= 1001
			//this sets up the events for the whole menu (in case this is a sub-menu)
			//(Microsoft version)
			if (parent)
			{
				this.parent = parent;
				document.all[this.id].onmouseout = function() {parent.out(parent_element); me.hideMenu();}
				document.all[this.id].onmouseover =function() {parent.over(parent_element); parent.showMenu();}
			}
			// if it's not a submenu
			else
			{
				//alert(this.id)
				document.all[this.id].onmouseout = function() {me.hideMenu();}
			}

		}
		else
		{
			//this sets up the events for the whole menu (in case this is a sub-menu)
			//(Netscape version)
			if (parent)
			{
				this.parent = parent;
				document.layers[this.id].onmouseout = function(event) {parent.out(parent_element); me.hideMenu(event);}
				document.layers[this.id].onmouseover = function(event) {parent.over(parent_element); parent.showMenu(event); }
			}
			//if it's not a submenu
			else
			{
				document.layers[this.id].onmouseout = function(event) {me.hideMenu(event);}
			}	
		}
	
		for (var i=0;i<this.items.length;i++) 
		{
			this.items[i].setbg = ListSetbg
		
			//setup the events and various pointers for the individual menu items
		
			if (ie) 
			{	
		
				//Microsoft version
				if (this.items[i].handcursor != true)
				{
					this.items[i].e = document.all[this.name+'ListItemC'+i]
				}
				else
				{
					this.items[i].e = document.all[this.name+'ListItem'+i]
				}
				this.items[i].layer = document.all[this.name+'ListItem'+i]
				this.items[i].doc = document.all[this.name+'ListItem'+i].style
			
			}
			else
			{
				//Netscape version
				if (this.items[i].handcursor != true)
				{
					this.items[i].e = eval('document.'+this.id+'.document.'+this.name+'ListItemC'+i)
				}
				else
				{
					this.items[i].e = eval('document.'+this.id+'.document.'+this.name+'ListItem'+i)
				}
				this.items[i].e.captureEvents(Event.MOUSEDOWN)
				this.items[i].layer = eval('document.'+this.id+'.document.'+this.name+'ListItem'+i)
				this.items[i].doc = eval('document.'+this.id+'.document.'+this.name+'ListItem'+i+'.document')
			}
		
			this.items[i].e.onmouseover = new Function(this.obj+'.over('+i+');')
			this.items[i].e.onmouseout =  new Function(this.obj+'.out('+i+'); ')
			this.items[i].e.onmousedown = new Function(this.obj+'.down('+i+'); return false;')

		}
	}
}

function ListOver(i)
{
	if (browserVersion >= 4)
	{
		if (this.items[i].Rollover == true )
		{
			this.items[i].setbg(this.color.bgRollover)
	
			if (this.items[i].submenu && this.submenuOnSelect != true)
			{
				for (var x=0;x<this.items.length;x++)
				{
					if(this.items[x].submenu)
					{
						this.items[x].submenu.hide()
					}
				}
				this.items[i].submenu.showMenu()
			}
		}
	}
	
}

function ListOut(i) 
{
	if (browserVersion >= 4)
	{

		this.items[i].setbg(this.color.bgNormal)
	
		if (this.items[i].submenu)
		{
			this.items[i].submenu.hideMenu()
		}
	}
	
}
function ListDown(i) 
{
	if (browserVersion >= 4)
	{
			this.select(i)
			//this.items[i].setbg(this.color.bgNormal)
			if (this.submenuOnSelect == true && (this.items[i].submenu))
			{
				this.items[i].submenu.showMenu();
				this.hide();
			}
			else
			{
				this.onSelect()
			}

	}

}
function ListSelect(index) 
{
	if (browserVersion >= 4)
	{
		if (this.items[index]!=null) 
		{	
			this.selectedIndex = index
			this.value = this.items[index].value
			this.items[index].selected = true
		}
	}
}

function ListHideMenu(e)
{
	if (browserVersion >= 4)
	{
		if (navigator.appName.indexOf("Microsoft") != -1)
		{
			 e = window.event;
			X = e.clientX;
			Y = e.clientY;
		}
		else
		{
			if (e)
			{
				X = e.pageX;
				Y = e.pageY;
			}
			else
			{
				if (this.autohide == true)
				{
					document.layers[this.name+'List'].visibility = "hide";
					return;
				}
			}
		
		}
	
		if (this.autohide == true)
		{
			if (X > (this.right - 1) || X < (this.left + 1) || Y > (this.bottom- 1) ||  Y < (this.top))
			{
				if (ie)
				{
					document.all[this.name+'List'].style.visibility = "hidden";
				}
				else
				{
					document.layers[this.name+'List'].visibility = "hide";
	
				}

				if (this.parent)
				{
					this.parent.hideMenu();
				}
			}
		}
	}
}

function ListForceHide()
{
	if (ie)
	{
		document.all[this.name+'List'].style.visibility = "hidden";
	}
	else
	{
		document.layers[this.name+'List'].visibility = "hide";
	}
}

function ListShowMenu() 
{
	if (browserVersion >= 4)
	{
		if (ie)
		{	
			document.all[this.name+'List'].style.visibility = "visible";
		}
		else
		{
			for (var i=0; i<this.items.length; i++)
			{
				this.items[i].setbg(this.color.bgNormal)
			}
			document.layers[this.name+'List'].visibility = "show";
		}
	}

}

function ListBringToFront()
{

	for (var i=0;i<this.items.length;i++) 
	{
		if (ie)
		{
			document.all[this.name+'ListItem'+i].style.zIndex = "0";
			document.all[this.name+'ListItemC'+i].style.zIndex = "0";
			document.all[this.name+'List'].style.zIndex = "0";
		}
		else
		{
			document.layers[this.name+'List'].zIndex = "0";
		}
	}

}

function ListSendToBack()
{

	for (var i=0;i<this.items.length;i++) 
	{
		if (ie)
		{
			document.all[this.name+'ListItem'+i].style.zIndex = "1";
			document.all[this.name+'ListItemC'+i].style.zIndex = "1";
			document.all[this.name+'List'].style.zIndex = "1";
		}
		else
		{
			document.layers[this.name+'List'].zIndex = 1;
		}
	}

}

function ListRedirect() 
{
	if (browserVersion >= 4)
	{
		location.href = this.value
	}
}

function ListSetbg(color) 
{
	if (browserVersion >= 4)
	{
		if (ie) 
		{
			//Microsoft Version
			this.doc.backgroundColor = color

		}
		else
		{
			//netscape Version
			this.doc.bgColor = color

		}
	}

}



function css(id,left,top,width,height,color,vis,z,other) 
{
	if (browserVersion >= 4)
	{
		if (id=="START")
		{
			 return '<STYLE TYPE="text/css">\n'
		}
		else if (id=="END") 
		{
			return '</STYLE>'
		}
		var str = (left!=null && top!=null)? '#'+id+' {position:absolute; left:'+left+'px; top:'+top+'px;' : '#'+id+' {position:relative;'
		if (arguments.length>=4 && width!=null) str += ' width:'+width+'px;'
		if (arguments.length>=5 && height!=null) 
		{
			str += ' height:'+height+'px;'
			if (arguments.length<9 || other.indexOf('clip')==-1) 
			{
				str += ' clip:rect(0px '+width+'px '+height+'px 0px);'
			}
		}
		if (arguments.length>=6 && color!=null)
		{
			if (ie)
			{
				str += ' background-color:'+color+';'
			}
			else
			{
				str += ' layer-background-color:'+color+';'
			}
		}
	
	
		if (arguments.length>=7 && vis!=null)
		{
			 str += ' visibility:'+vis+';'
		}
		if (arguments.length>=8 && z!=null)
		{
			 str += ' z-index:'+z+';'
		}
		if (arguments.length==9 && other!=null)
		{
			 str += ' '+other
		}
		str += '}\n'
		return str
	}
}
function writeCSS(str,showAlert) 
{
	if (browserVersion >= 4)
	{
		str = css('START')+str+css('END')
		document.write(str)
		if (showAlert) alert(str)
	}
}

if (browserVersion >= 4)
{
	List.count = 0
	List.Menus = new Array()
}

// set up specific menu style formatting and positioning

var Menu_Item_Height = 30;
var Menu_Item_Font_Size =11;
var Menu_Item_Color = '#ffffff';
var Menu_Item_Font_Name = 'Helvetica'
var Sub_Menu_Item_bg_color = '#ffffff'
var Sub_Menu_Item_rollover_color = '#333333'

// Consulting
var mnu_services_Width = 115;
var mnu_services_Top = 30;
var mnu_services_Left = 15;

// Corrosion Prevention
var Capabilities_Menu_Width = 115;
var Capabilities_Menu_Top = 30;
var Capabilities_Menu_Left = 170;

//Global Trading
var mnu_global_Width = 115;
var mnu_global_Top = 30;
var mnu_global_Left = 325;

//About
var About_Menu_Width = 115;
var About_Menu_Top = 30;
var About_Menu_Left = 480;


function loadHome(url)
{
	top.location.href=url
}

function headermenu_init()
{
	if (browserVersion >= 4)
	{
		mnu_solutions.activate(mnu_solutions)
		mnu_services.activate(mnu_services)
		mnu_global.activate(mnu_global)
		mnu_about.activate(mnu_about)
	}
}

if (browserVersion >= 4)
{
//Build the Corrosion Menu
	mnu_solutions = new List (Capabilities_Menu_Left,Capabilities_Menu_Top,Capabilities_Menu_Width,Menu_Item_Height)
	mnu_solutions.add('javascript:loadHome("corrosion.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Overview')
	mnu_solutions.add('javascript:loadHome("partners.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Corrosion Partners')
	mnu_solutions.add('javascript:loadHome("strongback.htm")','&nbsp;&nbsp;&nbsp;&nbsp;StrongBack Corp.')
	mnu_solutions.add('javascript:loadHome("stuart.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Stuart Steel')
	
	mnu_solutions.fontsize = Menu_Item_Font_Size;
	mnu_solutions.fontname = Menu_Item_Font_Name;
	mnu_solutions.color.textNormal  = Menu_Item_Color
	mnu_solutions.visibility = 'hidden'
	mnu_solutions.build()
}
else
{
	mnu_solutions = " ";
}

if (browserVersion >= 4)
{
//Build the Consulting Menu
	mnu_services = new List (mnu_services_Left,mnu_services_Top,mnu_services_Width,Menu_Item_Height)
	mnu_services.add('javascript:loadHome("consulting.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Market Research')
	//mnu_services.add('javascript:loadHome("prevention.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Corrosion Prevention')
	mnu_services.add('javascript:loadHome("consulting.htm#partner")','&nbsp;&nbsp;&nbsp;&nbsp;Partnerships')
	mnu_services.add('javascript:loadHome("consulting.htm#trade")','&nbsp;&nbsp;&nbsp;&nbsp;Int. Consulting')
	
	mnu_services.fontsize = Menu_Item_Font_Size;
	mnu_services.fontname = Menu_Item_Font_Name
	mnu_services.color.textNormal  = Menu_Item_Color
	mnu_services.visibility = 'hidden'
	mnu_services.build()
}
else
{
	mnu_services = " ";
}


if (browserVersion >= 4)
{
//Build the Global Trading Menu
	mnu_global = new List (mnu_global_Left,mnu_global_Top,mnu_global_Width,Menu_Item_Height)
	mnu_global.add('javascript:loadHome("global.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Intermediary Mgmt.')
	mnu_global.add('javascript:loadHome("global.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Representation')
	
	mnu_global.fontsize = Menu_Item_Font_Size;
	mnu_global.fontname = Menu_Item_Font_Name
	mnu_global.color.textNormal  = Menu_Item_Color
	mnu_global.visibility = 'hidden'
	mnu_global.build()
}
else
{
	mnu_global = " ";
}

//Build the About Us Menu
if (browserVersion >= 4)
{
	mnu_about = new List (About_Menu_Left,About_Menu_Top,About_Menu_Width,Menu_Item_Height)
	//mnu_about.add('javascript:loadHome("about.htm")','&nbsp;&nbsp;&nbsp;&nbsp;NIXUS International')
	mnu_about.add('javascript:loadHome("news.htm")','&nbsp;&nbsp;&nbsp;&nbsp;News & Events')
	mnu_about.add('javascript:loadHome("contact.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Contact Us')
	mnu_about.add('javascript:loadHome("alliance.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Alliances')
	//mnu_about.add('javascript:loadHome("about/staff.htm")','&nbsp;&nbsp;&nbsp;&nbsp;Staff')
	//mnu_about.add('javascript:loadHome("news/default.htm")','&nbsp;&nbsp;&nbsp;&nbsp;News')
	
	mnu_about.fontsize = Menu_Item_Font_Size;
	mnu_about.fontname = Menu_Item_Font_Name
	mnu_about.color.textNormal  = Menu_Item_Color
	mnu_about.visibility = 'hidden'
	mnu_about.build()
}
else
{
	mnu_about = " ";
}

function init()
{
	//Generic Init Function
	//activate the Menu(s)
	if (browserVersion >= 4)
	{
		headermenu_init();
	}
}

function WM_netscapeCssFix() {
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.parent.onresize = WM_netscapeCssFix;
  }
}

WM_netscapeCssFixCheckIn()


function goOne()

{
window.open("isi1.htm","","width=567,height=372,toolbar=no,location=no,resizable=no,scrollbars=no");
}


function goTwo()

{
window.open("stm1.htm","","width=567,height=372,toolbar=no,location=no,resizable=no,scrollbars=no");
}
