/*INISEAL:[%2Bzpto3Vp%2BA%2F2NwdJBd6GQltTlIY%3D%0A]*/
/*****************************************************************************
 * ÆÄÀÏ¸í : ccd-pvcrd-bnf.js
 * ÀÛ¼ºÀÏ : 2008. 06. 13
 * ÀÛ¼ºÀÚ : È«ÁÖÈñ
 * ¼³  ¸í : ÇÏ³ªÄ«µå > ÇÒÀÎ/ÇýÅÃ javascript function ÆÄÀÏ
 * ===========================================================================
 * º¯°æÀÌ·Â:
 * DATE				AUTHOR		DESCRIPTION
 * ---------------------------------------------------------------------------
 * º¯°æ ÀÌ·ÂÀº ÀÌ°÷¿¡ Ãß°¡ ÇÕ´Ï´Ù.
 *****************************************************************************/




// for debug

var tmpp;
////////////
/**
 * 
 * 
 */
ccd.pvcrd.bnf = function() {
	
var CONTENT_DIV  = 'HANA_CONTENT' ;
var HANA_LEFT_DIV = 'HANA_LEFT';
var TAB_MENU_DIV = 'tabMenuDiv';               // Tab ¸Þ´º
var TAB_MENU_CONTENT_DIV = 'tabMenuContentDiv';        // Tab ¸Þ´º¿¡ µû¸¥ Content
var HANA_MAIN_DIV = 'hanaMainDiv';
var HANA_CONTENT_DIV = "hanaContentDiv";
    
    
    // public space
    return {
    	

	/**
         * ´ë¸Þ´ºÀÌµ¿ 
         * 
         */ 
        ViewLayer : function(id, divId, num) {
        		
        	for(i=1;i<=num;i++) {
			document.getElementById(id+i+"_on").style.display="none";
			document.getElementById(id+i+"_off").style.display="";
		}
		
        	document.getElementById(divId+"_off").style.display = "none";
        	document.getElementById(divId+"_on").style.display ="";      		
        	
        }, //function close


	/**
	 * ¿ÞÂÊ¸Þ´º ÆäÀÌÁö ÀÌµ¿
	 * 
	 * @param {Object} pageURL
	 * @param {Object} formObj
	 */
	goPage : function(pageURL) {
		
		var hanaAjax = null;
		
		/*if ( destDiv == undefined || destDiv == null ) {
			destDiv = pbk.CONTENT_WRAP;
		}*/
		
		var destDiv = CONTENT_DIV ;
		//alert("destDiv : "+ destDiv);
		
		hanaAjax = new hana.JHanaAjax(destDiv, true, true);	
	
		//alert(pbk.APPLICATION_CONTEXT_ROOT + pageURL);
		hanaAjax.ajaxCommSubmit(pbk.APPLICATION_CONTEXT_ROOT + pageURL, null);
	},
	
	/**
         * ´ë¸Þ´ºÀÌµ¿ (´Ù¸¥ ¸Þ´º·ÎÀÇ ÀÌµ¿)
         * 
     */      
        goLeftMenu : function(idxUrl, id, divId, type) {
			
			if (type == null) {
				var goUrl = idxUrl+"?id="+id+"&di="+divId+"&type=A";
			} else {
				var goUrl = idxUrl+"?id="+id+"&di="+divId+"&type="+type;
			}
			
			goUrl = pbk.APPLICATION_CONTEXT_ROOT + goUrl;
			
			location.href = goUrl;   
				
        }, //function close	 
        
        goFromOutside : function(id, divId, type) {

			document.getElementById(divId+"_off").style.display = "none";
        	document.getElementById(divId+"_on").style.display = "block"; 
        	
        	var hanaAjax = new hana.JHanaAjax(CONTENT_DIV, false, true);
			if(type == 'aerial'){
        		hanaAjax.ajaxCommSubmit('/contents/ccd/pvcrd/bnf/bnf_p282.jsp', null);
        	} else if(type == 'abroad'){
        		hanaAjax.ajaxCommSubmit('/contents/ccd/pvcrd/bnf/bnf_p284.jsp', null);
        	} else if(type == 'accident'){
        		hanaAjax.ajaxCommSubmit('/contents/ccd/pvcrd/bnf/bnf_p286.jsp', null);
        	}
        	
        }, //function close
        
        
        goSelMovePage: function(url){       
			goUrl = pbk.APPLICATION_CONTEXT_ROOT + url;
			var hanaAjax = new hana.JHanaAjax(HANA_MAIN_DIV, true, true);
			hanaAjax.ajaxCommSubmit(goUrl, null);
		},
		
		insertFlashWithVersion:function (swf, width, height, bgcolor, id, flashvars, trans, verstr, base, div){
		
			var strFlashTag = new String();
			verstr = '9,0,0,0';
		
			if (navigator.appName.indexOf("Microsoft") != -1)
			{
				strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+verstr+'" id="' + id + '" width="' + width + '" height="' + height + '" align="left">';
				strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
				strFlashTag += '<param name="movie" value="' + swf + '"/>';
				strFlashTag += '<param name="quality" value="high"/>';
				strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
				strFlashTag += '<param name="flashVars" value="xmlPath=/contents/ionresource/flash/ccd/joinShop.xml" />';
				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="' + trans + '" ';
				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.getElementById(div).innerHTML = strFlashTag;
			
		}, // End insertFlashWithVersion
        toggleTabMenu : function(actionObj, type) {
         	// TabÀÌ¹ÌÁö¸¦ Å¬¸¯½Ã ÅÇ¸Þ´º effect¸¦ ¹ß»ýÇÑ´Ù.
         	 pbk.changeTabImage(actionObj, TAB_MENU_DIV);
         	
         	 //ÇØ´ç ÅÇ¿¡ ´ëÀÀÇÏ´Â ActionÀ» È£ÃâÇÑ´Ù.
         	var formObj = form.createForm([{
         	    id: 'paramReturnType',
         	    value: type
         	}]);
            var hanaAjax = new hana.JHanaAjax(TAB_MENU_CONTENT_DIV, true, true);
            hanaAjax.ajaxCommSubmit(type, formObj);
        },       // End toggleTabMenu
        
        goPageFromFlash: function(url){
       		goUrl = pbk.APPLICATION_CONTEXT_ROOT + url;
			var hanaAjax = new hana.JHanaAjax(HANA_MAIN_DIV, true, true);
			hanaAjax.ajaxCommSubmit(goUrl, null);
		}

    }           // End Reutn
}();            // csc.acdc close



