var modbanner=(function(){
	var tinggi=0;
	var lebar=0;
	var tinggibanner=300;
	var databanner=[];
	var delay=10000;
	var bannerslide=null;
	var posisi=0;
	return{
		load:function(a){
			databanner=a;
			
			lebar=screen.width;
			tinggi=screen.height;
			
			$("#box_script").html(".muncul{opacity: 1;filter: alpha(opacity=100);} .sembunyi{opacity: 0;filter: alpha(opacity=0);}");
			
			
			if(databanner.length>0){
				$("#databanner_"+databanner[posisi]['id']).show();
				document.getElementById("databanner_"+databanner[posisi]['id']).className="databanner muncul";
				if(databanner.length>1){
					modbanner.mulai();
				}
			}
		},
		mulai:function(){
			if(bannerslide!=null) clearInterval(bannerslide);
			bannerslide=setInterval(function(){
				if(posisi>=databanner.length) posisi=0;
				
				$("#databanner_"+databanner[posisi]['id']).show();
				document.getElementById("databanner_"+databanner[posisi]['id']).className="databanner sembunyi";
					
				posisi++;
				if(databanner.length>1){
					if(posisi>=databanner.length) posisi=0;
					$("#databanner_"+databanner[posisi]['id']).show();
					document.getElementById("databanner_"+databanner[posisi]['id']).className="databanner muncul";
				}
			},delay);
		},
		
	};
})();
