/*
 * @file
 * @author  Original:      German Escallon
 * @author  Contributors:  N/A
 * @date    Created:       2008/12/29
 * @date    Last Edit:     $Date: 2009/10/02 20:15:05 $ by $Author: germane $
 * Description: This file handles the FEATURES subtab, under UUPGRADE.
 *****************************************************************************/
function DisplayFeatures(){if(_currentTab!="upgrade"){UpdateCurrentTab("upgrade")}UpdateCurrentSubTab("features");var a=' <h3>Features</h3><br />Product ID: <span id="prodIdSpan"></span><br /><br /><div id="featuresDatatable"></div><br /><br /><br />To purchase a key for one of your disabled features, contact your Adtec Sales Representative. <br /><br /><b>Domestic Sales:</b>  Phone 1.615.256.6619  Fax 1.615.256.6593  <a href="mailto:sales@adtecinc.com">sales@adtecinc.com</a><br /><br /><b>International Sales:</b>  Phone +1 (904) 394-0389   Fax +1 (904) 421-0684 <a href="mailto:intlsales@adtecinc.com">intlsales@adtecinc.com</a><br /><br />';$("main_div").innerHTML=a;var c=function(h){if(ParseResponse(h)){$("prodIdSpan").innerHTML=setting.sysd_fe_permId;var g=new YAHOO.util.LocalDataSource(setting.features);g.responseType=YAHOO.util.LocalDataSource.TYPE_JSARRAY;var e=[{key:"name",label:"<b>Name</b>",sortable:true,selected:false,formatter:function(j,i,k,l){j.innerHTML=l}},{key:"status",label:"<b>Status</b>",sortable:true,selected:false,formatter:function(j,i,k,l){j.innerHTML=l;if(l=="ENABLED"){j.style.color=_GREEN}else{if(l=="DISABLED"){j.style.color=_RED}}}},{key:"action",label:"<b>Action</b>",sortable:false,selected:false,formatter:function(j,i,k,l){j.innerHTML='<img src="/images/inputkey.gif" />'}}];var f=new YAHOO.widget.DataTable("featuresDatatable",e,g,{});f.subscribe("cellClickEvent",function(k){var l=YAHOO.util.Event.getTarget(k);var j=this.getColumn(l);var i=this.getRecord(l);switch(j.key){case"action":GetInputKey(i);break;default:break}})}else{if(_debug){console.log("AJAX Error: Features not retrieved")}}};var d={success:c,failure:function(e){if(_debug){console.log("AJAX error in FE command")}}};var b="/myles?req="+Math.random()+"&q=SYSD+FE";_yuiConnect.asyncRequest("GET",b,d,null)}function GetInputKey(a){var b=prompt("Please enter the KEY to enable/disable "+a.getData("name"));if(b!==null){if(IsValidFeatureKey(b)){SubmitFeatureRequest(a,b)}}}function SubmitFeatureRequest(a,b){var c="/myles?req="+Math.random()+"&q="+a.getData("handler")+"+FEA+"+a.getData("name")+"+"+b;var d=function(g){var f=(g.responseText).toUpperCase();var h=f.search("ERROR-");if(h!=-1){SetInfoMessage(f.substring(h),_DEFAULT_INFO_MSG_TIMEOUT,_RED)}else{SetInfoMessage("Status of "+a.getData("name")+" succesfully changed",_DEFAULT_INFO_MSG_TIMEOUT,_GREEN);GetAdtecFeatures();setTimeout(DisplayFeatures,500)}};var e={success:d,failure:function(f){if(_debug){console.log("Status change in feature could not be changed")}}};_yuiConnect.asyncRequest("GET",c,e,null)}function IsValidFeatureKey(a){return true}CreateMetaTagElement("features");