function getObj(objName) { 
	return document.getElementById(objName);
}

function timeOut(method,time) {
	setTimeout(method,time) 
}

function movie_change(id, which, total) {
	next = (id+1);
	if(next>total){
		next = 1;
	}
	for(i = 1; i <= total; i++){
		if(i == next){
			getObj('tab'+which+i).style.visibility = 'visible';
			id = i;
		} else {
			getObj('tab'+which+i).style.visibility = 'hidden';
		}
	}
	timeOut('movie_change('+id+', '+which+', '+total+')',5000);
}

function banner_square_change(id, which, total) {
	next = (id+1);
	if(next>total){
		next = 1;
	}
	for(i = 1; i <= total; i++){
		if(i == next){
			getObj('banner_square'+which+i).style.visibility = 'visible';
			id = i;
		} else {
			getObj('banner_square'+which+i).style.visibility = 'hidden';
		}
	}
	timeOut('banner_square_change('+id+', '+which+', '+total+')',8000);
}

function banner_sub_change(id, which, total) {
	next = (id+1);
	if(next>total){
		next = 1;
	}
	for(i = 1; i <= total; i++){
		if(i == next){
			getObj('banner_sub'+which+i).style.visibility = 'visible';
			id = i;
		} else {
			getObj('banner_sub'+which+i).style.visibility = 'hidden';
		}
	}
	timeOut('banner_sub_change('+id+', '+which+', '+total+')',8000);
}
