/*
 * @file
 * @author  Original:      N/A
 * @author  Contributors:  German Escallon Amy Pichardo
 * @date    Created:       August 4 2008
 * @date    Last Edit:     $Date: 2009/10/14 23:02:35 $ by $Author: amyp $
 * Description: This file handles the Modulator Tab.
 *****************************************************************************/
function DisplayModulator(){UpdateCurrentTab("modulator");$("main_div").className="yui-skin-sam";var a='<br/><br/><form id="modulatorForm"><a onclick="return SubmitModulatorForm(document.getElementById(&quot;modulatorForm&quot;));" >   <img src="/images/apply.gif" /></a>&nbsp;&nbsp;&nbsp;<a onclick="return DisplayModulator();">   <img src="/images/cancel.gif" /></a><br/><br/><table width="100%" ><tr><td><table class="general"><tr><td>Encoding:</td><td><select id="qamEncodingDropdown">'+GetSelectOptions("modulator_qamEncoding")+'</select></td><td>Mode:</td><td><select id="qamModeDropdown">'+GetSelectOptions("modulator_qamMode")+'</select></td></tr><tr><td>UpCnv. Channel Number:</td><td><input id="qamChannelNumberTextField" class="inputbox" /></td><td>UpCnv. Power Level:</td><td><select id="qamPowerLevelDropdown">'+GetSelectOptions("modulator_upConvertorPower")+'</select></td></tr></td></table><br/><br/><a onclick="return SubmitModulatorForm(document.getElementById(&quot;modulatorForm&quot;));" >   <img src="/images/apply.gif" /></a>&nbsp;&nbsp;&nbsp;<a onclick="return DisplayModulator();">   <img src="/images/cancel.gif" /></a></form>';$("main_div").innerHTML=a;var b="/myles?req="+Math.random()+"&q=ECMD0+QAM";var c=function(e){if(ParseResponse(e)){$("qamModeDropdown").value=setting.ecmd0_qam_mode;$("qamEncodingDropdown").value=setting.ecmd0_qam_encoding;$("qamChannelNumberTextField").value=setting.ecmd0_qam_channelNumber;$("qamPowerLevelDropdown").value=setting.ecmd0_qam_powerLevel}else{if(_debug){console.log("Modulator Tab parse error")}}};var d={success:c,failure:function(e){if(_debug){console.log("AJAX Error. Modulator settings could not be captured.  Response: "+e.responseText)}}};_yuiConnect.asyncRequest("GET",b,d,null);return false}function SubmitModulatorForm(b){var f,c,a,e;for(var d=0;d<b.length;d++){switch(Trim(b.elements[d].id)){case"qamModeDropdown":f=Trim(b.elements[d].value);break;case"qamEncodingDropdown":c=Trim(b.elements[d].value);break;case"qamPowerLevelDropdown":e=Trim(b.elements[d].value);break;case"qamChannelNumberTextField":a=Trim(b.elements[d].value);break}}var g="/myles?req="+Math.random()+"&q=ECMD0+QAM+MOD_QAM_MODE+"+f+"&q=ECMD0+QAM+MOD_ENCODING+"+c+"&q=ECMD0+QAM+UPCON_POWER_LVL+"+e+"&q=ECMD0+QAM+UPCON_CHANNEL_NUM+"+a;var h=function(i){setTimeout(DisplayModulator,1000);SaveHDMI2QAMSettings();SetInfoMessage("Your new settings have been set",3000,_GREEN)};var j={success:h,failure:function(i){document.body.style.cursor="default";if(_debug){console.log("Modulator form submit failed. Unable to set new values."+i.response)}}};_yuiConnect.asyncRequest("GET",g,j,null);return false}CreateMetaTagElement("modulator");