|
I found a typo that would cause the search to not
work on Saturdays... Attached is the fixed version..
Monty
|
<search function="racetv">
<name>Racing TV Coverage</name>
<description>Displays a current TV listing of racing events in US and Canada.
<table class="helpboxDescTable">
<tr><td><div class="helpboxDescLabels">Switches:</div></td></tr>
<tr><td>US (default)</td><td>/us</td></tr>
<tr><td>Canada</td><td>/canada</td></tr>
<tr><td>Can-Am</td><td>/can-am or /canam</td></tr>
<tr><td colspan="2"><div class="helpboxDescLabels">Notes:</div></td></tr>
<tr><td colspan="2">All the switches can be abbreviated.</td></tr>
<tr><td colspan="2">All times are US Eastern.</td></tr>
</table>
</description>
<link>http://www.geocities.com/racefantv/USTV.htm</link>
<category>Entertainment</category>
<script><![CDATA[
function racetv(q){
if( q == "?" ){
qsfind("racing /function");
return false;
}
//defaults
var windowW = 760;
var windowH = 215;
var urlstart="http://www.geocities.com/racefantv/USTV.htm";
var wintitle="US"
var args = parseArgs(q, "canada,can-am,canam");
if ( args.switches.length > 0 ){
for (i=0; i < args.switches.length; i++){
switch( args.switches[i].name ){
case "canada": urlstart="http://www.geocities.com/racefantv/CDNTV.htm";wintitle="Canadian";break;
case "can-am": urlstart="http://www.geocities.com/racefantv/CANAMTV.htm";wintitle="Canadian-American";break;
case "canam": urlstart="http://www.geocities.com/racefantv/CANAMTV.htm";wintitle="Canadian-American";break;
}//switch
}
};
// Set an array for the days of the week
// We add a comma and a space to each for presentation
// get.day will return 0 through 6 as valid values
word_day = new Array(
"SUNDAY, ",
"MONDAY, ",
"TUESDAY, ",
"WEDNESDAY, ",
"THURSDAY, ",
"FRIDAY, ",
"SATURDAY, ");
// Set an array for the Months of the year
// We add a space after the month for presentation
// get.month will return 0 through 11 as valid values
word_month = new Array(
"JANUARY ",
"FEBRUARY ",
"MARCH ",
"APRIL ",
"MAY ",
"JUNE ",
"JULY ",
"AUGUST ",
"SEPTEMBER ",
"OCTOBER ",
"NOVEMBER ",
"DECEMBER ");
// Set right_now to the current date() value
right_now = new Date();
var datestring=word_day[right_now.getDay()]+word_month[right_now.getMonth()]+right_now.getDate();
var sUrl=urlstart;
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
xmlHttp.open("GET", urlstart, false);
xmlHttp.send();
//get the response content from the remote site
var sBody = xmlHttp.responseText;
// Replace the break TAGs with returns or the regex wont work
var rex = new RegExp ('\n', 'g') ;
sBody = sBody.replace(rex, '\r') ;
var re = new RegExp( ".*" + datestring + "(.*)", "im" );
var r = sBody.match( re )[1];
var tableleadin='<td colspan="3" width="100%" style="border:1px solid black;background-color: #ffff33;padding-top: 0.0416667in; padding-bottom: 0.0416667in;" valign="top"><p>';
tableleadin+='<span style="font-weight: bold; font-family:Verdana, sans-serif"><font size="1">'+datestring;
if (typeof r == 'undefined'){
return;
}else{
var RacingSearchPopupBodyCode = "<html><head><style>table,td {border:1px solid black;margin:0px;padding-left:2px;border-collapse:collapse;}</style></head><body>";
RacingSearchPopupBodyCode += "<center><span style=font-weight:bold;color:#900000;>"+wintitle+" Racing TV times (Eastern Timezone)</span></center><table><tr> "+tableleadin+r+"</body></html>";
var top=((screen.availheight-windowH)-38);
var left=((screen.width-windowW)-10);
popupImage = window.open('','_blank','width='+windowW+', height='+windowH+',toolbar=0,status=0,titlebar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,left='+left+',top='+top);
popupImage.document.open();
popupImage.document.write(RacingSearchPopupBodyCode);
popupImage.document.close()
popupImage.document.title=wintitle+' Racing TV times (Eastern Timezone)';
}//if
} //function
]]></script>
</search>
