/* ########################################
GLOBAL ASSETS RELEASE v4.3.5
BUILD DATE: 20081208
COPYRIGHT SUN MICROSYSTEMS INC. 2008
CONTACT US AT http://www.sun.com/secure/contact/cer.jsp?id=1073e17d-8d6c-43f6-b7e8-cf210cc89ba9 WITH ANY QUESTIONS
######################################## */

function initializeMyAccount(){
itemList=new Array("loginForm","orderHistory","orderStatus","addressBook","myProfile","discounts","changePassword");
for(i=0;i<itemList.length;i++){
var j=1;
while(document.getElementById(itemList[i]+j)){
document.getElementById(itemList[i]+j).style.display="none";
j++;
}
}
}
function initializeMyAccountOpen(){
itemList=new Array("loginForm","orderHistory","orderStatus","addressBook","myProfile","discounts","changePassword");
for(i=0;i<itemList.length;i++){
var j=1;
displayMode=(document.getElementById&&document.all)?"block":"table-row";
while(document.getElementById(itemList[i]+j)){
document.getElementById(itemList[i]+j).style.display=displayMode;
j++;
}
}
}
function initializeMyAccountLoggedin(){
itemList=new Array("myAccountList");
for(i=0;i<itemList.length;i++){
var j=1;
displayMode=(document.getElementById&&document.all)?"block":"table-row";
while(document.getElementById(itemList[i]+j)){
document.getElementById(itemList[i]+j).style.display=displayMode;
j++;
}
}
}
function expandCollapse(_2e2){
var sh=addClassName;
var displayMode="none";
var img=document.getElementById(_2e2+"-img");
if(img.src.indexOf("ic_show_plus")>-1){
sh=removeClassName;
displayMode=(document.getElementById&&document.all)?"block":"table-row";
img.src=img.src.replace(/ic_show_plus/,"ic_hide_minus");
}else{
img.src=img.src.replace(/ic_hide_minus/,"ic_show_plus");
}
var i=1;
while(document.getElementById(_2e2+i)){
sh(document.getElementById(_2e2+i),"hidethis");
document.getElementById(_2e2+i).style.display=displayMode;
i++;
}
}
function expandCollapseCartSummary(sectionName){
var displayMode="none";
if(document.getElementById(sectionName+"-img").src.indexOf("ic_show_plus.gif")> - 1){
displayMode=(document.getElementById&&document.all)?"block":"table-row";
document.getElementById(sectionName+"-img").src=imdir+"/ic_hide_minus.gif";
document.getElementById("hideLabel").style.display="inline";
document.getElementById("showLabel").style.display="none";
}else{
document.getElementById(sectionName+"-img").src=imdir+"/ic_show_plus.gif";
document.getElementById("hideLabel").style.display="none";
document.getElementById("showLabel").style.display="inline";
}
var i=1;
while(document.getElementById(sectionName+i)){
document.getElementById(sectionName+i).style.display=displayMode;
i++;
}
}

