//fontsize
	var typenum = "";
	typenum = getCookieValue("style");
	//alert (typenum);
	if(!typenum || typenum == "default" || typenum == "large"){typenum=2;}
	//if(!typenum){typenum=2;}
	var typeList=new Array('s','m','l');
	var value_style=typeList[typenum-1];
//sitepath
	var SitePath="/en/"


//show buttons
function size_btn(){
document.write('<dl><dt><img src="'+SitePath+'common/fontsize_label.gif" width="51" height="18" alt="Font Size"></dt>');
if(value_style=="s"){
document.write('<dd><a href="#" onclick="setStyle(1);return false;"><img src="'+SitePath+'common/size_s_on.gif" width="18" height="18" alt="small" name="fontIcnS"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(2);return false;"><img src="'+SitePath+'common/size_m.gif" width="18" height="18" alt="regular" name="fontIcnM"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(3);return false;"><img src="'+SitePath+'common/size_l.gif" width="18" height="18" alt="big" name="fontIcnL"></a></dd></dl>');
}else if(value_style=="m"){
document.write('<dd><a href="#" onclick="setStyle(1);return false;"><img src="'+SitePath+'common/size_s.gif" width="18" height="18" alt="small" name="fontIcnS"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(2);return false;"><img src="'+SitePath+'common/size_m_on.gif" width="18" height="18" alt="regular" name="fontIcnM"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(3);return false;"><img src="'+SitePath+'common/size_l.gif" width="18" height="18" alt="big" name="fontIcnL"></a></dd></dl>');
}else{
document.write('<dd><a href="#" onclick="setStyle(1);return false;"><img src="'+SitePath+'common/size_s.gif" width="18" height="18" alt="small" name="fontIcnS"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(2);return false;"><img src="'+SitePath+'common/size_m.gif" width="18" height="18" alt="regular" name="fontIcnM"></a></dd>');
document.write('<dd><a href="#" onclick="setStyle(3);return false;"><img src="'+SitePath+'common/size_l_on.gif" width="18" height="18" alt="big" name="fontIcnL"></a></dd></dl>');
}
}

//read style from Cookie and write css
function setCss(){
	var i,a;
	document.write( '<link href="'+SitePath+'css/size_m.css" rel="alternate stylesheet" type="text/css" media="all" title="m">');
	document.write( '<link href="'+SitePath+'css/size_s.css" rel="alternate stylesheet" type="text/css" media="all" title="s">');
	document.write( '<link href="'+SitePath+'css/size_l.css" rel="alternate stylesheet" type="text/css" media="all" title="l">');

for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == value_style) a.disabled = false;
		}
	}
}

//rewite stylesheet
function resetCss(num){
	var typeList=new Array('s','m','l');
	var value_style=typeList[num-1];
	var i,a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == value_style) a.disabled = false;
		}
	}


}

//change icons
function fontIcnChange(num) {
	if(num == "1"){
		document.images["fontIcnS"].src = SitePath+"common/size_s_on.gif";
		document.images["fontIcnM"].src = SitePath+"common/size_m.gif";
		document.images["fontIcnL"].src = SitePath+"common/size_l.gif";
	}if(num == "2"){
		document.images["fontIcnS"].src = SitePath+"common/size_s.gif";
		document.images["fontIcnM"].src = SitePath+"common/size_m_on.gif";
		document.images["fontIcnL"].src = SitePath+"common/size_l.gif";
	}if(num == "3"){
		document.images["fontIcnS"].src = SitePath+"common/size_s.gif";
		document.images["fontIcnM"].src = SitePath+"common/size_m.gif";
		document.images["fontIcnL"].src = SitePath+"common/size_l_on.gif";
	}
}

//Cookie
function getCookieValue(name)	{
var cookieStr = document.cookie
var existNum = cookieStr.indexOf(name)
	if(existNum != -1)	{
		var start = existNum + name.length + 1
		var end = cookieStr.indexOf(";" , start)
		if(end == -1)	{
			end = cookieStr.length
		}
		var cookieValue = cookieStr.substring(start,end)
		return cookieValue
	} else {
		return "2"
	}
}

//write s,m,l
function setStyle(num){
fontIcnChange(num);
resetCss(num);
	if(num){
	typenum=num;
	}
	var styletype=typenum;
	var sizeString='style=' ;
	sizeString+=escape(styletype);
	sizeString+= "; path=";
	sizeString+= SitePath;
	document.cookie =sizeString ;

}

//document.write(cssName);
setCss();

