var isAccessoriesDownLoaded=false;var ajaxTabId;var ajaxColorId;var accessoriesID="accessories";var technicalDetailsId="technical_details";var customerReviewsId="customer_reviews";var accessoriesColorId="accessoriesColor";var technicalDetailsColorId="technicalColor";var customerReviewsColorId="customerReviewsColor";var accessoriesTab="accessoriesTab.jsp";var technicalDetailsTab="technicalDetailsTab.jsp";var customerReviewsTab="customerReviewsTab.jsp";var errFunc=function(a){refreshCurrentPage()};function getTabContent(d,e,c,f){if(document.getElementById("reviewsTabLoadedFlag")!=null){var a=document.getElementById("reviewsTabLoadedFlag").innerHTML;if(f=="true"&&a!="true"){e=customerReviewsTab}}if(!isAccessoriesDownLoaded&&e==accessoriesTab){var b=tabsJspPath+e;tabsAjaxRequest=new Ajax.Request(b,{parameters:"?productId="+d+"&history="+c,asynchronous:true,onSuccess:handleTabsRequest,onFailure:errFunc,method:"Get"});switch(e){case accessoriesTab:isAccessoriesDownLoaded=true;ajaxTabId=accessoriesID;ajaxColorId=accessoriesColorId;changeTabColor(accessoriesColorId);break}}else{switch(e){case technicalDetailsTab:displayTabContent(technicalDetailsId);changeTabColor(technicalDetailsColorId);break;case accessoriesTab:displayTabContent(accessoriesID);changeTabColor(accessoriesColorId);break;case customerReviewsTab:if(c=="numReviewsLink"){cmCreateManualPageviewTag("Reviews: Customer Review Tab Number of Reviews","Reviews")}else{if(c=="readReviewsLink"){cmCreateManualPageviewTag("Reviews: Customer Review Tab Read Reviews","Reviews")}else{cmCreateManualPageviewTag("Reviews: Customer Review Tab","Reviews")}}displayTabContent(customerReviewsId);changeTabColor(customerReviewsColorId);window.loadReviews();break}}}function handleTabsRequest(a){var b=document.getElementById(accessoriesID);if(a.responseText.indexOf("<error500>")>0){window.location.replace(contextPath+"/error/error.jsp")}else{if(a.responseText.indexOf("<error404>")>0){window.location.replace(contextPath+"/home/homePage.jsp")}else{b.innerHTML=a.responseText}}changeTabColor(ajaxColorId);displayTabContent(ajaxTabId);initCartQuantity();callHover()}function hideTabContent(){if(document.getElementById(technicalDetailsId)!=null){document.getElementById(technicalDetailsId).style.display="none"}if(document.getElementById(accessoriesID)!=null){document.getElementById(accessoriesID).style.display="none"}if(document.getElementById(customerReviewsId)!=null){document.getElementById(customerReviewsId).style.display="none"}}function displayTabContent(a){hideTabContent();if(document.getElementById(a)!=null){document.getElementById(a).style.display="block"}}function changeColor(){if(document.getElementById(accessoriesColorId)!=null){document.getElementById(accessoriesColorId).parentNode.parentNode.className=" "}if(document.getElementById(technicalDetailsColorId)!=null){document.getElementById(technicalDetailsColorId).parentNode.parentNode.className=" "}document.getElementById(customerReviewsColorId).parentNode.parentNode.className=" ";if(document.getElementById(accessoriesColorId)!=null){document.getElementById(accessoriesColorId).className="greenTitle"}if(document.getElementById(technicalDetailsColorId)!=null){document.getElementById(technicalDetailsColorId).className="greenTitle"}document.getElementById(customerReviewsColorId).className="greenTitle"}function changeTabColor(a){changeColor();document.getElementById(a).parentNode.parentNode.className="active";document.getElementById(a).className="orangeTitle"}function callHover(){var b=$A($$(".emailWhat"));var a=b.length;for(i=0;i<a;++i){new grayHover(b[i])}}function printSkuPage(c,d){var b=c+d+"&printTab=true";var a=window.open(b,"","directories=no,location=no,menubar=no,titlebar=no,toolbar=no,width=950,height=750,resizable=no");a.focus()};