﻿var txt1 = "日本語で入力してください。";
var txt2 = "都道府県から入力してください。";


function getObj(name)
{
	if (document.getElementById)
		this.obj = document.getElementById(name);
	else if (document.all)
		this.obj = document.all[name];
	return this.obj;
}
function initControl()
{
	JFamilyName = getObj("ctl00_Holder_JFamilyName");
	JFirstName = getObj("ctl00_Holder_JFirstName");
	JAddress1 = getObj("ctl00_Holder_JAddress1");
	JCompanyName = getObj("ctl00_Holder_JCompanyName");
	JCompanyAddress1 = getObj("ctl00_Holder_JCompanyAddress1");

	setEmpty(JFamilyName, txt1);
	setEmpty(JFirstName, txt1);
	setEmpty(JAddress1, txt2);
	setEmpty(JCompanyName, txt1);
	setEmpty(JCompanyAddress1, txt2);
	
}
function setEmpty( obj, txt )
{
	if (obj != null)
	{
		if ((obj.value.length == 0) || (obj.value == txt))
		{
			obj.style.color = "#808080";
		}
		else
		{
			obj.style.color = "#000000";
		}
		if (obj.value.length == 0)
		{
			obj.value = txt;
		}
		obj.onfocus = function()
		{
			if ((this.value.length != 0) && ((this.value == txt1) || (this.value == txt2)))
			{
				this.value = "";
			}
		};
		obj.onblur = function()
		{
			if (this.value.length == 0)
			{
				this.style.color = "#808080";
				if ((this.id == "ctl00_Holder_JAddress1") ||
					(this.id == "ctl00_Holder_JCompanyAddress1"))
				{
					this.value = txt2;
				}
				else
				{
					this.value = txt1;
				}
			}
			else
			{
				this.style.color = "#000000";
			}
		};
	}
}

function loginHover(obj) {
    if (obj.src.match("/Common/images/login_btn_1.gif")) {
        obj.src = "./Common/images/login_btn_2.gif";
    } else {
        obj.src = "./Common/images/login_btn_1.gif";
    }
}

