function doPhoto()
{
	document.getElementById('headerdos').className='hide';
	document.getElementById("content").innerHTML='';

	var http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            // http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
		  // fall back to old photo-implementation
         window.location='http://www.kijkbuiskinderen.nl/slideshow/index.html';
         return false;
      }

   	http_request.onreadystatechange=function() {
    	if(http_request.readyState==4)
      	{
          document.getElementById("content").innerHTML = http_request.responseText;
     	 }
    }


   	http_request.open("GET","../includes/photo_list.php",true);
	http_request.send(null);
	document.getElementById('content').className='content_photo';
}

function showPhoto(s_url_width_height)
{
	t_s_com=s_url_width_height.split('&width=');
	s_url=t_s_com[0];
	s_com=t_s_com[1].split('&height=');

	t_s_width=s_com[0];
	t_s_height=s_com[1];

	s_ratio = t_s_width/t_s_height;
	
	// check width; fix width, fix height accordingly
	if (t_s_width > 900) {
		e_t_width=900;
		e_t_height=e_t_width/s_ratio;
	} else {
		e_t_width = t_s_width;
		e_t_height = t_s_height;
	}
	// check (possibly fixed) height, fix width accordingly
	if (e_t_height > 480) {
		e_height=480;
		e_width=e_height*s_ratio;
	} else {
		e_height = e_t_height;
		e_width = e_t_width;
	}

	document.getElementById("content").innerHTML = '<div id=\'photo_inner_show\'><a href=\'javascript:doPhoto();\'><img src="'  + s_url + '" width="' + e_width + 'px" height="' + e_height + 'px" /></a></div>';
}
