/*
Javascript support for Ihdt site Mike Watts
*/

//------------------------------------------------------------------------------------------
function mask(end,middle,start,subject){
//obfuscate email addresses to keep out spambots
var one ='mai';
var two='lto:';
var three='?Subject=';
//start,middle,end,subject;
var putogether= one+two+start+middle+end+three+subject;
document.location.href=eval('"'+putogether+'"');
window.status=putogether;
}
//------------------------------------------------------------------------------------------
function esubmit()
//are you sure function for enter results
{
return confirm("If you're sure you are ready to submit these results, please press OK \n If not, please press Cancel to keep editing.\n\nIf you later need to change results, please enter the changes, adding UPDATE to the event location, or UPDATE2, ....");
}
//------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------
//search routines

function isrch(stype) //can search wikipedia or all types of site...
{
var s=document.getElementById('srch').value;

if (s=='') {
  alert('Please fill in what you are searching for first');
  return;
  }

switch (stype) {
case 'w':
  document.location.href='http://en.wikipedia.org/wiki/' + s;
  break;
case 'g':
  document.location.href='http://www.google.co.uk/search?q=' + s +  '&submit2=Google+Search';
  break;
case 'b':
  document.location.href='http://www.google.co.uk/search?q=' + s +  '&submit2=Google+Search&as_sitesearch=www.horsedrivingtrials.co.uk';
  break;
case 'e':
  document.location.href='http://www.google.co.uk/search?q=' + s +  '&submit2=Google+Search&as_sitesearch=www.eacdg.co.uk';
  break;
case 'i':
  document.location.href='http://www.google.co.uk/search?q=' + s +  '&submit2=Google+Search&as_sitesearch=www.indoordriving.co.uk';
  break;
case 's':
  document.location.href='http://www.streetmap.co.uk/streetmap.dll?postcode2map?' + s.replace(' ','+');
//    document.location.href='http://www.streetmap.co.uk/streetmap.dll?Postcode2Map?code=' + s.replace(' ','+')+ '&title=Your+map&back=Back+to+eacdg&url=www.eacdg.co.uk&nolocal=X'
    break;
case 'd':
  document.location.href='http://www.thefreedictionary.com/' + s;
  break;
case 'm':
  document.location.href='http://www.mamma.com/Mamma?utfout=1&qtype=0&query=' + s;
  break;
  }
}
//------------------------------------------------------------------------------------------
function ipaster()
{
var s = document.getElementById('paste').value;

if (!s || s.length <= 0) {
  alert('Nothing to paste');
  return;
  }

alert("Pasting " + s);
}
//------------------------------------------------------------------------------------------
