
$(document).ready(function() {
	var fsize_cookie = $.cookie('fsize');
	if(fsize_cookie){
		$("body").css("font-size",$.cookie('fsize'));	
		changeFontImg($.cookie('fsize'),true);
	}
	else {
		$("body").css("font-size","84%");
		changeFontImg("84%",true);
	}
});


function font(size){
	if(activeSize)changeFontImg(activeSize,false);
	changeFontImg(size,true);

	$("body").css("font-size",size);
	$.cookie("fsize",size,{expires:30,path:'/'});
	
}

function changeFontImg(fsize,sw){
	
	if(fsize == "78%"){
			if(sw){
				$("#header img[alt='小']").attr("src","/inc/images/global/font_small_acv.gif");
				activeSize = '78%';
			}
			else $("#header img[alt='小']").attr("src","/inc/images/global/font_small_dis.gif");
	}
	else if(fsize == "84%"){
			if(sw){
				$("#header img[alt='中']").attr("src","/inc/images/global/font_medium_acv.gif");
				activeSize = "84%";
			}
			else $("#header img[alt='中']").attr("src","/inc/images/global/font_medium_dis.gif");
	}
	else if(fsize == "100%"){
			
			if(sw){
				$("#header img[alt='大']").attr("src","/inc/images/global/font_large_acv.gif");
				activeSize = '100%';
			}
			else $("#header img[alt='大']").attr("src","/inc/images/global/font_large_dis.gif");
	}

}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

