// 날짜 선택박스 호출 처리
$(function() {
	// AB_datepicker 클래스에 캘린더 배정
	// numberOfMonths:3
	// minDate:-20, maxDate:"+1M +10D"
	// showOn:"button", buttonImage:"/tools/calendar/form_input_type/cal.gif", buttonImageOnly:true
	$(".AB_datepicker").datepicker({dateFormat:'yy-mm-dd', showOtherMonths:true, selectOtherMonths:true})
	$(".ui-datepicker").attr({ 'style' : 'width: 17em; padding: .2em .2em 0; font-size:75%;' });

	// 입력용 추가클래스(AB_datepicker_time) 지정된 경우 처리
	var now = new Date();
	$(".AB_datepicker_time").datepicker('option', 'dateFormat' , 'yy-mm-dd ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds());

	// 버튼넣기
	$(".AB_datepicker_btn").datepicker('option', 'showOn' , 'button');
	$(".AB_datepicker_btn").datepicker('option', 'buttonImage' , '/include/images/cal.gif');
	$(".AB_datepicker_btn").datepicker('option', 'buttonImageOnly' , 'true');
	$(".AB_datepicker_btn").datepicker('option', 'buttonText' , 'calendar');
	$("img.ui-datepicker-trigger").attr({ 'style' : 'margin:0 0 -4px 2px;' });									// 버튼 여백 조정

	// 드래그객체
	$( ".draggable" ).draggable({ scroll: true });

	// 마우스 좌표 얻음
	__mouse_xy = new Array();
	$(this).bind('mousemove',function(e){ 		
		__mouse_xy[0] = e.pageX;
		__mouse_xy[1] = e.pageY;
		__mouse_xy[2] = e.screenX;
		__mouse_xy[3] = e.screenY;
	});

	/* 커서의 위치를 찾는 함수 new function($) { 
	$.fn.getCursorPosition = function() { 
		 var pos = 0; 
		 var el = $(this).get(0); 
		 // IE Support 
		 if (document.selection) { 
			  el.focus(); 
			  var Sel = document.selection.createRange(); 
			  var SelLength = document.selection.createRange().text.length; 
			  Sel.moveStart('character', -el.value.length); 
			  pos = Sel.text.length - SelLength; 
		 } 
		 // Firefox support 
		 else if (el.selectionStart || el.selectionStart == '0') 
			  pos = el.selectionStart; 
	 
		 return pos; 
	} 
	} (jQuery);

	Basically, to use it on a text box, do the following:

	$("#myTextBoxSelector").getCursorPosition();*/

});
