
//메인페이지 로그인 체크
function form_check()
{
	var login_id = jQuery("#login_id");
	var login_pwd = jQuery("#login_pwd");

	if(!login_id) return false;
	if(!login_pwd) return false;

	if(!login_id.val()) {alert('아이디를 입력해 주시기 바랍니다.');login_id.focus();return false;}
	if(!login_pwd.val()) {alert('비밀번호를 입력해 주시기 바랍니다.');login_pwd.focus();return false;}

	return true;
}

//메인페이지 아이디 저장기능
function func_idsave()
{
	var chk = jQuery("#id_save").attr("checked");

	if(chk){

		var con = confirm("학교나 도서관 같은 공공장소에서는 개인정보 보호를 위해 \n\n아이디 저장기능 사용을 권장하지 않습니다.\n\n일주일간 아이디를 저장하시겠습니까?");
		var login_id = jQuery("#login_id").val();

		if(login_id)
		{
			if(con && chk)
			{
				setCookie( "save_id", login_id, 7);
				return true;
			}else{
				setCookie( "save_id", login_id, 0);
				return false;
			}
		}else {
			alert("아이디를 입력 후 이용해 주시기 바랍니다.");
			return false;
		}
	}else {
		var login_id = "";
		setCookie( "save_id", login_id, 0);
	}
}


//이미지오버
function imgOperation(){
	jQuery("a[rel*=ov]").hover(imgOv,imgOut);
}
function imgOv(){
	var old_img = jQuery(this).find(">img")[0].src;
	old_img = old_img.replace("_out","_ov");
	jQuery(this).find(">img")[0].src = old_img;
}
function imgOut(){
	var old_img = jQuery(this).find(">img")[0].src;
	old_img = old_img.replace("_ov","_out");
	jQuery(this).find(">img")[0].src = old_img;
}


//전체 감싸는 검은 레이어 처리
function Site(){
	this.setBG();
	this.setContainer();
}

Site.prototype.setBG = function(){
	this.body = jQuery("body");
	this.bg_layer = jQuery("<div id='bg_layer'></div>");

	this.bg_layer.css({"position":"fixed","bottom":"0px","left":"0","width":"100%","height":"200%","background":"#000000","display":"none"});

	this.body.append(this.bg_layer);
}

Site.prototype.setContainer = function(){
	this.container = jQuery("<div id='container'></div>");
}

Site.prototype.showBG = function(t){
	if(!t) t = 0.5;
	this.bg_layer.fadeTo("fast", t);
}

Site.prototype.hideBG = function(t){
	this.bg_layer.fadeOut();
}

function prepare(){
	alert('준비중입니다.');
	return false;
}