function showHideErrors(sectionName){
var displayMode="none";
if(document.getElementById(sectionName+"-img").src.indexOf("ic_show_plus_large.gif")> - 1){
displayMode="block";
document.getElementById(sectionName+"-img").src=imdir+"/ic_hide_minus_large.gif";
}else{
document.getElementById(sectionName+"-img").src=imdir+"/ic_show_plus_large.gif";
}
document.getElementById(sectionName).style.display=displayMode;
}
function expandCollapseSoftwarePortfolio(_2e6){
var _2e7="none";
if(document.getElementById(_2e6+"-img").src.indexOf("ic_show_plus.gif")>-1){
_2e7="block";
document.getElementById(_2e6+"-img").src="/im/ic_hide_minus.gif";
}else{
document.getElementById(_2e6+"-img").src="/im/ic_show_plus.gif";
}
var i=1;
while(document.getElementById(_2e6+i)){
document.getElementById(_2e6+i).style.display=_2e7;
i++;
}
}
function initializeOrderParts(){
itemList=new Array("orderParts");
for(i=0;i<itemList.length;i++){
var j=1;
while(document.getElementById(itemList[i]+j)){
document.getElementById(itemList[i]+j).style.display="none";
j++;
}
}
}
function showMyAccount(){
var _2ea=document.getElementById("loginForm");
var _2eb=document.getElementById("myAccount");
_2ea.style.display=(_2ea.style.display=="none")?"block":"none";
_2eb.style.display=(_2ea.style.display=="none")?"block":"none";
displayMode=(document.getElementById&&document.all)?"block":"table-row";
for(i=1;i<3;i++){
if(document.getElementById("discountedPrice"+i)){
document.getElementById("discountedPrice"+i).style.display=(_2ea.style.display=="none")?displayMode:"none";
document.getElementById("originalPrice"+i).style.display=(_2ea.style.display=="none")?"none":displayMode;
}
}
}
function checkSelectedIo(_2ec){
var _2ed;
var _2ee=0;
if(_2ec==2){
_2ed=3;
}else{
_2ed=2;
}
for(i=1;i<=5;i++){
if(document.getElementById("cmIO"+i+_2ec).checked){
_2ee++;
}
}
if(_2ee>=_2ed){
for(i=1;i<=5;i++){
if(document.getElementById("cmIO"+i+_2ec).checked){
document.getElementById("cmIO"+i+_2ec).disabled=false;
document.getElementById("cmIO"+i+_2ec+"lbl").disabled=false;
}else{
document.getElementById("cmIO"+i+_2ec).disabled=true;
document.getElementById("cmIO"+i+_2ec+"lbl").disabled=true;
}
}
}
}
/*
function showPrintPage(_2ef,_2f0,_2f1){
var _2f2=document.documentElement.clientHeight;
var _2f3=document.body.clientWidth;
leftpos=parseInt((_2f3-_2f1)/2);
toppos=parseInt((_2f2-_2f0)/2);
switch(_2ef){
case ("orderdetails"):
newWindow=window.open("order_details_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("quotedetails"):
newWindow=window.open("quote_details_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("shoppingcart"):
newWindow=window.open("shoppingcart_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("receipt"):
newWindow=window.open("receipt_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("itemdetails"):
newWindow=window.open("item_details_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("configuration"):
newWindow=window.open("configuration_print_page.jsp","popupwindow","scrollbars=yes, resizable=yes, height=400,width=815,top="+toppos+", left="+leftpos+"\"");
break;
}
}
*/
function showPopup(_2f4,_2f5,_2f6){
var _2f7=document.documentElement.clientHeight;
var _2f8=document.body.clientWidth;
leftpos=parseInt((_2f8-_2f6)/2);
toppos=parseInt((_2f7-_2f5)/2);
switch(_2f4){
case ("sunsystemmanager"):
newWindow=window.open("candyrack_sunsystemmanager.jsp","popupwindow","scrollbars=yes, resizable=yes, height=400,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("solarissoftwarekit"):
newWindow=window.open("candyrack_solarissoftwarekit.jsp","popupwindow","scrollbars=yes, resizable=yes, height=600,width=815,top="+toppos+", left="+leftpos+"\"");
break;
case ("warrantyPrice"):
newWindow=window.open("warranty_prices.jsp","popupwindow","scrollbars=yes, resizable=yes, height=300,width=815,top="+toppos+", left="+leftpos+"\"");
break;
}
}
function showShipWithinPopup(_2f9){
var _2fa=document.documentElement.clientHeight;
var _2fb=document.documentElement.clientWidth;
var _2fc=275;
var _2fd=550;
leftpos=parseInt((_2fb-_2fd)/2);
toppos=parseInt((_2fa-_2fc)/2);
newWindow=window.open(_2f9,"popupwindow","scrollbars=yes, resizable=yes, height=275,width=550,top="+toppos+", left="+leftpos+"\"");
}
function showSearchResults(_2fe){
document.getElementById(_2fe).style.display="block";
if(document.getElementById("systemSummary")){
document.getElementById("systemSummary").style.display="block";
}
}
function showPartSearchResults(_2ff){
document.getElementById("narrow-search-msg").style.display="none";
document.getElementById(_2ff).style.display="none";
document.getElementById("no-result-msg").style.display="none";
var _300=(document.getElementById&&document.all)?"block":"table-row";
var _301=_300;
var _302=document.getElementById("part-search").value;
var _303=document.getElementById("searchResult-table").tBodies[0].rows;
var _304="block";
for(i=0;i<_303.length;i++){
_303[i].style.display="none";
var _305=_303[i].cells;
if(_305[2]){
if(_305[2].innerHTML.indexOf(_302)>-1){
document.getElementById(_2ff).style.display="block";
_303[i].style.display=_300;
_303[0].style.display=_300;
document.getElementById("numResults").innerHTML="1 item";
_304="none";
}
}
}
if((_302!="generic")&&(_302!="power supply")){
document.getElementById("keyword").innerHTML=_302;
document.getElementById("no-result-msg").style.display=_304;
}else{
if(_302=="generic"){
document.getElementById("narrow-search-msg").style.display=_304;
}else{
if(_302=="power supply"){
for(i=0;i<_303.length;i++){
_303[i].style.display="none";
}
document.getElementById("search-results").style.display="block";
document.getElementById("powerSupplySearch").style.display=_300;
document.getElementById("powersupply2").style.display=_300;
document.getElementById("powersupply3").style.display=_300;
}
}
}
if(document.getElementById("viewTypeSystem").checked){
document.getElementById("productCat1").innerHTML="System Options";
document.getElementById("productCat2").innerHTML="System Options";
}else{
document.getElementById("productCat1").innerHTML="Spare Parts";
document.getElementById("productCat2").innerHTML="Spare Parts";
}
}
/*
Method adds new table row to ExpressOrder table.
Parameters:
tableId - the ExpressOrder table Id
newRows - the number of new rows to add
rowCount - the final number of row count
*/
function addRowToTable(tableId, newRows, rowCount){
var tbl=document.getElementById(tableId).tBodies[0];
// get tbody of table
var lastRow=tbl.rows.length;
// get number of rows currently in tbody
var limit=lastRow+newRows;
// max

for(index=lastRow+1;lastRow < limit;index++){
var row=tbl.insertRow(lastRow);

// index cell
var indexCell=row.insertCell(0);
indexCell.innerHTML=index+".";

// part number cell
var partNumCell=row.insertCell(1);
var e1=document.createElement('input');
e1.type='text';
e1.name='ProductIdentifier_'+index;
e1.id='ProductIdentifier_'+index;
e1.size=40;
e1.maxLength=40;
partNumCell.appendChild(e1);

// quantity cell
var qtyCell=row.insertCell(2);
var e2=document.createElement('input');
e2.type='text';
e2.name='ProductQuantity_'+index;
e2.id='ProductQuantity_'+index;
e2.size=7;
e2.maxLength=7;
qtyCell.appendChild(e2);

// clear link cell
var clearCell=row.insertCell(3);
clearCell.className="small";
clearCell.innerHTML="<a href=\"#\" onClick=\"document.getElementById('ProductIdentifier_"+index+"').value='';document.getElementById('ProductQuantity_"+index+"').value='';return false;\">Clear</a>";

lastRow++;
}

document.getElementById(rowCount).value=lastRow;
}

/* Show/Hide Cart Details */

/* SUN_SLD_B2C_SF ShowCartDetails and shwoAllCartDetails Function */
function showCartDetails(_306){
var _307="true";
cartDetails=document.getElementById("cart-details"+_306);
viewIcon=document.getElementById("icView"+_306);
viewLink=document.getElementById("view-link"+_306);
viewIcon.src=(cartDetails.style.display=="none")? imdir+"/ic_hide_minus.gif": imdir+"/ic_show_plus.gif";
viewLink.innerHTML=(cartDetails.style.display=="none")?"Hide Details":"View Details";
cartDetails.style.display=(cartDetails.style.display=="none")?"block":"none";
viewAllLink=document.getElementById("viewAll-link");
var i=1;
while(document.getElementById("cart-details"+i)){
if(document.getElementById("cart-details"+i).style.display=="none"){
_307="false";
}
i++;
}
viewAllLink.innerHTML=(_307=="false")?"View All Details":"Hide All Details";
viewAllIcon=document.getElementById("icViewAll");
viewAllIcon.src=(viewAllLink.innerHTML=="Hide All Details")? imdir+"/ic_hide_minus.gif": imdir+"/ic_show_plus.gif";
}
function showAllCartDetails(){
var _309=1;
viewAllLink=document.getElementById("viewAll-link");
viewAllLink.innerHTML=(viewAllLink.innerHTML=="View All Details")?"Hide All Details":"View All Details";
viewAllIcon=document.getElementById("icViewAll");
viewAllIcon.src=(viewAllLink.innerHTML=="Hide All Details")? imdir+"/ic_hide_minus.gif": imdir+"/ic_show_plus.gif";
while(document.getElementById("cart-details"+_309)){
cartDetails=document.getElementById("cart-details"+_309);
viewIcon=document.getElementById("icView"+_309);
viewLink=document.getElementById("view-link"+_309);
viewIcon.src=(viewAllLink.innerHTML=="Hide All Details")? imdir+"/ic_hide_minus.gif": imdir+"/ic_show_plus.gif";
viewLink.innerHTML=(viewAllLink.innerHTML=="Hide All Details")?"Hide Details":"View Details";
cartDetails.style.display=(viewAllLink.innerHTML=="Hide All Details")?"block":"none";
_309++;
}
}
function showCategoryDescription(_30a){
var _30b=(document.getElementById&&document.all)?"block":"table-row";
var _30c=document.getElementById("searchResult-table").tBodies[0].rows;
for(i=0;i<_30c.length;i++){
_30c[i].style.display=_30b;
}
document.getElementById("filter-all").style.display="none";
document.getElementById("filter-spares").style.display="none";
document.getElementById("filter-systemoptions").style.display="none";
if(_30a==1){
document.getElementById("filter-spares").style.display="inline";
for(i=0;i<_30c.length;i++){
if((_30c[i].getAttribute("name")=="system")){
_30c[i].style.display="none";
}else{
_30c[i].style.display=_30b;
}
}
}else{
if(_30a==0){
document.getElementById("filter-systemoptions").style.display="inline";
for(i=0;i<_30c.length;i++){
if((_30c[i].getAttribute("name")=="spare")){
_30c[i].style.display="none";
}else{
_30c[i].style.display=_30b;
}
}
}
}
}
function showProductModels(_30d,_30e){
if(_30e=="dynamic"){
document.getElementById("productModels").style.display=(_30d!=0)?"block":"none";
}
if(document.getElementById("productOptions").selectedIndex==0){
document.getElementById("cmservermodels").style.display="none";
document.getElementById("cmstoragemodels").style.display="none";
document.getElementById("cmdefaultmodels").style.display="block";
}else{
if(document.getElementById("productOptions").selectedIndex==2){
document.getElementById("cmservermodels").style.display="block";
document.getElementById("cmstoragemodels").style.display="none";
document.getElementById("cmdefaultmodels").style.display="none";
}else{
if(document.getElementById("productOptions").selectedIndex==3){
document.getElementById("cmstoragemodels").style.display="block";
document.getElementById("cmservermodels").style.display="none";
document.getElementById("cmdefaultmodels").style.display="none";
}
}
}
}
function expandCollapseSpare(_30f){
var _310="none";
if(document.getElementById(_30f+"-img").src.indexOf("ic_show_plus.gif")>-1){
_310=(document.getElementById&&document.all)?"block":"table-row";
document.getElementById(_30f+"-img").src="/im/ic_hide_minus.gif";
}else{
document.getElementById(_30f+"-img").src="/im/ic_show_plus.gif";
}
var i=1;
while(document.getElementById(_30f+i)){
document.getElementById(_30f+i).style.display=_310;
i++;
}
}
function showMyAccount(){
var _312=document.getElementById("loginForm");
var _313=document.getElementById("myAccount");
_312.style.display=(_312.style.display=="none")?"block":"none";
_313.style.display=(_312.style.display=="none")?"block":"none";
displayMode=(document.getElementById&&document.all)?"block":"table-row";
var i=1;
if(document.getElementById("listPrice1")){
while(document.getElementById("listPrice"+i)){
document.getElementById("listPrice"+i).style.display=(_312.style.display=="none")?"none":"block";
document.getElementById("yourPrice"+i).style.display=(_312.style.display=="none")?"block":"none";
i++;
}
}
if(document.getElementById("originalPrice1")){
var j=1;
while(document.getElementById("originalPrice"+j)){
document.getElementById("originalPrice"+j).style.display=(_312.style.display=="none")?"none":"block";
document.getElementById("discountedPrice"+j).style.display=(_312.style.display=="none")?"block":"none";
j++;
}
}
}
function expandCollapseAddress(btnstatus, sectionName){
document.getElementById(sectionName).style.display=btnstatus?"block":"none";
}

// method display edit address window
function showAddressDHTML(windowName, popupheader, popupheight){
document.getElementById("popupaddressheader").innerHTML=popupheader;
if(document.getElementById&&document.all){
if(document.getElementById(windowName+"iframe")){
document.getElementById(windowName+"iframe").className="k4";
}
}
var browserHeight=document.body.clientHeight;

var divMoreWin=document.getElementById(windowName);
var divMoreFrame=document.getElementById(windowName+"iframe");

topPos=10+parseInt(getScrollY());
bottomPadding=browserHeight - parseInt(topPos+popupheight);

divMoreWin.style.paddingTop=topPos+"px";
divMoreWin.style.paddingBottom=bottomPadding+"px";

if(document.getElementById&&document.all){
if(document.getElementById(windowName+"iframe")){
divMoreFrame.style.paddingTop=topPos+"px";
divMoreFrame.style.paddingBottom=bottomPadding+"px";
}
}
document.getElementById(windowName).className="k4 k4v0";
}

function showDHTML(_316,_317){
if(document.getElementById(_316+"iframe")){
document.getElementById(_316+"iframe").className="k4";
}
var _318=document.body.clientHeight;
var _319=document.getElementById(_316);
topPos=10+parseInt(getScrollY());
bottomPadding=_318-parseInt(topPos+_317);
_319.style.paddingTop=topPos+"px";
_319.style.paddingBottom=bottomPadding+"px";
document.getElementById(_316).className="k4 k4v0";
}
function getScrollY(){
var _31a=0,scrOfY=0;
if(typeof (window.pageYOffset)=="number"){
scrOfY=window.pageYOffset;
_31a=window.pageXOffset;
}else{
if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
scrOfY=document.body.scrollTop;
_31a=document.body.scrollLeft;
}else{
if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
scrOfY=document.documentElement.scrollTop;
_31a=document.documentElement.scrollLeft;
}
}
}
return [scrOfY];
}
function hideDHTML(_31b){
document.getElementById(_31b).className="k4 k4v0 k4hidden";
if(document.getElementById(_31b+"iframe")){
document.getElementById(_31b+"iframe").className="k4 k4v0 k4hidden";
}
}

