function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if(a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n,d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function numf(s) {
	re=/([0-9]+)([0-9]{3})/;if(re.test(s=s.toString().replace(re,"$1,$2")))s=numf(s);
	return s;
}

function num(s) {
	if(s=="-"||s=="")s="0";return parseInt(s.replace(/[,-]/,""),10);
}

function fill(n,l,c) {
	if(c==undefined)c="0";for(var i=l-String(n).length;i>0;i--)n=c+String(n);return n;
}

function gi(id) { return document.getElementById(id); }
function gn(id) { return document.getElementsByName(id); }

MM_preloadImages('/images/navi01r.gif','/images/navi02r.gif','/images/navi03r.gif','/images/navi07r.gif');

function ob(url) {
	var opt,winname=ob.arguments.length>1?ob.arguments[1]:"_blank";
	if(ob.arguments.length>2)opt=ob.arguments[2];
	else {
		w=Math.round(window.screen.availWidth*0.9);h=Math.round(window.screen.availHeight*0.9);
		if(w>1400)w=1400;if(h>900)h=900;
		opt=new Array();
		opt.push("width="+w);opt.push("height="+h);
		opt.push("left="+Math.round((window.screen.availWidth-w)*0.5));
		opt.push("top="+Math.round((window.screen.availHeight-h)*0.3));
		opt.push("resizable=yes");
		opt=opt.join(",");
	}
	var w=window.open(url,winname,opt);
	return false;
}

function addstring() {
	document.forms[0].q.value='site:www.wisebook.jp '+document.forms[0].q.value;return true;
}

function ga(n) {
	location.href=location.href.replace(location.hash,"")+n;
}

function html_entity_decode(str) {
	var ta=document.createElement("TEXTAREA");ta.innerHTML=str;return ta.value;
}

var tween_width_obj;
function tween_bar(id, p, t, e) {
	if (e == undefined) e = 2;
	if (tween_width_obj) tween_width_obj.stop();
	w = parseInt(gi(id).style.width, 10);
	if (isNaN(w)) w = 1;
	tween_width_obj = new Tween(gi(id).style, "width", Tween.regularEaseIn, w, Math.round(p / t * 100), e, "%");
	tween_width_obj.start();
}

var noop_timeout=5*60*1000;
var noop_count=0;
function noop() {
	var img=new Image;img.src="/member/noop/"+noop_count++;
	setTimeout("noop()",noop_timeout);
}

noop();

if(!Array.indexOf)Array.prototype.indexOf=function(obj,start){for(var i=(start||0);i<this.length;i++)if(this[i]==obj)return i;return -1;};
if(!Array.filter)Array.prototype.filter=function(func){var a=new Array;for(var i=0;i<this.length;i++)if(func(this[i],i,this))a.push(this[i]);return a;};

