﻿

var sps = [
    ["http://video.search.yahoo.com/search/video?p=",null,null,null,null
    ],
        ["http://search.live.com/video/results.aspx?q=", null,null,null,null
        ],
  ["http://www.youtube.com/results?search_query=", null,null,null,null
  ],
     
         ];
var acc=["", "", "", ""];
var cur_sp=1;
function search(ev){
	var e = ev || window.event;
	if(e){
		var key = window.event ? e.keyCode : e.which;
		if(key == 13) 
			do_s();
	}
}
function do_s(){
var orig = $("keyword").value, key = encodeURIComponent(orig), gb = sps[cur_sp-1][0].indexOf("UTF-8") > 0 || cur_sp==4;
if(!orig.length) 
$('if_result').src = "";
else{
var url = sps[cur_sp-1][0] + (gb?UTF-8(orig):key) + acc[cur_sp-1];
$('if_result').src = url;

}
}
function select_tag(oid){
cur_sp = oid;

do_s();
}
if(document.all) var location = null;
var s = document.location.search.substr(1).split("&");
function val(key){ 
for(var i=0; i<s.length; i++){
var kv = s[i].split("=");
if(kv.length != 2) 
continue;
if(kv[0] == key) 
return kv[1];
} 
return null;
}
var kw = val("kw"), sp = val("sp"), f = val("from");
if(sp) 
try{
cur_sp = parseInt(sp);
if(cur_sp<5 && cur_sp>0)
select_tag(cur_sp);else cur_sp=1
}catch(e)
{}
if(kw) 
$('keyword').value = decodeURIComponent(kw);

do_s();







function check(select){
key11 = document.form_search.keyword.value;
key =  encodeURIComponent(key11);

switch(select){
case 1: window.open('http://video.google.com/videosearch?q='+key);break;
case 2: window.open('http://video.search.yahoo.com/search/video?p='+key);break;
case 3: window.open('http://search.live.com/video/results.aspx?q='+key);break;
case 4: window.open('http://www.altavista.com/video/results?itag=ody&q='+key);break;
case 5: window.open('http://www.exalead.com/video/results?q='+key);break;
case 6: window.open('http://video.gigablast.com/index.php?q=wmy'+key);break;
case 7: window.open('http://video.amfibi.com/search?query='+key);break;
case 8: window.open('http://pixsy.com/search.aspx?q='+key+'&ctid=2');break;
case 9: window.open('http://search.lycos.com/?tab=multi&cat=video&query='+key);break;
case 10: window.open('http://snipp.tv/clips/'+key);break;
case 11: window.open('http://www.blinkx.com/videos/'+key);break;
case 12: window.open('http://www.youtube.com/results?search_query='+key);break;




case 100: window.open('https://isohunt.com/torrents/?ihq='+key);break;
case 101: window.open('http://btjunkie.org/search?q='+key);break;
case 102: window.open('http://www.bittorrent.com/search?q='+key);break;
case 103: window.open('http://www.mininova.org/search/?search='+key);break;
case 104: window.open('http://torrentman.com/search.php?search='+key);break;
case 105: window.open('http://www.pizzatorrent.com/'+key+'-torrents');break;
case 106: window.open('http://www.torrentreactor.net/search.php?words='+key);break;
case 107: window.open('http://www.torrentz.com/search?q='+key);break;




case 200: window.open('http://www.imdb.com/find?s=all&q='+key);break;
case 201: window.open('http://www.hollywood.com/search.aspx?q='+key);break;
case 202: window.open('http://search.ovguide.com/movies_tv.php?q='+key);break;
case 203: window.open('http://www.fandango.com/GlobalSearch.aspx?tab=Movies&q='+key);break;
case 204: window.open('http://www.tvguide.com/search/index.aspx?keyword='+key);break;
case 205: window.open('http://tv.yahoo.com/search?p='+key);break;
case 206: window.open('http://www.locatetv.com/?q='+key);break;


}

}