var bigImageSrc = new Array();
var postLink = new Array();

bigImageSrc[0] = "http://sst.revu.co.kr/files/sb/20101214/198_big.jpg";
postLink[0] = "http://samsungtomorrow.com/704";

bigImageSrc[1] = "http://sst.revu.co.kr/files/sb/20101207/197_big.jpg";
postLink[1] = "http://samsungtomorrow.com/696";

bigImageSrc[2] = "http://sst.revu.co.kr/files/sb/20101202/196_big.jpg";
postLink[2] = "http://www.samsungtomorrow.com/680";


nowImageFocus = -1;
isAutoRolling = "Y";

function setChangeImage(data) {
	var reData = data.split("|");

	var postLink = document.getElementById("postLink");
	var bigImage = document.getElementById("bigImage");
	var nowSmallImage = document.getElementById("simage"+reData[2]);

	bigImage.src = reData[0];
	postLink.href = reData[1];
	nowSmallImage.style.border = 1;
    //isAutoRolling = reData[3];
}

function reSetAuto(focus) {
	//isAutoRolling = "Y";
	//nowImageFocus = focus;
}

var print = "<table width='700' border='0' cellspacing='0' cellpadding='0'>";
print += "<tr><td width='545'>";
print += "<a id='postLink' name='postLink' href='http://samsungtomorrow.com/704'><img name='bigImage' id='bigImage' src='http://sst.revu.co.kr/files/sb/20101214/198_big.jpg' width='545' height='289' border='0'></a></td>";
print += "<td width='155' valign='top' align='right'>";
print += "<table width='100%'  border='0' cellspacing='1' cellpadding='0' bgcolor='#E7E7E7'>";
print += "<tr><td height='95'>";
print += '<img name="simage0" id="simage0" src="http://sst.revu.co.kr/files/sb/20101214/198_small.jpg" width="153" height="95" border="0" OnMouseOver=setChangeImage("http://sst.revu.co.kr/files/sb/20101214/198_big.jpg|http://samsungtomorrow.com/704|0|N");>';
print += "</td></tr><tr><td height='95'>";
print += '<img name="simage1" id="simage1" src="http://sst.revu.co.kr/files/sb/20101207/197_small.jpg" width="153" height="95" border="0" OnMouseOver=setChangeImage("http://sst.revu.co.kr/files/sb/20101207/197_big.jpg|http://samsungtomorrow.com/696|1|N");>';
print += "</td></tr><tr><td height='95'>";
print += '<img name="simage2" id="simage2" src="http://sst.revu.co.kr/files/sb/20101202/196_small.jpg" width="153" height="95" border="0" OnMouseOver=setChangeImage("http://sst.revu.co.kr/files/sb/20101202/196_big.jpg|http://www.samsungtomorrow.com/680|2|N");>';
print += "</td></tr>";
print += "</table>";
print += "<td></tr>";
print += "</table>";

document.write(print);

function autoChage() {
	if(isAutoRolling == "N") return;

	if(nowImageFocus == 2) {
		nowImageFocus = -1;
	}

	for(var i=0; i<bigImageSrc.length; i++) {
		if(i == (nowImageFocus+1)) {
			setChangeImage(bigImageSrc[i]+"|"+postLink[i]+"|"+i+"|Y");
			break;
		}
	}
	nowImageFocus++;
	setTimeout("autoChage()", 3000);

}
autoChage();
