var affectedSelectors = " .box  .Normal,  .box  .NormalTextBox,  .box  h1,  .box  h2,  .box  h3,  .box  h4,  .box  h5, #content .box p,#content .box ul,#content .box a, .box p, .box, .box1, .box1 p, .box a, .box ul, .box ol, #content_in, .box .formLabel, .box .formTable";
var scale = 1.5;


//sIFR implementation
var Fritz = {  src: DNN_skinPath+'Trajan Pro.swf' };
sIFR.activate(Fritz);

sIFR.replace(Fritz, {
  selector: '.sIFR', 
  wmode: 'transparent', 
  src: DNN_skinPath+'Trajan Pro.swf', 
  css: [ '.sIFR-root {color:#e7debd;font-size:28px;}'
	   ]
});

//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();
	});
	
/* Enlarge Text */

	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);
	});
}






