try { document.execCommand('BackgroundImageCache', false, true); }
catch(e) { }

jQuery(function($) {
	//우측 오늘 본 상품
	followTodaysGoods();
	
	/////// 메인용 시작
	$("#naviTop li a.main").each(function(i) {
		$(this).hover(
			function() {
				switch (i) {
					case 0 : $("#naviTop").css("background-position", "0 -24px"); break;
					case 1 : $("#naviTop").css("background-position", "0 -48px"); break;
					case 2 : $("#naviTop").css("background-position", "0 -72px"); break;
					case 3 : $("#naviTop").css("background-position", "0 -96px"); break;
					case 4 : $("#naviTop").css("background-position", "0 -120px"); break;
					case 5 : $("#naviTop").css("background-position", "0 -144px"); break;
					case 6 : $("#naviTop").css("background-position", "0 -168px"); break;
					case 7 : $("#naviTop").css("background-position", "0 -192px"); break;
					default : $("#naviTop").css("background-position", "0 0");
				}
				$("#naviTop li ul").hide();
				$(this).next().show();
			},
			function() {
				$(this).next().show();
			}
		);

		$(this).focus(
			function() {
				switch (i) {
					case 0 : $("#naviTop").css("background-position", "0 -24px"); break;
					case 1 : $("#naviTop").css("background-position", "0 -48px"); break;
					case 2 : $("#naviTop").css("background-position", "0 -72px"); break;
					case 3 : $("#naviTop").css("background-position", "0 -96px"); break;
					case 4 : $("#naviTop").css("background-position", "0 -120px"); break;
					case 5 : $("#naviTop").css("background-position", "0 -144px"); break;
					case 6 : $("#naviTop").css("background-position", "0 -168px"); break;
					case 7 : $("#naviTop").css("background-position", "0 -192px"); break;
					default : $("#naviTop").css("background-position", "0 0");
				}
				$("#naviTop li ul").hide();
				$(this).next().show();
			}
		);
	});

	var ta = $("#themeBookTitle span").length;
	for(var i=1; i<ta; i++) {
		$("#themeBookTitle span:eq("+i+")").css("display", "none");
	}
	var rta = $("#rThemeBookPromotion table a").length;
	for(var i=1; i<rta; i++) {
		$("#rThemeBookPromotion table a:eq("+i+")").css("display", "none");
	}

	adMove();
	newbook = window.setTimeout("newBookAuto()", 5000);
	naviAd();
	
	/////// 메인용 끝


	//좌측 오버메뉴(until 2depth)
	if ($("#leftHoverMenu li").length) {
		$("#leftHoverMenu li").hover(function() { 
			$(this).css("background-color", "#ebf5fa")
			.find("> ul").show().end()
			.find("> a").addClass("current");
		}, function() {
			$(this).css("background-color", "transparent")
			.find("> ul").hide().end()
			.find("> a").removeClass("current");
		});
	}

	//이미지 마우스 오버시 보더 설정
	if ($("img.thumb").length) {
		$("img.thumb").hover(function() { $(this).addClass("over"); }, function() { $(this).removeClass("over"); });
	}

	//주문갯수 증감버튼 및 입력란
	if ($("a.plus, a.minus").length) {
		$("a.plus").click(function() { 
			
			//-----------------------------성수기(3월,9월)에는 특정 조서가(대학교재)는 3권 이상 주문이 불가능함-----------------------------//
			
			var p_bookcd	=  this.getAttribute("book_cd");
			var p_pubcd	=  this.getAttribute("pub_cd");
			var p_catecd	=  this.getAttribute("cate_cd");

			if (PeriodEmbargo(p_bookcd, p_pubcd, p_catecd)){
				if (Number($(this).parent().find("input").val()) > 2) { alert("이 도서는 3권이상 주문을 할 수 없습니다."); $(this).parent().find("input").val(3); return false; }
			}
				
		
			
			//---------------------------------------------------------------------------------------------------------------------------//

			
			$(this).parent().find("input").val(Number($(this).parent().find("input").val()) + 1); return false; 
		});

		$("a.minus").click(function() { if (Number($(this).parent().find("input").val()) > 1 ) { $(this).parent().find("input").val(Number($(this).parent().find("input").val()) - 1); } return false; });
	}
	if ($("input.numBox").length) {
		$("input.numBox").keyup(function() { 

			//-----------------------------성수기(3월,9월)에는 특정 조서가(대학교재)는 3권 이상 주문이 불가능함-----------------------------//

			//if ($(this).val() > 3) { alert("이 도서는 3권이상 주문을 할 수 없습니다."); $(this).val(3); }

			//---------------------------------------------------------------------------------------------------------------------------//


			if (isNaN($(this).val())) { alert("숫자를 입력해 주세요."); $(this).val(1); }
			if ($(this).val() < 1) { alert("1이상의 숫자를 입력해 주세요."); $(this).val(1); }
		});
	}

	//전체분야보기 토글
	$("#btnAllCategory").toggle(function() { $("#depth3Category .depth3Category").show(); }, function() { $("#depth3Category .depth3Category").hide(); });

	//간략보기 토글
	$("#searchResultList tr td.sample img, #DateSearchResultList td.sample img").toggle(function() { $(this).parent().find("div").show(); }, function() { $(this).parent().find("div").hide(); });

	//예상수령일 토글
	$("img.btnGuide").click(function() {
		$("img.dueDateGuide").remove();
		$(this).parent().append('<img src="/ypbooks/images/dueDateGuide.gif" width="283" height="348" alt="예상 수령일 안내" style="position:absolute; margin:24px 0 0 -64px; z-index:9999;" class="dueDateGuide" />');
		$("img.dueDateGuide").click(function() { $(this).remove(); });
	});

	//이분야의 테마 높이 조절
	if ($("#themeOfThis").length) {
		$("#themeOfThis").css("height", 45+22 * $("#themeOfThis li").length +"px");
	}

	//검색결과 베스트 중앙정렬
	if ($("#searchBest").length) {
		$("#searchBest").css("width", 187 * $("#searchBest li").length + "px");
	}

	//분야별 검색결과 6개이상 토글
	if($("#fieldList li").length > 6) {
		for(var i=6; i < $("#fieldList li").length; i++) {
			$("#fieldList li:eq("+i+")").hide();
		}
	}



	//통합검색 셀렉트 박스
	$("#searchA").click( function() {
		if( $("#allSearchList").css("display") != 'none') {
			$("#allSearchList").css("display", "none");
			$("#searchA").css("background", "url(../images/allSearch_navi.gif) no-repeat");
		}else {
			$("#allSearchList").css("display", "block");
			$("#searchA").css("background", "url(../images/allSearch_navi_up.gif) no-repeat");
		}
		return false;
	});

	$("#searchInput #btn").click( function() {
		if( $("#lookAhead").css("display") != "none" ) {
			$("#lookAhead").css("display", 'none');
			$("#searchInput").css("background", "url(/ypbooks/images/searchInput_navi.gif) no-repeat");
		}else {
			$("#lookAhead").css("display", 'block');
			$("#searchInput").css("background", "url(/ypbooks/images/searchInput_navi_up.gif) no-repeat");
		}
		return false;
	});

	$("#searchInput #off").click( function() {
		$("#lookAhead").css("display", 'none');
		$("#searchInput").css("background", "url(/ypbooks/images/searchInput_navi.gif) no-repeat");
		return false;
	});

	$("#btnCategory").click(function() {
		if ($("#categoryBox").css("display") == "none")	{
			$("#categoryBox").bgiframe();
			$("#categoryBox").show();
		} else {
			$("#categoryBox").hide();
		}
	  return false;
	});

	$("#goodsNum").html($("#todayShowGoods li").length);
	$("#btnTodayShow").click( function() {
		$("#todayShowBox").bgiframe();
		$("#todayShowBox").show();

		makeRequest("get", "/servlet/GetTodayViewBook", GetTodayBookList);		//seon : 오늘본 상품(도서)정보를 가져온다.
		return false;
	});

	$("#prevNewBook").click( function() {
		if( newb != 0) {
			$("#newBookList").animate({"left": "+=55px"}, 2000);
			newb--;
		}
	});
	$("#nextNewBook").click( function() {
		var n = $("#newBookList li").length-7;
		if( newb != n ) {
			$("#newBookList").animate({"left": "-=55px"}, 2000);
			newb++;
		}
	});
	
	$("#prevNewBook").mouseover( function() {
		window.clearInterval(newbook);
	});
	$("#nextNewBook").mouseover( function() {
		window.clearInterval(newbook);
	});
	$("#prevNewBook").mouseout( function() {
		newBookAuto();
	});
	$("#nextNewBook").mouseout( function() {
		newBookAuto();
	});
	  $("#newBookList").show()
	   .hover(function() {
		window.clearInterval(newbook); },
	   function() { 
		newBookAuto();
	   });


	$("#ad div a").mouseover( function() {
		window.clearTimeout(adTime);
	});
	$("#ad div a").mouseout( function() {
		adTime = setTimeout("naviAd()", 1000);
	});

	$("#oneLineAD div a").mouseover( function() {
		window.clearTimeout(oneLineTime);
	});
	$("#oneLineAD div a").mouseout( function() {
		oneLineTime= window.setTimeout("adMove()", 1000);
	});






	for(var i=5; i<10; i++ ) {
		$("#weekBestList li:eq("+i+")").css("display", "none");
	}


	$("#directGoYP a.ir").click(function() {
		if ($("#slt").css("display") == "none") {
			$("#slt").show();
		} else {
			$("#slt").hide();
		}
		return false;
	});


});

