window.onload = initAll;

function initAll() {
	document.getElementById("gethtmlcontent").addEventListener('click',ShowProgressBar,true);
}

function ShowProgressBar() {
  var fill = document.createElement('div');
  fill.setAttribute('id', 'filler');
  document.body.appendChild(fill);



  var height = 20;
  var width = 220;
  var progress = document.createElement('div');
  progress.setAttribute('id', 'progressbar');
  

  progress.setAttribute('style', 'top:'+ ((screen.availHeight/2) - (height/2)) +'px;');

  document.body.appendChild(progress);
    scroll(0,0);
}


function previewContent(content,closeImg) {

  var fill = document.createElement('div');
  fill.setAttribute('id', 'filler');
  document.body.appendChild(fill);

  
  var b = document.getElementsByName('previewC');

  for ( var i=b.length-1; i>=0; --i ){
      if (b[i].id == 'previewComment') {
          var divs = document.getElementById('msgerr');
          document.removeChild(divs)
      }
  }


  var height = 20;
  var width = 350;
  var preview = document.createElement('div');
  preview.setAttribute('id', 'previewComment');
  preview.setAttribute('name', 'previewC');
  var IMG = '<img class="hidecommentbox_btn" onclick="javascript:hideBox();" src="'+closeImg+'/icons/negative.png" />';
  preview.innerHTML = IMG+'<p>'+content+'</p>';
  preview.setAttribute('style', 'top:'+ ((screen.availHeight/2) - (height/2)) +'px; left:'+ ((screen.availWidth/2) - (width/2)) +'px;');
 

  document.body.appendChild(preview);
    //scroll(0,0);
}

function hideBox() {
  var div = document.getElementById('previewComment');
  document.body.removeChild(div);

  var divfiller = document.getElementById('filler');
  document.body.removeChild(divfiller);
}


function deleteline(theid)
{
   var oDiv1 = document.getElementById(theid);
   var outer = document.getElementById('content_admin');
   outer.removeChild(oDiv1);
}




function formclear(element) {
   (element).value='';
}

