//swf object variable
var fo;

//Descrierile proiectelor
var cat1ProjectDescription = 
	['', 
	 '',
	 '', 
	 '',
	 '',
	 ''];
	
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];
}


