com.csg.ProductFinder=com.csg.Class.extend({rootNode:null,content_:null,dropDowns_:null,submitButton_:null,data:null,initialize:function(A){var C=this;C.rootNode=$(A);C.rootNode.find("div.default-text").remove();C.submitButton_=C.rootNode.find("input.submit").click(function(D){C.handleButtonClick.call(C,D)}).attr("disabled","disabled").addClass("fms-inactive");C.content_=C.rootNode.find("div.product-finder-content").removeClass("hidden");C.data=com.csg.ProductFinder.Data;C.dropDowns_=C.rootNode.find("select").click(function(){$(this).find("option.fms-inactive").attr("disabled","disabled")}).change(function(){C.activateNextDropDown.call(C,$(this))});C.fillOutDropDown(0);for(var B=C.dropDowns_.length-1;B>0;B--){C.clearDropDown(B)}},fillOutDropDown:function(A){var B=this;if(A>=B.dropDowns_.length){return }B.dropDowns_.eq(A).attr("disabled",false).removeClass("fms-inactive");B.submitButton_.attr("disabled","disabled").addClass("fms-inactive");if(!A||A<1){for(key in B.data){B.dropDowns_.eq(0).append('<option value="'+key+'">'+key+"</option>")}}else{if(A===1){for(key in B.data[B.dropDowns_.eq(0).find("option:selected").attr("value")]){B.dropDowns_.eq(1).append('<option value="'+key+'">'+key+"</option>")}}else{for(id in B.data[B.dropDowns_.eq(0).find("option:selected").attr("value")][B.dropDowns_.eq(1).find("option:selected").attr("value")]){for(key in B.data[B.dropDowns_.eq(0).find("option:selected").attr("value")][B.dropDowns_.eq(1).find("option:selected").attr("value")][id]){var C=B.data[B.dropDowns_.eq(0).find("option:selected").attr("value")][B.dropDowns_.eq(1).find("option:selected").attr("value")][id][key];B.dropDowns_.eq(2).append('<option value="'+C+'">'+key+"</option>");if(C.search(/http:.+/)<0){B.dropDowns_.eq(2).find("option:last").attr("disabled","disabled")}}}}}},activateNextDropDown:function(D){var C=this,A=C.dropDowns_.index($(D));if(A>(C.dropDowns_.length-1)){return }else{if(A===(C.dropDowns_.length-1)){C.submitButton_.attr("disabled",false).removeClass("fms-inactive");return }}for(var B=C.dropDowns_.length-1;B>A;B--){C.clearDropDown(B)}if(!D.find("option:selected").attr("disabled")){C.fillOutDropDown(A+1)}},clearDropDown:function(A){var B=this;if(A>=B.dropDowns_.length){return }B.dropDowns_.eq(A).find("option:not(.fms-inactive)").remove();B.dropDowns_.eq(A).find("option.fms-inactive").attr("disabled",false);B.dropDowns_.eq(A).attr("disabled","disabled").addClass("fms-inactive")},handleButtonClick:function(C){var B=this,A=B.dropDowns_.eq(2).find("option:selected");C.cancelBubble=true;C.returnValue=false;C.preventDefault();C.stopPropagation();if(!A||A.attr("disabled")||A.parent().attr("disabled")){return false}window.open(A.attr("value"))}});$(document).ready(function(){$("div.product-finder").each(function(){new com.csg.ProductFinder(this)});com.csg.Page.addBrowserFixStyleSheet("productfinder")});