// printGM streat view related functions

function dispStreetView(lat,lng) { 
	setDispID('streetView',1);
	setDispID('streetViewClose',1);
	var targetPoint  =  new GLatLng(lat, lng);
	var panoramaOptions  = { latlng:targetPoint };
	var tgtSV = new GStreetviewPanorama(document.getElementById('streetView'),panoramaOptions);
	GEvent.addListener(tgtSV, "error", handleNoFlash);
}

function handleNoFlash(errorCode) {
	setDispID('streetViewClose',0);//street view レイヤーを非表示に
	setDispID('streetView',0);//street view レイヤーを非表示に
	
	setDispID('mapoverlay',0);
	if (errorCode == 600) {// 未対応エリアの時のエラーナンバー
		document.getElementById('mapoverlay').innerHTML = 'ストリートビュー未対応の地域です';
	}
	if (errorCode == 603) {//FLASH_UNAVAILABLE
		document.getElementById('mapoverlay').innerHTML = "Flashをインストールしてください";
	}
	setDispID('mapoverlay',1);
	setTimeout("setDispID('mapoverlay',0)",3000);
}

function setDispID(id,type) {
	var obj = document.getElementById( id );
	obj.style.display = ( type ? 'block' : 'none' );
}

function dispMobileQR(prf,srl) {
	if(prf && srl) {
		var target = "http://www.10man-doc.co.jp/mobile/printGMmobile.php?q="+prf+"/"+srl;
		document.getElementById('mobileQR').innerHTML = '<img src="http://chart.apis.google.com/chart?chs=100x100&cht=qr&chl='+target+'" alt="QRcode" border="1" />';
	}
}

