﻿//alert(window.location.host + ' : ' + document.cookie);

document.title = "하나HSBC생명보험";
//document.domain = 'hanahsbclife.co.kr';

function changeRowColor(o, b)
{
    (b) ? $(o).addClassName('onmouse_color') : $(o).removeClassName('onmouse_color');
}

function insertFlash(swf, width, height, bgcolor, id, flashvars)
{
	var strFlashTag = new String();

	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
		strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
		strFlashTag += '<param name="movie" value="' + swf + '"/>';

		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		strFlashTag += '<param name="quality" value="best"/>';
		strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
		strFlashTag += '<param name="menu" value="false"/>';
		strFlashTag += '<param name="salign" value="LT"/>';
		strFlashTag += '<param name="scale" value="noscale"/>';
		 strFlashTag += '<param name="wmode" value="transparent"/>';
		strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
		strFlashTag += '</object>';
	}
	else
	{
		strFlashTag += '<embed src="' + swf + '" ';
		strFlashTag += 'quality="best" ';
		strFlashTag += 'bgcolor="' + bgcolor + '" ';
		strFlashTag += 'width="' + width + '" ';
		strFlashTag += 'height="' + height + '" ';
		strFlashTag += 'menu="false" ';
		strFlashTag += 'scale="noscale" ';
		strFlashTag += 'id="' + id + '" ';
		strFlashTag += 'salign="LT" ';
		//strFlashTag += 'wmode="transparent" ';
		strFlashTag += 'allowScriptAccess="sameDomain" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
		strFlashTag += 'type="application/x-shockwave-flash" ';
		strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
		strFlashTag += '</embed>';
	}

	document.write(strFlashTag);
}

function popup(u,w,h,s,n)
{
    var url = u;
    var width = w;
    var height = h;
    //var left = 380;
    //var top = 150;
	var left = ((screen.width - width) / 2); 
	var top = ((screen.height - height) / 2);

    var toolbar = 'no';
    var menubar = 'no';
    var status = 'no';
    var scrollbars = s;
    var resizable = 'no';
    var help = window.open( u, n, 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar+', menubar='+menubar+', status='+status+', scrollbars='+scrollbars+', resizable='+resizable);
}

function popup_plan(u,d,v)
{
    var url = u;
	var dc = d;
	var vp = v
    var width = 690;
    var height = 590;
	var left = ((screen.width - width) / 2); 
	var top = ((screen.height - height) / 2);

    var toolbar = 'no';
    var menubar = 'no';
    var status = 'no';
    var scrollbars = 'yes';
    var resizable = 'no';
    var help = window.open( "/HO/PD/HO_PD_00/plan_popup.jsp?url="+u+"&DpCode="+d+"&v_prdtype="+v,'plan', 'left='+left+', top='+top+', width='+width+', height='+height+', toolbar='+toolbar+', menubar='+menubar+', status='+status+', scrollbars='+scrollbars+', resizable='+resizable);
}

function q()
{
    document.write("<script type='text/javascript' src='/js/scroll.js'></script>");
}

/**
 * 해당 엘리먼트의 display 스타일을 변경
 *
 * @history             2008-01-15 김형섭 추가
 * @param ids 엘리먼트ID 배열
 * @param v   display 여부
 *
 */
function displayIngLayer(ids, v)
{
    if(typeof v == 'undefined') v = true;

    /*
    for(var i=0; i<ids.length; i++)
    {
        var ingLayer = $(ids[i]);       

        if(v) ingLayer.removeClassName('display_none');
        else ingLayer.addClassName('display_none');
    }
    */

    for(var i=0; i<ids.length; i++)
    {
        var ingLayer = $(ids[i]);       

        if(v) ingLayer.style.display = '';
        else ingLayer.style.display = 'none';
    }
}




function clickMouse(idx) //this, 1
{
    var menuimg = [
                    {off:"/img/HO/PD/producttab1.gif", on:"/img/HO/PD/producttab1_on.gif"},
                    {off:"/img/HO/PD/producttab1.gif", on:"/img/HO/PD/producttab1_on.gif"},
                    {off:"/img/HO/PD/producttab2.gif", on:"/img/HO/PD/producttab2_on.gif"},
                    {off:"/img/HO/PD/producttab3.gif", on:"/img/HO/PD/producttab3_on.gif"},
                    {off:"/img/HO/PD/producttab4.gif", on:"/img/HO/PD/producttab4_on.gif"},
                    {off:"/img/HO/PD/producttab5.gif", on:"/img/HO/PD/producttab5_on.gif"}
                  ];

    var count = document.getElementById("parent_tabmenu").getElementsByTagName("img").length;

    for(var i=0; i<count; i++){

        var ii = i + 1;
        var ig = document.getElementById("ig" + ii);

        if(ii == idx){
            ig.setAttribute("src", menuimg[ii].on);
            ig.blur(); // 클릭시 이미지 테두리 점선 제거
        }
        else{
            ig.setAttribute("src", menuimg[ii].off);
        }
    }
}


	function doResize() 	
{ 
  insur.height = insur_inner.document.body.scrollHeight;
  insur.width = insur_inner.document.body.scrollWidth;
} 


