
indexOfEntries = new Array 
nEntries = 0 
doc = document 
bulletIcon = "images/menudot.gif"
itemIndent = "20"
styleClassName = "menuLink"
openFolderId = -1

browserVersion = 0 
if (doc.all) 
    browserVersion = 1 //IE4   
else if (doc.layers) 
	browserVersion = 2 //NS4 
else 
	browserVersion = 0 //other 



function initializeDocument(folderID) 
{  
    if (folderID != null) {
		openFolderId = folderID
    }
      
	folderCompany.initialize() 
	folderSolutions.initialize() 
	folderNews.initialize() 
	folderPartners.initialize() 
	folderAct1.initialize() 
	folderAct2.initialize() 
	folderAct3.initialize() 
	folderEvents.initialize() 
	folderCareers.initialize() 
	folderService.initialize() 
	folderUpdates.initialize() 
} 



function createFolder(imageName, closedImage, openImage, mouseOverImage, link, altText)
{
	folder = new Folder(imageName, closedImage, openImage, mouseOverImage, link, altText)
	return folder
}


function Folder(imageName, closedImage, openImage, mouseOverImage, link, altText) 
{ 
  this.imageName = imageName
  this.closedImage = closedImage
  this.openImage = openImage
  this.mouseOverImage = mouseOverImage
  this.link = link
  this.altText = altText
  this.id = -1   
  this.navObj = -1  
  this.image = 0  
  this.isOpen = false  
  this.children = new Array 
  this.nChildren = 0 
  this.initialize = initializeFolder 
  this.addChild = addChild 
  this.createIndex = createEntryIndex  
  this.renderOb =  drawFolder
  this.outputLink = outputFolderLink 
  this.hide = hideFolder 
  this.display = display 
  this.setState = setStateFolder 
} 
function initializeFolder() 
{ 
      
  this.createIndex() 
  if (this.id == openFolderId)
    this.renderOb(true)
  else
	this.renderOb(false)  
}
function drawFolder(printLinks) 
{ 
   
  doc.write("<table border=0 cellspacing=0 cellpadding=0>") 
  doc.write("<tr><td colspan=2>") 
  this.outputLink() 
  doc.write("<img name='" + this.imageName + "'") 
  doc.write("src='" + this.closedImage +"'")
  if (this.altText) 
	doc.write(" alt='" + this.altText + "'")
  
  doc.write(" border=0></a>") 
  doc.write("</td>")  
  doc.write("</tr>") 
  doc.write("</table>")

  if (printLinks) {
    this.isOpen = true
	doc.write("<table ")
    if (browserVersion == 1) 
		doc.write("id='folder" + this.id + "' style='position:block; display:block;' ") 
    doc.write("border=0 cellspacing=0 cellpadding=0>") 
    for (i=0 ; i < this.nChildren; i++)  
		this.children[i].initialize() 
    doc.write("</table>")

	
  }
  else {
	this.isOpen = false
	if (browserVersion == 1) {   
	  doc.write("<table id='folder" + this.id + "' style='position:block; display:none' border=0 cellspacing=0 cellpadding=0>") 

      for (i=0 ; i < this.nChildren; i++)  
		this.children[i].initialize() 
      doc.write("</table>")
	}
	else {
	  for (i=0; i<this.nChildren; i++)
		this.children[i].createIndex()
	}
		
	
  }
  
  if (browserVersion == 1) { 
	this.navObj = doc.all["folder"+this.id]
	this.image = doc.all[this.imageName]
  } 
  else if (browserVersion == 2) { 
	this.image = document.images[this.imageName]
  }
 
} 

function outputFolderLink() 
{ 
	if (this.nChildren == 0) 
		doc.write("<a href='" + this.link + "' onMouseOver=mouseOver("+this.id+") onMouseOut=mouseOut("+this.id+")>")	
	else 
	{
		if (browserVersion == 1)
			doc.write("<a href='javascript:menuChange("+this.id+")' onMouseOver=mouseOver("+this.id+") onMouseOut=mouseOut("+this.id+")>")
		else
			doc.write("<a href='" + this.link + "' onMouseOver=mouseOver("+this.id+") onMouseOut=mouseOut("+this.id+")>")
	}
} 

