function brandChange() {
    var f = window.document.the_form;
    f.action = "";
    f.target="";
    f.submit();
}

function do_send() {
	if(confirm("M܂B\n낵łH")){
		document.the_form.action.disabled = true;
		return true;
	}
	return false;
}

function SetChar()
{
var f = window.document.the_form;

f.name1.value="";
f.name2.value="";
f.c_name.value="";
f.p_name.value="";
f.message.value="";
f.name1.value="";
f.name2.value="";
f.kana1.value="";
f.kana2.value="";
f.mail.value="";
f.tel1.value="";
f.tel2.value="";
f.tel3.value="";
f.fax1.value="";
f.fax2.value="";
f.fax3.value="";
f.area.value="0";
f.zip1.value="";
f.zip2.value="";
f.add1.value="";
f.add2.value="";
f.add3.value="";
f.stay.value="";

}

function SetChar_i()
{
var f = window.document.the_form;

f.i_name1.value="";
f.i_name2.value="";
f.i_c_name.value="";
f.i_p_name.value="";
f.i_message.value="";
f.i_name1.value="";
f.i_name2.value="";
f.i_kana1.value="";
f.i_kana2.value="";
f.i_mail.value="";
f.i_tel1.value="";
f.i_tel2.value="";
f.i_tel3.value="";
f.i_fax1.value="";
f.i_fax2.value="";
f.i_fax3.value="";
f.i_area.value="0";
f.i_zip1.value="";
f.i_zip2.value="";
f.i_add1.value="";
f.i_add2.value="";
f.i_add3.value="";
f.i_hp1.value="";
f.i_hp2.value="";
f.i_hp3.value="";
f.i_stay.value="";

}

function SetChar_l()
{
var f = window.document.the_form;

f.l_name1.value="";
f.l_name2.value="";
f.l_c_name.value="";
f.l_p_name.value="";
f.l_message.value="";
f.l_name1.value="";
f.l_name2.value="";
f.l_kana1.value="";
f.l_kana2.value="";
f.l_mail.value="";
f.l_tel1.value="";
f.l_tel2.value="";
f.l_tel3.value="";
f.l_fax1.value="";
f.l_fax2.value="";
f.l_fax3.value="";
f.l_area.value="0";
f.l_zip1.value="";
f.l_zip2.value="";
f.l_add1.value="";
f.l_add2.value="";
f.l_add3.value="";
f.l_hp1.value="";
f.l_hp2.value="";
f.l_hp3.value="";
f.l_stay.value="";

}

function SetChar_t()
{
var f = window.document.the_form;

f.t_name1.value="";
f.t_name2.value="";
f.t_c_name.value="";
f.t_p_name.value="";
f.t_message.value="";
f.t_name1.value="";
f.t_name2.value="";
f.t_kana1.value="";
f.t_kana2.value="";
f.t_mail.value="";
f.t_tel1.value="";
f.t_tel2.value="";
f.t_tel3.value="";
f.t_fax1.value="";
f.t_fax2.value="";
f.t_fax3.value="";
f.t_area.value="0";
f.t_zip1.value="";
f.t_zip2.value="";
f.t_add1.value="";
f.t_add2.value="";
f.t_add3.value="";
f.t_hp1.value="";
f.t_hp2.value="";
f.t_hp3.value="";
f.t_date.value="1";

}

function SetChar_d()
{
var f = window.document.the_form;

f.d_name1.value="";
f.d_name2.value="";
f.d_c_name.value="";
f.d_p_name.value="";
f.d_name1.value="";
f.d_name2.value="";
f.d_kana1.value="";
f.d_kana2.value="";
f.d_mail.value="";
f.d_area.value="0";
f.d_zip1.value="";
f.d_zip2.value="";
f.d_add1.value="";
f.d_add2.value="";
f.d_add3.value="";
f.d_area2.value="0";
f.d_zip3.value="";
f.d_zip4.value="";
f.d_add4.value="";
f.d_add5.value="";
f.d_add6.value="";
f.d_name3.value="";
f.d_tel1.value="";
f.d_tel2.value="";
f.d_tel3.value="";
f.d_fax1.value="";
f.d_fax2.value="";
f.d_fax3.value="";
f.title.value="0";

}

