var Q_tooltip = {
/*
Browser: MSIE8, Firefox3, Safari3, Opera9
DTD: Strict XHTML 1.0
Created: 2008-08-17
Last Updated: 2009-01-14
*/
     usr_agnt : navigator.userAgent.toLowerCase()
    ,dvtnX : 30
    ,dvtnY : 30
    ,background_color : '#f4f4f4'
    ,font : '12px arial'
    ,padding : '10px'
    ,border : '0px solid silver'
	,border2 : '0px solid #f4f4f4'
	,font_weight : 'bold'
	,white_space : 'nowrap'
    ,event_attach : function(objct,type,fnctn) {
        if(objct.attachEvent) { var rtrn = objct.attachEvent('on'+type,fnctn); return rtrn; } //MSIE
        else if(objct.addEventListener) { objct.addEventListener(type,fnctn,false); return true; } //Mozilla
        else objct.onclick = fnctn;
    }
    ,scrlld : function() {
        var arry = new Array(2);
        if(document.body.scrollLeft)                 arry[0] = document.body.scrollLeft;
        else if(document.documentElement.scrollLeft) arry[0] = document.documentElement.scrollLeft;
        if(document.body.scrollTop)                  arry[1] = document.body.scrollTop;
        else if(document.documentElement.scrollTop)  arry[1] = document.documentElement.scrollTop;
        return arry;
    }
    ,create : function() {
        var ghost    = this;
        this.objct   = null;
        this.img     = null;
        this.dscrptn = null;
        this.wdth    = null;
        this.hght    = null;
        this.dvsn    = null;
		this.dvsn2    = null;
        this.mouseover = function(e) {
            var evntX = e.clientX;
            var evntY = e.clientY;
            var scrlld_x = 0;
            var scrlld_y = 0;
            var arry = Q_tooltip.scrlld();
            if(typeof(arry[0])!='undefined') scrlld_x += arry[0];
            if(typeof(arry[1])!='undefined') scrlld_y += arry[1];
            var clntW = (document.compatMode=='BackCompat')?(document.body.clientWidth ):(document.documentElement.clientWidth );
            var clntH = (document.compatMode=='BackCompat')?(document.body.clientHeight):(document.documentElement.clientHeight);
            var dvsnW = ghost.dvsn.offsetWidth;
            var dvsnH = ghost.dvsn.offsetHeight;
            if(evntX+dvsnW>clntW)
                 ghost.dvsn.style.left = scrlld_x+clntW-(dvsnW+Q_tooltip.dvtnX)+'px';
            else ghost.dvsn.style.left = scrlld_x+evntX-Q_tooltip.dvtnX +'px';
            if(evntY-dvsnH-Q_tooltip.dvtnY<0) 
                 ghost.dvsn.style.top = scrlld_y+evntY+Q_tooltip.dvtnY+'px';
            else ghost.dvsn.style.top = scrlld_y+evntY-dvsnH-Q_tooltip.dvtnY+'px';
            ghost.dvsn.style.visibility = 'visible';
        };
        this.mouseout = function(e) { 
            ghost.dvsn.style.visibility = 'hidden';
        };
        this.attch = function() {
            ghost.dvsn = document.createElement('div');
            if(ghost.wdth) {
				var wd = ghost.wdth;
				var myWidth = 0;
				if( typeof( window.innerWidth ) == 'number') {
					//Non-IE
					myWidth = window.innerWidth;
				} else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
					//IE 6+ in 'standards compliant mode'
					myWidth = document.documentElement.clientWidth;
				} else if( document.body && ( document.body.clientWidth ) ) {
					//IE 4 compatible
					myWidth = document.body.clientWidth;
				}
				if((myWidth-50) <= wd) myWidth = (myWidth-50);
				else myWidth = wd;
				//if(myWidth<450) myWidth=200;
				//else myWidth= wd;
				ghost.dvsn.style.width  = myWidth+'px';
			}
            //if(ghost.hght) ghost.dvsn.style.height = ghost.hght+'px';
            ghost.dvsn.style.zIndex = 1000;
            ghost.dvsn.style.visibility = 'hidden';
            ghost.dvsn.style.position = 'absolute';
            ghost.dvsn.style.left     = '0px';
            ghost.dvsn.style.top      = '0px';
            ghost.dvsn.style.backgroundColor = Q_tooltip.background_color;
            ghost.dvsn.style.font            = Q_tooltip.font;
            ghost.dvsn.style.padding         = Q_tooltip.padding;
            ghost.dvsn.style.border          = Q_tooltip.border;
			ghost.dvsn.style.verticalAlign	  = 'bottom';
			//ghost.dvsn.style.whiteSpace     = Q_tooltip.white_space;
			//ghost.dvsn.style.fontWeight     = Q_tooltip.font_weight;
			table1=document.createElement("table");
			with(table1){
				border=0;
				cellpadding=0;
				cellspacing=0;
				//table1.style.backgroundColor="#000000";
			}
			ghost.dvsn.appendChild(table1);
			if(ghost.img) {
				tr10=document.createElement("tr");
				tr10 = table1.insertRow();
				with(tr10){
					height=20;
				}
				//table1.appendChild(tr10);
				var td10 = tr10.insertCell();
				//td10=document.createElement('td');
				with(td10){
					width="100%";
					//td10.style.backgroundColor="#fff";
					td10.style.whiteSpace = Q_tooltip.white_space;
					td10.style.fontWeight = Q_tooltip.font_weight;
					innerText = ghost.img;
				}
			}
            if(ghost.dscrptn) {
				tr11=document.createElement("tr");
				tr11 = table1.insertRow();
				with(tr11){
					//height=20;
				}
				//table1.appendChild(tr10);
				var td11 = tr11.insertCell();
				//td10=document.createElement('td');
				with(td11){
					width="100%";
					td11.style.textAlign = 'justify';
					innerText = ghost.dscrptn;
				}
                //dscrptn = document.createTextNode(ghost.dscrptn);
                //ghost.dvsn.appendChild(dscrptn);
            }
            document.getElementsByTagName('body')[0].appendChild(ghost.dvsn);
            Q_tooltip.event_attach(ghost.objct,'mouseover',ghost.mouseover);
            Q_tooltip.event_attach(ghost.objct,'mouseout' ,ghost.mouseout);
        };
        this.rgstr = function() {
            Q_tooltip.event_attach(window,'load',ghost.attch);
        };
    }
    //idntty,img,dscrptn,wdth,hght
    ,add : function() {
        var ghost = new Q_tooltip.create();
        ghost.objct = document.getElementById(arguments[0]);
        if(arguments[1]) ghost.img     = arguments[1];
        if(arguments[2]) ghost.dscrptn = arguments[2];
        if(arguments[3]) ghost.wdth	= arguments[3];
        if(arguments[4]) ghost.hght    = arguments[4];
        ghost.rgstr();
    }
};
 window.onerror = function(ErrorMessage, Url, Line){ 
	  //window.status = 'Error : ' + ErrorMessage + ' : ' + Line + ' Line';  //¿À·ù ¸Þ¼¼Áö Ç¥½Ã 
	  window.status = '';  //¿À·ù ¸Þ¼¼Áö °¨Ãß±â 
	  return true; 
 } 
// customizing
//Q_tooltip.background_color = 'white';
//Q_tooltip.font    = '12px arial';
//Q_tooltip.padding = '10px';
//Q_tooltip.border  = '1px solid silver';

