// Calendar °ü·ÃÇÔ¼ö start ---------------------------------------------------------------------------------------------------------
var strTarget;
var intTime;
var objCal;

document.domain="vuple.co.kr";

document.writeln('<div id="minical" onmouseover="gfnCalendarOver()" onmouseout="gfnCalendarOut()" style="background: buttonface; margin:2; border: 1 solid buttonshadow; width:143; display:none; position:absolute; z-index:1">');
document.writeln('<iframe id="ifrCalendar" width=143 height=130 src="/inc/calendar.html" scrolling=no frameborder=no border=1 bordercolor=red></iframe>');
document.writeln('</div>');

function gfnCalendarOver() {
	window.clearTimeout(intTime);
}

function gfnCalendarOut() {
	intTime=window.setTimeout("objCal.style.display='none';", 200);
}

function gfnCalendarClick(e) {
	cal_Day = e.title;
	if (cal_Day.length > 6) {
		strTarget.value = cal_Day
	}	
	objCal.style.display='none';
}

function gfnSetCalendarDay(obj) {
	var now = obj.value.split("-");
	strTarget = obj;															

	var top = document.body.clientTop + gfnGetObjectTop(obj);
	var left = document.body.clientLeft + gfnGetObjectLeft(obj);

	objCal = document.all.minical;
	objCal.style.pixelTop = top + obj.offsetHeight;
	objCal.style.pixelLeft = left;
	objCal.style.display = '';
	
	if (now.length == 3) {											
		ifrCalendar.Show_cal(now[0],now[1],now[2]);					
	} else {
		now = new Date();
		ifrCalendar.Show_cal(now.getFullYear(), now.getMonth()+1, now.getDate());
	}
}

function gfnSetCalendarMonth(obj) {
	var now = obj.value.split("-");
	strTarget = obj;															

	var top = document.body.clientTop + gfnGetObjectTop(obj);
	var left = document.body.clientLeft + gfnGetObjectLeft(obj);

	objCal = document.all.minical;
	objCal.style.pixelTop = top + obj.offsetHeight;
	objCal.style.pixelLeft = left;
	objCal.style.display = '';
	
	if (now.length == 2) {
		ifrCalendar.Show_cal_M(now[0],now[1]);					
	} else {
		now = new Date();
		ifrCalendar.Show_cal_M(now.getFullYear(), now.getMonth()+1);
	}
}

/**
	HTML °³Ã¼¿ë À¯Æ¿¸®Æ¼ ÇÔ¼ö
**/
function gfnGetObjectTop(obj)
{
	if (obj.offsetParent == document.body)
		return obj.offsetTop;
	else
		return obj.offsetTop + gfnGetObjectTop(obj.offsetParent);
}

function gfnGetObjectLeft(obj)
{
	if (obj.offsetParent == document.body)
		return obj.offsetLeft;
	else
		return obj.offsetLeft + gfnGetObjectLeft(obj.offsetParent) - 0;
}
// Calendar °ü·ÃÇÔ¼ö end ---------------------------------------------------------------------------------------------------------
