function switchFontSize(fs)
{
	set_cookie('fontsize',fs,2009,12,12,"/","ring.idv.tw");

	var s = document.getElementsByTagName("div");
	for( i = 0 ; s.length ; i++ )
	{
		if(s[i] == undefined)
			return;

		if(s[i].id == 'content')
			s[i].style.fontSize = fs;
	}

}
function get_cookie ( cookie_name )
{
	var results = document.cookie.match('(^|;)?' + cookie_name + '=([^;]*)(;|$)');
	if ( results )
    		return ( unescape ( results[2] ) );
  	else
    		return null;
}
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}
function RingOnLoad()
{
	var fs = get_cookie('fontsize');
	if(fs != null)
	{
		switchFontSize(fs);
	}
}
window.onload = RingOnLoad;