////////////////////////////////////////////////////////////////////// End document.ready function
var ___rM = 0; // right margin
var ___topM = 172 ; // top margin
var ___sTM = 0 ; // scroll top margin
var ___sSP = 172 ; // scroll start point
var ___speed = 10 ;
var ___sSS = 500 ;
var ___sTimer ;

function RefreshStaticMenu() {
  var stmnStartPoint, stmnEndPoint;

  stmnStartPoint = parseInt(document.getElementById('tempAbsoluteRight').style.top, 10);
  stmnEndPoint = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + ___sTM;
  if (stmnEndPoint < ___topM) stmnEndPoint = ___topM;

  if (stmnStartPoint != stmnEndPoint) {
	stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 5 );
	document.getElementById('tempAbsoluteRight').style.top = parseInt(document.getElementById('tempAbsoluteRight').style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ) + 'px';
	stmnRefreshTimer = ___sSS;
  }

  ___sTimer = setTimeout("RefreshStaticMenu();", ___speed);
}

function followTodaysGoods() {

//  	document.getElementById('tempAbsoluteRight').style.right = ___rM + 'px';
//  	document.getElementById('tempAbsoluteRight').style.top = document.body.scrollTop + ___sSP + 'px';
//  	RefreshStaticMenu();
}


var naviAdn=0;
var adTime;
function naviAd() {
	var n = $("#ad li").length;
	if( naviAdn < n ) {
		if( naviAdn == n-1) {
			$("#ad ul").animate({"top": "-=15px"}, 200);
			adTime = setTimeout("naviAd()", 300);
		}else {
			$("#ad ul").animate({"top": "-=30px"}, 500);
			adTime = setTimeout("naviAd()", 5000);
		}
		naviAdn++;
	}else {
		$("#ad ul").css("top", "5px");
		$("#ad ul").animate({"top": "0px"}, 100);
		naviAdn=0;
		adTime = setTimeout("naviAd()", 5000);
	}
}

