
	
	//rearrange order of sitempa blocks
	
	
	function apply_additional_jquery(){
		
		// remove weirf double up on event calednar display
		jQuery('.calendar-calendar td .inner').each(function(){
			 	
		 if(jQuery(this).children('.view-item:first-child').children().children('a').text() == jQuery(this).children('.view-item:nth-child(2)').children().children('a').text()){
				 jQuery(this).children('.view-item:nth-child(2)').remove();
		 }
		});
		
		jQuery('h1.title:contains("Resources: Ltad Resource Papers")').replaceWith('<h1 class="title">Resources: LTAD Resource Papers</h1>');
		jQuery('h1.title:contains("Resources: Ltad Sport Models")').replaceWith('<h1 class="title">Resources: LTAD Sport Models</h1>');
		jQuery('h1.title:contains("Resources: Ltad Implementation")').replaceWith('<h1 class="title">Resources: LTAD Implementation</h1>');
		jQuery('h1.title:contains("Resources: Ltad Case Studies")').replaceWith('<h1 class="title">Resources: LTAD Case Studies</h1>');
		jQuery('.i18n-fr h1.title:contains("Resources: LTAD Case Studies")').replaceWith('<h1 class="title">Ressources: &Eacute;tudes de car DLTA</h1>');
		
		
		//correct the page title in the french LTAD sport models pages
	jQuery('.page-resources-ltad-sport-models.i18n-fr h1.title').html('Ressources: Mod&egrave;les de DLTA canadiens propres &agrave; chaque sport');
	jQuery('.page-resources-2009-cs4l-workshop-presentations.i18n-fr h1.title').html("Ressources: Présentations de l'atelier 2009");
	jQuery('.page-resources-2010-cs4l-workshop-presentations.i18n-fr h1.title').html("Ressources: Présentations de l'atelier 2010");
	jQuery('.page-resources-2011-cs4l-workshop-presentations.i18n-fr h1.title').html("Ressources: Présentations de l'atelier 2011");
		
		
		jQuery('div.site-map-menu-box').each(function() {
			
			 //CS4L menu block	
			 if(jQuery(this).children('H2').text()=='CS4L For'){
				
			 }
			 
			 //Footer Links menu block	
			 if(jQuery(this).children('H2').text()=='Footer Links'){
				
			 }
			 
			 //Main Menu Links menu block	
			 if(jQuery(this).children('H2').text()=='Main menu'){
				jQuery(this).parent('.site-map-menus').prepend(jQuery(this));
			 }
	
		});
		
		jQuery("h1.title").each(function () {
			jQuery(this).text( jQuery(this).text().replace('Cs4l','CS4L'));
				jQuery(this).text( jQuery(this).text().replace('Ltad','LTAD'));
	jQuery(this).text( jQuery(this).text().replace('Cs4L','CS4L'));
});


		
		// Modify CS4L block headings
		jQuery('#block-menu-block-2 h2.block-title').prepend('CS4L For ');
		
		//jQuery('#content-header-area').parent('#secondary-content').children().children().children().children('h1#page-title').css('margin-top','0');
		
		// Remove submitted by text except for date on authoring info 
		jQuery('.section-news .submitted .username').remove();
		var myText = jQuery('.section-news .submitted');
	myText.text(myText.text().replace('Submitted by',''));
	var myText = jQuery('.section-news .submitted');
	myText.text(myText.text().replace('on',''));
	
	
	
	
	//Disable links for coming soon nav buttons
	/*jQuery('.menu-468 a').click(function(){
		return false;
	});*/
	jQuery('.menu-469 a').click(function(){
		return false;
	});
	
	//get external homepage banner to link correctly {
		/*
		jQuery('.view-id-slideshow .views-field-field-link').each(function(){
				var this_href = jQuery(this).children().children('a').attr('href');
				
				jQuery(this).parent().children('.views-field-field-slide-image').children().children('a').attr('href',this_href);
				jQuery(this).parent().children('.views-field-field-slide-image').children().children('a').attr('target','_blank');
		});
		*/
	
	//add new window target to footer links
	jQuery('#block-nice-menus-3 .nice-menu li a').attr('target','_blank');
	
	
	//remove empty video block on front page
	jQuery('#block-views-videos-block .td-inner:empty').remove();
	
	//Laanuch slideshow link
	jQuery('a#slideshow-button').click(function(){
									  
    	jQuery('.row-1 .col-1 .views-field-field-photo-1 a').click();
   	 	return false;

	}); 
	
	//Modify podcast download audio link 
	jQuery('.jp-playlist a').html('Download the mp3 file &raquo;');

	//correct the page title in the french resources pages
	jQuery('.page-resources-ltad-resource-papers.i18n-fr h1.title').text('Ressources du DLTA');
	
	jQuery('#block-locale-language .fr a.language-link').prepend('En ');
	
	jQuery(".i18n-fr a:contains('Watch Video')").html("Voir les vid&egrave;os");
	jQuery(".i18n-fr.section-events .view-footer a").html("Calendrier d&#39;&egrave;v&egrave;nements &raquo;");
	
	jQuery('.i18n-fr .view-content iframe').each(function(){
												  //jQuery(this).remove();
		var urllink = jQuery(this).attr('src');	
		//jQuery(this).append(urllink);
		
		jQuery(this).attr('src',(urllink+'&locale=fr_FR'));
	});
	
	
	//apply href target attribute to sidebar badges
	jQuery('a.external-Yes').attr('target','_blank');
	
	// Add links to sidebar menu titles
	jQuery('.section-coaches #block-menu-block-2 h2.block-title').wrapInner('<a href="/coaches" title="CS4L For Coaches"></a>');
	jQuery('.section-parents #block-menu-block-2 h2.block-title').wrapInner('<a href="/parents" title="CS4L For Parents"></a>');
		jQuery('.section-females #block-menu-block-2 h2.block-title').wrapInner('<a href="/females" title="CS4L For Females"></a>');
		jQuery('.section-athletes-disabilities #block-menu-block-2 h2.block-title').wrapInner('<a href="/athletes-disabilities" title="CS4L For Athletes with Disabilities"></a>');
		jQuery('.section-educators #block-menu-block-2 h2.block-title').wrapInner('<a href="/educators" title="CS4L For Educators"></a>');
		jQuery('.section-health-practitioners #block-menu-block-2 h2.block-title').wrapInner('<a href="/health-practitioners" title="CS4L For Health Practitioners"></a>');
		jQuery('.section-recreation-professionals #block-menu-block-2 h2.block-title').wrapInner('<a href="/recreation-professionals" title="CS4L For Recreation Professionals"></a>');
		jQuery('.section-leaders-programmers #block-menu-block-2 h2.block-title').wrapInner('<a href="/leaders-programmers" title="CS4L For Leaders & Programmers"></a>');
		
		
		
		//Create external link for external badge
		jQuery('.view-callout-block .External-badge a').each(function(){
			var urllink = jQuery(this).parent().parent().parent().children().children('.views-field-field-link .field-content').text();
			jQuery(this).attr('href', urllink);														  
					jQuery(this).attr('target', '_blank');													  
		});
		
		jQuery('.view-slideshow .External-banner-image a').each(function(){
			var urllink = jQuery(this).parent().parent().parent().children().children('.views-field-field-link .field-content').text();
			jQuery(this).attr('href', urllink);														  
					jQuery(this).attr('target', '_blank');													  
		});
		
		//Fix French CS4L for block title
		jQuery(".i18n-fr #block-menu-block-2 h2.block-title a").each(function () {
			jQuery(this).text( jQuery(this).text().replace('CS4L For','ACSV POUR'));
			//jQuery(this).text( jQuery(this).text('ACSV POUR'));	
});


		
		//tranlsate read to french
		jQuery('.i18n-fr li.node-readmore a').text('En Savoir Plus');
		
		
		jQuery('<li>Text Size:</li>').insertBefore('li.ts_increase_variable');
		
		jQuery('.i18n-fr .region-sidebar-first').insertAfter('#secondary-content');
		
		//translate text size label
		jQuery('.i18n-fr .textsize_list li:contains("Text Size:")').text('Taille du texte:');
		
		//translate Recent Posts block header
		jQuery('.i18n-fr h2.block-title:contains("Recent posts")').html('Messages R&#201;cents');
		
		jQuery('.i18n-fr a:contains("Post to Twitter")').html('<img typeof="foaf:Image" src="http://canadiansportforlife.ca/sites/all/modules/tweet/twitter.png" alt="Post to Twitter" title="Post to Twitter" /> Publier sur Twitter');
		
		// modify forums view
		jQuery('.view-forums table.views-table caption a').wrapInner('<h3></h3>');
		
		jQuery('#block-menu-menu-forums h2.block-title').wrapInner('<a href="/forum" title="Canadian Sport For Life Forums"></a>');
	
	};
	
	
	;

