function getSelectIDs(){
	var ids = new Array(3);
	jQuery(":checkbox[name=checksel]:checked").each(function(){
		ids.push(jQuery(this).val());
	});
	alert(ids.lenght);
	return ids;
}
function compareST(){
	var ids=new Array();
	var ids=getSelectIDs();
	alert(ids);
}

function search(form){
	var obj=document.getElementById(form);//"searchForm"
	//var text="全部";
	//obj.text.value=text;
	var context=obj.textfield.value;
	var str=obj.textfield;
	if(str.value=='输入商品关键字'){
		str.value='';
	}
	if(context=='\''){
		return;
	}else{
		if(context.indexOf('\'')==0){
			return;
		}
		obj.textfield.value=context;
	}
	
	//window.location.href="/search/"+context+".html";
	//window.open(jsCtx+"/search/"+encodeURI(encodeURI(context))+".html");
	
	//测试 GET 提交
	//catalog/catalogMessage.do?method=productSearch&amp;textfield=$1
	obj.submit();
}
function returnSearch(form){
	var obj=document.getElementById(form);//"searchForm"
	//var text="全部";
	//obj.text.value=text;
	var context=obj.textfield.value;
	var str=obj.textfield;
	if(str.value=='输入商品关键字'){
		str.value='';
	}
	if(context=='\''){
		return false;
	}else{
		if(context.indexOf('\'')==0){
			return false;
		}
		obj.textfield.value=context;
	}
	
	//window.location.href="/search/"+context+".html";
	
	//window.open(jsCtx+"/search/"+encodeURI(encodeURI(context))+".html");
	///catalog/catalogMessage.do?method=productSearch&amp;textfield=$1
	//obj.submit();
	return true;
}
function returnSearch2(form){
	var obj=document.getElementById(form);//"searchForm"
	//var text="全部";
	//obj.text.value=text;
	var context=obj.textfield.value;
	var str=obj.textfield;
	if(str.value=='输入商品关键字'){
		str.value='';
	}
	if(context=='\''){
		return false;
	}else{
		if(context.indexOf('\'')==0){
			return false;
		}
	}
	
	return true;
}
function removelook(){
	productService.removeMap({callback:function(returnValue){
		if(returnValue){
			document.getElementById('newlook').style.display='none';
		}
	}});
}
//是否评价
function isValue(productId,uid){
	if(uid==""){
		alert("请先登录");
		return;
	}
	productService.isValue(productId,uid,{callback:function(returnValue){
		if(returnValue>0){
			window.location.href=jsCtx+"/productEvalue.do?m=valueList&productId="+productId+"&orderId="+returnValue+"&success=0&isAll=0";
		}else if(returnValue==-2){
			alert("您购买的商品评价已经过期！");
		}else{
			alert("您已经评价过此商品或尚未购买此商品！");
		}
	}})
}