

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';


var MetaDataValueControl = {
restorePage: function()
{
setTimeout('formDisable(false)', 300);
return true;
},
RadioButtonListDisable: function(id, disabled)
{
var radUl = $(id);
if(radUl)
{
if(typeof(radUl.disabled) != 'undefined'){ radUl.disabled = disabled;}
var radValue1 = $(id + '_1');
var radValue2 = $(id + '_2');
var lblValue1 = radValue1.next(); var lblValue2 = radValue2.next(); if(typeof(radValue1.disabled) != 'undefined') radValue1.disabled = disabled;
if(typeof(radValue2.disabled) != 'undefined') radValue2.disabled = disabled;
if(typeof(lblValue1) != 'undefined') lblValue1.disabled = disabled;
if(typeof(lblValue2) != 'undefined') lblValue2.disabled = disabled;
}
},
AssetTextboxDisable: function(id, txtId, btnId, disabled)
{
var tbl = $(id);
if(tbl)
{
if(typeof(tbl.disabled) != 'undefined'){ tbl.disabled = disabled;}
}
var txt = document.getElementById(txtId);
if(txt)
{
if(typeof(txt.disabled) != 'undefined'){ txt.disabled = disabled;}
}
setButtonState(btnId, null, !disabled)

},
HtmlEditorDisable: function(id, disabled, fEditorInitFunction)
{
var txtHtmlEditor = $(id);
if(txtHtmlEditor)
{
if(typeof(txtHtmlEditor.disabled) != 'undefined'){ txtHtmlEditor.disabled = disabled;}
if(disabled)
{

tinyMCEext.setReadonly(id, true);

}
else
{
if ((fEditorInitFunction != '')&&(txtHtmlEditor.hasTinyMCEInit != true))
{
tinyMCEext.setReadonly(id, false);
txtHtmlEditor.style.display = ''; 
eval(fEditorInitFunction);
txtHtmlEditor.hasTinyMCEInit = true;

}
else
{
tinyMCEext.setReadonly(id, false);
}
}
}
},
ListBoxDisable: function(id, disabled)
{
var listBox = $(id);
if(listBox)
{
if(typeof(listBox.disabled) != 'undefined'){ listBox.disabled = disabled;}
}
},
CheckBoxListDisable: function(id, disabled)
{
}
}; 


//-End File-\\


