function getCalendar(txtId, btnId){
    strLocalLanguage = getLocalLanguage();
    jQuery("#" + txtId).datepicker($.datepicker.regional[strLocalLanguage]);
    jQuery("#" + txtId).datepicker('option', 'changeMonth', true);
    jQuery("#" + txtId).datepicker('option', 'changeYear', true);

    // 不要なスタイルクラスを削除
    var dp = jQuery("#" + txtId).datepicker("widget");
    dp.removeClass("ui-helper-hidden-accessible");

    jQuery("#" + btnId).removeAttr("onclick");
    jQuery("#" + txtId).focus();
    jQuery("#" + btnId).click(function(){
        jQuery("#" + txtId).focus();
        return false;
    });
}

/*yahoo calendar
//getCalendar
function getCalendar(txtId, btnId){
	if(jQuery("body").attr("curDateBtn") == btnId){
		return;
	}

    var Event = YAHOO.util.Event,
    Dom = YAHOO.util.Dom,
    dialog,
    calendar;

	var showBtn = Dom.get(btnId);
	Event.on(showBtn, "click", function() {
    // Lazy Dialog Creation - Wait to create the Dialog, and setup document click listeners, until the first time the button is clicked.
    if (!dialog || jQuery("body").attr("curDateBtn") != btnId) {
        // Hide Calendar if we click anywhere in the document other than the calendar
        Event.on(document, "click", function(e) {
            jQuery("document").removeAttr("onclick");
            var el = Event.getTarget(e);
            var dialogEl = dialog.element;
            if (el != dialogEl && !Dom.isAncestor(dialogEl, el) && el != showBtn && !Dom.isAncestor(showBtn, el)) {
                dialog.hide();
            }
        });

        function resetHandler() {
            // Reset the current calendar page to the select date, or
            // to today if nothing is selected.
            var selDates = calendar.getSelectedDates();
            var resetDate;

            if (selDates.length > 0) {
                resetDate = selDates[0];
            } else {
                resetDate = calendar.today;
            }

            calendar.cfg.setProperty("pagedate", resetDate);
            calendar.render();
        }

        function closeHandler() {
            dialog.hide();
        }

        dialog = new YAHOO.widget.Dialog("container", {
            visible:false,
            context:[btnId, "tl", "bl"],
            draggable:false,
            close:false
        });
        dialog.setBody('<div id="cal"></div>');
        dialog.render(document.body);

        dialog.showEvent.subscribe(function() {
            if (YAHOO.env.ua.ie) {
                // Since we're hiding the table using yui-overlay-hidden, we
                // want to let the dialog know that the content size has changed, when
                // shown
                dialog.fireEvent("changeContent");
            }
        });
    }

    // Lazy Calendar Creation - Wait to create the Calendar until the first time the button is clicked.
    if (!calendar || jQuery("body").attr("curDateBtn") != btnId) {

        calendar = new YAHOO.widget.Calendar("cal", {
            iframe:false,          // Turn iframe off, since container has iframe support.
            hide_blank_weeks:true  // Enable, to demonstrate how we handle changing height, using changeContent
        });

        eval(eval("calendar_" + getLocalLanguage() + "()"));

        calendar.render();
        calendar.selectEvent.subscribe(function() {
            if (calendar.getSelectedDates().length > 0) {

                var selDate = calendar.getSelectedDates()[0];

                // Pretty Date Output, using Calendar's Locale values
                //var wStr = calendar.cfg.getProperty("WEEKDAYS_LONG")[selDate.getDay()];
                var dStr = selDate.getDate();
                if(dStr.toString().length < 2){
                    dStr = "0" + dStr.toString();
                }
                var mStr = calendar.cfg.getProperty("MONTHS_SHORT")[selDate.getMonth()];
                var yStr = selDate.getFullYear();

                Dom.get(txtId).value = yStr + "/" + mStr + "/" + dStr;
            } else {
                Dom.get(txtId).value = "";
            }
            dialog.hide();
        });

        calendar.renderEvent.subscribe(function() {
            // Tell Dialog it's contents have changed, which allows
            // container to redraw the underlay (for IE6/Safari2)
            dialog.fireEvent("changeContent");
        });
    }

    var seldate = calendar.getSelectedDates();

    if (seldate.length > 0) {
        // Set the pagedate to show the selected date if it exists
        calendar.cfg.setProperty("pagedate", seldate[0]);
        calendar.render();
    }

    dialog.show();
    jQuery("#" + btnId).unbind("click", getCalendar);
	jQuery("#" + btnId).removeAttr("onclick");
	jQuery("#" + btnId).bind("click", getCalendar);
    jQuery("body").attr("curDateBtn", btnId);
    });

	//other explorer:firefox etc
    if( navigator.userAgent.toLowerCase().indexOf("firefox") >= 0 ||
            navigator.userAgent.toLowerCase().indexOf("safari") >= 0 ||
            navigator.userAgent.toLowerCase().indexOf("opera") >= 0){
	    // Lazy Dialog Creation - Wait to create the Dialog, and setup document click listeners, until the first time the button is clicked.
	    if (!dialog || jQuery("body").attr("curDateBtn") != btnId) {
	        // Hide Calendar if we click anywhere in the document other than the calendar
	        Event.on(document, "click", function(e) {
	            jQuery("document").removeAttr("onclick");
	            var el = Event.getTarget(e);
	            var dialogEl = dialog.element;
	            if (el != dialogEl && !Dom.isAncestor(dialogEl, el) && el != showBtn && !Dom.isAncestor(showBtn, el)) {
	                dialog.hide();
	            }
	        });

	        function resetHandler() {
	            // Reset the current calendar page to the select date, or
	            // to today if nothing is selected.
	            var selDates = calendar.getSelectedDates();
	            var resetDate;

	            if (selDates.length > 0) {
	                resetDate = selDates[0];
	            } else {
	                resetDate = calendar.today;
	            }

	            calendar.cfg.setProperty("pagedate", resetDate);
	            calendar.render();
	        }

	        function closeHandler() {
	            dialog.hide();
	        }

	        dialog = new YAHOO.widget.Dialog("container", {
	            visible:false,
	            context:[btnId, "tl", "bl"],
	            draggable:false,
	            close:false
	        });
	        dialog.setBody('<div id="cal"></div>');
	        dialog.render(document.body);

	        dialog.showEvent.subscribe(function() {
	            if (YAHOO.env.ua.ie) {
	                // Since we're hiding the table using yui-overlay-hidden, we
	                // want to let the dialog know that the content size has changed, when
	                // shown
	                dialog.fireEvent("changeContent");
	            }
	        });
	    }

	    // Lazy Calendar Creation - Wait to create the Calendar until the first time the button is clicked.
	    if (!calendar || jQuery("body").attr("curDateBtn") != btnId) {

	        calendar = new YAHOO.widget.Calendar("cal", {
	            iframe:false,          // Turn iframe off, since container has iframe support.
	            hide_blank_weeks:true  // Enable, to demonstrate how we handle changing height, using changeContent
	        });

	        eval(eval("calendar_" + getLocalLanguage() + "()"));

	        calendar.render();
	        calendar.selectEvent.subscribe(function() {
	            if (calendar.getSelectedDates().length > 0) {

	                var selDate = calendar.getSelectedDates()[0];

	                // Pretty Date Output, using Calendar's Locale values
	                //var wStr = calendar.cfg.getProperty("WEEKDAYS_LONG")[selDate.getDay()];
	                var dStr = selDate.getDate();
	                if(dStr.toString().length < 2){
	                    dStr = "0" + dStr.toString();
	                }
	                var mStr = calendar.cfg.getProperty("MONTHS_SHORT")[selDate.getMonth()];
	                var yStr = selDate.getFullYear();

	                Dom.get(txtId).value = yStr + "/" + mStr + "/" + dStr;
	            } else {
	                Dom.get(txtId).value = "";
	            }
	            dialog.hide();
	        });

	        calendar.renderEvent.subscribe(function() {
	            // Tell Dialog it's contents have changed, which allows
	            // container to redraw the underlay (for IE6/Safari2)
	            dialog.fireEvent("changeContent");
	        });
	    }

	    var seldate = calendar.getSelectedDates();

	    if (seldate.length > 0) {
	        // Set the pagedate to show the selected date if it exists
	        calendar.cfg.setProperty("pagedate", seldate[0]);
	        calendar.render();
	    }
	    dialog.show();
	}
}*/
