/** 
 * x.js compiled from X 4.0 with XC 0.27b. 
 * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com 
 * Copyright 2001-2005 Michael Foster (Cross-Browser.com)
 **/

var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
  var i=xUA.indexOf('opera');
  if(i!=-1){
    var v=parseInt(xUA.charAt(i+6));
    xOp7Up=v>=7;
    xOp6Dn=v<7;
  }
}
else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
  xIE4Up=parseFloat(navigator.appVersion)>=4;
  xIE4=xUA.indexOf('msie 4')!=-1;
  xIE5=xUA.indexOf('msie 5')!=-1;
  xIE6=xUA.indexOf('msie 6')!=-1;
}
else if(document.layers){xNN4=true;}
var xMac=xUA.indexOf('mac')!=-1;
var xFF=xUA.indexOf('firefox')!=-1;

// (element, event(without 'on'), event listener(function name)[, caption])
function xAddEventListener(e,eT,eL,cap)
{
  if(!(e=xGetElementById(e))) return;
  eT=eT.toLowerCase();
  if((!xIE4Up && !xOp7Up) && e==window) {
    if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }
    if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }
  }
  var eh='e.on'+eT+'=eL';
  if(e.addEventListener) e.addEventListener(eT,eL,cap);
  else if(e.attachEvent) e.attachEvent('on'+eT,eL);
  else eval(eh);
}
// called only from the above
function xResizeEvent()
{
  if (window.xREL) setTimeout('xResizeEvent()', 250);
  var cw = xClientWidth(), ch = xClientHeight();
  if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }
}

function xScrollEvent()
{
  if (window.xSEL) setTimeout('xScrollEvent()', 250);
  var sl = xScrollLeft(), st = xScrollTop();
  if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }
}

function xAppendChild(oParent, oChild)
{
  if (oParent.appendChild) return oParent.appendChild(oChild);
  else return null;
}

function xClientHeight()
{
  var h=0;
  if(xOp6Dn) h=window.innerHeight;
  else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
    h=document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    h=document.body.clientHeight;
  else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
    h=window.innerHeight;
    if(document.width>window.innerWidth) h-=16;
  }
  return h;
}

function xClientWidth()
{
  var w=0;
  if(xOp6Dn) w=window.innerWidth;
  else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)
    w=document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    w=document.body.clientWidth;
  else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
    w=window.innerWidth;
    if(document.height>window.innerHeight) w-=16;
  }
  return w;
}

function xCreateElement(sTag)
{
  if (document.createElement) return document.createElement(sTag);
  else return null;
}

function xDef()
{
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}

function xDeleteCookie(name, path)
{
  if (xGetCookie(name)) {
    document.cookie = name + "=" +
                    "; path=" + ((!path) ? "/" : path) +
                    "; expires=" + new Date(0).toGMTString();
  }
}

function xDisplay(e,s)
{
  if(!(e=xGetElementById(e))) return null;
  if(e.style && xDef(e.style.display)) {
    if (xStr(s)) e.style.display = s;
    return e.style.display;
  }
  return null;
}

function xEvent(evt) // object prototype
{
  var e = evt || window.event;
  if(!e) return;
  if(e.type) this.type = e.type;
  if(e.target) this.target = e.target;
  else if(e.srcElement) this.target = e.srcElement;

  // Section B
  if (e.relatedTarget) this.relatedTarget = e.relatedTarget;
  else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement;
  else if (e.type == 'mouseout') this.relatedTarget = e.toElement;
  // End Section B

  if(xOp6Dn) { this.pageX = e.clientX; this.pageY = e.clientY; }
  else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }
  else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }

  // Section A
  if (xDef(e.offsetX,e.offsetY)) {
    this.offsetX = e.offsetX;
    this.offsetY = e.offsetY;
  }
  else if (xDef(e.layerX,e.layerY)) {
    this.offsetX = e.layerX;
    this.offsetY = e.layerY;
  }
  else {
    this.offsetX = this.pageX - xPageX(this.target);
    this.offsetY = this.pageY - xPageY(this.target);
  }
  // End Section A
  
  if (e.keyCode) { this.keyCode = e.keyCode; } // for moz/fb, if keyCode==0 use which
  else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }

  this.shiftKey = e.shiftKey;
  this.ctrlKey = e.ctrlKey;
  this.altKey = e.altKey;
}

function xFirstChild(e, t)
{
  var c = e ? e.firstChild : null;
  if (t) while (c && c.nodeName != t) { c = c.nextSibling; }
  else while (c && c.nodeType != 1) { c = c.nextSibling; }
  return c;
}

function xGetBodyWidth() {
  var cw = xClientWidth();
  var sw = window.document.body.scrollWidth;
  return cw>sw?cw:sw;
}

function xGetBodyHeight() {
  var cw = xClientHeight();
  var sw = window.document.body.scrollHeight;
  return cw>sw?cw:sw;
}

function xGetComputedStyle(oEle, sProp, bInt)
{
  var s, p = 'undefined';
  var dv = document.defaultView;
  if(dv && dv.getComputedStyle){
    s = dv.getComputedStyle(oEle,'');
    if (s) p = s.getPropertyValue(sProp);
  }
  else if(oEle.currentStyle) {
    // convert css property name to object property name for IE
    var a = sProp.split('-');
    sProp = a[0];
    for (var i=1; i<a.length; ++i) {
      c = a[i].charAt(0);
      sProp += a[i].replace(c, c.toUpperCase());
    }   
    p = oEle.currentStyle[sProp];
  }
  else return null;
  return bInt ? (parseInt(p) || 0) : p;
}

function xGetCookie(name)
{
  var value=null, search=name+"=";
  if (document.cookie.length > 0) {
    var offset = document.cookie.indexOf(search);
    if (offset != -1) {
      offset += search.length;
      var end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      value = unescape(document.cookie.substring(offset, end));
    }
  }
  return value;
}

function xGetElementById(e)
{
  if(typeof(e)!='string') return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else e=null;
  return e;
}

function xGetElementsByAttribute(sTag, sAtt, sRE, fn)
{
  var a, list, found = new Array(), re = new RegExp(sRE, 'i');
  list = xGetElementsByTagName(sTag);
  for (var i = 0; i < list.length; ++i) {
    a = list[i].getAttribute(sAtt);
    if (!a) {a = list[i][sAtt];}
    if (typeof(a)=='string' && a.search(re) != -1) {
      found[found.length] = list[i];
      if (fn) fn(list[i]);
    }
  }
  return found;
}

function xGetElementsByClassName(c,p,t,f)
{
  var found = new Array();
  var re = new RegExp('\\b'+c+'\\b', 'i');
  var list = xGetElementsByTagName(t, p);
  for (var i = 0; i < list.length; ++i) {
    if (list[i].className && list[i].className.search(re) != -1) {
      found[found.length] = list[i];
      if (f) f(list[i]);
    }
  }
  return found;
}

function xGetElementsByTagName(t,p)
{
  var list = null;
  t = t || '*';
  p = p || document;
  if (xIE4 || xIE5) {
    if (t == '*') list = p.all;
    else list = p.all.tags(t);
  }
  else if (p.getElementsByTagName) list = p.getElementsByTagName(t);
  return list || new Array();
}

function xGetURLArguments()
{
  var idx = location.href.indexOf('?');
  var params = new Array();
  if (idx != -1) {
    var pairs = location.href.substring(idx+1, location.href.length).split('&');
    for (var i=0; i<pairs.length; i++) {
      nameVal = pairs[i].split('=');
      params[i] = nameVal[1];
      params[nameVal[0]] = nameVal[1];
    }
  }
  return params;
}

function xHeight(e,h)
{
  if(!(e=xGetElementById(e))) return 0;
  if (xNum(h)) {
    if (h<0) h = 0;
    else h=Math.round(h);
  }
  else h=-1;
  var css=xDef(e.style);
  if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
    h = xClientHeight();
  }
  else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
    if(h>=0) {
      var pt=0,pb=0,bt=0,bb=0;
      if (document.compatMode=='CSS1Compat') {
        var gcs = xGetComputedStyle;
        pt=gcs(e,'padding-top',1);
        if (pt !== null) {
          pb=gcs(e,'padding-bottom',1);
          bt=gcs(e,'border-top-width',1);
          bb=gcs(e,'border-bottom-width',1);
        }
        // Should we try this as a last resort?
        // At this point getComputedStyle and currentStyle do not exist.
        else if(xDef(e.offsetHeight,e.style.height)){
          e.style.height=h+'px';
          pt=e.offsetHeight-h;
        }
      }
      h-=(pt+pb+bt+bb);
      if(isNaN(h)||h<0) return null;
      else e.style.height=h+'px';
    }
    h=e.offsetHeight;
  }
  else if(css && xDef(e.style.pixelHeight)) {
    if(h>=0) e.style.pixelHeight=h;
    h=e.style.pixelHeight;
  }
  return h;
}

function xHex(sn, digits, prefix)
{
  var p = '';
  var n = Math.ceil(sn);
  if (prefix) p = prefix;
  n = n.toString(16);
  for (var i=0; i < digits - n.length; ++i) {
    p += '0';
  }
  return p + n;
}

function xHide(e){return xVisibility(e,0);}

function xInnerHtml(e,h)
{
  if(!(e=xGetElementById(e)) || !xStr(e.innerHTML)) return null;
  var s = e.innerHTML;
  if (xStr(h)) {e.innerHTML = h;}
  return s;
}

function xLeft(e, iX)
{
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if (css && xStr(e.style.left)) {
    if(xNum(iX)) e.style.left=iX+'px';
    else {
      iX=parseInt(e.style.left);
      if(isNaN(iX)) iX=0;
    }
  }
  else if(css && xDef(e.style.pixelLeft)) {
    if(xNum(iX)) e.style.pixelLeft=iX;
    else iX=e.style.pixelLeft;
  }
  return iX;
}

function xMoveTo(e,x,y)
{
  xLeft(e,x);
  xTop(e,y);
}

function xName(e)
{
  if (!e) return e;
  else if (e.id && e.id != "") return e.id;
  else if (e.name && e.name != "") return e.name;
  else if (e.nodeName && e.nodeName != "") return e.nodeName;
  else if (e.tagName && e.tagName != "") return e.tagName;
  else return e;
}

function xNextSib(e,t)
{
  var s = e ? e.nextSibling : null;
  if (t) while (s && s.nodeName != t) { s = s.nextSibling; }
  else while (s && s.nodeType != 1) { s = s.nextSibling; }
  return s;
}

function xNum()
{
  for(var i=0; i<arguments.length; ++i){if(isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;}
  return true;
}

function xOffsetLeft(e)
{
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetLeft)) return e.offsetLeft;
  else return 0;
}

function xOffsetTop(e)
{
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetTop)) return e.offsetTop;
  else return 0;
}

function xPad(s,len,c,left)
{
  if(typeof s != 'string') s=s+'';
  if(left) {for(var i=s.length; i<len; ++i) s=c+s;}
  else {for (i=s.length; i<len; ++i) s+=c;}
  return s;
}

function xPageX(e)
{
  if (!(e=xGetElementById(e))) return 0;
  var x = 0;
  while (e) {
    if (xDef(e.offsetLeft)) x += e.offsetLeft;
    e = xDef(e.offsetParent) ? e.offsetParent : null;
  }
  return x;
}

function xPageY(e)
{
  if (!(e=xGetElementById(e))) return 0;
  var y = 0;
  while (e) {
    if (xDef(e.offsetTop)) y += e.offsetTop;
    e = xDef(e.offsetParent) ? e.offsetParent : null;
  }
//  if (xOp7Up) return y - document.body.offsetTop; // v3.14, temporary hack for opera bug 130324 (reported 1nov03)
  return y;
}

function xParent(e, bNode)
{
  if (!(e=xGetElementById(e))) return null;
  var p=null;
  if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
  else if (xDef(e.parentNode)) p=e.parentNode;
  else if (xDef(e.parentElement)) p=e.parentElement;
  return p;
}

function xPreventDefault(e)
{
  if (e && e.preventDefault) e.preventDefault()
  else if (window.event) window.event.returnValue = false;
}

