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_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_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_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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function wongoSub() { //Show-hide ¸Þ´º¿¡ °üÇÑ ½ºÅ©¸³Æ®
	var wongoChr = document.all.wongoChr.value
	if (wongoChr == "Close"){
		document.all.wongo.style.display = "" ;
		document.all.wongoChr.value = "Open"
	}
	else {
		document.all.wongo.style.display = "none" ;
		document.all.wongoChr.value = "Close"
	}
}

function travelSub() { //Show-hide ¸Þ´º¿¡ °üÇÑ ½ºÅ©¸³Æ® 2
	var travelChr = document.all.travelChr.value
	if (travelChr == "Close"){
		document.all.travel.style.display = "" ;
		document.all.travelChr.value = "Open"
	}
	else {
		document.all.travel.style.display = "none" ;
		document.all.travelChr.value = "Close"
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function change(){
	if(document.search.directGO.selectedIndex != 0)
		parent.location = document.search.options[document.search.directGO.selectedIndex].value ;
}

function erp(n,a)
{
  for(i=1;i<a+1;i++){
    t=eval("erp" + i);
    t.style.display='none';
  }
  n.style.display='block';
}

function Positive_event() {
	location.href='/event/open_event/event_main.asp';
//	location.href='www.yahoo.co.kr';
}

function delayCH() {
	location.href='/book/book_event.asp';
}
function Positive_Contents_view() {			//ÁÁÀº»ý°¢ ÇÃ·¡½Ã ³»¿ëº¸±â
	location.href='/positive/list.asp?a=1';
}
function Friend_Contents_view() {			//ÁÁÀºÄ£±¸ ÇÃ·¡½Ã ³»¿ëº¸±â
	location.href='/friend/list.asp?a=2';
}
function Together_Contents_view() {			//Çàº¹ÇÑ µ¿Çà ÇÃ·¡½Ã ³»¿ëº¸±â
	location.href='/together/list.asp?a=3';
}
function Book_Contents_view() {             //´ÜÇàº» »õ·Î³ª¿Â Ã¥
	location.href='/book/detail.asp?BookSQ=1067';
}

function Positive_order() {			//ÇÃ·¡½Ã Á¾Àº»ý°¢ Á¤±â±¸µ¶½ÅÃ»
	location.href='/products/subscription/order_01.asp?menu=positive';
}
function Friend_order() {			//ÇÃ·¡½Ã ÁÁÀºÄ£±¸ Á¤±â±¸µ¶½ÅÃ»
	location.href='/products/subscription/order_01.asp?menu=friend';
}
function Together_order() {			//ÇÃ·¡½Ã Çàº¹ÇÑµ¿Çà Á¤±â±¸µ¶½ÅÃ»
	location.href='/products/subscription/order_01.asp?menu=together';
}
function Book_sell() {			    //´ÜÇàº» ÁÖ¹®ÇÏ±â
	location.href='/products/subscription/book_cart.asp?BookSQ=1067';
}

function Positive_Book_view() {				//ÁÁÀº»ý°¢ ÇÃ·¡½Ã ÀüÀÚÃ¥º¸±â
	location.href='/products/subscription/ebook_order_02.asp?category=1';
}
function Friend_Book_view() {				//ÁÁÀºÄ£±¸ ÇÃ·¡½Ã ÀüÀÚÃ¥º¸±â
	location.href='/products/subscription/ebook_order_02.asp?category=2';
}
function Book_book_view() {
	location.href='/book/detail.asp?BookSQ=1066';
}

//function Together_Book_view() {				//Çàº¹ÇÑ µ¿Çà ÇÃ·¡½Ã ÀüÀÚÃ¥º¸±â
//	location.href='/products/subscription/ebook_order_02.asp?category=3';
//}
//function list_thingking_01() {		//ÁÁÀº»ý°¢ Çìµå¶óÀÎ ¸ñÂ÷ 6°³
//}
//function list_thingking_02() {
//}
//function list_thingking_03() {
//}
//function list_thingking_04() {
//}
//function list_thingking_05() {
//}
//function list_thingking_06() {
//}
//function list_together_01() {		//Çàº¹ÇÑ µ¿Çà Çìµå¶óÀÎ ¸ñÂ÷ 6°³
//}
//function list_together_02() {
//}
//function list_together_03() {
//}
//function list_together_04() {
//}
//function list_together_05() {
//}
//function list_together_06() {
//}
//function list_friend_01() {			//ÁÁÀºÄ£±¸ Çìµå¶óÀÎ ¸ñÂ÷ 6°³
//}
//function list_friend_02() {
//}
//function list_friend_03() {
//}
//function list_friend_04() {
//}
//function list_friend_05() {
//}
//function list_friend_06() {
//}


///////////////////////////////////////////


function cal_pre()
{        
        var tmpStr;

        tmpStr = document.input.bodyDS.value;
        cal_byte(tmpStr);
}

function cal_byte(aquery) 
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for (k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);
                if (escape(onechar) =='%0D') { } else if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
        }

//        document.input.remLen.value = tcount;
        if(tcount>500) {
                reserve = tcount-500;
                alert("³»¿ëÀº 500¹ÙÀÌÆ® ÀÌ»óÀº ÀÔ·Â ÇÏ½Ç¼ö ¾ø½À´Ï´Ù.\r\n ¾²½Å ³»¿ëÀº "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\r\n ÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù."); 
                cutText();
        return;
        }        

}

function cutText()
{
        nets_check(document.input.bodyDS.value);
}

function nets_check(aquery)
{

        var tmpStr;
        var temp=0;
        var onechar;
        var tcount;
        tcount = 0;

        tmpStr = new String(aquery);
        temp = tmpStr.length;

        for(k=0;k<temp;k++)
        {
                onechar = tmpStr.charAt(k);

                if(escape(onechar).length > 4) {
                        tcount += 2;
                } else {
                        // ¿£ÅÍ°ªÀÌ µé¾î¿ÔÀ»¶§ °ª(\r\n)ÀÌ µÎ¹ø½ÇÇàµÇ´Âµ¥ Ã¹¹øÂ° °ª(\n)ÀÌ µé¾î¿ÔÀ»¶§ tcount¸¦ Áõ°¡½ÃÅ°Áö ¾Ê´Â´Ù.
                        if(escape(onechar)=='%0A') {
                        } else {
                                tcount++;
                        }
                }

                if(tcount>500) {
                        tmpStr = tmpStr.substring(0,k);
                        break;
                }

        }
        document.input.bodyDS.value = tmpStr;
        cal_byte(tmpStr);

}

//////////////////////// ÀüÀÚÃ¥ ½ºÅ©¸³Æ® //////////////////////


function openwebBOOK(url)
{

	var BrowName = navigator.appName;
	var BrowVer =  navigator.appVersion;
	if(BrowName=="Microsoft Internet Explorer"){
		if(BrowVer.substring(BrowVer.indexOf("MSIE ")+5,BrowVer.indexOf("MSIE ")+6) >= 5){
			if(screen.width >= 1024){
				window.open("http://www.positive.co.kr"+ url,"","fullscreen,scrollbars,width=0,height=0");
			}
			else{
				alert("webBookÀº È­¸éÇØ»óµµ 1024¡¿768 ÀÌ»ó¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é È­¸é ÇØ»óµµ¸¦ Á¶Á¤ÇÏ½Å ÈÄ ÀçÁ¢¼ÓÇØ ÁÖ½Ã±â¹Ù¶ø´Ï´Ù.");
			}
		}
		else{
			alert("webBookÀº ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 5.0ÀÌ»ó¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯5.0ÀÌ»ó ¹öÀüÀ¸·Î ¾÷±×·¹ÀÌµå ÇÑÈÄ Á¢¼ÓÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}
	}
	else{
		alert("webBookÀº ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯·Î Á¢¼ÓÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}

}
//////////////////////// ÀüÀÚÃ¥ ½ºÅ©¸³Æ® //////////////////////





function AutoResize(img){ 
  foto1= new Image(); 
  foto1.src=(img); 
  Controlla(img); 
} 
function Controlla(img){ 
  if((foto1.width!=0)&&(foto1.height!=0)){ 
    viewFoto(img); 
  } 
  else{ 
    funzione="Controlla('"+img+"')"; 
    intervallo=setTimeout(funzione,20); 
  } 
} 
function viewFoto(img){ 
  largh=foto1.width+20; 
  altez=foto1.height+20; 
  stringa="width="+largh+",height="+altez; 
  finestra=window.open(img,"",stringa); 
} 
