var Context = { Common : { numerize : function(obj){ return Number(String(obj).toLowerCase().replace('px','')); }, acquire : function(obj){ return document.getElementById(obj); }, isset : function(obj){ return (typeof(obj)!='undefined' ? true : false ); }, getInstance : function(instance){ if(!eval(instance)) return false; return eval(instance); }, getByClassName : function(el,className){ var i, tmp; if (el.className == className) return el; for (i = 0; i < el.childNodes.length; i++) { tmp = this.getByClassName(el.childNodes[i], className); if (tmp != null) return tmp; } return null; }, getLikeClassName : function(el,className){ var i, tmp; if (el.className && el.className.indexOf(className)>-1) return el; for (i = 0; i < el.childNodes.length; i++) { tmp = this.getLikeClassName(el.childNodes[i], className); if (tmp != null) return tmp; } return null; }, getAllByClassName : function(el,className){ var i, tmp; var results = new Array(); if (el.className == className) results[results.length] = el; tmp = el.getElementsByTagName('*'); for (i = 0; i < tmp.length; i++) if (tmp[i].className && tmp[i].className == className) results[results.length] = tmp[i]; return results; }, getAllLikeClassName : function(el,className){ var i, tmp; var results = new Array(); if(el.className && el.className.indexOf(className)>-1) results[results.length] = el; tmp = el.getElementsByTagName('*'); for (i = 0; i < tmp.length; i++) if (tmp[i].className && tmp[i].className.indexOf(className)>-1) results[results.length] = tmp[i]; return results; }, testBrowser : function(browser){ return navigator.userAgent.toLowerCase().indexOf(browser) + 1; }, loadInit :function(completion){ if (arguments.callee.done) return; arguments.callee.done = true; completion(); }, setOnload : function(completion){ /* for Mozilla */ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", function(){Context.Common.loadInit(completion)}, false); } /* for Internet Explorer */ /*@cc_on @*/ /*@if (@_win32) document.write("