File: /home/mycamden.co.uk/public_html/java/search_sup.js
<!--
// super search script - baz 2004
// this script requires that a few variables are set up before this:
// var area =, var reg = , var londonornot =, var style =
// first just write the HTML necessary
document.writeln(' <table width="522" border="0" cellspacing="0" cellpadding="0">');
document.writeln(' <tr> ');
document.writeln(' <td width="63"><img src="http://www.myvillage.com/images/homepage/2/search_' + style + '1.gif" width="63" height="41"></td>');
document.writeln(' <td background="http://www.myvillage.com/images/homepage/2/search_' + style + '.gif"> ');
document.writeln(' <table width="459" border="0" cellspacing="0" cellpadding="0">');
document.writeln(' <tr> ');
document.writeln(' <td colspan="8"> ');
document.writeln(' <div id="datacontainer" style="position:relative; height: 21px; width:459px; overflow: hidden;" name="datacontainer"> ');
document.writeln(' <div name="features_table" id="features_table" style="position:absolute; height: 21px; width:459px; left: 459px;"> ');
document.writeln(' <table width="459" height="21" border="0" cellpadding="0" cellspacing="0">');
document.writeln(' <form name="features" method="get" action="http://search.atomz.com/search/">');
document.writeln(' <tr valign="bottom"> ');
document.writeln(' <td width="459" height="21" colspan="6"> ');
document.writeln(' <input name="sp-q" onClick="this.value = \'\';" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" value="enter keywords or title >" size="80">');
document.writeln(' <a href="#" onClick="javascript: document.forms[\'features\'].submit();"><img src="../../images/homepage/2/go.gif" width="25" height="16" align="absmiddle" border="0"></a> ');
document.writeln(' <font size="1"> ');
document.writeln(' <input type=hidden name="sp-a" value="' + searchcode + '">');
document.writeln(' </font> ');
document.writeln(' <input type="hidden" name="sp-p" value="any">');
document.writeln(' <input type="hidden" name="sp-f" value="iso-8859-1">');
document.writeln(' <input type="hidden" name="domain" value="">');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </form>');
document.writeln(' </table>');
document.writeln(' </div>');
document.writeln(' <div name="web_table" id="web_table" style="position:absolute; height: 21px; width:459px; left: 459px;"> ');
document.writeln(' <table width="459" height="21" border="0" cellpadding="0" cellspacing="0">');
document.writeln(' <form name="web" method="GET" action="http://www.myvillage.com/espotting/results.php">');
document.writeln(' <tr valign="bottom"> ');
document.writeln(' <td width="459" height="21" colspan="6"> ');
document.writeln(' <input name="keyword" onClick="this.value = \'\';" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" value="enter keywords >" size="80">');
document.writeln(' <a href="#" onClick="javascript: document.forms[\'web\'].submit();"><img src="../../images/homepage/2/go.gif" width="25" height="16" align="absmiddle" border="0"></a> ');
document.writeln(' <input type="hidden" name="domain" value="">');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </form>');
document.writeln(' </table>');
document.writeln(' </div>');
document.writeln(' <div id="business_table" name="business_table" style="position:absolute; top: 0; width: 459px; left:459px;"> ');
document.writeln(' <table width="459" height="21" border="0" cellpadding="0" cellspacing="0">');
document.writeln(' <form name="askalex" method="post" action="">');
document.writeln(' <tr valign="bottom"> ');
document.writeln(' <td width="459" height="21" colspan="6"> ');
document.writeln(' ');
document.writeln(' <input name="keywords" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" onClick="this.value = \'\';" value="business name or type >" size="55">');
document.writeln(' <input name="towncounty_temp" onChange="document.forms[\'askalex\'].towncounty.value=this.value;" onClick="this.value = \'\';" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" value="postcode or area >" size="20">');
document.writeln(' <a href="#" onClick="javascript: document.forms[\'askalex\'].submit();"><img border="0" src="../../images/homepage/2/go.gif" width="25" height="16" align="absmiddle"></a> ');
document.writeln(' <input type="hidden" name="branding" value="788">');
document.writeln(' <input type="hidden" name="towncounty" value="">');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </form>');
document.writeln(' </table>');
document.writeln(' </div>');
document.writeln(' <div id="events_table" name="events_table" style="position:absolute; top: 0; width: 459px; left:459px;"> ');
document.writeln(' <table width="459" height="21" border="0" cellpadding="0" cellspacing="0">');
document.writeln(' <form name="events" method="get" action="http://www.myvillage.press.net/events/web/results.php">');
document.writeln(' <tr valign="bottom"> ');
document.writeln(' <td width="459" height="21" colspan="6"> ');
document.writeln(' ');
document.writeln(' <input name="title_temp" onClick="this.value = \'\';" onChange="document.forms[\'events\'].title.value=this.value;" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" value="event or venue >" size="18">');
document.writeln(' <input name="town_temp" onClick="this.value = \'\';" onChange="document.forms[\'events\'].town.value=this.value;" type="text" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" value="' + area + '" size="18">');
document.writeln(' <select name="maincat" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;">');
document.writeln(' <option value=all selectred>all</option>');
document.writeln(' <option value=cin>cinema</option>');
document.writeln(' <option value=art>art</option>');
document.writeln(' <option value=com>comedy</option>');
document.writeln(' <option value=fam>family</option>');
document.writeln(' <option value=club>clubbing</option>');
document.writeln(' <option value=mus>music</option>');
document.writeln(' <option value=leis>leisure</option>');
document.writeln(' <option value=the>theatre</option>');
document.writeln(' </select>');
document.writeln(' <select name="startday" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" onChange="updateDate();">');
document.writeln(' <option value="" selected>dd</option>');
document.writeln(' <option value=01>01</option>');
document.writeln(' <option value=02>02</option>');
document.writeln(' <option value=03>03</option>');
document.writeln(' <option value=04>04</option>');
document.writeln(' <option value=05>05</option>');
document.writeln(' <option value=06>06</option>');
document.writeln(' <option value=07>07</option>');
document.writeln(' <option value=08>08</option>');
document.writeln(' <option value=09>09</option>');
document.writeln(' <option value=10>10</option>');
document.writeln(' <option value=11>11</option>');
document.writeln(' <option value=12>12</option>');
document.writeln(' <option value=13>13</option>');
document.writeln(' <option value=14>14</option>');
document.writeln(' <option value=15>15</option>');
document.writeln(' <option value=16>16</option>');
document.writeln(' <option value=17>17</option>');
document.writeln(' <option value=18>18</option>');
document.writeln(' <option value=19>19</option>');
document.writeln(' <option value=20>20</option>');
document.writeln(' <option value=21>21</option>');
document.writeln(' <option value=22>22</option>');
document.writeln(' <option value=23>23</option>');
document.writeln(' <option value=24>24</option>');
document.writeln(' <option value=25>25</option>');
document.writeln(' <option value=26>26</option>');
document.writeln(' <option value=27>27</option>');
document.writeln(' <option value=28>28</option>');
document.writeln(' <option value=29>29</option>');
document.writeln(' <option value=30>30</option>');
document.writeln(' <option value=31>31</option>');
document.writeln(' </select>');
document.writeln(' <select name="startmon" style="font-family: Verdana,Arial,Helvetica; font-size: 10px;" onChange="updateDate();">');
document.writeln(' <option value="" selected>mm</option>');
document.writeln(' <option value=01>jan</option>');
document.writeln(' <option value=02>feb</option>');
document.writeln(' <option value=03>mar</option>');
document.writeln(' <option value=04>apr</option>');
document.writeln(' <option value=05>may</option>');
document.writeln(' <option value=06>jun</option>');
document.writeln(' <option value=07>jul</option>');
document.writeln(' <option value=08>aug</option>');
document.writeln(' <option value=09>sep</option>');
document.writeln(' <option value=10>oct</option>');
document.writeln(' <option value=11>nov</option>');
document.writeln(' <option value=12>dec</option>');
document.writeln(' </select>');
document.writeln(' <input type="hidden" name="sDate" value="">');
document.writeln(' <input type="hidden" name="eDate" value="">');
document.writeln(' <a href="#" onClick="javascript: document.forms[\'events\'].submit();"><img border="0" src="../../images/homepage/2/go.gif" width="25" height="16" align="absmiddle"></a> ');
document.writeln(' <input type="hidden" value="" name="town">');
document.writeln(' <input type="hidden" value="" name="title">');
document.writeln(' <input type="hidden" value="1" name="reset">');
document.writeln(' <input type="hidden" name="domain" value="">');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </form>');
document.writeln(' </table>');
document.writeln(' </div>');
document.writeln(' </div>');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' <form name="sel">');
document.writeln(' <tr> ');
document.writeln(' <td align="center"> ');
document.writeln(' <table width="459" cellpadding="0" cellspacing="0" border="0">');
document.writeln(' <tr> ');
document.writeln(' <td width="100" align="right"> ');
document.writeln(' <input name="radiobutton" type="radio" value="radiobutton" onClick="scrollIt(\'events_table\')" checked>');
document.writeln(' </td>');
document.writeln(' <td width="20"><a href="#" onClick="document.forms[\'sel\'].radiobutton[0].checked = true; scrollIt(\'events_table\');"><span style="font-family: Verdana, Arial, Helvetica; font-size: 10px; color: white;">events</span></a></td>');
document.writeln(' <td width="10" align="right"> ');
document.writeln(' <input name="radiobutton" type="radio" value="radiobutton" onClick="scrollIt(\'web_table\')" checked>');
document.writeln(' </td>');
document.writeln(' <td width="46"><a href="#" onClick="document.forms[\'sel\'].radiobutton[3].checked = true; scrollIt(\'web_table\');"><span style="font-family: Verdana, Arial, Helvetica; font-size: 10px; color: white;">the ');
document.writeln(' web</span></a></td>');
document.writeln(' <td width="10" align="right"> ');
document.writeln(' <input type="radio" name="radiobutton" value="radiobutton" onClick="scrollIt(\'business_table\')">');
document.writeln(' </td>');
document.writeln(' <td width="20"><a href="#" onClick="document.forms[\'sel\'].radiobutton[1].checked = true; scrollIt(\'business_table\');"><span style="font-family: Verdana, Arial, Helvetica; font-size: 10px; color: white;">businesses</span></a></td>');
document.writeln(' <td width="10"> ');
document.writeln(' <input type="radio" name="radiobutton" value="radiobutton3" onClick="scrollIt(\'features_table\')">');
document.writeln(' </td>');
document.writeln(' <td><a href="#" onClick="document.forms[\'sel\'].radiobutton[2].checked = true; scrollIt(\'features_table\');"><span style="font-family: Verdana, Arial, Helvetica; font-size: 10px; color: white;">features</span></a></td>');
document.writeln(' </tr>');
document.writeln(' </table>');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </form>');
document.writeln(' </table>');
document.writeln(' </td>');
document.writeln(' </tr>');
document.writeln(' </table>');
// start the scripts themselves
// event updater function
var eventform = document.forms['events'];
function updateDate() {
var day = eventform.startday.options[eventform.startday.selectedIndex].value;
var month = eventform.startmon.options[eventform.startmon.selectedIndex].value;
eventform.sDate.value = "2005-" + month + "-" + day;
eventform.eDate.value = "2005-" + month + "-" + day;
}
// the actual slider script
// sniff the browser
var isNetscape = false;
if(navigator.appName.indexOf("Netscape") != -1)
{
isNetscape = true;
}
// we are going to need a scrolly function
var scrollspeed = 6;
var currentmoving = "";
var lastmoved = "";
var firsttime = 0;
var startsec = 0;
function initMVSearch() {
// setup the search
var divtoshow = "";
document.forms["events"].domain.value = domainID;
document.forms["web"].domain.value = domainID;
document.forms["features"].domain.value = domainID;
document.forms["askalex"].action = "http://uk1.askalix.com/scripts/ask.dll?m788&domain=" + domainID;
// don't touch below
document.forms["events"].town.value = area;
document.forms["askalex"].towncounty.value = area;
if(londonornot == "london"){
document.forms["askalex"].towncounty.value = reg;
}
// cookie checkeer to see where we were last
if(document.cookie.indexOf("MVsearchLast")!=-1) {
divtoshow = document.cookie.substring(document.cookie.indexOf("MVsearchLast=")+13, document.cookie.indexOf("SSSSSSS"))
if(divtoshow=="events_table") {
document.forms['sel'].radiobutton[0].checked = true;
lastmoved = divtoshow;
}
if(divtoshow=="business_table") {
document.forms['sel'].radiobutton[2].checked = true;
lastmoved = divtoshow;
}
if(divtoshow=="features_table") {
document.forms['sel'].radiobutton[3].checked = true;
lastmoved = divtoshow;
}
if(divtoshow=="web_table") {
document.forms['sel'].radiobutton[1].checked = true;
lastmoved = divtoshow;
}
}
else {
divtoshow = "events_table";
lastmoved = "events_table";
document.cookie = "MVsearchLast=events_tableSSSSSSS";
document.forms['sel'].radiobutton[0].checked = true;
}
if(isNetscape) {
document.getElementById(divtoshow).style.left = 0;
}
else {
document.all[divtoshow].style.left = 0;
}
}
// heres the code that slides the table in and out
// you pass it the id of the table you want to shift.
function scrollIt(element)
{
if(firsttime == 0) {
currentmoving = element;
firsttime = 1;
}
if(isNetscape)
{
// the Netscape version
//alert(parseInt(document.getElementById(lastmoved).style.left));
if(parseInt(document.getElementById(lastmoved).style.left) < 459 && startsec != 1)
{
document.getElementById(lastmoved).style.left = parseInt(document.getElementById(lastmoved).style.left)+scrollspeed;
setTimeout("scrollIt();", 5)
}
else if(parseInt(document.getElementById(currentmoving).style.left) > 0)
{
startsec =1;
document.getElementById(currentmoving).style.left = parseInt(document.getElementById(currentmoving).style.left)-scrollspeed;
setTimeout("scrollIt()", 5)
}
else {
lastmoved = currentmoving;
currentmoving = "";
firsttime = 0;
startsec = 0;
// set a cookie to tell us which div to show
document.cookie = "MVsearchLast=" + lastmoved + "SSSSSSS";
}
}
else
{
// the IE version
//alert(parseInt(document.getElementById(lastmoved).style.left));
if(parseInt(document.all[lastmoved].style.left) < 459 && startsec != 1)
{
document.all[lastmoved].style.left = parseInt(document.all[lastmoved].style.left)+scrollspeed;
setTimeout("scrollIt();", 5)
}
else if(parseInt(document.all[currentmoving].style.left) > 0)
{
startsec = 1;
document.all[currentmoving].style.left = parseInt(document.all[currentmoving].style.left)-scrollspeed;
setTimeout("scrollIt()", 5)
}
else {
lastmoved = currentmoving;
currentmoving = "";
firsttime = 0;
startsec = 0;
// set a cookie to tell us which div to show
document.cookie = "MVsearchLast=" + lastmoved + "SSSSSSS";
//alert(document.cookie);
}
}
}
// start the whole thing up
initMVSearch();
//-->