function xPrevSib(e,t)
{
  var s = e ? e.previousSibling : null;
  if (t) while(s && s.nodeName != t) {s=s.previousSibling;}
  else while(s && s.nodeType != 1) {s=s.previousSibling;}
  return s;
}

function xRemoveEventListener(e,eT,eL,cap)
{
  if(!(e=xGetElementById(e))) return;
  eT=eT.toLowerCase();
  if((!xIE4Up && !xOp7Up) && e==window) {
    if(eT=='resize') { window.xREL=null; return; }
    if(eT=='scroll') { window.xSEL=null; return; }
  }
  var eh='e.on'+eT+'=null';
  if(e.removeEventListener) e.removeEventListener(eT,eL,cap);
  else if(e.detachEvent) e.detachEvent('on'+eT,eL);
  else eval(eh);
}

function xResizeTo(e,w,h)
{
  xWidth(e,w);
  xHeight(e,h);
}

function xScrollLeft(e, bWin)
{
  var offset=0;
  if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
    var w = window;
    if (bWin && e) w = e;
    if(w.document.documentElement && w.document.documentElement.scrollLeft) offset=w.document.documentElement.scrollLeft;
    else if(w.document.body && xDef(w.document.body.scrollLeft)) offset=w.document.body.scrollLeft;
  }
  else {
    e = xGetElementById(e);
    if (e && xNum(e.scrollLeft)) offset = e.scrollLeft;
  }
  return offset;
}

function xScrollTop(e, bWin)
{
  var offset=0;
  if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
    var w = window;
    if (bWin && e) w = e;
    if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;
    else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;
  }
  else {
    e = xGetElementById(e);
    if (e && xNum(e.scrollTop)) offset = e.scrollTop;
  }
  return offset;
}

function xSetCookie(name, value, expire, path)
{
  document.cookie = name + "=" + escape(value) +
                    ((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
                    "; path=" + ((!path) ? "/" : path);
}

function xShow(e) {return xVisibility(e,1);}


function xStr(s)
{
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}
  return true;
}

function xTop(e, iY)
{
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if(css && xStr(e.style.top)) {
    if(xNum(iY)) e.style.top=iY+'px';
    else {
      iY=parseInt(e.style.top);
      if(isNaN(iY)) iY=0;
    }
  }
  else if(css && xDef(e.style.pixelTop)) {
    if(xNum(iY)) e.style.pixelTop=iY;
    else iY=e.style.pixelTop;
  }
  return iY;
}

function xVisibility(e, bShow)
{
  if(!(e=xGetElementById(e))) return null;
  if(e.style && xDef(e.style.visibility)) {
    if (xDef(bShow)) e.style.visibility = bShow ? 'visible' : 'hidden';
    return e.style.visibility;
  }
  return null;
}

function xWidth(e,w)
{
  if(!(e=xGetElementById(e))) return 0;
  if (xNum(w)) {
    if (w<0) w = 0;
    else w=Math.round(w);
  }
  else w=-1;
  var css=xDef(e.style);
  if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
    w = xClientWidth();
  }
  else if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
    if(w>=0) {
      var pl=0,pr=0,bl=0,br=0;
      if (document.compatMode=='CSS1Compat') {
        var gcs = xGetComputedStyle;
        pl=gcs(e,'padding-left',1);
        if (pl !== null) {
          pr=gcs(e,'padding-right',1);
          bl=gcs(e,'border-left-width',1);
          br=gcs(e,'border-right-width',1);
        }
        // Should we try this as a last resort?
        // At this point getComputedStyle and currentStyle do not exist.
        else if(xDef(e.offsetWidth,e.style.width)){
          e.style.width=w+'px';
          pl=e.offsetWidth-w;
        }
      }
      w-=(pl+pr+bl+br);
      if(isNaN(w)||w<0) return null;
      else e.style.width=w+'px';
    }
    w=e.offsetWidth;
  }
  else if(css && xDef(e.style.pixelWidth)) {
    if(w>=0) e.style.pixelWidth=w;
    w=e.style.pixelWidth;
  }
  return w;
}

function xZIndex(e,uZ)
{
  if(!(e=xGetElementById(e))) return 0;
  if(e.style && xDef(e.style.zIndex)) {
    if(xNum(uZ)) e.style.zIndex=uZ;
    uZ=parseInt(e.style.zIndex);
  }
  return uZ;
}

function xStopPropagation(evt)
{
  if (evt && evt.stopPropagation) evt.stopPropagation();
  else if (window.event) window.event.cancelBubble = true;
}


/**
 * @file common.js
 * @author zero (zero@nzeo.com)
 * @brief 몇가지 유용한 & 기본적으로 자주 사용되는 자바스크립트 함수들 모음
 **/

/**
 * @brief location.href에서 특정 key의 값을 return
 **/
String.prototype.getQuery = function(key) {
    var idx = this.indexOf('?');
    if(idx == -1) return null;
    var query_string = this.substr(idx+1, this.length);
    var args = {}
    query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });

    var q = args[key];
    if(typeof(q)=="undefined") q = "";

    return q;
}

/**
 * @brief location.href에서 특정 key의 값을 return
 **/
String.prototype.setQuery = function(key, val) {
    var idx = this.indexOf('?');
    var uri = this;
    uri = uri.replace(/#$/,'');

    if(idx != -1) {
        uri = this.substr(0, idx);
        var query_string = this.substr(idx+1, this.length);
        var args = new Array();
        query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });

        args[key] = val;

        var q_list = new Array();
        for(var i in args) {
        if( !args.hasOwnProperty(i) ) continue;
            var arg = args[i];
            if(!arg.toString().trim()) continue;

            q_list[q_list.length] = i+'='+arg;
        }
        uri = uri+"?"+q_list.join("&");
    } else {
        if(val.toString().trim()) uri = uri+"?"+key+"="+val;
    }

    uri = uri.replace(/^https:\/\//i,'http://');
    if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && uri.getQuery('act')) {
        var act = uri.getQuery('act');
        for(i=0;i<ssl_actions.length;i++) {
            if(ssl_actions[i]==act) {
                uri = uri.replace(/^http:\/\//i,'https://');
                break;
            }
        }
    }
    return uri;
}

/**
 * @breif replace outerHTML
 **/
function replaceOuterHTML(obj, html) {
    if(obj.outerHTML) {
        obj.outerHTML = html;
    } else {
        var dummy = xCreateElement("div"); 
        xInnerHtml(dummy, html);
        var parent = obj.parentNode;
        while(dummy.firstChild) {
            parent.insertBefore(dummy.firstChild, obj);
        }
        parent.removeChild(obj);
    }
}

/**
 * @breif get outerHTML
 **/
function getOuterHTML(obj) {
    if(obj.outerHTML) return obj.outerHTML;
    var dummy = xCreateElement("div");
    dummy.insertBefore(obj, dummy.lastChild);
    return xInnerHtml(dummy);
}

/**
 * @brief xSleep(micro time) 
 **/
function xSleep(sec) {
    sec = sec / 1000;
    var now = new Date();
    var sleep = new Date();
    while( sleep.getTime() - now.getTime() < sec) {
        sleep = new Date();
    }      
}


/**
 * @brief string prototype으로 trim 함수 추가
 **/
String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

/**
 * @brief 주어진 인자가 하나라도 defined되어 있지 않으면 false return
 **/
function isDef() {
    for(var i=0; i<arguments.length; ++i) {
        if(typeof(arguments[i])=="undefined") return false;
    }
    return true;
}

/**
 * @brief 윈도우 오픈
 * 열려진 윈도우의 관리를 통해 window.focus()등을 FF에서도 비슷하게 구현함
 **/
var winopen_list = new Array();
function winopen(url, target, attribute) {
    try {
        if(target != "_blank" && winopen_list[target]) {
            winopen_list[target].close();
            winopen_list[target] = null;
        }
    } catch(e) {
    }

    if(typeof(target)=='undefined') target = '_blank';
    if(typeof(attribute)=='undefined') attribute = '';
    var win = window.open(url, target, attribute);
    win.focus();
    if(target != "_blank") winopen_list[target] = win;
}

/**
 * @brief 팝업으로만 띄우기 
 * common/tpl/popup_layout.html이 요청되는 제로보드 XE내의 팝업일 경우에 사용
 **/
function popopen(url, target) {
    if(typeof(target)=="undefined") target = "_blank";
    winopen(url, target, "left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no");
}

/**
 * @brief 메일 보내기용
 **/
function sendMailTo(to) {
    location.href="mailto:"+to;
}

/**
 * @brief url이동 (open_window 값이 N 가 아니면 새창으로 띄움)
 **/
function move_url(url, open_wnidow) {
    if(!url) return false;
    if(typeof(open_wnidow)=='undefined') open_wnidow = 'N';
    if(open_wnidow=='N') open_wnidow = false;
    else open_wnidow = true;

    if(/^\./.test(url)) url = request_uri+url;

    if(open_wnidow) {
        winopen(url);
    } else {
        location.href=url;
    }
    return false;
}

/**
 * @brief 특정 Element의 display 옵션 토글
 **/
function toggleDisplay(obj, display_type) {
    var obj = xGetElementById(obj);
    if(!obj) return;
    if(!obj.style.display || obj.style.display != 'none') {
        obj.style.display = 'none';
    } else {
        if(display_type) obj.style.display = display_type;
        else obj.style.display = '';
    }
}

/**
 * @brief 멀티미디어 출력용 (IE에서 플래쉬/동영상 주변에 점선 생김 방지용)
 **/
function displayMultimedia(src, width, height, auto_start, flashvars) {
    if(src.indexOf('files')==0) src = request_uri+src;
    if(auto_start) auto_start = "true";
    else auto_start = "false";

    var clsid = "";
    var codebase = "";
    var html = "";

    if(typeof(flashvars)=="undefined") flashvars = "";

    if(/\.swf/i.test(src)) {
        clsid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; 
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";
        html = ""+
            "<object classid=\""+clsid+"\" codebase=\""+codebase+"\" width=\""+width+"\" height=\""+height+"\" flashvars=\""+flashvars+"\">"+
            "<param name=\"wmode\" value=\"transparent\" />"+
            "<param name=\"allowScriptAccess\" value=\"sameDomain\" />"+
            "<param name=\"movie\" value=\""+src+"\" />"+
            "<param name=\"quality\" value=\"high\" />"+
            "<param name=\"flashvars\" value=\""+flashvars+"\" />"+
            "<embed src=\""+src+"\" autostart=\""+auto_start+"\"  width=\""+width+"\" height=\""+height+"\" flashvars=\""+flashvars+"\" wmode=\"transparent\"></embed>"+
            "<\/object>";
    } else if(/\.flv/i.test(src)) {
        html = "<embed src=\""+request_uri+"common/tpl/images/flvplayer.swf\" allowfullscreen=\"true\" autostart=\""+auto_start+"\" width=\""+width+"\" height=\""+height+"\" flashvars=\"&file="+src+"&width="+width+"&height="+height+"&autostart="+auto_start+"\" />";
    } else {
        html = "<embed src=\""+src+"\" autostart=\""+auto_start+"\" width=\""+width+"\" height=\""+height+"\"></embed>";
    }
    document.writeln(html);
}

/**
 * @brief 에디터에서 사용되는 내용 여닫는 코드 (고정, zbxe용)
 **/
function zbxe_folder_open(id) {
    var open_text_obj = xGetElementById("folder_open_"+id);
    var close_text_obj = xGetElementById("folder_close_"+id);
    var folder_obj = xGetElementById("folder_"+id);
    open_text_obj.style.display = "none";
    close_text_obj.style.display = "block";
    folder_obj.style.display = "block";
}

function zbxe_folder_close(id) {
    var open_text_obj = xGetElementById("folder_open_"+id);
    var close_text_obj = xGetElementById("folder_close_"+id);
    var folder_obj = xGetElementById("folder_"+id);
    open_text_obj.style.display = "block";
    close_text_obj.style.display = "none";
    folder_obj.style.display = "none";
}


