function close_calculation_layer(){
	$("#realtime_calculation_result").hide();
}


function select_tel(tel_no) {
	$("#customer_mobile1").val(tel_no);
}
/* 한글 입력체크 */
function onlyKorean(str){
	/*
	var findStr = str.match(/[가-힣ㄱ-ㅣ]+/);
	
	if ( str == findStr )return true;
	else return false;
	*/
	var pattern = /([^가-힣\x20])/i; 
	
	if (pattern.test(str)) return false;
	else return true;
	
}
/* 숫자 입력체크 */
function onlyNumber(str){
	var findStr = str.match(/[0-9]+/);

	if ( str == findStr )return true;
	else return false;
}
/* 한글이외에 입력방지 */
function hangul(){
	if((event.keyCode < 12592) || (event.keyCode > 12687)) event.returnValue = false
}
/* 숫자이외에 입력방지 */
function numbersonly(e, decimal) {
		
    var key;
    var keychar;

    if (window.event) {
        key = window.event.keyCode;
    } else if (e) {
        key = e.which;
    } else {
        return true;
    }
    keychar = String.fromCharCode(key);

    if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) {
        return true;
    } else if ((("0123456789").indexOf(keychar) > -1)) {
        return true;
    } else if (decimal && (keychar == ".")) {
        return true;
    } else
        return false;
}
//상단메뉴 보험 상품
function top_menu_prd_list(){
	
	show_small_loading("#top_menu_prd_list_area");
    $.ajax({
        type: "POST",
        url: "/FRONT/insur_main/top_menu_prd_list",
        success: function(result_data){
        	$("#top_menu_prd_list_area").html(result_data);
            $("#top_menu_prd_list_area").fadeOut();
        }
    });
}


// 인기검색어
function hot_keyword_list(){
	$.ajax({
        type: "POST",
        url: "/FRONT/insur_main/hot_keyword_list",
        success: function(result_data){
        	
        	$("#hot_keyword_list_area").html(result_data);
            $("#hot_keyword_list_area").fadeIn();
        }
    });
}
//핫이슈 상품
function hot_product_list(){
	$.ajax({
        type: "POST",
        url: "/FRONT/insur_main/hot_product_list",
        success: function(result_data){
        	
        	$("#hot_product_list_area").html(result_data);
            $("#hot_product_list_area").fadeIn();
        }
    });
}

//즐겨찾기
function add_favorites(url, title){
	var url = "http://www."+url;
	
	if (window.sidebar && window.sidebar.addPanel){ // Firefox
		window.sidebar.addPanel(title, url,"");
	}else{ // ie
		window.external.AddFavorite(url, title);
	}
	
}

//휴대폰 번호 선택 처리
function choice_hphone(choice_val){
	$("#quick_customer_hphone1").val(choice_val);
}
//1차 보종 선택 처리
function choice_category(category_code){
	$("#quick_category_code").val(category_code);
}
//성별 선택 처리
function choice_sex(choice_val){
	$("#quick_customer_sex").val(choice_val);
}
//개인정보수집 동의 선택 처리
function choice_gather(form_name, target_gather){
	var tmp_target_gather = "#"+target_gather;
	if($(tmp_target_gather).is(':checked')){
		open_agreement(form_name,target_gather);	
	}
}

//이메일 유효성 체크
function isemail(strValue){

	var tmp = strValue.match("^[0-9A-Za-z._-]+@[0-9A-Za-z.-]+$");
	
	if (tmp != strValue){
		return false;
	} else {
		return true;
	}
}



//폼 리셋
function reset_frm(frmId){
    $(frmId).each(function(){
        this.reset();
    });
}


//탭 자동 이동
function auto_tab(id1, id2, length) {
	if ($(id1).val().length == length) {
		$(id2).focus();
	}
}	



//상단 플로팅 닫기
function close_floating(status) {
	$.ajax({
        type: "POST",
        url: "/FRONT/insur_main/set_floating_session/"+status
    });
}
function show_small_loading(area){
    $(area).html("<div style='width:500px;height:100px;text-align:center;margin:auto;clear:both;'><img src='/COMMON/images/form/ajax-loader-circle.gif'></div>");
}


function set_blank(id, check_id) {
	$(id).val("");
	$(check_id).val('Y');
}


var Browser = {
	    a : navigator.userAgent.toLowerCase()
	}

Browser = {
    ie : /*@cc_on true || @*/ false,
    ie6 : Browser.a.indexOf('msie 6') != -1,
    ie7 : Browser.a.indexOf('msie 7') != -1,
    ie8 : Browser.a.indexOf('msie 8') != -1,
    opera : !!window.opera,
    safari : Browser.a.indexOf('safari') != -1,
    safari3 : Browser.a.indexOf('applewebkit/5') != -1,
    mac : Browser.a.indexOf('mac') != -1,
    chrome : Browser.a.indexOf('chrome') != -1,
    firefox : Browser.a.indexOf('firefox') != -1
}


function whatKindOfBrowser() {
	if (Browser.ie6) {
		alert("It is ie6 browser");
	} 
}