// method expand collapse payment options
function expandCollapsePayment(btnstatus, sectionName) {
itemList = new Array ("newcard", "bankaccount", "payorder", "pcard");
for (i=0; i<itemList.length; i++) {
var j = 1;
while (document.getElementById(itemList[i] + j)) {
document.getElementById(itemList[i] + j).style.display = "none";
j++;
}
}
displayMode = (document.getElementById && document.all) ? "block" : "table-row";
var i = 1;
while (document.getElementById(sectionName + i)) {
document.getElementById(sectionName + i).style.display = displayMode;
i++;
}
}

// method populate address form to be updated
function populateAddressForm(address, htmlformname){
with(document.PopinAddressForm){
elements[htmlformname+"_FirstName" ].value=address["FirstName" ];
elements[htmlformname+"_LastName" ].value=address["LastName" ];
elements[htmlformname+"_Title" ].value=address["Title" ];
elements[htmlformname+"_Company" ].value=address["CompanyName" ];
elements[htmlformname+"_Street" ].value=address["Street" ];
elements[htmlformname+"_Street2" ].value=address["Street2" ];
elements[htmlformname+"_StreetTranscription" ].value=address["StreetTranscription" ];
elements[htmlformname+"_City" ].value=address["City" ];
elements[htmlformname+"_State" ].value=address["State" ];
elements[htmlformname+"_PostalCode" ].value=address["PostalCode" ];
elements[htmlformname+"_PhoneHome" ].value=address["PhoneHome" ];
elements[htmlformname+"_Email" ].value=address["EMail" ];
elements[htmlformname+"_Fax" ].value=address["Fax" ];
elements[htmlformname+"_FirstNameTranscription" ].value=address["FirstNameTranscription" ];
elements[htmlformname+"_LastNameTranscription" ].value=address["LastNameTranscription" ];
elements[htmlformname+"_PhoneBusiness" ].value=address["PhoneBusiness" ];
document.forms[htmlformname].elements["AddressID" ].value=address["AddressID" ];

htmlformname="PopinAddressForm";

if(address["AddressType" ]=="Service"){
document.forms[htmlformname].elements[document.forms[htmlformname].elements.length - 1].name="updateServiceAddress";
document.forms[htmlformname].elements["DefaultButton" ].value="updateServiceAddress";
}
else if(address["AddressType" ]=="Billing"){
document.forms[htmlformname].elements[document.forms[htmlformname].elements.length - 1].name="updateBillingAddress";
document.forms[htmlformname].elements["DefaultButton" ].value="updateBillingAddress";
}
else{
document.forms[htmlformname].elements[document.forms[htmlformname].elements.length - 1].name="updateShippingAddress";
document.forms[htmlformname].elements["DefaultButton" ].value="updateShippingAddress";
}
}
}

