home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
iis4_03.cab
/
iirtels.asp
< prev
next >
Wrap
Text File
|
1997-11-12
|
11KB
|
376 lines
<%@ LANGUAGE=VBScript %>
<% Option Explicit %>
<% Response.Expires = 0 %>
<%
Const L_RATING_TEXT = "Rating"
Const L_OPTIONAL_TEXT = "Optional Information"
Const L_EMAIL_TEXT = "Email name of the person rating this content:"
Const L_EXPIRES_TEXT = "Rating expires:"
Const L_MODIFIED_TEXT = "Ratings were last modified on:"
Const L_NOSLIDER_TEXT = "This ratings file cannot be configured from the remote admin. Please use MMC to configure these ratings."
Const L_MONTH_TEXT="Month"
Const L_DAY_TEXT="Day"
Const L_YEAR_TEXT="Year"
Const L_TIME_TEXT="Time"
Const L_JAN_TEXT = "January"
Const L_FEB_TEXT = "February"
Const L_MAR_TEXT = "March"
Const L_APR_TEXT = "April"
Const L_MAY_TEXT = "May"
Const L_JUN_TEXT = "June"
Const L_JUL_TEXT = "July"
Const L_AUG_TEXT = "August"
Const L_SEP_TEXT = "September"
Const L_OCT_TEXT = "October"
Const L_NOV_TEXT = "November"
Const L_DEC_TEXT = "December"
Const L_MON_TEXT = "Monday"
Const L_TUE_TEXT = "Tuesday"
Const L_WED_TEXT = "Wednesday"
Const L_THU_TEXT = "Thursday"
Const L_FRI_TEXT = "Friday"
Const L_SAT_TEXT = "Saturday"
Const L_SUN_TEXT = "Sunday"
Dim level,quote
level = Request.QueryString("level")
if (level = "") then
level = 0
end if
quote=chr(34)
function writeSlider(prop, stops, width, selnum)
dim slidestr, i
slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
for i=0 to stops-2
slidestr=slidestr & drawStop(i,prop, selnum)
slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
Next
slidestr=slidestr & drawStop(i, prop, selnum)
slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
writeSlider=slidestr
end function
function drawStop(curr,prop, selnum)
dim thisname, slidestr,formname
thisname=quote & prop & curr & quote
if Session("IsIE") then
formname = "parent.document.userform."
else
formname = "document.userform."
end if
slidestr="<A HREF='javascript:moveSlider(" & formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
if cInt(curr)=cInt(selnum) then
drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
else
drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
end if
end function
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">
MONTHS = new Array()
MONTHS[0] = "<%= L_JAN_TEXT %>";
MONTHS[1] = "<%= L_FEB_TEXT %>";
MONTHS[2] = "<%= L_MAR_TEXT %>";
MONTHS[3] = "<%= L_APR_TEXT %>";
MONTHS[4] = "<%= L_MAY_TEXT %>";
MONTHS[5] = "<%= L_JUN_TEXT %>";
MONTHS[6] = "<%= L_JUL_TEXT %>";
MONTHS[7] = "<%= L_AUG_TEXT %>";
MONTHS[8] = "<%= L_SEP_TEXT %>";
MONTHS[9] = "<%= L_OCT_TEXT %>";
MONTHS[10] = "<%= L_NOV_TEXT %>";
MONTHS[11] = "<%= L_DEC_TEXT %>";
DAYS = new Array()
DAYS[0] = "<%= L_SUN_TEXT %>";
DAYS[1] = "<%= L_MON_TEXT %>";
DAYS[2] = "<%= L_TUE_TEXT %>";
DAYS[3] = "<%= L_WED_TEXT %>";
DAYS[4] = "<%= L_THU_TEXT %>";
DAYS[5] = "<%= L_FRI_TEXT %>";
DAYS[6] = "<%= L_SAT_TEXT %>";
<% if not Session("IsIE") then %>
slideron=new Image(11,26);
slideron.src="images/slideron.gif";
slideroff=new Image(11,26);
slideroff.src="images/slideroff.gif";
lastslide="hdnPics<%= level %>";
<% end if %>
theList = parent.head.cachedList;
uform = document.userform;
headform = parent.head.document.hiddenform;
function moveSlider(control,prop,num){
top.title.Global.updated=true;
<% if Session("IsIE") then %>
slideurl="iislider.asp?selnum="+num+"&stops=5&width=80&prop="+prop;
control.value=num;
document.Slider.location.href=slideurl;
<% else %>
turnSlideOff(lastslide);
lastslide=prop+num;
thisprop=prop+num;
document [thisprop].src=slideron.src;
control.value=num;
<% end if %>
setLevel(num);
}
function turnSlideOff(prop){
document [prop].src=slideroff.src;
}
function setLevel(num){
setRatingString(num);
theList[headform.index.value].sel = num;
setUpdated();
showLevel();
}
function showLevel(){
uform = document.userform;
uform.level.value = theList[headform.index.value].level[uform.hdnPics.value];
}
function setRatingString(num){
ratings = "r (";
for (i=0;i<theList.length;i++){
ratings += theList[i].key + " " + theList[i].sel;
}
ratings += ")";
}
function setUpdated(){
//parent.head.listFunc.seton = ""
parent.head.document.cacheform.chkEnableRatings.checked = true;
uform = document.userform;
dateObj=parseUIDate(uform.hdnExpiresDate);
var yyyy=fullYear(dateObj.getYear());
var mo=rpad(2,"0",dateObj.getMonth()+1);
var dd=rpad(2,"0",dateObj.getDate());
var hh=rpad(2,"0",dateObj.getHours());
var mm=rpad(2,"0",dateObj.getMinutes());
var tzdiff=dateObj.getTimezoneOffset()
parent.head.listFunc.expon =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+tzdiff;
dateObj=new Date();
var yyyy=fullYear(dateObj.getYear());
var mo=rpad(2,"0",dateObj.getMonth()+1);
var dd=rpad(2,"0",dateObj.getDate());
var hh=rpad(2,"0",dateObj.getHours());
var mm=rpad(2,"0",dateObj.getMinutes());
parent.head.listFunc.seton =yyyy+"."+mo+"."+dd+"T"+hh+":"+mm+"-"+tzdiff;
parent.head.listFunc.email = uform.email.value;
}
function dateComplete(){
uform = document.userform;
completed = uform.yyyy.value != "";
completed = completed && (uform.mo.value != "");
completed = completed && (uform.dd.value != "");
completed = completed && (uform.hh.value != "");
completed = completed && (uform.mm.value != "");
return completed;
}
function rpad(len,padchr,str){
str = str.toString();
if (str.length < len){
str = padchr + str;
}
return str;
}
function writeDates(){
var dstr = "";
dstr += "<%= L_EXPIRES_TEXT %> ";
dstr += "<TABLE>";
dstr += "<TR>";
dstr += "<TD><FONT SIZE=1 FACE='Helv'>";
dstr += "<INPUT READONLY NAME='hdnExpiresDate' VALUE='' SIZE = 35 OnBlur='setUpdated();'>";
dstr += "<INPUT TYPE='button' VALUE='...' OnClick='popCalendar(\"document.userform.hdnExpiresDate\",document.userform.hdnExpiresDate.value);'>";
dstr += "</FONT></TD>"
dstr += "</TR>";
dstr += "</TABLE>";
dstr += "<BR>";
dstr += "<%= L_MODIFIED_TEXT %> ";
dstr += "<TABLE>";
dstr += "<TR>";
dstr += "<TD><FONT SIZE=1 FACE='Helv'>"
dstr += "<INPUT DISABLED NAME='hdnModifiedDate' VALUE='' SIZE = 35 >";
dstr += "</FONT></TD>"
dstr += "</TR>";
dstr += "</TABLE>";
return (dstr + "<P>");
}
function fullYear(yearStr)
{
if (yearStr < 100){
yearStr="19" + yearStr;
}
return yearStr
}
function replaceStr(fullStr,oldStr,newStr)
{
newFullStr = fullStr;
if (fullStr.indexOf(oldStr) != 0)
{
newFullStr = fullStr.substring(0,fullStr.indexOf(oldStr));
newFullStr += newStr;
newFullStr += fullStr.substring(fullStr.indexOf(oldStr)+(oldStr.length),fullStr.length);
}
return newFullStr;
}
function parseUIDate(dateCntrl){
if (dateCntrl.value != "")
{
datestr = dateCntrl.value;
datestr = datestr.substring(datestr.indexOf(",")+2, datestr.length);
newDate = new Date(datestr);
}
else{
newDate = new Date();
}
return newDate;
}
function parseRatingsDate(dateStr){
dateStr = replaceStr(dateStr,"T",".");
dateStr = replaceStr(dateStr,"-",".");
dateStr = replaceStr(dateStr,":",".");
dateObj = new Date();
dateArray = dateStr.split(".");
if (dateArray[0] != "")
{
dateObj.setYear(dateArray[0]);
dateObj.setMonth(dateArray[1]-1);
dateObj.setDate(dateArray[2]);
}
return dateObj;
}
function setDateCntrl(dateCntrl,dateObj){
year=fullYear(dateObj.getYear());
datestr = DAYS[dateObj.getDay()] + ", " + MONTHS[dateObj.getMonth()] + " " + dateObj.getDate() + ", " + year;
dateCntrl.value = datestr;
}
function popCalendar(cntrlname,someDate){
if (someDate == ""){
newdate = new Date();
someDate = newdate.toGMTString();
}
thefile="calendar.asp?cntrl="+cntrlname + "¤tDate=" + escape(someDate);
<% if Session("FONTSIZE") = "LARGE" then %>
popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=250,height=260");
<% else %>
popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=250,height=240");
<% end if %>
if(popbox !=null){
if (popbox.opener==null){
popbox.opener=self;
}
}
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#CCCCCC" TOPMARGIN=10 TEXT="#000000" LINK="#FFFFFF" OnLoad="showLevel();">
<TABLE>
<TR>
<TD><FONT SIZE=1 FACE="HELV,ARIAL">
<TABLE>
<TR>
<TD>
<% if Session("IsIE") then %>
<IFRAME NAME="Slider" HEIGHT=30 FRAMEBORDER=0 WIDTH=415 SRC="iislider.asp?stops=5&width=80&prop=hdnPics&selnum=<%= level %>">
</IFRAME>
<% else %>
<%= writeSlider("hdnPics", 5, 80, level) %>
<% end if %>
</TD>
</TR>
</TABLE>
</FONT>
</TD>
</TR>
</TABLE>
<FORM NAME="userform">
<TABLE WIDTH = 100%>
<TR>
<TD><FONT SIZE=1 FACE="HELV,ARIAL">
<%= L_RATING_TEXT %>: <INPUT READONLY TYPE="text" SIZE = 40 NAME="level" VALUE="">
<INPUT TYPE="hidden" NAME="hdnPics" VALUE="<%= level %>">
<INPUT TYPE="hidden" NAME="HttpPics">
</TD>
</TR>
</TABLE>
<HR>
<TABLE WIDTH = 100%>
<TR>
<TD>
<FONT SIZE=1 FACE="HELV,ARIAL">
<B><%= L_OPTIONAL_TEXT %></B><P>
<%= L_EMAIL_TEXT %>
<SCRIPT LANGAUGE="JavaScript">
document.write("<INPUT NAME='email' SIZE=35 VALUE='" + parent.head.listFunc.email + "' OnChange='setUpdated();'>"+ "<P>");
document.write(writeDates());
setDateCntrl(document.userform.hdnExpiresDate,parseRatingsDate(parent.head.listFunc.expon));
setDateCntrl(document.userform.hdnModifiedDate,parseRatingsDate(parent.head.listFunc.seton));
</SCRIPT>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>