// JavaScript Document

var projectsImageURI = "Images/Projects/";

var projectsImageMBSURI = "Images/Projects/MBS/";
var projectsImageMLSURI = "Images/Projects/MLS/";
var projectsImageMMSURI = "Images/Projects/MMS/";

var currentImageIndex = 0;

excelSoftArray 	= new Array('Excelsoft-1.jpg','Excelsoft-2.jpg','Excelsoft-3.jpg','Excelsoft-6.jpg',
							'Excelsoft-7.jpg','Excelsoft-9.jpg'); 

dubaiArray  = new Array('DubaiMetro-1.jpg','DubaiMetro-2.jpg','DubaiMetro-3.jpg','DubaiMetro-4.jpg',
							'DubaiMetro-5.jpg','DubaiMetro-6.jpg','DubaiMetro-7.jpg'); 

tataArray 		= new Array('Indicom-1.jpg','Indicom-2.jpg','Indicom-3.jpg'); 

mahindraArray 	= new Array('Satyam-1.jpg','Satyam-2.jpg'); 

cryArray 		= new Array('CRY-1.jpg','CRY-2.jpg','CRY-3.jpg','CRY-4.jpg','CRY-5.jpg'); 

delloSportArray = new Array('Gazetta-1.jpg'); 

trainArray		= new Array('Play2Train-1.jpg','Play2Train-2.jpg','Play2Train-3.jpg');

alfaLumArray 	= new Array('Alfalum-1.jpg', 'Alfalum-2.jpg','Alfalum-3.jpg');

rayArray 		= new Array('Ray&k-1.jpg', 'Ray&k-2.jpg'); 

bollywood 		= new Array('Bollywood-1.jpg','Bollywood-3.jpg','Bollywood-5.jpg','Bollywood-6.jpg',
							'Bollywood-7.jpg','Bollywood-8.jpg','Bollywood-9.jpg'); 

comunicattore	= new Array('Comunicattore-1.jpg','Comunicattore-2.jpg','Comunicattore-3.jpg'); 

elks 			= new Array('Elks-1.jpg','Elks-2.jpg','Elks-3.jpg','Elks-4.jpg'); 

mbs				= new Array('MBS (1).jpg','MBS (2).jpg','MBS (3).jpg',
							'MBS (4).jpg', 'MBS (5).jpg','MBS (6).jpg'); 

mms 			= new Array('MMS (1).jpg','MMS (2).jpg','MMS (3).jpg'); 

mls 			= new Array('MLS (1).jpg','MLS (2).jpg','MLS (3).jpg','MLS (4).jpg','MLS (6).jpg',
							'MLS (7).jpg','MLS (8).jpg','MLS (13).jpg','MLS (14).jpg'); 

//	Image Descriptions Array Starts


excelSoftDescArray 		= new Array('The e-School Auditourium and Resource Centre',
								   'The eSchool Science Lab- 3D Interactive Experiment',
								   'The eSchool Campus',
								   'The eSchool Reception',
								   'The eSchool Science Classroom',
								   'Excelsoft'); 


dubaiDescArray  		= new Array('Virtual Metro(in Shockwave 3D) - "Earth" themed Station with a local avatar',
								   'Virtual Metro(in Shockwave 3D) - "Air" themed Station',
								   'Virtual Metro(in Shockwave 3D) - "Water" themed Station',
								   'Virtual Metro(in Shockwave 3D) - "Fire" themed Station',
								   'Machinima (video in Second Life) - College students using the metro',
								   'Machinima (video in Second Life) - Customer Service Representative',
								   'Machinima (video in Second Life) - Metro compartment for Women & Children'); 

tataDescArray 			= new Array('The Tata Indicom Auditorium/Events Space ',
									'\'Follow Your Heart\' Talent Hunt Space',
									'\'Follow Your Heart\' Talent Hunt- Art Showcase'); 

mahindraDescArray		= new Array('Training/Product Demo (Machinima) Set',
									'Training/Product Demo (Machinima) Set'); 

cryDescArray 			= new Array('CRY\'s global community meeting space',
									 'CRY\'s virtual product gallery',
									 'CRY\'s virtual office on Second Life',
									 'CRY\'s audio/visual and conference space',
									 'CRY\'s virtual product gallery'); 

