
/************************************************************
*
*  JavaScript
*
************************************************************/

 //ex)<script type="text/javascript">flashX('slide.swf','462','495','slide');</script> <== html »ç¿ë½Ã
function flashX(src,w,h,swfid){
swf_html = '';
swf_html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="'+swfid+'">';
swf_html += '<param name="allowScriptAccess" value="sameDomain">';
swf_html += '<param name="movie" value="'+src+'">';
swf_html += '<param name="quality" value="high">';
swf_html += '<param name="bgcolor" value="#FFFFFF">';
swf_html += '<PARAM NAME="wmode" VALUE="transparent">';
swf_html += '<embed src="'+src+'" quality="high" bgcolor="#FFFFFF" width="'+w+'" height="'+h+'" name="'+swfid+'" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
swf_html += '</object>';
document.write(swf_html);
}



//  È­¸é Á¤Áß¾Ó¿¡ POPUP WINODOW OPEN
function popCwin( url, name, w, h, scroll) {

  var wl = (window.screen.width/2) - ((w/2) + 10);
  var wt = (window.screen.height/2) - ((h/2) + 50);

  var option = "height="+h+",width="+w+",left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll + ", status=yes";

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

// ¿øÇÏ´Â À§Ä¡¿¡ POPUP WINODOW OPEN
function popUwin( url, name, w, h, wl, wt, scroll) {

  var option = "status=no,height="+h+",width="+w+",resizable=no,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll;

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

/************************************************************
* GoTop
************************************************************/
function GoTop() {
	window.scrollTo(0,0);
}





/*************************************
** SELECT SHOW / HIDE
*************************************/



/* tab show hide */
function changeDivStyle(bid, id, total)
{
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+'Tab_'+i).style.display = 'none';
		document.getElementById(bid+'Cont_'+i).style.display = 'none';
    }
	document.getElementById(bid+'Tab_'+id).style.display = 'block';
	document.getElementById(bid+'Cont_'+id).style.display = 'block';
}

// div show/hide
function changeDivStyle2(bid, id, total)
{
	if(id){
		for(var i = 1; i <= total; i++)
		{
			document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		}

		document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	}
}

// 2Tab
function changeDivStyle3(bid, id, total)
{
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
    }
	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
}

// 3Tab
function changeDivStyle4(bid, id, total)
{
	var offNum;
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
	}

		if (id != 1){
			offNum = id - 1;
			document.getElementById(bid+"_Tab_"+offNum).className = 'off';
			if (id > 2) {
				document.getElementById(bid+"_Tab_1").className = 'off1';
			} else {
				document.getElementById(bid+"_Tab_1").className = 'off2';
			}
		}

	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
/*
	var offNum;
	for(var i = 1; i <= total; i++)
    {
		document.getElementById(bid+"_Cont_"+i).style.display = 'none';
		document.getElementById(bid+"_Tab_"+i).className = '';
	}

		if (id != 1){
			offNum = id - 1;
			document.getElementById(bid+"_Tab_"+offNum).className = 'off2'
		}

	document.getElementById(bid+"_Cont_"+id).style.display = 'block';
	document.getElementById(bid+"_Tab_"+id).className = 'on';
*/
}

/************************************************************
¼³¸í : »õÃ¢ ¶ç¿ö¼­ Æ÷Ä¿½º ÁÖ±â
¿¹)winOpen(url,winName,width,height,scrollbars,resizable,left,top)

À§Ä¡ ÁöÁ¤ ¾ÈÇÏ¸é ÇØ»óµµ °¡¿îµ¥·Î
winOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',500,400,'yes','no')

À§Ä¡ ÁöÁ¤ÇÏ¸é ÇØ´ç À§Ä¡·Î
winOpen('ÁÖ¼Ò','À©µµ¿ìÀÌ¸§',500,400,'yes','no',100,100)
************************************************************/
function winOpen(pUrl,pName,pW,pH,sb,rs,pL,pT){
	if(typeof(pL)=="undefined"){
		var winWidth  = window.screen.width;    //ÇØ»óµµ°¡·Î
		pL = parseInt((winWidth-pW)/2);
	}
	if(typeof(pT)=="undefined"){
		var winHeight  = window.screen.height;     //ÇØ»óµµ¼¼·Î
		pT = parseInt((winHeight-pH)/2);
	}

	var newWin=window.open(pUrl,pName,"width="+pW+",height="+pH+",scrollbars="+sb+",resizable="+rs+",left=" + pL + ",top=" + pT+",directories=no,status=no,menubar=no");
	newWin.focus(); 
}

function windowOpen(pUrl,pName,pW,pH,sb,rs,pL,pT){
	winOpen(pUrl,pName,pW,pH,sb,rs,pL,pT);
}

/*
setCookie( "Notice", "done" , 1);
(ÀÌ¸§,°ª,³¯Â¥)  ÇÏ·çµ¿¾È ÄíÅ° ÀúÀå
*/
function setCookie( name, value, expiredays ){ 
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
}

/*
getCookie(ÄíÅ°ÀÌ¸§)
*/
function getCookie(name){
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return "";
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

/*
ÄíÅ° ¼Ò¸ê ÇÔ¼ö
*/
function clearCookie(name) {
	if (getCookie(name)){	
		var today = new Date();
		//¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
		var expire_date = new Date(today.getTime() - 60*60*24*1000);
		document.cookie = name + "= " + "; expires=" + expire_date.toGMTString();
	}
}

