function AXPopup(strURL, intWidth, intHeight, intPosX, intPosY)
{
 var winPopup = new Object;
 
 if(intPosX == undefined) intPosX = (screen.width-intWidth)/2;
 if(intPosY == undefined) intPosY = (screen.height-intHeight)/2; 
 strValue = 'screenX='+ intPosX +', left='+ intPosX +', screenY='+ intPosY +', top='+ intPosY +', width='+ intWidth +', height='+ intHeight +', scrollbars';
 
 winPopup = open(strURL, 'winPopup', strValue); 
 window.onblur = function(){if(!winPopup.closed) winPopup.focus();}  
   
}

function pickDate(buttonObj,inputObject)
{
	tmpInputCalendar = buttonObj;
    calendarObjForForm.setCalendarPositionByHTMLElement(inputObject,0,inputObject.offsetHeight+2);
    calendarObjForForm.setInitialDateFromInput(inputObject,'dd-mm-yyyy');
    calendarObjForForm.addHtmlElementReference(buttonObj, inputObject);
    
	if(calendarObjForForm.isVisible())
	{
        calendarObjForForm.hide();
    }else{
        calendarObjForForm.resetViewDisplayedMonth();
        calendarObjForForm.display();
    }		
}

function getDateFromCalendar(inputArray)
{
 var references = calendarObjForForm.getHtmlElementReferences(); // Get back reference to form field.
 references[tmpInputCalendar].value = inputArray.day +'/'+ inputArray.month + '/' + inputArray.year;
 calendarObjForForm.hide();    
}