delloSportDescArray 	= new Array('The virtual Milan Marathon 2007 in Second Life'); 

trainDescArray 			= new Array('Hospital Cafeteria',
									'Hospital Outdoors/Meeting Space',
									'Hospital Room and Medical Equipment');

alfaLumDescArray 		= new Array('Alfa Lum\'s virtual product gallery in Second Life', 
									'Alfa Lum\'s virtual product gallery in Second Life',
									'Alfa Lum\'s tropical island on Second Life');

rayDescArray 			= new Array('Training Demo (Machinima) Set', 
									'Training Demo (Machinima) Set'); 

bollywoodDescArray 		= new Array('India-themed Bollywood Island and Community on Second Life',
								   'The \'Sharan\' Gate',
								   'The Regal Arches',
								   'The Bollywood Events Space',
								   'Bollywood',
								   'The Bollywood Dance Durbar',
								   'The Bollywood Dance Durbar'); 

comunicattoreDescArray 	= new Array('Comunicattore\'s virtual office on Second Life',
								   'The Conference Room',
								   'Meeting Spaces'); 

elksDescArray 			= new Array('Idaho Elks Rehabilitation Hospital Replica',
									  'The Hospital Entrance',
									  'The Hospital Entrance',
									  'The Hospital Parking Lot'); 

mbsDescArray 			= new Array('Alfa Lum\'s virtual product gallery on Second Life',
								  'Alfa Lum\'s Second Life Island',
								  'La Gazzetta dello Sport\'s Virtual Milan Marathon 2007',
								  'Tata Indicom\'s \'Follow Your Heart\' Talent Hunt in Second Life',
								  'Tata Indicom\'s \'Follow Your Heart\' Talent Hunt in Second Life',
								  'Tata Indicom\'s \'Follow Your Heart\' Talent Hunt in Second Life'); 

mmsDescArray 			= new Array('Bollywood- India themed Community on Second Life',
									'Comunicattore\'s (Milan) virtual office in Second Life',
									'CRY\'s global community meeting space on Second Life'); 

mlsDescArray 			= new Array('Role-Playing',
									'3D Classroom',
									'Tutor-led Experience',
									'Interactive Simulations',
									'Excel-Soft',
									'Excel-Soft',
									'Game Based Learning',
									'Space',
									'Virtual Field Trip (Marine Biology)'
									); 



function showImage(imgName, imgTitle, imgObj, index)
{
	currentImageIndex = index;
	var imagePath = "";

	if(imgName == 'Excelsoft')
	{
		imagePath = projectsImageURI+excelSoftArray[index];
		imgTitle = excelSoftDescArray[index];
	}
	else if(imgName == 'Tata')
	{
		imagePath = projectsImageURI+tataArray[index];
		imgTitle = tataDescArray[index];
	}
	else if(imgName == 'DubaiMetro')
	{
		imagePath = projectsImageURI+dubaiArray[index];
		imgTitle = dubaiDescArray[index];
	}
	else if(imgName == 'Mahindra')
	{
		imagePath = projectsImageURI+mahindraArray[index];
		imgTitle = mahindraDescArray[index];
	}
	else if(imgName == 'CRY')
	{
		imagePath = projectsImageURI+cryArray[index];
		imgTitle = cryDescArray[index]
	}
	else if(imgName == 'LaGazzetta')
	{
		imagePath = projectsImageURI+delloSportArray[index];
		imgTitle = delloSportDescArray[index];
	}
	else if(imgName == 'Train')
	{
		imagePath = projectsImageURI+trainArray[index];
		imgTitle = trainDescArray[index];
	}
	else if(imgName == 'AlfaLum')
	{
		imagePath = projectsImageURI+alfaLumArray[index];
		imgTitle = alfaLumDescArray[index];
	}
	else if(imgName == 'Ray')
	{
		imagePath = projectsImageURI+rayArray[index];
		imgTitle = rayDescArray[index];
	}
	else if(imgName == 'Bollywood')
	{
		imagePath = projectsImageURI+bollywood[index];
		imgTitle = bollywoodDescArray[index];
	}
	else if(imgName == 'Comunicattore')
	{
		imagePath = projectsImageURI+comunicattore[index];
		imgTitle = comunicattoreDescArray[index];
	}
	else if(imgName == 'Elks')
	{
		imagePath = projectsImageURI+elks[index];
		imgTitle = elksDescArray[index];
	}
	else if(imgName == 'MBS')
	{
		imagePath = projectsImageMBSURI+mbs[index];
		imgTitle = mbsDescArray[index];
	}
	else if(imgName == 'MLS')
	{
		imagePath = projectsImageMLSURI+mls[index];
		imgTitle = mlsDescArray[index];
	}
	else if(imgName == 'MMS')
	{
		imagePath = projectsImageMMSURI+mms[index];
		imgTitle = mmsDescArray[index];
	}


//alert('imagePath : '+imagePath);
	var imgArr = document.getElementsByName('imgBar');
	for(var i=0; i<imgArr.length; i++)
	{	
		imgArr[i].src = "Images/ProjectGallerygif_grey.gif";
	}
	imgObj.src = 'Images/ProjectGallerygif_green.gif';
	document.getElementById('projectsImage').src = imagePath;
	document.getElementById('projectsImage').width = 655;
	document.getElementById('projectsImage').height = 287;
	document.getElementById('imgTitle').innerHTML = imgTitle;	// Image Caption
	document.getElementById('projectsImage').title = imgTitle;
}