// display"saving ..." message box
function showSavingMsg(){
document.getElementById("saveaddressmsg").style.display="none";
viewAllLink=document.getElementById("savingMsg").style.display="block";
}

function showPrintPage(pagename, popupheight, popupwidth){
var documentHeight=document.documentElement.clientHeight;
var documentWidth=document.body.clientWidth;
leftpos=parseInt((documentWidth - popupwidth)/2);
toppos=parseInt(document.getElementById(documentHeight - popupheight)/2);

newWindow=window.open(pagename,"printerfriendlywindow","scrollbars=yes, resizable=yes, height=600,width=800,top="+toppos+", left="+leftpos+"\"");
newWindow.focus();
}

function highlightRow(btnStatus, rowId){
document.getElementById(rowId).style.background=btnStatus?"#eee":"none";
if(document.getElementById("product-"+rowId)){
document.getElementById("product-"+rowId).style.background=btnStatus?"#eee":"none";
_31f++;
}
}
function showSavedItemMsg(){
document.getElementById("saveditemmessage").style.display="block";
location.href="#";
}
function showChatPopup(){
window.open("https://ssl1.taggingserver.netmining.com/script/sun/chat/","callnow","directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no,height=450,width=370,top="+(screen.availHeight/2-225)+",left="+(screen.availWidth/2-175));
}
function initializeComponents(){
var _320=document.getElementsByTagName("div");
for(i=0;i<_320.length;i++){
if(_320[i].className.indexOf("cmOptions")>-1){
_320[i].onmouseover=function(){
if(this.className.indexOf("cmSelected")<=-1){
this.className="cmOptions cmHover";
}
};
_320[i].onmouseout=function(){
if(this.className.indexOf("cmSelected")<=-1){
this.className="cmOptions";
}
};
}
var _321=new Array("processorqty","memoryqty","diskqty");
for(k=0;k<_321.length;k++){
if(document.getElementById(_321[k]+1)){
j=1;
while(document.getElementById(_321[k]+j)){
document.getElementById(_321[k]+j).disabled=true;
document.getElementById(_321[k]+j).checked=false;
j++;
}
document.getElementById(_321[k]+1).parentNode.className="label-disabled";
}
}
if(document.getElementById("cmCpu1")){
document.getElementById("cmCpu1").checked=true;
document.getElementById("cmDisk11").checked=true;
document.getElementById("cmMem11").checked=true;
}
}
}
function highlightSelected(obj,_323){
var _324="";
if(obj.type=="radio"){
i=1;
while(document.getElementById(_323+i)){
document.getElementById(_323+i).parentNode.className="cmOptions";
if(document.getElementById(_323+i+"Price")){
document.getElementById(_323+i+"Price").style.display="inline";
}
i++;
}
}
if(obj.checked){
obj.parentNode.className="cmOptions cmSelected";
if(document.getElementById(obj.id+"Price")){
document.getElementById(obj.id+"Price").style.display="none";
}
}else{
obj.parentNode.className="cmOptions";
}
switch(_323){
case ("cmDisk1"):
_324=document.myform.cmDisk1Num;
break;
case ("cmMem1"):
_324=document.myform.cmNumMemory;
break;
case ("cmCpu"):
_324=document.myform.cmNumProcessor;
break;
}
if(_323!="cmMem1"){
if((document.myform.cmDisk1Num)&&(_324!="")){
var _325=_324.length;
for(i=0;i<_325;i++){
_324[i].disabled=(obj.id==(_323+1));
}
_324[0].parentNode.className=(obj.id==(_323+1))?"label-disabled":"label";
_324[0].checked=(obj.id!=(_323+1));
}
}
if((obj.id=="cmPs1")||(obj.id=="cmRp1")){
for(j=1;j<3;j++){
document.getElementById(obj.name+"qty"+j).disabled=!(obj.checked);
}
if((obj.id=="cmPs1")&&(!(obj.checked))){
document.getElementById("cmRp1").checked=false;
document.getElementById("cmRp1").parentNode.className="cmOptions";
for(j=1;j<3;j++){
document.getElementById("powercordqty"+j).disabled=true;
}
}
}
}
function updateIOCardSlots(obj,_327){
var _328=0;
if(obj.selectedIndex>0){
obj.parentNode.className="cmOptions cmSelected";
}
j=1;
while(document.getElementById(_327+j)){
_328=_328+document.getElementById(_327+j).selectedIndex;
j++;
}
}
function updateMemoryInfo(obj,_32a){
highlightSelected(obj,"cmMem");
switch(_32a){
case 1:
document.getElementById("cmMemInfo").innerHTML="1GB DDR1 (2x512MB)";
break;
case 2:
document.getElementById("cmMemInfo").innerHTML="2GB DDR1 (4x512MB)";
break;
case 3:
document.getElementById("cmMemInfo").innerHTML="2GB DDR1 (2x1GB)";
break;
}
document.getElementById("cmMemInfo").style.background="#ffffcc";
setTimeout("document.getElementById('cmMemInfo').style.background = 'transparent'",2000);
updatePrice();
}
function updateSecondaryDrive(obj,_32c){
highlightSelected(obj,"cmDisk2");
switch(_32c){
case 1:
document.getElementById("cmDisk2Info").style.display="none";
break;
case 2:
document.getElementById("cmDisk2Info").innerHTML="80GB Secondary Disk";
document.getElementById("cmDisk2Info").style.display="list-item";
document.getElementById("cmDisk2Info").className="small";
break;
case 3:
document.getElementById("cmDisk2Info").innerHTML="250GB Secondary Disk";
document.getElementById("cmDisk2Info").style.display="list-item";
document.getElementById("cmDisk2Info").className="small";
break;
}
document.getElementById("cmDisk2Info").style.background="#ffffcc";
setTimeout("document.getElementById('cmDisk2Info').style.background = 'transparent'",2000);
updatePrice();
}
function updatePrice(){
var _32d=0;
var _32e=0;
var _32f=0;
var _330=0;
var _331=new Array(49,35,349,349,799,1499);
if(document.getElementById("cmMem1").checked){
_32d=0;
}else{
if(document.getElementById("cmMem2").checked){
_32d=270;
}else{
if(document.getElementById("cmMem3").checked){
_32d=590;
}
}
}
if(document.getElementById("cmDisk21").checked){
_32e=0;
}else{
if(document.getElementById("cmDisk22").checked){
_32e=150;
}else{
if(document.getElementById("cmDisk23").checked){
_32e=299;
}
}
}
if(document.getElementById("cmOptical1").checked){
_32f=95;
}
for(i=1;i<=6;i++){
if(document.getElementById("cmOs"+i).checked){
_330+=_331[i-1];
}
}
var _332=1390+_32d+_32e+_330;
document.getElementById("cmSubtotal1").innerHTML="<strong>$"+_332+"</strong>";
document.getElementById("cmSubtotal2").innerHTML="<strong>$"+_332+"</strong>";
}
function checkLoginInfo(_333,_334){
if(document.getElementById(_334).value==""){
document.getElementById("errorMsg").style.display="block";
}else{
if(document.getElementById(_334).value!=""){
hideDHTML("loginpopup");
if(_333=="savequote"){
showDHTML("savequotepopup",400);
}else{
if(_333=="saveitem"){
location.href="saved_item.jsp";
}
}
}
}
}
function showSavingMsg(_335){
var _336=document.getElementById("quotename_field").value;
document.getElementById(_335).style.display="none";
document.getElementById("errorMsg").style.display="none";
document.getElementById("savingMsg").style.display="block";
var t=setTimeout("showSavedQuoteMsg()",2000);
location.href="#top";
}
function showSavedQuoteMsg(){
document.getElementById("savingMsg").style.display="none";
document.getElementById("savedquotemsg").style.display="block";
var _338=document.getElementById("quotename_field").value;
if(_338==""){
_338="Quote XYZ";
}
document.getElementById("quotename").innerHTML=_338;
}
function updateConfigSummary(obj,_33a,_33b,_33c){
highlightSelectedRow(obj,_33b);
}
function updateSparePrice(_33d,_33e){
var _33f=new Array("cmBootDisk","cmCod","cmAccelerationBoards");
var _340=new Array(7495,8495,7495);
var _341=20000;
var _342=50;
var _343=0;
for(j=0;j<_33f.length;j++){
i=0;
while(document.getElementById(_33f[j]+(++i))){
if(document.getElementById(_33f[j]+i).checked){
priceVar=_33f[j]+"PriceList";
switch(priceVar){
case ("cmBootDiskPriceList"):
_343+=_340[i-1];
break;
case ("cmCodPriceList"):
_343+=_341;
break;
case ("cmAccelerationBoardsPriceList"):
_343+=_342;
break;
}
}
}
}
document.getElementById("cmSubtotal1").innerHTML="<strong>$"+_343+"</strong>";
}
function highlightSelectedRow(obj,_345){
var _346="";
if(obj.checked){
(obj.parentNode).parentNode.className="cmOptions cmSelected";
(obj.parentNode).parentNode.cells[0].style.background="#fff";
}else{
(obj.parentNode).parentNode.className="cmOptions";
}
}
function highlightSelectedTableRow(obj,_348){
var _349="";
if(obj.type=="radio"){
i=1;
while(document.getElementById(_348+i)){
document.getElementById(_348+i).parentNode.parentNode.className="cmOptions";
if(document.getElementById(_348+i+"Price")){
document.getElementById(_348+i+"Price").style.display="inline";
}
i++;
}
}
var _34a=document.getElementById(_348+"-table").tBodies[0].rows.length;
for(i=0;i<_34a;i++){
document.getElementById(_348+"-table").tBodies[0].rows[i].className="cmOptions";
}
if(obj.checked){
(obj.parentNode).parentNode.className="cmOptions cmSelected";
if(document.getElementById(obj.id+"Price")){
document.getElementById(obj.id+"Price").style.display="none";
}
}else{
(obj.parentNode).parentNode.className="cmOptions";
}
switch(_348){
case ("cmDisk1"):
_349=document.myform.cmDisk1Num;
break;
case ("cmMem1"):
_349=document.myform.cmNumMemory;
break;
case ("cmCpu"):
_349=document.myform.cmNumProcessor;
break;
}
}
function trimAll(sString){
if(sString.length > 0){

while(sString.substring(0, 1)==' '){
sString=sString.substring(1, sString.length);
}
while(sString.substring(sString.length - 1, sString.length)==' '){
sString=sString.substring(0, sString.length - 1);
}
}
return sString;
}