function checkSeminar() {
  var f = window.document.the_form;
    // Ж
	if (f.c_name.value =="") {
		alert("MЖ͂Ă");
		f.c_name.focus();
		return false;
	}
	if (f.name1.value =="") {
		alert("Fgh͂Ă");
		f.name1.select();
		f.name1.focus();
		return false;
	}
	if (f.name2.value =="") {
		alert("Fgh͂Ă");
		f.name2.select();
		f.name2.focus();
		return false;
	}
		if (f.kana1.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.kana1.select();
		f.kana1.focus();
		return false;
	}
		if (f.kana2.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.kana2.select();
		f.kana2.focus();
		return false;
	}
	if (f.mail.value =="") {
		alert("[AhX͂Ă");
		f.mail.select();
		f.mail.focus();
		return false;
	}
		if (f.zip1.value =="") {
		alert("X֔ԍ͂Ă");
		f.zip1.select();
		f.zip1.focus();
		return false;
	}
		if (f.zip2.value =="") {
		alert("X֔ԍ͂Ă");
		f.zip2.select();
		f.zip2.focus();
		return false;
	}
		if (f.area.value =="0") {
		alert("s{IĂ");
		f.area.focus();
		return false;
	}
		if (f.add1.value =="") {
		alert("MЂZ͂Ă");
		f.add1.select();
		f.add1.focus();
		return false;
	}
		if (f.add2.value =="") {
		alert("MЂZ͂Ă");
		f.add2.select();
		f.add2.focus();
		return false;
	}
		if (f.tel1.value =="") {
		alert("dbԍ͂Ă");
		f.tel1.select();
		f.tel1.focus();
		return false;
	}
		if (f.tel2.value =="") {
		alert("dbԍ͂Ă");
		f.tel2.select();
		f.tel2.focus();
		return false;
	}
		if (f.tel3.value =="") {
		alert("dbԍ͂Ă");
		f.tel3.select();
		f.tel3.focus();
		return false;
	}
	return true;
}

function checkTel() {
  var f = window.document.the_form;
    // Ж
	if (f.t_c_name.value =="") {
		alert("MЖ͂Ă");
		f.t_c_name.focus();
		return false;
	}
	if (f.t_name1.value =="") {
		alert("Fgh͂Ă");
		f.t_name1.select();
		f.t_name1.focus();
		return false;
	}
	if (f.t_name2.value =="") {
		alert("Fgh͂Ă");
		f.t_name2.select();
		f.t_name2.focus();
		return false;
	}
		if (f.t_kana1.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.t_kana1.select();
		f.t_kana1.focus();
		return false;
	}
		if (f.t_kana2.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.t_kana2.select();
		f.t_kana2.focus();
		return false;
	}
	if (f.t_mail.value =="") {
		alert("[AhX͂Ă");
		f.t_mail.select();
		f.t_mail.focus();
		return false;
	}
		if (f.t_zip1.value =="") {
		alert("X֔ԍ͂Ă");
		f.t_zip1.select();
		f.t_zip1.focus();
		return false;
	}
		if (f.t_zip2.value =="") {
		alert("X֔ԍ͂Ă");
		f.t_zip2.select();
		f.t_zip2.focus();
		return false;
	}
		if (f.t_area.value =="0") {
		alert("s{IĂ");
		f.t_area.focus();
		return false;
	}
		if (f.t_add1.value =="") {
		alert("MЂZ͂Ă");
		f.t_add1.select();
		f.t_add1.focus();
		return false;
	}
		if (f.t_add2.value =="") {
		alert("MЂZ͂Ă");
		f.t_add2.select();
		f.t_add2.focus();
		return false;
	}
		if (f.t_tel1.value =="") {
		alert("dbԍ͂Ă");
		f.t_tel1.select();
		f.t_tel1.focus();
		return false;
	}
		if (f.t_tel2.value =="") {
		alert("dbԍ͂Ă");
		f.t_tel2.select();
		f.t_tel2.focus();
		return false;
	}
		if (f.t_tel3.value =="") {
		alert("dbԍ͂Ă");
		f.t_tel3.select();
		f.t_tel3.focus();
		return false;
	}
	if (f.t_date.value =="") {
		alert("]IĂ");
		f.t_date.select();
		f.t_date.focus();
		return false;
	}
	return true;
}

