var affectedSelectors = "#middle-content-panel-box1-left .box5, #middle-content-panel-box1-left .box5 .Normal, #middle-content-panel-box1-left .box5 .NormalTextBox, #middle-content-panel-box1-left .box5 h1, #middle-content-panel-box1-left .box5 h2, #middle-content-panel-box1-left .box5 h3, #middle-content-panel-box1-left .box5 h4, #middle-content-panel-box1-left .box5 h5, #middle-content-panel-box1-left .box5 p";
var scale = 1.5;



//sIFR implementation

var artbrush = {  src: DNN_skinPath+'GaramondPremrPro.swf'};
sIFR.activate(artbrush);

sIFR.replace(artbrush, {
  selector: '.sIFR', 
  wmode: 'transparent', 
  src: DNN_skinPath+'GaramondPremrPro.swf', 
  css: [ '.sIFR-root {color:#1F593A;font-size:26px;}'
	   ]
});

//Menu implementation
jQuery(document).ready(function(){

	jQuery("#MainMenu > ul").superfish({
		hoverClass:"hover",
		pathClass:"overideThisToUse",
		delay:800,
		animation:{height:"show"},
		speed:"normal",
		oldJquery:false,
		disableHI:false,
		onInit:function () {},
		onBeforeShow:function () {},
		onShow:function () {},
		onHide:function () {}
	});

		/* remove box from links */
	jQuery("a").focus(function(){
		this.blur();
	});
	

	var toggleCookie = jQuery.cookie('textSize');
	if(toggleCookie=="true"){
		toggleCookie = true;
		changeFontSize(toggleCookie);
		//change image
		jQuery(".font-toggle-img").attr('src',DNN_skinPath+'images/reduce.gif');
	} else {
		toggleCookie = false;
	}
	
	jQuery("a.font-toggle").click(function(){
		
		toggleCookie = (toggleCookie) ? false:true;
		
		//change font
		changeFontSize(toggleCookie);
		
		//change image
		img = (toggleCookie) ? 'reduce':'enlarge' ;
		jQuery(".font-toggle-img").attr('src',DNN_skinPath+'images/'+img+'.gif'); 
		
		//save toggle var as cookie
		jQuery.cookie('textSize',toggleCookie,{path:'/'});
	});
	
});




/* Change font size based on flag.
 * toggle true => larger
 * toggle false => smaller
 */
function changeFontSize (toggle){
	jQuery(affectedSelectors).each(function(){
		// set the current font size of .mainText as a var called currentSize
		var currentSize = jQuery(this).css('font-size');
		// parse the number value out of the font size value, set as a var called 'num'
		var num = parseFloat(currentSize, 10);
		// make sure current size is 2 digit number, save as var called 'unit'
		var unit = currentSize.slice(-2);
	
		if(toggle){
			num = num * scale;
		} else {
			num = num / scale;
		}
		// jQuery lets us set the font Size value of the mainText div
		jQuery(this).css('font-size', num + unit);
	});
}










