
function wordWrap(){
/******
* wordWrap to firefox for big words
* Creative Commons license * Version: 1.0 - 26/04/2006
* Autor: Micox - Nairon J.C.G - micoxjcg@yahoo.com.br - http://elmicoxcodes.blogspot.com
* Uso: call the function on onload of body element.
* put the class "word-wrap" on elements to wordwrap
*******/
    var larg_total,larg_carac,quant_quebra,pos_quebra;
    var elementos,quem, caracs, texto, display_orig;

    elementos = document.getElementsByTagName("p")

    for(var i=0; i<elementos.length;i++){
        if(elementos[i].className=="word-wrap"){
            quem = elementos[i];

            quem.innerHTML = String(quem.innerHTML).replace(/ /g,"¨ª")
            texto = String(quem.innerHTML)

            quem.innerHTML = " "

            display_orig = quem.style.display;
            quem.style.display="block";
            larg_oficial = quem.offsetWidth;
            //alert("oficial: " + larg_oficial)
            //alert("display " + quem.style.display)
            if(!document.all) quem.style.display="table";
            //alert("display " + quem.style.display)
            quem.innerHTML = texto;
            larg_total = quem.offsetWidth;
            //alert("total: " + larg_total)

            pos_quebra = 0;
            caracs = texto.length;
            texto = texto.replace(/¨ª/g," ")
            larg_carac = larg_total / caracs
            if(larg_total>larg_oficial){
                quant_quebra = parseInt(larg_oficial/larg_carac)
                quant_quebra = quant_quebra - (parseInt(quant_quebra/6)) //quanto menor o num, maior a garantia;
                quem.innerHTML = ""
                while(pos_quebra<=caracs){
                    quem.innerHTML = quem.innerHTML + texto.substring(pos_quebra,pos_quebra + quant_quebra) + " "
                    pos_quebra = pos_quebra + quant_quebra;
                }
            }else{
                quem.innerHTML = texto;
            }//end if do larg_total>larg_oficial
            quem.style.display = display_orig;
        }//end if do word wrap
    }//end for loop dos elementos
}



//µû¶ó´Ù´Ï´Â ¹è³Ê ½ºÅ©¸³Æ® ½ÃÀÛ
/*
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) {
                yMenuFrom   = document["divMenu"].top;
                yMenuTo     = top.pageYOffset + 10; //ÀÌ ¼ýÀÚ¸¦ ¼öÁ¤ÇÏ¸é À§ÂÊ¿©¹éÀ» Á¶Àý ÇÒ ¼ö ÀÖ½À´Ï´Ù(³×Ã÷ÄÉÀÌÇÁ)
        }
        else if ( bExplorer4plus ) {
                yMenuFrom   = parseInt (divMenu.style.top, 10);
                yMenuTo     = document.body.scrollTop + 10;//ÀÌ ¼ýÀÚ¸¦ ¼öÁ¤ÇÏ¸é À§ÂÊ¿©¹éÀ» Á¶Àý ÇÒ ¼ö ÀÖ½À´Ï´Ù(ÀÍ½ºÇÃ·Î·¯)
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }

        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divMenu"].top += yOffset;
                else if ( bExplorer4plus )
                        divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
        var y;
        if ( top.frames.length )
        if ( bNetscape4plus ) {
                document["divMenu"].top = top.pageYOffset + 135;
                document["divMenu"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                divMenu.style.top = document.body.scrollTop + 135;
                divMenu.style.visibility = "visible";
        }
        CheckUIElements();
        return true;
}
OnLoad();

//µû¶ó´Ù´Ï´Â ¹è³Ê ½ºÅ©¸³Æ® ³¡
*/

function bookmarksite(title,url) {
   if (window.sidebar) // firefox
   		window.sidebar.addPanel(title, url, "");
   else if(window.opera && window.print)
   { // opera       var elem = document.createElement('a');
      elem.setAttribute('href',url);
      elem.setAttribute('title',title);
      elem.setAttribute('rel','sidebar');
      elem.click();
   }

   else if(document.all) // ie
   window.external.AddFavorite(url, title);
}


//·Ñ¿À¹öÇßÀ»¶§ ½ÃÀÛ

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_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;
	//alert(a);
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
   	//alert(a[i]);
   	//alert(x.oSrc);
   	//alert(x.src);
   	//alert(a[i+2]);
   	document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
   }
}

//·Ñ¿À¹öÇßÀ»¶§ ³¡




//popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//popup


//jump menu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//jump menu
function goSite(URL){

	if ( URL == "" ) return;

	window.open(URL,"");

}

function  ChartLayDisp(tt){
  for(i=1;i<3;i++) {
    if(i==tt) {
      document.getElementById("ChartPOPTAB"+i).style.display="";
    }else {
      document.getElementById("ChartPOPTAB"+i).style.display="none";
    }
  }
}

function  PerfLayDisp(tt){
  for(i=1;i<3;i++) {
    if(i==tt) {
      document.getElementById("PerfPOPTAB"+i).style.display="";
    }else {
      document.getElementById("PerfPOPTAB"+i).style.display="none";
    }
  }
}

function  NoticeLayDisp(tt){
  for(i=1;i<4;i++) {
    if(i==tt) {
      document.getElementById("NoticePOPTAB"+i).style.display="";
    }else {
      document.getElementById("NoticePOPTAB"+i).style.display="none";
    }
  }
}