function CurrencyFormatted(amount){
var i=parseFloat(amount);
if(isNaN(i)){
i=0.00;
}
var minus='';
if(i < 0){
minus='-';
}
i=Math.abs(i);
i=parseInt((i+.005)* 100);
i=i / 100;
s=new String(i);
if(s.indexOf('.')< 0){
s+='.00';
}
if(s.indexOf('.')==(s.length - 2)){
s+='0';
}
s=minus+s;
return s;
}

function CommaFormatted(amount){
var delimiter=",";
// replace comma if desired
var a=amount.split('.', 2)
var d=a[1];
var i=parseInt(a[0]);
if(isNaN(i)){
return '';
}
var minus='';
if(i < 0){
minus='-';
}
i=Math.abs(i);
var n=new String(i);
var a=[];
while(n.length > 3){
var nn=n.substr(n.length - 3);
a.unshift(nn);
n=n.substr(0, n.length - 3);
}
if(n.length > 0){
a.unshift(n);
}
n=a.join(delimiter);
if(d.length < 1){
amount=n;
}
else{
amount=n+'.'+d;
}
amount=minus+amount;
return amount;
}


function SaveQty(QtyID){
var CurrentQty=document.getElementById(QtyID).value;
if(isNaN(CurrentQty)){
document.getElementById(QtyID).value=oldQty;
oldQty=1;
subtotpriceQty=0;
}

else if(trimAll(CurrentQty)==''){
document.getElementById(QtyID).value='';
oldQty=1;
subtotpriceQty=0;
}

else{
oldQty=CurrentQty;
subtotpriceQty=CurrentQty;
}

}


