function Login() {
	new Ajax.Request('http://www.junjin-japan.com', { method:"post", parameters:Form.serialize('loginForm'), onComplete:location.reload});
}
function RegistForm() {
	location.href = 'http://www.junjin-japan.com/regist/';
}
function rightClick(e) {
	menuX = e.pageX - 10;
	menuY = e.pageY - 10;
	jQuery("div#rightMenu").css('display','block');
	jQuery("div#rightMenu").css('position','absolute').css('top',menuY+'px').css('left',menuX+'px');
	return false;
}
function showData(request) {
	alert(request.responseText);
}
function rightMenu() {
	if (document.all) {
		menuX = event.clientX - 10;
		menuY = event.clientY + document.documentElement.scrollTop -10;
	}
	jQuery("div#rightMenu").css('display','block');
	jQuery("div#rightMenu").css('position','absolute').css('top',menuY+'px').css('left',menuX+'px');
}
function closeRightMenu() {
	jQuery("div#rightMenu").css('display','none');
}
function newsOpen(id,title) {
	jQuery('#'+title).css('background','#131E59');
	if (document.getElementById(id).style.display == 'block') {
		jQuery('#'+id).css('display','none');
		jQuery('#'+title).css('background','');
	} else {
		jQuery('.newsBody').css('display','none');
		jQuery('#'+id).css('display','block');
		jQuery('#'+title).css('background','#131E59');
	}
}
function newsTitle(id,title) {
	if (document.getElementById(title).style.background == '#131E59') {
		jQuery('#'+title).css('background','');
	} else {
		jQuery('.newsTitle').css('background','');
		jQuery('#'+title).css('background','#131E59');
	}
}
function eventOpen(id,title) {
	if (document.getElementById(id).style.display == 'block') {
		jQuery('#'+id).css('display','none');
	} else {
		jQuery('.eventBody').css('display','none');
		jQuery('#'+id).css('display','block');
	}
}
function changeCategory(cate) {
	location.href = 'http://www.junjin-japan.com/goods/'+cate;
}
function goTo(page) {
	location.href = page;
}
function goNews(formName) {
	document.formName.submit();
}
function mOver(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + "2.gif";
}
function mOut(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + "1.gif";
}
function PngOver(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + "2.png";
}
function PngOut(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + "1.png";
}
function GifOver(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + "_01.gif";
}
function GifOut(obj) {
	obj.src = 'http://www.junjin-japan.com/images/' + obj.id + ".gif";
}
function writeBG(category) {
	image = 'http://www.junjin-japan.com/images/bgPhoto/'+category+'.jpg';
	jQuery('#ContentsBody').css('background-image','url('+image+')');
}
var PopupCnt=0;
function forgetID() {
}
function PopupDisplay(page,w,h,formName) {
	Title = '　';
    Box_w = w;
	Box_h = h;
	var page_html = "http://www.junjin-japan.com/"+page;
	new Ajax.Request(page_html, { method:"post", parameters:Form.serialize(formName), onComplete:ResultPopup});
    jQuery('.pullDownSelect').css('visibility','hidden');
}
function PopupSchedule(code,title) {
	Title = title;
	Box_w = 330;
	Box_h = 280;
	var page_html = "http://www.junjin-japan.com/calendar?code="+code;
	new Ajax.Request(page_html, { method:"post", onComplete:ResultPopup});
}
function ResultPopup(httpobj) {
//	if (PopupCnt > 0) popup.closePopup();
	var txt=httpobj.responseText;
	var options={
		hideOnClick: false,
		zIndex     : ++PopupCnt   // ensures shadows layer correctly
	};
	var w = Math.floor(Box_w);
	var h = Math.floor(Box_h);
	
	popup=new Rico.Popup(options);
	popup.options.canDragFunc=true;
	popup.createWindow(Title, txt,h+'px',w+'px');

	popup.contentDiv.style.backgroundColor="#FFFFFF";

	var x = Math.floor((RicoUtil.windowWidth()-w)/2);
	var y = Math.floor((RicoUtil.windowHeight()-h)/2)-20;
	popup.openPopup(x,y);
	if(navigator.userAgent.indexOf("MSIE 6") == -1) {
		jQuery('.ricoWindow').css('position','fixed');
	} else {
		sy = document.documentElement.scrollTop;
		jQuery('.ricoWindow').css('top',y+sy);
	}
}
