
function loading_start() {
    document.getElementById('load_page').style.visibility = 'visible';
}

function loading_end() {
    document.getElementById('load_page').style.visibility = 'hidden';
}

function loading_start2() {
    document.getElementById('load_page2').style.visibility = 'visible';
}

function loading_end2() {
    document.getElementById('load_page2').style.visibility = 'hidden';
}

function open_help() {
    
	var html;
	
	html = '<a href="JavaScript:close_help()"><img src="http://hospital.accessgate.jp/image/cl_win.gif" border="0" align="right"></a>';
	html += '<div class="title"><strong>地図の操作方法</strong></div>';
	html += '<br>';
	html += '<strong>1.移動する</strong><br>';
	html += '<br>';
	html += '地図をドラッグ（地図をクリックしたままマウスを動かす）します。<br>';
	html += '<strong><br>';
	html += '2.拡大する（表示範囲を狭める）</strong><br>';
	html += '<br>';
	html += '地図左上のスライダーの目盛りを上方向にドラッグして移動させるか、 スライダーの上についている「＋（プラス）」ボタンをクリックします。<br>';
	html += '<br>';
	html += '<strong>3.縮小する（表示範囲を広げる）</strong><br>';
	html += '<br>';
	html += '地図左上のスライダーの目盛りを下方向にドラッグして移動させるか、スライダーの下についている「－（マイナス）」ボタンをクリックします。<br>';
	html += '<br>';
	html += '<strong>4.航空写真に切り替える<br>';
	html += '</strong><br>';
	html += '地図右上の「航空写真」ボタンをクリックします。<br>';
	html += '<br>';
	html += '<strong>5.地図に切り替える</strong><br>';
	html += '<br>';
	html += '地図右上の「マップ」ボタンをクリックします。<br>';
	html += '<br>';
	html += '<br>';
	html += '<div align="center">[ <a href="JavaScript:close_help()">閉じる</a> ]</div>';
	
	
	document.getElementById("help_window").innerHTML = html;
	document.getElementById('help_window').style.visibility = 'visible';
	
	
}

function close_help() {
    document.getElementById('help_window').style.visibility = 'hidden';
}

function open_othercity() {
	
	html = '<div align="right" style="clear:both;"><a href="JavaScript:close_othercity()"><img src="http://hospital.accessgate.jp/image/cl_win.gif" border="0"></a></div>';
	html += '<div class="title">'+ pname +'内のその他の市区町村</div>';
	
	html += '<iframe width="100%" height="100%" frameborder="0" src="http://hospital.accessgate.jp/include/othercity_window.php?pid=' + pid + '&kid=' + kid + '&cid=' + cid + '" scrolling="auto" padding="0" margin="0" allowtransparency="true"></iframe>';
	
	html += '<div align="center" style="clear:both;"><br>[ <a href="JavaScript:close_othercity()">閉じる</a> ]</div>';
	
	document.getElementById("othercity_window").innerHTML = html;
	
    document.getElementById('othercity_window').style.visibility = 'visible';
}

function close_othercity() {
    document.getElementById('othercity_window').style.visibility = 'hidden';
}

function open_menu() {
	
	html = '<a href="JavaScript:close_menu()"><img src="http://hospital.accessgate.jp/image/cl_win.gif" border="0" align="right"></a>';
	html += '<br>';
	html += '<a href="JavaScript:open_help()"><img src="http://hospital.accessgate.jp/image/menu_window/help.gif" alt="市区町村で絞り込む" hspace="1" border="0" /></a>';
	
	if(type == 'normal'){
	
	html += '<a href="JavaScript:open_othercity()"><img src="http://hospital.accessgate.jp/image/menu_window/other_city.gif" alt="内のその他の市区町村" hspace="1" border="0" /></a>';
	
	}
	
	html += '<a onMouseDown="open_list()" class="link"><img src="http://hospital.accessgate.jp/image/menu_window/mylist.gif" alt="マイリスト" hspace="1" border="0" /></a>';
	html += '<a href="JavaScript:open_search()"><img src="http://hospital.accessgate.jp/image/menu_window/kw_search.gif" alt="キーワード検索" hspace="1" border="0" /></a>';
	
    document.getElementById("menu_window").innerHTML = html;
	document.getElementById('menu_window').style.visibility = 'visible';
}