var searchN;
var searchImg;
function navi_search(n, img) {
	if( $("#search"+n+" ul").css("display") != 'none' ) {
		$("#search"+n+" ul").css("display", "none");
		$("#search"+n+"").css("background", "url(/ypbooks/images/searchSelect"+img+".gif) no-repeat");
	}else {
		$("#search"+n+" ul").bgiframe();
		$("#search"+n).css("background", "url(/ypbooks/images/searchSelect"+img+"_up.gif) no-repeat");
		$("#search"+n+" ul").css("display", "block");
	}

	if( searchN != n) {
		$("#search"+searchN+" ul").css("display", "none");
		$("#search"+searchN+"").css("background", "url(/ypbooks/images/searchSelect"+searchImg+".gif) no-repeat");
	}


	searchN=n;
	searchImg=img;
}

function sltBold(id, n) {
	for(var i=0; i<$("#"+id+" span").length; i++) {
		$("#"+id + " span:eq(" + i + ")").css("font-weight", "normal");
	}
	$("#"+id + " span:eq(" + n + ")").css("font-weight", "bold");
}

function showBox(id, id_) {
	if( id == 'interior' || id == 'foreign' || id == 'interior2') {
		$("#" + id).css("display", "");
	}else {
		$("#" + id).css("display", "block");
	}
	$("#" + id_).css("display", "none");
}

function hideBox(id, id_) {
	$("#" + id).css("display", "none");
	$("#" + id_).css("display", "none");
}

