
var CoreURL = '/mypage';
var CoreCGI = '/mypage/r.cgi';

document.write('<script type="text/javascript" src="' + CoreURL + '/js/prototype.js"></script>');
document.write('<script type="text/javascript" src="' + CoreURL + '/js/PrototypeWindowClass/window.js"></script>');
document.write('<link href="' + CoreURL + '/css/sub_theme.css" rel="stylesheet" type="text/css">');



// 外部ブログに飛ばす
function myJumbBlog ( Aobj, blogId ) {
	if( ! Aobj ) return;
	var url    = CoreURL + '/link.cgi?blog_id=' + blogId;
	Aobj.href = url;
	return true;
}

// 外部記事に飛ばす
function myJumbItem ( Aobj, itemId ) {
	if( ! Aobj ) return;
	var url    = CoreURL + '/link.cgi?item_id=' + itemId;
	Aobj.href = url;
	return true;
}

// 中間ページに飛ばす
function myJumbSub ( Aobj, itemId ) {
	if( ! Aobj ) return;
	var url    = CoreCGI + '/top.html?item_id=' + itemId;
	Aobj.href = url;
	return true;
}

// 投稿お料理ファイルを外部に飛ばす
function myJumbPost ( Aobj, postId ) {
	if( ! Aobj ) return;
	var url    = CoreURL + '/link.cgi?post_id=' + postId;
	Aobj.href = url;
	return true;
}

// サブウィンドウを閉じる
function mySubClose () {
	window.parent.Windows.closeAll();
}

// サブウィンドウを閉じつつ親ウィンドウをリロードする
function myParentReload () {
	window.parent.location.reload();
}

// ログインフォームへ飛ばす
function mySubLogin () {
	window.parent.location.href = CoreCGI + '/login.html?return=' + window.parent.location.href;
}

// 任意のURLへ飛ばす
function myParentLocation ( url ) { 
	window.parent.location.href = url;
}


// ブックマークブログ登録フォームを表示する
function myBookmark ( blogId ) {
	var wobj = new Window( 'sub_bookmark', {
		title:			'ブックマークする',
		zIndex:			100,
		width:			450,
		height:			200,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/bookmark_regist.html?target_blog_id=" + blogId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// ブックマーク削除フォームを表示する
function myBookmarkDelete ( blogId ) {
	var wobj = new Window( 'sub_bookmark', {
		title:			'ブックマークブログ削除',
		zIndex:			100,
		width:			450,
		height:			200,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/bookmark_delete.html?target_blog_id=" + blogId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}


// クリッピングレシピ登録フォームを表示する
function myClip ( itemId ) {
	var wobj = new Window( 'sub_clip', {
		title:			'クリップする',
		zIndex:			100,
		width:			450,
		height:			450,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/clip_regist.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クリッピングレシピ編集フォームを表示する
function myClipEdit ( itemId ) {
	var wobj = new Window( 'sub_clip', {
		title:			'クリッピングレシピ編集',
		zIndex:			100,
		width:			450,
		height:			450,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/clip_edit.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クリッピングレシピ削除フォームを表示する
function myClipDelete ( itemId ) {
	var wobj = new Window( 'sub_clip', {
		title:			'クリッピングレシピ削除',
		zIndex:			100,
		width:			450,
		height:			450,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/clip_delete.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}


// クッキングノート登録フォームを表示する
function myNote ( itemId ) {
	var wobj = new Window( 'sub_note', {
		title:			'クッキングノート登録',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/note_edit.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クッキングノート編集フォームを表示する
function myNoteEdit ( itemId ) {
	var wobj = new Window( 'sub_note', {
		title:			'クッキングノート編集',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/note_edit.html?edit_ok=1&target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クッキングノート削除フォームを表示する
function myNoteDelete ( itemId ) {
	var wobj = new Window( 'sub_note', {
		title:			'クッキングノート削除',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/note_delete.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クッキングノートThanksコメントフォームを表示する
function myNoteThanks ( itemId, userId ) {
	var wobj = new Window( 'sub_note', {
		title:			'クッキングノート Thanksコメント',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/note_thanks.html?target_item_id=" + itemId + "&target_user_id=" + userId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// クッキングノート非表示フォームを表示する
function myNoteHidden ( itemId, userId ) {
	var wobj = new Window( 'sub_note', {
		title:			'クッキングノート削除',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/note_hidden.html?target_item_id=" + itemId + "&target_user_id=" + userId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}


// みんなの投稿お料理ファイル登録フォームを表示する
function myPost ( themeId ) {
	var wobj = new Window( 'sub_post', {
		title:			'テーマ別投稿レシピ 登録',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/post_edit.html?theme_id=" + themeId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// みんなの投稿お料理ファイル編集フォームを表示する
function myPostEdit ( postId ) {
	var wobj = new Window( 'sub_post', {
		title:			'テーマ別投稿レシピ 編集',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/post_edit.html?target_post_id=" + postId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// みんなの投稿お料理ファイル削除フォームを表示する
function myPostDelete ( postId ) {
	var wobj = new Window( 'sub_post', {
		title:			'テーマ別投稿レシピ 削除',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/post_delete.html?target_post_id=" + postId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}


// お気に入りアイテムファイル登録フォームを表示する
function myTool ( categoryId ) {
	var wobj = new Window( 'sub_tool', {
		title:			'お気に入りアイテムファイル 登録',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/tool_edit.html?category_id=" + categoryId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// お気に入りアイテムファイル編集フォームを表示する
function myToolEdit ( toolId ) {
	var wobj = new Window( 'sub_tool', {
		title:			'お気に入りアイテムファイル 編集',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/tool_edit.html?target_tool_id=" + toolId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// お気に入りアイテムファイル削除フォームを表示する
function myToolDelete ( toolId ) {
	var wobj = new Window( 'sub_tool', {
		title:			'お気に入りアイテムファイル 削除',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/tool_delete.html?target_tool_id=" + toolId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}


// プチレシピ編集フォームを表示する
function myPuchiEdit ( recipeId ) {
	var wobj = new Window( 'sub_puchi', {
		title:			'簡単！1・2・3レシピ 編集',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/puchi_edit.html?target_recipe_id=" + recipeId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}

// プチレシピ削除フォームを表示する
function myPuchiDelete ( recipeId ) {
	var wobj = new Window( 'sub_puchi', {
		title:			'簡単！1・2・3レシピ 削除',
		zIndex:			100,
		width:			450,
		height:			550,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/puchi_delete.html?target_recipe_id=" + recipeId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}



// 画像変更フォームを表示する
function myChangeImage ( itemId ) {
	var wobj = new Window( 'sub_puchi', {
		title:			'画像編集',
		zIndex:			100,
		width:			450,
		height:			450,
		closable:		true,
		resizable:		false,
		minimizable:	false,
		maximizable:	false,
		draggable:		true,
		url:			CoreCGI + "/sub/change_image.html?target_item_id=" + itemId
	});
	wobj.setDestroyOnClose();
	wobj.showCenter( true );
}




