function class_cookielib(){
this.getCookie = getCookie;
this.setCookie = setCookie;
this.removeCookie = removeCookie;

var expireDate = new Date();
expireDate.setFullYear(expireDate.getFullYear()+1);
expireStr = "expires=" + expireDate.toUTCString();

function getCookie(name){
var gc=name+"=";
var Cookie=document.cookie;
if (Cookie.length>0) {
var start=Cookie.indexOf(gc);
if (start!=-1) {
start+=gc.length;
terminus=Cookie.indexOf(";",start);
if (terminus==-1) terminus=Cookie.length;
return unescape(Cookie.substring(start,terminus));
}
}
return '';
}
function setCookie() {
var key = arguments[0];
var val = arguments[1];
var path = (typeof(arguments[2]) != 'undefined' ? arguments[2] : '/');
var exp = (typeof(arguments[3]) != 'undefined' ? arguments[3] : expireStr);
var sc = key + "=" + escape(val) + "; path=" + path + "; " + exp;
document.cookie = sc;
}
function removeCookie(key,path) {
if(!path){
path = '/';
}
var rc = key + "=; path=" + path + "; expires=Thu, 1 Jan 1970 00:00:00 UTC";
document.cookie = rc;
}
}
var cookieObj = new class_cookielib();

function onresize_handler(){
if(document.layers){
window.location.reload();
}
}
window.onresize = onresize_handler;

var txtsize_val = 3;
var txtsize_css_size = new Array();
txtsize_css_size[0] = '85%';
txtsize_css_size[1] = '100%';
txtsize_css_size[2] = '110%';
function setTextSize(){
if(cookieObj.getCookie('txtsize') != ''){
txtsize_val = 1 * cookieObj.getCookie('txtsize');
}
document.write('<style type="text/css">');
document.write('body { font-size:' + txtsize_css_size[txtsize_val] + '; }');
if (txtsize_val=="0"){
	document.write('#headerwrap #fontsize ul li #fs_s { background:transparent url("/common/img/fontsize_s_on.gif") 0 0 no-repeat;');
}else if (txtsize_val=="1"){
	document.write('#headerwrap #fontsize ul li #fs_m { background:transparent url("/common/img/fontsize_m_on.gif") 0 0 no-repeat;');
}else if (txtsize_val=="2"){
	document.write('#headerwrap #fontsize ul li #fs_l { background:transparent url("/common/img/fontsize_l_on.gif") 0 0 no-repeat;');
}else {
	document.write('#headerwrap #fontsize ul li #fs_m { background:transparent url("/common/img/fontsize_m_on.gif") 0 0 no-repeat;');
}
document.write('</style>');
}

function changeTextSize(num){
var fl_update = false;
var tmp_val = num;
if(tmp_val >= 0 && tmp_val < txtsize_css_size.length){
txtsize_val = tmp_val;
fl_update = true;
}
if(fl_update){
cookieObj.setCookie('txtsize',txtsize_val,'/','');
window.location.reload();
}
}

function defaultTextSize(){
var fl_update = false;
var tmp_val = 3;
if(tmp_val >= 0 && tmp_val < txtsize_css_size.length){
txtsize_val = tmp_val;
fl_update = true;
}
if(fl_update){
cookieObj.setCookie('txtsize',txtsize_val,'/','');
window.location.reload();
}
} 