var n_=0;
function registerType(n, id) {
	$("#"+id+n_).css("display", "none");
	$("#"+id+n).css("display", "block");

	var src = $("#"+id+" img:eq(" + n + ")").attr("src");
	var src_ = $("#"+id+" img:eq(" + n_ + ")").attr("src");
	var src_on = src.replace('off', 'on');
	var src_off = src_.replace('on', 'off');

	$("#"+id+" img:eq(" + n_ + ")").attr("src", src_off);
	$("#"+id+" img:eq(" + n + ")").attr("src", src_on);

	n_=n;
}

function loginType(t, tt) {//b, c
	var a = $("#loginBox li:eq("+t+")").attr("id");
	var b = $("#loginBox li:eq("+tt+")").attr("id");

	$("#loginBox li:eq("+t+")").attr("id", a.replace("Off", "On"));
	$("#loginBox li:eq("+tt+")").attr("id", b.replace("On", "Off"));
}

function loginType2(t, tt, ttt) {
	var a = $("#loginBox li:eq("+t+")").attr("id");
	var b = $("#loginBox li:eq("+tt+")").attr("id");
	var c = $("#loginBox li:eq("+ttt+")").attr("id");

	$("#loginBox li:eq("+t+")").attr("id", a.replace("Off", "On"));
	$("#loginBox li:eq("+tt+")").attr("id", b.replace("On", "Off"));
	$("#loginBox li:eq("+ttt+")").attr("id", c.replace("On", "Off"));
}

function selectBox(id) {
	$("#"+id).toggle();
}

function chgClass(id, c) {
	$("#"+id).attr("class", c);
}

function close(id) {
	$("#"+id).css("display", "none");
}

function moreShow(id, img) {
	var n = $("#"+id+" li").length;
	var onoff= $("#"+img).attr("src").indexOf("1.gif");

	if(onoff == -1 ) {
		$("#"+img).attr("src", $("#"+img).attr("src").replace(".gif", "1.gif"));
	}else {
		$("#"+img).attr("src", $("#"+img).attr("src").replace("1.gif", ".gif"));
	}


	for(var i=0; i<n; i++) {
		if(i > 5) {
			$("#"+id+" li:eq("+i+")").toggle();
		}
	}
	
}

var childTab=0;
function childTTab(n) {
	var num = $("#childThemeTab li").length;

	if( childTab != n) {
		$("#childThemeTab li:eq("+n+")").addClass("on");
		$("#childThemeTab li:eq("+childTab+")").removeClass();

		$("#ChildRecommedThemeList"+n).css("display", "block");
		$("#ChildRecommedThemeList"+childTab).css("display", "none");
	}

	childTab=n;
}

var babyN=0;
function babyBox(n) {
	var src = $("#recommendBookTab img:eq("+n+")").attr("src");
	var src_ = $("#recommendBookTab img:eq("+babyN+")").attr("src");
	
	for(var i=0;i<4;i++){
		var name = "tabMenu"+i;
		var tab = document.getElementById(name);
		if(i == n){
			tab.src = "/ypbooks/images/books/child_tab0"+(i+1)+"on.gif";
		}else{
			tab.src = "/ypbooks/images/books/child_tab0"+(i+1)+".gif";
		}
	}
	
	if( n != babyN ) {
		//$("#recommendBookTab img:eq("+babyN+")").attr("src", src_.replace("on", ""));
		//$("#recommendBookTab img:eq("+n+")").attr("src", src.replace("", "on"));

		$("#baby"+n).css("display", "block");
		$("#baby"+babyN).css("display", "none");
	}
	
	var img = document.getElementById("childTit");
	
	if(n == 0){
		img.src = "/ypbooks/images/books/stit_child01.jpg";
	}else if(n == 1){
		img.src = "/ypbooks/images/books/stit_child02.jpg";
	}else if(n == 2){
		img.src = "/ypbooks/images/books/stit_child03.jpg";
	}else if(n == 3){
		img.src = "/ypbooks/images/books/stit_child04.jpg";
	}else{
		img.src = "/ypbooks/images/books/stit_child01.jpg";
	}
	
	babyN=n;
}

var arrowN=0;
function arrow(type) {
	var total = $("#todayShowGoods li").length;
	if( type == 'left' ) {
		if( arrowN != 0 ) {
			$("#todayShowGoods").animate({"left": "+=71px"}, "slow");
			arrowN--;
		}
	}else {
		if( arrowN < total-3 ) {
			$("#todayShowGoods").animate({"left": "-=71px"}, "slow");
			arrowN++;
		}
	}
	$(document).unbind("click");
	window.setTimeout(function() {
		$(document).click(function() { $(".defaultToggle").hide(); });
	}, 10);
}

