gecko/parser/htmlparser/tests/html/bigscript.html

422 lines
24 KiB
HTML
Raw Normal View History

<HTML>
<BODY BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000">
<img src="igh.src">ddasdasd
<CENTER>
<script language="Javascript">
var oldBrowser = 0
var curDate = new Date()
var curDay = curDate.getDate()
var curMonth = curDate.getMonth()
var curYear = curDate.getYear()
var nextDate = curDate
nextDate.setDate(curDay + 1) // increment the next day to set it right
var nextDay = nextDate.getDate()
var nextMonth = nextDate.getMonth()
var nextYear = nextDate.getYear()
var month = new Array(12)
month[0] = "Jan"
month[1] = "Feb"
month[2] = "Mar"
month[3] = "Apr"
month[4] = "May"
month[5] = "Jun"
month[6] = "Jul"
month[7] = "Aug"
month[8] = "Sep"
month[9] = "Oct"
month[10] = "Nov"
month[11] = "Dec"
if(navigator.appVersion.charAt(0) == "2") {
if (navigator.appName != "Microsoft Internet Explorer") {
oldBrowser=1
}
}
function writeOption(myNum, myValue, mySelected) {
if (oldBrowser == 0) {
if (mySelected == 1) {
document.write ('<option value=' + myNum + ' selected>' + myValue )
}
else
{
document.write ('<option value=' + myNum + '>' + myValue )
}
}
}
function showMonth(toSelect) {
for (var i=0; i < 12; i++ ) {
if (i == toSelect) {
writeOption(month[i], month[i], 1)
}
else
{
writeOption(month[i], month[i], 0)
}
}
}
function showDay(toSelect, myMonth, myYear) {
for (i=1; i <= 31; i++) {
if (i == toSelect) {
writeOption(i, i, 1)
}
else
{
writeOption(i, i, 0)
}
}
}
function mySubmit(myForm) {
// Dealing with year returned by different browsers
//if (curYear < 99) {
// var leaveYear = curYear + 2000
// var returnYear = curYear + 2000
//}
//else
//{
// var leaveYear = curYear + 1900
// var returnYear = curYear + 1900
//}
tempyear = new String(curYear)
if (tempyear.length < 4) {
curYear = curYear + 1900
}
var leaveYear = curYear
var returnYear = curYear
var leaveDay;
var returnDay;
if (curMonth > myForm.leaveMonth.selectedIndex) {
leaveYear = curYear+1
}
if (curMonth > myForm.returnMonth.selectedIndex) {
returnYear = curYear + 1
}
else
{
if (myForm.returnMonth.selectedIndex < myForm.leaveMonth.selectedIndex)
returnYear = curYear + 1
}
var tempDate = new Date(leaveYear, myForm.leaveMonth.selectedIndex, myForm.inp_dep_dt_dy_1.options[myForm.inp_dep_dt_dy_1.selectedIndex].value)
var leaveDay = tempDate.getDay()
tempDate = new Date(returnYear, myForm.returnMonth.selectedIndex, myForm.inp_ret_dep_dt_dy.options[myForm.inp_ret_dep_dt_dy.selectedIndex].value)
var returnDay = tempDate.getDay()
myForm.inp_dep_year.value = leaveYear
myForm.inp_arr_year.value = returnYear
myForm.inp_dep_day.value = leaveDay
myForm.inp_arr_day.value = returnDay
myForm.inp_dep_dt_mn_1.value = month[myForm.inp_dep_dt_mn_1.selectedIndex]
myForm.inp_dep_dt_mn_1.value = month[myForm.leaveMonth.selectedIndex]
myForm.inp_ret_dep_dt_mn.value = month[myForm.returnMonth.selectedIndex]
var myMessage = " Form fields: \n"
// myMessage += "Login - inp_es_alias - " + myForm.inp_es_alias.value + "\n"
// myMessage += "Password - inp_es_passwd - " + myForm.inp_es_passwd.value + "\n"
myMessage += "Travelers - inp_pax_cnt - " + (myForm.inp_pax_cnt.selectedIndex+1) + "\n"
myMessage += "Leaving From - inp_dep_arp_cd_1 - " + myForm.inp_dep_arp_cd_1.value + "\n"
myMessage += "Going To - inp_arr_arp_cd_1 - " + myForm.inp_arr_arp_cd_1.value + "\n"
myMessage += "Leave Year - inp_dep_year - " + leaveYear + "\n"
myMessage += "Leave Month - inp_dep_dt_mn_1 - " + myForm.inp_dep_dt_mn_1.value + "\n"
myMessage += "Leave Day - inp_dep_dt_dy_1 - " + (myForm.inp_dep_dt_dy_1.selectedIndex+1) + "\n"
myMessage += "Leave Weekday - inp_dep_day - " + leaveDay + "\n"
myMessage += "Leave Time - inp_dep_tm_1 - " + (myForm.inp_dep_tm_1.options[myForm.inp_dep_tm_1.selectedIndex].text) + "\n"
myMessage += "Return Year - inp_arr_year - " + returnYear + "\n"
myMessage += "Return Month - inp_ret_dep_dt_mn - " + myForm.inp_ret_dep_dt_mn.value + "\n"
myMessage += "Return Day - inp_ret_dep_dt_dy - " + (myForm.inp_ret_dep_dt_dy.selectedIndex+1) + "\n"
myMessage += "Return Weekday - inp_arr_day - " + returnDay + "\n"
myMessage += "Return Time - inp_ret_dep_tm - " + myForm.inp_ret_dep_tm.options[myForm.inp_ret_dep_tm.selectedIndex].text + "\n"
myMessage += "Service - Service - " + myService + "\n"
// myMessage += "SID - SID - " + myForm.SID.value + "\n"
// alert(myMessage)
myForm.submit()
}
// Get ready for some low down, ugly parsing. Don't say you weren't warned!
// var queryString = location.search.substring(0, location.search.length)
var queryString = window.location.href
var myStart = queryString.indexOf("?")
var myEnd = queryString.length
if (myStart < 0) {
myStart = 0
}
queryString = queryString.substring(myStart, myEnd)
var stampStart = queryString.indexOf("timestamp=") + 10 // 10 is len of string
var stampEnd = queryString.indexOf("&", stampStart) // get ending timestamp index
stampStart = parseFloat(stampStart)
stampEnd = parseFloat(stampEnd)
if (stampEnd < 0) {
stampEnd = location.search.length
}
var timeStamp = parseFloat(queryString.substring(stampStart, stampEnd)) // get timestamp
var timeOutStart = parseFloat(stampEnd + 9) // 9 is len of string
var timeOutEnd = parseFloat(queryString.indexOf("&", timeOutStart)) // get ending timeout index
if (timeOutEnd < 0 ) {
timeOutEnd = location.search.length
}
var timeOut = parseFloat(queryString.substring(timeOutStart, timeOutEnd)); // get timeout
var expireAt = timeStamp + timeOut
var sysStart = parseFloat(queryString.indexOf("systemtime=") + 11)
var sysEnd = parseFloat(queryString.indexOf("&", sysStart))
if (sysEnd < 0) {
sysEnd = location.search.length
}
var serviceStart = parseFloat(queryString.indexOf("Service=") + 8)
var serviceEnd = parseFloat(queryString.indexOf("&", serviceStart))
if (serviceEnd < 0) {
serviceEnd = location.search.length
}
var myService = queryString.substring(serviceStart, serviceEnd)
var sidStart = parseFloat(queryString.indexOf("SID=") + 4)
var sidEnd = parseFloat(queryString.indexOf("&", sidStart))
if (sidEnd < 0) {
sidEnd = location.search.length
}
if (queryString.indexOf("SID=") < 0 ) {
mySID = "NULL"
}
else {
mySID = queryString.substring(sidStart, sidEnd)
}
//-------------------------------------------------------------
// D E F A U L T S E R V I C E / C O B R A N D L O G I C
//-------------------------------------------------------------
if (queryString.indexOf("Service=") < 0) { // there is no service so set a default
myService = 'TRAVELOCITY'
}
var isNotCobrand = ( myService.toUpperCase() != "COMDEX" && myService.toUpperCase() != "JAL" && myService.toUpperCase() != "NETWORLD")
var sysTime = parseFloat(location.search.substring(sysStart, sysEnd))
// The next 2 ifs are hacks for NS 3.0
if (!queryString) {
queryString= "?undefined"
isNotCobrand = "true"
}
if (!expireAt) {
queryString = "?undefined"
}
if (isNotCobrand) {
document.write ('<CENTER>')
myVar = '<FORM ACT' + 'ION=http://dps1.travelocity.com/express.ctl?Service=TRAVELOCITY&expr_path=Y METHOD=POST>'
document.write (myVar)
document.write ('<input type=hidden name=Service value=' + myService + '> ')
if (mySID != "NULL") {
document.write (' <input type=hidden name=SID value=' + mySID + '>')
}
document.write ('<table cellspacing=0 cellpadding=1 bgcolor="#336699" WIDTH="405" border="0" align="left">')
document.write ('<tr>')
document.write ('<td>')
document.write ('<table cellspacing=0 cellpadding=0 bgcolor="#FFFFFF" WIDTH="405">')
document.write ('<tr>')
document.write ('<td bgcolor="#FFFFFF">')
document.write ('<TABLE WIDTH="405" CELLPADDING="2" CELLSPACING="0" BORDER="0">')
//
// -- TITLE --
//
document.write ('<TR>')
document.write ('<TD COLSPAN="6" BGCOLOR="#FFFFFF" VALIGN=TOP>')
document.write ('<TABLE WIDTH="405" BGCOLOR="#FFFFFF" CELLPADDING="0" CELLSPACING="0" BORDER="0">')
document.write ('<TR ALIGN=LEFT>')
document.write ('<TD VALIGN=TOP ALIGN=LEFT BGCOLOR="#336699"><FONT FACE="helvetica, arial" SIZE="2" color="#FFFFFF">&nbsp;<B>Book Your Roundtrip Flight Now!</FONT></B></TD>')
if ( ( parseFloat(expireAt) < parseFloat(sysTime)) || (parseFloat(timeStamp) == -1) || (queryString== "?undefined")){ // if we have session already
document.write ('<TD ALIGN=RIGHT BGCOLOR="#336699" valign=top><A HREF="http://dps1.travelocity.com/lognmemnew.ctl?Service=TRAVELOCITY&expr_path=Y' + myService + '&expr_path=Y" style=color=#FFFFFF><font face="arial, helvetica" size="1" color="#FFFFFF"><u>Need a login name?</u></A></font>&nbsp;')
}
else
{
document.write ('<td bgcolor="#000000">')
}
document.write ('</TD>')
document.write ('</TR>')
//
// don't display login message for express path if already logged in and we have a session
//
if ( ( parseFloat(expireAt) < parseFloat(sysTime)) || (parseFloat(timeStamp) == -1) || (queryString== "?undefined")){
document.write ('<TR><TD colspan="2"><FONT FACE="helvetica, arial" SIZE="1"><i>Log in here to search for roundtrip flights and special offers.</i></a></font></TD></TR>')
}
else
{
document.write ('<TR><TD colspan="2"><FONT FACE="helvetica, arial" SIZE="1"><i>Search for roundtrip flights and special offers.</i></a></font></TD></TR>')
}
document.write ('</TABLE>')
document.write ('</TD>')
document.write ('</TR>')
//
// -- END TITLE --
//
if ( (parseFloat(expireAt) < parseFloat(sysTime)) || (parseFloat(timeStamp) == -1) || queryString== "?undefined"){ // if we have an expired session, so form
// -- LOGIN/PASSWORD --
document.write ('<TR>')
document.write ('<TD NOWRAP><FONT FACE="helvetica, arial" SIZE="1">Login<br> name:</FONT></TD>')
document.write ('<TD VALIGN="TOP"><FONT SIZE="2"><INPUT TYPE="TEXT" NAME=inp_es_alias SIZE="8" MAXLENGTH="20"></FONT></TD>')
document.write ('<TD>&nbsp;</TD>')
document.write ('<TD align=left><FONT FACE="helvetica, arial" SIZE="1">Password:</FONT></TD>')
document.write ('<TD COLSPAN="2" align="left"><FONT SIZE="2"><INPUT TYPE="PASSWORD" NAME=inp_es_passwd SIZE="8"></FONT></TD>')
document.write ('</TR>')
// -- END LOGIN/PASSWORD --
} // end if
// -- LEAVING FROM/GOING TO --
//
document.write ('<TR>')
document.write ('<!-- a comment -->')
document.write ('<TD NOWRAP><FONT FACE="helvetica, arial" SIZE="1">Leaving<br>from:</FONT></TD>')
document.write ('<TD VALIGN="TOP"><FONT SIZE="2"><INPUT TYPE="TEXT" NAME="inp_dep_arp_cd_1" SIZE="10"></FONT></TD>')
document.write ('<TD><FONT SIZE="1" FACE="helvetica, arial">On:</FONT></TD>')
document.write ('<TD VALIGN="TOP" ALIGN="LEFT">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME=leaveMonth size=1>')
document.write ('<scrip' + 't language="javascript"> ')
document.write ('show' + 'Month(curMonth); ')
document.write ('</scrip' + 't> ')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('<TD VALIGN="TOP" ALIGN="LEFT">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME="inp_dep_dt_dy_1" size="1">')
document.write ('<scrip' + 't language="javascript"> ')
document.write ('show' + 'Day(curDay, curMonth, curYear); ')
document.write ('</scrip' + 't> ')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('<TD VALIGN="TOP" ALIGN="LEFT">')
document.write ('<FONT SIZE="2">')
document.write (' <SELECT NAME="inp_dep_tm_1" size="1">')
document.write ('<OPTION>12:00 AM</OPTION>')
document.write ('<OPTION>1:00 AM</OPTION>')
document.write ('<OPTION>2:00 AM</OPTION>')
document.write ('<OPTION>3:00 AM</OPTION>')
document.write ('<OPTION>4:00 AM</OPTION>')
document.write ('<OPTION>5:00 AM</OPTION>')
document.write ('<OPTION SELECTED>6:00 AM</OPTION>')
document.write ('<OPTION>7:00 AM</OPTION>')
document.write ('<OPTION>8:00 AM</OPTION>')
document.write ('<OPTION>9:00 AM</OPTION>')
document.write ('<OPTION>10:00 AM</OPTION>')
document.write ('<OPTION>11:00 AM</OPTION>')
document.write ('<OPTION>12:00 PM</OPTION>')
document.write ('<OPTION>1:00 PM</OPTION>')
document.write ('<OPTION>2:00 PM</OPTION>')
document.write ('<OPTION>3:00 PM</OPTION>')
document.write ('<OPTION>4:00 PM</OPTION>')
document.write ('<OPTION>5:00 PM</OPTION>')
document.write ('<OPTION>6:00 PM</OPTION>')
document.write ('<OPTION>7:00 PM</OPTION>')
document.write ('<OPTION>8:00 PM</OPTION>')
document.write ('<OPTION>9:00 PM</OPTION>')
document.write ('<OPTION>10:00 PM</OPTION>')
document.write ('<OPTION>11:00 PM</OPTION>')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('</TR>')
document.write ('<TR>')
document.write ('<TD NOWRAP>')
document.write ('<FONT FACE="helvetica, arial" SIZE="1">Going<br>to:</FONT></TD>')
document.write ('<TD VALIGN="TOP">')
document.write ('<FONT SIZE="2">')
document.write ('<INPUT TYPE="TEXT" NAME="inp_arr_arp_cd_1" SIZE="10"></FONT>')
document.write ('</TD>')
document.write ('<TD ALIGN="LEFT"><FONT SIZE="1" FACE="helvetica, arial">Return:</FONT></TD><TD VALIGN="TOP">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME=returnMonth size=1>')
document.write ('<scrip' + 't language="javascript"> ')
document.write ('show' + 'Month(nextMonth); ')
document.write ('</scrip' + 't> ')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('<TD VALIGN="TOP" ALIGN="LEFT">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME="inp_ret_dep_dt_dy" size="1">')
document.write ('<scrip' + 't language="javascript"> ')
document.write ('show' + 'Day(nextDay, nextMonth, nextYear); ')
document.write ('</scrip' + 't> ')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('<TD VALIGN="TOP" ALIGN="LEFT">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME="inp_ret_dep_tm" size="1">')
document.write ('<OPTION>12:00 AM</OPTION>')
document.write ('<OPTION>1:00 AM</OPTION>')
document.write ('<OPTION>2:00 AM</OPTION>')
document.write ('<OPTION>3:00 AM</OPTION>')
document.write ('<OPTION>4:00 AM</OPTION>')
document.write ('<OPTION>5:00 AM</OPTION>')
document.write ('<OPTION SELECTED>6:00 AM</OPTION>')
document.write ('<OPTION>7:00 AM</OPTION>')
document.write ('<OPTION>8:00 AM</OPTION>')
document.write ('<OPTION>9:00 AM</OPTION>')
document.write ('<OPTION>10:00 AM</OPTION>')
document.write ('<OPTION>11:00 AM</OPTION>')
document.write ('<OPTION>12:00 PM</OPTION>')
document.write ('<OPTION>1:00 PM</OPTION>')
document.write ('<OPTION>2:00 PM</OPTION>')
document.write ('<OPTION>3:00 PM</OPTION>')
document.write ('<OPTION>4:00 PM</OPTION>')
document.write ('<OPTION>5:00 PM</OPTION>')
document.write ('<OPTION>6:00 PM</OPTION>')
document.write ('<OPTION>7:00 PM</OPTION>')
document.write ('<OPTION>8:00 PM</OPTION>')
document.write ('<OPTION>9:00 PM</OPTION>')
document.write ('<OPTION>10:00 PM</OPTION>')
document.write ('<OPTION>11:00 PM</OPTION>')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('</TR>')
document.write ('<TR ALIGN=CENTER>')
document.write ('<TD colspan=3>')
document.write ('<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">')
document.write ('<TR ALIGN=LEFT>')
document.write ('<TD ALIGN=RIGHT NOWRAP><FONT FACE="helvetica, arial" SIZE="1">Total Travelers: </FONT></TD>')
document.write ('<TD VALIGN="TOP">')
document.write ('<FONT SIZE="2">')
document.write ('<SELECT NAME="inp_pax_cnt" size="1">')
document.write ('<OPTION>1')
document.write ('<OPTION>2')
document.write ('<OPTION>3')
document.write ('<OPTION>4')
document.write ('</SELECT>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('</TR>')
document.write ('</TABLE>')
document.write ('</TD>')
document.write ('<TD VALIGN="MIDDLE" BGCOLOR="#FFFFFF" colspan="3">')
document.write ('<input type=hidden name=inp_dep_dt_mn_1>')
document.write ('<input type=hidden name=inp_ret_dep_dt_mn>')
document.write ('<INPUT type=hidden name=inp_dep_day>')
document.write ('<INPUT type=hidden name=inp_arr_day>')
document.write ('<INPUT type=hidden name=inp_dep_year>')
document.write ('<INPUT type=hidden name=inp_arr_year>')
document.write ('<INPUT TYPE=HIDDEN NAME=tv_module VALUE=TR>')
document.write ('<INPUT TYPE=HIDDEN NAME=expr_path VALUE="Y">')
document.write ('<FONT SIZE="3">')
document.write ('<b>')
document.write ('<INPUT TYPE=button VALUE="Search Flights" onClick="mySubmit(this.form)"></b>')
document.write ('</FONT>')
document.write ('</TD>')
document.write ('</TR></FORM>')
document.write ('</CENTER>')
document.write ('</TABLE>')
//
// -- END SEARCH FLIGHTS/TOTAL TRAVELERS --
//
document.write ('</td>')
document.write ('</tr>')
document.write ('</table>')
document.write ('</td>')
document.write ('</tr>')
document.write ('</table>')
document.write ('<!--')
}
else
{
document.write ('Else info here')
}
// -->
</scRipt>
Done
</BODY>
</HTML>