//物件リストのページング
function MovePage(pg){
	var iCurPage = 1;
	if( "" != document.paramform.pg.value ){
		iCurPage = parseInt( document.paramform.pg.value );
	}
	if( "undefined" != typeof document.paramform.orgpg ){
		if( "" != document.paramform.orgpg.value )
			iCurPage = parseInt( document.paramform.orgpg.value );
	}
	document.paramform.action = location.pathname;
	if( '+' == pg ){
		document.paramform.pg.value = iCurPage + 1;
	}
	else if( '-' == pg ){
		if( 1 < iCurPage )
			document.paramform.pg.value = iCurPage - 1;
		else
			document.paramform.pg.value = 1;
	}
	else{
		document.paramform.pg.value = pg;
	}
	var strPathName = location.pathname.toLowerCase();
	if(-1 != strPathName.indexOf("listmap.aspx")){
		ChangeList('pg');
	}
	else{
		document.paramform.submit();
	}
}
//キーワードのチェック
function CheckKeyword(key){
	if(0 == key.length) {
		return "1";
	}
	else if(100 < key.length ) {
		return "2";
	}
	return "0";
}
//トップへ戻る

function ToTop(){
	document.paramform.action = "top.aspx";
	document.paramform.submit();
}

function ToDetail(){
	document.paramform.action = "detailmap.aspx";
	document.paramform.submit();
}


//天気予報画面をポップアップする
function ToWeather(longitude, latitude, account, accmd){
	window.open('weather.aspx?'+"x"+"="+longitude+"&"+"y"+"="+latitude + "&account=" + account + "&accmd=" + accmd, '_blank', 'width=600,height=600,menubar=no,toolbar=no');
}

//ヘルプ画面をポップアップする
function ToHelp(){
	window.open('help.html', '_blank', 'width=600,height=600,menubar=no,toolbar=no, scrollbars=yes');
}

//凡例画面をポップアップする
function ToHanrei(account, accmd, page){
	window.open("hanrei.aspx?account=" + account + "&accmd=" + accmd + "&page=" + page, '_blank', 'width=600, height=600, menubar=no, toolbar=no, resizable=yes, scrollbars=yes');
}

//路線図凡例画面をポップアップする
function ToHanreiRosenzu(pagename){
	if(pagename == "hanrei_toukai.html"){
	window.open(pagename, '_blank', 'width=600, height=450, menubar=no, toolbar=no, resizable=no, scrollbars=no');
	}
	if(pagename == "hanrei_shutoken.html"){
	window.open(pagename, '_blank', 'width=600, height=700, menubar=no, toolbar=no, resizable=no, scrollbars=yes');
	}
	if(pagename == "hanrei_kansai.html"){
	window.open(pagename, '_blank', 'width=600, height=700, menubar=no, toolbar=no, resizable=no, scrollbars=no');
	}
}



/*
 * 変換関数(ORACLEでいうところのデコード関数)
 *
 * @param obj1 比較対象1
 * @param obj2 比較対象2
 * @param str1 出力対象1(一致時)
 * @param str2 出力対象2(不一致時)
 *
 */
function Decode(obj1,obj2,str1,str2){
	
	if(obj1==obj2){
		document.write( str1 );
	}else{
		document.write( str2 );
	}
}


/*
 * 変換関数(ORACLEでいうところのデコード関数)文字列変数で返す
 *
 * @param obj1 比較対象1
 * @param obj2 比較対象2
 * @param str1 出力対象1(一致時)
 * @param str2 出力対象2(不一致時)
 * @return 文字列
 *
 */
function Decodestr(obj1,obj2,str1,str2){
	
	return (obj1==obj2) ? str1 : str2;
}


/*
 * 変換関数(ORACLEでいうところのNVL2関数)
 *
 * 引数1の配列内の値に一つでもがNULL(空)でないものがあった場合は、引数2を書き出します。
 * 引数1の配列内の値がすべてNULL(空)の場合は、引数3を書き出します。
 *
 * @param obj1 対象文字列
 * @param str1 非NULL(空)時出力文字列
 * @param str2 NULL(空)時出力文字列
 *
 */
function DecodeArray(objArray, obj2 ,str1,str2){
	
	var flg = false;
	
	for(i=0;i<objArray.length;i++){
		
		if(objArray[i]==obj2){
			flg=true;
			break;
		}
	}
	
	if(flg){
		document.write( str1 );
	}else{
		document.write( str2 );
	}
}



/*
 * 変換関数(ORACLEでいうところのNVL関数)
 *
 * 引数1がNULL(空)でない場合は、引数1をそのまま書き出します。
 * 引数1がNULL(空)の場合は、引数2を書き出します。
 *
 * @param str1 比較対象､出力対象
 * @param str2 出力対象(NULL(空)時)
 *
 */
