// all graphics and javascript by steve dimond
// visit www.Arthon.com

// ************************************************************************
// ************************************************************************

var picchoice = rand(6)-1;

if (document.images) {
	var List    = "company,products,projects,equipment,contact,library,links";
	var ImgDn = new Array();
	var ImgUp = new Array();
	var imgArray    = new Array();
	var imgArray    = List.split(",");
	for (var i = 1; i <= imgArray.length; i++) {
		ImgDn[i] = new Image();
		ImgUp[i] = new Image();
		ImgDn[i].src = "images/buttons/butt_" + imgArray[i-1] + ".gif";
		ImgUp[i].src = "images/buttons/butt_o_" + imgArray[i-1] + ".gif";
	}

}


function rnd() {
		rnd.today=new Date();
		rnd.seed=rnd.today.getTime();
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function showdate() {
	var thisdate  = new Date();
	var thisYear  = thisdate.getYear() ;
	if (thisYear < 1000) {thisYear +=  1900;}
	var thisMonth = 1 + thisdate.getMonth();
	var thisDay   = thisdate.getDate();
	var thisHour  = thisdate.getHours();
	var thisMin   = thisdate.getMinutes();
	var months = new makeArray('January','February','March',
		'April','May','June','July','August','September',
		'October','November','December');
	
	document.write(months[thisMonth]+" "+thisDay+", "+thisYear+"<BR>");
}

function makeArray() {
     for (i = 0; i<makeArray.arguments.length; i++)
          this[i + 1] = makeArray.arguments[i];
}

function rand(number) {
        return Math.ceil(rnd()*number);
};


// Links at the base of the page.
// Placed here for ease of changing universally

function textlinks() {
	var passedlinks = '<IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="company/index.html"> Company </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="projects/index.html"> Projects </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="/"> HOME </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE"><BR>'+
''+
		'<IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="equipment/index.html"> Equipment </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="contact/index.html"> Contact </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="library/index.html"> Library </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE">'+
		'<A HREF="links/index.html"> Links </A> <IMG SRC="images/bullet_stockpile.gif" ALT="*" WIDTH="39" HEIGHT="22" HSPACE="0" BORDER="0" ALIGN="MIDDLE"><BR>';
	return (passedlinks);
}


// Links at the base of the page.

function popWin(name,width,height,address) { 
	winoptions='"toolbar=no,status=yes,location=no,menubar=no,height='+height+',width='+width+'"';
	MessageWin = window.open(address,name,winoptions);
	MessageWin.focus()
}

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_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
//		alert(appName);
//		alert(navigator);
//		alert(appVersion);
		
		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);

var menuLayers = {
  timer: null,
  activeMenuID: null,
  offX: 4,   // horizontal offset 
  offY: 6,   // vertical offset 
  
  show: function(id, e) {
    var mnu = document.getElementById? document.getElementById(id): null;
   if (!mnu) return;
    this.activeMenuID = id;
    this.timer = setTimeout("document.getElementById('" + menuLayers.activeMenuID + "').style.visibility = 'visible'", 200);
    if ( mnu.onmouseout == null ) mnu.onmouseout = this.mouseoutCheck;
    if ( mnu.onmouseover == null ) mnu.onmouseover = this.clearTimer;
  },

  hide: function() {
    this.clearTimer();
    if (this.activeMenuID && document.getElementById) 
      this.timer = setTimeout("document.getElementById('"+menuLayers.activeMenuID+"').style.visibility = 'hidden'", 200);
  },
  
  mouseoutCheck: function(e) {
    e = e? e: window.event;
    // is element moused into contained by menu? or is it menu (ul or li or a to menu div)?
    var mnu = document.getElementById(menuLayers.activeMenuID);
    var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
    if ( mnu != toEl && !menuLayers.contained(toEl, mnu) ) menuLayers.hide();
  },
  
  // returns true of oNode is contained by oCont (container)
  contained: function(oNode, oCont) {
    if (!oNode) return; // in case alt-tab away while hovering (prevent error)
    while ( oNode = oNode.parentNode ) 
      if ( oNode == oCont ) return true;
    return false;
  },

  clearTimer: function() {
    if (menuLayers.timer) clearTimeout(menuLayers.timer);
  }
  
}

