function SendData(mydate)
{
var strData = "";
strData=mydate;
return strData;
}
//----------------打开窗口方法-----------------------------------------
function openMyWindow(obj){
var accept_id="CustomerFram";
var CustomerFram = document.getElementById(accept_id);
CustomerFram.style.display ="";
CustomerFram.innerHTML="";
//CustomerFram.innerHTML='';
//DoSubmit_spsx(accept_id,mydata);
if(''=="1")
{
CustomerFram.style.left = ((document.body.scrollWidth-275)/2) + "px";
//CustomerFram.style.top = ((document.body.scrollHeight-150)/2) + "px";
CustomerFram.style.top =200 + document.body.scrollTop + "px";
}
else
{
var hidivmt = obj.offsetTop;
if(hidivmt==0)
{
hidivmt=obj.scrollTop;
}
var hidivml = obj.offsetLeft;
if(hidivml==0)
{
hidivml=obj.scrollLeft;
}
var objWidth = obj.offsetWidth;
var objHeight = obj.offsetHeight;
var aBox = obj;
try
{
do{
aBox = aBox.offsetParent;
hidivml += aBox.offsetLeft;
hidivmt += aBox.offsetTop;
}
while( aBox.tagName != "BODY" );
var cusHeight = CustomerFram.offsetHeight;
var cusWidth = CustomerFram.offsetWidth;
var bodyHeight = document.body.clientHeight;
var bodyWidth = document.body.clientWidth;
CustomerFram.style.left = (hidivml-1) + "px";
CustomerFram.style.top = (hidivmt+objHeight) + "px";
if(hidivml+cusWidth>=bodyWidth){
CustomerFram.style.left = hidivml+objWidth-cusWidth+1;
}
if(hidivmt+cusHeight>=bodyHeight-objHeight){
CustomerFram.style.top = hidivmt-cusHeight;
}
}
catch (e) {
CustomerFram.style.left = ((document.body.scrollWidth-275)/2) + "px";
//CustomerFram.style.top = ((document.body.scrollHeight-150)/2) + "px";
CustomerFram.style.top =200 + document.body.scrollTop + "px";
}
}
}
//=========================================================================================================
function buy_add(txtId){
var obj=document.getElementById(txtId);
if (obj){
if (obj.value=='')
{
obj.value=0;
}
obj.value=parseFloat(obj.value) +1;
}
}
function buy_delete(txtId){
var obj=document.getElementById(txtId);
if (obj)
{
if (obj.value=='')
{
obj.value=0;
}
obj.value=parseFloat(obj.value) -1;
if (parseFloat(obj.value)<0)
{
obj.value=0;
}
}
}
function keyup_check(txtId){
txtId.value= txtId.value.replace(/\D/gi,"");
if (txtId.value=='')
{
txtId.value=1;
}
if (parseFloat(txtId.value)<1)
{
obj.value=1;
}
}
function close_window(){
var CustomerFram = document.getElementById("CustomerFram");
/*
CustomerFram.innerHTML="";
*/
CustomerFram.style.display ="none";
}
/*----------------------------------------------------------加入购物车时用到的分类js---------------------------------------*/
function getspsx_list(text,XML,acceptspan)
{
if (text=='startRedirect')
{
var loadimg=document.getElementById('loadimg');
if (loadimg)
{
loadimg.style.display ="none";
}
//window.open('gwsp.aspx?shbid=17376');
openMyWindow_3_2('/shop_share/pay/cart.aspx?shbid=17376');
}
else
{
if (text=='startRedirectJk')
{
var loadimg=document.getElementById('loadimg');
if (loadimg)
{
loadimg.style.display ="none";
}
openMyWindow_3_2('ProductsJp.aspx?sku=&shbid=17376');
}
else
{
if (text=='startRedirectgwc'){
var loadimg=document.getElementById('loadimg');
if (loadimg)
{
loadimg.style.display ="none";
}
openMyWindow_3_2('ProductsNew_n.aspx?sku=&shbid=17376');
}
else{
var objA=document.getElementById("Ad3ShowMsg");
if (objA)
{
//objA.innerHTML=text;
alert("已成功加入购物车");
}
else
{
if (acceptspan)
{
acceptspan.innerHTML=text;
}
}
}
}
}
}
function DoSubmit_spsx(acceptspan,mydata)
{
var objGetMsg = new CallBackObject(getspsx_list,SendData,"","",acceptspan);
objGetMsg.DoCallBack("POST","/shop_share/products/function/add_cart_first.aspx",mydata);
}
function DoSubmit_spsx2(acceptspan,mydata)
{
var objGetMsg = new CallBackObject(getspsx_list,SendData,"","",acceptspan);
objGetMsg.DoCallBack("POST","/shop_share/products/function/add_cart_four.aspx",mydata);
}
//===============放入购物车==========================================================================================
function AddCart(obj,mydata){
openMyWindow(obj);
DoSubmit_spsx('CustomerFram',mydata);
}
//=========================================================================================================
function buy_check(count,data,A10){
//count是记录总条数,data是传递要数据给后台,A10判断是否对库存进行检察,避免订购数量超过库存数量
//var spsx_id_1=window.document.getElementById ("spsx_id_1");
//if (spsx_id_1)
//{
//var strtemp=spsx_id_1.innerHTML;
//if(strtemp=="不可选择!")
//{
//alert("对不起,商品缺货,不可购买!");
//return false;
//}
//}
var loadimg=document.getElementById('loadimg');
if (loadimg)
{
loadimg.style.display ="block";
}
//h_show_1记录是否有提示信息
var h_show_1=document.getElementById('h_show_1');
if (h_show_1)
{
h_show_1.value='';
}
var h_sx1;
var h_sx2;
var h_kc;
var txt_buy_sl;
var i;
var sl_all=0;
for (i=0;i