
var logos_timeout = 6000;
var pictures_timeout = 6000;

var center_images = new Array();

// AR, 11/8/07
// Firefox behaves more like IE, so to differentiate it from old Netscape browsers
var dom = (document.getElementById); //modern dom browsers
var iebrowser = document.all;

center_images[0]=["Picture1.gif", "", ""];
center_images[1]=["Picture2.gif", "", ""];
center_images[2]=["Picture3.gif", "", ""];
center_images[3]=["Picture4.gif", "", ""];

function index_onload() {
//MM_preloadImages('Picture1.gif','Picture2.gif','Picture3.gif','Picture4.gif');
  // AR, 8/5/04, removed the preloading of the GE logo
  // '/logos/ge_capital.gif',
  MM_preloadImages('/logos/S_lexis.gif','/logos/lexis.gif','/logos/pillsbury_logo.gif');
  //if (isIE) {
	setTimeout('rotate_logos()',logos_timeout);
	//setTimeout('rotate_pictures()',pictures_timeout);
	//}
}


function rotate_logos() {
  // we do not rotate for Netscape
  //if (isNav)
  //return;

  if ((iebrowser && dom) || dom)
	; // continue for Firefox and other modern browsers
  else
	return;

  // AR, 8/5/04, removed GE from the rotation
  // ["Logo1","GE_Text"]

  var a_cust = [ ["Logo2","Lexis_Text"], ["Logo3", "Pillsbury_Text"] ];
  var curr = 0;

  var obj0 = (iebrowser ? document.all[a_cust[0][0]] : document.getElementById(a_cust[0][0]));
  //alert("obj0: "+obj0);
  var obj1 = (iebrowser ? document.all[a_cust[1][0]] : document.getElementById(a_cust[1][0]));
  //alert("obj1: "+obj1);

  //alert("[0]: Name: "+obj0+" display: "+obj0.currentStyle.display+"<br>"+"[1]: Name: "+obj1+" display: "+obj1.currentStyle.display);

  for(var i=0;i<a_cust.length;i++){
	if(document.all[ a_cust[i][0] ] && document.all[ a_cust[i][0] ].currentStyle.display == "block")
	  curr = i;
  }
  var next = (curr + 1) % a_cust.length;
  for(var i=0;i<a_cust.length;i++){
	if(document.all[ a_cust[i][0] ]){
	  if(i==next){
		document.all[ a_cust[i][0] ].style.display = "block";
		document.all[ a_cust[i][0] ].style.visibility = "visible";
		document.all[ a_cust[i][1] ].style.display = "block";
		document.all[ a_cust[i][1] ].style.visibility = "visible";
	  }
	  else {
		document.all[ a_cust[i][0] ].style.display = "none";
		document.all[ a_cust[i][0] ].style.visibility = "hidden";
		document.all[ a_cust[i][1] ].style.display = "none";
		document.all[ a_cust[i][1] ].style.visibility = "hidden";
	  }
	}
  }

  setTimeout('rotate_logos()',logos_timeout);
}


