﻿
var current=1;
var changeItemTime = 4; //in seconds

function changeItem(ImgCount)
{    
    if(isNaN(ImgCount)) //The method was called without a the ImgCount Parameter
    {    
       ImgCount = 6; //6 is USA default
       //alert("ImgCount = " + ImgCount);
    }
    
    var show
    show = 'div' + current;
    
// hide all
  for (var i = 1; i <= ImgCount; i++) {
    x = 'div' + i;
    if(document.getElementById(x) != null){document.getElementById(x).style.display='none';}
  }// end for

//  show
    if(document.getElementById(show) != null)
    {
        document.getElementById(show).style.display = '';
    }
    

    current++;
    if (current==(ImgCount + 1)) 
        current=1;
		
	//Time of 5000 = 5 sec	
    setTimeout("changeItem(" + ImgCount + ")",changeItemTime * 1000)
}


function HandleEnterKeyPress()
{
	strName = "";
	
	if ( 13 == window.event.keyCode )
	{
		return true;
	}
	else
		return false;
}