function menuLayers2() {
	var g,b,k,f,args=menuLayers.arguments;
	var a = parseInt(args[0]);
	if(isNaN(a)){a=0};
	if(!document.menusetc) {
	 	menuc=new Array();
	 	document.menusetc=true;
	  	for (var u=0;u<10;u++) {menuc[u] = new Array();}
	 }
	for(k=0; k<menuc[a].length; k++) {
		if((g=MM_findObj(menuc[a][k]))!=null) {
	   		b=(document.layers)?g:g.style;b.visibility="hidden";
//		 	alert("1.  b="+b)
	  	}
	 }
	for(k=1; k<args.length; k++) {
		if((g=MM_findObj(args[k])) != null) {
			b=(document.layers)?g:g.style;b.visibility="visible";
			f=false;
			for(j=0;j<menuc[a].length;j++) {
				if(args[k]==menuc[a][j]) {f=true;}
	   		}
			if(!f) {
				menuc[a][menuc[a].length++]=args[k];
			}
	  	}
	 }
}



// this is for MAIN MENU area ... DIVisions are set up for each drop down menu area.  Initially, hidden.
// this is for MAIN MENU area ... DIVisions are set up for each drop down menu area.  Initially, hidden.
// this is for MAIN MENU area ... DIVisions are set up for each drop down menu area.  Initially, hidden.

