function regFav(jid) {var p = "jid=" + jid; var request = new Ajax.Request("/box_check.php", {method: 'post', requestHeaders: ["If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT"], parameters: p, onComplete: showBoxCheck});}
function showBoxCheck(res) {showFavCompDialog();$("box_check").innerHTML = res.responseText;}
function showFavCompDialog() {var t; if(document.all) { $("ato_box").style.left = (((document.documentElement.clientWidth - 400) / 2) + document.documentElement.scrollLeft) + "px"; t = (((document.documentElement.clientHeight - 390) / 2) + document.documentElement.scrollTop - 200); } else { $("ato_box").style.left = (((window.innerWidth - 400) / 2) + document.documentElement.scrollLeft) + "px"; t = (((window.innerHeight - 390) / 2) + document.documentElement.scrollTop - 200); } if (t < 150) t = 150; t += "px";$("ato_box").style.top = t; $("ato_box").style.display = "block"; op=0;sh_showFavCompDialog();}
function sh_showFavCompDialog() {if (op>100) op = 100;op+=20;$('ato_box').style.opacity = op / 100;$('ato_box').style.filter = "alpha(opacity=" + op + ")";if (op != 100) setTimeout(function () {sh_showFavCompDialog()}, 10);}
function Scroll(base,move){
	var obj_base  = getElemPosition(base);
	var elem_move = document.getElementById(move);
	var obj_move  = getElemPosition(elem_move);
	restScroll = obj_move.y-obj_base.y;
	eventTimer = setInterval(setScrollPosition,8);
}

function setScrollPosition() {
	var moveValue=0;
	if(Math.abs(restScroll)>80){
		moveValue = (restScroll>0)?20:-20;
	}else{
		moveValue = Math.round(restScroll/4);
	}
	parent.scrollBy(0,moveValue);

	restScroll = (restScroll>0)?restScroll-moveValue:restScroll-moveValue;

	if(moveValue==0){
		clearInterval(eventTimer);
		restScroll=0;
	}
}

function getElemPosition(elem) {
	var obj = new Object();
	obj.x = elem.offsetLeft;
	obj.y = elem.offsetTop;

	while(elem.offsetParent) {
		elem = elem.offsetParent;
		obj.x += elem.offsetLeft;
		obj.y += elem.offsetTop;
	}
	return obj;
}