function close_menu() {
    document.getElementById('menu_window').style.visibility = 'hidden';
}

function open_search() {
    
	//if(location.search){
		
	var pram=location.search;
	
	//}	
	
	var html;
	
	html = '<a href="JavaScript:close_search()"><img src="http://hospital.accessgate.jp/image/cl_win.gif" border="0" align="right"></a>';
	html += '<div class="title"><strong>キーワード検索</strong></div><br />';
	html += '医療機関の名称や住所などのキーワードで検索<br /><br />';
	html += '<iframe width="285" height="65" frameborder="0" src="http://hospital.accessgate.jp/include/search_form.php' + pram + '" scrolling="no" padding="0" margin="0" allowtransparency="true"></iframe>';
	
	document.getElementById("search_window").innerHTML = html;
	document.getElementById('search_window').style.visibility = 'visible';
}

function close_search() {
    document.getElementById('search_window').style.visibility = 'hidden';
}

function main_body() {
    document.getElementById('main_body').style.visibility = 'visible';
}

function open_window2(url){
	
	popup=window.open(url);
	
}

function open_window(url){
	
	popup=window.open(url);
	
}


function open_list(title,messe,pointy,pointx) {
	
	bwser = getBrowser();
	//var agent=navigator.userAgent;
	//bwser = myAgent = navigator.userAgent;
	
	if(bwser == 'Microsoft Internet Explorer Version 7.0'){
	
		if(pointy){
		
		
				offY = document.body.scrollTop - 30;
				offX = (document.body.clientWidth / 2) - 250;
				
				//bigimage_window.style.left = offX;
				bigimage_window.style.left = pointx;
				bigimage_window.style.top = ( offY + pointy);
		
		}
		
	
	}else{
		
		
		if(pointy){
		
		
				offY = document.body.scrollTop - 30;
				offX = document.body.clientWidth / 3;
				
				bigimage_window.style.width = 480;
				bigimage_window.style.height = 60;
				bigimage_window.style.border = '#999999 1px solid';
				//bigimage_window.style.left = pointx;
				//bigimage_window.style.top = ( offY + pointy);
		
		}
	
	
	}
	
	
	html = '<div align="left">' + title + '</div>';
	html= '<div align="left"><img src="' + messe + '"></div>';
		
	document.getElementById("result").innerHTML = html;
	
	document.getElementById('detail_window').style.visibility = 'visible';
	
}

function close_list() {

    document.getElementById('detail_window').style.visibility = 'hidden';
}


function getBrowser() {

	myBsr   = navigator.appName;                     // ブラウザ名取得
	myAgent = navigator.userAgent;                   // エージェント取得
	myTop = myAgent.indexOf("Opera",0);              // OP チェック
	
		if (myTop == -1){                                // OPじゃない
		
			myTop = myAgent.indexOf("MSIE",0);               // IE チェック
			
				if (myTop == -1){                                // IEじゃない
				
				myTop = myAgent.indexOf("Mozilla/",0);        // NN チェック
				
					if (myTop == -1){                             // NNでもない
					
					myVersion = "";
					
					}else{                                        // NNだ!
					
					myLast = myAgent.indexOf(" ",myTop);
					myVer = myAgent.substring(myTop+8,myLast); // NNのバージョン切り取り
					myVersion = " Version " + myVer;
					
					}
				
				}else{                                           // IEだ!
				
				myLast = myAgent.indexOf(";",myTop);
				myVer = myAgent.substring(myTop+5,myLast);    // IEのバージョン切り取り
				myVersion = " Version " + myVer;
				
				}
			
			}else{                                              // OPだ!
			
			myBsr = "Opera";
			myLast = myAgent.indexOf(" ",myTop+6);
			myVer = myAgent.substring(myTop+6,myLast);       // OPのバージョン切り取り
			myVersion = " Version " + myVer;
			
		}
	
	browserversion = myBsr+myVersion;
	
	return browserversion;

}
