//------------------------------------------------------------------------------------------------- // Classes: main classes // // EFFECTS, EFFECTS.manager, // // visual effect classes // // EFFECTS.fadding, EFFECTS.appearing, EFFECTS.smoothChange, // EFFECTS.smoothChangeSize, EFFECTS.smoothChangeSizeWH, EFFECTS.smoothChangeSizeHW, // EFFECTS.smoothMove, // // time effect class // // EFFECTS.setTimeout // // Methods: EFFECTS.setOpacity // // Filename: effects2.js (effects.js version 2) // // Function: Create, process and manager visual and time effects. // // Author: Viet Hoai Vu (known as Bell4285, foxdingdong) // // Release: 17/03/2009 // // Require: nothing // // Information: // // This version optimises effects.js code and make it easier to use // // Change: // // - EFFECTS is made to be singleton // - EFFECTS.manager is made to be singleton // - EFFECTS.manager is made to be self processing (no need to call EFFECTS.manager.process) // - Change the way, object is accessed, using reference in place of id // //------------------------------------------------------------------------------------------------- // EFFECTS constructor function EFFECTS(){}; // time not relevant effects // ------------------------------------------------------------------------------------------------ // EFFECTS.setOpacity EFFECTS.setOpacity = function(obj, percent) { if (obj.style.setAttribute) { obj.style.setAttribute("filter","alpha(opacity="+percent+")"); } else { obj.style.MozOpacity = (percent)/100; obj.style.opacity = percent/100; } } // EFFECTS.getOpacity EFFECTS.getOpacity = function(obj) { if (!obj) { return 0; } if (typeof obj.filters != "unknown" && obj.filters && obj.filters.alpha) { return parseInt(obj.filters.alpha.opacity); } else if (obj.style.MozOpacity) { return parseInt(parseFloat(obj.style.MozOpacity)*100); } else if (obj.style.opacity) { return parseInt(parseFloat(obj.style.opacity)*100); } else return 100; } // time relevant effects //------------------------------------------------------------------------------------------------- /* effect defination template // EFFECTS.effect_name // constructor EFFECTS.effect_name = function(objid,[ADD CODE HERE]) { this.objId = objid; // this parameter is required for effects which affects an object. it is // needed for EFFECTS.manager.stopEffectsOnObject to stop effects on // certain object [ADD CODE HERE] this.fdone = ([ADD CODE HERE]) ? true : false; } // EFFECTS.effect_name.done EFFECTS.effect_name.prototype.done = function() { return this.fdone; } // EFFECTS.effect_name.process EFFECTS.effect_name.prototype.process = function() { if (document.getElementById(this.objId) && !this.fdone) { [ADD CODE HERE] } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- */ // EFFECTS.fadding // // Function: smooth fade the object by time // // Parameter: String objid - id of the object which will fadding // int startOpa - percent of opacity of the object at the beginning of effect // int endOpa - percent of opacity of the object at the end of effect // int opaJump - percent of opacity of the object which will be decrease each // time the effect process // String onDone - javascript code which will be executed when the effect stop // constructor EFFECTS.fadding = function(obj, startOpa, endOpa, opaJump, onDone) { this.objRef = obj; this.startOpa = startOpa; this.endOpa = endOpa; this.opaJump = Math.abs(opaJump); this.onDone = onDone; this.fdone = (opaJump == 0 || startOpa < endOpa) ? true : false; } // EFFECTS.fadding.done EFFECTS.fadding.prototype.done = function() { return this.fdone; } // EFFECTS.fadding.process EFFECTS.fadding.prototype.process = function() { if (this.objRef && !this.fdone) { if (this.startOpa > this.endOpa) { EFFECTS.setOpacity(this.objRef, this.startOpa); this.startOpa -= this.opaJump; } else { this.fdone = true; EFFECTS.setOpacity(this.objRef, this.endOpa); try { this.onDone(); } catch (e) { eval(this.onDone); } } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // effect appearing // // Function: smooth show the object by time // // Parameter: String objid - id of the object which will be showed // int startOpa - percent of opacity of the object at the beginning of effect // int endOpa - percent of opacity of the object at the end of effect // int opaJump - percent of opacity of the object which will be increase each // time the effect process // String onDone - javascript code which will be executed when the effect stop // constructor EFFECTS.appearing = function(obj, startOpa, endOpa, opaJump, onDone) { this.objRef = obj; this.startOpa = startOpa; this.endOpa = endOpa; this.opaJump = Math.abs(opaJump); this.onDone = onDone; this.fdone = (opaJump == 0 || startOpa > endOpa) ? true : false; } // EFFECTS.appearing.done EFFECTS.appearing.prototype.done = function() { return this.fdone; } // EFFECTS.appearing.process EFFECTS.appearing.prototype.process = function() { if (this.objRef && !this.fdone) { if (this.startOpa < this.endOpa) { EFFECTS.setOpacity(this.objRef, this.startOpa); this.startOpa += this.opaJump; } else { this.fdone = true; EFFECTS.setOpacity(this.objRef, this.endOpa); try { this.onDone(); } catch (e) { eval(this.onDone); } } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.smoothChange // constructor EFFECTS.smoothChange = function(obj, onChange, onDone, opaJump, startOpa, endOpa) { this.objRef = obj; this.opaJump = Math.abs(opaJump); this.onChange = onChange; this.onDone = onDone; this.endOpa = endOpa; this.currentOpa = startOpa; this.fdone = (opaJump == 0 || endOpa <= 0) ? true : false; } // EFFECTS.smoothChange.done EFFECTS.smoothChange.prototype.done = function() { return this.fdone; } // EFFECTS.smoothChange.process EFFECTS.smoothChange.prototype.process = function() { if (this.objRef && !this.fdone) { if (this.currentOpa <= this.endOpa && this.currentOpa >= 0) { EFFECTS.setOpacity(this.objRef, this.currentOpa); this.currentOpa -= this.opaJump; } else { if (this.currentOpa < 0) { this.currentOpa = 0; this.opaJump = -this.opaJump; EFFECTS.setOpacity(this.objRef, 0); try { this.onChange(); } catch (e) { eval(this.onChange); } } else { this.fdone = true; EFFECTS.setOpacity(this.objRef, this.endOpa); try { this.onDone(); } catch (e) { eval(this.onDone); } } } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.smoothChangeSizeWH // constructor EFFECTS.smoothChangeSizeWH = function(obj, width, height, wInterval, hInterval, onDone) { this.objRef = obj; this.width = width; this.height = height; this.wInterval = wInterval; this.hInterval = hInterval; this.onDone = onDone; this.fdone = false; } // EFFECTS.smoothChangeSizeWH.done EFFECTS.smoothChangeSizeWH.prototype.done = function() { return this.fdone; } // EFFECTS.smoothChangeSizeWH.process EFFECTS.smoothChangeSizeWH.prototype.process = function() { if (this.objRef && !this.fdone) { obj_width = parseInt(this.objRef.style.width); obj_height = parseInt(this.objRef.style.height); if (this.wInterval > 0 && obj_width != this.width) { off = obj_width-this.width; if (Math.abs(off) < this.wInterval) { this.objRef.style.width = this.width+"px"; } else if (off > 0) { this.objRef.style.width = (obj_width - this.wInterval)+"px"; } else this.objRef.style.width = (obj_width + this.wInterval)+"px"; } else if (this.hInterval > 0 && obj_height != this.height) { off = obj_height-this.height; if (Math.abs(off) < this.hInterval) { this.objRef.style.height = this.height+"px"; } else if (off > 0) { this.objRef.style.height = (obj_height - this.hInterval)+"px"; } else this.objRef.style.height = (obj_height + this.hInterval)+"px"; } else { try { this.onDone(); } catch (e) { eval(this.onDone); } this.fdone = true; } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.smoothChangeSizeHW // constructor EFFECTS.smoothChangeSizeHW = function(obj, width, height, wInterval, hInterval, onDone) { this.objRef = obj; this.width = width; this.height = height; this.wInterval = wInterval; this.hInterval = hInterval; this.onDone = onDone; this.fdone = false; } // EFFECTS.smoothChangeSizeHW.done EFFECTS.smoothChangeSizeHW.prototype.done = function() { return this.fdone; } // EFFECTS.smoothChangeSizeHW.process EFFECTS.smoothChangeSizeHW.prototype.process = function() { if (this.objRef && !this.fdone) { obj_width = parseInt(this.objRef.style.width); obj_height = parseInt(this.objRef.style.height); if (this.hInterval > 0 && obj_height != this.height) { off = obj_height-this.height; if (Math.abs(off) < this.hInterval) { this.objRef.style.height = this.height+"px"; } else if (off > 0) { this.objRef.style.height = (obj_height - this.hInterval)+"px"; } else this.objRef.style.height = (obj_height + this.hInterval)+"px"; } else if (this.wInterval > 0 && obj_width != this.width) { off = obj_width-this.width; if (Math.abs(off) < this.wInterval) { this.objRef.style.width = this.width+"px"; } else if (off > 0) { this.objRef.style.width = (obj_width - this.wInterval)+"px"; } else this.objRef.style.width = (obj_width + this.wInterval)+"px"; } else { try { this.onDone(); } catch (e) { eval(this.onDone); } this.fdone = true; } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.smoothChangeSize // constructor EFFECTS.smoothChangeSize = function(obj, width, height, wInterval, hInterval, onDone) { this.objRef = obj; this.width = width; this.height = height; this.wInterval = wInterval; this.hInterval = hInterval; this.onDone = onDone; this.fdone = false; } // EFFECTS.smoothChangeSize.done EFFECTS.smoothChangeSize.prototype.done = function() { return this.fdone; } // EFFECTS.smoothChangeSize.process EFFECTS.smoothChangeSize.prototype.process = function() { if (this.objRef && !this.fdone) { obj_width = parseInt(this.objRef.style.width); obj_height = parseInt(this.objRef.style.height); if (obj_height != this.height || obj_width != this.width) { off = obj_height-this.height; if (Math.abs(off) < this.hInterval) { this.objRef.style.height = this.height+"px"; } else if (off > 0) { this.objRef.style.height = (obj_height - this.hInterval)+"px"; } else this.objRef.style.height = (obj_height + this.hInterval)+"px"; off = obj_width-this.width; if (Math.abs(off) < this.wInterval) { this.objRef.style.width = (this.width)+"px"; } else if (off > 0) { this.objRef.style.width = (obj_width - this.wInterval)+"px"; } else this.objRef.style.width = (obj_width + this.wInterval)+"px"; } else { try { this.onDone(); } catch (e) { eval(this.onDone); } this.fdone = true; } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.smoothMove // constructor EFFECTS.smoothMove = function(obj, posX, posY, offX, offY, onDone) { this.objRef = obj; this.posX = posX; this.posY = posY; this.offX = Math.abs(offX); this.offY = Math.abs(offY); this.onDone = onDone; this.fdone = true; if (this.objRef) { if (this.objRef.style.top && this.objRef.style.left && this.objRef.style.position) { if (this.objRef.style.position == "absolute" || this.objRef.style.position == "fixed" || this.objRef.style.position == "relative") { this.fdone = false; } } } } // EFFECTS.smoothMove.done EFFECTS.smoothMove.prototype.done = function() { return this.fdone; } // EFFECTS.smoothMove.process EFFECTS.smoothMove.prototype.process = function() { if (this.objRef && !this.fdone) { obj_x = parseInt(this.objRef.style.left); obj_y = parseInt(this.objRef.style.top); if (obj_x != this.posX || obj_y != this.posY) { off = obj_x - this.posX; if (Math.abs(off) < this.offX) { this.objRef.style.left = this.posX+"px"; } else if (off > 0) { this.objRef.style.left = (obj_x - this.offX)+"px"; } else { this.objRef.style.left = (obj_x + this.offX)+"px"; } off = obj_y - this.posY; if (Math.abs(off) < this.offY) { this.objRef.style.top = this.posY+"px"; } else if (off > 0) { this.objRef.style.top = (obj_y - this.offY)+"px"; } else { this.objRef.style.top = (obj_y + this.offY)+"px"; } } else { try { this.onDone(); } catch (e) { eval(this.onDone); } this.fdone = true; } } else { this.fdone = true; } } //------------------------------------------------------------------------------------------------- // EFFECTS.setTimeout // constructor EFFECTS.setTimeout = function(onProcess, repeat, startAfter) { this.repeat = repeat; this.startAfter = Math.abs(startAfter); this.onProcess = onProcess; this.fdone = false; } // EFFECTS.setTimeout.done EFFECTS.setTimeout.prototype.done = function() { return this.fdone; } // EFFECTS.setTimeout.process EFFECTS.setTimeout.prototype.process = function() { if (!this.fdone && this.startAfter <= 0) { if (this.repeat > 0) { this.repeat--; this.fdone = (this.repeat == 0) } try { this.onProcess(); } catch (e) { eval(this.onProcess); } } else { this.startAfter--; } } //------------------------------------------------------------------------------------------------- // Effect Manager //------------------------------------------------------------------------------------------------- // EFFECTS.manager // construction EFFECTS.manager = function(){}; EFFECTS.manager.queue = new Array(); EFFECTS.manager.fdone = true; EFFECTS.manager.timeInterval = 10; EFFECTS.manager.onDone = function(){}; //------------------------------------------------------------------------------------------------- EFFECTS.manager.setTimeInterval = function(tInterval) { this.timeInterval = tInterval; } EFFECTS.manager.setOnDone = function(func) { this.onDone = func; } //------------------------------------------------------------------------------------------------- // EFFECTS.manager.addEffect EFFECTS.manager.addEffect = function(effect) { this.queue.push(effect); if (this.fdone) { this.fdone = false; this.process(); } } // EFFECTS.manager.processOnce EFFECTS.manager.processOnce = function() { for (i = 0; i < this.queue.length ; i++ ) if (this.queue[i].done()) { this.queue[i] = this.queue[this.queue.length-1]; this.queue.pop(); i -= 1; } else { this.queue[i].process(); } if (this.queue.length == 0) { this.fdone = true; } } // EFFECTS.manager.done EFFECTS.manager.done = function() { return this.fdone; } // EFFECTS.manager.process EFFECTS.manager.process = function() { this.processOnce(); if (!this.done()) { setTimeout("EFFECTS.manager.process()",this.timeInterval); } else { try { this.onDone(); } catch (e) { eval(this.onDone); } } } // EFFECTS.manager.stopEffectsOnObject EFFECTS.manager.stopEffectsOnObject = function(obj) { for (i = 0; i < this.queue.length ; i++ ) { if (this.queue[i].objRef && this.queue[i].objRef == obj) { this.queue[i] = this.queue[this.queue.length-1]; this.queue.pop(); i -= 1; } } } TEMPLATE = function(){}; TEMPLATE.currentId = 0; TEMPLATE.load = function(objid) { if (document.getElementById(objid)) { obj = document.getElementById(objid).cloneNode(true); obj.setAttribute("id","template."+(TEMPLATE.currentId++)); nodeArray = new Array(); nodeArray.push(obj); while (nodeArray.length > 0) { currentNode = nodeArray.shift(); if (typeof i != "undefined") { currentI = i; } i = 0; for (i = 0; i < currentNode.childNodes.length ; i++ ) { nodeArray.push(currentNode.childNodes[i]); } if (typeof currentI != "undefined") { i = currentI; } if (currentNode != obj && currentNode.id) { eval("obj."+currentNode.id+" = currentNode;"); eval("obj."+currentNode.id+".setAttribute('id','"+obj.id+"."+currentNode.id+"');"); } } return obj; } else { return null; } } // require prototypes.js MOUSE = function() { this.markedX = 0; this.markedY = 0; } MOUSE.posX = 0; MOUSE.posY = 0; MOUSE.onmousemove = new Array(); MOUSE.addOnmousemove = MOUSE.prototype.addOnmousemove = function(func) { MOUSE.onmousemove.push(func); } MOUSE.removeOnmousemove = MOUSE.prototype.removeOnmousemove = function(func) { id = MOUSE.onmousemove.indexOf(func); if (id >= 0) { MOUSE.onmousemove.remove(id,1); } } MOUSE.onmousedown = new Array(); MOUSE.addOnmousedown = MOUSE.prototype.addOnmousedown = function(func) { MOUSE.onmousedown.push(func); } MOUSE.removeOnmousedown = MOUSE.prototype.removeOnmousedown = function(func) { id = MOUSE.onmousedown.indexOf(func); if (id >= 0) { MOUSE.onmousedown.remove(id,1); } } MOUSE.onmouseup = new Array(); MOUSE.addOnmouseup = MOUSE.prototype.addOnmouseup = function(func) { MOUSE.onmouseup.push(func); } MOUSE.removeOnmouseup = MOUSE.prototype.removeOnmouseup = function(func) { id = MOUSE.onmouseup.indexOf(func); if (id >= 0) { MOUSE.onmouseup.remove(id,1); } } MOUSE.onclick = new Array(); MOUSE.addOnclick = MOUSE.prototype.addOnclick = function(func) { MOUSE.onclick.push(func); } MOUSE.removeOnclick = MOUSE.prototype.removeOnclick = function(func) { id = MOUSE.onclick.indexOf(func); if (id >= 0) { MOUSE.onclick.remove(id,1); } } MOUSE.prototype.getOffsetX = function() { return (MOUSE.posX - this.markedX); } MOUSE.prototype.getOffsetY = function() { return (MOUSE.posY - this.markedY); } MOUSE.prototype.rememberPosition = function() { this.markedX = MOUSE.posX; this.markedY = MOUSE.posY; } MOUSE.getAbsoluteX = MOUSE.prototype.getAbsoluteX = function() { return MOUSE.posX; } MOUSE.getAbsoluteY = MOUSE.prototype.getAbsoluteY = function() { return MOUSE.posY; } MOUSE.getClientX = MOUSE.prototype.getClientX = function() { return MOUSE.posX - document.body.scrollLeft - document.documentElement.scrollLeft; } MOUSE.getClientY = MOUSE.prototype.getClientY = function() { return MOUSE.posY - document.body.scrollTop - document.documentElement.scrollTop; } MOUSE.prototype.getMarkedX = function() { return this.markedX; } MOUSE.prototype.getMarkedY = function() { return this.markedY; } MOUSE.getCurrentObject = MOUSE.prototype.getCurrentObject = function() { currentObject = null; for (i = 0; i < BOXES.objects.length ; i++ ) { pos = BOXES.objects[i].getAbsoluteOffset(); size = BOXES.objects[i].getSize(); pos.X = MOUSE.getAbsoluteX()-pos.X; pos.Y = MOUSE.getAbsoluteY()-pos.Y; if (pos.X > 0 && size.width > pos.X && pos.Y > 0 && size.height > pos.Y) { if (!currentObject || currentObject.getZ() < BOXES.objects[i].getZ()) { currentObject = BOXES.objects[i]; } } } return currentObject; } MOUSE.stopPropagation = MOUSE.prototype.stopPropagation = function(e) { e = e || window.event; if (e && e.stopPropagation) { e.stopPropagation(); } else { event.cancelBubble=true; } } MOUSE.cursors = function(){}; MOUSE.cursors.auto = "auto"; MOUSE.cursors.allScroll = "all-scroll"; MOUSE.cursors.crossHair = "crosshair"; MOUSE.cursors.Default = "default"; MOUSE.cursors.help = "help"; MOUSE.cursors.inherit = "inherit"; MOUSE.cursors.move = "move"; MOUSE.cursors.pointer = "pointer"; MOUSE.cursors.progress = "progress"; MOUSE.cursors.text = "text"; MOUSE.cursors.verticalText = "vertical-text"; MOUSE.cursors.wait = "wait"; MOUSE.cursors.noDrop = "no-drop"; MOUSE.cursors.notAllowed = "not-allowed"; MOUSE.cursors.eResize = "e-resize"; MOUSE.cursors.nResize = "n-resize"; MOUSE.cursors.sResize = "s-resize"; MOUSE.cursors.wResize = "w-resize"; MOUSE.cursors.colResize = "col-resize"; MOUSE.cursors.rowResize = "row-resize"; MOUSE.cursors.neResize = "ne-resize"; MOUSE.cursors.nwResize = "nw-resize"; MOUSE.cursors.seResize = "se-resize"; MOUSE.cursors.swResize = "sw-resize"; MOUSE.setCursor = MOUSE.prototype.setCursor = function(cursor) { document.body.style.cursor = cursor; } MOUSE.onmousemoveEvent = function( e ) { if (!e) { e = window.event; } if (e.pageX && e.pageY) { MOUSE.posX = e.pageX; MOUSE.posY = e.pageY; } else if (e.clientX && e.clientY) { MOUSE.posX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; MOUSE.posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } else { MOUSE.posX = 0; MOUSE.posY = 0; } for (i = 0; i < MOUSE.onmousemove.length ; i++ ) { try { MOUSE.onmousemove[i]( e ); } catch ( error ) { try { MOUSE.onmousemove[i](); } catch ( error ) { eval(MOUSE.onmousemove[i]); } } } } MOUSE.onmousedownEvent = function( e ) { if (!e) { e = window.event; } for (i = 0; i < MOUSE.onmousedown.length ; i++ ) { try { MOUSE.onmousedown[i]( e ); } catch ( error ) { try { MOUSE.onmousedown[i](); } catch ( error ) { eval(MOUSE.onmousedown[i]); } } } } MOUSE.onmouseupEvent = function( e ) { if (!e) { e = window.event; } for (i = 0; i < MOUSE.onmouseup.length ; i++ ) { try { MOUSE.onmouseup[i]( e ); } catch ( error ) { try { MOUSE.onmouseup[i](); } catch ( error ) { eval(MOUSE.onmouseup[i]); } } } } MOUSE.onclickEvent = function( e ) { if (!e) { e = window.event; } for (i = 0; i < MOUSE.onclick.length ; i++ ) { try { MOUSE.onclick[i]( e ); } catch ( error ) { try { MOUSE.onclick[i](); } catch ( error ) { eval(MOUSE.onclick[i]); } } } } document.onmousemove = MOUSE.onmousemoveEvent; document.onmousedown = MOUSE.onmousedownEvent; document.onmouseup = MOUSE.onmouseupEvent; document.onclick = MOUSE.onclickEvent; MOUSE.preventDefault = function(e) { e = e || window.event; if (e && e.preventDefault) { e.preventDefault(); return true; } return false; } MOUSE.clickedButton = MOUSE.prototype.clickedButton = function(e) { e = window.event || e; if (typeof e.which != "undefined") { switch(e.which) { case 3: return MOUSE.button.right; case 1: return MOUSE.button.left; case 0: return MOUSE.button.middle; default: return MOUSE.button.unknown; } } else if (typeof e.button != "undefined") { switch(e.button) { case 2: return MOUSE.button.right; case 1: return MOUSE.button.left; case 4: return MOUSE.button.middle; default: return MOUSE.button.unknown; } } return MOUSE.button.unknown; } MOUSE.button = function(){}; MOUSE.button.left = 0; MOUSE.button.right = 1; MOUSE.button.middle = 2; MOUSE.button.unknown = 3;overall = function(){}; overall.banner = document.getElementById("Banner"); overall.banner.mask = document.getElementById("BannerMask"); EFFECTS.setOpacity(overall.banner.mask,0); overall.banner.buffer = new Image(); overall.banner.buffer.parent = overall.banner; overall.banner.opaJump = 1; // % overall.banner.stayTime = 10; // seconds overall.banner.buffer.onload = function() { EFFECTS.manager.addEffect(new EFFECTS.appearing(this.parent.mask,0,100,this.parent.opaJump,"overall.banner.change()")); } overall.banner.change = function() { overall.banner.style.background = ""; overall.banner.style.background = "url("+overall.banner.buffer.src+") no-repeat right bottom"; EFFECTS.manager.addEffect(new EFFECTS.fadding(this.mask,100,0,this.opaJump,"")); startAfter = 100+ parseInt(overall.banner.stayTime*1000/EFFECTS.manager.timeInterval); EFFECTS.manager.addEffect(new EFFECTS.setTimeout("overall.banner.loadNew()",1,startAfter)); } overall.banner.loadNew = function() { overall.banner.buffer.src = "randombanner.php?rand="+(new Date()).getTime(); } startAfter = parseInt(overall.banner.stayTime*1000/EFFECTS.manager.timeInterval); EFFECTS.manager.addEffect(new EFFECTS.setTimeout("overall.banner.loadNew()",1,startAfter)); overall.navigationBar = document.getElementById("NavigationBar"); overall.navigationBar.createButton = function(action, normalImg) { button = TEMPLATE.load("NavigationButton"); button.buttonReadyState = 0; overall.navigationBar.appendChild(button); button.image.src = "templates/Aeolus/images/"+normalImg; button.image.parent = button; EFFECTS.setOpacity(button,0); if (button.image.complete) { EFFECTS.manager.addEffect(new EFFECTS.appearing(button,0,100,5,"")); } button.image.onload = function() { EFFECTS.manager.addEffect(new EFFECTS.appearing(this.parent,0,100,5,"")); this.onload = null; } button.onmouseover = function() { MOUSE.setCursor(MOUSE.cursors.pointer); } button.onmouseout = function() { MOUSE.setCursor(MOUSE.cursors.Default); } if (action != null) { button.onclick = function() { SESSION.redirect(action); } } } overall.navigationBar.createButton("http://gallery.cgviet.com","nbtn_home.gif"); overall.navigationBar.createButton("http://news.cgviet.com","nbtn_news.gif"); overall.navigationBar.createButton(null,"abtn_forum.gif"); overall.navigationBar.createButton("http://gallery.cgviet.com","nbtn_gallery.gif"); overall.navigationBar.createButton("http://jobs.cgviet.com","nbtn_jobs.gif"); overall.navigationBar.createButton("http://contact.cgviet.com","nbtn_contact.gif"); overall.login = function(){}; overall.login.username = document.getElementById("username"); overall.login.password = document.getElementById("password"); overall.login.loginButton = document.getElementById("loginButton"); overall.login.dataForm = document.getElementById("LoginData"); overall.login.dataForm.username = document.getElementById("LDUsername"); overall.login.dataForm.password = document.getElementById("LDPassword"); if (overall.login.username) { overall.login.username.onchange = function() { overall.login.dataForm.username.value = this.value; } overall.login.password.onchange = function() { overall.login.dataForm.password.value = this.value; } overall.login.loginButton.onclick = function() { overall.login.dataForm.submit(); } overall.login.loginButton.onmouseover = function() { MOUSE.setCursor(MOUSE.cursors.pointer); } overall.login.loginButton.onmouseout = function() { MOUSE.setCursor(MOUSE.cursors.Default); } }overall.toolsBox = document.getElementById("toolsBox"); overall.toolsBox.tools = overall.toolsBox.getElementsByTagName("a"); for (i = 0; i < overall.toolsBox.tools.length ; i++ ) { overall.toolsBox.tools[i].label = overall.toolsBox.tools[i].getElementsByTagName("div")[0]; overall.toolsBox.tools[i].icon = overall.toolsBox.tools[i].getElementsByTagName("img")[0]; overall.toolsBox.tools[i].onmouseover = function() { this.label.className = "ToolsBoxMouseOver"; this.iconName = this.icon.src.substr(0,this.icon.src.lastIndexOf(".")); this.icon.src = this.iconName+".activated.gif"; } overall.toolsBox.tools[i].onmouseout = function() { this.label.className = "ToolsBoxMouseOut"; this.iconName = this.icon.src.substr(0,this.icon.src.lastIndexOf(".")); this.iconName = this.iconName.substr(0,this.iconName.lastIndexOf(".")); this.icon.src = this.iconName+".gif"; } }