function ranking(type) {
	if( type == 'next' ) {
		for(var i=0; i<10; i++ ) {
			if(i < 5) {
				$("#weekBestList li:eq("+i+")").css("display", "none");
			}else {
				$("#weekBestList li:eq("+i+")").css("display", "block");
			}
		}
	}else {
		for(var i=0; i<10; i++ ) {
			if(i < 5) {
				$("#weekBestList li:eq("+i+")").css("display", "block");
			}else {
				$("#weekBestList li:eq("+i+")").css("display", "none");
			}
		}
	}
}

var issueN=0;
function issue(type) {
	var n = $("#issueBookWrap dl").length/2;

	if( type == 'pre' ) {
		if( issueN != 0) {
			$("#issueBookWrap").animate({"left": "+=520px"}, "slow");
			issueN--;
		}
	}else {
		if( issueN != n-1) {
			$("#issueBookWrap").animate({"left": "-=520px"}, "slow");
			issueN++;
		}
	}
}
var ibookAuto_;
function iAuto() {
	var num = $("#issueBookWrap dl").length/2-1;

	if(issueN != num) {
		$("#issueBookWrap").animate({"left": "-=520px"}, "slow");
		issueN++;
	}else {
		$("#issueBookWrap").animate({"left": "0"}, "slow");
		issueN=0;
	}
	ibookAuto_ = window.setTimeout("iAuto()", 3000);
}

var issueN_=0;
function issueBook_(t) {
	var n = $("#issueBookList_ li").length;

	if( t == 'pre' ) {
		if( issueN_ != 0 ) {
			$("#issueBookList_ ul").animate({"left": "+=100px"}, "slow");
			issueN_--;
		}
	}else {
		if( issueN_ != n-5 ) {
			$("#issueBookList_ ul").animate({"left": "-=100px"}, "slow");
			issueN_++;
		}
	}
}

var tb=0;
var tb_=0;
function themeBook(t) {
	var n = $("#themeBookWrap li").length;
	tb_ = tb;

	if( t == 'pre' ) {
		if( tb != 0) {
			$("#themeBookWrap ul").animate({"left": "+=483px"}, "slow");
			tb--;
		}
	}else {
		if( tb != n/5-1 ) {
			$("#themeBookWrap ul").animate({"left": "-=483px"}, "slow");
			tb++;
		}
	}

	$("#themeBookTitle span:eq("+tb_+")").css("display", "none");
	$("#themeBookTitle span:eq("+tb+")").css("display", "block");
}

var rtb=0;
var rtb_=0;
function rtheme(t) {
	var n = $("#rThemeBookList li").length;
	rtb_ = rtb;

	if( t == 'pre' ) {
		if( rtb != 0) {
			if ( $.browser.msie && $.browser.version > 6 ) {
				$("#rThemeBookList").animate({"top": "+=224px"}, "slow");
			} else {
				$("#rThemeBookList").animate({"top": "+=232px"}, "slow");
			}
			rtb--;
		}
	}else {
		if( rtb != n/2-1 ) {
			if ( $.browser.msie && $.browser.version > 6 ) {
				$("#rThemeBookList").animate({"top": "-=224px"}, "slow");
			} else {
				$("#rThemeBookList").animate({"top": "-=232px"}, "slow");
			}
			rtb++;
		}
	}

//	alert(n + "   " + rtb);

	$("#rThemeBookPromotion table a:eq("+rtb_+")").css("display", "none");
	$("#rThemeBookPromotion table a:eq("+rtb+")").css("display", "block");
}



//메인용
var adn=0;
var oneLineTime;
function adMove() {
	var n = $("#oneLineAD li").length;
	if( adn < n) {
		if( adn == n-1) {
			$("#oneLineAD ul").animate({"top": "-=12px"}, 200);
			oneLineTime= window.setTimeout("adMove()", 300);
		}else {
			$("#oneLineAD ul").animate({"top": "-=30px"}, 500);
			oneLineTime= window.setTimeout("adMove()", 5000);
		}
		adn++;
	}else {
		$("#oneLineAD ul").css("top", "5px");
		$("#oneLineAD ul").animate({"top": "0px"}, 100);
		adn=0;
		oneLineTime= window.setTimeout("adMove()", 5000);
	}
}

