/*
Copyrights ¨Ï gwkplus. All rights reserved.
This article may not be published, rewritten or redistributed.
developer : gwkplus at korea dot com
*/
// ÇÁ·ÎÅä ŸÀÔ
Number.prototype.format = function (places) {
var n = (Math.round(this * Math.pow(10, places))).toString();
var s1 = parseFloat('0'+n.slice(0, -(places)));
var s2 = parseFloat('0.'+n.slice(-(places)));
return s1+s2;
}
Number.prototype.zf = function(l) { return this.toString().zf(l); } // ¹øÈ£ Á¦·ÎÇÊ
String.prototype.zf = function(l) { return '0'.string(l - this.length) + this; } // ¹®ÀÚ¿ Á¦·ÎÇÊ
String.prototype.string = function(l) { var s = '', i = 0; while (i++ < l) { s += this; } return s; } // ¹®ÀÚ¿ ¹Ýº¹
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/gi, "");}
Date.prototype.format = function(f)
{
if (!this.valueOf()) return '';
var d = this;
return f.replace(/(yyyy|mmmm|mm|dd|hh|mi|nn|ss)/gi,
function($1)
{
switch ($1.toLowerCase())
{
case 'yyyy': return d.getFullYear().zf(4);
case 'mm': return (d.getMonth() + 1).zf(2);
case 'dd': return d.getDate().zf(2);
case 'hh': return d.getHours().zf(2);
case 'mi':
case 'nn': return d.getMinutes().zf(2);
case 'ss': return d.getSeconds().zf(2);
}
}
);
}
var filters =
{
opacity:function(obj, opacity)
{
obj.style.opacity=opacity;
obj.style.filter = "alpha(opacity="+opacity*100+")";
},
//filters.transform(´ë»ó, À̺¥Æ®Çڵ鷯, ÃʱⰪ, Áõ°¡°ª, ½ÇÇàȽ¼ö, Áö¿¬½Ã°£ms);
transform:function(obj, handler, start, inc, count, delay)
{
if(count>=0)
{
handler(obj, start);
start += inc;
count -= 1;
window.setTimeout(function(){filters.transform(obj,handler,start,inc,count,delay)},delay);
}
}
};
function setThrow(num,desc)
{
//¿¹¿ÜÁ¤º¸ ¼³Á¤
var error=
{
number:num,
description:desc
};
return error;
}
//==================================================================================================================
// ´ÙÀ̾ó·Î±× À̺¥Æ® 󸮱â
var __DivOpen;
function DivOpenMsDown(obj)
{
__DivOpen = obj;
obj.cX = event.clientX;
obj.cY = event.clientY;
addEvent(document,'mouseup',DivOpenMsUp);
addEvent(document,'mousemove',DivOpenMsMove);
document.body.onselect = function (){return false;};
return false;
}
function DivOpenMsUp()
{
var obj = __DivOpen;
filters.opacity(obj,1.0);
removeEvent(document,'mouseup', DivOpenMsUp);
removeEvent(document,'mousemove', DivOpenMsMove);
document.body.onselectstart = function (){return true;};
return false;
}
function DivOpenMsMove()
{
var obj = __DivOpen;
if(!(event.clientX > 0 && event.clientY > 0)){ return false;}
var left = (parseInt(obj.style.left) + (-obj.cX - (-event.clientX)));
var top = (parseInt(obj.style.top) + (-obj.cY - (-event.clientY)));
filters.opacity(obj,0.7);
obj.style.left = left;
obj.style.top = top;
obj.cX = event.clientX;
obj.cY = event.clientY;
return false;
}
parseOptions = function(style)
{
this.top=0;
this.left=0;
this.width=0;
this.height=0;
this.innerWidth=0;
this.innerHeight=0;
this.outerWidth=0;
this.outerHeight=0;
this.fullscreen=0;//Àüü ȸé Â÷Áö
this.alwaysLowered = 'no';//Ç×»ó±ò¸²
this.alwaysRaised = 'no';//Ç×»óµå·¯³²
this.moveable=0; //·¹À̾îâ¿¡¼¸¸
this.resizable='no';//Å©±âº¯°æ Çã¿ë ¿©ºÎ
this.scrollbars='no';//½ºÅ©·Ñ¹Ù
this.titlebar='yes'; //Á¦¸ñÇ¥½ÃÁÙ
this.layerWindow = 'no'; //·¹À̾îâ
var options = style.split(",");
for(var i = 0; i < options.length; i+=1)
{
var name,value;
var option = options[i].split("=");
if(option.length == 2)
{
name = option[0].trim();
value = option[1].trim();
}
switch(name)
{
case "top":this.top = value;break;
case "left":this.left = value;break;
case "width":this.width = value;break;
case "height":this.height = value;break;
case "fullscreen":this.fullscreen = value;break;
case "moveable":this.moveable = value;break;
case "resizable":this.resizable = value;break;
case "titlebar":this.titlebar = value;break;
}
}
}
createDivWin = function(location,id,style)
{
if(document.getElementById(id) != null) return;
this.id = id;
this.style = style;
this.getWindow = function(){return document.getElementById(id);};
this.getContainer = function()
{
var obj = this.getWindow();
obj = obj.children[0].children[0].children[1].children[0];
return obj;
};
this.setTitle = function(){};
this.setTop=function(num){this.getWindow().style.top=num;};
this.setLeft=function(num){this.getWindow().style.left=num;};
this.setWidth = function(num){this.getWindow().style.width=num;};
this.setHeight = function(num){this.getWindow().style.height=num;};
this.close = function()
{
this.getWindow().close();
}
this.setVisible = function(b)
{
if(this.getWindow() == null)
{
this.init();
}
this.getWindow().setVisible(b);
}
this.getVisible = function()
{
if(this.getWindow() == null)
{
return false;
}
return this.getWindow().getVisible();
}
this.setHTML = function(str)
{
var obj = this.getContainer();
obj.innerHTML = str;
}
this.setLocation = function(location)
{
if(location!='')
{
var lv = new LoadVars();
lv.win = this;
lv.onLoad = function()
{
if(this.win.getVisible() == false) this.win.init();
this.win.setHTML(this.getResponseText());
this.win.setVisible(true);
}
lv.open("get",location);
lv.send(null);
}
}
this.formAction = function(f)
{
var lv = new LoadVars();
lv.win = this;
lv.onLoad = function()
{
this.win.setVisible(true);
this.win.setHTML(this.getResponseText());
}
var content = lv.setForm(f);
lv.send(content);
}
this.init =
function(){//init
document.body.insertAdjacentHTML('afterBegin','
'
+'
'
+''
+''
+''
+' '
+' '
+''
+' = '
+'X´Ý±â '
+' '
+' '
+'
'
+' '
+' '
+''
+' '
+' '
+'
');
this.getWindow().getWindow = this.getWindow;
this.getWindow().getContainer = this.getContainer;
this.getWindow().minimize = function()
{
if(this.getContainer().style.display == 'none')
{
this.getContainer().style.display = 'block';
}
else
{
this.getContainer().style.display = 'none';
}
};
this.getWindow().setVisible = function(b)
{
var obj = this.getWindow();
if(b)
{
obj.style.display = 'block';
}
else
{
obj.style.display = 'none';
}
}
this.getWindow().getVisible = function()
{
var obj = this.getWindow();
return obj.style.display == 'block';
}
this.getWindow().close = function()
{
this.getWindow().removeNode(true);
};
this.setLocation(location);
}// end init
this.init();
return this;
};// end DivWindow
DivWin = function(location,id,style)
{
if(typeof(style) == "undefined")
{
style="";
}
var options = new parseOptions(style);
return new createDivWin(location,id,options);
}
window.DivWin = DivWin;
//==================================================================================================================
function styleCopy(obj, style)
{
if(typeof(style) != 'undefined'
&& style != '')
{
var arrStyle = style.split(";");
for(var i = 0; i < arrStyle.length; i+=1)
{
var pair = arrStyle[i].split(":");
if(pair[0]!='')
{
pair[0] = pair[0].trim();
pair[0] = pair[0].replace(/(-.)/g,
function($1)
{
return $1.charAt(1).toUpperCase();
});
pair[1] = pair[1].trim();
obj.style[pair[0]] = pair[1];
}
}
}
}
function templateEvent(node, config)
{
return {
click:node.attributes.getNamedItem('click').text,
mout:node.attributes.getNamedItem('mout').text,
mover:node.attributes.getNamedItem('mover').text,
mdown:node.attributes.getNamedItem('mdown').text
};
}
menuSkin =
{
defaultMenu:function(nodes,depth,config,subConfig)
{
var ret_val='';
for(var i = 0; i < nodes.length; i+=1)
{
var sub = nodes[i].selectNodes('./sub');
ret_val += '
'
+''
+''
+'';
}
else
{
ret_val += ' onmouseover="'+event.mover+';showSubMenu(this,displaySubMenu);">';
}
ret_val += '';
ret_val += '';
// ¾ÆÀÌÄÜ
var nodesTmp = nodes[i].selectNodes('./icon');
if(nodesTmp.length)
{
node = nodesTmp[0];
var icon = templateEvent(node, config);
if(icon.mout!='')
{
ret_val +=' ';
}
}
ret_val+=''
+' '
+'';
//////////////////////////////////////////////////////////////////////
var node = nodes[i].selectSingleNode('./link');
var link =
{
href:node.text,
target:node.attributes.getNamedItem('target').text
}
if(link.target == '')
{
link.target = '_self';
}
if(link.href != '')
{
ret_val += '';// Ÿ°Ù´Ý±â/´Ý±â
}// end if
ret_val += nodes[i].selectSingleNode('./text').text;
if(link.href != '')
{
ret_val += ' ';//¸µÅ©´Ý±â
}// end if
//////////////////////////////////////////////////////////////////////
ret_val += ' '
ret_val += '';
//¼ºê ¸Þ´º
if(sub.length)
{
if(config.treeclose != '')
{
ret_val +=' ';
}
}
ret_val +=' '
+' '
+'
'
+' '
node = nodes[i].selectSingleNode('./event');
var event = templateEvent(node, config);
ret_val+=''
+' ';
if(sub.length)
{
subTmp = nodes[i].selectSingleNode('./sub');
subStyle = subTmp.selectSingleNode('./style');
var subConfigTmp=
{
issub:true,
width:subTmp.attributes.getNamedItem('width').text,
height:subTmp.attributes.getNamedItem('height').text,
offsetX:subTmp.attributes.getNamedItem('offsetX').text,
offsetY:subTmp.attributes.getNamedItem('offsetY').text,
isvertical:subTmp.attributes.getNamedItem('isvertical').text,
style_mover:subStyle.attributes.getNamedItem('mover').text,
style_mdown:subStyle.attributes.getNamedItem('mdown').text,
style_mout:subStyle.attributes.getNamedItem('mout').text,
style_click:subStyle.attributes.getNamedItem('click').text
}
ret_val+='';
var style = subConfigTmp.style_mout;
if(subConfigTmp.offsetX != 0
|| subConfigTmp.offsetY != 0)
{
style += 'position:absolute;left:'+subConfigTmp.offsetX+';top:'+subConfigTmp.offsetY+';';
}
ret_val+='
';
ret_val+='';
node = sub[0];
ret_val += menuSkin.defaultMenu(node.selectNodes('./menu'),depth+1,config,subConfigTmp);
ret_val +='
';
}
ret_val += ''
+' '
+' '
+'
';
}
return ret_val;
},// end defaultMenu
treeMenu:function(nodes,depth,config,subConfig)
{
var ret_val='';
for(var i = 0; i < nodes.length; i+=1)
{
var node = nodes[i].selectSingleNode('./link');
sub = nodes[i].selectNodes('./sub');
ret_val += '
'
+''
+'';
var rnd = Math.round(Math.random()*10000000000);
ret_val +='';
ret_val += '';
ret_val += '';
for(var j = 0; j < depth; j+=1)
{
ret_val += ' ';
}
if(sub.length)
{
var treenclose = config.treeopen;
var treeopen = config.treeclose;
ret_val +=' ';
}
else if(subConfig.issub)
{
ret_val += ' ';
}
var nodesTmp = nodes[i].selectNodes('./icon');
if(nodesTmp.length)
{
node = nodesTmp[0];
var icon = templateEvent(node, config);
if(icon.mout!='')
{
var mout = icon.mover == '' ? icon.mout:icon.mover;
var mover = icon.mout;
ret_val +=' ';
}
}
ret_val+=''
+' '
+'';
//////////////////////////////////////////////////////////////////////
var node = nodes[i].selectSingleNode('./link');
var link =
{
href:node.text,
target:node.attributes.getNamedItem('target').text
}
if(link.target == '')
{
link.target = '_self';
}
if(link.href != '')
{
ret_val += '';// Ÿ°Ù´Ý±â/´Ý±â
}// end if
ret_val += nodes[i].selectSingleNode('./text').text;
if(link.href != '')
{
ret_val += ' ';//¸µÅ©´Ý±â
}// end if
//////////////////////////////////////////////////////////////////////
ret_val += ''
+' '
+'';
if(sub.length)
{
//ret_val +='';
}
ret_val +=' '
+' '
+'
'
+' '
node = nodes[i].selectSingleNode('./event');
var event = templateEvent(node, config);
ret_val+=' ';
ret_val+='';
ret_val+=''
+'';
if(sub.length)
{
subStyle = sub[0].selectSingleNode('./style');
var subConfigTmp=
{
issub:true,
width:sub[0].attributes.getNamedItem('width').text,
height:sub[0].attributes.getNamedItem('height').text,
offsetX:sub[0].attributes.getNamedItem('offsetX').text,
offsetY:sub[0].attributes.getNamedItem('offsetY').text,
isvertical:sub[0].attributes.getNamedItem('isvertical').text,
style_mover:subStyle.attributes.getNamedItem('mover').text,
style_mdown:subStyle.attributes.getNamedItem('mdown').text,
style_mout:subStyle.attributes.getNamedItem('mout').text,
style_click:subStyle.attributes.getNamedItem('click').text
}
ret_val+='';
var style = subConfigTmp.style_mout;
if(subConfigTmp.offsetX != 0
|| subConfigTmp.offsetY != 0)
{
style += 'position:absolute;left:'+subConfigTmp.offsetX+';top:'+subConfigTmp.offsetY+';';
}
ret_val+='
';
ret_val+='';
node = sub[0];
ret_val += menuSkin.treeMenu(node.selectNodes('./menu'),depth+1,config,subConfigTmp);
ret_val +='
';
}
ret_val += ''
+' '
+' '
+'
';
}
return ret_val;
}, // end treeMenu
selectMenu:function(nodes,depth,config,subConfig)
{
var ret_val = '
';
ret_val += ''+ config.name +' ';
for(var i = 0; i < nodes.length; i+=1)
{
var menuName = nodes[i].selectSingleNode('./text').text;
var node = nodes[i].selectSingleNode('./link');
var menuLink =
{
href:node.text,
target:node.attributes.getNamedItem('target').text
}
if(menuLink.target == '')
{
menuLink.target = '_self';
}
ret_val += ''+ menuName +' ';
}
return ret_val;
}// end selectMenu
}// end menuSkin
function templateMenus(xml)
{
var config =
{
name:xml.selectSingleNode('/menus/config/name').text,
skin:xml.selectSingleNode('/menus/config/skin').text,
target:xml.selectSingleNode('/menus/config/target').text,
isvertical:xml.selectSingleNode('/menus/config/isvertical').text,
treeopen:xml.selectSingleNode('/menus/config/treeopen').text,
treeclose:xml.selectSingleNode('/menus/config/treeclose').text
}
var subConfig=
{
issub:false,
width:0,
height:0,
offsetx:0,
isvertical:config.isvertical,
style_mover:"",
style_mdown:"",
style_mout:"",
style_click:""
}
return menuSkin[config.skin](xml.selectNodes('/menus/menu'),0,config,subConfig);
}
function getMenu(name)
{
var url = "./menu/"+name+".xml";
var xml_doc = openDOM(url);
return templateMenus(xml_doc);
}
function showSubMenu(obj, fn)
{
var submenus;
styleCopy(obj, obj.stylemover);
submenus = (obj.parentElement.parentElement.children[1].children[0]);
obj.onmouseout =
function()
{
styleCopy(obj,obj.getAttribute("stylemout"));
}
if(submenus)
{
submenus.parentMenu = obj;
fn(submenus, "block");
if(obj.Timeout) clearTimeout(obj.Timeout);
obj.onmouseout = function()
{
styleCopy(obj,obj.stylemout);
obj.Timeout = setTimeout(function(){fn(submenus,"none");}, 200);
}
}
}// end function
function showTreeSubMenu(obj, fn, rnd)
{
var submenus;
submenus = (obj.parentElement.parentElement.parentElement.children[1].children[0].children[0]);
if(submenus)
{
submenus.parentMenu = obj;
fn(submenus,rnd);
}
}// end function
function swapTree(obj, rnd)
{
var icon = document.getElementById('icon_'+rnd);
var tree = document.getElementById('tree_'+rnd);
var old;
if(icon != null
&& icon.getAttribute('iconmover')!='')
{
old = icon.src;
icon.src = icon.getAttribute('iconmover');
icon.setAttribute('iconmover',old);
}
if(tree != null
&& tree.treeopen!='')
{
old = tree.src;
tree.src = tree.getAttribute('treeopen');
tree.setAttribute('treeopen',old);
}
obj.style.display = obj.style.display == 'none' ? 'block':'none';
}
function objectDisplay(obj, val)
{
obj.style.display = val;
obj.onmouseover = function()
{
clearTimeout(this.parentMenu.Timeout);
}
obj.onmouseout = function()
{
this.parentMenu.onmouseout();
}
}// end function
function displaySubMenu(obj, val)
{
var To = document.getElementById("DisplaySubMenu1");
if(val != "none")
{
To.innerHTML = obj.innerHTML;
}
}// end function
//==================================================================================================================
// ºü¸¥ ÅÂ±× È®Àå±â
var tagExtender =
{
// plugins´Â ºê¶ó¿ìÀú ȣȯ¼º ¹®Á¦·Î Á¦°Å
names : ['anchors','applets','embeds','frames','images','forms','links'],
plugins:
{
anchors : new Array(),
applets : new Array(),
embeds: new Array(),
frames: new Array(),
images : new Array(),
forms : new Array(),
links : new Array()
},
addPlugin:function(name, fname, f)
{
// name °´Ã¼¸í
// fname ÇÔ¼ö¸í
// f ÇÔ¼ö
var pair = new Array(fname,f);
if(tagExtender.replacePlugin(name,fname)==0)
{
// ±³Ã¼µÇÁö ¾ÊÀº °æ¿ì »õ·Î Ãß°¡ÇÑ´Ù.
tagExtender.plugins[name].push(pair);
}
},
replacePlugin:function(name, fname, f)
{
for(var i = 0; i < tagExtender.plugins[name].length; i++)
{
if(tagExtender.plugins[name][i][0] == fname)
{
tagExtender.plugins[name][i][1] = f;
return 1; // ±³Ã¼ ¼º°ø
}
}
return 0; // ±³Ã¼µÇÁö ¾ÊÀ½
},
removePlugin:function(name, fname)
{
// Áö¿ì´Â ´ë½Å ºóÇÔ¼ö¸¦ ´ëÀÔÇÑ´Ù.
return tagExtender.replacePlugin(name,fname, function(){});
},
run:function()
{
for(var n = 0; n < tagExtender.names.length; n++)
{
var name = tagExtender.names[n];
var objects = document[name];
for(var i = 0; i < objects.length; i++)
{
// °íÀÇÀûÀ¸·Î »ç¿ëµÇÁö ¾ÊÀ» ¸¸ÇÑ À̸§À¸·Î ¼Ó¼ºÀ̸§À» ÁØ´Ù.
var extended = "FTDFYXDFHD";
var obj = objects[i];
try{
if(obj.getAttribute(extended) != null) continue;
}catch(e){
continue;
}
for(var j = 0; j < tagExtender.plugins[name].length; j++)
{
tagExtender.plugins[name][j][1](obj);
}
obj.setAttribute(extended,true);
}// end for
}
}// end function
}
addEvent(document,'readystatechange',tagExtender.run);
//==================================================================================================================
/*
====================================================================================================================
Å©·Î½º ºê¶ó¿ìÀú À¯Æ¿
*¿ì¼±¼øÀ§*
ÆÄÀÌ¾îÆø½º
MSºê¶ó¿ìÀú
====================================================================================================================
*/
function createDOM()
{
var objDOM = null;
if(document.implementation
&& document.implementation.createDocument)
{
objDOM = document.implementation.createDocument("","", null);
objDOM.addEventListener("load", function(){this.readyState = 4;}, false);
objDOM.__load__ = objDOM.load;
objDOM.load = function(strURL){this.readyState = 1;this.__load__(strURL);}
}
else
{
objDOM = new ActiveXObject('MSXML.DOMDocument');
}
objDOM.async = false;
return objDOM;
}// end function
function openDOM(url)
{
var dom = new createDOM();
dom.load(url);
return dom;
}// end function
if(!window.addEventListener)
{
window.addEventListener = function(type, func, useCapture)
{
if(typeof(b) == 'undefined') return;
window.attachEvent("on"+type, func);
}
window.removeEventListener = function(type, func, useCapture)
{
if(typeof(b) == 'undefined') return;
window.detachEvent("on"+type, func);
}
}// end if
if(typeof(event) == 'undefined')
{
document.captureEvents(
Event.MOUSEMOVE|
Event.MOUSEUP|
Event.MOUSEOVER|
Event.MOUSEDOWN|
Event.MOUSEDRAG);
event =
{
clientX:0,clientY:0
};
window.event = event;
addEvent(document,'mousemove',
function(e)
{
event.clientX = e.pageX;
event.clientY = e.pageY;
});
}
function addEvent( obj, type, fn )
{
//addEvent(document, 'load', function(){alert('')});
if(typeof(obj) != 'object')
{
alert('addEvent, °´Ã¼°¡ ¾Æ´Õ´Ï´Ù.');
}
if(typeof(type) != 'string')
{
alert('addEvent, À̺¥Æ®¸íÀ» ÀÔ·ÂÇϼ¼¿ä.');
}
if(typeof(fn) != 'function')
{
alert('addEvent, À̺¥Æ® ó¸® ÇÔ¼ö°¡ ¾Æ´Õ´Ï´Ù.');
}
if (obj.addEventListener)
{
obj.addEventListener( type, fn, false );
}
else if (window.attachEvent)
{
obj.attachEvent( 'on'+type, fn);
}
}// end function
function removeEvent( obj, type, fn )
{
//removeEvent(document, 'load', fn);
if(obj.removeEventListener)
{
obj.removeEventListener( type, fn, false );
}
else if (window.detachEvent)
{
obj.detachEvent( 'on'+type, fn );
}
}// end function
/*
==================================================================================================================
¿øÇü Á¤ÀÇ
MS°è¿ ºê¶ó¿ìÀú¿¡¼´Â ºê¶ó¿ìÀú °íÀ¯ °´Ã¼µé¿¡ ´ëÇÑ ¿øÇüÀ» ÀçÁ¤ÀÇ ÇÒ ¼ö ¾øÀ¸¹Ç·Î
ÆÄÀÌ¾îÆø½º,¸ðÁú¶ó °è¿ ºê¶ó¿ìÀú¿¡¼ MSºê¶ó¿ìÀúÀÇ Äڵ带 ½ÇÇà ÇÒ ¼ö ÀÖµµ·Ï ó¸® ÇÏ¿´À½.
==================================================================================================================
*/
if (document.implementation.createDocument)
{
Document.prototype.readyState = "0";
Document.prototype.frames = window.frames;
function changeReadyState(objDOMDocument, iReadyState)
{
objDOMDocument.readyState = iReadyState;
if (objDOMDocument.onreadystatechange != null
&& typeof(objDOMDocument.onreadystatechange) == "function")
objDOMDocument.onreadystatechange();
}
if(!Document.prototype.loadXML)
{
Document.prototype.loadXML = function(strXML)
{
strXML = strXML.replace(/<\?xml.+\?>/gi, "");//ÆÄ½ÌÇϱâÀü¿¡ XMLÇì´õ Á¦°Å
changeReadyState(this, 1);
var objDOMParser = new DOMParser();
var objDoc = objDOMParser.parseFromString(strXML, "text/xml");
while (this.hasChildNodes()) this.removeChild(this.lastChild);
for (var i=0; i < objDoc.childNodes.length; i++)
{
var objImportedNode = this.importNode(objDoc.childNodes[i], true);
this.appendChild(objImportedNode);
}
changeReadyState(this, 4);
}
}
if (!Document.prototype.selectSingleNode) {
try{var xpath = new XPathEvaluator();}
catch(e){}
Document.prototype.selectSingleNode = function (path)
{
return xpath.evaluate(path, this, this._ns, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}// end function
Document.prototype.selectNodes = function (path)
{
var result = xpath.evaluate(path, this, this._ns, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var i, nodes = [];
for (i=0; i';
if (!emptyElements[node.nodeName])
{
html += node.innerHTML;
html += '<\/' + node.nodeName + '>';
}// end if
}// end if
else
{
switch (node.nodeName)
{
case 'TEXTAREA':
for (var a = 0; a < node.attributes.length; a+=1)
if (node.attributes[a].nodeName.toLowerCase() != 'value')
{
html += ' ' + node.attributes[a].nodeName.toUpperCase() +
'="' + node.attributes[a].nodeValue + '"';
}
else
{
var content = node.attributes[a].nodeValue;
}
html += '>';
html += content;
html += '<\/' + node.nodeName + '>';
break;
}// end switch
} // end if
break;
case Node.TEXT_NODE:
html += node.nodeValue;
break;
case Node.COMMENT_NODE:
html += '';
break;
}// switch
return html;
});// end prototype
HTMLElement.prototype.__defineSetter__("innerText",
function (sText)
{
var s = "" + sText;
this.innerHTML = s.replace(/\&/g, "&").replace(//g,">");
});
HTMLElement.prototype.__defineGetter__("innerText",
function ()
{
var s = this.innerHTML;
return s ? s.replace(/<[^>]+>/g, "") : "";
});
HTMLElement.prototype.insertAdjacentElement =
function(where,parsedNode)
{
switch (where)
{
case 'beforeBegin':
this.parentNode.insertBefore(parsedNode,this)
break;
case 'afterBegin':
this.insertBefore(parsedNode,this.firstChild);
break;
case 'beforeEnd':
this.appendChild(parsedNode);
break;
case 'afterEnd':
if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling);
else this.parentNode.appendChild(parsedNode);
break;
}
}
HTMLElement.prototype.insertAdjacentHTML =
function(where,htmlStr)
{
var r = this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML = r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML)
}
HTMLElement.prototype.insertAdjacentText =
function(where,txtStr)
{
var parsedText = document.createTextNode(txtStr)
this.insertAdjacentElement(where,parsedText)
}
}
Attr.prototype.__defineGetter__('text', function(){return this.nodeValue});
Text.prototype.__defineGetter__('text', function(){return this.nodeValue});
}
// User define function
function gotoSelectMenuLink(value)
{
if(typeof(value) != 'undefined' && value.length > 5) {
var value = value.split('||__||');
var href = value[0];
var target = value[1];
if(target == "_blank"){
window.open(href,"new","");
}
else if(target == "_self"){
location.href = href;
}
else {
eval(target+".location='"+href+"'");
}
}
}