function checkInquiry() {
  var f = window.document.the_form;
    // Ж
	if (f.i_c_name.value =="") {
		alert("MЖ͂Ă");
		f.i_c_name.focus();
		return false;
	}
	if (f.i_name1.value =="") {
		alert("Fgh͂Ă");
		f.i_name1.select();
		f.i_name1.focus();
		return false;
	}
	if (f.i_name2.value =="") {
		alert("Fgh͂Ă");
		f.i_name2.select();
		f.i_name2.focus();
		return false;
	}
		if (f.i_kana1.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.i_kana1.select();
		f.i_kana1.focus();
		return false;
	}
		if (f.i_kana2.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.i_kana2.select();
		f.i_kana2.focus();
		return false;
	}
	if (f.i_mail.value =="") {
		alert("[AhX͂Ă");
		f.i_mail.select();
		f.i_mail.focus();
		return false;
	}
		if (f.i_zip1.value =="") {
		alert("X֔ԍ͂Ă");
		f.i_zip1.select();
		f.i_zip1.focus();
		return false;
	}
		if (f.i_zip2.value =="") {
		alert("X֔ԍ͂Ă");
		f.i_zip2.select();
		f.i_zip2.focus();
		return false;
	}
		if (f.i_area.value =="0") {
		alert("s{IĂ");
		f.i_area.focus();
		return false;
	}
		if (f.i_add1.value =="") {
		alert("MЂZ͂Ă");
		f.i_add1.select();
		f.i_add1.focus();
		return false;
	}
		if (f.i_add2.value =="") {
		alert("MЂZ͂Ă");
		f.i_add2.select();
		f.i_add2.focus();
		return false;
	}
		if (f.i_tel1.value =="") {
		alert("dbԍ͂Ă");
		f.i_tel1.select();
		f.i_tel1.focus();
		return false;
	}
		if (f.i_tel2.value =="") {
		alert("dbԍ͂Ă");
		f.i_tel2.select();
		f.i_tel2.focus();
		return false;
	}
		if (f.i_tel3.value =="") {
		alert("dbԍ͂Ă");
		f.i_tel3.select();
		f.i_tel3.focus();
		return false;
	}
	if (f.i_message.value =="") {
		alert("e͂Ă");
		f.i_message.select();
		f.i_message.focus();
		return false;
	}
	return true;
}

function checkLecture() {
  var f = window.document.the_form;
    // Ж
	if (f.l_c_name.value =="") {
		alert("MЖ͂Ă");
		f.l_c_name.focus();
		return false;
	}
	if (f.l_name1.value =="") {
		alert("Fgh͂Ă");
		f.l_name1.select();
		f.l_name1.focus();
		return false;
	}
	if (f.l_name2.value =="") {
		alert("Fgh͂Ă");
		f.l_name2.select();
		f.l_name2.focus();
		return false;
	}
		if (f.l_kana1.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.l_kana1.select();
		f.l_kana1.focus();
		return false;
	}
		if (f.l_kana2.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.l_kana2.select();
		f.l_kana2.focus();
		return false;
	}
	if (f.l_mail.value =="") {
		alert("[AhX͂Ă");
		f.l_mail.select();
		f.l_mail.focus();
		return false;
	}
		if (f.l_zip1.value =="") {
		alert("X֔ԍ͂Ă");
		f.l_zip1.select();
		f.l_zip1.focus();
		return false;
	}
		if (f.l_zip2.value =="") {
		alert("X֔ԍ͂Ă");
		f.l_zip2.select();
		f.l_zip2.focus();
		return false;
	}
		if (f.l_area.value =="0") {
		alert("s{IĂ");
		f.l_area.focus();
		return false;
	}
		if (f.l_add1.value =="") {
		alert("MЂZ͂Ă");
		f.l_add1.select();
		f.l_add1.focus();
		return false;
	}
		if (f.l_add2.value =="") {
		alert("MЂZ͂Ă");
		f.l_add2.select();
		f.l_add2.focus();
		return false;
	}
		if (f.l_tel1.value =="") {
		alert("dbԍ͂Ă");
		f.l_tel1.select();
		f.l_tel1.focus();
		return false;
	}
		if (f.l_tel2.value =="") {
		alert("dbԍ͂Ă");
		f.l_tel2.select();
		f.l_tel2.focus();
		return false;
	}
		if (f.l_tel3.value =="") {
		alert("dbԍ͂Ă");
		f.l_tel3.select();
		f.l_tel3.focus();
		return false;
	}
	return true;
}

