// JavaScript Document for Blanchrdstown CIC website 2010
		
	
// Function to increse Font Size

		var min=10;
		var max=20;
			function increaseFontSize() {
				var p = document.getElementsByTagName('body');
					for(i=0;i<p.length;i++) {
				if(p[i].style.fontSize) {
				var s = parseInt(p[i].style.fontSize.replace("px",""));
					} else {
				var s = 12;
					}
				if(s!=max) {
					s += 1;
					}
				p[i].style.fontSize = s+"px"
				}
		}
		
// Function to decrease Font Size
		
		function decreaseFontSize() {
				var p = document.getElementsByTagName('body');
					for(i=0;i<p.length;i++) {
				if(p[i].style.fontSize) {
					var s = parseInt(p[i].style.fontSize.replace("px",""));
					} else {
				var s = 12;
					}
				if(s!=min) {
					s -= 1;
					}
				p[i].style.fontSize = s+"px"
				}  
		}
		
// Function to Reset Font Size

		function resetFontSize() {
				var p = document.getElementsByTagName('body');
					for(i=0;i<p.length;i++) {
			p[i].style.fontSize = "12px";
				}
		}
		


/* Function that opens the print preview window. */

		function printPage() {
			window.open(window.location.href + "#top?style=print", 'winName', 'height=425, width=650, scrollbars=yes, toolbar=yes, menubar=yes, status=yes, resizable=yes');
		}
		
//swap print styles

		if (window.location.search.substring(1) == "style=print" || window.location.hash == "#top?style=print") {
 			changeStyles();
		}
		
		
/* Function that disables the primary screen stylesheet and enables the alternate screen stylesheet. */

		function changeStyles() {
		  var style_dec;
			  for (i=0; (style_dec = document.getElementsByTagName("link")[i]); i++) {
			    if (style_dec.getAttribute("rel").indexOf("style") != -1 && style_dec.getAttribute("title")) {
				style_dec.disabled = true;
				if (style_dec.getAttribute("title") == 'print_preview')
				style_dec.disabled = false;
			    }
			  }
		}

