function csInclude(displayId, url) {
         var req = null;
         if (window.XMLHttpRequest) {//other than IE
            try {
              req = new XMLHttpRequest();
            } catch (e) {
              req = null;
            }
         } else if (window.ActiveXObject) {//IE
            try {
              req = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
              try {
                req = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e) {
                req = null;
              }
            }
         }
         var display = document.getElementById(displayId);
         if (!display) {
            alert("give me a valid ID dude.");
            return;
         }
         if (req != null) {
            req.open('GET', 'ajax.php'+url, false);
            req.send(null);
            display.innerHTML = req.responseText;
         } else {
            display.innerHTML =
            "your browser does not support ajax";
         }
}

function visible_id(id) {
 document.getElementById(id).style.visibility='visible';
}

function hidden_id(id) {
 document.getElementById(id).style.visibility='hidden';
}

function OnOff(id) {
 var id = document.getElementById(id);
 if(id.style.visibility=='visible')
  id.style.visibility='hidden';
 else
  id.style.visibility='visible';
}

function Preload(url) {
 if(!document.getElementById(url)){
  var id = document.getElementById('preload');
  if(id){
   var newDiv = document.createElement('div');
   newDiv.id = url;
   newDiv.innerHTML = '<img src="gallery/d'+url+'" />';
   id.appendChild(newDiv);
  }
 }
}

function Imgload(displayId,url) {
 var id = document.getElementById(displayId);
 if(id)
   id.innerHTML = '<img src="gallery/d'+url+'" />';
}

var t = '0';
function Txtload(displayId) {
 var id = document.getElementById(displayId);
 if(id){
  t = setTimeout(function(){visible_id(displayId);},2000);
 }
}