/**
 * @brief 에디터에서 사용하되 내용 여닫는 코드 (zb5beta beta 호환용으로 남겨 놓음)
 **/
function svc_folder_open(id) {
    var open_text_obj = xGetElementById("_folder_open_"+id);
    var close_text_obj = xGetElementById("_folder_close_"+id);
    var folder_obj = xGetElementById("_folder_"+id);
    open_text_obj.style.display = "none";
    close_text_obj.style.display = "block";
    folder_obj.style.display = "block";
}

function svc_folder_close(id) {
    var open_text_obj = xGetElementById("_folder_open_"+id);
    var close_text_obj = xGetElementById("_folder_close_"+id);
    var folder_obj = xGetElementById("_folder_"+id);
    open_text_obj.style.display = "block";
    close_text_obj.style.display = "none";
    folder_obj.style.display = "none";
}

/**
 * @brief 팝업의 경우 내용에 맞춰 현 윈도우의 크기를 조절해줌 
 * 팝업의 내용에 맞게 크기를 늘리는 것은... 쉽게 되지는 않음.. ㅡ.ㅜ
 * popup_layout 에서 window.onload 시 자동 요청됨.
 **/
function setFixedPopupSize() {

    if(xGetElementById('popBody')) {
        if(xHeight('popBody')>500) {
            xGetElementById('popBody').style.overflowY = 'scroll';
            xGetElementById('popBody').style.overflowX = 'hidden';
            xHeight('popBody', 500);
        }
    }

    var w = xWidth("popup_content");
    var h = xHeight("popup_content");

    var obj_list = xGetElementsByTagName('div');
    for(i=0;i<obj_list.length;i++) {
        var ww = xWidth(obj_list[i]);
        var id = obj_list[i].id;
        if(id == 'waitingforserverresponse' || id == 'fororiginalimagearea' || id == 'fororiginalimageareabg') continue;
        if(ww>w) w = ww;
    }

    // 윈도우에서는 브라우저 상관없이 가로 픽셀이 조금 더 늘어나야 한다.
    if(xUA.indexOf('windows')>0) {
        if(xOp7Up) w += 10;
        else if(xIE4Up) w += 10;
        else w += 6;
    }
    window.resizeTo(w,h);
   
    var h1 = xHeight(window.document.body);
    window.resizeBy(0,h-h1);

    window.scrollTo(0,0);
}

/**
 * @brief 이름, 게시글등을 클릭하였을 경우 팝업 메뉴를 보여주는 함수
 **/
xAddEventListener(window, 'load', createPopupMenu);
xAddEventListener(document, 'click', chkPopupMenu);

var loaded_popup_menus = new Array();

/* 멤버 팝업 메뉴 레이어를 생성하는 함수 (문서 출력이 완료되었을때 동작) */
function createPopupMenu(evt) {
    var area = xGetElementById("popup_menu_area");
    if(area) return;
    area = xCreateElement("div");
    area.id = "popup_menu_area";
    area.style.visibility = 'hidden';
    document.body.appendChild(area);
}

/* 클릭 이벤트 발생시 이벤트가 일어난 대상을 검사하여 적절한 규칙에 맞으면 처리 */
function chkPopupMenu(evt) {
    // 이전에 호출되었을지 모르는 팝업메뉴 숨김
    var area = xGetElementById("popup_menu_area");
    if(!area) return;

    if(area.style.visibility!="hidden") area.style.visibility="hidden";

    // 이벤트 대상이 없으면 무시
    var e = new xEvent(evt);
    if(!e) return;

    // 대상의 객체 구함
    var obj = e.target;
    if(!obj) return;

    // obj의 nodeName이 div나 span이 아니면 나올대까지 상위를 찾음
    if(obj && obj.nodeName != 'DIV' && obj.nodeName != 'SPAN') obj = obj.parentNode;
    if(!obj || (obj.nodeName != 'DIV' && obj.nodeName != 'SPAN')) return;

    // 객체의 className값을 구함
    var class_name = obj.className;
    if(!class_name) return;

    // className을 분리
    var class_name_list = class_name.split(' ');
    var menu_id = '';
    var menu_id_regx = /^([a-zA-Z]+)_([0-9]+)$/ig;
    for(var i in class_name_list) {
        if(menu_id_regx.test(class_name_list[i])) {
            menu_id = class_name_list[i];
            break;
        }
    }
    if(!menu_id) return;

    // module명과 대상 번호가 없으면 return
    var tmp_arr = menu_id.split('_');
    var module_name = tmp_arr[0];
    var target_srl = tmp_arr[1];
    if(!module_name || !target_srl || target_srl < 1) return;

    // action이름을 규칙에 맞게 작성
    var action_name = "get" + module_name.substr(0,1).toUpperCase() + module_name.substr(1,module_name.length-1) + "Menu";

    // 서버에 메뉴를 요청
    var params = new Array();
    params["target_srl"] = target_srl;
    params["cur_mid"] = current_mid;
    params["cur_act"] = current_url.getQuery('act');
    params["menu_id"] = menu_id;
    params["page_x"] = e.pageX;
    params["page_y"] = e.pageY;

    var response_tags = new Array("error","message","menus");

    if(loaded_popup_menus[menu_id]) {
        displayPopupMenu(params, response_tags, params);
        return;
    }

    show_waiting_message = false;
    exec_xml(module_name, action_name, params, displayPopupMenu, response_tags, params);
    show_waiting_message = true;
}

function displayPopupMenu(ret_obj, response_tags, params) {
    var target_srl = params["target_srl"];
    var menu_id = params["menu_id"];
    var menus = ret_obj['menus'];
    var html = "";

    if(loaded_popup_menus[menu_id]) {
        html = loaded_popup_menus[menu_id];
    } else {
        if(menus) {
            var item = menus['item'];
            if(item.length<1) item = new Array(item);
            if(item.length) {
                for(var i=0;i<item.length;i++) {
                    var url = item[i].url;
                    var str = item[i].str;
                    var icon = item[i].icon;
                    var target = item[i].target;

                    var styleText = "";

                    if(icon) styleText = " style=\"background:url('"+icon+"') no-repeat left center; padding-left:18px; \"";
                    switch(target) {
                        case "popup" :
                                click_str = " onclick=\"popopen('"+url+"','"+target+"')\"; return false;";
                            break;
                        case "self" :
                                click_str = " onclick=\"location.href='"+url+"'\"; return false;";
                            break;
                        case "javascript" :
                                click_str = " onclick=\""+url+"\"; return false;";
                            break;
                        default :
                                click_str = " onclick=\"window.open('"+url+"')\"; return false;";
                            break;
                    }

                    html += '<div class="item" onmouseover="this.className=\'item_on\'" onmouseout="this.className=\'item\'"'+styleText+click_str+'>'+str+'</div> ';
                }
            }
        }
        loaded_popup_menus[menu_id] =  html;
    }

    // 레이어 출력
    if(html) {
        var area = xGetElementById("popup_menu_area");
        xInnerHtml(area, "<div class=\"box\">"+html+"</div>");
        xLeft(area, params["page_x"]);
        xTop(area, params["page_y"]);
        if(xWidth(area)+xLeft(area)>xClientWidth()+xScrollLeft()) xLeft(area, xClientWidth()-xWidth(area)+xScrollLeft());
        if(xHeight(area)+xTop(area)>xClientHeight()+xScrollTop()) xTop(area, xClientHeight()-xHeight(area)+xScrollTop());
        area.style.visibility = "visible";
    }
}

/**
 * @brief 추천/비추천,스크랩,신고기능등 특정 srl에 대한 특정 module/action을 호출하는 함수
 **/
function doCallModuleAction(module, action, target_srl) {
    var params = new Array();
    params['target_srl'] = target_srl;
    params['cur_mid'] = current_mid;
    exec_xml(module, action, params, completeCallModuleAction);
}

function completeCallModuleAction(ret_obj, response_tags) {
    if(ret_obj['message']!='success') alert(ret_obj['message']);
    location.reload();
}

/**
 * @brief 날짜 선택 (달력 열기) 
 **/
function open_calendar(fo_id, day_str, callback_func) {
    if(typeof(day_str)=="undefined") day_str = "";

    var url = "./common/tpl/calendar.php?";
    if(fo_id) url+="fo_id="+fo_id;
    if(day_str) url+="&day_str="+day_str;
    if(callback_func) url+="&callback_func="+callback_func;

    popopen(url, 'Calendar');
}

/* 언어코드 (lang_type) 쿠키값 변경 */
function doChangeLangType(obj) {
    if(typeof(obj)=="string") {
        setLangType(obj);
    } else {
        var val = obj.options[obj.selectedIndex].value;
        setLangType(val);
    }
    location.reload();
}
function setLangType(lang_type) {
    var expire = new Date();
    expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
    xSetCookie('lang_type', lang_type, expire);
}

/* 미리보기 */
function doDocumentPreview(obj) {
    var fo_obj = obj;
    while(fo_obj.nodeName != "FORM") {
        fo_obj = fo_obj.parentNode;
    }
    if(fo_obj.nodeName != "FORM") return;
    var editor_sequence = fo_obj.getAttribute('editor_sequence');

    var content = editorGetContent(editor_sequence);

    var win = window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");

    var dummy_obj = xGetElementById("previewDocument");

    if(!dummy_obj) {
        var fo_code = '<form id="previewDocument" target="previewDocument" method="post" action="'+request_uri+'">'+
                      '<input type="hidden" name="module" value="document" />'+
                      '<input type="hidden" name="act" value="dispDocumentPreview" />'+
                      '<input type="hidden" name="content" />'+
                      '</form>';
        var dummy = xCreateElement("DIV");
        xInnerHtml(dummy, fo_code);
        window.document.body.insertBefore(dummy,window.document.body.lastChild);
        dummy_obj = xGetElementById("previewDocument");
    }

    if(dummy_obj) {
        dummy_obj.content.value = content;
        dummy_obj.submit();
    }
}

/* 게시글 저장 */
function doDocumentSave(obj) {
    var editor_sequence = obj.form.getAttribute('editor_sequence');
    var prev_content = editorRelKeys[editor_sequence]['content'].value;
    if(typeof(editor_sequence)!='undefined' && editor_sequence && typeof(editorRelKeys)!='undefined' && typeof(editorGetContent)=='function') {
        var content = editorGetContent(editor_sequence);
        editorRelKeys[editor_sequence]['content'].value = content;
    }

    var oFilter = new XmlJsFilter(obj.form, "member", "procMemberSaveDocument", completeDocumentSave);
    oFilter.addResponseItem("error");
    oFilter.addResponseItem("message");
    oFilter.proc();

    editorRelKeys[editor_sequence]['content'].value = prev_content;
    return false;
}

function completeDocumentSave(ret_obj) {
    alert(ret_obj['message']);
}

/* 저장된 게시글 불러오기 */
var objForSavedDoc = null;
function doDocumentLoad(obj) {
    // 저장된 게시글 목록 불러오기
    objForSavedDoc = obj.form;
    popopen(request_uri.setQuery('module','member').setQuery('act','dispSavedDocumentList'));
}

/* 저장된 게시글의 선택 */
function doDocumentSelect(document_srl) {
    if(!opener || !opener.objForSavedDoc) {
        window.close();
        return;
    }

    // 게시글을 가져와서 등록하기
    opener.location.href = opener.current_url.setQuery('document_srl', document_srl);
    window.close();
}


/* 스킨 정보 */
function viewSkinInfo(module, skin) {
    popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+module+"&skin="+skin, 'SkinInfo');
}

/* 체크박스 선택 */
function checkboxSelectAll(form, name, option){ 
    var value;
    var fo_obj = xGetElementById(form);
    for ( var i = 0 ; i < fo_obj.length ; i++ ){
        if(typeof(option) == "undefined") {
            var select_mode = fo_obj[i].checked;
            if ( select_mode == 0 ){
                value = true;
                select_mode = 1;
            }else{
                value = false;
                select_mode = 0;
            }
        }
        else if(option == true) value = true
        else if(option == false) value = false

        if(fo_obj[i].name == name) fo_obj[i].checked = value;
    }
}

