// JavaScript Document

// MENU for MK Digital Direct Website (www.mkdigitaldirect.com)
// Created by Jaime Nacach, September 2007. www.myedeisgner.com								


// MENU CONFIGURATION 

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for LED LIGHTING products
var incounter=new Array()
incounter[0]='<a href="/products/jewelry-led-lighting-products.html#incounter"><span style="color:black; font-weight:bold;">SparkleLite&trade; In-Counter LEDs</span></a><br />'
incounter[1]='<a href="/products/led-lighting/iclex-led-showcase-lighting-jewelry-stores.html"><img src="/images/led-lights/main/thumbs-incounter-iclex.png" width="80" height="60" /><br />Model: ICLEX</a>'
incounter[2]='<a href="/products/led-lighting/vertical_jewelry-led-counter-showcase-lighting.html"><span style="color: red">Brand New!</span><br><img src="/images/led-lights/main/thumbs-incounter-VICLEX.png" width="80" height="60" /><br />Model: VICLEX</a>'
incounter[3]='<a href="/products/led-lighting/fsh3w_jewelry-led-in-counter-lighting-natural-daylight.html"><img src="/images/led-lights/main/thumbs-incounter-FSH3W.png" width="60" height="60" /><br />Model: FSH3W</a>'
incounter[4]='<a href="/products/led-lighting/tsh1w_jewelry-led-in-counter-lighting-natural-daylight.html"><img src="/images/led-lights/main/thumbs-incounter-TSH1W.png" width="80" height="60" /><br />Model: TSH1W</a>'

var countertop=new Array()
countertop[0]='<a href="/products/jewelry-led-lighting-products.html#countertop"><span style="color:black; font-weight:bold;">SparkleLite&trade; Counter-Top  LED Lights</span> (Full product details)</a><br />'
countertop[1]='<a href="/products/led-lighting/diamond-led-light-flexible-goosneck-workbench.html"><img src="/images/led-lights/main/thumbs-counter-fgdl-iclex.png" width="80" height="60" /><br />LED Desk Light</a>'
countertop[2]='<a href="/products/led-lighting/Mini-Lite-350-2_jewelry-led-counter-light-natural-daylight.html"><img src="/images/led-lights/main/thumbs-counter-minilite350.png" width="80" height="60" /><br />MiniLite 350-2</a>'
countertop[3]='<a href="/products/led-lighting/Mini-Lite-ml-700_jewelry-led-counter-light-natural-daylight.html"><img src="/images/led-lights/main/thumbs-counter-minilite700.png" width="85" height="60" /><br />MiniLite ML-700</a>'
countertop[4]='<a href="/products/led-lighting/65bg-jewelry-led-counter-light-natural-daylight.html"><div id="productdiv" class="padding-rl1em"><img src="/images/led-lights/main/thumbs-counter-65bg.png" width="80" height="60" /><br />65BG</a>'
countertop[5]='<a href="/products/led-lighting/1exbg-jewelry-led-counter-light-natural-daylight.html"><img src="/images/led-lights/main/thumbs-counter-1exbg2.png" width="59" height="60" /><br />1EXBG</a>'
countertop[6]='<a href="/products/led-lighting/65exl-jewelry-led-counter-light-natural-daylight.html"><img src="/images/led-lights/main/thumbs-counter-65EXL.png" width="80" height="60" /><br />65EXL</a>'
countertop[7]='<a href="/products/led-lighting/1acs-jewelry-led-counter-light-natural-daylight.html"><img src="/images/led-lights/main/thumbs-counter-1acs.png" width="80" height="60" /><br />1ACS</a>'

var ceiling=new Array()
ceiling[0]='<a href="/products/jewelry-led-lighting-products.html#overhead"><span style="color:black; font-weight:bold;">SparkleLite&trade; Overhead LED Lights</span> (Full product details)</a><br />'
ceiling[1]='<a href="/products/led-lighting/above-counter-jewelry-stores-led-natural-daylight.html"><div id="productdiv" class="padding-rl1em"><img src="/images/led-lights/main/thumbs-ceiling-ocl.png" width="100" height="60" /><br />Overhead LEDs</a>'
ceiling[2]='<a href="/products/led-lighting/mr16-jewelry-led-ceiling-lighting-natural-daylight.html"><img src="/images/led-lights/main/thumbs-ceiling-mr16.png" width="66" height="60" /><br />MR-16</a>'
ceiling[3]='<a href="/products/led-lighting/par30-jewelry-led-ceiling-lighting-natural-daylight.html"><img src="/images/led-lights/main/thumbs-ceiling-par30.png" width="61" height="60" /><br />PAR-30</a>'
ceiling[4]='<a href="/products/led-lighting/par38-jewelry-led-ceiling-lighting-natural-daylight.html"><img src="/images/led-lights/main/thumbs-ceiling-par38.png" width="66" height="60" /><br />PAR-38</a>'


var handheld=new Array()
handheld[0]='<a href="/products/jewelry-led-lighting-products.html#handheld"><span style="color:black; font-weight:bold;">SparkleLite&trade; Hand-held LED Lights</span> (Full product details)</a><br />'
handheld[1]='<a href="/products/led-lighting/1lpl-jewelry-led-light-keychain-handheld-natural-daylight-lighting.html"><img src="/images/led-lights/main/thumbs-handheld-1lpl.png" width="80" height="60" /><br />1LPL</a>'
handheld[2]='<a href="/products/led-lighting/3wlpl-jewelry-led-light-handheld-natural-daylight-lighting.html"><img src="/images/led-lights/main/thumbs-handheld-3wlpl.png" width="80" height="60" /><br />3WLPL</a>'
handheld[3]='<a href="/products/led-lighting/5lpl-jewelry-led-light-handheld-natural-daylight-lighting.html"><img src="/images/led-lights/main/thumbs-handheld-5lpl.png" width="80" height="60" /><br />5LPL</a>'
handheld[4]='<a href="/products/led-lighting/hirl-gemstone-crack-detection-jewelry-led-light-transmission-refraction.html"><img src="/images/led-lights/main/thumbs-handheld-hirl.png" width="80" height="60" /><br />HIRL</a>'
handheld[5]='<a href="/products/led-lighting/rurl-warming-light-rubies-emeralds-opals-gold-jewelry-led-handheld-lighting.html"><img src="/images/led-lights/main/thumbs-handheld-rurl.png" width="80" height="60" /><br />RURL</a>'
handheld[6]='<a href="/products/led-lighting/uvpl3-uv-light-handheld-jewelry-led-lighting.html"><img src="/images/led-lights/main/thumbs-handheld-uvpl3.png" width="110" height="60" /><br />UVPL3</a>'

var menuwidth='165px' //default menu width
var menubgcolor='white'  //menu bgcolor
var disappeardelay=50  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var strRoot="http://www.mkdigitaldirect.com"

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv2" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu2(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv2") : dropmenudiv2
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
