// JavaScript Document
var tmp;
function autoHighlight(anim, DivCount) {
    ////alert(anim + ',' + DivCount);
   
	    showImg(anim, DivCount);
	   // alert(document.getElementById("anim").value, DivCount);
					if(document.getElementById("anim").value == ''){
						document.getElementById("anim").value = anim;
						if (anim < parseInt(DivCount)) {
							anim = anim + 1;
						}
						else{
							anim = 1;	
						}
					}
					else{
						document.getElementById("anim").value = anim;
						if (anim < parseInt(DivCount)) {
							anim = anim + 1;
						}
						else{
							anim = 1;	
						}
		}
		tmp = "autoHighlight(" + anim + "," + DivCount + ")";//alert(tmp);
					mytime = setTimeout(tmp,7000);
				}
				function showNext(DivCount) {
					clearTimeout(mytime);

					if (parseInt(document.getElementById("anim").value) < parseInt(DivCount) || document.getElementById("anim").value == "") {
						var next_div_id = parseInt(document.getElementById("anim").value) + 1;
					}
					else{
						var next_div_id = 1;	
					}
					showImg(next_div_id, DivCount);

					document.getElementById("anim").value = next_div_id;

					tmp = "autoHighlight(" + next_div_id + "," + DivCount + ")";// alert(tmp);
					
					mytime = setTimeout(tmp,7000);
				}

				function showPrev(DivCount) {
					clearTimeout(mytime);
					if(parseInt(document.getElementById("anim").value) == 1){
					    prev_div_id = parseInt(DivCount);
					}
					else{
						prev_div_id = parseInt(document.getElementById("anim").value) - 1;
					}
					showImg(prev_div_id, DivCount);
					document.getElementById("anim").value = prev_div_id ;

					tmp = "autoHighlight(" + prev_div_id + "," + DivCount + ")"; //alert(tmp);
					
					mytime = setTimeout(tmp,7000);
				}
				function showImg1(ID, DivCount) {
					clearTimeout(mytime);
					showImg(ID, DivCount);
					document.getElementById("anim").value = ID;

					tmp = "autoHighlight(" + ID + "," + DivCount + ")"; //alert(tmp);
					
					mytime = setTimeout(tmp,7000);
				}
				function showImg(ID, DivCount) {//alert(DivCount);
				    var header = new Array();
				   
				    var divId;
				    var anchrId;
				    for (var j = 1; j <=parseInt(DivCount); j++) {

				        divId = "div" + j ;//alert(divId);
				    
				        header[j] = document.getElementById(divId).innerHTML;
				        //alert(header[j]);

				    }

				    document.getElementById('holder').innerHTML = header[ID];



				    for (var j = 1; j <= parseInt(DivCount); j++) {

				        anchrId = "a" + j;//alert(anchrId);
				        document.getElementById(anchrId).className = "";

				    }
				    document.getElementById('a' + ID).className = "active";


				}

