// JavaScript Document


	var whichpic = 1; 
	var totalpix = 0;  
	var i = 0; 

	var picname; 
	var picinfo;
	var jspix = new Array();
	var jsinfo = new Array();
	var CopiedTxt; 
	var prevnex;
	var prevnext;

	
function colchange() { 
		var elem = document.getElementById(prevnext);
		elem.style.color="#999999";
	} 
function colchangeback() { 
		var elem = document.getElementById(prevnext);
		elem.style.color="#363636";
	} 

 function theHotlink() {
	 		
 			document.getElementById('hoturl').textContent = "http://darioayalaphoto.com/hotlink.php?loc=" + picdir + "&pic=" +  encodeURI(jspix[whichpic]);
 }
 
 
function nextpix() {
					// if the next picture is not the last picture then load the next one in the array.
					if (whichpic <= totalpix) {
						document.getElementById('image').src = picdir + (jspix[whichpic]);
						document.getElementById('image').alt = (jsinfo[whichpic]);
						document.getElementById('infoz').innerHTML = (jsinfo[whichpic]);	
						theHotlink()
						
						
					}
					
					// otherwise go back to the first picture
					else {
						whichpic = 1; 
						document.getElementById('image').src = picdir + (jspix[whichpic]);
						document.getElementById('image').alt = (jsinfo[whichpic]);
						document.getElementById('infoz').innerHTML = (jsinfo[whichpic]);
						theHotlink()
					}
					
					
					
}

function previouspix () {
					if (whichpic < 1) {
						whichpic = totalpix
						document.getElementById('image').src = picdir + (jspix[whichpic]);
						document.getElementById('image').alt = (jsinfo[whichpic]);
						document.getElementById('infoz').innerHTML = (jsinfo[whichpic]);
						theHotlink()
					}
					
					else {
						
						document.getElementById('image').src = picdir + (jspix[whichpic]);
						document.getElementById('image').alt = (jsinfo[whichpic]);
						document.getElementById('infoz').innerHTML = (jsinfo[whichpic]);
						theHotlink()
					}

}

