//////
// ajax_topic_list_multi_ex_be.js based on jslib_ajax****.js　　マルチタイプメッセージマルチユース制御AJAX処理
//
//
//////
	var u_req_tar_proc	= './ajctrl.php' ;

	var msg_lc		= 1 ;
	var msg_lcx		= 3 ;

	//
	// Ajax like コールバック処理
	//
	function u_ajax_mmsg_topiclist_callback01( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist01").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback02( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist02").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback03( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist03").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback04( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist04").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback05( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist05").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback06( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist06").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback07( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist07").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback08( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist08").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback09( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist09").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback10( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist10").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclist_callback11( oj )
	{
		var res = oj.responseText ;
		document.getElementById("topiclist11").innerHTML = res ;
	}

	function u_ajax_mmsg_topiclistcount_callback( oj )
	{
		var res = oj.responseXML ;
		u_mmsg_countxmlproc( res ) ;
	}



	//
	// Ajax like リクエスト処理
	//
	function u_ajax_mmsg_topiclistview01( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback01,
						'&pt=300&md=0&msgl='+msg_lcx+'&msgc='+u_pg1,
						'GET',
						u_req_tar_proc,
						true,
						true);
//		sendRequest( u_ajax_mmsg_topiclist_callback01,
//						'&pt=300&md=0&msgl='+msg_lc+'&msgx=e&msgc='+u_pg1,
//						'GET',
//						u_req_tar_proc,
//						true,
//						true);
	}

	function u_ajax_mmsg_topiclistview02( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback02,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg2,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview03( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback03,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg3,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview04( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback04,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg4,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview05( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback05,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg5,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview06( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback06,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg6,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview07( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback07,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg7,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview08( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback08,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg8,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview09( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback09,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg9,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview10( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback10,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg10,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistview11( )
	{
		sendRequest( u_ajax_mmsg_topiclist_callback11,
						'&pt=300&md=0&msgl='+msg_lc+'&msgc='+u_pg11,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}

	function u_ajax_mmsg_topiclistcount( )
	{
		sendRequest( u_ajax_mmsg_topiclistcount_callback,
						'&pt=304&md=0&msgn='+u_pg1+'+'+u_pg2+'+'+u_pg3+'+'+u_pg4+'+'+u_pg5+'+'+u_pg6+'+'+u_pg7+'+'+u_pg8+'+'+u_pg9+'+'+u_pg10+'+'+u_pg11,
						'GET',
						u_req_tar_proc,
						true,
						true);
	}


	//
	// 
	//
	function u_mmsg_topicframebuild( p_id, p_img, p_ih, p_iw )
	{
		var w_html	= '<table width="570" border="0" cellspacing="2" cellpadding="0"><tbody>' ;
		w_html	= w_html + '<tr height="40">' ;
		w_html	= w_html + '<td height="40"><img src="img/salon/'+p_img+'" alt="" height="'+p_ih+'" width="'+p_iw+'" border="0" /></td>' ;
		w_html	= w_html + '</tr>' ;
		w_html	= w_html + '<tr>' ;
		w_html	= w_html + '<td class="td_01_3"><div id="'+p_id+'">' ;
		w_html	= w_html + '<img src="img/msg/now_loading.gif" alt="プログラム読み込み中表示画像"><br />' ;
		w_html	= w_html + 'しばらくお待ちください。<br /><br />' ;
		w_html	= w_html + '「loading・・・」の状態が長時間続く場合には、再読み込みを行ってください。' ;
		w_html	= w_html + '</div></td>' ;
		w_html	= w_html + '</tr>' ;
		w_html	= w_html + '</tbody>' ;

		return w_html ;
	}

	function u_mmsg_countxmlproc( xdoc ) {
		var item = xdoc.getElementsByTagName("items") ;
		var rt_idx = xdoc.getElementsByTagName("tpcmsgidx") ;
		var rt_mid = xdoc.getElementsByTagName("tpcmsgid") ;
		var rt_cnt = xdoc.getElementsByTagName("tpcmsgcnt") ;
		var rt_tcnt = xdoc.getElementsByTagName("tpcmsgtcnt") ;

		if (rt_tcnt.length > 0 && rt_tcnt[0].firstChild) {			var t_tcnt = rt_tcnt[0].firstChild.nodeValue ;		}
		else {			var t_tcnt = 0 ;		}

		if ( t_tcnt > 0 )
		{
			if ( t_tcnt > 12 )
			{
				msg_lc	= 1 ;
				msg_lcx	= 2 ;
			}
			else
			{
				msg_lc	= 2 ;
				msg_lcx	= 4 ;
			}

			for ( i = 0 ; i < item.length ; i ++ )
			{
				if (rt_idx.length > 0 && rt_idx[i].firstChild) {				tix	= Math.abs(rt_idx[i].firstChild.nodeValue) ;			}
				else {				tix	= 0 ;			}
				if (rt_mid.length > 0 && rt_mid[i].firstChild) {				tmi	= Math.abs(rt_mid[i].firstChild.nodeValue) ;			}
				else {				tmi	= 0 ;			}
				if (rt_cnt.length > 0 && rt_cnt[i].firstChild) {				tmc	= Math.abs(rt_cnt[i].firstChild.nodeValue) ;			}
				else {				tmc	= 0 ;			}

				switch( tmi )
				{
					case u_pg1 :
						document.getElementById("topiclistframe01").innerHTML	= u_mmsg_topicframebuild( "topiclist01", "top_allshop.jpg", 34, 248 ) ;
						u_ajax_mmsg_topiclistview01( );
						break ;
					case u_pg2 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe02").innerHTML	= u_mmsg_topicframebuild( "topiclist02", "top_ozuki.jpg", 34, 91 ) ;
							u_ajax_mmsg_topiclistview02( );
						}
						break ;
					case u_pg3 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe03").innerHTML	= u_mmsg_topicframebuild( "topiclist03", "top_yamanota.jpg", 34, 107 ) ;
							u_ajax_mmsg_topiclistview03( );
						}
						break ;
					case u_pg4 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe04").innerHTML	= u_mmsg_topicframebuild( "topiclist04", "top_seamall.jpg", 34, 131 ) ;
							u_ajax_mmsg_topiclistview04( );
						}
						break ;
					case u_pg5 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe05").innerHTML	= u_mmsg_topicframebuild( "topiclist05", "top_chofu.jpg", 34, 90 ) ;
							u_ajax_mmsg_topiclistview05( );
						}
						break ;
					case u_pg6 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe06").innerHTML	= u_mmsg_topicframebuild( "topiclist06", "top_coco.jpg", 34, 136 ) ;
							u_ajax_mmsg_topiclistview06( );
						}
						break ;
					case u_pg7 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe07").innerHTML	= u_mmsg_topicframebuild( "topiclist07", "top_shinshimo.jpg", 34, 104 ) ;
							u_ajax_mmsg_topiclistview07( );
						}
						break ;
					case u_pg8 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe08").innerHTML	= u_mmsg_topicframebuild( "topiclist08", "top_ube.jpg", 34, 91 ) ;
							u_ajax_mmsg_topiclistview08( );
						}
						break ;
					case u_pg9 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe09").innerHTML	= u_mmsg_topicframebuild( "topiclist09", "top_blanc.jpg", 34, 170 ) ;
							u_ajax_mmsg_topiclistview09( );
						}
						break ;
					case u_pg10 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe10").innerHTML	= u_mmsg_topicframebuild( "topiclist10", "top_hello.jpg", 34, 107 ) ;
							u_ajax_mmsg_topiclistview10( );
						}
						break ;
					case u_pg11 :
						if ( tmc > 0 )
						{
							document.getElementById("topiclistframe11").innerHTML	= u_mmsg_topicframebuild( "topiclist11", "top_bridal.jpg", 34, 137 ) ;
							u_ajax_mmsg_topiclistview11( );
						}
						break ;
				}
			}
		}
	
	}


	//
	// 
	//
	/*  isset function simulate */
	function isset( data )
	{
		return ( typeof( data ) != 'undefined' );
	}

	/*  */
	function u_ajax_mmsg_topic_init_ex_ss( )
	{
		u_ajax_mmsg_topiclistview01( );
		u_ajax_mmsg_topiclistview02( );
		u_ajax_mmsg_topiclistview03( );
		u_ajax_mmsg_topiclistview04( );
		u_ajax_mmsg_topiclistview05( );
		u_ajax_mmsg_topiclistview06( );
		u_ajax_mmsg_topiclistview07( );
		u_ajax_mmsg_topiclistview08( );
		u_ajax_mmsg_topiclistview09( );
		u_ajax_mmsg_topiclistview10( );
		u_ajax_mmsg_topiclistview11( );
	}

	function u_ajax_mmsg_topic_init_ex_s( )
	{
		u_ajax_mmsg_topiclistcount() ;
	}

	function u_ajax_mmsg_topic_init_ex_s_delaystart( )
	{
		clearTimeout();
		u_ajax_mmsg_topic_init_ex_s();
	}

	function u_ajax_mmsg_topic_init_ex_s_delay(p_dt)
	{
		setTimeout(u_ajax_mmsg_topic_init_ex_s_delaystart,p_dt);
	}

	//
	// on load initialize process
	//
	function u_ajax_mmsg_topic_init_ex_mf( )
	{
		if ( "u_dd" in window ) {
			if (u_dd) {
				u_ajax_mmsg_topic_init_ex_s_delay(u_dd);
			}
			else {
				u_ajax_mmsg_topic_init_ex_s() ;
			}
		}
		else {
			u_ajax_mmsg_topic_init_ex_s() ;
		}
	}

	function u_ajax_mmsg_topic_init_ex( )
	{
		if (arguments.callee.done) return;
		arguments.callee.done = true;
		if (_timer) clearInterval(_timer);

		u_ajax_mmsg_topic_init_ex_mf() ;
	}

