/* 
This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jay M. Rumsey, OD | http://www.nova.edu/~rumsey */

var num=0;

imgArray = [ 
  ['./images/main/product_img_1.jpg','1','Print your photos and charge your iPad or any other Android tablets via USB'],
  ['./images/main/product_img_2.jpg','2','Prinics¡¯s World Patented All-in-One Cartridge. Paper and Ribbon are built in one unit!'],
  ['./images/main/product_img_3.jpg','3','Now, you can carry this little printer and print photos everywhere with Bolle Photo Travel Kit!'],
  ['./images/main/product_img_4.jpg','4','Capture, Edit and Create your photo with Bolle Photo Free Application.!'],
  ['./images/main/product_img_5.jpg','5','8¡± Photo Frame Printer']
]

function slideshow(slide_num) {
  document.getElementById('mypic').src=imgArray[slide_num][0];
  document.getElementById('mypic').alt=imgArray[slide_num][1];
  document.getElementById('burns').innerHTML=imgArray[slide_num][2];
  
}

function slideshowUp() {
  num++;
  num = num % imgArray.length;
  slideshow(num);
}

function slideshowBack() {
  num--;
  if (num < 0) {num=imgArray.length-1;}
  num = num % imgArray.length;
  slideshow(num);
}

function slideshowGo(num) {
  slideshow(num);
}




var sel1=4000;
var slide=true;
var cnt=0;
var currentImage=1;
var timeout=0;
var pic1= new Array();
var pic=new Array();
var p_title=new Array();

// ÀÌ¹ÌÁö ½½¶óÀÌµå´Â 1¹ø([1])ÀÌ ·Îµù½Ã ¿­¸®´Â ÆÄÀÏÀÌ¶ó 2([2])¹øºÎÅÍ ½ÃÀÛµÇ¸ç 0([0])¹øÀº ¹«½ÃµÇ´Â°Å °°¾Æ¼­ ¾ø¿¥

// Ãß°¡¹æ¹ý - X : ÀÌ¹ÌÁöÀÇ ¹øÈ£·Î 1¹øºÎÅÍ +1¾¿ Ãß°¡ÇÏ¸é µÊ
// pic1[X] = "ÀÌ¹ÌÁö °æ·Î";
// p_title[X] = "ÀÌ¹ÌÁö ¼³¸íºÎºÐ - htmlÅÂ±× µÊ";

// ÀÌ¹ÌÁö ½½¶óÀÌµå °æ·ÎºÎºÐ
	pic1[1] = "./images/main/right_visual_001.jpg";
	p_title[1] = "";
	pic1[2] = "./images/main/right_visual_002.jpg";
	p_title[2] = "";
	pic1[3] = "./images/main/right_visual_003.jpg";
	p_title[3] = "";
	pic1[4] = "./images/main/right_visual_004.jpg";
	p_title[4] = "";
	pic1[5] = "./images/main/right_visual_005.jpg";
	p_title[5] = "";
	pic1[6] = "./images/main/right_visual_006.jpg";
	p_title[6] = "";
	pic1[7] = "./images/main/right_visual_007.jpg";
	p_title[7] = "";
				
pic[1]=new Image();
pic[1].src=pic1[1];
isNext = false;

function p_speed() {
	sel=speedid.selectedIndex;
	sel1=speedid.options[sel].value;
}

function go() {
	if (!slide) {
		nextImage1();
	}
}

function loadImage(imgNum) {
	slideshowUp()
	if (imgNum >= 0) {
		title1.innerHTML=p_title[currentImage];
	}

	if (slide && !isNext) {
		imgsrc.filters.blendTrans.apply();
		document.imgsrc.src= pic[imgNum].src;
		imgsrc.filters.blendTrans.duration=0.5;
		imgsrc.filters.blendTrans.play();
    	nextImage1();
	} else {
		document.imgsrc.src= pic[imgNum].src;
		isNext = false;
	}
}

function nextImage() {
	if (currentImage < pic.length-1) {
		currentImage++;
	} else {
		currentImage=1;
	}
    isNext = true;
    loadImage(currentImage);
}

function nextImage1() {
	if (currentImage < pic1.length-1) {
		currentImage++;
	} else {
		currentImage = 1;
	}
    slide = true;
    timeout = setTimeout("loadImage(currentImage)",sel1);
}

function preload() {
	for (i = 2; i < pic1.length; i++) {
		pic[i]=new Image();
		pic[i].src=pic1[i];
	}
}

function prevImage() {
	if (currentImage <= pic1.length-1) {
		currentImage--;
		if(currentImage < 1) {
		 	currentImage=currentImage+pic1.length;
	     	currentImage--;
	   	}
	}
    isNext = true;
    loadImage(currentImage)
}

function still() {
	clearTimeout(timeout);
	slide=false;
}
