/**
 * @author rgaumond
 */

function initialize_ceremony(current_site)
{
	if(!header_completed)
		initialize_ceremony.delay(global_delay,current_site);
	else
	{try{
	site = current_site;
	main_container = $("main_container");
	container = $("container");
	index_container = $("index_container");
	veil = $("veil");
	header = $("header");
	footer = $("footer");
	theBody = document.getElementsByTagName("body")[0];
	IE = navigator.appName=="Microsoft Internet Explorer" ;
	patientez = $("patientez");
	if(site=="roue")
	{
		site_name="La Roue Champ&ecirc;tre";
		site_courriel="info@cycloconcept.ca";
	}	
	else
	{
		site_name="Cyclo-Concept";
		site_courriel="info@larouechampetre.ca";
	}

	load_status();//in user_object
	}catch(e){"error in function initialize_ceremony() in initializer"+e}
	}
}
 
function post_assembly(from)
{
		theBody.scrollTop = 0;
		if (selected_user.id == 0) {
			$("identity_div").style.display = "none";
			$("quitter").style.display = "none";
		}
		else {
			$("identity_div").style.display = "block";
			$("quitter").style.display = "block";
		}
		load_mon_image();//in profil.js
		if (from != "login" )//do not close the veil 
		{
			if( from!="quick")
				processed.delay(global_delay, "from post");

			load_usurpation();//user_utilities
			reloadHeaderButtons();// button_logic.js
			set_win_attributes();
		}
}

function set_win_attributes()
{
	
	if (windows_attributes.findAll(function(w_a){
		return w_a.id == current_window;
	}).size() == 0) 
		alert("No Attributes for "+current_window)
	else {
		
		var the_window = windows_attributes.find(function(w_a){
			return w_a.id == current_window;
		});
	
		if(the_window.header_button!=null)
			current_selected(the_window.header_button);//header_buttons.js

	}
}
