/* 상단 메뉴에서 하위 메뉴 show / hide */
var showElement = function(id) {
	$('#'+id).show();
};
var hideElement = function(id) {
	$('#'+id).hide();
};

/* 마우스 롤오버 스크립트 by Ray */

var mm_over = function(id){
 var img = id.src.split('.gif');
 id.src = img[0] + '_on.gif';
}
var mm_out = function(id){
 var img = id.src.split('_on.gif');
 id.src = img[0] + '.gif';
}



/* 로그인 창에서 배경으로 삽입한 텍스트 이미지 처리 */
var hideInputBg = function(obj) {
	obj.style.background = 'none';
};
var restoreInputBg = function(obj) {
	if(!obj.value) obj.style.background = '';
};

/* 자동로그인 여부를 묻는다 */
var checkAutoLogin = function(obj) {
    /*
    if(obj.checked == true)
    return confirm('자동로그인을 선택하셨습니다.\n공공장소 등에서는 개인정보가 유출될 수 있으므로 주의하시기 바랍니다.\n계속하시겠습니까?');
    else return true;
    */
    return true;
};


/* 새 실통(한 줄에 네 개 나오는 것) 움직임 구현 */
var initSealBoxMove = function(list, left, right) {
	eval('var left_func = function() { moveSealBoxLeft(\'' + list + '\'); return false; };');
	eval('var right_func = function() { moveSealBoxRight(\'' + list + '\'); return false; };');

	document.getElementById(left).onclick = left_func;
	document.getElementById(right).onclick = right_func;
};

var moveSealBoxLeft = function(id) {
	var left = parseInt($('#'+id).css('left')), width = $('#'+id).width();
	if(!left) left = 0;

	left += 480;
	if(left > 0) left = Math.floor(width / 480) * -480;

	newSealMoveTab(id, left);
};
var moveSealBoxRight = function(id) {
	var left = parseInt($('#'+id).css('left')), width = $('#'+id).width() * -1;
	if(!left) left = 0;

	left -= 480;
	if(left < width) left = 0;

	newSealMoveTab(id, left);
};
var newSealMoveTab = function(id, left) {
	$('#'+id).animate({left: left});
};







