﻿// JavaScript Document
jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery("#dh1").mouseover(function(){setTab('dh',1,3);});
	jQuery("#dh1").mouseout(function(){setTout('dh',1);});
	
	//jQuery('#myformmyform').submit(function(){
	//	login_ajax();
	//	return false;
	//});
	/*function login_ajax(){
		var username_ajax = jQuery("#username_top").val();
		var password_ajax = jQuery("#password_top").val();
		var code_ajax = jQuery("#nocode").val();
		var notempty = "<br>&nbsp;*&nbsp;Can not be empty";
		if(username_ajax == ""){
			jQuery('#username_html').html(notempty);
			jQuery('#username_top').focus();
			return false;
		}else{
			jQuery('#username_html').html("");
		}
		if(password_ajax == ""){
			jQuery('#password_html').html(notempty);
			jQuery('#password_top').focus();
			return false;
		}else{
			jQuery('#password_html').html("");
		}
		if(code_ajax == ""){
			jQuery('#code_html').html(notempty);
			jQuery('#nocode').focus();
			return false;
		}else{
			jQuery('#code_html').html("");
		}
		
		jQuery.ajax({
			type: "POST",
			url: "/en/index.php?m=member&c=index&a=login",
			data: "dosubmit=login&username=" + username_ajax + "&password=" + password_ajax + "&nocode=" + code_ajax,
			beforeSend: function(){jQuery("confirm").html("Loading...");},
			success: function(msgs){
				if(msgs=="You have logged in successfully"){
					window.location.href="/en/index.php?m=member&c=index";
					return false;
					//jQuery("#con_dh_1").hide();
					//jQuery("#dh1").unbind();
					//setTout('dh',1);
					//jQuery("#dh1 .lise").html("<b>Welcome</b>&nbsp;&nbsp;<a href='/en/index.php?m=member&c=index'>"+username_ajax+"</a>&nbsp;&nbsp;<a href='/en/index.php?m=member&c=index&a=logout'>Logout</a>");
				}
				jQuery("#confirm").html(msgs);
			}
		});
	}*/
});

	function startRequest() {
		jQuery.ajax({
			type: "GET",
			url: "/jp/index.php?m=member&c=index&a=login_ajax&modd=ajax&random="+Math.random(),
			success: function(msgs){jQuery("#dh1").html(msgs);}
		});
	}
	startRequest();
