var myTimer = null;
var myTimer2 = null;
var myTimer3 = null;
var preactiveH;
var preactiveB1;
var preactiveB2;
var showI;
var preshowI;
var newsItemA;
var seed;
var preSeed;

function selectFile(sURL) {
	if (sURL != "") location = sURL;
}

var param = "";
function toggleVisibility() {
  var inc, endInc=arguments.length;
  for (inc=0; inc<endInc; inc+=2) {
    var id = arguments[inc];
    if (arguments[inc+1] == 'hidden')param="hidden";
    else if(arguments[inc+1]=='visible')param="visible";
    if (document.getElementById) {
      eval("document.getElementById(id).style.visibility = \"" + param + "\"");
    } else {
      if (document.layers) document.layers[id].visibility = param;
      else if (document.all) eval("document.all." + id + ".style.visibility = \"" + param + "\"");
    }
  }
}

function randomNum(max) {
  var rNum=NaN
  while (isNaN(rNum)) {
    rNum=Math.floor(Math.random()*(max))
  }
  return rNum;
}

function changeImages() {
  for (var i=0; i<changeImages.arguments.length; i+=2) document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function preloadImages() {
  if (document.images) {
    var imgFiles = preloadImages.arguments;
    for (var i=0; i<imgFiles.length; i+=2){
      eval(arguments[i]+' = new Image()');
      eval(arguments[i]+'.src = "'+arguments[i+1]+'"');
    }
  }
}

//preloadImages('aboutimg',imgurl+'topnav/about_on.gif','newsimg',imgurl+'topnav/news_on.gif','eventsimg',imgurl+'topnav/events_on.gif','customersimg',imgurl+'topnav/customers_on.gif','solutionsimg',imgurl+'topnav/solutions_on.gif','industriesimg',imgurl+'topnav/industries_on.gif','partnersimg',imgurl+'topnav/partners_on.gif','productsimg',imgurl+'topnav/products_on.gif','servicesimg',imgurl+'topnav/services_on.gif','spacer',imgurl+'common/spacer_on.gif','arrow1',imgurl+'home/doublearrow_white.gif','arrow2',imgurl+'home/bottomnav/doublearrow.gif');
/*
// headlines
function headlineMover(param) {
  clearTimeout(myTimer);
  activeH = param;
  if (preactiveH) changeImages(preactiveH,imgurl+'common/spacer.gif');
  changeImages(activeH,imgurl+'home/doublearrow_white.gif');  
  preactiveH = activeH;
}*/

/*function headlineMout() {
  changeImages(activeH,imgurl+'common/spacer.gif');
  myTimer = setTimeout("headlineMover('spacer1');",200);
}*/

// bottom nav 1
/*function bottomNav1Mover(param) {
  clearTimeout(myTimer2);
  activeB1 = param;
  if (preactiveB1) changeImages(preactiveB1,imgurl+'common/spacer.gif');
  changeImages(activeB1,imgurl+'home/bottomnav/doublearrow.gif');  
  preactiveB1 = activeB1;
}*/

/*function bottomNav1Mout() {
  changeImages(activeB1,imgurl+'common/spacer2.gif');
  myTimer2 = setTimeout("bottomNav1Mover('b1spacer1');",200);
}*/

// bottom nav 2
/*function bottomNav2Mover(param) {
  clearTimeout(myTimer3);
  activeB2 = param;
  if (preactiveB2) changeImages(preactiveB2,imgurl+'common/spacer.gif');
  changeImages(activeB2,imgurl+'home/bottomnav/doublearrow.gif');  
  preactiveB2 = activeB2;
}*/

/*function bottomNav2Mout() {
  changeImages(activeB2,imgurl+'common/spacer.gif');
  myTimer3 = setTimeout("bottomNav2Mover('b2spacer1');",200);
}
*/
// grid
function gridOn(param) {
	showI = param;
	if (preshowI) toggleVisibility(preshowI,'hidden',showI,'visible');
	else toggleVisibility(showI,'visible');
	preshowI = showI;
}

function gridOff() {
	if (preshowI) toggleVisibility(preshowI,'hidden');
}

function startNews() {
    toggleVisibility('NewsTicker0Item'+seed,'visible');
    preSeed = seed;
    if (seed == newsItemA) seed = 0;
    else seed = seed + 1;
    setTimeout('rotateNews()',5000);
}

function rotateNews() {
  toggleVisibility('NewsTicker0Item'+preSeed,'hidden','NewsTicker0Item'+seed,'visible');
  startNews();
}
//
<!--
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_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];}}
}

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];}
}
//-->
function ChangeDisplay() { //v3.0
	var id = arguments[0];
	if (document.getElementById(id).style.display =='none')  
		document.getElementById(id).style.display ='list-item'; 
	else document.getElementById(id).style.display = 'none';
}
