function openContentsLayer(contentsname) {
	$('main').setAttribute('openlayer', 'medialayer');
	closeMenu();
	lineContentsLayer(contentsname);
	$('main-topmenu').setAttribute('lock', 1);
	$('medialayer').setAttribute('x', 5);
	$('medialayer').setAttribute('lock', 1);
	$('medialayer').morph('margin-left: 5px;', {delay: 0.8, duration : 1.0});
}

function lineContentsLayer(contentsname) {
	if(contentsname == 'inquiry') {
		new Ajax.Request(
			'/form/'+contentsname+'.php', {
				method:"get",
				onSuccess : function(httpObj) {
					setMediaLayer(httpObj.responseText);
				},
				onFailure : function(httpObj) {
					setMediaLayer('');
					Modalbox.show('<p class="center">Sorry, cannot load informations.</p>', { title: "Caution!!" });
				}
			}
		);
	} else if(contentsname == 'reinquiry' || contentsname == 'confirm' || contentsname == 'send') {
		new Ajax.Request(
			'/form/'+contentsname+'.php', {
				method:"post",
				parameters: Form.serialize('form'),
				onSuccess : function(httpObj) {
					setMediaLayer(httpObj.responseText);
				},
				onFailure : function(httpObj) {
					setMediaLayer('');
					Modalbox.show('<p class="center">Sorry, cannot load informations.</p>', { title: "Caution!!" });
				}
			}
		);
	} else {
		new Ajax.Request(
			'/contents/'+contentsname+'.txt', {
				method: "get",
				parameters: "cache=" + (new Date()).getTime(),
				onSuccess : function(httpObj) {
					setMediaLayer(httpObj.responseText);
				},
				onFailure : function(httpObj) {
					setMediaLayer('');
					Modalbox.show('<p class="center">Sorry, cannot load informations.</p>', { title: "Caution!!" });
				}
			}
		);
	}
}
