<!— KAYNAK: http://www.gezginler.net —>
<script LANGUAGE=”JavaScript”>function CC_noErrors() {return true;}window.onerror = CC_noErrors;
</script>
<script type=”text/javascript”>
/** Bismillaahirrohmaanirrohiim
* @package doiMenu v.1.4 author Donna Iwan Setiawan
* @email pagi@donnaiwan.com homepage http://www.donnaiwan.com*/
var _params = new TParameter()
var _browser = new TBrowser()
//browser constructor
function TBrowser()
{
this._name =”
this._version = ”
this._os =”
}
//start:function browser checking
var detect = navigator.userAgent.toLowerCase();
var total,thestring;
if (checkIt(’konqueror’))
{
_browser._name = “Konqueror”;
_browser._os = “Linux”;
}
else if (checkIt(’safari’)) _browser._name = “Safari”
else if (checkIt(’omniweb’)) _browser._name = “OmniWeb”
else if (checkIt(’opera’)) _browser._name = “Opera”
else if (checkIt(’webtv’)) _browser._name = “WebTV”;
else if (checkIt(’icab’)) _browser._name = “iCab”
else if (checkIt(’msie’)) _browser._name = “IE”
else if (!checkIt(’compatible’))
{
_browser._name = “Netscape”
_browser._version = detect.charAt(8);
}
else _browser._name = “none”;
if (_browser._version == ”) _browser._version = detect.charAt(place + thestring.length);
if (_browser._os == ”)
{
if (checkIt(’linux’)) _browser._os = “Linux”;
else if (checkIt(’x11′)) _browser._os = “Unix”;
else if (checkIt(’mac’)) _browser._os = “Mac”
else if (checkIt(’win’)) _browser._os = “Windows”
else _browser._os = “none”;
}
function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
//end:function browser checking
//Main Menu Constructor
function TMainMenu(id,direction)
{
this._id = id
this._parent = ” //di set pada saat Add() method –>belum kepake
this._width =’auto’
this._direction = direction //direction = ‘horizontal’ atau ‘vertical’
this._position= ‘absolute’
this._top = 0
this._left = 0
this._cellSpacing =5
this._itemHeight = ‘auto’ //dengan satuan bisa ‘auto’ atau ”
this._itemWidth = ‘auto’ //dengan satuan bisa ‘auto’ atau ”
this._textAlign = ‘center’
this._backColor = ‘buttonface’
this._outerBorder = new TBorder()
this._innerBorder = new TBorder() //bug: harus diisi jangan none atau 0px
this._noShadow = true
this._itemIndex = -1
this._items = new Array()
this.Add = AddItem
this.Draw = DrawMenu
this.Init = InitMenu
this.Build = BuildMenu
}
//Pop Menu Constructor
function TPopMenu(id,label,icon,clickType,clickParam,status)
{
//status belum kepake
//rencana buat status di statusbar
this._id = id
this._parent = ” //di set pada saat Add() method –>belum kepake
this._label = label
this._top = 0
this._left = 0
this._status = status
if(icon == “”)
this._icon = ‘<td><img src=”none.gif” /></td>’
else if(icon == ‘9x’)
this._icon = ”
else
this._icon = ‘<td><img src=”’+icon+’” /></td>’
this._itemIndex = -1
this._items = new Array()
switch(clickType)
{
case ‘function’:
this._eClick = ‘ onclick=”’+clickParam+’”’
break;
default:
this._eClick = ”
}
this.Add = AddItem
this.Draw = DrawPopMenu
}
//Parameter buat Menu
function TParameter()
{
this._width = 200 //lebar popup menu in px
this._separator = new TSeparator()
this._expandIcon = new TExpandIcon()
this._font = new TFont()
this._font._family = ‘tahoma,verdana,sans-serif,arial’
this._font._size = ‘8pt’
//untuk pop menu
this._hlItemBorderColor = ‘green’
this._hlItemTextColor = ‘green’
this._hlItemBackColor = ‘#cccccc’
this._itemBorderColor = ‘none’
this._itemTextColor = ‘#000066′
this._itemBackColor = ‘transparent’
//untuk main menu
this._mmPosition = ‘absolute’ //dioverwrite dengan TMainMenu._position pada saat TMainMenu.Build()
this._mmItemTextColor = ‘#000066′
this._mmItemBackColor = ‘#bcbc7a’
this._mmHLItemTextColor = ‘white’
this._mmHLItemBackColor = ‘#9ca972′
this._mmItemBorder = new TBorder() //dioverwrite dengan TMainMenu._innerBorder pada saat TMainMenu.Build()
this._mmHLItemBorder = new TBorder()
this._mmHLItemBorder._top =’1px navy solid’
this._mmHLItemBorder._right =’1px navy solid’
this._mmHLItemBorder._bottom =’1px navy solid’
this._mmHLItemBorder._left =’1px navy solid’
this._mmItemTextColorClick = ‘white’
this._mmItemBackColorClick = ‘#9ca972′
this._mmItemBorderClick = new TBorder()
this._mmItemBorderClick._top =’1px navy solid’
this._mmItemBorderClick._right =’1px navy solid’
this._mmItemBorderClick._bottom =’1px navy solid’
this._mmItemBorderClick._left =’1px navy solid’
this._popBack = new TBackground()
this._popBack._color = ‘whitesmoke’
this._popBack._image = ‘url(“xp.gif”)’
this._popBack._repeat = ‘repeat-y’
this._popBorder = new TBorder()
this._popBorder._top = ‘1px black solid’
this._popBorder._right = ‘1px black solid’
this._popBorder._bottom = ‘1px black solid’
this._popBorder._left = ‘1px black solid’
this._createShadow = true
this._shadowColor = ‘#c0c0c0′
this._shadowDistance = 10 //in pixel
this._timeOut = 2000 //in milliseconds
}
function TSeparator()
{
this._align = ‘center’ //available value: ‘left’,’center’,’right’
this._width = 200 //in pixel
this._margin = “0px 0px 0px 0px”; //top right bottom left margin –> dioverwrite
this._border = new TBorder() //_left and _right –> tidak kepake
this._border._top = ‘1px black solid’
this._border._bottom = ‘1px white solid’
}
function TFont()
{
this._family = ‘arial,times,sans-serif’
this._size = ‘8pt’
}
function TBackground()
{
this._image = ‘none’
this._repeat = ‘no-repeat’
this._color = ‘transparent’
this._position = ‘top left’
}
function TExpandIcon()
{
this._symbol = ‘►’
this._font = new TFont()
this._font._size = ‘6pt’
}
//Border yapıcı
function TBorder()
{
this._top=’1px black solid’
this._right =’1px black solid’
this._bottom =’1px black solid’
this._left=’1px black solid’
}
function BuildMenu()
{
var result =”"
var level = -1
_params._mmPosition = this._position
_params._mmItemBorder._top = this._innerBorder._top
_params._mmItemBorder._right = this._innerBorder._right
_params._mmItemBorder._bottom = this._innerBorder._bottom
_params._mmItemBorder._left = this._innerBorder._left
result += BuildStyle()
result += this.Draw(level++)
level++
for(var i=0;i<=this._itemIndex;i++)
{
result +=this._items[i].Draw(level)
result += BuildPopUpMenu(this._items[i],level)
}
return result
}
function InitMenu()
{
var el_menu = document.getElementById(this._id)
//el_menu.style.position = this._position
if(this._position == ‘absolute’)
{
el_menu.style.top = this._top
el_menu.style.left = this._left
}else
{
this._top = el_menu.offsetTop
this._left = el_menu.offsetLeft
}
el_menu.style.borderTop = this._outerBorder._top
el_menu.style.borderRight = this._outerBorder._right
el_menu.style.borderBottom = this._outerBorder._bottom
el_menu.style.borderLeft = this._outerBorder._left
el_menu.style.backgroundColor = this._backColor
for(var i=0;i<=this._itemIndex;i++)
{
var el_menuitem = document.getElementById(’pr_’+this._items[i]._id)
if(this._itemHeight.toLowerCase() != ‘auto’ || this._itemHeight != ”)
el_menuitem.style.height = this._itemHeight
if(this._itemWidth.toLowerCase() != ‘auto’ || this._itemWidth != ”)
el_menuitem.style.width = this._itemWidth
el_menuitem.style.borderTop = this._innerBorder._top
el_menuitem.style.borderRight = this._innerBorder._right
el_menuitem.style.borderBottom = this._innerBorder._bottom
el_menuitem.style.borderLeft = this._innerBorder._left
el_menuitem.style.textAlign = this._textAlign
el_menuitem.style.backgroundColor = _params._mmItemBackColor
el_menuitem.style.color = _params._mmItemTextColor
if(this._items[i]._itemIndex > -1)
{
var el_pop = document.getElementById(this._items[i]._id)
if(this._direction == ‘horizontal’)
{
this._items[i]._top = el_menuitem.offsetTop + el_menuitem.offsetHeight+this._top + 1
this._items[i]._left = el_menuitem.offsetLeft + this._left
}
else
{
this._items[i]._top = el_menuitem.offsetTop +this._top
this._items[i]._left = el_menuitem.offsetLeft + el_menuitem.offsetWidth+this._left+ 4
}
el_pop.style.top = this._items[i]._top + ‘px’
el_pop.style.left = this._items[i]._left + ‘px’
el_pop.style.width = _params._width + ‘px’
el_pop.style.zIndex = 1
//Gölge
if(_params._createShadow)
{
var sh_el_pop = document.getElementById(’sh_’+this._items[i]._id)
sh_el_pop.style.top= this._items[i]._top + _params._shadowDistance + ‘px’
sh_el_pop.style.left= this._items[i]._left + _params._shadowDistance + ‘px’
sh_el_pop.style.width= el_pop.offsetWidth
sh_el_pop.style.height= el_pop.offsetHeight
sh_el_pop.style.backgroundColor = _params._shadowColor
}
InitPopMenu(this._items[i],1)
}
}
//Ana menü gölgesi
if(!this._noShadow)
{
var sh_el = document.getElementById(’sh_’+this._id)
sh_el.style.top = this._top + _params._shadowDistance +’px’
sh_el.style.left= this._left + _params._shadowDistance +’px’
sh_el.style.width = el_menu.offsetWidth
sh_el.style.height = el_menu.offsetHeight
sh_el.style.backgroundColor = _params._shadowColor
}
}
//Özel
function DrawMenu(level)
{
var result = “”
//Ana menü gölgesi
if(!this._noShadow)
{
result +=’<div style=”position:absolute;” id=”sh_’+this._id+’”></div>’
}
result +=’<table id=”’+this._id+’”’
if(this._width != ‘auto’ || this._width != ”)
result +=’ width=”’+this._width+’”’
result +=’ cellspacing=”’+this._cellSpacing+’”>’
if(this._direction == ‘horizontal’)
result +=’<tr>’
if(this._itemIndex > -1)
{
for(var i=0;i<=this._itemIndex;i++)
{
var result1 = ”
result1 += ‘<td nowrap id=”pr_’+this._items[i]._id+’”’
if(this._items[i]._itemIndex > -1)
{
result1 += ‘ onmouseover=”onMainMOver(event,this,\”+this._items[i]._id+’\’,’+level+’)”’
result1 += ‘onclick=”onMainClick(event,this,\”+this._items[i]._id+’\’)”’
result1 += ‘ onmouseout=”onMainMOut(event,this,\”+this._items[i]._id+’\’)”’
}
else
{
result1 += ‘ onmouseover=”onMainMOver(event,this,\’\’)”’
result1 += ‘ onmouseout=”onMainMOut(event,this,\’\’)”’
}
result1 += ‘>’+this._items[i]._label+’</td>’
if(this._direction == ‘horizontal’)
result += result1
else
result += ‘<tr>’+result1+’</tr>’
}
}
else
{
var result1 = ”
result1 +=’<td> </td>’
if(this._direction == ‘horizontal’)
result += result1
else
result +=’<tr>’+result1+’</tr>’
}
if(this._direction == ‘horizontal’)
result += ‘</tr>’
result +=’</table>’
return result
}
//Özel
function DrawPopMenu(level)
{
var result =”"
if(this._itemIndex > -1)
{
//Gölge
if(_params._createShadow)
{
result += ‘<div style=”position:absolute;visibility:hidden;” id=”sh_’+this._id+’”></div>’
}
result += ‘<div id=”’+this._id+’”>’
for(var i=0;i<=this._itemIndex;i++)
{
if(this._items[i]._label != ‘-’)
{
if(this._items[i]._itemIndex > -1)
{
result += ‘<div id=”di_’+this._items[i]._id+’”>’
result += ‘<table cellspacing=”0″ cellpadding=”2″’
result += ‘ onmouseover=”onPopItemMOver(event,this,\”+this._items[i]._id+’\’,’+level+’)”’
result += ‘ onmouseout=”onPopItemMOut(event,this,\”+this._items[i]._id+’\’)”’
result +=’ id=”pr_’+this._items[i]._id+’”><tr>’+this._items[i]._icon+’<td>’+this._items[i]._label+’</td><td>’+_params._expandIcon._symbol+’</td>’
}
else
{
result += ‘<div>’
result += ‘<table cellspacing=”0″ cellpadding=”2″’
result += ‘ onmouseover=”onPopItemMOver(event,this,\’\’,’+level+’)”’
result += ‘ onmouseout=”onPopItemMOut(event,this,\’\’)”’
result += this._items[i]._eClick
result +=’><tr>’+this._items[i]._icon+’<td>’+this._items[i]._label+’</td>’
}
result += ‘</tr></table>’
result += ‘</div>’
}
else
{
if(_browser._name == ‘IE’)
result +=’<div style=”margin-right:-2px;padding:4px 0px 4px 0px;background-color:’+_params._itemBackColor+’;”><div></div></div>’
else
result +=’<div style=”margin-right:0px;padding:4px 0px 4px 0px;background-color:’+_params._itemBackColor+’;”><div></div></div>’
}
}
result +=’</div>’
}
return result
}
//global
function AddItem(popMenu)
{
this._itemIndex++
this._items[this._itemIndex] = popMenu
this._items[this._itemIndex]._parent = popMenu._id
}
//global
function InitPopMenu(popMenu,zIndex)
{
if(popMenu._itemIndex > -1)
{
for(var i=0;i<=popMenu._itemIndex;i++)
{
if(popMenu._items[i]._itemIndex > -1)
{
var pr_el = document.getElementById(’pr_’+popMenu._items[i]._id)
var el = document.getElementById(popMenu._items[i]._id)
popMenu._items[i]._top = popMenu._top + pr_el.offsetTop
popMenu._items[i]._left = popMenu._left + _params._width – 3
el.style.top = popMenu._items[i]._top +’px’
el.style.left = popMenu._items[i]._left + ‘px’
el.style.width =_params._width
zIndex++
el.style.zIndex = zIndex
//Gölge
if(_params._createShadow)
{
var sh_el = document.getElementById(’sh_’+popMenu._items[i]._id)
sh_el.style.top= popMenu._items[i]._top + _params._shadowDistance + ‘px’
sh_el.style.left= popMenu._items[i]._left + _params._shadowDistance + ‘px’
sh_el.style.width= el.offsetWidth
sh_el.style.height= el.offsetHeight
sh_el.style.backgroundColor = _params._shadowColor
}
InitPopMenu(popMenu._items[i],zIndex)
}
}
}
}
//global
function BuildPopUpMenu(popMenu,level)
{
var result = “”
level++
for(var i=0;i<=popMenu._itemIndex;i++)
{
result += popMenu._items[i].Draw(level)
result += BuildPopUpMenu(popMenu._items[i],level)
}
return result
}
//global
function BuildStyle()
{
var result = ”
result +=’<style type=”text/css”>’
result +=’table.TMenu{cursor:default’
result +=’;position:’+_params._mmPosition
result +=’;font-family:’+ _params._font._family
result +=’;font-size:’+ _params._font._size
result +=’;}’
result +=’td.TMenuItem{padding:1px 5px 1px 5px’
result +=’;}’
result +=’div.TPopUp{position:absolute;padding: 1px 1px 1px 1px;visibility:hidden’
result +=’;border-top:’+ _params._popBorder._top
result +=’;border-right:’+_params._popBorder._right
result +=’;border-bottom:’+_params._popBorder._bottom
result +=’;border-left:’+_params._popBorder._left
result +=’;background-color:’+ _params._popBack._color
result +=’;background-image:’+ _params._popBack._image
result +=’;background-position:’ + _params._popBack._position
result +=’;background-repeat:’+ _params._popBack._repeat
result +=’;display:block’
result +=’;}’
result +=’table.TPopUpItem{width:100%;cursor:default;’
result +=’font-family:’+_params._font._family+’;font-size:’+_params._font._size+’;}’
result +=’div.TPopUpItem{cursor:default;background-color:’+ _params._itemBackColor+’;’
if(_params._itemBorderColor.toLowerCase() == ‘none’ || _params._itemBorderColor == ”)
{
result +=’padding:1px 1px 1px 1px;’
result +=’border:0px red solid;’
}
else
{
result +=’padding:0px 0px 0px 0px;’
result +=’border:1px ‘+_params._itemBorderColor+’ solid;’
}
result +=’}’
result +=’div.TPopUpItem1{cursor:default;background-color :’+_params._hlItemBackColor+’;’
if(_params._hlItemBorderColor.toLowerCase() == ‘none’ || _params._hlItemBorderColor == ”)
{
result +=’padding:1px 1px 1px 1px;’
result +=’border:0px none solid;’
}
else
{
result +=’padding:0px 0px 0px 0px;’
result +=’border:1px ‘+_params._hlItemBorderColor+’ solid;’
}
result +=’}’
//Ayırıcı
_params._separator._width=((_params._width – _params._separator._width) < 0)?_params._width:_params._separator._width
var _div = Math.floor((_params._width – _params._separator._width)/2)
switch(_params._separator._align)
{
case ‘left’:
_params._separator._margin = ‘0px ‘+(_div*2)+’px 0px 0px’
break
case ‘right’:
_params._separator._margin = ‘0px 0px 0px ‘+(_div*2)+’px’
break
default:
_params._separator._margin = ‘0px ‘+_div+’px 0px ‘+_div+’px’
}
result +=’div.TSeparator{’
result +=’margin:’+_params._separator._margin
result +=’;border-top:’+_params._separator._border._top
result +=’;border-bottom:’+_params._separator._border._bottom
result +=’;}’
result +=’td.TExpand{text-align:right;font-family:’+_params._expandIcon._font._family
result +=’;font-size:’+_params._expandIcon._font._size+’;}’
result +=’td.TIcon{width:24px;text-align:left;}’
result +=’img.TIcon{width:16px;vertical-align:middle;}’
result +=’</style>’
return result
}
var RegisterPopUpMenuID = new Array()
var RegisterPopUpMenuIndex = -1
var RegisterTriggerPopID = new Array()
var RegisterTriggerPopIndex = -1
var MainMenuClick = false
//start: basit fonksiyonlar
function findTriggerPopID(elmID)
{
var result = -1
for(var i=0;i<=RegisterTriggerPopIndex;i++)
{
if(RegisterTriggerPopID[i] == elmID)
{
result = i
break
}
}
return result
}
function saveTriggerPopID(elmID)
{
RegisterTriggerPopIndex++
RegisterTriggerPopID[RegisterTriggerPopIndex] = elmID
var el = document.getElementById(elmID)
if(el.className == “TMenuItem”)
{
el.style.backgroundColor=_params._mmItemBackColorClick
el.style.color = _params._mmItemTextColorClick
el.style.borderTop= _params._mmItemBorderClick._top
el.style.borderRight= _params._mmItemBorderClick._right
el.style.borderBottom= _params._mmItemBorderClick._bottom
el.style.borderLeft= _params._mmItemBorderClick._left
}
else
{
el.className = “TPopUpItem1″
}
}
function removeTriggerPopID(elmID)
{
var index = findTriggerPopID(elmID)
if(index > -1)
{
for(var i=RegisterTriggerPopIndex;i>=index;i–)
{
var ID = RegisterTriggerPopID[i]
var el = document.getElementById(ID)
if(el.className == “TMenuItem”)
{
el.style.backgroundColor=_params._mmItemBackColor
el.style.color = _params._mmItemTextColor
el.style.borderTop= _params._mmItemBorder._top
el.style.borderRight= _params._mmItemBorder._right
el.style.borderBottom= _params._mmItemBorder._bottom
el.style.borderLeft= _params._mmItemBorder._left
}
else
{
var IDLen = ID.length
var tableID = ‘pr_’+ ID.substr(3,IDLen)
var elTable = document.getElementById(tableID)
el.className = “TPopUpItem”
elTable.style.color =_params._itemTextColor
}
RegisterTriggerPopID[i] = null
}
RegisterTriggerPopIndex = index – 1
}
}
function removeTriggerPopIDByIndex(index)
{
if(RegisterTriggerPopIndex > -1 && index > -1)
{
for(var i=RegisterTriggerPopIndex;i>=index;i–)
{
var ID = RegisterTriggerPopID[i]
var el = document.getElementById(ID)
if(el.className == “TMenuItem”)
{
el.style.backgroundColor=_params._mmItemBackColor
el.style.color = _params._mmItemTextColor
el.style.borderTop= _params._mmItemBorder._top
el.style.borderRight= _params._mmItemBorder._right
el.style.borderBottom= _params._mmItemBorder._bottom
el.style.borderLeft= _params._mmItemBorder._left
}
else
{
var IDLen = ID.length
var tableID = ‘pr_’+ ID.substr(3,IDLen)
var elTable = document.getElementById(tableID)
el.className = “TPopUpItem”
elTable.style.color =_params._itemTextColor
}
RegisterTriggerPopID[i] = null
}
RegisterTriggerPopIndex = index – 1
}
}
function removeAllTriggerPopID()
{
if(RegisterTriggerPopIndex > -1)
{
for(var i=RegisterTriggerPopIndex;i>=0;i–)
{
var ID = RegisterTriggerPopID[i]
var el = document.getElementById(ID)
if(el.className == “TMenuItem”)
{
if(MainMenuClick)
{
el.style.backgroundColor=_params._mmItemBackColor
el.style.color = _params._mmItemTextColor
el.style.borderTop= _params._mmItemBorder._top
el.style.borderRight= _params._mmItemBorder._right
el.style.borderBottom= _params._mmItemBorder._bottom
el.style.borderLeft= _params._mmItemBorder._left
}
}
else
{
var IDLen = ID.length
var tableID = ‘pr_’+ ID.substr(3,IDLen)
var elTable = document.getElementById(tableID)
el.className = “TPopUpItem”
elTable.style.color =_params._itemTextColor
}
RegisterTriggerPopID[i] = null
}
RegisterTriggerPopIndex = – 1
}
}
function findRegisteredPopUpMenuID(elmID)
{
var result=-1
for(var i=0;i<=RegisterPopUpMenuIndex;i++)
{
if(RegisterPopUpMenuID[i] == elmID)
{
result = i
break
}
}
return result
}
function showPopUpMenu(elmID)
{
RegisterPopUpMenuIndex++
RegisterPopUpMenuID[RegisterPopUpMenuIndex] = elmID
document.getElementById(elmID).style.visibility=”visible”
if(_params._createShadow)
document.getElementById(’sh_’+elmID).style.visibility=”visible”
}
function hidePopUpMenu(elmID)
{
var index = findRegisteredPopUpMenuID(elmID)
if(index >-1)
{
for(var i=RegisterPopUpMenuIndex;i>=index;i–)
{
var ID = RegisterPopUpMenuID[i]
document.getElementById(ID).style.visibility=”hidden”
if(_params._createShadow)
document.getElementById(’sh_’+ID).style.visibility=”hidden”
}
RegisterPopUpMenuIndex = index – 1
}
}
function hidePopUpMenuByIndex(index)
{
if(RegisterPopUpMenuIndex >= index)
{
for(var i=RegisterPopUpMenuIndex;i>=index;i–)
{
var ID = RegisterPopUpMenuID[i]
document.getElementById(ID).style.visibility=”hidden”
if(_params._createShadow)
document.getElementById(’sh_’+ID).style.visibility=”hidden”
}
RegisterPopUpMenuIndex = index-1
}
}
function hideAllPopUpMenu()
{
var index = RegisterPopUpMenuIndex
if(index > -1)
{
for(i=index;i>=0;i–)
{
var ID = RegisterPopUpMenuID[i]
document.getElementById(ID).style.visibility=”hidden”
if(_params._createShadow)
document.getElementById(’sh_’+ID).style.visibility=”hidden”
}
}
RegisterPopUpMenuIndex = -1
}
//end: basit fonksiyonlar
var triggerMenu
function triggerHideAll()
{
triggerMenu = window.setTimeout(’hideAll()’,_params._timeOut)
}
function clearTriggerHideAll()
{
window.clearTimeout(triggerMenu)
}
function hideAll()
{
hideAllPopUpMenu()
removeAllTriggerPopID()
MainMenuClick = false
}
function onMainClick(event,elm,popID)
{
if(!MainMenuClick)
{
MainMenuClick = true
if(popID !=”)
{
showPopUpMenu(popID)
saveTriggerPopID(elm.id)
}
}
else
{
MainMenuClick = false
hideAllPopUpMenu()
removeAllTriggerPopID()
elm.style.backgroundColor= _params._mmHLItemBackColor
elm.style.color = _params._mmHLItemTextColor
elm.style.borderTop= _params._mmHLItemBorder._top
elm.style.borderRight= _params._mmHLItemBorder._right
elm.style.borderBottom= _params._mmHLItemBorder._bottom
elm.style.borderLeft= _params._mmHLItemBorder._left
}
if(_browser._name == ‘IE’)
window.event.cancelBubble = true
if (event.stopPropagation) event.stopPropagation();
}
function onMainMOver(event,elm,popID,level)
{
clearTriggerHideAll()
if(RegisterTriggerPopID[0] != elm.id)
{
if(RegisterTriggerPopID[0] !=null)
{
removeAllTriggerPopID()
}
if(MainMenuClick)
{
hideAllPopUpMenu()
removeAllTriggerPopID()
if(popID !=”)
{
showPopUpMenu(popID)
saveTriggerPopID(elm.id)
}
elm.style.backgroundColor=_params._mmItemBackColorClick
elm.style.color = _params._mmItemTextColorClick
elm.style.borderTop= _params._mmItemBorderClick._top
elm.style.borderRight= _params._mmItemBorderClick._right
elm.style.borderBottom= _params._mmItemBorderClick._bottom
elm.style.borderLeft= _params._mmItemBorderClick._left
}
else
{
elm.style.backgroundColor= _params._mmHLItemBackColor
elm.style.color = _params._mmHLItemTextColor
elm.style.borderTop= _params._mmHLItemBorder._top
elm.style.borderRight= _params._mmHLItemBorder._right
elm.style.borderBottom= _params._mmHLItemBorder._bottom
elm.style.borderLeft= _params._mmHLItemBorder._left
}
}
if(_browser._name == ‘IE’)
window.event.cancelBubble = true
if (event.stopPropagation) event.stopPropagation();
}
function onMainMOut(event,elm,popID)
{
if(!MainMenuClick || popID == ”)
{
elm.style.backgroundColor= _params._mmItemBackColor
elm.style.color = _params._mmItemTextColor
elm.style.borderTop= _params._mmItemBorder._top
elm.style.borderRight= _params._mmItemBorder._right
elm.style.borderBottom= _params._mmItemBorder._bottom
elm.style.borderLeft= _params._mmItemBorder._left
}
triggerHideAll()
if(_browser._name == ‘IE’)
window.event.cancelBubble = true
if (event.stopPropagation) event.stopPropagation();
}
//end: fungsi manipulasi main menu
//start: fungsi manipulasi popup menu
function onPopItemMOver(event,elm,popID,level)
{
clearTriggerHideAll()
var index = -1
index = findRegisteredPopUpMenuID(popID)
elm.parentNode.className =’TPopUpItem1′
elm.style.color=_params._hlItemTextColor
if(index == -1)
{
hidePopUpMenuByIndex(level)
removeTriggerPopIDByIndex(level)
}
if(popID !=”)
{
if(index == -1)
{
showPopUpMenu(popID)
saveTriggerPopID(’di_’+popID)
}
}
if(_browser._name == ‘IE’)
window.event.cancelBubble = true
if (event.stopPropagation) event.stopPropagation();
}
function onPopItemMOut(event,elm,popID)
{
if(popID == ”)
{
elm.parentNode.className =’TPopUpItem’
elm.style.color=_params._itemTextColor
}
triggerHideAll()
if(_browser._name == ‘IE’)
window.event.cancelBubble = true
if (event.stopPropagation) event.stopPropagation();
}
</script>
<script type=”text/javascript”>function go2URL(address)
{
var elFrame = document.getElementById(’doiFrame’)
elFrame.src = address
}
function newWindow(address)
{
var maxW = screen.width
var maxH = screen.height
var w = 800
var h = 600
var _top = Math.floor((maxH – h) / 2)
var _left = Math.floor((maxW – w) / 2)
var win = window.open(address,’doiW’,”toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=”+w+”,height=”+h)
win.moveTo(_left,_top)
win.focus()
}
</script>
</head>
<body bgcolor=”ebe2d3″ onLoad=”mmenu.Init()”>
<iframe style=”position:absolute;top:40px;left:10px;” width=”100%” height=”90%” id=”doiFrame”></iframe>
<script type=”text/javascript”>var mmenu = new TMainMenu(’mmID’,’horizontal’)
var pmFile = new TPopMenu(’pmFileID’,’İÇERİK 1′,”,”,”,”)
var pmcizgi3 = new TPopMenu(”,’-’,”,”,”,”)
var pmNew = new TPopMenu(’pmNewID’,’Başlık 1′,’dosya.gif’,”,”,”)
var pmHome = new TPopMenu(’pmHomeID’,’Link 1′,’home.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”,”)
var pmWindow = new TPopMenu(”,’Başlık 1′,’acik.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”,”)
var pmcizgi1 = new TPopMenu(”,’-’,”,”,”,”)
var pmMsg = new TPopMenu(”,’Link 1′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”)
var pmPost = new TPopMenu(”,’Link 2 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”)
var pmContact = new TPopMenu(”,’Link 3′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”)
var pmInt = new TPopMenu(”,’Link 4 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”)
var pmcizgi2 = new TPopMenu(”,’-’,”,”,”,”)
var pmLink2 = new TPopMenu(”,’Link 2 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”)
var pmcizgi3 = new TPopMenu(”,’-’,”,”,”,”)
var pmLink3= new TPopMenu(”,’Link 3′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”)
var pm1 = new TPopMenu(’pm1ID’,’İÇERİK 5′,”,”,”,”)
var pm2 = new TPopMenu(’pm2ID’,’İÇERİK 3′,”,”,”,”)
var pm3 = new TPopMenu(’pm3ID’,’İÇERİK 4′,”,”,”,”)
var pmenu = new TPopMenu(’pmenuID’,’İÇERİK 2′,”,”,”,”)
var pmenu1 = new TPopMenu(”,’Link 1′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”,”)
var pmenucizgi = new TPopMenu(”,’-’,”,”,”,”)
var pmenu2 = new TPopMenu(”,’Link 2 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”)
var pmenu_ = new TPopMenu(”,’-’,”,”)
var pmenu3 = new TPopMenu(’pmenu3ID’,’Başlık 1′,’dosya.gif’,”,”,”)
var pmenucizgi1 = new TPopMenu(”,’-’,”,”,”,”)
var _pmenu1 = new TPopMenu(”,’Link 1 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”)
var _pmenu2 = new TPopMenu(’_pmenu2ID’,’Başlık 1′,’acik.gif’,”,”,”)
var _pmenu3 = new TPopMenu(”,’Link 2′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”)
var __pmenu1 = new TPopMenu(”,’Link 1′,’Link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”,”)
var __pmenu2 = new TPopMenu(”,’Link 2′,’link.gif’,’function’,”newWindow(’http://www.gezginler.net’)”,”,”,”,”)
var __pmenu3 = new TPopMenu(”,’Link 3 (iframe)’,’link.gif’,’function’,”go2URL(’http://www.gezginler.net/modules/javascripts/ornek/menu/acilanmenu/ornek.html’)”,”,”,”,”)
var _pmenu1_ = new TPopMenu(”,’Hakkımızda’,”,’function’,”alert(’Mesajınızı buraya yazacaksınız’)”,”)
var _pmenu2_ = new TPopMenu(”,’Bize Ulaşın’,’mail.gif’,’function’,”newWindow(’mailto:mail@adresiniz.com’)”,”)
mmenu.Add(pmFile)
mmenu.Add(pmenu)
mmenu.Add(pm2)
mmenu.Add(pm3)
mmenu.Add(pm1)
pmFile.Add(pmHome)
pmFile.Add(pmcizgi1)
pmFile.Add(pmLink2)
pmFile.Add(pmcizgi2)
pmFile.Add(pmLink3)
pmFile.Add(pmcizgi3)
pmFile.Add(pmNew)
pmNew.Add(pmWindow)
pmNew.Add(pmcizgi1)
pmNew.Add(pmMsg)
pmNew.Add(pmPost)
pmNew.Add(pmContact)
pmNew.Add(pmInt)
pm1.Add(_pmenu1_)
pm1.Add(_pmenu2_)
pmenu.Add(pmenu1)
pmenu.Add(pmenu2)
pmenu.Add(pmenu_)
pmenu.Add(pmenu3)
pmenu3.Add(_pmenu2)
pmenu3.Add(pmenucizgi)
pmenu3.Add(_pmenu1)
pmenu3.Add(_pmenu3)
_pmenu2.Add(__pmenu1)
_pmenu2.Add(__pmenu2)
_pmenu2.Add(__pmenu3)
mmenu._cellSpacing = 2
mmenu._position = ‘relative’
mmenu._itemWidth = ‘50px’
mmenu._itemHeight = ‘22px’
mmenu._left = 10
mmenu._top = 10
//mmenu._itemWidth = ‘100px’
_params._separator._align = ‘right’
_params._separator._width = ‘120′
_params._separator._border._top=’1px gray solid’
_params._separator._border._bottom = ‘0px’
_params._width = 150
//_params._shadowColor = ‘#E8E8E8′
//_params._expandIcon._symbol = ‘+’
document.write(mmenu.Build())
</script>
</body>
<!— KAYNAK: http://www.gezginler |