/*텝 및 이미지 클릭시 점선 없애는 것*/

function bluring(){ 
    if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 


/* 메인 간편 보험 설계 버튼 함수 */

function Plan(a,b,c,d) {
	document.write ("<form name = 'frm'>");
	document.write ("<input type = 'hidden' name = 'birthday' value = '"+a+"'>");
	document.write ("<input type = 'hidden' name = 'sex' value = '"+b+"'>");
	document.write ("<input type = 'hidden' name = 'cal' value = '"+c+"'>");
	document.write ("<input type = 'hidden' name = 'bhsp' value = '"+d+"'>");
	document.write ("<input type = 'hidden' name = 'page_gubun' value = '1'>");
	document.write ("</form>");
	var f = document.frm ;
	f.action = "/HO/PD/HO_PD_06/HO_PD_06_01.jsp";   //간편 보험 설계 계산되어 뿌려지는 페이지 주소
	f.method = "post";
	f.submit();
}


/*  메인 공지사항 리스트 클릭 함수 */
function NoticeView(index,seqno,totalCount) {
	document.write ("<form name = 'Viewfrm'>");
	document.write ("<input type = 'hidden' name = 'index' value = '"+index+"'>");
	document.write ("<input type = 'hidden' name = 'seqno' value = '"+seqno+"'>");
	document.write ("<input type = 'hidden' name = 'totalCount' value = '"+totalCount+"'>");
	document.write ("</form>");
	var nvF = document.Viewfrm;
	nvF.action = '/HO/CS/HO_CS_01/HO_CS_01_02.jsp';
	nvF.method = 'post';
	nvF.submit();
}


// String Filter
function stringFilter(input) {
    s = input.value;
    filteredValues = "<,>,#,&,^,$,%,*,(,),{,},[,],/,;,`";
    var i;
    var returnString = "";
    for( i=0 ; i<s.length ; i++ ) {   
        var c = s.charAt(i);
        if( filteredValues.indexOf(c) == -1 ) {returnString += c;}
    }
    input.value = returnString;
    
}

Event.observe(window, 'load', function()
{
    var d  = document;
    
    d.title = "하나HSBC생명보험";

    if(d.layers) d.captureEvents(Event.mouseover | Event.mouseout);

    Event.observe(d, 'mouseover', function()
    {
        this.status = '';
        return true;
    });

    Event.observe(d, 'mouseout', function()
    {
        this.status = '';
        return true;
    });

    Event.observe(d, 'dragstart', stopNotAllowedEvent);

    Event.observe(d, 'selectstart', stopNotAllowedEvent);

    Event.observe(d, 'contextmenu', stopNotAllowedEvent);

    Event.observe(d, 'keydown', function()
    {
        var kca = (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82));
        var kcb = (event.keyCode >= 112 && event.keyCode <= 123);
        //var kcc = (event.ctrlKey || event.shiftKey);  //20080514
	var kcc = event.ctrlKey;
        if(kca || kcb || kcc) stopNotAllowedEvent(event);
    });

    Event.observe(d, 'mousedown', function()
    {       
        //var kca = (event.ctrlKey || event.shiftKey); //20080514
	var kca = event.ctrlKey;
        var kcb = (event.button == 2 || event.button == 2);
        if(kca || kcb) stopNotAllowedEvent(event);
    });
});

stopNotAllowedEvent = function(e)
{
    e.cancelBubble = true; 
    e.returnValue = false;
};


// 20081230 Softforum Kim Irang

// Softforum Key Protector Start
document.write('<script language="javascript" src="http://ck.softforum.co.kr/CKKeyPro/hanalife/CKKeyPro_homepage.js"></script>');
// Softforum Key Protector End

// Softforum Firewall Start
document.write('<script language="javascript" src="http://ck.softforum.co.kr/CKFW/hanalife/vc/CKFW.js"></script>');
// Softforum Firewall End

// Softforum Web Protector Start
document.write('<script language="javascript" src="http://ck.softforum.co.kr/CKWebPro/hanalife/CKWebPro_homepage.js"></script>');
// Softforum Web Protector End