function psearch() { var a = $.trim($("#txtsearch").val()); if (a == "") { alert("please enter product name!"); return false; } if (a.length <= 1) { return false; } location.href = "http://" + document.domain + "/search/" + a + ".html"; } $(function () { $("#txtsearch").keydown(function (a) { var b = a.which; if (b == 13) { psearch(); } }); $("#a_1,#a_2,#a_3,#a_4,#a_5,#a_6,#a_7").click(function () { $.ajax({ type: "post", url: "/outopen/addemailrecord", data: { fromemail: $(this).text(), pathpage: document.url }, datatype: "jsonp", jsonp: "callback", crossdomain: true, jsonpcallback: "result", error: function () { }, success: function (a) { }, async: false }) }) }); function nsearch() { var a = $.trim($("#txtsearch").val()); if (a == "") { return false; } if (a.length <= 1) { return false; } location.href = "http://" + document.domain + "/view_aspx/nsearch.aspx?q=" + escape(a); } function submitemail() { var b = $("#footemail").val(); if (b == "") { alert("please enter a email "); $("#footemail").focus(); return false; } var a = /^([a-za-z0-9_\.\-])+\@(([a-za-z0-9\-])+\.)+([a-za-z0-9]{2,4})+$/; if (!a.test(b) && $.trim(b) !== "") { alert("please enter a valid email format"); $("#footemail").focus(); return false; } $.ajax({ type: "post", url: "/outopen/submitemail", data: { email: $("#footemail").val(), name: $("#footem_name").val(), pageurl: document.url }, datatype: "jsonp", crossdomain: true, jsonp: "callback", jsonpcallback: "result", error: function (c, e, d) { alert("submit failed, please try again later!"); $("#footemail").val(""); return false; }, success: function (c) { alert("submit successfully, we will contact you soon!"); $("#footemail").val(""); }, async: false }) } function fixjqtext(b) { var a = b.replace(/\+/g, "+"); return a; } function submitinquiry() { var b = $.trim($("#submitemail_i").val()); var f = /^([a-za-z0-9_\.\-])+\@(([a-za-z0-9\-])+\.)+([a-za-z0-9]{2,4})+$/; if (b == "" || b == "e-mail address") { alert("please enter the email!"); $("#submitemail_i").val("").focus(); return false; } if (!f.test(b)) { alert("please enter a valid email format"); $("#submitemail_i").focus(); return false; } var d = $.trim($("#submitcontent_i").val()); if ($("#submitcontent_i").length > 0) { if (d == "content" || d == "") { alert("please enter the content!"); $("#submitcontent_i").val("").focus(); return false; } if (d.length > 2000) { alert("contents of the number of characters can not be more than 2000!"); $("#submitcontent_i").focus(); return false; } d = escape(fixjqtext(d)); } var e = $.trim($("#submitname_i").val()); var a = $.trim($("#submitcompanyname_i").val()); var g = $.trim($("#submittitle_i").val()); var c = $.trim($("#submitphone_i").val()); if (e != "") { e = escape(fixjqtext(e)); } if (a != "") { a = escape(fixjqtext(a)); } if (g != "") { if (g.length > 340) { alert("the title you have entered is too long!"); $("#submittitle_i").focus(); return false; } else { g = escape(fixjqtext(g)); } } if (c != "") { c = escape(fixjqtext(c)); } $.ajax({ type: "post", url: "/outopen/saveinquirysimp", data: { name: e, company: a, proid: number($.trim($("#productid").val())), phone: c, email: b, title: g, content: d, pageurl: document.url }, datatype: "jsonp", crossdomain: true, jsonp: "callback", jsonpcallback: "result", error: function (h, j, i) { alert("submit failed, please try again later!"); }, success: function (h) { $("#imgsend_i").removeattr("disabled"); alert("submit successfully, we will contact you soon!"); $("#submitcontent_i").val(""); }, async: false }); return false } function submitfloatinquiry() { var a = $.trim($("#submitemail_float").val()); var c = /^([a-za-z0-9_\.\-])+\@(([a-za-z0-9\-])+\.)+([a-za-z0-9]{2,4})+$/; if (a == "" || a == "e-mail") { alert("please enter the email!"); $("#submitemail_float").val("").focus(); return false } if (!c.test(a)) { alert("please enter a valid email format"); $("#submitemail_float").focus(); return false } var b = $.trim($("#submitcontent_float").val()); if ($("#submitcontent_float").length > 0) { if (b == "content" || b == "") { alert("please enter the content!"); $("#submitcontent_float").val("").focus(); return false; } if (b.length > 2000) { alert("contents of the number of characters can not be more than 2000!"); $("#submitcontent_float").focus(); return false; } b = escape(fixjqtext(b)) } $.ajax({ type: "post", url: "/outopen/saveinquirysimp", data: { name: "", company: "", proid: 0, phone: "", email: a, title: "", content: b, pageurl: document.url }, datatype: "jsonp", crossdomain: true, jsonp: "callback", jsonpcallback: "result", error: function (d, f, e) { alert("submit failed, please try again later!"); }, success: function (d) { if (d == "1") { $("#imgsend_float").removeattr("disabled"); alert("submit successfully, we will contact you soon!"); $("#submitcontent_float").val(""); } else { alert("send failed, please re submit!"); } }, async: false }); return false } function showhid(a, c) { var b = $("#" + a + "").css("display"); if (b == "none") { $("#" + a + "").show(); $("#" + c + "").removeclass("bodyright100").addclass("bodyright"); } else { $("#" + a + "").hide(); $("#" + c + "").removeclass("bodyright").addclass("bodyright100"); } } function ismobile() { var a = navigator.useragent; var b = ["android", "iphone", "symbianos", "windows phone", "ipad", "ipod"]; var d = false; for (var c = 0; c < b.length; c++) { if (a.indexof(b[c]) > 0) { d = true; break; } } return d } function displaysubmenu(a) { var b = a.getelementsbytagname("ul")[0]; b.style.display = "block"; } function hidesubmenu(a) { var b = a.getelementsbytagname("ul")[0]; b.style.display = "none"; } $(function () { var a = document.getelementbyid("pg2"); if (a != null) { a.style.display = "none"; } }); function showdiv(a, b) { var d = document.getelementbyid(a); var c = document.getelementbyid(b); if (d.style.display == "inline") { d.style.display = "none"; c.innerhtml = ' '; } else { d.style.display = "inline"; c.innerhtml = ' '; } } var vismobile = ismobile(); if (vismobile) { var homeurl = document.url; if (homeurl.indexof("http://www.") > -1) { location.href = document.url.replace("http://www.", "http://m."); } else if (homeurl.indexof("https://www.") > -1) { location.href = document.url.replace("https://www.", "http://m."); } else { if (homeurl.indexof("http://m.") == -1) { location.href = document.url.replace("http://", "http://m."); } } } var showimage = function () { xoffset = 10; yoffset = 30; $("div.singglepic").find("img").hover(function (a) { $("").appendto("body"); $("#imgshow").css({ "top": (a.pagey + 36) + "px", "left": 0 + "px", "right": 0 + "px", "margin": "0 auto" }).fadein("slow") }, function () { $("#imgshow").remove(); }) }; jquery(document).ready(function () { showimage(); }); function addfavorite() { var a = document.location.href; var c = document.title; try { window.external.addfavorite(a, c); } catch (b) { try { window.sidebar.addpanel(c, a, ""); } catch (b) { alert("sorry, but you are using a browser to complete this operation.\nfavorite fails, use ctrl + d add"); } } };