var rocket = new rkt_obj();

function rkt_obj(){//object
 this.d = document;
 this.ar = ['1', '2', '3', '4','5'];
 this.zoom = function(_num){//void
  var ar = this.ar;
  var d = this.d;
  var n,el1,el2='';
  n = "frame";
  for(var i=0; i<ar.length; i++){
   if(ar[i] != _num){
    el1 = n + ar[i];
    el1 = d.getElementById(el1);
    el1.style.width = 0;
    el1.style.height = 0;
    el1.style.display = 'none';
   }
  }
  el2 = n + _num;
  el2 = d.getElementById(el2);
  el2.style.display = 'block';
  el2.style.width = '100%';
  el2.style.height = '100%';
 };

 this.reset = function(){//void
  var ar = this.ar;
  var d = this.d;
  var n,el='';
  for(var i=0; i<ar.length; i++){
   n = "frame";
   n += ar[i];
   el = d.getElementById(n);
   el.style.display = "inline";
   if(i != ar.length-1){
    el.style.width = "49%";
    el.style.height = "70%";
   } else {
    el.style.width = "99%";
    el.style.height = "70%";
   }
  }
 };

 this.multi = function(){//void
  var ar,d,str,google,yahoo,msn,ask,wiki,p1,p2,p3,obj,el,rbtn = '';
  ar = this.ar;
  d = document;
  str = location.href.split("?search=")[1];
  //google = 'http://www.google.com/search?hl=ja&q=';
  google = 'http://www.google.com/custom?sa=Google+%E6%A4%9C%E7%B4%A2&client=pub-7810192182310390&forid=1&ie=UTF-8&oe=UTF-8&cof=AH%3Acenter%3BFORID%3A1&hl=ja&q=';
  yahoo = 'http://search.yahoo.com/search?ei=UTF-8&p=';
  msn = 'http://search.msn.com/results.aspx?q=';
  //msn = 'http://www.amazon.com/s/?ie=UTF8&tag=exspidernet-22&keywords=';
  //ask ='http://ask.com/web.asp?q=';
  ask = 'http://www.amazon.com/s/?ie=UTF8&tag=exspidernet-22&keywords=';
  //ask = 'http://del.icio.us/search/?fr=del_icio_us&type=all&p=';
  wiki = 'http://en.wikipedia.org/wiki/';
  p1 ='<iframe border=0 bordercolor="#FFFFFF" src="';
  p2 =' width=49% height=70%></iframe> ';
  p3 =' width=99% height=70%></iframe> ';
  obj = p1 + google + str + "\" id=frame1" + p2
      + p1 + yahoo + str + "\" id=frame2" + p2
      + p1 + msn + str + "\" id=frame3" + p2
      + p1 + ask + str + "\" id=frame4" + p2
      + p1 + wiki + str + "\" id=frame5" + p3;
  if(str){
   d.getElementById("relative").innerHTML = '<a href="/i/?search='+ str +'">media</a>';
   d.getElementById("resultbox").innerHTML = obj;
   for(var i=0; i<ar.length; i++){
    el = 'btn' + ar[i];
    el = d.getElementById(el);
    el.style.display = 'inline';
    el.style.height = '25px';
    el.style.width = '50px';
   }
   rbtn = d.getElementById("reset");
   rbtn.style.display = 'inline';
   rbtn.style.height = '25px';
   rbtn.style.width = '50px';
  }
  if (str != undefined) d.searchform.search.value = decodeURI(str);
  d.getElementById("go").style.fontWeight = 'normal';
 };

 this.add = function (name,ext,cat,pid){//void
  var w = window;
  if ((typeof w.sidebar == "object") 
  && (typeof w.sidebar.addSearchEngine == "function"))
  {
    w.sidebar.addSearchEngine(
      "http://www.rocketparc.com/e/rocket.src",
      "http://www.rocketparc.com/rocket.gif", "Rocket", "");
  } else {
   alert("You will need a browser which supports Sherlock to install this plugin.");
  }
 };
}; //end of object

