function checkLength(strLine,strLenCnt){
    var ix_str,strcnt=0;
    for(ix_str=0;ix_str<strLine.length;ix_str++){
        if(escape(strLine.charAt(ix_str)).length >= 4 ) strcnt+=2;
        else strcnt++;
    }
    
    if(strcnt>strLenCnt){
        return false;
    }else{
        return true;
    }
}

function wc(strLine){
    var ix_str,strcnt=0;
    for(ix_str=0;ix_str<strLine.length;ix_str++){
        if(escape(strLine.charAt(ix_str)).length >= 4 ) strcnt+=2;
        else strcnt++;
    }

    return strcnt;
}



function wc2(str){
  var bc=0;
  for(var i=0;i<str.length;i++){
    if(str.charCodeAt(i)<0x100){
      // case: ascii character.
      bc+=1;
    }else{
      // case: double byte character.
      bc+=2;
    }
  }
  return bc;
}

function loginOpen(id){
    if (id ==1){	
        url = "http://www.jp.real.com/login/index.htm";
	//url = "/login/index.htm";
	w=480;
	h=360;
	sr="no";

    }else if (id==2){
	url = "https://account.real.com/acct/create_newacct.html?language=JP";
	//url = "http://www.jp.real.com/downloadRP/download1.html";
	w=780;
	h=550;
	sr="yes";

    }else if (id==3){
        url = "http://www.jp.real.com/downloadRP/download1.html";
        w=480;
        h=360;
        sr="no";
    }

	/*if (id==2){
	    if (confirm("Please download RealPlayer in order to get free Login ID. Do you want to install RealPlayer now?.")){
		window.open(url,null,"top=150,left=150,height=366,width=500,status=no,toolbar=no,menubar=no,location=no,scrollbars="+sr+",resizable=no");
	    }
	}else{*/
	    window.open(url,null,"top=150,left=150,height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,scrollbars="+sr+",resizable=no");

	//}
	
}
