﻿$(document).ready(function(){
 
    // 페이즈 사이즈
    $("#pagesize").val($("#pagesize").attr("ps"));

    // 검색어 처리
    $("#stxt").bind({
        focus : function(){
            if($(this).val()=="검색어를 입력하세요") $(this).val("");
        }, 
        blur : function(){
            if($(this).val()=="") $(this).val("검색어를 입력하세요");
        }
    });

	// 프린트하기
	$(".btnPrint").click(function(){
		$("div.PrintArea").printArea( {mode: "iframe"} );
	});

});

function js_moveList(obj, url){
	$("#idx, #mode").remove();
	$(obj).attr("action",url);
	$(obj).submit();
}

function js_movePage(pg, obj){
    $("#gourl, #mode, #idx").remove();
    $("#page").val(pg);
    var sf = eval('document.' + $("#page").parents("form").attr("name"));
    sf.action = sf.action.replace("_view.", "_list.");
    sf.submit();
}

function js_moveView(idx, obj){
	$("#gourl, #mode").remove();
    $("#idx").val(idx);

    $(obj).parents("form").attr("action", $(obj).attr("href"));
	$(obj).parents("form").submit();
}

//영문&숫자 조합 체크
function js_Chkstrnum(str){ 
	var reg1 = /^[a-z\d]{8,256}$/i;
	var reg2 = /[a-z]/i;
	var reg3 = /\d/;
	return (reg1.test(str)&reg2.test(str)&reg3.test(str));
}

// ajax 로딩 이미지
function js_loading(x, y){
    $("#ajaxLoader").css({'top':y, 'left':x}).toggle();
}

// 팝업
function winOpen(url,width,height,scroll)
{

	px = (screen.width - width) / 2;
	py = (screen.height - height) / 2; 
	var now = new Date();
	var openwin = window.open(url,'win'+now.getHours()+now.getSeconds(),'width='+width+',height='+height+',scrollbars='+scroll+',top='+py+',left='+px);	

}

// 팝업창뜨기
function winPopup(idname){
	$("select, iframe").hide();
	$("#" + idname).bPopup({onClose:function(){
		$("select, iframe").show();
	},opacity:0.5});
}



