/* Pierre - 12/09/2011 */ 

function showAlbum(id_album, click_offset) {

	//blank 
	$('#iframeAlbum').attr('src', 'about:blank');


	//charger l'album dans la frame ;-)
	var newurl = 'album'+id_album+'.html';
	$('#iframeAlbum').attr('src', newurl);
	
	//modifier hauteur et largeur du block ... 
	var w = window.innerWidth-100;
	var offset = $('#footer').offset();
	var h = offset.top + $('#footer').height();
	
	var obj = $("#album_photos");
	/*var halfsc = $(window).height()/2;
	var halfh = $(obj).height() / 2; 

	var halfscrn = screen.width/2;
	var halfobj =$(obj).width() / 2; 

	var goRight =  halfscrn - halfobj ;
	var goBottom = halfsc - halfh;
	*/
	//$(obj).css({marginLeft: goRight }).css({marginTop: goBottom });
	/* attention, erreur sous IE8 : */
	if(!$.browser.msie) {
		$(obj).css({width: w }).css({height: h });
	}else{
		/*$(obj).css({left: '250px'});*/
		$(obj).css({height: h});
	}

	//changer le top du bloc album_photos vers offset.top
	//$('#iframeAlbum').offset({top : click_offset.h+500 });
	
	//afficher le bloc
	$('#album_photos').show('');


	

}


function hideAlbum() {
	$('#album_photos').hide();
}


function getScriptname() {
    var loc = window.location;
    var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
    var scriptname = loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length);
    return scriptname;
}


$(document).keyup(function(e) {
  if (e.keyCode == 27) { 
	// $(location).attr('href')
	if(getScriptname()=="photos.html") {
	  	$('#album_photos').hide();	
	}else{
		//albums***.html
	  	window.parent.$('#album_photos').hide();
	}

   }   // esc
});