function checkDvd() {
  var f = window.document.the_form;
    // Ж
	if (f.d_c_name.value =="") {
		alert("MЖ͂Ă");
		f.d_c_name.focus();
		return false;
	}
	if (f.d_name1.value =="") {
		alert("Fgh͂Ă");
		f.d_name1.select();
		f.d_name1.focus();
		return false;
	}
	if (f.d_name2.value =="") {
		alert("Fgh͂Ă");
		f.d_name2.select();
		f.d_name2.focus();
		return false;
	}
		if (f.d_kana1.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.d_kana1.select();
		f.d_kana1.focus();
		return false;
	}
		if (f.d_kana2.value =="") {
		alert("ӂ肪Ȃ͂Ă");
		f.d_kana2.select();
		f.d_kana2.focus();
		return false;
	}
	if (f.d_mail.value =="") {
		alert("[AhX͂Ă");
		f.d_mail.select();
		f.d_mail.focus();
		return false;
	}
		if (f.d_zip1.value =="") {
		alert("X֔ԍ͂Ă");
		f.d_zip1.select();
		f.d_zip1.focus();
		return false;
	}
		if (f.d_zip2.value =="") {
		alert("X֔ԍ͂Ă");
		f.d_zip2.select();
		f.d_zip2.focus();
		return false;
	}
		if (f.d_area.value =="0") {
		alert("s{IĂ");
		f.d_area.focus();
		return false;
	}
		if (f.d_add1.value =="") {
		alert("MЂZ͂Ă");
		f.d_add1.select();
		f.d_add1.focus();
		return false;
	}
		if (f.d_add2.value =="") {
		alert("MЂZ͂Ă");
		f.d_add2.select();
		f.d_add2.focus();
		return false;
	}
		if (f.d_tel1.value =="") {
		alert("dbԍ͂Ă");
		f.d_tel1.select();
		f.d_tel1.focus();
		return false;
	}
		if (f.d_tel2.value =="") {
		alert("dbԍ͂Ă");
		f.d_tel2.select();
		f.d_tel2.focus();
		return false;
	}
		if (f.d_tel3.value =="") {
		alert("dbԍ͂Ă");
		f.d_tel3.select();
		f.d_tel3.focus();
		return false;
	}
		if (f.title.value =="0") {
		alert("cuc^CgIĂ");
		f.title.focus();
		return false;
	}
	return true;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ChangeParent()
{
	window.opener.location.href="seminar.php";
}

function MakeChild()
{
	window.open("seminar_dm.html","","width=200,height=200");
}


function change(obj){

	document.orderForm.action = "?page=order&action=change";
	document.orderForm.target = "_top";
	document.orderForm.submit();

}


function openwindow( url, winName, width, height)
{
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ))
{
xposition = (screen.width - width) / 2;
yposition = (screen.height - height) / 3;
}
theproperty= "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=1,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //Netscape
+ "screeny=" + yposition + "," //Netscape
+ "left=" + xposition + "," //IE
+ "top=" + yposition; //IE
window.open( url,winName,theproperty );
}


// Example:
// onMouseOver="toolTip('tool tip text here')";
// onMouseOut="toolTip()";
// -or-
/*
MOVE this to the <body>:
*/
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 20;
offsetY = -60;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg, fg, bg)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="0"><font face="sans-serif" color="' + fg +
    '">' + msg +
    '</font></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

//end




