

var Cookie = {
set: function(name,value,intDays)
{
if(intDays)
{
d = new Date();
d.setTime(d.getTime() + (intDays * 24 * 60 * 60 * 1000));
expiry = '; expires=' + d.toGMTString();
}
else 
{
expiry = '';
}
document.cookie = name + "=" + value + expiry + "; path=/";
},
get: function(name)
{
nameEQ = name + "=";
ca = document.cookie.split(';');
for(i = 0; i < ca.length; i++)
{
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
},
unset: function(name)
{
Cookie.set(name,'',-1);
}
}



function PageFontSizeObject(strFormName)
{
this.mstrFormName = strFormName;
this.savesize = function(intSize) 
{
if(typeof(intSize) == 'undefined' || intSize==null)
{
intSize = this.mintDefaultSize;
}
Cookie.set(this.mstrCookie, intSize, 365);
}

this.loadsize = function() 
{
var intSize = Cookie.get(this.mstrCookie);
if(typeof(intSize) == 'undefined' || intSize==null)
{
intSize = this.mintDefaultSize;
} 
return parseInt(intSize);
}

this.cssclass = function(intSize) 
{
switch(parseInt(intSize))
{
case 1:
return this.mstrClassPre + this.mstrSize1; 
break;
case 2:
return this.mstrClassPre + this.mstrSize2; 
break;
case 3:
return this.mstrClassPre + this.mstrSize3; 
break;
case 4:
return this.mstrClassPre + this.mstrSize4; 
break;
case 5:
return this.mstrClassPre + this.mstrSize5; 
break;
default:
return this.cssclass(this.mintDefaultSize); 
}
}

this.setsizeclass = function(strClass)
{
for(var i=1;i<=this.mintMaxSize;i++)
{
this.removesizeclass(this.cssclass(i));
}
$(this.mstrFormName).addClassName(strClass); 
}
this.removesizeclass = function(strClass)
{
$(this.mstrFormName).removeClassName(strClass);
}

this.setSizeUp = function() 
{
var intSize = this.loadsize();
intSize++;
if(intSize>this.mintMaxSize)
{
return false;
}
else
{
var strClass = this.cssclass(intSize);
this.setsizeclass(strClass);
this.savesize(intSize);
}
}

this.setSizeDown = function()
{
var intSize = this.loadsize(); 
intSize--;
if(intSize<=0)
{
return false;
}
else
{
var strClass = this.cssclass(intSize);
this.setsizeclass(strClass);
this.savesize(intSize);
}
}

this.init = function() 
{
var intSize = this.loadsize();
var strClass = this.cssclass(intSize);
this.setsizeclass(strClass);
}
}
PageFontSizeObject.prototype.mstrFormName;
PageFontSizeObject.prototype.mintDefaultSize = 3;
PageFontSizeObject.prototype.mintMaxSize = 5;
PageFontSizeObject.prototype.mstrClassPre = 'body-';
PageFontSizeObject.prototype.mstrCookie = 'PageFontSize';
PageFontSizeObject.prototype.mstrSize1 = 'Smallest';
PageFontSizeObject.prototype.mstrSize2 = 'Small';
PageFontSizeObject.prototype.mstrSize3 = 'Medium';
PageFontSizeObject.prototype.mstrSize4 = 'Large';
PageFontSizeObject.prototype.mstrSize5 = 'Largest';

//-End File-\\


