function changeImage(index){
	document.getElementById("categoryMediaSet").style.backgroundImage = "url("+imageArray[index]+")";
	document.getElementById("mediaTitle").innerHTML = imageTitleArray[index];
	document.getElementById("mediaDesc").innerHTML = imageDescArray[index];
}

function getCatItemUrl(){
	window.location = imageLinkArray[index];
}

function getProjectUrl(){
	window.location = imageProjectArray[index];
}

function next(){
	if (index == imageSize-1) {
		index = 0;
	} else {
		index++;
	}
	changeImage(index);
}

function prev(){
	if (index == 0) {
		index = imageSize-1;
	} else {
		index--;
	}
	changeImage(index);
}

function downloadHandler(selectObject) {
	 var selObj=selectObject;
	 var selIndex = selObj.selectedIndex;
	 var url = selObj.options[selIndex].value;
	 if(url.length>0){
		 window.open(url, '_blank');
	}	 
		 selObj.selectedIndex=0;	 
}    
