document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('');
var time = 0;
var t;
var timer_is_on = 0;
var prog_bar = $(".prog_bar");
var Time_text = $(".timer");
/* 과정 기본정보 */
var CourseObj =
{
"course_name":"소방설비(산업)기사(기계분야) 자격대비반",
"course_id":"AL0000",
"total_lesson":88,
"total_frame":6,
"frame_info": {
"frame01":["인트로",5],
"frame02":["학습내용 및 목표",10],
"frame03":["동영상 강의 학습",10],
"frame04":["학습 정리",30],
"frame05":["문제풀이",30],
"frame06":["다음시간 안내",10]
}
};
/* PAGE 정보*/
dir=location.href;
dir=dir.split("/");
var PageInfor = dir[dir.length-1];
var LessonNumber = dir[dir.length-2];
PageNumber = Number(PageInfor.split(".html")[0]);
PrevPageNumber = PageNumber - 1;
NextPageNumber = PageNumber + 1;
nLessonNumber = Number(LessonNumber);
/* PAGE Start */
$(document).ready(function(){
startCount();
page_set();
});
/* 공통 기능 관련*/
function timedBar(){
$(".prog_bar").animate({
width: '250px'
},{duration:maxtime*1000});
page_animation();
}
function timedCount() {
if(time0) maxmin = maxhour*60 + maxmin;
if (maxmin.toString().length==1) maxmin = "0" + maxmin;
if (maxsec.toString().length==1) maxsec = "0" + maxsec;
t = setTimeout(function(){ timedCount() }, 1000);
timedBar();
time = time + 1;
var hour = parseInt(time/3600);
var min = parseInt((time%3600)/60);
var sec = time%60;
if (hour.toString().length>0) min = hour*60 + min;
if (min.toString().length==1) min = "0" + min;
if (sec.toString().length==1) sec = "0" + sec;
$('.timer').text(min+':'+sec+' / '+maxmin+':'+maxsec);
}
else{
timer_is_on = 0;
if(PageNumber == 1 || PageNumber == 2 || PageNumber == 5){
$(".nextindicator").slideToggle("slow");
document.getElementById("NextBtn").setAttribute("style", "background-color: #1ac7fa;color: #ffffff;");
}
}
}
function startCount() {
if (!timer_is_on) {
timer_is_on = 1;
timedCount();
}
}
function stopCount() {
clearTimeout(t);
timer_is_on = 0;
}
function lec_wait(){
page_wait();
timer_is_on = 0;
clearTimeout(t);
}
function lec_resume(){
page_resume();
timer_is_on = 1;
t = setTimeout(function(){ timedCount() }, 1000);
}
function pauseBtnClick(event) {
event = event || window.event;
if(event.target.getAttribute("aria-pressed") == "true"){
event.target.setAttribute("aria-pressed", "false");
lec_resume();
}
else{
event.target.setAttribute("aria-pressed", "true");
lec_wait();
}
}
function itostr(inum){
//두자리변환
return inum<10?"0"+inum:inum;
}
function itostrh(inum){
//세자리 변환
if(inum<10){
inum = "00"+inum;
return inum;
}else if(inum<100){
inum = "0"+inum;
return inum;
} else {
return inum;
}
}
function prevBtnClick() {
if ( PrevPageNumber > 0 ){
document.location=itostr(PrevPageNumber)+".html";
}
}
function nextBtnClick() {
if ( NextPageNumber < CourseObj.total_frame+1 ){
document.location=itostr(NextPageNumber)+".html";
}else{
if(nLessonNumber==CourseObj.total_lesson) {
alert("학습을 모두 마치셨습니다. 수고하셨습니다.");
}else{
alert("마지막 페이지입니다.");
}
}
}
function movePage(pName){
document.location=pName+".html";
}
function down_pop(val){
downlink=val;
htmlURL="../down/downPop.htm";
downWin = window.open(htmlURL,"","menubar=no,toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=400,height=178");
}
window.onunload = function(){
//stop_studytime();
}