/**
 * 不動産管理用 ＪａｖａＳｃｒｉｐｔ関数定義
 *
 *     $Source:$
 *   $Revision:$
 *     $Author:$
 *       $Date:$
 *     $Locker:$
 *      $State:$
 *         $Id:$
 *                                 Copyright (c) Honest Friend 2005
 */
function movie_open( addr ){
    window.open( addr, "", "menubar=no, toolbar=no, status=no, width=960, height=530" ) ;
}

function map_open( addr ){
    window.open( "map.php?addr=" +addr ) ;
}

function open_form(){
    window.open("request_form.php", "", "height=550, width=750");
}

function area_view(arti_cd){
    location.href = "arti_list.php?arti_type=" + arti_cd + "&area_cd=" + top.matrix.document.forms[0].select_area.value ;
}

function new_list_change( area_cd ){
    top.new_list.location.href = "new_arti_list.php?area_cd=" + area_cd ;
}

function fsetAttribute(search,element,value){
	
	//searchパラメータが空の場合
	if (search.length == 0){
		search += "?" + element + "=" + value ;
	}else{
		//エレメントを検索
		pos_str = search.indexOf(element, 0) ;

		//エレメントが見つかった場合の処理
		if (pos_str != -1){ 

			//次のエレメントまでの位置を検索
			pos_end = search.indexOf("&", pos_str) ;

			//次のエレメントが見つかった場合の処理
			if (pos_end != -1){ 
				target = search.substring(pos_str, pos_end )

			//次のエレメントがなかった場合の処理
			}else{
				target = search.substring(pos_str)
			}
			//エレメントを置換
			search = search.split(target);
			search = search.join(element + "=" + value );

		//エレメントがなかった場合の処理
		}else{
			search += "&" + element + "=" + value ;
		}
	}
	return search ;
}

