﻿///<reference path="../ext/vswd-ext_2.2.js">

/*
========================
       Utility
@author: HONG,Lane-Chang
@dates:  2009/02/26
@update: 
========================
*/

//顯示問題訊息
function fnShowQ_YN(title, msg, el, fn) {
    Ext.MessageBox.show({
        title: title,
        msg: msg,
        animEl: el,
        scope: this,
        icon: Ext.MessageBox.QUESTION,
        buttons: Ext.MessageBox.YESNO,
        fn: fn
    });
}


//顯示成功訊息
function fnShowInfo(title, msg, el, fn) {
    Ext.MessageBox.show({
        title: title,
        msg: msg,
        animEl: el,
        scope: this,
        icon: Ext.MessageBox.INFO,
        buttons: Ext.MessageBox.OK,
        fn: fn
    });
}

//顯示警告訊息
function fnShowWar(msg) {
    Ext.MessageBox.show({
        title: '系統訊息',
        msg: msg,
        scope: this,
        icon: Ext.MessageBox.WARNING,
        buttons: Ext.MessageBox.OK
    });
}


//顯示錯誤訊息
function fnShowErr(msg, el, fn) {
    Ext.MessageBox.show({
        title: '系統訊息',
        msg: msg,
        scope: this,
        icon: Ext.MessageBox.ERROR,
        buttons: Ext.MessageBox.OK,
        fn:fn
    });
}


//變更Field Label
function fnSet_fieldLabel(Cmp, newLabel, newClass) {
    var Temp_Cmp = Cmp;
    Temp_Cmp.getEl().up('div.x-form-item').dom.firstChild.firstChild.firstChild.nodeValue = newLabel;
    Temp_Cmp.getEl().up('div.x-form-item').dom.firstChild.firstChild.className = newClass;
    return Temp_Cmp;
}