//AJAX for displaying home section content
//Mid Section1
$(document).ready(function midsection1(){
	$.ajax({
		type: "GET",
		url: "xml/midsection1.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('mid_section_area').each(function(){
				//Mid section1
				var discrip1 = $(this).find('discrip').text();
				//Mid section1 display
				$('<span id="mid_output1'+discrip1+'"></span>').html(discrip1).appendTo('#mid_output1');
				});
		}
	});
});
//Mid Section2
$(document).ready(function midsection2(){
	$.ajax({
		type: "GET",
		url: "xml/midsection2.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('mid_section_area').each(function(){
				//Mid section2
				var discrip2 = $(this).find('discrip').text();
				//Mid section2 display
				$('<span id="mid_output2'+discrip2+'"></span>').html(discrip2).appendTo('#mid_output2');
				});
		}
	});
});
//Mid Section3
$(document).ready(function midsection3(){
	$.ajax({
		type: "GET",
		url: "xml/midsection3.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('mid_section_area').each(function(){
				//Mid section3
				var discrip3 = $(this).find('discrip').text();
				//Mid section3 display
				$('<span id="mid_output3'+discrip3+'"></span>').html(discrip3).appendTo('#mid_output3');
				});
		}
	});
});
//Bottom Section
//Latest news section
//Section1
$(document).ready(function section1(){
	$.ajax({
		type: "GET",
		url: "xml/latest_news1.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('section1').each(function(){
				var id = $(this).attr('id');
				//section1
				var title1 = $(this).find('title1').text();
				var date1 = $(this).find('date1').text();
				var LNcontent1 = $(this).find('content1').text();
				//section1 display
				$('<strong id="title1'+title1+'"></strong>').html(title1).appendTo('#title1');
				$('<span id="date1'+date1+'"></span>').html(date1).appendTo('#date1');
				$('<span id="LNcontent1'+LNcontent1+'"></span>').html(LNcontent1).appendTo('#LNcontent1');
				});
		}
	});
});
//Section2
$(document).ready(function section2(){
	$.ajax({
		type: "GET",
		url: "xml/latest_news2.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('section1').each(function(){
				var id = $(this).attr('id');
				//section1
				var title1 = $(this).find('title1').text();
				var date1 = $(this).find('date1').text();
				var LNcontent1 = $(this).find('content1').text();
				//section1 display
				$('<strong id="title2'+title1+'"></strong>').html(title1).appendTo('#title2');
				$('<span id="date2'+date1+'"></span>').html(date1).appendTo('#date2');
				$('<span id="LNcontent2'+LNcontent1+'"></span>').html(LNcontent1).appendTo('#LNcontent2');
				});
		}
	});
});
//Section3
$(document).ready(function section3(){
	$.ajax({
		type: "GET",
		url: "xml/latest_news3.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('section1').each(function(){
				var id = $(this).attr('id');
				//section1
				var title1 = $(this).find('title1').text();
				var date1 = $(this).find('date1').text();
				var LNcontent1 = $(this).find('content1').text();
				//section1 display
				$('<strong id="title3'+title1+'"></strong>').html(title1).appendTo('#title3');
				$('<span id="date3'+date1+'"></span>').html(date1).appendTo('#date3');
				$('<span id="LNcontent3'+LNcontent1+'"></span>').html(LNcontent1).appendTo('#LNcontent3');
				});
		}
	});
});
//Dates section
//Date 1
$(document).ready(function datesdisplay(){
	$.ajax({
		type: "GET",
		url: "xml/date1.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('dates_area').each(function(){
				//date and info
				var date = $(this).find('date').text();
				var dateinformation = $(this).find('dateinfo').text();
				//date and info display
				$('<strong id="date_ouput'+date+'"></strong>').html(date).appendTo('#date_output');
				$('<span id="info_date_output'+dateinformation+'"></span>').html(dateinformation).appendTo('#info_date_output');
				});
		}
	});
});
//Date 2
$(document).ready(function date2display(){
	$.ajax({
		type: "GET",
		url: "xml/date2.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('dates_area').each(function(){
				//date and info
				var date2 = $(this).find('date').text();
				var dateinformation2 = $(this).find('dateinfo').text();
				//date and info display
				$('<strong id="date_ouput2'+date2+'"></strong>').html(date2).appendTo('#date_output2');
				$('<span id="info_date_output2'+dateinformation2+'"></span>').html(dateinformation2).appendTo('#info_date_output2');
				});
		}
	});
});
//Date 3
$(document).ready(function date3display(){
	$.ajax({
		type: "GET",
		url: "xml/date3.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('dates_area').each(function(){
				//date and info
				var date3 = $(this).find('date').text();
				var dateinformation3 = $(this).find('dateinfo').text();
				//date and info display
				$('<strong id="date_ouput3'+date3+'"></strong>').html(date3).appendTo('#date_output3');
				$('<span id="info_date_output3'+dateinformation3+'"></span>').html(dateinformation3).appendTo('#info_date_output3');
				});
		}
	});
});
//Date 4
$(document).ready(function date4display(){
	$.ajax({
		type: "GET",
		url: "xml/date4.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('dates_area').each(function(){
				//date and info
				var date4 = $(this).find('date').text();
				var dateinformation4 = $(this).find('dateinfo').text();
				//date and info display
				$('<strong id="date_ouput4'+date4+'"></strong>').html(date4).appendTo('#date_output4');
				$('<span id="info_date_output4'+dateinformation4+'"></span>').html(dateinformation4).appendTo('#info_date_output4');
				});
		}
	});
});
//Date 5
$(document).ready(function date5display(){
	$.ajax({
		type: "GET",
		url: "xml/date5.xml",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('dates_area').each(function(){
				//date and info
				var date5 = $(this).find('date').text();
				var dateinformation5 = $(this).find('dateinfo').text();
				//date and info display
				$('<strong id="date_ouput5'+date5+'"></strong>').html(date5).appendTo('#date_output5');
				$('<span id="info_date_output5'+dateinformation5+'"></span>').html(dateinformation5).appendTo('#info_date_output5');
				});
		}
	});
});
