$(document).ready(function(){
                           

//$("#headerImageBanner").find("img:eq(1)").attr("alt");

	var selector = "#headerImageBanner";
    var imgTotal = $(selector).find("img").length;
    var imgWidth = 705;    
    var count = 1;
    
    $(selector).find("img").css("left", "705px");
    $(selector).find("img:eq(0)").css("left", "0");

    function timer() {
    
        playId = setTimeout(function(){
			
			$(selector).find("img:eq("+count+")").css("z-index", (count + 1));
			$(selector).find("img:eq("+count+")").animate({				
				left: "0"    
				}, 500, function() {
					
					if(count == 0){
						$(selector).find("img:last").css("left", "705px");
					}
					
					if (count == (imgTotal - 1)) {
						count = 0;				
						$(selector).find("img:not(:last)").css("left", "705px");
						$(selector).find("img").css("z-index", "auto");        
				
					} else {
						count++; 
					}  
					timer();
				});
			
			}, 1500);
		
	}    
    	
	/* init */
	timer();

                           
})

function clearText(element) {
	if (element.value) {
	element.value = "";
	}
}

