/*function createRequestObject() {
	var obj;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        obj = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        obj = new XMLHttpRequest();
    }
    return obj;
}
var initHTTP = createRequestObject();
var http = createRequestObject();*/
var id = 1;
var totalSlides = 7;
var play = true;
var playInterval = window.setInterval("runShow();",5000);
//var play = window.setInterval("runShow();",5000);


function runShow(){
	if(play == true){
		for(var i= 1; i <= totalSlides; i++)
		{
			document.getElementById("slide" + i).style.display = "none";
		}
		document.getElementById("slide" + id).style.display = "block";
   /* http.open('get', 'dykSlides/slide' + id + '.html');
    http.onreadystatechange = function(){
	  if(http.readyState == 4){
	    var result = http.responseText;
		document.getElementById('dykGallery').innerHTML = result;
	  }
    }
	http.send(null);*/
	
	if(id == totalSlides){
		id = 1;
	}
	else{
		id++;
	}
	}
	if(play == true){
	//setTimeout("runShow();",5000);
	}
}



function nextSlide(){
	
	for(var i= 1; i <= totalSlides; i++)
	{
		document.getElementById("slide" + i).style.display = "none";
	}
	document.getElementById("slide" + id).style.display = "block";
	
	if(id == totalSlides){
		id = 1;
	}
	else{
		id++;
	}
	
	/*document.getElementById('nextBtn').src = "dyk_btn_blank.gif";
	http.open('get', 'dykSlides/slide' + id + '.html');
    http.onreadystatechange = function(){
	  if(http.readyState == 4){
	    var result = http.responseText;
		document.getElementById('dykGallery').innerHTML = result;
	  }
    }
	http.send(null);*/
}

function pauseStopSlideshow(){
	window.clearInterval(playInterval);
	//play = false;
}

function playSlideshow(){
	window.clearInterval(playInterval);
	playInterval = window.setInterval("runShow();",5000);
	//runShow();
}

function startSlideShow(){
	//var myInterval = window.setInterval("runShow();",5000);
}
