

/* --------------------------------------------------------
 *
 * Twitteen表示列切替
 *
 * -------------------------------------------------------- */
function setViewRow () {
	var type = $("input:radio[name='type']:checked").val();
	if ( type == "1" ) {
		$(".rAccount").show();
		$(".rKeyword").hide();
	} else if ( type == "2" ) {
		$(".rAccount").hide();
		$(".rKeyword").show();
	}
}

/* --------------------------------------------------------
 *
 * Twitteenコード生成
 *
 * -------------------------------------------------------- */
function getTwitteenCode () {
	var type         = $("input:radio[name='type']:checked").val();
	var account      = $("#account").val();
	var keyword      = $("#keyword").val();
	var view         = $("#view").val();
	var twitteentype = $("input:radio[name='twitteentype']:checked").val();
	var tweetcolor   = $("#tweetcolor").val();
	var timecolor    = $("#timecolor").val();
	var reply        = $("input:radio[name='reply']:checked").val();
	var reverse      = $("input:radio[name='reverse']:checked").val();
	var datetype     = $("input:radio[name='datetype']:checked").val();
	var elements     = $("#elements").val();
	
	if ( type == "1" ) {
		if ( account == "" ) { alert("アカウント名が入力されていません。"); return false; }
	} else if ( type == "2" ) {
		if ( keyword == "" ) { alert("キーワードが入力されていません。"); return false; }
	}
	
	var flashvars = "";
	if ( type == "1" ) {
		flashvars += "account=" + account;
	} else if ( type == "2" ) {
		flashvars += "words=" + keyword;
	}
	flashvars += "&view=" + view + 
	             "&reply=" + reply + 
	             "&timecolor=" + timecolor + 
	             "&tweetcolor=" + tweetcolor +
	             "&type=" + twitteentype + 
	             "&reverse=" + reverse + 
	             "&datetype=" + datetype + 
	             "&elements=" + elements;
	
	var code = "";
	code += "<!-- Twitteen v2 Start -->\r\n";
	code += "<object id=\"" + elements + "\" width=\"160\" height=\"100\" type=\"application/x-shockwave-flash\" data=\"http://www.clover-box.net/Twitteen/twitteen2.swf\">\r\n";
	code += "  <param value=\"http://www.clover-box.net/Twitteen/twitteen2.swf\" name=\"movie\">\r\n";
	code += "  <param value=\"" + flashvars + "\" name=\"FlashVars\">\r\n";
	code += "  <param value=\"transparent\" name=\"wmode\">\r\n";
	code += "  <param name=\"allowScriptAccess\" value=\"always\">\r\n";
	code += "</object>\r\n";
	code += "<!-- Twitteen v2 End -->\r\n";
	
	$("#code01").val( code );
}