function removeComma(num){
var temp1=num;
var templen=num.length;
for(i=1;i < templen;i++){
// pick limit high enough to find all possiblecommas
temp1=temp1.replace(",","");
}
return temp1;
}


function UpdateQtyPrice(QtyID, PriceID){
var CurrentPrice=document.getElementById(PriceID).innerHTML;
var CurrentQty=document.getElementById(QtyID).value;

CurrentQty=parseInt(CurrentQty)
if(isNaN(CurrentQty)||(CurrentQty < 0)){

var curPrice=CurrentPrice.substring(1);
curPrice=removeComma(curPrice);
curPrice=parseFloat(curPrice)

var singlePrice=curPrice / oldQty;
if(trimAll(document.getElementById(QtyID).value).length==0 || CurrentQty==0){
cmsubtotprice=cmsubtotprice -(subtotpriceQty * singlePrice);
var singlePrice=CurrencyFormatted(singlePrice)
var strsinglePrice="$"+CommaFormatted(singlePrice);
document.getElementById(QtyID).value='';
document.getElementById(PriceID).innerHTML=strsinglePrice;
oldQty=1;
subtotpriceQty=0;
}
else{
document.getElementById(QtyID).value=oldQty;
}

}

else{
var curPrice=CurrentPrice.substring(1);
curPrice=removeComma(curPrice);
curPrice=parseFloat(curPrice)
var singlePrice=curPrice / oldQty;
if(isNaN(curPrice)|| curPrice==''){
document.getElementById(QtyID).value=CurrentQty;
}
else{


if(trimAll(document.getElementById(QtyID).value).length==0 || CurrentQty==0){
cmsubtotprice=cmsubtotprice -(subtotpriceQty * singlePrice);

var singlePrice=CurrencyFormatted(singlePrice)
var strsinglePrice="$"+CommaFormatted(singlePrice);
document.getElementById(QtyID).value='';
document.getElementById(PriceID).innerHTML=strsinglePrice;
oldQty=1;
subtotpriceQty=0;
}
else{
cmsubtotprice=cmsubtotprice -(subtotpriceQty * singlePrice);
cmsubtotprice=cmsubtotprice+(singlePrice * CurrentQty);

var TotalPrice=singlePrice * CurrentQty;
var TotalPrice=CurrencyFormatted(TotalPrice)
var strTotalPrice="$"+CommaFormatted(TotalPrice);
document.getElementById(QtyID).value=CurrentQty;
document.getElementById(PriceID).innerHTML=strTotalPrice;
}

}


}
}


