var clientPC = navigator.userAgent.toLowerCase(); var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
&& (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
&& (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); var gb_InFocus = false; var gb_Searched = false; var TdObj, B1Obj, B2Obj, B3Obj, B4Obj; var gb_ew = false; var gsSearch1, gsSearch2, gsSearch3, gsSearch4; var gbUse1,gbUse2,gbUse3,gbUse4; var gbSearchNum = 4; var gbSENUm = 0; var gbFrameFocus = 0; function xppr(im){var i=new Image();i.src='images/bt'+im;return i;}function xpe(id){x=id.substring(0,id.length-1);document['xpwb'+x].src=eval('xpwb'+id+'.src');if(id.indexOf('e')!=-1)document['xpwb'+x+'e'].src=eval('xpwb'+id+'e.src');}
xpwb0n=xppr('0_0.gif');xpwb0o=xppr('0_1.gif');xpwb0c=xppr('0_2.gif'); xpwb1n=xppr('1_0.gif');xpwb1o=xppr('1_1.gif');xpwb1c=xppr('1_2.gif');xpwb2n=xppr('2_0.gif');xpwb2o=xppr('2_1.gif');xpwb2c=xppr('2_2.gif');xpwb3n=xppr('3_0.gif');xpwb3o=xppr('3_1.gif');xpwb3c=xppr('3_2.gif');xpwb4n=xppr('4_0.gif');xpwb4o=xppr('4_1.gif');xpwb4c=xppr('4_2.gif'); xpwb5n=xppr('5_0.gif');xpwb5o=xppr('5_1.gif');xpwb5c=xppr('5_2.gif'); xpwb7n=xppr('7_0.gif');xpwb7o=xppr('7_1.gif');xpwb7c=xppr('7_2.gif'); function InitGlobalparams()
{ gb_ew = false; gsSearch1 = "http://www.google.com/search?hl=en&q=<term>"; gsSearch2 = "http://omgili.com/omgili.search?q=<term>"; gsSearch3 = "http://search.yahoo.com/search?ei=UTF-8&p=<term>"; gsSearch4 = "http://www.bing.com/search?q=<term>"; gbUse1 = gbUse2 = gbUse3 = gbUse4 = true;}
function ol()
{ InitGlobalparams(); TdObj = document.getElementById('ResTdID'); B1Obj = document.getElementById('B1ID'); B2Obj = document.getElementById('B2ID'); B3Obj = document.getElementById('B3ID'); B4Obj = document.getElementById('B4ID'); Btn1Obj = document.getElementById('Btn1ID'); Btn2Obj = document.getElementById('Btn2ID'); Btn3Obj = document.getElementById('Btn3ID'); Btn4Obj = document.getElementById('Btn4ID'); document.getElementById('q').focus(); LoadSettings();}
function SaveSettings()
{ if(document.getElementById('cb5').checked)
Set_Cookie( 'EW', '1', 1000, '/', '', '' ); else
Set_Cookie( 'EW', '0', 1000, '/', '', '' ); if(document.getElementById('url1').value.length > 5)
Set_Cookie( 'URL1', document.getElementById('url1').value, 1000, '/', '', '' ); if(document.getElementById('url2').value.length > 5)
Set_Cookie( 'URL2', document.getElementById('url2').value, 1000, '/', '', '' ); if(document.getElementById('url3').value.length > 5)
Set_Cookie( 'URL3', document.getElementById('url3').value, 1000, '/', '', '' ); if(document.getElementById('url4').value.length > 5)
Set_Cookie( 'URL4', document.getElementById('url4').value, 1000, '/', '', '' ); if(document.getElementById('cb1').checked)
Set_Cookie( 'use1', '1', 1000, '/', '', '' ); else
Set_Cookie( 'use1', '0', 1000, '/', '', '' ); if(document.getElementById('cb2').checked)
Set_Cookie( 'use2', '1', 1000, '/', '', '' ); else
Set_Cookie( 'use2', '0', 1000, '/', '', '' ); if(document.getElementById('cb3').checked)
Set_Cookie( 'use3', '1', 1000, '/', '', '' ); else
Set_Cookie( 'use3', '0', 1000, '/', '', '' ); if(document.getElementById('cb4').checked)
Set_Cookie( 'use4', '1', 1000, '/', '', '' ); else
Set_Cookie( 'use4', '0', 1000, '/', '', '' ); LoadSettings();}
function LoadSettings()
{ var lsEnlarge = Get_Cookie( 'EW' ); if(lsEnlarge == "1")
document.getElementById('cb5').checked = gb_ew = true; else
document.getElementById('cb5').checked = gb_ew = false; var lnUseNum = 0; if(Get_Cookie( 'use1' ) == "0")
document.getElementById('cb1').checked = gbUse1 = false; else
{ document.getElementById('cb1').checked = gbUse1 = true; ++lnUseNum;}
if(Get_Cookie( 'use2' ) == "0")
document.getElementById('cb2').checked = gbUse2 = false; else
{ document.getElementById('cb2').checked = gbUse2 = true; ++lnUseNum;}
if(Get_Cookie( 'use3' ) == "0")
document.getElementById('cb3').checked = gbUse3 = false; else
{ document.getElementById('cb3').checked = gbUse3 = true; ++lnUseNum;}
if(Get_Cookie( 'use4' ) == "0")
document.getElementById('cb4').checked = gbUse4 = false; else
{ document.getElementById('cb4').checked = gbUse4 = true; ++lnUseNum;}
gbSearchNum = lnUseNum; var lsURL = Get_Cookie( 'URL1' ); if(lsURL != null)
gsSearch1 = lsURL; lsURL = Get_Cookie( 'URL2' ); if(lsURL != null)
gsSearch2 = lsURL; lsURL = Get_Cookie( 'URL3' ); if(lsURL != null)
gsSearch3 = lsURL; lsURL = Get_Cookie( 'URL4' ); if(lsURL != null)
gsSearch4 = lsURL; document.getElementById('url1').value = gsSearch1; document.getElementById('url2').value = gsSearch2; document.getElementById('url3').value = gsSearch3; document.getElementById('url4').value = gsSearch4;}
function CloseSettings()
{ var SettingsObj = document.getElementById("SettingsID"); SettingsObj.style.display = "none"; var SOPT = document.getElementById('SEOptID'); SOPT.style.display = "none";}
function ShowSettings()
{ var SettingsObj = document.getElementById("SettingsID"); var SettingsTxtObj = document.getElementById("SettingsTxtID"); var TdObj = document.getElementById('ResTdID'); SettingsObj.style.left = TdObj.clientWidth/4; SettingsObj.style.top = TdObj.offsetTop + 10; SettingsObj.style.width = TdObj.clientWidth/2; SettingsObj.style.height = TdObj.clientHeight/1.5; SettingsObj.style.display = "inline"; var lsSettingsTxt = ""; Set_Cookie( 'test', 'none', '', '/', '', '' ); if ( Get_Cookie( 'test' ) )
{ Delete_Cookie('test', '/', ''); LoadSettings();}
else
{ lsSettingsTxt = "<center><b>Cookies Disabled</b><br>Cookies must be enabled to use the Settings feature.</center>"; SettingsTxtObj.innerHTML = lsSettingsTxt
}
}
function DoFocus(FrmNum)
{ if(gb_InFocus && FrmNum == gbFrameFocus)
{ ResetFramesPos(0); return;}
gbFrameFocus = FrmNum; var lsUseTest = "gbUse" + FrmNum; if(eval(lsUseTest) == false)
return; ResetFramesPos(0); var TdObj = document.getElementById('ResTdID'); var lsObj = "B" + FrmNum + "ID"; var Obj = document.getElementById(lsObj); Obj.style.zIndex = 10; Obj.style.left = TdObj.offsetLeft + 5; Obj.style.top = TdObj.offsetTop + 5; Obj.style.width = TdObj.clientWidth - 10; Obj.style.height = TdObj.clientHeight - 10; var NumberObj = document.getElementById('Btn' + FrmNum + 'ID'); NumberObj.style.top = Obj.style.top; NumberObj.style.left = Obj.style.left
NumberObj.style.zIndex = 11; gb_InFocus = true;}
function ResetFramesPos(Exclude)
{ if(gb_Searched == false)
return; B1Obj.style.zIndex = 0; B2Obj.style.zIndex = 0; B3Obj.style.zIndex = 0; B4Obj.style.zIndex = 0; var Left1 = TdObj.offsetLeft + 5; var Top1 = TdObj.offsetTop + 5; var Left2 = TdObj.clientWidth/2 + 10; var Top2 = TdObj.offsetTop + TdObj.clientHeight/2; var Width = TdObj.clientWidth/2 - 10; var Height = TdObj.clientHeight/2 - 10; var Height2 = TdObj.clientHeight - 10; if(gbSearchNum>1)
{ if(Exclude != 1)
{ B1Obj.style.left = Left1; B1Obj.style.top = Top1; B1Obj.style.width = Width; if((!gbUse2 && !gbUse4) || !gbUse3)
B1Obj.style.height = Height2; else
B1Obj.style.height = Height; Btn1Obj.style.top = B1Obj.style.top; Btn1Obj.style.left = B1Obj.style.left
}
if(Exclude != 2)
{ if(!gbUse1 && !gbUse3)
{ B2Obj.style.left = Left1; B2Obj.style.height = Height2;}
else
{ B2Obj.style.left = Left2; if(!gbUse4)
B2Obj.style.height = Height2; else
B2Obj.style.height = Height;}
B2Obj.style.top = Top1; B2Obj.style.width = Width; Btn2Obj.style.top = B2Obj.style.top; Btn2Obj.style.left = B2Obj.style.left
}
if(Exclude != 3)
{ B3Obj.style.left = Left1; B3Obj.style.width = Width; if(!gbUse4 && !gbUse2 )
{ B3Obj.style.left = Left2; B3Obj.style.height = Height2; B3Obj.style.top = Top1;}
else
{ if(!gbUse1)
{ B3Obj.style.top = Top1; B3Obj.style.height = Height2;}
else
{ B3Obj.style.height = Height; B3Obj.style.top = Top2;}
}
Btn3Obj.style.top = B3Obj.style.top; Btn3Obj.style.left = B3Obj.style.left
}
if(Exclude != 4)
{ if(!gbUse2 || (!gbUse1 && !gbUse3))
{ B4Obj.style.top = Top1; B4Obj.style.height = Height2;}
else
{ B4Obj.style.top = Top2; B4Obj.style.height = Height;}
B4Obj.style.left = Left2; B4Obj.style.width = Width; Btn4Obj.style.top = B4Obj.style.top; Btn4Obj.style.left = B4Obj.style.left
}
}else
{ if(gbUse1)
{ B1Obj.style.left = TdObj.offsetLeft + 5; B1Obj.style.top = TdObj.offsetTop + 5; B1Obj.style.width = TdObj.clientWidth - 10; B1Obj.style.height = TdObj.clientHeight - 10; Btn1Obj.style.top = B1Obj.style.top; Btn1Obj.style.left = B1Obj.style.left;}
if(gbUse2)
{ B2Obj.style.left = TdObj.offsetLeft + 5; B2Obj.style.top = TdObj.offsetTop + 5; B2Obj.style.width = TdObj.clientWidth - 10; B2Obj.style.height = TdObj.clientHeight - 10; Btn2Obj.style.top = B2Obj.style.top; Btn2Obj.style.left = B2Obj.style.left;}
if(gbUse3)
{ B3Obj.style.left = TdObj.offsetLeft + 5; B3Obj.style.top = TdObj.offsetTop + 5; B3Obj.style.width = TdObj.clientWidth - 10; B3Obj.style.height = TdObj.clientHeight - 10; Btn3Obj.style.top = B3Obj.style.top; Btn3Obj.style.left = B3Obj.style.left;}
if(gbUse4)
{ B4Obj.style.left = TdObj.offsetLeft + 5; B4Obj.style.top = TdObj.offsetTop + 5; B4Obj.style.width = TdObj.clientWidth - 10; B4Obj.style.height = TdObj.clientHeight - 10; Btn4Obj.style.top = B4Obj.style.top; Btn4Obj.style.left = B4Obj.style.left;}
}
Btn1Obj.style.zIndex = 1; Btn2Obj.style.zIndex = 1; Btn3Obj.style.zIndex = 1; Btn4Obj.style.zIndex = 1; if(gbUse1)
{ Btn1Obj.style.display = "inline"; B1Obj.style.display = "inline";}else
{ Btn1Obj.style.display = "none"; B1Obj.style.display = "none";}
if(gbUse2)
{ Btn2Obj.style.display = "inline"; B2Obj.style.display = "inline";}else
{ Btn2Obj.style.display = "none"; B2Obj.style.display = "none";}
if(gbUse3)
{ Btn3Obj.style.display = "inline"; B3Obj.style.display = "inline";}else
{ Btn3Obj.style.display = "none"; B3Obj.style.display = "none";}
if(gbUse4)
{ Btn4Obj.style.display = "inline"; B4Obj.style.display = "inline";}else
{ Btn4Obj.style.display = "none"; B4Obj.style.display = "none";}
gb_InFocus = false;}
function DoSearch()
{ if(document.getElementById("q").value.length ==0 )
return; if(gbSearchNum == 0)
{ document.getElementById("MessageID").innerHTML = "<b>No Search Engines selected. Go to the Settings panel and choose which Search Engines to use.</b>"; return;}else
document.getElementById("MessageID").innerHTML = ""; gb_Searched = true; if(gbUse1)
B1Obj.src = encodeURI(gsSearch1.replace("<term>",document.getElementById("q").value)); if(gbUse2)
B2Obj.src = encodeURI(gsSearch2.replace("<term>",document.getElementById("q").value)); if(gbUse3)
B3Obj.src = encodeURI(gsSearch3.replace("<term>",document.getElementById("q").value)); if(gbUse4)
B4Obj.src = encodeURI(gsSearch4.replace("<term>",document.getElementById("q").value)); ResetFramesPos(0); document.getElementById('ButtonsID').style.display = "inline";}
function TestEnter(e)
{ var keynum; if(window.event)
keynum = e.keyCode
else if(e.which)
keynum = e.which
if(keynum == 13)
DoSearch();}
function ResetSettings()
{ var Ret; if(confirm('Are you sure?'))
{ Delete_Cookie('URL1','/',''); Delete_Cookie('URL2','/',''); Delete_Cookie('URL3','/',''); Delete_Cookie('URL4','/',''); Delete_Cookie('use1','/',''); Delete_Cookie('use2','/',''); Delete_Cookie('use3','/',''); Delete_Cookie('use4','/',''); Delete_Cookie('EW','/',''); InitGlobalparams(); LoadSettings(); SaveSettings();}
}
function ChangeMySize(Obj,bOverOut,FrmNum)
{ if(!gb_ew)
return; if(gbSearchNum <=1)
return; if(!gb_InFocus)
{ if(bOverOut)
{ ResetFramesPos(FrmNum); var TdObj = document.getElementById('ResTdID'); Obj.style.zIndex = 10; Obj.style.left = TdObj.offsetLeft + TdObj.clientWidth/15; Obj.style.top = TdObj.offsetTop + TdObj.clientHeight/15; Obj.style.width = TdObj.clientWidth/1.2; Obj.style.height = TdObj.clientHeight/1.2; var NumberObj = document.getElementById('Btn' + FrmNum + 'ID'); NumberObj.style.top = Obj.style.top; NumberObj.style.left = Obj.style.left
NumberObj.style.zIndex = 11;}
}
}
function ShowSearchOpt(e,num)
{ var x = e.clientX; var y = e.clientY; gbSENUm = num; var SOPT = document.getElementById('SEOptID'); SOPT.style.left = x + 20; SOPT.style.top = y - 40; SOPT.style.display = "inline";}
function SetSE(val)
{ if(gbSENUm>0)
{ var TxtStr = "url" + gbSENUm; var TxtObj = document.getElementById(TxtStr); TxtObj.value = val;}
}
