
//var article_fontSize = parseInt(getCookie("article_fontSizePx"));
/*
function getCookie (name) {

  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;

  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;

}
*/
function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )    {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";

}


/*
function fontPlus() {
	if (article_fontSize < 7) {
		article_fontSize = article_fontSize + 1;
		setFont(article_fontSize);
	}
}
function fontMinus() {
	if (article_fontSize > 1) {
		article_fontSize = article_fontSize - 1;
		setFont(article_fontSize);
	}
}
*/
function fontDefault() {
	setFont(4);
}
function fontPlus() {
	setFont(5);
}
function fontPlusPlus() {
	setFont(6);
}


function setFont(article_fontSize) {

	document.getElementById("articleBody").className = "article0"+article_fontSize;
	//document.getElementById("articleBody").style.fontSize = article_fontSize+"pt";

	setFontCookie(article_fontSize);
}

function setFontCookie(article_fontSize) {

	var expiry = new Date();
	var path = "/";
	var domain = ".midishelp.com";
	var secure = "";

	expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000));

	setCookie("article_fontSizePx",article_fontSize,expiry,path,domain,secure);
}

function setCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}


function initFont() {
	/*
	if (isNaN(article_fontSize) == true) {
		article_fontSize = 4;
	}
	*/
	var article_fontSize = 4;
	setFont(article_fontSize);
}

// ÀÌ¸ÞÀÏ Ã¼Å©
function email_chk(tempf)
{
	var t = tempf
	var ValidFlag = false
	var atCount = 0
	var SpecialFlag
	var atLoop
	var atChr
	var BadFlag
	var tAry1
	var UserName
	var DomainName

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0
		SpecialFlag = false

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 )
			if ( atChr == "@" ) atCount = atCount + 1

			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true
		}

		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false
			tAry1 = t.split("@")
			UserName = tAry1[0]
			DomainName = tAry1[1]
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true
			ValidFlag = true
		}
	}
	if ( BadFlag == true ) ValidFlag = false
	return ValidFlag
}

// »ó´Ü °Ë»ö¹Ù
function CkSearch()
{
	var f = document.topForm
	if (f.hSEARCH_TEXT.value=='')
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		f.hSEARCH_TEXT.focus();
		return false;
	}
	return true;
}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//»ç¾÷½ÇÀû µ¿¿µ»ó È®´ëº¸±â
function fGoPlayer(argFILE_NAME, argFILE_PATH)
{
	var win = window.open('/business/business_popup_movie.asp?hFILE_NAME='+argFILE_NAME+'&hFILE_PATH='+argFILE_PATH, 'business', 'width=823, height=640, scrollbars=no, menubar=no');
	win.focus();
}

/* »ç¾÷½ÇÀû ÇÃ·¹ÀÌ¾î Á¦¾î.*/
function fChange2(data)
{
	document.frmFORM.mediaPlayer2.FileName=data;
}

function fStop2()
{
	document.frmFORM.mediaPlayer2.Stop();
	//document.frmFORM.mediaPlayer.src = 'images/default_movie.gif';
}
function fPause2()
{
	document.frmFORM.mediaPlayer2.Pause();
}
function fPlay2()
{
	document.frmFORM.mediaPlayer2.Play();
}
/* »ç¾÷½ÇÀû ÇÃ·¹ÀÌ¾î Á¦¾î.*/

function fGoCommingsoon()
{
	alert("ÁØºñÁß ÀÔ´Ï´Ù.")
	return;
}

function fGoRND()
{
	window.open("http://dro.poscoenc.com/Main.aspx")
//alert("ÁØºñÁß ÀÔ´Ï´Ù.")
}

// ÆË¾÷Ã¢ °¡¿îµ¥ ¶ç¿ì±â.
var win = null; 
function NewWindow(mypage,myname,w,h,scroll)
{ 
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' ;
	win = window.open(mypage,myname,settings) 
	win.focus();
} 

function FixLayer(e, top , gubun) {

	var xMax = document.body.clientWidth;
	var yMax = document.body.clientHeight;

	var xOffset;
	if (gubun=="1")
	{
		xOffset= (xMax)/2-490;
	} 
	else {
		xOffset= (xMax)/2-150;
	}

	var yOffset = (yMax)/2+10; 
	//var divMenu = eval("document.all.POPUP1_" + e).style;
	var divMenu = document.getElementById("postLayer").style;
		
	divMenu.left = xOffset;
	divMenu.top = top;
}
