var nsItemsWCF=new Array();
	//intro
		nsItemsWCF[0]=new Array();
			//surface
			nsItemsWCF[0][0]=new Array();
				nsItemsWCF[0][0][0]=0;
				nsItemsWCF[0][0][1]=5;
				nsItemsWCF[0][0][2]=6;
				nsItemsWCF[0][0][3]=7;
				nsItemsWCF[0][0][4]=8;
				nsItemsWCF[0][0][5]=9;
				nsItemsWCF[0][0][6]=10;
				nsItemsWCF[0][0][7]=11;
				nsItemsWCF[0][0][8]=12;
				nsItemsWCF[0][0][9]=13;
				nsItemsWCF[0][0][10]=14;
				nsItemsWCF[0][0][11]=15;
				nsItemsWCF[0][0][12]=16;
				nsItemsWCF[0][0][13]=17;
				nsItemsWCF[0][0][14]=18;
				nsItemsWCF[0][0][15]=19;
				nsItemsWCF[0][0][16]=20;
				nsItemsWCF[0][0][17]=21;
				nsItemsWCF[0][0][18]=22;
				nsItemsWCF[0][0][19]=23;
				nsItemsWCF[0][0][20]=24;
				nsItemsWCF[0][0][21]=25;
				nsItemsWCF[0][0][22]=26;
				nsItemsWCF[0][0][23]=27;
				nsItemsWCF[0][0][24]=28;
				nsItemsWCF[0][0][25]=29;
				nsItemsWCF[0][0][26]=30;
				nsItemsWCF[0][0][27]=31;
				nsItemsWCF[0][0][28]=32;
				nsItemsWCF[0][0][29]=33;
				nsItemsWCF[0][0][30]=34;
				nsItemsWCF[0][0][31]=35;
			//subsea
			nsItemsWCF[0][1]=new Array();
				nsItemsWCF[0][1][0]=0;
				nsItemsWCF[0][1][1]=0;
				nsItemsWCF[0][1][2]=0;
				nsItemsWCF[0][1][3]=0;
				nsItemsWCF[0][1][4]=0;
				nsItemsWCF[0][1][5]=0;
				nsItemsWCF[0][1][6]=0;
				nsItemsWCF[0][1][7]=0;
				nsItemsWCF[0][1][8]=36;
				nsItemsWCF[0][1][9]=37;
				nsItemsWCF[0][1][10]=38;
				nsItemsWCF[0][1][11]=39;
				nsItemsWCF[0][1][12]=40;
				nsItemsWCF[0][1][13]=41;
				nsItemsWCF[0][1][14]=42;
				nsItemsWCF[0][1][15]=43;
				nsItemsWCF[0][1][16]=44;
				nsItemsWCF[0][1][17]=45;
				nsItemsWCF[0][1][18]=46;
				nsItemsWCF[0][1][19]=47;
				nsItemsWCF[0][1][20]=48;
				nsItemsWCF[0][1][21]=49;
				nsItemsWCF[0][1][22]=50;
				nsItemsWCF[0][1][23]=51;
				nsItemsWCF[0][1][24]=52;
				nsItemsWCF[0][1][25]=53;
				nsItemsWCF[0][1][26]=54;
				nsItemsWCF[0][1][27]=55;
				nsItemsWCF[0][1][28]=56;
				nsItemsWCF[0][1][29]=57;
				nsItemsWCF[0][1][30]=58;
				nsItemsWCF[0][1][31]=59;
	//fund
		nsItemsWCF[1]=new Array();
			//surface
			nsItemsWCF[1][0]=new Array();
				nsItemsWCF[1][0][0]=0;
				nsItemsWCF[1][0][1]=60;
				nsItemsWCF[1][0][2]=61;
				nsItemsWCF[1][0][3]=62;
				nsItemsWCF[1][0][4]=0;
				nsItemsWCF[1][0][5]=0;
				nsItemsWCF[1][0][6]=0;
				nsItemsWCF[1][0][7]=0;
				nsItemsWCF[1][0][8]=63;
				nsItemsWCF[1][0][9]=64;
				nsItemsWCF[1][0][10]=65;
				nsItemsWCF[1][0][11]=66;
				nsItemsWCF[1][0][12]=67;
				nsItemsWCF[1][0][13]=68;
				nsItemsWCF[1][0][14]=69;
				nsItemsWCF[1][0][15]=70;
				nsItemsWCF[1][0][16]=71;
				nsItemsWCF[1][0][17]=72;
				nsItemsWCF[1][0][18]=73;
				nsItemsWCF[1][0][19]=74;
				nsItemsWCF[1][0][20]=75;
				nsItemsWCF[1][0][21]=76;
				nsItemsWCF[1][0][22]=77;
				nsItemsWCF[1][0][23]=78;
				nsItemsWCF[1][0][24]=79;
				nsItemsWCF[1][0][25]=80;
				nsItemsWCF[1][0][26]=81;
				nsItemsWCF[1][0][27]=82;
				nsItemsWCF[1][0][28]=83;
				nsItemsWCF[1][0][29]=84;
				nsItemsWCF[1][0][30]=85;
				nsItemsWCF[1][0][31]=86;
			//subsea
			nsItemsWCF[1][1]=new Array();
				nsItemsWCF[1][1][0]=0;
				nsItemsWCF[1][1][1]=0;
				nsItemsWCF[1][1][2]=0;
				nsItemsWCF[1][1][3]=0;
				nsItemsWCF[1][1][4]=0;
				nsItemsWCF[1][1][5]=0;
				nsItemsWCF[1][1][6]=0;
				nsItemsWCF[1][1][7]=0;
				nsItemsWCF[1][1][8]=87;
				nsItemsWCF[1][1][9]=88;
				nsItemsWCF[1][1][10]=89;
				nsItemsWCF[1][1][11]=90;
				nsItemsWCF[1][1][12]=91;
				nsItemsWCF[1][1][13]=92;
				nsItemsWCF[1][1][14]=93;
				nsItemsWCF[1][1][15]=94;
				nsItemsWCF[1][1][16]=95;
				nsItemsWCF[1][1][17]=96;
				nsItemsWCF[1][1][18]=97;
				nsItemsWCF[1][1][19]=98;
				nsItemsWCF[1][1][20]=99;
				nsItemsWCF[1][1][21]=100;
				nsItemsWCF[1][1][22]=101;
				nsItemsWCF[1][1][23]=102;
				nsItemsWCF[1][1][24]=103;
				nsItemsWCF[1][1][25]=104;
				nsItemsWCF[1][1][26]=105;
				nsItemsWCF[1][1][27]=106;
				nsItemsWCF[1][1][28]=107;
				nsItemsWCF[1][1][29]=108;
				nsItemsWCF[1][1][30]=109;
				nsItemsWCF[1][1][31]=110;
	//supv
		nsItemsWCF[2]=new Array();
			//surface
			nsItemsWCF[2][0]=new Array();
				nsItemsWCF[2][0][0]=0;
				nsItemsWCF[2][0][1]=111;
				nsItemsWCF[2][0][2]=112;
				nsItemsWCF[2][0][3]=113;
				nsItemsWCF[2][0][4]=0;
				nsItemsWCF[2][0][5]=0;
				nsItemsWCF[2][0][6]=0;
				nsItemsWCF[2][0][7]=0;
				nsItemsWCF[2][0][8]=114;
				nsItemsWCF[2][0][9]=115;
				nsItemsWCF[2][0][10]=116;
				nsItemsWCF[2][0][11]=117;
				nsItemsWCF[2][0][12]=118;
				nsItemsWCF[2][0][13]=119;
				nsItemsWCF[2][0][14]=120;
				nsItemsWCF[2][0][15]=121;
				nsItemsWCF[2][0][16]=122;
				nsItemsWCF[2][0][17]=123;
				nsItemsWCF[2][0][18]=124;
				nsItemsWCF[2][0][19]=125;
				nsItemsWCF[2][0][20]=126;
				nsItemsWCF[2][0][21]=127;
				nsItemsWCF[2][0][22]=128;
				nsItemsWCF[2][0][23]=129;
				nsItemsWCF[2][0][24]=130;
				nsItemsWCF[2][0][25]=131;
				nsItemsWCF[2][0][26]=132;
				nsItemsWCF[2][0][27]=133;
				nsItemsWCF[2][0][28]=134;
				nsItemsWCF[2][0][29]=135;
				nsItemsWCF[2][0][30]=136;
				nsItemsWCF[2][0][31]=137;
			//subsea
			nsItemsWCF[2][1]=new Array();
			nsItemsWCF[2][1][0]=0;
			nsItemsWCF[2][1][1]=0;
			nsItemsWCF[2][1][2]=0;
			nsItemsWCF[2][1][3]=0;
			nsItemsWCF[2][1][4]=0;
			nsItemsWCF[2][1][5]=0;
			nsItemsWCF[2][1][6]=0;
			nsItemsWCF[2][1][7]=0;
			nsItemsWCF[2][1][8]=138;
			nsItemsWCF[2][1][9]=139;
			nsItemsWCF[2][1][10]=140;
			nsItemsWCF[2][1][11]=141;
			nsItemsWCF[2][1][12]=142;
			nsItemsWCF[2][1][13]=143;
			nsItemsWCF[2][1][14]=144;
			nsItemsWCF[2][1][15]=145;
			nsItemsWCF[2][1][16]=146;
			nsItemsWCF[2][1][17]=147;
			nsItemsWCF[2][1][18]=148;
			nsItemsWCF[2][1][19]=149;
			nsItemsWCF[2][1][20]=150;
			nsItemsWCF[2][1][21]=151;
			nsItemsWCF[2][1][22]=152;
			nsItemsWCF[2][1][23]=153;
			nsItemsWCF[2][1][24]=154;
			nsItemsWCF[2][1][25]=155;
			nsItemsWCF[2][1][26]=156;
			nsItemsWCF[2][1][27]=157;
			nsItemsWCF[2][1][28]=158;
			nsItemsWCF[2][1][29]=159;
			nsItemsWCF[2][1][30]=160;
			nsItemsWCF[2][1][31]=161;

