
//
var anchor_obj;
var scroll_position;
var next_anchor;
function scrollPage(){
	if(isNaN(scroll_position)){
		scroll_position = 0;
	}
	scroll_position += (next_anchor- scroll_position)/2;
	//
	if(Math.floor(scroll_position) == next_anchor || Math.ceil(scroll_position) == next_anchor){
		clearInterval(scroll_ID);
	}
	//
	scroll(0,scroll_position);
}

function toAnchor(_anchor){
	scroll_position = (document.body.scrollTop || document.documentElement.scrollTop);
	if(_anchor == 'PRESENT'){
		next_anchor = document.getElementById('flash-space').offsetTop;
	}else if(_anchor == 'TOP'){
		next_anchor = 1;
	}else{
		anchor_obj = document.getElementById(_anchor);
		next_anchor = anchor_obj.offsetTop+document.getElementById('contents').offsetTop;
	}
	//alert(next_anchor);
	scroll_ID = setInterval("scrollPage()",50);
}