var ZeroClipboard = (function () { // Immediately invoked function expression
// ZeroClipboard is required for interface to ZeroClipboard.swf file.
// and a few things in the search box HTML. See bottom.
// When invoked, mys_interval is set up (see bottom) and initial.start is run when mys_e element exists in the page.

// id's from the HTML, last 4 used with eval.
// mys_copy, mys_c, mys_search, mys_but_1, mys_b, mys_controls, mys_type, mys_modify, mys_e

// class id from HTML
// mys_ib

// Objects, top to bottom.
var initial, zc, events, search, button, mys_controls, mys_type, mys_modify, mys_e, element, util, cookie, engine


initial = {
//
start: function () { // Initialises buttons, events, engines. 
// Setup flash movie over the button.
var idNum, list, total_buttons=1
for(idNum=1; idNum<=total_buttons; ++idNum) {
   zc.setMovie(idNum)
}
zc.copy_code_on() // Copy Code button
// Quirks mode fix for IE 8+
if(document.documentMode==5 || document.compatMode=='BackCompat') { // Quirks mode, cross browser 
   if( /MSIE (.)/.test(navigator.userAgent) && Number(RegExp.$1)>=8 ) { // IE8+
      list = element.getTagClassElements('div', 'mys_ib') // get inline blocks
      element.setStyles(list, 'display', 'inline')
      // Need to set hover to an expression
   }
}
button.init()
events.setEvents(button.list, 'click', events.inn) 
events.setEvents(button.list, 'mousedown', events.inn) 
events.setEvents(button.list, 'mouseover', events.inn) 
events.setEvents(button.list, 'mouseout', events.inn) 
engine.init() 
engine.set()
if(top[0]) {
   setTimeout(function() {search.focus()}, 600)
}
else {
   search.focus()
}
} 
} // end initial


zc = { // #########  ZeroClipboard stuff  ##########
//
set_text: function(idNum) {
// Only one button idNum=1. Get all the code text, set it into the movie
var txt, mov
txt = this.getDivText('mys_copy')
mov = element.el("ZeroClipboard_" + idNum)
mov.setText(txt)
},
//
flashEvents: function(idNum, eventName, args) {
var style
style = element.el('mys_but_'+idNum).style
if(eventName=='complete') { // happens after click finished  
   style.color = 'black'
   setTimeout(function() {alert('The search box code is now copied to your clipboard,\nand you can paste it into your webpage.\n\nYou also need to copy ZeroClipboard.swf and mys_search.js\nfrom this website to your website.')},500)
   search.focus()
}
else if(eventName=='mouseOver') {  
   // zc.set_text(idNum) // used to be here but moved to mousedown due to text box blanking on mouseover
}
else if(eventName=='mouseDown') { // Set the text in ZeroClipboard.swf before click event 
   zc.set_text(idNum) // Can't use "this" instead of zc here for some reason.
   style.color = 'red'
}
else if(eventName=='mouseUp' || eventname=='mouseOut') {  
   style.color = 'black'
}
},
//
getHtml: function(width, height, idNum) {
var flashvars, movieId, html, protocol
flashvars = "id=" +idNum+ "&width=" +width+ "&height=" +height
movieId = "ZeroClipboard_" + idNum
if (navigator.userAgent.match(/MSIE/)) {
   protocol = location.href.match(/^https/i) ? 'https://' : 'http://'
   html = '<object id="'+movieId+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" align="middle"><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>'
}
else { 
   html = '<embed src="'+ZeroClipboard.moviePath+'" id="'+movieId+'" name="'+movieId+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
}
return html
},
//
setMovie: function(idNum) {
// Create hidden ZeroClipboard.swf movie over DOM element to be clicked when copying
var elemId, elem, Pos, div, style, zIndex, body
elemId = 'mys_but_' + idNum
Pos = this.pos(elemId)
elem = element.el(elemId)
div = document.createElement('div')
style = div.style
if( !/MSIE /.test(navigator.userAgent)) {
   style.overflow = 'auto'
}
style.position = 'absolute'
style.left = '' + Pos.left + 'px'
style.top = '' + Pos.top + 'px'
style.width = '' + Pos.width + 'px'
style.height = '' + Pos.height + 'px'
zIndex = 99
if (elem.style.zIndex) {
   zIndex = parseInt(elem.style.zIndex) + 1
}
style.zIndex = zIndex
//top.listObj(style)
// style.backgroundColor = '#f00'; // debug
body = document.getElementsByTagName('body')[0]
body.appendChild(div)
// Put the movie html in the div
div.innerHTML = this.getHtml(Pos.width, Pos.height, idNum) 
},
//
getDivText: function(id) {
var div, txt
div = document.getElementById(id)
// Remove any text from the box
div.getElementsByTagName('input')[0].value=''
txt = div.innerHTML
// Set \n linefeeds
txt = txt.replace(/\r\n/g,'\n').replace(/\r/g,'\n')
// Add the div tag itself
txt = '<div id="' + id + '">' + txt + '</div>\n'
// Set \r\n linefeeds for Windows
if(navigator.platform.indexOf("Win")!=-1) {
   txt = txt.replace(/\n/g,'\r\n')
}
if( /MSIE (.)/.test(navigator.userAgent) && Number(RegExp.$1)<=8 ) { // upToIE8
   // Put back what IE8 took out
   txt = txt.replace(/([\s\S]*)(<style)([\s\S]*)(<style)([\s\S]*)/i, '$1$2$3<!--[if lte IE 8]>$4$5')
   txt = txt.replace(/([\s\S]*)(<\/style)([\s\S]*)(<\/style>)([\s\S]*)/i, '$1$2$3$4<![endif]-->$5')
}
// Remove any anchor attributes put in by browsers
txt = txt.replace(/<a[^>]*>/gi,'<a>') 
// Remove any added button attributes
txt = txt.replace(/<button[^>]*>/gi,'<button>') 
// Remove anything added before id=
txt = txt.replace(/<span .*?id=/gi,'<span id=') 
txt = txt.replace(/<div .*?id=/gi,'<div id=') 
return txt
},
//
pos: function(elemId) {
var elem, Pos
elem = element.el(elemId)
Pos = {left:0, top:0, width:elem.width ? elem.width : elem.offsetWidth, height:elem.height ? elem.height : elem.offsetHeight}
// Calculate absolute position
while (elem) {
   Pos.left += elem.offsetLeft
   Pos.top += elem.offsetTop
   elem = elem.offsetParent
}
// Below added for FF bug 
Pos.top -= 4
Pos.height += 4
return Pos
},
//
copy_code_on: function () {
var style  = element.el('mys_but_1').style
style.color = 'black'
return
}
}
// #########  End of ZeroClipboard stuff  ##########


events = {
//
add: function(node, eventType, func) {
// E.g. events.add(top, 'load', mys_start)
// node['on' + type] = func  // CROCKFORD but not right since overwrites existing
if(window.addEventListener && !window.opera) { 
   // Firefox 1.5+, Gecko-1.0.1+, Mozilla, Konqueror, Safari, iCab
   node.addEventListener(eventType, func, false) // Use false for bubbling, compatible with IE
}
else if(window.attachEvent) {
   // Microsoft IE 5+, Opera 8.0+
   node.attachEvent('on' + eventType, func)
}
},
// SUB-OBJECT
key: { 
pressFlag: false,
press: function(e) {
return this.pressed(e, 'press')
},
up: function(e) {
return this.pressed(e, 'up')
},
pressed: function(e, callr) {
var code
if(callr == 'press') { 
   this.pressFlag = true
}
else { // Up key
   engine.set()
   if(!window.event || this.pressFlag) { // FF bugfix or press() occured before
      this.pressFlag = false
      return false
   }
}
e = e || window.event
code = e.keyCode || e.which
if(code == 13) {
   window.open(search.url('Bing'), '_blank')
   return false
}
return true
}
}, 
// 
setEvents: function(list, eventName, eventHandler) {
// E.g. events.setEvents(button.list, 'click', events.inn) 
var i
for(i=0; i<list.length; i++) {
   this.add(list[i], eventName, eventHandler)
}
},
//
inn: function(e) { // .in reserved word in IE
// All button click, mousedown, mouseover, mouseout events come here. Also engine mouseover.
// Engine click works direct from the anchor. 
// Always remove all event handlers from nodes before removing the node. Applies to innerHTML,
var elem, anode
e = e || event
elem = e.target || e.srcElement
if (elem.nodeType == 3) { // defeat Safari bug
   elem = elem.parentNode
}
// Stop event propogating higher.
e.cancelBubble = true
if (e.stopPropagation) {
   e.stopPropagation()
}
e.returnValue = false
if(e.preventDefault) {
   e.preventDefault()
} 
if(e.type == 'mouseover') { 
   if(elem.nodeName.toLowerCase() == 'button') {
      elem.style.borderColor = 'darkgray'; 
      elem.style.cursor = 'pointer'; 
      return false // Nothing else to do
   }
}
else if(e.type == 'mouseout') { 
   elem.style.borderColor = 'transparent'
   //elem.style.borderColor='tomato'; 
   //elem.style.filter="chroma(color='tomato')"; 
   return false // Nothing else to do
}
else if(e.type == 'mousedown') { 
   // Button mousedown
   elem.style.outlineColor = 'black'
   return false // Nothing else to do
}
else if(e.type == 'click') { 
   // Button finish click
   elem.style.outlineColor = 'transparent' 
   elem.blur() // Remove any IE black focus outline
}
// Handled by first ancestor with an id
anode = element.anode(elem)
if(anode) {
   // Route the event to the element ancestor node event handler
   eval( anode.id + '.evt(elem, anode)' )  
}
return false
}
}


search = { 
//
url: function(engine) {  // Return search url for given engine
var wiki, url, text, what, domain, query, dir, unadjustedText
mys_controls.value = element.getBox().value // crap way to do it. Better to fix button using .on() etc.
unadjustedText = mys_controls.value 
mys_type.value = ''
button.mod()
text = mys_controls.value
what = mys_type.value.toLowerCase()
if(engine == "Google") {
   if(what == 'images') {
      url = 'http://images.google.com'
      if(text) {
          url += '/images?hl=en&q=' + text 
      }
   }
   else if(what == 'video') {
      url = 'http://www.youtube.com'
      if(text) {
          url += '/results/?search_query=' + text
      }
   }
   else if(what == 'news') {
      url = 'http://news.google.com/news'
      if(text) {
         url += '/search?aq=f&cf=all&ned=us&hl=en&q=' + text
      }
      else {
         url += '?pz=0&hl=en&ned=us'
      }
   }
   else if(what == 'shopping') {
      url = 'http://www.google.com'
      if(text) {
         url += '/search?q=' + text + '&hl=en&tbs=shop:1'
      }
      else {
         url += '/prdhp?hl=en&tab=wf'
      }
   }
   else if(what == 'maps') {
      url = 'http://maps.google.com/maps?'
      if(text) {
         url += 'q=' + text + '&hl=en&tab=wl'
      }
      else {
         url += 'hl=en&tab=wl'
      }
   }
   else if(!what) {
      url = 'http://www.google.com'
      if(text) {
         url += '/search?hl=en&q=' + text + '&aq=f&aqi=g10&aql=&oq='
      }
   }
   else {
      url = 'http://google.com'
   }
}
else if(engine=='Yahoo') {
   if(what=='images') {
      url = 'http://images.search.yahoo.com/search/images?p=' + text + '&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8'
   }
   else if(what=='news') {
      if(!text) {
         url = 'http://news.yahoo.com/i/721'
      }
      else {
         url = 'http://news.search.yahoo.com/search/news?p=' + text + '&c=&fr=sfp&ei=UTF-8&x=wrt'
      }
   }
   else if(what=='video') {
      url = 'http://video.search.yahoo.com/search/?p=' + text + '&fr=yfp-t-501&ei=utf-8&fr2=tab-web&n=21&js=1&tnr=20'
   }
   else { // normal search  
      url = 'http://search.yahoo.com/search?p=' + text + '&fr=yfp-t-501&toggle=1&cop=mss&ei=UTF-8'
   }
}
else if(engine=='Bing') {
   url = 'http://www.bing.com/'
   if(what=='images') {
      url += 'images/search?q=' + text + '&go=&form=QBIR&qs=n&sk=' 
   }
   else if(what=='news') {
      url += 'news/search?q=' + text + '&setmkt=en-US&setlang=match&uid=CEAF328D&FORM=W5WA'
   }
   else if(what=='video') {
      url += 'video/search?q=' + text + '&go=&form=QBVR&qs=n&sk='
   }
   else { // normal search  
      url += 'search?q=' + text + '&go=&form=QBRE&scope=web&filt=custom'
   }
}
else if(engine=='Archive') {
   //http://web.archive.org/web/*/http://www.plexel.com
   url = 'http://web.archive.org/*/'
   if(text.indexOf('://') == -1) {
      text = 'http://' + text
   }
   url += text
}
else if(engine=='Wikipedia') {
   wiki = "http://en.wikipedia.org/wiki/"
   if(what=='news') {
      if(text) {
         url = 'http://en.wikinews.org/w/index.php?title=Special%3ASearch&search=' +text+ '&button='
      }
      else {
         url= wiki + 'Portal:Current_events'
      }
   }
   else {
      url = wiki + 'Special:Search?search=' + text + '&go=Go'
   }
}
else if(engine=='Flickr') {
   url = 'http://flickr.com/search/?q=' + text
}
else if(engine=='CanUse') {
   //url = 'http://flickr.com/search/?q=' + text + '&l=comm&ct=0'
   url = 'http://search.creativecommons.org/?q=' + text 
}
else if(engine=='Mse360') {
   // normal images search
   url = 'http://mse360.com/new.php?search=' + text + '&set_country=ww'
}
else if(engine=='Twitter') {
   url = 'http://search.twitter.com/search?q='
   if(text.indexOf('inurl:') != -1) {
      url = 'http://twitter.com/' + unadjustedText.replace(/ /g,'')
   }
   else if(text.indexOf('intitle:') != -1) {
      url = url + '&tag=' + unadjustedText.replace(/ /g,'+')
   }
   else {
      url += text
   }
}
else if(engine=='Question') {
   url = 'http://www.trueknowledge.com/q/' + text
}
else if(engine=='BBC') {
   if(!text) {
      if(what == 'news') {
         url = 'http://www.bbc.co.uk/iplayer/console/bbc_world_service'
      }
      else {
         url = 'http://news.bbc.co.uk'
      }
   }
   else {
      url = 'http://search.bbc.co.uk/search?uri=%2F&scope=all&go=toolbar&q=' + text
   }
}
else if(engine=='Compute') {
   if(!text) {
      url = 'http://www.wolframalpha.com'
   }
   else {
      url = 'http://www.wolframalpha.com/input/?i=' + text
   }
}
else if(engine=='Reuters') {
   url = 'http://www.reuters.com'
   if(text) {
      url += '/search?blob=' +text+ '&x=30&y=6'
   }
}
else {
   alert('Unknown search engine "' + engine + '"')
   url = null
}
return url
},
//
focus: function() {
if(!top.c1_G || document.title=='Master') { // Focus if Plexel not loaded or for Master page.
   element.getBox().focus()
}
}
}



button = { 
// Button methods
//
list: '',
//
init: function() {
var buts, i, len, but
buts = element.getIdTagElements('mys_b', 'button')
len = buts.length
for(i=0; i<len; i++) {
   but = buts[i]
   but.disabled = 'disabled' 
   but.setAttribute('type', 'button') // Disabled thing stops IE type submit.
   but.disabled = false 
   if(cookie.get(but.innerHTML)) {
      this.on(but)
   }
}
this.list = buts // list of all buttons
},
//
mod: function() { // For each button that is on, run button .aid.mod method
var i, butsOn, aid
butsOn = this.onList()
for(i=0; i<butsOn.length; i++) {
   aid = butsOn[i].aid 
   eval(aid + '.mod(butsOn[i])') // aid can be mys_controls or mys_type
}
},
// 
onList: function(elem) {
// Return array of button elements turned on, each having 
// .aid ancestor node id.
var buts, i, butsOn=[]
if(elem) {
   buts = elem.getElementsByTagName('button')
}
else {
   buts = this.list // Use list of all buttons instead
}
for(i=0; i<buts.length; i++) {
   if(this.isOn(buts[i])) { 
      buts[i].aid = element.anode(buts[i]).id 
      butsOn[butsOn.length] = buts[i]
   }
}
return butsOn
},
//
isOn: function(elem) {
if(element.color(elem)) {
   return true
}
return false
},
//
off: function(but) {
if( /MSIE (.)/.test(navigator.userAgent) && Number(RegExp.$1)<=7 ) {
   but.style.backgroundColor='tomato' 
   but.style.filter="chroma(color='tomato')" 
}
else {
   but.style.backgroundColor = 'transparent'
}
cookie.set(but.innerHTML, '')
},
//
on: function(but) {
but.style.backgroundColor = '#dddddd'
cookie.set(but.innerHTML, 'on', 10000)
},
//
allOff: function(elem) {
// Turn off all descendant buttons of elem
var i, buts, len
buts = elem.getElementsByTagName('button')
len = buts.length
for(i=0; i<len; i++) {
   but = buts[i]
   this.off(but) 
   cookie.set(but.innerHTML, '')
}
}
}


function buttonList() {
// button lists
//
}
buttonList.prototype = {
value: '',
//
evt: function(elem, anode) { 
if(button.isOn(elem)) { // clicked a button that is on
   button.off(elem)
   this.value = ''
}
else { // clicked unset button with either another button set or none set
   button.allOff(anode)
   // Turn off all engine buttons
   // Turn on elem button
   button.on(elem)
   this.value = elem.innerHTML
   // turn on all engines that work with this button
}
search.focus()
engine.set()
}
}

// Used with Eval
mys_controls = new buttonList()
//
mys_controls.mod = function(button) { // called with Eval from button.mod()
var A, i, name, text
name = button.innerHTML.toLowerCase() // name e.g. InTitle
text = this.value
this.name = this.value
if(text.charAt(0)=='"') { // Assume text in quotes
   text = name + ':' + text
}
else { // Not in quotes
   A = text.split(' ')
   text = ""
   for(i=0; i<A.length; i++) {
      if(A[i]) {
         if(text) {
            text += ' ' // add space if there's something there
         }
         text += name.toLowerCase() + ':' + A[i]
      }
   }
}
text = encodeURIComponent(text)
text = text.replace(/%20/g,'+')
text = text.replace(/%3A/g,':')
this.value = text
}

// Used with Eval
mys_type = {
// handles <span id="mys_type">
//
value: '',
//
evt: function(elem, anode) {
mys_controls.evt(elem, anode) // re-route it
},
//
mod: function(button) {
this.value = button.innerHTML 
}
}

// Used with Eval
mys_modify = {
// handles <span id="mys_modify">
//
evt: function(elem) {
// Modify what's in the text box
var text, ix, Box, what, child
Box = element.getBox()
text = Box.value
what = elem.innerHTML
// If quotes then add or remove quotes
if(what=='Clear') {
   Box.value = ""
}
else if(what=='Exact') {
   if(text.substring(0,1)=='"') { // Already has quotes
      text = text.substring(1)
      if(text.substring(text.length-1)=='"') {  // Remove trailing quote
         text = text.substring(0, text.length-1)
      }
   }
   else { // Add quotes
      text = '"' + text +'"'
   }
   Box.value = text
}
else if(what=='Site') {
   ix = text.toLowerCase().indexOf('.com') // Look for '.com'
   if(text.indexOf('site:')==0) { // Already is a site search
      text = text.substring(0,ix) + text.substring(ix+4) // Remove '.com'
      text = text.substring(5) // Remove existing 'site:'
   }
   else { // add 'site:' and '.com'
      if(ix == -1) { // no existing .com
         ix = text.indexOf(' ') // Look for any space
         if(ix==-1) {  // No space so tack on end
            text += '.com'
         }
         else { // insert '.com' before 1st space
            text = text.substring(0,ix) + '.com' + text.substring(ix)
         }
      }
      text = 'site:' + text
   }
   Box.value = text
}
else if(what=='Set') {
   //child = document.createElement('p')
   //child.data = "G"
   //elem.appendChild(child)
}
search.focus()
engine.set()
}
}

// Used with Eval
mys_e = {
//
evt: function(elem) {
// All mouse over anchors come here
var url
url = search.url(elem.innerHTML)
// Set the anchor href and target
elem.href = url
elem.target = '_blank'
}
}


element = {
//
color: function(elem) {
// Returns res: in hex e.g. '#f1e800'. Color words left alone. Transparent/tomato returned as ''.
var res = ""
if(!elem) {
   elem = this.el('mys_b')
}
res = elem.style.backgroundColor
res = util.rgbToHexColor(res)
if(res=='transparent' || res=='tomato') {
   res = ''
}
return res
},
//
getBox: function() { // return the search box element
var box
box = this.el('mys_input')
return box
},
//
el: function(id) {
return document.getElementById(id)
},
//
getTagClassElements: function(tag, className) {
// Return an array of all tag elements with className
var res=[], list, i
list = document.getElementsByTagName(tag)
for(i=0; i<list.length; i++) {
   if(list[i].className==className) {
      res[res.length] = list[i]
   }
}
return res
},
//
getIdTagElements: function(id, tagName) {
// Return a list of all descendant tag elements of id
var list, elem
elem = element.el(id)
list = elem.getElementsByTagName(tagName)
return list
},
//
setStyles: function(list, property, value) {
// E.g. element.setStyles(elementsList, 'display', 'inline')
var i
for(i=0; i<list.length; i++) {
   list[i].style[property]=value
}
},
//
anode: function(elem) {
// Returns nearest ancestor node with id or {}
var ancestor
ancestor = elem.parentNode
while(ancestor) {
   if(ancestor.id) {
      return ancestor
   }
   ancestor = ancestor.parentNode
}
return {} // no id for any ancestor
}
}


util = {
//
rgbToHexColor: function(v) { 
// E.g. 'rgb(5,2,11)' converts to "#05020b". All other formats returned unchanged.
var i
v = v.split('(')
if(!v[1]) return v[0]
v = v[1].replace(/ /g, '').replace(/\)/, '')
v = v.split(',')
for(i=0; i<v.length; i++) {
   v[i] = Number(v[i]).toString(16)
   if(v[i].length==1) v[i] = '0' + v[i]
}
return '#'+v.join('')
}
}


cookie = {
get: function(name) {
var start, end
if (document.cookie.length > 0) {
   start=document.cookie.indexOf(name + "=")
   if (start!=-1) {
      start=start + name.length+1
      end=document.cookie.indexOf(";",start)
      if (end==-1) {
         end=document.cookie.length
      }
      return unescape(document.cookie.substring(start,end))
  }
}
return ""
},
set: function(name, value, expireDays) {
// To delete cookie set expireDays falsey
var exdate=new Date(), cookie=name
exdate.setDate(exdate.getDate()+expireDays);
cookie += "=" + escape(value) + ( !expireDays ? ";expires=Thu, 01-Jan-70 00:00:01 GMT" : ";expires="+exdate.toGMTString() )
document.cookie = cookie
},
enabled: function() {
this.set('test', 'enabled', 1)
if(this.get('test')) {
   this.set('test', '', 0) // delete test cookie
   return true
}
return false
}
}


engine = {
//
list: '',  // list is a live connection to the engine links
oEngs: [], // initial engine names
//
init: function(){
var i, list
list = element.getIdTagElements('mys_e', 'a') 
this.list = list
for(i=0; i<list.length; i++) {
   this.oEngs.push(list[i].childNodes[0].data)
}
},
//
set: function(){
var i, list=this.list
for(i=0; i<list.length; i++) {
   this.seti(i, this.oEngs[i])   
}
},
//
seti: function(i, text){ // change the engine text and href
   var atag, parent, list=this.list
   parent = list[i].parentNode
   atag = list[i].cloneNode(true)
   if(text) {
      atag.childNodes[0].data = text // There is one child node which is the <a> tag text.
   }
   else {
      text = list[i].childNodes[0].data
   }
   atag.setAttribute('href', search.url(text)) 
   events.add(atag, 'mouseover', events.inn) // Add event since FF events not cloned
   parent.replaceChild(atag, list[i]) // Forces any visited color to appear for IE
},
//
setText: function(i, text){ // called from mys_controls via buttonList
this.seti(i,text)   
}
}


// ####### This gets run at start #######
mys_interval = setInterval( // wait till elem is not null then start
function (){
var elem = document.getElementById('mys_e')
if(elem!=null) {
   initial.start()
   clearInterval(mys_interval)
}
},30)


return { // All things needed externally in ZeroClipboard object
dispatch: zc.flashEvents,
moviePath: 'ZeroClipboard.swf', 
mys_key: events.key
} 

})() // end function wrapper




