// ÃÖ±Ùº»»óÇ° ½ºÅ©¸³Æ® ½ÃÀÛ
var timerID = null;
var np_active;
var np_speed;
var dspcnt;

function ScrollUp(){
	if(parseInt(obj[np_active].style.top) == 0){
		alert('¿À´Ã º» »óÇ° Ã¹»óÇ°ÀÔ´Ï´Ù.');
		return;
	}
	if(document.getElementById){
		if(parseInt(obj[np_active].style.top) < 0){
			obj[np_active].style.top = parseInt(obj[np_active].style.top) + np_speed + "px";
		}
	}
}

function ScrollDown(){
	if(document.getElementById){
		var remain_height = parseInt(obj[np_active].style.height) + (parseInt(obj[np_active].style.top));

		if(remain_height <= (dspcnt * np_speed)){
			alert('¿À´Ã º» »óÇ° ¸¶Áö¸·»óÇ°ÀÔ´Ï´Ù.');
			return;
		}

		if(parseInt(obj[np_active].style.top) > document.getElementById('cont').offsetHeight - obj[np_active].offsetHeight){
			obj[np_active].style.top = parseInt(obj[np_active].style.top) - np_speed + "px";
		}
	}
}

function ScrollStop(){
	if(document.getElementById){
		clearTimeout(timerID);
	}
}

function ScrollPageInit(rowcnt, rowlimit) {
	var tbl_row =  document.getElementById("tbl_row0");
	var inner_width = 0;
	var inner_height = 0;
	var cont_obj;
	var tmp_obj;
	dspcnt = rowlimit;
	np_active = 0;
	if(tbl_row == undefined || rowcnt <= 0)
		return;
	else {
		//inner_width = parseInt(tbl_row.width);
		inner_width = 82;
		for(var i=0; i < rowcnt; i++){
			tmp_obj = document.getElementById("tbl_row" + i);
			tmp_obj.width = inner_width;
		}
		//¸®½ºÆ® Å×ÀÌºí ³ôÀÌ¼³Á¤
		inner_height = parseInt(tbl_row.height);

		if(inner_width <= 0 || inner_height <= 0)
			return;
		np_speed = inner_height;

		cont_obj = document.getElementById("cont");
		cont_obj.style.width = inner_width;
		cont_obj.style.height = (rowcnt > rowlimit ? (inner_height * rowlimit) : (inner_height * rowcnt + 1)) + 'px';
	}
	if(document.getElementById){
	var	obj = document.getElementById("cont").getElementsByTagName("DIV");
		obj['inner_row'].style.visibility = "visible";
		obj['inner_line'].style.visibility = "visible";
		obj['inner_row'].style.height = (inner_height * rowcnt) + 'px';
		obj['inner_row'].style.width = inner_width + 'px';
		obj['inner_row'].style.top = 0;
	}
	if(document.addEventListener){
		for(i=0;i<document.getElementsByTagName('a').length;i++){
			document.getElementsByTagName('a')[i].style.position = "relative";
		}
	}
    return obj;
}
// ÃÖ±Ùº»»óÇ° ³¡




function showtip2(title, price, imageurl){
		var html = '<table border="4" cellpadding="0" cellspacing="5" class="collapse" bordercolor="D8D8D8" rules="none" bgcolor="ffffff">';
		html = html +		'<tr><td><img src="' + imageurl + '" width="176" height="120"></td></tr>';
		html = html + 	'<tr><td style="padding-left:6">' + title + '<br>';
		html = html +			  	'°¡°Ý: <b style="color:D85069">' + price + '¿ø</b></td></tr>';
		html = html +	'</table>';

		window.document.all.contentsview.innerHTML = html;

 		dummymove();

		document.all.contentsview.style.display = 'block';
	}

function hidetip2(){
	if (document.all){
		document.all.contentsview.style.display = 'none';
		//document.onmousemove = null;
		}
	else if (document.layers){
		clearInterval(currentscroll);
		document.contentsview.display = 'none';
		}
	}

function dummymove(){

	if ((document.all.contentsview.style.pixelLeft != window.event.clientX + document.body.scrollLeft) || (document.all.contentsview.style.pixelTop != window.event.clientY + document.body.scrollTop)){
		if(window.screen.width + document.body.scrollLeft <= window.event.clientX + document.body.scrollLeft + 500)
			{

				document.all.contentsview.style.pixelLeft = window.event.clientX + document.body.scrollLeft - 200;
			}
		else
			{
				document.all.contentsview.style.pixelLeft = window.event.clientX + document.body.scrollLeft;
			}

		if(window.screen.height + document.body.scrollTop <= window.event.clientY + document.body.scrollTop + 200)
			{

				document.all.contentsview.style.pixelTop = window.event.clientY + document.body.scrollTop - 313;
			}
		else
			{
				document.all.contentsview.style.pixelTop = window.event.clientY + document.body.scrollTop;
			}
		}

	}

//¾ð·Ð¼ÓÀÇ Ä«Æä24 ¼îÇÎ¸ô
// ÀÌ¹ÌÁö ¹Ù²Ù´Â ½Ã°£ °£°Ý
delay = 2000
// ÇöÀç ÀÌ¹ÌÁö ¹øÈ£
num = 2

// ÀÌ¹ÌÁö ÆÄÀÏÀ» ¹Ì¸® ÀÐ¾î Image °´Ã¼ ¸¸µé±â
my_image = new Array()
for(i = 1; i <= 13; i++) {
		my_image[i] = new Image()
		my_image[i].src = "http://img.cafe24.com/dcafe/images/main/bner_0" + i + ".gif"

}

// ¿¬¼ÓµÈ ÀÌ¹ÌÁö¸¦ º¸¿©ÁÖ´Â ÇÔ¼ö
function animate() {
		// <IMG> ÅÃÀÇ ÀÌ¸§ java_image
		document.java_image.src = my_image[num].src
		num++
		if(num > 13) num = 1
}