var nsItemsSOP=new Array(0,162,163,0);

var cookies=new CookieUtil("WCSSYS21",0);


function AddToCart_cookies(f){
	if(!cookies.getSubValue("WCSSYS21")){
		document.getElementById("panel").style.display="none";
		document.getElementById("eula").style.display="block";
		if(document.getElementById("eulaText").scrollHeight<350){
			//no need to scroll to bottom (350 + 30 padding);
			document.getElementById("accept").disabled=false;
			document.getElementById("decline").disabled=false;
		}
	}else{
		f.submit();
	}
}

function AddToCart(f){
	document.getElementById("panel").style.display="none";
	document.getElementById("eula").style.display="block";
	if(document.getElementById("eulaText").scrollHeight<350){
		//no need to scroll to bottom (350 + 30 padding);
		document.getElementById("accept").disabled=false;
		document.getElementById("decline").disabled=false;
	}
}

function checkEULA(){
	var objDiv = document.getElementById("eulaText");
	if((objDiv.offsetHeight+objDiv.scrollTop)>= objDiv.scrollHeight){
		document.getElementById("accept").disabled=false;
		document.getElementById("decline").disabled=false;
	}else{
		document.getElementById("accept").disabled=true;
		document.getElementById("decline").disabled=true;
	}

}

