var count = 3;
var isclick = false;
var currentmenuName = "Properties";
$(function () {
$("#btnSearchFloat").click(function () {
location.href = "/ProductList.aspx?kwd=" + $("#keyWordFloat").val();
});
var anchor = $("a[data-field='anchor']");
var coordinate = $("a[data-field='coordinate']");
//var shtml = "
";
// var IsVip = false;
// if (suppliers[i].HWOrderValue >= 206) {
// IsVip = true;
// }
// if (type = "A") {
// if (IsVip) {
// if (suppliers[i].HWOrderValue >= 280 && suppliers[i].HWOrderValue <= 300) {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// else if (suppliers[i].HWOrderValue >= 310) {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// else {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// }
// else {
// if (suppliers[i].HWOrderValue >= 280 && suppliers[i].HWOrderValue <= 300) {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// else if (suppliers[i].HWOrderValue >= 310) {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// else {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// }
// }
// else {
// shtml += "" + suppliers[i].SupplierEName + "";
// if (suppliers[i].PhysicalId > 0 && suppliers[i].AuthenticatingId > 0) {
// shtml += "";
// }
// shtml += " | ";
// }
// shtml += " " + suppliers[i].Tel + "
| ";
// shtml += "" + suppliers[i].Fax + " | ";
// shtml += "" + suppliers[i].Email + " | ";
// shtml += " " + suppliers[i].SNationality + " | ";
// shtml += "" + suppliers[i].ProdCount + " | ";
// shtml += " " + suppliers[i].ECEI + " |
";
// }
// $("#GridView2").empty();
// $("#GridView2").html(shtml);
// $("div[data-field='goldpro']").unbind("click");
// $("div[data-field='goldpro']").click(function () {
// location.href = "/ProductAdvertising.aspx";
// });
// }
// }, "json");
//});
$("#prev_main").click(function () {
if (count <= 3) {
return;
}
$("li[data-id='" + count + "']").hide();
$("li[data-id='" + (count - 3) + "']").show();
count--;
})
$("#next_main").click(function () {
if (count >= $("#imagetext_productcount").val()) {
return;
}
count++;
$("li[data-id='" + count + "']").show();
$("li[data-id='" + (count - 3) + "']").hide();
})
$("#bt_delegate_list").click(function () {
var cas = $(this).attr("data-cas");
var productname = $(this).attr("data-productname");
var cbnumber = $(this).attr("data-cbnumber");
source = "ChemicalProductProperty_EN_new.aspx";
location.href = "InquiryToSupplier.aspx?cas=" + cas + "&n=" + productname + "&cbnumber=" + cbnumber + "&source=" + source;
});
$("#bt_delegate_list_float").click(function () {
var cas = $(this).attr("data-cas");
var productname = $(this).attr("data-productname");
var cbnumber = $(this).attr("data-cbnumber");
source = "ChemicalProductProperty_EN_new.aspx";
location.href = "InquiryToSupplier.aspx?cas=" + cas + "&n=" + productname + "&cbnumber=" + cbnumber + "&source=" + source;
});
$("input[data-field='inquiry']").click(function () {
delCookie("merge");
setCookie("merge", $(this).attr("data-cbsid"), "d1");
var cas = $("#bt_delegate_list").attr("data-cas");
var productname = $("#bt_delegate_list").attr("data-productname");
var cbnumber = $("#bt_delegate_list").attr("data-cbnumber");
source = "ChemicalProductProperty_EN_new.aspx";
location.href = "InquiryToSupplier.aspx?cas=" + cas + "&n=" + productname + "&cbnumber=" + cbnumber + "&source=" + source;
});
$("#spectrumdiv a").attr('target', '_blank');
})
function delCookie(name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null)
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
function setCookie(name, value, time) {
var strsec = getsec(time);
var exp = new Date();
exp.setTime(exp.getTime() + strsec * 1);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
function getCookie(name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
function getsec(str) {
var str1 = str.substring(1, str.length) * 1;
var str2 = str.substring(0, 1);
if (str2 == "s") {
return str1 * 1000;
}
else if (str2 == "h") {
return str1 * 60 * 60 * 1000;
}
else if (str2 == "d") {
return str1 * 24 * 60 * 60 * 1000;
}
}