// some ask the teacher bullshit

askTeacherEl = document.getElementById('askTeacherLk');
addEvent(askTeacherEl, 'click', askTheTeacher);

function askTheTeacher()
{
    //    window.location = 'lg-askTeacher.php';
}


// for previewing html
var previewId;
var gPreviewFile;

function previewHtml(idName, previewFile) {
    previewId = idName;
    gPreviewFile = previewFile;

    htmlTryEl = document.getElementById('htmlTry-' + previewId);
    htmlString = htmlentities(htmlTryEl.value);

    htmlString = Url.encode(htmlString);
    //    console.log(htmlString);
    params = 'value='+ htmlString + '&previewFile=' + previewFile;
    makeHttpRequest('writeToPreview.php', 'previewDo', 'previewLoading', 'POST', params);

}

function previewDo(content)
{
  document.getElementById(previewId).src = 'tmp/' + gPreviewFile; // replaces the form_adm html with the content from the ajax request
}


function previewLoading()
{
    //  document.getElementById(previewId).innerHTML = 'asteptati un moment...';
}

  function popitup(url, w, h) {
  if (!w) w = 800;
  if (!h) h = 600;
    newwindow=window.open(url,'name',' width= ' + w + ' , height= ' + h
+' ');
    if (window.focus) {newwindow.focus()}
    return false;
}

var vShowHwNote = 1;

function doItHwNote(content)
{
  document.getElementById('hwNote').style.display = 'block'; // it shows in the right  the text: Apasati linkul Contact now...
  document.getElementById('hwNote').innerHTML = content; // replaces the form_adm html with the content from the ajax request
}

function loadingHwNote()
{

}


function showHwNote() {
    if (vShowHwNote == 1) {
	vShowHwNote = 0;
        makeHttpRequest('hwNote.php', 'doItHwNote', 'loadingHwNote', 0);
    } else {
	vShowHwNote = 1;
	setDisplay('hwNote', 0);
    }
}
