// JavaScript Document
// here we define global variable
var twitter_end="";
var location_end=""

function load_twitter(location,id) { // get data from source (what)
 try {
   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
  		new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (e) { /* do nothing */ }

 document.getElementById(id).innerHTML ="loading...";
// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
 twitter_end=id;
 xmlhttp.onreadystatechange = triggered_twitter; // when request finished, call the function to put result to destination DIV
 xmlhttp.open("GET", location);
 xmlhttp.send(null);
  return false;
}

function triggered_twitter() { // put data returned by requested URL to selected DIV
  if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) 
    document.getElementById(twitter_end).innerHTML =xmlhttp.responseText;
}

function load_location(location,id) { // get data from source (what)
 try {
   ymlhttp = window.XMLHttpRequest?new XMLHttpRequest():
  		new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (e) { /* do nothing */ }

 document.getElementById(id).innerHTML ="loading...";
// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
 location_end=id;
 ymlhttp.onreadystatechange = triggered_location; // when request finished, call the function to put result to destination DIV
 ymlhttp.open("GET", location);
 ymlhttp.send(null);
  return false;
}

function triggered_location() { // put data returned by requested URL to selected DIV
  if (ymlhttp.readyState == 4) if (ymlhttp.status == 200) 
    document.getElementById(location_end).innerHTML =ymlhttp.responseText;
}