var editor=0;
function ediorRecommendBook(t, id) {
	var total = $("#" + id + " li").length;
	if( t == 'pre') {
		if( editor != 0) {
			$("#"+id).animate({"left": "+=114px"}, 200);
			editor--;
		}
	}else {
		if( editor < total-1 ) {
			$("#"+id).animate({"left": "-=114px"}, 200);
			editor++;
		}
	}
}

var newbook;
var newb=0;
var t="right";
function newBookAuto() {
	var n = $("#newBookList li").length-7;
	if( newb != n && t == "right") {
		t="right";
		$("#newBookList").animate({"left": "-=123px"}, 750);
		newb++;
	}else {
		t="left";
		$("#newBookList").animate({"left": "+=123"}, 750);
		newb--;
		if(newb < 1) {t="right";}
	}
	newbook = window.setTimeout("newBookAuto()", 5000);
}

function buttonOnOff(id, type) {
	var imgSrc = id.src;
	if( type == 'over' ) {
		id.src = imgSrc.replace('_off', '_on');
	}else {
		id.src = imgSrc.replace('_on', '_off');
	}
}


var id__="tab1";
function branchMenu(id1) {
	if( id1 != id__) {
		$("#"+id1).css("display", "block");
		$("#branchInfo img." + id1).attr("src", $("#branchInfo img." + id1).attr("src").replace("_off","_on"));
		$("#"+id__).css("display", "none");
		$("#branchInfo img." + id__).attr("src", $("#branchInfo img." + id__).attr("src").replace("_on","_off"));
	}
	id__ = id1;
}

function changeBestTab(idx) {
	$("#SubMenuTab li").each(function(i) {
		idx === i ? $(this).find("img").attr("src", $(this).find("img").attr("src").replace("_off", "_on")) : $(this).find("img").attr("src", $(this).find("img").attr("src").replace("_on", "_off"));
	});
}

var __detail_Editor = 0;
var __detail_Editor1 = 0;
function detail_Editor(t) {
	var n = $("#detailEditorRecommend li").length;
	__detail_Editor1 = __detail_Editor;

	if( t == 'prev' ) {
		if( __detail_Editor != 0) {
			$("#detailEditorRecommend ul").animate({"left": "+=513px"}, 300);
			__detail_Editor--;
		}
	}else {
		if( __detail_Editor < n/2 - 1 ) {
			$("#detailEditorRecommend ul").animate({"left": "-=513px"}, 300);
			__detail_Editor++;
		}
	}
}


////////////////////////////// 작업 중 //////////////////////////////
$(function() {	
	//토글탭 처리
	$(document).click(function() {
		$(".defaultToggle").hide();
	});
});





function GetTodayBookList(req_obj){	//seon
	var _html = req_obj.responseXML.getElementsByTagName("html")[0];
	if (_html){		
		var Obj = document.getElementById("todayShowGoods");
		if (Obj)
		{
			Obj.innerHTML = _html.firstChild.nodeValue;
		}
		
		Obj = document.getElementById("goodsNum");
		if (Obj)
		{
			Obj.innerHTML = _html.getAttribute("total_cnt");
		}
	}
}

function PeriodEmbargo(p_bookcd, p_pubcd, p_catecd){
	/*
	alert(p_bookcd);
	alert(p_pubcd);
	alert(p_catecd);
	*/

	var today	= new Date();
	var month	=  today.getMonth()+1;
	
	var arrCategory	= new Array("301405","140000","160000","180000");	 //조서가별
	var arrPublish	= new Array("25460","22302");	 //출판사별
	var arrBook		= new Array("1619200147","2135500060","5110805131","4252500012");	 //도서별
	var viewFlag	= false;

	if (month == 3 || month == 9 || month == 11){

		for(var i=0; i<arrCategory.length; i++){
			if(arrCategory[i] == p_catecd){
				viewFlag = true;
				break;
			}
		}

		if (!viewFlag){
			for(var i=0; i<arrPublish.length; i++){
				if(arrPublish[i] == p_pubcd){
					viewFlag = true;
					break;
				}
			}
		}

		if (!viewFlag){
			for(var i=0; i<arrBook.length; i++){
				if(arrBook[i] == p_bookcd){
					viewFlag = true;
					break; 
				}
			}
		}
	}

	return viewFlag;
}

