
function check_mes(){
if(document.mes.FID_2430.value==""){
    alert("Content can not be empty!");
    document.mes.FID_2430.focus();
    return false;
  }
   if(document.mes.FID_2427.value==""){
    alert("Nickname can not be empty!");
    document.mes.FID_2427.focus();
    return false;
  }
  if(document.mes.FID_2428.value==""){
    alert("Telephone Number can not be empty!");
    document.mes.FID_2428.focus();
    return false;
  }
  if(document.mes.FID_2429.value==""){
    alert("Email can not be empty!");
    document.mes.FID_2429.focus();
    return false;
  }
 
 
  return true;
}

function shop_add_cart(sj,CID,IID)//ajax添加到购物车
{
	//alert("ss");

	//var num;
	//num=document.getElementById('num').value;
	var num = document.getElementById('num') ? document.getElementById('num').value : 1;
	if (!Utils.isNumber(num) || num==0)
	{
		alert("Please enter the number of purchase");
	}
	//check="<?=$hckeck?>";	
	else
	{
	//Ajax.call('user.php?act=cart', 'IID=' + IID+'&CID='+CID+"&sj="+sj, cart_callback , 'GET', 'TEXT', true, true );
	//alert( 'IID=' + IID+'&CID='+CID+"&sjid="+sj);
	//alert(document.getElementById('num').value);
		if (sj==99)
		{
			Ajax.call('shop.php?act=shop_cart', 'IID=' + IID+'&CID='+CID+"&sjid="+sj+"&num="+num, shop_add_cartResponse, 'POST', 'JSON');
		}
		else
		{
			//alert("ss");
			Ajax.call('shop.php?act=shop_cart_text','IID=' + IID+'&CID='+CID+"&sjid="+sj+"&num="+num, shop_add_cart_text_back , 'GET', 'TEXT', true, true );
			//Ajax.call('shop.php?act=shop_cart', 'IID=' + IID+'&CID='+CID+"&sjid="+sj+"&num="+num, shop_add_wishResponse, 'POST', 'JSON');
		}
		
	}
}

function shop_cart_del(sj,CID,IID)//ajax添加到购物车删除某件商品
{
	//alert("ss");
	Ajax.call('shop.php?act=shop_cart_del', 'IID=' + IID+'&CID='+CID+"&sjid="+sj, shop_add_cartResponse , 'GET', 'TEXT', true, true );
	//Ajax.call('shop.php?act=shop_cart_del', 'IID=' + IID+'&CID='+CID+"&sjid="+sj, shop_add_cartResponse, 'POST', 'JSON');
}

function shop_cart_clear(sj,CID)//ajax添加到购物车清除
{
	//alert("ss");
	//Ajax.call('user.php?act=cart', 'IID=' + IID+'&CID='+CID+"&sj="+sj, cart_callback , 'GET', 'TEXT', true, true );
	Ajax.call('shop.php?act=shop_cart_clear','CID='+CID+"&sjid="+sj, shop_add_cartResponse, 'POST', 'JSON');
}
function shop_change_num(sj,CID,IID,num)//ajax添加到购物车某件商品修改数量
{
	//alert('IID=' + IID+'&num='+num);
	//2008-3-11alert(Math.int(num));
	var asj=sj;
	if (num>0)
	{
		Ajax.call('shop.php?act=shop_change_num','IID=' + IID+'&num='+num+'&sjid='+asj+"&CID="+CID, shop_add_cartResponse , 'GET', 'TEXT', true, true );
		//Ajax.call('shop.php?act=shop_change_num', 'IID=' + IID+'&num='+num+"&sjid="+asj+"&CID="+CID, shop_add_cartResponse, 'POST', 'JSON');
	}
	else
	{
		alert("数量参数错误，请重新输入");
		location.reload();
		return false;
	}

}
function shop_cart_submit(sj,CID,IID)//ajax检测是否可以提交
{
	
	//	Ajax.call('user.php?act=cart_submit','CID=' + CID+'&sj='+sj+'&IID='+IID, alert_callback, 'POST', 'JSON');
		Ajax.call('shop.php?act=shop_cart_submit','CID=' + CID+'&sjid='+sj+'&IID='+IID, shop_url_callback , 'GET', 'TEXT', true, true );
		
}

/* *
 * 处理添加商品到购物车的反馈信息
 */
function product_sort_submit(sortname,number)//ajax检测是否可以提交
{
	
	//	Ajax.call('user.php?act=cart_submit','CID=' + CID+'&sj='+sj+'&IID='+IID, alert_callback, 'POST', 'JSON');
	if (sortname!='' && number!='')
	{
		Ajax.call('../shop.php?act=product_sort_submit','sortname=' + escape(sortname)+'&number='+number, shop_add_cartResponse , 'GET', 'TEXT', true, true );
	}
	else
	{
		alert("请选择分类及要归类的产品");
	}
		
}
function product_stau_submit(product_stau,number)//ajax检测是否可以提交
{
	
	//	Ajax.call('user.php?act=cart_submit','CID=' + CID+'&sj='+sj+'&IID='+IID, alert_callback, 'POST', 'JSON');
	if (product_stau=="disable")
	{
		alert("请选择其他状态");
		return false;
	}
	
	if (product_stau!='' && number!='' )
	{
		Ajax.call('../shop.php?act=product_stau_submit','product_stau=' + escape(product_stau)+'&number='+number, shop_add_cartResponse , 'GET', 'TEXT', true, true );
	}
	else
	{
		alert("请选择状态及要操作的产品");
	}
		
}

function shop_add_cartResponse(result)//添加购物车
{
	
	/**/
  if (result!="")
	{
		alert(result);
	}else
	{
		var url="member.php?info=cart";	
		window.location.reload();
	}
}
function shop_add_cart_text_back(result)//弹出提示信息
{
	if (result!="")
	{
		alert(result);
	}else
	{
		var url="member.php?info=cart";
		if (checkclick("The product has been added to your cart!"))
		{
			//blank.location.href=url;
			window.open(url, 'cart', 'height=600, width=800, top=0, left=0, toolbar=yes, menubar=yes, scrollbars=yes,resizable=yes,location=yes, status=yes');
			
		}
	}
}

function shop_add_wishResponse(result)//有意向的列表
{
	
	/**/
	

  if (result.error > 0)
  {
   
      alert(result.message);
   
  }
  else
  {
	 
	//var url=result.url;
	var url="/nitc/FendiBelts-23.html";

	//alert("jjj");
	if (url!='')
	{
		//self.location=url;
		if (checkclick("The product has been added to your cart!"))
		{
			self.location.href=url;
		}		
	}
    var cartInfo = document.getElementById('cart_list');
    if (cartInfo)
    {
      cartInfo.innerHTML = result.content;
    }
	
  }
}

function shop_alert_callback(result)//弹出提示信息
{
	//result="s";
	if (result!="")
	{
		alert(result)
	}
}
function shop_url_callback(result)//弹出提示信息
{
	if (result!="")
	{
		location.href=result;
	}
}
function shop_IsDigit(vv) { 
	return ((event.keyCode >= 48) &&(event.keyCode <= 57));
}
