
var xmlhttp;

function init(){
   if(window.location.hash){
	    //alert(window.location.hash);
	    loadProject(window.location.hash.substr(1));
   }
}

function loadProject(which){
   window.location.hash=which;
   return loadContent("project.php?lang=nl&id="+which);
}

var http = false;

if (window.XMLHttpRequest){
      http=new XMLHttpRequest();
} else if (window.ActiveXObject){
      http=new ActiveXObject("Microsoft.XMLHTTP");
} 

function loadContent(url) {

  if(!http)return false;

  document.getElementById('content').innerHTML = '';
  document.getElementById('loading').style.display='inline';

  http.open("GET", url, true);
  http.onreadystatechange=function() {

    if(http.readyState == 4) {

      var response = http.responseText;
      document.getElementById('content').innerHTML = response;
    }
  }
  http.send(null);
  return true;
}

function loadedLastPic(){
   document.getElementById('loading').style.display='none';
}
function getName(str){
   var idx=str.indexOf('=');
	 var name=str.substr(idx+1);
	 //alert(name);
	 return name;
}
function highlight(id){
   //item.childNodes[2].className='thumblabel_highlight'; 
   document.getElementById(id).className='thumblabel_highlight'; 
}
function unhighlight(id){
   //item.childNodes[2].className='thumblabel';
   document.getElementById(id).className='thumblabel'; 
}

/* Function to adjust the size of the #content div*/
function adjustSize(){
   var winW=-1 , winH=-1;

   if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
        winW = window.innerWidth;
        winH = window.innerHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
        winW = document.body.offsetWidth;
        winH = document.body.offsetHeight;
     }
   }
   try{
      if(winW >0 && winH >0){
	       var leftbarwidth=157;
         var topbarheight=50;
        
         var leftbarpadding=18;
         var contentwidth=winW-leftbarwidth;
         var contentheight=winH-topbarheight;
         var leftbarheight=winH-leftbarpadding;
         document.getElementById('content').style.width=contentwidth+'px';
         document.getElementById('content').style.height=contentheight+'px';
         document.getElementById('leftbar').style.height=leftbarheight+'px';    
      }else{

      }	
   } catch(err){
    
   }
}

window.onresize = function (evt) {
   adjustSize();
};




