/******************************************************************************
 ** G A L L E R Y   S I T E
 *
 * Autor: André Britto
 * Date: 30.08.2007
 * File: site.gallery.js
 */


/**
 * Class: Gallery
 */	

var Gallery = {

  showEvt : function(album, pg){
	showLoading();
	var contentMain = E('imageMini');
	
	var req = reqNew();
	req.onreadystatechange = function() {
	  if(req.readyState == 4) {
	    if(req.status == 200) {
			contentMain.innerHTML = req.responseText;
			//Gallery.showPhoto(images[0].title, images[0]);
    	}else{
			alert(req.status+' '+req.statusText);
		}
		hideLoading();
	  }
	}
	req.open('POST', 'album.php', true);
    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req.send('album='+album+'&pagina='+pg);
	
  },
	
  showPhoto : function(idFoto){
	showLoading();
	var contentMain = E('imageMain');
	
	var req = reqNew();
	req.onreadystatechange = function() {
	  if(req.readyState == 4) {
	    if(req.status == 200) {
			contentMain.innerHTML = req.responseText;
    	}else{
			alert(req.status+' '+req.statusText);
		}
		hideLoading();
	  }
	}
	req.open('POST', 'foto.php', true);
    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req.send('foto='+idFoto);
  }

}


