//Global Module Variables
var _mContainer;

Sys.Application.add_init( 
    function(){
         if( typeof(_mContainer) == 'undefined' )  _mContainer = dnn.getVar('Container_ID'); 
    }
);

function onPopOk(){
    $find('PopupEditSubject').show();
    return false;   
}
function onCancel(){
    $find('PopupEditSubject').hide(); 
    return false;
}

function onUpdate(){
   if ($get(_mContainer+ 'txtSubject').value === ''){
        //TODO
        alert('Error');
   }else{
       $find('PopupEditSubject').hide(); 
        var lbl = document.createElement('SPAN');
        lbl.innerHTML = 'Subject #1';
        $get('divForSubjectEdit').appendChild(lbl);
        var inputTxt = document.createElement('INPUT');
        inputTxt.type = 'text';
        inputTxt.readOnly = true;
        inputTxt.className = 'ElegantTextBox';
        inputTxt.value = $get(_mContainer+ 'txtSubject').value;
        $get('divForSubjectEdit').appendChild(inputTxt);
   }
}

// Add the new Tag to the Game Subject
function AddTag(Tag){
    $get(_mContainer+ 'txtSubject').value = Tag;
}
// Clear the Subject
function ClearSubject(){
    $get(_mContainer+ 'txtSubject').value = "";
}