﻿var currslid = 0;
var AllPicNum = 6;
var slidint;
function $(id){return document.getElementById(id);}
function setfoc(id){
	if(id>=AllPicNum){id=0;}
	for(i=0;i<AllPicNum;i++){
		$("AimooPic"+i).style.display = "none";
		$("imagetext"+i).style.display = "none";
		$("swicthImg"+i).className = "disabled2";
	}
	$("AimooPic"+id).style.display = "";
	$("imagetext"+id).style.display = "";
	$("swicthImg"+id).className = "current";
//	try{
//		with (fc) {
//			filters[0].Apply();
//			$("AimooPic"+id).style.display = "";
//			$("imagetext"+id).style.display = "";
//			$("swicthImg"+id).className = "current";
//			filters[0].play();
//		}
//	}
//	catch(e){
//		$("AimooPic"+id).style.display = "";
//		$("imagetext"+id).style.display = "";
//		$("swicthImg"+id).className = "current";
//	}
//	
	currslid = id;

//	$("fc").filters[0].Apply();
//	if ($("fc").style.visibility == "visible") {
//		$("fc").style.visibility = "hidden";
//		//$("fc").filters.revealTrans.transition=23;
//	}
//	else {
//		$("fc").style.visibility = "visible";
//		//$("fc").filters[0].transition=23;
//	}
//	$("fc").filters[0].Play();
	stopit();
}

function playnext(){
	if(currslid>(AllPicNum-1)){
		currslid = 0;
	}
	else{
		currslid++;
	};
	setfoc(currslid);
	if(currslid==0){playit(5000);}else{playit(5000);}
}
function playit(timeValue){
	slidint = setTimeout(playnext,timeValue);
}
function stopit(){
	clearTimeout(slidint);
	}
window.onload = function(){
	playit(5000);
}