function setCookie(name,value){
  expire = new Date();
  expire.setTime(expire.getTime() + (365*24*60*60*1000));
  document.cookie
    = name + '=' + escape(value)+'; expires='+expire.toGMTString();
}
function getCookie(name){
  var search = name + '=';
  if (document.cookie.length>0)
  {
    offset = document.cookie.indexOf(search);
    cookiestr = document.cookie + ";"
    if (offset != -1){
      offset += search.length;
      end     = cookiestr.indexOf(';',offset);
      if(end == -1)
        end = document.cookie.length;
      return unescape(cookiestr.substring(offset,end));
    }
  }
  return null;
}
function initZoom()
{
	z = 100;
	if (navigator.cookieEnabled)
	{
		z=getCookie('zoom');
		if(z == null)
		{
			z = 100;
		}
	}
	document.body.style.setAttribute('zoom',z+'%');	
}
function setZoom(z, ratio)
{
	z=parseInt(z)+parseInt(ratio);
	document.body.style.setAttribute('zoom',z+'%');
	if (navigator.cookieEnabled)
	{
		setCookie('zoom',parseInt(z));
	}
}
function changeZoom(ratio)
{
	z=document.body.style.getAttribute('zoom');
	if(z){
	setZoom(z,ratio);
	}else{
		setZoom(100, ratio);
	}
}
