// scripts

// all graphics and javascript by steve dimond

if (document.images) {
	var List    = "but_home,but_apabc,but_aggregate,but_education,but_members,but_contact,but_links,but_news";
	var ImgDn = new Array();
	var ImgUp = new Array();
	var imgArray    = new Array();
	var imgArray    = List.split(",");
	var lenloc = location.pathname.length; //index.html is base ... all others in sub dirs, therefore if >10, add sub dir
	var pref  = "../";
	if (location.pathname.indexOf(".ca/index.html") != -1) { pref = "" ;}  //
	for (var i = 1; i <= imgArray.length; i++) {
		ImgDn[i] = new Image();
		ImgUp[i] = new Image();
		ImgDn[i].src = "" + pref + "images/" + imgArray[i-1] + ".gif";
		ImgUp[i].src = "" + pref + "images/" + imgArray[i-1] + "_o.gif";
	}
	var wwwimg = new Image();
	wwwimg.src = "images/wwwgravelbcca.gif";
	var ww = location.host;

}
function Show(img,which){
	if (document.images) {
		var imgStr   = 'document.'+img + '.src = ImgUp['+which+'].src';
		eval(imgStr);
	}
}
function Hide(img,which){
	if (document.images) {
		var imgStr   = 'document.'+img + '.src = ImgDn['+which+'].src';
		var targimg  = eval(imgStr);
	}
}

function showdate() {
	var thisdate=(new Date());
	var thisYear  = thisdate.getYear();
	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 footerlinks() {
	var passedlinks = "" +
		'<A HREF="../firm/"><STRONG>The Firm</STRONG></A>' + 
		'<IMG SRC="../images/feather.gif" ALT="-*-" WIDTH="40" HEIGHT="31" HSPACE="2" VSPACE="2" ALIGN=BOTTOM>' + 
		'<A HREF="../services"><STRONG>Services</STRONG></A>' + 
		'<IMG SRC="../images/feather.gif" ALT="-*-" WIDTH="40" HEIGHT="31" HSPACE="2" VSPACE="2" ALIGN=BOTTOM>' + 
		'<A HREF="../contact"><STRONG>Contact Us</STRONG></A><BR>' + 
		'<A HREF="../links/"><STRONG>Links of Interest</STRONG></A>' + 
		'<IMG SRC="../images/feather.gif" ALT="-*-" WIDTH="40" HEIGHT="31" HSPACE="2" VSPACE="2" ALIGN=MIDDLE>' + 
		'<A HREF="../taxtips"><STRONG>Tax Tips</STRONG></A>' + 
		'<IMG SRC="../images/feather.gif" ALT="-*-" WIDTH="40" HEIGHT="31" HSPACE="2" VSPACE="2" ALIGN=MIDDLE>' + 
		'<A HREF="../contact"><STRONG>Glossary</STRONG></A><BR>' + 
		'<STRONG>A.H.Senae Inc., Certified General Accountant</STRONG><BR>' + 
		'33221 Whidden Ave., Mission, British Columbia, Canada, V2V 2T3<BR>' + 
		'Tel: <STRONG>604-826-8060</STRONG> &nbsp; &nbsp; &nbsp; Fax: 604-826-4091 &nbsp; &nbsp; &nbsp;<STRONG>www.senae.com</STRONG><BR>' ;
	return (passedlinks);
}





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) {
    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);

function menuLayers() {
	 var g,b,k,f,args=menuLayers.arguments;
//	 alert("args0="+args[0]+"  args1="+args[1]+"  args2="+args[2])
//	 alert("g="+g+"   b="+b+"  k="+k+"  f="+f)
	 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";
	  }
	 }
	 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];}
	  }
	 }
}