function acceptEula(f){
	cookies.setSubValue("WCSSYS21",1);
	f.submit();
}

function declineEula(){
	document.getElementById("panel").style.display="block";
	document.getElementById("eula").style.display="none";
}


function updateWCFPrice(){
	var levelIndex=(checkedIndex(form1.level));
	var stackIndex=(checkedIndex(form1.stack));
	var subjectIndex=0;
	var j=0;
	for(var i=form1.subject.length-1;i>=0;i--){
		subjectIndex+=Math.pow(2,j)*(form1.subject[i].checked?1:0);
		j++;
	}
	dbgc.debugMsgValue("levelIndex",levelIndex);
	dbgc.debugMsgValue("stackIndex",stackIndex);
	dbgc.debugMsgValue("subjectIndex",subjectIndex);
	addWCF.addWCFButt.disabled=true;
	if((levelIndex>=0)&&(stackIndex>=0)&&(subjectIndex>0)){
		var nsItem=nsItemsWCF[levelIndex][stackIndex][subjectIndex];
		if(nsItem!=0){
			dbgc.debugMsg("get ns value for "+nsItem);
			document.getElementById("wcfPriceFrame").src="nsitem.asp?nsItemId="+nsItem
			addWCF.buyid.value=nsItem;
			addWCF.addWCFButt.disabled=false;
			dbgc.debugMsgValue("nsItem",nsItem)
		}else{
			alert("Invalid selection, please try again.")
		}
	}else{
		document.getElementById("wcfPriceFrame").src="about:blank";
	}
	dbgc.debugMsgValue("wcfPriceFrame.src",document.getElementById("wcfPriceFrame").src);
}

function checkedIndex(g){
	for(var i=0;i<g.length;i++){
		if(g[i].checked){
			return i;
		}
	}
	return -1;
}

function updateSOPPrice(){
	var levelIndex=0;
	var j=0;
	for(var i=form1.level.length-1;i>=0;i--){
		dbgc.debugMsg(i+": "+form1.level[i].checked);
		levelIndex+=Math.pow(2,j)*(form1.level[i].checked?1:0);
		j++;
	}
	dbgc.debugMsg("levelindex "+levelIndex);
	addSOP.addSOPButt.disabled=true;
	if(levelIndex>0){
		var nsItem=nsItemsSOP[levelIndex];
		if(nsItem!=0){
			dbgc.debugMsg("get ns value for "+nsItem);
			document.getElementById("sopPriceFrame").src="nsitem.asp?nsItemId="+nsItem
			addSOP.buyid.value=nsItem;
			addSOP.addSOPButt.disabled=false;
		}else{
			alert("Invalid selection, please try again.")
		}
	}else{
		document.getElementById("sopPriceFrame").src="about:blank";
	}
}