
function aweb_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.aweb_pgW=innerWidth; document.aweb_pgH=innerHeight; onresize=aweb_reloadPage; }}
else if (innerWidth!=document.aweb_pgW || innerHeight!=document.aweb_pgH) location.reload();
}
aweb_reloadPage(true);
// -->
function aweb_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=aweb_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function aweb_showHideLayers() { //v3.0
var i,p,v,obj,args=aweb_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=aweb_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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];}}
 createDOMSearchForm();
}

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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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 LinkSelect(form, sel)
{
	adrs = sel.options[sel.selectedIndex].value;
	if (adrs != "-" ) location.href = adrs;
}

function createDOMSearchForm()
{
	var obj_body;
	if (location.href.match(/\.jp\/index|.jp\/$|\.jp\/e\/|\.cgi|save_index\.php|\/service_search\/|\/administrator\/|\/magma\//i)) return "is not second page";
	if (!document.getElementsByTagName && !document.createElement) return "is not DOM elements";
	
	var obj_body = document.getElementsByTagName("body")[0];
	if (!obj_body || !obj_body.appendChild) return "is not DOM creation";
	
	var obj_divcov = document.createElement("div");
	var obj_div    = document.createElement("div");
	var obj_form   = document.createElement("form");
	var inp_word   = document.createElement("input");
	var inp_submit = document.createElement("input");
	var ACTION = "http://www.jmac.co.jp/cgi-bin/namazu.cgi";

	obj_div.style.position = "absolute";
	obj_div.style.top      = "56px";
	obj_div.style.left     = "0px";
	obj_div.style.width    = "100%";
	obj_div.style.zIndex   = "0";
	obj_div.innerHTML = (""
		+'<table align="center" border="0" cellpadding="0" cellspacing="0" width="780" height="40">'
		+'<tr><td height="40"><a href="http://'+document.domain+'/"><img src="/img/spacer.gif" border="0" width="133" height="40"></a></td>'
		+'<td align="right" valign="top">'
		+'<form style="margine:0" name="searchform" action="'+ACTION+'" method="GET">'
		//+'<span class="s">'+unescape("%u30B5%u30A4%u30C8%u5185%u691C%u7D22")+'</span>'
		+'<input type="text" name="query" size="20" value="'+document.domain+'">'
		+'<input type="submit" value="'+unescape("%u691C%u7D22")+'">'
		+'<input type="hidden" name="whence" value="0">'
		+'<input type="hidden" name="idxname" value="jmac">'
		+'<input type="hidden" name="idxname" value="gpc">'
		+'<input name="reference" type="hidden" value="off">'
		+'<input name="max" type="hidden" value="20">'
		+'<input name="result" type="hidden" value="normal">'
		+'<input name="sort" type="hidden" value="score">'
		+'</form>'
		+'</td><td><img src="/img/spacer.gif" width="4" height="1" alt=""></td></tr></table>'
	);
	//obj_body.appendChild(obj_div);

	return "runable DOM";
}
if (window.onload == null)
{
	window.onload = createDOMSearchForm;
}

function FlashView(filename,width,height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write(' <param name="movie" value="' + filename + '">');
	document.write(' <param name="quality" value="high">');
	document.write(' <embed src="' + filename + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + ' " height="' + height + '"></embed>');
	document.write('</object>\n');
}
