/***********************************************
* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var defaultMenuWidth="200px" //set default menu width.

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<span class="popitmenuheader"><strong>Products & Services</strong></span>'
linkset[0]+='<hr>' //Optional Separator*/
linkset[0]+='<a href="products.php">Product Info</a>'
linkset[0]+='<a href="services.php">DCA Services</a>'
linkset[0]+='<a href="support.php">DCA Support</a>'
linkset[0]+='<a href="supplies.php">Supplies</a>'
linkset[0]+='<a href="aboutdca.php">About DCA</a>'

//linkset[1]='<a href="credit.php">Credit Application</a>'
//linkset[1]+='<a href="meter.php">Submit Meter Readings</a>'
var thislink = dynbutton("meters", "dcac", "biz", "Submit Meter Readings", "DCA Meter Reading", "* = Required Items%0A%0A Company: %0A*Contact Name: %0A*Contact Phone: %0A*Copier DCA Number: %0A Copier Model: %0A Copier Serial: %0A*Color Total (if applicable): %0A*Black %26 White Total: ")
linkset[1]='<a href="' + thislink + '">Submit Meter Readings<br>&nbsp;&nbsp;(opens email client)</a>'
linkset[1]+='<a href="supplyform.php" target="_blank">Submit Supply Request</a>'
linkset[1]+='<a href="requestonsite.php">Request Onsite Support</a>'
linkset[1]+='<a href="requestspt.php">Request A Callback</a>'
//linkset[1]+='<a href="emergency.php">Request Emergency Support</a>'

////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)" background="images/submenu_bg.jpg"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, which, startpos, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY

//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)

//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"

else

//position the horizontal position of the menu where the mouse was clicked

//    orig line --> menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
menuobj.style.left=ie5? "133px" : "133px"

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
//	orig line --> menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"

//menuobj.style.top=ie5?  startpos : window.pageYOffset+eventY+"px"
menuobj.style.top=ie5?  startpos : startpos

menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
	delayhide=setTimeout("hidemenu()",1000)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu

// all images preloaded
function preloader() 
{
     // counter     
	 var i = 0;
     // create object     
	 imageObj = new Image();
     // set image list     
	 images = new Array();     
	 images[0]="index_01.jpg";
	 images[1]="index_02.jpg";
	 images[2]="index_03.jpg";
	 images[3]="index_04.jpg";
	 images[4]="index_05.jpg";
	 images[5]="index_06.jpg";
	 images[6]="index_07.jpg";
	 images[7]="index_08.jpg";
	 images[8]="index_09.jpg";
	 images[9]="index_09_dn.jpg";
	 images[10]="index_09_short.jpg";
	 images[11]="index_09_up.jpg";
	 images[12]="index_10.jpg";
	 images[13]="index_11.jpg";
	 images[14]="index_12.jpg";
	 images[15]="index_12_bg.jpg";
	 images[16]="index_13.jpg";
	 images[17]="index_13_bg.jpg";
	 images[18]="index_14.jpg";
	 images[19]="index_14_topleft.jpg";
	 images[20]="index_16.jpg";
	 images[21]="index_17.jpg";
	 images[22]="index_19.jpg";
	 images[23]="index_20.jpg";
	 images[24]="index_21.jpg";
	 images[25]="index_22.jpg";
	 images[26]="index_23.jpg";
	 images[27]="index_24.jpg";
	 images[28]="index_25.jpg";
	 images[29]="index_26.jpg";
	 images[30]="index_27.jpg";
	 images[31]="index_28.jpg";
	 images[32]="index_29.jpg";
	 images[33]="index_30.jpg";
	 images[34]="index_31.jpg";
	 images[35]="index_32.jpg";
	 images[36]="index_33.jpg";
	 images[37]="btn1_dn_04.jpg";
	 images[38]="btn2_dn_05.jpg";
	 images[39]="btn3_dn_06.jpg";
	 images[40]="btn4_dn_07.jpg";
	 images[41]="btn5_dn_08.jpg";
	 images[42]="myfolderbanner.jpg";
	 images[43]="osa.jpg";
	 images[44]="OSA-EmailBanner.jpg";
	 images[45]="OSA-Email-Icon.gif";
	 images[46]="OSA-MyFolderBanner.jpg";
	 images[47]="OSA-MyFolder-Icon.jpg";
	 images[48]="prodserv_15.jpg";
	 images[49]="prodserv_dn_15.jpg";
	 images[50]="qb-mfp2.jpg";
	 images[51]="qb-mfp3.jpg";
	 images[52]="qb-mfp.jpg";
	 images[53]="sharpaip.jpg";
	 images[54]="spacer.gif";
	 images[55]="submenu_bg.jpg";
	 images[56]="tvpromo.gif";
	 images[57]="aip.gif";
	 images[58]="aquostv.jpg";
	 images[59]="cliserv_18.jpg";
	 images[60]="cliserv_dn_18.jpg";
	 images[61]="emailbanner.jpg";
     // start preloading     
	 for(i=0; i<=9; i++) {
		 imageObj.src="images/" + images[i];
	 }
} 
/**
 * Copyright (C) 2004, CodeHouse.com. All rights reserved.
 * CodeHouse(TM) is a registered trademark.
 *
 * THIS SOURCE CODE MAY BE USED FREELY PROVIDED THAT
 * IT IS NOT MODIFIED OR DISTRIBUTED, AND IT IS USED
 * ON A PUBLICLY ACCESSIBLE INTERNET WEB SITE.
 *
 * Script Name: E-mail Hider
 *
 * You can obtain this script at http://www.codehouse.com
 */
 
function dynaddr(name, domain, suffix, text, subj, bodytxt)
{
   var address = name + "\u0040" + domain + "." + suffix;
   var url = "mailto:" + address;
   if( subj ) { 
		url = url + "?subject=" + subj;
   } 
   if( bodytxt ) { 
		url = url + "&body=" + bodytxt;
   } 
   if( ! text )
   {
      text = address;
   }

   document.write("<a href=\"" + url + "\">" + text + "</a>");
}
function dynbutton(name, domain, suffix, text, subj, bodytxt)
{
   var address = name + "\u0040" + domain + "." + suffix;
   var url = "mailto:" + address;
   if( subj ) { 
		url = url + "?subject=" + subj;
   } 
   if( bodytxt ) { 
		url = url + "&body=" + bodytxt;
   } 
   if( ! text )
   {
      text = address;
   }

   return url;
}
