   var AWActiveMenu = null;
   var _AWTSelectElement = "select";
   var IsIE = true;
   var IsIE4 = (document.all && !document.getElementById) ? true : false;
   var IsIE5 = (document.all && document.getElementById) ? true : false;
   var isIE6 = navigator.appVersion.indexOf("MSIE 6") != -1;
   var IsIEonMac = (IsIE5 && (navigator.platform != "Win32")) ? true : false;

   function CloseModalWindow()
    {
		var parent=window.dialogArguments;
		if (parent!=null)
		{
			parent.document.execCommand('refresh',false,0);
			//parent.location.href = parent.location.href ;
			//parent.location.reload;
			window.close();
		}
	}
	
	function awmenuLinkOnClick (positioningObject, menuName)
    {
        var divObject = awgetElementById(menuName);
        if (AWActiveMenu != divObject) 
        {
			//先隐藏
			awhideActiveMenu(divObject);
            awActiveMenu(divObject);
            AWActiveMenu = divObject;
            window.document.onmousedown = awhideMenu;
            if (positioningObject != null) {
                divObject.style.top = 0;
                divObject.style.left = 0;
                var newTop = awabsoluteTop(positioningObject) + positioningObject.offsetHeight;
                var newLeft = awabsoluteLeft(positioningObject);
				divObject.style.top = awcorrectForBottomEdge(newTop, divObject) + 'px';
                divObject.style.left = awcorrectForRightEdge(newLeft, divObject) + 'px';
                awActiveMenu(divObject);
            }
        }
        else 
        {
			awhideActiveMenu(divObject);
        }
        return false;
    }
    
    function awhideMenu(divObject)
    {
        if (AWActiveMenu!=null) 
        {
			AWActiveMenu.style.display = 'none';
			AWActiveMenu = null;
        }
	}
   
    function awhideActiveMenu(divObject)
    {
        divObject.style.display = 'none';
        AWActiveMenu = null;
	}
     
    function awActiveMenu(divObject)
    {
        divObject.style.display = '';
	}
  
    function awabsoluteTop (element)
    {
        var absoluteTop = element.offsetTop;
        var parentElement = element.offsetParent;
        while (parentElement != null) {
            absoluteTop += parentElement.offsetTop
            if (parentElement != awdocumentElement()) {
                // subtract scrollTop for positioning inside of scrollable elements
                absoluteTop -= parentElement.scrollTop;
            }
            parentElement = parentElement.offsetParent;
        }
        return absoluteTop;
    }
    
    function awabsoluteLeft (element)
    {
        var absoluteLeft = element.offsetLeft;
        var parentElement = element.offsetParent;
        while (parentElement != null) {
            absoluteLeft += parentElement.offsetLeft;
            if (parentElement != awdocumentElement()) {
                // subtract scrollLeft for positioning inside of scrollable elements
                absoluteLeft -= parentElement.scrollLeft;
            }
            parentElement = parentElement.offsetParent;
        }
        return absoluteLeft;
    }
    
    function awcorrectForRightEdge (menuLeft, menuDiv)
    {
        var clientWidth = awclientWidth(awdocumentElement());
        var adjustedMenuLeft = clientWidth - menuDiv.offsetWidth;
        if (menuLeft > adjustedMenuLeft) {
            menuLeft = adjustedMenuLeft;
        }
        return menuLeft;
    }

    function awcorrectForBottomEdge (menuTop, menuDiv)
    {
        var clientHeight = awclientHeight(awdocumentElement());
        var adjustedMenuTop = clientHeight - menuDiv.offsetHeight;
        if (menuTop > adjustedMenuTop) {
            menuTop = adjustedMenuTop;
        }
        return menuTop;
    }
    
    function awclientHeight (docElement)
    {
        var clientHeight = docElement.clientHeight;
        clientHeight += docElement.scrollTop;
        return clientHeight;
    }

    function awclientWidth (docElement)
    {
        var clientWidth = docElement.clientWidth;
        clientWidth += docElement.scrollLeft;
        return clientWidth;
    }
    
    function awgetElementById(id)
    {
        var element = document.getElementById ? document.getElementById(id) : document.all[id];
        return element;
    }
    
    function awdocumentElement ()
    {
        return document.body;
    }
    
    function awcellMouseOver(divObject)
    {
        if (divObject != null) {
            if (awstringEndsWith(divObject.className, ' check')) {
                divObject.className = 'awmenuCellHilite check';
            }
            else if (awstringEndsWith(divObject.className, ' bullet')) {
                divObject.className = 'awmenuCellHilite bullet';
            }
            else {
                divObject.className = 'awmenuCellHilite';
            }
        }
    }
    
    function awcellMouseOut(divObject)
    {
        if (divObject != null) {
            if (awstringEndsWith(divObject.className, ' check')) {
                divObject.className = 'awmenuCell check';
            }
            else if (awstringEndsWith(divObject.className, ' bullet')) {
                divObject.className = 'awmenuCell bullet';
            }
            else {
                divObject.className = 'awmenuCell';
            }
        }
    }
    
    function awstringEndsWith (sourceString, searchString)
    {
        return (sourceString.lastIndexOf(searchString) == (sourceString.length - searchString.length));
    }
    
    function awbodyMouseOver(divObject)
    {
		var OverClass='tableRowHover ';
        if (divObject != null && divObject.className) {
              if (divObject.className.indexOf(OverClass) == -1) {
					divObject.className = OverClass + divObject.className;
					}
        }
    }
    
    function awbodyMouseSelected(divObject)
    {
		var SelectClass = 'tableRowSelected ';
		var Checkbox = awFindRowSelectElement(divObject);
        if (divObject != null && divObject.className) {
              if (divObject.className.indexOf(SelectClass) == -1) {
					divObject.className = SelectClass + divObject.className;
					    if (Checkbox) {
							Checkbox.checked = true;							
						}
					}
					else
					{
						var curClassName = divObject.className;
						if (curClassName && curClassName.substring(0, SelectClass.length) == SelectClass)  {
							divObject.className = curClassName.substring(SelectClass.length, curClassName.length);
						}
					    if (Checkbox) {
							Checkbox.checked = false;
							var selall = awgetElementById("selectallhead");
							if (selall)
							{
								selall.checked = false;							
								}
						}
					}
        }
    }
    
    function awFindRowSelectElement(target)
    {
        var node = null;
		if (awtIsSelectElement(target)) {
            return target;
        }
        else if (target.childNodes) {
            var childNodes = target.childNodes;
            for (var i=0; i < childNodes.length && node == null; i++) {
                node = awFindRowSelectElement(childNodes[i]);
            }
        }
        return node;
    }
    
    function awtIsSelectElement (node)
	{
		return  node.tagName=="INPUT" && (node.type=="checkbox" || node.type=="radio");
	}
   
    function awbodyMouseOut(divObject)
    {
		var OverClass='tableRowHover ';
        if (divObject != null && divObject.className) {
              if (divObject.className.indexOf(OverClass) == -1) {
					}
					else
					{
						var curClassName = divObject.className;
						if (curClassName && curClassName.substring(0, OverClass.length) == OverClass)  {
							divObject.className = curClassName.substring(OverClass.length, curClassName.length);
						}
				}
        }
    }
    
  
