// JavaScript Document
var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/jquery-1.7.1.js",false);xhr.send("");eval(xhr.responseText);

var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/yahho-calendar.js",false);xhr.send("");eval(xhr.responseText);

var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/gcalendar-holidays.js",false);xhr.send("");eval(xhr.responseText);

YahhoCal.loadYUI();

var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/chili/jquery.chili-2.2.js",false);xhr.send("");eval(xhr.responseText);

var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/jquery.cycle.all.js",false);xhr.send("");eval(xhr.responseText);

var xhr=null;
if (window.XMLHttpRequest)xhr=new XMLHttpRequest();
else if(window.ActiveXObject)
    try {xhr=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP");}
xhr.open("GET","/js/jquery.easing.1.3.js",false);xhr.send("");eval(xhr.responseText);

$(window).load(function() {
	$("#top_image").css("visibility", "visible");
	$("#top_image").after("<div id=\"nav\"></div>").cycle({
		fx: "fade",
		speed: 1000,
		timeout: 5000,
        pager: "#nav",
		pause: 1
	});
});

function funcZipSearch (formName) {
	var j = 0;

	with (formName) {
		for (i=0; i<elements.length; i++) {
			if (elements[i].name == "zip1") {
				if (elements[i].value.length != 3) {
					j++;
				}
			}
			if (elements[i].name == "zip2") {
				if (elements[i].value.length != 4) {
					j++;
				}
			}
		}

		if (j > 0) {
			alert("郵便番号が正しく入力されていません");
		} else {
			window.open('./zip_search.php', 'zip_search', 'width=400, height=400, menubar=no, toolbar=no, location=no, status=no, resizable=yes, scrollbars=yes');

			action = "./zip_search.php";
			target = "zip_search";
			submit();
		}
		return false;
	}
}

function funcZipInput (formName) {
	window.opener.document.forms[0].elements["prefecture_id"].value = window.document.forms[formName].elements["prefecture_id"].value;
	window.opener.document.forms[0].elements["address1"].value = window.document.forms[formName].elements["address1"].value;
	window.close();
	return false;
}

function funcFormCheck (formName) {
	with (formName) {
		action = "";
		target = "_self";
		submit();
	}
}

