//URLパラメータ取得
function getParameter(key) {
	var str = location.search.split("?");
	if (str.length < 2) {
		return "";
	}
	
	var params = str[1].split("&");
	for (var i = 0; i < params.length; i++) {
		var keyVal = params[i].split("=");
		if (keyVal[0] == key && keyVal.length == 2) {
			return decodeURIComponent(keyVal[1]);
		}
	}
	return "";
}

var getMedia = getParameter("media");
var getAgencyId = getParameter("agency_id");
var getUserId = getParameter("userid");

function domestic_tour_update(n,media,etc,type){

//-----------------------------------------------------------------------------------------------------------
//	▼　国内ツアー　特集(sp)　var01　▼
//-----------------------------------------------------------------------------------------------------------


	//　■(A)写真データのファイル名（大写真+小写真）
	var sample_sp = new Array(n) ; 
	sample_sp[0] = "tour_sp01_01.jpg" ;  			//大きい画像
	sample_sp[1] = "tour_sp01_02.jpg" ;
	sample_sp[2] = "tour_sp01_03.jpg" ;
	sample_sp[3] = "tour_sp02_01.jpg" ;
	sample_sp[4] = "tour_sp02_04.jpg" ;
	sample_sp[5] = "tour_sp02_03.jpg" ;


	//　■(A)写真データのファイル名（中写真タイプ）
	var sample_m = new Array(n) ; 
	sample_m[0] = "" ;  
	sample_m[1] = "" ;
	sample_m[2] = "" ;
	sample_m[3] = "tour_sp03_01.jpg" ;  
	sample_m[4] = "tour_sp03_05.jpg" ;
	sample_m[5] = "tour_sp03_03.jpg" ;
	sample_m[6] = "tour_sp03_04.jpg" ;
	
	
	
	//　■(A)写真データのファイル名（新travel3写真タイプ）
	var sample_newtravel3 = new Array(n) ; 
	sample_newtravel3[0] = "" ;  
	sample_newtravel3[1] = "" ;
	sample_newtravel3[2] = "" ;
	sample_newtravel3[3] = "tour_sp04_01.gif" ;  
	sample_newtravel3[4] = "tour_sp04_04.gif" ;
	sample_newtravel3[5] = "tour_sp04_03.gif" ;
	


	//　■(A)写真データのファイル名（チョビリッチタイプ）
	var sample_chobi = new Array(n) ; 
	sample_chobi[0] = "196_51_3.jpg" ;  

	
	

	//　■(B)リンク先アドレス　※旅キャピサーバのみ※アドレスのみ指定
	var link_sp = new Array(n) ; 
	link_sp[0] = "http://tabicapital.jp/special/sp91/";
	link_sp[1] = "http://www.tabicapital.jp/special/sp10/" ;
	link_sp[2] = "http://tabicapital.jp/special/sp_hokkaido/" ;
	link_sp[3] = "http://www.tabicapital.jp/special/sp91/" ;	
	link_sp[4] = "http://www.tabicapital.jp/special/sp13/" ;
	link_sp[5] = "http://www.tabicapital.jp/special/sp12/";
	link_sp[6] = "http://tabicapital.jp/special/sp_hokkaido/";


	var title_sp = new Array(n) ; 

	//　■(C)タイトルデータ
	title_sp[0] = "羽田発のお得なツアー!!" ;  			//大きい画像 緊急企画！特別値下！！
	title_sp[1] = "いつでも人気の沖縄旅行！！" ;//出張に行くならビジネスパック
	title_sp[2] = "北海道ツアープラン情報が満載" ;
	title_sp[3] = "価格改訂！格安国内ツアー" ;	//旅キャピタルで行く沖縄国際映画祭
	title_sp[4] = "大阪旅行特集　羽田発→大阪行" ;	//ＵＳＪ　羽田発→伊丹行！
	title_sp[5] = "福岡旅行特集　羽田発→福岡行" ;
	title_sp[6] = "北海道のおすすめツアー" ;



	var sentence_sp = new Array(n) ; 

	//　■(D)説明文データ
	sentence_sp[0] = "お得で人気のツアーが満載！沖縄も北海道も日本各地への素敵な旅をお届けします！" ;//年末年始の国内旅行のお得なツアーや宿泊情報が満載！
	sentence_sp[1] = "いつでも人気の沖縄旅行！おすすめのツアーが満載！" ;//1名様よりお申し込みＯＫ。お得で便利なビジネスパック！
	sentence_sp[2] = "北海道の周辺情報や人気ホテルを豊富にご用意！" ;
	sentence_sp[3] = "【往復航空券＋宿泊】1名参加〜、ホテル・フライト選択OK！復路便延長プランも多数。便利で断然お得！" ;//	吉本興業特製福袋プレゼント付き！沖縄国際映画祭へ！３月の旅行はこれで決まり！
	sentence_sp[4] = "大阪旅行に行こう！大阪格安旅行が盛りだくさん！" ;
	sentence_sp[5] = "大人気！福岡旅行！美味しいものたくさん福岡へ！" ;
	sentence_sp[6] = "北海道を満喫できるスペシャルツアー満載！" ;

	
	var price_sp = new Array(n) ; 

	//　■(E)料金データ
	price_sp[0] = "" ;
	price_sp[1] = "" ;
	price_sp[2] = "" ;
	price_sp[3] = "" ;
	price_sp[4] = "" ;
	price_sp[5] = "" ;
	price_sp[6] = "" ;





//-----------------------------------------------------------------------------------------------------------
//	▼　国内ツアー　おすすめ(_re)　var01　▼
//-----------------------------------------------------------------------------------------------------------


	//　■(A)写真データのファイル名
	var sample_re = new Array(n) ; 
	sample_re[0] = "tour_re01_01.jpg" ;
	sample_re[1] = "tour_re01_02.jpg" ;
	sample_re[2] = "tour_re01_04.jpg" ;


	//　■(B)リンク先アドレス　※e航空券にリンク※agency_diは消す
	var link_re = new Array(n) ; 
	link_re[0] = "http://www.e-koukuuken.com/sys/user/tour.view.php?tour_id=5875";
	link_re[1] = "http://www.e-koukuuken.com/sys/user/tour.view.php?tour_id=5870" ;
	link_re[2] = "http://www.e-koukuuken.com/sys/user/tour.view.php?tour_id=5868" ;


	//　■(C)タイトルデータ
	var title_re = new Array(n) ; 
	title_re[0] = "羽田−那覇 ホテルサン沖縄1泊2日延泊可" ;
	title_re[1] = "羽田−那覇 南西観光ホテル1泊2日延泊可" ;
	title_re[2] = "羽田−那覇 沖縄都ホテル1泊2日延泊可" ;

	



	//　■(D)説明文データ
	var sentence_re = new Array(n) ; 
	sentence_re[0] = "太陽と海の楽園で贅沢なひとときを！" ;
	sentence_re[1] = "南海のオアシスを思わせる上質のリゾートを味わおう！" ;
	sentence_re[2] = "沖縄ステイ！最大8日間延長可！" ;


	//　■(E)料金データ
	var price_re = new Array(n) ; 
	price_re[0] = "" ;
	price_re[1] = "" ;
	price_re[2] = "" ;



//-----------------------------------------------------------------------------------------------------------

	//↓国内航空券　特集大きい画像あり(旅キャピリンク)↓
	
	if( type == 1){



		if( media == getMedia ){
			media = "";
		}

		for(cnt=0;cnt<n;cnt++){
		
			html = '<dl id="tour_sp01_'
			+ (cnt+1)
			+ '">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/'
			+ sample_sp[cnt]
			+ '">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ title_sp[cnt]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_sp[cnt]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[cnt]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}
	
	
	//↓国内ツアー　小さい画像(旅キャピリンク)↓

	else if( type == 2 ){

		if( media == getMedia ){
			media = "";
		}
		
		for(cnt=3;cnt<n+3;cnt++){
		
			html = '<dl id="tour_sp02_'
			+ (cnt+1)
			+ '">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/'
			+ sample_sp[cnt]
			+ '">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ title_sp[cnt]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_sp[cnt]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[cnt]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}
	

	//↓国内ツアー　おすすめ(e航空券リンク)↓
	
	
	else if( type == 3 ){
		if( media == getAgencyId ){
			media = "";
		}
		
		for(cnt=0;cnt<n;cnt++){
		
			html = '<dl id="tour_re01_'
			+ (cnt+1)
			+ '">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_re[cnt]
			+ '&agency_id='
			+ media
			+ getAgencyId
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/'
			+ sample_re[cnt]
			+ '">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_re[cnt]
			+ '&agency_id='
			+ media
			+ getAgencyId
			+ '" '
			+ etc
			+ '>'
			+ title_re[cnt]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_re[cnt]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_re[cnt]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}




	//↓国内ツアー　中画像(旅キャピリンク)↓

	else if( type == 4 ){

		if( media == getMedia ){
			media = "";
		}
		
		for(cnt=3;cnt<n+3;cnt++){
		
			html = '<dl id="tour_sp03_'
			+ (cnt+1)
			+ '">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/'
			+ sample_m[cnt]
			+ '">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ title_sp[cnt]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_sp[cnt]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[cnt]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}
	





	//↓国内ツアー　（新travel3テンプレート おすすめ特集 大575*77 ･中275*70 ･中275*70）

	else if( type == 5 ){

		if( media == getMedia ){
			media = "";
		}
		
		for(cnt=3;cnt<n+3;cnt++){
		
			html = '<dl id="tour_sp04_'
			+ (cnt-2)
			+ '">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[cnt]
			+ '?media='
			+ media
			+ getMedia
			+ '&userid='
			+ getUserId
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/'
			+ sample_newtravel3[cnt]
			+ '">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="sentence">'
			+ sentence_sp[cnt]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[cnt]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}












	

	//↓テキスト+画像↓（ちょびりっち型）
		

	//右上　北海道旅行　特集
	
	else if( type == "t1" ){
			
			if( media == getMedia ){
			media = "";
		}
	
			html = '<a href="'
			+ link_sp[0]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img alt="特集" src="http://www.tabicapital.jp/special/images/'
			+ sample_chobi[0]
			+ '"></a> '
			+ '<div class="text_sp">'
			+ '<a target="support" href="'
			+ link_sp[0]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ 'ビジネスパック特集'//title_sp[0]
			+ '</a></div>'
			document.write( html )
	}



	//ECナビ　イチオシから選ぶ　専用　100*68
	
	else if( type == "ec1"){



		if( media == getMedia ){
			media = "";
		}

		for(cnt=0;cnt<n;cnt++){
		
			html = '<dl id="tour_sp01_1">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[4]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/ecnavi_100_80_1_c.gif">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_sp[4]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ title_sp[4]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_sp[4]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[4]
			+ '</dd>'
			+ '</dl>'

	    	document.write( html )
		}

	}


	//ECナビ　イチオシから選ぶ　専用　100*68
	
	else if( type == "ec2"){



		if( media == getMedia ){
			media = "";
		}

		for(cnt=0;cnt<n;cnt++){
		
			html = '<dl id="tour_sp01_2">'
			+ '<dt class="photo">'
			+ '<a href="'
			+ link_sp[5]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ '<img src="http://www.tabicapital.jp/special/images/ecnavi_100_80_2.gif">'
			+ '</a>'
			+ '</dt>'
			+ '<dd class="title">'
			+ '<a href="'
			+ link_sp[5]
			+ '?media='
			+ media
			+ getMedia
			+ '" '
			+ etc
			+ '>'
			+ title_sp[5]
			+ '</a>'
			+ '</dd>'
			+ '<dd class="sentence">'
			+ sentence_sp[5]
			+ '</dd>'
			+ '<dd class="price">'
			+ price_sp[5]
			+ '</dd>'
			+ '</dl>'
	    	document.write( html )
		}

	}







}

	
