/**
 * @author jun k8440ty@nate.com
 */
function createXMLFromString(string) {
   var xmlDocument;
   var xmlParser;
   if(window.ActiveXObject){   //IE일 경우
      xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
      xmlDocument.async = false;
      xmlDocument.loadXML(string);
   } else if (window.XMLHttpRequest) {   //Firefox, Netscape일 경우
      xmlParser = new DOMParser();
      xmlDocument = xmlParser.parseFromString(string, 'text/xml');
   } else {
      return null;
   }
   return xmlDocument;
}

function html_escape(str)
{
 return str.replace(/&/g, "%26").replace(/=/g,"%3D");
}
function html_escape2(str)
{
 return str.replace(/&/g, "&amp;").replace(/</g,"&lt;")
     .replace(/>/g,"&gt;").replace(/"/g,"&quot;")
     .replace(/'/g,"&apos;");
}
function html_escape3(str)
{
 return str.replace(/&amp;/g, "&").replace(/&lt;/g,"<")
     .replace(/&gt;/g,">").replace(/&quot;/g,"\"")
     .replace(/&apos;/g,"\'");
}

function html_br(str)
{
 return str.replace(/\n/g, "<br />");
}

jQuery.fn.center = function() {
        return this.each(function() {
                var t = jQuery(this);
                t.css({position: 'fixed'});
                var w = t.width(), 
                        h = t.height(), 
                        lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
                        lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10), 
                        tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
                        tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10), 
                        leftMargin = (w + lrPadding + lrBorder) / 2;
                        topMargin = (h + tbPadding + tbBorder) / 2;

                t.css({
                        position: 'fixed', 
                        left: '50%', 
                        top: '50%', 
                        marginLeft: '-' +leftMargin +'px', 
                        marginTop: '-' +topMargin +'px', 
                        zIndex: '99'
                });
        });
};
jQuery.fn.center_ie6 = function() {

        return this.each(function() {
                var t = jQuery(this);
                t.css({position: 'absolute'});
                var w = t.width(), 
                        h = t.height(), 
                        lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
                        lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10), 
                        tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
                        tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10), 
                        leftMargin = (w + 0 + 0) / 2;
                        topMargin = (h + 0 + 0) / 2;
                t.css({
                        position: 'absolute', 
                        left: '50%', 
                        top: '50%', 
                        marginLeft: '-' +leftMargin +'px', 
                        marginTop: '-' +topMargin +'px', 
                        zIndex: '99'
                });
        });
		
};

jQuery.fn.left = function() {
        return this.each(function() {
                var t = jQuery(this);
                t.css({position: 'fixed'});
                var w = t.width(), 
                        h = t.height(), 
                        lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
                        lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10), 
                        tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
                        tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10), 
                        leftMargin = (w + lrPadding + lrBorder) / 2;
                        topMargin = (h + tbPadding + tbBorder) / 2;

                t.css({
                        position: 'fixed', 
                        left: '10px', 
                        top: '30px', 
                        zIndex: '99'
                });
        });
};
jQuery.fn.left_ie6 = function() {

        return this.each(function() {
                var t = jQuery(this);
                t.css({position: 'absolute'});
                var w = t.width(), 
                        h = t.height(), 
                        lrPadding = parseInt(t.css('paddingLeft'), 10) + parseInt(t.css('paddingRight'), 10), 
                        lrBorder = parseInt(t.css('borderLeftWidth'), 10) + parseInt(t.css('borderRightWidth'), 10), 
                        tbPadding = parseInt(t.css('paddingTop'), 10) + parseInt(t.css('paddingBottom'), 10), 
                        tbBorder = parseInt(t.css('borderTopWidth'), 10) + parseInt(t.css('borderBottomWidth'), 10), 
                        leftMargin = (w + 0 + 0) / 2;
                        topMargin = (h + 0 + 0) / 2;
                t.css({
                        position: 'absolute', 
                        left: '10px', 
                        top: '30px', 
                        zIndex: '99'
                });
        });
		
};

function trim12(str){var str = str.replace(/^\s\s*/, ''),ws = /\s/,i = str.length;while (ws.test(str.charAt(--i)));return str.slice(0, i + 1);}

jQuery.browser.msie6 = jQuery.browser.msie && parseInt(jQuery.browser.version) == 6 && !window["XMLHttpRequest"];