// InterDyn - Menu - Drop-Down - Common Functions
// Copyright 2005 JP7
// http://jp7.com.br
// Versão 0.11 - 2005/08/26


// Methods

var str2=new Array()
var menuFrameOK=new Array()
var menuFrame=false
var menuOK=false


// Images

function DMpI(imgPath,type){
	imgPath=imgPath||'/'+path+'img_dyn/DM/'
	type=type||'png'
	//imgPath=imgPath||'../../img_dyn/DM/'
	this.imgName=this.parent.imgName+'_'+toId(this.arguments[0])
	this.imgClosed=new Image()
	if(is.ie){
		this.imgClosed.src=null
		if(is.mac){
			this.imgClosed.width=''
			this.imgClosed.height=''
		}
	}
	this.imgClosed.onerror=DMpIerror
	this.imgClosed.src=imgPath+this.imgName+'_'+((tipos[this.nivel]==this.arguments[2])?'on':'off')+'_closed.'+type
	this.imgOver=new Image()
	this.imgOver.onerror=DMpIerror
	this.imgOver.src=imgPath+this.imgName+'_'+((tipos[this.nivel]==this.arguments[2])?'on':'off')+'_over.'+type
	this.imgOpened=new Image()
	this.imgOpened.onerror=DMpIerror
	this.imgOpened.src=imgPath+this.imgName+'_'+((tipos[this.nivel]==this.arguments[2])?'on':'off')+'_opened.'+type
}

function DMpIerror(){this.error=true}

function DMpreload(imgPath,type){
	for(var i=0;i<this.itens.length;i++){
		this.itens[i].pI(imgPath,type)
		//if(this.itens[i].itens.length)this.itens[i].preload()
	}
}

function DMcIover(){if(!this.DO.imgOver.error)this.src=this.DO.imgOver.src}
function DMcIout(){if(!this.DO.imgOver.error)this.src=this.DO.imgClosed.src}


// Prototypes

var DOP=DO.prototype

if(isDef('DMwriteMenu'))DOP.writeMenu=DMwriteMenu
if(isDef('DMwriteMenuItens'))DOP.writeMenuItens=DMwriteMenuItens
if(isDef('DMreposMenu'))DOP.reposMenu=DMreposMenu
if(isDef('DMmouseOver'))DOP.mouseOver=DMmouseOver
if(isDef('DMmouseOut'))DOP.mouseOut=DMmouseOut
if(isDef('DMclick'))DOP.click=DMclick
if(isDef('DMshowMenu'))DOP.showMenu=DMshowMenu
if(isDef('DMhideMenu'))DOP.hideMenu=DMhideMenu

DOP.id='DO0'        // ID
DOP.nivel=0         // Nível
DOP.l=0             // Left
DOP.t=0             // Top
DOP.DL=null         // DL
DOP.DLcontent=null  // DLcontent

DOP.preload=DMpreload
DOP.pI=DMpI
DOP.imgName=null
DOP.imgObj=null
DOP.imgClosed=null
DOP.imgOver=null
DOP.imgOn=null
DOP.time=null
DOP.opened=null
