if (document.all) Node = { ELEMENT_NODE: 1 };

var doneToggle = {};
function selectedFsDetail(recCnt) {	
    
    if (doneToggle[recCnt] != undefined) {
        if (!doneToggle[recCnt]) return;
    }

    var fsImgShown = document.images["fsDetailsImg" + recCnt];
    if (fsImgShown){
        doneToggle[recCnt] = false;
       if (fsImgShown.src.indexOf("/images/ptools/fs/prodpage/warranty-phone-1.gif")>0){
          fsImgShown.src = "/images/ptools/fs/prodpage/warranty-phone-2.gif";
       } else if (fsImgShown.src.indexOf("/images/ptools/fs/prodpage/warranty-esp-1.gif")>0){
          fsImgShown.src = "/images/ptools/fs/prodpage/warranty-esp-2.gif";
       } else if (fsImgShown.src.indexOf("/images/ptools/fs/prodpage/warranty-phone-2.gif")>0){
          fsImgShown.src = "/images/ptools/fs/prodpage/warranty-phone-1.gif";
       }else if (fsImgShown.src.indexOf("/images/ptools/fs/prodpage/warranty-esp-2.gif")>0){
          fsImgShown.src = "/images/ptools/fs/prodpage/warranty-esp-1.gif";
       }
       if (document.getElementById('fsDetail'+recCnt)) {
      	  if (document.getElementById('fsDetail'+recCnt).innerHTML.indexOf("Chosen") == -1 ){
            this.fsDetail     = document.getElementById('fsDetail'+recCnt);
            Effect.toggle(this.fsDetail,'appear',{duration:0.8,
                                                  afterFinish: function() {
                                                                            doneToggle[recCnt] = true;
                                                                          }});
          }
       }
    }
    

	
}

function showFsDetail(recCnt,val) {	
    var fsDetail = $('fsDetail'+recCnt);
    if (fsDetail) {
        if (val == 0) {
            if (!fsDetail.visible()) return;
        } else {
            if (fsDetail.visible()) return;
        }
  
        if (document.getElementById('fsSelectedPlan'+recCnt)) {
        	if (document.getElementById('fsSelectedPlan'+recCnt).innerHTML.indexOf("Chosen") > -1 ){
    	        return;
    	    }
        }
    
        selectedFsDetail(recCnt);
    }
}

function closeFsDetail(recCnt) {	
    
    var fsImgShown = document.images["fsDetailsImg" + recCnt];
    if (fsImgShown == null){
    	return;
    }
    if (fsImgShown.src.indexOf("/images/prodpage/warranty-phone-2.gif")>0){
          fsImgShown.src = "/images/prodpage/warranty-phone-1.gif";
    }else if (fsImgShown.src.indexOf("/images/prodpage/warranty-esp-2.gif")>0){
          fsImgShown.src = "/images/prodpage/warranty-esp-1.gif";
    }

    if (document.getElementById('fsDetail'+recCnt)) {
    	if (document.getElementById('fsDetail'+recCnt).style.display == "" ){
            this.fsDetail = document.getElementById('fsDetail'+recCnt);
            Effect.toggle(this.fsDetail,'appear',{duration:0.8});
        }
    }
	
}