function showNextImage(imgName, imgTitle, imgObj)
{
	var imagePath = "";//projectsImageURI+imgName;
	//alert('imagePath : '+imagePath);
	var imgArr = document.getElementsByName('imgBar');
	//alert('B4 current ; '+currentImageIndex);
	var index = currentImageIndex+1;
	//alert('Img Length : '+imgArr.length+" -- index : "+index);
	if(index < imgArr.length)
	{
		if(imgName == 'Excelsoft')
		{
			imagePath = projectsImageURI+excelSoftArray[index];
			imgTitle = excelSoftDescArray[index];
		}
		else if(imgName == 'DubaiMetro')
		{
			imagePath = projectsImageURI+dubaiArray[index];
			imgTitle = dubaiDescArray[index];
		}
		else if(imgName == 'Tata')
		{
			imagePath = projectsImageURI+tataArray[index];
			imgTitle = tataDescArray[index];
		}
		else if(imgName == 'Mahindra')
		{
			imagePath = projectsImageURI+mahindraArray[index];
			imgTitle = mahindraDescArray[index];
		}
		else if(imgName == 'CRY')
		{
			imagePath = projectsImageURI+cryArray[index];
			imgTitle = cryDescArray[index]
		}
		else if(imgName == 'LaGazzetta')
		{
			imagePath = projectsImageURI+delloSportArray[index];
			imgTitle = delloSportDescArray[index];
		}
		else if(imgName == 'Train')
		{
			imagePath = projectsImageURI+trainArray[index];
			imgTitle = trainDescArray[index];
		}
		else if(imgName == 'AlfaLum')
		{
			imagePath = projectsImageURI+alfaLumArray[index];
			imgTitle = alfaLumDescArray[index];
		}
		else if(imgName == 'Ray')
		{
			imagePath = projectsImageURI+rayArray[index];
			imgTitle = rayDescArray[index];
		}
		else if(imgName == 'Bollywood')
		{
			imagePath = projectsImageURI+bollywood[index];
			imgTitle = bollywoodDescArray[index];
		}
		else if(imgName == 'Comunicattore')
		{
			imagePath = projectsImageURI+comunicattore[index];
			imgTitle = comunicattoreDescArray[index];
		}
		else if(imgName == 'Elks')
		{
			imagePath = projectsImageURI+elks[index];
			imgTitle = elksDescArray[index];
		}
		else if(imgName == 'MBS')
		{
			imagePath = projectsImageMBSURI+mbs[index];
			imgTitle = mbsDescArray[index];
		}
		else if(imgName == 'MLS')
		{
			imagePath = projectsImageMLSURI+mls[index];
			imgTitle = mlsDescArray[index];
		}
		else if(imgName == 'MMS')
		{
			imagePath = projectsImageMMSURI+mms[index];
			imgTitle = mmsDescArray[index];
		}
	
		for(var i=0; i<imgArr.length; i++)
		{	
			imgArr[i].src = "Images/ProjectGallerygif_grey.gif";
		}
		imgArr[index].src = "Images/ProjectGallerygif_green.gif";
		
		document.getElementById('projectsImage').src = imagePath;
		document.getElementById('projectsImage').width = 655;
		document.getElementById('projectsImage').height = 287;
		document.getElementById('imgTitle').innerHTML = imgTitle;	// Image Caption
		document.getElementById('projectsImage').title = imgTitle;
		currentImageIndex++;
	}
}