function divSections() {
	var passeddivs = 

'<DIV CLASS="menu" ID="company" STYLE="position: absolute; left: 30px; top: 102px; width: 120px; height: 100px; visibility: hidden; z-index:100;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0" BORDER="0">'
+'	<TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="company/index.html"><IMG SRC="images/buttons/butt_o_company.gif" BORDER="0" WIDTH="100" HEIGHT="27"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP>'
+'        &bull; <A HREF="company/index.html">Who We Are</A><BR>'
+'        &bull; <A HREF="company/where.html">Where We Are</A><BR>'
+'        &bull; <A HREF="company/positions_open.html">Positions: Jobs Available</A><BR>'
+'        &bull; <A HREF="company/arthon_mission_statement.html">Mission Statement</A><BR>'
+'        &bull; <A HREF="company/arthon_safety_policy.html">Safety Policy</A><BR>'
+'       </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead"><STRONG>Company Links</STRONG></TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<DIV CLASS="menu" ID="projects" STYLE="position: absolute; left: 130px; top: 102px; width: 120px; height: 100px; visibility: hidden; z-index:102;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0">'
+'    <TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="projects/index.html"><IMG SRC="images/buttons/butt_o_projects.gif" ALT="Project Information " NAME="menu_projects" WIDTH="100" HEIGHT="27" BORDER="0" ALIGN="middle"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP>&nbsp; &nbsp; Products available ...<BR>'
+'        &bull; <A HREF="projects/kelowna/index.html">Kelowna Rock Quarry</A><HR>&nbsp; &nbsp; Projects ...<BR>'
+'        &bull; <A HREF="projects/revelstoke/index.html">Clanwilliam, Revelstoke</A><BR>'
+'        &bull; <A HREF="projects/baileyroad/index.html">Bailey Road, Vernon</A><BR>'
+'        &bull; <A HREF="projects/summerland/index.html">Hwy 97 Summerland</A><BR>'
+'        &bull; <A HREF="projects/theponds/index.html">The Ponds</A><BR>'
+'        &bull; <A HREF="projects/ubco/index.html">UBC Okanagan Flyover</A><BR>'
+'        &bull; <A HREF="projects/mission/index.html">Cascade Ridge - Mission BC</A><BR>'
+'        &bull; <A HREF="projects/banff/blast.html">Blast/Haul - Lake Louise</A><BR>'
+'        &bull; <A HREF="projects/banff/index.html">Banff TCH Twinning</A><BR>'
+'        &bull; <A HREF="projects/okbridge/index.html">Westside Road - OK Bridge</A><BR>'
+'        &bull; <A HREF="projects/index.html">Arthon Project List</A><BR>'
+'        &bull; <A HREF="projects/bellacoola/index.html">Bella Coola Rock Quarry</A><BR>'
+'        &bull; <A HREF="projects/cranbrook/index.html">Cranbrook Hwy 3/93</A><BR>'
+'        &bull; <A HREF="projects/gvrd/index.html">GVRD Aggregates</A><BR>'
+'        &bull; <A HREF="projects/kitimat/index.html">Kitimat Sand Pit</A><BR>'
+'        &bull; <A HREF="projects/salmonarm/index.html">Salmon Arm Sand Pit</A><BR>' 
+'        &bull; <A HREF="projects/seatosky/index.html">Sea to Sky - Whistler Hwy</A><BR>'
+'        </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead">Arthon\'s Projects</TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<DIV CLASS="menu" ID="equipment" STYLE="position: absolute; left: 230px; top: 102px; width: 120px; height: 100px; visibility: hidden; z-index:103;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0">'
+'    <TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="equipment/index.html"><IMG SRC="images/buttons/butt_o_equipment.gif" ALT="Arthon Equipment - Tools of the Trade" NAME="menu_equipment" WIDTH="100" HEIGHT="27" BORDER="0" ALIGN="middle"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP>'
+'          &bull; <A HREF="equipment/index.html">Arthon Equipment</A><BR>'
+'          &bull; <A HREF="equipment/Caterpillar_D10_FOR_RENT.html">D10 Dozer - Equipment for Rent<BR>'
+'       </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead">Equipment Links</TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<DIV CLASS="menu" ID="contact" STYLE="position: absolute; left: 330px; top: 102px; width: 120px; height: 100px; visibility: hidden; z-index:104;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0">'
+'    <TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="contact/index.html"><IMG SRC="images/buttons/butt_o_contact.gif" ALT="Arthon contact - Reach Us" NAME="menu_contact" WIDTH="100" HEIGHT="27" BORDER="0" ALIGN="middle"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP><A HREF="contact/index.html">Contact Arthon</A>'
+'       </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead">Arthon contact</TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<DIV CLASS="menu" ID="library" STYLE="position: absolute; left: 430px; top: 102px; width: 120px; height: 300px; visibility: hidden; z-index:105;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0">'
+'    <TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="library/index.html"><IMG SRC="images/buttons/butt_o_library.gif" ALT="Arthon library - Calculators and Information" NAME="menu_library" WIDTH="100" HEIGHT="27" BORDER="0" ALIGN="middle"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP><FONT SIZE="-1">'
+'          &bull; <A HREF="library/index.html"><STRONG>Library INDEX</STRONG></A><BR>'
+'          &bull; <A HREF="glossary/index.html"><STRONG>Glossary of TERMS</STRONG></A><BR>'
+'          &bull; <A HREF="library/sandgravel.html">Sand & Gravel in BC</A><BR>'
+'          &bull; <A HREF="library/whataggregatesare.html">What Aggregates Are </A><BR>'
+'          &bull; <A HREF="library/sincethedawn.html">Since the Dawn of Time </A><BR>'
+'          &bull; <A HREF="library/formfoundation.html">Aggregates Form the Foundation </A><BR>'
+'          &bull; Aggregate Companies <A HREF="library/forgingenvironmental.html">Forging Environmental Solutions</A><BR>'
+'          &bull; <A HREF="library/didyouknow.html">Did You Know ?</A><BR>'
+'          &bull; <A HREF="library/production_canada.html">Sand, Gravel, and Stone Production</A><BR>'
+'          &bull; <A HREF="library/aggin_canada.html">Aggregates in Canade</A><BR>'
+'          &bull; <A HREF="library/aggregateFAQ.html">Aggregate FAQ</A><BR>'
+'          &bull; <A HREF="library/soilclassification.html">Soil Classification</A><BR>'
+'          &bull; <A HREF="library/angleofrepose.html">Angle of Repose</A><BR>'
+'          &bull; <A HREF="library/wwwcredits.html">Web Site Credits</A><BR></FONT>'
+'       </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead">Library &amp; Reference</TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<DIV CLASS="menu" ID="calculate" STYLE="position: absolute; left: 530px; top: 102px; width: 120px; height: 300px; visibility: hidden; z-index:105;"> '
+'  <TABLE WIDTH="120" BORDER="0" CELLSPACING="0" CELLPADDING="0">'
+'    <TR><TD HEIGHT="27" VALIGN="top" WIDTH="100" ALIGN="LEFT"><A HREF="calculators/index.html"><IMG SRC="images/buttons/butt_o_calculate.gif" ALT="Arthon library - Calculators and Information" NAME="menu_calculate" WIDTH="100" HEIGHT="27" BORDER="0" ALIGN="middle"></A></TD></TR>'
+'  </TABLE><TABLE WIDTH="120" BORDER="1" CELLSPACING="0" CELLPADDING="4" BGCOLOR="#99CCCC" BORDERCOLOR="#000066">'
+'    <TR><TD VALIGN="top" NOWRAP>'
+'          &bull; <STRONG>Calculators ---------------------------------------</STRONG><BR>'
+'          &bull; <A HREF="calculators/aggweight.shtml">Aggregate Weights</A><BR>'
+'          &bull; <A HREF="calculators/barrel.shtml">Barrel</A><BR>'
+'          &bull; <A HREF="calculators/calc_tankonside.shtml">Tank on Side</A><BR>'
+'          &bull; <A HREF="calculators/pipeweights.shtml">Pipe Weights</A><BR>'
+'          &bull; <A HREF="calculators/pyramidlong.shtml">Pyramid Volumes</A><BR>'
+'          &bull; <A HREF="calculators/sphere_volume.shtml">Sphere Volumes</A><BR>'
//+'          &bull; <A HREF="calculators/stacker.shtml">Stacker Volumes</A><BR>'
+'          &bull; <A HREF="calculators/stockpile.shtml">Stockpile Volumes</A><BR>'
+'       </TD></TR>'
+'    <TR><TD BGCOLOR="#90A4B4" CLASS="menuhead">Industry Calculators </TD></TR>'
+'  </TABLE>'
+'</DIV>'
+''
+'<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BACKGROUND="images/bg_top.gif">'
+'	<TR>'
+'		<TD ALIGN="left" WIDTH="220" VALIGN="TOP"><IMG SRC="images/header_granite.gif" WIDTH="212" HEIGHT="102" BORDER="0" ALIGN="top" ALT="Granite Corner" HSPACE="0" VSPACE="0"></TD>'
+'		<TD VALIGN="MIDDLE" ALIGN="CENTER"><A HREF="http://www.Arthon.com/" onMouseOver="document.titleimg.src = \'images/wwwarthoncom.gif\'" onMouseout = "document.titleimg.src=\'images/trans.gif\'">'
+' 		<IMG SRC="images/trans.gif" WIDTH="320" HEIGHT="97" BORDER="0" ALIGN="middle" ALT="Arthon Construction Ltd." HSPACE="2" NAME="titleimg" VSPACE="0"></A></TD>'
+'		<TD ALIGN="right" VALIGN="BOTTOM" WIDTH="220"><A HREF="http://www.Arthon.com/" onMouseOver="document.titleimg.src = \'images/wwwarthoncom.gif\'" onMouseout = "document.titleimg.src=\'images/trans.gif\'"><IMG SRC="images/arthon_logo.gif" WIDTH="244" HEIGHT="97" BORDER="0" ALIGN="bottom" ALT="www.Arthon.com" HSPACE="10" VSPACE="0"></A></TD>'
+'	</TR>'
+'	<TR HEIGHT="27">'
+'		<TD BACKGROUND="images/bg_menuline.gif" HEIGHT="27" COLSPAN=3 VALIGN=BOTTOM NOWRAP><IMG SRC="images/trans.gif" WIDTH="27" HEIGHT="27" BORDER="0" ALIGN="LEFT" ALT=""'
+'		><A HREF="company/index.html"   onMouseOver="menuLayers.show(\'company\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_company.gif"     ALT="Company" name="company"     WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="projects/index.html"  onMouseOver="menuLayers.show(\'projects\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_projects.gif"   ALT="Projects" name="projects"   WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="equipment/index.html" onMouseOver="menuLayers.show(\'equipment\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_equipment.gif" ALT="Equipment" name="equipment" WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="contact/index.html"   onMouseOver="menuLayers.show(\'contact\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_contact.gif"     ALT="contact" name="contact"     WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="library/index.html"   onMouseOver="menuLayers.show(\'library\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_library.gif"     ALT="Library" name="library"     WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="calculators/index.html" onMouseOver="menuLayers.show(\'calculate\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_calculate.gif" ALT="Calculate" name="calculate" WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A><A HREF="links/index.html"     onMouseOver="menuLayers.show(\'links\',event);" onmouseout="menuLayers.hide()"><IMG SRC="images/buttons/butt_links.gif"         ALT="Links" name="links"         WIDTH="100" HEIGHT="27" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="middle"'
+'	></A></TD>'
+'	</TR>'
+'</TABLE>';
	return (passeddivs);
}

// this is END of  MAIN MENU area ... 
// this is END of  MAIN MENU area ... 
// this is END of  MAIN MENU area ... 




//+'          &bull; <A HREF="equipment/aggprocessing.html">Arthon Aggregate Processing</A><BR>'
//+'          &bull; <A HREF="equipment/construction.html">Arhon Construction Equipment</A><BR>'
//+'          &bull; <A HREF="equipment/forsale.html">Arhon Equipment for Sale</A><BR>'