function  NewTitleLayDisp(tt){
  for(i=1;i<4;i++) {
    if(i==tt) {
      document.getElementById("NewTitleTAB"+i).style.display="";
    }else {
      document.getElementById("NewTitleTAB"+i).style.display="none";
    }
  }
}


function DataToggle() {
   var ct=document.getElementById("StatTab").style.display
   if(ct=="none") document.getElementById("StatTab").style.display="";
   else  document.getElementById("StatTab").style.display="none";
}

function setCookie (name, value, expires) {
  document.cookie = name + "=" + escape (value) +
    "; path=/; expires=" + expires.toGMTString();
}

function getCookie(Name) {
  var search = Name + "="
  if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é

      offset += search.length
      // set index of beginning of value

      end = document.cookie.indexOf(";", offset)
      // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤

      if (end == -1)
        end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
  }
  return "";
}


/*-----------------------------------------------------------------------------*/
// Æ¯¼ö¹®ÀÚ Ã¼Å©
// - obj : form name
/*-----------------------------------------------------------------------------*/
function inputCheckSpecial(obj){

	return true;











 var ft = "true";
  obj = obj.elements;
 for (var i = 0; i < obj.length; i++){

  if( obj[i].type == "text" ||obj[i].type == "password") {

  	if ( obj[i].name == "rlsdates"  ) continue;
  	if ( obj[i].name == "rlsdatee"  ) continue;

    var strobj = obj[i].value; //ÀÔ·Â°ªÀ» ´ãÀ»º¯¼ö.
    re = /[~!@\#$%<>^&*\()\-=+_\']/gi;

    if(re.test(strobj)){
   alert("Æ¯¼ö¹®ÀÚ(~!@\#$%<>^&*\()\-=+_\')¸¦  ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
   obj[i].value=strobj.replace(re,"");
   obj[i].focus();
   ft += ",false";
    }else {
   ft += ",true";
    }//end if

  }//end if
 }//end for

 if (ft.indexOf("false")!=-1){
  return false;
 }else{
  return true;
 }
}







// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,win,m,s){

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='FlashVars' value='page="+m+"&subNum="+s+"'/>"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}

function flashWrite2(id){
//	alert( id.innerHTML );
	 document.write(id.innerHTML);
	 id.id = '';
}
/**
 * quick link menu ¼ø¼­´ë·Î Á¤¸®
 */
function quicklink(num){
	//alert(num);
    switch(num){
    //HOME
    case "01" :
        location.href = "/barokey/barokey01.jsp"; break;
    case "02" :
        location.href = "/baromanag/manager01.jsp"; break;
	case "03" :
        location.href = "/baroinfo/baroinfo01.jsp"; break;
    case "04" :
        location.href = "/barocenter/barocenter01.jsp"; break;
    case "05" :
        location.href = "/baroconcord/baroconcord01.jsp"; break;
    case "06" :
        location.href = "#"; break;
    case "07" :
        location.href = "#"; break;
    case "08" :
        location.href = "#top"; break;

    }
    return;

}

/**
 * menu link menu ¼ø¼­´ë·Î Á¤¸®
 */
function menulink(num){
	//alert(num);
    switch(num){
    //HOME
    case "0100" :
        location.href = "/mucon_intro/mucon_intro_01.jsp"; break;
    case "0101" :
        location.href = "#"; break;
    case "0102" :
        location.href = "#"; break;
    case "0103" :
        location.href = "#"; break;
    case "0104" :
        location.href = "#"; break;
    case "0105" :
        location.href = "#"; break;
    case "0200" :
        location.href = "/music_chart/music_chart_00.jsp"; break;
    case "0201" :
        location.href = "#"; break;
    case "0202" :
        location.href = "#"; break;
    case "0203" :
        location.href = "#"; break;
    case "0204" :
        location.href = "#"; break;
	case "0300" :
        location.href = "/industry_trend/industry_trend_06.jsp"; break;
    case "0301" :
        location.href = "#"; break;
    case "0302" :
        location.href = "#"; break;
    case "0303" :
        location.href = "#"; break;
    case "0400" :
        location.href = "/perfor_info/perfor_info_02.jsp"; break;
    case "0401" :
        location.href = "#"; break;
    case "0402" :
        location.href = "#"; break;
    case "0403" :
        location.href = "#"; break;
    case "0404" :
        location.href = "#"; break;
    case "0405" :
        location.href = "#"; break;
    case "0500" :
        location.href = "/music_com/music_com_01.jsp"; break;
    case "0501" :
        location.href = "#"; break;
    case "0502" :
        location.href = "#"; break;
	case "0503" :
        location.href = "#"; break;
    case "0600" :
        location.href = "/album_info/album_info_01.jsp"; break;
    case "0601" :
        location.href = "#"; break;
    case "0602" :
        location.href = "#"; break;
    case "0603" :
        location.href = "#"; break;
    case "0604" :
        location.href = "#"; break;
    case "0605" :
        location.href = "#"; break;
    case "0606" :
        location.href = "#"; break;
    case "0607" :
        location.href = "#"; break;
	case "0700" :
        location.href = "#"; break;
    case "0701" :
        location.href = "#"; break;
    case "0702" :
        location.href = "#"; break;
    case "0703" :
        location.href = "#"; break;
    case "0704" :
        location.href = "#"; break;
    case "0705" :
        location.href = "#"; break;
    case "0706" :
        location.href = "#"; break;

    }
    return;

}