function showPrevImage(imgName, imgTitle, imgObj)
{
	
	var imagePath = "";//projectsImageURI+imgName;
	//alert('imagePath : '+imagePath);
	var imgArr = document.getElementsByName('imgBar');
	//alert('B4 current ; '+currentImageIndex);
	var index = currentImageIndex-1;
	
	//alert('current ; '+currentImageIndex+" -- index : "+index);
	
	if(index >= 0)
	{
		if(imgName == 'Excelsoft')
		{
			imagePath = projectsImageURI+excelSoftArray[index];
			imgTitle = excelSoftDescArray[index];
		}
		else if(imgName == 'DubaiMetro')
		{
			imagePath = projectsImageURI+dubaiArray[index];
			imgTitle = dubaiDescArray[index];
		}
		else if(imgName == 'Tata')
		{
			imagePath = projectsImageURI+tataArray[index];
			imgTitle = tataDescArray[index];
		}
		else if(imgName == 'Mahindra')
		{
			imagePath = projectsImageURI+mahindraArray[index];
			imgTitle = mahindraDescArray[index];
		}
		else if(imgName == 'CRY')
		{
			imagePath = projectsImageURI+cryArray[index];
			imgTitle = cryDescArray[index]
		}
		else if(imgName == 'LaGazzetta')
		{
			imagePath = projectsImageURI+delloSportArray[index];
			imgTitle = delloSportDescArray[index];
		}
		else if(imgName == 'Train')
		{
			imagePath = projectsImageURI+trainArray[index];
			imgTitle = trainDescArray[index];
		}
		else if(imgName == 'AlfaLum')
		{
			imagePath = projectsImageURI+alfaLumArray[index];
			imgTitle = alfaLumDescArray[index];
		}
		else if(imgName == 'Ray')
		{
			imagePath = projectsImageURI+rayArray[index];
			imgTitle = rayDescArray[index];
		}
		else if(imgName == 'Bollywood')
		{
			imagePath = projectsImageURI+bollywood[index];
			imgTitle = bollywoodDescArray[index];
		}
		else if(imgName == 'Comunicattore')
		{
			imagePath = projectsImageURI+comunicattore[index];
			imgTitle = comunicattoreDescArray[index];
		}
		else if(imgName == 'Elks')
		{
			imagePath = projectsImageURI+elks[index];
			imgTitle = elksDescArray[index];
		}
		else if(imgName == 'MBS')
		{
			imagePath = projectsImageMBSURI+mbs[index];
			imgTitle = mbsDescArray[index];
		}
		else if(imgName == 'MLS')
		{
			imagePath = projectsImageMLSURI+mls[index];
			imgTitle = mlsDescArray[index];
		}
		else if(imgName == 'MMS')
		{
			imagePath = projectsImageMMSURI+mms[index];
			imgTitle = mmsDescArray[index];
		}

		for(var i=0; i<imgArr.length; i++)
		{	
			imgArr[i].src = "Images/ProjectGallerygif_grey.gif";
		}
		imgArr[index].src = "Images/ProjectGallerygif_green.gif";
		document.getElementById('projectsImage').src = imagePath;
		document.getElementById('projectsImage').width = 655;
		document.getElementById('projectsImage').height = 287;
		document.getElementById('imgTitle').innerHTML = imgTitle;	// Image Caption
		document.getElementById('projectsImage').title = imgTitle;
		currentImageIndex--;
	}
}
