var cP = 0;
var aP = new Array();
var w = new Image();
w.src = '/gui_resources/images/1x1.gif';

function rotateMainPhoto(d){
	switch(d){
		case '>':{
			cP++;
			if(cP == aP.length){cP = 0;}
		} break;
		case '<':{
			cP--;
			if(cP < 0){cP = aP.length-1;}
		} break;
	}
	var img = document.getElementById('main_photo_img');
	img.src = w.src;
	img.width = aP[cP][2];
	img.height = aP[cP][3];
	timerID = self.setTimeout("swapMainPhoto()", 50);
}

function swapMainPhoto(){
	document.getElementById('main_photo_img').src = aP[cP][1];
	document.getElementById('main_photo_txt').innerHTML = aP[cP][4];
	clearTimeout(timerID);
}

function zoomMainPhoto(){
	var winURL = '/content/2/module/photos/photo_id/' + aP[cP][0] + '/format/html/';
	window.open(winURL, 'main_photo', 'status=0,toolbar=0,menubar=0,scrollbars=auto,resizable=1,width=640,height=500');
}
