// JavaScript Document

function changeFontSize(level) {

if (level==12) {
	document.body.style.fontSize= level + 'px';
	document.getElementById('menu-quick-nav-menu').style.fontSize= level + 'px';
	document.getElementById('breadcrumb').style.fontSize= level + 'px';
	document.getElementById('category-title').style.fontSize= level + 'px';
	$(".widget-title").css('font-size', level+6 + 'px');
	document.getElementById('footer').style.fontSize= level-2 + 'px';
	document.getElementById('category-title').style.lineHeight= level+6 + 'px';
	$(".entry-meta").css('font-size', level-2 + 'px');
	$(".entry-utility").css('font-size', level-2 + 'px');

	} else if (level==16) {
	document.body.style.fontSize= level + 'px';
	document.getElementById('menu-quick-nav-menu').style.fontSize= level-2 + 'px';
	document.getElementById('breadcrumb').style.fontSize= level + 'px';
	document.getElementById('category-title').style.fontSize= level-2 + 'px';
	document.getElementById('category-title').style.lineHeight= level-3 + 'px';
	$(".widget-title").css('font-size', level+4 + 'px');
	document.getElementById('footer').style.fontSize= level-2 + 'px';
	$(".entry-meta").css('font-size', level-4 + 'px');
	$(".entry-utility").css('font-size', level-4 + 'px');
	}
}


$(function(){
/* Apply Blank Target to External Links */
var externalLinks = $("a[href^='http']"); /* HREF starts with "http" */
	externalLinks
		/* Except Links to specified domain */	.not("a[href*='dawsoncreek.ca']")
		/* Except Links to specified domain */	.not("a[href*='newharvest.ca']")
		/* Except Links to specified domain */	.not("a[href*='macromedia.com']")
		/* Except Links to specified domain */	.not("a[href*='adobe.com']")
		/* Except Links to specified domain */	.not("a[href*='apple.com']")
		/* Except Links to specified domain */	.not("a[href*='linkedin.com']")
		/* Except Links to specified domain */	.not("a[href*='facebook.com']")
		/* Add the _blank target */				.attr('target','_blank')
		/* Insert Image after the link */		.after(" <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_newWindow.png' width='11' height='8' alt='(link opens in a new window)' title='(link opens in a new window)' class='icon_newWindow' /> ");
			
			
/* Add PDF icons with _blank targets */
var pdfLinks = $("a[href$='.pdf']"); /* HREF ends in ".pdf" */
pdfLinks.attr('target','_blank').after("&nbsp; <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_pdf.gif' width='16' height='16' alt='(PDF Document)' title='(PDF Document)' class='icon_pdf' /> ")
		
/* Add Excel Icon with _blank targets */
var xlsLinks = $("a[href$='.xls']"); /* HREF ends in ".xls" */
var xlsxLinks = $("a[href$='.xlsx']"); /* HREF ends in ".xlsx" */
xlsLinks.attr('target','_blank').after("&nbsp; <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_excel.jpg' width='16' height='16' alt='(Excel Document)' title='(Excel Document)' class='icon_excel' /> ")
xlsxLinks.attr('target','_blank').after("&nbsp; <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_excel.jpg' width='16' height='16' alt='(Excel Document)' title='(Excel Document)' class='icon_excel' /> ")
		
/* Add Word Document Icon with _blank targets */
var docLinks = $("a[href$='.doc']"); /* HREF ends in ".doc" */
var docxLinks = $("a[href$='.docx']"); /* HREF ends in ".docx" */
docLinks.attr('target','_blank').after("&nbsp; <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_doc.png' width='15' height='15' alt='(Word Document)' title='(Word Document)' class='icon_word' /> ")
docxLinks.attr('target','_blank').after("&nbsp; <img src='/wordpress/wp-content/themes/cityofdawsoncreek/images/icon_doc.png' width='15' height='15' alt='(Word Document)' title='(Word Document)' class='icon_word' /> ")


// jQuery sripts needed for certain few pages:

	// Hide the Tender Info link in the breadcrumbs.
	$("#breadcrumb a[title*='Tender Downloads']").replaceWith("<a href='/category/tenders/'>Tenders Registration</a>");
	
	// Contacts Page "Accordion"
	$(".contactsAccordion h4").next().slideUp();
	$(".contactsAccordion h4").click(function() {
		$(this).next().slideToggle();
		});


}); // End jQuery Document Ready Function
