// JavaScript Document
function ShowStyle(name)
{
	$("#ulC li").removeClass("current");
	
	
	$("#"+name).addClass("current");
    if(name=="liA")
	{		
	    $("#ulCList").hide();
		$("#ulBList").hide();
		$("#ulAList").show();
		
	}
	else if(name=="liB")
	{		
		$("#ulAList").hide();
		$("#ulCList").hide();
		$("#ulBList").show();		
	}
	else if(name=="liC")
	{		
		$("#ulAList").hide();
		$("#ulBList").hide();
		$("#ulCList").show();
	}
	
}

//没有商品时不允许购买
function check(obj){
    var parent=obj.parentNode;
   var oh=parent.getElementsByTagName("h1");
   if(oh){
        var price=oh[0].innerText;
        if(price=="0.00$"){
            return false;
        }
        else
        {
            return true;
        }
   } 
   return false;
}

//T7人数选择
function doSetShow(obj){
    var options=obj.getElementsByTagName("option");
    if(options){
        for(var i=0;i<options.length;i++){
            if(options[i].selected){
                    if(i==0){
                    document.getElementById("div1").style.display="block";
                    document.getElementById("div2").style.display="none";
                    }else{
                        document.getElementById("div1").style.display="none";
                        document.getElementById("div2").style.display="block";
                    }
            }
        }
    } 
}


function chk_change(c)
{
    var count = parseFloat(document.getElementById("lbcount10").innerHTML);
    var chk = document.getElementById(c);
    alert(chk+count);
}

//散件装备选择时
 function cb_OnChange() 
                        {
                           var i=0;
                           var price=0.00;
                           var selectAll = true;
                           
                           while(document.getElementById("chk"+(i++))!=null)
                           {
                                if(document.getElementById("chk"+(i-1)).checked)
                                {
                                    var txt = document.getElementById("Prices"+(i-1)).innerHTML;                                   
                                    txt=txt.replace("Prices:","").replace("$","");
                                    price=price + parseFloat(txt,2);
                                    document.getElementById("chk"+(i-1)).value="true";
                                }
                                else
                                {
                                    selectAll=false;
                                }
                           }  
                           var ospan=document.getElementById("lbsetprice10");
                           var TotalPrice=ospan.getElementsByTagName("span")[0].innerText
                           var lblToalPrices=document.getElementById("ToalPrices");
                           var lblToalPrices1=document.getElementById("ToalPrices1");
                           if(lblToalPrices){
                                 if(parseFloat(price)>=parseFloat(TotalPrice)){
                                    lblToalPrices.innerHTML= TotalPrice+"$";
                                    return;
                               }
                               else{
                                    lblToalPrices.innerHTML=ForDight(price,2)+"$";     
                                    return;
                               }
                           }
                           else{
                                 if(parseFloat(price)>=parseFloat(TotalPrice)){
                                    lblToalPrices1.innerHTML= TotalPrice+"$";
                                    return;
                               }
                               else{
                                    lblToalPrices1.innerHTML=ForDight(price,2)+"$";     
                                    return;
                               }
                           }           
                        }