function chintaiSerch(){
	$('sb').action = "list.php";
	$('sb').method = "get";
	$('sb').submit();
}
function formCorrect(){
	$('mailForm').action = "form.php#form_title02";
	$('mailForm').method = "post";
	$('mailForm').submit();
}
function formSubmit(){
	$('mailForm').action = "send.php";
	$('mailForm').method = "post";
	$('mailForm').submit();
}
function judgeGood(id){
	var a = new Ajax.Updater("number","g.php",
			{
			"method": "post","parameters": "id="+id,
			onSuccess: function(request){},
			onComplete: function(request){},
			onFailure: function(request){alert('false'); },
			onException: function (request){alert('error');}
			}
		);
}
function comSmt(id){
	var uname= $('uname').value;
	var com = $('com').value;
	var a = new Ajax.Updater("comment_in","c.php",
			{
			"method": "post","parameters": "id="+id+"&uname="+uname+"&com="+com,
			onSuccess: function(request){},
			onComplete: function(request){},
			onFailure: function(request){alert('false'); },
			onException: function (request){alert('error');}
			}
		);
}

function postInq(){
	var uname= $('inq_uname').value;
	var email = $('inq_email').value;
	var com = $('inq_question').value;
	var bid = $('inq_bukken_id').value;
	var type = $('inq_bukken_type').value;
	var a = new Ajax.Updater("single_question","conf.php",
			{
			"method": "post","parameters": "bid="+bid+"&uname="+uname+"&com="+com+"&email="+email+"&type"+type,
			onSuccess: function(request){},
			onComplete: function(request){},
			onFailure: function(request){alert('false'); },
			onException: function (request){alert('error');}
			}
		);
}

function get_shinchiku(code){
	var shinchiku_file;
	shinchiku_file = "./shinchiku_html/" + code + ".html";
	var a = new Ajax.Updater("shinchiku_content",shinchiku_file,
			{
			"method": "get",
			onSuccess: function(request){scrollTo(0,0);},
			onComplete: function(request){},
			onFailure: function(request){alert('false'); },
			onException: function (request){alert('error');}
			}
		);
}

s=0;
function menu_switch(){

	if(s==0){s=1;}else{s=0;}
	if(s){
		new Effect.SlideDown("equiplist", { from:0.1,to:1.0,delay:0,fps:60,duration:0.3});
	}else{
		new Effect.SlideUp("equiplist", { from:0.1,to:1.0,delay:0,fps:60,duration:0.3});
	}
}

sw=0;
function search_switch(){
	if(sw==0){sw=1;}else{sw=0;}
	if(sw){
		new Effect.SlideDown("search_main", { from:0.1,to:1.0,delay:0,fps:60,duration:0.3});
	}else{
		new Effect.SlideUp("search_main", { from:0.1,to:1.0,delay:0,fps:60,duration:0.3});
	}
}
page=1;
function execute(p) {
	var a = new Ajax.Request(
			"t.php",
		{
			"method": "get",
			"parameters": "p="+p,
			onSuccess: function(request) {	},
			onComplete: function(request) {
				req = request.responseText;
				$('newList').innerHTML += req;
				columnAnimation(p);
				page=page+1;
			},
			onFailure: function(request) {
				alert('読み込みに失敗しました');
			},
			onException: function (request) {
				alert('読み込み中にエラーが発生しました');
			}
		}
	);
}
function columnAnimation(p){
	var addColumn = "newList"+p;
	if($(addColumn)){
		new Effect.BlindDown(addColumn, {from:0.1,to:1.0,delay:0,fps:60,duration:0.5} );
	}
}
function init(){
	$("equiplist").style.display='none';
	new Event.observe('eqmenu', 'click',menu_switch);
	if($("search_main")!==null){
		$("search_main").style.display='none';
		new Event.observe('search_title', 'click',search_switch);
	}
}

window.onload = function(){init();}