function prepTextField(txtField) {
		var textField = document.getElementById(txtField);
		if (textField.value == textField.defaultValue) {
			textField.value = ""
			textField.style.color = "#333333";
		} else textField.select();
	}
	
	function resumeTextField(txtField) {
		var textField = document.getElementById(txtField);
		if (textField.value == "") {
			textField.value = textField.defaultValue;
			textField.style.color = "#999999";
		}
	}
	
	function resumeSelect(joeygraphic) {
		var sel = document.getElementById(joeygraphic);
		var selIndex = sel.selectedIndex;
		if(selIndex > 0) sel.style.color = "#333333";
		else sel.style.color = "#999999";
	}
	
	function disable(disabledDiv, qman) {
		var disabled = document.getElementById(disabledDiv);
		if (qman) {
			disabled.className = "disabled";
		}else {
			disabled.className = "enabled";
		}
	}
	
	function isIE() {
		var browser = navigator.appName;
		if (browser.indexOf("Microsoft") >= 0) return(true);
		else return(false);
	}
	
	function showSuccess(popID, qman) {
	var popUp = document.getElementById(popID);
		if (qman) {
			disable("disabled", true);
			if (isIE()) {
				popUp.style.display = "block";
				popUp.style.position = "absolute";
				popUp.style.top = "100px";
				popUp.style.left = "70px";
			}else popUp.setAttribute("style", "display:block;position:absolute;top:100px;left:70px;");
		}else {
			disable("disabled", false);
			if (isIE()) {
				popUp.style.float = "left";
				popUp.style.display = "none";
			}else {
				popUp.setAttribute("style", "float:left;display:none;");
			}
		}
	}
    


