<!--
//インラインフレームサイズ調整
function RemakeFrameHeight() {
	ParentIframeId = "doclist";
	if(parent && (parent != self) && ParentIframeId && parent.document.getElementById(ParentIframeId)) {
		if(document.all) {
			window.top.scrollTo(0,0);
			parent.document.getElementById(ParentIframeId).height = (document.body.scrollHeight + 2);
		} else {
			window.top.scrollTo(0,0);
			parent.document.getElementById(ParentIframeId).height = (document.body.offsetHeight + 2);
		}
	}else{
		window.open("http://www.tarikin.net/","_top","")
	}
}

//SUBMITボタン2度押し対応
var setbtn=0;
function checkbtn() {
	if(setbtn==0){
		setbtn=1;
	}else{
		return false;
	}
}

//カテゴリ追加
function addKeyword(categorystr) {
	categorystr=categorystr.replace(/&lt;/i , "<");
	categorystr=categorystr.replace(/&gt;/i , ">");
	categorystr=categorystr.replace(/&#39;/i , "\'");
	categorystr=categorystr.replace(/&quot;/i , "\"");
	categorystr=categorystr.replace(/&amp;/i , "\&");
	document.all.userkey.value=document.all.userkey.value + categorystr + " , ";
	return false;
}

//ビュー色配置
function transformView() {
	var tableElements = document.getElementsByTagName('table') ;
	var table = tableElements[tableElements.length - 1] ;
	//table.width = '100%' ;
	table.cellSpacing = '0' ;

	rows = table.getElementsByTagName("tr") ;
	var counter = 0
	for( i = 0; i <rows.length; i++) {
		//alert(rows.length);
		rows[i].bgColor = (i % 2 ? '#ffffff' : '#efefef') ;
	}
}
function cSendClap(threadno) {
	$.ajax( {
		type : "post",
		url : "/dev/Action.php",
		data : "action=contribute3&threadno=" + threadno,
		dataType : "html",
		success : function(data){
			$('#'+threadno).attr("value","Thanks!");
		}
	});
}
function cSendClapPage(threadno) {
	$.ajax( {
		type : "post",
		url : "/dev/Action.php",
		data : "action=contribute4&threadno=" + threadno,
		dataType : "html",
		success : function(data){

		}
	});
}
function inputPreview(){
	var textbody = encodeURIComponent(document.all.comment.value);
	w=window.open("about:blank","preview");
	$.ajax( {
		type : "post",
		url : "http://www.tarikin.net/dev/Action.php",
		data : "action=contribute5&comment=" + textbody,
		dataType : "html",
		success : function(data){
			w.document.write(data);
		}
	});
}
function inputURL(m) {
	var captext='';
	if (m==0){
		captext='挿入するURLを入力してください。';
		url = prompt(captext, "http://");
	}else if(m==1||m==2){
		captext='挿入する画像のURLを入力してください。';
		url = prompt(captext, "http://");
	}else if(m==3){
		captext='挿入するYouTube動画のURLを入力してください。';
		url = prompt(captext, "http://");
	}

	var textbody = document.all.comment;
	if(m==4){
		textbody.value=textbody.value + '[[clear]]';
	}else if (url) {
		if (m==0){
			textbody.value=textbody.value + '[[url=' + url +']]' + url + '[[/url]]';
		}else if(m==1){
			textbody.value=textbody.value + '[[img=' + url +']]';
		}else if(m==2){
			textbody.value=textbody.value + '[[imgc=' + url +']]';
		}else if(m==3){
			textbody.value=textbody.value + '[[ytube=' + url +']]';
		}
	}
}
// -->
