Javascript/setInterval()

sample1
0
sample1code
var count = 0;
var countup = function(){
  document.getElementById("s1Div").innerHTML = count++;
}
var auto = setInterval(function(){
  countup();
  if(count > 5){
	clearInterval(auto);
  }
},500);
sample2
sample2code
s2Str = "@rise";
s2Figure = 0;
function s2Func(){
  var s2Count = 0;
  document.s2Form.s2Input.value = s2Str.substring(0, s2Figure) + "_";
  if(s2Count == s2Str.length){
  	s2Figure = 0;
  } else {
  	s2Figure = s2Figure + 1;
  }
}
setInterval("s2Func()", 200);
sample3
sample3code
var s3Count = 0;
var img = new Array();
img[0] = new Image();
img[0].src = "../../img/m4.jpg";
img[1] = new Image();
img[1].src = "../../img/m5.jpg";
img[2] = new Image();
img[2].src=  "../../img/jura.jpg";
var sample3Func = function(){
  document.getElementById("s3Img").src=img[s3Count].src;
  s3Count++;
  if(s3Count === 3){
  	s3Count=0;
  }
}
setInterval(function(){
  sample3Func();
}, 1000);  
	
sample4
s4Div
sample4code
$(function(){
  $("#s4Div").css({
  	"border-width": "10px",
  	"border-color": "white",
  	"border-style": "double",
  	"padding": "10px",
  	"display": "inline-block"
  });
});
var tcArray = ["#7cdabf", "#89addd", "#cb897a"];
var bcArray = ["purple", "green", "yellow"];
var s4Count = 0;
function s4Func(){
  var s4Div = document.getElementById("s4Div");
  s4Div.style.color = tcArray[s4Count];
  s4Div.style.borderColor = bcArray[s4Count];
  s4Count++;
  if(s4Count > bcArray.length-1){
  	s4Count = 0;
  }
}
setInterval("s4Func()", 500);
	
sample5

sample5code
function s5Func(){
	var d = new Date();
	var nowYear = d.getFullYear();
	var nowMon = d.getMonth() + 1;
	var nowDay = d.getDate();
	var nowWeek = d.getDay();
	var nowHour = d.getHours();
	var nowMin = d.getMinutes();
	var nowSec = d.getSeconds();
	var week = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	if(nowMin < 10){
		nowMin = nowMin.toString();
		nowMin = "0" + nowMin;
		console.log(nowMin);
	}
	var nowDate = nowYear + "年" + nowMon + "月" + nowDay + "日("+week[nowWeek]+")";
	var nowTime = nowHour + "時" + nowMin + "分" + nowSec + "秒";
	document.getElementById("s5p").textContent = nowDate + nowTime;
}
setInterval("s5Func()",1000);