function highlightSelectedQty(obj){
if((obj.value!="")&&(obj.value!="0")){
(obj.parentNode).className="cmOptions cmSelected";
}else{
(obj.parentNode).className="cmOptions";
}
}
function highlightQty(obj,_34d){
if((obj.value!="")&&(obj.value!="0")){
objCheck=document.getElementById(_34d+1);
objCheck.checked=true;
highlightSelectedHardware(objCheck,_34d);
}else{
if((obj.value=="")||(obj.value=="0")){
objCheck=document.getElementById(_34d+1);
objCheck.checked=false;
highlightSelectedHardware(objCheck,_34d);
}
}
}
function highlightSelectedHardware(obj,_34f){
var _350="";
if(obj.checked){
(obj.parentNode).parentNode.className="cmOptions cmSelected";
}else{
(obj.parentNode).parentNode.className="cmOptions";
}
}
function highlightSelectedSpare(obj,_352){
var _353="";
if(obj.type=="radio"){
i=1;
while(document.getElementById(_352+i)){
document.getElementById(_352+i).parentNode.className="cmOptions";
if(document.getElementById(_352+i+"Price")){
document.getElementById(_352+i+"Price").style.display="inline";
}
i++;
}
}
if(obj.checked){
obj.parentNode.className="cmOptions cmSelected";
if(document.getElementById(obj.id+"Price")){
document.getElementById(obj.id+"Price").style.display="none";
}
}else{
obj.parentNode.className="cmOptions";
}
if((_352=="cmSupport")&&(obj.id!="cmSupport1")){
document.getElementById("serviceDeliveryMethod").style.display="block";
}else{
if((_352=="cmSupport")&&(obj.id=="cmSupport1")){
document.getElementById("serviceDeliveryMethod").style.display="none";
}
}
}
function showQty(_354,_355){
document.getElementById(_355).value=_354?"1":"";
}


