function getElem(id) {
	return document.getElementById(id);
}
function getElementOffset(elm, ax){
	var i ='offset'+ax.replace(/^./, ax.substring(0, 1).toUpperCase());
	var x =elm[i];
	while(elm =elm.offsetParent) x +=elm[i];
	return x;
}
function getElementSize(elm, ax) {
	return elm['offset'+ax.replace(/^./, ax.substring(0, 1).toUpperCase())];
}
function stylePsMotion(melm) {
	if(!melm.spsmid) melm.spsmid =new Object();
	
	this.startMotion =function(elm, ax, tg, dnm, spd, ref, aftFnc) {
		var x;
		if(ax == "left" || ax == "top") x =getElementOffset(elm, ax);
		if(ax == "width" || ax == "height") x =getElementSize(elm, ax);
		x =isNaN(x)? Number(x.split('px')[0]) : x;
		
		spd =(spd < 1)? 1 : spd;
		var ds =((tg -x) == 0)? 1 : (tg -x);
		var cut =spd *(ds /Math.abs(ds));
		var ad;
		
		var af =aftFnc? aftFnc : null;
		
		this.moveElementPos =function() {
			ds =tg -x;
			ad =(ds +cut) /dnm;
			if(Math.abs(ad) < Math.abs(ds)) {
				x +=ad;
				elm.style[ax] =x;
				elm[ax] =x;
			} else {
				clearInterval(melm.spsmid[ax]);
				elm.style[ax] =tg;
				elm[ax] =tg;
				if(aftFnc) ref[aftFnc](this);
			}
		};
		clearInterval(melm.spsmid[ax]);
		var self =this;
		melm.spsmid[ax] =setInterval(function() {self.moveElementPos();}, 10);
	};
}
function MotionElement(id) {
	var elm =getElem(id);
	this.motion_1 =function(ax, tg, dnm, spd) {
		var s =new stylePsMotion(elm);
		s.startMotion(elm, ax, tg, dnm, spd, this, "fin");
	};
	this.fin=function(){};
}

function getMotionElement() {
	this["brand_list"] =new MotionElement("brand_list");
}

function moveSwf2Height(tgh) {
	this["brand_list"].motion_1("height", tgh, 10, 10);
}
function search_shoplist(q){	
	var ws =new Array();
	ws[0] ="width=657";
	ws[1] ="height=500";
	ws[2] ="scrollbars=yes";
	ws[3] ="menubar=yes";
	ws[4] ="resizable=yes";
	window.open("http://www.flandre.ne.jp/shop/shop_list.php?" +q, "win1", ws );
	document.formA.submit();
}
