	this.URLString = "";

	function searchFocus(searchid){
    var searchval = document.getElementById(searchid).value;
    	if(searchval=='検索キーワード'){
    		document.getElementById(searchid).value="";
    	}
    }
	function IsNullString(string)
	{
        for(var i=0; i<string.length; i++)
                if(string.charAt(i)!=' ' && string.charAt(i)!='\r' && string.charAt(i)!='\n'
			&& string.charAt(i)!='\t' && string.charAt(i)!='\b') return false;
        return true;
	}    
    function checkQuery(searchid){
        var searchval = document.getElementById(searchid).value;
    	if(IsNullString(searchval)){
    		alert("キーワードが入力されてません");
    		document.getElementById(searchid).focus();
    		return false;
    	}else if(searchval=='検索キーワード'){
    		alert('キーワードが入力されてません');
    		document.getElementById(searchid).focus();
    		return false;
    	}
    }
    
	function ajax_execute(id,url,name,value){
		this.URLString = "";
		for (i = 0; i < name.length; i++) {
			
			this.setVar(name[i], value[i]);
			
		}
		
		var myAjax = new Ajax.Updater(
				{success: id} , url, 
				{
						method: 'get',
						parameters: this.URLString, 
						onFailure: reportError
				});
	}
	function reportError(request)
	{
		alert('Sorry. There was an error.');
	}
	
	this.setVar = function(name, value){
		if (this.URLString.length < 3){
			this.URLString = name + "=" + value;
		} else {
			this.URLString += "&" + name + "=" + value;
		}
	}
	
