function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

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

function 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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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


// スワップイメージ
function ImageSwaping(img) {
	obj = document.getElementById("image");
	obj.src = img;
//	clearTimeout(timer);
//	timer=setTimeout('DefaultImage()',5000);
}

function orderForm(){
// 入力させる順番に","で区切ってインプットタグのネーム属性値を追加
	formlist = new Array("","");
	for(i=0; i<formlist.length - 1; i++) {
		if(document.inputForm.elements[formlist[i]].value != "displayfixed") {
			document.inputForm.elements[formlist[i+1]].disabled = true;
		} else {
			document.inputForm.elements[formlist[i+1]].disabled = false;
		}
	}
}
//function orderForm(){

//}

function display() {
	var fdv;
	var i;
	if (document.f1.dp.length) {
		for (i = 0; i < document.f1.dp.length; i++) {
			if (document.f1.dp[i].checked) {
				dpvalue = document.f1.dp[i].value;
//				break;
			}
		}
	} else {
		if (document.f1.dp.checked) {
			dpvalue = document.f1.dp.value;
//			break;
		}
	}
	fdv = dpvalue;
	if (fdv != "displayfixed") {
		document.all.fixednum.style.visibility = "hidden";
	} else {
		document.all.fixednum.style.visibility = "visible";
	}
}

function flash(swf,width,height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="top" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="movie" value="'+swf+'">');
	document.write('<param name="quality" value="best">');
	document.write('<embed src="'+swf+'" quality="best" wmode="transparent" width="'+width+'" height="'+height+'" name="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
}

function clearBox(obj) {
	var cearing = true;
	if (cearing) {
		obj.value = "";
	}
	cearing = false;
}
function limitter(obj) {
	var substring = '';
	substring = obj.value;
	if (substring.length > 6000) {
		obj.value = substring.substr(0, 6000);
	}
}

function winopen(url,name,w,h){
	width=w;
	height=h;
	x=(screen.availWidth/2) - (w/2);
	y=(screen.availHeight/2) - (h/2);
	window.open(url,name,'location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+',left='+x+',top='+y);
}

var V_scrollstep = 1;
function SCROLL2TOP() {
	if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat"){
		var V_scrollposition = document.body.parentNode.scrollTop;
	}else{
		var V_scrollposition = document.body.scrollTop;
	}
	if(V_scrollstep < 50 && V_scrollposition) {
		V_scrollposition = (V_scrollposition > 2) ? Math.ceil(V_scrollposition*.2) : 1;
		V_scrollstep++;
		scrollBy(0,-V_scrollposition);
		setTimeout("SCROLL2TOP()",10);
	}else{
		scrollTo(0,0);
		V_scrollstep = 1;
	} 
}
function SelectOption(opt) {
	location.href = opt.options[opt.selectedIndex].value;
}
