function addBookmarkNote(noteid) {
	new Ajax.Request('/JSONAddBookmarkNote.note', {
		"method": "get",
		"parameters": "noteid=" + noteid,
		onSuccess: function(transport) {
			var _data = eval(transport.responseJSON);
			var _msg = _data.msg;
			alert(_msg);
		},
		onFailure: function(request) {
			alert('お気に入り登録に失敗しました');
		},
		onException: function (request) {
			alert('お気に入り登録中にエラーが発生しました');
		}
	});
}
function addBookmarkTodaiStudent(todaistudentid) {
	new Ajax.Request('/JSONAddBookmarkTodaiStudent.note', {
		"method": "get",
		"parameters": "todaistudentid=" + todaistudentid,
		onSuccess: function(transport) {
			var _data = eval(transport.responseJSON);
			var _msg = _data.msg;
			alert(_msg);
		},
		onFailure: function(request) {
			alert('お気に入り登録に失敗しました');
		},
		onException: function (request) {
			alert('お気に入り登録中にエラーが発生しました');
		}
	});
}
function addMyChannel(worryid) {
	new Ajax.Request('/JSONAddMyChannel.note', {
		"method": "get",
		"parameters": "worryid=" + worryid,
		onSuccess: function(transport) {
			var _data = eval(transport.responseJSON);
			var _msg = _data.msg;
			alert(_msg);
		},
		onFailure: function(request) {
			alert('マイデスクに追加失敗しました');
		},
		onException: function (request) {
			alert('マイデスクに追加中にエラーが発生しました');
		}
	});
}
function addCart(noteid) {
	new Ajax.Request('JSONAddCart.note', {
		"method": "get",
		"parameters": "noteid=" + noteid,
		onSuccess: function(transport) {
			var _data = eval(transport.responseJSON);
			var _msg = _data.msg;
			alert(_msg);
		},
		onFailure: function(request) {
			alert('カートに追加失敗しました');
		},
		onException: function (request) {
			alert('カートに追加中にエラーが発生しました');
		}
	});
}

function yesUp(isLogon, notevaluationid, divid) {
	if(!isLogon) {
		referer = location.href;
		location.href = "/LoginForm.note?referer=" + referer;
	} else {
		new Ajax.Request('/JSONNoteValuationYesUp.note', {
			"method": "get",
			"parameters": "notevaluationid=" + notevaluationid,
			onSuccess: function(transport) {
				var _data = eval(transport.responseJSON);
				var _msg = _data.msg;
				var _yescount = _data.yescount;
				alert(_msg);
				document.getElementById(divid).innerHTML = _yescount;
			},
			onFailure: function(request) {
				alert('失敗しました');
			},
			onException: function (request) {
				alert('エラーが発生しました');
			}
		});
	}
}

function noUp(isLogon, notevaluationid, divid) {
	if(!isLogon) {
		referer = location.href;
		location.href = "/LoginForm.note?referer=" + referer;
	} else {
		new Ajax.Request('/JSONNoteValuationNoUp.note', {
			"method": "get",
			"parameters": "notevaluationid=" + notevaluationid,
			onSuccess: function(transport) {
				var _data = eval(transport.responseJSON);
				var _msg = _data.msg;
				var _nocount = _data.nocount;
				alert(_msg);
				document.getElementById(divid).innerHTML = _nocount;
			},
			onFailure: function(request) {
				alert('失敗しました');
			},
			onException: function (request) {
				alert('エラーが発生しました');
			}
		});
	}
}

function viewTestTodainote(noteid) {
	window.open('http://files.todainote.jp/AjaxNoteTestOpen.note?noteid=' + noteid, "TestViewer", "width=1024,height=768,resizable=no,status=no,toolbar=no");

}

function viewTodainote(noteid) {
	window.open('http://files.todainote.jp/AjaxMyBuyNoteOpen.note?noteid=' + noteid, "Viewer", "width=1024,height=768,resizable=no,status=no,toolbar=no")
}

function viewMynote(mynoteid) {
	window.open('AjaxMyNoteOpen.note?mynoteid=' + mynoteid, "MynoteViewer", "width=1024,height=768,resizable=no,status=no,toolbar=no")
}

function viewOthernote(mynoteid, studentid) {
	window.open('AjaxOtherNoteOpen.note?mynoteid=' + mynoteid + "&studentid=" + studentid, "MynoteViewer", "width=1024,height=768,resizable=no,status=no,toolbar=no")
}

function viewStaColo() {
	window.open('/AjaxStarColoTop.note', "StarColoViewer", "width=800,height=680,resizable=no,status=no,toolbar=no")
}



