﻿var ajaxdestination="";
var righttext="";
var righttr="";

function getdata(what,where,noload) { // get data from source (what)
 try {
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
  		new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (e) { /* do nothing */ }
if (noload=='') {
 document.getElementById(where).innerHTML ="<center><img src='img/loading.gif'><br>Loading...</center>";
 }
// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
 ajaxdestination=where;
if (where!="") {
xmlhttp.onreadystatechange = triggered;
}
 xmlhttp.open("GET", what);
 xmlhttp.send(null);
//  return true;

}

function triggered() { // put data returned by requested URL to selected DIV
  if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) 
if (ajaxdestination= "extracontent") {  document.getElementById("extra").style.display ="block";}
  document.getElementById(ajaxdestination).style.display ="block"; 
  document.getElementById(ajaxdestination).innerHTML =xmlhttp.responseText;
}

function placer(what) {
righttext=what;
}

function rightico(what) {
righttransp();
placer("<img src='ico/"+what+"' align='right'>");
}


function righttransp() {
righttr="1";
}
function putright() {
if (righttext!='')
 {
  document.getElementById("extra").style.display ="block";
  document.getElementById("extracontent").style.display ="block";
  document.getElementById("extracontent").innerHTML =righttext;
 }
if (righttr!=0) {
 document.getElementById("extra").style.border ="none";
 document.getElementById("extracontent").style.border ="none";
 document.getElementById("extra").style.background ="none";
 document.getElementById("extracontent").style.background ="none";
 
} 
}


