var Gmap=null;
var Gmap_w=0;
var Gmap_h=0;
var TBA=null;

function outEki(pg){
try{
	out_footer();
	set_bnr('js_bnrR1',BnrR_1);
	set_iframe_url('AdsG_w','/ads/google/NewJRDResultBannerNoriBlue.html',480,60);
	set_iframe_url('AdsG_b','/ads/google/NewJRDRectangle.html',300,250);
	if(pg==3) set_iframe_url('AdsG_r','/ads/google/NewJRDTopButtonNoriBlue.html',125,125); 
	else set_iframe_url('AdsG_r','/ads/google/NewJRDWskyscp.html',160,605);
}catch(e){}
}

function InitEki(){
try{
	var tbo=document.getElementById("search_tab");
	if(tbo)TBA=tbo.getElementsByTagName("a");
	if( document.fm_eki.pg.value ) tabEki(document.fm_eki.pg.value);
}catch(e){}
}

function tabEki(no){
try{
	if( TBA==null ) return;
	//if( TBA==null || document.getElementById('Stb'+no).className=='on') return;
	for(var i=0,l=TBA.length;i<l;i++) TBA[i].className='';
	document.getElementById('Stb'+no).className='on';
	document.fm_eki.pg.value=no;
}catch(e){}
}

function map_p(xx,yy,f){
try{
	if(f>=0){ var o=document.getElementById("exit"+f); if(o)o.focus(); }
	if(Gmap==null){return;}
	if(xx==0 || yy==0){Gmap.clearOverlays(); return;}
	var m = new GMarker(new GPoint(xx,yy)); var c = new GLatLng(yy,xx);
	var mxy = Gmap.fromLatLngToContainerPixel(c);Gmap.clearOverlays();
	if(mxy.x < 60 || mxy.x > Gmap_w || mxy.y < 60 || mxy.y > Gmap_h ){ Gmap.panTo(c,null); }
	Gmap.addOverlay(m);
}catch(e){}
}
function InitMap(w,h,xx,yy){
try{
	if (GBrowserIsCompatible()) {
		Gmap = new GMap2(document.getElementById("map"));
		Gmap.setCenter(new GLatLng(yy,xx),15);
		Gmap.addControl(new GLargeMapControl());
		Gmap.addControl(new GMapTypeControl());
		Gmap_w=w-60;
		Gmap_h=h-60;
	}
}catch(e){}
}

function submitEki(f){
try{
	if( chckFm1(f)==false ) return false;
	var no=f.pg.value;
	if( no==5 ){
		window.open("about:blank","ekibenWin",'width=450, height=650, menubar=no, toolbar=no, scrollbars=yes');
		f.target = "ekibenWin";
	}else if(no=='4'){ f.target="_blank"; 
	}else{ f.target="_self"; }
}catch(e){}
}