function mouseOver(folderId)
{
	folder = indexOfEntries[folderId] 
	if (!folder.isOpen)
		folder.image.src = folder.mouseOverImage
}
function mouseOut(folderId)
{
	folder = indexOfEntries[folderId] 
	if (!folder.isOpen)
		folder.image.src = folder.closedImage	
}

function Item(description, link)
{ 
  this.desc = description 
  this.link = link  

  this.id = -1
  this.navObj = 0 
  this.iconImg = 0 
  
  this.initialize = initializeItem 
  this.createIndex = createEntryIndex 
  
  this.renderOb = drawItem 

} 

function createLink(description, link) 
{ 
  linkItem = new Item(description, link)   
  return linkItem 
} 

function insideFolderDocument(parentFolder, document) 
{ 
  parentFolder.addChild(document) 
} 


function initializeItem() 
{  
  this.createIndex() 
  this.renderOb()   
} 

function addChild(childNode) 
{ 
  this.children[this.nChildren] = childNode 
  this.nChildren++ 
  return childNode 
} 

function menuChange(folderId) 
{ 
  var clickedFolder = 0 
  var state = 0 
 
  clickedFolder = indexOfEntries[folderId] 
  state = clickedFolder.isOpen 
 
  clickedFolder.setState(!state) // open<->close  
} 

function setStateFolder(open) 
{  
  if (this.isOpen == open) 
    return 
  
  this.isOpen = open 
  changeDaState(this) 
} 
 

function changeDaState(folder) 
{   
  var i=0 
 
  if (folder.isOpen) 
  { 
    if (browserVersion == 1) {
		folder.image.src = folder.openImage 
		folder.display()
	}
  } 
  else 
  {    
	if (browserVersion == 1) {
		folder.image.src = folder.closedImage 
		folder.hide()
	}
	
    
  }  
} 

function display() 
{ 
  if (browserVersion == 1) 
    this.navObj.style.display = "block" 
} 

function hideFolder() 
{ 
  if (browserVersion == 1) { 
    if (this.navObj.style.display == "none") 
      return 
    this.navObj.style.display = "none" 
  }     
} 
 
 
function createEntryIndex() 
{ 
  this.id = nEntries 
  indexOfEntries[nEntries] = this 
  nEntries++ 
} 
 
function drawItem() 
{   
	doc.write("<tr>") 
	doc.write("<td width=" + itemIndent + ">&nbsp</td>")
	doc.write("<td>")
	doc.write("<a href=" + this.link + ">") 
	doc.write("<img id='itemIcon"+this.id+"' ") 
	doc.write("src='"+bulletIcon+"' border=0>") 
	doc.write("</a>") 
	doc.write("</td>")
	doc.write("<td valign=left class=" + styleClassName + ">")  
	doc.write("<a href=" + this.link + ">" + this.desc + "</a>") 
	doc.write("</td></tr>")
   
} 





/////////////// Un-Swaps Images /////////////////////////////////////
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;
}
/////////////////////////////////////////////////////////////////////

/////////////// Finds Object ////////////////////////////////////////
function MM_findObj(n, d) { //v3.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); return x;
}
/////////////////////////////////////////////////////////////////////

/////////////// Swaps Images ////////////////////////////////////////
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];}
}
/////////////////////////////////////////////////////////////////////

/////////////// Reloads if Netscape resizes ////////////////////////
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
/////////////////////////////////////////////////////////////////////

/////////////// Jump Menu Function //////////////////////////////////
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
/////////////////////////////////////////////////////////////////////

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/////////////////////////////////////////////////////////////////////

///// Random animate of logo ////////////////////////////////////////
counter= RandomNumber(20,10);
ID=window.setTimeout("countdown();", 1000);

var counter;
function countdown() {
counter--;
	// window.status = counter;
   ID=window.setTimeout("countdown();", 1000);
   if(counter == 0)  {
        window.clearTimeout(ID);
		MM_swapImage('head23','','images/headanim23.gif',1)
		counter= RandomNumber(20,10);
		ID=window.setTimeout("countdown();", 1000);
	}

}

function RandomNumber(upper_limit,lower_limit) {
	return (Math.round(upper_limit * Math.random()) + lower_limit);
}
////////////////////////////////////////////////////////////////////