// JavaScript Document

function getmyIMG(locat) {
	get_this = Pic[locat] + ".jpg";	
	document.getElementById('main_imag').src = get_this;		
	document.getElementById('caped').innerHTML = caps[locat];
	return false;
}

function loadImag(loc){
	for (var i=0;i<=(num_imag-1);i++){
		Pic[i] = loc + (i+1);		
	}//end for
}

function loadEmptyCaps(){
	for (var ii=0;ii<=num_imag-1;ii++){
		caps[ii] = "";		
	}//end for
}

function loadThumbs(numb){
	for (var x=0;x<=numb-1;x++){
		document.write('<a href="" '+'onClick="javascript:getmyIMG(' + x + ');return false;"'+'/>' + '<img src="' + Pic[x] + '_sm.jpg' + '"' + ' border="0" height="40"/>' + '</a> ');	
	}//end for
}

function nextImag(){
	source = document.getElementById('main_imag').src;
	current_imag = parseInt(source.substring(imag_location.length, source.length-4));

	if (current_imag < num_imag){
		getmyIMG(current_imag);
	} else {
		getmyIMG(0);
	}//end if		
}

function prevImag(){
	source = document.getElementById('main_imag').src;
	current_imag = parseInt(source.substring(imag_location.length, source.length-4));
	if ((current_imag-1) > 0){
		getmyIMG(current_imag-2);
	} else {
		getmyIMG(num_imag-1);
	}//end if		
}