// called once after site is built up
function GetRelatedInit(){
// store prices
CTOstorePrices();

for(var ocUUID in CTOocInformationList){
var oc=CTOocInformationList[ocUUID];
var scenario=oc["Scenario" ];
var components=oc["Components" ];
var defaultSelectionPrice=0;
for(var i=0;i < components.length;i++){
var compUUID=components[i];
var comp=CTOcompInformationList[compUUID];
// make default selections

if( ! CTOisSelected(compUUID)){
if(comp["Price" ] !=- 1){
price=comp["Price" ] - oc["NonePrice" ] - defaultSelectionPrice;
//var currency=CTOdetermineCurrency(proxyProductRef);
var currency='$';
var prefix=(price > 0)?"Add":"Subtract";
CTOdisplayProductPrice("cmCpu2Price_"+compUUID, currency, Math.abs(price), prefix);
}
else{
CTOdisplayProductPrice("cmCpu2Price_"+compUUID,"", - 1,"");
}
}
else if(proxyProductDummyName !=""){
// set new proxy product if necessary
if((oc["Name" ]==proxyProductDummyName)){
CTOsetNewProxyProduct(compUUID, comp["ProductRef" ], null, null, null);
}
}

// extension 3.8: preselect qty
var selectQty=comp["SelectedQuantity" ];
if(selectQty !=- 1&&scenario !="na"){
CTOselectQuantity(compUUID, ocUUID, selectQty, scenario);
}
}
}
}



// End HardWare StandAlone Get It Page Javascript//

 
// highlight Checked on OfferList.isml
function highlightChecked(htmlformname,checkboxname,counter,bgc){
var chkbox=document.forms[htmlformname].elements[checkboxname];
if(chkbox.length)
{var obj=chkbox[counter];}
else
{ var obj=chkbox;}

if(obj.checked){
document.getElementById("prd"+counter+"1").style.background="#fff1ca";
document.getElementById("prd"+counter+"2").style.background="#fff1ca";
document.getElementById("prd"+counter+"3").style.background="#fff1ca";
}
else
{
document.getElementById("prd"+counter+"1").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
document.getElementById("prd"+counter+"2").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
document.getElementById("prd"+counter+"3").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
}

}

//clear checked on OfferlistLoop.islm

function clearChecked(htmlformname,checkboxname,counter,bgc){
var chkbox=document.forms[htmlformname].elements[checkboxname];
var obj=chkbox[counter];  
 obj.checked=false;
highlightChecked(htmlformname,checkboxname,counter,bgc);

}

// Clear All function.

function resetChecked(htmlformname,checkboxname,startcount,maxcountname){
  var bgc="grey1";
 var maxcount=document.forms[htmlformname].elements[maxcountname].value;
 for(var counter=startcount;counter < maxcount;counter++) 
{var chkbox=document.forms[htmlformname].elements[checkboxname];
if(chkbox.length)
{var obj=chkbox[counter];}
else
{ var obj=chkbox;}
 obj.checked=false;
 document.getElementById("prd"+counter+"1").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
document.getElementById("prd"+counter+"2").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
document.getElementById("prd"+counter+"3").style.background=(bgc=="grey1")?"#EEE":"#FDFDFD";
bgc=(bgc=="grey1")?"grey2":"grey1";  
 }
}


// check if at least one item is selected and submits the form, on the other hand it display an error message
// formName - name of the formular
// cbNamePrefix - prefix of checkBox names
// errorLayerName - name of the layer to show as error
// formAction(optional)- action url for form, only assigned if set and not empty
function checkCB(formName, cbNamePrefix, errorLayerName, formAction){
var formRef=document.forms[formName];
self.scrollBy(0, -1000);
for(var i=0;i<formRef.elements.length;i++){
if((formRef.elements[i].checked==true)&&(formRef.elements[i].name.indexOf(cbNamePrefix)==0)){
if(formAction&&(formAction!='')){
formRef.action=getWSMLWebServiceHref(formAction);
}
formRef.submit();
return;
}
}

document.getElementById(errorLayerName).style.display='block';
var messageBoxElement=document.getElementById("messagebox_quote");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
messageBoxElement=document.getElementById("messagebox_requisition");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
messageBoxElement=document.getElementById("errorbox_quote_contained");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
}


// check if at least one radio item is selected and submits the form, on the other hand it display an error message
// formName - name of the formular
// rgNamePrefix - prefix of radio group's items names
// errorLayerName - name of the layer to show as error
// formAction(optional)- action url for form, only assigned if set and not empty
function checkRG(formName, rgNamePrefix, errorLayerName, formAction){
var formRef=document.forms[formName];
self.scrollBy(0, -1000);
for(var i=0;i<formRef.elements.length;i++){
if((formRef.elements[i].checked==true)&&(formRef.elements[i].name.indexOf(rgNamePrefix)==0)){
if(formAction&&(formAction!='')){
formRef.action=getWSMLWebServiceHref(formAction);
}
formRef.submit();
return;
}
}

document.getElementById(errorLayerName).style.display='block';
var messageBoxElement=document.getElementById("messagebox_quote");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
messageBoxElement=document.getElementById("messagebox_requisition");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
messageBoxElement=document.getElementById("errorbox_quote_contained");
if(messageBoxElement){
messageBoxElement.style.display='none';
}
}
