
function jGet( elementId ){return document.getElementById( elementId );};

function pPro_sel(key,v,n){
	var old = jGet("pPro_"+key+"ID").value;
	if(old.length>0)
	{
		if(jGet(key+"_"+old)){jGet(key+"_"+old).className = '';};
	};
	
	var oThe = jGet(key+'_'+v);
	if(oThe){oThe.className = 'cur';};
	
	jGet("pPro_"+key).innerHTML= '"' + n + '", ';
	jGet("pPro_"+key+"ID").value= v;
};

/*
function pPro_sel(sid,key,m,v,n){
	for(var i=1;i<=m;i++){
		var oThe = jGet(key+'_'+i);
		if(oThe){
			if(i==sid){oThe.className = 'cur';}else{oThe.className = '';};
		};
	};
	jGet("pPro_"+key).innerHTML= '"' + n + '", ';
	jGet("pPro_"+key+"ID").value= v;
};
*/

function pPro_move(oThe,f)
{
	if(oThe.className != 'cur'){
		if(f){oThe.className = 'hover';}else{oThe.className = '';};
	};
};

var pPic_sel_id = 0;

function pPic_sel(v,m,b)
{
	if(pPic_sel_id>0)
	{
		if(jGet("pPic_id_"+pPic_sel_id)){jGet("pPic_id_"+pPic_sel_id).className = '';};
	};
	
	var oThe = jGet("pPic_id_"+v);
	if(oThe){
		oThe.className = 'cur';
		pPic_sel_id=v;
		if(m.length>0)
		{
			if(jGet("prd_picShow")){
				jGet("prd_picShow").innerHTML = '<a href="javascript:pPic_click('+v+');" title="点击查看大图"><img src="'+m+'" /></a>';
				
			};
			/*
			if(jGet("prd_picShowA") && jGet("prd_picShowP")){
				jGet("prd_picShowA").href=b;
				jGet("prd_picShowP").src=m;
			};
			*/
		};
	};
};

function pPic_move(oThe,f)
{
	if(oThe.className != 'cur'){
		if(f){oThe.className = 'hover';}else{oThe.className = '';};
	};
};

function pPic_click(v)
{
	if(jGet("pPic_id_"+v))
	{
		jGet("pPic_id_"+v).onclick();
	};

};

function so_move(f)
{
	var oThe = jGet("so_c");
	if(!oThe){return;};
	var st = oThe.scrollTop;
	var sh = oThe.scrollHeight;
	//alert("scrollTop="+oThe.scrollTop + "\n" + "scrollHeight="+oThe.scrollHeight);
	if(f==0){//left
		if((st-60)>=0){st-=60;oThe.scrollTop=st;};
	}else{//right
		if((st+60)<=sh){st+=60;oThe.scrollTop=st;};
	};	
};


function CheckFrmCartAdd()
{
    var oThe=document.frmCartAdd;
    if (oThe.PrdID.value=="" || oThe.PrdID.value=="0"){
        alert('参数出错！请刷新本页！');
        return false;
    };
	
	var TypeID = oThe.TypeID.value;
	if(TypeID != "2" ){
		if (oThe.CupID.value=="" || oThe.CupID.value=="0"){
			alert('请选择杯码！');
			return false;
		};
	};
	
    if (oThe.ColorID.value=="" || oThe.ColorID.value=="0"){
        alert('请选择颜色！');
        return false;
    };
	
    if (oThe.SizeID.value=="" || oThe.SizeID.value=="0"){
        alert('请选择尺寸！');
        return false;
    };
};


