//****************************************　タブの展開　****************************************//

function tabutenkai() {
	act = document.myForm.act.value;

	tag = document.myForm.link_tag.value;
	tag=tag.slice(tag.indexOf('http://'));
	link_url=tag.substring(0,tag.indexOf('"'));

	tag=tag.slice(tag.indexOf('>')+1);
	link_title=tag.substring(0,tag.indexOf('</a>'));

	tag = tag.replace(link_title,"");
 	tag = tag.replace("</a>","");

	jstrlen(tag)
   	link_comment = ''; 
	if(len>10){
		pos1 = tag.indexOf('<');
		while (pos1 > -1) {
			pos2 = tag.indexOf('>');
			stk = tag.substring(pos1,pos2+1);
			tag = tag.replace(stk,"");
			pos1 = tag.indexOf('<');
		}

	    for(i=0; i<tag.length; i++){ 
	        text = escape(tag.substring(i, i+1)); 
	        if(text != "%0D" && text != "%0A"){ 
	            link_comment += tag.substring(i, i+1); 
	        } 
	    } 
	}

	if(act=="regist_admin"){
		document.myForm.site_name.value = link_title;
		document.myForm.comment.value = link_comment;
	}
	document.myForm.your_url.value = link_url;
}


function thisclear() {
	document.myForm.comment.value = '';
}

function jstrlen(str){
	len = 0;
	str = escape(str);
	for(i=0;i<str.length;i++,len++){
	if(str.charAt(i) == "%"){
		if(str.charAt(++i) == "u"){
			i += 3;
			len++;
		}
		i++;
	}
	}
	return len;
}
