	function ClearDayList(obj_selectDay)
	{
		var i;
		var intLength;
		intLength = obj_selectDay.options.length = 1;
	}
		
	function IsLeapYear(int_year)
	{
		var blnIsLeapYear = false;
		
		if ((((int_year % 4) == 0) && ((int_year % 100) != 0)) || ((int_year % 400) == 0))
		{
			blnIsLeapYear = true;
		}
		
		return(blnIsLeapYear);
	}
	
	function PopulateDays(obj_selectMonth, obj_selectDay, obj_selectYear, int_defaultDay)
	{
		ClearDayList(obj_selectDay);
		
		var intYear = obj_selectYear.options[obj_selectYear.selectedIndex].value
		
		if (IsLeapYear(intYear) == true)
		{
			arrDaysInMonth[2] = 29;
		}
		else
		{
			arrDaysInMonth[2] = 28;
		}
		
		var intDaysInMonth	= arrDaysInMonth[obj_selectMonth.selectedIndex];
		var intDay			= '';
		
		for (i = 1; i <= intDaysInMonth; i++)
		{
			intDay = '' + i + ''
			if (intDay.length == 1)
			{
				intDay = '0' + intDay;
			}
			obj_selectDay.options[i] = new Option(intDay, intDay, false, false);
		}
		
		var intSelectedIndex = 0;
		
		if (int_defaultDay != '')
		{
			intSelectedIndex = int_defaultDay;
		}
		else
		{
			intSelectedIndex = 0;
		}
		
		obj_selectDay.selectedIndex = intSelectedIndex;
		
	}
	
	function ConstructDate(txt_hiddenField, int_monthSelected, int_daySelected, int_yearSelected)
	{
		var txt_hiddenTemp;
		txt_hiddenTemp = int_monthSelected + '/' + int_daySelected + '/' + int_yearSelected;
		
		if(txt_hiddenTemp == '//')
		{
			txt_hiddenTemp = ''
		}
		
		txt_hiddenField.value = txt_hiddenTemp
	}
	
	
	function focusPopup(objPopup,theURL,winName,features,width,height)
	{
		var blnIsOpen = true;
		if (typeof(objPopup) != 'object') {
			blnIsOpen = false;
		} else if (objPopup.closed) {
			blnIsOpen = false;
		}
		if (blnIsOpen== false) {
			objPopup = returnPopup(theURL,winName,features,width,height);
		}
		 objPopup.focus();
		 return objPopup;
	}
	
	function openPopup(theURL,winName,features,width,height)
	{
		var winWidth	= width;
		var winHeight	= height;
		var strWinSize	= ",width=" + winWidth + ",height=" + winHeight;
	
		if (window.screen) {
			var winPosL = (screen.availWidth - winWidth) / 2;
			var winPosT = (screen.availHeight - winHeight) / 2;
			strWinSize += ",left=" + winPosL + ",screenX=" + winPosL + ",top=" + winPosT + ",screenY=" + winPosT;
		}	
		
		window.open(theURL,winName,features + strWinSize);
  	}
	
	function returnPopup(theURL,winName,features,width,height)
	{
		var winWidth	= width;
		var winHeight	= height;
		var strWinSize	= ",width=" + winWidth + ",height=" + winHeight;
	
		if (window.screen) {
			var winPosL = (screen.availWidth - winWidth) / 2;
			var winPosT = (screen.availHeight - winHeight) / 2;
			strWinSize += ",left=" + winPosL + ",screenX=" + winPosL + ",top=" + winPosT + ",screenY=" + winPosT;
		}	
		
		return window.open(theURL,winName,features + strWinSize);
  	}
	
	function openModule(moduleURL,moduleName,width,height,formName,inputVisible,inputHidden,qsArgs)
	{
		var winWidth	= width;
		var winHeight	= height;
		var strWinSize	= ",width=" + winWidth + ",height=" + winHeight;
	
		if (window.screen) {
			var winPosL = (screen.availWidth - winWidth) / 2;
			var winPosT = (screen.availHeight - winHeight) / 2;
			strWinSize += ",left=" + winPosL + ",screenX=" + winPosL + ",top=" + winPosT + ",screenY=" + winPosT;
		}	
		
		moduleURL += "?fref=" + formName + "&iv=" + inputVisible + "&ih=" + inputHidden + qsArgs
		
		window.open(moduleURL,moduleName,'toolbar=0,status=0,scrollbars,location=0,menubar=0,resizable' + strWinSize);
  	}
	
	function mediaPlayer(mediaID,gallery) {
		openPopup('/media/player.asp?id=' + mediaID + '&gallery=' + gallery,'media_player','',413,350);
	}
	
	function ClosePopup() { //v2.0
 	 window.close(self);
	}
	
	function ul_onclick(jsObj)
	{
	   var i;
	   var style;
	  
	   for (i = 0; i < jsObj.children.length; i++)
	   {
	       style = jsObj.children[i].style;
	       if (style.display == "none")
	       {
	           style.display = "";
	       }
	       else
	       {
	           style.display = "none";
	       }
	   } 
	}
	
	function verifyMsg(jsStrURL, jsStrMsg) 
	{
		if (confirm (jsStrMsg)) 
		{		
			this.window.location=jsStrURL;
			return true;
		}
	}
	
	function buildHumanSQL(objElement, strHeadline) {
	
		var inputLocal	= objElement;
		var strSQLHuman	= '<b>' + strHeadline + '</b>\n';
			strSQLHuman	+='<ul type=square style="margin-top:0; margin-left:15; padding:5">\n';
		var blnIsSelected = false;
		
		if (inputLocal) {
			var len = inputLocal.length;
			var i=0;
			for (i=0 ; i<len ; i++) {
			
				if (inputLocal.options[i].selected) {
					blnIsSelected = true;
					strSQLHuman += '<li>' + inputLocal.options[i].text + '<br></li>\n';
				}
			}
		}
		
		strSQLHuman += '</ul>'
		if (blnIsSelected) objElement.form.txt_sqlHuman.value = strSQLHuman;
		return true;
	}