
function scaleImage(image){
	
	if(image.width>image.height){
	
		image.style.width="100px";
	
	}
	else{

		image.style.height="100px";

	}
}

function changeYear(amount){

	var table=document.getElementById("yearSelect");
	if(table){

		// Get the current start position if visible cells
		var cells=table.rows[0].cells;
		var start=-1;
		for(var i=1;i<(cells.length-1);i++){
		
			if(cells[i].style.display!="none"){
			
				start=i;					
				break;
				
			}
		}
		
		// Adjust by adding the amount
		start+=amount;
		
		// Test if we can move
		if(start>0&&start<(cells.length-3)){
		
			// Loop through the cells setting visibility
			for(var i=1;i<(cells.length-1);i++){
		
				// Test if cell is in the visible range
				if(i>=start&&i<(start+3)){
		
					cells[i].style.display="";
		
				}
				else{
				
					cells[i].style.display="none";
				
				}
			}
		}
	}
}