/* ロードスクリプト */$('document').ready(	function(){		/* 選択済の本文サイズに設定 */		if($.cookie('cluster_e_fontsize')){			setFontSize($.cookie('cluster_e_fontsize'),true);		}				/* アンカーリンクのスムース化 */		$('a[href^=#]').click(			function(){				var href = this.hash;				var targetObj = $(href=='#_top'?'body':href);				if(targetObj.size()){					var top = targetObj.offset().top;					$($.browser.safari?'body':'html').animate({scrollTop:top}); 					/*$.scrollTo(targetObj,800,{easing:'swing'});*/					return false;				}			}		);				/* apply fancybox */		if($.fancybox){			/* setting popup */			$('#international01 a.fancybox,#overview03 a.fancybox').fancybox({'type':'image','width':800,'autoScale':false})		}				/* preload header images */		if(document.body.id=="home"){			var tmpStr = location.href;			var tmp1 = tmpStr.lastIndexOf('english/');			var tmp2 = tmpStr.substring(0,tmp1);			var tmpPath = tmp2+'english/';					var tmpImg = new Array();			for (var i=0;i<6;i++){				tmpImg[i] = new Image();			}			tmpImg[0].src = tmpPath+"images/overview/h1_image.jpg";			tmpImg[1].src = tmpPath+"images/research/h1_image.jpg";			tmpImg[2].src = tmpPath+"images/regional/h1_image.jpg";			tmpImg[3].src = tmpPath+"images/international/h1_image.jpg";			tmpImg[4].src = tmpPath+"images/result/h1_image.jpg";			tmpImg[5].src = tmpPath+"images/management/h1_image.jpg"		}	});/* 本文サイズ制御 *//* statがtrueの場合はアニメートしない */function setFontSize(val,stat){	$('#header_sizemenu li a').css({backgroundPosition:"left bottom"});	switch(val){		case "large":			(!stat)?$('body').animate({fontSize:"14px",lineHeight:"160%"},"fast"):$('body').css({fontSize:"14px",lineHeight:"160%"});			$('#size_large').css({backgroundPosition:"left top"});			$.cookie('cluster_e_fontsize','large',{path:'/'});			break;		case "small":			(!stat)?$('body').animate({fontSize:"10px",lineHeight:"160%"},"fast"):$('body').css({fontSize:"10px",lineHeight:"160%"});			$('#size_small').css({backgroundPosition:"left top"});			$.cookie('cluster_e_fontsize','small',{path:'/'});			break;		default:			(!stat)?$('body').animate({fontSize:"12px",lineHeight:"160%"},"fast"):$('body').css({fontSize:"12px",lineHeight:"160%"});			$('#size_middle').css({backgroundPosition:"left top"});			$.cookie('cluster_e_fontsize','middle',{path:'/'});		}}/* クッキー操作用関数（jQuery.cookieの転載）  */jQuery.cookie = function(name, value, options) {    if (typeof value != 'undefined') { // name and value given, set cookie        options = options || {};        if (value === null) {            value = '';            options.expires = -1;        }        var expires = '';        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {            var date;            if (typeof options.expires == 'number') {                date = new Date();                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));            } else {                date = options.expires;            }            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE        }        // CAUTION: Needed to parenthesize options.path and options.domain        // in the following expressions, otherwise they evaluate to undefined        // in the packed version for some reason...        var path = options.path ? '; path=' + (options.path) : '';        var domain = options.domain ? '; domain=' + (options.domain) : '';        var secure = options.secure ? '; secure' : '';        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');    } else { // only name given, get cookie        var cookieValue = null;        if (document.cookie && document.cookie != '') {            var cookies = document.cookie.split(';');            for (var i = 0; i < cookies.length; i++) {                var cookie = jQuery.trim(cookies[i]);                // Does this cookie string begin with the name we want?                if (cookie.substring(0, name.length + 1) == (name + '=')) {                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));                    break;                }            }        }        return cookieValue;    }};
