// JavaScript Document
// precaution - only even number of images required
var gallery_images=new Array()
gallery_images[0]=["images/slideshowimages/1.jpg", "http://www.mind-spark.org"]
gallery_images[1]=["images/slideshowimages/2.jpg", "http://www.mind-spark.org/whysoserious.php"]
gallery_images[2]=["images/slideshowimages/3.jpg", "http://www.mind-spark.org/premierutkarsh.php"]
gallery_images[3]=["images/slideshowimages/4.png", "http://www.mind-spark.org/greenbuilding.php"]
gallery_images[4]=["images/slideshowimages/5.jpg", "http://www.mind-spark.org/wheelomation.php"]
gallery_images[5]=["images/slideshowimages/6.jpg", "http://www.mind-spark.org/pradyut.php"]
gallery_images[6]=["images/slideshowimages/7.jpg", "http://www.mind-spark.org/yantrashar.php"]
gallery_images[7]=["images/slideshowimages/8.jpg", "http://www.mind-spark.org/nirmaan.php"]
gallery_images[8]=["images/slideshowimages/9.jpg", "http://www.mind-spark.org/tatva.php"]
gallery_images[9]=["images/slideshowimages/10.jpg", "http://www.mind-spark.org/pratikruti.php"]
gallery_images[10]=["images/slideshowimages/11.jpg", "http://www.mind-spark.org/tantraansha.php"]
gallery_images[11]=["images/slideshowimages/12.jpg", "http://www.mind-spark.org/thewrightturn.php"]
gallery_images[12]=["images/slideshowimages/13.jpg", "http://www.mind-spark.org/codeville.php"]
var next = 0;
var arrindex = 2;
function slide(){
	$("#slideshow"+(next%2)).fadeTo(2500,0);
	$("#slideshow"+((next+1)%2)).fadeTo(2500,1);
	setTimeout(function(){
		document.getElementById("slideshow"+(next%2)).src = gallery_images[arrindex][0];
		document.getElementById('gallerylink0').href = gallery_images[arrindex][1];
		document.getElementById('gallerylink1').href = gallery_images[arrindex][1];
		next = next + 1;
		arrindex = arrindex + 1;
		if(arrindex>11){
			arrindex = 0;
		}
		slide();
	},5000);
}
$(document).ready(function(){
	document.getElementById('gallerylink0').href = gallery_images[0][1];
	document.getElementById('gallerylink1').href = gallery_images[0][1];
	setTimeout(function(){
		document.getElementById('gallerylink0').href = gallery_images[1][1];
		document.getElementById('gallerylink1').href = gallery_images[1][1];
		slide();
	},2500);
});

