
/*****************************************************
* IMG75SlideOutMenu
* 3/04/2001
* 
* a nice little script to create exclusive, slide-out
* menus for ns4, ns6, mozilla, opera, ie4, ie5 on 
* mac and win32. I've got no linux or unix to test on but 
* it should(?) work... 
*
* --youngpup--
*****************************************************/
IMG75SlideOutMenu.Registry = []
IMG75SlideOutMenu.aniLen = 300
IMG75SlideOutMenu.hideDelay = 100
IMG75SlideOutMenu.minCPUResolution = 10
function IMG75SlideOutMenu(id, dir, left, top, width, height)
{
this.ie = document.all ? 1 : 0
this.ns4 = document.layers ? 1 : 0
this.dom = document.getElementById ? 1 : 0
if (this.ie || this.ns4 || this.dom) {
this.id = id
this.dir = dir
this.orientation = dir == "right" || dir == "right" ? "h" : "v"
this.dirType = dir == "right" || dir == "down" ? "-" : "+"
this.dim = this.orientation == "h" ? width : height
this.hideTimer = false
this.aniTimer = false
this.open = false
this.over = false
this.startTime = 0
this.gRef = "IMG75SlideOutMenu_"+id
eval(this.gRef+"=this")
IMG75SlideOutMenu.Registry[id] = this
var d = document
d.write('<style type="text/css">')
d.write('#' + this.id + 'Container { visibility:hidden; ')
d.write('left:' + left + 'px; ')
d.write('top:' + top + 'px; ')
d.write('overflow:hidden; }')
d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; ')
d.write('width:' + width + 'px; ')
d.write('height:' + height + 'px; ')
d.write('clip:rect(0 ' + width + ' ' + height + ' 0); ')
d.write('}')
d.write('</style>')
this.load()
}
}
IMG75SlideOutMenu.prototype.load = function() {
var d = document
var lyrId1 = this.id + "Container"
var lyrId2 = this.id + "Content"
var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
var temp
if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 300)
else {
this.container = obj1
this.menu = obj2
this.style = this.ns4 ? this.menu : this.menu.style
this.homePos = eval("0" + this.dirType + this.dim)
this.outPos = 0
this.accelConst = (this.outPos - this.homePos) / IMG75SlideOutMenu.aniLen / IMG75SlideOutMenu.aniLen 
if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
this.menu.onmouseover = new Function("IMG75SlideOutMenu.showMenu('" + this.id + "')")
this.menu.onmouseout = new Function("IMG75SlideOutMenu.hideMenu('" + this.id + "')")
this.endSlide()
}
}
IMG75SlideOutMenu.showMenu = function(id)
{
var reg = IMG75SlideOutMenu.Registry
var obj = IMG75SlideOutMenu.Registry[id]
if (obj.container) {
obj.over = true
for (menu in reg) if (id != menu) IMG75SlideOutMenu.hide(menu)
if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
}
}
IMG75SlideOutMenu.hideMenu = function(id)
{
var obj = IMG75SlideOutMenu.Registry[id]
if (obj.container) {
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = window.setTimeout("IMG75SlideOutMenu.hide('" + id + "')", IMG75SlideOutMenu.hideDelay);
}
}
IMG75SlideOutMenu.hide = function(id)
{
var obj = IMG75SlideOutMenu.Registry[id]
obj.over = false
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = 0
if (obj.open && !obj.aniTimer) obj.startSlide(false)
}
IMG75SlideOutMenu.prototype.startSlide = function(open) {
this[open ? "onactivate" : "ondeactivate"]()
this.open = open
if (open) this.setVisibility(true)
this.startTime = (new Date()).getTime() 
this.aniTimer = window.setInterval(this.gRef + ".slide()", IMG75SlideOutMenu.minCPUResolution)
}
IMG75SlideOutMenu.prototype.slide = function() {
var elapsed = (new Date()).getTime() - this.startTime
if (elapsed > IMG75SlideOutMenu.aniLen) this.endSlide()
else {
var d = Math.round(Math.pow(IMG75SlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
if (this.open && this.dirType == "-") d = -d
else if (this.open && this.dirType == "+") d = -d
else if (!this.open && this.dirType == "-") d = -this.dim + d
else d = this.dim + d
this.moveTo(d)
}
}
IMG75SlideOutMenu.prototype.endSlide = function() {
this.aniTimer = window.clearTimeout(this.aniTimer)
this.moveTo(this.open ? this.outPos : this.homePos)
if (!this.open) this.setVisibility(false)
if ((this.open && !this.over) || (!this.open && this.over)) {
this.startSlide(this.over)
}
}
IMG75SlideOutMenu.prototype.setVisibility = function(bShow) { 
var s = this.ns4 ? this.container : this.container.style
s.visibility = bShow ? "visible" : "hidden"
}
IMG75SlideOutMenu.prototype.moveTo = function(p) { 
this.style[this.orientation == "h" ? "right" : "top"] = this.ns4 ? p : p + "px"
}
IMG75SlideOutMenu.prototype.getPos = function(c) {
return parseInt(this.style[c])
}
IMG75SlideOutMenu.prototype.onactivate = function() { }
IMG75SlideOutMenu.prototype.ondeactivate = function() { }

/**********************************
End of drop down menus
**********************************/
















var myMenu1 = new IMG75SlideOutMenu("menu1", "down",100, 11, 170, 236)
	var myMenu2 = new IMG75SlideOutMenu("menu2", "down",100, 37, 170, 187)
	var myMenu3 = new IMG75SlideOutMenu("menu3", "down",100, 64, 170, 187)
	var myMenu4 = new IMG75SlideOutMenu("menu4", "down", 100, 91, 170, 66)
	var myMenu5 = new IMG75SlideOutMenu("menu5", "down",100, 120, 170, 66)
	var myMenu5 = new IMG75SlideOutMenu("menu6", "down",100, 147, 170, 162)
	var myMenu5 = new IMG75SlideOutMenu("menu7", "down",100, 175, 170, 42)
	var myMenu5 = new IMG75SlideOutMenu("menu8", "down",100, 200, 170, 66)
	var myMenu5 = new IMG75SlideOutMenu("menu9", "down",100, 225, 170, 66)
	var myMenu5 = new IMG75SlideOutMenu("menu10", "down",100, 255, 170, 90)
	var myMenu5 = new IMG75SlideOutMenu("menu11", "down",100, 280, 170, 42)
	var myMenu5 = new IMG75SlideOutMenu("menu12", "down",100, 309, 170, 114)
	var myMenu5 = new IMG75SlideOutMenu("menu13", "down",100, 100, 170, 282)
	var myMenu5 = new IMG75SlideOutMenu("menu14", "down",100, 365, 170, 138)
	var myMenu5 = new IMG75SlideOutMenu("menu15", "down",100, 387, 170, 138)
	var myMenu5 = new IMG75SlideOutMenu("menu16", "down",100, 415, 170, 42)
	var myMenu5 = new IMG75SlideOutMenu("menu17", "down",100, 441, 170, 42)
	var myMenu5 = new IMG75SlideOutMenu("menu18", "down",100, 470, 170, 90)





////////////////////////////////scroll///////////////////////////////////////////////






var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
        var yMenu1From, yMenu1To, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { // ©ø¡¿A¡ÀAEAICA ¢¯e ¨ù©øA¢´
                //yButtonFrom = document["divLinkButton"].top;
                //yButtonTo   = top.pageYOffset + top.innerHeight - 55;
                yMenu1From   = document["Menu1"].top;
                yMenu1To     = top.pageYOffset + 150;   // A¡×AE A¡×A¢®
        }
        else if ( bExplorer4plus ) {  // IE ¢¯e ¨ù©øA¢´
                //yButtonFrom = parseInt (divLinkButton.style.top, 10);
                //yButtonTo   = document.body.scrollTop + document.body.clientHeight - 55;
                yMenu1From   = parseInt (Menu1.style.top, 10);
                yMenu1To     = document.body.scrollTop + 0 // A¡×AE A¡×A¢®
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenu1To + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenu1From != yMenu1To ) {
                yOffset = Math.ceil( Math.abs( yMenu1To - yMenu1From ) / 20 );
                if ( yMenu1To < yMenu1From )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["Menu1"].top += yOffset;
                else if ( bExplorer4plus )
                        Menu1.style.top = parseInt (Menu1.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function MovePosition()
{
        var y;

        // CA¡¤©öAO ¢¯¢®¨ù¡© ©ö©­¨úi©ø¨£¡ÆO CI¢¥A CO¨ùoAO¢¥I¢¥U. CA¡¤©öAO¢¯¢® ©øOA¢¬¡¤A¢¬e ¡íeA|CI¨ù¨ù¢¯a
        if ( top.frames.length )
         //       top.location.href = self.location.href;

        // ¨¡a¢¯¢®Ao ¡¤I¥ìu¨öA ¨¡¡ÀAo¨ùC
        if ( bNetscape4plus ) {
                document["Menu1"].top = top.pageYOffset + 268;
                document["Menu1"].visibility = "visible";
                //document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
                //document["divLinkButton"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                Menu1.style.top = document.body.scrollTop + 268;
                Menu1.style.visibility = "visible";
                //divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
                //divLinkButton.style.visibility = "visible";
        }

        // initializing UI update timer
        CheckUIElements();
        //if ( bExplorer4plus )
        //        setTimeout ( "FlashTitleStepIt(255)", 10 );
        return true;
}










