/*---------------------------------------------------------------------------
**	
**	プログラム名：【GJ!】Javascrpitインターフェイス
**	rev			:0.90
**	製作者		：HEX68
**	Website		：http://hmlab.info/minor/
**	Date		：2008/01/18
**
**---------------------------------------------------------------------------*/

//【GJ!】PHPスクリプトへのパス
URL = "http://hmlab.info/minor/php/gj_test/gj.php";

/*---------------------------------------------------------------------------
**	
**	ウェブ【GJ!】PHPへのリクエストメソッド
**
**---------------------------------------------------------------------------*/
function goodjob(cpageurl,cpagename)
{
	param = "pageurl=" + cpageurl + "&pagename=" + cpagename + "&cache=" + (new Date()).getTime();
	
	mess_id = cpageurl + "_gj_message";
	new Ajax.Request(URL,{
			method:'get',
			parameters:param+"&mode=gj" + "&gj_message=" + $(mess_id).value,
			onComplete:function(e)
			{
				$(mess_id).value = "";
				$(mess_id).style.visibility = "visible";
				
				
				showbutton(cpageurl,cpagename,1);
			},
			onException:function(e)
			{

			}
		}
	);
	
}

/*---------------------------------------------------------------------------
**	
**	拍手ボタンの描画メソッド
**
**---------------------------------------------------------------------------*/
function showbutton(cpageurl, cpagename, cbutton)
{
	address = URL + "?pageurl=" + cpageurl + "&pagename=" + cpagename + "&button=" + cbutton + "&mode=button" +"&cache=" + (new Date()).getTime();
	$(cpageurl).src = address;
}