//动态设置HTML元素的背景颜色
function mOvr(src,clrOver) { 
if (!src.contains(event.fromElement)) { 
src.style.cursor = 'hand'; src.bgColor = clrOver; }}

function mOut(src,clrIn) { 
if (!src.contains(event.toElement)) { 
src.style.cursor = 'default'; 
src.bgColor = clrIn; }} 

function mClk(src) { 
if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();} }

function clearForm(){
document.news.query.value="";}
    
    
    
    
    
String.prototype.Trim = function(){ return Trim(this);} 
String.prototype.LTrim = function(){return LTrim(this);} 
String.prototype.RTrim = function(){return RTrim(this);} 

//此处为独立函数 
function LTrim(str) 
{ 
var i; 
for(i=0;i<str.length;i++) 
{ 
if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
} 
str=str.substring(i,str.length); 
return str; 
} 
function RTrim(str) 
{ 
var i; 
for(i=str.length-1;i>=0;i--) 
{ 
if(str.charAt(i)!=" "&&str.charAt(i)!=" ")break; 
} 
str=str.substring(0,i+1); 
return str; 
} 
function trim(str) 
{ 
return LTrim(RTrim(str)); 
} 

//放大输入框脚本
function select_name(oo)
{	   
    var name=oo.value;
    var msg=window.showModalDialog("/XMTTC/UI/inputBox.htm",name,"dialogWidth=450px;dialogHeight=300px;status=no");
//    var msg=window.showModalDialog("../inputBox.htm",name,"dialogWidth=310px;dialogHeight=150px;status=no");
    oo.value=msg;
}
    
    
    
	function prepTextField(txtField) {
		var textField = document.getElementById(txtField);
		if (textField.value == textField.defaultValue) {
			textField.value = ""
			textField.style.color = "#333333";
		} else textField.select();
	}
	
	function resumeTextField(txtField) {
		var textField = document.getElementById(txtField);
		if (textField.value == "") {
			textField.value = textField.defaultValue;
			textField.style.color = "#999999";
		}
	}
    
    
    
    	function RidreactPage(url)
		{
		   window.location.href = url;
		}
    
    
  //GridView改进检索功能用代码 
    function dialog(){
        var titile = '';
        var width = 700;
        var height = 100;
        var src = "";
        var path = "";
        var sFunc = '<input id="dialogOk" type="button" style="cursor:hand;width:53px;height:22px;border:0;background:url(\'\/xmttc\/images\/gb2_4[1].gif\');line-height:20px;" value="" onclick="new dialog().search();" />';
        var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();" src="\/xmttc\/images\/dialogClose0.gif" border="0" width="17" height="17" onmouseover="this.src=\'\/xmttc\/images\/dialogCloseF.gif\';" onmouseout="this.src=\'\/xmttc\/images\/dialogClose0.gif\';" align="absmiddle" />';
        var sBody = '\
                <table id="dialogBodyBox" border="0" align="center" cellpadding="0" cellspacing="0">\
                        <tr height="10"><td colspan="4"></td></tr>\
                        <tr>\
                                <td width="10"></td>\
                                <td width="80" align="center" valign="absmiddle"><img id="dialogBoxFace" src="/xmttc/images/3.gif" /></td>\
                                <td id="dialogMsg" style="font-size:12px;color:#000;"></td>\
                                <td width="10"></td>\
                        </tr>\
                        <tr height="10"><td colspan="4" align="center"></td></tr>\
                        <tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
                        <tr height="10"><td colspan="4" align="center"></td></tr>\
                </table>\
        ';
        var sBox = '\
                <table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #000;display:none;z-index:10;">\
                        <tr height="1" bgcolor="#D6E3EB"><td></td></tr>\
                        <tr height="25" bgcolor="#6795B4">\
                                <td>\
                                        <table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0">\
                                                <tr>\
                                                        <td width="6"></td>\
                                                        <td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">Search DIY</td>\
                                                        <td id="dialogClose" width="27" align="right" valign="middle">\
                                                                ' + sClose + '\
                                                        </td>\
                                                        <td width="6"></td>\
                                                </tr>\
                                        </table>\
                                </td>\
                        </tr>\
                        <tr height="2" bgcolor="#EDEDED"><td></td></tr>\
                        <tr id="dialogHeight" style="height:' + height + '">\
                                <td id="dialogBody" style="background:#fff;color:#000;">' + sBody + '</td>\
                        </tr>\
                        <tr height="30" align="center" valign="middle">\
                                <td style="background:#fff;color:#000;">' + sFunc + '</td>\
                        </tr>\
                </table>\
                <div id="dialogBoxShadow" style="display:none;z-index:9;"></div>\
        ';
        function $(_sId){return document.getElementById(_sId)}
        this.show = function(){$('dialogBodyBox') ? function(){} : this.init();this.middle('dialogBox');this.shadow();}
        
        this.search = function(){
        document.getElementById("keyHid").value = window.frames['dialogFrame'].document.getElementById("ConditionHid").value;
        //alert('Search');
        new dialog().reset();
        if (document.getElementById("keyHid").value == "") 
        {return false;};
        else{javascript:__doPostBack('Search','');return true;}
        }
        
        this.reset = function(){this.hideModule('select', '');$('dialogBox').style.display='none';$('dialogBoxShadow').style.display = "none";$('dialogBody').innerHTML = sBody;}
        this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}
        this.init = function(){
                $('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
                var oDiv = document.createElement('span');
                oDiv.id = "dialogCase";
                oDiv.innerHTML = sBox;
                document.body.appendChild(oDiv);
        }
        this.button = function(_sId, _sFuc){
                if($(_sId)){
                        $(_sId).style.display = '';
                        if($(_sId).addEventListener){
                                if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}
                                $(_sId).act = _sFuc;
                                $(_sId).addEventListener('click', function(){eval(_sFuc)}, false);
                        }else{
                                if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}
                                $(_sId).act = _sFuc;
                                $(_sId).attachEvent('onclick', function(){eval(_sFuc)});
                        }
                }
        }
        this.shadow = function(){
                var oShadow = $('dialogBoxShadow');
                var oDialog = $('dialogBox');
                oShadow['style']['position'] = "absolute";
                oShadow['style']['background']        = "#000";
                oShadow['style']['display']        = "";
                oShadow['style']['opacity']        = "0.2";
                oShadow['style']['filter'] = "alpha(opacity=20)";
                oShadow['style']['top'] = oDialog.offsetTop + 6;
                oShadow['style']['left'] = oDialog.offsetLeft + 6;
                oShadow['style']['width'] = oDialog.offsetWidth;
                oShadow['style']['height'] = oDialog.offsetHeight;
        }
        this.open = function(_sUrl,_sName,_sMode){
                this.show();
                if(!_sMode || _sMode == "no" || _sMode == "yes"){
                        $("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' scrolling='" + _sMode + "'></iframe>";
						$("dialogFrame").src = _sUrl + "?UIName=" + _sName;	
                }
        }
        this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode){
                var oWindow;
                var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;
                var sTop = (screen.height) ? (screen.height - _iHeight)/2 : 0;
                if(window.showModalDialog && _sMode == "m"){
                        oWindow = window.showModalDialog(_sUrl,"","dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");
                } else {
                        oWindow = window.open(_sUrl, '', 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');
                }
        }
        this.event = function(_sMsg, _sOk, _sCancel, _sClose){
                $('dialogFunc').innerHTML = sFunc;
                $('dialogClose').innerHTML = sClose;
                $('dialogBodyBox') == null ? $('dialogBody').innerHTML = sBody : function(){};
                $('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg  : function(){};
                this.show();
                _sOk ? this.button('dialogOk', _sOk) | $('dialogOk').focus() : $('dialogOk').style.display = 'none';
                _sCancel ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';
                _sClose ? this.button('dialogBoxClose', _sClose) : function(){};
                //_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $('dialogOk').style.display = 'none';
                //_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $('dialogCancel').style.display = 'none';
        }
        
        this.set = function(_oAttr, _sVal){
                var oShadow = $('dialogBoxShadow');
                var oDialog = $('dialogBox');
                var oHeight = $('dialogHeight');

                if(_sVal != ''){
                        switch(_oAttr){
                                case 'title':
                                        $('dialogBoxTitle').innerHTML = _sVal;
                                        title = _sVal;
                                        break;
                                case 'width':
                                        oDialog['style']['width'] = _sVal;
                                        width = _sVal;
                                        break;
                                case 'height':
                                        oHeight['style']['height'] = _sVal;
                                        height = _sVal;
                                        break;
                                case 'src':
                                        if(parseInt(_sVal) > 0){
                                                $('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.gif' : function(){};
                                        }else{
                                                $('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};
                                        }
                                        src = _sVal;
                                        break;
                        }
                }
                this.middle('dialogBox');
                oShadow['style']['top'] = oDialog.offsetTop + 6;
                oShadow['style']['left'] = oDialog.offsetLeft + 6;
                oShadow['style']['width'] = oDialog.offsetWidth;
                oShadow['style']['height'] = oDialog.offsetHeight;
        }
        
        this.moveStart = function (event, _sId){
                var oObj = $(_sId);
                oObj.onmousemove = mousemove;
                oObj.onmouseup = mouseup;
                oObj.setCapture ? oObj.setCapture() : function(){};
                oEvent = window.event ? window.event : event;
                var dragData = {x : oEvent.clientX, y : oEvent.clientY};
                var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
                function mousemove(){
                        var oEvent = window.event ? window.event : event;
                        var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
                        var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
                        oObj.style.left = iLeft;
                        oObj.style.top = iTop;
                        $('dialogBoxShadow').style.left = iLeft + 6;
                        $('dialogBoxShadow').style.top = iTop + 6;
                        dragData = {x: oEvent.clientX, y: oEvent.clientY};
                        
                }
                function mouseup(){
                        var oEvent = window.event ? window.event : event;
                        oObj.onmousemove = null;
                        oObj.onmouseup = null;
                        if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
                                oObj.style.left = backData.y;
                                oObj.style.top = backData.x;
                                $('dialogBoxShadow').style.left = backData.y + 6;
                                $('dialogBoxShadow').style.top = backData.x + 6;
                        }
                        oObj.releaseCapture ? oObj.releaseCapture() : function(){};
                }
        }
        this.hideModule = function(_sType, _sDisplay){
                var aIframe = parent.document.getElementsByTagName("iframe");aIframe=0;
                var aType = document.getElementsByTagName(_sType);
                var iChildObj, iChildLen;
                for (var i = 0; i < aType.length; i++){
                        aType[i].style.display        = _sDisplay;
                }
                for (var j = 0; j < aIframe.length; j++){
                        iChildObj = document.frames ? document.frames[j] : aIframe[j].contentWindow;
                        iChildLen = iChildObj.document.body.getElementsByTagName(_sType).length;
                        for (var k = 0; k < iChildLen; k++){
                                iChildObj.document.body.getElementsByTagName(_sType)[k].style.display = _sDisplay;
                        }
                }
        }
        this.middle = function(_sId){
                document.getElementById(_sId)['style']['display'] = '';
                document.getElementById(_sId)['style']['position'] = "absolute";
                document.getElementById(_sId)['style']['left'] = (document.body.clientWidth / 2) - (document.getElementById(_sId).offsetWidth / 2);
                document.getElementById(_sId)['style']['top'] = (document.body.clientHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2);
        }
}






//增加设置隐藏字段功能
 function dialog2(){
        var titile = '';
        var width = 700;
        var height = 100;
        var src = "";
        var path = "";
        var sFunc = '<input id="dialogOk" type="button" style="cursor:hand;width:79px;height:24px;border:0;background:url(\'\/epp_hr\/images\/qb_pay_bn[1].gif\');line-height:20px;" value="" onclick="new dialog2().search2();" />';
        var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog2().reset2();" src="http:\/\/www.butong.net\/other\/061111\/dialogClose0.gif" border="0" width="17" height="17" onmouseover="this.src=\'\/epp_hr\/images\/dialogCloseF.gif\';" onmouseout="this.src=\'\/epp_hr\/images\/dialogClose0.gif\';" align="absmiddle" />';
        var sBody = '\
                <table id="dialogBody2Box2" border="0" align="center" cellpadding="0" cellspacing="0">\
                        <tr height="10"><td colspan="4"></td></tr>\
                        <tr>\
                                <td width="10"></td>\
                                <td width="80" align="center" valign="absmiddle"><img id="dialogBoxFace" src="/epp_hr/images/3.gif" /></td>\
                                <td id="dialogMsg" style="font-size:12px;color:#000;"></td>\
                                <td width="10"></td>\
                        </tr>\
                        <tr height="10"><td colspan="4" align="center"></td></tr>\
                        <tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
                        <tr height="10"><td colspan="4" align="center"></td></tr>\
                </table>\
        ';
        var sBox = '\
                <table id="dialogBox2" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #000;display:none;z-index:10;">\
                        <tr height="1" bgcolor="#D6E3EB"><td></td></tr>\
                        <tr height="25" bgcolor="#6795B4">\
                                <td>\
                                        <table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0">\
                                                <tr>\
                                                        <td width="6"></td>\
                                                        <td id="dialogBoxTitle" onmousedown="new dialog2().moveStart(event, \'dialogBox2\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">H</td>\
                                                        <td id="dialogClose" width="27" align="right" valign="middle">\
                                                                ' + sClose + '\
                                                        </td>\
                                                        <td width="6"></td>\
                                                </tr>\
                                        </table>\
                                </td>\
                        </tr>\
                        <tr height="2" bgcolor="#EDEDED"><td></td></tr>\
                        <tr id="dialogHeight" style="height:' + height + '">\
                                <td id="dialogBody2" style="background:#fff;color:#000;">' + sBody + '</td>\
                        </tr>\
                        <tr height="30" align="center" valign="middle">\
                                <td style="background:#fff;color:#000;">' + sFunc + '</td>\
                        </tr>\
                </table>\
                <div id="dialogBoxShadow2" style="display:none;z-index:9;"></div>\
        ';
        function $(_sId){return document.getElementById(_sId)}
        this.show = function(){$('dialogBody2Box') ? function(){} : this.init();this.middle('dialogBox2');this.shadow();}
        
        this.search2 = function(){
        document.getElementById("hidekeytxt").value = window.frames['dialogFrame2'].document.getElementById("HidConditionHid").value;
        window.frames['dialogFrame2'].document.getElementById("hidbtn").click();
        //window.frames['dialogFrame2'].document.location.replace(location.href);
        new dialog2().reset2();
        javascript:__doPostBack('Hide','');
        //javascript:__doPostBack('hide_BmsKindList','');
       
        }
        
        this.reset2 = function(){this.hideModule2('select', '');$('dialogBox2').style.display='none';$('dialogBoxShadow2').style.display = "none";$('dialogBody2').innerHTML = sBody;}
        this.html = function(_sHtml){$("dialogBody2").innerHTML = _sHtml;this.show();}
        this.init = function(){
                $('dialogCase2') ? $('dialogCase2').parentNode.removeChild($('dialogCase2')) : function(){};
                var oDiv = document.createElement('span');
                oDiv.id = "dialogCase2";
                oDiv.innerHTML = sBox;
                document.body.appendChild(oDiv);
        }
        this.button = function(_sId, _sFuc){
                if($(_sId)){
                        $(_sId).style.display = '';
                        if($(_sId).addEventListener){
                                if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}
                                $(_sId).act = _sFuc;
                                $(_sId).addEventListener('click', function(){eval(_sFuc)}, false);
                        }else{
                                if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}
                                $(_sId).act = _sFuc;
                                $(_sId).attachEvent('onclick', function(){eval(_sFuc)});
                        }
                }
        }
        this.shadow = function(){
                var oShadow = $('dialogBoxShadow2');
                var oDialog = $('dialogBox2');
                oShadow['style']['position'] = "absolute";
                oShadow['style']['background']        = "#000";
                oShadow['style']['display']        = "";
                oShadow['style']['opacity']        = "0.2";
                oShadow['style']['filter'] = "alpha(opacity=20)";
                oShadow['style']['top'] = oDialog.offsetTop + 6;
                oShadow['style']['left'] = oDialog.offsetLeft + 6;
                oShadow['style']['width'] = oDialog.offsetWidth;
                oShadow['style']['height'] = oDialog.offsetHeight;
        }
        this.open2 = function(_sUrl,_sName,_sMode){
                this.show();
                if(!_sMode || _sMode == "no" || _sMode == "yes"){
                        $("dialogBody2").innerHTML = "<iframe id='dialogFrame2' width='100%' height='100%' frameborder='0' scrolling='" + _sMode + "'></iframe>";
						$("dialogFrame2").src = _sUrl + "?UIName=" + _sName;	
                }
        }
        this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode){
                var oWindow;
                var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;
                var sTop = (screen.height) ? (screen.height - _iHeight)/2 : 0;
                if(window.showModalDialog && _sMode == "m"){
                        oWindow = window.showModalDialog(_sUrl,"","dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");
                } else {
                        oWindow = window.open(_sUrl, '', 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');
                }
        }
        this.event = function(_sMsg, _sOk, _sCancel, _sClose){
                $('dialogFunc').innerHTML = sFunc;
                $('dialogClose').innerHTML = sClose;
                $('dialogBody2Box') == null ? $('dialogBody2').innerHTML = sBody : function(){};
                $('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg  : function(){};
                this.show();
                _sOk ? this.button('dialogOk', _sOk) | $('dialogOk').focus() : $('dialogOk').style.display = 'none';
                _sCancel ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';
                _sClose ? this.button('dialogBoxClose', _sClose) : function(){};
                //_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $('dialogOk').style.display = 'none';
                //_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $('dialogCancel').style.display = 'none';
        }
        
        this.set = function(_oAttr, _sVal){
                var oShadow = $('dialogBoxShadow2');
                var oDialog = $('dialogBox2');
                var oHeight = $('dialogHeight');

                if(_sVal != ''){
                        switch(_oAttr){
                                case 'title':
                                        $('dialogBoxTitle').innerHTML = _sVal;
                                        title = _sVal;
                                        break;
                                case 'width':
                                        oDialog['style']['width'] = _sVal;
                                        width = _sVal;
                                        break;
                                case 'height':
                                        oHeight['style']['height'] = _sVal;
                                        height = _sVal;
                                        break;
                                case 'src':
                                        if(parseInt(_sVal) > 0){
                                                $('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.gif' : function(){};
                                        }else{
                                                $('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};
                                        }
                                        src = _sVal;
                                        break;
                        }
                }
                this.middle('dialogBox2');
                oShadow['style']['top'] = oDialog.offsetTop + 6;
                oShadow['style']['left'] = oDialog.offsetLeft + 6;
                oShadow['style']['width'] = oDialog.offsetWidth;
                oShadow['style']['height'] = oDialog.offsetHeight;
        }
        
        this.moveStart = function (event, _sId){
                var oObj = $(_sId);
                oObj.onmousemove = mousemove;
                oObj.onmouseup = mouseup;
                oObj.setCapture ? oObj.setCapture() : function(){};
                oEvent = window.event ? window.event : event;
                var dragData = {x : oEvent.clientX, y : oEvent.clientY};
                var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
                function mousemove(){
                        var oEvent = window.event ? window.event : event;
                        var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
                        var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
                        oObj.style.left = iLeft;
                        oObj.style.top = iTop;
                        $('dialogBoxShadow2').style.left = iLeft + 6;
                        $('dialogBoxShadow2').style.top = iTop + 6;
                        dragData = {x: oEvent.clientX, y: oEvent.clientY};
                        
                }
                function mouseup(){
                        var oEvent = window.event ? window.event : event;
                        oObj.onmousemove = null;
                        oObj.onmouseup = null;
                        if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
                                oObj.style.left = backData.y;
                                oObj.style.top = backData.x;
                                $('dialogBoxShadow2').style.left = backData.y + 6;
                                $('dialogBoxShadow2').style.top = backData.x + 6;
                        }
                        oObj.releaseCapture ? oObj.releaseCapture() : function(){};
                }
        }
        this.hideModule2 = function(_sType, _sDisplay){
                var aIframe = parent.document.getElementsByTagName("iframe");aIframe=0;
                var aType = document.getElementsByTagName(_sType);
                var iChildObj, iChildLen;
                for (var i = 0; i < aType.length; i++){
                        aType[i].style.display        = _sDisplay;
                }
                for (var j = 0; j < aIframe.length; j++){
                        iChildObj = document.frames ? document.frames[j] : aIframe[j].contentWindow;
                        iChildLen = iChildObj.document.body.getElementsByTagName(_sType).length;
                        for (var k = 0; k < iChildLen; k++){
                                iChildObj.document.body.getElementsByTagName(_sType)[k].style.display = _sDisplay;
                        }
                }
        }
        this.middle = function(_sId){
                document.getElementById(_sId)['style']['display'] = '';
                document.getElementById(_sId)['style']['position'] = "absolute";
                document.getElementById(_sId)['style']['left'] = (document.body.clientWidth / 2) - (document.getElementById(_sId).offsetWidth / 2);
                document.getElementById(_sId)['style']['top'] = (document.body.clientHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2);
        }
}


