// JavaScript Document
var totalPics = 23 //images in "index.img/" folder
var currentPic = 1
var teaserData=new Array(
			"<a href=\"photography/abstract.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/abstract.jpg\" alt=\"Abstract photographs\" /></a><br />",
			"<a href=\"photography/animals.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/animals.jpg\" alt=\"Photographs of animals\" /></a><br />",
			"<a href=\"photography/architecture.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/architecture.jpg\" alt=\"Photographs of architecture\" /></a><br />",
			"<a href=\"photography/cars.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/cars.jpg\" alt=\"Photographs of cars\" /></a><br />",
			"<a href=\"photography/flora.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/flora.jpg\" alt=\"Photographs of flora\" /></a><br />",
			"<a href=\"photography/hdr.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/hdr.jpg\" alt=\"High definition range photographs\" /></a><br />",
			"<a href=\"photography/insects.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/insects.jpg\" alt=\"Photographs of insects\" /></a><br />",
			"<a href=\"photography/landscapes.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/landscapes.jpg\" alt=\"Photographs of landscapes\" /></a><br />",
			"<a href=\"photography/outdoors.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/outdoors.jpg\" alt=\"Outdoors photography\" /></a><br />",
			"<a href=\"photography/panoramas.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/panoramas.jpg\" alt=\"Panoramic photographs\" /></a><br />",
			"<a href=\"photography/portraits.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/portraits.jpg\" alt=\"Portrait photographs\" /></a><br />",
			"<a href=\"photography/still.life.php\"><img hspace=\"0\" vspace=\"5\" src=\"photography/thumbs/still.life.jpg\" alt=\"Still life photographs\" /></a><br />")
function start(){
	currentPic = randomize(totalPics)
	document.getElementById('pic').style.backgroundImage = "url(index.img/" + (currentPic) + ".jpg)"
	}
function nextPic () {
	/*if (currentPic >= totalPics) {
		document.getElementById('pic').style.backgroundImage = "url(index.img/0.jpg)"
		currentPic = 0
	  }else {
		document.getElementById('pic').style.backgroundImage = "url(index.img/" + (currentPic+1) + ".jpg)"
		currentPic = currentPic + 1
	  }*/
	  currentPic = randomize(totalPics)
	  document.getElementById('pic').style.backgroundImage = "url(index.img/" + (currentPic) + ".jpg)"
	}
function randomize(amount) {
	return (Math.round((Math.random()*amount)))
	}
function showTeaser(targetId) {
	document.getElementById(targetId).innerHTML = teaserData[randomize(teaserData.length-1)]
	}