function checkPassport(obj){
	col_normal = "#FFFFFF";
	col_error  = "#FFFFFF";

	switch(obj.attr('id')){

	case 'loginid':

		var re=/^[a-zA-Z][a-zA-Z0-9_]{5,14}$/;

		if(!re.test($('#loginid').val()))
		{
			AddressError = true;
			Errors['loginid']= "*Invalid Login Id. \n";
		}
	break;


	case 'passwd':;
	case 'passwd_repeat':

		var re=/^[a-zA-Z0-9_~!@#$%^&*()-+=]{5,10}$/;

		if( (!re.test($('#passwd').val()) )
 		  || !($('#passwd').val() == $('#passwd_repeat').val()) )
		{
			AddressError = true;
			Errors['passwd']= "*Invalid Password Input.\n";
		}

		break;

	}

}



function checkPassport2(obj){
	col_normal = "#FFFFFF";
	col_error  = "#FFFFFF";

	switch(obj.attr('id')){

	case 'loginid':

		var re=/^[a-zA-Z][a-zA-Z0-9_]{5,14}$/;

		if(!re.test($('#loginid').val()))
		{
			AddressError = true;
			Errors['loginid']= "*Invalid Login Id. \n";
		}
	break;


	case 'passwd':;
	case 'passwd_repeat':

		var re=/^[a-zA-Z0-9_~!@#$%^&*()-+=]{5,10}$/;

		if( (!re.test($('#passwd').val()) )
 		  || !($('#passwd').val() == $('#passwd_repeat').val()) )
		{
			AddressError = true;
			Errors['passwd']= "*Invalid Password Input.\n";
		}

		break;

	}

}


function isValidMemberNo(str){
	var re=/^[0]{3}[0-9]{5}$/;
	return re.test(str);
}



/*    comm ajax login */

var options = {
	dataType: 'json',
	url:'?action=sublogin',
	beforeSubmit: function(formArray, jq){

		for(var i = 0; i < formArray.length; i ++){

			switch(formArray[i]['name']){
			case 'loginId':
				if( formArray[i]['value'].length <5 ){
					javascript:openwindow('id05.html','pop',600,320);
					return false;
					}
				break;

			case 'passwd':
				if( formArray[i]['value'].length < 1 ){
					javascript:openwindow('id05.html','pop',600,320);
					return false;
					}
				break;
			}
		}

		return true;
	},

	// 成功回应
	success: function(json) {
		if(json.result == 1){

		    $("#divLogin").empty();
			$("#divLogin").html(json.data);

		}else if(json.result == 2){
			window.location.href = json.data;
		}else{
			javascript:openwindow('id05.html','pop',600,320);
		}

	} };


function doLoginSubmit(id){
	$('#' + id ).ajaxSubmit(options);
}

function isTelnum(str){
	var re=/^\d{10,14}$/;
	return re.test(str);
}



//两个参数，一个是cookie的名子，一个是值
function SetCookie(name,value)
{
    var Days = 30;				//此 cookie 将被保存 30 天
    var exp  = new Date();		//new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

//取cookies函数
function getCookie(name)
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;

}

//删除cookie
function delCookie(name)
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}


function emptyLoginCookie(obj){

	if(!obj.checked){
		delCookie('key');
		if(document.loginform)
			document.loginform.loginId.value = '';
	}
}

var bCanLeave = true;
function setAllowVisitor(){
	bCanLeave = false;
	window.onbeforeunload = function (){
	try
	{
		 if(bCanLeave)
			return;
		 else
			return "Your order is not completed yet. Do you want to jump to another page? Click on “OK” button to jump to another page, Click on “Cancel” button to continue your shopping. ";
	}
	catch(e){}
  }
}


function canLeave(a){
	bCanLeave = true;
	return true;
}




function checkAddressValid(obj)
{
	col_normal = "#FFFFFF";
	col_error  = "#FFFFFF";

	switch(obj.attr('id')){
	case 'lname':;
	case 'fname':

		$("#name_input_div").css({
 			 background: col_normal});

		if( ($('#lname').val() =="")
		|| ($('#fname').val() == ""))
		{
			$("#name_input_div").css({
 			 background: col_error });

			Errors['name']= "*Invalid First Name or Invalid Family Name \n";
			AddressError = true;
		}
	break;



	case 'postcode':

		var re1=/^[\d-]{3,12}$/;

		if( !re1.test($('#postcode').val()) )
		{
			Errors['zip']= "*Invalid postcode number. \n";
			AddressError = true;
		}
	break;

	case 'prefecture':

		$("#prefecture_input_div").css({
 			 background: col_normal});

		if($('#prefecture').val().length == 0)
		{
			$("#prefecture_input_div").css({
 			 background: col_error });
			AddressError = true;
			Errors['prefecture']= "*Invalid prefecture name. \n";
		}
	break;


	case 'city':

		$("#city_input_div").css({
 			 background: col_normal});

		if($('#city').val().length == 0)
		{
			$("#city_input_div").css({
 			 background: col_error });
			Errors['city']= "*Invalid City name.\n";
			AddressError = true;
		}
	break;


	case 'street':

		$("#street_input_div").css({
 			 background: col_normal});

		if($('#street').val().length == 0)
		{
			$("#street_input_div").css({
 			 background: col_error });
			AddressError = true;
			Errors['street']= "*Invalid Street address \n";
		}
	break;


	case 'phone_number':

 		var re1=/^[\d-]{4,16}$/;


		if(!re1.test($('#phone_number').val()) )
		{
			AddressError = true;
			Errors['tele']= "*Invalid telephone number \n";
		}
	break;


	case 'fax_number':

 		var re1=/^[\d-]{0,16}$/;

		if(!re1.test($('#fax_number').val()) )
		{
			AddressError = true;
			Errors['tele']= "*Invalid fax number \n";
		}
	break;


	case 'mailaddress':;
	case 'mailaddressRepeat':

		var re=/^[\w-]+(\.[\w-]+)*@[\w- ]+(\.[\w-]+)+$/;
		if(!re.test($('#mailaddress').val())){
			$("#mailaddress_input_div").css({
	 			 background: col_error });
				AddressError = true;
				Errors['mailerr']= "*Invalid Mail address \n";

		}else if( ($('#mailaddressRepeat').attr('id') == 'mailaddressRepeat')
					 && !( $('#mailaddress').val() == $('#mailaddressRepeat').val()) )
			{
				AddressError = true;
				Errors['mailerr'] = "*Invalid Mail address \n";
			}

		break;



	}

}


function checkOtherAddr(obj)
{
	col_normal = "#FFFFFF";
	col_error = "#FFFFFF";

	switch(obj.attr('id')){
	case 'other_lname':;
	case 'other_fname':

		$("#other_name_input_div").css({
 			 background: col_normal});

		if( ($('#other_lname').val() =="")
		 || ($('#other_fname').val() == ""))
		{
			Errors['name']= "*Invalid First Name or Invalid Family Name \n";
			AddressError = true;
		}
	break;

	case 'other_postcode':
		var re1=/^[\d-]{3,12}$/;

		if( !re1.test($('#other_postcode').val()) )
		{
			Errors['zip']= "*Invalid other postcode number. \n";
			AddressError = true;
		}
	break;


	case 'other_prefecture':

		$("#other_prefecture_input_div").css({
 			 background: col_normal});

		if($('#other_prefecture').val().length == 0)
		{
			$("#other_prefecture_input_div").css({
 			 background: col_error });
			AddressError = true;
			Errors['prefecture']= "*Invalid prefecture name. \n";
		}
	break;

	case 'other_city':

		$("#other_city_input_div").css({
 			 background: col_normal});

		if($('#other_city').val().length == 0)
		{
			$("#other_city_input_div").css({
 			 background: col_error });
			Errors['city']= "*Invalid City name.\n";
			AddressError = true;
		}
	break;


	case 'other_street':

		$("#other_street_input_div").css({
 			 background: col_normal});

		if($('#other_street').val().length == 0)
		{
			$("#other_street_input_div").css({
 			 background: col_error });
			AddressError = true;
			Errors['street']= "*Invalid Street address \n";
		}
	break;

	case 'other_phone_number':

 		var re1=/^[\d-]{4,16}$/;


		if(!re1.test($('#other_phone_number').val()) )
		{
			AddressError = true;
			Errors['tele']= "*Invalid telephone number \n";
		}
	break;

	}
}


