<%
Response.Expires = -1000
Response.Expiresabsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
'General Functions

Function FillCombo(strArgQuery, strVal)' pass strval if any item should be auto selected...
  dim RS, strRet
  set RS = Server.CreateObject("Adodb.recordset")
		if strArgQuery <> "" then
	  			rs.Open strArgQuery, CN,3,1
 			  strRet = rs.GetString( ,,"'> "," </option>" & Chr(13) & "<option value='")
			end if 
	 		  rs.close
	set rs = nothing
 
  strRet = "<option value='" & Mid(CSTR(strRet),1,Len(CSTR(strRet))-15)
 
  if len(trim(strVal))>0 then
	response.Write "strVal :" & strVal
	strRet = Replace(strRet ,"<option value='" & trim(strVal) & "'>", "<option value='" & trim(strVal) & "' selected>")
  end if
  
  FillCombo = strRet
End function

'Function FillComboAutoSelect(strArgQuery,strVal)
'  dim RS, strRet
'  set RS = Server.CreateObject("Adodb.recordset")
'  rs.Open strArgQuery, CN,3,1
'  strRet = rs.GetString( ,,"'> "," </option>" & Chr(13) & "<option value='")
'  rs.close
'  set rs = nothing
'  FillCombo = "<option value='" & Mid(strRet,1,Len(strRet)-15)
'End function



Function FillYearsCombo(strArgSelectYear)
  dim i, strYears
  for i= 1980 to year(now)
	if cstr(i) = cstr(strArgSelectYear) then
	  strYears = strYears & "<option value='" & i & "' selected>" & i & "</option>"
	else
	  strYears = strYears & "<option value='" & i & "'>" & i & "</option>"
	end if
  next
  FillYearsCombo = "<option value=''>--Select Year--</option>" & strYears
End function

Function FillMonthsCombo(strArgSelectMonth)
  dim i, strMonths
  for i= 1 to 12
	if cstr(i) = cstr(strArgSelectMonth) then
  	  strMonths = strMonths & "<option value='" & i & "' selected>" & MonthName(i) & "</option>"
  	else
  	  strMonths = strMonths & "<option value='" & i & "'>" & MonthName(i) & "</option>"
  	end if
  next
  FillMonthsCombo = "<option value=''>--Select Month--</option>" & strMonths
End function
%>