function Nvl(str1,str2){
	
	if(str1!=null && str1.length>0){
		document.write( str2 );
	}
}

/*
 * 変換関数(ORACLEでいうところのNVL関数)文字列変数で返す
 * (※document.writeが使えない環境用)
 *
 * 引数1がNULL(空)でない場合は、引数1をそのまま書き出します。
 * 引数1がNULL(空)の場合は、引数2を書き出します。
 *
 * @param str1 比較対象､出力対象
 * @param str2 出力対象(NULL(空)時)
 * @param id   出力セット先のID
 *
 */
function Nvlstr(str1,str2){
	
	return (str1!=null && str1.length>0) ? str2 : "";
}



/*
 * 変換関数(ORACLEでいうところのNVL2関数)
 *
 * 引数1がNULL(空)でない場合は、引数2を書き出します。
 * 引数1がNULL(空)の場合は、引数3を書き出します。
 *
 * @param obj1 対象文字列
 * @param str1 非NULL(空)時出力文字列
 * @param str2 NULL(空)時出力文字列
 *
 */
function Nvl2(obj,str1,str2){
	
	if(obj!=null && obj.length>0){
		document.write( str1 );
	}else{
		document.write( str2 );
	}
}

/*
 * 変換関数(ORACLEでいうところのNVL2関数)出力先指定版
 *
 * 引数1がNULL(空)でない場合は、引数2を書き出します。
 * 引数1がNULL(空)の場合は、引数3を書き出します。
 *
 * @param obj1 対象文字列
 * @param str1 非NULL(空)時出力文字列
 * @param str2 NULL(空)時出力文字列
 * @param id   出力セット先のID
 *
 */
function Nvl2Id(obj,str1,str2,id){
	
	if(obj!=null && obj.length>0){
		document.getElementById(id).innerHTML = str1;
	}else{
		document.getElementById(id).innerHTML = str2;
	}
}


/*
 * 変換関数(ORACLEでいうところのNVL2関数)
 *
 * 引数1の配列内の値に一つでもがNULL(空)でないものがあった場合は、引数2を書き出します。
 * 引数1の配列内の値がすべてNULL(空)の場合は、引数3を書き出します。
 *
 * @param obj1 対象文字列
 * @param str1 非NULL(空)時出力文字列
 * @param str2 NULL(空)時出力文字列
 *
 */
function Nvl2Array(objArray,str1,str2){
	
	var flg = false;
	
	for(i=0;i<objArray.length;i++){
		
		if(objArray[i].length>0){
			flg=true;
			break;
		}
	}
	
	if(flg){
		document.write( str1 );
	}else{
		document.write( str2 );
	}
	
}


/*
 * 変換関数(ORACLEでいうところのNVL2関数)出力先指定版
 * (※document.writeが使えない環境用)
 *
 * 引数1の配列内の値に一つでもがNULL(空)でないものがあった場合は、引数2を書き出します。
 * 引数1の配列内の値がすべてNULL(空)の場合は、引数3を書き出します。
 *
 * @param obj1 対象文字列
 * @param str1 非NULL(空)時出力文字列
 * @param str2 NULL(空)時出力文字列
 * @param id   出力セット先のID
 *
 */
function Nvl2ArrayId(objArray,str1,str2,id){
	
	var flg = false;
	
	for(i=0;i<objArray.length;i++){
		
		if(objArray[i].length>0){
			flg=true;
		}
	}
	
	if(flg){
		document.getElementById(id).innerHTML = str1;
	}else{
		document.getElementById(id).innerHTML = str2;
	}
	
}


/*
 * 指定のIDの要素を非表示にする
 *
 * @param id 対象ID
 *
 * @return result_flg 結果(true or false)
 *
 */
function DispNone( id ){
	
	var result_flg = false;
	var obj = document.getElementById( id );
	
	if(obj){
		obj.style.display = "none";
		result_flg = true;
	}
	
	return result_flg;
}


/*
 * インラインフレームの縦幅をインラインフレームの内容の大きさに合わせる
 *
 * @param id インラインフレームのID
 *
 * @return result_flg 結果(true or false)
 *
 */
function ResizeIframe( id ){
	
	var result_flg = false;
	var iframe_obj = parent.document.getElementById(id);
	
	iframe_obj.scrolling = "no"; //スクロールバー非表示
	
	if(parent && (parent!=self) && iframe_obj){
		if(document.all||window.opera){ //IE,Operaの場合
			iframe_obj.height = document.body.scrollHeight;
			result_flg = true;
		}else{ //IE,Opera以外のブラウザの場合
			iframe_obj.height = document.body.offsetHeight;
			result_flg = true;
		}
	}
	
	return result_flg;
}

function ToDoordoor(fromCode){
	document.paramform.fromcode.value = fromCode;
	document.paramform.action = "doordoor.aspx";
	document.paramform.submit();
}

