// [MODULE-HEADER]
// *************************************************************************************************
//
// Name:				DnxDatePicker.js
//
// Created:			06.01.2003 VisionOne AG, St. Gallen AB
// Modified:		08.10.2009 VisionOne AG, St. Gallen FBE : Fixed http/https problem
// Modified:		06.01.2003 VisionOne AG, St. Gallen AB	: Creation
//
// *************************************************************************************************

function showDatePicker ( urlBase, day, month, year, returnFunction )
{
	var httpsPrefix = "https://";
	if (window.location.href.indexOf(httpsPrefix) == 0) {
		// current page is ssl
		var httpPreffix = "http://";
		if (urlBase.indexOf(httpPreffix) == 0)
			urlBase = httpsPrefix + urlBase.substring(httpPreffix.length);		
	}
	
	showDatePickerPopUp( urlBase+"/DnxDatePicker.aspx", "DAY="+day+"&MONTH="+month+"&YEAR="+year+"&RETURNFUNCTION="+returnFunction);
}

function showDatePickerPopUp( popUpPage, arguments ) {
   windowArguments = "status=0,menubar=no,scrollbars=yes,resizable=yes,channelmode=0,dependent=0,directories=0";
   windowName = "popUpDatePicker";
   width = 230;
   height = 210;
   posX = 200;
   posY = 200;
   
   if (windowName == "") windowName = "popDialog";
   var posXString = "";
   if (posX >= 0) posXString = ',left='+posX+',screenX='+posX;
   var posYString = "";
   if (posY >= 0) posYString = ',top='+posY+',screenY='+posY;
   if (arguments != "") popUpPage = popUpPage+'?'+arguments
   detail = window.open(popUpPage,windowName,'width='+width+',height='+height+','+windowArguments+posXString+posYString);
   detail.focus()
}

