//swf object variable
var fo;

//Descrierile proiectelor
var cat1ProjectDescription = 
	['Beneficiar_UCMR-ADA | Colaborator_Enclava de Arhitectura | Faza_Concurs', 
	 'Beneficiar_Horia C. | In cadrul_Studio T ',
	 'Beneficiar_ANL | Colaborator_Enclava de Arhitectura / Tehnoclima | Faza_Concurs'];
	
var cat2ProjectDescription = 
	['Beneficiar_Tei Lake Residence| In cadrul_Studio T ', 
	 'Beneficiar_Green Lake Residence| In cadrul_Studio T ' ];

var cat3ProjectDescription = 
	['Beneficiar_Banca Romaneasca | Colaborator_Arhiteq'];

var cat4ProjectDescription = 
	['Beneficiar_UNDP Romania | Colaborator_Enclava de Arhitectura', 
	 'Beneficiar_UNDP Romania | Colaborator_Enclava de Arhitectura', 
	 'Beneficiar_Primaria Bucuresti | Colaborator_Enclava de Arhitectura | Faza_Concurs'];

var catDescription = [cat1ProjectDescription, cat2ProjectDescription, cat3ProjectDescription, cat4ProjectDescription ];

//initilize the gallery when first loading the page
function InitializeGallery()
{
	//initialize gallery
	fo = new SWFObject("lib/autoviewer.swf", "autoviewer", "600", "400", "4", "#FFFFFF");						
	//Optional Configuration
	fo.addVariable("langOpenImage", "Open Image in New Window");
	fo.addVariable("langAbout", "About");
	ChangeGallery('1','1');
	
	//initialize project description
	ChangeDescription(1, 1);
}

function ChangeGalleryAndDescription(categoryId, projectId)
{
	ChangeGallery(categoryId, projectId);
	ChangeDescription(categoryId, projectId);
	
}

//change the gallery, identified by category and project
function ChangeGallery(categoryId, projectId)
{
	var xmlPath;
	fo.addVariable("xmlURL", "galleries/cat." + categoryId + "/gallery.p." + projectId + ".xml");					
	fo.write("flashcontent");		
}

function ChangeDescription(categoryId, projectId)
{
	document.getElementById('GalleryDescriptionId').innerHTML = catDescription[categoryId-1][projectId-1];
}