/* 체크박스를 실행 */
function clickCheckBoxAll(form, name) {
    var fo_obj = xGetElementById(form);
    for ( var i = 0 ; i < fo_obj.length ; i++ ){
        if(fo_obj[i].name == name) fo_obj[i].click();
    }
}

/* 관리자가 문서를 관리하기 위해서 선택시 세션에 넣음 */
function doAddDocumentCart(obj) {
    var srl = obj.value;
    var params = new Array();
    params["srl"] = srl;
    exec_xml("document","procDocumentAdminAddCart", params, null);
}

/* ff의 rgb(a,b,c)를 #... 로 변경 */
function transRGB2Hex(value) {
    if(!value) return value;
    if(value.indexOf('#') > -1) return value.replace(/^#/, '');

    if(value.toLowerCase().indexOf('rgb') < 0) return value;
    value = value.replace(/^rgb\(/i, '').replace(/\)$/, '');
    value_list = value.split(',');

    var hex = '';
    for(var i = 0; i < value_list.length; i++) {
        var color = parseInt(value_list[i], 10).toString(16);
        if(color.length == 1) color = '0'+color;
        hex += color;
    }
    return hex;
}

/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/

var Base64 = {

    // private property
    _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

    // public method for encoding
    encode : function (input) {
        var output = "";
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
        var i = 0;

        input = Base64._utf8_encode(input);

        while (i < input.length) {

            chr1 = input.charCodeAt(i++);
            chr2 = input.charCodeAt(i++);
            chr3 = input.charCodeAt(i++);

            enc1 = chr1 >> 2;
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
            enc4 = chr3 & 63;

            if (isNaN(chr2)) {
                enc3 = enc4 = 64;
            } else if (isNaN(chr3)) {
                enc4 = 64;
            }

            output = output +
            this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
            this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

        }

        return output;
    },

    // public method for decoding
    decode : function (input) {
        var output = "";
        var chr1, chr2, chr3;
        var enc1, enc2, enc3, enc4;
        var i = 0;

        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

        while (i < input.length) {

            enc1 = this._keyStr.indexOf(input.charAt(i++));
            enc2 = this._keyStr.indexOf(input.charAt(i++));
            enc3 = this._keyStr.indexOf(input.charAt(i++));
            enc4 = this._keyStr.indexOf(input.charAt(i++));

            chr1 = (enc1 << 2) | (enc2 >> 4);
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
            chr3 = ((enc3 & 3) << 6) | enc4;

            output = output + String.fromCharCode(chr1);

            if (enc3 != 64) {
                output = output + String.fromCharCode(chr2);
            }
            if (enc4 != 64) {
                output = output + String.fromCharCode(chr3);
            }

        }

        output = Base64._utf8_decode(output);

        return output;

    },

    // private method for UTF-8 encoding
    _utf8_encode : function (string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // private method for UTF-8 decoding
    _utf8_decode : function (utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while ( i < utftext.length ) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i+1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i+1);
                c3 = utftext.charCodeAt(i+2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

}

/* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */
if(xIE4Up) {
    xAddEventListener(window, 'load', activateOptionDisabled);

    function activateOptionDisabled(evt) {
        var sels = xGetElementsByTagName('select');
        for(var i=0; i < sels.length; i++){
            var disabled_exists = false;
            for(var j=0; j < sels[i].options.length; j++) {
                if(sels[i].options[j].disabled) {
                    sels[i].options[j].style.color = '#CCCCCC';
                    disabled_exists = true;
                }
            }

            if(!disabled_exists) continue;
            
            sels[i].oldonchange = sels[i].onchange;
            sels[i].onchange = function() {  
                if(this.options[this.selectedIndex].disabled) {
                    if(this.options.length<=1) this.selectedIndex = -1;
                    else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++;
                    else this.selectedIndex--;
                } else {
                    if(this.oldonchange) this.oldonchange();
                }
            }

            if(sels[i].selectedIndex >= 0 && sels[i].options[ sels[i].selectedIndex ].disabled) sels[i].onchange();

        }
    }
}


/* 보안 로그인 모드로 전환 */
function toggleSecuritySignIn() {
    var href = location.href;
    if(/https:\/\//i.test(href)) location.href = href.replace(/^https/i,'http');
    else location.href = href.replace(/^http/i,'https');
}   

/* 하위호환성 문제 */
if(typeof(resizeImageContents) == 'undefined')
{
    function resizeImageContents() {}
}

/**
 * @file   common/js/xml_handler.js
 * @author zero <zero@nzeo.com>
 * @brief  zbxe내에서 ajax기능을 이용함에 있어 module, act를 잘 사용하기 위한 자바스크립트
 **/

// xml handler을 이용하는 user function
var show_waiting_message = true;
function exec_xml(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) {
    var oXml = new xml_handler();
    oXml.reset();
    for(var key in params) {
	if(!params.hasOwnProperty(key)) continue;
        var val = params[key];
        oXml.addParam(key, val);
    }
    oXml.addParam("module", module);
    oXml.addParam("act", act);

    if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = new Array('error','message');

    oXml.request(xml_response_filter, oXml, callback_func, response_tags, callback_func_arg, fo_obj);
}

// 결과 처리 후 callback_func에 넘겨줌
function xml_response_filter(oXml, callback_func, response_tags, callback_func_arg, fo_obj) {
    var xmlDoc = oXml.getResponseXml();
    if(!xmlDoc) return null;

    var waiting_obj = xGetElementById("waitingforserverresponse");
    if(waiting_obj) waiting_obj.style.visibility = "hidden";

    var ret_obj = oXml.toZMsgObject(xmlDoc, response_tags);
    if(ret_obj["error"]!=0) {
        alert(ret_obj["message"]);
        return null;
    }

    if(ret_obj["redirect_url"]) {
        location.href=ret_obj["redirect_url"];
        return null;
    }

    if(!callback_func) return null;

    callback_func(ret_obj, response_tags, callback_func_arg, fo_obj);

    return null;
}

// xml handler
function xml_handler() {
    this.obj_xmlHttp = null;
    this.method_name = null;
    this.xml_path = request_uri+"index.php";

    this.params = new Array();

    this.reset = xml_handlerReset;
    this.getXmlHttp = zGetXmlHttp;
    this.request = xml_handlerRequest;
    this.setPath = xml_handlerSetPath;
    this.addParam = xml_handlerAddParam;
    this.getResponseXml = xml_handlerGetResponseXML;
    this.toZMsgObject = xml_handlerToZMsgObject;
    this.parseXMLDoc = xml_parseXmlDoc;

    this.obj_xmlHttp = this.getXmlHttp();
}

function zGetXmlHttp() {
    if (window.XMLHttpRequest) return new XMLHttpRequest();
    else if (window.ActiveXObject) {
        try {
            return new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            return new ActiveXObject("Microsoft.XMLHTTP");
        }
    }       
    return null;
}

function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags, callback_func_arg, fo_obj) {
    var rd = "";
    rd += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
    +  "<methodCall>\n"
    +  "<params>\n"

    for (var key in this.params) {
        if(!this.params.hasOwnProperty(key)) continue;
        var val = this.params[key];
        rd += "<"+key+"><![CDATA["+val+"]]></"+key+">\n";
    }

    rd += "</params>\n"
    +  "</methodCall>\n";

    // ssl action
    if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && typeof(this.params['act'])!='undefined' && /^https:\/\//i.test(location.href) ) {
        var action = this.params['act'];
        for(i=0;i<ssl_actions.length;i++) {
            if(ssl_actions[i]==action) {
                this.xml_path = this.xml_path.replace(/^http:\/\//i,'https://');
                break;
            }
        }
    }

    if(this.obj_xmlHttp.readyState!=0) {
        this.obj_xmlHttp.abort();
        this.obj_xmlHttp = this.getXmlHttp();
    }
    this.obj_xmlHttp.onreadystatechange = function () {callBackFunc(xmlObj, callBackFunc2, response_tags, callback_func_arg, fo_obj)};

    // 모든 xml데이터는 POST방식으로 전송. try-cacht문으로 오류 발생시 대처
    try {

        this.obj_xmlHttp.open("POST", this.xml_path, true);

    } catch(e) {
        alert(e);
        return;
    }

    // ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음)
    var waiting_obj = xGetElementById("waitingforserverresponse");
    if(show_waiting_message && waiting_obj) {
        xInnerHtml(waiting_obj, waiting_message);

        xTop(waiting_obj, xScrollTop()+20);
        xLeft(waiting_obj, xScrollLeft()+20);
        waiting_obj.style.visibility = "visible";
    }

    this.obj_xmlHttp.send(rd);
}

function xml_handlerSetPath(path) {
    this.xml_path = "./"+path;
}


function xml_handlerReset() {
    this.obj_xmlHttp = this.getXmlHttp();
    this.params = new Array();
}

function xml_handlerAddParam(key, val) {
    this.params[key] = val;
}

function xml_handlerGetResponseXML() {
    if(this.obj_xmlHttp && this.obj_xmlHttp.readyState == 4 && isDef(this.obj_xmlHttp.responseXML)) {
        var xmlDoc = this.obj_xmlHttp.responseXML;
        this.reset();
        return xmlDoc;
    }
    return null;
}

function xml_parseXmlDoc(dom) {
    if(!dom) return;

    var ret_obj = new Array();

    var obj = dom.firstChild;
    if(!obj) return;

    while(obj) {
        if(obj.nodeType == 1) {

            var name = obj.nodeName;
            var value = null;

            if(obj.childNodes.length==1 && obj.firstChild.nodeType != 1) {
                value = obj.firstChild.nodeValue;
            } else {
                value = this.parseXMLDoc(obj);
            }

            if(typeof(ret_obj[name])=='undefined') {
                ret_obj[name] = value;
            } else {
                if(ret_obj[name].length>0) {
                    ret_obj[name][ret_obj[name].length] = value;
                } else {
                    var tmp_value = ret_obj[name];
                    ret_obj[name] = new Array();
                    ret_obj[name][ret_obj[name].length] = tmp_value;
                    ret_obj[name][ret_obj[name].length] = value;
                }
            }

        }
        obj = obj.nextSibling;
    }
    return ret_obj;
}

function xml_handlerToZMsgObject(xmlDoc, tags) {
    if(!xmlDoc) return null;
    if(!tags) tags = new Array("error","message");
    tags[tags.length] = "redirect_url";
    tags[tags.length] = "act";

    var parsed_array = this.parseXMLDoc(xmlDoc.getElementsByTagName('response')[0]);

    var obj_ret = new Array();
    for(var i=0; i<tags.length; i++) {
        var key = tags[i];
        if(parsed_array[key]) obj_ret[key] = parsed_array[key];
        else obj_ret[key] = null;
    }
    return obj_ret;
}

/**
 * @file   common/js/xml_js_filter.js
 * @author zero (zero@nzeo.com)
 * @brief  xml filter에서 사용될 js
 *
 * zbxe 에서 form의 동작시 필수입력 여부등을 선처리하고 xml_handler.js의 exec_xml()을 통해서
 * 특정 모듈과의 ajax 통신을 통해 process를 진행시킴
 **/

var alertMsg = new Array();
var target_type_list = new Array();
var notnull_list = new Array();
var extra_vars = new Array();

/**
 * @function filterAlertMessage
 * @brief ajax로 서버에 요청후 결과를 처리할 callback_function을 지정하지 않았을 시 호출되는 기본 함수
 **/
function filterAlertMessage(ret_obj) {
    var error = ret_obj["error"];
    var message = ret_obj["message"];
    var act = ret_obj["act"];
    var redirect_url = ret_obj["redirect_url"];
    var url = location.href;

    if(typeof(message)!="undefined"&&message&&message!="success") alert(message);

    if(typeof(act)!="undefined" && act) url = current_url.setQuery("act", act);
    else if(typeof(redirect_url)!="undefined" && redirect_url) url = redirect_url;

    if(url == location.href) url = url.replace(/#(.+)$/,'');

    location.href = url;
}

/**
 * @class XmlJsFilter
 * @authro zero (zero@nzeo.com)
 * @brief form elements, module/act, callback_user_func을 이용하여 서버에 ajax로 form 데이터를 넘기고 결과를 받아오는 js class
 **/
function XmlJsFilter(form_object, module, act, callback_user_func) {
    this.field = new Array();
    this.parameter = new Array();
    this.response = new Array();

    this.fo_obj = form_object;
    this.module = module;
    this.act = act;
    this.user_func = callback_user_func;
    this.setFocus = XmlJsFilterSetFocus;
    this.addFieldItem = XmlJsFilterAddFieldItem;
    this.addParameterItem = XmlJsFilterAddParameterItem;
    this.addResponseItem = XmlJsFilterAddResponseItem;
    this.getValue = XmlJsFilterGetValue;
    this.executeFilter = XmlJsFilterExecuteFilter;
    this.checkFieldItem = XmlJsFilterCheckFieldItem;
    this.getParameterParam = XmlJsFilterGetParameterParam;
    this.alertMsg = XmlJsFilterAlertMsg;
    this.proc = XmlJsFilterProc;
}

function XmlJsFilterSetFocus(target_name) {
    var obj = this.fo_obj[target_name];
    if(typeof(obj)=='undefined' || !obj) return;
    
    var length = obj.length;
    try {
        if(typeof(length)!='undefined') {
            obj[0].focus();
        } else {
            obj.focus();
        }
    } catch(e) {
    }
}

function XmlJsFilterAddFieldItem(target, required, minlength, maxlength, equalto, filter) {
    var obj = new Array(target, required, minlength, maxlength, equalto, filter);
    this.field[this.field.length] = obj;
}

function XmlJsFilterAddParameterItem(param, target) {
    var obj = new Array(param, target);
    this.parameter[this.parameter.length] = obj;
}

function XmlJsFilterAddResponseItem(name) {
    this.response[this.response.length] = name;
}

function XmlJsFilterGetValue(target_name) {
    var obj = this.fo_obj[target_name];
    if(typeof(obj)=='undefined' || !obj) return '';
    var value = '';
    var length = obj.length;
    var type = obj.type;
    if((typeof(type)=='undefined'||!type) && typeof(length)!='undefined' && typeof(obj[0])!='undefined' && length>0) type = obj[0].type;
    else length = 0;

    switch(type) {
        case 'checkbox' :
                if(length>0) {
                    var value_list = new Array();
                    for(var i=0;i<length;i++) {
                        if(obj[i].checked) value_list[value_list.length] = obj[i].value;
                    }
                    value = value_list.join('|@|');
                } else {
                    if(obj.checked) value = obj.value;
                    else value = '';
                }
            break;
        case 'radio' :
                if(length>0) {
                    for(var i=0;i<length;i++) {
                        if(obj[i].checked) value = obj[i].value;
                    }
                } else {
                    if(obj.checked) value = obj.value;
                    else value = '';
                }
            break;
        case 'select' :
        case 'select-one' :
                if(obj.selectedIndex>=0) value = obj.options[obj.selectedIndex].value;
            break;
        default :
                if(length>0 && target_type_list[target_name]) {
                    switch(target_type_list[target_name]) {
                        case 'kr_zip' :
                                var val1 = obj[0].value;
                                var val2 = obj[1].value;
                                if(val1&&val2) {
                                    value = val1+'|@|'+val2;
                                }
                            break;
                        case 'tel' :
                                var val1 = obj[0].value;
                                var val2 = obj[1].value;
                                var val3 = obj[2].value;
                                if(val1&&val2&&val3) {
                                    value = val1+'|@|'+val2+'|@|'+val3;
                                }
                            break;
                    }

                } else {
                    value = obj.value;
                }
            break;
    }

    if(typeof(value)=='undefined'||!value) return '';
    return value.trim();
}

function XmlJsFilterExecuteFilter(filter, value) {
    switch(filter) {
        case "email" :
        case "email_address" :
                var regx = /^[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*@[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*$/;
                return regx.test(value);
            break;
        case "userid" :
        case "user_id" :
                var regx = /^[a-zA-Z]+([_0-9a-zA-Z]+)*$/;
                return regx.test(value);
            break;
        case "homepage" :
                var regx = /^(http|https|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;       
                return regx.test(value);
            break;
        case "korean" :
                var regx = /^[가-힣]*$/; 
                return regx.test(value);
            break;
        case "korean_number" :
                var regx = /^[가-힣0-9]*$/; 
                return regx.test(value);
            break;
        case "alpha" :
                var regx = /^[a-zA-Z]*$/; 
                return regx.test(value);
            break;
        case "alpha_number" :
                var regx = /^[a-zA-Z][a-zA-Z0-9\_]*$/; 
                return regx.test(value);
            break;
        case "number" :
            return !isNaN(value);
        break;
    }

    return null;
}

function XmlJsFilterAlertMsg(target, msg_code, minlength, maxlength) {
    var target_msg = "";

    if(alertMsg[target]!='undefined') target_msg = alertMsg[target];
    else target_msg = target;

    var msg = "";
    if(typeof(alertMsg[msg_code])!='undefined') {
        if(alertMsg[msg_code].indexOf('%s')>=0) msg = alertMsg[msg_code].replace('%s',target_msg);
        else msg = target_msg+alertMsg[msg_code];
    } else {
        msg = msg_code;
    }

    if(typeof(minlength)!='undefined' && typeof(maxlength)!='undefined') msg += "("+minlength+"~"+maxlength+")";

    alert(msg);
    this.setFocus(target);

    return false;
}

function XmlJsFilterCheckFieldItem() {
    for(var i=0; i<extra_vars.length;i++) {
        var name = extra_vars[i];
        this.addFieldItem(name, false, 0, 0, "", "");
    }

    for(var i=0; i<this.field.length;i++) {
        var item = this.field[i];
        var target = item[0];
        var required = item[1];
        var minlength = item[2];
        var maxlength = item[3];
        var equalto = item[4];
        var filter = item[5].split(",");

        if(typeof(this.fo_obj[target])=='undefined') continue;

        for(var j=0; j<notnull_list.length; j++) {
            if(notnull_list[j]==target) required = true;
        }

        var value = this.getValue(target);
        if(!required && !value) continue;
        if(required && !value && this.fo_obj[target]) return this.alertMsg(target,'isnull');

        if(minlength>0 && maxlength>0 && (value.length < minlength || value.length > maxlength)) return this.alertMsg(target, 'outofrange', minlength, maxlength);

        if(equalto) {
            var equalto_value = this.getValue(equalto);
            if(equalto_value != value) return this.alertMsg(target, 'equalto');
        }

        if(filter.length && filter[0]) {
            for(var j=0;j<filter.length;j++) {
                var filter_item = filter[j];
                if(!this.executeFilter(filter_item, value)) return this.alertMsg(target, "invalid_"+filter_item);
            }
        }
    }
    return true;
} 

function XmlJsFilterGetParameterParam() {
    if(!this.fo_obj) return new Array();

    var prev_name = '';
    if(this.parameter.length<1) {
        for(var i=0;i<this.fo_obj.length;i++) {
            var name = this.fo_obj[i].name;
            if(typeof(name)=='undefined'||!name||name==prev_name) continue;
            this.addParameterItem(name, name);
            prev_name = name;
        }
    }

    var params = new Array();
    for(var i=0; i<this.parameter.length;i++) {
        var item = this.parameter[i];
        var param = item[0];
        var target = item[1];
        var value = this.getValue(target);
        params[param] = value;
    }
    return params;
}

function XmlJsFilterProc(confirm_msg) {
    var result = this.checkFieldItem();
    if(!result) return false;

    if(typeof(confirm_msg)=='undefined') confirm_msg = '';

    var params = this.getParameterParam();
    var response = this.response;
    if(confirm_msg && !confirm(confirm_msg)) return false;
    if(!this.act) {
        this.user_func(this.fo_obj, params);
        return true;
    }
    exec_xml(this.module, this.act, params, this.user_func, response, params, this.fo_obj);

    return null;
}

// form proc
function procFilter(fo_obj, filter_func) {
    // form문 안에 위지윅 에디터가 세팅되어 있을 경우 에디터의 값과 지정된 content field를 sync
    var editor_sequence = fo_obj.getAttribute('editor_sequence');
    if(typeof(editor_sequence)!='undefined' && editor_sequence && typeof(editorRelKeys)!='undefined') { 
        editorRelKeys[editor_sequence]['content'].value = editorGetContent(editor_sequence);
    }

    filter_func(fo_obj);
    return false;
}

/**
 * @brief 카운터 정보 수집 javascript
 * window.onload 이벤트 후에 counter 모듈을 호출한다.
 **/

// 이벤트 등록
xAddEventListener(window,'load',doCallCounter);

// counter 모듈을 호출하는 함수
function doCallCounter() {
    show_waiting_message = false;
    exec_xml('counter','procCounterExecute');
    show_waiting_message = true;
}

/**
 * @brief	화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경
 * @author  zero ( http://www.zeroboard.com/ )
 * @modify	KAi ( http://kai.ibbun.net/ )
 *   - 전체 이미지가 아닌 컨텐츠 내의 이미지만 체크로 속도향상
 *   - <A> 테그가 없는 이미지 객체에 <A> 테그 생성
 *   - 여러 객체에서 이미지 체크 처리루틴 추가 [08-06-17]
 *   - 이미지 그룹을 지정하기 위한 고유 아이디 추출 루틴 개선 [08-06-28]
 **/
var ABzb={p:{d:"(document)_([0-9]+)",c:"(comment)_([0-9]+)"},c:{d:0,c:0}};var ABgid;var ABsid=1;function resizeImageInit(){var a=['IMG'];if(typeof ABdid=='string'&&ABdid.length>1){ABdid=ABdid.split(',');for(var n=0;n<a.length;n++){for(var i in ABdid){try{var b=document.getElementById(ABdid[i]).getElementsByTagName(a[n]);resizeImageContents(b)}catch(e){}}}return true}for(var n=0;n<a.length;n++){var b=document.getElementsByTagName(a[n]);resizeImageContents(b)}return true}function resizeImageContents(a){for(var i in a){var b=a[i];if(!b.parentNode)continue;if(/\/modules\//i.test(b.src))continue;if(/\/layouts\//i.test(b.src))continue;if(/\/widgets\//i.test(b.src))continue;if(/\/classes\//i.test(b.src))continue;if(/\/common\/tpl\//i.test(b.src))continue;if(/\/member_extra_info\//i.test(b.src))continue;var d=b.parentNode;while(d){if(d.className&&d.className.search(/xe_content|document_|comment_/i)!=-1)break;d=d.parentNode}if(!d||d.className.search(/xe_content|document_|comment_/i)<0)continue;if(d.parentNode)xWidth(d,xWidth(d.parentNode));d.style.width='100%';d.style.overflow='hidden';var f=xWidth(d);if(d.parentNode&&xWidth(d.parentNode)<f)f=xWidth(d.parentNode);var g=xWidth(b);var h=xHeight(b);var A=b.parentNode;var c=ActiveBox_getCaptionFromObject(b);try{for(var n in ABzb.p){if(ABgid=d.className.match(ABzb.p[n]))break}}catch(e){ABgid={0:1,1:1,2:1}}if(g>f-2){var j=f-2;var k=Math.round(h*j/g);xWidth(b,parseInt(j/1.2));xHeight(b,parseInt(k/1.2));if(A&&A.nodeName!='A'){ActiveBox_addElement(b,c)}else if(A.nodeName=='A'&&ABuhv=='use'){if(A.href.match(/\.(bmp|gif|jpg|jp2|jpeg|png)$/gi)){ActiveBox_modifyAttributesToAchor_Img(A,b,c)}else{ActiveBox_addAttributesToAnchor_Html(A,b,c)}}}else{var l=new Image();l.src=b.src;if(A&&A.nodeName!='A'&&(l.width>f-2||l.width!=g)){ActiveBox_addElement(b,c)}else if(A.nodeName=='A'&&ABuhv=='use'){if(A.href.match(/\.(bmp|gif|jpg|jp2|jpeg|png)$/gi)){ActiveBox_modifyAttributesToAchor_Img(A,b,c)}else{ActiveBox_addAttributesToAnchor_Html(A,b,c)}}}}}ActiveBox_addEvent(window,'load',resizeImageInit);


/*-------------------------------------*
**	ActiveBox library
**	by KAi ( http://kai.ibbun.net/ )
**-------------------------------------*/
function ActiveBox_addElement(B,c){var A=document.createElement('A');ActiveBox_addAttributesToAchor_Img(A,B,c);applyElement(A,B)}function applyElement(A,B){B.parentNode.insertBefore(A,B);A.appendChild(B)}function ActiveBox_getCaptionFromObject(i){var t=i.title;var a=i.alt;return(!t||t.length==0)?(!a||a.length==0)?'Nosubject':a:t}function ActiveBox_addEvent(a,b,c){try{a.detachEvent('on'+b,c);a.attachEvent('on'+b,c)}catch(e){try{a.addEventListener(b,c,false)}catch(e){a['on'+b]=c}}}
/******************************************************************************
Name:    Highslide JS
Version: 3.3.18 (Apr 30 2008)
Config:  default +inline +ajax +iframe +flash +packed
Author:  Torstein Hønsi
Support: http://vikjavev.no/highslide/forum

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
	* to copy, distribute, display, and perform the work
	* to make derivative works

Under the following conditions:
	* Attribution. You must attribute the work in the manner  specified by  the
	  author or licensor.
	* Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the 
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q k={5i:\'P/96/\',6J:\'95.7s\',8w:10,5G:6o,7i:10,7d:6o,47:15,5X:15,3P:15,2U:15,4t:94,67:\'5b W 1D 22, 93 8r 97 W 2N. 98 9c 9b X 1F 8r 4R.\',6X:\'9a...\',6Q:\'5b W 92\',7k:0.75,7X:\'5b W 91 W 8U\',5p:K,5Y:5,6e:1,5K:1i,2F:2,6s:3,7n:\'8T W 8S 2s\',8m:\'8d 7P\',8q:1,7N:K,7A:\'8R 2K <i>85 81</i>\',7z:\'8V://8W.90/P/\',7D:\'8Z W 8Y 85 81 8X\',8D:K,7h:\'9d\',7m:\'9e\',6Y:\'9t\',7r:\'9s\',7t:\'5b W 1D\',74:\'9r\',4P:1i,5v:K,4q:K,2q:\'4k\',6x:K,3w:H,3V:30,3T:H,2f:8F,2L:8F,51:K,1m:\'9q-9u\',5o:\'P-O\',4d:[],5z:K,L:[],5y:[\'51\',\'1m\',\'2F\',\'3V\',\'3w\',\'42\',\'6y\',\'5J\',\'J\',\'G\',\'4P\',\'5v\',\'4q\',\'2x\',\'6x\',\'3i\',\'4m\',\'2q\',\'29\',\'5o\',\'2f\',\'2L\',\'3T\',\'3R\',\'8u\',\'8y\'],1Q:[],5W:0,4W:[],3s:{},3t:[],4U:[],3M:[],4D:{},6j:{},1j:(Y.9v&&!1C.4i),3k:/9y/.1s(3G.8a),4a:/8Q.+9x:1\\.[0-8].+9w/.1s(3G.8a),$:r(1g){F Y.61(1g)},3U:r(2D,8b){2D[2D.1h]=8b},U:r(59,2P,2O,4o,8h){q u=Y.U(59);m(2P)k.8o(u,2P);m(8h)k.V(u,{6A:0,8i:\'1X\',8v:0});m(2O)k.V(u,2O);m(4o)4o.1y(u);F u},8o:r(u,2P){X(q x 54 2P)u[x]=2P[x]},V:r(u,2O){X(q x 54 2O){14{m(k.1j&&x==\'1q\'){m(2O[x]>0.99)u.B.9p(\'6E\');Q u.B.6E=\'9o(1q=\'+(2O[x]*3x)+\')\'}Q u.B[x]=2O[x]}Z(e){}}},3a:r(){q 2D=3G.8A.8c("9i");F 2D[1]?78(2D[1]):H},6z:r(){q 4g=Y.6O&&Y.6O!="84"?Y.5T:Y.1c;q J=k.1j?4g.6W:(Y.5T.6W||6U.9h),G=k.1j?4g.9g:6U.9f;F{J:J,G:G,57:k.1j?4g.57:9j,58:k.1j?4g.58:9k}},1d:r(u){q p={x:u.7j,y:u.6G};41(u.7l){u=u.7l;p.x+=u.7j;p.y+=u.6G;m(u!=Y.1c&&u!=Y.5T){p.x-=u.57;p.y-=u.58}}F p},5f:r(a,1J,3q){m(a.3D)F 1J;14{1E k.49(a,1J,3q);F 1i}Z(e){F K}},72:r(a,1J,3q){m(a.3D)F 1J;X(q i=0;i<k.3t.1h;i++){m(k.3t[i]&&k.3t[i].a==a){k.3t[i].7M();k.3t[i]=H;F 1i}}14{k.7v=K;1E k.49(a,1J,3q,\'3n\');F 1i}Z(e){F K}},3Y:r(u,3I,T){q 1e=u.3L(3I);X(q i=0;i<1e.1h;i++){m((1E 4w(T)).1s(1e[i].T)){F 1e[i]}}F H},5I:r(){q s=\'<1b 2H="P-9n"><7f>\'+\'<2S 2H="P-4R"><a 2l="F k.4R(f)" 1P="#">\'+k.7h+\'</a></2S>\'+\'<2S 2H="P-1F"><a 2l="F k.1F(f)" 1P="#">\'+k.7m+\'</a></2S>\'+\'<2S 2H="P-2N"><a 1P="#" 2l="F 1i">\'+k.6Y+\'</a></2S>\'+\'<2S 2H="P-1D"><a 2l="F k.1D(f)" 36="\'+k.7t+\'" 1P="#">\'+k.7r+\'</a></2S>\'+\'</7f></1b>\'+\'<1b 2H="P-1c"></1b>\'+\'<1b 2H="P-9m"><1b>\'+\'<D 2H="P-3e" 36="\'+k.74+\'"><D></D></D>\'+\'</1b></1b>\';F k.U(\'1b\',{T:\'P-3n-I\',1A:s})},5L:r(a){X(q i=0;i<k.3M.1h;i++){m(k.3M[i][0]==a){q c=k.3M[i][1];k.3M[i][1]=c.3X(1);F c}}F H},7y:r(e){q 3F=Y.3L(\'A\');q a,28;X(q i=0;i<3F.1h;i++){a=3F[i];28=k.3N(a);m(28&&28[0]==\'k.72\'&&k.3H(a,\'2x\')==\'2e\'&&k.3H(a,\'6x\')){k.3U(k.4U,a)}}k.6K(0)},6K:r(i){m(!k.4U[i])F;q a=k.4U[i];q 4h=k.4s(k.3H(a,\'5J\'));m(!4h)4h=k.5I();q 2e=1E k.4O(a,4h,1);2e.5H=r(){};2e.2o=r(){k.3U(k.3M,[a,4h]);k.6K(i+1)};2e.5M()},7S:r(){q 6v=0,4Y=-1;X(q i=0;i<k.L.1h;i++){m(k.L[i]){m(k.L[i].O.B.1r&&k.L[i].O.B.1r>6v){6v=k.L[i].O.B.1r;4Y=i}}}m(4Y==-1)k.1I=-1;Q k.L[4Y].2M()},5u:r(N,1x){q 3E=Y.3L(\'A\'),6g={},66=-1,j=0;X(q i=0;i<3E.1h;i++){m(k.3N(3E[i])&&((k.L[N].3T==k.3H(3E[i],\'3T\')))){6g[j]=3E[i];m(k.L[N]&&3E[i]==k.L[N].a){66=j}j++}}F 6g[66+1x]||H},3H:r(a,4f){a.3D=a.2l;q p=a.3D?a.3D():H;a.3D=H;F(p&&1z p[4f]!=\'2I\')?p[4f]:(1z k[4f]!=\'2I\'?k[4f]:H)},2C:r(a){q 11=k.3H(a,\'11\');m(11)F 11;F a.1P},4s:r(1g){q 1n=k.$(1g),3b=k.6j[1g],a={};m(!1n&&!3b)F H;m(!3b){3b=1n.3X(K);3b.1g=\'\';k.6j[1g]=3b;F 1n}Q{F 3b.3X(K)}},62:r(d){q a=d.6D,i,l,n;m(a){l=a.1h;X(q i=0;i<l;i+=1){n=a[i].31;m(1z d[n]===\'r\'){d[n]=H}}}a=d.3O;m(a){l=a.1h;X(q i=0;i<l;i+=1)k.62(d.3O[i])}},4b:r(d){m(k.1j)k.62(d);k.5Z.1y(d);k.5Z.1A=\'\'},4z:r(u,1x){q C=k.8H=k.3o(u);14{q 7e=k.8J=k.5u(C.N,1x);7e.2l()}Z(e){}14{C.1D()}Z(e){}F 1i},4R:r(u){F k.4z(u,-1)},1F:r(u){F k.4z(u,1)},5h:r(e){m(!e)e=1C.1M;m(!e.2g)e.2g=e.6b;m(e.2g.7K)F K;q 1x=H;8L(e.8P){2h 32:2h 34:2h 39:2h 40:1x=1;6N;2h 8:2h 33:2h 37:2h 38:1x=-1;6N;2h 27:2h 13:1x=0}m(1x!==H){k.46(Y,\'5w\',k.5h);m(!k.8D)F K;m(e.5k)e.5k();Q e.8M=1i;m(1x==0){14{k.3o().1D()}Z(e){}F 1i}Q{F k.4z(k.1I,1x)}}F K},8O:r(1B){k.3U(k.1Q,1B)},6p:r(6c){q u,28=/^P-O-([0-9]+)$/;u=6c;41(u.2W){m(u.1g&&28.1s(u.1g))F u.1g.1Z(28,"$1");u=u.2W}u=6c;41(u.2W){m(u.3I&&k.3N(u)){X(q N=0;N<k.L.1h;N++){q C=k.L[N];m(C&&C.a==u)F N}}u=u.2W}F H},3o:r(u){m(1z u==\'2I\')F k.L[k.1I]||H;m(1z u==\'3C\')F k.L[u]||H;m(1z u==\'6h\')u=k.$(u);F k.L[k.6p(u)]||H},3N:r(a){F(a.2l&&a.2l.7E().1Z(/\\s/g,\' \').2w(/k.(8N|e)8K/))},8t:r(){X(q i=0;i<k.L.1h;i++)m(k.L[i]&&k.L[i].5m)k.7S()},5N:r(e){m(!e)e=1C.1M;m(e.8I>1)F K;m(!e.2g)e.2g=e.6b;q u=e.2g;41(u.2W&&!(/P-(22|2N|3n|3e)/.1s(u.T))){u=u.2W}q C=k.3o(u);m(C&&(C.4v||!C.5m))F K;m(C&&e.2u==\'5F\'){m(e.2g.7K)F K;q 2w=u.T.2w(/P-(22|2N|3e)/);m(2w){k.1O={C:C,2u:2w[1],19:C.x.M,J:C.x.D,1k:C.y.M,G:C.y.D,8g:e.6r,7J:e.6q};k.2j(Y,\'6T\',k.6I);m(e.5k)e.5k();m(/P-(22|3n)-43/.1s(C.I.T)){C.2M();k.6a=K}F 1i}Q m(/P-3n/.1s(u.T)&&k.1I!=C.N){C.2M();C.4J()}}Q m(e.2u==\'89\'){k.46(Y,\'6T\',k.6I);m(k.1O){m(k.1O.2u==\'22\')k.1O.C.I.B.2i=k.48;q 2X=k.1O.2X;m(!2X&&!k.6a&&!/(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3C){m(3C&&1z 3C!=\'ar\')k.5Y=3C;q a,28,j=0;q 3F=Y.3L(\'A\');X(q i=0;i<3F.1h;i++){a=3F[i];28=k.3N(a);m(28&&28[0]==\'k.5f\'){m(j<k.5Y){k.4d[j]=k.2C(a);j++}}}1E k.3W(k.1m,r(){k.6t(0)});q 7s=k.U(\'1f\',{11:k.5i+k.6J})},4X:r(){m(!k.1U){k.1U=k.U(\'1b\',H,{1d:\'1T\',19:0,1k:0,J:\'3x%\',1r:k.4t},Y.1c,K);k.1u=k.U(\'a\',{T:\'P-1u\',36:k.6Q,1A:k.6X,1P:\'70:au(0)\'},{1d:\'1T\',1q:k.7k,19:\'-3m\',1r:1},k.1U);k.5Z=k.U(\'1b\',H,{1H:\'1X\'},k.1U);k.2m=k.U(\'1b\',H,{8k:\'8j\',ap:\'ao\'},H,K);1N.ak=r(t,b,c,d){F c*t/d+b};1N.8x=r(t,b,c,d){F c*(t/=d)*t+b};k.6i=(k.1j&&k.3a()<=6&&3Z.al==\'an:\')}},4S:r(u,o,3B,2v,i,4j){m(1z i==\'2I\'){m(1z 2v!=\'3C\')2v=6o;m(2v<25){k.V(u,{1q:3B});F}i=k.4W.1h;4j=3B>o?1:-1;q 2V=(25/(2v-2v%25))*1N.ax(o-3B)}o=78(o);u.B.1l=(o<=0)?\'16\':\'1V\';m(o<0||(4j==1&&o>3B))F;m(u.3p&&u.3p.i!=i){aE(k.4W[u.3p.i]);o=u.3p.o}u.3p={i:i,o:o,2V:(2V||u.3p.2V)};u.B.1l=(o<=0)?\'16\':\'1V\';k.V(u,{1q:o});k.4W[i]=2A(r(){k.4S(u,o+u.3p.2V*4j,3B,H,i,4j)},25)},1D:r(u){q C=k.3o(u);m(C)C.1D();F 1i}};k.3W=r(1m,2o){f.2o=2o;f.1m=1m;q v=k.3a(),4V;f.4K=k.1j&&v>=5.5&&v<7;m(!1m){m(2o)2o();F}k.4X();f.1v=k.U(\'1v\',{aC:0},{1l:\'16\',1d:\'1T\',ay:\'aD\'},k.1U,K);q 6u=k.U(\'6u\',H,H,f.1v,1);f.1p=[];X(q i=0;i<=8;i++){m(i%3==0)4V=k.U(\'4V\',H,{G:\'1G\'},6u,K);f.1p[i]=k.U(\'1p\',H,H,4V,K);q B=i!=4?{az:0,aA:0}:{1d:\'3h\'};k.V(f.1p[i],B)}f.1p[4].T=1m;f.77()};k.3W.5Q={77:r(){q 11=k.5i+(k.aB||"aF/")+f.1m+".ah";q 6Z=k.3k?k.1U:H;f.2B=k.U(\'1f\',H,{1d:\'1T\',19:\'-3m\',1k:\'-3m\'},6Z,K);q 2z=f;f.2B.4T=r(){2z.71()};f.2B.11=11},71:r(){q o=f.23=f.2B.J/4,2y=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],5a={G:(2*o)+\'E\',J:(2*o)+\'E\'};X(q i=0;i<=8;i++){m(2y[i]){m(f.4K){q w=(i==1||i==7)?\'3x%\':f.2B.J+\'E\';q 1b=k.U(\'1b\',H,{J:\'3x%\',G:\'3x%\',1d:\'3h\',2p:\'16\'},f.1p[i],K);k.U(\'1b\',H,{6E:"9P:9O.6V.9N(9M=9Q, 11=\'"+f.2B.11+"\')",1d:\'1T\',J:w,G:f.2B.G+\'E\',19:(2y[i][0]*o)+\'E\',1k:(2y[i][1]*o)+\'E\'},1b,K)}Q{k.V(f.1p[i],{7p:\'7R(\'+f.2B.11+\') \'+(2y[i][0]*o)+\'E \'+(2y[i][1]*o)+\'E\'})}m(1C.4i&&(i==3||i==5))k.U(\'1b\',H,5a,f.1p[i],K);k.V(f.1p[i],5a)}}f.2B=H;m(k.3s[f.1m])k.3s[f.1m].4A();k.3s[f.1m]=f;m(f.2o)f.2o()},3f:r(C,x,y,w,h,7o){m(7o)f.1v.B.1l=(h>=4*f.23)?\'1V\':\'16\';f.1v.B.19=(x-f.23)+\'E\';f.1v.B.1k=(y-f.23)+\'E\';f.1v.B.J=(w+2*(C.21+f.23))+\'E\';w+=2*(C.21-f.23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.M=1t(f.2Q)-f.2n+f.45;y.2c=y.D;f.y=f.3A(y)}},6F:r(){q 1w={x:f.x.M-20,y:f.y.M-20,w:f.x.D+40,h:f.y.D+40+f.3V};k.4C=(k.1j&&k.3a()<7);m(k.4C)f.2a(\'5x\',\'16\',1w);k.4y=((1C.4i&&3G.8A<9)||3G.8z==\'8s\'||(k.1j&&k.3a()<5.5));m(k.4y)f.2a(\'5E\',\'16\',1w);m(k.4a)f.2a(\'*\',\'16\',1w);m(f.x.44)f.I.B.8v=\'0 1G\';f.1Q=[];f.5R(1,{x:f.2Y+f.3Q-f.21,y:f.2Q+f.45-f.2n,w:f.1Y,h:f.2b,3d:f.1Y,o:k.6s},{x:f.x.M,y:f.y.M,w:f.x.D,h:f.y.D,3d:f.x.44,o:f.18?f.18.23:0},k.5G,k.8w)},5R:r(2E,26,W,2v,5t){m(2E&&f.18&&!f.2F)f.18.3f(f,f.x.M,f.y.M,f.x.D,f.y.D);Q m(!2E&&f.18){m(f.2F)f.18.3f(f,26.x,26.y,26.w,26.h);Q f.18.4A((f.2d&&f.4q))}m(!2E){q n=f.O.3O.1h;X(q i=n-1;i>=0;i--){q 63=f.O.3O[i];m(63!=f.I)k.4b(63)}}m(f.8y){26.1x=2E?0:1;W.1x=2E}q t,C=f,3R=1N[f.3R]||1N.8x;m(!2E)3R=1N[f.8u]||3R;X(q i=1;i<=5t;i++){t=1N.4N(i*(2v/5t));(r(){q 87=i,2s={};X(q x 54 26){2s[x]=3R(t,26[x],W[x]-26[x],2v);m(/[ae]/.1s(x))2s[x]=1N.4N(2s[x])}2A(r(){m(2E&&87==1){C.I.B.1l=\'1V\';C.a.T+=\' P-7B-7x\'}C.7I(2s)},t)})()}m(2E){2A(r(){m(C.18)C.18.1v.B.1l="1V"},t);2A(r(){m(C.S)C.83();C.7G()},t+50)}Q 2A(r(){C.6L()},t)},7I:r(W){14{m(f.2d){k.V(f.I,{J:W.w+\'E\',G:W.h+\'E\'});k.V(f.3K,{19:(f.x.M-W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.80}}m(f.S){f.2U+=f.3V}},83:r(){14{k.V(f.O,{J:f.O.1o+\'E\',G:f.O.1a+\'E\'});k.V(f.S,{1l:\'16\',3P:k.3k?0:\'-\'+f.y.D+\'E\'});f.S.T+=\' P-1H-4u\';q G,C=f;m(k.1j&&(k.3a()<6||Y.6O==\'84\')){G=f.S.1a}Q{q 86=k.U(\'1b\',{1A:f.S.1A},H,H,K);f.S.1A=\'\';f.S.1y(86);G=f.S.3O[0].1a;f.S.1A=f.S.3O[0].1A}k.V(f.S,{2p:\'16\',G:0,1r:2,3P:0});f.O.B.G=\'1G\';m(k.6e){q 2V=(1N.4N(G/50)||1)*k.6e}Q{f.65(G,1);F}X(q h=G%2V,t=0;h<=G;h+=2V,t+=10){(r(){q 7Y=h,4F=(h==G)?1:0;2A(r(){C.65(7Y,4F)},t)})()}}Z(e){}},65:r(G,4F){m(!f.S)F;f.S.B.G=G+\'E\';f.S.B.1l=\'1V\';f.y.D=f.O.1a-2*f.2n;q o=f.18;m(o){q h=f.O.1a-2*f.18.23;m(h>=0)o.1p[4].B.G=h+\'E\';m(o.4K)o.1p[3].B.G=o.1p[5].B.G=o.1p[4].B.G}m(4F)f.69()},2a:r(3I,1l,1w){q 1e=Y.3L(3I);q 3J=3I==\'*\'?\'2p\':\'1l\';X(q i=0;i<1e.1h;i++){m(3J==\'1l\'||(Y.9Z.9Y(1e[i],"").9X(\'2p\')==\'1G\'||1e[i].3u(\'16-2K\')!=H)){q 1L=1e[i].3u(\'16-2K\');m(1l==\'1V\'&&1L){1L=1L.1Z(\'[\'+f.N+\']\',\'\');1e[i].3r(\'16-2K\',1L);m(!1L)1e[i].B[3J]=1e[i].6l}Q m(1l==\'16\'){q 2r=k.1d(1e[i]);2r.w=1e[i].1o;2r.h=1e[i].1a;q 7W=(2r.x+2r.w<1w.x||2r.x>1w.x+1w.w);q 7V=(2r.y+2r.h<1w.y||2r.y>1w.y+1w.h);q 6k=k.6p(1e[i]);m(!7W&&!7V&&6k!=f.N){m(!1L){1e[i].3r(\'16-2K\',\'[\'+f.N+\']\');1e[i].6l=1e[i].B[3J];1e[i].B[3J]=\'16\'}Q m(!1L.2w(\'[\'+f.N+\']\')){1e[i].3r(\'16-2K\',1L+\'[\'+f.N+\']\')}}Q m(1L==\'[\'+f.N+\']\'||k.1I==6k){1e[i].3r(\'16-2K\',\'\');1e[i].B[3J]=1e[i].6l||\'\'}Q m(1L&&1L.2w(\'[\'+f.N+\']\')){1e[i].3r(\'16-2K\',1L.1Z(\'[\'+f.N+\']\',\'\'))}}}}},2M:r(){f.O.B.1r=k.4t++;X(q i=0;i<k.L.1h;i++){m(k.L[i]&&i==k.1I){q 2R=k.L[i];2R.I.T+=\' P-\'+2R.2k+\'-43\';m(2R.S){2R.S.T+=\' P-S-43\'}m(2R.3c){2R.I.B.2i=k.1j?\'7F\':\'6H\';2R.I.36=k.7X}}}m(f.18)f.18.1v.B.1r=f.O.B.1r;f.I.T=\'P-\'+f.2k;m(f.S){f.S.T=f.S.T.1Z(\' P-S-43\',\'\')}m(f.3c){f.I.36=k.67;k.48=1C.4i?\'6H\':\'7R(\'+k.5i+k.6J+\'), 6H\';m(k.1j&&k.3a()<6)k.48=\'7F\';f.I.B.2i=k.48}k.1I=f.N;k.2j(Y,\'5w\',k.5h)},2N:r(e){f.x.M=e.19+e.5d;f.y.M=e.1k+e.5e;m(e.2u==\'22\')f.I.B.2i=\'2N\';k.V(f.O,{19:f.x.M+\'E\',1k:f.y.M+\'E\'});m(f.18)f.18.3f(f,f.x.M,f.y.M,f.x.D,f.y.D)},3e:r(e){f.x.D=e.J+e.5d;f.y.D=e.G+e.5e;m(f.x.D<f.2f)f.x.D=f.2f;m(f.y.D<f.2L)f.y.D=f.2L;q d=f.1K;m(1z f.2t==\'2I\'){f.2t=f.12.1o-d.1o;f.2T=f.12.1a-d.1a}k.V(d,{J:(f.x.D-f.2t)+\'E\',G:(f.y.D-f.2T)+\'E\'});q 2s={J:f.x.D+\'E\',G:f.y.D+\'E\'};k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\',1w);m(k.4y)f.2a(\'5E\',\'16\',1w);m(k.4a)f.2a(\'*\',\'16\',1w)},6L:r(){f.a.T=f.a.T.1Z(\'P-7B-7x\',\'\');m(k.4C)f.2a(\'5x\',\'1V\');m(k.4y)f.2a(\'5E\',\'1V\');m(k.4a)f.2a(\'*\',\'1V\');m(f.2d&&f.4q)f.8f();Q{m(f.18&&f.2F)f.18.4A();k.4b(f.O)}m(k.4l)k.4l.B.1H=\'1X\';k.L[f.N]=H;k.8t()}};k.4O=r(a,I,4H){f.a=a;f.I=I;f.4H=4H};k.4O.5Q={5M:r(){f.11=k.2C(f.a);m(f.11.2w(\'#\')){q 2D=f.11.8c(\'#\');f.11=2D[0];f.1g=2D[1]}m(k.4D[f.11]){f.7Z=k.4D[f.11];m(f.1g)f.5D();Q f.4e();F}14{f.35=1E ac()}Z(e){14{f.35=1E 8p("aa.7u")}Z(e){14{f.35=1E 8p("6V.7u")}Z(e){f.5H()}}}q 2z=f;f.35.9E=r(){m(2z.35.9L==4){m(2z.1g)2z.5D();Q 2z.4e()}};f.35.8G("9U",f.11,K);f.35.9R(H)},5D:r(){k.4X();q 2P=1C.4i||k.6i?{11:\'79.8e\'}:H;f.R=k.U(\'R\',2P,{1d:\'1T\',19:\'-3m\'},k.1U);14{f.4e()}Z(e){q 2z=f;2A(r(){2z.4e()},1)}},4e:r(){q s=f.7Z||f.35.as;m(f.4H)k.4D[f.11]=s;m(!k.1j||k.3a()>=5.5){s=s.1Z(/\\s/g,\' \');s=s.1Z(1E 4w(\'<9l[^>]*>\',\'76\'),\'\');s=s.1Z(1E 4w(\'<7b[^>]*>.*?</7b>\',\'76\'),\'\');m(f.R){q 1W=f.R.5s||f.R.56.Y;1W.8G();1W.73(s);1W.1D();14{s=1W.61(f.1g).1A}Z(e){14{s=f.R.Y.61(f.1g).1A}Z(e){}}k.1U.5C(f.R)}Q{s=s.1Z(1E 4w(\'^.*?<1c[^>]*>(.*?)</1c>.*?$\',\'i\'),\'$1\')}}k.3Y(f.I,\'4M\',\'P-1c\').1A=s;f.2o();X(q x 54 f)f[x]=H}};q a2=k.49;k.2j(Y,\'5F\',k.5N);k.2j(Y,\'89\',k.5N);k.2j(1C,\'5A\',k.7T);k.2j(1C,\'5A\',k.7y);',62,663,'|||||||||||||||this|||||hs||if||||var|function|||el|||||||style|exp|span|px|return|height|null|content|width|true|expanders|min|key|wrapper|highslide|else|iframe|caption|className|createElement|setStyles|to|for|document|catch||src|innerContent||try||hidden||objOutline|left|offsetHeight|div|body|position|els|img|id|length|false|ie|top|visibility|outlineType|node|offsetWidth|td|opacity|zIndex|test|parseInt|loading|table|imgPos|op|appendChild|typeof|innerHTML|overlay|window|close|new|next|auto|display|focusKey|params|scrollerDiv|hiddenBy|event|Math|dragArgs|href|overlays|newWidth|newHeight|absolute|container|visible|doc|none|thumbWidth|replace||offsetBorderW|image|offset|marginMin||from||re|swfObject|showHideElements|thumbHeight|minSpan|isHtml|ajax|minWidth|target|case|cursor|addEventListener|contentType|onclick|clearing|offsetBorderH|onLoad|overflow|objectLoadTime|elPos|size|wDiff|type|dur|match|objectType|pos|pThis|setTimeout|graphic|getSrc|arr|up|outlineWhileAnimating|releaseMask|class|undefined|func|by|minHeight|focus|move|styles|attribs|thumbTop|blurExp|li|hDiff|marginBottom|step|parentNode|hasDragged|thumbLeft|ratio||name||||xmlHttp|title||||ieVersion|clone|isImage|imgW|resize|setPosition|scroll|relative|objectWidth|clientSpan|safari|marginMax|9999px|html|getExpander|fading|custom|setAttribute|pendingOutlines|sleeping|getAttribute|scrollingContent|captionId|100|cNode|allowReduce|justify|oFinal|number|getParams|aAr|aTags|navigator|getParam|tagName|prop|mediumContent|getElementsByTagName|cacheBindings|isHsAnchor|childNodes|marginTop|thumbOffsetBorderW|easing|fullExpandWidth|slideshowGroup|push|spaceForCaption|Outline|cloneNode|getElementByClass|location||while|captionText|blur|imgSpan|thumbOffsetBorderH|removeEventListener|marginLeft|styleRestoreCursor|Expander|geckoMac|discardElement|on|preloadTheseImages|loadHTML|param|iebody|cache|opera|dir|before|mask|objectHeight|contentLoaded|parent|displayLoading|preserveContent|page|getNode|zIndexCounter|block|isClosing|RegExp|writeExtendedContent|hideIframes|previousOrNext|destroy|changed|hideSelects|cachedGets|over|end|hsId|pre|positionOverlay|redoShowHide|hasAlphaImageLoader|center|DIV|round|Ajax|allowWidthReduction|thumb|previous|fade|onload|preloadTheseAjax|tr|faders|genContainer|topmostKey|onLoadStarted||allowSizeReduction|ruler|kdeBugCorr|in|currentStyle|contentWindow|scrollLeft|scrollTop|tag|dim|Click|thumbsUserSetId|dX|dY|expand|hideOnMouseOut|keyHandler|graphicsDir|fullExpandLabel|preventDefault|createOverlay|isExpanded|maxWidth|wrapperClassName|allowMultipleInstances|Create|dTop|contentDocument|steps|getAdjacentAnchor|allowHeightReduction|keydown|SELECT|overrides|continuePreloading|load|connectOutline|removeChild|getElementContent|IFRAME|mousedown|expandDuration|onError|getSelfRendered|contentId|padToMinWidth|getCacheBinding|run|mouseClickHandler|thumbSpan|hasMovedMin|prototype|changeSize|tId|documentElement|cancelLoading|correctIframeSize|idCounter|marginRight|numberOfImagesToPreload|garbageBin|sg|getElementById|purge|child|originalCursor|placeCaption|activeI|restoreTitle|thumbnailId|prepareNextOutline|hasFocused|srcElement|element|relatedTarget|captionSlideSpeed|htmlGetSize|hsAr|string|ie6SSL|clones|wrapperKey|origProp|distance|after|250|getWrapperKey|clientY|clientX|outlineStartOffset|preloadFullImage|tbody|topZ|overlayId|cacheAjax|captionEval|getPageSize|padding|credits|setObjContainerSize|attributes|filter|show|offsetTop|pointer|dragHandler|restoreCursor|preloadAjaxElement|afterClose|dLeft|break|compatMode|hsIframe|loadingTitle|modMarginRight|htmlPrepareClose|mousemove|self|Microsoft|clientWidth|loadingText|moveText|appendTo|javascript|onGraphicLoad|htmlExpand|write|resizeTitle||gi|preloadGraphic|parseFloat|blank|conH|script|createFullExpand|restoreDuration|adj|ul|wrapperMouseHandler|previousText|restoreSteps|offsetLeft|loadingOpacity|offsetParent|nextText|fullExpandTitle|vis|background|hide|closeText|cur|closeTitle|XMLHTTP|hasHtmlexpanders|writeCredits|anchor|preloadAjax|creditsHref|creditsText|active|getCaption|creditsTitle|toString|hand|afterExpand|hasExtendedContent|setSize|clickY|form|preloadNext|awake|showCredits|pow|right|createOverlays|url|focusTopmost|preloadImages|fullExpandHeight|clearsY|clearsX|focusTitle|pH|cachedGet|nextSibling|JS|destroyObject|writeCaption|BackCompat|Highslide|temp|pI|detachEvent|mouseup|userAgent|val|split|bottom|htm|sleep|clickX|nopad|border|both|clear|hsPos|fullExpandPosition|htmlSizeOperations|setAttribs|ActiveXObject|fullExpandOpacity|and|KDE|reOrder|easingClose|margin|expandSteps|easeInQuad|fadeInOut|vendor|appVersion|tmpMin|doFullExpand|enableKeyListener|correctRatio|200|open|last|button|upcoming|xpand|switch|returnValue|htmlE|registerOverlay|keyCode|Macintosh|Powered|actual|Expand|front|http|vikjavev|homepage|the|Go|no|bring|cancel|click|1001|zoomout|graphics|drag|Use||Loading|keys|arrow|Previous|Next|innerHeight|clientHeight|innerWidth|MSIE|pageXOffset|pageYOffset|link|footer|header|alpha|removeAttribute|drop|Resize|Close|Move|shadow|all|Gecko|rv|Safari|styleFloat|blockRightClick|flushImgSize|oncontextmenu|white|onreadystatechange|htmlCreate|static|frameBorder|oldBottom|oldRight|wait|readyState|sizingMethod|AlphaImageLoader|DXImageTransform|progid|scale|send|onmouseout|onmouseover|GET|allowTransparency|flash|getPropertyValue|getComputedStyle|defaultView|eval|StopPlay|HsExpander|useOnHtml|default|full|boolean|isNaN|insertBefore|nodeName|Msxml2|300px|XMLHttpRequest|tgt|xywh|tmpHeight|tmpWidth|png|imageCreate|mouseover|linearTween|protocol|dragSensitivity|https|1px|paddingTop|attachEvent|object|responseText|toElement|void|sqrt|fromElement|abs|borderCollapse|lineHeight|fontSize|outlinesDir|cellSpacing|collapse|clearTimeout|outlines|01'.split('|'),0,{}))

/******************************************************************************
Name:    Highslide JS
Version: 3.3.18 (Apr 30 2008)
Config:  default
Author:  Torstein H?si
Support: http://vikjavev.no/highslide/forum

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
	* to copy, distribute, display, and perform the work
	* to make derivative works

Under the following conditions:
	* Attribution. You must attribute the work in the manner  specified by  the
	  author or licensor.
	* Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/

ActiveBox_addEvent(window,'load',function() {
	//	remove the registerOverlay call to disable the controlbar
	hs.registerOverlay(
		{
			thumbnailId:null,
			overlayId:'controlbar',
			position:'top right',
			hideOnMouseOut:true
		}
	);

	hs.graphicsDir = AB_ROOT_DIR;//'/addons/activebox/lib.highslide/images/';

	//	Tell Highslide to use the thumbnail's title for captions
	hs.captionEval = 'this.thumb.title';
    hs.outlineWhileAnimating = true;
});



/*-------------------------------------*
**	TAG INITIALIZE FUNCTION
**	for Highslide
**-------------------------------------*/
//	A = <A> object , B = <IMG> object , c = Caption(.title or .alt attribute)
function ActiveBox_addAttributesToAnchor_Html(A,B,c) {
	A.title=c;
	A.onclick=(function(){return hs.htmlExpand(this,{objectType:'iframe',width:ABpW,height:ABpH});});
}

function ActiveBox_modifyAttributesToAchor_Img(A,B,c) {
	A.title=c;
	A.id='thumb_'+ABsid++;
	A.className='highslide';
	A.onclick=(function(){return hs.expand(this);});
}

function ActiveBox_addAttributesToAchor_Img(A,B,c) {
	A.href=B.src;

	ActiveBox_modifyAttributesToAchor_Img(A,B,c);
}
