/* Cookie */
function setCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ){
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}	return "";
}

/* Size control */
var zoomRate = 20;
var curRate = 100;
var minRate = 100;
var maxRate = 200;
function initZoom(){
	document.body.style.position="relative";
	if(getCookie("zoomName") != null && getCookie("zoomName") != ""){
		curRate = getCookie("zoomName");
		if(!((curRate >=minRate)&(curRate<=maxRate))){curRate = 100;}
		setCookie("zoomName",curRate, 1);
		document.body.style.zoom = curRate + '%';
	}	else{document.body.style.zoom = '100%';
		curRate = 100;
		setCookie("zoomName",100, 1);
	}
}
function zoomInOut(value){
	var ue = navigator.userAgent.toLowerCase();
	if(((value=="plus")&&(curRate >= maxRate))||((value == "minus") && (curRate <= minRate))){return;}
  if(value=="plus"){curRate = parseInt(curRate) + parseInt(zoomRate);}
  else if (value=="minus"){curRate = parseInt(curRate) - parseInt(zoomRate);}
  else{curRate = 100}
 	document.body.style.zoom = curRate + '%';
  setCookie("zoomName",curRate, 1);
}

/* ÃÊ±âÈ­ */

function f_setBasic(mode, load)
{
  document.body.style.zoom = '100%';
  curRate = 100;

}
