var KINOStatic={};

KINOStatic.initReciepe= function(m){
	KINOStatic.month = m;
	$.ajax({
		url: '/files/xml/reciepe.xml?noCache='+new Date().getTime(),
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		error: function(){
		},
		success: function(xml){
			KINOStatic.createReciepe(xml);
		}
	});
}

KINOStatic.createReciepe= function(xml){
	var lists = new Array();
	$(xml).find('data').each(function(){
		if($(this).find('month').text()==KINOStatic.month){
			lists.push({
				imgpath:$(this).find('imgpath').text(),
				title:$(this).find('title').text(),
				cap:$(this).find('cap').text()
			});
		}
	});
	var n = Math.floor(Math.random()*lists.length);
	var html = '<p class="image"><a href="/旬のレシピ/'+lists[n].title+'/"><img src="/旬のレシピ/'+lists[n].title+'/images/thumb.jpg" alt="" /></a></p>';
	html += '<p class="text"><a href="/旬のレシピ/'+lists[n].title+'/">'+lists[n].title+'</a><!--<br /><span>'+lists[n].cap+'</span>--></p>';
	$('#subContent .reciepeObj dd').html(html);
}

KINOStatic.initMariage= function(){
	$.ajax({
		url: '/files/xml/mariage.xml?noCache='+new Date().getTime(),
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		error: function(){
		},
		success: function(xml){
			KINOStatic.createMariage(xml);
		}
	});
}

KINOStatic.createMariage= function(xml){
	var lists = new Array();
	$(xml).find('data').each(function(){
		lists.push({
			imgpath:$(this).find('imgpath').text(),
			title:$(this).find('title').text()
		});
	});
	var n = Math.floor(Math.random()*lists.length);
	var html = '<p class="image"><a href="/マリアージュ/'+lists[n].title+'/"><img src="/マリアージュ/'+lists[n].title+'/images/thumb.jpg" width="45" height="45" alt="" /></a></p>';
	html += '<p class="text"><a href="/マリアージュ/'+lists[n].title+'/">'+lists[n].title+'</a></p>';
	$('#subContent .mariageObj dd.row').html(html);
}

KINOStatic.initZiten= function(){
	$.ajax({
		url: '/files/xml/ziten.xml?noCache='+new Date().getTime(),
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		error: function(){
		},
		success: function(xml){
			KINOStatic.createZiten(xml);
		}
	});
}

KINOStatic.createZiten= function(xml){
	var lists = new Array();
	$(xml).find('data').each(function(){
		lists.push({
			imgpath:$(this).find('imgpath').text(),
			title:$(this).find('title').text()
		});
	});
	var n = Math.floor(Math.random()*lists.length);
	var html = '<p class="image"><a href="/食べる百科事典/'+lists[n].title+'/"><img src="/食べる百科事典/'+lists[n].title+'/images/thumb.jpg" width="45" height="45" alt="" /></a></p>';
	html += '<p class="text"><a href="/食べる百科事典/'+lists[n].title+'/">'+lists[n].title+'</a></p>';
	$('#subContent .zitenObj dd.row').html(html);
}

KINOStatic.initPanReciepe= function(){
	$.ajax({
		url: '/files/xml/panreciepe.xml?noCache='+new Date().getTime(),
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		error: function(){
		},
		success: function(xml){
			KINOStatic.createPanReciepe(xml);
		}
	});
}

KINOStatic.createPanReciepe= function(xml){
	var lists = new Array();
	$(xml).find('data').each(function(){
		lists.push({
			path:$(this).find('path').text(),
			title:$(this).find('title').text()
		});
	});
	var n = Math.floor(Math.random()*lists.length);
	var html = '<p class="image"><a href="/パン料理レシピ/'+lists[n].path+'/"><img src="/パン料理レシピ/'+lists[n].path+'/images/thumb.jpg" alt="" /></a></p>';
	html += '<p class="text"><a href="/パン料理レシピ/'+lists[n].path+'/">'+lists[n].title+'</a></p>';
	$('#subContent .panObj dd').html(html);
}
