$(init);

/**
* 全ページ共通初期設定
* @param:
*/
function init(){
	setPGTP();
}

/**
* ページトップスクロール設定
* @param:
*/
function setPGTP(){
	$("#pgtp").bind('click', function(){
		$.scrollTo( $("#container"),{duration:800, axis:'y', queue:true});
		return false;
	}
	);
}

/**
* 指定IDまで、スクロール
* @param:
* s:String//ターゲットID
*/
function scrollPage(s){
	$.scrollTo( $("#" + s),{duration:800, axis:'y', queue:true});
}

/**
* Google Anaryticsコードをコール後、urlを変える
* @param:
* tar:ターゲットurl
* code:Google Anaryticsコード
* type:_selfか_blank
*/
function changeURLAndCode(tar,code,type){
	if(typeof code != 'undefined') pageTracker._trackPageview(code);
	var id = setTimeout("changeURL('" + tar + "', '" + type + "')", 200);
}

function changeURL(tar, type){
	if(type == "_self"){
		location.href = tar;
	}else if(type == "_blank"){
		window.open(tar)
	}
}
