/*¸Þ´º*/
function top_menu(n)
{
	for (var i=1; i<=9; i++)
	{
		document.getElementById("TM"+i).src = '../../Content/img/menu/menuOff'+i+'.gif';
		document.getElementById("SM"+i).className = 'SM HL';
	}
	var img = document.getElementById('TM'+n);
	var obj = document.getElementById('SM'+n);
	img.src = '../../Content/img/menu/menuOn' + n + '.gif';
	obj.className = 'SM VL';
}


function top_menu_sub(n) {
    for (var i = 1; i <= 21; i++) {
   //     alert(document.getElementById("TMsub" + i));
           if (document.getElementById("TMsub" + i) != null) {
               document.getElementById("TMsub" + i).src = '../../Content/img/menu/smOff' + i + '.gif';
           }
       }

       var img = document.getElementById('TMsub' + n);
        img.src = '../../Content/img/menu/smOn' + n + '.gif';
    
}




/* ÀÌ¹ÌÁö ½½¶óÀÌµå */
var CURRENT_DIV = 0;

function photo_next(tg, id, tot) {
    //    var obj = 'photo_num';
    //alert(tot);
    
    if (tot % 3 == 0) {
        tot = (tot / 3);
    } else {
        tot = (tot / 3) + 1;
    }
    var obj = id;
    var cnt = parseInt(tot);
    //alert(cnt);
    NextPrePhotoView(tg, obj, cnt);
	return;
}

var setRoll = 0;
function setPhotoRolling (tg, id, tot) {
	var tg, obj, cnt, timeLimit;

	if (tot % 3 == 0) {
	    cnt = (tot / 3);
	} else {
	    cnt = (tot / 3) + 1;
	}

	tg = 1;
	//obj = 'photo_num';
	obj = id;

	cnt = parseInt(cnt);
	timeLimit = 3500;
	
	if (setRoll == 0) {
		setRoll = 1;
		setTimeout("setPhotoRolling( " + tg + ",'" + obj + "'," + tot + "," + timeLimit + ")", timeLimit);
		return
    }

    NextPrePhotoView(tg, obj, cnt);

    setTimeout("setPhotoRolling( " + tg + ",'" + obj + "'," + tot + "," + timeLimit + ")", timeLimit);
}

function NextPrePhotoView(tg, obj, cnt) {
	var i,n,c;
	n = cnt;
	
	if(tg == 1) { CURRENT_DIV += 1; } else { CURRENT_DIV = CURRENT_DIV + (n - 1); }
	CURRENT_DIV %= n;
	
	for (i = 0; i < n; i++) {
	    c = document.getElementById(obj + i);
	    if (c != null) { if (i == CURRENT_DIV) { c.style.display = ''; } else { c.style.display = 'none'; } }
	}
}



