
$(document).ready(function(){

	/* Looks to see if the Wiki page has been loaded*/

	if ( $(".ms-wikicontent").length > 0 ) {

		/* This will dictate what happens to the main content of the wiki page*/

		$('.ms-wikicontent').addClass('pa-wikicontentPA'); 

		/* This will dictate what happens to any additional fields added below Wiki content*/

		$('.ms-formtable').addClass('pa-formtablePA'); 

		/* This section adds the HEADER to the Wiki Page
Remember to update the path to where you have located the wiki.css file*/

		$('.ms-wikicontent').prepend('<div id=placeTop></div>');
		$('#placeTop').load('../../Wiki/Support/wiki.css #pa-WikiTop');

		/* This section adds the FOOTER to the Wiki Page.
Remember to update the path to where you have located the wiki.css file*/

		$('#onetidinfoblock2').prepend('<div id=placeBottom></div>');
		$('#placeBottom').load('../../Wiki/Support/wiki.css #pa-WikiBottom');

/* This section adds up to three list views*/
			var SelectedView = $('a[href*=?ListView]:eq(0)').attr('href');

			$('a[href='+SelectedView+']').load(SelectedView+" [id*=WebPartWPQ]  .ms-listviewtable",function() {
				$(".ms-viewheadertr a").css("text-decoration","none");
				$(".ms-viewheadertr a").css("cursor","default");
				$(".ms-viewheadertr a").attr('title', 'Not Sortable'); 
				$(".ms-viewheadertr *").removeAttr("onclick");
				$(".ms-viewheadertr *").removeAttr("onfocus");
				$(".ms-viewheadertr *").removeAttr("onmouseover");

			});
			var SelectedView = $('a[href*=?ListView]:eq(1)').attr('href');

			$('a[href='+SelectedView+']').load(SelectedView+" [id*=WebPartWPQ]  .ms-listviewtable",function() {
				$(".ms-viewheadertr a").css("text-decoration","none");
				$(".ms-viewheadertr a").css("cursor","default");
				$(".ms-viewheadertr a").attr('title', 'Not Sortable'); 
				$(".ms-viewheadertr *").removeAttr("onclick");
				$(".ms-viewheadertr *").removeAttr("onfocus");
				$(".ms-viewheadertr *").removeAttr("onmouseover");

			});
			var SelectedView = $('a[href*=?ListView]:eq(2)').attr('href');

			$('a[href='+SelectedView+']').load(SelectedView+" [id*=WebPartWPQ]  .ms-listviewtable",function() {
				$(".ms-viewheadertr a").css("text-decoration","none");
				$(".ms-viewheadertr a").css("cursor","default");
				$(".ms-viewheadertr a").attr('title', 'Not Sortable'); 
				$(".ms-viewheadertr *").removeAttr("onclick");
				$(".ms-viewheadertr *").removeAttr("onfocus");
				$(".ms-viewheadertr *").removeAttr("onmouseover");

			});
	}
	
	$('span.ms-formdescription:eq(0)').append('<br><strong>Add List or Document Library View</strong> - Add a hyperlink of a list/document library view and add ?ListView to the end of the URL up to 3 lists.  EXAMPLE URL: http://site/List/Forms/AllItems.aspx?ListView');
});
