/***********************************************
* AnyLink Drop Down cartmenu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for cartmenu 1
var cartmenu1=new Array()
	
var cartmenuwidth='400px' //default cartmenu width
var cartmenubgcolor='white'  //menu bgcolor
var cartdisappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var carthidecartmenu_onclick="yes" //hide cartmenu when user clicks within cartmenu?

/////No further editting needed

var ie4=document.all
var ie5_5=typeof dropmenuiframe=='undefined'? 0 : 1
var ns6=document.getElementById&&!document.all

if (ie4||ie5_5||ns6)
document.write('<div id="cartdiv" style="z-index:100;visibility:hidden;width:'+cartmenuwidth+';background-color:'+cartmenubgcolor+'" onMouseover="clearhidecartmenu()" onMouseout="dynamiccarthide(event)"></div>')

function cartgetposOffset(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 cartshowhide(obj, e, visible, hidden, cartmenuwidth){
if (ie4||ie5_5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top='-500px'
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=cartmenuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
obj.visibility=visible
unhidecartIframe() }
else if (e.type=="click") {
setTimeout("hidecartIframe();",0);
obj.visibility=hidden
}
}


function cartiecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function cartclearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? cartiecompattest().scrollLeft+cartiecompattest().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? cartiecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? cartiecompattest().scrollTop+cartiecompattest().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 cartpopulatemenu(what){
if (ie4||ie5_5||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropcart(obj, e, cartmenucontents, cartmenuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidecartmenu()
dropmenuobj=document.getElementById? document.getElementById("cartdiv") : cartdiv
cartpopulatemenu(cartmenucontents)

if (ie4||ie5_5||ns6){
cartshowhide(dropmenuobj.style, e, "visible", "hidden", cartmenuwidth)
dropmenuobj.x=cartgetposOffset(obj, "left")
dropmenuobj.y=cartgetposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-cartclearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-cartclearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
unhidecartIframe()
}

return cartclickreturnvalue()
}

function cartclickreturnvalue(){
if (ie4||ie5_5||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamiccarthide(e){
if ((ie4||ie5_5)&&!dropmenuobj.contains(e.toElement))
delayhidecartmenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidecartmenu()
}

function hidecartmenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ie5_5||ns6)
dropmenuobj.style.visibility="hidden"
hidecartIframe()
}
}

function delayhidecartmenu(){
if (ie4||ie5_5||ns6)
delayhidecart=setTimeout("hidecartmenu()",cartdisappeardelay)
}

function clearhidecartmenu(){


if (typeof delayhidecart!="undefined")
clearTimeout(delayhidecart)
}

if (carthidecartmenu_onclick=="yes") {
document.onclick=delayhidecartmenu
}

// Hide IFrame
function hidecartIframe() {

if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
theIframe.style.display = "none";
}
}

// Unhide IFrame
function unhidecartIframe() {
if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
var theDiv = document.getElementById("cartdiv");
theIframe.style.width = theDiv.offsetWidth+'px';
theIframe.style.height = theDiv.offsetHeight+'px';
theIframe.style.top = theDiv.offsetTop+'px';
theIframe.style.left = theDiv.offsetLeft+'px';
theIframe.style.display = "block";
}
}