// Alp-Software JS Framework (c) 2009 - v1.2 - 2009-03-18

function Popup(Page, Width, Height)
{
   window.open(Page, '', 'scrollbars=yes,menubar=no,toolbar=no,resizable=no,width=' + Width + ',height=' + Height);
}


this.document.write('<div id="objPopup_Fond" style="display:none;position:absolute;z-index:50;background-color:#000000;height:100%;-moz-opacity:0.7;opacity: 0.7;filter:alpha(opacity=70);"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
this.document.write('        <tr>');
this.document.write('          <td align="center" valign="middle">&nbsp;</td>');
this.document.write('        </tr>');
this.document.write('      </table></div><iframe src="vide.html"  allowtransparency="true" frameborder="0" height="100%" hspace="0" id="objPopup_Content" marginheight="0" marginwidth="0" name="objPopup_Content" scrolling="no" vspace="0" width="100%" style="position:absolute;z-index:99;display:none;"></iframe>');

this.document.write('      <iframe src="vide.html" frameborder="0" height="100%" hspace="0" id="objPopup_Content_Scroll" marginheight="0" marginwidth="0" name="objPopup_Content_Scroll" scrolling="auto" vspace="0" width="100%" style="position:absolute;z-index:99;background-color:#000000;display:none;"></iframe>');

function Under_Popup(Page, Width, Height, Couleur)
{
	SetAlpha('objPopup_Fond',0);
	SetAlpha('objPopup_Content_Scroll',0);

	if (Couleur != undefined)
	{
		document.getElementById('objPopup_Fond').style.backgroundColor = Couleur;
	}
	
	//Prépare le fond
	document.getElementById('objPopup_Fond').style.left = 0;
	document.getElementById('objPopup_Fond').style.top = 0;
	document.getElementById('objPopup_Fond').style.width = document.body.scrollWidth;
	document.getElementById('objPopup_Fond').style.height = document.body.scrollHeight;
	document.getElementById('objPopup_Fond').style.display='inline';

	//Affiche le fond
	DoAlpha('objPopup_Fond',0,70);

	document.getElementById('objPopup_Content_Scroll').src = Page;
	document.getElementById('objPopup_Content_Scroll').style.left = (document.body.scrollWidth - Width) / 2;
	document.getElementById('objPopup_Content_Scroll').style.top = document.body.scrollTop + (document.body.clientHeight - Height) / 2;
	document.getElementById('objPopup_Content_Scroll').style.width = Width; //Width
	document.getElementById('objPopup_Content_Scroll').style.height = Height; //Height
	document.getElementById('objPopup_Content_Scroll').style.display = 'inline';
	
	DoAlpha('objPopup_Content_Scroll',0, 100);	

	//Lance les actions
	DoQueue();
}


function Under_Popup_Photo(Photo, Couleur)
{
	SetAlpha('objPopup_Fond',0);
	SetAlpha('objPopup_Content',0);

	if (Couleur != undefined)
	{
		document.getElementById('objPopup_Fond').style.backgroundColor = Couleur;
	}
	
	//Prépare le fond
	document.getElementById('objPopup_Fond').style.left = 0;
	document.getElementById('objPopup_Fond').style.top = 0;
	document.getElementById('objPopup_Fond').style.width = document.body.scrollWidth;
	document.getElementById('objPopup_Fond').style.height = document.body.scrollHeight;
	document.getElementById('objPopup_Fond').style.display='inline';

	//Affiche le fond
	DoAlpha('objPopup_Fond',0,70);
	
	//Charge l'image
	document.getElementById('objPopup_Content').src = "photo.html?" + Photo;
	
	//Lance les actions
	DoQueue();
}

function Under_Popup_Photo_Load(Width, Height, Bordure_Largeur, Bordure_Couleur)
{
	//Position initiale de la photo
	document.getElementById('objPopup_Content').style.left = (document.body.scrollWidth) / 2;
	document.getElementById('objPopup_Content').style.top = document.body.scrollTop + (document.body.clientHeight) / 2;
	document.getElementById('objPopup_Content').style.width = 0;
	document.getElementById('objPopup_Content').style.height = 0;
	document.getElementById('objPopup_Content').style.display = 'inline';

	//Affiche une bordure
	if (Bordure_Largeur != undefined)
	{
		Width++;
		Width++;
		Height++;;
		Height++;
		
		window.frames['objPopup_Content'].document.getElementById('objImage').style.border = Bordure_Largeur + "px solid " + Bordure_Couleur;
	}

	//Affiche le contenu
	SetAlpha('objPopup_Content',100);
	
	//Position finale
	Left = (document.body.scrollWidth - Width) / 2;
	Top = document.body.scrollTop + (document.body.clientHeight - Height) / 2;

	DoExpand('objPopup_Content', Left, Top, Width, Height);

	//Lance les actions
	DoQueue();	
}

function Under_Popup_Close()
{
	//Cache le contenu
	AddQueue("SetDisplay('objPopup_Content', false)");	
	AddQueue("SetDisplay('objPopup_Content_Scroll', false)");	
	
	//Masque le fond et la page
	DoAlpha('objPopup_Fond',70,0);
	AddQueue("SetDisplay('objPopup_Fond', false)");
	
	AddQueue("document.getElementById('objPopup_Content').src = 'vide.html'");
	AddQueue("document.getElementById('objPopup_Content_Scroll').src = 'vide.html'");
		
	//Lance les actions
	DoQueue();	
}