

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];}}
}
/*......................
	The following function creates the first sub-menu layer. The first number is the width and the second the height of each
	cell of the table formed for the hyperlink items in the sub-menu.
........*/
function fwLoadMenus() {
  if (window.fw_menu_0) return;
//Not used
  window.fw_menu_0 = new Menu("root",210,18,"Verdana, Arial, Helvetica, sans-serif",11,"#000099","#000099","#99cccc","#FFFECB");
   	fw_menu_0.fontWeight="bold";
   	fw_menu_0.hideOnMouseOut=true;

//This is the submenu for the Site Map   
  window.fw_menu_1 = new Menu("root",150,18,"Verdana, Arial, Helvetica, sans-serif",11,"#000099","#000099","#99cccc","#FFFECB");
  	fw_menu_1.addMenuItem("Home","location='index.html'");
	fw_menu_1.addMenuItem("Search","location='search.html'");
  	fw_menu_1.addMenuItem("About Us","location='about.htm'");
 	fw_menu_1.addMenuItem("Our Products","location='products.htm'");
  	fw_menu_1.addMenuItem("Custom Synthesis","location='custom.htm'");
  	fw_menu_1.addMenuItem("Contact Us","contactus.htm'");
    	fw_menu_1.fontWeight="bold"; 
   	fw_menu_1.hideOnMouseOut=true;

//This is the submenu for the Natural Products   
  window.fw_menu_2 = new Menu("root",230,18,"Verdana, Arial, Helvetica, sans-serif",11,"#000099","#000099","#99cccc","#FFFECB");
    	fw_menu_2.addMenuItem("Chlorobutanol","location='clbutanol.html'");
	fw_menu_2.addMenuItem("Pharmaceutical Intermediates","location='intermed.htm'");
	fw_menu_2.addMenuItem("Herbal Products","location='herbals.htm'");
	fw_menu_2.addMenuItem("Flavors & Fragrances","location='flavors.htm'");
	fw_menu_2.addMenuItem("Vitamins","location='vitamins.htm'");
	fw_menu_2.addMenuItem("Amino Acids","location='aminos.htm'");
	fw_menu_2.addMenuItem("Bulk Actives","location='bulks.htm'");
	fw_menu_2.addMenuItem("Nutraceuticals","location='nutraceuticals.htm'");
	fw_menu_2.addMenuItem("Food Ingredients","location='foods.htm'");
	fw_menu_2.addMenuItem("Specialty Packaging","location='packages.htm'");
	fw_menu_2.addMenuItem("Chirals/Rare Molecules","location='chirals.htm'");
	fw_menu_2.addMenuItem("Fine Chemicals","location='finechem.htm'");
	fw_menu_2.addMenuItem("Molecular Structures","location='molecules.htm'");
	fw_menu_2.fontWeight="bold"; 
   	fw_menu_2.hideOnMouseOut=true;
//menu3 is not used 
  window.fw_menu_3 = new Menu("root",300,18,"Verdana, Arial, Helvetica, sans-serif",11,"#000099","#000099","#99cccc","#FFFECB");
  	fw_menu_3.addMenuItem("Pharmaceutical Intermediates","location='intermed.htm'");
  	fw_menu_3.addMenuItem("Natural Products Derivatives","location='nutri.htm'");
  	fw_menu_3.addMenuItem("Pharmaceutical Bulk Actives","location='pharma.htm'");
   	fw_menu_3.fontWeight="bold"; 
   	fw_menu_3.hideOnMouseOut=true;

//This is the submenu for the email form
  window.fw_menu_4 = new Menu("root",125,18,"Verdana, Arial, Helvetica, sans-serif",11,"#000099","#000099","#99cccc","#FFFECB");
  	fw_menu_4.addMenuItem("eMail Form","location='email.htm'");
     	fw_menu_4.fontWeight="bold"; 
   	fw_menu_4.hideOnMouseOut=true;
           
  fw_menu_4.writeMenus();
} // fwLoadMenus()
   
if (navigator.appName == "Microsoft Internet Explorer") {
  		  document.write('<link rel="stylesheet" href="/dwd/css/version_1_exp.css">');
 		 } 
 		 else {
		  document.write('<link rel="stylesheet" href="/dwd/css/version_1_net.css">');

   
}
// these three following functions are to operate the rollover buttons
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
	// This function loads the rollover buttons needed
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
	backbtn_01_over = newImage("images/backbtn_01-over.gif");
		backbtn_01_click = newImage("images/backbtn_01-click.gif");
		backbtn_01_down = newImage("images/backbtn_01-down.gif");
	fwrdbtn_01_down = newImage("images/fwrdbtn_01-down.gif");
		fwrdbtn_01_over = newImage("images/fwrdbtn_01-over.gif");
		fwrdbtn_01_click = newImage("images/fwrdbtn_01-click.gif");
	topbtn_01_down = newImage("images/topbtn_01-down.gif");
		topbtn_01_over = newImage("images/topbtn_01-over.gif");
		topbtn_01_click = newImage("images/topbtn_01-click.gif");
	preloadFlag = true;
	}
}
// This function handles the forward and back buttons
function process(item){
	var isIE = new Boolean(navigator.userAgent.indexOf("MSIE") != -1);
	switch(item){
	case "forward":
		if(isIE){
			history.forward();
		}else{
			window.forward();
		}
		break;
	case "print":
		window.print();
		break;
	case "back":
		if(isIE){
			history.back();
		}else{
			window.back();
		}
		break;
	}
}
		