function rotate_pictures() {
  // we do not rotate for Netscape
  if (isNav)
	return;

  var a_pics = [ "Picture1.gif",  "Picture2.gif",  "Picture3.gif",  "Picture4.gif" ];

  var curr = -1;
  for (var i = 0; i < a_pics.length; i ++) {
	  // If the picture name is in the src field that looks like:
	  //  http://www.opensourceinc.com/images/Picture3.gif
	  if (document.all.center_image.src.indexOf("/"+a_pics[i]) >= 0) {
		  curr = i;
		  break;
	  }
  }

  var next = (curr + 1) % a_pics.length;

  // fades out in 1 sec
  imageFadeOut(document.all.center_image);

  // so change the picture and fade in in 1000 msec
  setTimeout("document.all.center_image.src = '"+a_pics[next]+"';imageFadeIn(document.all.center_image);",1000);

  setTimeout('rotate_pictures()',pictures_timeout);

  return;
}

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;
}
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 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 fwLoadMenus() {
  if (window.fw_menu_0) return;

  window.fw_menu_0 = new Menu("root",250,19,"verdana,arial,helvetica",'12px',"#483478","black","#DCD8E9","#EEEAF6");
  fw_menu_0.addMenuItem("Overview","location='solutions.overview.phtml'");
  fw_menu_0.addMenuItem("Corporate Legal","location='old_solutions.legal_dept.phtml'");
  fw_menu_0.addMenuItem("Law Firms","location='old_solutions.law_firm.phtml'");
  fw_menu_0.addMenuItem("Legal Publishers","location='old_solutions.publish.phtml'");
  fw_menu_0.addMenuItem("How OpenSource is Different","location='old_solutions.different.phtml'");
  fw_menu_0.addMenuItem("Best Practices","location='old_solutions.best_practices.phtml'");
  fw_menu_0.addMenuItem("Do you need a Contract Solution?","location='old_solutions.whycm.phtml'");

  // AR, 10/16/07, the color of the box around the whole submenu
  fw_menu_0.menuBorderBgColor = "#DCD8E9";
  // AR, 10/16/07, the color of the separator between submenu options
  fw_menu_0.bgColor = "white"; // color underneath for the menu item seperator
  fw_menu_0.fontWeight = "bolder";
  fw_menu_0.hideOnMouseOut=true;

  window.fw_menu_1 = new Menu("root",250,19,"verdana,arial,helvetica",'12px',"#483478","black","#DCD8E9","#EEEAF6");
  fw_menu_1.addMenuItem("OpenSource <I>Contract Manager</I>","location='products.core.phtml'");
  fw_menu_1.addMenuItem("OpenSource <I>Sanitize</I>","location='old_products.sanitize.phtml'");
  fw_menu_1.addMenuItem("OpenSource <I>Clause Manager</I>","location='old_products.clause.phtml'");
  fw_menu_1.addMenuItem("OpenSource <I>Legal Publishing</I>","location='old_products.publish.phtml'");
  fw_menu_1.addMenuItem("OpenSource <I>NuCompare</I>","location='old_products.nucompare.phtml'");
  fw_menu_1.addMenuItem("What is On-demand?","location='old_products.on_demand.phtml'"); 
  fw_menu_1.addMenuItem("Security","location='old_products.security.phtml'");
  fw_menu_1.addMenuItem("Technology","location='old_products.technology.phtml'");

  // AR, 10/16/07, the color of the box around the whole submenu
  fw_menu_1.menuBorderBgColor = "#DCD8E9";
  // AR, 10/16/07, the color of the separator between submenu options
  fw_menu_1.bgColor = "white"; // color underneath for the menu item seperator
  fw_menu_1.fontWeight = "bolder";
  fw_menu_1.hideOnMouseOut=true;

  window.fw_menu_2 = new Menu("root",150,19,"verdana,arial,helvetica",'12px',"#483478","black","#DCD8E9","#EEEAF6");
  fw_menu_2.addMenuItem("Customers","location='old_customers.phtml'");
  fw_menu_2.addMenuItem("Success Stories","location='old_testimonials.phtml'");

  // AR, 10/16/07, the color of the box around the whole submenu
  fw_menu_2.menuBorderBgColor = "#DCD8E9";
  // AR, 10/16/07, the color of the separator between submenu options
  fw_menu_2.bgColor = "white"; // color underneath for the menu item seperator
  fw_menu_2.fontWeight = "bolder";
  fw_menu_2.hideOnMouseOut=true;

  window.fw_menu_3 = new Menu("root",180,19,"verdana,arial,helvetica",'12px',"#483478","black","#DCD8E9","#EEEAF6");
  fw_menu_3.addMenuItem("About OpenSource","location='old_about.phtml'");

  fw_menu_3.addMenuItem("Free Trial Registration","location='register.phtml'");
  fw_menu_3.addMenuItem("Login","location='/nh.html'");
  fw_menu_3.addMenuItem("See a Demo","location='register.phtml'");

  fw_menu_3.addMenuItem("Partners","location='old_partners.phtml'");
  fw_menu_3.addMenuItem("Management","location='old_management.phtml'");
  fw_menu_3.addMenuItem("News Archive","location='News_Archive.phtml'");
  fw_menu_3.addMenuItem("Contact us","location='contact.phtml'");

  // AR, 10/16/07, the color of the box around the whole submenu
  fw_menu_3.menuBorderBgColor = "#DCD8E9";
  // AR, 10/16/07, the color of the separator between submenu options
  fw_menu_3.bgColor = "white"; // color underneath for the menu item seperator
  fw_menu_3.fontWeight = "bolder";
  fw_menu_3.hideOnMouseOut=true;

  // outputs all the menu
  fw_menu_3.writeMenus();

} // fwLoadMenus()
