/** * Title : DIV À¯Æ¿ * Author : foxeye * Create date : 2005. 12. xx * * @see * */ function DivUtil() { var ENABLE = false; var divList = new Array(); var currDiv; /** * ÃʱâÈ­ */ function init() { if( divList.length == 0 ) { // alert('¸ÕÀú DIV °´Ã¼¸¦ µî·ÏÇϽʽÿä.'); return; } // ù ¹øÂ° DIV¸¦ ÇöÀç Ȱ¼ºÈ­ currDiv = divList[0]; ENABLE = true; on(currDiv.name); }this.init = init; /** * DIV Ãß°¡ */ function addDiv(name, btnName, onBtn, offBtn) { divList[divList.length] = new Div(name, btnName, onBtn, offBtn); }this.addDiv = addDiv; /** * DIV °´Ã¼ */ function Div(name, btnName, onBtn, offBtn) { this.name = name; var btn = new Array(); this.btn = btn; // ¹öư ¼³Á¤ if(btnName && onBtn && offBtn) { this.btnName = btnName; btn[btn.length] = new Image(); btn[btn.length] = new Image(); btn[0].src = onBtn; btn[1].src = offBtn; } this.btn = btn; // Àü¿ªÈ­ } /** * DIV ¼±Åà */ function change(name) { if( !ENABLE ) { // alert('DIV°¡ ÃʱâÈ­µÇÁö ¾Ê¾Ò½À´Ï´Ù.'); return; } var divNo = find(name); if( divNo < 0 ) { // alert(name + ' DIV¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù'); return; } on(name); }this.change = change; /** * DIV Äѱâ */ function on(name) { for(var i=0; i 0 ) { document.images[ currDiv.btnName ].src = currDiv.btn[0].src; // ¹öư Ȱ¼ºÈ­ } } else { document.all[ divList[i].name ].style.display = 'none'; // ¼û±â±â if( divList[i].btn.length > 0 ) { document.images[ divList[i].btnName ].src = divList[i].btn[1].src; // ¹öư ºñȰ¼ºÈ­ } } } } /** * DIV ã±â */ function find(name) { for(var i=0; i