	function classChange()
	{
		var obj = document.getElementById('active_1');
		obj.className = 'active';
	}
	
	function classChangeOther(i)
	{
		var activeClass = 'active_' + i;
		var obj = document.getElementById(activeClass);
		obj.className = 'active';
		
		for(x = 1;x < 11;x++)
		{
			activeClass = 'active_' + x;
			obj = document.getElementById(activeClass);
			if( obj && x != i )
			{
				obj.className = activeClass;
			}
		}
	}

	function rewriteDiv( url, query, div_id )
	{
		var req = new ajaxObject(url);
		req.update(query);
		req.callback = function(responseText)
		{
			document.getElementById(div_id).innerHTML  = responseText;
			//document.getElementById(div_id).className = 'callme_clicked';
		}
		req.update();
	}

	function eraseDefault(obj)
	{
		if ( obj.value == obj.defaultValue )
		{
			obj.value = "";
		}
	}

	function eraseColor(obj)
	{
		obj.className = "";
	}

	function submitImage()
	{
	  document.ucsForm.submit();
	}

	function mCng(v)
	{
		//alert(v);
		if( !v )
		{
			//document.getElementById("carname_text").value = "";
			document.ucsForm.__Keyword.disabled = false;
			document.ucsForm.__Keyword.style.backgroundColor='#FFFFFF';
			rewriteDiv('./SendCarNameOption.php','__Manufacturer=', 'carNameOpt');
		}
		else
		{
			//document.getElementById("carname_text").value = "";
			//document.getElementById("carname_text").className = "";
			//document.ucsForm.__Keyword.disabled = true;
			//document.ucsForm.__Keyword.style.backgroundColor='#D4D0C8';
			rewriteDiv('./SendCarNameOption.php','__Manufacturer=' + v, 'carNameOpt');
		}
	}

	function nCng(v)
	{
		//alert(v);
		if( !v && v != undefined )
		{
			document.getElementById("carname_text").value = "";
			document.ucsForm.__Keyword.disabled = false;
			document.ucsForm.__Keyword.style.backgroundColor='#FFFFFF';
		}
		else
		{
			document.getElementById("carname_text").value = "";
			document.getElementById("carname_text").className = "";
			document.ucsForm.__Keyword.disabled = true;
			document.ucsForm.__Keyword.style.backgroundColor='#D4D0C8';
		}
	}



	function chkHighLow( sw, reg, op )
	{
	
		if( sw == '_P_' )
		{
			var objL = document.ucsForm.__PriceRangeLow;
			var objH = document.ucsForm.__PriceRangeHigh;
		}
		if( sw == '_N_' )
		{
			var objL = document.ucsForm.__NenshikiRangeLow;
			var objH = document.ucsForm.__NenshikiRangeHigh;
		}
		var vl  = objL.options[objL.selectedIndex].value;
		var vh  = objH.options[objH.selectedIndex].value;

		if( vl != '' && vh != '' && ( parseInt( vl ) > parseInt( vh ) ) )
		{
			alert( '下限と上限が逆転しています。' );
			if( !reg )
			{
				objL.selectedIndex = 0;
				objH.selectedIndex = 0;
				objL.focus();
			}
			else
			{
				if( op == '_L_' )
				{
					objL.selectedIndex = 0;
					objL.focus();
				}
				if( op == '_H_' )
				{
					objH.selectedIndex = 0;
					objH.focus();
				}
			}
			return false;
		}
		return true;
	}

//

	function sendAjax( url, query )
	{
		var req = new ajaxObject(url); // オブジェクト初期化
		req.update(query);
	}

	function ajaxObject( url, callbackFunction )
	{
		var that = this;
		this.updating = false;
		this.abort = function()
		{
			if( that.updating )
			{
				that.updating = false;
				that.AJAX.abort();
				that.AJAX = null;
			}
		}
		
		this.update = function( passData, postMethod )
		{
			if( that.updating )
			{
				return false;
			}
			that.AJAX = null;

			if( window.XMLHttpRequest )
			{              
				that.AJAX = new XMLHttpRequest();
			}
			else
			{
				that.AJAX = new ActiveXObject( "Microsoft.XMLHTTP" );
			}

			if( that.AJAX == null )
			{
				return false;
			}
			else
			{
				that.AJAX.onreadystatechange = function()
				{
					if( that.AJAX.readyState == 4 )
					{             
						that.updating = false;
						that.callback( that.AJAX.responseText, that.AJAX.status, that.AJAX.responseXML );
						that.AJAX = null;
					}
				}
				
				that.updating = new Date();
				if( /post/i.test( postMethod ) )
				{
					var uri = urlCall;
					//var uri = + '?' + that.updating.getTime();
					that.AJAX.open( "POST", uri, true );
					that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					that.AJAX.setRequestHeader("Content-Length", passData.length);
					that.AJAX.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
					that.AJAX.send( passData );
				}
				else
				{
					var uri = urlCall + '?' + passData;
					//var uri = + '?' + passData + '&amp;timestamp=' + (that.updating.getTime());
					that.AJAX.open( "GET", uri, true );
					that.AJAX.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
					that.AJAX.send(null);
				}
				return true;
			}
		}
		var urlCall = url;
		this.callback = callbackFunction || function () { };
	}