var Popup = Class.create();
Popup.prototype = {
	initialize: function(){
		standard = new Standard();
	},
	
	open: function(url, formId, submitTagId, popupId, options){
		submitTagId = submitTagId || 'con_submit_tag';
		popupId = popupId || 'con_popup';
		options = options || {popupClass:'con_popup'};
		standard.ajaxPopup(url, formId, submitTagId, popupId, options);
	},
	
	openGet: function(url, query, triggerId, popupId, options){
		triggerId = triggerId || 'trigger_id';
		popupId = popupId || 'con_popup';
		options = options || {popupClass:'con_popup'};
		standard.ajaxGetPopup(url, query, triggerId, popupId, options);
	},
	
//	open: function(url, formId, conSubmitTag,){
//		standard.ajaxPopup(url, formId, 'con_submit_tag', 'con_popup', {popupClass:'con_popup'});
//	},
	
	close: function(popupId){
		popupId = popupId || 'con_popup';
		standard.popupClose(popupId);
	},
	
	// account
	accountNew: function() {
		this.open('/account/check', 'user_detail_form');
	},
	
	// restful_user
	restfulUser: function() {
		this.open('/restful_users/check', 'restful_user_form');
	},
	
	passwordSend: function() {
		this.open('/password/email_check', 'password_send_form');
	},
	
	password: function() {
		this.open('/password/check', 'password_form');
	},
	
	// mypage/top
	mypageContentCommentDelete: function(id, contentId, tagId) {
		$('id').value = id;
		$('content_id').value = contentId;
		this.open('/mypage/comment/content/delete_check', 'content_comment_delete_form', tagId, 'con_popup2');
	},
	
	mypageUserCommentDelete: function(id, tagId) {
		$('id').value = id;
		this.open('/mypage/comment/user/delete_check', 'user_comment_delete_form', tagId, 'con_popup2');
	},
	
	profileUpdate: function() {
		this.open('/mypage/profile/update_check', 'profile_update_form');
	},
	
	// mypage/story
	storyCreate: function() {
		this.open('/mypage/story/create_check', 'story_create_form');
	},
	
	storyUpdate: function() {
		this.open('/mypage/story/update_check', 'story_update_form');
	},

	storyDelete: function(packageId, tagId) {
		$('package').value = packageId;
		this.open('/mypage/story/delete_check', 'con_delete_form', tagId, 'con_popup2');
	},
	
	storyContentCreate: function() {
		this.open('/mypage/story/content/create_check', 'story_content_create_form');
	},

	storyContentUpdate: function() {
		this.open('/mypage/story/content/update_check', 'story_content_update_form');
	},
	
	storyCompositionDelete: function(packageId, compositionId, tagId) {
		$('package').value = packageId;
		$('composition').value = compositionId;
		this.open('/mypage/story/composition/delete_check', 'con_composition_delete_form', tagId, 'con_popup3');
	},
	
	storyChapterCreate: function() {
		this.open('/mypage/story/chapter_create_check', 'chapter_create_form', 'con_submit_tag2', 'con_popup2');
	},
	
	// mypage/article
	articleCreate: function() {
		this.open('/mypage/article/create_check', 'article_create_form');
	},
	
	articleUpdate: function() {
		this.open('/mypage/article/update_check', 'article_update_form');
	},

	articleDelete: function(packageId, tagId) {
		$('package').value = packageId;
		this.open('/mypage/article/delete_check', 'con_delete_form', tagId, 'con_popup2');
	},
	
	articleContentCreate: function() {
		this.open('/mypage/article/content/create_check', 'article_content_create_form');
	},

	articleContentUpdate: function() {
		this.open('/mypage/article/content/update_check', 'article_content_update_form');
	},
	
	articleCompositionDelete: function(packageId, compositionId, tagId) {
		$('package').value = packageId;
		$('composition').value = compositionId;
		this.open('/mypage/article/composition/delete_check', 'con_composition_delete_form', tagId, 'con_popup3');
	},
	
	articleChapterCreate: function() {
		this.open('/mypage/article/chapter_create_check', 'chapter_create_form', 'con_submit_tag2', 'con_popup2');
	},
	
	// mypage/free
	freeContentCreate: function() {
		this.open('/mypage/free/create_check', 'free_content_create_form');
	},

	freeContentUpdate: function() {
		this.open('/mypage/free/update_check', 'free_content_update_form');
	},
	
	freeContentDelete: function(id, tagId) {
		$('content_id').value = id;
		this.open('/mypage/free/delete_check', 'free_content_delete_form', tagId);
	},
	
	// mypage/word
	mypageWordExplanationDelete: function(id, tagId) {
		$('delete_id').value = id;
		this.open('/mypage/word/delete_check', 'word_explanation_delete_form', tagId);
	},
	
	// story
	storyCommentCreate: function() {
		this.open('/story/comment/create_check', 'story_comment_create_form');
	},
	
	storyCommentDelete: function(id, contentId, tagId) {
		$('id').value = id;
		$('content_id').value = contentId;
		this.open('/story/comment/delete_check', 'story_comment_delete_form', tagId, 'con_popup2');
	},
	
	// article
	articleCommentCreate: function() {
		this.open('/article/comment/create_check', 'article_comment_create_form');
	},
	
	articleCommentDelete: function(id, contentId, tagId) {
		$('id').value = id;
		$('content_id').value = contentId;
		this.open('/article/comment/delete_check', 'article_comment_delete_form', tagId, 'con_popup2');
	},
	
	// free
	freeCommentCreate: function() {
		this.open('/free/comment/create_check', 'free_comment_create_form');
	},
	
	freeCommentDelete: function(id, contentId, tagId) {
		$('id').value = id;
		$('content_id').value = contentId;
		this.open('/free/comment/delete_check', 'free_comment_delete_form', tagId, 'con_popup2');
	},
	
	// word
	wordCreate: function() {
		this.open('/word/create_check', 'word_create_form');
	},
	
	wordExplanationCreate: function() {
		this.open('/word/explanation/create_check', 'word_explanation_create_form', null, null, {popupClass:'con_popup_explanation_create', top:-120});
	},
	
	wordExplanationDelete: function(id, tagId) {
		$('delete_id').value = id;
		this.open('/word/explanation/delete_check', 'word_explanation_delete_form', tagId, 'con_popup2');
	},
	
	userCommentCreate: function() {
		this.open('/user/comment/create_check', 'user_comment_create_form');
	},
	
	userCommentDelete: function(id, userId, tagId) {
		$('id').value = id;
		$('user_id').value = userId;
		this.open('/user/comment/delete_check', 'user_comment_delete_form', tagId, 'con_popup2');
	}
}