// Ver 1.1.100310 mod GRC
// Required: ajax.js

var IE = document.all ? true : false;

if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

var mousex = 0;
var mousey = 0;

function getMouseXY(e) {

	if (IE) { // grab the x-y pos.s if browser is IE

		if (!document.body)
			return;

		if (!e)
			if (event)
				e = event;

		if (!e)
			return;

		mousex = e.clientX + document.body.scrollLeft;
		mousey = e.clientY + document.body.scrollTop;

	} else {  // grab the x-y pos.s if browser is NS

		if (!e)
			return;

		mousex = e.pageX;
		mousey = e.pageY;

	}  

	return true;

}

function mypageGetFavouriteControl(type, id) {

	var container = document.getElementById("favourite_control");

	if (!container)
		return;

	var REQ = new ajaxContainer("favourite_control", "/members/mypage/mypage.phtml", "favourite_control", type);

	REQ.setErrorHandler(function() { });
	REQ.setParam("id", id);
	REQ.loadData();

}

function mypageAdd(type, id) {

	var container = document.getElementById("favourite_control");

	if (!container)
		return;

	var REQ = new ajaxContainer("favourite_control", "/members/mypage/mypage.phtml", "favourite_control_add", type);

	REQ.setParam("id", id);
	REQ.loadData();

}
