<% @ Page language="c#" Inherits="PageAdmin.searchbox" %>
<asp
laceHolder id="P1" runat="server" visible="false">
document.write("<ul>");
document.write("<li class='searchbox_item'><input id='searchkey_<%=Id%>' type='text' class='searchbox_textbox'>");
document.write("<a href='javascript:searchbox_1_<%=Id%>()'><img alt='' align='absMiddle' border='0' src='/images/public/search.gif'></a></li>");
document.write("</ul>");
</asp
laceHolder>
<asp
laceHolder id="P2" runat="server" visible="false">
document.write("<ul>");
document.write("<li class='searchbox_item'><input id='searchkey_<%=Id%>' type='text' class='searchbox_textbox'>");
document.write("<a href='javascript:searchbox_2_<%=Id%>()'><img alt='' align='absMiddle' border='0' src='/images/public/search.gif'></a></li>");
document.write("</ul>");
</asp
laceHolder>
<asp
laceHolder id="P3" runat="server" visible="false">
document.write("<ul>");
document.write("<li class='searchbox_item'><input id='sboxradio1_<%=Id%>' name='sboxradio_<%=Id%>' type='radio' checked><%=Tags_1%> <input name='sboxradio_<%=Id%>' id='sboxradio2_<%=Id%>' type='radio' /><%=Tags_2%> </li>");
document.write("<li class='searchbox_item'><input type='text' id='searchkey_<%=Id%>' class='searchbox_textbox' >");
document.write("<a href='javascript:searchbox_3_<%=Id%>()'><img alt='' align='absMiddle' border='0' src='<%=Tags_3%>'></a></li>");
document.write("</ul>");
</asp
laceHolder>
function searchbox_1_<%=Id%>()
{
var Language="<%=P_Language%>";
var Js1,Js2;
if(Language=="en")
{
Js1="Please enter your search product name or type keywords!";
Js2="Keyword must be greater than 2 characters!";
}
else
{
Js1="请输入要搜索的产品名称或型号关键字!";
Js2="关键字必须大于2个字符!";
}
var Keycode=escape(Trim(document.getElementById("searchkey_<%=Id%>").value));
var Target="<%=Target%>";
if(Keycode=="")
{
alert(Js1);
document.getElementById("searchkey_<%=Id%>").focus();
return;
}
else
{
if(Keycode.length<2)
{
alert(Js2);
document.getElementById("searchkey_<%=Id%>").focus();
return;
}
else
{
if(Target==1)
{
window.open("/include/search.aspx?keycode="+Keycode+"&type=1&language="+Language, "_target");
}
else
{
location.href="/include/search.aspx?keycode="+Keycode+"&type=1&language="+Language;
}
}
}
}
function searchbox_2_<%=Id%>()
{
var Language="<%=P_Language%>";
var Js1,Js2;
if(Language=="en")
{
Js1="Please enter your search to the title of the article or profile keyword!";
Js2="Keyword must be greater than 2 characters!";
}
else
{
Js1="请输入要搜索的文章标题或简介关键字!";
Js2="关键字必须大于2个字符!";
}
var Keycode=escape(Trim(document.getElementById("searchkey_<%=Id%>").value));
var Target="<%=Target%>";
if(Keycode=="")
{
alert(Js1);
document.getElementById("searchkey_<%=Id%>").focus();
return;
}
else
{
if(Keycode.length<2)
{
alert(Js2);
document.getElementById("searchkey_<%=Id%>").focus();
return;
}
else
{
if(Target==1)
{
window.open("/include/search.aspx?keycode="+Keycode+"&type=2&language="+Language, "_target");
}
else
{
location.href="/include/search.aspx?keycode="+Keycode+"&type=2&language="+Language;
}
}
}
}
function searchbox_3_<%=Id%>()
{
var Obj=document.getElementById("sboxradio1_<%=Id%>");
if(Obj.checked)
{
searchbox_1_<%=Id%>();
}
else
{
searchbox_2_<%=Id%>();
}
}
function Trim(str)
{
var Astr=str.split('');
var str1="";
for(i=0;i<Astr.length;i++)
{
str1+=Astr
.replace(" ","");
}
return str1;
}