<?php 

session_start();

if(!$_SESSION['login']){
	header("Location: login.php");
}
if(!in_array($_SESSION['device_id'],['nq-mix','nq-amp2c','nq-amp4c','nq-s810v2','nq-wbc','nq-ga20p2','nq-nqpaxxx','nq-amp2c-g2','nq-amp4c-g2','nq-edp01','nq-ga400p','nq-ga40p3','nq-ser20p2','nq-dsc01'])){
	header("Location: index.php");
}

// load in the dsp json data
$data_file = '';
$json_type = '';
if($_SESSION['device_id']=='nq-mix'){
	$data_file = file_get_contents("/etc/nyquist/mixer.json");
	$json_type = 'Mixer';
}
if($_SESSION['device_id']=='nq-amp2c'){
	$data_file = file_get_contents("/etc/nyquist/amp2c.json");
	$json_type = 'ampg1_2c';
}
if($_SESSION['device_id']=='nq-amp4c'){
	$data_file = file_get_contents("/etc/nyquist/amp4c.json");
	$json_type = 'ampg1_4c';
}
if($_SESSION['device_id']=='nq-s810v2'){
	$data_file = file_get_contents("/etc/nyquist/s810v2.json");
	$json_type = 's810v2';
}
if($_SESSION['device_id']=='nq-wbc'){
	$data_file = file_get_contents("/etc/nyquist/s810v2.json");
	$json_type = 's810v2';
}
if($_SESSION['device_id']=='nq-dsc01'){
	$data_file = file_get_contents("/etc/nyquist/nq-dsc01.json");
	$json_type = 'nq-dsc01';
}
if($_SESSION['device_id']=='nq-ga20p2'){
	$data_file = file_get_contents("/etc/nyquist/ga20p.json");
	$json_type = 'nqga20';
}
if($_SESSION['device_id']=='nq-nqpaxxx'){
	$data_file = file_get_contents("/etc/nyquist/pama.json");
	$json_type = 'nqpaxxx';
}
if($_SESSION['device_id']=='nq-amp2c-g2'){
	$data_file = file_get_contents("/etc/nyquist/ampg2_2c.json");
	$json_type = 'ampg2_2c';
}
if($_SESSION['device_id']=='nq-amp4c-g2'){
	$data_file = file_get_contents("/etc/nyquist/ampg2_4c.json");
	$json_type = 'ampg2_4c';
}
if($_SESSION['device_id']=='nq-edp01'){
	$data_file = file_get_contents("/etc/nyquist/edp01.json");
	$json_type = 'edp01';
}
if($_SESSION['device_id']=='nq-ga400p'){
	$data_file = file_get_contents("/etc/nyquist/ga400p.json");
	$json_type = 'nqga400p';
}
if($_SESSION['device_id']=='nq-ga40p3'){
	$data_file = file_get_contents("/etc/nyquist/ga40p.json");
	$json_type = 'nqga40';
}
$dataArray = json_decode($data_file,true);

if($_SESSION['device_id']=='nq-mix'){
	$dataArray2 = $dataArray["Mixer"];
}
if($_SESSION['device_id']=='nq-amp2c'){
	$dataArray2 = $dataArray["ampg1_2c"];
}
if($_SESSION['device_id']=='nq-amp4c'){
	$dataArray2 = $dataArray["ampg1_4c"];
}
if($_SESSION['device_id']=='nq-s810v2'){
	$dataArray2 = $dataArray["s810v2"];
}
if($_SESSION['device_id']=='nq-wbc'){
	$dataArray2 = $dataArray["s810v2"];
}
if($_SESSION['device_id']=='nq-dsc01'){
	$dataArray2 = $dataArray["nqdsc01"];
}
if($_SESSION['device_id']=='nq-ga20p2'){
	$dataArray2 = $dataArray["nqga20"];
}
if($_SESSION['device_id']=='nq-nqpaxxx'){
	$dataArray2 = $dataArray["nqpaxxx"];
}
if($_SESSION['device_id']=='nq-amp2c-g2'){
	$dataArray2 = $dataArray["ampg2_2c"];
}
if($_SESSION['device_id']=='nq-amp4c-g2'){
	$dataArray2 = $dataArray["ampg2_4c"];
}
if($_SESSION['device_id']=='nq-edp01'){
	$dataArray2 = $dataArray["edp01"];
}
if($_SESSION['device_id']=='nq-ga400p'){
	$dataArray2 = $dataArray["nqga400p"];
}
if($_SESSION['device_id']=='nq-ga40p3'){
	$dataArray2 = $dataArray["nqga40"];
}

$colorsArray = array('aqua','blue','green','grey','orange','pink','purple','red','yellow');

if($json_type=='Mixer'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["In3"]["Mute"]["Mute"];
	$mute4 = $dataArray2["In4"]["Mute"]["Mute"];
	$mute6 = $dataArray2["In5"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["In3"]["Volume"]["Volume"]; 
	$volume4 = $dataArray2["In4"]["Volume"]["Volume"];
	$volume5 = $dataArray2["Out5"]["Volume"]["Volume"];
	$volume6 = $dataArray2["In5"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["In3"]["Name"];
	$name4 = $dataArray2["In4"]["Name"];
	$name5 = $dataArray2["Out5"]["Name"];
	$name6 = $dataArray2["In5"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["In3"]["Color"];
	$color4 = $dataArray2["In4"]["Color"];
	$color5 = $dataArray2["Out5"]["Color"];
	$color6 = $dataArray2["In5"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	$level3 = $dataArray2["In3"]["Level"]["Value"];
	$level4 = $dataArray2["In4"]["Level"]["Value"];
	$level5 = $dataArray2["Out5"]["Level"]["Value"];
	$level6 = $dataArray2["In5"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	$levelIn3 = $dataArray2["In3"]["LevelIn"]["Value"];
	$levelIn4 = $dataArray2["In4"]["LevelIn"]["Value"];
	$levelIn5 = $dataArray2["In5"]["LevelIn"]["Value"];
	
	$Threshold_limiter5 = $dataArray2["Out5"]["Limiter"]["Threshold"];
	$Decay_limiter5 = $dataArray2["Out5"]["Limiter"]["Decay"];
	$RMSTC_limiter5 = $dataArray2["Out5"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_limiter3 = $dataArray2["In3"]["Limiter"]["Threshold"];
	$Decay_limiter3 = $dataArray2["In3"]["Limiter"]["Decay"];
	$RMSTC_limiter3 = $dataArray2["In3"]["Limiter"]["RMSTC"];

	$Threshold_limiter4 = $dataArray2["In4"]["Limiter"]["Threshold"];
	$Decay_limiter4 = $dataArray2["In4"]["Limiter"]["Decay"];
	$RMSTC_limiter4 = $dataArray2["In4"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter6 = $dataArray2["In5"]["Limiter"]["Threshold"];
	$Decay_limiter6 = $dataArray2["In5"]["Limiter"]["Decay"];
	$RMSTC_limiter6 = $dataArray2["In5"]["Limiter"]["RMSTC"];
	
	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["In3"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["In3"]["Detect"]["Trigger"];

	$Threshold_signal_present4 = $dataArray2["In4"]["Detect"]["Threshold"];
	$Trigger_signal_present4 = $dataArray2["In4"]["Detect"]["Trigger"];

	$Threshold_signal_present5 = $dataArray2["Out5"]["Detect"]["Threshold"];
	$Trigger_signal_present5 = $dataArray2["Out5"]["Detect"]["Trigger"];
	
	$Threshold_signal_present6 = $dataArray2["In5"]["Detect"]["Threshold"];
	$Trigger_signal_present6 = $dataArray2["In5"]["Detect"]["Trigger"];
	
	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];

	$Enabled_compressor3 = $dataArray2["In3"]["Compressor"]["Enable"];
	$Threshold_compressor3 = $dataArray2["In3"]["Compressor"]["Threshold"];
	$Attack_compressor3 = $dataArray2["In3"]["Compressor"]["Attack"];
	$Hold_compressor3 = $dataArray2["In3"]["Compressor"]["Hold"];
	$Decay_compressor3 = $dataArray2["In3"]["Compressor"]["Decay"];
	$Knee_compressor3 = $dataArray2["In3"]["Compressor"]["Knee"];
	$Ratio_compressor3 = $dataArray2["In3"]["Compressor"]["Ratio"];

	$Enabled_compressor4 = $dataArray2["In4"]["Compressor"]["Enable"];
	$Threshold_compressor4 = $dataArray2["In4"]["Compressor"]["Threshold"];
	$Attack_compressor4 = $dataArray2["In4"]["Compressor"]["Attack"];
	$Hold_compressor4 = $dataArray2["In4"]["Compressor"]["Hold"];
	$Decay_compressor4 = $dataArray2["In4"]["Compressor"]["Decay"];
	$Knee_compressor4 = $dataArray2["In4"]["Compressor"]["Knee"];
	$Ratio_compressor4 = $dataArray2["In4"]["Compressor"]["Ratio"];

	$Enabled_compressor5 = $dataArray2["In5"]["Compressor"]["Enable"];
	$Threshold_compressor5 = $dataArray2["In5"]["Compressor"]["Threshold"];
	$Attack_compressor5 = $dataArray2["In5"]["Compressor"]["Attack"];
	$Hold_compressor5 = $dataArray2["In5"]["Compressor"]["Hold"];
	$Decay_compressor5 = $dataArray2["In5"]["Compressor"]["Decay"];
	$Knee_compressor5 = $dataArray2["In5"]["Compressor"]["Knee"];
	$Ratio_compressor5 = $dataArray2["In5"]["Compressor"]["Ratio"];
	
	$Enabled_compressor6 = $dataArray2["In5"]["Compressor"]["Enable"];
	$Threshold_compressor6 = $dataArray2["In5"]["Compressor"]["Threshold"];
	$Attack_compressor6 = $dataArray2["In5"]["Compressor"]["Attack"];
	$Hold_compressor6 = $dataArray2["In5"]["Compressor"]["Hold"];
	$Decay_compressor6 = $dataArray2["In5"]["Compressor"]["Decay"];
	$Knee_compressor6 = $dataArray2["In5"]["Compressor"]["Knee"];
	$Ratio_compressor6 = $dataArray2["In5"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Attack"];
	$Hold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Hold"];
	$Decay_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Attack"];
	$Hold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Hold"];
	$Decay_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Decay"];
	
	$Enabled_noise_gate6 = $dataArray2["In5"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate6 = $dataArray2["In5"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate6 = $dataArray2["In5"]["Noise Gate"]["Attack"];
	$Hold_noise_gate6 = $dataArray2["In5"]["Noise Gate"]["Hold"];
	$Decay_noise_gate6 = $dataArray2["In5"]["Noise Gate"]["Decay"];
	
	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];
	$Frequency_hp3 = $dataArray2["In3"]["HP"]["Frequency"];
	$Frequency_hp4 = $dataArray2["In4"]["HP"]["Frequency"];
	$Frequency_hp6 = $dataArray2["In5"]["HP"]["Frequency"];

	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];
	$Frequency_lp3 = $dataArray2["In3"]["LP"]["Frequency"];
	$Frequency_lp4 = $dataArray2["In4"]["LP"]["Frequency"];
	$Frequency_lp6 = $dataArray2["In5"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];
	$Enabled_hp3 = $dataArray2["In3"]["HP"]["Enable"];
	$Enabled_hp4 = $dataArray2["In4"]["HP"]["Enable"];
	$Enabled_hp6 = $dataArray2["In5"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];
	$Enabled_lp3 = $dataArray2["In3"]["LP"]["Enable"];
	$Enabled_lp4 = $dataArray2["In4"]["LP"]["Enable"];
	$Enabled_lp6 = $dataArray2["In5"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];
	$Type_hp3 = $dataArray2["In3"]["HP"]["Type"];
	$Type_hp4 = $dataArray2["In4"]["HP"]["Type"];
	$Type_hp6 = $dataArray2["In5"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	$Type_lp3 = $dataArray2["In3"]["LP"]["Type"];
	$Type_lp4 = $dataArray2["In4"]["LP"]["Type"];
	$Type_lp6 = $dataArray2["In5"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$GEQ25HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ6_fader = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ6_enable = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);

	$S13_fader = round( $dataArray2["In3"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["In3"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["In3"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["In3"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["In3"]["EQP"]["S5"]["Boost"],2);
	$S63_fader = round( $dataArray2["In3"]["EQP"]["S6"]["Boost"],2);
	$S73_fader = round( $dataArray2["In3"]["EQP"]["S7"]["Boost"],2);

	$S13_enable = $dataArray2["In3"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["In3"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["In3"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["In3"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["In3"]["EQP"]["S5"]["Enable"];
	$S63_enable = $dataArray2["In3"]["EQP"]["S6"]["Enable"];
	$S73_enable = $dataArray2["In3"]["EQP"]["S7"]["Enable"];

	$S13_freq = $dataArray2["In3"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["In3"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["In3"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["In3"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["In3"]["EQP"]["S5"]["Frequency"];
	$S63_freq = $dataArray2["In3"]["EQP"]["S6"]["Frequency"];
	$S73_freq = $dataArray2["In3"]["EQP"]["S7"]["Frequency"];

	$S13_q =  round( $dataArray2["In3"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["In3"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["In3"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["In3"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["In3"]["EQP"]["S5"]["Q"],1);
	$S63_q =  round( $dataArray2["In3"]["EQP"]["S6"]["Q"],1);
	$S73_q =  round( $dataArray2["In3"]["EQP"]["S7"]["Q"],1);

	$S14_fader = round( $dataArray2["In4"]["EQP"]["S1"]["Boost"],2);
	$S24_fader = round( $dataArray2["In4"]["EQP"]["S2"]["Boost"],2);
	$S34_fader = round( $dataArray2["In4"]["EQP"]["S3"]["Boost"],2);
	$S44_fader = round( $dataArray2["In4"]["EQP"]["S4"]["Boost"],2);
	$S54_fader = round( $dataArray2["In4"]["EQP"]["S5"]["Boost"],2);
	$S64_fader = round( $dataArray2["In4"]["EQP"]["S6"]["Boost"],2);
	$S74_fader = round( $dataArray2["In4"]["EQP"]["S7"]["Boost"],2);

	$S14_enable = $dataArray2["In4"]["EQP"]["S1"]["Enable"];
	$S24_enable = $dataArray2["In4"]["EQP"]["S2"]["Enable"];
	$S34_enable = $dataArray2["In4"]["EQP"]["S3"]["Enable"];
	$S44_enable = $dataArray2["In4"]["EQP"]["S4"]["Enable"];
	$S54_enable = $dataArray2["In4"]["EQP"]["S5"]["Enable"];
	$S64_enable = $dataArray2["In4"]["EQP"]["S6"]["Enable"];
	$S74_enable = $dataArray2["In4"]["EQP"]["S7"]["Enable"];

	$S14_freq = $dataArray2["In4"]["EQP"]["S1"]["Frequency"];
	$S24_freq = $dataArray2["In4"]["EQP"]["S2"]["Frequency"];
	$S34_freq = $dataArray2["In4"]["EQP"]["S3"]["Frequency"];
	$S44_freq = $dataArray2["In4"]["EQP"]["S4"]["Frequency"];
	$S54_freq = $dataArray2["In4"]["EQP"]["S5"]["Frequency"];
	$S64_freq = $dataArray2["In4"]["EQP"]["S6"]["Frequency"];
	$S74_freq = $dataArray2["In4"]["EQP"]["S7"]["Frequency"];

	$S14_q =  round( $dataArray2["In4"]["EQP"]["S1"]["Q"],1);
	$S24_q =  round( $dataArray2["In4"]["EQP"]["S2"]["Q"],1);
	$S34_q =  round( $dataArray2["In4"]["EQP"]["S3"]["Q"],1);
	$S44_q =  round( $dataArray2["In4"]["EQP"]["S4"]["Q"],1);
	$S54_q =  round( $dataArray2["In4"]["EQP"]["S5"]["Q"],1);
	$S64_q =  round( $dataArray2["In4"]["EQP"]["S6"]["Q"],1);
	$S74_q =  round( $dataArray2["In4"]["EQP"]["S7"]["Q"],1);
	
	$S16_fader = round( $dataArray2["In5"]["EQP"]["S1"]["Boost"],2);
	$S26_fader = round( $dataArray2["In5"]["EQP"]["S2"]["Boost"],2);
	$S36_fader = round( $dataArray2["In5"]["EQP"]["S3"]["Boost"],2);
	$S46_fader = round( $dataArray2["In5"]["EQP"]["S4"]["Boost"],2);
	$S56_fader = round( $dataArray2["In5"]["EQP"]["S5"]["Boost"],2);
	$S66_fader = round( $dataArray2["In5"]["EQP"]["S6"]["Boost"],2);
	$S76_fader = round( $dataArray2["In5"]["EQP"]["S7"]["Boost"],2);

	$S16_enable = $dataArray2["In5"]["EQP"]["S1"]["Enable"];
	$S26_enable = $dataArray2["In5"]["EQP"]["S2"]["Enable"];
	$S36_enable = $dataArray2["In5"]["EQP"]["S3"]["Enable"];
	$S46_enable = $dataArray2["In5"]["EQP"]["S4"]["Enable"];
	$S56_enable = $dataArray2["In5"]["EQP"]["S5"]["Enable"];
	$S66_enable = $dataArray2["In5"]["EQP"]["S6"]["Enable"];
	$S76_enable = $dataArray2["In5"]["EQP"]["S7"]["Enable"];

	$S16_freq = $dataArray2["In5"]["EQP"]["S1"]["Frequency"];
	$S26_freq = $dataArray2["In5"]["EQP"]["S2"]["Frequency"];
	$S36_freq = $dataArray2["In5"]["EQP"]["S3"]["Frequency"];
	$S46_freq = $dataArray2["In5"]["EQP"]["S4"]["Frequency"];
	$S56_freq = $dataArray2["In5"]["EQP"]["S5"]["Frequency"];
	$S66_freq = $dataArray2["In5"]["EQP"]["S6"]["Frequency"];
	$S76_freq = $dataArray2["In5"]["EQP"]["S7"]["Frequency"];

	$S16_q =  round( $dataArray2["In5"]["EQP"]["S1"]["Q"],1);
	$S26_q =  round( $dataArray2["In5"]["EQP"]["S2"]["Q"],1);
	$S36_q =  round( $dataArray2["In5"]["EQP"]["S3"]["Q"],1);
	$S46_q =  round( $dataArray2["In5"]["EQP"]["S4"]["Q"],1);
	$S56_q =  round( $dataArray2["In5"]["EQP"]["S5"]["Q"],1);
	$S66_q =  round( $dataArray2["In5"]["EQP"]["S6"]["Q"],1);
	$S76_q =  round( $dataArray2["In5"]["EQP"]["S7"]["Q"],1);
}
if($json_type=='ampg1_2c'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["In5"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["In5"]["Volume"]["Volume"]; 
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["In5"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["In5"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	$level3 = $dataArray2["In5"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	$levelIn3 = $dataArray2["In5"]["LevelIn"]["Value"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_limiter3 = $dataArray2["In5"]["Limiter"]["Threshold"];
	$Decay_limiter3 = $dataArray2["In5"]["Limiter"]["Decay"];
	$RMSTC_limiter3 = $dataArray2["In5"]["Limiter"]["RMSTC"];

	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["In5"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["In5"]["Detect"]["Trigger"];
	
	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];

	$Enabled_compressor3 = $dataArray2["In5"]["Compressor"]["Enable"];
	$Threshold_compressor3 = $dataArray2["In5"]["Compressor"]["Threshold"];
	$Attack_compressor3 = $dataArray2["In5"]["Compressor"]["Attack"];
	$Hold_compressor3 = $dataArray2["In5"]["Compressor"]["Hold"];
	$Decay_compressor3 = $dataArray2["In5"]["Compressor"]["Decay"];
	$Knee_compressor3 = $dataArray2["In5"]["Compressor"]["Knee"];
	$Ratio_compressor3 = $dataArray2["In5"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate3 = $dataArray2["In5"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate3 = $dataArray2["In5"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate3 = $dataArray2["In5"]["Noise Gate"]["Attack"];
	$Hold_noise_gate3 = $dataArray2["In5"]["Noise Gate"]["Hold"];
	$Decay_noise_gate3 = $dataArray2["In5"]["Noise Gate"]["Decay"];
	
	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];
	$Frequency_hp3 = $dataArray2["In5"]["HP"]["Frequency"];

	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];
	$Frequency_lp3 = $dataArray2["In5"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];
	$Enabled_hp3 = $dataArray2["In5"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];
	$Enabled_lp3 = $dataArray2["In5"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];
	$Type_hp3 = $dataArray2["In5"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	$Type_lp3 = $dataArray2["In5"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ3_fader = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ3_enable = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);

	$S13_fader = round( $dataArray2["In5"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["In5"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["In5"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["In5"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["In5"]["EQP"]["S5"]["Boost"],2);
	$S63_fader = round( $dataArray2["In5"]["EQP"]["S6"]["Boost"],2);
	$S73_fader = round( $dataArray2["In5"]["EQP"]["S7"]["Boost"],2);

	$S13_enable = $dataArray2["In5"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["In5"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["In5"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["In5"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["In5"]["EQP"]["S5"]["Enable"];
	$S63_enable = $dataArray2["In5"]["EQP"]["S6"]["Enable"];
	$S73_enable = $dataArray2["In5"]["EQP"]["S7"]["Enable"];

	$S13_freq = $dataArray2["In5"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["In5"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["In5"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["In5"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["In5"]["EQP"]["S5"]["Frequency"];
	$S63_freq = $dataArray2["In5"]["EQP"]["S6"]["Frequency"];
	$S73_freq = $dataArray2["In5"]["EQP"]["S7"]["Frequency"];

	$S13_q =  round( $dataArray2["In5"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["In5"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["In5"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["In5"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["In5"]["EQP"]["S5"]["Q"],1);
	$S63_q =  round( $dataArray2["In5"]["EQP"]["S6"]["Q"],1);
	$S73_q =  round( $dataArray2["In5"]["EQP"]["S7"]["Q"],1);
	
	$AnalogModeCH1 = $dataArray2["AnalogModeCH1"];
	$AnalogModeCH2 = $dataArray2["AnalogModeCH2"];
	
	$Delay_delay1 = $dataArray2["In1"]["Delay"]["Delay"];
	$Delay_delay2 = $dataArray2["In2"]["Delay"]["Delay"];
	
	$Phase_invert1 = $dataArray2["In1"]["PhaseInvert"]["Invert"];
	$Phase_invert2 = $dataArray2["In2"]["PhaseInvert"]["Invert"];
	
	$preset1 = $dataArray2["In1"]["PresetName"];
	$preset2 = $dataArray2["In2"]["PresetName"];
	$AmpPresets = $dataArray2["Presets"]["PresetList"];
	
	$Enabled_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Decay"];
	
	$Enabled_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Decay"];	
	
	$Enabled_standby = $dataArray2["Standby"];
	$Threshold_standby_ab = $dataArray2["DetectAB"]["Threshold"];
	$Threshold_standby_cd = '';
}

if($json_type=='ampg1_4c'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["In3"]["Mute"]["Mute"];
	$mute4 = $dataArray2["In4"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["In3"]["Volume"]["Volume"];
	$volume4 = $dataArray2["In4"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["In3"]["Name"];
	$name4 = $dataArray2["In4"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["In3"]["Color"];
	$color4 = $dataArray2["In4"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	$level3 = $dataArray2["In3"]["Level"]["Value"];
	$level4 = $dataArray2["In4"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	$levelIn3 = $dataArray2["In3"]["LevelIn"]["Value"];
	$levelIn4 = $dataArray2["In4"]["LevelIn"]["Value"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_limiter3 = $dataArray2["In3"]["Limiter"]["Threshold"];
	$Decay_limiter3 = $dataArray2["In3"]["Limiter"]["Decay"];
	$RMSTC_limiter3 = $dataArray2["In3"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter4 = $dataArray2["In4"]["Limiter"]["Threshold"];
	$Decay_limiter4 = $dataArray2["In4"]["Limiter"]["Decay"];
	$RMSTC_limiter4 = $dataArray2["In4"]["Limiter"]["RMSTC"];

	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["In3"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["In3"]["Detect"]["Trigger"];
	
	$Threshold_signal_present4 = $dataArray2["In4"]["Detect"]["Threshold"];
	$Trigger_signal_present4 = $dataArray2["In4"]["Detect"]["Trigger"];

	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];

	$Enabled_compressor3 = $dataArray2["In3"]["Compressor"]["Enable"];
	$Threshold_compressor3 = $dataArray2["In3"]["Compressor"]["Threshold"];
	$Attack_compressor3 = $dataArray2["In3"]["Compressor"]["Attack"];
	$Hold_compressor3 = $dataArray2["In3"]["Compressor"]["Hold"];
	$Decay_compressor3 = $dataArray2["In3"]["Compressor"]["Decay"];
	$Knee_compressor3 = $dataArray2["In3"]["Compressor"]["Knee"];
	$Ratio_compressor3 = $dataArray2["In3"]["Compressor"]["Ratio"];
	
	$Enabled_compressor4 = $dataArray2["In4"]["Compressor"]["Enable"];
	$Threshold_compressor4 = $dataArray2["In4"]["Compressor"]["Threshold"];
	$Attack_compressor4 = $dataArray2["In4"]["Compressor"]["Attack"];
	$Hold_compressor4 = $dataArray2["In4"]["Compressor"]["Hold"];
	$Decay_compressor4 = $dataArray2["In4"]["Compressor"]["Decay"];
	$Knee_compressor4 = $dataArray2["In4"]["Compressor"]["Knee"];
	$Ratio_compressor4 = $dataArray2["In4"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Attack"];
	$Hold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Hold"];
	$Decay_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Decay"];
	
	$Enabled_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Attack"];
	$Hold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Hold"];
	$Decay_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Decay"];
	
	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];
	$Frequency_hp3 = $dataArray2["In3"]["HP"]["Frequency"];
	$Frequency_hp4 = $dataArray2["In4"]["HP"]["Frequency"];
	
	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];
	$Frequency_lp3 = $dataArray2["In3"]["LP"]["Frequency"];
	$Frequency_lp4 = $dataArray2["In4"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];
	$Enabled_hp3 = $dataArray2["In3"]["HP"]["Enable"];
	$Enabled_hp4 = $dataArray2["In4"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];
	$Enabled_lp3 = $dataArray2["In3"]["LP"]["Enable"];
	$Enabled_lp4 = $dataArray2["In4"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];
	$Type_hp3 = $dataArray2["In3"]["HP"]["Type"];
	$Type_hp4 = $dataArray2["In4"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	$Type_lp3 = $dataArray2["In3"]["LP"]["Type"];
	$Type_lp4 = $dataArray2["In4"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$GEQ25HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);

	$S13_fader = round( $dataArray2["In3"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["In3"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["In3"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["In3"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["In3"]["EQP"]["S5"]["Boost"],2);
	$S63_fader = round( $dataArray2["In3"]["EQP"]["S6"]["Boost"],2);
	$S73_fader = round( $dataArray2["In3"]["EQP"]["S7"]["Boost"],2);

	$S13_enable = $dataArray2["In3"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["In3"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["In3"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["In3"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["In3"]["EQP"]["S5"]["Enable"];
	$S63_enable = $dataArray2["In3"]["EQP"]["S6"]["Enable"];
	$S73_enable = $dataArray2["In3"]["EQP"]["S7"]["Enable"];

	$S13_freq = $dataArray2["In3"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["In3"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["In3"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["In3"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["In3"]["EQP"]["S5"]["Frequency"];
	$S63_freq = $dataArray2["In3"]["EQP"]["S6"]["Frequency"];
	$S73_freq = $dataArray2["In3"]["EQP"]["S7"]["Frequency"];

	$S13_q =  round( $dataArray2["In3"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["In3"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["In3"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["In3"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["In3"]["EQP"]["S5"]["Q"],1);
	$S63_q =  round( $dataArray2["In3"]["EQP"]["S6"]["Q"],1);
	$S73_q =  round( $dataArray2["In3"]["EQP"]["S7"]["Q"],1);
	
	$S14_fader = round($dataArray2["In4"]["EQP"]["S1"]["Boost"],2);
	$S24_fader = round($dataArray2["In4"]["EQP"]["S2"]["Boost"],2);
	$S34_fader = round($dataArray2["In4"]["EQP"]["S3"]["Boost"],2);
	$S44_fader = round($dataArray2["In4"]["EQP"]["S4"]["Boost"],2);
	$S54_fader = round($dataArray2["In4"]["EQP"]["S5"]["Boost"],2);
	$S64_fader = round($dataArray2["In4"]["EQP"]["S6"]["Boost"],2);
	$S74_fader = round($dataArray2["In4"]["EQP"]["S7"]["Boost"],2);

	$S14_enable = $dataArray2["In4"]["EQP"]["S1"]["Enable"];
	$S24_enable = $dataArray2["In4"]["EQP"]["S2"]["Enable"];
	$S34_enable = $dataArray2["In4"]["EQP"]["S3"]["Enable"];
	$S44_enable = $dataArray2["In4"]["EQP"]["S4"]["Enable"];
	$S54_enable = $dataArray2["In4"]["EQP"]["S5"]["Enable"];
	$S64_enable = $dataArray2["In4"]["EQP"]["S6"]["Enable"];
	$S74_enable = $dataArray2["In4"]["EQP"]["S7"]["Enable"];

	$S14_freq = $dataArray2["In4"]["EQP"]["S1"]["Frequency"];
	$S24_freq = $dataArray2["In4"]["EQP"]["S2"]["Frequency"];
	$S34_freq = $dataArray2["In4"]["EQP"]["S3"]["Frequency"];
	$S44_freq = $dataArray2["In4"]["EQP"]["S4"]["Frequency"];
	$S54_freq = $dataArray2["In4"]["EQP"]["S5"]["Frequency"];
	$S64_freq = $dataArray2["In4"]["EQP"]["S6"]["Frequency"];
	$S74_freq = $dataArray2["In4"]["EQP"]["S7"]["Frequency"];

	$S14_q =  round( $dataArray2["In4"]["EQP"]["S1"]["Q"],1);
	$S24_q =  round( $dataArray2["In4"]["EQP"]["S2"]["Q"],1);
	$S34_q =  round( $dataArray2["In4"]["EQP"]["S3"]["Q"],1);
	$S44_q =  round( $dataArray2["In4"]["EQP"]["S4"]["Q"],1);
	$S54_q =  round( $dataArray2["In4"]["EQP"]["S5"]["Q"],1);
	$S64_q =  round( $dataArray2["In4"]["EQP"]["S6"]["Q"],1);
	$S74_q =  round( $dataArray2["In4"]["EQP"]["S7"]["Q"],1);
	
	$AnalogModeCH1 = $dataArray2["AnalogModeCH1"];
	$AnalogModeCH2 = $dataArray2["AnalogModeCH2"];
	$AnalogModeCH3 = $dataArray2["AnalogModeCH3"];
	$AnalogModeCH4 = $dataArray2["AnalogModeCH4"];
		
	$Delay_delay1 = $dataArray2["In1"]["Delay"]["Delay"];
	$Delay_delay2 = $dataArray2["In2"]["Delay"]["Delay"];
	$Delay_delay3 = $dataArray2["In3"]["Delay"]["Delay"];
	$Delay_delay4 = $dataArray2["In4"]["Delay"]["Delay"];
	
	$Phase_invert1 = $dataArray2["In1"]["PhaseInvert"]["Invert"];
	$Phase_invert2 = $dataArray2["In2"]["PhaseInvert"]["Invert"];
	$Phase_invert3 = $dataArray2["In3"]["PhaseInvert"]["Invert"];
	$Phase_invert4 = $dataArray2["In4"]["PhaseInvert"]["Invert"];
	
	$preset1 = $dataArray2["In1"]["PresetName"];
	$preset2 = $dataArray2["In2"]["PresetName"];
	$preset3 = $dataArray2["In3"]["PresetName"];
	$preset4 = $dataArray2["In4"]["PresetName"];
	$AmpPresets = $dataArray2["Presets"]["PresetList"];
	
	$Enabled_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Decay"];
	
	$Enabled_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Decay"];
	
	$Enabled_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Decay"];
	
	$Enabled_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Decay"];
	
	$Enabled_standby = $dataArray2["Standby"];
	$Threshold_standby_ab = $dataArray2["DetectAB"]["Threshold"];
	$Threshold_standby_cd = $dataArray2["DetectCD"]["Threshold"];
}

if($json_type=='s810v2'){
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"];
	$level1 = '0';
	$levelIn1 = '0';
	
	$Threshold_compressor_duplexer = $dataArray2["Compressor"]["Threshold"];
	$Threshold_noise_gate_duplexer = $dataArray2["Speaker Threshold"]["Volume"];
	$talkback_threshold_duplexer = $dataArray2["In1"]["Talkback Threshold"]["Volume"];
	$talkback_decay_duplexer = $dataArray2["In1"]["Peak Envelope"]["Decay"];
	$preset_selected = $dataArray2["Preset"]["Selected"];
	$preset_list = $dataArray2["Preset"]["List"];
}

if($json_type=='nq-dsc01'){
	
	$volume1 = $dataArray2["InputChannel"]["Volume"]["Volume"];
	$level1 = '0';
	$levelIn1 = '0';
	$color1 = $dataArray2["InputChannel"]["Color"];
	if($color1=='Default'){
		$color1 = 'grey';
	}
	if(in_array($color1,$colorsArray)){
	} else {
		$color1 = 'grey';
	}
	if(in_array($color2,$colorsArray)){
	} else {
		$color2 = 'grey';
	}
	
	$name1 = $dataArray2["InputChannel"]["Name"];
	if($name1=='Default'){
		$name1 = 'Input';
	}
	$volume2 = $dataArray2["Ch1"]["Volume"]["Volume"]; 
	$level2 = '0';
	$levelIn2 = '0';
	$color2 = $dataArray2["Ch1"]["Color"];
	if($color2=='Default'){
		$color2 = 'grey';
	}
	$name2 = $dataArray2["Ch1"]["Name"];
	if($name2=='Default'){
		$name2 = 'Output';
	}
	
	$Threshold_noise_gate_duplexer = $dataArray2["Speaker Threshold"]["Volume"];
	$talkback_threshold_duplexer = $dataArray2["InputChannel"]["Talkback Threshold"]["Volume"];
	$talkback_decay_duplexer = $dataArray2["InputChannel"]["Peak Envelope"]["Decay"];
	
	$SpkMute = $dataArray2["SpkMute"]["Mute"];
	$LineMute = $dataArray2["LineMute"]["Mute"];
	
	$SpkVol = $dataArray2["SpkVol"]["Volume"];
	$LineVol = $dataArray2["LineVol"]["Volume"];
}

if($json_type=='edp01'){
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"];
	$level1 = '0';
	$levelIn1 = '0';
	
	$Threshold_compressor_duplexer = $dataArray2["Compressor"]["Threshold"];
	$Threshold_noise_gate_duplexer = $dataArray2["Noise Gate"]["Threshold"];
}

if($json_type=='nqga20'){
	
	$mute1 = $dataArray2["Ch1"]["Mute"]["Mute"];
	$volume1 = $dataArray2["Ch1"]["Volume"]["Volume"]; 
	$name1 = $dataArray2["Ch1"]["Name"];
	if($name1=='Default'){
		$name1 = 'Network';
	}
	$color1 = $dataArray2["Ch1"]["Color"];
	if($color1=='Default'){
		$color1 = 'grey';
	}
	$level1 = $dataArray2["Ch1"]["Level"]["Value"];
	
	$SpkMute = $dataArray2["SpkMute"]["Mute"];
	$LineMute = $dataArray2["LineMute"]["Mute"];
	
	$SpkVol = $dataArray2["SpkVol"]["Volume"];
	$LineVol = $dataArray2["LineVol"]["Volume"];
	
	$Threshold_signal_present1 = $dataArray2["Ch1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["Ch1"]["Detect"]["Trigger"];
	
	$Threshold_limiter1 = $dataArray2["Ch1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["Ch1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["Ch1"]["Limiter"]["RMSTC"];
	
	$S11_fader = round( $dataArray2["Ch1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["Ch1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["Ch1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["Ch1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["Ch1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["Ch1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["Ch1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["Ch1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["Ch1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["Ch1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["Ch1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["Ch1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["Ch1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["Ch1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["Ch1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["Ch1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["Ch1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["Ch1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["Ch1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["Ch1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["Ch1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["Ch1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["Ch1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["Ch1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["Ch1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["Ch1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["Ch1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["Ch1"]["EQP"]["S7"]["Q"],1);
	
	$Enabled_compressor1 = $dataArray2["Ch1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["Ch1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["Ch1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["Ch1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["Ch1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["Ch1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["Ch1"]["Compressor"]["Ratio"];
	
	$Frequency_hp1 = $dataArray2["Ch1"]["HP"]["Frequency"];
	$Frequency_lp1 = $dataArray2["Ch1"]["LP"]["Frequency"];
	$Enabled_hp1 = $dataArray2["Ch1"]["HP"]["Enable"];
	$Enabled_lp1 = $dataArray2["Ch1"]["LP"]["Enable"];
	$Type_hp1 = $dataArray2["Ch1"]["HP"]["Type"];
	$Type_lp1 = $dataArray2["Ch1"]["LP"]["Type"];
	
}

if($json_type=='nqpaxxx'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["In3"]["Mute"]["Mute"];
	$mute4 = $dataArray2["In4"]["Mute"]["Mute"];
	$mute5 = $dataArray2["In5"]["Mute"]["Mute"];
	$mute6 = $dataArray2["In6"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["In3"]["Volume"]["Volume"]; 
	$volume4 = $dataArray2["In4"]["Volume"]["Volume"];
	$volume5 = $dataArray2["In5"]["Volume"]["Volume"];
	$volume6 = $dataArray2["In6"]["Volume"]["Volume"];
	$volume7 = $dataArray2["Out5"]["Volume"]["Volume"];
	$volume8 = $dataArray2["Out6"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["In3"]["Name"];
	$name4 = $dataArray2["In4"]["Name"];
	$name5 = $dataArray2["In5"]["Name"];
	$name6 = $dataArray2["In6"]["Name"];
	$name7 = $dataArray2["Out5"]["Name"];
	$name8 = $dataArray2["Out6"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["In3"]["Color"];
	$color4 = $dataArray2["In4"]["Color"];
	$color5 = $dataArray2["In5"]["Color"];
	$color6 = $dataArray2["In6"]["Color"];
	$color7 = $dataArray2["Out5"]["Color"];
	$color8 = $dataArray2["Out6"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	$level3 = $dataArray2["In3"]["Level"]["Value"];
	$level4 = $dataArray2["In4"]["Level"]["Value"];
	$level5 = $dataArray2["In5"]["Level"]["Value"];
	$level6 = $dataArray2["In6"]["Level"]["Value"];
	$level7 = $dataArray2["Out5"]["Level"]["Value"];
	$level8 = $dataArray2["Out6"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	$levelIn3 = $dataArray2["In3"]["LevelIn"]["Value"];
	$levelIn4 = $dataArray2["In4"]["LevelIn"]["Value"];
	$levelIn5 = $dataArray2["In5"]["LevelIn"]["Value"];
	$levelIn6 = $dataArray2["In6"]["LevelIn"]["Value"];
	$levelIn7 = $dataArray2["Out5"]["LevelIn"]["Value"];
	$levelIn8 = $dataArray2["Out6"]["LevelIn"]["Value"];
		
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_limiter3 = $dataArray2["In3"]["Limiter"]["Threshold"];
	$Decay_limiter3 = $dataArray2["In3"]["Limiter"]["Decay"];
	$RMSTC_limiter3 = $dataArray2["In3"]["Limiter"]["RMSTC"];

	$Threshold_limiter4 = $dataArray2["In4"]["Limiter"]["Threshold"];
	$Decay_limiter4 = $dataArray2["In4"]["Limiter"]["Decay"];
	$RMSTC_limiter4 = $dataArray2["In4"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter5 = $dataArray2["In5"]["Limiter"]["Threshold"];
	$Decay_limiter5 = $dataArray2["Out6"]["Limiter"]["Decay"];
	$RMSTC_limiter5 = $dataArray2["Out6"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter6 = $dataArray2["In6"]["Limiter"]["Threshold"];
	$Decay_limiter6 = $dataArray2["In6"]["Limiter"]["Decay"];
	$RMSTC_limiter6 = $dataArray2["In6"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter7 = $dataArray2["Out5"]["Limiter"]["Threshold"];
	$Decay_limiter7 = $dataArray2["Out5"]["Limiter"]["Decay"];
	$RMSTC_limiter7 = $dataArray2["Out5"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter8 = $dataArray2["Out6"]["Limiter"]["Threshold"];
	$Decay_limiter8 = $dataArray2["Out6"]["Limiter"]["Decay"];
	$RMSTC_limiter8 = $dataArray2["Out6"]["Limiter"]["RMSTC"];
	
	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["In3"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["In3"]["Detect"]["Trigger"];

	$Threshold_signal_present4 = $dataArray2["In4"]["Detect"]["Threshold"];
	$Trigger_signal_present4 = $dataArray2["In4"]["Detect"]["Trigger"];

	$Threshold_signal_present5 = $dataArray2["In5"]["Detect"]["Threshold"];
	$Trigger_signal_present5 = $dataArray2["In5"]["Detect"]["Trigger"];
	
	$Threshold_signal_present6 = $dataArray2["In6"]["Detect"]["Threshold"];
	$Trigger_signal_present6 = $dataArray2["In6"]["Detect"]["Trigger"];
	
	$Threshold_signal_present7 = $dataArray2["Out5"]["Detect"]["Threshold"];
	$Trigger_signal_present7 = $dataArray2["Out5"]["Detect"]["Trigger"];
	
	$Threshold_signal_present8 = $dataArray2["Out6"]["Detect"]["Threshold"];
	$Trigger_signal_present8 = $dataArray2["Out6"]["Detect"]["Trigger"];
	
	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];

	$Enabled_compressor3 = $dataArray2["In3"]["Compressor"]["Enable"];
	$Threshold_compressor3 = $dataArray2["In3"]["Compressor"]["Threshold"];
	$Attack_compressor3 = $dataArray2["In3"]["Compressor"]["Attack"];
	$Hold_compressor3 = $dataArray2["In3"]["Compressor"]["Hold"];
	$Decay_compressor3 = $dataArray2["In3"]["Compressor"]["Decay"];
	$Knee_compressor3 = $dataArray2["In3"]["Compressor"]["Knee"];
	$Ratio_compressor3 = $dataArray2["In3"]["Compressor"]["Ratio"];

	$Enabled_compressor4 = $dataArray2["In4"]["Compressor"]["Enable"];
	$Threshold_compressor4 = $dataArray2["In4"]["Compressor"]["Threshold"];
	$Attack_compressor4 = $dataArray2["In4"]["Compressor"]["Attack"];
	$Hold_compressor4 = $dataArray2["In4"]["Compressor"]["Hold"];
	$Decay_compressor4 = $dataArray2["In4"]["Compressor"]["Decay"];
	$Knee_compressor4 = $dataArray2["In4"]["Compressor"]["Knee"];
	$Ratio_compressor4 = $dataArray2["In4"]["Compressor"]["Ratio"];

	$Enabled_compressor5 = $dataArray2["In5"]["Compressor"]["Enable"];
	$Threshold_compressor5 = $dataArray2["In5"]["Compressor"]["Threshold"];
	$Attack_compressor5 = $dataArray2["In5"]["Compressor"]["Attack"];
	$Hold_compressor5 = $dataArray2["In5"]["Compressor"]["Hold"];
	$Decay_compressor5 = $dataArray2["In5"]["Compressor"]["Decay"];
	$Knee_compressor5 = $dataArray2["In5"]["Compressor"]["Knee"];
	$Ratio_compressor5 = $dataArray2["In5"]["Compressor"]["Ratio"];
	
	$Enabled_compressor6 = $dataArray2["In6"]["Compressor"]["Enable"];
	$Threshold_compressor6 = $dataArray2["In6"]["Compressor"]["Threshold"];
	$Attack_compressor6 = $dataArray2["In6"]["Compressor"]["Attack"];
	$Hold_compressor6 = $dataArray2["In6"]["Compressor"]["Hold"];
	$Decay_compressor6 = $dataArray2["In6"]["Compressor"]["Decay"];
	$Knee_compressor6 = $dataArray2["In6"]["Compressor"]["Knee"];
	$Ratio_compressor6 = $dataArray2["In6"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Attack"];
	$Hold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Hold"];
	$Decay_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Attack"];
	$Hold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Hold"];
	$Decay_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Decay"];
	
	$Enabled_noise_gate5 = $dataArray2["In5"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate5 = $dataArray2["In5"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate5 = $dataArray2["In5"]["Noise Gate"]["Attack"];
	$Hold_noise_gate5 = $dataArray2["In5"]["Noise Gate"]["Hold"];
	$Decay_noise_gate5 = $dataArray2["In5"]["Noise Gate"]["Decay"];
	
	$Enabled_noise_gate6 = $dataArray2["In6"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate6 = $dataArray2["In6"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate6 = $dataArray2["In6"]["Noise Gate"]["Attack"];
	$Hold_noise_gate6 = $dataArray2["In6"]["Noise Gate"]["Hold"];
	$Decay_noise_gate6 = $dataArray2["In6"]["Noise Gate"]["Decay"];
	
	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];
	$Frequency_hp3 = $dataArray2["In3"]["HP"]["Frequency"];
	$Frequency_hp4 = $dataArray2["In4"]["HP"]["Frequency"];
	$Frequency_hp5 = $dataArray2["In5"]["HP"]["Frequency"];
	$Frequency_hp6 = $dataArray2["In6"]["HP"]["Frequency"];

	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];
	$Frequency_lp3 = $dataArray2["In3"]["LP"]["Frequency"];
	$Frequency_lp4 = $dataArray2["In4"]["LP"]["Frequency"];
	$Frequency_lp5 = $dataArray2["In5"]["LP"]["Frequency"];
	$Frequency_lp6 = $dataArray2["In6"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];
	$Enabled_hp3 = $dataArray2["In3"]["HP"]["Enable"];
	$Enabled_hp4 = $dataArray2["In4"]["HP"]["Enable"];
	$Enabled_hp5 = $dataArray2["In5"]["HP"]["Enable"];
	$Enabled_hp6 = $dataArray2["In6"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];
	$Enabled_lp3 = $dataArray2["In3"]["LP"]["Enable"];
	$Enabled_lp4 = $dataArray2["In4"]["LP"]["Enable"];
	$Enabled_lp5 = $dataArray2["In5"]["LP"]["Enable"];
	$Enabled_lp6 = $dataArray2["In6"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];
	$Type_hp3 = $dataArray2["In3"]["HP"]["Type"];
	$Type_hp4 = $dataArray2["In4"]["HP"]["Type"];
	$Type_hp5 = $dataArray2["In5"]["HP"]["Type"];
	$Type_hp6 = $dataArray2["In6"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	$Type_lp3 = $dataArray2["In3"]["LP"]["Type"];
	$Type_lp4 = $dataArray2["In4"]["LP"]["Type"];
	$Type_lp5 = $dataArray2["In5"]["LP"]["Type"];
	$Type_lp6 = $dataArray2["In6"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$GEQ25HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ5_fader = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ5_enable = $dataArray2["In5"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$GEQ25HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ6_fader = $dataArray2["In6"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ6_enable = $dataArray2["In6"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);

	$S13_fader = round( $dataArray2["In3"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["In3"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["In3"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["In3"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["In3"]["EQP"]["S5"]["Boost"],2);
	$S63_fader = round( $dataArray2["In3"]["EQP"]["S6"]["Boost"],2);
	$S73_fader = round( $dataArray2["In3"]["EQP"]["S7"]["Boost"],2);

	$S13_enable = $dataArray2["In3"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["In3"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["In3"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["In3"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["In3"]["EQP"]["S5"]["Enable"];
	$S63_enable = $dataArray2["In3"]["EQP"]["S6"]["Enable"];
	$S73_enable = $dataArray2["In3"]["EQP"]["S7"]["Enable"];

	$S13_freq = $dataArray2["In3"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["In3"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["In3"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["In3"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["In3"]["EQP"]["S5"]["Frequency"];
	$S63_freq = $dataArray2["In3"]["EQP"]["S6"]["Frequency"];
	$S73_freq = $dataArray2["In3"]["EQP"]["S7"]["Frequency"];

	$S13_q =  round( $dataArray2["In3"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["In3"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["In3"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["In3"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["In3"]["EQP"]["S5"]["Q"],1);
	$S63_q =  round( $dataArray2["In3"]["EQP"]["S6"]["Q"],1);
	$S73_q =  round( $dataArray2["In3"]["EQP"]["S7"]["Q"],1);

	$S14_fader = round( $dataArray2["In4"]["EQP"]["S1"]["Boost"],2);
	$S24_fader = round( $dataArray2["In4"]["EQP"]["S2"]["Boost"],2);
	$S34_fader = round( $dataArray2["In4"]["EQP"]["S3"]["Boost"],2);
	$S44_fader = round( $dataArray2["In4"]["EQP"]["S4"]["Boost"],2);
	$S54_fader = round( $dataArray2["In4"]["EQP"]["S5"]["Boost"],2);
	$S64_fader = round( $dataArray2["In4"]["EQP"]["S6"]["Boost"],2);
	$S74_fader = round( $dataArray2["In4"]["EQP"]["S7"]["Boost"],2);

	$S14_enable = $dataArray2["In4"]["EQP"]["S1"]["Enable"];
	$S24_enable = $dataArray2["In4"]["EQP"]["S2"]["Enable"];
	$S34_enable = $dataArray2["In4"]["EQP"]["S3"]["Enable"];
	$S44_enable = $dataArray2["In4"]["EQP"]["S4"]["Enable"];
	$S54_enable = $dataArray2["In4"]["EQP"]["S5"]["Enable"];
	$S64_enable = $dataArray2["In4"]["EQP"]["S6"]["Enable"];
	$S74_enable = $dataArray2["In4"]["EQP"]["S7"]["Enable"];

	$S14_freq = $dataArray2["In4"]["EQP"]["S1"]["Frequency"];
	$S24_freq = $dataArray2["In4"]["EQP"]["S2"]["Frequency"];
	$S34_freq = $dataArray2["In4"]["EQP"]["S3"]["Frequency"];
	$S44_freq = $dataArray2["In4"]["EQP"]["S4"]["Frequency"];
	$S54_freq = $dataArray2["In4"]["EQP"]["S5"]["Frequency"];
	$S64_freq = $dataArray2["In4"]["EQP"]["S6"]["Frequency"];
	$S74_freq = $dataArray2["In4"]["EQP"]["S7"]["Frequency"];

	$S14_q =  round( $dataArray2["In4"]["EQP"]["S1"]["Q"],1);
	$S24_q =  round( $dataArray2["In4"]["EQP"]["S2"]["Q"],1);
	$S34_q =  round( $dataArray2["In4"]["EQP"]["S3"]["Q"],1);
	$S44_q =  round( $dataArray2["In4"]["EQP"]["S4"]["Q"],1);
	$S54_q =  round( $dataArray2["In4"]["EQP"]["S5"]["Q"],1);
	$S64_q =  round( $dataArray2["In4"]["EQP"]["S6"]["Q"],1);
	$S74_q =  round( $dataArray2["In4"]["EQP"]["S7"]["Q"],1);
	
	$S15_fader = round( $dataArray2["In5"]["EQP"]["S1"]["Boost"],2);
	$S25_fader = round( $dataArray2["In5"]["EQP"]["S2"]["Boost"],2);
	$S35_fader = round( $dataArray2["In5"]["EQP"]["S3"]["Boost"],2);
	$S45_fader = round( $dataArray2["In5"]["EQP"]["S4"]["Boost"],2);
	$S55_fader = round( $dataArray2["In5"]["EQP"]["S5"]["Boost"],2);
	$S65_fader = round( $dataArray2["In5"]["EQP"]["S6"]["Boost"],2);
	$S75_fader = round( $dataArray2["In5"]["EQP"]["S7"]["Boost"],2);

	$S15_enable = $dataArray2["In5"]["EQP"]["S1"]["Enable"];
	$S25_enable = $dataArray2["In5"]["EQP"]["S2"]["Enable"];
	$S35_enable = $dataArray2["In5"]["EQP"]["S3"]["Enable"];
	$S45_enable = $dataArray2["In5"]["EQP"]["S4"]["Enable"];
	$S55_enable = $dataArray2["In5"]["EQP"]["S5"]["Enable"];
	$S65_enable = $dataArray2["In5"]["EQP"]["S6"]["Enable"];
	$S75_enable = $dataArray2["In5"]["EQP"]["S7"]["Enable"];

	$S15_freq = $dataArray2["In5"]["EQP"]["S1"]["Frequency"];
	$S25_freq = $dataArray2["In5"]["EQP"]["S2"]["Frequency"];
	$S35_freq = $dataArray2["In5"]["EQP"]["S3"]["Frequency"];
	$S45_freq = $dataArray2["In5"]["EQP"]["S4"]["Frequency"];
	$S55_freq = $dataArray2["In5"]["EQP"]["S5"]["Frequency"];
	$S65_freq = $dataArray2["In5"]["EQP"]["S6"]["Frequency"];
	$S75_freq = $dataArray2["In5"]["EQP"]["S7"]["Frequency"];

	$S15_q =  round( $dataArray2["In5"]["EQP"]["S1"]["Q"],1);
	$S25_q =  round( $dataArray2["In5"]["EQP"]["S2"]["Q"],1);
	$S35_q =  round( $dataArray2["In5"]["EQP"]["S3"]["Q"],1);
	$S45_q =  round( $dataArray2["In5"]["EQP"]["S4"]["Q"],1);
	$S55_q =  round( $dataArray2["In5"]["EQP"]["S5"]["Q"],1);
	$S65_q =  round( $dataArray2["In5"]["EQP"]["S6"]["Q"],1);
	$S75_q =  round( $dataArray2["In5"]["EQP"]["S7"]["Q"],1);
	
	$S16_fader = round( $dataArray2["In6"]["EQP"]["S1"]["Boost"],2);
	$S26_fader = round( $dataArray2["In6"]["EQP"]["S2"]["Boost"],2);
	$S36_fader = round( $dataArray2["In6"]["EQP"]["S3"]["Boost"],2);
	$S46_fader = round( $dataArray2["In6"]["EQP"]["S4"]["Boost"],2);
	$S56_fader = round( $dataArray2["In6"]["EQP"]["S5"]["Boost"],2);
	$S66_fader = round( $dataArray2["In6"]["EQP"]["S6"]["Boost"],2);
	$S76_fader = round( $dataArray2["In6"]["EQP"]["S7"]["Boost"],2);

	$S16_enable = $dataArray2["In6"]["EQP"]["S1"]["Enable"];
	$S26_enable = $dataArray2["In6"]["EQP"]["S2"]["Enable"];
	$S36_enable = $dataArray2["In6"]["EQP"]["S3"]["Enable"];
	$S46_enable = $dataArray2["In6"]["EQP"]["S4"]["Enable"];
	$S56_enable = $dataArray2["In6"]["EQP"]["S5"]["Enable"];
	$S66_enable = $dataArray2["In6"]["EQP"]["S6"]["Enable"];
	$S76_enable = $dataArray2["In6"]["EQP"]["S7"]["Enable"];

	$S16_freq = $dataArray2["In6"]["EQP"]["S1"]["Frequency"];
	$S26_freq = $dataArray2["In6"]["EQP"]["S2"]["Frequency"];
	$S36_freq = $dataArray2["In6"]["EQP"]["S3"]["Frequency"];
	$S46_freq = $dataArray2["In6"]["EQP"]["S4"]["Frequency"];
	$S56_freq = $dataArray2["In6"]["EQP"]["S5"]["Frequency"];
	$S66_freq = $dataArray2["In6"]["EQP"]["S6"]["Frequency"];
	$S76_freq = $dataArray2["In6"]["EQP"]["S7"]["Frequency"];

	$S16_q =  round( $dataArray2["In6"]["EQP"]["S1"]["Q"],1);
	$S26_q =  round( $dataArray2["In6"]["EQP"]["S2"]["Q"],1);
	$S36_q =  round( $dataArray2["In6"]["EQP"]["S3"]["Q"],1);
	$S46_q =  round( $dataArray2["In6"]["EQP"]["S4"]["Q"],1);
	$S56_q =  round( $dataArray2["In6"]["EQP"]["S5"]["Q"],1);
	$S66_q =  round( $dataArray2["In6"]["EQP"]["S6"]["Q"],1);
	$S76_q =  round( $dataArray2["In6"]["EQP"]["S7"]["Q"],1);
}

if($json_type=='ampg2_2c'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];
	
	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];

	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);
		
	$AnalogModeCH1 = $dataArray2["AnalogModeCH1"];
	$AnalogModeCH2 = $dataArray2["AnalogModeCH2"];
	
	$Delay_delay1 = $dataArray2["In1"]["Delay"]["Delay"];
	$Delay_delay2 = $dataArray2["In2"]["Delay"]["Delay"];
	
	$Phase_invert1 = $dataArray2["In1"]["PhaseInvert"]["Invert"];
	$Phase_invert2 = $dataArray2["In2"]["PhaseInvert"]["Invert"];
	
	$preset1 = $dataArray2["In1"]["PresetName"];
	$preset2 = $dataArray2["In2"]["PresetName"];
	$AmpPresets = $dataArray2["Presets"]["PresetList"];
	
	$Enabled_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Decay"];
	
	$Enabled_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Decay"];
	
	$Enabled_standby = $dataArray2["Standby"];
	$Threshold_standby_ab = $dataArray2["DetectAB"]["Threshold"];
	$Threshold_standby_cd = '';
	
	$Enabled_mute = $dataArray2["Mute"];
	$Threshold_mute_ab = $dataArray2["DetectMuteAB"]["Threshold"];
	$Threshold_mute_cd = '';
}

if($json_type=='ampg2_4c'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["In3"]["Mute"]["Mute"];
	$mute4 = $dataArray2["In4"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["In3"]["Volume"]["Volume"];
	$volume4 = $dataArray2["In4"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["In3"]["Name"];
	$name4 = $dataArray2["In4"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["In3"]["Color"];
	$color4 = $dataArray2["In4"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["In2"]["Level"]["Value"];
	$level3 = $dataArray2["In3"]["Level"]["Value"];
	$level4 = $dataArray2["In4"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["In2"]["LevelIn"]["Value"];
	$levelIn3 = $dataArray2["In3"]["LevelIn"]["Value"];
	$levelIn4 = $dataArray2["In4"]["LevelIn"]["Value"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_limiter3 = $dataArray2["In3"]["Limiter"]["Threshold"];
	$Decay_limiter3 = $dataArray2["In3"]["Limiter"]["Decay"];
	$RMSTC_limiter3 = $dataArray2["In3"]["Limiter"]["RMSTC"];
	
	$Threshold_limiter4 = $dataArray2["In4"]["Limiter"]["Threshold"];
	$Decay_limiter4 = $dataArray2["In4"]["Limiter"]["Decay"];
	$RMSTC_limiter4 = $dataArray2["In4"]["Limiter"]["RMSTC"];

	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["In3"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["In3"]["Detect"]["Trigger"];
	
	$Threshold_signal_present4 = $dataArray2["In4"]["Detect"]["Threshold"];
	$Trigger_signal_present4 = $dataArray2["In4"]["Detect"]["Trigger"];
	
	$Enabled_compressor1 = $dataArray2["In1"]["Compressor"]["Enable"];
	$Threshold_compressor1 = $dataArray2["In1"]["Compressor"]["Threshold"];
	$Attack_compressor1 = $dataArray2["In1"]["Compressor"]["Attack"];
	$Hold_compressor1 = $dataArray2["In1"]["Compressor"]["Hold"];
	$Decay_compressor1 = $dataArray2["In1"]["Compressor"]["Decay"];
	$Knee_compressor1 = $dataArray2["In1"]["Compressor"]["Knee"];
	$Ratio_compressor1 = $dataArray2["In1"]["Compressor"]["Ratio"];

	$Enabled_compressor2 = $dataArray2["In2"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["In2"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["In2"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["In2"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["In2"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["In2"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["In2"]["Compressor"]["Ratio"];

	$Enabled_compressor3 = $dataArray2["In3"]["Compressor"]["Enable"];
	$Threshold_compressor3 = $dataArray2["In3"]["Compressor"]["Threshold"];
	$Attack_compressor3 = $dataArray2["In3"]["Compressor"]["Attack"];
	$Hold_compressor3 = $dataArray2["In3"]["Compressor"]["Hold"];
	$Decay_compressor3 = $dataArray2["In3"]["Compressor"]["Decay"];
	$Knee_compressor3 = $dataArray2["In3"]["Compressor"]["Knee"];
	$Ratio_compressor3 = $dataArray2["In3"]["Compressor"]["Ratio"];
	
	$Enabled_compressor4 = $dataArray2["In4"]["Compressor"]["Enable"];
	$Threshold_compressor4 = $dataArray2["In4"]["Compressor"]["Threshold"];
	$Attack_compressor4 = $dataArray2["In4"]["Compressor"]["Attack"];
	$Hold_compressor4 = $dataArray2["In4"]["Compressor"]["Hold"];
	$Decay_compressor4 = $dataArray2["In4"]["Compressor"]["Decay"];
	$Knee_compressor4 = $dataArray2["In4"]["Compressor"]["Knee"];
	$Ratio_compressor4 = $dataArray2["In4"]["Compressor"]["Ratio"];
	
	$Enabled_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Attack"];
	$Hold_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Hold"];
	$Decay_noise_gate1 = $dataArray2["In1"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Attack"];
	$Hold_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Hold"];
	$Decay_noise_gate2 = $dataArray2["In2"]["Noise Gate"]["Decay"];

	$Enabled_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Attack"];
	$Hold_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Hold"];
	$Decay_noise_gate3 = $dataArray2["In3"]["Noise Gate"]["Decay"];
	
	$Enabled_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Enable"];
	$Threshold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Threshold"];
	$Attack_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Attack"];
	$Hold_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Hold"];
	$Decay_noise_gate4 = $dataArray2["In4"]["Noise Gate"]["Decay"];

	$Frequency_hp1 = $dataArray2["In1"]["HP"]["Frequency"];
	$Frequency_hp2 = $dataArray2["In2"]["HP"]["Frequency"];
	$Frequency_hp3 = $dataArray2["In3"]["HP"]["Frequency"];
	$Frequency_hp4 = $dataArray2["In4"]["HP"]["Frequency"];

	$Frequency_lp1 = $dataArray2["In1"]["LP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["In2"]["LP"]["Frequency"];
	$Frequency_lp3 = $dataArray2["In3"]["LP"]["Frequency"];
	$Frequency_lp4 = $dataArray2["In4"]["LP"]["Frequency"];

	$Enabled_hp1 = $dataArray2["In1"]["HP"]["Enable"];
	$Enabled_hp2 = $dataArray2["In2"]["HP"]["Enable"];
	$Enabled_hp3 = $dataArray2["In3"]["HP"]["Enable"];
	$Enabled_hp4 = $dataArray2["In4"]["HP"]["Enable"];

	$Enabled_lp1 = $dataArray2["In1"]["LP"]["Enable"];
	$Enabled_lp2 = $dataArray2["In2"]["LP"]["Enable"];
	$Enabled_lp3 = $dataArray2["In3"]["LP"]["Enable"];
	$Enabled_lp4 = $dataArray2["In4"]["LP"]["Enable"];

	$Type_hp1 = $dataArray2["In1"]["HP"]["Type"];
	$Type_hp2 = $dataArray2["In2"]["HP"]["Type"];
	$Type_hp3 = $dataArray2["In3"]["HP"]["Type"];
	$Type_hp4 = $dataArray2["In4"]["HP"]["Type"];

	$Type_lp1 = $dataArray2["In1"]["LP"]["Type"];
	$Type_lp2 = $dataArray2["In2"]["LP"]["Type"];
	$Type_lp3 = $dataArray2["In3"]["LP"]["Type"];
	$Type_lp4 = $dataArray2["In4"]["LP"]["Type"];
	
	$GEQ25HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ1_fader = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ1_enable = $dataArray2["In1"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ2_fader = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ2_enable = $dataArray2["In2"]["EQG"]["GEQ20000HZ"]["Enable"];

	$GEQ25HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ3_fader = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ3_enable = $dataArray2["In3"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$GEQ25HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Boost"];
	$GEQ40HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Boost"];
	$GEQ63HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Boost"];
	$GEQ100HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Boost"];
	$GEQ160HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Boost"];
	$GEQ250HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Boost"];
	$GEQ400HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Boost"];
	$GEQ630HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Boost"];
	$GEQ1000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Boost"];
	$GEQ1600HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Boost"];
	$GEQ2500HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Boost"];
	$GEQ4000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Boost"];
	$GEQ6300HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Boost"];
	$GEQ10000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Boost"];
	$GEQ16000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Boost"];
	$GEQ20000HZ4_fader = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Boost"];

	$GEQ25HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ25HZ"]["Enable"];
	$GEQ40HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ40HZ"]["Enable"];
	$GEQ63HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ63HZ"]["Enable"];
	$GEQ100HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ100HZ"]["Enable"];
	$GEQ160HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ160HZ"]["Enable"];
	$GEQ250HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ250HZ"]["Enable"];
	$GEQ400HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ400HZ"]["Enable"];
	$GEQ630HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ630HZ"]["Enable"];
	$GEQ1000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1000HZ"]["Enable"];
	$GEQ1600HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ1600HZ"]["Enable"];
	$GEQ2500HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ2500HZ"]["Enable"];
	$GEQ4000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ4000HZ"]["Enable"];
	$GEQ6300HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ6300HZ"]["Enable"];
	$GEQ10000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ10000HZ"]["Enable"];
	$GEQ16000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ16000HZ"]["Enable"];
	$GEQ20000HZ4_enable = $dataArray2["In4"]["EQG"]["GEQ20000HZ"]["Enable"];
	
	$S11_fader = round( $dataArray2["In1"]["EQP"]["S1"]["Boost"],2);
	$S21_fader = round( $dataArray2["In1"]["EQP"]["S2"]["Boost"],2);
	$S31_fader = round( $dataArray2["In1"]["EQP"]["S3"]["Boost"],2);
	$S41_fader = round( $dataArray2["In1"]["EQP"]["S4"]["Boost"],2);
	$S51_fader = round( $dataArray2["In1"]["EQP"]["S5"]["Boost"],2);
	$S61_fader = round( $dataArray2["In1"]["EQP"]["S6"]["Boost"],2);
	$S71_fader = round( $dataArray2["In1"]["EQP"]["S7"]["Boost"],2);

	$S11_enable = $dataArray2["In1"]["EQP"]["S1"]["Enable"];
	$S21_enable = $dataArray2["In1"]["EQP"]["S2"]["Enable"];
	$S31_enable = $dataArray2["In1"]["EQP"]["S3"]["Enable"];
	$S41_enable = $dataArray2["In1"]["EQP"]["S4"]["Enable"];
	$S51_enable = $dataArray2["In1"]["EQP"]["S5"]["Enable"];
	$S61_enable = $dataArray2["In1"]["EQP"]["S6"]["Enable"];
	$S71_enable = $dataArray2["In1"]["EQP"]["S7"]["Enable"];

	$S11_freq = $dataArray2["In1"]["EQP"]["S1"]["Frequency"];
	$S21_freq = $dataArray2["In1"]["EQP"]["S2"]["Frequency"];
	$S31_freq = $dataArray2["In1"]["EQP"]["S3"]["Frequency"];
	$S41_freq = $dataArray2["In1"]["EQP"]["S4"]["Frequency"];
	$S51_freq = $dataArray2["In1"]["EQP"]["S5"]["Frequency"];
	$S61_freq = $dataArray2["In1"]["EQP"]["S6"]["Frequency"];
	$S71_freq = $dataArray2["In1"]["EQP"]["S7"]["Frequency"];

	$S11_q =  round( $dataArray2["In1"]["EQP"]["S1"]["Q"],1);
	$S21_q =  round( $dataArray2["In1"]["EQP"]["S2"]["Q"],1);
	$S31_q =  round( $dataArray2["In1"]["EQP"]["S3"]["Q"],1);
	$S41_q =  round( $dataArray2["In1"]["EQP"]["S4"]["Q"],1);
	$S51_q =  round( $dataArray2["In1"]["EQP"]["S5"]["Q"],1);
	$S61_q =  round( $dataArray2["In1"]["EQP"]["S6"]["Q"],1);
	$S71_q =  round( $dataArray2["In1"]["EQP"]["S7"]["Q"],1);

	$S12_fader = round( $dataArray2["In2"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["In2"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["In2"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["In2"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["In2"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["In2"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["In2"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["In2"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["In2"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["In2"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["In2"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["In2"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["In2"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["In2"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["In2"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["In2"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["In2"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["In2"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["In2"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["In2"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["In2"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["In2"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["In2"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["In2"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["In2"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["In2"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["In2"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["In2"]["EQP"]["S7"]["Q"],1);

	$S13_fader = round( $dataArray2["In3"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["In3"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["In3"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["In3"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["In3"]["EQP"]["S5"]["Boost"],2);
	$S63_fader = round( $dataArray2["In3"]["EQP"]["S6"]["Boost"],2);
	$S73_fader = round( $dataArray2["In3"]["EQP"]["S7"]["Boost"],2);

	$S13_enable = $dataArray2["In3"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["In3"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["In3"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["In3"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["In3"]["EQP"]["S5"]["Enable"];
	$S63_enable = $dataArray2["In3"]["EQP"]["S6"]["Enable"];
	$S73_enable = $dataArray2["In3"]["EQP"]["S7"]["Enable"];

	$S13_freq = $dataArray2["In3"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["In3"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["In3"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["In3"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["In3"]["EQP"]["S5"]["Frequency"];
	$S63_freq = $dataArray2["In3"]["EQP"]["S6"]["Frequency"];
	$S73_freq = $dataArray2["In3"]["EQP"]["S7"]["Frequency"];

	$S13_q =  round( $dataArray2["In3"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["In3"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["In3"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["In3"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["In3"]["EQP"]["S5"]["Q"],1);
	$S63_q =  round( $dataArray2["In3"]["EQP"]["S6"]["Q"],1);
	$S73_q =  round( $dataArray2["In3"]["EQP"]["S7"]["Q"],1);
	
	$S14_fader = round( $dataArray2["In4"]["EQP"]["S1"]["Boost"],2);
	$S24_fader = round( $dataArray2["In4"]["EQP"]["S2"]["Boost"],2);
	$S34_fader = round( $dataArray2["In4"]["EQP"]["S3"]["Boost"],2);
	$S44_fader = round( $dataArray2["In4"]["EQP"]["S4"]["Boost"],2);
	$S54_fader = round( $dataArray2["In4"]["EQP"]["S5"]["Boost"],2);
	$S64_fader = round( $dataArray2["In4"]["EQP"]["S6"]["Boost"],2);
	$S74_fader = round( $dataArray2["In4"]["EQP"]["S7"]["Boost"],2);

	$S14_enable = $dataArray2["In4"]["EQP"]["S1"]["Enable"];
	$S24_enable = $dataArray2["In4"]["EQP"]["S2"]["Enable"];
	$S34_enable = $dataArray2["In4"]["EQP"]["S3"]["Enable"];
	$S44_enable = $dataArray2["In4"]["EQP"]["S4"]["Enable"];
	$S54_enable = $dataArray2["In4"]["EQP"]["S5"]["Enable"];
	$S64_enable = $dataArray2["In4"]["EQP"]["S6"]["Enable"];
	$S74_enable = $dataArray2["In4"]["EQP"]["S7"]["Enable"];

	$S14_freq = $dataArray2["In4"]["EQP"]["S1"]["Frequency"];
	$S24_freq = $dataArray2["In4"]["EQP"]["S2"]["Frequency"];
	$S34_freq = $dataArray2["In4"]["EQP"]["S3"]["Frequency"];
	$S44_freq = $dataArray2["In4"]["EQP"]["S4"]["Frequency"];
	$S54_freq = $dataArray2["In4"]["EQP"]["S5"]["Frequency"];
	$S64_freq = $dataArray2["In4"]["EQP"]["S6"]["Frequency"];
	$S74_freq = $dataArray2["In4"]["EQP"]["S7"]["Frequency"];

	$S14_q =  round( $dataArray2["In4"]["EQP"]["S1"]["Q"],1);
	$S24_q =  round( $dataArray2["In4"]["EQP"]["S2"]["Q"],1);
	$S34_q =  round( $dataArray2["In4"]["EQP"]["S3"]["Q"],1);
	$S44_q =  round( $dataArray2["In4"]["EQP"]["S4"]["Q"],1);
	$S54_q =  round( $dataArray2["In4"]["EQP"]["S5"]["Q"],1);
	$S64_q =  round( $dataArray2["In4"]["EQP"]["S6"]["Q"],1);
	$S74_q =  round( $dataArray2["In4"]["EQP"]["S7"]["Q"],1);
			
	$AnalogModeCH1 = $dataArray2["AnalogModeCH1"];
	$AnalogModeCH2 = $dataArray2["AnalogModeCH2"];
	$AnalogModeCH3 = $dataArray2["AnalogModeCH3"];
	$AnalogModeCH4 = $dataArray2["AnalogModeCH4"];
	
	$Delay_delay1 = $dataArray2["In1"]["Delay"]["Delay"];
	$Delay_delay2 = $dataArray2["In2"]["Delay"]["Delay"];
	$Delay_delay3 = $dataArray2["In3"]["Delay"]["Delay"];
	$Delay_delay4 = $dataArray2["In4"]["Delay"]["Delay"];
	
	$Phase_invert1 = $dataArray2["In1"]["PhaseInvert"]["Invert"];
	$Phase_invert2 = $dataArray2["In2"]["PhaseInvert"]["Invert"];
	$Phase_invert3 = $dataArray2["In3"]["PhaseInvert"]["Invert"];
	$Phase_invert4 = $dataArray2["In4"]["PhaseInvert"]["Invert"];
	
	$preset1 = $dataArray2["In1"]["PresetName"];
	$preset2 = $dataArray2["In2"]["PresetName"];
	$preset3 = $dataArray2["In3"]["PresetName"];
	$preset4 = $dataArray2["In4"]["PresetName"];
	$AmpPresets = $dataArray2["Presets"]["PresetList"];
	
	$Enabled_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter1 = $dataArray2["In1"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter2 = $dataArray2["In2"]["PeakLimiter"]["Decay"];
	
	$Enabled_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter3 = $dataArray2["In3"]["PeakLimiter"]["Decay"];

	$Enabled_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Enable"];
	$Threshold_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Threshold"];
	$Attack_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Attack"];
	$Hold_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Hold"];
	$Decay_peak_limiter4 = $dataArray2["In4"]["PeakLimiter"]["Decay"];
	
	$Enabled_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter1 = $dataArray2["In1"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter2 = $dataArray2["In2"]["RMSLimiter"]["Decay"];
	
	$Enabled_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter3 = $dataArray2["In3"]["RMSLimiter"]["Decay"];

	$Enabled_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Enable"];
	$Threshold_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Threshold"];
	$Attack_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Attack"];
	$Hold_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Hold"];
	$Decay_rms_limiter4 = $dataArray2["In4"]["RMSLimiter"]["Decay"];
	
	$Enabled_standby = $dataArray2["Standby"];
	$Threshold_standby_ab = $dataArray2["DetectAB"]["Threshold"];
	$Threshold_standby_cd = $dataArray2["DetectCD"]["Threshold"];
	
	$Enabled_mute = $dataArray2["Mute"];
	$Threshold_mute_ab = $dataArray2["DetectMuteAB"]["Threshold"];
	$Threshold_mute_cd = $dataArray2["DetectMuteCD"]["Threshold"];
}

if($volume1>12){ $volume1=12; }
if($volume2>12){ $volume2=12; }
if($volume3>12){ $volume3=12; }
if($volume4>12){ $volume4=12; }
if($volume5>12){ $volume5=12; }
if($volume6>12){ $volume6=12; }
if($volume7>12){ $volume7=12; }
if($volume8>12){ $volume8=12; }

if($volume1<-60){ $volume1=-60; }
if($volume2<-60){ $volume2=-60; }
if($volume3<-60){ $volume3=-60; }
if($volume4<-60){ $volume4=-60; }
if($volume5<-60){ $volume5=-60; }
if($volume6<-60){ $volume6=-60; }
if($volume7<-60){ $volume7=-60; }
if($volume8<-60){ $volume8=-60; }

if($json_type=='ampg1_2c'){
	
	$router_gain1 = $dataArray2["SignalGain1"]["Gain"];
	
	$router_input1 = $dataArray2["Router"]["IG1"]["Volume"];

    $router_output1 = $dataArray2["Router"]["OG1"]["Volume"];
    $router_output2 = $dataArray2["Router"]["OG2"]["Volume"];

    $router_cg11 = $dataArray2["Router"]["CG11"]["Volume"];
	$router_cg12 = $dataArray2["Router"]["CG12"]["Volume"];
	
} else if($json_type=='ampg2_2c'){
	
	$router_gain1 = $dataArray2["SignalGain1"]["Gain"];
    $router_gain2 = $dataArray2["SignalGain2"]["Gain"];
	
	$router_input1 = $dataArray2["Router"]["IG1"]["Volume"];
    $router_input2 = $dataArray2["Router"]["IG2"]["Volume"];

    $router_output1 = $dataArray2["Router"]["OG1"]["Volume"];
    $router_output2 = $dataArray2["Router"]["OG2"]["Volume"];

    $router_cg11 = $dataArray2["Router"]["CG11"]["Volume"];
  	$router_cg21 = $dataArray2["Router"]["CG21"]["Volume"];
	$router_cg12 = $dataArray2["Router"]["CG12"]["Volume"];
	$router_cg22 = $dataArray2["Router"]["CG22"]["Volume"];
	
} else if($json_type=='ampg1_4c'){
	
	$router_gain1 = $dataArray2["SignalGain1"]["Gain"];
    $router_gain2 = $dataArray2["SignalGain2"]["Gain"];
	
	$router_input1 = $dataArray2["Router"]["IG1"]["Volume"];
    $router_input2 = $dataArray2["Router"]["IG2"]["Volume"];

    $router_output1 = $dataArray2["Router"]["OG1"]["Volume"];
    $router_output2 = $dataArray2["Router"]["OG2"]["Volume"];
    $router_output3 = $dataArray2["Router"]["OG3"]["Volume"];
    $router_output4 = $dataArray2["Router"]["OG4"]["Volume"];

    $router_cg11 = $dataArray2["Router"]["CG11"]["Volume"];
    $router_cg12 = $dataArray2["Router"]["CG12"]["Volume"];
    $router_cg13 = $dataArray2["Router"]["CG13"]["Volume"];
    $router_cg14 = $dataArray2["Router"]["CG14"]["Volume"];

    $router_cg21 = $dataArray2["Router"]["CG21"]["Volume"];
    $router_cg22 = $dataArray2["Router"]["CG22"]["Volume"];
    $router_cg23 = $dataArray2["Router"]["CG23"]["Volume"];
    $router_cg24 = $dataArray2["Router"]["CG24"]["Volume"];

} else if($json_type=='ampg2_4c'){
	
	$router_gain1 = $dataArray2["SignalGain1"]["Gain"];
    $router_gain2 = $dataArray2["SignalGain2"]["Gain"];
	$router_gain3 = $dataArray2["SignalGain3"]["Gain"];
    $router_gain4 = $dataArray2["SignalGain4"]["Gain"];
	
	$router_input1 = $dataArray2["Router"]["IG1"]["Volume"];
    $router_input2 = $dataArray2["Router"]["IG2"]["Volume"];
    $router_input3 = $dataArray2["Router"]["IG3"]["Volume"];
    $router_input4 = $dataArray2["Router"]["IG4"]["Volume"];

    $router_output1 = $dataArray2["Router"]["OG1"]["Volume"];
    $router_output2 = $dataArray2["Router"]["OG2"]["Volume"];
    $router_output3 = $dataArray2["Router"]["OG3"]["Volume"];
    $router_output4 = $dataArray2["Router"]["OG4"]["Volume"];
    $router_output5 = $dataArray2["Router"]["OG5"]["Volume"];
    $router_output6 = $dataArray2["Router"]["OG6"]["Volume"];

    $router_cg11 = $dataArray2["Router"]["CG11"]["Volume"];
    $router_cg12 = $dataArray2["Router"]["CG12"]["Volume"];
    $router_cg13 = $dataArray2["Router"]["CG13"]["Volume"];
    $router_cg14 = $dataArray2["Router"]["CG14"]["Volume"];
    $router_cg15 = $dataArray2["Router"]["CG15"]["Volume"];
    $router_cg16 = $dataArray2["Router"]["CG16"]["Volume"];

    $router_cg21 = $dataArray2["Router"]["CG21"]["Volume"];
    $router_cg22 = $dataArray2["Router"]["CG22"]["Volume"];
    $router_cg23 = $dataArray2["Router"]["CG23"]["Volume"];
    $router_cg24 = $dataArray2["Router"]["CG24"]["Volume"];
    $router_cg25 = $dataArray2["Router"]["CG25"]["Volume"];
    $router_cg26 = $dataArray2["Router"]["CG26"]["Volume"];

    $router_cg31 = $dataArray2["Router"]["CG31"]["Volume"];
    $router_cg32 = $dataArray2["Router"]["CG32"]["Volume"];
    $router_cg33 = $dataArray2["Router"]["CG33"]["Volume"];
    $router_cg34 = $dataArray2["Router"]["CG34"]["Volume"];
    $router_cg35 = $dataArray2["Router"]["CG35"]["Volume"];
    $router_cg36 = $dataArray2["Router"]["CG36"]["Volume"];

    $router_cg41 = $dataArray2["Router"]["CG41"]["Volume"];
    $router_cg42 = $dataArray2["Router"]["CG42"]["Volume"];
    $router_cg43 = $dataArray2["Router"]["CG43"]["Volume"];
    $router_cg44 = $dataArray2["Router"]["CG44"]["Volume"];
    $router_cg45 = $dataArray2["Router"]["CG45"]["Volume"];
    $router_cg46 = $dataArray2["Router"]["CG46"]["Volume"];
} else {
    $router_input1 = $dataArray2["Router"]["IG1"]["Volume"];
    $router_input2 = $dataArray2["Router"]["IG2"]["Volume"];
    $router_input3 = $dataArray2["Router"]["IG3"]["Volume"];
    $router_input4 = $dataArray2["Router"]["IG4"]["Volume"];

    $router_output1 = $dataArray2["Router"]["OG1"]["Volume"];
    $router_output2 = $dataArray2["Router"]["OG2"]["Volume"];
    $router_output3 = $dataArray2["Router"]["OG3"]["Volume"];
    $router_output4 = $dataArray2["Router"]["OG4"]["Volume"];
    $router_output5 = $dataArray2["Router"]["OG5"]["Volume"];
    $router_output6 = $dataArray2["Router"]["OG6"]["Volume"];

    $router_cg11 = $dataArray2["Router"]["CG11"]["Volume"];
    $router_cg12 = $dataArray2["Router"]["CG12"]["Volume"];
    $router_cg13 = $dataArray2["Router"]["CG13"]["Volume"];
    $router_cg14 = $dataArray2["Router"]["CG14"]["Volume"];
    $router_cg15 = $dataArray2["Router"]["CG15"]["Volume"];
    $router_cg16 = $dataArray2["Router"]["CG16"]["Volume"];

    $router_cg21 = $dataArray2["Router"]["CG21"]["Volume"];
    $router_cg22 = $dataArray2["Router"]["CG22"]["Volume"];
    $router_cg23 = $dataArray2["Router"]["CG23"]["Volume"];
    $router_cg24 = $dataArray2["Router"]["CG24"]["Volume"];
    $router_cg25 = $dataArray2["Router"]["CG25"]["Volume"];
    $router_cg26 = $dataArray2["Router"]["CG26"]["Volume"];

    $router_cg31 = $dataArray2["Router"]["CG31"]["Volume"];
    $router_cg32 = $dataArray2["Router"]["CG32"]["Volume"];
    $router_cg33 = $dataArray2["Router"]["CG33"]["Volume"];
    $router_cg34 = $dataArray2["Router"]["CG34"]["Volume"];
    $router_cg35 = $dataArray2["Router"]["CG35"]["Volume"];
    $router_cg36 = $dataArray2["Router"]["CG36"]["Volume"];

    $router_cg41 = $dataArray2["Router"]["CG41"]["Volume"];
    $router_cg42 = $dataArray2["Router"]["CG42"]["Volume"];
    $router_cg43 = $dataArray2["Router"]["CG43"]["Volume"];
    $router_cg44 = $dataArray2["Router"]["CG44"]["Volume"];
    $router_cg45 = $dataArray2["Router"]["CG45"]["Volume"];
    $router_cg46 = $dataArray2["Router"]["CG46"]["Volume"];	
}

if($json_type=='nqga400p'){
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["In2"]["Mute"]["Mute"];
	$mute3 = $dataArray2["Out1"]["Mute"]["Mute"];
	$mute4 = $dataArray2["Out2"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["In2"]["Volume"]["Volume"]; 
	$volume3 = $dataArray2["Out1"]["Volume"]["Volume"];
	$volume4 = $dataArray2["Out2"]["Volume"]["Volume"];
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["In2"]["Name"];
	$name3 = $dataArray2["Out1"]["Name"];
	$name4 = $dataArray2["Out2"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["In2"]["Color"];
	$color3 = $dataArray2["Out1"]["Color"];
	$color4 = $dataArray2["Out2"]["Color"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["In2"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["In2"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["In2"]["Limiter"]["RMSTC"];

	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["In2"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["In2"]["Detect"]["Trigger"];

	$Threshold_signal_present3 = $dataArray2["Out1"]["Detect"]["Threshold"];
	$Trigger_signal_present3 = $dataArray2["Out1"]["Detect"]["Trigger"];

	$Threshold_signal_present4 = $dataArray2["Out2"]["Detect"]["Threshold"];
	$Trigger_signal_present4 = $dataArray2["Out2"]["Detect"]["Trigger"];
	
	$Frequency_hp3 = $dataArray2["Out1"]["HP"]["Frequency"];
	$Frequency_hp4 = $dataArray2["Out2"]["HP"]["Frequency"];

	$Frequency_lp3 = $dataArray2["Out1"]["LP"]["Frequency"];
	$Frequency_lp4 = $dataArray2["Out2"]["LP"]["Frequency"];

	$Enabled_hp3 = $dataArray2["Out1"]["HP"]["Enable"];
	$Enabled_hp4 = $dataArray2["Out2"]["HP"]["Enable"];

	$Enabled_lp3 = $dataArray2["Out1"]["LP"]["Enable"];
	$Enabled_lp4 = $dataArray2["Out2"]["LP"]["Enable"];

	$Type_hp3 = $dataArray2["Out1"]["HP"]["Type"];
	$Type_hp4 = $dataArray2["Out2"]["HP"]["Type"];

	$Type_lp3 = $dataArray2["Out1"]["LP"]["Type"];
	$Type_lp4 = $dataArray2["Out2"]["LP"]["Type"];
	
	$S13_fader = round( $dataArray2["Out1"]["EQP"]["S1"]["Boost"],2);
	$S23_fader = round( $dataArray2["Out1"]["EQP"]["S2"]["Boost"],2);
	$S33_fader = round( $dataArray2["Out1"]["EQP"]["S3"]["Boost"],2);
	$S43_fader = round( $dataArray2["Out1"]["EQP"]["S4"]["Boost"],2);
	$S53_fader = round( $dataArray2["Out1"]["EQP"]["S5"]["Boost"],2);

	$S13_enable = $dataArray2["Out1"]["EQP"]["S1"]["Enable"];
	$S23_enable = $dataArray2["Out1"]["EQP"]["S2"]["Enable"];
	$S33_enable = $dataArray2["Out1"]["EQP"]["S3"]["Enable"];
	$S43_enable = $dataArray2["Out1"]["EQP"]["S4"]["Enable"];
	$S53_enable = $dataArray2["Out1"]["EQP"]["S5"]["Enable"];

	$S13_freq = $dataArray2["Out1"]["EQP"]["S1"]["Frequency"];
	$S23_freq = $dataArray2["Out1"]["EQP"]["S2"]["Frequency"];
	$S33_freq = $dataArray2["Out1"]["EQP"]["S3"]["Frequency"];
	$S43_freq = $dataArray2["Out1"]["EQP"]["S4"]["Frequency"];
	$S53_freq = $dataArray2["Out1"]["EQP"]["S5"]["Frequency"];

	$S13_q =  round( $dataArray2["Out1"]["EQP"]["S1"]["Q"],1);
	$S23_q =  round( $dataArray2["Out1"]["EQP"]["S2"]["Q"],1);
	$S33_q =  round( $dataArray2["Out1"]["EQP"]["S3"]["Q"],1);
	$S43_q =  round( $dataArray2["Out1"]["EQP"]["S4"]["Q"],1);
	$S53_q =  round( $dataArray2["Out1"]["EQP"]["S5"]["Q"],1);
	
	$S14_fader = round( $dataArray2["Out2"]["EQP"]["S1"]["Boost"],2);
	$S24_fader = round( $dataArray2["Out2"]["EQP"]["S2"]["Boost"],2);
	$S34_fader = round( $dataArray2["Out2"]["EQP"]["S3"]["Boost"],2);
	$S44_fader = round( $dataArray2["Out2"]["EQP"]["S4"]["Boost"],2);
	$S54_fader = round( $dataArray2["Out2"]["EQP"]["S5"]["Boost"],2);

	$S14_enable = $dataArray2["Out2"]["EQP"]["S1"]["Enable"];
	$S24_enable = $dataArray2["Out2"]["EQP"]["S2"]["Enable"];
	$S34_enable = $dataArray2["Out2"]["EQP"]["S3"]["Enable"];
	$S44_enable = $dataArray2["Out2"]["EQP"]["S4"]["Enable"];
	$S54_enable = $dataArray2["Out2"]["EQP"]["S5"]["Enable"];

	$S14_freq = $dataArray2["Out2"]["EQP"]["S1"]["Frequency"];
	$S24_freq = $dataArray2["Out2"]["EQP"]["S2"]["Frequency"];
	$S34_freq = $dataArray2["Out2"]["EQP"]["S3"]["Frequency"];
	$S44_freq = $dataArray2["Out2"]["EQP"]["S4"]["Frequency"];
	$S54_freq = $dataArray2["Out2"]["EQP"]["S5"]["Frequency"];

	$S14_q =  round( $dataArray2["Out2"]["EQP"]["S1"]["Q"],1);
	$S24_q =  round( $dataArray2["Out2"]["EQP"]["S2"]["Q"],1);
	$S34_q =  round( $dataArray2["Out2"]["EQP"]["S3"]["Q"],1);
	$S44_q =  round( $dataArray2["Out2"]["EQP"]["S4"]["Q"],1);
	$S54_q =  round( $dataArray2["Out2"]["EQP"]["S5"]["Q"],1);
}

if($json_type=='nqga40'){
	
	$mute1 = $dataArray2["In1"]["Mute"]["Mute"];
	$mute2 = $dataArray2["Ch1"]["Mute"]["Mute"];
	
	$volume1 = $dataArray2["In1"]["Volume"]["Volume"]; 
	$volume2 = $dataArray2["Ch1"]["Volume"]["Volume"]; 
	
	$name1 = $dataArray2["In1"]["Name"];
	$name2 = $dataArray2["Ch1"]["Name"];
	
	$color1 = $dataArray2["In1"]["Color"];
	$color2 = $dataArray2["Ch1"]["Color"];
	
	$level1 = $dataArray2["In1"]["Level"]["Value"];
	$level2 = $dataArray2["Ch1"]["Level"]["Value"];
	
	$levelIn1 = $dataArray2["In1"]["LevelIn"]["Value"];
	$levelIn2 = $dataArray2["Ch1"]["LevelIn"]["Value"];
	
	$SpkMute = $dataArray2["SpkMute"]["Mute"];
	$LineMute = $dataArray2["LineMute"]["Mute"];
	
	$SpkVol = $dataArray2["SpkVol"]["Volume"];
	$LineVol = $dataArray2["LineVol"]["Volume"];
	
	$Threshold_limiter1 = $dataArray2["In1"]["Limiter"]["Threshold"];
	$Decay_limiter1 = $dataArray2["In1"]["Limiter"]["Decay"];
	$RMSTC_limiter1 = $dataArray2["In1"]["Limiter"]["RMSTC"];

	$Threshold_limiter2 = $dataArray2["Ch1"]["Limiter"]["Threshold"];
	$Decay_limiter2 = $dataArray2["Ch1"]["Limiter"]["Decay"];
	$RMSTC_limiter2 = $dataArray2["Ch1"]["Limiter"]["RMSTC"];
	
	$Threshold_signal_present1 = $dataArray2["In1"]["Detect"]["Threshold"];
	$Trigger_signal_present1 = $dataArray2["In1"]["Detect"]["Trigger"];

	$Threshold_signal_present2 = $dataArray2["Ch1"]["Detect"]["Threshold"];
	$Trigger_signal_present2 = $dataArray2["Ch1"]["Detect"]["Trigger"];
	
	$S12_fader = round( $dataArray2["Ch1"]["EQP"]["S1"]["Boost"],2);
	$S22_fader = round( $dataArray2["Ch1"]["EQP"]["S2"]["Boost"],2);
	$S32_fader = round( $dataArray2["Ch1"]["EQP"]["S3"]["Boost"],2);
	$S42_fader = round( $dataArray2["Ch1"]["EQP"]["S4"]["Boost"],2);
	$S52_fader = round( $dataArray2["Ch1"]["EQP"]["S5"]["Boost"],2);
	$S62_fader = round( $dataArray2["Ch1"]["EQP"]["S6"]["Boost"],2);
	$S72_fader = round( $dataArray2["Ch1"]["EQP"]["S7"]["Boost"],2);

	$S12_enable = $dataArray2["Ch1"]["EQP"]["S1"]["Enable"];
	$S22_enable = $dataArray2["Ch1"]["EQP"]["S2"]["Enable"];
	$S32_enable = $dataArray2["Ch1"]["EQP"]["S3"]["Enable"];
	$S42_enable = $dataArray2["Ch1"]["EQP"]["S4"]["Enable"];
	$S52_enable = $dataArray2["Ch1"]["EQP"]["S5"]["Enable"];
	$S62_enable = $dataArray2["Ch1"]["EQP"]["S6"]["Enable"];
	$S72_enable = $dataArray2["Ch1"]["EQP"]["S7"]["Enable"];

	$S12_freq = $dataArray2["Ch1"]["EQP"]["S1"]["Frequency"];
	$S22_freq = $dataArray2["Ch1"]["EQP"]["S2"]["Frequency"];
	$S32_freq = $dataArray2["Ch1"]["EQP"]["S3"]["Frequency"];
	$S42_freq = $dataArray2["Ch1"]["EQP"]["S4"]["Frequency"];
	$S52_freq = $dataArray2["Ch1"]["EQP"]["S5"]["Frequency"];
	$S62_freq = $dataArray2["Ch1"]["EQP"]["S6"]["Frequency"];
	$S72_freq = $dataArray2["Ch1"]["EQP"]["S7"]["Frequency"];

	$S12_q =  round( $dataArray2["Ch1"]["EQP"]["S1"]["Q"],1);
	$S22_q =  round( $dataArray2["Ch1"]["EQP"]["S2"]["Q"],1);
	$S32_q =  round( $dataArray2["Ch1"]["EQP"]["S3"]["Q"],1);
	$S42_q =  round( $dataArray2["Ch1"]["EQP"]["S4"]["Q"],1);
	$S52_q =  round( $dataArray2["Ch1"]["EQP"]["S5"]["Q"],1);
	$S62_q =  round( $dataArray2["Ch1"]["EQP"]["S6"]["Q"],1);
	$S72_q =  round( $dataArray2["Ch1"]["EQP"]["S7"]["Q"],1);
	
	$Frequency_hp2 = $dataArray2["Ch1"]["HP"]["Frequency"];
	$Frequency_lp2 = $dataArray2["Ch1"]["LP"]["Frequency"];
	$Enabled_hp2 = $dataArray2["Ch1"]["HP"]["Enable"];
	$Enabled_lp2 = $dataArray2["ICh1n2"]["LP"]["Enable"];
	$Type_hp2 = $dataArray2["Ch1"]["HP"]["Type"];
	$Type_lp2 = $dataArray2["Ch1"]["LP"]["Type"];
	
	$Enabled_compressor2 = $dataArray2["Ch1"]["Compressor"]["Enable"];
	$Threshold_compressor2 = $dataArray2["Ch1"]["Compressor"]["Threshold"];
	$Attack_compressor2 = $dataArray2["Ch1"]["Compressor"]["Attack"];
	$Hold_compressor2 = $dataArray2["Ch1"]["Compressor"]["Hold"];
	$Decay_compressor2 = $dataArray2["Ch1"]["Compressor"]["Decay"];
	$Knee_compressor2 = $dataArray2["Ch1"]["Compressor"]["Knee"];
	$Ratio_compressor2 = $dataArray2["Ch1"]["Compressor"]["Ratio"];
}

$router_enable_input1=1;
if($router_input1=='-144'){$router_enable_input1=0;}
$router_enable_input2=1;
if($router_input2=='-144'){$router_enable_input2=0;}
$router_enable_input3=1;
if($router_input3=='-144'){$router_enable_input3=0;}
$router_enable_input4=1;
if($router_input4=='-144'){$router_enable_input4=0;}

$router_enable_output1=1;
if($router_output1=='-144'){$router_enable_output1=0;}
$router_enable_output2=1;
if($router_output2=='-144'){$router_enable_output2=0;}
$router_enable_output3=1;
if($router_output3=='-144'){$router_enable_output3=0;}
$router_enable_output4=1;
if($router_output4=='-144'){$router_enable_output4=0;}
$router_enable_output5=1;
if($router_output5=='-144'){$router_enable_output5=0;}
$router_enable_output6=1;
if($router_output6=='-144'){$router_enable_output6=0;}

$router_enable_cg11=1;
if($router_cg11=='-144'){$router_enable_cg11=0;}
$router_enable_cg12=1;
if($router_cg12=='-144'){$router_enable_cg12=0;}
$router_enable_cg13=1;
if($router_cg13=='-144'){$router_enable_cg13=0;}
$router_enable_cg14=1;
if($router_cg14=='-144'){$router_enable_cg14=0;}
$router_enable_cg15=1;
if($router_cg15=='-144'){$router_enable_cg15=0;}
$router_enable_cg16=1;
if($router_cg16=='-144'){$router_enable_cg16=0;}

$router_enable_cg21=1;
if($router_cg21=='-144'){$router_enable_cg21=0;}
$router_enable_cg22=1;
if($router_cg22=='-144'){$router_enable_cg22=0;}
$router_enable_cg23=1;
if($router_cg23=='-144'){$router_enable_cg23=0;}
$router_enable_cg24=1;
if($router_cg24=='-144'){$router_enable_cg24=0;}
$router_enable_cg25=1;
if($router_cg25=='-144'){$router_enable_cg25=0;}
$router_enable_cg26=1;
if($router_cg26=='-144'){$router_enable_cg26=0;}

$router_enable_cg31=1;
if($router_cg31=='-144'){$router_enable_cg31=0;}
$router_enable_cg32=1;
if($router_cg32=='-144'){$router_enable_cg32=0;}
$router_enable_cg33=1;
if($router_cg33=='-144'){$router_enable_cg33=0;}
$router_enable_cg34=1;
if($router_cg34=='-144'){$router_enable_cg34=0;}
$router_enable_cg35=1;
if($router_cg35=='-144'){$router_enable_cg35=0;}
$router_enable_cg36=1;
if($router_cg36=='-144'){$router_enable_cg36=0;}

$router_enable_cg41=1;
if($router_cg41=='-144'){$router_enable_cg41=0;}
$router_enable_cg42=1;
if($router_cg42=='-144'){$router_enable_cg42=0;}
$router_enable_cg43=1;
if($router_cg43=='-144'){$router_enable_cg43=0;}
$router_enable_cg44=1;
if($router_cg44=='-144'){$router_enable_cg44=0;}
$router_enable_cg45=1;
if($router_cg45=='-144'){$router_enable_cg45=0;}
$router_enable_cg46=1;
if($router_cg46=='-144'){$router_enable_cg46=0;}

$Master_ducker = $dataArray2["Ducker"]["Master"];
$MasterIn1_ducker = 0;
$MasterIn2_ducker = 0;
$MasterIn3_ducker = 0;
$MasterIn4_ducker = 0;
if($Master_ducker=='IN1'){ 
	$MasterIn1_ducker = 1;
}
if($Master_ducker=='IN2'){ 
	$MasterIn2_ducker = 1;
}
if($Master_ducker=='IN3'){ 
	$MasterIn3_ducker = 1;
}
if($Master_ducker=='IN4'){ 
	$MasterIn4_ducker = 1;
}

$DuckedIn1_ducker = $dataArray2["Ducker"]["DuckedIn1"];
$DuckedIn2_ducker = $dataArray2["Ducker"]["DuckedIn2"];
$DuckedIn3_ducker = $dataArray2["Ducker"]["DuckedIn3"];
$DuckedIn4_ducker = $dataArray2["Ducker"]["DuckedIn4"];
$Threshold_ducker = $dataArray2["Ducker"]["Threshold"];
$Hold_ducker = $dataArray2["Ducker"]["Hold"];

$SignalGain1 = $dataArray2["In1"]["SignalGain"]["Gain"];
$SignalGain2 = $dataArray2["In2"]["SignalGain"]["Gain"];
$SignalGain3 = $dataArray2["In3"]["SignalGain"]["Gain"];
$SignalGain4 = $dataArray2["In4"]["SignalGain"]["Gain"];
$SignalGain5 = $dataArray2["In5"]["SignalGain"]["Gain"];
$SignalGain6 = $dataArray2["In6"]["SignalGain"]["Gain"];

$Mode1 = $dataArray2["In1"]["Mode"];
$Mode2 = $dataArray2["In2"]["Mode"];
$Mode3 = $dataArray2["In3"]["Mode"];
$Mode4 = $dataArray2["In4"]["Mode"];

$Phantom1 = $dataArray2["In1"]["Phantom"];
$Phantom2 = $dataArray2["In2"]["Phantom"];
$Phantom3 = $dataArray2["In3"]["Phantom"];
$Phantom4 = $dataArray2["In4"]["Phantom"];

$redirect_from_presets_upload = $_SESSION['redirect_from_presets_upload'];
$_SESSION['redirect_from_presets_upload'] = '';

?>

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="author" content="Bogen Communications LLC">
<meta name="copyright" content="Bogen Communications LLC">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<link rel="shortcut icon" href="">
<link rel="stylesheet" href="/css/styles.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/favicon.png" />
<title><?php echo $_SESSION['device_type']; ?> (<?php echo $_SESSION['device_name']; ?>) - DSP</title>
</head>

<body scroll="no" style="overflow: hidden">
<div class="main-container">

<input name="router_view" id="router_view" type="hidden" value="main">
<input name="channel" id="channel" type="hidden" value="1">
<input name="json_type" id="json_type" type="hidden" value="<?php echo $json_type; ?>">
<input name="redirect_from_presets_upload" id="redirect_from_presets_upload" type="hidden" value='<?php echo $redirect_from_presets_upload; ?>'>
	
<input name="mute1" id="mute1" type="hidden" value="<?php if($mute1==1){ echo 1;} else { echo 0;};?>">
<input name="mute2" id="mute2" type="hidden" value="<?php if($mute2==1){ echo 1;} else { echo 0;};?>">
<input name="mute3" id="mute3" type="hidden" value="<?php if($mute3==1){ echo 1;} else { echo 0;};?>">
<input name="mute4" id="mute4" type="hidden" value="<?php if($mute4==1){ echo 1;} else { echo 0;};?>">
<input name="mute5" id="mute5" type="hidden" value="<?php if($mute5==1){ echo 1;} else { echo 0;};?>">
<input name="mute6" id="mute6" type="hidden" value="<?php if($mute6==1){ echo 1;} else { echo 0;};?>">
	
<input name="slider1" id="slider1" type="hidden" value="<?php echo $volume1;?>">
<input name="slider2" id="slider2" type="hidden" value="<?php echo $volume2;?>">
<input name="slider3" id="slider3" type="hidden" value="<?php echo $volume3;?>">
<input name="slider4" id="slider4" type="hidden" value="<?php echo $volume4;?>">
<input name="slider5" id="slider5" type="hidden" value="<?php echo $volume5;?>">
<input name="slider6" id="slider6" type="hidden" value="<?php echo $volume6;?>">
<input name="slider7" id="slider7" type="hidden" value="<?php echo $volume7;?>">
<input name="slider8" id="slider8" type="hidden" value="<?php echo $volume8;?>">
	
<input name="label1" id="label1" type="hidden" value="<?php echo $name1;?>">
<input name="label2" id="label2" type="hidden" value="<?php echo $name2;?>">
<input name="label3" id="label3" type="hidden" value="<?php echo $name3;?>">
<input name="label4" id="label4" type="hidden" value="<?php echo $name4;?>">
<input name="label5" id="label5" type="hidden" value="<?php echo $name5;?>">
<input name="label6" id="label6" type="hidden" value="<?php echo $name6;?>">
<input name="label7" id="label7" type="hidden" value="<?php echo $name7;?>">
<input name="label8" id="label8" type="hidden" value="<?php echo $name8;?>">
	
<input name="color1" id="color1" type="hidden" value="<?php echo $color1;?>">
<input name="color2" id="color2" type="hidden" value="<?php echo $color2;?>">
<input name="color3" id="color3" type="hidden" value="<?php echo $color3;?>">
<input name="color4" id="color4" type="hidden" value="<?php echo $color4;?>">
<input name="color5" id="color5" type="hidden" value="<?php echo $color5;?>">
<input name="color6" id="color6" type="hidden" value="<?php echo $color6;?>">
<input name="color7" id="color7" type="hidden" value="<?php echo $color7;?>">
<input name="color8" id="color8" type="hidden" value="<?php echo $color8;?>">

<input name="level1" id="level1" type="hidden" value="<?php echo $level1;?>">
<input name="level2" id="level2" type="hidden" value="<?php echo $level2;?>">
<input name="level3" id="level3" type="hidden" value="<?php echo $level3;?>">
<input name="level4" id="level4" type="hidden" value="<?php echo $level4;?>">
<input name="level5" id="level5" type="hidden" value="<?php echo $level5;?>">
<input name="level6" id="level6" type="hidden" value="<?php echo $level6;?>">
<input name="level7" id="level7" type="hidden" value="<?php echo $level7;?>">
<input name="level8" id="level8" type="hidden" value="<?php echo $level8;?>">
	
<input name="levelIn1" id="levelIn1" type="hidden" value="<?php echo $levelIn1;?>">
<input name="levelIn2" id="levelIn2" type="hidden" value="<?php echo $levelIn2;?>">
<input name="levelIn3" id="levelIn3" type="hidden" value="<?php echo $levelIn3;?>">
<input name="levelIn4" id="levelIn4" type="hidden" value="<?php echo $levelIn4;?>">
	<?php if($json_type=='nqpaxxx'){ ?>
		<input name="levelIn5" id="levelIn5" type="hidden" value="<?php echo $levelIn5;?>">
		<input name="levelIn6" id="levelIn6" type="hidden" value="<?php echo $levelIn6;?>">	
	<?php } else { ?>
		<input name="levelIn5" id="levelIn5" type="hidden" value="">
		<input name="levelIn6" id="levelIn6" type="hidden" value="<?php echo $levelIn5;?>">	
	<?php } ?>

<input name="SpkMute" id="SpkMute" type="hidden" value="<?php if($SpkMute==1){ echo 1;} else { echo 0;};?>">
<input name="LineMute" id="LineMute" type="hidden" value="<?php if($LineMute==1){ echo 1;} else { echo 0;};?>">
<input name="SpkVol" id="SpkVol" type="hidden" value="<?php echo $SpkVol;?>">
<input name="LineVol" id="LineVol" type="hidden" value="<?php echo $LineVol;?>">
		
<input name="comp_level_in1" id="comp_level_in1" type="hidden" value="-144">
<input name="comp_level_in2" id="comp_level_in2" type="hidden" value="-144">
<input name="comp_level_in3" id="comp_level_in3" type="hidden" value="-144">
<input name="comp_level_in4" id="comp_level_in4" type="hidden" value="-144">
<input name="comp_level_in5" id="comp_level_in5" type="hidden" value="-144">
<input name="comp_level_in6" id="comp_level_in6" type="hidden" value="-144">
	
<input name="comp_level_out1" id="comp_level_out1" type="hidden" value="-144">
<input name="comp_level_out2" id="comp_level_out2" type="hidden" value="-144">
<input name="comp_level_out3" id="comp_level_out3" type="hidden" value="-144">
<input name="comp_level_out4" id="comp_level_out4" type="hidden" value="-144">
<input name="comp_level_out5" id="comp_level_out5" type="hidden" value="-144">
<input name="comp_level_out6" id="comp_level_out6" type="hidden" value="-144">
	
<input name="comp1" id="comp1" type="hidden" value="0">
<input name="comp2" id="comp2" type="hidden" value="0">
<input name="comp3" id="comp3" type="hidden" value="0">
<input name="comp4" id="comp4" type="hidden" value="0">
<input name="comp5" id="comp5" type="hidden" value="0">
<input name="comp6" id="comp6" type="hidden" value="0">
	
<input name="router_gain1" id="router_gain1" type="hidden" value="<?php echo $router_gain1;?>">
<input name="router_gain2" id="router_gain2" type="hidden" value="<?php echo $router_gain2;?>">
<input name="router_gain3" id="router_gain3" type="hidden" value="<?php echo $router_gain3;?>">
<input name="router_gain4" id="router_gain4" type="hidden" value="<?php echo $router_gain4;?>">
	
<input name="router_input1" id="router_input1" type="hidden" value="<?php echo $router_input1;?>">
<input name="router_input2" id="router_input2" type="hidden" value="<?php echo $router_input2;?>">
<input name="router_input3" id="router_input3" type="hidden" value="<?php echo $router_input3;?>">
<input name="router_input4" id="router_input4" type="hidden" value="<?php echo $router_input4;?>">
	
<input name="router_output1" id="router_output1" type="hidden" value="<?php echo $router_output1;?>">
<input name="router_output2" id="router_output2" type="hidden" value="<?php echo $router_output2;?>">
<input name="router_output3" id="router_output3" type="hidden" value="<?php echo $router_output3;?>">
<input name="router_output4" id="router_output4" type="hidden" value="<?php echo $router_output4;?>">
<input name="router_output5" id="router_output5" type="hidden" value="<?php echo $router_output5;?>">
<input name="router_output6" id="router_output6" type="hidden" value="<?php echo $router_output6;?>">
	
<input name="router_cg11" id="router_cg11" type="hidden" value="<?php echo $router_cg11;?>">
<input name="router_cg12" id="router_cg12" type="hidden" value="<?php echo $router_cg12;?>">
<input name="router_cg13" id="router_cg13" type="hidden" value="<?php echo $router_cg13;?>">
<input name="router_cg14" id="router_cg14" type="hidden" value="<?php echo $router_cg14;?>">
<input name="router_cg15" id="router_cg15" type="hidden" value="<?php echo $router_cg15;?>">
<input name="router_cg16" id="router_cg16" type="hidden" value="<?php echo $router_cg16;?>">
	
<input name="router_cg21" id="router_cg21" type="hidden" value="<?php echo $router_cg21;?>">
<input name="router_cg22" id="router_cg22" type="hidden" value="<?php echo $router_cg22;?>">
<input name="router_cg23" id="router_cg23" type="hidden" value="<?php echo $router_cg23;?>">
<input name="router_cg24" id="router_cg24" type="hidden" value="<?php echo $router_cg24;?>">
<input name="router_cg25" id="router_cg25" type="hidden" value="<?php echo $router_cg25;?>">
<input name="router_cg26" id="router_cg26" type="hidden" value="<?php echo $router_cg26;?>">

<input name="router_cg31" id="router_cg31" type="hidden" value="<?php echo $router_cg31;?>">
<input name="router_cg32" id="router_cg32" type="hidden" value="<?php echo $router_cg32;?>">
<input name="router_cg33" id="router_cg33" type="hidden" value="<?php echo $router_cg33;?>">
<input name="router_cg34" id="router_cg34" type="hidden" value="<?php echo $router_cg34;?>">
<input name="router_cg35" id="router_cg35" type="hidden" value="<?php echo $router_cg35;?>">
<input name="router_cg36" id="router_cg36" type="hidden" value="<?php echo $router_cg36;?>">
	
<input name="router_cg41" id="router_cg41" type="hidden" value="<?php echo $router_cg41;?>">
<input name="router_cg42" id="router_cg42" type="hidden" value="<?php echo $router_cg42;?>">
<input name="router_cg43" id="router_cg43" type="hidden" value="<?php echo $router_cg43;?>">
<input name="router_cg44" id="router_cg44" type="hidden" value="<?php echo $router_cg44;?>">
<input name="router_cg45" id="router_cg45" type="hidden" value="<?php echo $router_cg45;?>">
<input name="router_cg46" id="router_cg46" type="hidden" value="<?php echo $router_cg46;?>">
		
<input name="router_enable_input1" id="router_enable_input1" type="hidden" value="<?php echo $router_enable_input1; ?>">
<input name="router_enable_input2" id="router_enable_input2" type="hidden" value="<?php echo $router_enable_input2; ?>">
<input name="router_enable_input3" id="router_enable_input3" type="hidden" value="<?php echo $router_enable_input3; ?>">
<input name="router_enable_input4" id="router_enable_input4" type="hidden" value="<?php echo $router_enable_input4; ?>">
	
<input name="router_enable_output1" id="router_enable_output1" type="hidden" value="<?php echo $router_enable_output1; ?>">
<input name="router_enable_output2" id="router_enable_output2" type="hidden" value="<?php echo $router_enable_output2; ?>">
<input name="router_enable_output3" id="router_enable_output3" type="hidden" value="<?php echo $router_enable_output3; ?>">
<input name="router_enable_output4" id="router_enable_output4" type="hidden" value="<?php echo $router_enable_output4; ?>">
<input name="router_enable_output5" id="router_enable_output5" type="hidden" value="<?php echo $router_enable_output5; ?>">
<input name="router_enable_output6" id="router_enable_output6" type="hidden" value="<?php echo $router_enable_output6; ?>">
	
<input name="router_enable_cg11" id="router_enable_cg11" type="hidden" value="<?php echo $router_enable_cg11; ?>">
<input name="router_enable_cg12" id="router_enable_cg12" type="hidden" value="<?php echo $router_enable_cg12; ?>">
<input name="router_enable_cg13" id="router_enable_cg13" type="hidden" value="<?php echo $router_enable_cg13; ?>">
<input name="router_enable_cg14" id="router_enable_cg14" type="hidden" value="<?php echo $router_enable_cg14; ?>">
<input name="router_enable_cg15" id="router_enable_cg15" type="hidden" value="<?php echo $router_enable_cg15; ?>">
<input name="router_enable_cg16" id="router_enable_cg16" type="hidden" value="<?php echo $router_enable_cg16; ?>">

<input name="router_enable_cg21" id="router_enable_cg21" type="hidden" value="<?php echo $router_enable_cg21; ?>">
<input name="router_enable_cg22" id="router_enable_cg22" type="hidden" value="<?php echo $router_enable_cg22; ?>">
<input name="router_enable_cg23" id="router_enable_cg23" type="hidden" value="<?php echo $router_enable_cg23; ?>">
<input name="router_enable_cg24" id="router_enable_cg24" type="hidden" value="<?php echo $router_enable_cg24; ?>">
<input name="router_enable_cg25" id="router_enable_cg25" type="hidden" value="<?php echo $router_enable_cg25; ?>">
<input name="router_enable_cg26" id="router_enable_cg26" type="hidden" value="<?php echo $router_enable_cg26; ?>">
	
<input name="router_enable_cg31" id="router_enable_cg31" type="hidden" value="<?php echo $router_enable_cg31; ?>">
<input name="router_enable_cg32" id="router_enable_cg32" type="hidden" value="<?php echo $router_enable_cg32; ?>">
<input name="router_enable_cg33" id="router_enable_cg33" type="hidden" value="<?php echo $router_enable_cg33; ?>">
<input name="router_enable_cg34" id="router_enable_cg34" type="hidden" value="<?php echo $router_enable_cg34; ?>">
<input name="router_enable_cg35" id="router_enable_cg35" type="hidden" value="<?php echo $router_enable_cg35; ?>">
<input name="router_enable_cg36" id="router_enable_cg36" type="hidden" value="<?php echo $router_enable_cg36; ?>">
	
<input name="router_enable_cg41" id="router_enable_cg41" type="hidden" value="<?php echo $router_enable_cg41; ?>">
<input name="router_enable_cg42" id="router_enable_cg42" type="hidden" value="<?php echo $router_enable_cg42; ?>">
<input name="router_enable_cg43" id="router_enable_cg43" type="hidden" value="<?php echo $router_enable_cg43; ?>">
<input name="router_enable_cg44" id="router_enable_cg44" type="hidden" value="<?php echo $router_enable_cg44; ?>">
<input name="router_enable_cg45" id="router_enable_cg45" type="hidden" value="<?php echo $router_enable_cg45; ?>">
<input name="router_enable_cg46" id="router_enable_cg46" type="hidden" value="<?php echo $router_enable_cg46; ?>">
		
<input name="GEQ25HZ1_fader" id="GEQ25HZ1_fader" type="hidden" value="<?php echo $GEQ25HZ1_fader;?>">
<input name="GEQ40HZ1_fader" id="GEQ40HZ1_fader" type="hidden" value="<?php echo $GEQ40HZ1_fader;?>">
<input name="GEQ63HZ1_fader" id="GEQ63HZ1_fader" type="hidden" value="<?php echo $GEQ63HZ1_fader;?>">
<input name="GEQ100HZ1_fader" id="GEQ100HZ1_fader" type="hidden" value="<?php echo $GEQ100HZ1_fader;?>">
<input name="GEQ160HZ1_fader" id="GEQ160HZ1_fader" type="hidden" value="<?php echo $GEQ160HZ1_fader;?>">
<input name="GEQ250HZ1_fader" id="GEQ250HZ1_fader" type="hidden" value="<?php echo $GEQ250HZ1_fader;?>">
<input name="GEQ400HZ1_fader" id="GEQ400HZ1_fader" type="hidden" value="<?php echo $GEQ400HZ1_fader;?>">
<input name="GEQ630HZ1_fader" id="GEQ630HZ1_fader" type="hidden" value="<?php echo $GEQ630HZ1_fader;?>">
<input name="GEQ1000HZ1_fader" id="GEQ1000HZ1_fader" type="hidden" value="<?php echo $GEQ1000HZ1_fader;?>">
<input name="GEQ1600HZ1_fader" id="GEQ1600HZ1_fader" type="hidden" value="<?php echo $GEQ1600HZ1_fader;?>">
<input name="GEQ2500HZ1_fader" id="GEQ2500HZ1_fader" type="hidden" value="<?php echo $GEQ2500HZ1_fader;?>">
<input name="GEQ4000HZ1_fader" id="GEQ4000HZ1_fader" type="hidden" value="<?php echo $GEQ4000HZ1_fader;?>">	
<input name="GEQ6300HZ1_fader" id="GEQ6300HZ1_fader" type="hidden" value="<?php echo $GEQ6300HZ1_fader;?>">
<input name="GEQ10000HZ1_fader" id="GEQ10000HZ1_fader" type="hidden" value="<?php echo $GEQ10000HZ1_fader;?>">
<input name="GEQ16000HZ1_fader" id="GEQ16000HZ1_fader" type="hidden" value="<?php echo $GEQ16000HZ1_fader;?>">
<input name="GEQ20000HZ1_fader" id="GEQ20000HZ1_fader" type="hidden" value="<?php echo $GEQ20000HZ1_fader;?>">
	
<input name="GEQ25HZ1_enable" id="GEQ25HZ1_enable" type="hidden" value="<?php echo $GEQ25HZ1_enable;?>">	
<input name="GEQ40HZ1_enable" id="GEQ40HZ1_enable" type="hidden" value="<?php echo $GEQ40HZ1_enable;?>">
<input name="GEQ63HZ1_enable" id="GEQ63HZ1_enable" type="hidden" value="<?php echo $GEQ63HZ1_enable;?>">
<input name="GEQ100HZ1_enable" id="GEQ100HZ1_enable" type="hidden" value="<?php echo $GEQ100HZ1_enable;?>">
<input name="GEQ160HZ1_enable" id="GEQ160HZ1_enable" type="hidden" value="<?php echo $GEQ160HZ1_enable;?>">
<input name="GEQ250HZ1_enable" id="GEQ250HZ1_enable" type="hidden" value="<?php echo $GEQ250HZ1_enable;?>">
<input name="GEQ400HZ1_enable" id="GEQ400HZ1_enable" type="hidden" value="<?php echo $GEQ400HZ1_enable;?>">
<input name="GEQ630HZ1_enable" id="GEQ630HZ1_enable" type="hidden" value="<?php echo $GEQ630HZ1_enable;?>">
<input name="GEQ1000HZ1_enable" id="GEQ1000HZ1_enable" type="hidden" value="<?php echo $GEQ1000HZ1_enable;?>">
<input name="GEQ1600HZ1_enable" id="GEQ1600HZ1_enable" type="hidden" value="<?php echo $GEQ1600HZ1_enable;?>">
<input name="GEQ2500HZ1_enable" id="GEQ2500HZ1_enable" type="hidden" value="<?php echo $GEQ2500HZ1_enable;?>">
<input name="GEQ4000HZ1_enable" id="GEQ4000HZ1_enable" type="hidden" value="<?php echo $GEQ4000HZ1_enable;?>">
<input name="GEQ6300HZ1_enable" id="GEQ6300HZ1_enable" type="hidden" value="<?php echo $GEQ6300HZ1_enable;?>">
<input name="GEQ10000HZ1_enable" id="GEQ10000HZ1_enable" type="hidden" value="<?php echo $GEQ10000HZ1_enable;?>">
<input name="GEQ16000HZ1_enable" id="GEQ16000HZ1_enable" type="hidden" value="<?php echo $GEQ16000HZ1_enable;?>">
<input name="GEQ20000HZ1_enable" id="GEQ20000HZ1_enable" type="hidden" value="<?php echo $GEQ20000HZ1_enable;?>">
	
<input name="GEQ25HZ2_fader" id="GEQ25HZ2_fader" type="hidden" value="<?php echo $GEQ25HZ2_fader;?>">
<input name="GEQ40HZ2_fader" id="GEQ40HZ2_fader" type="hidden" value="<?php echo $GEQ40HZ2_fader;?>">
<input name="GEQ63HZ2_fader" id="GEQ63HZ2_fader" type="hidden" value="<?php echo $GEQ63HZ2_fader;?>">
<input name="GEQ100HZ2_fader" id="GEQ100HZ2_fader" type="hidden" value="<?php echo $GEQ100HZ2_fader;?>">
<input name="GEQ160HZ2_fader" id="GEQ160HZ2_fader" type="hidden" value="<?php echo $GEQ160HZ2_fader;?>">
<input name="GEQ250HZ2_fader" id="GEQ250HZ2_fader" type="hidden" value="<?php echo $GEQ250HZ2_fader;?>">
<input name="GEQ400HZ2_fader" id="GEQ400HZ2_fader" type="hidden" value="<?php echo $GEQ400HZ2_fader;?>">
<input name="GEQ630HZ2_fader" id="GEQ630HZ2_fader" type="hidden" value="<?php echo $GEQ630HZ2_fader;?>">
<input name="GEQ1000HZ2_fader" id="GEQ1000HZ2_fader" type="hidden" value="<?php echo $GEQ1000HZ2_fader;?>">
<input name="GEQ1600HZ2_fader" id="GEQ1600HZ2_fader" type="hidden" value="<?php echo $GEQ1600HZ2_fader;?>">
<input name="GEQ2500HZ2_fader" id="GEQ2500HZ2_fader" type="hidden" value="<?php echo $GEQ2500HZ2_fader;?>">
<input name="GEQ4000HZ2_fader" id="GEQ4000HZ2_fader" type="hidden" value="<?php echo $GEQ4000HZ2_fader;?>">	
<input name="GEQ6300HZ2_fader" id="GEQ6300HZ2_fader" type="hidden" value="<?php echo $GEQ6300HZ2_fader;?>">
<input name="GEQ10000HZ2_fader" id="GEQ10000HZ2_fader" type="hidden" value="<?php echo $GEQ10000HZ2_fader;?>">
<input name="GEQ16000HZ2_fader" id="GEQ16000HZ2_fader" type="hidden" value="<?php echo $GEQ16000HZ2_fader;?>">
<input name="GEQ20000HZ2_fader" id="GEQ20000HZ2_fader" type="hidden" value="<?php echo $GEQ20000HZ2_fader;?>">
	
<input name="GEQ25HZ2_enable" id="GEQ25HZ2_enable" type="hidden" value="<?php echo $GEQ25HZ2_enable;?>">	
<input name="GEQ40HZ2_enable" id="GEQ40HZ2_enable" type="hidden" value="<?php echo $GEQ40HZ2_enable;?>">
<input name="GEQ63HZ2_enable" id="GEQ63HZ2_enable" type="hidden" value="<?php echo $GEQ63HZ2_enable;?>">
<input name="GEQ100HZ2_enable" id="GEQ100HZ2_enable" type="hidden" value="<?php echo $GEQ100HZ2_enable;?>">
<input name="GEQ160HZ2_enable" id="GEQ160HZ2_enable" type="hidden" value="<?php echo $GEQ160HZ2_enable;?>">
<input name="GEQ250HZ2_enable" id="GEQ250HZ2_enable" type="hidden" value="<?php echo $GEQ250HZ2_enable;?>">
<input name="GEQ400HZ2_enable" id="GEQ400HZ2_enable" type="hidden" value="<?php echo $GEQ400HZ2_enable;?>">
<input name="GEQ630HZ2_enable" id="GEQ630HZ2_enable" type="hidden" value="<?php echo $GEQ630HZ2_enable;?>">
<input name="GEQ1000HZ2_enable" id="GEQ1000HZ2_enable" type="hidden" value="<?php echo $GEQ1000HZ2_enable;?>">
<input name="GEQ1600HZ2_enable" id="GEQ1600HZ2_enable" type="hidden" value="<?php echo $GEQ1600HZ2_enable;?>">
<input name="GEQ2500HZ2_enable" id="GEQ2500HZ2_enable" type="hidden" value="<?php echo $GEQ2500HZ2_enable;?>">
<input name="GEQ4000HZ2_enable" id="GEQ4000HZ2_enable" type="hidden" value="<?php echo $GEQ4000HZ2_enable;?>">
<input name="GEQ6300HZ2_enable" id="GEQ6300HZ2_enable" type="hidden" value="<?php echo $GEQ6300HZ2_enable;?>">
<input name="GEQ10000HZ2_enable" id="GEQ10000HZ2_enable" type="hidden" value="<?php echo $GEQ10000HZ2_enable;?>">
<input name="GEQ16000HZ2_enable" id="GEQ16000HZ2_enable" type="hidden" value="<?php echo $GEQ16000HZ2_enable;?>">
<input name="GEQ20000HZ2_enable" id="GEQ20000HZ2_enable" type="hidden" value="<?php echo $GEQ20000HZ2_enable;?>">
	
<input name="GEQ25HZ3_fader" id="GEQ25HZ3_fader" type="hidden" value="<?php echo $GEQ25HZ3_fader;?>">
<input name="GEQ40HZ3_fader" id="GEQ40HZ3_fader" type="hidden" value="<?php echo $GEQ40HZ3_fader;?>">
<input name="GEQ63HZ3_fader" id="GEQ63HZ3_fader" type="hidden" value="<?php echo $GEQ63HZ3_fader;?>">
<input name="GEQ100HZ3_fader" id="GEQ100HZ3_fader" type="hidden" value="<?php echo $GEQ100HZ3_fader;?>">
<input name="GEQ160HZ3_fader" id="GEQ160HZ3_fader" type="hidden" value="<?php echo $GEQ160HZ3_fader;?>">
<input name="GEQ250HZ3_fader" id="GEQ250HZ3_fader" type="hidden" value="<?php echo $GEQ250HZ3_fader;?>">
<input name="GEQ400HZ3_fader" id="GEQ400HZ3_fader" type="hidden" value="<?php echo $GEQ400HZ3_fader;?>">
<input name="GEQ630HZ3_fader" id="GEQ630HZ3_fader" type="hidden" value="<?php echo $GEQ630HZ3_fader;?>">
<input name="GEQ1000HZ3_fader" id="GEQ1000HZ3_fader" type="hidden" value="<?php echo $GEQ1000HZ3_fader;?>">
<input name="GEQ1600HZ3_fader" id="GEQ1600HZ3_fader" type="hidden" value="<?php echo $GEQ1600HZ3_fader;?>">
<input name="GEQ2500HZ3_fader" id="GEQ2500HZ3_fader" type="hidden" value="<?php echo $GEQ2500HZ3_fader;?>">
<input name="GEQ4000HZ3_fader" id="GEQ4000HZ3_fader" type="hidden" value="<?php echo $GEQ4000HZ3_fader;?>">	
<input name="GEQ6300HZ3_fader" id="GEQ6300HZ3_fader" type="hidden" value="<?php echo $GEQ6300HZ3_fader;?>">
<input name="GEQ10000HZ3_fader" id="GEQ10000HZ3_fader" type="hidden" value="<?php echo $GEQ10000HZ3_fader;?>">
<input name="GEQ16000HZ3_fader" id="GEQ16000HZ3_fader" type="hidden" value="<?php echo $GEQ16000HZ3_fader;?>">
<input name="GEQ20000HZ3_fader" id="GEQ20000HZ3_fader" type="hidden" value="<?php echo $GEQ20000HZ3_fader;?>">
	
<input name="GEQ25HZ3_enable" id="GEQ25HZ3_enable" type="hidden" value="<?php echo $GEQ25HZ3_enable;?>">	
<input name="GEQ40HZ3_enable" id="GEQ40HZ3_enable" type="hidden" value="<?php echo $GEQ40HZ3_enable;?>">
<input name="GEQ63HZ3_enable" id="GEQ63HZ3_enable" type="hidden" value="<?php echo $GEQ63HZ3_enable;?>">
<input name="GEQ100HZ3_enable" id="GEQ100HZ3_enable" type="hidden" value="<?php echo $GEQ100HZ3_enable;?>">
<input name="GEQ160HZ3_enable" id="GEQ160HZ3_enable" type="hidden" value="<?php echo $GEQ160HZ3_enable;?>">
<input name="GEQ250HZ3_enable" id="GEQ250HZ3_enable" type="hidden" value="<?php echo $GEQ250HZ3_enable;?>">
<input name="GEQ400HZ3_enable" id="GEQ400HZ3_enable" type="hidden" value="<?php echo $GEQ400HZ3_enable;?>">
<input name="GEQ630HZ3_enable" id="GEQ630HZ3_enable" type="hidden" value="<?php echo $GEQ630HZ3_enable;?>">
<input name="GEQ1000HZ3_enable" id="GEQ1000HZ3_enable" type="hidden" value="<?php echo $GEQ1000HZ3_enable;?>">
<input name="GEQ1600HZ3_enable" id="GEQ1600HZ3_enable" type="hidden" value="<?php echo $GEQ1600HZ3_enable;?>">
<input name="GEQ2500HZ3_enable" id="GEQ2500HZ3_enable" type="hidden" value="<?php echo $GEQ2500HZ3_enable;?>">
<input name="GEQ4000HZ3_enable" id="GEQ4000HZ3_enable" type="hidden" value="<?php echo $GEQ4000HZ3_enable;?>">
<input name="GEQ6300HZ3_enable" id="GEQ6300HZ3_enable" type="hidden" value="<?php echo $GEQ6300HZ3_enable;?>">
<input name="GEQ10000HZ3_enable" id="GEQ10000HZ3_enable" type="hidden" value="<?php echo $GEQ10000HZ3_enable;?>">
<input name="GEQ16000HZ3_enable" id="GEQ16000HZ3_enable" type="hidden" value="<?php echo $GEQ16000HZ3_enable;?>">
<input name="GEQ20000HZ3_enable" id="GEQ20000HZ3_enable" type="hidden" value="<?php echo $GEQ20000HZ3_enable;?>">
	
<input name="GEQ25HZ4_fader" id="GEQ25HZ4_fader" type="hidden" value="<?php echo $GEQ25HZ4_fader;?>">
<input name="GEQ40HZ4_fader" id="GEQ40HZ4_fader" type="hidden" value="<?php echo $GEQ40HZ4_fader;?>">
<input name="GEQ63HZ4_fader" id="GEQ63HZ4_fader" type="hidden" value="<?php echo $GEQ63HZ4_fader;?>">
<input name="GEQ100HZ4_fader" id="GEQ100HZ4_fader" type="hidden" value="<?php echo $GEQ100HZ4_fader;?>">
<input name="GEQ160HZ4_fader" id="GEQ160HZ4_fader" type="hidden" value="<?php echo $GEQ160HZ4_fader;?>">
<input name="GEQ250HZ4_fader" id="GEQ250HZ4_fader" type="hidden" value="<?php echo $GEQ250HZ4_fader;?>">
<input name="GEQ400HZ4_fader" id="GEQ400HZ4_fader" type="hidden" value="<?php echo $GEQ400HZ4_fader;?>">
<input name="GEQ630HZ4_fader" id="GEQ630HZ4_fader" type="hidden" value="<?php echo $GEQ630HZ4_fader;?>">
<input name="GEQ1000HZ4_fader" id="GEQ1000HZ4_fader" type="hidden" value="<?php echo $GEQ1000HZ4_fader;?>">
<input name="GEQ1600HZ4_fader" id="GEQ1600HZ4_fader" type="hidden" value="<?php echo $GEQ1600HZ4_fader;?>">
<input name="GEQ2500HZ4_fader" id="GEQ2500HZ4_fader" type="hidden" value="<?php echo $GEQ2500HZ4_fader;?>">
<input name="GEQ4000HZ4_fader" id="GEQ4000HZ4_fader" type="hidden" value="<?php echo $GEQ4000HZ4_fader;?>">	
<input name="GEQ6300HZ4_fader" id="GEQ6300HZ4_fader" type="hidden" value="<?php echo $GEQ6300HZ4_fader;?>">
<input name="GEQ10000HZ4_fader" id="GEQ10000HZ4_fader" type="hidden" value="<?php echo $GEQ10000HZ4_fader;?>">
<input name="GEQ16000HZ4_fader" id="GEQ16000HZ4_fader" type="hidden" value="<?php echo $GEQ16000HZ4_fader;?>">
<input name="GEQ20000HZ4_fader" id="GEQ20000HZ4_fader" type="hidden" value="<?php echo $GEQ20000HZ4_fader;?>">
	
<input name="GEQ25HZ4_enable" id="GEQ25HZ4_enable" type="hidden" value="<?php echo $GEQ25HZ4_enable;?>">	
<input name="GEQ40HZ4_enable" id="GEQ40HZ4_enable" type="hidden" value="<?php echo $GEQ40HZ4_enable;?>">
<input name="GEQ63HZ4_enable" id="GEQ63HZ4_enable" type="hidden" value="<?php echo $GEQ63HZ4_enable;?>">
<input name="GEQ100HZ4_enable" id="GEQ100HZ4_enable" type="hidden" value="<?php echo $GEQ100HZ4_enable;?>">
<input name="GEQ160HZ4_enable" id="GEQ160HZ4_enable" type="hidden" value="<?php echo $GEQ160HZ4_enable;?>">
<input name="GEQ250HZ4_enable" id="GEQ250HZ4_enable" type="hidden" value="<?php echo $GEQ250HZ4_enable;?>">
<input name="GEQ400HZ4_enable" id="GEQ400HZ4_enable" type="hidden" value="<?php echo $GEQ400HZ4_enable;?>">
<input name="GEQ630HZ4_enable" id="GEQ630HZ4_enable" type="hidden" value="<?php echo $GEQ630HZ4_enable;?>">
<input name="GEQ1000HZ4_enable" id="GEQ1000HZ4_enable" type="hidden" value="<?php echo $GEQ1000HZ4_enable;?>">
<input name="GEQ1600HZ4_enable" id="GEQ1600HZ4_enable" type="hidden" value="<?php echo $GEQ1600HZ4_enable;?>">
<input name="GEQ2500HZ4_enable" id="GEQ2500HZ4_enable" type="hidden" value="<?php echo $GEQ2500HZ4_enable;?>">
<input name="GEQ4000HZ4_enable" id="GEQ4000HZ4_enable" type="hidden" value="<?php echo $GEQ4000HZ4_enable;?>">
<input name="GEQ6300HZ4_enable" id="GEQ6300HZ4_enable" type="hidden" value="<?php echo $GEQ6300HZ4_enable;?>">
<input name="GEQ10000HZ4_enable" id="GEQ10000HZ4_enable" type="hidden" value="<?php echo $GEQ10000HZ4_enable;?>">
<input name="GEQ16000HZ4_enable" id="GEQ16000HZ4_enable" type="hidden" value="<?php echo $GEQ16000HZ4_enable;?>">
<input name="GEQ20000HZ4_enable" id="GEQ20000HZ4_enable" type="hidden" value="<?php echo $GEQ20000HZ4_enable;?>">
	
<input name="GEQ25HZ5_fader" id="GEQ25HZ5_fader" type="hidden" value="<?php echo $GEQ25HZ5_fader;?>">
<input name="GEQ40HZ5_fader" id="GEQ40HZ5_fader" type="hidden" value="<?php echo $GEQ40HZ5_fader;?>">
<input name="GEQ63HZ5_fader" id="GEQ63HZ5_fader" type="hidden" value="<?php echo $GEQ63HZ5_fader;?>">
<input name="GEQ100HZ5_fader" id="GEQ100HZ5_fader" type="hidden" value="<?php echo $GEQ100HZ5_fader;?>">
<input name="GEQ160HZ5_fader" id="GEQ160HZ5_fader" type="hidden" value="<?php echo $GEQ160HZ5_fader;?>">
<input name="GEQ250HZ5_fader" id="GEQ250HZ5_fader" type="hidden" value="<?php echo $GEQ250HZ5_fader;?>">
<input name="GEQ400HZ5_fader" id="GEQ400HZ5_fader" type="hidden" value="<?php echo $GEQ400HZ5_fader;?>">
<input name="GEQ630HZ5_fader" id="GEQ630HZ5_fader" type="hidden" value="<?php echo $GEQ630HZ5_fader;?>">
<input name="GEQ1000HZ5_fader" id="GEQ1000HZ5_fader" type="hidden" value="<?php echo $GEQ1000HZ5_fader;?>">
<input name="GEQ1600HZ5_fader" id="GEQ1600HZ5_fader" type="hidden" value="<?php echo $GEQ1600HZ5_fader;?>">
<input name="GEQ2500HZ5_fader" id="GEQ2500HZ5_fader" type="hidden" value="<?php echo $GEQ2500HZ5_fader;?>">
<input name="GEQ4000HZ5_fader" id="GEQ4000HZ5_fader" type="hidden" value="<?php echo $GEQ4000HZ5_fader;?>">	
<input name="GEQ6300HZ5_fader" id="GEQ6300HZ5_fader" type="hidden" value="<?php echo $GEQ6300HZ5_fader;?>">
<input name="GEQ10000HZ5_fader" id="GEQ10000HZ5_fader" type="hidden" value="<?php echo $GEQ10000HZ5_fader;?>">
<input name="GEQ16000HZ5_fader" id="GEQ16000HZ5_fader" type="hidden" value="<?php echo $GEQ16000HZ5_fader;?>">
<input name="GEQ20000HZ5_fader" id="GEQ20000HZ5_fader" type="hidden" value="<?php echo $GEQ20000HZ5_fader;?>">
	
<input name="GEQ25HZ5_enable" id="GEQ25HZ5_enable" type="hidden" value="<?php echo $GEQ25HZ5_enable;?>">	
<input name="GEQ40HZ5_enable" id="GEQ40HZ5_enable" type="hidden" value="<?php echo $GEQ40HZ5_enable;?>">
<input name="GEQ63HZ5_enable" id="GEQ63HZ5_enable" type="hidden" value="<?php echo $GEQ63HZ5_enable;?>">
<input name="GEQ100HZ5_enable" id="GEQ100HZ5_enable" type="hidden" value="<?php echo $GEQ100HZ5_enable;?>">
<input name="GEQ160HZ5_enable" id="GEQ160HZ5_enable" type="hidden" value="<?php echo $GEQ160HZ5_enable;?>">
<input name="GEQ250HZ5_enable" id="GEQ250HZ5_enable" type="hidden" value="<?php echo $GEQ250HZ5_enable;?>">
<input name="GEQ400HZ5_enable" id="GEQ400HZ5_enable" type="hidden" value="<?php echo $GEQ400HZ5_enable;?>">
<input name="GEQ630HZ5_enable" id="GEQ630HZ5_enable" type="hidden" value="<?php echo $GEQ630HZ5_enable;?>">
<input name="GEQ1000HZ5_enable" id="GEQ1000HZ5_enable" type="hidden" value="<?php echo $GEQ1000HZ5_enable;?>">
<input name="GEQ1600HZ5_enable" id="GEQ1600HZ5_enable" type="hidden" value="<?php echo $GEQ1600HZ5_enable;?>">
<input name="GEQ2500HZ5_enable" id="GEQ2500HZ5_enable" type="hidden" value="<?php echo $GEQ2500HZ5_enable;?>">
<input name="GEQ4000HZ5_enable" id="GEQ4000HZ5_enable" type="hidden" value="<?php echo $GEQ4000HZ5_enable;?>">
<input name="GEQ6300HZ5_enable" id="GEQ6300HZ5_enable" type="hidden" value="<?php echo $GEQ6300HZ5_enable;?>">
<input name="GEQ10000HZ5_enable" id="GEQ10000HZ5_enable" type="hidden" value="<?php echo $GEQ10000HZ5_enable;?>">
<input name="GEQ16000HZ5_enable" id="GEQ16000HZ5_enable" type="hidden" value="<?php echo $GEQ16000HZ5_enable;?>">
<input name="GEQ20000HZ5_enable" id="GEQ20000HZ5_enable" type="hidden" value="<?php echo $GEQ20000HZ5_enable;?>">
	
<input name="GEQ25HZ6_fader" id="GEQ25HZ6_fader" type="hidden" value="<?php echo $GEQ25HZ6_fader;?>">
<input name="GEQ40HZ6_fader" id="GEQ40HZ6_fader" type="hidden" value="<?php echo $GEQ40HZ6_fader;?>">
<input name="GEQ63HZ6_fader" id="GEQ63HZ6_fader" type="hidden" value="<?php echo $GEQ63HZ6_fader;?>">
<input name="GEQ100HZ6_fader" id="GEQ100HZ6_fader" type="hidden" value="<?php echo $GEQ100HZ6_fader;?>">
<input name="GEQ160HZ6_fader" id="GEQ160HZ6_fader" type="hidden" value="<?php echo $GEQ160HZ6_fader;?>">
<input name="GEQ250HZ6_fader" id="GEQ250HZ6_fader" type="hidden" value="<?php echo $GEQ250HZ6_fader;?>">
<input name="GEQ400HZ6_fader" id="GEQ400HZ6_fader" type="hidden" value="<?php echo $GEQ400HZ6_fader;?>">
<input name="GEQ630HZ6_fader" id="GEQ630HZ6_fader" type="hidden" value="<?php echo $GEQ630HZ6_fader;?>">
<input name="GEQ1000HZ6_fader" id="GEQ1000HZ6_fader" type="hidden" value="<?php echo $GEQ1000HZ6_fader;?>">
<input name="GEQ1600HZ6_fader" id="GEQ1600HZ6_fader" type="hidden" value="<?php echo $GEQ1600HZ6_fader;?>">
<input name="GEQ2500HZ6_fader" id="GEQ2500HZ6_fader" type="hidden" value="<?php echo $GEQ2500HZ6_fader;?>">
<input name="GEQ4000HZ6_fader" id="GEQ4000HZ6_fader" type="hidden" value="<?php echo $GEQ4000HZ6_fader;?>">	
<input name="GEQ6300HZ6_fader" id="GEQ6300HZ6_fader" type="hidden" value="<?php echo $GEQ6300HZ6_fader;?>">
<input name="GEQ10000HZ6_fader" id="GEQ10000HZ6_fader" type="hidden" value="<?php echo $GEQ10000HZ6_fader;?>">
<input name="GEQ16000HZ6_fader" id="GEQ16000HZ6_fader" type="hidden" value="<?php echo $GEQ16000HZ6_fader;?>">
<input name="GEQ20000HZ6_fader" id="GEQ20000HZ6_fader" type="hidden" value="<?php echo $GEQ20000HZ6_fader;?>">
	
<input name="GEQ25HZ6_enable" id="GEQ25HZ6_enable" type="hidden" value="<?php echo $GEQ25HZ6_enable;?>">	
<input name="GEQ40HZ6_enable" id="GEQ40HZ6_enable" type="hidden" value="<?php echo $GEQ40HZ6_enable;?>">
<input name="GEQ63HZ6_enable" id="GEQ63HZ6_enable" type="hidden" value="<?php echo $GEQ63HZ6_enable;?>">
<input name="GEQ100HZ6_enable" id="GEQ100HZ6_enable" type="hidden" value="<?php echo $GEQ100HZ6_enable;?>">
<input name="GEQ160HZ6_enable" id="GEQ160HZ6_enable" type="hidden" value="<?php echo $GEQ160HZ6_enable;?>">
<input name="GEQ250HZ6_enable" id="GEQ250HZ6_enable" type="hidden" value="<?php echo $GEQ250HZ6_enable;?>">
<input name="GEQ400HZ6_enable" id="GEQ400HZ6_enable" type="hidden" value="<?php echo $GEQ400HZ6_enable;?>">
<input name="GEQ630HZ6_enable" id="GEQ630HZ6_enable" type="hidden" value="<?php echo $GEQ630HZ6_enable;?>">
<input name="GEQ1000HZ6_enable" id="GEQ1000HZ6_enable" type="hidden" value="<?php echo $GEQ1000HZ6_enable;?>">
<input name="GEQ1600HZ6_enable" id="GEQ1600HZ6_enable" type="hidden" value="<?php echo $GEQ1600HZ6_enable;?>">
<input name="GEQ2500HZ6_enable" id="GEQ2500HZ6_enable" type="hidden" value="<?php echo $GEQ2500HZ6_enable;?>">
<input name="GEQ4000HZ6_enable" id="GEQ4000HZ6_enable" type="hidden" value="<?php echo $GEQ4000HZ6_enable;?>">
<input name="GEQ6300HZ6_enable" id="GEQ6300HZ6_enable" type="hidden" value="<?php echo $GEQ6300HZ6_enable;?>">
<input name="GEQ10000HZ6_enable" id="GEQ10000HZ6_enable" type="hidden" value="<?php echo $GEQ10000HZ6_enable;?>">
<input name="GEQ16000HZ6_enable" id="GEQ16000HZ6_enable" type="hidden" value="<?php echo $GEQ16000HZ6_enable;?>">
<input name="GEQ20000HZ6_enable" id="GEQ20000HZ6_enable" type="hidden" value="<?php echo $GEQ20000HZ6_enable;?>">
		
<input name="S11_fader" id="S11_fader" type="hidden" value="<?php echo $S11_fader;?>">
<input name="S21_fader" id="S21_fader" type="hidden" value="<?php echo $S21_fader;?>">
<input name="S31_fader" id="S31_fader" type="hidden" value="<?php echo $S31_fader;?>">
<input name="S41_fader" id="S41_fader" type="hidden" value="<?php echo $S41_fader;?>">
<input name="S51_fader" id="S51_fader" type="hidden" value="<?php echo $S51_fader;?>">
<input name="S61_fader" id="S61_fader" type="hidden" value="<?php echo $S61_fader;?>">
<input name="S71_fader" id="S71_fader" type="hidden" value="<?php echo $S71_fader;?>">
	
<input name="S11_enable" id="S11_enable" type="hidden" value="<?php echo $S11_enable;?>">	
<input name="S21_enable" id="S21_enable" type="hidden" value="<?php echo $S21_enable;?>">
<input name="S31_enable" id="S31_enable" type="hidden" value="<?php echo $S31_enable;?>">
<input name="S41_enable" id="S41_enable" type="hidden" value="<?php echo $S41_enable;?>">
<input name="S51_enable" id="S51_enable" type="hidden" value="<?php echo $S51_enable;?>">
<input name="S61_enable" id="S61_enable" type="hidden" value="<?php echo $S61_enable;?>">
<input name="S71_enable" id="S71_enable" type="hidden" value="<?php echo $S71_enable;?>">
	
<input name="S11_freq" id="S11_freq" type="hidden" value="<?php echo $S11_freq;?>">
<input name="S21_freq" id="S21_freq" type="hidden" value="<?php echo $S21_freq;?>">
<input name="S31_freq" id="S31_freq" type="hidden" value="<?php echo $S31_freq;?>">
<input name="S41_freq" id="S41_freq" type="hidden" value="<?php echo $S41_freq;?>">
<input name="S51_freq" id="S51_freq" type="hidden" value="<?php echo $S51_freq;?>">
<input name="S61_freq" id="S61_freq" type="hidden" value="<?php echo $S61_freq;?>">
<input name="S71_freq" id="S71_freq" type="hidden" value="<?php echo $S71_freq;?>">
	
<input name="S11_q" id="S11_q" type="hidden" value="<?php echo $S11_q;?>">
<input name="S21_q" id="S21_q" type="hidden" value="<?php echo $S21_q;?>">
<input name="S31_q" id="S31_q" type="hidden" value="<?php echo $S31_q;?>">
<input name="S41_q" id="S41_q" type="hidden" value="<?php echo $S41_q;?>">
<input name="S51_q" id="S51_q" type="hidden" value="<?php echo $S51_q;?>">
<input name="S61_q" id="S61_q" type="hidden" value="<?php echo $S61_q;?>">
<input name="S71_q" id="S71_q" type="hidden" value="<?php echo $S71_q;?>">
	
<input name="S12_fader" id="S12_fader" type="hidden" value="<?php echo $S12_fader;?>">
<input name="S22_fader" id="S22_fader" type="hidden" value="<?php echo $S22_fader;?>">
<input name="S32_fader" id="S32_fader" type="hidden" value="<?php echo $S32_fader;?>">
<input name="S42_fader" id="S42_fader" type="hidden" value="<?php echo $S42_fader;?>">
<input name="S52_fader" id="S52_fader" type="hidden" value="<?php echo $S52_fader;?>">
<input name="S62_fader" id="S62_fader" type="hidden" value="<?php echo $S62_fader;?>">
<input name="S72_fader" id="S72_fader" type="hidden" value="<?php echo $S72_fader;?>">
	
<input name="S12_enable" id="S12_enable" type="hidden" value="<?php echo $S12_enable;?>">	
<input name="S22_enable" id="S22_enable" type="hidden" value="<?php echo $S22_enable;?>">
<input name="S32_enable" id="S32_enable" type="hidden" value="<?php echo $S32_enable;?>">
<input name="S42_enable" id="S42_enable" type="hidden" value="<?php echo $S42_enable;?>">
<input name="S52_enable" id="S52_enable" type="hidden" value="<?php echo $S52_enable;?>">
<input name="S62_enable" id="S62_enable" type="hidden" value="<?php echo $S62_enable;?>">
<input name="S72_enable" id="S72_enable" type="hidden" value="<?php echo $S72_enable;?>">
	
<input name="S12_freq" id="S12_freq" type="hidden" value="<?php echo $S12_freq;?>">
<input name="S22_freq" id="S22_freq" type="hidden" value="<?php echo $S22_freq;?>">
<input name="S32_freq" id="S32_freq" type="hidden" value="<?php echo $S32_freq;?>">
<input name="S42_freq" id="S42_freq" type="hidden" value="<?php echo $S42_freq;?>">
<input name="S52_freq" id="S52_freq" type="hidden" value="<?php echo $S52_freq;?>">
<input name="S62_freq" id="S62_freq" type="hidden" value="<?php echo $S62_freq;?>">
<input name="S72_freq" id="S72_freq" type="hidden" value="<?php echo $S72_freq;?>">

<input name="S12_q" id="S12_q" type="hidden" value="<?php echo $S12_q;?>">
<input name="S22_q" id="S22_q" type="hidden" value="<?php echo $S22_q;?>">
<input name="S32_q" id="S32_q" type="hidden" value="<?php echo $S32_q;?>">
<input name="S42_q" id="S42_q" type="hidden" value="<?php echo $S42_q;?>">
<input name="S52_q" id="S52_q" type="hidden" value="<?php echo $S52_q;?>">
<input name="S62_q" id="S62_q" type="hidden" value="<?php echo $S62_q;?>">
<input name="S72_q" id="S72_q" type="hidden" value="<?php echo $S72_q;?>">
	
<input name="S13_fader" id="S13_fader" type="hidden" value="<?php echo $S13_fader;?>">
<input name="S23_fader" id="S23_fader" type="hidden" value="<?php echo $S23_fader;?>">
<input name="S33_fader" id="S33_fader" type="hidden" value="<?php echo $S33_fader;?>">
<input name="S43_fader" id="S43_fader" type="hidden" value="<?php echo $S43_fader;?>">
<input name="S53_fader" id="S53_fader" type="hidden" value="<?php echo $S53_fader;?>">
<input name="S63_fader" id="S63_fader" type="hidden" value="<?php echo $S63_fader;?>">
<input name="S73_fader" id="S73_fader" type="hidden" value="<?php echo $S73_fader;?>">
	
<input name="S13_enable" id="S13_enable" type="hidden" value="<?php echo $S13_enable;?>">	
<input name="S23_enable" id="S23_enable" type="hidden" value="<?php echo $S23_enable;?>">
<input name="S33_enable" id="S33_enable" type="hidden" value="<?php echo $S33_enable;?>">
<input name="S43_enable" id="S43_enable" type="hidden" value="<?php echo $S43_enable;?>">
<input name="S53_enable" id="S53_enable" type="hidden" value="<?php echo $S53_enable;?>">
<input name="S63_enable" id="S63_enable" type="hidden" value="<?php echo $S63_enable;?>">
<input name="S73_enable" id="S73_enable" type="hidden" value="<?php echo $S73_enable;?>">
	
<input name="S13_freq" id="S13_freq" type="hidden" value="<?php echo $S13_freq;?>">
<input name="S23_freq" id="S23_freq" type="hidden" value="<?php echo $S23_freq;?>">
<input name="S33_freq" id="S33_freq" type="hidden" value="<?php echo $S33_freq;?>">
<input name="S43_freq" id="S43_freq" type="hidden" value="<?php echo $S43_freq;?>">
<input name="S53_freq" id="S53_freq" type="hidden" value="<?php echo $S53_freq;?>">
<input name="S63_freq" id="S63_freq" type="hidden" value="<?php echo $S63_freq;?>">
<input name="S73_freq" id="S73_freq" type="hidden" value="<?php echo $S73_freq;?>">

<input name="S13_q" id="S13_q" type="hidden" value="<?php echo $S13_q;?>">
<input name="S23_q" id="S23_q" type="hidden" value="<?php echo $S23_q;?>">
<input name="S33_q" id="S33_q" type="hidden" value="<?php echo $S33_q;?>">
<input name="S43_q" id="S43_q" type="hidden" value="<?php echo $S43_q;?>">
<input name="S53_q" id="S53_q" type="hidden" value="<?php echo $S53_q;?>">
<input name="S63_q" id="S63_q" type="hidden" value="<?php echo $S63_q;?>">
<input name="S73_q" id="S73_q" type="hidden" value="<?php echo $S73_q;?>">
	
<input name="S14_fader" id="S14_fader" type="hidden" value="<?php echo $S14_fader;?>">
<input name="S24_fader" id="S24_fader" type="hidden" value="<?php echo $S24_fader;?>">
<input name="S34_fader" id="S34_fader" type="hidden" value="<?php echo $S34_fader;?>">
<input name="S44_fader" id="S44_fader" type="hidden" value="<?php echo $S44_fader;?>">
<input name="S54_fader" id="S54_fader" type="hidden" value="<?php echo $S54_fader;?>">
<input name="S64_fader" id="S64_fader" type="hidden" value="<?php echo $S64_fader;?>">
<input name="S74_fader" id="S74_fader" type="hidden" value="<?php echo $S74_fader;?>">
	
<input name="S14_enable" id="S14_enable" type="hidden" value="<?php echo $S14_enable;?>">	
<input name="S24_enable" id="S24_enable" type="hidden" value="<?php echo $S24_enable;?>">
<input name="S34_enable" id="S34_enable" type="hidden" value="<?php echo $S34_enable;?>">
<input name="S44_enable" id="S44_enable" type="hidden" value="<?php echo $S44_enable;?>">
<input name="S54_enable" id="S54_enable" type="hidden" value="<?php echo $S54_enable;?>">
<input name="S64_enable" id="S64_enable" type="hidden" value="<?php echo $S64_enable;?>">
<input name="S74_enable" id="S74_enable" type="hidden" value="<?php echo $S74_enable;?>">

<input name="S14_freq" id="S14_freq" type="hidden" value="<?php echo $S14_freq;?>">
<input name="S24_freq" id="S24_freq" type="hidden" value="<?php echo $S24_freq;?>">
<input name="S34_freq" id="S34_freq" type="hidden" value="<?php echo $S34_freq;?>">
<input name="S44_freq" id="S44_freq" type="hidden" value="<?php echo $S44_freq;?>">
<input name="S54_freq" id="S54_freq" type="hidden" value="<?php echo $S54_freq;?>">
<input name="S64_freq" id="S64_freq" type="hidden" value="<?php echo $S64_freq;?>">
<input name="S74_freq" id="S74_freq" type="hidden" value="<?php echo $S74_freq;?>">

<input name="S14_q" id="S14_q" type="hidden" value="<?php echo $S14_q;?>">
<input name="S24_q" id="S24_q" type="hidden" value="<?php echo $S24_q;?>">
<input name="S34_q" id="S34_q" type="hidden" value="<?php echo $S34_q;?>">
<input name="S44_q" id="S44_q" type="hidden" value="<?php echo $S44_q;?>">
<input name="S54_q" id="S54_q" type="hidden" value="<?php echo $S54_q;?>">
<input name="S64_q" id="S64_q" type="hidden" value="<?php echo $S64_q;?>">
<input name="S74_q" id="S74_q" type="hidden" value="<?php echo $S74_q;?>">
	
<input name="S15_fader" id="S15_fader" type="hidden" value="<?php echo $S15_fader;?>">
<input name="S25_fader" id="S25_fader" type="hidden" value="<?php echo $S25_fader;?>">
<input name="S35_fader" id="S35_fader" type="hidden" value="<?php echo $S35_fader;?>">
<input name="S45_fader" id="S45_fader" type="hidden" value="<?php echo $S45_fader;?>">
<input name="S55_fader" id="S55_fader" type="hidden" value="<?php echo $S55_fader;?>">
<input name="S65_fader" id="S65_fader" type="hidden" value="<?php echo $S65_fader;?>">
<input name="S75_fader" id="S75_fader" type="hidden" value="<?php echo $S75_fader;?>">
	
<input name="S15_enable" id="S15_enable" type="hidden" value="<?php echo $S15_enable;?>">	
<input name="S25_enable" id="S25_enable" type="hidden" value="<?php echo $S25_enable;?>">
<input name="S35_enable" id="S35_enable" type="hidden" value="<?php echo $S35_enable;?>">
<input name="S45_enable" id="S45_enable" type="hidden" value="<?php echo $S45_enable;?>">
<input name="S55_enable" id="S55_enable" type="hidden" value="<?php echo $S55_enable;?>">
<input name="S65_enable" id="S65_enable" type="hidden" value="<?php echo $S65_enable;?>">
<input name="S75_enable" id="S75_enable" type="hidden" value="<?php echo $S75_enable;?>">

<input name="S15_freq" id="S15_freq" type="hidden" value="<?php echo $S15_freq;?>">
<input name="S25_freq" id="S25_freq" type="hidden" value="<?php echo $S25_freq;?>">
<input name="S35_freq" id="S35_freq" type="hidden" value="<?php echo $S35_freq;?>">
<input name="S45_freq" id="S45_freq" type="hidden" value="<?php echo $S45_freq;?>">
<input name="S55_freq" id="S55_freq" type="hidden" value="<?php echo $S55_freq;?>">
<input name="S65_freq" id="S65_freq" type="hidden" value="<?php echo $S65_freq;?>">
<input name="S75_freq" id="S75_freq" type="hidden" value="<?php echo $S75_freq;?>">

<input name="S15_q" id="S15_q" type="hidden" value="<?php echo $S15_q;?>">
<input name="S25_q" id="S25_q" type="hidden" value="<?php echo $S25_q;?>">
<input name="S35_q" id="S35_q" type="hidden" value="<?php echo $S35_q;?>">
<input name="S45_q" id="S45_q" type="hidden" value="<?php echo $S45_q;?>">
<input name="S55_q" id="S55_q" type="hidden" value="<?php echo $S55_q;?>">
<input name="S65_q" id="S65_q" type="hidden" value="<?php echo $S65_q;?>">
<input name="S75_q" id="S75_q" type="hidden" value="<?php echo $S75_q;?>">
	
<input name="S16_fader" id="S16_fader" type="hidden" value="<?php echo $S16_fader;?>">
<input name="S26_fader" id="S26_fader" type="hidden" value="<?php echo $S26_fader;?>">
<input name="S36_fader" id="S36_fader" type="hidden" value="<?php echo $S36_fader;?>">
<input name="S46_fader" id="S46_fader" type="hidden" value="<?php echo $S46_fader;?>">
<input name="S56_fader" id="S56_fader" type="hidden" value="<?php echo $S56_fader;?>">
<input name="S66_fader" id="S66_fader" type="hidden" value="<?php echo $S66_fader;?>">
<input name="S76_fader" id="S76_fader" type="hidden" value="<?php echo $S76_fader;?>">
	
<input name="S16_enable" id="S16_enable" type="hidden" value="<?php echo $S16_enable;?>">	
<input name="S26_enable" id="S26_enable" type="hidden" value="<?php echo $S26_enable;?>">
<input name="S36_enable" id="S36_enable" type="hidden" value="<?php echo $S36_enable;?>">
<input name="S46_enable" id="S46_enable" type="hidden" value="<?php echo $S46_enable;?>">
<input name="S56_enable" id="S56_enable" type="hidden" value="<?php echo $S56_enable;?>">
<input name="S66_enable" id="S66_enable" type="hidden" value="<?php echo $S66_enable;?>">
<input name="S76_enable" id="S76_enable" type="hidden" value="<?php echo $S76_enable;?>">

<input name="S16_freq" id="S16_freq" type="hidden" value="<?php echo $S16_freq;?>">
<input name="S26_freq" id="S26_freq" type="hidden" value="<?php echo $S26_freq;?>">
<input name="S36_freq" id="S36_freq" type="hidden" value="<?php echo $S36_freq;?>">
<input name="S46_freq" id="S46_freq" type="hidden" value="<?php echo $S46_freq;?>">
<input name="S56_freq" id="S56_freq" type="hidden" value="<?php echo $S56_freq;?>">
<input name="S66_freq" id="S66_freq" type="hidden" value="<?php echo $S66_freq;?>">
<input name="S76_freq" id="S76_freq" type="hidden" value="<?php echo $S76_freq;?>">

<input name="S16_q" id="S16_q" type="hidden" value="<?php echo $S16_q;?>">
<input name="S26_q" id="S26_q" type="hidden" value="<?php echo $S26_q;?>">
<input name="S36_q" id="S36_q" type="hidden" value="<?php echo $S36_q;?>">
<input name="S46_q" id="S46_q" type="hidden" value="<?php echo $S46_q;?>">
<input name="S56_q" id="S56_q" type="hidden" value="<?php echo $S56_q;?>">
<input name="S66_q" id="S66_q" type="hidden" value="<?php echo $S66_q;?>">
<input name="S76_q" id="S76_q" type="hidden" value="<?php echo $S76_q;?>">

<input name="Enabled_compressor1" id="Enabled_compressor1" type="hidden" value="<?php if($Enabled_compressor1==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor1" id="Threshold_compressor1" type="hidden" value="<?php echo $Threshold_compressor1;?>">
<input name="Attack_compressor1" id="Attack_compressor1" type="hidden" value="<?php echo $Attack_compressor1;?>">
<input name="Hold_compressor1" id="Hold_compressor1" type="hidden" value="<?php echo $Hold_compressor1;?>">
<input name="Decay_compressor1" id="Decay_compressor1" type="hidden" value="<?php echo $Decay_compressor1;?>">
<input name="Knee_compressor1" id="Knee_compressor1" type="hidden" value="<?php echo $Knee_compressor1;?>">
<input name="Ratio_compressor1" id="Ratio_compressor1" type="hidden" value="<?php echo $Ratio_compressor1;?>">
	
<input name="Enabled_compressor2" id="Enabled_compressor2" type="hidden" value="<?php if($Enabled_compressor2==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor2" id="Threshold_compressor2" type="hidden" value="<?php echo $Threshold_compressor2;?>">
<input name="Attack_compressor2" id="Attack_compressor2" type="hidden" value="<?php echo $Attack_compressor2;?>">
<input name="Hold_compressor2" id="Hold_compressor2" type="hidden" value="<?php echo $Hold_compressor2;?>">
<input name="Decay_compressor2" id="Decay_compressor2" type="hidden" value="<?php echo $Decay_compressor2;?>">
<input name="Knee_compressor2" id="Knee_compressor2" type="hidden" value="<?php echo $Knee_compressor2;?>">
<input name="Ratio_compressor2" id="Ratio_compressor2" type="hidden" value="<?php echo $Ratio_compressor2;?>">
	
<input name="Enabled_compressor3" id="Enabled_compressor3" type="hidden" value="<?php if($Enabled_compressor3==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor3" id="Threshold_compressor3" type="hidden" value="<?php echo $Threshold_compressor3;?>">
<input name="Attack_compressor3" id="Attack_compressor3" type="hidden" value="<?php echo $Attack_compressor3;?>">
<input name="Hold_compressor3" id="Hold_compressor3" type="hidden" value="<?php echo $Hold_compressor3;?>">
<input name="Decay_compressor3" id="Decay_compressor3" type="hidden" value="<?php echo $Decay_compressor3;?>">
<input name="Knee_compressor3" id="Knee_compressor3" type="hidden" value="<?php echo $Knee_compressor3;?>">
<input name="Ratio_compressor3" id="Ratio_compressor3" type="hidden" value="<?php echo $Ratio_compressor3;?>">
	
<input name="Enabled_compressor4" id="Enabled_compressor4" type="hidden" value="<?php if($Enabled_compressor4==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor4" id="Threshold_compressor4" type="hidden" value="<?php echo $Threshold_compressor4;?>">
<input name="Attack_compressor4" id="Attack_compressor4" type="hidden" value="<?php echo $Attack_compressor4;?>">
<input name="Hold_compressor4" id="Hold_compressor4" type="hidden" value="<?php echo $Hold_compressor4;?>">
<input name="Decay_compressor4" id="Decay_compressor4" type="hidden" value="<?php echo $Decay_compressor4;?>">
<input name="Knee_compressor4" id="Knee_compressor4" type="hidden" value="<?php echo $Knee_compressor4;?>">
<input name="Ratio_compressor4" id="Ratio_compressor4" type="hidden" value="<?php echo $Ratio_compressor4;?>">
	
<input name="Enabled_compressor5" id="Enabled_compressor5" type="hidden" value="<?php if($Enabled_compressor5==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor5" id="Threshold_compressor5" type="hidden" value="<?php echo $Threshold_compressor5;?>">
<input name="Attack_compressor5" id="Attack_compressor5" type="hidden" value="<?php echo $Attack_compressor5;?>">
<input name="Hold_compressor5" id="Hold_compressor5" type="hidden" value="<?php echo $Hold_compressor5;?>">
<input name="Decay_compressor5" id="Decay_compressor5" type="hidden" value="<?php echo $Decay_compressor5;?>">
<input name="Knee_compressor5" id="Knee_compressor5" type="hidden" value="<?php echo $Knee_compressor5;?>">
<input name="Ratio_compressor5" id="Ratio_compressor5" type="hidden" value="<?php echo $Ratio_compressor5;?>">
	
<input name="Enabled_compressor6" id="Enabled_compressor6" type="hidden" value="<?php if($Enabled_compressor6==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_compressor6" id="Threshold_compressor6" type="hidden" value="<?php echo $Threshold_compressor6;?>">
<input name="Attack_compressor6" id="Attack_compressor6" type="hidden" value="<?php echo $Attack_compressor6;?>">
<input name="Hold_compressor6" id="Hold_compressor6" type="hidden" value="<?php echo $Hold_compressor6;?>">
<input name="Decay_compressor6" id="Decay_compressor6" type="hidden" value="<?php echo $Decay_compressor6;?>">
<input name="Knee_compressor6" id="Knee_compressor6" type="hidden" value="<?php echo $Knee_compressor6;?>">
<input name="Ratio_compressor6" id="Ratio_compressor6" type="hidden" value="<?php echo $Ratio_compressor6;?>">
	
<input name="Threshold_limiter1" id="Threshold_limiter1" type="hidden" value="<?php echo $Threshold_limiter1;?>">
<input name="Decay_limiter1" id="Decay_limiter1" type="hidden" value="<?php echo $Decay_limiter1;?>">
<input name="RMSTC_limiter1" id="RMSTC_limiter1" type="hidden" value="<?php echo $RMSTC_limiter1;?>">
	
<input name="Threshold_limiter2" id="Threshold_limiter2" type="hidden" value="<?php echo $Threshold_limiter2;?>">
<input name="Decay_limiter2" id="Decay_limiter2" type="hidden" value="<?php echo $Decay_limiter2;?>">
<input name="RMSTC_limiter2" id="RMSTC_limiter2" type="hidden" value="<?php echo $RMSTC_limiter2;?>">
	
<input name="Threshold_limiter3" id="Threshold_limiter3" type="hidden" value="<?php echo $Threshold_limiter3;?>">
<input name="Decay_limiter3" id="Decay_limiter3" type="hidden" value="<?php echo $Decay_limiter3;?>">
<input name="RMSTC_limiter3" id="RMSTC_limiter3" type="hidden" value="<?php echo $RMSTC_limiter3;?>">
	
<input name="Threshold_limiter4" id="Threshold_limiter4" type="hidden" value="<?php echo $Threshold_limiter4;?>">
<input name="Decay_limiter4" id="Decay_limiter4" type="hidden" value="<?php echo $Decay_limiter4;?>">
<input name="RMSTC_limiter4" id="RMSTC_limiter4" type="hidden" value="<?php echo $RMSTC_limiter4;?>">
	
<input name="Threshold_limiter5" id="Threshold_limiter5" type="hidden" value="<?php echo $Threshold_limiter5;?>">
<input name="Decay_limiter5" id="Decay_limiter5" type="hidden" value="<?php echo $Decay_limiter5;?>">
<input name="RMSTC_limiter5" id="RMSTC_limiter5" type="hidden" value="<?php echo $RMSTC_limiter5;?>">
	
<input name="Threshold_limiter6" id="Threshold_limiter6" type="hidden" value="<?php echo $Threshold_limiter6;?>">
<input name="Decay_limiter6" id="Decay_limiter6" type="hidden" value="<?php echo $Decay_limiter6;?>">
<input name="RMSTC_limiter6" id="RMSTC_limiter6" type="hidden" value="<?php echo $RMSTC_limiter6;?>">
	
<input name="Threshold_limiter7" id="Threshold_limiter7" type="hidden" value="<?php echo $Threshold_limiter7;?>">
<input name="Decay_limiter7" id="Decay_limiter7" type="hidden" value="<?php echo $Decay_limiter7;?>">
<input name="RMSTC_limiter7" id="RMSTC_limiter7" type="hidden" value="<?php echo $RMSTC_limiter7;?>">
	
<input name="Threshold_limiter8" id="Threshold_limiter8" type="hidden" value="<?php echo $Threshold_limiter8;?>">
<input name="Decay_limiter8" id="Decay_limiter8" type="hidden" value="<?php echo $Decay_limiter8;?>">
<input name="RMSTC_limiter8" id="RMSTC_limiter8" type="hidden" value="<?php echo $RMSTC_limiter8;?>">
	
<input name="Enabled_noise_gate1" id="Enabled_noise_gate1" type="hidden" value="<?php if($Enabled_noise_gate1==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate1" id="Threshold_noise_gate1" type="hidden" value="<?php echo $Threshold_noise_gate1;?>">
<input name="Attack_noise_gate1" id="Attack_noise_gate1" type="hidden" value="<?php echo $Attack_noise_gate1;?>">
<input name="Hold_noise_gate1" id="Hold_noise_gate1" type="hidden" value="<?php echo $Hold_noise_gate1;?>">
<input name="Decay_noise_gate1" id="Decay_noise_gate1" type="hidden" value="<?php echo $Decay_noise_gate1;?>">
	
<input name="Enabled_noise_gate2" id="Enabled_noise_gate2" type="hidden" value="<?php if($Enabled_noise_gate2==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate2" id="Threshold_noise_gate2" type="hidden" value="<?php echo $Threshold_noise_gate2;?>">
<input name="Attack_noise_gate2" id="Attack_noise_gate2" type="hidden" value="<?php echo $Attack_noise_gate2;?>">
<input name="Hold_noise_gate2" id="Hold_noise_gate2" type="hidden" value="<?php echo $Hold_noise_gate2;?>">
<input name="Decay_noise_gate2" id="Decay_noise_gate2" type="hidden" value="<?php echo $Decay_noise_gate2;?>">
	
<input name="Enabled_noise_gate3" id="Enabled_noise_gate3" type="hidden" value="<?php if($Enabled_noise_gate3==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate3" id="Threshold_noise_gate3" type="hidden" value="<?php echo $Threshold_noise_gate3;?>">
<input name="Attack_noise_gate3" id="Attack_noise_gate3" type="hidden" value="<?php echo $Attack_noise_gate3;?>">
<input name="Hold_noise_gate3" id="Hold_noise_gate3" type="hidden" value="<?php echo $Hold_noise_gate3;?>">
<input name="Decay_noise_gate3" id="Decay_noise_gate3" type="hidden" value="<?php echo $Decay_noise_gate3;?>">
	
<input name="Enabled_noise_gate4" id="Enabled_noise_gate4" type="hidden" value="<?php if($Enabled_noise_gate4==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate4" id="Threshold_noise_gate4" type="hidden" value="<?php echo $Threshold_noise_gate4;?>">
<input name="Attack_noise_gate4" id="Attack_noise_gate4" type="hidden" value="<?php echo $Attack_noise_gate4;?>">
<input name="Hold_noise_gate4" id="Hold_noise_gate4" type="hidden" value="<?php echo $Hold_noise_gate4;?>">
<input name="Decay_noise_gate4" id="Decay_noise_gate4" type="hidden" value="<?php echo $Decay_noise_gate4;?>">
	
<input name="Enabled_noise_gate5" id="Enabled_noise_gate5" type="hidden" value="<?php if($Enabled_noise_gate5==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate5" id="Threshold_noise_gate5" type="hidden" value="<?php echo $Threshold_noise_gate5;?>">
<input name="Attack_noise_gate5" id="Attack_noise_gate5" type="hidden" value="<?php echo $Attack_noise_gate5;?>">
<input name="Hold_noise_gate5" id="Hold_noise_gate5" type="hidden" value="<?php echo $Hold_noise_gate5;?>">
<input name="Decay_noise_gate5" id="Decay_noise_gate5" type="hidden" value="<?php echo $Decay_noise_gate5;?>">
	
<input name="Enabled_noise_gate6" id="Enabled_noise_gate6" type="hidden" value="<?php if($Enabled_noise_gate6==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_noise_gate6" id="Threshold_noise_gate6" type="hidden" value="<?php echo $Threshold_noise_gate6;?>">
<input name="Attack_noise_gate6" id="Attack_noise_gate6" type="hidden" value="<?php echo $Attack_noise_gate6;?>">
<input name="Hold_noise_gate6" id="Hold_noise_gate6" type="hidden" value="<?php echo $Hold_noise_gate6;?>">
<input name="Decay_noise_gate6" id="Decay_noise_gate6" type="hidden" value="<?php echo $Decay_noise_gate6;?>">
	
<input name="Threshold_signal_present1" id="Threshold_signal_present1" type="hidden" value="<?php echo $Threshold_signal_present1;?>">
<input name="Trigger_signal_present1" id="Trigger_signal_present1" type="hidden" value="<?php echo $Trigger_signal_present1;?>">
<input name="Signal_signal_present1" id="Signal_signal_present1" type="hidden" value="0">
<input name="Signal_IsNetwork1" id="Signal_IsNetwork1" type="hidden" value="0">
	
<input name="Threshold_signal_present2" id="Threshold_signal_present2" type="hidden" value="<?php echo $Threshold_signal_present2;?>">
<input name="Trigger_signal_present2" id="Trigger_signal_present2" type="hidden" value="<?php echo $Trigger_signal_present2;?>">
<input name="Signal_signal_present2" id="Signal_signal_present2" type="hidden" value="0">
<input name="Signal_IsNetwork2" id="Signal_IsNetwork2" type="hidden" value="0">
	
<input name="Threshold_signal_present3" id="Threshold_signal_present3" type="hidden" value="<?php echo $Threshold_signal_present3;?>">
<input name="Trigger_signal_present3" id="Trigger_signal_present3" type="hidden" value="<?php echo $Trigger_signal_present3;?>">
<input name="Signal_signal_present3" id="Signal_signal_present3" type="hidden" value="0">
<input name="Signal_IsNetwork3" id="Signal_IsNetwork3" type="hidden" value="0">
	
<input name="Threshold_signal_present4" id="Threshold_signal_present4" type="hidden" value="<?php echo $Threshold_signal_present4;?>">
<input name="Trigger_signal_present4" id="Trigger_signal_present4" type="hidden" value="<?php echo $Trigger_signal_present4;?>">
<input name="Signal_signal_present4" id="Signal_signal_present4" type="hidden" value="0">
<input name="Signal_IsNetwork4" id="Signal_IsNetwork4" type="hidden" value="0">
	
<input name="Threshold_signal_present5" id="Threshold_signal_present5" type="hidden" value="<?php echo $Threshold_signal_present5;?>">
<input name="Trigger_signal_present5" id="Trigger_signal_present5" type="hidden" value="<?php echo $Trigger_signal_present5;?>">
<input name="Signal_signal_present5" id="Signal_signal_present5" type="hidden" value="0">
	
<input name="Threshold_signal_present6" id="Threshold_signal_present6" type="hidden" value="<?php echo $Threshold_signal_present6;?>">
<input name="Trigger_signal_present6" id="Trigger_signal_present6" type="hidden" value="<?php echo $Trigger_signal_present6;?>">
<input name="Signal_signal_present6" id="Signal_signal_present6" type="hidden" value="0">
	
<input name="Threshold_signal_present7" id="Threshold_signal_present7" type="hidden" value="<?php echo $Threshold_signal_present7;?>">
<input name="Trigger_signal_present7" id="Trigger_signal_present7" type="hidden" value="<?php echo $Trigger_signal_present7;?>">
<input name="Signal_signal_present7" id="Signal_signal_present7" type="hidden" value="0">
	
<input name="Threshold_signal_present8" id="Threshold_signal_present8" type="hidden" value="<?php echo $Threshold_signal_present8;?>">
<input name="Trigger_signal_present8" id="Trigger_signal_present8" type="hidden" value="<?php echo $Trigger_signal_present8;?>">
<input name="Signal_signal_present8" id="Signal_signal_present8" type="hidden" value="0">
	
<input name="Delay_delay1" id="Delay_delay1" type="hidden" value="<?php echo $Delay_delay1;?>">
<input name="Delay_delay2" id="Delay_delay2" type="hidden" value="<?php echo $Delay_delay2;?>">
<input name="Delay_delay3" id="Delay_delay3" type="hidden" value="<?php echo $Delay_delay3;?>">
<input name="Delay_delay4" id="Delay_delay4" type="hidden" value="<?php echo $Delay_delay4;?>">
	
<input name="Phase_invert1" id="Phase_invert1" type="hidden" value="<?php if($Phase_invert1==1){ echo 1;} else { echo 0;}?>">
<input name="Phase_invert2" id="Phase_invert2" type="hidden" value="<?php if($Phase_invert2==1){ echo 1;} else { echo 0;}?>">
<input name="Phase_invert3" id="Phase_invert3" type="hidden" value="<?php if($Phase_invert3==1){ echo 1;} else { echo 0;}?>"> 
<input name="Phase_invert4" id="Phase_invert4" type="hidden" value="<?php if($Phase_invert4==1){ echo 1;} else { echo 0;}?>">
	
<input name="Clip1_enabled" id="Clip1_enabled" type="hidden" value="0">
<input name="Clip2_enabled" id="Clip2_enabled" type="hidden" value="0">
<input name="Clip3_enabled" id="Clip3_enabled" type="hidden" value="0">
<input name="Clip4_enabled" id="Clip4_enabled" type="hidden" value="0">
<input name="Clip5_enabled" id="Clip5_enabled" type="hidden" value="0">
<input name="Clip6_enabled" id="Clip6_enabled" type="hidden" value="0">
<input name="Clip7_enabled" id="Clip7_enabled" type="hidden" value="0">
<input name="Clip8_enabled" id="Clip8_enabled" type="hidden" value="0">

<input name="Limiter_limiting1" id="Limiter_limiting1" type="hidden" value="0">
<input name="Limiter_limiting2" id="Limiter_limiting2" type="hidden" value="0">
<input name="Limiter_limiting3" id="Limiter_limiting3" type="hidden" value="0">
<input name="Limiter_limiting4" id="Limiter_limiting4" type="hidden" value="0">
<input name="Limiter_limiting5" id="Limiter_limiting5" type="hidden" value="0">
<input name="Limiter_limiting6" id="Limiter_limiting6" type="hidden" value="0">
<input name="Limiter_limiting7" id="Limiter_limiting7" type="hidden" value="0">
<input name="Limiter_limiting8" id="Limiter_limiting8" type="hidden" value="0">

<input name="Master_ducker" id="Master_ducker" type="hidden" value="<?php echo $Master_ducker;?>">
<input name="MasterIn1_ducker" id="MasterIn1_ducker" type="hidden" value="<?php echo $MasterIn1_ducker;?>">
<input name="MasterIn2_ducker" id="MasterIn2_ducker" type="hidden" value="<?php echo $MasterIn2_ducker;?>">
<input name="MasterIn3_ducker" id="MasterIn3_ducker" type="hidden" value="<?php echo $MasterIn3_ducker;?>">
<input name="MasterIn4_ducker" id="MasterIn4_ducker" type="hidden" value="<?php echo $MasterIn4_ducker;?>">
<input name="Threshold_ducker" id="Threshold_ducker" type="hidden" value="<?php echo $Threshold_ducker;?>">
<input name="Hold_ducker" id="Hold_ducker" type="hidden" value="<?php echo $Hold_ducker;?>">
<input name="DuckedIn1_ducker" id="DuckedIn1_ducker" type="hidden" value="<?php if($DuckedIn1_ducker==1){ echo 1;} else { echo 0;};?>">
<input name="DuckedIn2_ducker" id="DuckedIn2_ducker" type="hidden" value="<?php if($DuckedIn2_ducker==1){ echo 1;} else { echo 0;};?>">
<input name="DuckedIn3_ducker" id="DuckedIn3_ducker" type="hidden" value="<?php if($DuckedIn3_ducker==1){ echo 1;} else { echo 0;};?>">
<input name="DuckedIn4_ducker" id="DuckedIn4_ducker" type="hidden" value="<?php if($DuckedIn4_ducker==1){ echo 1;} else { echo 0;};?>">
	
<input name="Frequency_hp1_hplp" id="Frequency_hp1_hplp" type="hidden" value="<?php echo $Frequency_hp1;?>">
<input name="Frequency_hp2_hplp" id="Frequency_hp2_hplp" type="hidden" value="<?php echo $Frequency_hp2;?>">
<input name="Frequency_hp3_hplp" id="Frequency_hp3_hplp" type="hidden" value="<?php echo $Frequency_hp3;?>">
<input name="Frequency_hp4_hplp" id="Frequency_hp4_hplp" type="hidden" value="<?php echo $Frequency_hp4;?>">
<input name="Frequency_hp5_hplp" id="Frequency_hp5_hplp" type="hidden" value="<?php echo $Frequency_hp5;?>">
<input name="Frequency_hp6_hplp" id="Frequency_hp6_hplp" type="hidden" value="<?php echo $Frequency_hp6;?>">
	
<input name="Frequency_lp1_hplp" id="Frequency_lp1_hplp" type="hidden" value="<?php echo $Frequency_lp1;?>">
<input name="Frequency_lp2_hplp" id="Frequency_lp2_hplp" type="hidden" value="<?php echo $Frequency_lp2;?>">
<input name="Frequency_lp3_hplp" id="Frequency_lp3_hplp" type="hidden" value="<?php echo $Frequency_lp3;?>">
<input name="Frequency_lp4_hplp" id="Frequency_lp4_hplp" type="hidden" value="<?php echo $Frequency_lp4;?>">
<input name="Frequency_lp5_hplp" id="Frequency_lp5_hplp" type="hidden" value="<?php echo $Frequency_lp5;?>">
<input name="Frequency_lp6_hplp" id="Frequency_lp6_hplp" type="hidden" value="<?php echo $Frequency_lp6;?>">
		
<input name="Enabled_hp1_hplp" id="Enabled_hp1_hplp" type="hidden" value="<?php if($Enabled_hp1==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_hp2_hplp" id="Enabled_hp2_hplp" type="hidden" value="<?php if($Enabled_hp2==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_hp3_hplp" id="Enabled_hp3_hplp" type="hidden" value="<?php if($Enabled_hp3==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_hp4_hplp" id="Enabled_hp4_hplp" type="hidden" value="<?php if($Enabled_hp4==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_hp5_hplp" id="Enabled_hp5_hplp" type="hidden" value="<?php if($Enabled_hp5==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_hp6_hplp" id="Enabled_hp6_hplp" type="hidden" value="<?php if($Enabled_hp6==1){ echo 1;} else { echo 0;};?>">

<input name="Enabled_lp1_hplp" id="Enabled_lp1_hplp" type="hidden" value="<?php if($Enabled_lp1==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_lp2_hplp" id="Enabled_lp2_hplp" type="hidden" value="<?php if($Enabled_lp2==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_lp3_hplp" id="Enabled_lp3_hplp" type="hidden" value="<?php if($Enabled_lp3==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_lp4_hplp" id="Enabled_lp4_hplp" type="hidden" value="<?php if($Enabled_lp4==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_lp5_hplp" id="Enabled_lp5_hplp" type="hidden" value="<?php if($Enabled_lp5==1){ echo 1;} else { echo 0;};?>">
<input name="Enabled_lp6_hplp" id="Enabled_lp6_hplp" type="hidden" value="<?php if($Enabled_lp6==1){ echo 1;} else { echo 0;};?>">

<input name="Type_hp1_hplp" id="Type_hp1_hplp" type="hidden" value="<?php echo $Type_hp1;?>">
<input name="Type_hp2_hplp" id="Type_hp2_hplp" type="hidden" value="<?php echo $Type_hp2;?>">
<input name="Type_hp3_hplp" id="Type_hp3_hplp" type="hidden" value="<?php echo $Type_hp3;?>">
<input name="Type_hp4_hplp" id="Type_hp4_hplp" type="hidden" value="<?php echo $Type_hp4;?>">
<input name="Type_hp5_hplp" id="Type_hp5_hplp" type="hidden" value="<?php echo $Type_hp5;?>">
<input name="Type_hp6_hplp" id="Type_hp6_hplp" type="hidden" value="<?php echo $Type_hp6;?>">
	
<input name="Type_lp1_hplp" id="Type_lp1_hplp" type="hidden" value="<?php echo $Type_lp1;?>">
<input name="Type_lp2_hplp" id="Type_lp2_hplp" type="hidden" value="<?php echo $Type_lp2;?>">
<input name="Type_lp3_hplp" id="Type_lp3_hplp" type="hidden" value="<?php echo $Type_lp3;?>">
<input name="Type_lp4_hplp" id="Type_lp4_hplp" type="hidden" value="<?php echo $Type_lp4;?>">
<input name="Type_lp5_hplp" id="Type_lp5_hplp" type="hidden" value="<?php echo $Type_lp5;?>">
<input name="Type_lp6_hplp" id="Type_lp6_hplp" type="hidden" value="<?php echo $Type_lp6;?>">
	
<input name="SignalGain1" id="SignalGain1" type="hidden" value="<?php echo $SignalGain1; ?>">
<input name="SignalGain2" id="SignalGain2" type="hidden" value="<?php echo $SignalGain2; ?>">
<input name="SignalGain3" id="SignalGain3" type="hidden" value="<?php echo $SignalGain3; ?>">
<input name="SignalGain4" id="SignalGain4" type="hidden" value="<?php echo $SignalGain4; ?>">
<input name="SignalGain5" id="SignalGain5" type="hidden" value="<?php echo $SignalGain5; ?>">
<input name="SignalGain6" id="SignalGain6" type="hidden" value="<?php echo $SignalGain6; ?>">

<input name="Mode1" id="Mode1" type="hidden" value="<?php echo $Mode1; ?>">
<input name="Mode2" id="Mode2" type="hidden" value="<?php echo $Mode2; ?>">
<input name="Mode3" id="Mode3" type="hidden" value="<?php echo $Mode3; ?>">
<input name="Mode4" id="Mode4" type="hidden" value="<?php echo $Mode4; ?>">

<input name="Phantom1" id="Phantom1" type="hidden" value="<?php if($Phantom1==1){ echo 1;} else { echo 0;};?>">
<input name="Phantom2" id="Phantom2" type="hidden" value="<?php if($Phantom2==1){ echo 1;} else { echo 0;};?>">
<input name="Phantom3" id="Phantom3" type="hidden" value="<?php if($Phantom3==1){ echo 1;} else { echo 0;};?>">
<input name="Phantom4" id="Phantom4" type="hidden" value="<?php if($Phantom4==1){ echo 1;} else { echo 0;};?>">	
	
<input name="IsDualChannel" id="IsDualChannel" type="hidden" value="1">
<input name="InProtection" id="InProtection" type="hidden" value="0">
<input name="out1_clip" id="out1_clip" type="hidden" value="0">
<input name="out2_clip" id="out2_clip" type="hidden" value="0">
	
<input name="IsDualChannel2" id="IsDualChannel2" type="hidden" value="1">
<input name="InProtection2" id="InProtection2" type="hidden" value="0">
<input name="out3_clip" id="out3_clip" type="hidden" value="0">
<input name="out4_clip" id="out4_clip" type="hidden" value="0">
	
<input name="AnalogModeCH1" id="AnalogModeCH1" type="hidden" value="<?php echo $AnalogModeCH1;?>">
<input name="AnalogModeCH2" id="AnalogModeCH2" type="hidden" value="<?php echo $AnalogModeCH2;?>">
<input name="AnalogModeCH3" id="AnalogModeCH3" type="hidden" value="<?php echo $AnalogModeCH3;?>">
<input name="AnalogModeCH4" id="AnalogModeCH4" type="hidden" value="<?php echo $AnalogModeCH4;?>">
	
<input name="Threshold_compressor_duplexer" id="Threshold_compressor_duplexer" type="hidden" value="<?php echo $Threshold_compressor_duplexer;?>">
<input name="Threshold_noise_gate_duplexer" id="Threshold_noise_gate_duplexer" type="hidden" value="<?php echo $Threshold_noise_gate_duplexer;?>">
<input name="Talkback_threshold_duplexer" id="Talkback_threshold_duplexer" type="hidden" value="<?php echo $talkback_threshold_duplexer;?>">
<input name="Talkback_decay_duplexer" id="Talkback_decay_duplexer" type="hidden" value="<?php echo $talkback_decay_duplexer;?>">
<input name="preset_selected" id="preset_selected" type="hidden" value="<?php echo $preset_selected;?>"> 
	
<input name="preset_modal" id="preset_modal" type="hidden" value="0">
<input name="generate_modal" id="generate_modal" type="hidden" value="0">
<input name="preset_url" id="preset_url" type="hidden" value="">
	
<input name="preset1_value" id="preset1_value" type="hidden" value="<?php echo $preset1;?>">
<input name="preset2_value" id="preset2_value" type="hidden" value="<?php echo $preset2;?>">
<input name="preset3_value" id="preset3_value" type="hidden" value="<?php echo $preset3;?>">
<input name="preset4_value" id="preset4_value" type="hidden" value="<?php echo $preset4;?>">
	
<input name="preset1_value_changed" id="preset1_value_changed" type="hidden" value="0">
<input name="preset2_value_changed" id="preset2_value_changed" type="hidden" value="0">
<input name="preset3_value_changed" id="preset3_value_changed" type="hidden" value="0">
<input name="preset4_value_changed" id="preset4_value_changed" type="hidden" value="0">
	
<input name="pink_noise_enabled1" id="pink_noise_enabled1" type="hidden" value="0">
<input name="pink_noise_enabled2" id="pink_noise_enabled2" type="hidden" value="0">
<input name="pink_noise_enabled3" id="pink_noise_enabled3" type="hidden" value="0">
<input name="pink_noise_enabled4" id="pink_noise_enabled4" type="hidden" value="0">
	
<input name="Enabled_peak_limiter1" id="Enabled_peak_limiter1" type="hidden" value="<?php if($Enabled_peak_limiter1==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_peak_limiter1" id="Threshold_peak_limiter1" type="hidden" value="<?php echo $Threshold_peak_limiter1;?>">
<input name="Attack_peak_limiter1" id="Attack_peak_limiter1" type="hidden" value="<?php echo $Attack_peak_limiter1;?>">
<input name="Hold_peak_limiter1" id="Hold_peak_limiter1" type="hidden" value="<?php echo $Hold_peak_limiter1;?>">
<input name="Decay_peak_limiter1" id="Decay_peak_limiter1" type="hidden" value="<?php echo $Decay_peak_limiter1;?>">
	
<input name="Enabled_peak_limiter2" id="Enabled_peak_limiter2" type="hidden" value="<?php if($Enabled_peak_limiter2==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_peak_limiter2" id="Threshold_peak_limiter2" type="hidden" value="<?php echo $Threshold_peak_limiter2;?>">
<input name="Attack_peak_limiter2" id="Attack_peak_limiter2" type="hidden" value="<?php echo $Attack_peak_limiter2;?>">
<input name="Hold_peak_limiter2" id="Hold_peak_limiter2" type="hidden" value="<?php echo $Hold_peak_limiter2;?>">
<input name="Decay_peak_limiter2" id="Decay_peak_limiter2" type="hidden" value="<?php echo $Decay_peak_limiter2;?>">
	
<input name="Enabled_peak_limiter3" id="Enabled_peak_limiter3" type="hidden" value="<?php if($Enabled_peak_limiter3==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_peak_limiter3" id="Threshold_peak_limiter3" type="hidden" value="<?php echo $Threshold_peak_limiter3;?>">
<input name="Attack_peak_limiter3" id="Attack_peak_limiter3" type="hidden" value="<?php echo $Attack_peak_limiter3;?>">
<input name="Hold_peak_limiter3" id="Hold_peak_limiter3" type="hidden" value="<?php echo $Hold_peak_limiter3;?>">
<input name="Decay_peak_limiter3" id="Decay_peak_limiter3" type="hidden" value="<?php echo $Decay_peak_limiter3;?>">
	
<input name="Enabled_peak_limiter4" id="Enabled_peak_limiter4" type="hidden" value="<?php if($Enabled_peak_limiter4==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_peak_limiter4" id="Threshold_peak_limiter4" type="hidden" value="<?php echo $Threshold_peak_limiter4;?>">
<input name="Attack_peak_limiter4" id="Attack_peak_limiter4" type="hidden" value="<?php echo $Attack_peak_limiter4;?>">
<input name="Hold_peak_limiter4" id="Hold_peak_limiter4" type="hidden" value="<?php echo $Hold_peak_limiter4;?>">
<input name="Decay_peak_limiter4" id="Decay_peak_limiter4" type="hidden" value="<?php echo $Decay_peak_limiter4;?>">
	
<input name="Enabled_rms_limiter1" id="Enabled_rms_limiter1" type="hidden" value="<?php if($Enabled_rms_limiter1==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_rms_limiter1" id="Threshold_rms_limiter1" type="hidden" value="<?php echo $Threshold_rms_limiter1;?>">
<input name="Attack_rms_limiter1" id="Attack_rms_limiter1" type="hidden" value="<?php echo $Attack_rms_limiter1;?>">
<input name="Hold_rms_limiter1" id="Hold_rms_limiter1" type="hidden" value="<?php echo $Hold_rms_limiter1;?>">
<input name="Decay_rms_limiter1" id="Decay_rms_limiter1" type="hidden" value="<?php echo $Decay_rms_limiter1;?>">
	
<input name="Enabled_rms_limiter2" id="Enabled_rms_limiter2" type="hidden" value="<?php if($Enabled_rms_limiter2==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_rms_limiter2" id="Threshold_rms_limiter2" type="hidden" value="<?php echo $Threshold_rms_limiter2;?>">
<input name="Attack_rms_limiter2" id="Attack_rms_limiter2" type="hidden" value="<?php echo $Attack_rms_limiter2;?>">
<input name="Hold_rms_limiter2" id="Hold_rms_limiter2" type="hidden" value="<?php echo $Hold_rms_limiter2;?>">
<input name="Decay_rms_limiter2" id="Decay_rms_limiter2" type="hidden" value="<?php echo $Decay_rms_limiter2;?>">
	
<input name="Enabled_rms_limiter3" id="Enabled_rms_limiter3" type="hidden" value="<?php if($Enabled_rms_limiter3==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_rms_limiter3" id="Threshold_rms_limiter3" type="hidden" value="<?php echo $Threshold_rms_limiter3;?>">
<input name="Attack_rms_limiter3" id="Attack_rms_limiter3" type="hidden" value="<?php echo $Attack_rms_limiter3;?>">
<input name="Hold_rms_limiter3" id="Hold_rms_limiter3" type="hidden" value="<?php echo $Hold_rms_limiter3;?>">
<input name="Decay_rms_limiter3" id="Decay_rms_limiter3" type="hidden" value="<?php echo $Decay_rms_limiter3;?>">
	
<input name="Enabled_rms_limiter4" id="Enabled_rms_limiter4" type="hidden" value="<?php if($Enabled_rms_limiter4==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_rms_limiter4" id="Threshold_rms_limiter4" type="hidden" value="<?php echo $Threshold_rms_limiter4;?>">
<input name="Attack_rms_limiter4" id="Attack_rms_limiter4" type="hidden" value="<?php echo $Attack_rms_limiter4;?>">
<input name="Hold_rms_limiter4" id="Hold_rms_limiter4" type="hidden" value="<?php echo $Hold_rms_limiter4;?>">
<input name="Decay_rms_limiter4" id="Decay_rms_limiter4" type="hidden" value="<?php echo $Decay_rms_limiter4;?>">
	
<input name="rms_limiter_level_in1" id="rms_limiter_level_in1" type="hidden" value="-144">
<input name="rms_limiter_level_in2" id="rms_limiter_level_in2" type="hidden" value="-144">
<input name="rms_limiter_level_in3" id="rms_limiter_level_in3" type="hidden" value="-144">
<input name="rms_limiter_level_in4" id="rms_limiter_level_in4" type="hidden" value="-144">
       
<input name="rms_limiter_level_out1" id="rms_limiter_level_out1" type="hidden" value="-144">
<input name="rms_limiter_level_out2" id="rms_limiter_level_out2" type="hidden" value="-144">
<input name="rms_limiter_level_out3" id="rms_limiter_level_out3" type="hidden" value="-144">
<input name="rms_limiter_level_out4" id="rms_limiter_level_out4" type="hidden" value="-144">
       
<input name="rms_limiter_limiting1" id="rms_limiter_limiting1" type="hidden" value="0">
<input name="rms_limiter_limiting2" id="rms_limiter_limiting2" type="hidden" value="0">
<input name="rms_limiter_limiting3" id="rms_limiter_limiting3" type="hidden" value="0">
<input name="rms_limiter_limiting4" id="rms_limiter_limiting4" type="hidden" value="0">
       
<input name="peak_limiter_level_in1" id="peak_limiter_level_in1" type="hidden" value="-144">
<input name="peak_limiter_level_in2" id="peak_limiter_level_in2" type="hidden" value="-144">
<input name="peak_limiter_level_in3" id="peak_limiter_level_in3" type="hidden" value="-144">
<input name="peak_limiter_level_in4" id="peak_limiter_level_in4" type="hidden" value="-144">
       
<input name="peak_limiter_level_out1" id="peak_limiter_level_out1" type="hidden" value="-144">
<input name="peak_limiter_level_out2" id="peak_limiter_level_out2" type="hidden" value="-144">
<input name="peak_limiter_level_out3" id="peak_limiter_level_out3" type="hidden" value="-144">
<input name="peak_limiter_level_out4" id="peak_limiter_level_out4" type="hidden" value="-144">
       
<input name="peak_limiter_limiting1" id="peak_limiter_limiting1" type="hidden" value="0">
<input name="peak_limiter_limiting2" id="peak_limiter_limiting2" type="hidden" value="0">
<input name="peak_limiter_limiting3" id="peak_limiter_limiting3" type="hidden" value="0">
<input name="peak_limiter_limiting4" id="peak_limiter_limiting4" type="hidden" value="0">
	
<input name="Enabled_standby" id="Enabled_standby" type="hidden" value="<?php if($Enabled_standby==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_standby_ab" id="Threshold_standby_ab" type="hidden" value="<?php echo $Threshold_standby_ab;?>">
<input name="Threshold_standby_cd" id="Threshold_standby_cd" type="hidden" value="<?php echo $Threshold_standby_cd;?>">
<input name="Threshold_standby_channels" id="Threshold_standby_channels" type="hidden" value="">
	
<input name="Enabled_mute" id="Enabled_mute" type="hidden" value="<?php if($Enabled_mute==1){ echo 1;} else { echo 0;};?>">
<input name="Threshold_mute_ab" id="Threshold_mute_ab" type="hidden" value="<?php echo $Threshold_mute_ab;?>">
<input name="Threshold_mute_cd" id="Threshold_mute_cd" type="hidden" value="<?php echo $Threshold_mute_cd;?>">
<input name="Threshold_mute_channels" id="Threshold_mute_channels" type="hidden" value="">

		
<?php include 'navbar.php';?>

<h4><strong><i class="fa fa-sliders"></i> DSP</strong>&nbsp;&nbsp;<a href="/help/<?php echo $_SESSION['device_id']; ?>/#t=<?php echo $_SESSION['help_dsp']; ?>" type="button" class="btn btn-xs btn-primary" target="_blank"><i class="fa fa-question-circle"></i></a> <?php if($_SESSION['standalone_mode']=='1'){ } else { ?>&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-xs btn-primary" name="saveSettingsButton" id="saveSettingsButton" onclick="save_settings_to_server()"><i class='fa fa-save'></i>&nbsp;&nbsp;Save Settings to Server</button><?php } ?></h4>

<div id="status"></div>
<div id="message_container"><?php echo $message; ?></div>
<br>
<canvas id="chart_canvas" width="600" height="0"></canvas>
<canvas id="c" width="600" height="400"></canvas>

<input type="hidden" value="<?php echo $name1;?>" id="name1_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name2;?>" id="name2_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name3;?>" id="name3_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name4;?>" id="name4_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name5;?>" id="name5_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name6;?>" id="name6_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name7;?>" id="name7_input" maxlength="11" style="position:absolute">
<input type="hidden" value="<?php echo $name8;?>" id="name8_input" maxlength="11" style="position:absolute">
	
<input type="hidden" value="" id="generate_name_input" maxlength="30" style="position:absolute">
<input type="hidden" value="" id="generate_input_channel">
<input type="hidden" value="" id="clear_input_channel">
	
<input type="hidden" value="" id="frequency_input" maxlength="6" style="position:absolute;text-align:center;width: 100px;">
<input type="hidden" value="" id="frequency_input_type">
<input type="hidden" value="" id="threshold_input" maxlength="4" style="position:absolute;text-align:center;width: 100px;">
<input type="hidden" value="" id="threshold_standby_input" maxlength="4" style="position:absolute;text-align:center;width: 100px;">
<input type="hidden" value="" id="delay_input" maxlength="2" style="position:absolute;text-align:center;width: 100px;">
<input type="hidden" value="" id="peq_input_type">
<input type="hidden" value="" id="modal_input" maxlength="6" style="position:absolute;text-align:center;width: 100px;">
<input type="hidden" value="" id="modal_input_type">
<input type="hidden" value="" id="modal_input_name2">
<input type="hidden" value="" id="modal_left_data">
<input type="hidden" value="" id="modal_top_data">
<input type="hidden" value="" id="modal_type">
	
<input type="hidden" value="" id="temperature">
<input type="hidden" value="" id="temperature2">
	
<input type="hidden" value="" id="standby_status">
<input type="hidden" value="" id="standby_status2">
	
<input type="hidden" value="" id="mute_status">
<input type="hidden" value="" id="mute_status2">
	
<select id="color1_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color1=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color1=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color1=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color1=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color1=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color1=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color1=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color1=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color1=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color2_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color2=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color2=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color2=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color2=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color2=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color2=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color2=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color2=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color2=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color3_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color3=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color3=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color3=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color3=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color3=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color3=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color3=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color3=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color3=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color4_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color4=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color4=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color4=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color4=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color4=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color4=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color4=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color4=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color4=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color5_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color5=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color5=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color5=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color5=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color5=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color5=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color5=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color5=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color5=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color6_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color6=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color6=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color6=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color6=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color6=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color6=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color6=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color6=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color6=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>

<select id="color7_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color7=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color7=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color7=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color7=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color7=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color7=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color7=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color7=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color7=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>
	
<select id="color8_input" style="position:absolute; visibility: hidden">
  	<option value="aqua" <?php if($color8=='aqua'){ echo 'selected'; }?>>Aqua</option>
  	<option value="blue" <?php if($color8=='blue'){ echo 'selected'; }?>>Blue</option>
  	<option value="green" <?php if($color8=='green'){ echo 'selected'; }?>>Green</option>
	<option value="grey" <?php if($color8=='grey'){ echo 'selected'; }?>>Grey</option>
  	<option value="orange" <?php if($color8=='orange'){ echo 'selected'; }?>>Orange</option>
	<option value="pink" <?php if($color8=='pink'){ echo 'selected'; }?>>Pink</option>
	<option value="purple" <?php if($color8=='purple'){ echo 'selected'; }?>>Purple</option>
	<option value="red" <?php if($color8=='red'){ echo 'selected'; }?>>Red</option>
	<option value="yellow" <?php if($color8=='yellow'){ echo 'selected'; }?>>Yellow</option>
</select>

<?php for($x=1;$x<=8;$x++){ ?>
	<?php $type_hp = 'Type_hp'.$x;?>
	<?php $type_lp = 'Type_lp'.$x;?>
<select id="hp_type<?php echo $x;?>" style="position:absolute; visibility: hidden" onchange="hplp_type_changed(<?php echo $x;?>,'hp')">
	<option value="Bessel_12DB" <?php if(${$type_hp}=='Bessel_12DB'){ echo 'selected'; }?>>Bessel 12DB</option>
	<option value="Bessel_18DB" <?php if(${$type_hp}=='Bessel_18DB'){ echo 'selected'; }?>>Bessel 18DB</option>
	<option value="Bessel_24DB" <?php if(${$type_hp}=='Bessel_24DB'){ echo 'selected'; }?>>Bessel 24DB</option>	
	<option value="Butterworth_6DB" <?php if(${$type_hp}=='Butterworth_6DB'){ echo 'selected'; }?>>Butterworth 6DB</option>
	<option value="Butterworth_12DB" <?php if(${$type_hp}=='Butterworth_12DB'){ echo 'selected'; }?>>Butterworth 12DB</option>
	<option value="Butterworth_18DB" <?php if(${$type_hp}=='Butterworth_18DB'){ echo 'selected'; }?>>Butterworth 18DB</option>
	<option value="Butterworth_24DB" <?php if(${$type_hp}=='Butterworth_24DB'){ echo 'selected'; }?>>Butterworth 24DB</option>
	<option value="Butterworth_30DB" <?php if(${$type_hp}=='Butterworth_30DB'){ echo 'selected'; }?>>Butterworth 30DB</option>
	<option value="Butterworth_36DB" <?php if(${$type_hp}=='Butterworth_36DB'){ echo 'selected'; }?>>Butterworth 36DB</option>
	<option value="Butterworth_42DB" <?php if(${$type_hp}=='Butterworth_42DB'){ echo 'selected'; }?>>Butterworth 42DB</option>
	<option value="Butterworth_48DB" <?php if(${$type_hp}=='Butterworth_48DB'){ echo 'selected'; }?>>Butterworth 48DB</option>
  	<option value="Linkwitz_Riley_12DB" <?php if(${$type_hp}=='Linkwitz_Riley_12DB'){ echo 'selected'; }?>>Linkwitz Riley 12DB</option>
  	<option value="Linkwitz_Riley_24DB" <?php if(${$type_hp}=='Linkwitz_Riley_24DB'){ echo 'selected'; }?>>Linkwitz Riley 24DB</option>
  	<option value="Linkwitz_Riley_36DB" <?php if(${$type_hp}=='Linkwitz_Riley_36DB'){ echo 'selected'; }?>>Linkwitz Riley 36DB</option>
	<option value="Linkwitz_Riley_48DB" <?php if(${$type_hp}=='Linkwitz_Riley_48DB'){ echo 'selected'; }?>>Linkwitz Riley 48DB</option>
</select>
	
<select id="lp_type<?php echo $x;?>" style="position:absolute; visibility: hidden" onchange="hplp_type_changed(<?php echo $x;?>,'lp')">
	<option value="Bessel_12DB" <?php if(${$type_lp}=='Bessel_12DB'){ echo 'selected'; }?>>Bessel 12DB</option>
	<option value="Bessel_18DB" <?php if(${$type_lp}=='Bessel_18DB'){ echo 'selected'; }?>>Bessel 18DB</option>
	<option value="Bessel_24DB" <?php if(${$type_lp}=='Bessel_24DB'){ echo 'selected'; }?>>Bessel 24DB</option>	
	<option value="Butterworth_6DB" <?php if(${$type_lp}=='Butterworth_6DB'){ echo 'selected'; }?>>Butterworth 6DB</option>
	<option value="Butterworth_12DB" <?php if(${$type_lp}=='Butterworth_12DB'){ echo 'selected'; }?>>Butterworth 12DB</option>
	<option value="Butterworth_18DB" <?php if(${$type_lp}=='Butterworth_18DB'){ echo 'selected'; }?>>Butterworth 18DB</option>
	<option value="Butterworth_24DB" <?php if(${$type_lp}=='Butterworth_24DB'){ echo 'selected'; }?>>Butterworth 24DB</option>
	<option value="Butterworth_30DB" <?php if(${$type_lp}=='Butterworth_30DB'){ echo 'selected'; }?>>Butterworth 30DB</option>
	<option value="Butterworth_36DB" <?php if(${$type_lp}=='Butterworth_36DB'){ echo 'selected'; }?>>Butterworth 36DB</option>
	<option value="Butterworth_42DB" <?php if(${$type_lp}=='Butterworth_42DB'){ echo 'selected'; }?>>Butterworth 42DB</option>
	<option value="Butterworth_48DB" <?php if(${$type_lp}=='Butterworth_48DB'){ echo 'selected'; }?>>Butterworth 48DB</option>
  	<option value="Linkwitz_Riley_12DB" <?php if(${$type_lp}=='Linkwitz_Riley_12DB'){ echo 'selected'; }?>>Linkwitz Riley 12DB</option>
  	<option value="Linkwitz_Riley_24DB" <?php if(${$type_lp}=='Linkwitz_Riley_24DB'){ echo 'selected'; }?>>Linkwitz Riley 24DB</option>
  	<option value="Linkwitz_Riley_36DB" <?php if(${$type_lp}=='Linkwitz_Riley_36DB'){ echo 'selected'; }?>>Linkwitz Riley 36DB</option>
	<option value="Linkwitz_Riley_48DB" <?php if(${$type_lp}=='Linkwitz_Riley_48DB'){ echo 'selected'; }?>>Linkwitz Riley 48DB</option>
</select>
<?php } ?>
	
<select id="preset_input" style="position:absolute; visibility: hidden">
	<?php foreach($preset_list as $key => $preset){ ?>
		<option value="<?php echo $preset; ?>" <?php if($preset_selected==$key){ echo 'selected'; }?>><?php echo $preset; ?></option>
	<?php } ?>
</select>

<?php for($x=1;$x<=4;$x++){ ?>
    <select id="preset<?php echo $x;?>" style="position:absolute; visibility: hidden" onChange="preset_changed(this.value, <?php echo $x;?>);">
    </select>
<?php } ?>
	
<button class="btn btn-success btn-sm" type="hidden" id="settings_save_button" onClick="save_settings();" style="position:absolute; visibility: hidden">Save</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_hplp_input_button" onClick="save_hplp_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_hplp_input_button" onClick="close_hplp_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_peq_input_button" onClick="save_peq_input('freq');" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_peq_input_button2" onClick="save_peq_input('q');" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_peq_input_button3" onClick="save_peq_input('fader');" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_peq_input_button" onClick="close_peq_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_threshold_input_button" onClick="save_threshold_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_threshold_input_button" onClick="close_threshold_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_threshold_standby_input_button" onClick="save_threshold_standby_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_threshold_standby_input_button" onClick="close_threshold_standby_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_delay_input_button" onClick="save_delay_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_delay_input_button" onClick="close_delay_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_modal_input_button" onClick="save_modal_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Save</button>
<button class="btn btn-default btn-sm" type="hidden" id="close_modal_input_button" onClick="close_modal_input();" style="position:absolute; visibility: hidden;min-width: 60px;">Cancel</button>	
	
<button class="btn btn-success btn-sm" type="hidden" id="presets_save_button" onClick="save_presets();" style="position:absolute; visibility: hidden">Apply</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_detail_button1" onClick="details_button_preset(1);" style="position:absolute; visibility: hidden">Details</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_detail_button2" onClick="details_button_preset(2);" style="position:absolute; visibility: hidden">Details</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_detail_button3" onClick="details_button_preset(3);" style="position:absolute; visibility: hidden">Details</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_detail_button4" onClick="details_button_preset(4);" style="position:absolute; visibility: hidden">Details</button>

<button class="btn btn-primary btn-xs" type="hidden" id="presets_generate_button1" onClick="generate_button_preset(1);" style="position:absolute; visibility: hidden">Generate</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_generate_button2" onClick="generate_button_preset(2);" style="position:absolute; visibility: hidden">Generate</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_generate_button3" onClick="generate_button_preset(3);" style="position:absolute; visibility: hidden">Generate</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_generate_button4" onClick="generate_button_preset(4);" style="position:absolute; visibility: hidden">Generate</button>

<button class="btn btn-primary btn-xs" type="hidden" id="presets_download_button1" onClick="download_button_preset(1);" style="position:absolute; visibility: hidden">Download</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_download_button2" onClick="download_button_preset(2);" style="position:absolute; visibility: hidden">Download</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_download_button3" onClick="download_button_preset(3);" style="position:absolute; visibility: hidden">Download</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_download_button4" onClick="download_button_preset(4);" style="position:absolute; visibility: hidden">Download</button>
	
<button class="btn btn-primary btn-xs" type="hidden" id="presets_clear_button1" onClick="clear_button_preset(1);" style="position:absolute; visibility: hidden">Clear</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_clear_button2" onClick="clear_button_preset(2);" style="position:absolute; visibility: hidden">Clear</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_clear_button3" onClick="clear_button_preset(3);" style="position:absolute; visibility: hidden">Clear</button>
<button class="btn btn-primary btn-xs" type="hidden" id="presets_clear_button4" onClick="clear_button_preset(4);" style="position:absolute; visibility: hidden">Clear</button>

<button class="btn btn-default btn-sm" type="hidden" id="close_preset_modal_button" onClick="details_close();" style="position:absolute; visibility: hidden">Close</button>
<button class="btn btn-primary btn-xs" type="hidden" id="preset_open_web_page_button" onClick="open_web_page();" style="position:absolute; visibility: hidden">Open Web Page</button>
	
<button class="btn btn-primary btn-sm" type="hidden" id="presets_upload_button" onClick="presets_upload_button();" style="position:absolute; visibility: hidden">Upload Presets</button>
	
<button class="btn btn-default btn-sm" type="hidden" id="close_generate_modal_button" onClick="generate_close();" style="position:absolute; visibility: hidden">Close</button>
<button class="btn btn-success btn-sm" type="hidden" id="save_generate_modal_button" onClick="generate_save();" style="position:absolute; visibility: hidden">Save</button>
<button class="btn btn-success btn-sm" type="hidden" id="generate_warning_yes_button" onClick="generate_warning_yes();" style="position:absolute; visibility: hidden">Yes</button>
<button class="btn btn-danger btn-sm" type="hidden" id="generate_warning_no_button" onClick="generate_warning_no();" style="position:absolute; visibility: hidden">No</button>
<button class="btn btn-success btn-sm" type="hidden" id="clear_warning_yes_button" onClick="clear_warning_yes();" style="position:absolute; visibility: hidden">Yes</button>
<button class="btn btn-danger btn-sm" type="hidden" id="clear_warning_no_button" onClick="clear_warning_no();" style="position:absolute; visibility: hidden">No</button>	

<img id="mute_bar_button1_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button2_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button3_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button4_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button5_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button6_on" width="82" height="36" src="/img/mute_button_on.png" alt="" style="display: none;">
<img id="mute_bar_button1_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
<img id="mute_bar_button2_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
<img id="mute_bar_button3_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
<img id="mute_bar_button4_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
<img id="mute_bar_button5_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
<img id="mute_bar_button6_off" width="82" height="36" src="/img/mute_button_off.png" alt="" style="display: none;">
	
<img id="level_bar_disabled" width="1200" height="791" src="/img/level_bar_disabled.png" alt="" style="display: none;">
	
<img id="level_bar_nqpaxxx_disabled" width="1560" height="791" src="/img/level_bar_nqpaxxx_disabled.png" alt="" style="display: none;">
	
<img id="level_bar_ga20p2_disabled" width="210" height="791" src="/img/level_bar_ga20p2_disabled.png" alt="" style="display: none;">
	
<img id="mixer_channel_aqua" width="150" height="791" src="/img/mixer_channel_aqua.png" alt="" style="display: none;">
<img id="mixer_channel_blue" width="150" height="791" src="/img/mixer_channel_blue.png" alt="" style="display: none;">
<img id="mixer_channel_green" width="150" height="791" src="/img/mixer_channel_green.png" alt="" style="display: none;">
<img id="mixer_channel_grey" width="150" height="791" src="/img/mixer_channel_grey.png" alt="" style="display: none;">
<img id="mixer_channel_orange" width="150" height="791" src="/img/mixer_channel_orange.png" alt="" style="display: none;">
<img id="mixer_channel_pink" width="150" height="791" src="/img/mixer_channel_pink.png" alt="" style="display: none;">
<img id="mixer_channel_purple" width="150" height="791" src="/img/mixer_channel_purple.png" alt="" style="display: none;">
<img id="mixer_channel_red" width="150" height="791" src="/img/mixer_channel_red.png" alt="" style="display: none;">
<img id="mixer_channel_yellow" width="150" height="791" src="/img/mixer_channel_yellow.png" alt="" style="display: none;">

<img id="mixer_channel_1_levels_aqua" width="210" height="791" src="/img/mixer_channel_1_levels_aqua.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_blue" width="210" height="791" src="/img/mixer_channel_1_levels_blue.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_green" width="210" height="791" src="/img/mixer_channel_1_levels_green.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_grey" width="210" height="791" src="/img/mixer_channel_1_levels_grey.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_orange" width="210" height="791" src="/img/mixer_channel_1_levels_orange.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_pink" width="210" height="791" src="/img/mixer_channel_1_levels_pink.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_purple" width="210" height="791" src="/img/mixer_channel_1_levels_purple.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_red" width="210" height="791" src="/img/mixer_channel_1_levels_red.png" alt="" style="display: none;">
<img id="mixer_channel_1_levels_yellow" width="210" height="791" src="/img/mixer_channel_1_levels_yellow.png" alt="" style="display: none;">
	
<img id="mixer_channel_2_levels_aqua" width="210" height="791" src="/img/mixer_channel_2_levels_aqua.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_blue" width="210" height="791" src="/img/mixer_channel_2_levels_blue.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_green" width="210" height="791" src="/img/mixer_channel_2_levels_green.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_grey" width="210" height="791" src="/img/mixer_channel_2_levels_grey.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_orange" width="210" height="791" src="/img/mixer_channel_2_levels_orange.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_pink" width="210" height="791" src="/img/mixer_channel_2_levels_pink.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_purple" width="210" height="791" src="/img/mixer_channel_2_levels_purple.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_red" width="210" height="791" src="/img/mixer_channel_2_levels_red.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_yellow" width="210" height="791" src="/img/mixer_channel_2_levels_yellow.png" alt="" style="display: none;">
	
<img id="mixer_channel_3_levels_aqua" width="210" height="791" src="/img/mixer_channel_3_levels_aqua.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_blue" width="210" height="791" src="/img/mixer_channel_3_levels_blue.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_green" width="210" height="791" src="/img/mixer_channel_3_levels_green.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_grey" width="210" height="791" src="/img/mixer_channel_3_levels_grey.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_orange" width="210" height="791" src="/img/mixer_channel_3_levels_orange.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_pink" width="210" height="791" src="/img/mixer_channel_3_levels_pink.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_purple" width="210" height="791" src="/img/mixer_channel_3_levels_purple.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_red" width="210" height="791" src="/img/mixer_channel_3_levels_red.png" alt="" style="display: none;">
<img id="mixer_channel_3_levels_yellow" width="210" height="791" src="/img/mixer_channel_3_levels_yellow.png" alt="" style="display: none;">
	
<img id="mixer_channel_2_levels_aqua_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_aqua_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_blue_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_blue_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_green_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_green_no_sig_no_clip.png" alt="" style="display: none;">	
<img id="mixer_channel_2_levels_grey_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_grey_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_orange_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_orange_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_pink_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_pink_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_purple_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_purple_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_red_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_red_no_sig_no_clip.png" alt="" style="display: none;">
<img id="mixer_channel_2_levels_yellow_no_sig_no_clip" width="210" height="791" src="/img/mixer_channel_2_levels_yellow_no_sig_no_clip.png" alt="" style="display: none;">
	
<img id="mixer_mode_block1" width="150" height="186" src="/img/mixer_mode_block1.png" alt="" style="display: none;">
<img id="mixer_mode_block2" width="150" height="186" src="/img/mixer_mode_block2.png" alt="" style="display: none;">
<img id="mixer_mode_block3" width="150" height="186" src="/img/mixer_mode_block3.png" alt="" style="display: none;">
<img id="mixer_mode_block4" width="150" height="186" src="/img/mixer_mode_block3.png" alt="" style="display: none;">
<img id="mixer_mode_block5" width="150" height="186" src="/img/mixer_mode_block3.png" alt="" style="display: none;">
<img id="mixer_mode_block6" width="150" height="186" src="/img/mixer_mode_block3.png" alt="" style="display: none;">
<img id="mixer_mode_block7" width="150" height="186" src="/img/mixer_mode_block4.png" alt="" style="display: none;">
	
<img id="level_bar_amp2c_disabled" width="630" height="791" src="/img/level_bar_amp2c_disabled.png" alt="" style="display: none;">
<img id="level_bar_amp4c_disabled" width="1260" height="791" src="/img/level_bar_amp4c_disabled.png" alt="" style="display: none;">
<img id="level_bar_s810v2_disabled" width="210" height="791" src="/img/level_bar_s810v2_disabled.png" alt="" style="display: none;">
<img id="level_bar_edp01_disabled" width="210" height="791" src="/img/level_bar_edp01_disabled.png" alt="" style="display: none;">
<img id="level_bar_ampg2_2c_disabled" width="420" height="791" src="/img/level_bar_ampg2_2c_disabled.png" alt="" style="display: none;">
<img id="level_bar_ampg2_4c_disabled" width="840" height="791" src="/img/level_bar_ampg2_4c_disabled.png" alt="" style="display: none;">
<img id="level_bar_nqga400p_disabled" width="840" height="791" src="/img/level_bar_nqga400p_disabled.png" alt="" style="display: none;">
<img id="level_bar_nqga40p3_disabled" width="420" height="791" src="/img/level_bar_nqga40p3_disabled.png" alt="" style="display: none;">
<img id="level_bar_dsc01_disabled" width="420" height="791" src="/img/level_bar_dsc01_disabled.png" alt="" style="display: none;">

<img id="level_fader1" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader2" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader3" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader4" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader5" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader6" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader7" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
<img id="level_fader8" width="36" height="89" src="/img/fader.png" alt="" style="display: none;">
	
<img id="router_bar" width="1202" height="719" src="/img/router_bar.png" alt="" style="display: none;">
<img id="router_bar_nqpaxxx" width="1402" height="719" src="/img/router_bar_nqpaxxx.png" alt="" style="display: none;">
<img id="router_bar_amp2c" width="803" height="335" src="/img/router_bar_amp2c.png" alt="" style="display: none;">
<img id="router_bar_amp4c" width="1203" height="465" src="/img/router_bar_amp4c.png" alt="" style="display: none;">
<img id="router_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="router_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
<img id="router_bar_amp2c_g2" width="803" height="464" src="/img/router_bar_amp2c_g2.png" alt="" style="display: none;">
<img id="router_bar_amp4c_g2" width="1203" height="719" src="/img/router_bar_amp4c_g2.png" alt="" style="display: none;">

<img id="router_touch_gain1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_gain2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_gain3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_gain4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">	
	
<img id="router_touch_input1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_input2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_input3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_input4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_input5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="router_touch_output1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_output2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_output3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_output4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_output5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_output6" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="router_touch_cg11" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg12" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg13" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg14" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg15" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg16" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="router_touch_cg21" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg22" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg23" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg24" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg25" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg26" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">

<img id="router_touch_cg31" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg32" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg33" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg34" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg35" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg36" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="router_touch_cg41" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg42" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg43" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg44" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg45" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="router_touch_cg46" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">

<img id="router_indicator_gain1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_gain2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_gain3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_gain4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">	
	
<img id="router_indicator_input1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_input2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_input3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_input4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_input5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_output1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_output2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_output3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_output4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_output5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_output6" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_cg11" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg12" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg13" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg14" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg15" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg16" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_cg21" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg22" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg23" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg24" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg25" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg26" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_cg31" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg32" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg33" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg34" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg35" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg36" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_cg41" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg42" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg43" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg44" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg45" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg46" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="router_indicator_cg51" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg52" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg53" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg54" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="router_indicator_cg55" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="enabled_input1_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_input2_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_input3_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_input4_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_input5_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_input1_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_input2_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_input3_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_input4_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_input5_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_output1_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_output2_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_output3_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_output4_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_output5_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_output6_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">

<img id="enabled_output1_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_output2_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_output3_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_output4_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_output5_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_output6_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_cg11_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg12_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg13_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg14_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg15_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg16_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_cg11_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg12_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg13_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg14_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg15_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg16_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_cg21_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg22_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg23_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg24_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg25_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg26_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_cg21_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg22_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg23_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg24_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg25_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg26_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_cg31_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg32_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg33_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg34_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg35_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg36_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_cg31_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg32_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg33_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg34_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg35_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg36_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_cg41_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg42_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg43_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg44_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg45_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg46_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_cg41_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg42_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg43_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg44_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg45_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg46_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="enabled_cg51_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg52_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg53_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg54_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="enabled_cg55_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_cg51_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg52_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg53_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg54_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_cg55_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="dropdown_button1" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button2" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button3" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button4" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button5" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button6" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button7" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
<img id="dropdown_button8" width="40" height="36" src="/img/dropdown_button.png" alt="" style="display: none;">
	
<img id="geq_bar" width="2074" height="664" src="/img/geq_bar.png" alt="" style="display: none;">
<img id="geq_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="geq_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="geq_fader_GEQ25HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ40HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ63HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ100HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ160HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ250HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ400HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ630HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ1000HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ1600HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ2500HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ4000HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ6300HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ10000HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ16000HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
<img id="geq_fader_GEQ20000HZ" width="62" height="43" src="/img/eq_fader.png" alt="" style="display: none;">
	
<img id="geq_GEQ25HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ40HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ63HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ100HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ160HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ250HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ400HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ630HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ1000HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ1600HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ2500HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ4000HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ6300HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ10000HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ16000HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="geq_GEQ20000HZ_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">

<img id="geq_GEQ25HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ40HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ63HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ100HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ160HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ250HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ400HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ630HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ1000HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ1600HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ2500HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ4000HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ6300HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ10000HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ16000HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="geq_GEQ20000HZ_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="peq_bar" width="1663" height="740" src="/img/peq_bar.png" alt="" style="display: none;">
<img id="peq_bar_5" width="1663" height="740" src="/img/peq_bar_5.png" alt="" style="display: none;">
<img id="peq_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="peq_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
		
<img id="peq_S1_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S2_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S3_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S4_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S5_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S6_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
<img id="peq_S7_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="peq_S1_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S2_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S3_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S4_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S5_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S6_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="peq_S7_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="peq_indicator_fader_S1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S6" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_fader_S7" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="peq_indicator_freq_S1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S6" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_freq_S7" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="peq_indicator_q_S1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S6" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="peq_indicator_q_S7" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">

<img id="peq_touch_fader_S1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S6" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_fader_S7" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="peq_touch_freq_S1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S6" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_freq_S7" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="peq_touch_q_S1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S6" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="peq_touch_q_S7" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="compressor_bar" width="1024" height="564" src="/img/compressor_bar.png" alt="" style="display: none;">
<img id="compressor_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="compressor_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="compressor_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="compressor_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="compressor_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="compressor_indicator_Attack" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="compressor_indicator_Hold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="compressor_indicator_Decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="compressor_indicator_Knee" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="compressor_indicator_Ratio" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="compressor_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="compressor_touch_Attack" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="compressor_touch_Hold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="compressor_touch_Decay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="compressor_touch_Knee" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="compressor_touch_Ratio" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
		
<img id="limiter_bar" width="724" height="564" src="/img/limiter_bar.png" alt="" style="display: none;">
<img id="limiter_bar2" width="602" height="564" src="/img/limiter_bar2.png" alt="" style="display: none;">
<img id="limiter_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="limiter_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="limiter_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="limiter_indicator_Decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="limiter_indicator_RMSTC" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="limiter_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="limiter_touch_Decay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="limiter_touch_RMSTC" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="noise_gate_bar" width="824" height="564" src="/img/noise_gate_bar.png" alt="" style="display: none;">
<img id="noise_gate_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="noise_gate_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="noise_gate_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="noise_gate_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="noise_gate_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="noise_gate_indicator_Attack" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="noise_gate_indicator_Hold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="noise_gate_indicator_Decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="noise_gate_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="noise_gate_touch_Attack" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="noise_gate_touch_Hold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="noise_gate_touch_Decay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="rms_limiter_bar" width="824" height="564" src="/img/peak_rms_limiter_bar.png" alt="" style="display: none;">
<img id="rms_limiter_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="rms_limiter_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="rms_limiter_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="rms_limiter_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="rms_limiter_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="rms_limiter_indicator_Attack" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="rms_limiter_indicator_Hold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="rms_limiter_indicator_Decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="rms_limiter_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="rms_limiter_touch_Attack" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="rms_limiter_touch_Hold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="rms_limiter_touch_Decay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">

<img id="peak_limiter_bar" width="824" height="564" src="/img/peak_rms_limiter_bar.png" alt="" style="display: none;">
<img id="peak_limiter_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="peak_limiter_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="peak_limiter_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="peak_limiter_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="peak_limiter_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="peak_limiter_indicator_Attack" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="peak_limiter_indicator_Hold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="peak_limiter_indicator_Decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="peak_limiter_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="peak_limiter_touch_Attack" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="peak_limiter_touch_Hold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="peak_limiter_touch_Decay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">

<img id="signal_present_bar" width="602" height="564" src="/img/signal_present_bar.png" alt="" style="display: none;">
<img id="signal_present_bar_no_clip" width="602" height="564" src="/img/signal_present_bar_no_clip.png" alt="" style="display: none;">
<img id="signal_present_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="signal_present_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="signal_present_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="signal_present_indicator_Trigger" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="signal_present_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="signal_present_touch_Trigger" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="signal_present_gray_light" width="48" height="48" src="/img/gray_light.png" alt="" style="display: none;">
<img id="signal_present_green_light" width="48" height="48" src="/img/green_light.png" alt="" style="display: none;">
	
<img id="ducker_bar" width="602" height="564" src="/img/ducker_bar.png" alt="" style="display: none;">
<img id="ducker_bar2" width="723" height="564" src="/img/ducker_bar2.png" alt="" style="display: none;">
<img id="ducker_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="ducker_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="ducker_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="ducker_indicator_Hold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="ducker_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="ducker_touch_Hold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="ducker_MasterIn1_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_MasterIn1_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_MasterIn2_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_MasterIn2_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_MasterIn3_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_MasterIn3_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_MasterIn4_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_MasterIn4_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="ducker_DuckedIn1_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_DuckedIn1_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_DuckedIn2_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_DuckedIn2_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_DuckedIn3_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_DuckedIn3_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="ducker_DuckedIn4_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="ducker_DuckedIn4_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="hplp_bar" width="824" height="564" src="/img/hplp_bar.png" alt="" style="display: none;">
<img id="hplp_bar_no_clip" width="824" height="564" src="/img/hplp_bar_no_clip.png" alt="" style="display: none;">
<img id="hplp_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="hplp_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="hplp_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="hplp_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="hplp_indicator_Frequency" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="hplp_indicator_Type" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="hplp_touch_Frequency" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="hplp_touch_Type" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="indicator_SignalGain1" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="indicator_SignalGain2" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="indicator_SignalGain3" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="indicator_SignalGain4" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="indicator_SignalGain5" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="indicator_SignalGain6" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="touch_SignalGain1" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="touch_SignalGain2" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="touch_SignalGain3" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="touch_SignalGain4" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="touch_SignalGain5" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="touch_SignalGain6" width="48" height="48" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="Mode_button1" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Mode_button2" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Mode_button3" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Mode_button4" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
	
<img id="Mode_touch1" width="80" height="35" src="/img/toggle_touch_large.png" alt="" style="display: none;">
<img id="Mode_touch2" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="Mode_touch3" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="Mode_touch4" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
	
<img id="Phantom_button1" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Phantom_button2" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Phantom_button3" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="Phantom_button4" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
	
<img id="Phantom_touch1" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="Phantom_touch2" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="Phantom_touch3" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="Phantom_touch4" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
	
<img id="noise_gen_button1" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="noise_gen_button2" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="noise_gen_button3" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="noise_gen_button4" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
	
<img id="noise_gen_touch1" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="noise_gen_touch2" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="noise_gen_touch3" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="noise_gen_touch4" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
	
<img id="noise_gen_background1" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="noise_gen_background2" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="noise_gen_background3" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="noise_gen_background4" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
	
<img id="invert_button1" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="invert_button2" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="invert_button3" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
<img id="invert_button4" width="27" height="27" src="/img/toggle_button.png" alt="" style="display: none;">
	
<img id="invert_touch1" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="invert_touch2" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="invert_touch3" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
<img id="invert_touch4" width="61" height="35" src="/img/toggle_touch.png" alt="" style="display: none;">
	
<img id="invert_background1" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="invert_background2" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="invert_background3" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
<img id="invert_background4" width="60" height="35" src="/img/toggle_background.png" alt="" style="display: none;">
	
<img id="settings_bar" width="702" height="714" src="/img/settings_bar.png" alt="" style="display: none;">
<img id="settings_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="settings_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="standby_bar_2c" width="702" height="564" src="/img/standby_bar_2c.png" alt="" style="display: none;">
<img id="standby_bar_4c" width="702" height="564" src="/img/standby_bar_4c.png" alt="" style="display: none;">
<img id="standby_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="standby_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="mute_bar_2c" width="702" height="564" src="/img/mute_bar_2c.png" alt="" style="display: none;">
<img id="mute_bar_4c" width="702" height="564" src="/img/mute_bar_4c.png" alt="" style="display: none;">
<img id="mute_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="mute_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="status_bar" width="702" height="564" src="/img/status_bar.png" alt="" style="display: none;">
<img id="status_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
	
<img id="enabled_router11_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router11_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router12_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router12_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router13_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router13_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router14_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router14_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router21_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router21_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router22_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router22_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router23_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router23_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_router24_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_router24_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="duplexer_bar" width="824" height="564" src="/img/duplexer_bar.png" alt="" style="display: none;">
<img id="duplexer_bar_edp01" width="824" height="564" src="/img/duplexer_bar_edp01.png" alt="" style="display: none;">
<img id="duplexer_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="duplexer_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="duplexer_indicator_compressor" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="duplexer_indicator_noise_gate" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="duplexer_indicator_talkback_threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
<img id="duplexer_indicator_talkback_decay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="duplexer_compressor_touch" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="duplexer_noise_gate_touch" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="duplexer_talkback_threshold_touch" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
<img id="duplexer_talkback_decay_touch" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="presets_bar" width="702" height="564" src="/img/presets_bar.png" alt="" style="display: none;">
<img id="presets_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
	
<img id="outputs_bar_nqga20" width="602" height="335" src="/img/outputs_bar_nqga20.png" alt="" style="display: none;">
<img id="outputs_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="outputs_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="enabled_speaker_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_speaker_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="enabled_line_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
<img id="enabled_line_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">
	
<img id="outputs_indicator_speaker" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
<img id="outputs_indicator_line" width="52" height="52" src="/img/knob_indicator.png" alt="" style="display: none;">
	
<img id="outputs_touch_speaker" width="72" height="72" src="/img/knob_touch.png" alt="" style="display: none;">
<img id="outputs_touch_line" width="72" height="72" src="/img/knob_touch.png" alt="" style="display: none;">
	
<img id="delay_bar" width="602" height="564" src="/img/delay_bar.png" alt="" style="display: none;">
<img id="delay_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="delay_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
	
<img id="delay_indicator_Delay" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">
	
<img id="delay_touch_Delay" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="phase_invert_bar" width="602" height="564" src="/img/phase_invert_bar.png" alt="" style="display: none;">
<img id="phase_invert_close_button" width="40" height="36" src="/img/close_button.png" alt="" style="display: none;">
<img id="phase_invert_reset_button" width="41" height="36" src="/img/reset_button.png" alt="" style="display: none;">
<img id="phase_invert_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="phase_invert_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="standby_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="standby_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">
	
<img id="standby_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">	
<img id="standby_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
<img id="mute_Enabled_on" width="56" height="56" src="/img/green_button_on.png" alt="" style="display: none;">	
<img id="mute_Enabled_off" width="56" height="56" src="/img/gray_button_off.png" alt="" style="display: none;">

<img id="mute_indicator_Threshold" width="39" height="121" src="/img/knob_indicator_large.png" alt="" style="display: none;">	
<img id="mute_touch_Threshold" width="122" height="122" src="/img/knob_touch_large.png" alt="" style="display: none;">
	
</div>
	
	
<!--  start upload modal -->
<div id="upload_preset" class="modal" tabindex="-1" role="dialog" aria-labelledby="upload_preset" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog">
	<div class="modal-content">
			 <div class="modal-header">       							
			<h4 class="modal-title"><p align="center">Upload Presets</p></h4>
			</div>
			<form method="POST" action="/scripts.php?s=upload_presets" class="form-horizontal" enctype="multipart/form-data">
			<input type="hidden" name="_token" value="{{ csrf_token() }}">
			<div align="center" class="modal-body">
				<div style="text-align:center; width:60%;">
					<input id="fileuploads" name="fileuploads[]" type="file" class="filestyle" data-buttonName="btn-primary" data-buttonText="&nbsp;Choose file" data-size="sm" data-placeholder="No file selected" multiple="multiple">
				</div>
			</div>
			<div class="modal-footer">        							
			<button type="button" class="btn btn-xs btn-default" data-dismiss="modal">Close</button>
			<button  type="submit" name="upload_button" id="upload_button" onClick="this.disabled=true;forms[0].submit();" class="btn btn-xs btn-primary"><span id="upload_spinner"><i class='fa fa-upload'></i>&nbsp;&nbsp;Upload</span></button>
			</div>
		  </form>
	</div>  							
	</div>
	</div>
<!--  end upload modal -->
	
<!--  start preset upload status modal -->
<div id="preset_upload_status_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="preset_upload_status_modal" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog modal-lg">
	<div class="modal-content">
			 <div class="modal-header">       							
			<h4 class="modal-title"><p align="center">Preset Upload Status</p></h4>
			</div>
			<div id="upload_preset_response_text" align="left" class="modal-body"></div>
			<div class="modal-footer">        							
				<button type="button" class="btn btn-xs btn-default" data-dismiss="modal">OK</button>
			</div>
	</div>  							
	</div>
	</div>
<!--  end preset upload status modal -->
	
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/fabric.min.js"></script>
<script src="/js/bootstrap-growl.min.js"></script>
</body>
</html>
<script>
var device_id = '<?php echo $_SESSION['device_id']; ?>';
// on page load
window.onload = function() {
	// only start the web socket for these devices
	if(['nq-mix','nq-amp2c','nq-amp4c','nq-s810v2','nq-wbc','nq-ga20p2','nq-nqpaxxx','nq-amp2c-g2','nq-amp4c-g2','nq-edp01','nq-ga400p','nq-ga40p3','nq-dsc01'].indexOf(device_id)>-1){ 
		init_socket(); 
	}
}
var socket;
var canvas;
var chart_canvas;
var menu_timer;
var router_touch_temp;
var channel_view;
var peq_touch_temp;
var compressor_touch_temp;
var limiter_touch_temp;
var noise_gate_touch_temp;
var signal_present_touch_temp;
var ducker_touch_temp;
var hplp_touch_temp;
var mic_touch_temp;
var duplexer_compressor_touch_temp;
var duplexer_noise_gate_touch_temp;
var duplexer_talkback_threshold_touch_temp;
var duplexer_talkback_decay_touch_temp;
var outputs_touch_temp;
var delay_touch_temp;
var rms_limiter_touch_temp;
var peak_limiter_touch_temp;
var chartData;
var presetsArray;
var standby_touch_temp;
var mute_touch_temp;
	
var main_data_array = [
		{type:"knob",name:"SignalGain1",parameter:"SignalGain",channel:"1",indicator_left:105,indicator_top:594,text_left:95,text_top:543},
		{type:"knob",name:"SignalGain2",parameter:"SignalGain",channel:"2",indicator_left:315,indicator_top:594,text_left:305,text_top:543},
		{type:"knob",name:"SignalGain3",parameter:"SignalGain",channel:"3",indicator_left:525,indicator_top:594,text_left:515,text_top:543},
		{type:"knob",name:"SignalGain4",parameter:"SignalGain",channel:"4",indicator_left:735,indicator_top:594,text_left:725,text_top:543},
		{type:"knob2",name:"SignalGain5",parameter:"SignalGain",channel:"5",indicator_left:525,indicator_top:594,text_left:515,text_top:543},
	];
	
var main_data_array2 = [
		{type:"knob2",name:"SignalGain5",parameter:"SignalGain",channel:"5",indicator_left:945,indicator_top:594,text_left:935,text_top:543},
		{type:"knob2",name:"SignalGain6",parameter:"SignalGain",channel:"6",indicator_left:1155,indicator_top:594,text_left:1145,text_top:543},
	];
	
var main_data_array3 = [
		{type:"knob",name:"SignalGain1",parameter:"SignalGain",channel:"1",indicator_left:105,indicator_top:594,text_left:95,text_top:543},
		{type:"knob",name:"SignalGain2",parameter:"SignalGain",channel:"2",indicator_left:315,indicator_top:594,text_left:305,text_top:543},
	];
	
var main_data_array4 = [
		{type:"knob",name:"SignalGain1",parameter:"SignalGain",channel:"1",indicator_left:105,indicator_top:594,text_left:95,text_top:543},
	];
	
var router_data_array = [
		{name:"input1",parameter:"IG1",indicator_left:131,indicator_top:265,text_left:120,text_top:215,button_left:20,button_top:244},
		{name:"input2",parameter:"IG2",indicator_left:131,indicator_top:392,text_left:120,text_top:342,button_left:20,button_top:370},
		{name:"input3",parameter:"IG3",indicator_left:131,indicator_top:520,text_left:120,text_top:470,button_left:20,button_top:500},
		{name:"input4",parameter:"IG4",indicator_left:131,indicator_top:647,text_left:120,text_top:598,button_left:20,button_top:626},
	
		{name:"output1",parameter:"OG1",indicator_left:331,indicator_top:139,text_left:320,text_top:89,button_left:220,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:531,indicator_top:139,text_left:520,text_top:89,button_left:420,button_top:117},
		{name:"output3",parameter:"OG3",indicator_left:731,indicator_top:139,text_left:720,text_top:89,button_left:620,button_top:117},
		{name:"output4",parameter:"OG4",indicator_left:931,indicator_top:139,text_left:920,text_top:89,button_left:820,button_top:117},
		{name:"output5",parameter:"OG5",indicator_left:1132,indicator_top:139,text_left:1120,text_top:89,button_left:1020,button_top:117},
	
		{name:"cg11",parameter:"CG11",indicator_left:331,indicator_top:265,text_left:320,text_top:215,button_left:220,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:531,indicator_top:265,text_left:520,text_top:215,button_left:420,button_top:244},
		{name:"cg13",parameter:"CG13",indicator_left:731,indicator_top:265,text_left:720,text_top:215,button_left:620,button_top:244},
		{name:"cg14",parameter:"CG14",indicator_left:931,indicator_top:265,text_left:920,text_top:215,button_left:820,button_top:244},
		{name:"cg15",parameter:"CG15",indicator_left:1132,indicator_top:265,text_left:1120,text_top:215,button_left:1020,button_top:244},
	
		{name:"cg21",parameter:"CG21",indicator_left:331,indicator_top:392,text_left:320,text_top:342,button_left:220,button_top:370},
		{name:"cg22",parameter:"CG22",indicator_left:531,indicator_top:392,text_left:520,text_top:342,button_left:420,button_top:370},
		{name:"cg23",parameter:"CG23",indicator_left:731,indicator_top:392,text_left:720,text_top:342,button_left:620,button_top:370},
		{name:"cg24",parameter:"CG24",indicator_left:931,indicator_top:392,text_left:920,text_top:342,button_left:820,button_top:370},
		{name:"cg25",parameter:"CG25",indicator_left:1132,indicator_top:392,text_left:1120,text_top:342,button_left:1020,button_top:370},
	
		{name:"cg31",parameter:"CG31",indicator_left:331,indicator_top:520,text_left:320,text_top:470,button_left:220,button_top:500},
		{name:"cg32",parameter:"CG32",indicator_left:531,indicator_top:520,text_left:520,text_top:470,button_left:420,button_top:500},
		{name:"cg33",parameter:"CG33",indicator_left:731,indicator_top:520,text_left:720,text_top:470,button_left:620,button_top:500},
		{name:"cg34",parameter:"CG34",indicator_left:931,indicator_top:520,text_left:920,text_top:470,button_left:820,button_top:500},
		{name:"cg35",parameter:"CG35",indicator_left:1132,indicator_top:520,text_left:1120,text_top:470,button_left:1020,button_top:500},
	
		{name:"cg41",parameter:"CG41",indicator_left:331,indicator_top:647,text_left:320,text_top:598,button_left:220,button_top:626},
		{name:"cg42",parameter:"CG42",indicator_left:531,indicator_top:647,text_left:520,text_top:598,button_left:420,button_top:626},
		{name:"cg43",parameter:"CG43",indicator_left:731,indicator_top:647,text_left:720,text_top:598,button_left:620,button_top:626},
		{name:"cg44",parameter:"CG44",indicator_left:931,indicator_top:647,text_left:920,text_top:598,button_left:820,button_top:626},
		{name:"cg45",parameter:"CG45",indicator_left:1132,indicator_top:647,text_left:1120,text_top:598,button_left:1020,button_top:626},
	];
	
	var router_data_array2 = [
		
		{name:"input1",parameter:"IG1",indicator_left:332,indicator_top:265,text_left:321,text_top:215,button_left:221,button_top:244},
	
		{name:"output1",parameter:"OG1",indicator_left:532,indicator_top:139,text_left:521,text_top:89,button_left:421,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:732,indicator_top:139,text_left:721,text_top:89,button_left:621,button_top:117},
		
		{name:"cg11",parameter:"CG11",indicator_left:532,indicator_top:265,text_left:521,text_top:215,button_left:421,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:732,indicator_top:265,text_left:721,text_top:215,button_left:621,button_top:244},
		
		{name:"gain1",parameter:"gain",indicator_left:102,indicator_top:265,text_left:92,text_top:215,button_left:221,button_top:244},
	];
	
	var router_data_array3 = [
		{name:"input1",parameter:"IG1",indicator_left:332,indicator_top:265,text_left:321,text_top:215,button_left:221,button_top:244},
		{name:"input2",parameter:"IG2",indicator_left:332,indicator_top:392,text_left:321,text_top:342,button_left:221,button_top:370},
	
		{name:"output1",parameter:"OG1",indicator_left:532,indicator_top:139,text_left:521,text_top:89,button_left:421,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:732,indicator_top:139,text_left:721,text_top:89,button_left:621,button_top:117},
		{name:"output3",parameter:"OG3",indicator_left:932,indicator_top:139,text_left:921,text_top:89,button_left:821,button_top:117},
		{name:"output4",parameter:"OG4",indicator_left:1132,indicator_top:139,text_left:1121,text_top:89,button_left:1021,button_top:117},
	
		{name:"cg11",parameter:"CG11",indicator_left:532,indicator_top:265,text_left:521,text_top:215,button_left:421,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:732,indicator_top:265,text_left:721,text_top:215,button_left:621,button_top:244},
		{name:"cg13",parameter:"CG13",indicator_left:932,indicator_top:265,text_left:921,text_top:215,button_left:821,button_top:244},
		{name:"cg14",parameter:"CG14",indicator_left:1132,indicator_top:265,text_left:1121,text_top:215,button_left:1021,button_top:244},
	
		{name:"cg21",parameter:"CG21",indicator_left:532,indicator_top:392,text_left:521,text_top:342,button_left:421,button_top:370},
		{name:"cg22",parameter:"CG22",indicator_left:732,indicator_top:392,text_left:721,text_top:342,button_left:621,button_top:370},
		{name:"cg23",parameter:"CG23",indicator_left:932,indicator_top:392,text_left:921,text_top:342,button_left:821,button_top:370},
		{name:"cg24",parameter:"CG24",indicator_left:1132,indicator_top:392,text_left:1121,text_top:342,button_left:1021,button_top:370},
		
		{name:"gain1",parameter:"gain",indicator_left:102,indicator_top:265,text_left:92,text_top:215,button_left:221,button_top:244},
		{name:"gain2",parameter:"gain",indicator_left:102,indicator_top:392,text_left:92,text_top:342,button_left:221,button_top:370},
	];
	
	var router_data_array4 = [
		{name:"input1",parameter:"IG1",indicator_left:332,indicator_top:265,text_left:321,text_top:215,button_left:221,button_top:244},
		{name:"input2",parameter:"IG2",indicator_left:332,indicator_top:392,text_left:321,text_top:342,button_left:221,button_top:370},
		{name:"input3",parameter:"IG3",indicator_left:332,indicator_top:520,text_left:321,text_top:470,button_left:221,button_top:500},
		{name:"input4",parameter:"IG4",indicator_left:332,indicator_top:647,text_left:321,text_top:598,button_left:221,button_top:626},
	
		{name:"output1",parameter:"OG1",indicator_left:532,indicator_top:139,text_left:521,text_top:89,button_left:421,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:732,indicator_top:139,text_left:721,text_top:89,button_left:621,button_top:117},
		{name:"output3",parameter:"OG3",indicator_left:932,indicator_top:139,text_left:921,text_top:89,button_left:821,button_top:117},
		{name:"output4",parameter:"OG4",indicator_left:1132,indicator_top:139,text_left:1121,text_top:89,button_left:1021,button_top:117},
	
		{name:"cg11",parameter:"CG11",indicator_left:532,indicator_top:265,text_left:521,text_top:215,button_left:421,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:732,indicator_top:265,text_left:721,text_top:215,button_left:621,button_top:244},
		{name:"cg13",parameter:"CG13",indicator_left:932,indicator_top:265,text_left:921,text_top:215,button_left:821,button_top:244},
		{name:"cg14",parameter:"CG14",indicator_left:1132,indicator_top:265,text_left:1121,text_top:215,button_left:1021,button_top:244},
	
		{name:"cg21",parameter:"CG21",indicator_left:532,indicator_top:392,text_left:521,text_top:342,button_left:421,button_top:370},
		{name:"cg22",parameter:"CG22",indicator_left:732,indicator_top:392,text_left:721,text_top:342,button_left:621,button_top:370},
		{name:"cg23",parameter:"CG23",indicator_left:932,indicator_top:392,text_left:921,text_top:342,button_left:821,button_top:370},
		{name:"cg24",parameter:"CG24",indicator_left:1132,indicator_top:392,text_left:1121,text_top:342,button_left:1021,button_top:370},
	
		{name:"cg31",parameter:"CG31",indicator_left:532,indicator_top:520,text_left:521,text_top:470,button_left:421,button_top:500},
		{name:"cg32",parameter:"CG32",indicator_left:732,indicator_top:520,text_left:721,text_top:470,button_left:621,button_top:500},
		{name:"cg33",parameter:"CG33",indicator_left:932,indicator_top:520,text_left:921,text_top:470,button_left:821,button_top:500},
		{name:"cg34",parameter:"CG34",indicator_left:1132,indicator_top:520,text_left:1121,text_top:470,button_left:1021,button_top:500},
	
		{name:"cg41",parameter:"CG41",indicator_left:532,indicator_top:647,text_left:521,text_top:598,button_left:421,button_top:626},
		{name:"cg42",parameter:"CG42",indicator_left:732,indicator_top:647,text_left:721,text_top:598,button_left:621,button_top:626},
		{name:"cg43",parameter:"CG43",indicator_left:932,indicator_top:647,text_left:921,text_top:598,button_left:821,button_top:626},
		{name:"cg44",parameter:"CG44",indicator_left:1132,indicator_top:647,text_left:1121,text_top:598,button_left:1021,button_top:626},
		
		{name:"gain1",parameter:"gain",indicator_left:102,indicator_top:265,text_left:92,text_top:215,button_left:221,button_top:244},
		{name:"gain2",parameter:"gain",indicator_left:102,indicator_top:392,text_left:92,text_top:342,button_left:221,button_top:370},
		{name:"gain3",parameter:"gain",indicator_left:102,indicator_top:520,text_left:92,text_top:470,button_left:221,button_top:500},
		{name:"gain4",parameter:"gain",indicator_left:102,indicator_top:647,text_left:92,text_top:598,button_left:221,button_top:626},
	];
	
	var router_data_array5 = [
		
		{name:"input1",parameter:"IG1",indicator_left:332,indicator_top:265,text_left:321,text_top:215,button_left:221,button_top:244},
		{name:"input2",parameter:"IG2",indicator_left:332,indicator_top:392,text_left:321,text_top:342,button_left:221,button_top:370},
	
		{name:"output1",parameter:"OG1",indicator_left:532,indicator_top:139,text_left:521,text_top:89,button_left:421,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:732,indicator_top:139,text_left:721,text_top:89,button_left:621,button_top:117},
		
		{name:"cg11",parameter:"CG11",indicator_left:532,indicator_top:265,text_left:521,text_top:215,button_left:421,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:732,indicator_top:265,text_left:721,text_top:215,button_left:621,button_top:244},
	
		{name:"cg21",parameter:"CG21",indicator_left:532,indicator_top:392,text_left:521,text_top:342,button_left:421,button_top:370},
		{name:"cg22",parameter:"CG22",indicator_left:732,indicator_top:392,text_left:721,text_top:342,button_left:621,button_top:370},
		
		{name:"gain1",parameter:"gain",indicator_left:102,indicator_top:265,text_left:92,text_top:215,button_left:221,button_top:244},
		{name:"gain2",parameter:"gain",indicator_left:102,indicator_top:392,text_left:92,text_top:342,button_left:221,button_top:370},
	];
	
	var router_data_array6 = [
		{name:"input1",parameter:"IG1",indicator_left:131,indicator_top:265,text_left:120,text_top:215,button_left:20,button_top:244},
		{name:"input2",parameter:"IG2",indicator_left:131,indicator_top:392,text_left:120,text_top:342,button_left:20,button_top:370},
		{name:"input3",parameter:"IG3",indicator_left:131,indicator_top:520,text_left:120,text_top:470,button_left:20,button_top:500},
		{name:"input4",parameter:"IG4",indicator_left:131,indicator_top:647,text_left:120,text_top:598,button_left:20,button_top:626},
	
		{name:"output1",parameter:"OG1",indicator_left:331,indicator_top:139,text_left:320,text_top:89,button_left:220,button_top:117},
		{name:"output2",parameter:"OG2",indicator_left:531,indicator_top:139,text_left:520,text_top:89,button_left:420,button_top:117},
		{name:"output3",parameter:"OG3",indicator_left:731,indicator_top:139,text_left:720,text_top:89,button_left:620,button_top:117},
		{name:"output4",parameter:"OG4",indicator_left:931,indicator_top:139,text_left:920,text_top:89,button_left:820,button_top:117},
		{name:"output5",parameter:"OG5",indicator_left:1132,indicator_top:139,text_left:1120,text_top:89,button_left:1020,button_top:117},
		{name:"output6",parameter:"OG6",indicator_left:1333,indicator_top:139,text_left:1320,text_top:89,button_left:1220,button_top:117},
	
		{name:"cg11",parameter:"CG11",indicator_left:331,indicator_top:265,text_left:320,text_top:215,button_left:220,button_top:244},
		{name:"cg12",parameter:"CG12",indicator_left:531,indicator_top:265,text_left:520,text_top:215,button_left:420,button_top:244},
		{name:"cg13",parameter:"CG13",indicator_left:731,indicator_top:265,text_left:720,text_top:215,button_left:620,button_top:244},
		{name:"cg14",parameter:"CG14",indicator_left:931,indicator_top:265,text_left:920,text_top:215,button_left:820,button_top:244},
		{name:"cg15",parameter:"CG15",indicator_left:1132,indicator_top:265,text_left:1120,text_top:215,button_left:1020,button_top:244},
		{name:"cg16",parameter:"CG16",indicator_left:1333,indicator_top:265,text_left:1320,text_top:215,button_left:1220,button_top:244},
	
		{name:"cg21",parameter:"CG21",indicator_left:331,indicator_top:392,text_left:320,text_top:342,button_left:220,button_top:370},
		{name:"cg22",parameter:"CG22",indicator_left:531,indicator_top:392,text_left:520,text_top:342,button_left:420,button_top:370},
		{name:"cg23",parameter:"CG23",indicator_left:731,indicator_top:392,text_left:720,text_top:342,button_left:620,button_top:370},
		{name:"cg24",parameter:"CG24",indicator_left:931,indicator_top:392,text_left:920,text_top:342,button_left:820,button_top:370},
		{name:"cg25",parameter:"CG25",indicator_left:1132,indicator_top:392,text_left:1120,text_top:342,button_left:1020,button_top:370},
		{name:"cg26",parameter:"CG26",indicator_left:1333,indicator_top:392,text_left:1320,text_top:342,button_left:1220,button_top:370},
	
		{name:"cg31",parameter:"CG31",indicator_left:331,indicator_top:520,text_left:320,text_top:470,button_left:220,button_top:500},
		{name:"cg32",parameter:"CG32",indicator_left:531,indicator_top:520,text_left:520,text_top:470,button_left:420,button_top:500},
		{name:"cg33",parameter:"CG33",indicator_left:731,indicator_top:520,text_left:720,text_top:470,button_left:620,button_top:500},
		{name:"cg34",parameter:"CG34",indicator_left:931,indicator_top:520,text_left:920,text_top:470,button_left:820,button_top:500},
		{name:"cg35",parameter:"CG35",indicator_left:1132,indicator_top:520,text_left:1120,text_top:470,button_left:1020,button_top:500},
		{name:"cg36",parameter:"CG36",indicator_left:1333,indicator_top:520,text_left:1320,text_top:470,button_left:1220,button_top:500},
	
		{name:"cg41",parameter:"CG41",indicator_left:331,indicator_top:647,text_left:320,text_top:598,button_left:220,button_top:626},
		{name:"cg42",parameter:"CG42",indicator_left:531,indicator_top:647,text_left:520,text_top:598,button_left:420,button_top:626},
		{name:"cg43",parameter:"CG43",indicator_left:731,indicator_top:647,text_left:720,text_top:598,button_left:620,button_top:626},
		{name:"cg44",parameter:"CG44",indicator_left:931,indicator_top:647,text_left:920,text_top:598,button_left:820,button_top:626},
		{name:"cg45",parameter:"CG45",indicator_left:1132,indicator_top:647,text_left:1120,text_top:598,button_left:1020,button_top:626},
		{name:"cg46",parameter:"CG46",indicator_left:1333,indicator_top:647,text_left:1320,text_top:598,button_left:1220,button_top:626},
	];
		
	var geq_data_array = [
		{type:"fader",name:"geq_fader_GEQ25HZ",parameter:"GEQ25HZ",left:115,top:412},
		{type:"fader",name:"geq_fader_GEQ40HZ",parameter:"GEQ40HZ",left:219,top:412},
		{type:"fader",name:"geq_fader_GEQ63HZ",parameter:"GEQ63HZ",left:324,top:412},
		{type:"fader",name:"geq_fader_GEQ100HZ",parameter:"GEQ100HZ",left:428,top:412},
		{type:"fader",name:"geq_fader_GEQ160HZ",parameter:"GEQ160HZ",left:533,top:412},
		{type:"fader",name:"geq_fader_GEQ250HZ",parameter:"GEQ250HZ",left:639,top:412},
		{type:"fader",name:"geq_fader_GEQ400HZ",parameter:"GEQ400HZ",left:744,top:412},
		{type:"fader",name:"geq_fader_GEQ630HZ",parameter:"GEQ630HZ",left:849,top:412},
		{type:"fader",name:"geq_fader_GEQ1000HZ",parameter:"GEQ1000HZ",left:954,top:412},
		{type:"fader",name:"geq_fader_GEQ1600HZ",parameter:"GEQ1600HZ",left:1059,top:412},
		{type:"fader",name:"geq_fader_GEQ2500HZ",parameter:"GEQ2500HZ",left:1164,top:412},
		{type:"fader",name:"geq_fader_GEQ4000HZ",parameter:"GEQ4000HZ",left:1269,top:412},
		{type:"fader",name:"geq_fader_GEQ6300HZ",parameter:"GEQ6300HZ",left:1374,top:412},
		{type:"fader",name:"geq_fader_GEQ10000HZ",parameter:"GEQ10000HZ",left:1478,top:412},
		{type:"fader",name:"geq_fader_GEQ16000HZ",parameter:"GEQ16000HZ",left:1583,top:412},
		{type:"fader",name:"geq_fader_GEQ20000HZ",parameter:"GEQ20000HZ",left:1688,top:412},
		
		{type:"enabled",name:"geq_enabled_GEQ25HZ",parameter:"GEQ25HZ",left:118,top:75},
		{type:"enabled",name:"geq_enabled_GEQ40HZ",parameter:"GEQ40HZ",left:222,top:75},
		{type:"enabled",name:"geq_enabled_GEQ63HZ",parameter:"GEQ63HZ",left:327,top:75},
		{type:"enabled",name:"geq_enabled_GEQ100HZ",parameter:"GEQ100HZ",left:431,top:75},
		{type:"enabled",name:"geq_enabled_GEQ160HZ",parameter:"GEQ160HZ",left:536,top:75},
		{type:"enabled",name:"geq_enabled_GEQ250HZ",parameter:"GEQ250HZ",left:642,top:75},
		{type:"enabled",name:"geq_enabled_GEQ400HZ",parameter:"GEQ400HZ",left:747,top:75},
		{type:"enabled",name:"geq_enabled_GEQ630HZ",parameter:"GEQ630HZ",left:852,top:75},
		{type:"enabled",name:"geq_enabled_GEQ1000HZ",parameter:"GEQ1000HZ",left:957,top:75},
		{type:"enabled",name:"geq_enabled_GEQ1600HZ",parameter:"GEQ1600HZ",left:1062,top:75},
		{type:"enabled",name:"geq_enabled_GEQ2500HZ",parameter:"GEQ2500HZ",left:1166,top:75},
		{type:"enabled",name:"geq_enabled_GEQ4000HZ",parameter:"GEQ4000HZ",left:1270,top:75},
		{type:"enabled",name:"geq_enabled_GEQ6300HZ",parameter:"GEQ6300HZ",left:1375,top:75},
		{type:"enabled",name:"geq_enabled_GEQ16000HZ",parameter:"GEQ10000HZ",left:1479,top:75},
		{type:"enabled",name:"geq_enabled_GEQ16000HZ",parameter:"GEQ16000HZ",left:1584,top:75},
		{type:"enabled",name:"geq_enabled_GEQ20000HZ",parameter:"GEQ20000HZ",left:1689,top:75},
	];
	
	var peq_data_array = [
		{type:"fader",name:"peq_fader_S1",parameter:"S1",indicator_left:92,indicator_top:622,text_left:42,text_top:566},
		{type:"fader",name:"peq_fader_S2",parameter:"S2",indicator_left:297,indicator_top:622,text_left:247,text_top:566},
		{type:"fader",name:"peq_fader_S3",parameter:"S3",indicator_left:503,indicator_top:622,text_left:452,text_top:566},
		{type:"fader",name:"peq_fader_S4",parameter:"S4",indicator_left:708,indicator_top:622,text_left:658,text_top:566},
		{type:"fader",name:"peq_fader_S5",parameter:"S5",indicator_left:913,indicator_top:622,text_left:863,text_top:566},
		{type:"fader",name:"peq_fader_S6",parameter:"S6",indicator_left:1118,indicator_top:622,text_left:1068,text_top:566},
		{type:"fader",name:"peq_fader_S7",parameter:"S7",indicator_left:1323,indicator_top:622,text_left:1273,text_top:566},
		
		{type:"enabled",name:"peq_enabled_S1",parameter:"S1",left:65,top:354},
		{type:"enabled",name:"peq_enabled_S2",parameter:"S2",left:270,top:354},
		{type:"enabled",name:"peq_enabled_S3",parameter:"S3",left:476,top:354},
		{type:"enabled",name:"peq_enabled_S4",parameter:"S4",left:682,top:354},
		{type:"enabled",name:"peq_enabled_S5",parameter:"S5",left:886,top:354},
		{type:"enabled",name:"peq_enabled_S6",parameter:"S6",left:1092,top:354},
		{type:"enabled",name:"peq_enabled_S7",parameter:"S7",left:1299,top:354},
		
		{type:"freq",name:"peq_freq_S1",parameter:"S1",indicator_left:50,indicator_top:497,text_left:0,text_top:440},
		{type:"freq",name:"peq_freq_S2",parameter:"S2",indicator_left:254,indicator_top:497,text_left:205,text_top:440},
		{type:"freq",name:"peq_freq_S3",parameter:"S3",indicator_left:460,indicator_top:497,text_left:411,text_top:440},
		{type:"freq",name:"peq_freq_S4",parameter:"S4",indicator_left:666,indicator_top:497,text_left:617,text_top:440},
		{type:"freq",name:"peq_freq_S5",parameter:"S5",indicator_left:871,indicator_top:497,text_left:824,text_top:440},
		{type:"freq",name:"peq_freq_S6",parameter:"S6",indicator_left:1079,indicator_top:497,text_left:1029,text_top:440},
		{type:"freq",name:"peq_freq_S7",parameter:"S7",indicator_left:1285,indicator_top:497,text_left:1234,text_top:440},
		
		{type:"q",name:"peq_q_S1",parameter:"S1",indicator_left:135,indicator_top:497,text_left:125,text_top:440},
		{type:"q",name:"peq_q_S2",parameter:"S2",indicator_left:339,indicator_top:497,text_left:330,text_top:440},
		{type:"q",name:"peq_q_S3",parameter:"S3",indicator_left:545,indicator_top:497,text_left:535,text_top:440},
		{type:"q",name:"peq_q_S4",parameter:"S4",indicator_left:751,indicator_top:497,text_left:742,text_top:440},
		{type:"q",name:"peq_q_S5",parameter:"S5",indicator_left:956,indicator_top:497,text_left:946,text_top:440},
		{type:"q",name:"peq_q_S6",parameter:"S6",indicator_left:1164,indicator_top:497,text_left:1152,text_top:440},
		{type:"q",name:"peq_q_S7",parameter:"S7",indicator_left:1370,indicator_top:497,text_left:1358,text_top:440},
	];
	var peq_data_array_5 = [
		{type:"fader",name:"peq_fader_S1",parameter:"S1",indicator_left:92,indicator_top:622,text_left:42,text_top:566},
		{type:"fader",name:"peq_fader_S2",parameter:"S2",indicator_left:297,indicator_top:622,text_left:247,text_top:566},
		{type:"fader",name:"peq_fader_S3",parameter:"S3",indicator_left:503,indicator_top:622,text_left:452,text_top:566},
		{type:"fader",name:"peq_fader_S4",parameter:"S4",indicator_left:708,indicator_top:622,text_left:658,text_top:566},
		{type:"fader",name:"peq_fader_S5",parameter:"S5",indicator_left:913,indicator_top:622,text_left:863,text_top:566},
		
		{type:"enabled",name:"peq_enabled_S1",parameter:"S1",left:65,top:354},
		{type:"enabled",name:"peq_enabled_S2",parameter:"S2",left:270,top:354},
		{type:"enabled",name:"peq_enabled_S3",parameter:"S3",left:476,top:354},
		{type:"enabled",name:"peq_enabled_S4",parameter:"S4",left:682,top:354},
		{type:"enabled",name:"peq_enabled_S5",parameter:"S5",left:886,top:354},
		
		{type:"freq",name:"peq_freq_S1",parameter:"S1",indicator_left:50,indicator_top:497,text_left:0,text_top:440},
		{type:"freq",name:"peq_freq_S2",parameter:"S2",indicator_left:254,indicator_top:497,text_left:205,text_top:440},
		{type:"freq",name:"peq_freq_S3",parameter:"S3",indicator_left:460,indicator_top:497,text_left:411,text_top:440},
		{type:"freq",name:"peq_freq_S4",parameter:"S4",indicator_left:666,indicator_top:497,text_left:617,text_top:440},
		{type:"freq",name:"peq_freq_S5",parameter:"S5",indicator_left:871,indicator_top:497,text_left:824,text_top:440},
		
		{type:"q",name:"peq_q_S1",parameter:"S1",indicator_left:135,indicator_top:497,text_left:125,text_top:440},
		{type:"q",name:"peq_q_S2",parameter:"S2",indicator_left:339,indicator_top:497,text_left:330,text_top:440},
		{type:"q",name:"peq_q_S3",parameter:"S3",indicator_left:545,indicator_top:497,text_left:535,text_top:440},
		{type:"q",name:"peq_q_S4",parameter:"S4",indicator_left:751,indicator_top:497,text_left:742,text_top:440},
		{type:"q",name:"peq_q_S5",parameter:"S5",indicator_left:956,indicator_top:497,text_left:946,text_top:440},
	];
	
	var compressor_data_array = [
		{type:"enabled",name:"compressor_Enabled",parameter:"Enabled",left:55,top:272},
		{type:"knob",name:"compressor_Threshold",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"compressor_Hold",parameter:"Hold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		{type:"knob",name:"compressor_Knee",parameter:"Knee",indicator_left:664,indicator_top:189,text_left:654,text_top:100},
		{type:"knob",name:"compressor_Attack",parameter:"Attack",indicator_left:232,indicator_top:411,text_left:221,text_top:322},
		{type:"knob",name:"compressor_Decay",parameter:"Decay",indicator_left:448,indicator_top:411,text_left:439,text_top:322},
		{type:"knob",name:"compressor_Ratio",parameter:"Ratio",indicator_left:664,indicator_top:411,text_left:654,text_top:322},
		];
	
	var limiter_data_array = [
		{type:"knob",name:"limiter_Threshold",parameter:"Threshold",indicator_left:120,indicator_top:189,text_left:111,text_top:100},
		{type:"knob",name:"limiter_Decay",parameter:"Decay",indicator_left:339,indicator_top:188,text_left:328,text_top:100},
		{type:"knob",name:"limiter_RMSTC",parameter:"RMSTC",indicator_left:239,indicator_top:415,text_left:227,text_top:326},
		];
	
	var noise_gate_data_array = [
		{type:"enabled",name:"noise_gate_Enabled",parameter:"Enabled",left:55,top:272},
		{type:"knob",name:"noise_gate_Threshold",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"noise_gate_Hold",parameter:"Hold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		{type:"knob",name:"noise_gate_Attack",parameter:"Attack",indicator_left:232,indicator_top:412,text_left:221,text_top:322},
		{type:"knob",name:"noise_gate_Decay",parameter:"Decay",indicator_left:448,indicator_top:412,text_left:439,text_top:322},
		];
	
	var rms_limiter_data_array = [
		{type:"enabled",name:"rms_limiter_Enabled",parameter:"Enabled",left:55,top:272},
		{type:"knob",name:"rms_limiter_Threshold",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"rms_limiter_Hold",parameter:"Hold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		{type:"knob",name:"rms_limiter_Attack",parameter:"Attack",indicator_left:232,indicator_top:412,text_left:221,text_top:322},
		{type:"knob",name:"rms_limiter_Decay",parameter:"Decay",indicator_left:448,indicator_top:412,text_left:439,text_top:322},
		];
	
	var peak_limiter_data_array = [
		{type:"enabled",name:"peak_limiter_Enabled",parameter:"Enabled",left:55,top:272},
		{type:"knob",name:"peak_limiter_Threshold",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"peak_limiter_Hold",parameter:"Hold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		{type:"knob",name:"peak_limiter_Attack",parameter:"Attack",indicator_left:232,indicator_top:412,text_left:221,text_top:322},
		{type:"knob",name:"peak_limiter_Decay",parameter:"Decay",indicator_left:448,indicator_top:412,text_left:439,text_top:322},
		];
	
	var signal_present_data_array = [
		{type:"knob",name:"signal_present_Threshold",parameter:"Threshold",indicator_left:120,indicator_top:189,text_left:110,text_top:100},
		{type:"knob",name:"signal_present_Trigger",parameter:"Trigger",indicator_left:339,indicator_top:188,text_left:329,text_top:100},
		];
	
	var ducker_data_array = [
		{type:"knob",name:"ducker_Threshold",parameter:"Threshold",indicator_left:120,indicator_top:189,text_left:111,text_top:100},
		{type:"knob",name:"ducker_Hold",parameter:"Hold",indicator_left:339,indicator_top:188,text_left:328,text_top:100},
		{type:"enabled",name:"ducker_MasterIn1",parameter:"MasterIn1",left:115,top:317},
		{type:"enabled",name:"ducker_MasterIn2",parameter:"MasterIn2",left:200,top:317},
		{type:"enabled",name:"ducker_MasterIn3",parameter:"MasterIn3",left:285,top:317},
		{type:"enabled",name:"ducker_MasterIn4",parameter:"MasterIn4",left:370,top:317},
		{type:"enabled",name:"ducker_DuckedIn1",parameter:"DuckedIn1",left:115,top:420},
		{type:"enabled",name:"ducker_DuckedIn2",parameter:"DuckedIn2",left:200,top:420},
		{type:"enabled",name:"ducker_DuckedIn3",parameter:"DuckedIn3",left:285,top:420},
		{type:"enabled",name:"ducker_DuckedIn4",parameter:"DuckedIn4",left:370,top:420},
		];
	
	var hplp_data_array = [
		{type:"enabled",type2:"hp",name:"Enabled_hp",parameter:"Enabled",left:55,top:170},
		{type:"enabled",type2:"lp",name:"Enabled_lp",parameter:"Enabled",left:55,top:407},
		{type:"knob",type2:"hp",name:"Frequency_hp",parameter:"Frequency",indicator_left:232,indicator_top:189,text_left:85,text_top:97},
		{type:"knob",type2:"hp",name:"Type_hp",parameter:"Type",indicator_left:448,indicator_top:189,text_left:300,text_top:97},
		{type:"knob",type2:"lp",name:"Frequency_lp",parameter:"Frequency",indicator_left:232,indicator_top:427,text_left:85,text_top:334},
		{type:"knob",type2:"lp",name:"Type_lp",parameter:"Type",indicator_left:448,indicator_top:427,text_left:300,text_top:334},
		];
	
	var standby_data_array = [
		{type:"enabled",name:"standby_Enabled",parameter:"Enabled",left:55,top:200},
		{type:"knob",name:"standby_Threshold_ab",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"standby_Threshold_cd",parameter:"Threshold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		];
	
	var mute_data_array = [
		{type:"enabled",name:"mute_Enabled",parameter:"Enabled",left:55,top:200},
		{type:"knob",name:"mute_Threshold_ab",parameter:"Threshold",indicator_left:232,indicator_top:189,text_left:221,text_top:100},
		{type:"knob",name:"mute_Threshold_cd",parameter:"Threshold",indicator_left:448,indicator_top:189,text_left:439,text_top:100},
		];
	
function save_settings_to_server(){
	
	$("#saveSettingsButton").removeClass("btn-success").addClass("btn-primary");
	
	var xmlhttp=new XMLHttpRequest();
    	xmlhttp.onreadystatechange=function() {
        	if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				// success 
				// console.log(xmlhttp.responseText);
				
				// send growl notification
				$.bootstrapGrowl("Settings sent to the server.", {
				  ele: 'body', // which element to append to
				  type: 'success', // (null, 'info', 'error', 'success')
				  offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
				  align: 'right', // ('left', 'right', or 'center')
				  width: 350, // (integer, or 'auto')
				  delay: 5000, // 5 seconds
				  allow_dismiss: true,
				  stackup_spacing: 10 // spacing between consecutively stacked growls.
				});  
        	}
		}
	 	xmlhttp.open("GET","scripts.php?s=save_settings_to_server",true);
   		xmlhttp.send();
}
	
// web socket
function init_socket() {
	var host = "wss://" + location.hostname + '/ws';
	
	try {
		socket = new WebSocket(host);
		//console.log('WebSocket - status ' + socket.readyState);
		socket.onopen    = function(msg) { 
			
			//console.log("Welcome - status "+this.readyState);
			
			get_dsp_view();
		};	
		
		socket.onmessage = function(msg) {
			//console.log(msg);
			var obj = JSON.parse(msg.data);
			var obj2;
			var json_type = document.getElementById('json_type').value;
			var IsDualChannel = document.getElementById('IsDualChannel').value;
			var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
			
			if(json_type=='Mixer'){
			   obj2 = obj.Mixer;
			}
			if(json_type=='ampg1_2c'){
			   obj2 = obj.ampg1_2c;
			}
			if(json_type=='ampg1_4c'){
			   obj2 = obj.ampg1_4c;
			}
			if(json_type=='s810v2'){
			   obj2 = obj.s810v2;
			}
			if(json_type=='nq-dsc01'){
			  	obj2 = obj['nq-dsc01'];
			}
			if(json_type=='nqga20'){
			   obj2 = obj.nqga20;
			}
			if(json_type=='nqpaxxx'){
			   obj2 = obj.nqpaxxx;
			}
			if(json_type=='ampg2_2c'){
			   obj2 = obj.ampg2_2c;
			}
			if(json_type=='ampg2_4c'){
			   obj2 = obj.ampg2_4c;
			}
			if(json_type=='edp01'){
			   obj2 = obj.edp01;
			}
			if(json_type=='nqga400p'){
			   obj2 = obj.nqga400p;
			}
			if(json_type=='nqga40'){
			   obj2 = obj.nqga40;
			}
			
			var router_view = document.getElementById('router_view').value;
			var channel = document.getElementById('channel').value;
			var left;
			
			// console.log(msg.data);
			// console.log(obj);
			for(var key1 in obj) {
				//console.log(key1);
			  for(var key2 in obj[key1]) {
				  // console.log(key2);  
				for(var key3 in obj[key1][key2]) { // start key2, key3
					// console.log(key1,key2,key3);
					if(key3=='Level' && ['main','compressor','limiter','noise_gate','peq','geq','ducker','hplp','signal_present','duplexer'].indexOf(router_view)>-1){
						if(router_view=='compressor'){
							left=841;
						}
						if(router_view=='limiter'){
							left=663;
							if((channel==5 && json_type=='Mixer') || (channel==7 && json_type=='nqpaxxx') || (channel==8 && json_type=='nqpaxxx')){
							   left=541;
							 }
						}
						if(router_view=='noise_gate'){
							left=763;
						}
						if(router_view=='peq'){
							left=1602;
						}
						if(router_view=='geq'){
							left=2013;
						}
						if(router_view=='ducker' && json_type=='Mixer'){
							left=541;
						}
						if(router_view=='hplp'){
							left=763;
						}
						if(router_view=='signal_present'){
							if(channel==5){
							   left=541;
							} else {
								left=-50; // don't show
							}
						}	
						// Mixer
						if(json_type=='Mixer'){
						    if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left); 
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='In3'){
								if(router_view=='main'){
								  left=604;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==3)){
									var lvl3 = obj2.In3.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
							if(key2=='In4'){
								if(router_view=='main'){
								  left=814;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==4)){
									var lvl4 = obj2.In4.Level;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect(4,top4,left);
									set_yellow_led_rect(4,top4,left);
									set_green_led_rect(4,top4,left);
									document.getElementById('level4').value = lvl4;
								}
							}
							if(key2=='In5'){
								if(router_view=='main'){
								  left=1024;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==6)){
									var lvl6 = obj2.In5.Level;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect(6,top6,left);
									set_yellow_led_rect(6,top6,left);
									set_green_led_rect(6,top6,left);
									document.getElementById('level6').value = lvl6;
								}
							}
							if(key2=='Out5'){
								if(router_view=='main'){
								  left=1164;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==5)){
									var lvl5 = obj2.Out5.Level;
									var top5 = get_led_top_from_volume(lvl5);
									set_red_led_rect(5,top5,left);
									set_yellow_led_rect(5,top5,left);
									set_green_led_rect(5,top5,left);
									document.getElementById('level5').value = lvl5;
								}
							}
						}
					  
						// ampg1_2c
						if(json_type=='ampg1_2c'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(IsDualChannel==0){
								   	left = -300; // don't show
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='In5'){
								if(router_view=='main'){
								  	left=604;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
								}
								
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==3)){
									var lvl3 = obj2.In5.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
						}
						// ampg1_4c
						if(json_type=='ampg1_4c'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(IsDualChannel==0){
								   	left = -300; // don't show
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='In3'){
								if(router_view=='main'){
								  	left=604;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==3)){
									var lvl3 = obj2.In3.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
							if(key2=='In4'){
								if(router_view=='main'){
								  	left=814;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
									if(IsDualChannel2==0){
								   		left = -300; // don't show
									}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==4)){
									var lvl4 = obj2.In4.Level;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect(4,top4,left);
									set_yellow_led_rect(4,top4,left);
									set_green_led_rect(4,top4,left);
									document.getElementById('level4').value = lvl4;
								}
							}
							if(key2=='In5'){
								if(router_view=='main'){
								  	left=1024;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
									if(IsDualChannel2==0){
								   		left = left-210;
									}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==5)){
									var lvl5 = obj2.In5.Level;
									var top5 = get_led_top_from_volume(lvl5);
									set_red_led_rect(5,top5,left);
									set_yellow_led_rect(5,top5,left);
									set_green_led_rect(5,top5,left);
									document.getElementById('level5').value = lvl5;
								}
							}
							if(key2=='In6'){
								if(router_view=='main'){
								  	left=1234;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
									if(IsDualChannel2==0){
								   		left = left-210;
									}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==6)){
									var lvl6 = obj2.In6.Level;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect(6,top6,left);
									set_yellow_led_rect(6,top6,left);
									set_green_led_rect(6,top6,left);
									document.getElementById('level6').value = lvl6;
								}
							}
						}
						
						// VoIP Gen2
						if(json_type=='s810v2'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
								if(router_view=='duplexer'){
								  left=763;
								}
							   if(router_view=='main' || router_view=='duplexer'){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
						}
						
						// DSC01
						if(json_type=='nq-dsc01'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
								if(router_view=='duplexer'){
								  left=763;
								}
							   if(router_view=='main' || router_view=='duplexer'){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='Ch1'){
							   if(router_view=='main'){
								  left=394;
								}
							   if(router_view=='main'){
									var lvl2 = obj2.Ch1.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
								    document.getElementById('level2').value = lvl2;
								}
							}
						}
						
						// EDP01
						if(json_type=='edp01'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
								if(router_view=='duplexer'){
								  left=763;
								}
							   if(router_view=='main' || router_view=='duplexer'){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
						}
						
						// nqga20
						if(json_type=='nqga20'){
							if(key2=='Ch1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || router_view!='main' && router_view!='compressor'){
									var lvl1 = obj2.Ch1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
						}
						// nqpaxxx
						if(json_type=='nqpaxxx'){
						    if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left); 
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='In3'){
								if(router_view=='main'){
								  left=604;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==3)){
									var lvl3 = obj2.In3.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
							if(key2=='In4'){
								if(router_view=='main'){
								  left=814;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==4)){
									var lvl4 = obj2.In4.Level;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect(4,top4,left);
									set_yellow_led_rect(4,top4,left);
									set_green_led_rect(4,top4,left);
									document.getElementById('level4').value = lvl4;
								}
							}
							if(key2=='In5'){
								if(router_view=='main'){
								  left=1024;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==5)){
									var lvl5 = obj2.In5.Level;
									var top5 = get_led_top_from_volume(lvl5);
									set_red_led_rect(5,top5,left);
									set_yellow_led_rect(5,top5,left);
									set_green_led_rect(5,top5,left);
									document.getElementById('level5').value = lvl5;
								}
							}
							if(key2=='In6'){
								if(router_view=='main'){
								  left=1234;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && router_view!='ducker' && channel==6)){
									var lvl6 = obj2.In6.Level;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect(6,top6,left);
									set_yellow_led_rect(6,top6,left);
									set_green_led_rect(6,top6,left);
									document.getElementById('level6').value = lvl6;
								}
							}
							if(key2=='Out5'){
								if(router_view=='main'){
								  left=1374;
								}
								if(router_view=='ducker'){
								  left=541;
								}
								if(router_view=='limiter'){
								  left=541;
								}
								if(router_view=='signal_present'){
								  left=541;
								}
								if(router_view=='main' || router_view=='ducker' || (router_view=='signal_present' && channel==7) || (router_view=='limiter' && channel==7)){
									var lvl7 = obj2.Out5.Level;
									var top7 = get_led_top_from_volume(lvl7);
									set_red_led_rect(7,top7,left);
									set_yellow_led_rect(7,top7,left);
									set_green_led_rect(7,top7,left);
									document.getElementById('level7').value = lvl7;
								}
							}
							if(key2=='Out6'){
								if(router_view=='main'){
								  left=1524;
								}
								if(router_view=='ducker'){
								  left=663;
								}
								if(router_view=='limiter'){
								  left=541;
								}
								if(router_view=='signal_present'){
								  left=541;
								}
								if(router_view=='main' || router_view=='ducker' || (router_view=='signal_present' && channel==8) || (router_view=='limiter' && channel==8)){
									var lvl8 = obj2.Out6.Level;
									var top8 = get_led_top_from_volume(lvl8);
									set_red_led_rect(8,top8,left);
									set_yellow_led_rect(8,top8,left);
									set_green_led_rect(8,top8,left);
									document.getElementById('level8').value = lvl8;
								}
							}
						}
						// ampg2_2c
						if(json_type=='ampg2_2c'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(IsDualChannel==0){
								   	left = -300; // don't show
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
						}
						// ampg2_4c
						if(json_type=='ampg2_4c'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(IsDualChannel==0){
								   	left = -300; // don't show
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='In3'){
								if(router_view=='main'){
								  	left=604;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==3)){
									var lvl3 = obj2.In3.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
							if(key2=='In4'){
								if(router_view=='main'){
								  	left=814;
									if(IsDualChannel==0){
								   		left = left-210;
								 	}
									if(IsDualChannel2==0){
								   		left = -300; // don't show
									}
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==4)){
									var lvl4 = obj2.In4.Level;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect(4,top4,left);
									set_yellow_led_rect(4,top4,left);
									set_green_led_rect(4,top4,left);
									document.getElementById('level4').value = lvl4;
								}
							}
						}
						// nqga400p
						if(json_type=='nqga400p'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='In2'){
								if(router_view=='main'){
								  left=394;
								}
								if(router_view=='main' || (router_view!='main' && channel==2)){
									var lvl2 = obj2.In2.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
							if(key2=='Out1'){
								if(router_view=='main'){
								  	left=604;
								}
								if(router_view=='main' || (router_view!='main' && channel==3)){
									var lvl3 = obj2.Out1.Level;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect(3,top3,left);
									set_yellow_led_rect(3,top3,left);
									set_green_led_rect(3,top3,left);
									document.getElementById('level3').value = lvl3;
								}
							}
							if(key2=='Out2'){
								if(router_view=='main'){
								  	left=814;
								}
								if(router_view=='main' || (router_view!='main' && channel==4)){
									var lvl4 = obj2.Out2.Level;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect(4,top4,left);
									set_yellow_led_rect(4,top4,left);
									set_green_led_rect(4,top4,left);
									document.getElementById('level4').value = lvl4;
								}
							}
						}
						// nqga40
						if(json_type=='nqga40'){
							if(key2=='In1'){
							   if(router_view=='main'){
								  left=184;
								}
							   if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==1)){
									var lvl1 = obj2.In1.Level;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect(1,top1,left);
									set_yellow_led_rect(1,top1,left);
									set_green_led_rect(1,top1,left);
								    document.getElementById('level1').value = lvl1;
								}
							}
							if(key2=='Ch1'){
								if(router_view=='main'){
								  left=394;
								}
								if(router_view=='main' || (router_view!='main' && router_view!='compressor' && channel==2)){
									var lvl2 = obj2.Ch1.Level;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect(2,top2,left);
									set_yellow_led_rect(2,top2,left);
									set_green_led_rect(2,top2,left);
									document.getElementById('level2').value = lvl2;
								}
							}
						}
					 }
					if(key3=='Clip' && ['main','compressor','limiter','noise_gate','peq','geq','signal_present','ducker','hplp','delay','phase_invert'].indexOf(router_view)>-1){
						
						// Mixer
						if(json_type=='Mixer'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        }
									}
									
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(2,81,260);
									 }
									if(channel==2){
									  	if(router_view=='noise_gate'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
							if(key2=='In3'){
								var clip3 = obj2.In3.Clip;
								if(clip3){
									document.getElementById('Clip3_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(3,81,470);
									 }
									if(channel==3){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(3,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(3,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(3,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip3'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip3_enabled').value = 0;
								}
							}
							if(key2=='In4'){
								var clip4 = obj2.In4.Clip;
								if(clip4){
									document.getElementById('Clip4_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(4,81,680);
									 }
									if(channel==4){
									 	if(router_view=='noise_gate'){
                                            set_clip_led_rect(4,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(4,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(4,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(4,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(4,81,641);
                                        }  
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip4'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip4_enabled').value = 0;
								}
							}
							if(key2=='In5'){
								var clip6 = obj2.In5.Clip;
								if(clip6){
									document.getElementById('Clip6_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(6,81,890);
									 }
									if(channel==6){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(6,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(6,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(6,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(6,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(6,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip6'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip6_enabled').value = 0;
								}
							}
							if(key2=='Out5'){
								var clip5 = obj2.Out5.Clip;
								if(clip5){
									document.getElementById('Clip5_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(5,81,1164);
									 }
									if(channel==5){
									   	if(router_view=='signal_present'){
                                            set_clip_led_rect(5,81,541);
                                        }
                                        if(router_view=='ducker'){
                                           set_clip_led_rect(5,81,541);
                                         }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip5'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip5_enabled').value = 0;
								}
							}
						}
						// ampg1_2c
						if(json_type=='ampg1_2c'){

							if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
										if(IsDualChannel==0){
								   			// don't show
										} else {
											set_clip_led_rect(2,81,260);
										}
									 }
									if(channel==2){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
							if(key2=='In5'){	
								var clip3 = obj2.In5.Clip;
								if(clip3){
									document.getElementById('Clip3_enabled').value = 1;
									if(router_view=='main'){
										if(IsDualChannel==0){
										   set_clip_led_rect(3,81,260);
										} else {
											set_clip_led_rect(3,81,470);
										}
									 }
									if(channel==3){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(3,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(3,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(3,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip3'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip3_enabled').value = 0;
								}
							}
						}
						// ampg1_4c
						if(json_type=='ampg1_4c'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
									  	if(router_view=='noise_gate'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        } 
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
										if(IsDualChannel==0){
								   			// don't show
										} else {
											set_clip_led_rect(2,81,260);
										}
									 }
									if(channel==2){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
							if(key2=='In3'){
								var clip3 = obj2.In3.Clip;
								if(clip3){
									document.getElementById('Clip3_enabled').value = 1;
									if(router_view=='main'){
										var left= 470;
										if(IsDualChannel==0){
											left=left-210;
										}
									   set_clip_led_rect(3,81,left);
									 }
									if(channel==3){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(3,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(3,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(3,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip3'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip3_enabled').value = 0;
								}
							}
							if(key2=='In4'){
								var clip4 = obj2.In4.Clip;
								if(clip4){
									document.getElementById('Clip4_enabled').value = 1;
									if(router_view=='main'){
										var left= 680;
										if(IsDualChannel==0){
											left=left-210;
										}
										if(IsDualChannel2==0){
											// don't show
										} else {
											set_clip_led_rect(4,81,left);
										}
									 }
									if(channel==4){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(4,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(4,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(4,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(4,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(4,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip4'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip4_enabled').value = 0;
								}
							}
							if(key2=='In5'){
								var clip5 = obj2.In5.Clip;
								if(clip5){
									document.getElementById('Clip5_enabled').value = 1;
									if(router_view=='main'){
										var left= 890;
										if(IsDualChannel==0){
											left=left-210;
										}
										if(IsDualChannel2==0){
											left=left-210;
										}
									   set_clip_led_rect(5,81,left);
									 }
									if(channel==5){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(5,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(5,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(5,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(5,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(5,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip5'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip5_enabled').value = 0;
								}
							}
							if(key2=='In6'){
								var clip6 = obj2.In6.Clip;
								if(clip6){
									document.getElementById('Clip6_enabled').value = 1;
									if(router_view=='main'){
										var left= 1100;
										if(IsDualChannel==0){
											left=left-210;
										}
										if(IsDualChannel2==0){
											left=left-210;
										}
									   set_clip_led_rect(6,81,left);
									 }
									if(channel==6){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(6,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(6,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(6,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(6,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(6,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip6'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip6_enabled').value = 0;
								}
							}
						}
						
						// nqga20
						if(json_type=='nqga20'){
						   if(key2=='Ch1'){
								var clip1 = obj2.Ch1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(router_view=='peq'){
										set_clip_led_rect(1,81,1479);
									}
									if(router_view=='signal_present'){
										set_clip_led_rect(1,81,541);
									}
									if(router_view=='hplp'){
										set_clip_led_rect(1,81,641);
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
						}
						
						// nqga40
						if(json_type=='nqga40'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(router_view=='signal_present'){
										set_clip_led_rect(1,81,541);
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='Ch1'){
								var clip2 = obj2.Ch1.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(2,81,260);
									 }
									if(router_view=='peq'){
										set_clip_led_rect(2,81,1479);
									}
									if(router_view=='signal_present'){
										set_clip_led_rect(2,81,541);
									}
									if(router_view=='hplp'){
										set_clip_led_rect(2,81,641);
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
						}
						// nqpaxxx
						if(json_type=='nqpaxxx'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        }
									}
								} else {
                                    canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(2,81,260);
									 }
									if(channel==2){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
							if(key2=='In3'){
								var clip3 = obj2.In3.Clip;
								if(clip3){
									document.getElementById('Clip3_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(3,81,470);
									 }
									if(channel==3){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(3,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(3,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(3,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip3'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip3_enabled').value = 0;
								}
							}
							if(key2=='In4'){
								var clip4 = obj2.In4.Clip;
								if(clip4){
									document.getElementById('Clip4_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(4,81,680);
									 }
									if(channel==4){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(4,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(4,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(4,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(4,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(4,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip4'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip4_enabled').value = 0;
								}
							}
							if(key2=='In5'){
								var clip6 = obj2.In5.Clip;
								if(clip6){
									document.getElementById('Clip5_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(5,81,890);
									 }
									if(channel==5){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(5,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(5,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(5,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(5,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(5,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip5'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip5_enabled').value = 0;
								}
							}
							if(key2=='In6'){
								var clip6 = obj2.In6.Clip;
								if(clip6){
									document.getElementById('Clip6_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(6,81,1100);
									 }
									if(channel==6){
										if(router_view=='noise_gate'){
                                            set_clip_led_rect(6,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(6,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(6,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(6,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(6,81,641);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip6'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip6_enabled').value = 0;
								}
							}
							if(key2=='Out5'){
								var clip7 = obj2.Out5.Clip;
								if(clip7){
									document.getElementById('Clip7_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(7,81,1374);
									}
									if(channel==7){
										if(router_view=='signal_present'){
                                            set_clip_led_rect(7,81,541);
                                        }
                                        if(router_view=='ducker'){
                                           set_clip_led_rect(7,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip7'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip7_enabled').value = 0;
								}
							}
							if(key2=='Out6'){
								var clip8 = obj2.Out6.Clip;
								if(clip8){
									document.getElementById('Clip8_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(8,81,1524);
									}
									if(channel==8){
										if(router_view=='signal_present'){
                                            set_clip_led_rect(8,81,541);
                                        }
                                        if(router_view=='ducker'){
                                           set_clip_led_rect(8,81,663);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip8'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip8_enabled').value = 0;
								}
							}
						}
						// ampg2_2c
						if(json_type=='ampg2_2c'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
									   if(router_view=='noise_gate'){
											set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(1,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
										if(IsDualChannel==0){
								   			// don't show
										} else {
											set_clip_led_rect(2,81,260);
										}
									 }
									if(channel==2){
										if(router_view=='noise_gate'){
											set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(2,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
						}
						// ampg2_4c
						if(json_type=='ampg2_4c'){
						   if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
									   set_clip_led_rect(1,81,50);
									 }
									if(channel==1){
									    if(router_view=='noise_gate'){
											set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(1,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(1,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(1,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(1,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(1,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
							if(key2=='In2'){
								var clip2 = obj2.In2.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
										if(IsDualChannel==0){
								   			// don't show
										} else {
											set_clip_led_rect(2,81,260);
										}
									 }
									if(channel==2){
									    if(router_view=='noise_gate'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(2,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(2,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(2,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(2,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(2,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
							if(key2=='In3'){
								var clip3 = obj2.In3.Clip;
								if(clip3){
									document.getElementById('Clip3_enabled').value = 1;
									if(router_view=='main'){
										var left= 470;
										if(IsDualChannel==0){
											left=left-210;
										}
									   set_clip_led_rect(3,81,left);
									 }
									if(channel==3){
									    if(router_view=='noise_gate'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(3,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(3,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(3,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(3,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(3,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip3'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip3_enabled').value = 0;
								}
							}
							if(key2=='In4'){
								var clip4 = obj2.In4.Clip;
								if(clip4){
									document.getElementById('Clip4_enabled').value = 1;
									if(router_view=='main'){
										var left= 680;
										if(IsDualChannel==0){
											left=left-210;
										}
										if(IsDualChannel2==0){
											// don't show
										} else {
											set_clip_led_rect(4,81,left);
										}
									 }
									if(channel==4){
									   	if(router_view=='noise_gate'){
                                            set_clip_led_rect(4,81,641);
                                        }
                                        if(router_view=='peq'){
                                            set_clip_led_rect(4,81,1479);
                                        }
                                        if(router_view=='geq'){
                                            set_clip_led_rect(4,81,1891);
                                        }
                                        if(router_view=='signal_present'){
                                            set_clip_led_rect(4,81,541);
                                        }
                                        if(router_view=='hplp'){
                                            set_clip_led_rect(4,81,641);
                                        }
                                        if(router_view=='delay'){
                                            set_clip_led_rect(4,81,541);
                                        }
                                        if(router_view=='phase_invert'){
                                            set_clip_led_rect(4,81,541);
                                        }
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip4'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip4_enabled').value = 0;
								}
							}
						}
						// nqga40
						if(json_type=='nqga40'){
							if(key2=='In1'){
								var clip1 = obj2.In1.Clip;
								if(clip1){
									document.getElementById('Clip1_enabled').value = 1;
									if(router_view=='main'){
										set_clip_led_rect(1,81,50);
									 }
									if(router_view=='signal_present'){
                                        set_clip_led_rect(1,81,541);
                                     }
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip1'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip1_enabled').value = 0;
								}
							}
						   if(key2=='Ch1'){
								var clip2 = obj2.Ch1.Clip;
								if(clip2){
									document.getElementById('Clip2_enabled').value = 1;
									if(router_view=='main'){
										set_clip_led_rect(2,81,260);
									 }
									if(router_view=='peq'){
                                    	 set_clip_led_rect(2,81,1479);
                                     }
									if(router_view=='signal_present'){
                                    	 set_clip_led_rect(2,81,541);
                                    }
									if(router_view=='hplp'){
									 	 set_clip_led_rect(2,81,641);
									}
								} else {
									 canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'clip2'){
                                            canvas.remove(object);
                                          }
                                    });
									document.getElementById('Clip2_enabled').value = 0;
								}
							}
						}
					}
					for(var key4 in obj[key1][key2][key3]){
						// console.log(key3,key4);
						
						if(key3=='Signal' && (key4=='Detected' || key4=='IsNetwork') && (['main','compressor','limiter','noise_gate','peq','geq','signal_present','ducker','hplp','delay','phase_invert'].indexOf(router_view)>-1)){
							
							// Mixer
							if(json_type=='Mixer'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
									if(signal1){
										if(router_view=='main'){
											set_signal_led_rect(1,66,50);
										}
										if(channel==1){
										   	if(router_view=='limiter'){
                                               set_signal_led_rect(1,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(1,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(1,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(1,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(1,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(1,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present1').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal1'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present1').value = 0;
									 }
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
									if(signal2){
										if(router_view=='main'){
											set_signal_led_rect(2,66,260);
										}
										if(channel==2){
										   	if(router_view=='limiter'){
                                               set_signal_led_rect(2,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(2,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(2,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(2,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(2,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(2,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present2').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal2'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present2').value = 0;
									 }
								}
								if(key2=='In3'){
									var signal3 = obj2.In3.Signal.Detected;
									if(signal3){
										if(router_view=='main'){
											set_signal_led_rect(3,66,470);
										}
										if(channel==3){
										   	if(router_view=='limiter'){
                                               set_signal_led_rect(3,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(3,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(3,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(3,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(3,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(3,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present3').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal3'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present3').value = 0;
									 }
								}
								if(key2=='In4'){
									var signal4 = obj2.In4.Signal.Detected;
									if(signal4){
										if(router_view=='main'){
											set_signal_led_rect(4,66,680);
										}
										if(channel==4){
										   	if(router_view=='limiter'){
                                               set_signal_led_rect(4,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(4,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(4,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(4,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(4,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(4,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present4').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal4'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present4').value = 0;
									 }
								}
								if(key2=='In5'){
									var signal6 = obj2.In5.Signal.Detected;
									if(signal6){
										if(router_view=='main'){
											set_signal_led_rect(6,66,890);
										}
										if(channel==6){
										   	if(router_view=='limiter'){
                                               set_signal_led_rect(6,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(6,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(6,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(6,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(6,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(6,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present6').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal6'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present6').value = 0;
									 }
								}
								if(key2=='Out5'){
									var signal5 = obj2.Out5.Signal.Detected;
									if(signal5){
										if(router_view=='main'){
											set_signal_led_rect(5,66,1164);
										}
										if(channel==5){
										   	if(router_view=='ducker'){
                                                set_signal_led_rect(5,66,540);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(5,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present5').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal5'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present5').value = 0;
									 }
								}
							}
							// ampg1_2c
							if(json_type=='ampg1_2c'){
								if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
								    var IsNetwork1 = obj2.In1.Signal.IsNetwork;
								      
								   if(router_view=='main'){
										
									    if(signal1==true){
										   document.getElementById('Signal_signal_present1').value = 1;
										}
									    if(signal1==false){
										   document.getElementById('Signal_signal_present1').value = 0;
										}
									    if(IsNetwork1==true){
										   document.getElementById('Signal_IsNetwork1').value = 1;
										}
									    if(IsNetwork1==false){
										   document.getElementById('Signal_IsNetwork1').value = 0;
										}
									   
									   var Signal_signal_present1 = document.getElementById('Signal_signal_present1').value;
									   var Signal_IsNetwork1 = document.getElementById('Signal_IsNetwork1').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present1=='1' && Signal_IsNetwork1=='1'){
                                           led_top = 66;
											var IsNetwork1 = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork1'){
                                                    IsNetwork1 = 1;
                                                }
                                            });
											if(IsNetwork1==0){
												 set_IsNetwork_led_rect(1,led_top,184);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present1=='1' && Signal_IsNetwork1=='0'){
                                           led_top = 81;
											var signal1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    signal1_found = 1;
                                                }
                                            });
											if(signal1_found==0){
												 set_signal_led_rect(1,led_top,184);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal1){
                                            if(channel==1){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(1,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(1,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(1,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present1').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present1').value = 0;
                                         }
									}
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
								    var IsNetwork2 = obj2.In2.Signal.IsNetwork;
								    var Signal_signal_present2_old = document.getElementById('Signal_signal_present2').value;
								    var Signal_IsNetwork2_old = document.getElementById('Signal_IsNetwork2').value;
								      
								   if(router_view=='main'){
										
									    if(signal2==true){
										   document.getElementById('Signal_signal_present2').value = 1;
										}
									    if(signal2==false){
										   document.getElementById('Signal_signal_present2').value = 0;
										}
									    if(IsNetwork2==true){
										   document.getElementById('Signal_IsNetwork2').value = 1;
										}
									    if(IsNetwork2==false){
										   document.getElementById('Signal_IsNetwork2').value = 0;
										}
									   
									   var Signal_signal_present2 = document.getElementById('Signal_signal_present2').value;
									   var Signal_IsNetwork2 = document.getElementById('Signal_IsNetwork2').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present2=='1' && Signal_IsNetwork2=='1'){
                                           led_top = 66;
											var IsNetwork2 = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork2'){
                                                    IsNetwork2 = 1;
                                                }
                                            });
											if(IsNetwork2==0 && IsDualChannel==1){
												 set_IsNetwork_led_rect(2,led_top,394);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present2=='1' && Signal_IsNetwork2=='0'){
                                           led_top = 81;
											var signal2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    signal2_found = 1;
                                                }
                                            });
											if(signal2_found==0 && IsDualChannel==1){
												 set_signal_led_rect(2,led_top,394);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal2){
                                            if(channel==2){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(2,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(2,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(2,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present2').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present2').value = 0;
                                         }
									}
								}
							}
							// ampg1_4c
							if(json_type=='ampg1_4c'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
								    var IsNetwork1 = obj2.In1.Signal.IsNetwork;
								      
								   if(router_view=='main'){
										
									    if(signal1==true){
										   document.getElementById('Signal_signal_present1').value = 1;
										}
									    if(signal1==false){
										   document.getElementById('Signal_signal_present1').value = 0;
										}
									    if(IsNetwork1==true){
										   document.getElementById('Signal_IsNetwork1').value = 1;
										}
									    if(IsNetwork1==false){
										   document.getElementById('Signal_IsNetwork1').value = 0;
										}
									   
									   var Signal_signal_present1 = document.getElementById('Signal_signal_present1').value;
									   var Signal_IsNetwork1 = document.getElementById('Signal_IsNetwork1').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present1=='1' && Signal_IsNetwork1=='1'){
                                           led_top = 66;
											var IsNetwork1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork1'){
                                                    IsNetwork1_found = 1;
                                                }
                                            });
											if(IsNetwork1_found==0){
												 set_IsNetwork_led_rect(1,led_top,184);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present1=='1' && Signal_IsNetwork1=='0'){
                                           led_top = 81;
											var signal1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    signal1_found = 1;
                                                }
                                            });
											if(signal1_found==0){
												 set_signal_led_rect(1,led_top,184);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal1){
                                            if(channel==1){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(1,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(1,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(1,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present1').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present1').value = 0;
                                         }
									}
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
								    var IsNetwork2 = obj2.In2.Signal.IsNetwork;
								    var Signal_signal_present2_old = document.getElementById('Signal_signal_present2').value;
								    var Signal_IsNetwork2_old = document.getElementById('Signal_IsNetwork2').value;
								      
								   if(router_view=='main'){
										
									    if(signal2==true){
										   document.getElementById('Signal_signal_present2').value = 1;
										}
									    if(signal2==false){
										   document.getElementById('Signal_signal_present2').value = 0;
										}
									    if(IsNetwork2==true){
										   document.getElementById('Signal_IsNetwork2').value = 1;
										}
									    if(IsNetwork2==false){
										   document.getElementById('Signal_IsNetwork2').value = 0;
										}
									   
									   var Signal_signal_present2 = document.getElementById('Signal_signal_present2').value;
									   var Signal_IsNetwork2 = document.getElementById('Signal_IsNetwork2').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present2=='1' && Signal_IsNetwork2=='1'){
                                           led_top = 66;
											var IsNetwork2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork2'){
                                                    IsNetwork2_found = 1;
                                                }
                                            });
											if(IsNetwork2_found==0 && IsDualChannel==1){
												 set_IsNetwork_led_rect(2,led_top,394);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present2=='1' && Signal_IsNetwork2=='0'){
                                           led_top = 81;
											var signal2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    signal2_found = 1;
                                                }
                                            });
											if(signal2_found==0 && IsDualChannel==1){
												 set_signal_led_rect(2,led_top,394);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal2){
                                            if(channel==2){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(2,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(2,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(2,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present2').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present2').value = 0;
                                         }
									}
								}
								if(key2=='In3'){
									var signal3 = obj2.In3.Signal.Detected;
								    var IsNetwork3 = obj2.In3.Signal.IsNetwork;
								    var Signal_signal_present3_old = document.getElementById('Signal_signal_present3').value;
								    var Signal_IsNetwork3_old = document.getElementById('Signal_IsNetwork3').value;
								      
								   if(router_view=='main'){
										
									    if(signal3==true){
										   document.getElementById('Signal_signal_present3').value = 1;
										}
									    if(signal3==false){
										   document.getElementById('Signal_signal_present3').value = 0;
										}
									    if(IsNetwork3==true){
										   document.getElementById('Signal_IsNetwork3').value = 1;
										}
									    if(IsNetwork3==false){
										   document.getElementById('Signal_IsNetwork3').value = 0;
										}
									   
									   var Signal_signal_present3 = document.getElementById('Signal_signal_present3').value;
									   var Signal_IsNetwork3 = document.getElementById('Signal_IsNetwork3').value;
									      	   
                                        var led_top;
									    var  led_left = 604;
                                        if(IsDualChannel==0){
                                            led_left = led_left-210;
                                        }
									    if(Signal_signal_present3=='1' && Signal_IsNetwork3=='1'){
                                           led_top = 66;
											var IsNetwork3_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork3'){
                                                    IsNetwork3_found = 1;
                                                }
                                            });
											if(IsNetwork3_found==0){
												 set_IsNetwork_led_rect(3,led_top,led_left); 
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present3=='1' && Signal_IsNetwork3=='0'){
                                           led_top = 81;
											var signal3_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    signal3_found = 1;
                                                }
                                            });
											if(signal3_found==0){
												 set_signal_led_rect(3,led_top,led_left);  
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present3=='0' || Signal_IsNetwork3=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present3=='0' || Signal_IsNetwork3=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal3){
                                            if(channel==3){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(3,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(3,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(3,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(3,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(3,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(3,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present3').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present3').value = 0;
                                         }
									}
								}
								if(key2=='In4'){
									var signal4 = obj2.In4.Signal.Detected;
								    var IsNetwork4 = obj2.In4.Signal.IsNetwork;
								    var Signal_signal_present4_old = document.getElementById('Signal_signal_present4').value;
								    var Signal_IsNetwork4_old = document.getElementById('Signal_IsNetwork4').value;
								      
								   if(router_view=='main'){
										
									    if(signal4==true){
										   document.getElementById('Signal_signal_present4').value = 1;
										}
									    if(signal4==false){
										   document.getElementById('Signal_signal_present4').value = 0;
										}
									    if(IsNetwork4==true){
										   document.getElementById('Signal_IsNetwork4').value = 1;
										}
									    if(IsNetwork4==false){
										   document.getElementById('Signal_IsNetwork4').value = 0;
										}
									   
									   var Signal_signal_present4 = document.getElementById('Signal_signal_present4').value;
									   var Signal_IsNetwork4 = document.getElementById('Signal_IsNetwork4').value;
									      	   
                                        var led_top;
									    var led_left = 814;
                                        if(IsDualChannel==0){
                                          	led_left = led_left-210;
                                         }
									   if(Signal_signal_present4=='1' && Signal_IsNetwork4=='1'){
                                           led_top = 66;
											var IsNetwork4_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork4'){
                                                    IsNetwork4_found = 1;
                                                }
                                            });
											if(IsNetwork4_found==0 && IsDualChannel2==1){
												 set_IsNetwork_led_rect(4,led_top,led_left); 
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present4=='1' && Signal_IsNetwork4=='0'){
                                           led_top = 81;
											var signal4_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    signal4_found = 1;
                                                }
                                            });
											if(signal4_found==0 && IsDualChannel2==1){
												 set_signal_led_rect(4,led_top,led_left);
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present4=='0' || Signal_IsNetwork4=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present4=='0' || Signal_IsNetwork4=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal4){
                                            if(channel==4){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(4,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(4,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(4,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(4,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(4,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(4,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present4').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present4').value = 0;
                                         }
									}
								}
							}
							
							// nqga20
							if(json_type=='nqga20'){
							   if(key2=='Ch1'){
									var signal1 = obj2.Ch1.Signal.Detected;
									if(signal1){
										if(router_view=='main'){
											set_signal_led_rect(1,66,50);
										}
										if(router_view=='limiter'){
										   set_signal_led_rect(1,66,541);
										 }
										if(router_view=='peq'){
											set_signal_led_rect(1,66,1479);
										}
										if(router_view=='signal_present'){
											set_signal_led_rect(1,66,541);
										}
										if(router_view=='hplp'){
											set_signal_led_rect(1,66,641);
										}
										document.getElementById('Signal_signal_present1').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal1'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present1').value = 0;
									 }
								}
							}
							// nqpaxxx
							if(json_type=='nqpaxxx'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
									if(signal1){
										if(router_view=='main'){
											set_signal_led_rect(1,66,50);
										}
										if(channel==1){
										   if(router_view=='limiter'){
                                               set_signal_led_rect(1,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(1,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(1,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(1,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(1,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(1,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present1').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal1'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present1').value = 0;
									 }
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
									if(signal2){
										if(router_view=='main'){
											set_signal_led_rect(2,66,260);
										}
										if(channel==2){
											if(router_view=='limiter'){
                                               set_signal_led_rect(2,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(2,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(2,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(2,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(2,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(2,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present2').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal2'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present2').value = 0;
									 }
								}
								if(key2=='In3'){
									var signal3 = obj2.In3.Signal.Detected;
									if(signal3){
										if(router_view=='main'){
											set_signal_led_rect(3,66,470);
										}
										if(channel==3){
											if(router_view=='limiter'){
                                               set_signal_led_rect(3,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(3,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(3,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(3,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(3,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(3,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present3').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal3'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present3').value = 0;
									 }
								}
								if(key2=='In4'){
									var signal4 = obj2.In4.Signal.Detected;
									if(signal4){
										if(router_view=='main'){
											set_signal_led_rect(4,66,680);
										}
										if(channel==4){
											if(router_view=='limiter'){
                                               set_signal_led_rect(4,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(4,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(4,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(4,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(4,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(4,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present4').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal4'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present4').value = 0;
									 }
								}
								if(key2=='In5'){
									var signal5 = obj2.In5.Signal.Detected;
									if(signal5){
										if(router_view=='main'){
											set_signal_led_rect(5,66,890);
										}
										if(channel==5){
											if(router_view=='limiter'){
                                               set_signal_led_rect(5,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(5,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(5,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(5,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(5,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(5,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present5').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal5'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present5').value = 0;
									 }
								}
								if(key2=='In6'){
									var signal6 = obj2.In6.Signal.Detected;
									if(signal6){
										if(router_view=='main'){
											set_signal_led_rect(6,66,1100);
										}
										if(channel==6){
											if(router_view=='limiter'){
                                               set_signal_led_rect(6,66,541);
                                             }
                                            if(router_view=='noise_gate'){
                                                set_signal_led_rect(6,66,641);
                                            }
                                            if(router_view=='peq'){
                                                set_signal_led_rect(6,66,1479);
                                            }
                                            if(router_view=='geq'){
                                                set_signal_led_rect(5,66,1891);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(6,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(6,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present6').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal6'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present6').value = 0;
									 }
								}
								if(key2=='Out5'){
									var signal7 = obj2.Out5.Signal.Detected;
									if(signal7){
										if(router_view=='main'){
											set_signal_led_rect(7,66,1374);
										}
										if(channel==7){
											if(router_view=='ducker'){
                                                set_signal_led_rect(7,66,541);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(7,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present7').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal7'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present7').value = 0;
									 }
								}
								if(key2=='Out6'){
									var signal8 = obj2.Out6.Signal.Detected;
									if(signal8){
										if(router_view=='main'){
											set_signal_led_rect(8,66,1524);
										}
										if(channel==8){
											if(router_view=='ducker'){
                                                set_signal_led_rect(8,66,663);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(8,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present8').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal8'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present8').value = 0;
									 }
								}
							}
							// ampg2_2c
							if(json_type=='ampg2_2c'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
								    var IsNetwork1 = obj2.In1.Signal.IsNetwork;
								      
								   if(router_view=='main'){
										
									    if(signal1==true){
										   document.getElementById('Signal_signal_present1').value = 1;
										}
									    if(signal1==false){
										   document.getElementById('Signal_signal_present1').value = 0;
										}
									    if(IsNetwork1==true){
										   document.getElementById('Signal_IsNetwork1').value = 1;
										}
									    if(IsNetwork1==false){
										   document.getElementById('Signal_IsNetwork1').value = 0;
										}
									   
									   var Signal_signal_present1 = document.getElementById('Signal_signal_present1').value;
									   var Signal_IsNetwork1 = document.getElementById('Signal_IsNetwork1').value;
									     
                                        var led_top;
                                        if(Signal_signal_present1=='1' && Signal_IsNetwork1=='1'){
                                           led_top = 66;
											var IsNetwork1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork1'){
                                                    IsNetwork1_found = 1;
                                                }
                                            });
											if(IsNetwork1_found==0){
												 set_IsNetwork_led_rect(1,led_top,184);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present1=='1' && Signal_IsNetwork1=='0'){
                                           led_top = 81;
											var signal1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    signal1_found = 1;
                                                }
                                            });
											if(signal1_found==0){
												 set_signal_led_rect(1,led_top,184);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal1){
                                            if(channel==1){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(1,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(1,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(1,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present1').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present1').value = 0;
                                         }
									}
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
								    var IsNetwork2 = obj2.In2.Signal.IsNetwork;
								    var Signal_signal_present2_old = document.getElementById('Signal_signal_present2').value;
								    var Signal_IsNetwork2_old = document.getElementById('Signal_IsNetwork2').value;
								      
								   if(router_view=='main'){
										
									    if(signal2==true){
										   document.getElementById('Signal_signal_present2').value = 1;
										}
									    if(signal2==false){
										   document.getElementById('Signal_signal_present2').value = 0;
										}
									    if(IsNetwork2==true){
										   document.getElementById('Signal_IsNetwork2').value = 1;
										}
									    if(IsNetwork2==false){
										   document.getElementById('Signal_IsNetwork2').value = 0;
										}
									   
									   var Signal_signal_present2 = document.getElementById('Signal_signal_present2').value;
									   var Signal_IsNetwork2 = document.getElementById('Signal_IsNetwork2').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present2=='1' && Signal_IsNetwork2=='1'){
                                           led_top = 66;
											var IsNetwork2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork2'){
                                                    IsNetwork2_found = 1;
                                                }
                                            });
											if(IsNetwork2_found==0 && IsDualChannel==1){
												 set_IsNetwork_led_rect(2,led_top,394);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present2=='1' && Signal_IsNetwork2=='0'){
                                           led_top = 81;
											var signal2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    signal2_found = 1;
                                                }
                                            });
											if(signal2_found==0 && IsDualChannel==1){
												 set_signal_led_rect(2,led_top,394);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal2){
                                            if(channel==2){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(2,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(2,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(2,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present2').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present2').value = 0;
                                         }
									}
								}
							}
							// ampg2_4c
							if(json_type=='ampg2_4c'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
								    var IsNetwork1 = obj2.In1.Signal.IsNetwork;
								      
								   if(router_view=='main'){
										
									    if(signal1==true){
										   document.getElementById('Signal_signal_present1').value = 1;
										}
									    if(signal1==false){
										   document.getElementById('Signal_signal_present1').value = 0;
										}
									    if(IsNetwork1==true){
										   document.getElementById('Signal_IsNetwork1').value = 1;
										}
									    if(IsNetwork1==false){
										   document.getElementById('Signal_IsNetwork1').value = 0;
										}
									   
									   var Signal_signal_present1 = document.getElementById('Signal_signal_present1').value;
									   var Signal_IsNetwork1 = document.getElementById('Signal_IsNetwork1').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present1=='1' && Signal_IsNetwork1=='1'){
                                           led_top = 66;
											var IsNetwork1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork1'){
                                                    IsNetwork1_found = 1;
                                                }
                                            });
											if(IsNetwork1_found==0){
												 set_IsNetwork_led_rect(1,led_top,184);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present1=='1' && Signal_IsNetwork1=='0'){
                                           led_top = 81;
											var signal1_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    signal1_found = 1;
                                                }
                                            });
											if(signal1_found==0){
												 set_signal_led_rect(1,led_top,184);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present1=='0' || Signal_IsNetwork1=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal1){
                                            if(channel==1){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(1,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(1,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(1,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(1,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(1,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present1').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal1'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present1').value = 0;
                                         }
									}
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
								    var IsNetwork2 = obj2.In2.Signal.IsNetwork;
								    var Signal_signal_present2_old = document.getElementById('Signal_signal_present2').value;
								    var Signal_IsNetwork2_old = document.getElementById('Signal_IsNetwork2').value;
								      
								   if(router_view=='main'){
										
									    if(signal2==true){
										   document.getElementById('Signal_signal_present2').value = 1;
										}
									    if(signal2==false){
										   document.getElementById('Signal_signal_present2').value = 0;
										}
									    if(IsNetwork2==true){
										   document.getElementById('Signal_IsNetwork2').value = 1;
										}
									    if(IsNetwork2==false){
										   document.getElementById('Signal_IsNetwork2').value = 0;
										}
									   
									   var Signal_signal_present2 = document.getElementById('Signal_signal_present2').value;
									   var Signal_IsNetwork2 = document.getElementById('Signal_IsNetwork2').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present2=='1' && Signal_IsNetwork2=='1'){
                                           led_top = 66;
											var IsNetwork2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork2'){
                                                    IsNetwork2_found = 1;
                                                }
                                            });
											if(IsNetwork2_found==0 && IsDualChannel==1){
												 set_IsNetwork_led_rect(2,led_top,394);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present2=='1' && Signal_IsNetwork2=='0'){
                                           led_top = 81;
											var signal2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    signal2_found = 1;
                                                }
                                            });
											if(signal2_found==0 && IsDualChannel==1){
												 set_signal_led_rect(2,led_top,394);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal2){
                                            if(channel==2){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(2,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(2,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(2,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present2').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present2').value = 0;
                                         }
									}
								}
								if(key2=='In3'){
									var signal3 = obj2.In3.Signal.Detected;
								    var IsNetwork3 = obj2.In3.Signal.IsNetwork;
								    var Signal_signal_present3_old = document.getElementById('Signal_signal_present3').value;
								    var Signal_IsNetwork3_old = document.getElementById('Signal_IsNetwork3').value;
								      
								   if(router_view=='main'){
										
									    if(signal3==true){
										   document.getElementById('Signal_signal_present3').value = 1;
										}
									    if(signal3==false){
										   document.getElementById('Signal_signal_present3').value = 0;
										}
									    if(IsNetwork3==true){
										   document.getElementById('Signal_IsNetwork3').value = 1;
										}
									    if(IsNetwork3==false){
										   document.getElementById('Signal_IsNetwork3').value = 0;
										}
									   
									   var Signal_signal_present3 = document.getElementById('Signal_signal_present3').value;
									   var Signal_IsNetwork3 = document.getElementById('Signal_IsNetwork3').value;
									      	   
                                        var led_top;
									    var  led_left = 604;
                                        if(IsDualChannel==0){
                                            led_left = led_left-210;
                                        }
									   if(Signal_signal_present3=='1' && Signal_IsNetwork3=='1'){
                                           led_top = 66;
											var IsNetwork3_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork3'){
                                                    IsNetwork3_found = 1;
                                                }
                                            });
											if(IsNetwork3_found==0){
												 set_IsNetwork_led_rect(3,led_top,led_left); 
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present3=='1' && Signal_IsNetwork3=='0'){
                                           led_top = 81;
											var signal3_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    signal3_found = 1;
                                                }
                                            });
											if(signal3_found==0){
												 set_signal_led_rect(3,led_top,led_left);  
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present3=='0' || Signal_IsNetwork3=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present3=='0' || Signal_IsNetwork3=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal3){
                                            if(channel==3){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(3,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(3,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(3,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(3,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(3,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(3,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(3,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(3,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present3').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal3'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present3').value = 0;
                                         }
									}
								}
								if(key2=='In4'){
									var signal4 = obj2.In4.Signal.Detected;
								    var IsNetwork4 = obj2.In4.Signal.IsNetwork;
								    var Signal_signal_present4_old = document.getElementById('Signal_signal_present4').value;
								    var Signal_IsNetwork4_old = document.getElementById('Signal_IsNetwork4').value;
								      
								   if(router_view=='main'){
										
									    if(signal4==true){
										   document.getElementById('Signal_signal_present4').value = 1;
										}
									    if(signal4==false){
										   document.getElementById('Signal_signal_present4').value = 0;
										}
									    if(IsNetwork4==true){
										   document.getElementById('Signal_IsNetwork4').value = 1;
										}
									    if(IsNetwork4==false){
										   document.getElementById('Signal_IsNetwork4').value = 0;
										}
									   
									   var Signal_signal_present4 = document.getElementById('Signal_signal_present4').value;
									   var Signal_IsNetwork4 = document.getElementById('Signal_IsNetwork4').value;
									      	   
                                        var led_top;
									    var led_left = 814;
                                        if(IsDualChannel==0){
                                          	led_left = led_left-210;
                                         }
									   if(Signal_signal_present4=='1' && Signal_IsNetwork4=='1'){
                                           led_top = 66;
											var IsNetwork4_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork4'){
                                                    IsNetwork4_found = 1;
                                                }
                                            });
											if(IsNetwork4_found==0 && IsDualChannel2==1){
												 set_IsNetwork_led_rect(4,led_top,led_left); 
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present4=='1' && Signal_IsNetwork4=='0'){
                                           led_top = 81;
											var signal4_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    signal4_found = 1;
                                                }
                                            });
											if(signal4_found==0 && IsDualChannel2==1){
												 set_signal_led_rect(4,led_top,led_left);
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present4=='0' || Signal_IsNetwork4=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present4=='0' || Signal_IsNetwork4=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal4){
                                            if(channel==4){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(4,66,541);
                                                 }
                                                if(router_view=='noise_gate'){
                                                    set_signal_led_rect(4,66,641);
                                                }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(4,66,1479);
                                                }
                                                if(router_view=='geq'){
                                                    set_signal_led_rect(4,66,1891);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(4,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(4,66,641);
                                                }
                                                if(router_view=='delay'){
                                                    set_signal_led_rect(4,66,541);
                                                }
                                                if(router_view=='phase_invert'){
                                                    set_signal_led_rect(4,66,541);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present4').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal4'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present4').value = 0;
                                         }
									}
								}
							}
							// nqga400p
							if(json_type=='nqga400p'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
									if(signal1){
										if(router_view=='main'){
											set_signal_led_rect(1,66,50);
										}
										if(channel==1){
										   if(router_view=='limiter'){
                                               set_signal_led_rect(1,66,541);
                                             }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(1,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present1').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal1'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present1').value = 0;
									 }
								}
								if(key2=='In2'){
									var signal2 = obj2.In2.Signal.Detected;
									if(signal2){
										if(router_view=='main'){
											set_signal_led_rect(2,66,260);
										}
										if(channel==2){
											if(router_view=='limiter'){
                                               set_signal_led_rect(2,66,541);
                                             }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(2,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present2').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal2'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present2').value = 0;
									 }
								}
								if(key2=='Out1'){
									var signal3 = obj2.Out1.Signal.Detected;
									if(signal3){
										if(router_view=='main'){
											set_signal_led_rect(3,66,470);
										}
										if(channel==3){
                                            if(router_view=='peq'){
                                                set_signal_led_rect(3,66,1479);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(3,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(3,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present3').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal3'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present3').value = 0;
									 }
								}
								if(key2=='Out2'){
									var signal4 = obj2.Out2.Signal.Detected;
									if(signal4){
										if(router_view=='main'){
											set_signal_led_rect(4,66,680);
										}
										if(channel==4){
                                            if(router_view=='peq'){
                                                set_signal_led_rect(4,66,1479);
                                            }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(4,66,541);
                                            }
                                            if(router_view=='hplp'){
                                                set_signal_led_rect(4,66,641);
                                            }
										}
										document.getElementById('Signal_signal_present4').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal4'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present4').value = 0;
									 }
								}
							}
							// nqga40
							if(json_type=='nqga40'){
							   if(key2=='In1'){
									var signal1 = obj2.In1.Signal.Detected;
									if(signal1){
										if(router_view=='main'){
											set_signal_led_rect(1,66,50);
										}
										if(channel==1){
										   if(router_view=='limiter'){
                                               set_signal_led_rect(1,66,541);
                                             }
                                            if(router_view=='signal_present'){
                                                set_signal_led_rect(1,66,541);
                                            }
										}
										document.getElementById('Signal_signal_present1').value = 1;
									 } else {
										canvas.getObjects().forEach(function (object) {
                                           if(object.name == 'signal1'){
                                            	canvas.remove(object);
										   }
                                    	});
										document.getElementById('Signal_signal_present1').value = 0;
									 }
								}
								if(key2=='Ch1'){
									var signal2 = obj2.Ch1.Signal.Detected;
								    var IsNetwork2 = obj2.Ch1.Signal.IsNetwork;
								    var Signal_signal_present2_old = document.getElementById('Signal_signal_present2').value;
								    var Signal_IsNetwork2_old = document.getElementById('Signal_IsNetwork2').value;
								      
								   if(router_view=='main'){
										
									    if(signal2==true){
										   document.getElementById('Signal_signal_present2').value = 1;
										}
									    if(signal2==false){
										   document.getElementById('Signal_signal_present2').value = 0;
										}
									    if(IsNetwork2==true){
										   document.getElementById('Signal_IsNetwork2').value = 1;
										}
									    if(IsNetwork2==false){
										   document.getElementById('Signal_IsNetwork2').value = 0;
										}
									   
									   var Signal_signal_present2 = document.getElementById('Signal_signal_present2').value;
									   var Signal_IsNetwork2 = document.getElementById('Signal_IsNetwork2').value;
									      	   
                                        var led_top;
                                        if(Signal_signal_present2=='1' && Signal_IsNetwork2=='1'){
                                           led_top = 66;
											var IsNetwork2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'IsNetwork2'){
                                                    IsNetwork2_found = 1;
                                                }
                                            });
											if(IsNetwork2_found==0 && IsDualChannel==1){
												 set_IsNetwork_led_rect(2,led_top,394);  
											}
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
                                        }
									    if(Signal_signal_present2=='1' && Signal_IsNetwork2=='0'){
                                           led_top = 81;
											var signal2_found = 0;
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    signal2_found = 1;
                                                }
                                            });
											if(signal2_found==0 && IsDualChannel==1){
												 set_signal_led_rect(2,led_top,394);   
											}
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                        }
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='1'){
											canvas.getObjects().forEach(function (object) {
                                                if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                                }
                                            });
										}
									    if(Signal_signal_present2=='0' || Signal_IsNetwork2=='0'){
											canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'IsNetwork2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                         }
									} else {
										if(signal2){
                                            if(channel==2){
                                                if(router_view=='limiter'){
                                                   set_signal_led_rect(2,66,541);
                                                 }
                                                if(router_view=='peq'){
                                                    set_signal_led_rect(2,66,1479);
                                                }
                                                if(router_view=='signal_present'){
                                                    set_signal_led_rect(2,66,541);
                                                }
                                                if(router_view=='hplp'){
                                                    set_signal_led_rect(2,66,641);
                                                }
                                            }
                                            document.getElementById('Signal_signal_present2').value = 1;
                                         } else {
                                            canvas.getObjects().forEach(function (object) {
                                               if(object.name == 'signal2'){
                                                    canvas.remove(object);
                                               }
                                            });
                                            document.getElementById('Signal_signal_present2').value = 0;
                                         }
									}
								}
							}
						}
						for(var key5 in obj[key1][key2][key3][key4]) {
							//console.log(key5);
							if(key5=='Frequency'){
								var field = key4 + channel + '_freq';
								var frequency = obj[key1][key2][key3][key4][key5];
								document.getElementById(field).value = frequency;
								//console.log(field, frequency);
							}
							if(key5=='Q'){
								var field = key4 + channel + '_q';
								var qval = obj[key1][key2][key3][key4][key5];
								document.getElementById(field).value = qval;
								//console.log(field, qval);
							}
							if(key5=='Boost'){
								var field = key4 + channel + '_fader';
								var boost = obj[key1][key2][key3][key4][key5];
								document.getElementById(field).value = boost;
								//console.log(field, boost);
							}
							if(key5=='Enable'){
								var field = key4 + channel + '_enable';
								var enable = obj[key1][key2][key3][key4][key5];
								if(enable==true){
									document.getElementById(field).value = 1;
								} else {
									document.getElementById(field).value = 0;
								}
								//console.log(field, enable);
							}
						}
						if(key3=='Limiter' && key4=='Limiting' && router_view=='limiter'){
							// console.log(key3, key4);
							// Mixer
							if(json_type=='Mixer'){
							   if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
								if(key2=='In3'){
									var limiting3 = obj2.In3.Limiter.Limiting;
									if(limiting3){
										set_limiter_led_rect(3,81,541);
										document.getElementById('Limiter_limiting3').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting3'));
										document.getElementById('Limiter_limiting3').value = 0;
									}
								}
								if(key2=='In4'){
									var limiting4 = obj2.In4.Limiter.Limiting;
									if(limiting4){
										set_limiter_led_rect(4,81,541);
										document.getElementById('Limiter_limiting4').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting4'));
										document.getElementById('Limiter_limiting4').value = 0;
									}
								}
								if(key2=='Out5'){
									var limiting5 = obj2.Out5.Limiter.Limiting;
									if(limiting5){
										set_limiter_led_rect(5,81,541);
										document.getElementById('Limiter_limiting5').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting5'));
										document.getElementById('Limiter_limiting5').value = 0;
									}
								}
							}
							// ampg1_2c
							if(json_type=='ampg1_2c'){
								if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										   set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									 }
								}
								if(key2=='In5'){
									var limiting3 = obj2.In5.Limiter.Limiting;
									if(limiting3){
										   set_limiter_led_rect(3,81,541);
										document.getElementById('Limiter_limiting3').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting3'));
										document.getElementById('Limiter_limiting3').value = 0;
									 }
								}
							}
							// ampg1_4c
							if(json_type=='ampg1_4c'){
							   if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
								if(key2=='In3'){
									var limiting3 = obj2.In3.Limiter.Limiting;
									if(limiting3){
										set_limiter_led_rect(3,81,541);
										document.getElementById('Limiter_limiting3').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting3'));
										document.getElementById('Limiter_limiting3').value = 0;
									}
								}
								if(key2=='In4'){
									var limiting4 = obj2.In4.Limiter.Limiting;
									if(limiting4){
										set_limiter_led_rect(4,81,541);
										document.getElementById('Limiter_limiting4').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting4'));
										document.getElementById('Limiter_limiting4').value = 0;
									}
								}
								if(key2=='In5'){
									var limiting5 = obj2.In5.Limiter.Limiting;
									if(limiting5){
										set_limiter_led_rect(5,81,541);
										document.getElementById('Limiter_limiting5').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting5'));
										document.getElementById('Limiter_limiting5').value = 0;
									}
								}
								if(key2=='In6'){
									var limiting6 = obj2.In6.Limiter.Limiting;
									if(limiting6){
										set_limiter_led_rect(6,81,541);
										document.getElementById('Limiter_limiting6').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting6'));
										document.getElementById('Limiter_limiting6').value = 0;
									}
								}
							}
							
							// nqga20
							if(json_type=='nqga20'){
							   if(key2=='Ch1'){
									var limiting1 = obj2.Ch1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
							}
							// nqpaxxx
							if(json_type=='nqpaxxx'){
							   if(key2=='In1' && channel==1){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2' && channel==2){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
								if(key2=='In3' && channel==3){
									var limiting3 = obj2.In3.Limiter.Limiting;
									if(limiting3){
										set_limiter_led_rect(3,81,541);
										document.getElementById('Limiter_limiting3').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting3'));
										document.getElementById('Limiter_limiting3').value = 0;
									}
								}
								if(key2=='In4' && channel==4){
									var limiting4 = obj2.In4.Limiter.Limiting;
									if(limiting4){
										set_limiter_led_rect(4,81,541);
										document.getElementById('Limiter_limiting4').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting4'));
										document.getElementById('Limiter_limiting4').value = 0;
									}
								}
								if(key2=='In5' && channel==5){
									var limiting5 = obj2.In5.Limiter.Limiting;
									if(limiting5){
										set_limiter_led_rect(5,81,541);
										document.getElementById('Limiter_limiting5').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting5'));
										document.getElementById('Limiter_limiting5').value = 0;
									}
								}
								if(key2=='In6' && channel==6){
									var limiting6 = obj2.In6.Limiter.Limiting;
									if(limiting6){
										set_limiter_led_rect(6,81,541);
										document.getElementById('Limiter_limiting6').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting6'));
										document.getElementById('Limiter_limiting6').value = 0;
									}
								}
								if(key2=='Out5' && channel==7){
									var limiting7 = obj2.Out5.Limiter.Limiting;
									if(limiting7){
										set_limiter_led_rect(7,81,541);
										document.getElementById('Limiter_limiting7').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting7'));
										document.getElementById('Limiter_limiting7').value = 0;
									}
								}
								if(key2=='Out6' && channel==8){
									var limiting8 = obj2.Out6.Limiter.Limiting;
									if(limiting8){
										set_limiter_led_rect(8,81,541);
										document.getElementById('Limiter_limiting8').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting8'));
										document.getElementById('Limiter_limiting8').value = 0;
									}
								}
							}
							// ampg2_2c
							if(json_type=='ampg2_2c'){
							   if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
							}
							// ampg2_4c
							if(json_type=='ampg2_4c'){
							   if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
								if(key2=='In3'){
									var limiting3 = obj2.In3.Limiter.Limiting;
									if(limiting3){
										set_limiter_led_rect(3,81,541);
										document.getElementById('Limiter_limiting3').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting3'));
										document.getElementById('Limiter_limiting3').value = 0;
									}
								}
								if(key2=='In4'){
									var limiting4 = obj2.In4.Limiter.Limiting;
									if(limiting4){
										set_limiter_led_rect(4,81,541);
										document.getElementById('Limiter_limiting4').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting4'));
										document.getElementById('Limiter_limiting4').value = 0;
									}
								}
							}
							// nqga400p
							if(json_type=='nqga400p'){
							   if(key2=='In1'){
									var limiting1 = obj2.In1.Limiter.Limiting;
									if(limiting1){
										   set_limiter_led_rect(1,81,541);
										document.getElementById('Limiter_limiting1').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting1'));
										document.getElementById('Limiter_limiting1').value = 0;
									 }
								}
								if(key2=='In2'){
									var limiting2 = obj2.In2.Limiter.Limiting;
									if(limiting2){
										set_limiter_led_rect(2,81,541);
										document.getElementById('Limiter_limiting2').value = 1;
									 } else {
										canvas.remove(canvas.getItemByName('limiting2'));
										document.getElementById('Limiter_limiting2').value = 0;
									}
								}
							}
						}
						if(key3=='Compressor' && key4=='Levels' && ['main','compressor'].indexOf(router_view)>-1){
							//console.log(key3, key4);
							// Mixer
							if(json_type=='Mixer'){
							   if(key2=='In1'){
								    
								  var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								   document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2); 

											if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
									}
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
								if(key2=='In3'){
									
									var compressor_levels3 = obj2.In3.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels3[0]);
									document.getElementById('comp_level_in3').value = compressor_levels3[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels3[1]);
									document.getElementById('comp_level_out3').value = compressor_levels3[1];

								   var compression3 = compressor_levels3[2];
								   var current_compression3 = document.getElementById('comp3').value;
									
									if(channel==3){

										if(router_view=='compressor'){

											set_red_led_rect(3,top1,left1);
											set_yellow_led_rect(3,top1,left1);
											set_green_led_rect(3,top1,left1); 

											set_red_led_rect2(3,top2,left2); 
											set_yellow_led_rect2(3,top2,left2); 
											set_green_led_rect2(3,top2,left2); 

											if(compression3>0 && current_compression3==0){
                                                set_compression_led_rect(3,81,963);
                                            } else if(current_compression3==0){
                                                canvas.remove(canvas.getItemByName('compression3'));
                                            }
                                            document.getElementById('comp3').value = compression3;
										}
									}
								}
								if(key2=='In4'){
									
									var compressor_levels4 = obj2.In4.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels4[0]);
									document.getElementById('comp_level_in4').value = compressor_levels4[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels4[1]);
									document.getElementById('comp_level_out4').value = compressor_levels4[1];

								   var compression4 = compressor_levels4[2];
								   var current_compression4 = document.getElementById('comp4').value;
									
									if(channel==4){

										if(router_view=='compressor'){

											set_red_led_rect(4,top1,left1);
											set_yellow_led_rect(4,top1,left1);
											set_green_led_rect(4,top1,left1); 

											set_red_led_rect2(4,top2,left2); 
											set_yellow_led_rect2(4,top2,left2); 
											set_green_led_rect2(4,top2,left2); 

											if(compression4>0 && current_compression4==0){
                                                set_compression_led_rect(4,81,963);
                                            } else if(current_compression4==0){
                                                canvas.remove(canvas.getItemByName('compression4'));
                                            }
                                            document.getElementById('comp4').value = compression4;
										}
									}
								}
								if(key2=='In5'){
									
									var compressor_levels6 = obj2.In5.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels6[0]);
									document.getElementById('comp_level_in6').value = compressor_levels6[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels6[1]);
									document.getElementById('comp_level_out6').value = compressor_levels6[1];

								   var compression6 = compressor_levels6[2];
								   var current_compression6 = document.getElementById('comp6').value;
									
									if(channel==6){

										if(router_view=='compressor'){

											set_red_led_rect(6,top1,left1);
											set_yellow_led_rect(6,top1,left1);
											set_green_led_rect(6,top1,left1); 

											set_red_led_rect2(6,top2,left2); 
											set_yellow_led_rect2(6,top2,left2); 
											set_green_led_rect2(6,top2,left2); 

											if(compression6>0 && current_compression6==0){
                                                set_compression_led_rect(6,81,963);
                                            } else if(current_compression6==0){
                                                canvas.remove(canvas.getItemByName('compression6'));
                                            }
                                            document.getElementById('comp6').value = compression6;
										}
									}
								}
							}
							// ampg1_2c
							if(json_type=='ampg1_2c'){
							   if(key2=='In1'){
								   
									var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
									document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
									document.getElementById('comp_level_out1').value = compressor_levels1[1];

									var compression1 = compressor_levels1[2];
									var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2);

										   if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
								   }
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]); 
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

									var compression2 = compressor_levels2[2];
									var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2);

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
								if(key2=='In5'){
									
									var compressor_levels3 = obj2.In5.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels3[0]);
									document.getElementById('comp_level_in3').value = compressor_levels3[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels3[1]);
									document.getElementById('comp_level_out3').value = compressor_levels3[1];

									var compression3 = compressor_levels3[2];
									var current_compression3 = document.getElementById('comp3').value;
									
									if(channel==3){

										if(router_view=='compressor'){

											set_red_led_rect(3,top1,left1);
											set_yellow_led_rect(3,top1,left1);
											set_green_led_rect(3,top1,left1);

											set_red_led_rect2(3,top2,left2); 
											set_yellow_led_rect2(3,top2,left2); 
											set_green_led_rect2(3,top2,left2);

											if(compression3>0 && current_compression3==0){
                                                set_compression_led_rect(3,81,963);
                                            } else if(current_compression3==0){
                                                canvas.remove(canvas.getItemByName('compression3'));
                                            }
                                            document.getElementById('comp3').value = compression3;
										}
									}
								}
							}
							// ampg1_4c
							if(json_type=='ampg1_4c'){
							   if(key2=='In1'){
								    
								  var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								   document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2); 

										  if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
									}
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
								if(key2=='In3'){
									
									var compressor_levels3 = obj2.In3.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels3[0]);
									document.getElementById('comp_level_in3').value = compressor_levels3[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels3[1]);
									document.getElementById('comp_level_out3').value = compressor_levels3[1];

								   var compression3 = compressor_levels3[2];
								   var current_compression3 = document.getElementById('comp3').value;
									
									if(channel==3){

										if(router_view=='compressor'){

											set_red_led_rect(3,top1,left1);
											set_yellow_led_rect(3,top1,left1);
											set_green_led_rect(3,top1,left1); 

											set_red_led_rect2(3,top2,left2); 
											set_yellow_led_rect2(3,top2,left2); 
											set_green_led_rect2(3,top2,left2); 

											if(compression3>0 && current_compression3==0){
                                                set_compression_led_rect(3,81,963);
                                            } else if(current_compression3==0){
                                                canvas.remove(canvas.getItemByName('compression3'));
                                            }
                                            document.getElementById('comp3').value = compression3;
										}
									}
								}
								if(key2=='In4'){
									
									var compressor_levels4 = obj2.In4.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels4[0]);
									document.getElementById('comp_level_in4').value = compressor_levels4[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels4[1]);
									document.getElementById('comp_level_out4').value = compressor_levels4[1];

								   var compression4 = compressor_levels4[2];
								   var current_compression4 = document.getElementById('comp4').value;
									
									if(channel==4){

										if(router_view=='compressor'){

											set_red_led_rect(4,top1,left1);
											set_yellow_led_rect(4,top1,left1);
											set_green_led_rect(4,top1,left1); 

											set_red_led_rect2(4,top2,left2); 
											set_yellow_led_rect2(4,top2,left2); 
											set_green_led_rect2(4,top2,left2); 

											if(compression4>0 && current_compression4==0){
                                                set_compression_led_rect(4,81,963);
                                            } else if(current_compression4==0){
                                                canvas.remove(canvas.getItemByName('compression4'));
                                            }
                                            document.getElementById('comp4').value = compression4;
										}
									}
								}
								if(key2=='In5'){
									
									var compressor_levels5 = obj2.In5.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels5[0]);
									document.getElementById('comp_level_in5').value = compressor_levels5[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels5[1]);
									document.getElementById('comp_level_out5').value = compressor_levels5[1];

								   var compression5 = compressor_levels5[2];
								   var current_compression5 = document.getElementById('comp5').value;
									
									if(channel==5){

										if(router_view=='compressor'){

											set_red_led_rect(5,top1,left1);
											set_yellow_led_rect(5,top1,left1);
											set_green_led_rect(5,top1,left1); 

											set_red_led_rect2(5,top2,left2); 
											set_yellow_led_rect2(5,top2,left2); 
											set_green_led_rect2(5,top2,left2); 

											if(compression5>0 && current_compression5==0){
                                                set_compression_led_rect(5,81,963);
                                            } else if(current_compression5==0){
                                                canvas.remove(canvas.getItemByName('compression5'));
                                            }
                                            document.getElementById('comp5').value = compression5;
										}
									}
								}
								if(key2=='In6'){
									
									var compressor_levels6 = obj2.In6.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels6[0]);
									document.getElementById('comp_level_in6').value = compressor_levels6[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels6[1]);
									document.getElementById('comp_level_out6').value = compressor_levels6[1];

								   var compression6 = compressor_levels6[2];
								   var current_compression6 = document.getElementById('comp6').value;
									
									if(channel==6){

										if(router_view=='compressor'){

											set_red_led_rect(6,top1,left1);
											set_yellow_led_rect(6,top1,left1);
											set_green_led_rect(6,top1,left1); 

											set_red_led_rect2(6,top2,left2); 
											set_yellow_led_rect2(6,top2,left2); 
											set_green_led_rect2(6,top2,left2); 
											
											if(compression6>0 && current_compression6==0){
                                                set_compression_led_rect(6,81,963);
                                            } else if(current_compression6==0){
                                                canvas.remove(canvas.getItemByName('compression6'));
                                            }
                                            document.getElementById('comp6').value = compression6;
										}
									}
								}
							}
							
							// nqga20
							if(json_type=='nqga20'){
							   if(key2=='Ch1'){
								  var compressor_levels1 = obj2.Ch1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								   document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
                                   if(router_view=='compressor'){

                                        set_red_led_rect(1,top1,left1);
                                        set_yellow_led_rect(1,top1,left1);
                                        set_green_led_rect(1,top1,left1); 

                                        set_red_led_rect2(1,top2,left2); 
                                        set_yellow_led_rect2(1,top2,left2); 
                                        set_green_led_rect2(1,top2,left2); 

                                       if(compression1>0 && current_compression1==0){
                                            set_compression_led_rect(1,81,963);
                                        } else if(current_compression1==0){
                                            canvas.remove(canvas.getItemByName('compression1'));
                                        }
                                        document.getElementById('comp1').value = compression1;
                                   }
								}
							}
							// nqpaxxx
							if(json_type=='nqpaxxx'){
							   if(key2=='In1'){
								    
								  var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								   document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2); 

										   if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
									}
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
								if(key2=='In3'){
									
									var compressor_levels3 = obj2.In3.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels3[0]);
									document.getElementById('comp_level_in3').value = compressor_levels3[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels3[1]);
									document.getElementById('comp_level_out3').value = compressor_levels3[1];

								   var compression3 = compressor_levels3[2];
								   var current_compression3 = document.getElementById('comp3').value;
									
									if(channel==3){

										if(router_view=='compressor'){

											set_red_led_rect(3,top1,left1);
											set_yellow_led_rect(3,top1,left1);
											set_green_led_rect(3,top1,left1); 

											set_red_led_rect2(3,top2,left2); 
											set_yellow_led_rect2(3,top2,left2); 
											set_green_led_rect2(3,top2,left2); 

											if(compression3>0 && current_compression3==0){
                                                set_compression_led_rect(3,81,963);
                                            } else if(current_compression3==0){
                                                canvas.remove(canvas.getItemByName('compression3'));
                                            }
                                            document.getElementById('comp3').value = compression3;
										}
									}
								}
								if(key2=='In4'){
									
									var compressor_levels4 = obj2.In4.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels4[0]);
									document.getElementById('comp_level_in4').value = compressor_levels4[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels4[1]);
									document.getElementById('comp_level_out4').value = compressor_levels4[1];

								   var compression4 = compressor_levels4[2];
								   var current_compression4 = document.getElementById('comp4').value;
									
									if(channel==4){

										if(router_view=='compressor'){

											set_red_led_rect(4,top1,left1);
											set_yellow_led_rect(4,top1,left1);
											set_green_led_rect(4,top1,left1); 

											set_red_led_rect2(4,top2,left2); 
											set_yellow_led_rect2(4,top2,left2); 
											set_green_led_rect2(4,top2,left2); 

											if(compression4>0 && current_compression4==0){
                                                set_compression_led_rect(4,81,963);
                                            } else if(current_compression4==0){
                                                canvas.remove(canvas.getItemByName('compression4'));
                                            }
                                            document.getElementById('comp4').value = compression4;
										}
									}
								}
								if(key2=='In5'){
									
									var compressor_levels5 = obj2.In5.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels5[0]);
									document.getElementById('comp_level_in5').value = compressor_levels5[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels5[1]);
									document.getElementById('comp_level_out5').value = compressor_levels5[1];

								   var compression5 = compressor_levels5[2];
								   var current_compression5 = document.getElementById('comp5').value;
									
									if(channel==5){

										if(router_view=='compressor'){

											set_red_led_rect(5,top1,left1);
											set_yellow_led_rect(5,top1,left1);
											set_green_led_rect(5,top1,left1); 

											set_red_led_rect2(5,top2,left2); 
											set_yellow_led_rect2(5,top2,left2); 
											set_green_led_rect2(5,top2,left2); 

											if(compression5>0 && current_compression5==0){
                                                set_compression_led_rect(5,81,963);
                                            } else if(current_compression5==0){
                                                canvas.remove(canvas.getItemByName('compression5'));
                                            }
                                            document.getElementById('comp5').value = compression5;
										}
									}
								}
								if(key2=='In6'){
									
									var compressor_levels6 = obj2.In6.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels6[0]);
									document.getElementById('comp_level_in6').value = compressor_levels6[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels6[1]);
									document.getElementById('comp_level_out6').value = compressor_levels6[1];

								   var compression6 = compressor_levels6[2];
								   var current_compression6 = document.getElementById('comp6').value;
									
									if(channel==6){

										if(router_view=='compressor'){

											set_red_led_rect(6,top1,left1);
											set_yellow_led_rect(6,top1,left1);
											set_green_led_rect(6,top1,left1); 

											set_red_led_rect2(6,top2,left2); 
											set_yellow_led_rect2(6,top2,left2); 
											set_green_led_rect2(6,top2,left2); 

											if(compression6>0 && current_compression6==0){
                                                set_compression_led_rect(6,81,963);
                                            } else if(current_compression6==0){
                                                canvas.remove(canvas.getItemByName('compression6'));
                                            }
                                            document.getElementById('comp6').value = compression6;
										}
									}
								}
							}
							// ampg2_2c
							if(json_type=='ampg2_2c'){
							   if(key2=='In1'){
								    
								  var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								    document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2); 

										   if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
									}
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
							}
							// ampg2_4c
							if(json_type=='ampg2_4c'){
							   if(key2=='In1'){
								    
								  var compressor_levels1 = obj2.In1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels1[0]);
								   document.getElementById('comp_level_in1').value = compressor_levels1[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels1[1]);
								   document.getElementById('comp_level_out1').value = compressor_levels1[1];

								   var compression1 = compressor_levels1[2];
								   var current_compression1 = document.getElementById('comp1').value;
								   
								   if(channel==1){

									   if(router_view=='compressor'){

											set_red_led_rect(1,top1,left1);
											set_yellow_led_rect(1,top1,left1);
											set_green_led_rect(1,top1,left1); 

											set_red_led_rect2(1,top2,left2); 
											set_yellow_led_rect2(1,top2,left2); 
											set_green_led_rect2(1,top2,left2); 

										   if(compression1>0 && current_compression1==0){
                                                set_compression_led_rect(1,81,963);
                                            } else if(current_compression1==0){
                                                canvas.remove(canvas.getItemByName('compression1'));
                                            }
                                            document.getElementById('comp1').value = compression1;
									   }
									}
								}
								if(key2=='In2'){
									
									var compressor_levels2 = obj2.In2.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
								if(key2=='In3'){
									
									var compressor_levels3 = obj2.In3.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels3[0]);
									document.getElementById('comp_level_in3').value = compressor_levels3[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels3[1]);
									document.getElementById('comp_level_out3').value = compressor_levels3[1];

								   var compression3 = compressor_levels3[2];
								   var current_compression3 = document.getElementById('comp3').value;
									
									if(channel==3){

										if(router_view=='compressor'){

											set_red_led_rect(3,top1,left1);
											set_yellow_led_rect(3,top1,left1);
											set_green_led_rect(3,top1,left1); 

											set_red_led_rect2(3,top2,left2); 
											set_yellow_led_rect2(3,top2,left2); 
											set_green_led_rect2(3,top2,left2); 

											if(compression3>0 && current_compression3==0){
                                                set_compression_led_rect(3,81,963);
                                            } else if(current_compression3==0){
                                                canvas.remove(canvas.getItemByName('compression3'));
                                            }
                                            document.getElementById('comp3').value = compression3;
										}
									}
								}
								if(key2=='In4'){
									
									var compressor_levels4 = obj2.In4.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels4[0]);
									document.getElementById('comp_level_in4').value = compressor_levels4[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels4[1]);
									document.getElementById('comp_level_out4').value = compressor_levels4[1];

								   var compression4 = compressor_levels4[2];
								   var current_compression4 = document.getElementById('comp4').value;
									
									if(channel==4){

										if(router_view=='compressor'){

											set_red_led_rect(4,top1,left1);
											set_yellow_led_rect(4,top1,left1);
											set_green_led_rect(4,top1,left1); 

											set_red_led_rect2(4,top2,left2); 
											set_yellow_led_rect2(4,top2,left2); 
											set_green_led_rect2(4,top2,left2); 
													
											if(compression4>0 && current_compression4==0){
                                                set_compression_led_rect(4,81,963);
                                            } else if(current_compression4==0){
                                                canvas.remove(canvas.getItemByName('compression4'));
                                            }
                                            document.getElementById('comp4').value = compression4;
										}
									}
								}
							}
							// nqga40
							if(json_type=='nqga40'){
								if(key2=='Ch1'){
									var compressor_levels2 = obj2.Ch1.Compressor.Levels;
									var left1 = 841;
									var top1 = get_led_top_from_volume(compressor_levels2[0]);
									document.getElementById('comp_level_in2').value = compressor_levels2[0];

									var left2 = 963;
									var top2 = get_led_top_from_volume(compressor_levels2[1]);
									document.getElementById('comp_level_out2').value = compressor_levels2[1];

								   var compression2 = compressor_levels2[2];
								   var current_compression2 = document.getElementById('comp2').value;
									
									if(channel==2){

										if(router_view=='compressor'){

											set_red_led_rect(2,top1,left1);
											set_yellow_led_rect(2,top1,left1);
											set_green_led_rect(2,top1,left1); 

											set_red_led_rect2(2,top2,left2); 
											set_yellow_led_rect2(2,top2,left2); 
											set_green_led_rect2(2,top2,left2); 

											if(compression2>0 && current_compression2==0){
                                                set_compression_led_rect(2,81,963);
                                            } else if(current_compression2==0){
                                                canvas.remove(canvas.getItemByName('compression2'));
                                            }
                                            document.getElementById('comp2').value = compression2;
										}
									}
								}
							}
						}
						
						if(key3=='PeakLimiter' && key4=='Levels' && router_view=='peak_limiter'){
						// console.log(key3, key4);
							// ampg1_2c, ampg2_2c
							if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
							   if(key2=='In1'){
								  var peak_levels_levels1 = obj2.In1.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels1[0]);
								   document.getElementById('peak_limiter_level_in1').value = peak_levels_levels1[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels1[1]);
								   document.getElementById('peak_limiter_level_out1').value = peak_levels_levels1[1];

								   var peak_limiter_limiting1 = peak_levels_levels1[2];
								   var current_led_state1 =  document.getElementById('rms_limiter_limiting1').value;
								   
								   if(channel==1){
									    set_red_led_rect(1,top1,left1);
                                        set_yellow_led_rect(1,top1,left1);
                                        set_green_led_rect(1,top1,left1); 

                                        set_red_led_rect2(1,top2,left2); 
                                        set_yellow_led_rect2(1,top2,left2); 
                                        set_green_led_rect2(1,top2,left2); 

                                       if(peak_limiter_limiting1>0 && current_led_state1==0){
                                            set_peak_limiting_led_rect(1,81,763);
                                        } else if(current_led_state1==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting1'));
                                        }
									   document.getElementById('rms_limiter_limiting1').value = peak_limiter_limiting1;
									}
								}
								if(key2=='In2'){
									var peak_levels_levels2 = obj2.In2.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels2[0]);
								   document.getElementById('peak_limiter_level_in2').value = peak_levels_levels2[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels2[1]);
								   document.getElementById('peak_limiter_level_out2').value = peak_levels_levels2[1];

								   var peak_limiter_limiting2 = peak_levels_levels2[2];
								   var current_led_state2 =  document.getElementById('rms_limiter_limiting2').value;
								   
								   if(channel==2){
									    set_red_led_rect(2,top1,left1);
                                        set_yellow_led_rect(2,top1,left1);
                                        set_green_led_rect(2,top1,left1); 

                                        set_red_led_rect2(2,top2,left2); 
                                        set_yellow_led_rect2(2,top2,left2); 
                                        set_green_led_rect2(2,top2,left2); 

                                       if(peak_limiter_limiting2>0 && current_led_state2==0){
                                            set_peak_limiting_led_rect(2,81,763);
                                       } else if(current_led_state2==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting2'));
                                        }
									   document.getElementById('rms_limiter_limiting2').value = peak_limiter_limiting2;
									}
								}
							}
							// ampg1_4c, ampg2_4c
							if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
							    if(key2=='In1'){
								  var peak_levels_levels1 = obj2.In1.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels1[0]);
								   document.getElementById('peak_limiter_level_in1').value = peak_levels_levels1[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels1[1]);
								   document.getElementById('peak_limiter_level_out1').value = peak_levels_levels1[1];

								   var peak_limiter_limiting1 = peak_levels_levels1[2];
								   var current_led_state1 =  document.getElementById('rms_limiter_limiting1').value;
								   
								   if(channel==1){
									    set_red_led_rect(1,top1,left1);
                                        set_yellow_led_rect(1,top1,left1);
                                        set_green_led_rect(1,top1,left1); 

                                        set_red_led_rect2(1,top2,left2); 
                                        set_yellow_led_rect2(1,top2,left2); 
                                        set_green_led_rect2(1,top2,left2); 

                                       if(peak_limiter_limiting1>0 && current_led_state1==0){
                                            set_peak_limiting_led_rect(1,81,763);
                                        } else if(current_led_state1==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting1'));
                                        }
									   document.getElementById('rms_limiter_limiting1').value = peak_limiter_limiting1;
									}
								}
								if(key2=='In2'){
									var peak_levels_levels2 = obj2.In2.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels2[0]);
								   document.getElementById('peak_limiter_level_in2').value = peak_levels_levels2[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels2[1]);
								   document.getElementById('peak_limiter_level_out2').value = peak_levels_levels2[1];

								   var peak_limiter_limiting2 = peak_levels_levels2[2];
								   var current_led_state2 =  document.getElementById('rms_limiter_limiting2').value;
								   
								   if(channel==2){
									    set_red_led_rect(2,top1,left1);
                                        set_yellow_led_rect(2,top1,left1);
                                        set_green_led_rect(2,top1,left1); 

                                        set_red_led_rect2(2,top2,left2); 
                                        set_yellow_led_rect2(2,top2,left2); 
                                        set_green_led_rect2(2,top2,left2); 

                                       if(peak_limiter_limiting2>0 && current_led_state2==0){
                                            set_peak_limiting_led_rect(2,81,763);
                                        } else if(current_led_state2==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting2'));
                                        }
									   document.getElementById('rms_limiter_limiting2').value = peak_limiter_limiting2;
									}
								}
								if(key2=='In3'){
									var peak_levels_levels3 = obj2.In3.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels3[0]);
								   document.getElementById('peak_limiter_level_in3').value = peak_levels_levels3[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels3[1]);
								   document.getElementById('peak_limiter_level_out3').value = peak_levels_levels3[1];

								   var peak_limiter_limiting3 = peak_levels_levels3[2];
								   var current_led_state3 =  document.getElementById('rms_limiter_limiting3').value;
								   
								   if(channel==3){
									    set_red_led_rect(3,top1,left1);
                                        set_yellow_led_rect(3,top1,left1);
                                        set_green_led_rect(3,top1,left1); 

                                        set_red_led_rect2(3,top2,left2); 
                                        set_yellow_led_rect2(3,top2,left2); 
                                        set_green_led_rect2(3,top2,left2); 

                                       if(peak_limiter_limiting3>0 && current_led_state3==0){
                                            set_peak_limiting_led_rect(3,81,763);
                                        } else if(current_led_state3==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting3'));
                                        }
									   document.getElementById('rms_limiter_limiting3').value = peak_limiter_limiting3;
									}
								}
								if(key2=='In4'){
									var peak_levels_levels4 = obj2.In4.PeakLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(peak_levels_levels4[0]);
								   document.getElementById('peak_limiter_level_in4').value = peak_levels_levels4[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(peak_levels_levels4[1]);
								   document.getElementById('peak_limiter_level_out4').value = peak_levels_levels4[1];

								   var peak_limiter_limiting4 = peak_levels_levels4[2];
								   var current_led_state4 =  document.getElementById('rms_limiter_limiting4').value;
											   
								   if(channel==4){
									    set_red_led_rect(4,top1,left1);
                                        set_yellow_led_rect(4,top1,left1);
                                        set_green_led_rect(4,top1,left1); 

                                        set_red_led_rect2(4,top2,left2); 
                                        set_yellow_led_rect2(4,top2,left2); 
                                        set_green_led_rect2(4,top2,left2); 

                                       if(peak_limiter_limiting4>0 && current_led_state4==0){
                                            set_peak_limiting_led_rect(4,81,763);
                                       } else if(current_led_state4==0){
                                            canvas.remove(canvas.getItemByName('peak_limiter_limiting4'));
                                        }
									   document.getElementById('rms_limiter_limiting4').value = peak_limiter_limiting4;
									}
								}
							}
						}
						
						if(key3=='RMSLimiter' && key4=='Levels' && router_view=='rms_limiter'){
							// console.log(key3, key4);
							// ampg1_2c, ampg2_2c
							if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
							   if(key2=='In1'){
								  var rms_levels_levels1 = obj2.In1.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels1[0]);
								   document.getElementById('rms_limiter_level_in1').value = rms_levels_levels1[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels1[1]);
								   document.getElementById('rms_limiter_level_out1').value = rms_levels_levels1[1];

								   var rms_limiter_limiting1 = rms_levels_levels1[2];
								   var current_led_state1 =  document.getElementById('rms_limiter_limiting1').value;
								   
								   if(channel==1){
									    set_red_led_rect(1,top1,left1);
                                        set_yellow_led_rect(1,top1,left1);
                                        set_green_led_rect(1,top1,left1); 

                                        set_red_led_rect2(1,top2,left2); 
                                        set_yellow_led_rect2(1,top2,left2); 
                                        set_green_led_rect2(1,top2,left2); 

                                       if(rms_limiter_limiting1>0 && current_led_state1==0){
                                            set_rms_limiting_led_rect(1,81,763);
                                        } else if(current_led_state1==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting1'));
                                        }
									    document.getElementById('rms_limiter_limiting1').value = rms_limiter_limiting1;
									}
								}
								if(key2=='In2'){
									var rms_levels_levels2 = obj2.In2.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels2[0]);
								   document.getElementById('rms_limiter_level_in2').value = rms_levels_levels2[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels2[1]);
								   document.getElementById('rms_limiter_level_out2').value = rms_levels_levels2[1];

								   var rms_limiter_limiting2 = rms_levels_levels2[2];
								   var current_led_state2 =  document.getElementById('rms_limiter_limiting2').value;
								   
								   if(channel==2){
									    set_red_led_rect(2,top1,left1);
                                        set_yellow_led_rect(2,top1,left1);
                                        set_green_led_rect(2,top1,left1); 

                                        set_red_led_rect2(2,top2,left2); 
                                        set_yellow_led_rect2(2,top2,left2); 
                                        set_green_led_rect2(2,top2,left2); 

                                       if(rms_limiter_limiting2>0 && current_led_state2==0){
                                            set_rms_limiting_led_rect(2,81,763);
                                         } else if(current_led_state2==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting2'));
                                        }
									   document.getElementById('rms_limiter_limiting2').value = rms_limiter_limiting2;
									}
								}
							}
							// ampg1_4c, ampg2_4c
							if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
							    if(key2=='In1'){
								  var rms_levels_levels1 = obj2.In1.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels1[0]);
								   document.getElementById('rms_limiter_level_in1').value = rms_levels_levels1[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels1[1]);
								   document.getElementById('rms_limiter_level_out1').value = rms_levels_levels1[1];

								   	var rms_limiter_limiting1 = rms_levels_levels1[2];
									var current_led_state1 =  document.getElementById('rms_limiter_limiting1').value;
								   
								   if(channel==1){
									    set_red_led_rect(1,top1,left1);
                                        set_yellow_led_rect(1,top1,left1);
                                        set_green_led_rect(1,top1,left1); 

                                        set_red_led_rect2(1,top2,left2); 
                                        set_yellow_led_rect2(1,top2,left2); 
                                        set_green_led_rect2(1,top2,left2); 

                                       if(rms_limiter_limiting1>0 && current_led_state1==0){
                                            set_rms_limiting_led_rect(1,81,763);
                                        } else if(current_led_state1==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting1'));
                                        }
									   document.getElementById('rms_limiter_limiting1').value = rms_limiter_limiting1;
									}
								}
								if(key2=='In2'){
									var rms_levels_levels2 = obj2.In2.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels2[0]);
								   document.getElementById('rms_limiter_level_in2').value = rms_levels_levels2[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels2[1]);
								   document.getElementById('rms_limiter_level_out2').value = rms_levels_levels2[1];

								   var rms_limiter_limiting2 = rms_levels_levels2[2];
								   var current_led_state2 =  document.getElementById('rms_limiter_limiting2').value;
								   
								   if(channel==2){
									    set_red_led_rect(2,top1,left1);
                                        set_yellow_led_rect(2,top1,left1);
                                        set_green_led_rect(2,top1,left1); 

                                        set_red_led_rect2(2,top2,left2); 
                                        set_yellow_led_rect2(2,top2,left2); 
                                        set_green_led_rect2(2,top2,left2); 

                                        if(rms_limiter_limiting2>0 && current_led_state2==0){
                                            set_rms_limiting_led_rect(2,81,763);
                                        } else if(current_led_state2==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting2'));
                                        }
									    document.getElementById('rms_limiter_limiting2').value = rms_limiter_limiting2;
									}
								}
								if(key2=='In3'){
									var rms_levels_levels3 = obj2.In3.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels3[0]);
								   document.getElementById('rms_limiter_level_in3').value = rms_levels_levels3[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels3[1]);
								   document.getElementById('rms_limiter_level_out3').value = rms_levels_levels3[1];

								   var rms_limiter_limiting3 = rms_levels_levels3[2];
								   var current_led_state3 =  document.getElementById('rms_limiter_limiting3').value;
								   
								   if(channel==3){
									    set_red_led_rect(3,top1,left1);
                                        set_yellow_led_rect(3,top1,left1);
                                        set_green_led_rect(3,top1,left1); 

                                        set_red_led_rect2(3,top2,left2); 
                                        set_yellow_led_rect2(3,top2,left2); 
                                        set_green_led_rect2(3,top2,left2); 

                                       if(rms_limiter_limiting3>0 && current_led_state3==0){
                                            set_rms_limiting_led_rect(3,81,763);
                                        } else if(current_led_state3==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting3'));
                                        }
									   document.getElementById('rms_limiter_limiting3').value = rms_limiter_limiting3;
									}
								}
								if(key2=='In4'){
									var rms_levels_levels4 = obj2.In4.RMSLimiter.Levels;
									var left1 = 641;
									var top1 = get_led_top_from_volume(rms_levels_levels4[0]);
								   document.getElementById('rms_limiter_level_in4').value = rms_levels_levels4[0];

									var left2 = 763;
									var top2 = get_led_top_from_volume(rms_levels_levels4[1]);
								   document.getElementById('rms_limiter_level_out4').value = rms_levels_levels4[1];

								   var rms_limiter_limiting4 = rms_levels_levels4[2];
								   var current_led_state4 =  document.getElementById('rms_limiter_limiting4').value;
								   
								   if(channel==4){
									    set_red_led_rect(4,top1,left1);
                                        set_yellow_led_rect(4,top1,left1);
                                        set_green_led_rect(4,top1,left1); 

                                        set_red_led_rect2(4,top2,left2); 
                                        set_yellow_led_rect2(4,top2,left2); 
                                        set_green_led_rect2(4,top2,left2); 

                                       if(rms_limiter_limiting4>0 && current_led_state4==0){
                                            set_rms_limiting_led_rect(4,81,763);
                                        } else if(current_led_state4==0){
                                            canvas.remove(canvas.getItemByName('rms_limiter_limiting4'));
                                        }
									   document.getElementById('rms_limiter_limiting4').value = rms_limiter_limiting4;
									}
								}
							}
						}
					}
					if(key3=='LevelIn' && ['main','noise_gate','geq','peq','limiter','signal_present','hplp','duplexer','delay','phase_invert'].indexOf(router_view)>-1){
						
						if(router_view=='noise_gate'){
							left=641;
						}
						if(router_view=='geq'){
							left=1891;
						}
						if(router_view=='peq'){
							left=1479;
						}
						if(router_view=='limiter'){
							if(channel==5 && json_type=='Mixer'){
							   left=-50; // don't show
							} else {  
							   left=541; 
							}
						}
						if(router_view=='signal_present'){
							if(channel==5){
							   left=-50; // don't show
							} else {  
							   left=541;
							}
							if(channel==5 && json_type=='nqpaxxx'){
								left=541;
							}
						}
						if(router_view=='hplp'){
							left=641;
						}
						if(router_view=='delay'){
							left=541;
						}
						if(router_view=='phase_invert'){
							left=541;
						}
							// Mixer
							if(json_type=='Mixer'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								    document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='In3' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
									}
									var lvl3 = obj2.In3.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left); 
									document.getElementById('levelIn3').value = lvl3;
								}
								if(key2=='In4' && (router_view=='main' || channel==4)){
									if(router_view=='main'){
										left = 680;
									}
									var lvl4 = obj2.In4.LevelIn;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect2(4,top4,left);
									set_yellow_led_rect2(4,top4,left);
									set_green_led_rect2(4,top4,left);
									document.getElementById('levelIn4').value = lvl4;
								}
								if(key2=='In5' && (router_view=='main' || channel==6)){
									if(router_view=='main'){
										left = 890;
									}
									var lvl6 = obj2.In5.LevelIn;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect2(6,top6,left);
									set_yellow_led_rect2(6,top6,left);
									set_green_led_rect2(6,top6,left);
									document.getElementById('levelIn6').value = lvl6;
								}
							}
							// ampg1_2c
							if(json_type=='ampg1_2c'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									if(IsDualChannel==0){
									   	left = -300; // don't show
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='In5' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
										if(IsDualChannel==0){
									   		left = 260;
										}
									}
									var lvl3 = obj2.In5.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left);
									document.getElementById('levelIn3').value = lvl3;
								}
							}
							// ampg1_4c
							if(json_type=='ampg1_4c'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									if(IsDualChannel==0){
									   	left = -300; // don't show
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='In3' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
										if(IsDualChannel==0){
									   		left = left-210;
										}
									}
								
									var lvl3 = obj2.In3.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left);
									document.getElementById('levelIn3').value = lvl3;
								}
								if(key2=='In4' && (router_view=='main' || channel==4)){
									if(router_view=='main'){
										left = 680;
										if(IsDualChannel==0){
									   		left = left-210;
										}
										if(IsDualChannel2==0){
									   		left = -300; // don't show
										}
									}
									var lvl4 = obj2.In4.LevelIn;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect2(4,top4,left);
									set_yellow_led_rect2(4,top4,left);
									set_green_led_rect2(4,top4,left);
									document.getElementById('levelIn4').value = lvl4;
								}
								if(key2=='In5' && (router_view=='main' || channel==5)){
									if(router_view=='main'){
										left = 890;
										if(IsDualChannel==0){
									   		left = left-210;
										}
										if(IsDualChannel2==0){
									   		left = left-210;
										}
									}
									var lvl5 = obj2.In5.LevelIn;
									var top5 = get_led_top_from_volume(lvl5);
									set_red_led_rect2(5,top5,left);
									set_yellow_led_rect2(5,top5,left);
									set_green_led_rect2(5,top5,left);
									document.getElementById('levelIn5').value = lvl5;
								}
								if(key2=='In6' && (router_view=='main' || channel==6)){
									if(router_view=='main'){
										left = 1100;
										if(IsDualChannel==0){
									   		left = left-210;
										}
										if(IsDualChannel2==0){
									   		left = left-210;
										}
									}
									var lvl6 = obj2.In6.LevelIn;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect2(6,top6,left);
									set_yellow_led_rect2(6,top6,left);
									set_green_led_rect2(6,top6,left);
									document.getElementById('levelIn6').value = lvl6;
								}
							}
							
							// VoIP Gen2
							if(json_type=='s810v2'){
							   if(key2=='In1' && (router_view=='main' || router_view=='duplexer')){
								   if(router_view=='main'){
										left = 50;
									}
								   if(router_view=='duplexer'){
										left = 641;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
							}
						
							// DSC01
							if(json_type=='nq-dsc01'){
							   if(key2=='In1' && (router_view=='main' || router_view=='duplexer')){
								   if(router_view=='main'){
										left = 50;
									}
								   if(router_view=='duplexer'){
										left = 641;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='Ch1' && router_view=='main'){
								   if(router_view=='main'){
										left = 260;
									}
									var lvl2 = obj2.Ch1.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
								   	document.getElementById('levelIn2').value = lvl2;
								}
							}
						
							// EDP01
							if(json_type=='edp01'){
							   if(key2=='In1' && (router_view=='main' || router_view=='duplexer')){
								   if(router_view=='main'){
										left = 50;
									}
								   if(router_view=='duplexer'){
										left = 641;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
							}
							// nqga20
							if(json_type=='nqga20'){
							   if(key2=='Ch1' && (router_view=='main' || router_view!='main' && router_view!='compressor')){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.Ch1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
							}
							// nqpaxxx
							if(json_type=='nqpaxxx'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								    document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='In3' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
									}
									var lvl3 = obj2.In3.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left); 
									document.getElementById('levelIn3').value = lvl3;
								}
								if(key2=='In4' && (router_view=='main' || channel==4)){
									if(router_view=='main'){
										left = 680;
									}
									var lvl4 = obj2.In4.LevelIn;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect2(4,top4,left);
									set_yellow_led_rect2(4,top4,left);
									set_green_led_rect2(4,top4,left);
									document.getElementById('levelIn4').value = lvl4;
								}
								if(key2=='In5' && (router_view=='main' || channel==5)){
									if(router_view=='main'){
										left = 890;
									}
									var lvl5 = obj2.In5.LevelIn;
									var top5 = get_led_top_from_volume(lvl5);
									set_red_led_rect2(5,top5,left);
									set_yellow_led_rect2(5,top5,left);
									set_green_led_rect2(5,top5,left);
									document.getElementById('levelIn5').value = lvl5;
								}
								if(key2=='In6' && (router_view=='main' || channel==6)){
									if(router_view=='main'){
										left = 1100;
									}
									var lvl6 = obj2.In6.LevelIn;
									var top6 = get_led_top_from_volume(lvl6);
									set_red_led_rect2(6,top6,left);
									set_yellow_led_rect2(6,top6,left);
									set_green_led_rect2(6,top6,left);
									document.getElementById('levelIn6').value = lvl6;
								}
							}
							// ampg2_2c
							if(json_type=='ampg2_2c'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									if(IsDualChannel==0){
									   	left = -300; // don't show
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
							}
							// ampg2_4c
							if(json_type=='ampg2_4c'){
								//console.log(key2,key3);
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								   	document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									if(IsDualChannel==0){
									   	left = -300; // don't show
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='In3' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
										if(IsDualChannel==0){
									   		left = left-210;
										}
									}
								
									var lvl3 = obj2.In3.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left);
									document.getElementById('levelIn3').value = lvl3;
								}
								if(key2=='In4' && (router_view=='main' || channel==4)){
									if(router_view=='main'){
										left = 680;
										if(IsDualChannel==0){
									   		left = left-210;
										}
										if(IsDualChannel2==0){
									   		left = -300; // don't show
										}
									}
									var lvl4 = obj2.In4.LevelIn;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect2(4,top4,left);
									set_yellow_led_rect2(4,top4,left);
									set_green_led_rect2(4,top4,left);
									document.getElementById('levelIn4').value = lvl4;
								}
							}
							// nqga400p
							if(json_type=='nqga400p'){
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								    document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='In2' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									var lvl2 = obj2.In2.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
								if(key2=='Out1' && (router_view=='main' || channel==3)){
									if(router_view=='main'){
										left = 470;
									}
									var lvl3 = obj2.Out1.LevelIn;
									var top3 = get_led_top_from_volume(lvl3);
									set_red_led_rect2(3,top3,left);
									set_yellow_led_rect2(3,top3,left);
									set_green_led_rect2(3,top3,left); 
									document.getElementById('levelIn3').value = lvl3;
								}
								if(key2=='Out2' && (router_view=='main' || channel==4)){
									if(router_view=='main'){
										left = 680;
									}
									var lvl4 = obj2.Out2.LevelIn;
									var top4 = get_led_top_from_volume(lvl4);
									set_red_led_rect2(4,top4,left);
									set_yellow_led_rect2(4,top4,left);
									set_green_led_rect2(4,top4,left);
									document.getElementById('levelIn4').value = lvl4;
								}
							}
							// nqga40
							if(json_type=='nqga40'){
							   if(key2=='In1' && (router_view=='main' || channel==1)){
								   if(router_view=='main'){
										left = 50;
									}
									var lvl1 = obj2.In1.LevelIn;
									var top1 = get_led_top_from_volume(lvl1);
									set_red_led_rect2(1,top1,left);
									set_yellow_led_rect2(1,top1,left);
									set_green_led_rect2(1,top1,left); 
								    document.getElementById('levelIn1').value = lvl1;
								}
								if(key2=='Ch1' && (router_view=='main' || channel==2)){
									if(router_view=='main'){
										left = 260;
									}
									var lvl2 = obj2.Ch1.LevelIn;
									var top2 = get_led_top_from_volume(lvl2);
									set_red_led_rect2(2,top2,left);
									set_yellow_led_rect2(2,top2,left);
									set_green_led_rect2(2,top2,left); 
									document.getElementById('levelIn2').value = lvl2;
								}
							}
						}
					if(key3=='EQP' && ['peq'].indexOf(router_view)>-1 && key4=='PlotSamples'){
						
						if(json_type=='nqga20'){
						   chartData = obj2.Ch1.EQP.PlotSamples;
						}
						if(key2=='In1'){
						   chartData = obj2.In1.EQP.PlotSamples;
						}
						if(key2=='In2'){
						   chartData = obj2.In2.EQP.PlotSamples;
						}
						if(key2=='In3'){
						   chartData = obj2.In3.EQP.PlotSamples;
						}
						if(key2=='In4'){
						   chartData = obj2.In4.EQP.PlotSamples;
						}
						if(key2=='In5'){
						   chartData = obj2.In5.EQP.PlotSamples;
						}
						if(key2=='In6'){
						   chartData = obj2.In6.EQP.PlotSamples;
						}
						if(key2=='Out1'){
						   chartData = obj2.Out1.EQP.PlotSamples;
						}
						if(key2=='Out2'){
						   chartData = obj2.Out2.EQP.PlotSamples;
						}
						if(key2=='Ch1'){
						   chartData = obj2.Ch1.EQP.PlotSamples;
						}
						// console.log(obj2);
						plotChartData();
					}
						if(key2=='AmpAB' && key3=='IsDualChannel'){
						 var IsDualChannel = obj2.AmpAB.IsDualChannel;	
						  if(IsDualChannel){
							  document.getElementById('IsDualChannel').value = 1;
						  } else {
							  document.getElementById('IsDualChannel').value = 0;
						  }
						}
					  if(key2=='AmpAB' && key3=='InProtection'){
						 var InProtection = obj2.AmpAB.InProtection;	
						  if(InProtection){
							  document.getElementById('InProtection').value = 1;
						  } else {
							  document.getElementById('InProtection').value = 0;
						  }
						}
					  if(key2=='AmpCD' && key3=='IsDualChannel'){
						 var IsDualChannel2 = obj2.AmpCD.IsDualChannel;	
						  if(IsDualChannel2){
							  document.getElementById('IsDualChannel2').value = 1;
						  } else {
							  document.getElementById('IsDualChannel2').value = 0;
						  }
						}
					  if(key2=='AmpCD' && key3=='InProtection'){
						 var InProtection2 = obj2.AmpCD.InProtection;	
						  if(InProtection2){
							  document.getElementById('InProtection2').value = 1;
						  } else {
							  document.getElementById('InProtection2').value = 0;
						  }
						}
						if(key2=='Out1' && json_type!='nqga400p'){
						 var clip1 = obj2.Out1.Clip;	
						  if(clip1){
							  document.getElementById('out1_clip').value = 1;
						  } else {
							  document.getElementById('out1_clip').value = 0;
						  }
						}
					  if(key2=='Out2' && json_type!='nqga400p'){
						 var clip2 = obj2.Out2.Clip;	
						  if(clip2){
							  document.getElementById('out2_clip').value = 1;
						  } else {
							  document.getElementById('out2_clip').value = 0;
						  }
						}
					   if(key2=='Out3'){
						 var clip3 = obj2.Out3.Clip;	
						  if(clip3){
							  document.getElementById('out3_clip').value = 1;
						  } else {
							  document.getElementById('out3_clip').value = 0;
						  }
						}
					  if(key2=='Out4'){
						 var clip4 = obj2.Out4.Clip;	
						  if(clip4){
							  document.getElementById('out4_clip').value = 1;
						  } else {
							  document.getElementById('out4_clip').value = 0;
						  }
						}
					  if(router_view=='status' && (['Out1','Out2','Out3','Out4'].indexOf(key2)>-1)){
						  var IsDualChannel = document.getElementById('IsDualChannel').value;
						  var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
						  if(key2=='Out1'){
								var clip1 = obj2.Out1.Clip;	
								canvas.remove(canvas.getItemByName('ch1_led'));
							  if(clip1){
									set_status_led('red',315,170,'ch1');
								} else {
									set_status_led('green',315,170,'ch1');
								}
						  }
						  if(key2=='Out2' && IsDualChannel==1){
								var clip2 = obj2.Out2.Clip;	
								canvas.remove(canvas.getItemByName('ch2_led'));
							  if(clip2){
									set_status_led('red',315,220,'ch2');
								} else {
									set_status_led('green',315,220,'ch2');
								}
						  }
						  if(key2=='Out3'){
								var clip3 = obj2.Out3.Clip;	
								canvas.remove(canvas.getItemByName('ch3_led'));
							  if(clip3){
									set_status_led('red',315,420,'ch3');
								} else {
									set_status_led('green',315,420,'ch3');
								}
						  }
						  if(key2=='Out4' && IsDualChannel2==1){
								var clip4 = obj2.Out4.Clip;	
								canvas.remove(canvas.getItemByName('ch4_led'));
							  if(clip4){
									set_status_led('red',315,470,'ch4');
								} else {
									set_status_led('green',315,470,'ch4');
								}
						  }
					  }
					  if(router_view=='status' && key2=='AmpAB' && (['IsDualChannel','InProtection','Temperature','IsStandingby','IsMuted'].indexOf(key3)>-1)){

						  if(key3=='IsDualChannel'){
								var IsDualChannel = obj2.AmpAB.IsDualChannel;	
								canvas.remove(canvas.getItemByName('bridged_text2'));
								if(IsDualChannel){
								   set_bridged_text2('2 Channel', 70);
								} else {
									set_bridged_text2('Bridged', 70);
								}  	
						  }
						  if(key3=='InProtection'){
								var InProtection = obj2.AmpAB.InProtection;	
								canvas.remove(canvas.getItemByName('protection_led'));
							  if(InProtection){
									set_status_led('red',230,120,'protection');
								} else {
									set_status_led('green',230,120,'protection');
								}
						  }
						   if(key3=='Temperature'){
							  var temperature = obj2.AmpAB.Temperature;	
							  document.getElementById('temperature').value = temperature;
							  var temperature_text = temperature+ '\u00b0C ';
							  var fahrenheit = Math.round((1.8 * temperature) + 32);
							  temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

								canvas.remove(canvas.getItemByName('temperature_text'));

								var top_adjustment=0;
							    var IsDualChannel = document.getElementById('IsDualChannel').value;
								if(IsDualChannel==0){
									top_adjustment = -50;
								}

								// temperature text
								var temp_text = new fabric.Textbox(String(temperature_text), {
									id: 'temperature_text',
									name: 'temperature_text',
									left: 185,
									top: 270+top_adjustment,
									width: 400,
									fontSize: 25,
									selectable: false,
									hasControls: false,
									fontFamily: 'Arial',
									fontWeight: 'bold',
									fill: 'rgba(0,0,0,1.0)',
									textAlign: 'left',
									editable: false,
								});
								canvas.add(temp_text);
						  }
						  if(key3=='IsStandingby'){
								var IsStandingby = obj2.AmpAB.IsStandingby;	
								canvas.remove(canvas.getItemByName('standby_text1'));
								if(IsStandingby){
								   	set_standby_text1('On', 535, 120);
								} else {
									set_standby_text1('Off', 535, 120);
								}  	
						  }
						  if(key3=='IsMuted'){
								var IsMuted = obj2.AmpAB.IsMuted;	
								canvas.remove(canvas.getItemByName('mute_text1'));
								if(IsMuted){
								   	set_mute_text1('On', 495, 170);
								} else {
									set_mute_text1('Off', 495, 170);
								}  	
						  }
					  }
					 if(router_view=='status' && key2=='AmpCD' && (['IsDualChannel','InProtection','Temperature','IsStandingby','IsMuted'].indexOf(key3)>-1)){
						  if(key3=='IsDualChannel'){
								var IsDualChannel = obj2.AmpCD.IsDualChannel;	
								canvas.remove(canvas.getItemByName('bridged_text4'));
								if(IsDualChannel){
								   set_bridged_text2('2 Channel', 320);
								} else {
									set_bridged_text2('Bridged', 320);
								}  	
						  }
						  if(key3=='InProtection'){
								var InProtection2 = obj2.AmpCD.InProtection;	
								canvas.remove(canvas.getItemByName('protection2_led'));
							  if(InProtection2){
									set_status_led('red',310,370,'protection2');
								} else {
									set_status_led('green',310,370,'protection2');
								}
						  }
						   if(key3=='Temperature'){
							  var temperature = obj2.AmpCD.Temperature;	
							  document.getElementById('temperature2').value = temperature;
							  var temperature_text = temperature+ '\u00b0C ';
							  var fahrenheit = Math.round((1.8 * temperature) + 32);
							  temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

								canvas.remove(canvas.getItemByName('temperature_text2'));

								var top_adjustment=0;
							   var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
								if(IsDualChannel2==0){
									top_adjustment = -50;
								}

								// temperature text
								var temp_text2 = new fabric.Textbox(String(temperature_text), {
									id: 'temperature_text2',
									name: 'temperature_text2',
									left: 185,
									top: 520+top_adjustment,
									width: 400,
									fontSize: 25,
									selectable: false,
									hasControls: false,
									fontFamily: 'Arial',
									fontWeight: 'bold',
									fill: 'rgba(0,0,0,1.0)',
									textAlign: 'left',
									editable: false,
								});
								canvas.add(temp_text2);
						  }
						  if(key3=='IsStandingby'){
								var IsStandingby = obj2.AmpCD.IsStandingby;	
								canvas.remove(canvas.getItemByName('standby_text2'));
								if(IsStandingby){
								   	set_standby_text2('On', 535, 370);
								} else {
									set_standby_text2('Off', 535, 370);
								}  	
						  }
						 if(key3=='IsMuted'){
								var IsMuted = obj2.AmpCD.IsMuted;	
								canvas.remove(canvas.getItemByName('mute_text2'));
								if(IsMuted){
								   	set_mute_text2('On', 495, 420);
								} else {
									set_mute_text2('Off', 495, 420);
								}  	
						  }
					  }
					  if(router_view=='mute' && key2=='AmpAB' && (['IsMuted'].indexOf(key3)>-1)){
						  
						  if(key3=='IsMuted'){
								var IsMuted = obj2.AmpAB.IsMuted;	
								canvas.remove(canvas.getItemByName('mute_text1'));
								if(IsMuted){
								   	set_mute_text1('On', 260, 350);
								} else {
									set_mute_text1('Off', 260, 350);
								}  	
						  }
					  }
					  if(router_view=='mute' && key2=='AmpCD' && (['IsMuted'].indexOf(key3)>-1)){
						 
						 if(key3=='IsMuted'){
								var IsMuted = obj2.AmpCD.IsMuted;	
								canvas.remove(canvas.getItemByName('mute_text2'));
								if(IsMuted){
								   	set_mute_text2('On', 470, 350);
								} else {
									set_mute_text2('Off', 470, 350);
								}  	
						  }
					  }
					  if(router_view=='standby' && key2=='AmpAB' && (['IsStandingby'].indexOf(key3)>-1)){

						  if(key3=='IsStandingby'){
								var IsStandingby = obj2.AmpAB.IsStandingby;	
								canvas.remove(canvas.getItemByName('standby_text1'));
								if(IsStandingby){
								   	set_standby_text1('On', 260, 350);
								} else {
									set_standby_text1('Off', 260, 350);
								}  	
						  }
					  }
					  if(router_view=='standby' && key2=='AmpCD' && (['IsStandingby'].indexOf(key3)>-1)){
						 
						  if(key3=='IsStandingby'){
								var IsStandingby = obj2.AmpCD.IsStandingby;	
								canvas.remove(canvas.getItemByName('standby_text2'));
								if(IsStandingby){
								   	set_standby_text2('On', 470, 350);
								} else {
									set_standby_text2('Off', 470, 350);
								}  	
						  }
					  }
					
					  if(key2=='AmpAB' && key3=='Temperature'){ // grab and save the temperature when the main view loads
							var temperature = obj2.AmpAB.Temperature;	
							document.getElementById('temperature').value = temperature;	
					  }
					  if(key2=='AmpCD' && key3=='Temperature'){ // grab and save the temperature when the main view loads
							var temperature = obj2.AmpCD.Temperature;	
							document.getElementById('temperature2').value = temperature;	
					  }
					  if(key2=='AmpAB' && key3=='IsStandingby'){ // grab and save the standby_status when the main view loads
							var IsStandingby = obj2.AmpAB.IsStandingby;	
							if(IsStandingby){
								document.getElementById('standby_status').value = 1;
							} else {
								document.getElementById('standby_status').value = 0;
							}
					  }
					  if(key2=='AmpCD' && key3=='IsStandingby'){ // grab and save the standby_status when the main view loads
							var IsStandingby2 = obj2.AmpCD.IsStandingby;	
						  	if(IsStandingby2){
								document.getElementById('standby_status2').value = 1;
							} else {
								document.getElementById('standby_status2').value = 0;
							}
					  }
					  if(key2=='AmpAB' && key3=='IsMuted'){ // grab and save the mute_status when the main view loads
							var IsMuted = obj2.AmpAB.IsMuted;	
							if(IsMuted){
								document.getElementById('mute_status').value = 1;
							} else {
								document.getElementById('mute_status').value = 0;
							}
					  }
					  if(key2=='AmpCD' && key3=='IsMuted'){ // grab and save the mute_status2 when the main view loads
							var IsMuted2 = obj2.AmpCD.IsMuted;	
						  	if(IsMuted2){
								document.getElementById('mute_status2').value = 1;
							} else {
								document.getElementById('mute_status2').value = 0;
							}
					  }
					
					  if(key2=='AmpAB' && key3=='IsDualChannel'){ // grab and save IsDualChannel when the main view loads
							var IsDualChannel = obj2.AmpAB.IsDualChannel;
							if(IsDualChannel){
								document.getElementById('IsDualChannel').value = 1;
							} else {
								document.getElementById('IsDualChannel').value = 0;
							}
							if(router_view=='main'){
								if(json_type=='ampg1_2c'){
								   get_dsp_view2();
								}
								if(json_type=='ampg1_4c'){
								   get_dsp_view3();
								}
								if(json_type=='ampg2_2c'){
								   get_dsp_view8();
								}
								if(json_type=='ampg2_4c'){
								   get_dsp_view7();
								}
							}
							if(router_view=='router'){
								get_router_view();
							}
						    if(router_view=='settings'){
								get_settings_view();
							}
						    if(router_view=='status'){
								get_status_view();
							}
						    if(router_view=='presets'){
								get_presets_view();
							}
					  }
					if(key2=='AmpCD' && key3=='IsDualChannel'){ // grab and save IsDualChannel2 when the main view loads
							var IsDualChannel = obj2.AmpCD.IsDualChannel;
							if(IsDualChannel){
								document.getElementById('IsDualChannel2').value = 1;
							} else {
								document.getElementById('IsDualChannel2').value = 0;
							}
							if(router_view=='main'){
								if(json_type=='ampg1_4c'){
								   get_dsp_view3();
								}
								if(json_type=='ampg2_4c'){
								   get_dsp_view7();
								}
							}
							if(router_view=='router'){
								get_router_view();
							}
						    if(router_view=='settings'){
								get_settings_view();
							}
						    if(router_view=='status'){
								get_status_view();
							}
							if(router_view=='presets'){
								get_presets_view();
							}
					  }
					  // Presets Selected
					  if(key3=='Preset' && key4=='Selected'){
						  if(key2=='In1'){
							var preset1 = obj2.In1.Preset.Selected; 
							  if(preset1==null){
								  document.getElementById('preset1').value = '';
								  document.getElementById('preset1_value').value = '';
							  } else {
								  var preset1_name = obj2.In1.Preset.Selected['Name']; 
								  document.getElementById('preset1').value = preset1_name;
								  document.getElementById('preset1_value').value = preset1_name;
							  }
						   }
						  if(key2=='In2'){
							  var preset2 = obj2.In2.Preset.Selected; 
							  if(preset2==null){
								  document.getElementById('preset2').value = '';
								  document.getElementById('preset2_value').value = '';
							  } else {
								  var preset2_name = obj2.In2.Preset.Selected['Name'];
								  document.getElementById('preset2').value = preset2_name;
								  document.getElementById('preset2_value').value = preset2_name;
							  }
						   }
						  if(key2=='In3'){
							  var preset3 = obj2.In3.Preset.Selected; 
							  if(preset3==null){
								  document.getElementById('preset3').value = '';
								  document.getElementById('preset3_value').value = '';
							  } else {
								  var preset3_name = obj2.In3.Preset.Selected['Name'];
								  document.getElementById('preset3').value = preset3_name;
								  document.getElementById('preset3_value').value = preset3_name;
							  }
						   }
						  if(key2=='In4'){
							  var preset4 = obj2.In4.Preset.Selected;
							  if(preset4==null){
								  document.getElementById('preset4').value = '';
								  document.getElementById('preset4_value').value = '';
							  } else {
								  var preset4_name = obj2.In4.Preset.Selected['Name'];
								  document.getElementById('preset4').value = preset4_name;
								  document.getElementById('preset4_value').value = preset4_name;
							  }
						   }
						  get_preset_list();
					  }
                      if(key2=='Preset'){
						  if(key3=='List'){
							 presetsArray = obj2.Preset.List;
							 presetsArray = presetsArray.sort(function (a, b) {
								  	let x = a.toUpperCase(), y = b.toUpperCase();
    								return x == y ? 0 : x > y ? 1 : -1;
							  });
							  update_preset_lists();
						  }
						  if(key3=='Detail'){
							 var preset_detail = obj2.Preset.Detail;
							  show_preset_detail(preset_detail);
						  }
                      }
					 // Preset Generate
					  if(key3=='Preset' && key4=='Generate'){
						  	if(key2=='In1'){ 
								var result1 = obj2.In1.Preset.Generate.Result;
								var name1 = obj2.In1.Preset.Generate.Name;
								if(result1=='ValidationSuccess'){
									get_preset_list();
									document.getElementById('preset1').value = name1;
									document.getElementById('preset1_value').value = name1;
								}
								if(result1=='ReservedName'){
								   show_preset_generate_error("*" +name1+ " is a reserved name.");
								}
							}
						  	if(key2=='In2'){ 
								var result2 = obj2.In2.Preset.Generate.Result;
								var name2 = obj2.In2.Preset.Generate.Name;
								if(result2=='ValidationSuccess'){
									get_preset_list();
									document.getElementById('preset2').value = name2;
									document.getElementById('preset2_value').value = name2;
								}
								if(result2=='ReservedName'){
								   show_preset_generate_error("*" +name2+ " is a reserved name.");
								}
							}
						  	if(key2=='In3'){ 
								var result3 = obj2.In3.Preset.Generate.Result;
								var name3 = obj2.In3.Preset.Generate.Name;
								if(result3=='ValidationSuccess'){
									get_preset_list();
									document.getElementById('preset3').value = name3;
									document.getElementById('preset3_value').value = name3;
								}
								if(result3=='ReservedName'){
								   show_preset_generate_error("*" +name3+ " is a reserved name.");
								}
							}
						  	if(key2=='In4'){ 
								var result4 = obj2.In4.Preset.Generate.Result
								var name4 = obj2.In4.Preset.Generate.Name;
								if(result4=='ValidationSuccess'){
									get_preset_list();
									document.getElementById('preset4').value = name4;
									document.getElementById('preset4_value').value = name4;
								}
								if(result4=='ReservedName'){
								   show_preset_generate_error("*" +name4+ " is a reserved name.");
								}
							}
					  }
					  if(key3=='PinkNoiseEnabled'){
						  if(key2=='In1'){
							  var pinknoise1 = obj2.In1.PinkNoiseEnabled;
							  if(pinknoise1){
									document.getElementById('pink_noise_enabled1').value = 1;
							   } else {
									document.getElementById('pink_noise_enabled1').value = 0;
							   }
						  }
						  if(key2=='In2'){
							  var pinknoise2 = obj2.In2.PinkNoiseEnabled;
							  if(pinknoise2){
									document.getElementById('pink_noise_enabled2').value = 1;
							   } else {
									document.getElementById('pink_noise_enabled2').value = 0;
							   }
						  }
						  if(key2=='In3'){
							  var pinknoise3 = obj2.In3.PinkNoiseEnabled;
							  if(pinknoise3){
									document.getElementById('pink_noise_enabled3').value = 1;
							   } else {
									document.getElementById('pink_noise_enabled3').value = 0;
							   }
						  }
						  if(key2=='In4'){
							  var pinknoise4 = obj2.In4.PinkNoiseEnabled;
							  if(pinknoise4){
									document.getElementById('pink_noise_enabled4').value = 1;
							   } else {
									document.getElementById('pink_noise_enabled4').value = 0;
							   }
						  }
					   }
					} // end of key2, key3
				  
				  // console.log(key2);
				  if(json_type=='nqpaxxx'){
					  if(key2=='Temperature'){ // grab and save the temperature when the main view loads
							var temperature = obj2.Temperature;
							document.getElementById('temperature').value = temperature;	
				  	   }
					   if(key2=='InProtection'){ // grab and save InProtection when the main view loads
							var InProtection = obj2.InProtection;
						    if(InProtection){
							 	document.getElementById('InProtection').value = '1';	
                            } else {
                                document.getElementById('InProtection').value = '0';
                            }	
				  	   }
					  if(key2=='Out6' && key3=='Clip'){ // grab and save Out6 clip when the main view loads
							var out1_clip = obj2.Out6.Clip;
						  if(out1_clip){
							 document.getElementById('out1_clip').value = '1';	
						  } else {
							  document.getElementById('out1_clip').value = '0';
						  }
				  	   }				  
					  
					 if(router_view=='status'){
					 
					  if(key2=='Temperature'){
                          var temperature = obj2.Temperature;	
                          document.getElementById('temperature').value = temperature;
                          var temperature_text = temperature+ '\u00b0C ';
                          var fahrenheit = Math.round((1.8 * temperature) + 32);
                          temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

                            canvas.remove(canvas.getItemByName('temperature_text'));

                            // temperature text
                            var temp_text = new fabric.Textbox(String(temperature_text), {
                                id: 'temperature_text',
                                name: 'temperature_text',
                                left: 265,
                                top: 170,
                                width: 400,
                                fontSize: 25,
                                selectable: false,
                                hasControls: false,
                                fontFamily: 'Arial',
                                fontWeight: 'bold',
                                fill: 'rgba(0,0,0,1.0)',
                                textAlign: 'left',
                                editable: false,
                            });
                            canvas.add(temp_text);
						}
                        if(key2=='InProtection'){
                              var InProtection = obj2.InProtection;	
                              canvas.remove(canvas.getItemByName('protection_led'));
                          if(InProtection){
                                set_status_led('red',310,70,'protection');
                            } else {
                                set_status_led('green',310,70,'protection');
                           }
                        }
                        if(key2=='Out6'){
                            var clip1 = obj2.Out6.Clip;	
                            canvas.remove(canvas.getItemByName('ch1_led'));
                          if(clip1){
                                set_status_led('red',272,120,'ch1');
                          } else {
                                set_status_led('green',272,120,'ch1');
                          }
                       }
				  	 }
				  }
			  }
			}
		};
		
		socket.onclose  = function(msg) { 
			//console.log(msg);
			
			set_disabled_view();
		};
		
		socket.onerror  = function(msg) { 
			//console.log(msg);
			
			set_disabled_view();
		};
	}
	catch(ex){ 
		console.log(ex); 
	}
}
	
function set_volume_value(channel, volume){
	
	var channel_id = 'slider' + channel;
	var msg;
	var slider = document.getElementById(channel_id);
	slider.value = volume;
	var json_type = document.getElementById('json_type').value;
	if(json_type=='Mixer'){
	   	if(channel==5){
		  	msg = '{ "'+json_type+'": { "Out' + channel +'": { "Volume": ' + volume + ' } } }';
	   	} else if(channel==6){
			msg = '{ "'+json_type+'": { "In5": { "Volume": ' + volume + ' } } }'; 
		} else {
			msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
		}
	 }
	if(json_type=='ampg1_2c'){
	   	if(channel==3){
			msg = '{ "'+json_type+'": { "In5": { "Volume": ' + volume + ' } } }';
	   	} else if(channel==4){
			msg = '{ "'+json_type+'": { "Out1": { "Volume": ' + volume + ' } } }';	
		} else if(channel==5){
			msg = '{ "'+json_type+'": { "Out2": { "Volume": ' + volume + ' } } }';
		} else {
			msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
		}
	 }
	if(json_type=='ampg1_4c'){	  
		msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='s810v2'){	  
		msg = '{ "'+json_type+'": { "In1": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='edp01'){	  
		msg = '{ "'+json_type+'": { "In1": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='nqga20'){	  
		msg = '{ "'+json_type+'": { "Ch1": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='nqpaxxx'){
		if(channel==7){
			msg = '{ "'+json_type+'": { "Out5": { "Volume": ' + volume + ' } } }';	
		} else if(channel==8){
			msg = '{ "'+json_type+'": { "Out6": { "Volume": ' + volume + ' } } }';
		} else {
			msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
		}
	 }
	if(json_type=='ampg2_2c'){	  
		msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='ampg2_4c'){	  
		msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
	 }
	if(json_type=='nqga400p'){	
		if(channel==1 || channel==2){
		   msg = '{ "'+json_type+'": { "In' + channel +'": { "Volume": ' + volume + ' } } }';
		}
		if(channel==3){
		   msg = '{ "'+json_type+'": { "Out1": { "Volume": ' + volume + ' } } }';
		}
		if(channel==4){
		   msg = '{ "'+json_type+'": { "Out2": { "Volume": ' + volume + ' } } }';
		}
	 }
	if(json_type=='nqga40'){	
		if(channel==1){
		   msg = '{ "'+json_type+'": { "In1": { "Volume": ' + volume + ' } } }';
		}
		if(channel==2){
		   msg = '{ "'+json_type+'": { "Ch1": { "Volume": ' + volume + ' } } }';
		}
	 }
	if(json_type=='nq-dsc01'){	
		if(channel==1){
		   msg = '{ "'+json_type+'": { "In1": { "Volume": ' + volume + ' } } }';
		}
		if(channel==2){
		   msg = '{ "'+json_type+'": { "Ch1": { "Volume": ' + volume + ' } } }';
		}
	 }
	socket.send(msg);
	update_save_settings_button();
}
	
function set_router_volume(parameter, volume){
	var json_type = document.getElementById('json_type').value;	
	var msg = '{ "'+json_type+'": { "Router": { "'+ parameter +'": ' + volume + ' } } }';
	socket.send(msg);
	update_save_settings_button();
}
	
function start_levels(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "In2": { "Level": null }, "In3": { "Level": null }, "In4": { "Level": null }, "In5": { "Level": null }, "Out5": { "Level": null } } }';
	}
	if(json_type=='s810v2'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null } } }';
	}
	if(json_type=='nq-dsc01'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "Ch1": { "Level": null } } }';
	}
	if(json_type=='edp01'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Level": null } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "In2": { "Level": null }, "In3": { "Level": null }, "In4": { "Level": null }, "In5": { "Level": null }, "In6": { "Level": null }, "Out5": { "Level": null },  "Out6": { "Level": null } } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "In2": { "Level": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "In2": { "Level": null }, "In3": { "Level": null }, "In4": { "Level": null } } }';
	}
	if(json_type=='nqga400p'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "In2": { "Level": null }, "Out1": { "Level": null }, "Out2": { "Level": null } } }';
	}
	if(json_type=='nqga40'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Level": null }, "Ch1": { "Level": null } } }';
	}
	socket.send(msg);
}
	
function start_signals(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null } }, "In2": { "Signal": { "Detected": null } }, "In3": { "Signal": { "Detected": null } }, "In4": { "Signal": { "Detected": null } }, "In5": { "Signal": { "Detected": null } }, "Out5": { "Signal": { "Detected": null } } } }';
	 }
	if(json_type=='nqga20'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Signal": { "Detected": null } } } }';
	 }
	if(json_type=='nqpaxxx'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null } }, "In2": { "Signal": { "Detected": null } }, "In3": { "Signal": { "Detected": null } }, "In4": { "Signal": { "Detected": null } }, "In5": { "Signal": { "Detected": null } }, "In6": { "Signal": { "Detected": null } }, "Out5": { "Signal": { "Detected": null } }, "Out6": { "Signal": { "Detected": null } } } }';
	 }
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null, "IsNetwork": null } }, "In2": { "Signal": { "Detected": null, "IsNetwork": null } } } }';
	 }
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null, "IsNetwork": null } }, "In2": { "Signal": { "Detected": null, "IsNetwork": null } }, "In3": { "Signal": { "Detected": null, "IsNetwork": null } }, "In4": { "Signal": { "Detected": null, "IsNetwork": null } } } }';
	 }
	if(json_type=='nqga400p'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null } }, "In2": { "Signal": { "Detected": null } }, "Out1": { "Signal": { "Detected": null } }, "Out2": { "Signal": { "Detected": null } } } }';
	 }
	if(json_type=='nqga40'){
	   	msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Signal": { "Detected": null } }, "Ch1": { "Signal": { "Detected": null } } } }';
	 }
	socket.send(msg);
}
	
function start_clips(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Clip": null }, "In2": { "Clip": null }, "In3": { "Clip": null }, "In4": { "Clip": null }, "In5": { "Clip": null }, "Out5": { "Clip": null } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Clip": null } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Clip": null }, "In2": { "Clip": null }, "In3": { "Clip": null }, "In4": { "Clip": null }, "In5": { "Clip": null }, "In6": { "Clip": null }, "Out5": { "Clip": null }, "Out6": { "Clip": null } } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Clip": null }, "In2": { "Clip": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Clip": null }, "In2": { "Clip": null }, "In3": { "Clip": null }, "In4": { "Clip": null } } }';
	}
	if(json_type=='nqga40'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Clip": null }, "Ch1": { "Clip": null } } }';
	}
	socket.send(msg);
}
	
function start_limiting(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Limiter": { "Limiting": null } }, "In2": { "Limiter": { "Limiting": null } }, "In3": { "Limiter": { "Limiting": null } }, "In4": { "Limiter": { "Limiting": null } }, "In5": { "Limiter": { "Limiting": null } }, "Out5": { "Limiter": { "Limiting": null } } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Limiter": { "Limiting": null } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Limiter": { "Limiting": null } }, "In2": { "Limiter": { "Limiting": null } }, "In3": { "Limiter": { "Limiting": null } }, "In4": { "Limiter": { "Limiting": null } }, "In5": { "Limiter": { "Limiting": null } }, "In6": { "Limiter": { "Limiting": null } }, "Out5": { "Limiter": { "Limiting": null } }, "Out6": { "Limiter": { "Limiting": null } } } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Limiter": { "Limiting": null } }, "In2": { "Limiter": { "Limiting": null } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Limiter": { "Limiting": null } }, "In2": { "Limiter": { "Limiting": null } }, "In3": { "Limiter": { "Limiting": null } },  "In4": { "Limiter": { "Limiting": null } } } }';
	}
	if(json_type=='nqga400p'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Limiter": { "Limiting": null } }, "In2": { "Limiter": { "Limiting": null  } } } }';
	}
	if(json_type=='nqga40'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Limiter": { "Limiting": null } } } }';
	}
	socket.send(msg);
}

function start_peak_limiting(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "PeakLimiter": { "Levels": null } }, "In2": { "PeakLimiter": { "Levels": null } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "PeakLimiter": { "Levels": null } }, "In2": { "PeakLimiter": { "Levels": null } }, "In3": { "PeakLimiter": { "Levels": null } },  "In4": { "PeakLimiter": { "Levels": null } } } }';
	}
	socket.send(msg);
}
	
function start_rms_limiting(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "RMSLimiter": { "Levels": null } }, "In2": { "RMSLimiter": { "Levels": null } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "RMSLimiter": { "Levels": null } }, "In2": { "RMSLimiter": { "Levels": null } }, "In3": { "RMSLimiter": { "Levels": null } },  "In4": { "RMSLimiter": { "Levels": null } } } }';
	}
	socket.send(msg);
}
	
function start_compressor_levels(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Compressor": { "Levels": null } }, "In2": { "Compressor": { "Levels": null } }, "In3": { "Compressor": { "Levels": null } }, "In4": { "Compressor": { "Levels": null } },  "In5": { "Compressor": { "Levels": null } } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Compressor": { "Levels": null } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Compressor": { "Levels": null } }, "In2": { "Compressor": { "Levels": null } }, "In3": { "Compressor": { "Levels": null } }, "In4": { "Compressor": { "Levels": null } },  "In5": { "Compressor": { "Levels": null } }, "In6": { "Compressor": { "Levels": null } } } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Compressor": { "Levels": null } }, "In2": { "Compressor": { "Levels": null } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "Compressor": { "Levels": null } }, "In2": { "Compressor": { "Levels": null } }, "In3": { "Compressor": { "Levels": null } }, "In4": { "Compressor": { "Levels": null } } } }';
	}
	if(json_type=='nqga40'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "Compressor": { "Levels": null } } } }';
	}
	socket.send(msg);
}
	
function start_input_levels(){
	var json_type = document.getElementById('json_type').value;	
	var msg;
	if(json_type=='Mixer'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "In2": { "LevelIn": null }, "In3": { "LevelIn": null },  "In4": { "LevelIn": null }, "In5": { "LevelIn": null } } }';
	}
	if(json_type=='s810v2'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null } } }';
	}
	if(json_type=='nq-dsc01'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "Ch1": { "LevelIn": null } } }';
	}
	if(json_type=='edp01'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "Interval": 100, "'+json_type+'": { "Ch1": { "LevelIn": null } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "In2": { "LevelIn": null }, "In3": { "LevelIn": null },  "In4": { "LevelIn": null }, "In5": { "LevelIn": null }, "In6": { "LevelIn": null } } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "In2": { "LevelIn": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "In2": { "LevelIn": null }, "In3": { "LevelIn": null }, "In4": { "LevelIn": null } } }';
	}
	if(json_type=='nqga400p'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "In2": { "LevelIn": null }, "Out1": { "LevelIn": null }, "Out2": { "LevelIn": null } } }';
	}
	if(json_type=='nqga40'){
		msg = '{ "Interval": 100, "'+json_type+'": { "In1": { "LevelIn": null }, "Ch1": { "LevelIn": null } } }';
	}
	socket.send(msg);
}
	
function start_amp_status(){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='nqpaxxx'){
		msg = '{ "Interval": "async", "'+json_type+'": { "InProtection": null } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": "async", "'+json_type+'": { "AmpAB":{ "IsDualChannel": null, "InProtection": null }, "Out1": { "Clip": null }, "Out2": { "Clip": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": "async", "'+json_type+'": { "AmpAB":{ "IsDualChannel": null, "InProtection": null }, "Out1": { "Clip": null }, "Out2": { "Clip": null }, "AmpCD":{ "IsDualChannel": null, "InProtection": null }, "Out3": { "Clip": null }, "Out4": { "Clip": null } } }';
	}
	socket.send(msg);
}
	
function start_temperature_status(){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='nqpaxxx'){
	   msg = '{ "Interval": 1000, "'+json_type+'": { "Temperature": null } }';
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 1000, "'+json_type+'": { "AmpAB":{ "Temperature": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 1000, "'+json_type+'": { "AmpAB":{ "Temperature": null }, "AmpCD":{ "Temperature": null } } }';
	}
	socket.send(msg);
}
function start_standby_mute_status(){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "AmpAB":{ "IsStandingby": null , "IsMuted": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "Interval": 100, "'+json_type+'": { "AmpAB":{ "IsStandingby": null,  "IsMuted": null  }, "AmpCD":{ "IsStandingby": null,  "IsMuted": null  } } }';
	}
	socket.send(msg);
}
	
function set_peq_data(channel,parameter,input_type,data){
	
	var json_type = document.getElementById('json_type').value;	
	var variable;
	var msg;
	if(input_type=='q'){
	   variable='Q';
		if(data<0.1){
		   data=0.1;
		}
	}
	if(input_type=='freq'){
	   variable='Frequency';
	}
	if(input_type=='fader'){
	   variable='Boost';
	}
	if(json_type=='Mixer'){
		if(channel==6){
		   msg = '{ "'+json_type+'": { "In5": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} else {
		   msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
		if(channel==3){
		   msg = '{ "'+json_type+'": { "In5": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='nqga20' || json_type=='nqga40'){
		msg = '{ "'+json_type+'": { "Ch1": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='nqga400p'){
		if(channel==3){
		   msg = '{ "'+json_type+'": { "Out1": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} 
		if(channel==4){
		   msg = '{ "'+json_type+'": { "Out2": { "EQP": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} 
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_geq_data(channel,parameter,input_type,data){
	var json_type = document.getElementById('json_type').value;	
	var variable;
	var msg;
	if(input_type=='q'){
	   variable='Q';
	}
	if(input_type=='freq'){
	   variable='Frequency';
	}
	if(input_type=='fader'){
	   variable='Boost';
	}
	if(json_type=='Mixer'){
		if(channel==6){
			msg = '{ "'+json_type+'": { "In5": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
		if(channel==3){
		   msg = '{ "'+json_type+'": { "In5": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+parameter +'": { "'+variable+'": '+data+' } } } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_compressor_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='Mixer'){
		if(channel==6){
		 	msg = '{ "'+json_type+'": { "In5": { "Compressor": { "'+parameter+'": '+data+' } } } }';
		} else {
		   	msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
		if(channel==3){
			msg = '{ "'+json_type+'": { "In5": { "Compressor": { "'+parameter+'": '+data+' } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "'+json_type+'": { "Ch1": { "Compressor": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Compressor": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga40'){
		if(channel==2){
			msg = '{ "'+json_type+'": { "Ch1": { "Compressor": { "'+parameter+'": '+data+' } } } }';
		}
	}
	socket.send(msg);	
	update_save_settings_button();
}
function set_limiter_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='Mixer'){
	   	if(channel==5){
		  	msg = '{ "'+json_type+'": { "Out'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		} else if(channel==6){
			msg = '{ "'+json_type+'": { "In5": { "Limiter": { "'+parameter+'": '+data+' } } } }';  
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
	   if(channel==3){
		  	msg = '{ "'+json_type+'": { "In5": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	   	} else if(channel==4){
			msg = '{ "'+json_type+'": { "Out1": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		} else if(channel==5){
			msg = '{ "'+json_type+'": { "Out2": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "'+json_type+'": { "Ch1": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqpaxxx'){
	   	if(channel==7){
		  	msg = '{ "'+json_type+'": { "Out5": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		} else if(channel==8){
			msg = '{ "'+json_type+'": { "Out6": { "Limiter": { "'+parameter+'": '+data+' } } } }';  
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga400p'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Limiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga40'){
		if(channel==1){
		   msg = '{ "'+json_type+'": { "In1": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		}
		if(channel==2){
		   msg = '{ "'+json_type+'": { "Ch1": { "Limiter": { "'+parameter+'": '+data+' } } } }';
		}
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_noise_gate_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='Mixer'){
		if(channel==6){
		   	msg = '{ "'+json_type+'": { "In5": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
		} else {
		   	msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
		if(channel==3){
	   		msg = '{ "'+json_type+'": { "In5": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqpaxxx'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "'+parameter+'": '+data+' } } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_signal_present_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='Mixer'){
	   if(channel==5){
		   	msg = '{ "'+json_type+'": { "Out'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
	   } else if(channel==6){
			msg = '{ "'+json_type+'": { "In5": { "Signal": { "'+parameter+'": '+data+' } } } }'; 
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_2c'){
		if(channel==3){
	   		msg = '{ "'+json_type+'": { "In5": { "Signal": { "'+parameter+'": '+data+' } } } }';
		} else if(channel==4){
			msg = '{ "'+json_type+'": { "Out1": { "Signal": { "'+parameter+'": '+data+' } } } }'; 
		} else if(channel==5){
			msg = '{ "'+json_type+'": { "Out2": { "Signal": { "'+parameter+'": '+data+' } } } }'; 
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg1_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga20'){
		msg = '{ "'+json_type+'": { "Ch'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqpaxxx'){
		if(channel==7){
	   		msg = '{ "'+json_type+'": { "Out5": { "Signal": { "'+parameter+'": '+data+' } } } }';
		} else if(channel==8){
			msg = '{ "'+json_type+'": { "Out6": { "Signal": { "'+parameter+'": '+data+' } } } }'; 
		} else {
			msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='nqga400p'){
		if(channel==1 || channel==2){
	   		msg = '{ "'+json_type+'": { "In'+ channel +'": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
		if(channel==3){
	   		msg = '{ "'+json_type+'": { "Out1": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
		if(channel==4){
	   		msg = '{ "'+json_type+'": { "Out2": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
	}
	if(json_type=='nqga40'){
		if(channel==1){
	   		msg = '{ "'+json_type+'": { "In1": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
		if(channel==2){
	   		msg = '{ "'+json_type+'": { "Ch1": { "Signal": { "'+parameter+'": '+data+' } } } }';
		}
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_ducker_data(parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Ducker": { "'+parameter+'": '+data+' } } }';
	socket.send(msg);	
	update_save_settings_button();
}
function set_hplp_data(channel,parameter,data,type2){
			
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='Mixer' && channel==6){
	   channel=5;
	}
	if(json_type=='ampg1_2c' && channel==3){
	   channel=5;
	}
	
	var channel_name = '';
	
	if(json_type=='nqga20' || json_type=='nqga40'){
	   channel_name = 'Ch1';
	} else if(json_type=='nqga400p'){
		if(channel==3){
		   	channel_name = 'Out1';
		}
		if(channel==4){
			channel_name = 'Out2';
		} 
	} else {
	   channel_name = 'In'+ channel;
	}
	
	if(parameter=='Frequency'){
	   	msg = '{ "'+json_type+'": { "'+ channel_name +'": { "'+type2.toUpperCase()+'": { "'+parameter+'": '+data+' } } } }';
	 } else {
		msg = '{ "'+json_type+'": { "'+ channel_name +'": { "'+type2.toUpperCase()+'": { "'+parameter+'": "'+data+'" } } } }'; 
	 }
	socket.send(msg);
	update_save_settings_button();
}
function set_peak_limiter_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "PeakLimiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "PeakLimiter": { "'+parameter+'": '+data+' } } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_rms_limiter_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "RMSLimiter": { "'+parameter+'": '+data+' } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In'+ channel +'": { "RMSLimiter": { "'+parameter+'": '+data+' } } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function hplp_type_changed(channel,type2){
    var data = document.getElementById(type2+'_type'+channel).value;
    set_hplp_data(channel,'Type',data,type2);
}
function set_main_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg = '';
	if(parameter=='SignalGain' && (json_type=='ampg1_2c' || json_type=='ampg1_4c')){
	   msg = '{ "'+json_type+'": { "'+parameter+channel+'": '+data+' } }';
	} else {
	   msg = '{ "'+json_type+'": { "In'+ channel +'": { "'+parameter+'": '+data+' } } }';
	}
	socket.send(msg);	
	update_save_settings_button();
}
function set_duplexer_compressor_data(data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Compressor": { "Threshold": '+data+' } } }';
	socket.send(msg);
	update_save_settings_button();
}
function set_duplexer_noise_gate_data(data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Speaker Threshold": { "Volume": '+data+' } } }';
	if(json_type=='edp01'){
	   msg = '{ "'+json_type+'": { "Noise Gate": { "Threshold": '+data+' } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function set_duplexer_talkback_threshold_data(data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "In1" : { "Talkback Threshold": { "Volume": '+data+' } } } }';
	socket.send(msg);
	update_save_settings_button();
}
function set_duplexer_talkback_decay_data(data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "In1" : { "Peak Envelope": { "Decay": '+data+' } } } }';
	socket.send(msg);
	update_save_settings_button();
}
function set_outputs_data(data, parameter){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Ch1": { "'+parameter+'": { "Volume": '+data+' } } } }';
	socket.send(msg);
	update_save_settings_button();
}
function set_delay_data(channel,parameter,data){
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Delay": '+data+' } } }';
	socket.send(msg);	
	update_save_settings_button();
}
function set_standby_data(amp,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(amp=='ab'){
	   msg = '{ "'+json_type+'": { "AmpAB": { "StandbySignal": { "Threshold": '+data+'  } } } }';
	}
	if(amp=='cd'){
	   msg = '{ "'+json_type+'": { "AmpCD": { "StandbySignal": { "Threshold": '+data+'  } } } }';
	}
	socket.send(msg);	
	update_save_settings_button();
}
function set_mute_data(amp,data){
	var json_type = document.getElementById('json_type').value;
	var msg;
	if(amp=='ab'){
	   msg = '{ "'+json_type+'": { "AmpAB": { "MuteSignal": { "Threshold": '+data+'  } } } }';
	}
	if(amp=='cd'){
	   msg = '{ "'+json_type+'": { "AmpCD": { "MuteSignal": { "Threshold": '+data+'  } } } }';
	}
	socket.send(msg);
	update_save_settings_button();
}
function get_chart_data(channel){
	var json_type = document.getElementById('json_type').value;
	var router_view = document.getElementById('router_view').value;
	var msg;
	if(channel==3 && json_type=='ampg1_2c'){
	   channel=5;
	}
	if(router_view=='peq' && (['Mixer','ampg1_2c','ampg1_4c','nqga20','nqpaxxx','ampg2_2c','ampg2_4c','nqga400p','nqga40'].indexOf(json_type)>-1)){
	  	if(channel==6 && json_type=='Mixer'){
			msg = '{ "'+json_type+'": { "In5": { "EQP": { "PlotSamples" : 1000 } } } }';
		} else if(json_type=='nqga20' || json_type=='nqga40'){
			msg = '{ "'+json_type+'": { "Ch1": { "EQP": { "PlotSamples" : 1000 } } } }';
		} else if(json_type=='nqga400p'){
			if(channel==3){
			   msg = '{ "'+json_type+'": { "Out1": { "EQP": { "PlotSamples" : 1000 } } } }';
			}
			if(channel==4){
			   msg = '{ "'+json_type+'": { "Out2": { "EQP": { "PlotSamples" : 1000 } } } }';
			}
		} else {
			msg = '{ "'+json_type+'": { "In'+channel+'": { "EQP": { "PlotSamples" : 1000 } } } }';
		}	
	}
	socket.send(msg);
}	
function update_save_settings_button(){
	$("#saveSettingsButton").removeClass("btn-primary").addClass("btn-success");
	
	var router_view = document.getElementById('router_view').value;
	var json_type = document.getElementById('json_type').value;
	var channel = document.getElementById('channel').value;
	if(router_view=='peq' && (['Mixer','ampg1_2c','ampg1_4c','nqga20','nqpaxxx','ampg2_2c','ampg2_4c','nqga400p','nqga40'].indexOf(json_type)>-1)){
	   get_peq_view(channel);
	}
	if(['ampg1_2c','ampg1_4c','ampg2_2c','ampg2_4c'].indexOf(json_type)>-1){ // dsp settings changed, reset presets
		
		get_presets();
	}
}
function plotChartData(){
	var min_f = Math.log10(20);
    var max_f = Math.log10(20000);
    var range = max_f - min_f;
	var width_px = 1305; // width of the data in the chart
		
	if(chartData){
		
		for (var i = 0; i < chartData.length; i++) {
			
			var frequency = chartData[i][0];
    		var position_px = (Math.log10(frequency) - min_f) / range * width_px;	
			var top = 210+chartData[i][1]*-5.0; // negative value adjusts the height of the data in the chart
			var left = position_px+50;
					
			if(chartData[i][1]>28 || chartData[i][1]<-26){
			   // prevent data outside the chart
			} else {
                canvas.add(new fabric.Circle({
                  name: 'plotPoint'+i,
                  type: 'plotPoint',
                  radius: 2, 
                  fill:  'rgba(66,139,202,1.0)', // bootstrap blue
                  left: left, 
                  top: top,
                  editable: false,
                  selectable: false,
                  hasControls: false,
                }));
			}
		}
	}
}
				
// ************************
// Start Canvas code 	
// ************************
		
  canvas = this.__canvas = new fabric.Canvas('c');
	canvas.hoverCursor = 'pointer'; // hand pointer
	canvas.selection = false; // disable group selection
	
  chart_canvas = this.__canvas = new fabric.Canvas('chart_canvas');
	chart_canvas.hoverCursor = 'pointer'; // hand pointer
	chart_canvas.selection = false; // disable group selection
	// selection settings
	fabric.Canvas.prototype.set({
	 selectionColor : 'rgba(0,0,0,0.2)',
	 selectionBorderColor :  'rgba(0, 0, 0, 0.0)',
	 selectionLineWidth : 10,
	 selectionDashArray : [3,3],
	 preserveObjectStacking : true,
	});
	
  var _isDragging = false;
  var _isMouseDown = false;
	
	//trigger level1 event handler
	canvas.trigger("custom:level1event", {
		id: 'level1_data',
		data: '24',	
	});
		
	//handler for moving objects on canvas
	var moveHandler = function (evt) {
		var obj = evt.target;		
		//console.log(movingObject.get('id'));
		_isDragging = _isMouseDown;
		
		//console.log(obj.canvas);
		var moveEvent = evt.e;
		var touchEvent;
		var clientX;
		var clientY;
		var offsetX;
		var offsetY;
		
		//console.log(evt.e);
		//console.log(evt.e.touches[0]);
		
		// check for touch event
		if(evt.e.touches){
		   touchEvent = evt.e.touches[0];
			//console.log(touchEvent.clientX, touchEvent.clientY);
			clientX = touchEvent.clientX;
			clientY = touchEvent.clientY
			var offsetTop = touchEvent.target.parentElement.offsetTop;
			offsetY =  clientY-offsetTop
		} else {
			//console.log(moveEvent.clientX, moveEvent.clientY);
			clientX = moveEvent.clientX;
			clientY = moveEvent.clientY;
			offsetX = moveEvent.offsetX;
			offsetY = moveEvent.offsetY;
		}
		
		// track mouse inside and outside canvas
		var inside_canvas;
		if(clientX<obj.canvas._offset.left || clientX>obj.canvas.width+obj.canvas._offset.left-1 || clientY<obj.canvas._offset.top || clientY>obj.canvas.height+obj.canvas._offset.top-1){
			inside_canvas=0;
		 } else {
			 inside_canvas=1;
		 }
		
		var object_id = obj.get('id');
		var channel = document.getElementById('channel').value;
		var volume = 0;
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
			   
	   if(obj.type== 'level_fader'){
			volume = get_volume_from_top(obj.top);
			if(obj.top<65){
			   obj.set({top:65});
			} 
			if(obj.top>449){
			   obj.set({top:449});
			}
		   
		   var left1;
		   var left2;
		   var left3;
		   var left4;
		   var left5;
		   var left6;
		   var left7;
		   var left8;
		   
		   if(json_type=='Mixer'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   	left4=740;
			   	left5=1095;
			   	left6=950;
			}
		   if(json_type=='ampg1_2c'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   
			   if(IsDualChannel==0){
				  left3=320;
				}
			}
		   if(json_type=='ampg1_4c'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   	left4=740;
			   	left5=950;
			   	left6=1160;
			   if(IsDualChannel==0){
				  left3=left3-210;
				  left5=left5-210;
				  left6=left6-210;
				}
			   if(IsDualChannel2==0){
				  left5=left5-210;
				  left6=left6-210;
				}
			}
		    if(json_type=='s810v2'){
			  	left1=110;
			}
		    if(json_type=='nq-dsc01'){
			  	left1=110;
				left2=320;
			}
		    if(json_type=='edp01'){
			  	left1=110;
			}
		    if(json_type=='nqga20'){
			  	left1=110;
			}
		   if(json_type=='nqpaxxx'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   	left4=740;
			   	left5=950;
			   	left6=1160;
			   	left7=1305;
			   	left8=1455;
			}
		   if(json_type=='ampg2_2c'){
			  	left1=110;
			   	left2=320;
			}
		    if(json_type=='ampg2_4c'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   	left4=740;
			   if(IsDualChannel==0){
				  left3=left3-210;
				   if(IsDualChannel2==1){
					  left4=left4-210;
					}
				}
			}
		    if(json_type=='nqga400p'){
			  	left1=110;
			   	left2=320;
			   	left3=530;
			   	left4=740;
			}
		   if(json_type=='nqga40'){
			  	left1=110;
			   	left2=320;
			}
			if(obj.channel == '1'){
				obj.set({left:left1});
				canvas.remove(canvas.getItemByName('level1_text'));
				set_volume_text(1,volume,obj.top);
			}
			if(obj.channel == '2'){
				obj.set({left:left2});
				canvas.remove(canvas.getItemByName('level2_text'));
				set_volume_text(2,volume,obj.top);
			}
			if(obj.channel == '3'){
				obj.set({left:left3});
				canvas.remove(canvas.getItemByName('level3_text'));
				set_volume_text(3,volume,obj.top);
			}
			if(obj.channel == '4'){
				obj.set({left:left4});
				canvas.remove(canvas.getItemByName('level4_text'));
				set_volume_text(4,volume,obj.top);
			}
		   if(obj.channel == '5'){
				obj.set({left:left5});
				canvas.remove(canvas.getItemByName('level5_text'));
				set_volume_text(5,volume,obj.top);
			}
		   if(obj.channel == '6'){
				obj.set({left:left6});
				canvas.remove(canvas.getItemByName('level6_text'));
				set_volume_text(6,volume,obj.top);
			}
		    if(obj.channel == '7'){
				obj.set({left:left7});
				canvas.remove(canvas.getItemByName('level7_text'));
				set_volume_text(7,volume,obj.top);
			}
		    if(obj.channel == '8'){
				obj.set({left:left8});
				canvas.remove(canvas.getItemByName('level8_text'));
				set_volume_text(8,volume,obj.top);
			}
		}
		 if(obj.type== 'router_touch_input' && inside_canvas==1){
			 
			 var data;
			if(json_type=='Mixer'){
				data = get_router_data(object_id); 
			}
			  if(json_type=='nqpaxxx'){
				data = get_router_data6(object_id); 
			}
			if(json_type=='ampg1_2c'){
				data = get_router_data2(object_id); 
			}
			if(json_type=='ampg1_4c'){
				data = get_router_data3(object_id); 
			}
			if(json_type=='ampg2_2c'){
				data = get_router_data5(object_id); 
			}
			if(json_type=='ampg2_4c'){
				data = get_router_data4(object_id); 
			}
			 
			var name = data['name'];
			var name2 = data['name2'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];
			 
			if(IsDualChannel==0 && ["ampg1_2c","ampg1_4c","ampg2_2c","ampg2_4c"].includes(json_type) && ["output3","cg13","cg23","cg33","cg43","output4","cg14","cg24","cg34","cg44"].includes(name)){
				indicator_left -= 200;
				text_left -= 200;
			}

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('router_'+name).value;

			 if(input=='-144'){
				input=0;
			 }
			 
			 var new_value;
			if(parameter=='gain'){
				new_value = -150+((parseInt(input))*10.714)+diff;// Min: 0 Max:28
			} else {
				new_value = (input*10)+diff;	
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}
			 
			var text;
			if(parameter=='gain'){
				text = Math.round(((new_value+150)/10.714)); // Min: 0 Max:28	 
			} else {
				text = Math.round(new_value/10);
			}

			canvas.getItemByName('router_indicator_'+name).set('angle',new_value);

			canvas.remove(canvas.getItemByName('router_'+name+'_text'));

			 var router_input1ext = new fabric.Textbox(String(text), {
				id: 'router_'+name+'_text',
				name: 'router_'+name+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});

			canvas.add(router_input1ext);

			router_touch_temp=text;
			 
			if(parameter!='gain'){
				// set enable button on
				document.getElementById('router_enable_'+name).value =1;
				canvas.getItemByName('enabled_'+ name +'_off').set('opacity', 0.0);
				canvas.getItemByName('enabled_'+ name +'_on').set('opacity', 1.0);
			}
		}
		
		if(obj.type== 'geq_fader'){
			volume = get_geq_volume_from_top(obj.top);
			var name = obj.name;
			var parameter = obj.parameter;

			if(obj.top<161){ obj.set({top:161}); }
			if(obj.top>532){ obj.set({top:532}); }

			if(parameter=='GEQ25HZ'){ obj.set({left:115}); }
			if(parameter=='GEQ40HZ'){ obj.set({left:219}); }
			if(parameter=='GEQ63HZ'){ obj.set({left:324}); }
			if(parameter=='GEQ100HZ'){ obj.set({left:428}); }
			if(parameter=='GEQ160HZ'){ obj.set({left:533}); }
			if(parameter=='GEQ250HZ'){ obj.set({left:639}); }
			if(parameter=='GEQ400HZ'){ obj.set({left:744}); }
			if(parameter=='GEQ630HZ'){ obj.set({left:849}); }
			if(parameter=='GEQ1000HZ'){ obj.set({left:954}); }
			if(parameter=='GEQ1600HZ'){ obj.set({left:1059}); }
			if(parameter=='GEQ2500HZ'){ obj.set({left:1164}); }
			if(parameter=='GEQ4000HZ'){ obj.set({left:1269}); }
			if(parameter=='GEQ6300HZ'){ obj.set({left:1374}); }
			if(parameter=='GEQ10000HZ'){ obj.set({left:1478}); }
			if(parameter=='GEQ16000HZ'){ obj.set({left:1583}); }
			if(parameter=='GEQ20000HZ'){ obj.set({left:1688}); }

			canvas.remove(canvas.getItemByName(parameter+'_text'));
			set_geq_text(parameter,volume,obj.top);	

			document.getElementById(parameter+channel+'_fader').value=volume;
		}
		if(obj.type=='peq_touch_fader' && inside_canvas==1){
		   
		  	var input_type ='fader';
		
			var data = get_peq_data(obj.type, obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];
			
			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+channel+'_'+input_type).value;
			
			var new_value = -150+((parseInt(input)+12)*12.5)+diff; // Min:-12 Max:12

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/12.5)-12); // Min: -12 to Max: 12
			
			canvas.getItemByName('peq_indicator_'+input_type+'_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('peq_'+input_type+'_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'peq_'+input_type+'_'+parameter+'_text',
				name: 'peq_'+input_type+'_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 100,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			peq_touch_temp=text;
		}
		if(obj.type=='peq_touch_q' && inside_canvas==1){
		   
		  	var input_type ='q';
		
			var data = get_peq_data(obj.type, obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+channel+'_'+input_type).value;

			var new_value = -150+(input*15)+diff;

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(10*((new_value+150)/15))/10;
			
			if(text<0.1){ // min is 0.05
			   text=0.1;
			}
			
			canvas.getItemByName('peq_indicator_'+input_type+'_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('peq_'+input_type+'_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'peq_'+input_type+'_'+parameter+'_text',
				name: 'peq_'+input_type+'_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			peq_touch_temp=text;
		}
		
		if(obj.type=='peq_touch_freq' && inside_canvas==1){ 

			var input_type ='freq';
			
			var data = get_peq_data(obj.type, obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive
			
			var input = document.getElementById(parameter+channel+'_'+input_type).value;

			var new_value;
			
			if(input>=20 && input<=100){
			   new_value = -150+((parseInt(input)-20)*1.25)+diff; // Min:20 Max:100
			}
			if(input>100 && input<=1000){
				new_value = -50+((parseInt(input)-100)*.1111)+diff; // Min:100 Max:1000
			}
			if(input>1000 && input<=20000){
				new_value = 50+((parseInt(input)-1000)*.005263)+diff; // Min:1000 Max:20,000
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}
			
			var text;
			
			if(new_value>=-150 && new_value <=-50){
			   text = Math.round(((new_value+150)/1.25)+20); // Min: 20 to Max: 100
			}
			if(new_value>-50 && new_value <=50){
			   text = Math.round(((new_value+50)/.1111)+100); // Min: 100 to Max: 1000
			 }
			if(new_value>50 && new_value <=150){
			   text = Math.round(((new_value-50)/.005263)+1000); // Min: 1000 Max: 20k
			 }
			
			var formatted_text=text;
			if(text>9){
			   	formatted_text = Math.floor(text/2)*2;
				text = Math.floor(text/2)*2;
			 }
			if(text>99){
			   	formatted_text = Math.floor(text/50)*50;
				text = Math.floor(text/50)*50;
			 }
			if(text>999){
				formatted_text = formatNumber(Math.floor(text/500)*500);
				text = Math.floor(text/500)*500;
			}
			if(text>20000){
			   text=20000;
			 }
			
			canvas.getItemByName('peq_indicator_'+input_type+'_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('peq_'+input_type+'_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(formatted_text), {
				id: 'peq_'+input_type+'_'+parameter+'_text',
				name: 'peq_'+input_type+'_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 100,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
						   
			canvas.remove(canvas.getItemByName('peq_'+input_type+'_'+parameter+'_text2'));

			var peq_text2 = new fabric.Textbox(String(formatted_text), {
				id: 'peq_freq_'+ parameter +'_text2',
				name: 'peq_freq_'+parameter+'_text2',
				parameter: parameter,
				left: text_left+37,
				top: text_top+434,
				width: 100,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_text2);
			
			peq_touch_temp=text;
		}
		
		if(obj.type=='compressor_touch' && inside_canvas==1){
		   
			var data = get_compressor_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive
			
			var input = document.getElementById(parameter+'_compressor'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				if(json_type=='nqga20'){
					new_value = -150+((parseInt(input)+90)*3.125)+diff; // Min:-90 Max:6
				} else {
					new_value = -150+((parseInt(input)+135)*1.92)+diff; // Min:-135 Max:21	
				}
			}
			if(parameter=='Attack'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Hold'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Decay'){
				new_value = -150+(input*0.15)+diff; // Min:0 Max:2000
			}
			if(parameter=='Knee'){
				new_value = -150+(input*3)+diff; // Min:1 Max:100
			}
			if(parameter=='Ratio'){
				new_value = -150+(input*3)+diff; // Min:1 Max:100
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				if(json_type=='nqga20'){
					text = Math.round(((new_value+150)/3.125)-90);
				} else {
					text = Math.round(((new_value+150)/1.92)-135);
				}
			}
			if(parameter=='Attack'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Hold'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Decay'){
				text = Math.round((new_value+150)/0.15);
			}
			if(parameter=='Knee'){
				text = Math.round((new_value+150)/3);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Ratio'){
				text = Math.round((new_value+150)/3);
				if(text==0){
				   text=1;
				}
			}
			
			canvas.getItemByName('compressor_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('compressor_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'compressor_'+parameter+'_text',
				name: 'compressor_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			compressor_touch_temp=text;
		}
		
		if(obj.type=='limiter_touch' && inside_canvas==1){
		   
			var data = get_limiter_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+'_limiter'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+24)*6.25)+diff;// Min:-24 Max:24
			}
			if(parameter=='Decay'){
				new_value = -150+((parseInt(input)-5)*16.667)+diff; // Min:5 Max:23
			}
			if(parameter=='RMSTC'){
				new_value = -150+(input*0.03)+diff; // Min:1 Max:10000
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/6.25)-24);
			}
			if(parameter=='Decay'){
				text = Math.round(((new_value+150)/16.667)+5);
			}
			if(parameter=='RMSTC'){
				text = Math.round((new_value+150)/0.03);
				if(text=='0'){
				   text=1;
				 }
			}
			
			canvas.getItemByName('limiter_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('limiter_'+parameter+'_text'));

			 var limiter_inputext = new fabric.Textbox(String(text), {
				id: 'limiter_'+parameter+'_text',
				name: 'limiter_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(limiter_inputext);
			
			limiter_touch_temp=text;
		}
		
		if(obj.type=='noise_gate_touch' && inside_canvas==1){
		   
			var data = get_noise_gate_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+'_noise_gate'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+135)*1.92)+diff; // Min:-135 Max:21
			}
			if(parameter=='Attack'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Hold'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Decay'){
				new_value = -150+(input*0.15)+diff; // Min:0 Max 2000
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.92)-135);
			}
			if(parameter=='Attack'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Hold'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Decay'){
				text = Math.round((new_value+150)/0.15);
			}
			
			canvas.getItemByName('noise_gate_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('noise_gate_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'noise_gate_'+parameter+'_text',
				name: 'noise_gate_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			noise_gate_touch_temp=text;
		}
		
		if(obj.type=='signal_present_touch' && inside_canvas==1){
		   
			var data = get_signal_present_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+'_signal_present'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+144)*1.786)+diff; // Min:-144 Max:24
			}
			if(parameter=='Trigger'){
				new_value = -150+(input*1.5)+diff; // Min:2 Max 200
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.786)-144);
			}
			if(parameter=='Trigger'){
				text = Math.round((new_value+150)/1.5);
				if(text<2){
				   text=2;
				}
			}
			
			canvas.getItemByName('signal_present_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('signal_present_'+parameter+'_text'));

			 var signal_present_inputext = new fabric.Textbox(String(text), {
				id: 'signal_present_'+parameter+'_text',
				name: 'signal_present_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(signal_present_inputext);
			
			signal_present_touch_temp=text;
		}
		
		if(obj.type=='ducker_touch' && inside_canvas==1){
		   
			var data = get_ducker_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive
			
			var input = document.getElementById(parameter+'_ducker').value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+135)*1.935)+diff; // Min:-135 Max:20
			}
			if(parameter=='Hold'){
				new_value = -150+(input*0.6)+diff; // Min: 1 Max:500
			}
			
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.935)-135);
			}
			if(parameter=='Hold'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			
			canvas.getItemByName('ducker_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('ducker_'+parameter+'_text'));

			 var ducker_inputext = new fabric.Textbox(String(text), {
				id: 'ducker_'+parameter+'_text',
				name: 'ducker_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(ducker_inputext);
			
			ducker_touch_temp=text;
		}
		
		if(obj.type=='hplp_touch' && inside_canvas==1){
		   
			var data = get_hplp_data(obj.parameter,obj.type2); 
			
			var type2 = data['type2'];
			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = diff*1; // control the sensitivity, higher multiplier/more sensitive
			
			var input = document.getElementById(name+channel+'_hplp').value;

			var new_value;
			
			if(parameter=='Frequency'){
				if(input>=20 && input<=100){
				   new_value = -150+((parseInt(input)-20)*1.25)+diff; // Min:20 Max:100
				}
				if(input>100 && input<=1000){
					new_value = -50+((parseInt(input)-100)*.1111)+diff; // Min:100 Max:1000
				}
				if(input>1000 && input<=20000){
					new_value = 50+((parseInt(input)-1000)*.005263)+diff; // Min:1000 Max:20,000
				}
			}
			if(parameter=='Type'){
				
				if(input=='Linkwitz_Riley_12DB'){
					new_value = -150+(0*37.5)+diff;
				}
				if(input=='Linkwitz_Riley_24DB'){
				  	new_value = -150+(1*37.5)+diff;
				}
				if(input=='Linkwitz_Riley_36DB'){
				  	new_value = -150+(2*37.5)+diff;
				}
				if(input=='Butterworth_12DB'){
				  	new_value = -150+(3*37.5)+diff;
				}
				if(input=='Butterworth_18DB'){
				  	new_value = -150+(4*37.5)+diff;
				}
				if(input=='Butterworth_24DB'){
				  	new_value = -150+(5*37.5)+diff;
				}
				if(input=='Bessel_12DB'){
				  	new_value = -150+(6*37.5)+diff;
				}
				if(input=='Bessel_18DB'){
				  	new_value = -150+(7*37.5)+diff;
				}
				if(input=='Bessel_24DB'){
				  	new_value = -150+(8*37.5)+diff;
				}
			}
			
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Frequency'){
				if(new_value>=-150 && new_value <=-50){
				   text = Math.round(((new_value+150)/1.25)+20); // Min: 20 to Max: 100
				}
				if(new_value>-50 && new_value <=50){
				   text = Math.round(((new_value+50)/.1111)+100); // Min: 100 to Max: 1000
				 }
				if(new_value>50 && new_value <=150){
				   text = Math.round(((new_value-50)/.005263)+1000); // Min: 1000 Max: 20k
				 }
			}
			if(parameter=='Type'){
				
				if(new_value<-131.25){
				   	text='Linkwitz Riley 12DB';
					new_value = -150+(0*37.5);
				 }
				if(new_value>-131.25 && new_value<-93.75){
				   	text='Linkwitz Riley 24DB';
					new_value = -150+(1*37.5);
				 }
				if(new_value>-93.75 && new_value<-56.25){
				   	text='Linkwitz Riley 36DB';
					new_value = -150+(2*37.5);
				 }
				if(new_value>-56.25 && new_value<-18.75){
				   	text='Butterworth 12DB';
					new_value = -150+(3*37.5);
				 }
				if(new_value>-18.75 && new_value<0){
				   	text='Butterworth 18DB';
					new_value = -150+(4*37.5);
				 }
				if(new_value>0 && new_value<56.25){
				   	text='Butterworth 24DB';
					new_value = -150+(5*37.5);
				 }
				if(new_value>56.25 && new_value<93.75){
				   text='Bessel 12DB';
					new_value = -150+(6*37.5);
				 }
				if(new_value>93.75 && new_value<131.25){
				   text='Bessel 18DB';
					new_value = -150+(7*37.5);
				 }
				if(new_value>131.25){
				   text='Bessel 24DB';
					new_value = -150+(8*37.5);
				 }
			}
			
			canvas.getItemByName('hplp_indicator_'+name).set('angle',new_value);

			canvas.remove(canvas.getItemByName('hplp_'+name+'_text'));
			
			// reformat large frequencies
			var formatted_text=text;
			if(text>9){
				formatted_text = Math.floor(text/2)*2;
				text = Math.floor(text/2)*2;
				formatted_text = formatted_text + ' Hz';
			 }
			if(text>99){
				formatted_text = Math.floor(text/50)*50;
				text = Math.floor(text/50)*50;
				formatted_text = formatted_text + ' Hz';
			 }
			if(text>999){
				formatted_text = formatNumber(Math.floor(text/500)*500);
				text = Math.floor(text/500)*500;
				formatted_text = formatted_text + ' Hz';
			}
			if(text>20000){
			   text=20000;
			}
			
			 var hplp_inputext = new fabric.Textbox(String(formatted_text), {
				id: 'hplp_'+name+'_text',
				name: 'hplp_'+name+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 300,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(hplp_inputext);
			
			hplp_touch_temp=text;
		}
		
		if(obj.type=='mic_touch' && inside_canvas==1){
			
			var data;
			if(json_type=='Mixer' || json_type=='ampg1_2c' || json_type=='nqpaxxx' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			   data = get_main_data(obj.name2); 
			}
			if(json_type=='ampg1_4c'){
			   data = get_main_data2(obj.name2);
			}
			if(json_type=='nqga400p'){
			   data = get_main_data3(obj.name2);
			}
			if(json_type=='nqga40'){
			   data = get_main_data4(obj.name2);
			}
		   			
			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];
			var channel = obj.get('channel');
			
			if(IsDualChannel==0 && (json_type=='ampg1_2c')){
				text_left = text_left -210;
			}
			if(IsDualChannel==0 && json_type=='ampg1_4c'){
				text_left = text_left -210;
			}
			if(IsDualChannel2==0 && json_type=='ampg1_4c'){
				text_left = text_left -210;
			}
			if(IsDualChannel==0 && json_type=='ampg2_4c' && (channel==3 || channel==4)){
				text_left = text_left -210;
			}

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(name).value;

			var new_value;
			
			if(parameter=='SignalGain'){
				new_value = -150+((parseInt(input))*10.714)+diff;// Min: 0 Max:28
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='SignalGain'){
				text = Math.round(((new_value+150)/10.714)); // Min: 0 Max:28
			}
			
			canvas.getItemByName('indicator_'+name).set('angle',new_value);

			canvas.remove(canvas.getItemByName(name+'_text'));

			 var gain_inputext = new fabric.Textbox(String(text), {
				id: name+'_text',
				name: name+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(gain_inputext);
			
			mic_touch_temp=text;
		}
		if(obj.type=='duplexer_compressor_touch' && inside_canvas==1){
		   
			var parameter = 'threshold_compressor';
			var indicator_left = 394;
			var indicator_top = 189;
			var text_left = 381;
			var text_top = 100;

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('Threshold_compressor_duplexer').value;

			var new_value = -150+((parseInt(input)+90)*4.29)+diff; // Min:-90 Max:-20
	
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/4.29)-90);  // Min:-90 Max:-20
			
			canvas.getItemByName('duplexer_indicator_compressor').set('angle',new_value);

			canvas.remove(canvas.getItemByName('compressor_threshold_text'));

			 var compressor_threshold_inputext = new fabric.Textbox(String(text), {
				id: 'compressor_threshold_text',
				name: 'compressor_threshold_text',
				parameter: 'threshold_compressor',
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(compressor_threshold_inputext);
			
			duplexer_compressor_touch_temp=text;
		}
		if(obj.type=='duplexer_noise_gate_touch' && inside_canvas==1){
		   
			var parameter = 'threshold_noise_gate';
			var indicator_left = 176;
			var indicator_top = 189;
			var text_left = 165;
			var text_top = 100;

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('Threshold_noise_gate_duplexer').value;

			var new_value = -150+((parseInt(input)+144)*1.785)+diff; // Min:-144 Max:24
			if(json_type=='edp01'){
				new_value = -150+((parseInt(input)+90)*4.29)+diff; // Min:-90 Max:-20
			}
	
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/1.785)-144);
			if(json_type=='edp01'){
			   	text = Math.round(((new_value+150)/4.29)-90);
			}
			
			canvas.getItemByName('duplexer_indicator_noise_gate').set('angle',new_value);

			canvas.remove(canvas.getItemByName('noise_gate_threshold_text'));

			 var noise_gate_threshold_inputext = new fabric.Textbox(String(text), {
				id: 'noise_gate_threshold_text',
				name: 'noise_gate_threshold_text',
				parameter: 'threshold_noise_gate',
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(noise_gate_threshold_inputext);
			
			duplexer_noise_gate_touch_temp=text;
		}	
		
		if(obj.type=='duplexer_talkback_threshold_touch' && inside_canvas==1){
		   
			var parameter = 'duplexer_talkback_threshold';
			var indicator_left = 412;
			var indicator_top = 189;
			var text_left = 400;
			var text_top = 100;

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('Talkback_threshold_duplexer').value;

			var new_value = -150+((parseInt(input)+144)*1.785)+diff; // Min:-144 Max:24
	
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/1.785)-144);
			
			canvas.getItemByName('duplexer_indicator_talkback_threshold').set('angle',new_value);

			canvas.remove(canvas.getItemByName('duplexer_talkback_threshold_text'));

			 var duplexer_talkback_threshold_input_text = new fabric.Textbox(String(text), {
				id: 'duplexer_talkback_threshold_text',
				name: 'duplexer_talkback_threshold_text',
				parameter: 'duplexer_talkback_threshold',
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(duplexer_talkback_threshold_input_text);
			
			duplexer_talkback_threshold_touch_temp=text;
		}	
		
		if(obj.type=='duplexer_talkback_decay_touch' && inside_canvas==1){
		   
			var parameter = 'duplexer_talkback_decay';
			var indicator_left = 176;
			var indicator_top = 415;
			var text_left = 165;
			var text_top = 326; 

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('Talkback_decay_duplexer').value;

			var new_value = -150+((parseInt(input))*0.3)+diff; // Min:0 Max:1000
	
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/0.3));
			
			canvas.getItemByName('duplexer_indicator_talkback_decay').set('angle',new_value);

			canvas.remove(canvas.getItemByName('duplexer_talkback_decay_text'));

			 var duplexer_talkback_decay_input_text = new fabric.Textbox(String(text), {
				id: 'duplexer_talkback_decay_text',
				name: 'duplexer_talkback_decay_text',
				parameter: 'duplexer_talkback_decay',
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(duplexer_talkback_decay_input_text);
			
			duplexer_talkback_decay_touch_temp=text;
		}	
		
		if(obj.type== 'outputs_touch' && inside_canvas==1){
			
			var id = obj.id;
			var parameter = obj.parameter;
			var parameter2 = obj.parameter2;
			var p_lower = parameter.toLowerCase();
			
			var indicator_left = 0;
			var indicator_top = 0;
			var text_left = 0;
			var text_top = 0;
					
			if(parameter=='Speaker'){
			   	indicator_left = 161;
				indicator_top = 167;
				text_left = 150;
				text_top = 112;
			} 
			if(parameter=='Line'){
			    indicator_left = 415;
				indicator_top = 167;
				text_left = 405;
				text_top = 112;
			} 
			
			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter2).value;
			
			 if(input=='-144'){
				input=0;
			 }
			var new_value;
			if(parameter=='Speaker'){
			  	new_value =  -150+((parseInt(input)+15)*20)+diff; // Min:-15 Max:0
			 }
			if(parameter=='Line'){
			  	new_value = (input*10)+diff;
			 }
			 
			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}
			
			var text;
			if(parameter=='Speaker'){
				text = Math.round(((new_value+150)/20)-15); // Min:-15 Max:0
			}
			if(parameter=='Line'){
				text = Math.round(new_value/10);
			}

			canvas.getItemByName('outputs_indicator_'+p_lower).set('angle',new_value);

			canvas.remove(canvas.getItemByName('outputs_'+p_lower+'_text'));

			 var outputs_text = new fabric.Textbox(String(text), {
				id: 'outputs_'+p_lower+'_text',
				name: 'outputs_'+p_lower+'_text',
				parameter: parameter,
				parameter2: parameter2,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});

			canvas.add(outputs_text);

			outputs_touch_temp=text;
		}
	
		if(obj.type=='delay_touch' && inside_canvas==1){
					
			var diff = 205-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById('Delay_delay'+channel).value;
				
			var new_value = -150+((parseInt(input))*10)+diff; // Min:0 Max:30

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text = Math.round(((new_value+150)/10));
			
			canvas.getItemByName('delay_indicator_Delay').set('angle',new_value);

			canvas.remove(canvas.getItemByName('delay_Delay_text'));

			 var delay_inputext = new fabric.Textbox(String(text), {
				id: 'delay_Delay_text',
				name: 'delay_Delay_text',
				parameter: 'Delay',
				left: 240,
				top: 110,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(delay_inputext);
			
			delay_touch_temp=text;
		}
		
		if(obj.type=='peak_limiter_touch' && inside_canvas==1){
		   
			var data = get_peak_limiter_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+'_peak_limiter'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+135)*1.92)+diff; // Min:-135 Max:21
			}
			if(parameter=='Attack'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Hold'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Decay'){
				new_value = -150+(input*0.15)+diff; // Min:0 Max 2000
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.92)-135);
			}
			if(parameter=='Attack'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Hold'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Decay'){
				text = Math.round((new_value+150)/0.15);
			}
			
			canvas.getItemByName('peak_limiter_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('peak_limiter_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'peak_limiter_'+parameter+'_text',
				name: 'peak_limiter_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			peak_limiter_touch_temp=text;
		}
		
		if(obj.type=='rms_limiter_touch' && inside_canvas==1){
		   
			var data = get_rms_limiter_data(obj.parameter); 

			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var input = document.getElementById(parameter+'_rms_limiter'+channel).value;

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+135)*1.92)+diff; // Min:-135 Max:21
			}
			if(parameter=='Attack'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Hold'){
				new_value = -150+(input*0.6)+diff; // Min:1 Max:500
			}
			if(parameter=='Decay'){
				new_value = -150+(input*0.15)+diff; // Min:0 Max 2000
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.92)-135);
			}
			if(parameter=='Attack'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Hold'){
				text = Math.round((new_value+150)/0.6);
				if(text==0){
				   text=1;
				}
			}
			if(parameter=='Decay'){
				text = Math.round((new_value+150)/0.15);
			}
			
			canvas.getItemByName('rms_limiter_indicator_'+parameter).set('angle',new_value);

			canvas.remove(canvas.getItemByName('rms_limiter_'+parameter+'_text'));

			 var peq_inputext = new fabric.Textbox(String(text), {
				id: 'rms_limiter_'+parameter+'_text',
				name: 'rms_limiter_'+parameter+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(peq_inputext);
			
			rms_limiter_touch_temp=text;
		}
		if(obj.type=='standby_touch' && inside_canvas==1){
			
			var amp;
			var input;
			if(obj.name=='standby_touch_Threshold_ab'){
                amp = 'ab';
				input = document.getElementById('Threshold_standby_ab').value;
            }
            if(obj.name=='standby_touch_Threshold_cd'){
                amp = 'cd';
				input = document.getElementById('Threshold_standby_cd').value;
            }
			
			var data = get_standby_data(amp); 
	
			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+144)*1.785)+diff; // Min:-144 Max:24
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.785)-144);
			}
			
			canvas.getItemByName('standby_indicator_'+parameter + '_' + amp).set('angle',new_value);

			canvas.remove(canvas.getItemByName('standby_'+parameter+'_text' + '_' + amp));

			 var standby_inputext = new fabric.Textbox(String(text), {
				id: 'standby_'+parameter+'_text' + '_' + amp,
				name: 'standby_'+parameter+'_text' + '_' + amp,
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(standby_inputext);
			
			standby_touch_temp=text;
		}
		if(obj.type=='mute_touch' && inside_canvas==1){
			
			var amp;
			var input;
			if(obj.name=='mute_touch_Threshold_ab'){
                amp = 'ab';
				input = document.getElementById('Threshold_mute_ab').value;
            }
            if(obj.name=='mute_touch_Threshold_cd'){
                amp = 'cd';
				input = document.getElementById('Threshold_mute_cd').value;
            }
			
			var data = get_mute_data(amp);
	
			var name = data['name'];
			var parameter = data['parameter'];
			var indicator_left = data['indicator_left'];
			var indicator_top = data['indicator_top'];
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			var diff = indicator_top-obj.top;

			diff = 1*diff; // control the sensitivity, higher multiplier/more sensitive

			var new_value;
			
			if(parameter=='Threshold'){
				new_value = -150+((parseInt(input)+144)*1.785)+diff; // Min:-144 Max:24
			}

			if(new_value>150){
				new_value=150;
			}
			if(new_value<-150){
				new_value=-150;
			}

			var text;
			
			if(parameter=='Threshold'){
				text = Math.round(((new_value+150)/1.785)-144);
			}
			
			canvas.getItemByName('mute_indicator_'+parameter + '_' + amp).set('angle',new_value);

			canvas.remove(canvas.getItemByName('mute_'+parameter+'_text' + '_' + amp));

			 var mute_inputext = new fabric.Textbox(String(text), {
				id: 'mute_'+parameter+'_text' + '_' + amp,
				name: 'mute_'+parameter+'_text' + '_' + amp,
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(mute_inputext);
			
			mute_touch_temp=text;
		}
	};
	
	var scaleHandler = function (evt) {
		var scaleObject = evt.target;
		//console.log(scaleObject.get('id'));
		_isDragging = _isMouseDown;
		
		var object_id = scaleObject.get('id');
		 canvas.forEachObject(function(obj){
			 if(obj){
				 /*
				if(obj.id == 'menu'+ object_id){
					canvas.remove(obj);
				}
				*/
			}
		});
	};
	
	var mouseUpHandler = function (evt) {
		var mouseUpObject = evt.target;
		var mouseUpEvent = evt.e;
		//console.log(mouseUpObject.get('id'), mouseUpObject.get('top'));
		_isMouseDown = false;
		
		if(mouseUpObject){
			
			var object_id = mouseUpObject.get('id');
			var top = mouseUpObject.get('top');
			var channel = document.getElementById('channel').value;
			var type = mouseUpObject.get('type');
			var volume = 0;
			var json_type = document.getElementById('json_type').value;
			var IsDualChannel = document.getElementById('IsDualChannel').value;
			var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
			
			var isDragEnd = _isDragging;
			_isDragging = false;
			if (isDragEnd) {
		   		// code for drag complete
				if(type == 'level_fader'){
					var channel = mouseUpObject.get('channel');
					volume = get_volume_from_top(top);
					set_volume_value(channel, volume);
					canvas.remove(canvas.getItemByName('level'+channel+'_text'));
				}
				if(type == 'peq_fader'){
					volume = get_peq_volume_from_top(top);
					var parameter = mouseUpObject.get('parameter');
					var input_type = 'fader';
					set_peq_data(channel,parameter,input_type,volume);
					canvas.remove(canvas.getItemByName(parameter+'_text'));
				}
				if(type == 'geq_fader'){
					volume = get_geq_volume_from_top(top);
					var parameter = mouseUpObject.get('parameter');
					var input_type = 'fader';
					set_geq_data(channel,parameter,input_type,volume);
					canvas.remove(canvas.getItemByName(parameter+'_text'));
				}
				if(type=='router_touch_input'){ 
									
					var parameter = mouseUpObject.get('parameter');
					var name2 = mouseUpObject.get('name2');
					document.getElementById('router_'+name2).value=router_touch_temp;
					
					if(parameter=='gain'){
						var gain_channel = name2.replace("gain", "");
					  	set_main_data(gain_channel,'SignalGain',router_touch_temp);
					} else {
						set_router_volume(parameter, router_touch_temp);
					}
					
					var data;
					if(json_type=='Mixer'){
					   data = get_router_data(object_id);
					}
					if(json_type=='nqpaxxx'){
					   data = get_router_data6(object_id);
					} 
					if(json_type=='ampg1_2c'){
					   data = get_router_data2(object_id);
					} 
					if(json_type=='ampg1_4c'){
					   data = get_router_data3(object_id);
					} 
					if(json_type=='ampg2_2c'){
					   data = get_router_data5(object_id);
					} 
					if(json_type=='ampg2_4c'){
					   data = get_router_data4(object_id);
					} 
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					var object_name = data['name'];
					
					if(IsDualChannel==0 &&  ["ampg1_2c","ampg1_4c","ampg2_2c","ampg2_4c"].includes(json_type)  && ["output3","cg13","cg23","cg33","cg43","output4","cg14","cg24","cg34","cg44"].includes(object_name)){
						left -= 200;
					}
					
					canvas.remove(canvas.getItemByName('router_touch_'+name2));
					
					// set router_touch_element
					var router_touch_element = document.getElementById('router_touch_'+name2);
					var router_touch_instance = new fabric.Image(router_touch_element, {
					  id: 'router_touch_'+name2,
					  name: 'router_touch_'+name2,
					  name2: name2,
					  type: 'router_touch_input',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(router_touch_instance);

				 }
				if(type=='peq_touch_fader' || type=='peq_touch_freq' || type=='peq_touch_q'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_peq_data(type, parameter); 
						
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					var input_type;
					if(type=='peq_touch_freq'){
					   input_type='freq';
					}
					if(type=='peq_touch_q'){
					   input_type='q';
					}
					if(type=='peq_touch_fader'){
					   input_type='fader';
					}
					document.getElementById(parameter+channel+'_'+input_type).value=peq_touch_temp;
					
					set_peq_data(channel,parameter,input_type,peq_touch_temp);
					
					canvas.remove(canvas.getItemByName(type +'_'+parameter));
					
					// set touch_element
					var peq_touch_element = document.getElementById(type+'_'+parameter);
					var peq_touch_instance = new fabric.Image(peq_touch_element, {
					  id: type+'_'+parameter,
					  name: type+'_'+parameter,
					  type: type,
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(peq_touch_instance);
				 }
				if(type=='compressor_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_compressor_data(parameter); 
					
					document.getElementById(parameter+'_compressor'+channel).value=compressor_touch_temp;
					
					set_compressor_data(channel,parameter,compressor_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('compressor_touch_'+parameter));
					
					// set touch_element
					var compressor_touch_element = document.getElementById('compressor_touch_'+parameter);
					var compressor_touch_instance = new fabric.Image(compressor_touch_element, {
					  id: 'compressor_touch_'+parameter,
					  name: 'compressor_touch_'+parameter,
					  type: 'compressor_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(compressor_touch_instance);
				 }
				if(type=='limiter_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_limiter_data(parameter); 
					
					document.getElementById(parameter+'_limiter'+channel).value=limiter_touch_temp;
					
					set_limiter_data(channel,parameter,limiter_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('limiter_touch_'+parameter));
					
					// set touch_element
					var limiter_touch_element = document.getElementById('limiter_touch_'+parameter);
					var limiter_touch_instance = new fabric.Image(limiter_touch_element, {
					  id: 'limiter_touch_'+parameter,
					  name: 'limiter_touch_'+parameter,
					  type: 'limiter_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(limiter_touch_instance);
				 }
				if(type=='noise_gate_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_noise_gate_data(parameter); 
					
					document.getElementById(parameter+'_noise_gate'+channel).value=noise_gate_touch_temp;
					
					set_noise_gate_data(channel,parameter,noise_gate_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('noise_gate_touch_'+parameter));
					
					// set touch_element
					var noise_gate_touch_element = document.getElementById('noise_gate_touch_'+parameter);
					var noise_gate_touch_instance = new fabric.Image(noise_gate_touch_element, {
					  id: 'noise_gate_touch_'+parameter,
					  name: 'noise_gate_touch_'+parameter,
					  type: 'noise_gate_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(noise_gate_touch_instance);
				 }
				if(type=='signal_present_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_signal_present_data(parameter); 
					
					document.getElementById(parameter+'_signal_present'+channel).value=signal_present_touch_temp;
					
					set_signal_present_data(channel,parameter,signal_present_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('signal_present_touch_'+parameter));
					
					// set touch_element
					var signal_present_touch_element = document.getElementById('signal_present_touch_'+parameter);
					var signal_present_touch_instance = new fabric.Image(signal_present_touch_element, {
					  id: 'signal_present_touch_'+parameter,
					  name: 'signal_present_touch_'+parameter,
					  type: 'signal_present_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(signal_present_touch_instance);
				 }
				if(type=='ducker_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_ducker_data(parameter); 
					
					document.getElementById(parameter+'_ducker').value=ducker_touch_temp;
					
					set_ducker_data(parameter,ducker_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('ducker_touch_'+parameter));
					
					// set touch_element
					var ducker_touch_element = document.getElementById('ducker_touch_'+parameter);
					var ducker_touch_instance = new fabric.Image(ducker_touch_element, {
					  id: 'ducker_touch_'+parameter,
					  name: 'ducker_touch_'+parameter,
					  type: 'ducker_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(ducker_touch_instance);
				 }
				if(type=='hplp_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var type2 = mouseUpObject.get('type2');
					var data = get_hplp_data(parameter,type2);
								
					// add "_" for spaces
					hplp_touch_temp = hplp_touch_temp.toString().split(" ").join("_");
					
					document.getElementById(parameter+'_'+type2+channel+'_hplp').value=hplp_touch_temp;
						
					set_hplp_data(channel,parameter,hplp_touch_temp,type2);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('hplp_touch_'+parameter+'_'+type2));
										
					// set touch_element
					var hplp_touch_element = document.getElementById('hplp_touch_'+parameter);
					var hplp_touch_instance = new fabric.Image(hplp_touch_element, {
					  id: 'hplp_touch_'+parameter+'_'+type2,
					  name: 'hplp_touch_'+parameter+'_'+type2,
					  type: 'hplp_touch',
					  type2: type2,
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(hplp_touch_instance);
				 }
				if(type=='mic_touch'){
					var name = mouseUpObject.get('name');
					var name2 = mouseUpObject.get('name2');
					var parameter = mouseUpObject.get('parameter');
					var channel = mouseUpObject.get('channel');
					var data;
					if(json_type=='Mixer' || json_type=='ampg1_2c' || json_type=='nqpaxxx' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
					   data = get_main_data(name2); 
					}
					if(json_type=='ampg1_4c'){
					   data = get_main_data2(name2); 
					}
					if(json_type=='nqga400p'){
					   data = get_main_data3(name2); 
					}
					if(json_type=='nqga40'){
					   data = get_main_data4(name2); 
					}
					
					document.getElementById(name2).value=mic_touch_temp;
					
					set_main_data(channel,parameter,mic_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					if(IsDualChannel==0 && json_type=='ampg1_2c'){
					   left = left-210;
					}
					if(IsDualChannel==0 && json_type=='ampg1_4c'){
					   left = left-210;
					}
					if(IsDualChannel2==0 && json_type=='ampg1_4c'){
					   left = left-210;
					}
					if(IsDualChannel==0 && json_type=='ampg2_4c' && (channel==3 || channel==4)){
					   left = left-210;
					}
					
					canvas.remove(canvas.getItemByName('touch_'+name2));
					
					// set gain_touch_element
					var gain_touch_element = document.getElementById('touch_'+name2);
					var gain_touch_instance = new fabric.Image(gain_touch_element, {
					  id: 'touch_'+name2,
					  name: 'touch_'+name2,
					  type: 'mic_touch',
					  parameter: parameter,
					  name2: name2,
				 	  channel: channel,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(gain_touch_instance);
				 }
				if(type=='duplexer_compressor_touch'){ 
					
					document.getElementById('Threshold_compressor_duplexer').value=duplexer_compressor_touch_temp;
					
					set_duplexer_compressor_data(duplexer_compressor_touch_temp);
					
					canvas.remove(canvas.getItemByName('duplexer_compressor_touch'));
					
					// set touch_element
					var duplexer_compressor_touch_element = document.getElementById('duplexer_compressor_touch');
					var duplexer_compressor_touch_instance = new fabric.Image(duplexer_compressor_touch_element, {
					  id: 'duplexer_compressor_touch',
					  name: 'duplexer_compressor_touch',
					  type: 'duplexer_compressor_touch',
					  parameter: 'threshold_compressor',
					  left: 394,
					  top: 189,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(duplexer_compressor_touch_instance);
				 }
				if(type=='duplexer_noise_gate_touch'){ 
					
					document.getElementById('Threshold_noise_gate_duplexer').value=duplexer_noise_gate_touch_temp;
					
					set_duplexer_noise_gate_data(duplexer_noise_gate_touch_temp);
					
					canvas.remove(canvas.getItemByName('duplexer_noise_gate_touch'));
					
					// set touch_element
					var duplexer_noise_gate_touch_element = document.getElementById('duplexer_noise_gate_touch');
					var duplexer_noise_gate_touch_instance = new fabric.Image(duplexer_noise_gate_touch_element, {
					  id: 'duplexer_noise_gate_touch',
					  name: 'duplexer_noise_gate_touch',
					  type: 'duplexer_noise_gate_touch',
					  parameter: 'threshold_noise_gate',
					  left: 178,
					  top: 189,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(duplexer_noise_gate_touch_instance);
				 }
				if(type=='duplexer_talkback_threshold_touch'){ 
					
					document.getElementById('Talkback_threshold_duplexer').value=duplexer_talkback_threshold_touch_temp;
					
					set_duplexer_talkback_threshold_data(duplexer_talkback_threshold_touch_temp);
					
					canvas.remove(canvas.getItemByName('duplexer_talkback_threshold_touch'));
					
					// set touch_element
					var duplexer_talkback_threshold_touch_element = document.getElementById('duplexer_talkback_threshold_touch');
					var duplexer_talkback_threshold_touch_instance = new fabric.Image(duplexer_talkback_threshold_touch_element, {
					  id: 'duplexer_talkback_threshold_touch',
					  name: 'duplexer_talkback_threshold_touch',
					  type: 'duplexer_talkback_threshold_touch',
					  parameter: 'duplexer_talkback_threshold',
					  left: 412,
					  top: 189,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(duplexer_talkback_threshold_touch_instance);
				 }
				if(type=='duplexer_talkback_decay_touch'){ 
					
					document.getElementById('Talkback_decay_duplexer').value=duplexer_talkback_decay_touch_temp;
					
					set_duplexer_talkback_decay_data(duplexer_talkback_decay_touch_temp);
					
					canvas.remove(canvas.getItemByName('duplexer_talkback_decay_touch'));
					
					// set touch_element
					var duplexer_talkback_decay_touch_element = document.getElementById('duplexer_talkback_decay_touch');
					var duplexer_talkback_decay_touch_instance = new fabric.Image(duplexer_talkback_decay_touch_element, {
					  id: 'duplexer_talkback_decay_touch',
					  name: 'duplexer_talkback_decay_touch',
					  type: 'duplexer_talkback_decay_touch',
					  parameter: 'duplexer_talkback_decay',
					  left: 178,
					  top: 415,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(duplexer_talkback_decay_touch_instance);
				 }
				if(type=='outputs_touch'){ 
					var id = mouseUpObject.get('id');
					var parameter = mouseUpObject.get('parameter');
					var parameter2 = mouseUpObject.get('parameter2');
					var p_lower = parameter .toLowerCase();
					
					document.getElementById(parameter2).value=outputs_touch_temp;
					
					set_outputs_data(outputs_touch_temp, parameter);
					
					var left = 0
					var top = 0;
					if(parameter=='Speaker'){
					   	left = 173
						top = 179;
					}
					if(parameter=='Line'){
					   	left = 426;
						top = 179;
					}
					
					canvas.remove(canvas.getItemByName('outputs_touch_'+p_lower));
					
					// set speaker_touch_element
                    var speaker_touch_element = document.getElementById('outputs_touch_'+p_lower);
                    var speaker_touch_instance = new fabric.Image(speaker_touch_element, {
                      id: 'outputs_touch_'+p_lower,
                      name: 'outputs_touch_'+p_lower,
                      type: 'outputs_touch',
                      parameter: parameter,
                	  parameter2: parameter2,
                      left: left,
                      top: top,
                      angle: 0,
                      opacity: 1.0,	
                      selectable: true,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                      borderColor: 'rgba(0,0,0,0.0)',
                      cornerColor: 'rgba(0,0,0,0.0)',
                    });
                    canvas.add(speaker_touch_instance);
				 }
				if(type=='delay_touch'){ 
					var name = mouseUpObject.get('name'); 
					
					document.getElementById('Delay_delay'+channel).value=delay_touch_temp;
					
					set_delay_data(channel,'Delay',delay_touch_temp);
					
					canvas.remove(canvas.getItemByName('delay_touch_Delay'));
					
					// set touch_element
					var delay_touch_element = document.getElementById('delay_touch_Delay');
					var delay_touch_instance = new fabric.Image(delay_touch_element, {
					  id: 'delay_touch_Delay',
					  name: 'delay_touch_Delay',
					  type: 'delay_touch',
					  parameter: 'Delay',
					  left: 247,
					  top: 205,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(delay_touch_instance);
				 }
				if(type=='peak_limiter_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_peak_limiter_data(parameter); 
					
					document.getElementById(parameter+'_peak_limiter'+channel).value=peak_limiter_touch_temp;
					
					set_peak_limiter_data(channel,parameter,peak_limiter_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('peak_limiter_touch_'+parameter));
					
					// set touch_element
					var peak_limiter_touch_element = document.getElementById('peak_limiter_touch_'+parameter);
					var peak_limiter_touch_instance = new fabric.Image(peak_limiter_touch_element, {
					  id: 'peak_limiter_touch_'+parameter,
					  name: 'peak_limiter_touch_'+parameter,
					  type: 'peak_limiter_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(peak_limiter_touch_instance);
				 }
				if(type=='rms_limiter_touch'){ 
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter');
					var data = get_rms_limiter_data(parameter); 
					
					document.getElementById(parameter+'_rms_limiter'+channel).value=rms_limiter_touch_temp;
					
					set_rms_limiter_data(channel,parameter,rms_limiter_touch_temp);
					
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					canvas.remove(canvas.getItemByName('rms_limiter_touch_'+parameter));
					
					// set touch_element
					var rms_limiter_touch_element = document.getElementById('rms_limiter_touch_'+parameter);
					var rms_limiter_touch_instance = new fabric.Image(rms_limiter_touch_element, {
					  id: 'rms_limiter_touch_'+parameter,
					  name: 'rms_limiter_touch_'+parameter,
					  type: 'rms_limiter_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(rms_limiter_touch_instance);
				 }
				if(type=='standby_touch'){ 
							
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter'); 
					var amp;
							
					if(name=='standby_touch_Threshold_ab'){
					   document.getElementById('Threshold_standby_ab').value=standby_touch_temp;
						amp = 'ab';
					}
					if(name=='standby_touch_Threshold_cd'){
					   document.getElementById('Threshold_standby_cd').value=standby_touch_temp;
						amp = 'cd';
					}
					
					var data = get_standby_data(amp);
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					set_standby_data(amp,standby_touch_temp);
					
					canvas.remove(canvas.getItemByName('standby_touch_'+parameter + '_' + amp));
					
					// set touch_element
					var standby_touch_element = document.getElementById('standby_touch_'+parameter);
					var standby_touch_instance = new fabric.Image(standby_touch_element, {
					  id: 'standby_touch_'+parameter + '_' + amp,
					  name: 'standby_touch_'+parameter + '_' + amp,
					  type: 'standby_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(standby_touch_instance);
				 }
				if(type=='mute_touch'){ 
							
					var name = mouseUpObject.get('name');
					var parameter = mouseUpObject.get('parameter'); 
					var amp;
							
					if(name=='mute_touch_Threshold_ab'){
					   document.getElementById('Threshold_mute_ab').value=mute_touch_temp;
						amp = 'ab';
					}
					if(name=='mute_touch_Threshold_cd'){
					   document.getElementById('Threshold_mute_cd').value=mute_touch_temp;
						amp = 'cd';
					}
					
					var data = get_mute_data(amp);
					var left = data['indicator_left'];
					var top = data['indicator_top'];
					
					set_mute_data(amp,mute_touch_temp);
					
					canvas.remove(canvas.getItemByName('mute_touch_'+parameter + '_' + amp));
					
					// set touch_element
					var mute_touch_element = document.getElementById('mute_touch_'+parameter);
					var mute_touch_instance = new fabric.Image(mute_touch_element, {
					  id: 'mute_touch_'+parameter + '_' + amp,
					  name: 'mute_touch_'+parameter + '_' + amp,
					  type: 'mute_touch',
					  parameter: parameter,
					  left: left,
					  top: top,
					  angle: 0,
					  opacity: 1.0,	
					  selectable: true,
					  hasControls: false,
					  originX: 'center',
					  originY: 'center',
					  centeredRotation: true,
					  borderColor: 'rgba(0,0,0,0.0)',
					  cornerColor: 'rgba(0,0,0,0.0)',
					});
					canvas.add(mute_touch_instance);
				 }
			} else {
				// code for no drag mouse up
			}
		}
	};
	
	var mouseDownHandler = function (evt) {
		var mouseDownObject = evt.target;	
		var mouseDownEvent = evt.e;
		// console.log(mouseDownEvent.offsetY);
		// console.log(mouseDownObject);
		 _isMouseDown = true;
		
		var name = mouseDownObject.get('name');
		var type = mouseDownObject.get('type');
		var channel = mouseDownObject.get('channel');
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		if(type=='mute_bar_button'){  
			
			var channel_id = 'mute' + channel;
			var mute = document.getElementById(channel_id);
			var dsp_value;

			if(mute.value==0){
			   mute.value=1;
				dsp_value = true;
				canvas.getItemByName('mute_bar_button'+ channel +'_off').set('opacity', 0.0);
				canvas.getItemByName('mute_bar_button'+ channel +'_on').set('opacity', 1.0);
			} else {
				mute.value=0;
				dsp_value = false;
				canvas.getItemByName('mute_bar_button'+ channel +'_off').set('opacity', 1.0);
				canvas.getItemByName('mute_bar_button'+ channel +'_on').set('opacity', 0.0);
			}
			var msg = '';
			if(json_type=='Mixer'){
			   if(channel==6){
				  	channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			if(json_type=='nqga20'){
			    msg = '{ "'+json_type+'": { "Ch1": { "Mute": ' + dsp_value + ' } } }';
			} else {
			   	msg = '{ "'+json_type+'": { "In' + channel +'": { "Mute": ' + dsp_value + ' } } }';
			}
			if(json_type=='nqga400p'){
				if(channel==1 || channel==2){
				   	msg = '{ "'+json_type+'": { "In' + channel +'": { "Mute": ' + dsp_value + ' } } }';
				}
				if(channel==3){
					msg = '{ "'+json_type+'": { "Out1": { "Mute": ' + dsp_value + ' } } }';
				}
				if(channel==4){
					msg = '{ "'+json_type+'": { "Out2": { "Mute": ' + dsp_value + ' } } }';
				}
			}
			if(json_type=='nqga40'){
				if(channel==1){
				   	msg = '{ "'+json_type+'": { "In1": { "Mute": ' + dsp_value + ' } } }';
				}
				if(channel==2){
					msg = '{ "'+json_type+'": { "Ch1": { "Mute": ' + dsp_value + ' } } }';
				}
			}
			socket.send(msg);
			update_save_settings_button();
		}
		if(type=='enabled_button'){  
			
			var name = mouseDownObject.get('name2');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById('router_enable_'+name);
			var data;
			if(json_type=='Mixer'){
			   data = get_router_data('router_touch_'+name);
			}
			if(json_type=='nqpaxxx'){
			   data = get_router_data6('router_touch_'+name);
			}
			if(json_type=='ampg1_2c'){
			   data = get_router_data2('router_touch_'+name);
			}
			if(json_type=='ampg1_4c'){
			   data = get_router_data3('router_touch_'+name);
			}
			if(json_type=='ampg2_2c'){
			   data = get_router_data5('router_touch_'+name);
			}
			if(json_type=='ampg2_4c'){
			   data = get_router_data4('router_touch_'+name);
			}
			
			var text_left = data['text_left'];
			var text_top = data['text_top'];

			if(enabled.value==0){
			   enabled.value=1;
				canvas.getItemByName('enabled_'+name+'_off').set('opacity', 0.0);
				canvas.getItemByName('enabled_'+name+'_on').set('opacity', 1.0);
				var msg = '{ "'+json_type+'": { "Router": { "'+ parameter +'": 0 } } }';
				socket.send(msg);
				update_save_settings_button();
			} else {
				enabled.value=0;
				canvas.getItemByName('enabled_'+name+'_off').set('opacity', 1.0);
				canvas.getItemByName('enabled_'+name+'_on').set('opacity', 0.0);
				var msg = '{ "'+json_type+'": { "Router": { "'+ parameter +'": -144 } } }';
				socket.send(msg);
				update_save_settings_button();
			}
			
			if(json_type=='ampg1_4c'){
				if(IsDualChannel==0 && ["output3","cg13","cg23","output4","cg14","cg24"].includes(name)){
					text_left -= 200;
				}	
			}
			
			if(json_type=='ampg2_4c'){
				if(IsDualChannel==0 && ["output3","cg13","cg23","cg33","cg43","output4","cg14","cg24","cg34","cg44"].includes(name)){
					text_left -= 200;
				}
			}
			
			// reset indicator to 0
			document.getElementById('router_'+name).value=0;
			canvas.getItemByName('router_indicator_'+name).set('angle',0);
			canvas.remove(canvas.getItemByName('router_'+name+'_text'));

			 var router_inputext = new fabric.Textbox(String(0), {
				id: 'router_'+name+'_text',
				name: 'router_'+name+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(router_inputext);

		}
		if(type=='enabled_button_amp_router'){ 
			
			var json_type = document.getElementById('json_type').value;
			
			var parameter = mouseDownObject.get('parameter');
			var AnalogModeCH1 = document.getElementById('AnalogModeCH1').value;
			var AnalogModeCH2 = document.getElementById('AnalogModeCH2').value;
			var AnalogModeCH3 = document.getElementById('AnalogModeCH3').value;
			var AnalogModeCH4 = document.getElementById('AnalogModeCH4').value;
			
			if(json_type=='ampg1_2c'){
			   
			   if(AnalogModeCH1=='None' && parameter=='AnalogModeCH1'){
					document.getElementById('AnalogModeCH1').value = 'Analog1';
					canvas.getItemByName('enabled_router11_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router11_on').set('opacity', 1.0);
					var msg = '{ "ampg1_2c": { "Out1": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if(AnalogModeCH1=='Analog1' && parameter=='AnalogModeCH1'){
					document.getElementById('AnalogModeCH1').value = 'None';
					canvas.getItemByName('enabled_router11_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router11_on').set('opacity', 0.0);
					var msg = '{ "ampg1_2c": { "Out1": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
				if(AnalogModeCH2=='None' && parameter=='AnalogModeCH2'){
					document.getElementById('AnalogModeCH2').value = 'Analog1';
					canvas.getItemByName('enabled_router12_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router12_on').set('opacity', 1.0);
					var msg = '{ "ampg1_2c": { "Out2": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if(AnalogModeCH2=='Analog1' && parameter=='AnalogModeCH2'){
					document.getElementById('AnalogModeCH2').value = 'None';
					canvas.getItemByName('enabled_router12_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router12_on').set('opacity', 0.0);
					var msg = '{ "ampg1_2c": { "Out2": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
			}
			if(json_type=='ampg1_4c'){
				
				if((AnalogModeCH1=='None' || AnalogModeCH1=='Analog2') && parameter=='enabled_button_amp_router11'){
					document.getElementById('AnalogModeCH1').value = 'Analog1';
					canvas.getItemByName('enabled_router11_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router11_on').set('opacity', 1.0);
					canvas.getItemByName('enabled_router21_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router21_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out1": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if((AnalogModeCH1=='None' || AnalogModeCH1=='Analog1') && parameter=='enabled_button_amp_router21'){
					document.getElementById('AnalogModeCH1').value = 'Analog2';
					canvas.getItemByName('enabled_router11_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router11_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router21_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router21_on').set('opacity', 1.0);
					var msg = '{ "ampg1_4c": { "Out1": { "AnalogSource": "Analog2" } } }';
					socket.send(msg);
				}	
				if((AnalogModeCH1=='Analog1' && parameter=='enabled_button_amp_router11') || (AnalogModeCH1=='Analog2' && parameter=='enabled_button_amp_router21')){
					document.getElementById('AnalogModeCH1').value = 'None';
					canvas.getItemByName('enabled_router11_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router11_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router21_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router21_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out1": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
				
				if((AnalogModeCH2=='None' || AnalogModeCH2=='Analog2') && parameter=='enabled_button_amp_router12'){
					document.getElementById('AnalogModeCH2').value = 'Analog1';
					canvas.getItemByName('enabled_router12_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router12_on').set('opacity', 1.0);
					canvas.getItemByName('enabled_router22_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router22_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out2": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if((AnalogModeCH2=='None' || AnalogModeCH2=='Analog1') && parameter=='enabled_button_amp_router22'){
					document.getElementById('AnalogModeCH2').value = 'Analog2';
					canvas.getItemByName('enabled_router12_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router12_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router22_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router22_on').set('opacity', 1.0);
					var msg = '{ "ampg1_4c": { "Out2": { "AnalogSource": "Analog2" } } }';
					socket.send(msg);
				}	
				if((AnalogModeCH2=='Analog1' && parameter=='enabled_button_amp_router12') || (AnalogModeCH2=='Analog2' && parameter=='enabled_button_amp_router22')){
					document.getElementById('AnalogModeCH2').value = 'None';
					canvas.getItemByName('enabled_router12_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router12_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router22_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router22_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out2": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
				
				if((AnalogModeCH3=='None' || AnalogModeCH3=='Analog2') && parameter=='enabled_button_amp_router13'){
					document.getElementById('AnalogModeCH3').value = 'Analog1';
					canvas.getItemByName('enabled_router13_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router13_on').set('opacity', 1.0);
					canvas.getItemByName('enabled_router23_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router23_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out3": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if((AnalogModeCH3=='None' || AnalogModeCH3=='Analog1') && parameter=='enabled_button_amp_router23'){
					document.getElementById('AnalogModeCH3').value = 'Analog2';
					canvas.getItemByName('enabled_router13_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router13_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router23_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router23_on').set('opacity', 1.0);
					var msg = '{ "ampg1_4c": { "Out3": { "AnalogSource": "Analog2" } } }';
					socket.send(msg);
				}	
				if((AnalogModeCH3=='Analog1' && parameter=='enabled_button_amp_router13') || (AnalogModeCH3=='Analog2' && parameter=='enabled_button_amp_router23')){
					document.getElementById('AnalogModeCH3').value = 'None';
					canvas.getItemByName('enabled_router13_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router13_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router23_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router23_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out3": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
				
				if((AnalogModeCH4=='None' || AnalogModeCH4=='Analog2') && parameter=='enabled_button_amp_router14'){
					document.getElementById('AnalogModeCH4').value = 'Analog1';
					canvas.getItemByName('enabled_router14_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router14_on').set('opacity', 1.0);
					canvas.getItemByName('enabled_router24_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router24_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out4": { "AnalogSource": "Analog1" } } }';
					socket.send(msg);
				}
				if((AnalogModeCH4=='None' || AnalogModeCH4=='Analog1') && parameter=='enabled_button_amp_router24'){
					document.getElementById('AnalogModeCH4').value = 'Analog2';
					canvas.getItemByName('enabled_router14_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router14_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router24_off').set('opacity', 0.0);
					canvas.getItemByName('enabled_router24_on').set('opacity', 1.0);
					var msg = '{ "ampg1_4c": { "Out4": { "AnalogSource": "Analog2" } } }';
					socket.send(msg);
				}	
				if((AnalogModeCH4=='Analog1' && parameter=='enabled_button_amp_router14') || (AnalogModeCH4=='Analog2' && parameter=='enabled_button_amp_router24')){
					document.getElementById('AnalogModeCH4').value = 'None';
					canvas.getItemByName('enabled_router14_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router14_on').set('opacity', 0.0);
					canvas.getItemByName('enabled_router24_off').set('opacity', 1.0);
					canvas.getItemByName('enabled_router24_on').set('opacity', 0.0);
					var msg = '{ "ampg1_4c": { "Out4": { "AnalogSource": "None" } } }';
					socket.send(msg);
				}
			}
			
			update_save_settings_button();
			
		}
		if(type=='router_reset_button'){
			
			var msg;
			
			if(json_type=='Mixer' || json_type=='nqpaxxx'){
			   	document.getElementById('router_input1').value = 0;
				document.getElementById('router_input2').value = 0;
				document.getElementById('router_input3').value = 0;
				document.getElementById('router_input4').value = 0;

				document.getElementById('router_output1').value = 0;
				document.getElementById('router_output2').value = 0;
				document.getElementById('router_output3').value = 0;
				document.getElementById('router_output4').value = 0;
				document.getElementById('router_output5').value = -144;

				document.getElementById('router_cg11').value = 0;
				document.getElementById('router_cg12').value = -144;
				document.getElementById('router_cg13').value = -144;
				document.getElementById('router_cg14').value = -144;
				document.getElementById('router_cg15').value = -144;

				document.getElementById('router_cg21').value = -144;
				document.getElementById('router_cg22').value = 0;
				document.getElementById('router_cg23').value = -144;
				document.getElementById('router_cg24').value = -144;
				document.getElementById('router_cg25').value = -144;

				document.getElementById('router_cg31').value = -144;
				document.getElementById('router_cg32').value = -144;
				document.getElementById('router_cg33').value = 0;
				document.getElementById('router_cg34').value = -144;
				document.getElementById('router_cg35').value = -144;

				document.getElementById('router_cg41').value = -144;
				document.getElementById('router_cg42').value = -144;
				document.getElementById('router_cg43').value = -144;
				document.getElementById('router_cg44').value = 0;
				document.getElementById('router_cg45').value = -144;

				document.getElementById('router_enable_input1').value = 1;
				document.getElementById('router_enable_input2').value = 1;
				document.getElementById('router_enable_input3').value = 1;
				document.getElementById('router_enable_input4').value = 1;

				document.getElementById('router_enable_output1').value = 1;
				document.getElementById('router_enable_output2').value = 1;
				document.getElementById('router_enable_output3').value = 1;
				document.getElementById('router_enable_output4').value = 1;
				document.getElementById('router_enable_output5').value = 0;

				document.getElementById('router_enable_cg11').value = 1;
				document.getElementById('router_enable_cg12').value = 0;
				document.getElementById('router_enable_cg13').value = 0;
				document.getElementById('router_enable_cg14').value = 0;
				document.getElementById('router_enable_cg15').value = 0;

				document.getElementById('router_enable_cg21').value = 0;
				document.getElementById('router_enable_cg22').value = 1;
				document.getElementById('router_enable_cg23').value = 0;
				document.getElementById('router_enable_cg24').value = 0;
				document.getElementById('router_enable_cg25').value = 0;

				document.getElementById('router_enable_cg31').value = 0;
				document.getElementById('router_enable_cg32').value = 0;
				document.getElementById('router_enable_cg33').value = 1;
				document.getElementById('router_enable_cg34').value = 0;
				document.getElementById('router_enable_cg35').value = 0;

				document.getElementById('router_enable_cg41').value = 0;
				document.getElementById('router_enable_cg42').value = 0;
				document.getElementById('router_enable_cg43').value = 0;
				document.getElementById('router_enable_cg44').value = 1;
				document.getElementById('router_enable_cg45').value = 0;
				

				msg = '{ "'+json_type+'": { "Router": { "IG1": 0, "IG2": 0, "IG3": 0, "IG4": 0, "OG1": 0, "OG2": 0, "OG3": 0, "OG4": 0, "OG5": -144, "CG11": 0, "CG21": -144, "CG31": -144, "CG41": -144, "CG12": -144, "CG22": 0, "CG32": -144, "CG42": -144, "CG13": -144, "CG23": -144, "CG33": 0, "CG43": -144, "CG14": -144, "CG24": -144, "CG34": -144, "CG44": 0, "CG15": -144, "CG25": -144, "CG35": -144, "CG45": -144 } } }';
				 
			}
			
			if(json_type=='nqpaxxx'){
					
                document.getElementById('router_enable_output6').value = 0;

                document.getElementById('router_enable_cg16').value = 0;
                document.getElementById('router_enable_cg26').value = 0;
                document.getElementById('router_enable_cg36').value = 0;
                document.getElementById('router_enable_cg46').value = 0;
				
				document.getElementById('router_output6').value = -144;
				document.getElementById('router_cg16').value = -144;
				document.getElementById('router_cg26').value = -144;
				document.getElementById('router_cg36').value = -144;
				document.getElementById('router_cg46').value = -144;
				
				msg = '{ "'+json_type+'": { "Router": { "IG1": 0, "IG2": 0, "IG3": 0, "IG4": 0, "OG1": 0, "OG2": 0, "OG3": 0, "OG4": 0, "OG5": -144, "OG6": -144, "CG11": 0, "CG21": -144, "CG31": -144, "CG41": -144, "CG12": -144, "CG22": 0, "CG32": -144, "CG42": -144, "CG13": -144, "CG23": -144, "CG33": 0, "CG43": -144, "CG14": -144, "CG24": -144, "CG34": -144, "CG44": 0, "CG15": -144, "CG25": -144, "CG35": -144, "CG45": -144, "CG16": -144, "CG26": -144, "CG36": -144, "CG46": -144 } } }';
			}
			if(json_type=='ampg1_2c'){
			   	document.getElementById('router_input1').value = 0;

				document.getElementById('router_output1').value = 0;
				document.getElementById('router_output2').value = 0;

				document.getElementById('router_cg11').value = -144;
				document.getElementById('router_cg12').value = -144;

				document.getElementById('router_enable_input1').value = 1;

				document.getElementById('router_enable_output1').value = 1;
				document.getElementById('router_enable_output2').value = 1;

				document.getElementById('router_enable_cg11').value = 0;
				document.getElementById('router_enable_cg12').value = 0;
			
				document.getElementById('router_gain1').value = 14;

				msg = '{ "'+json_type+'": { "SignalGain1": 14, "Router": { "IG1": 0, "OG1": 0, "OG2": 0, "CG11": -144, "CG12": -144} } }';
			}
			if(json_type=='ampg1_4c'){
			   	document.getElementById('router_input1').value = 0;
				document.getElementById('router_input2').value = 0;

				document.getElementById('router_output1').value = 0;
				document.getElementById('router_output2').value = 0;
				document.getElementById('router_output3').value = 0;
				document.getElementById('router_output4').value = 0;

				document.getElementById('router_cg11').value = -144;
				document.getElementById('router_cg12').value = -144;
				document.getElementById('router_cg13').value = -144;
				document.getElementById('router_cg14').value = -144;

				document.getElementById('router_cg21').value = -144;
				document.getElementById('router_cg22').value = -144;
				document.getElementById('router_cg23').value = -144;
				document.getElementById('router_cg24').value = -144;

				document.getElementById('router_enable_input1').value = 1;
				document.getElementById('router_enable_input2').value = 1;

				document.getElementById('router_enable_output1').value = 1;
				document.getElementById('router_enable_output2').value = 1;
				document.getElementById('router_enable_output3').value = 1;
				document.getElementById('router_enable_output4').value = 1;

				document.getElementById('router_enable_cg11').value = 0;
				document.getElementById('router_enable_cg12').value = 0;
				document.getElementById('router_enable_cg13').value = 0;
				document.getElementById('router_enable_cg14').value = 0;

				document.getElementById('router_enable_cg21').value = 0;
				document.getElementById('router_enable_cg22').value = 0;
				document.getElementById('router_enable_cg23').value = 0;
				document.getElementById('router_enable_cg24').value = 0;

				document.getElementById('router_gain1').value = 14;
				document.getElementById('router_gain2').value = 14;
				
				msg = '{ "'+json_type+'": { "SignalGain1": 14, "SignalGain2": 14, "Router": { "IG1": 0, "IG2": 0, "OG1": 0, "OG2": 0, "OG3": 0, "OG4": 0, "CG11": -144, "CG21": -144,  "CG12": -144, "CG22": -144, "CG13": -144, "CG23": -144, "CG14": -144, "CG24": -144 } } }';
			}
			
			if(json_type=='ampg2_2c'){
			   	document.getElementById('router_input1').value = 0;
				document.getElementById('router_input2').value = 0;

				document.getElementById('router_output1').value = 0;
				document.getElementById('router_output2').value = 0;

				document.getElementById('router_cg11').value = 0;
				document.getElementById('router_cg12').value = -144;

				document.getElementById('router_cg21').value = -144;
				document.getElementById('router_cg22').value = 0;
				
				document.getElementById('router_enable_input1').value = 1;
				document.getElementById('router_enable_input2').value = 1;

				document.getElementById('router_enable_output1').value = 1;
				document.getElementById('router_enable_output2').value = 1;

				document.getElementById('router_enable_cg11').value = 1;
				document.getElementById('router_enable_cg12').value = 0;

				document.getElementById('router_enable_cg21').value = 0;
				document.getElementById('router_enable_cg22').value = 1;
				
				document.getElementById('router_gain1').value = 14;
				document.getElementById('router_gain2').value = 14;

				msg = '{ "'+json_type+'": { "In1": { "SignalGain": 14 }, "In2": { "SignalGain": 14 }, "Router": { "IG1": 0, "IG2": 0, "OG1": 0, "OG2": 0, "CG11": 0, "CG21": -144, "CG12": -144, "CG22": 0 } } }';
			}
			
			if(json_type=='ampg2_4c'){
			   	document.getElementById('router_input1').value = 0;
				document.getElementById('router_input2').value = 0;
				document.getElementById('router_input3').value = 0;
				document.getElementById('router_input4').value = 0;

				document.getElementById('router_output1').value = 0;
				document.getElementById('router_output2').value = 0;
				document.getElementById('router_output3').value = 0;
				document.getElementById('router_output4').value = 0;

				document.getElementById('router_cg11').value = 0;
				document.getElementById('router_cg12').value = -144;
				document.getElementById('router_cg13').value = -144;
				document.getElementById('router_cg14').value = -144;

				document.getElementById('router_cg21').value = -144;
				document.getElementById('router_cg22').value = 0;
				document.getElementById('router_cg23').value = -144;
				document.getElementById('router_cg24').value = -144;

				document.getElementById('router_cg31').value = -144;
				document.getElementById('router_cg32').value = -144;
				document.getElementById('router_cg33').value = 0;
				document.getElementById('router_cg34').value = -144;

				document.getElementById('router_cg41').value = -144;
				document.getElementById('router_cg42').value = -144;
				document.getElementById('router_cg43').value = -144;
				document.getElementById('router_cg44').value = 0;

				document.getElementById('router_enable_input1').value = 1;
				document.getElementById('router_enable_input2').value = 1;
				document.getElementById('router_enable_input3').value = 1;
				document.getElementById('router_enable_input4').value = 1;

				document.getElementById('router_enable_output1').value = 1;
				document.getElementById('router_enable_output2').value = 1;
				document.getElementById('router_enable_output3').value = 1;
				document.getElementById('router_enable_output4').value = 1;

				document.getElementById('router_enable_cg11').value = 1;
				document.getElementById('router_enable_cg12').value = 0;
				document.getElementById('router_enable_cg13').value = 0;
				document.getElementById('router_enable_cg14').value = 0;

				document.getElementById('router_enable_cg21').value = 0;
				document.getElementById('router_enable_cg22').value = 1;
				document.getElementById('router_enable_cg23').value = 0;
				document.getElementById('router_enable_cg24').value = 0;

				document.getElementById('router_enable_cg31').value = 0;
				document.getElementById('router_enable_cg32').value = 0;
				document.getElementById('router_enable_cg33').value = 1;
				document.getElementById('router_enable_cg34').value = 0;

				document.getElementById('router_enable_cg41').value = 0;
				document.getElementById('router_enable_cg42').value = 0;
				document.getElementById('router_enable_cg43').value = 0;
				document.getElementById('router_enable_cg44').value = 1;
				
				document.getElementById('router_gain1').value = 14;
				document.getElementById('router_gain2').value = 14;
				document.getElementById('router_gain3').value = 14;
				document.getElementById('router_gain4').value = 14;
				
				msg = '{ "'+json_type+'": { "In1": { "SignalGain": 14 }, "In2": { "SignalGain": 14 }, "In3": { "SignalGain": 14 }, "In4": { "SignalGain": 14 }, "Router": { "IG1": 0, "IG2": 0, "IG3": 0, "IG4": 0, "OG1": 0, "OG2": 0, "OG3": 0, "OG4": 0, "CG11": 0, "CG21": -144, "CG31": -144, "CG41": -144, "CG12": -144, "CG22": 0, "CG32": -144, "CG42": -144, "CG13": -144, "CG23": -144, "CG33": 0, "CG43": -144, "CG14": -144, "CG24": -144, "CG34": -144, "CG44": 0 } } }';
			}
			
			socket.send(msg);
			update_save_settings_button();

			get_router_view(); 
		}
		if(type=='geq_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var channel = mouseDownObject.get('channel');
			var enabled = document.getElementById(parameter+channel+'_enable');
			var dsp_value;
			if(enabled.value==0){
				dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('geq_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('geq_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('geq_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('geq_'+parameter+'_on').set('opacity', 0.0);
			}
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "EQG": { "'+ parameter +'": { "Enable": '+dsp_value+' } } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='geq_reset_button'){
			
			var channel = mouseDownObject.get('channel');
		
			var channel2 = channel;
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel2=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel2=5;
				}
			}
			
			document.getElementById('GEQ25HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ40HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ63HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ100HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ160HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ250HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ400HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ630HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ1000HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ1600HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ2500HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ4000HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ6300HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ10000HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ16000HZ'+channel+'_fader').value = 0;
			document.getElementById('GEQ20000HZ'+channel+'_fader').value = 0;
			
			document.getElementById('GEQ25HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ40HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ63HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ100HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ160HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ250HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ400HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ630HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ1000HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ1600HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ2500HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ4000HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ6300HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ10000HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ16000HZ'+channel+'_enable').value = 1;
			document.getElementById('GEQ20000HZ'+channel+'_enable').value = 1;
						
			var msg = '{ "'+json_type+'": { "In'+ channel2 +'": { "EQG": { "GEQ25HZ": { "Boost": 0, "Enable": true }, "GEQ40HZ": { "Boost": 0, "Enable": true }, "GEQ63HZ": { "Boost": 0, "Enable": true }, "GEQ100HZ": { "Boost": 0, "Enable": true  }, "GEQ160HZ": { "Boost": 0, "Enable": true }, "GEQ250HZ": { "Boost": 0, "Enable": true }, "GEQ400HZ": { "Boost": 0, "Enable": true }, "GEQ630HZ": { "Boost": 0, "Enable": true }, "GEQ1000HZ": { "Boost": 0, "Enable": true }, "GEQ1600HZ": { "Boost": 0, "Enable": true }, "GEQ2500HZ": { "Boost": 0, "Enable": true }, "GEQ4000HZ": { "Boost": 0, "Enable": true }, "GEQ6300HZ": { "Boost": 0, "Enable": true }, "GEQ10000HZ": { "Boost": 0, "Enable": true }, "GEQ16000HZ": { "Boost": 0, "Enable": true }, "GEQ20000HZ": { "Boost": 0, "Enable": true } } } } }';
			socket.send(msg);
			update_save_settings_button();
			get_geq_view(channel);
		   
		}
		if(type=='peq_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var channel = mouseDownObject.get('channel');
			var enabled = document.getElementById(parameter+channel+'_enable');
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('peq_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('peq_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('peq_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('peq_'+parameter+'_on').set('opacity', 0.0);
			}
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			
			var channel_name = '';
			if(json_type=='nqga20' || json_type=='nqga40'){
			   channel_name = 'Ch1';
			} else if(json_type=='nqga400p'){
				if(channel==3){
				   channel_name = 'Out1';
				}
				if(channel==4){
				   channel_name = 'Out2';
				}
			} else {
			   channel_name = 'In'+ channel;
			}
			
			var msg = '{ "'+json_type+'": { "'+ channel_name +'": { "EQP": { "'+ parameter +'": { "Enable": '+dsp_value+' } } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='peq_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			var channel2 = channel;
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel2=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel2=5;
				}
			}
			
			document.getElementById('S1'+channel+'_fader').value = 0;
			document.getElementById('S2'+channel+'_fader').value = 0;
			document.getElementById('S3'+channel+'_fader').value = 0;
			document.getElementById('S4'+channel+'_fader').value = 0;
			document.getElementById('S5'+channel+'_fader').value = 0;
			document.getElementById('S6'+channel+'_fader').value = 0;
			document.getElementById('S7'+channel+'_fader').value = 0;
			
			document.getElementById('S1'+channel+'_enable').value = 1;
			document.getElementById('S2'+channel+'_enable').value = 1;
			document.getElementById('S3'+channel+'_enable').value = 1;
			document.getElementById('S4'+channel+'_enable').value = 1;
			document.getElementById('S5'+channel+'_enable').value = 1;
			document.getElementById('S6'+channel+'_enable').value = 1;
			document.getElementById('S7'+channel+'_enable').value = 1;
			
			document.getElementById('S1'+channel+'_freq').value = 40;
			document.getElementById('S2'+channel+'_freq').value = 100;
			document.getElementById('S3'+channel+'_freq').value = 400;
			document.getElementById('S4'+channel+'_freq').value = 1000;
			document.getElementById('S5'+channel+'_freq').value = 4000;
			document.getElementById('S6'+channel+'_freq').value = 10000;
			document.getElementById('S7'+channel+'_freq').value = 16000;
			
			document.getElementById('S1'+channel+'_q').value = 1.4;
			document.getElementById('S2'+channel+'_q').value = 1.4;
			document.getElementById('S3'+channel+'_q').value = 1.4;
			document.getElementById('S4'+channel+'_q').value = 1.4;
			document.getElementById('S5'+channel+'_q').value = 1.4;
			document.getElementById('S6'+channel+'_q').value = 1.4;
			document.getElementById('S7'+channel+'_q').value = 1.4;
			
			if(json_type=='nqga400p'){
				
				document.getElementById('S1'+channel+'_fader').value = 0;
                document.getElementById('S2'+channel+'_fader').value = 0;
                document.getElementById('S3'+channel+'_fader').value = 0;
                document.getElementById('S4'+channel+'_fader').value = 0;
                document.getElementById('S5'+channel+'_fader').value = 0;

                document.getElementById('S1'+channel+'_enable').value = 1;
                document.getElementById('S2'+channel+'_enable').value = 1;
                document.getElementById('S3'+channel+'_enable').value = 1;
                document.getElementById('S4'+channel+'_enable').value = 1;
                document.getElementById('S5'+channel+'_enable').value = 1;

                document.getElementById('S1'+channel+'_freq').value = 60;
                document.getElementById('S2'+channel+'_freq').value = 250;
                document.getElementById('S3'+channel+'_freq').value = 1000;
                document.getElementById('S4'+channel+'_freq').value = 4000;
                document.getElementById('S5'+channel+'_freq').value = 16000;

                document.getElementById('S1'+channel+'_q').value = 1.4;
                document.getElementById('S2'+channel+'_q').value = 1.4;
                document.getElementById('S3'+channel+'_q').value = 1.4;
                document.getElementById('S4'+channel+'_q').value = 1.4;
                document.getElementById('S5'+channel+'_q').value = 1.4;
			}
			
			var channel_name = '';
			
			if(json_type=='nqga20' || json_type=='nqga40'){
			   channel_name = 'Ch1';
			} else if(json_type=='nqga400p'){
				if(channel==3){
				   channel_name = 'Out1';
				}
				if(channel==4){
				   channel_name = 'Out2';
				}
			} else {
			   channel_name = 'In'+ channel2;
			}
			
			var msg;
			
			if(json_type=='nqga400p'){
				msg = '{ "'+json_type+'": { "'+ channel_name  +'": { "EQP": { "S1": { "Frequency": 60, "Q": 1.40, "Boost": 0, "Enable": true }, "S2": { "Frequency": 250, "Q": 1.40, "Boost": 0, "Enable": true }, "S3": { "Frequency": 1000, "Q": 1.40, "Boost": 0, "Enable": true }, "S4": { "Frequency": 4000, "Q": 1.40, "Boost": 0, "Enable": true }, "S5": { "Frequency": 16000, "Q": 1.40, "Boost": 0, "Enable": true } } } } }';
			} else {
				msg = '{ "'+json_type+'": { "'+ channel_name  +'": { "EQP": { "S1": { "Frequency": 40, "Q": 1.40, "Boost": 0, "Enable": true }, "S2": { "Frequency": 100, "Q": 1.40, "Boost": 0, "Enable": true }, "S3": { "Frequency": 400, "Q": 1.40, "Boost": 0, "Enable": true }, "S4": { "Frequency": 1000, "Q": 1.40, "Boost": 0, "Enable": true }, "S5": { "Frequency": 4000, "Q": 1.40, "Boost": 0, "Enable": true }, "S6": { "Frequency": 10000, "Q": 1.40, "Boost": 0, "Enable": true }, "S7": { "Frequency": 16000, "Q": 1.40, "Boost": 0, "Enable": true } } } } }';
			}
			socket.send(msg);
			update_save_settings_button();
		}
		if(type=='compressor_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var channel = mouseDownObject.get('channel');
			var enabled = document.getElementById(parameter+'_compressor'+channel);
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('compressor_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('compressor_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('compressor_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('compressor_'+parameter+'_on').set('opacity', 0.0);
			}
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			
			var channel_name = 'In'+ channel;
			
			if(json_type=='nqga20'){
			   channel_name = 'Ch1';
			}
			if(json_type=='nqga40'){
			   channel_name = 'Ch1';
			}
			
			var msg = '{ "'+json_type+'": { "'+ channel_name  +'": { "Compressor": { "Enable": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='compressor_reset_button'){

			var channel = mouseDownObject.get('channel');
			var channel2 = channel;
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel2=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel2=5;
				}
			}
			
			document.getElementById('Enabled_compressor'+channel).value = 0;
			if(json_type=='nqga20' || json_type=='nqga40'){
			   document.getElementById('Threshold_compressor'+channel).value = 6;
			} else {
			   document.getElementById('Threshold_compressor'+channel).value = 21;
			}
			document.getElementById('Attack_compressor'+channel).value = 73;
			document.getElementById('Hold_compressor'+channel).value = 73;
			document.getElementById('Decay_compressor'+channel).value = 868;
			document.getElementById('Knee_compressor'+channel).value = 1;
			document.getElementById('Ratio_compressor'+channel).value = 1;
			
			var channel_name = '';
			
			if(json_type=='nqga20' || json_type=='nqga40'){
			   channel_name = 'Ch1';
			} else {
			   channel_name = 'In'+ channel2;
			}
			
			var threshold = '';
			
			if(json_type=='nqga20' || json_type=='nqga40'){
			   threshold  = '6';
			} else {
			   threshold = '21';
			}
					  
			var msg = '{ "'+json_type+'": { "'+ channel_name +'": { "Compressor": { "Enable": false, "Threshold": '+threshold +', "Attack": 73, "Hold": 73, "Decay": 868, "Knee": 1, "Ratio": 1 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_compressor_view(channel);
		   
		}
		if(type=='noise_gate_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_noise_gate'+channel);
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('noise_gate_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('noise_gate_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('noise_gate_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('noise_gate_'+parameter+'_on').set('opacity', 0.0);
			}
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Noise Gate": { "Enable": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='noise_gate_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			var channel2 = channel;
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel2=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel2=5;
				}
			}
			
			var msg = '{ "'+json_type+'": { "In'+ channel2 +'": { "Noise Gate": { "Enable": false, "Threshold": -135, "Attack": 73, "Hold": 73, "Decay": 868 } } } }';
			
			if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
				document.getElementById('Enabled_noise_gate'+channel).value = 1;
				document.getElementById('Threshold_noise_gate'+channel).value = -70;
				document.getElementById('Attack_noise_gate'+channel).value = 73;
				document.getElementById('Hold_noise_gate'+channel).value = 73;
				document.getElementById('Decay_noise_gate'+channel).value = 868;
				
				msg = '{ "'+json_type+'": { "In'+ channel2 +'": { "Noise Gate": { "Enable": true, "Threshold": -70, "Attack": 73, "Hold": 73, "Decay": 868 } } } }';
			   
			} else {
			   	document.getElementById('Enabled_noise_gate'+channel).value = 0;
				document.getElementById('Threshold_noise_gate'+channel).value = -135;
				document.getElementById('Attack_noise_gate'+channel).value = 73;
				document.getElementById('Hold_noise_gate'+channel).value = 73;
				document.getElementById('Decay_noise_gate'+channel).value = 868;
			}
			
			socket.send(msg);
			update_save_settings_button();
						
			get_noise_gate_view(channel);
		}
		if(type=='ducker_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_ducker');
			var dsp_value;
			var dsp_value2;
			var parameter2;
			var msg;
			if(enabled.value==0){
				
				if(parameter.includes("Ducked")){
				
					var MasterIn1_ducker = document.getElementById('MasterIn1_ducker').value;
					var MasterIn2_ducker = document.getElementById('MasterIn2_ducker').value;
					var MasterIn3_ducker = document.getElementById('MasterIn3_ducker').value;
					var MasterIn4_ducker = document.getElementById('MasterIn4_ducker').value;
					
					if((MasterIn1_ducker==1 && parameter=='DuckedIn1') || (MasterIn2_ducker==1 && parameter=='DuckedIn2') || (MasterIn3_ducker==1 && parameter=='DuckedIn3') || (MasterIn4_ducker==1 && parameter=='DuckedIn4')){
					   	dsp_value = false;
						enabled.value=0;
						canvas.getItemByName('ducker_'+parameter+'_off').set('opacity', 1.0);
						canvas.getItemByName('ducker_'+parameter+'_on').set('opacity', 0.0);
					 } else {
						dsp_value = true;
			   			enabled.value=1;
					 	canvas.getItemByName('ducker_'+parameter+'_off').set('opacity', 0.0);
						canvas.getItemByName('ducker_'+parameter+'_on').set('opacity', 1.0); 
					 }
				}		
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('ducker_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('ducker_'+parameter+'_on').set('opacity', 0.0);
			}
			
			if(parameter.includes("Master")){
				canvas.getItemByName('ducker_MasterIn1_off').set('opacity', 1.0);
				canvas.getItemByName('ducker_MasterIn1_on').set('opacity', 0.0);
				document.getElementById('MasterIn1_ducker').value=0;
				
				canvas.getItemByName('ducker_MasterIn2_off').set('opacity', 1.0);
				canvas.getItemByName('ducker_MasterIn2_on').set('opacity', 0.0);
				document.getElementById('MasterIn2_ducker').value=0;
				
				canvas.getItemByName('ducker_MasterIn3_off').set('opacity', 1.0);
				canvas.getItemByName('ducker_MasterIn3_on').set('opacity', 0.0);
				document.getElementById('MasterIn3_ducker').value=0;
				
				canvas.getItemByName('ducker_MasterIn4_off').set('opacity', 1.0);
				canvas.getItemByName('ducker_MasterIn4_on').set('opacity', 0.0);
				document.getElementById('MasterIn4_ducker').value=0;
				
				if(parameter=='MasterIn1'){
			   		dsp_value = 'IN1';
					parameter = 'Master';
					canvas.getItemByName('ducker_MasterIn1_off').set('opacity', 0.0);
					canvas.getItemByName('ducker_MasterIn1_on').set('opacity', 1.0);
					document.getElementById('MasterIn1_ducker').value=1;
					
					canvas.getItemByName('ducker_DuckedIn1_off').set('opacity', 1.0);
					canvas.getItemByName('ducker_DuckedIn1_on').set('opacity', 0.0);
					document.getElementById('DuckedIn1_ducker').value=0;
					parameter2 = 'DuckedIn1';
					dsp_value2 = false;
				}
				if(parameter=='MasterIn2'){
			   		dsp_value = 'IN2';
					parameter = 'Master';
					canvas.getItemByName('ducker_MasterIn2_off').set('opacity', 0.0);
					canvas.getItemByName('ducker_MasterIn2_on').set('opacity', 1.0);
					document.getElementById('MasterIn2_ducker').value=1;
					
					canvas.getItemByName('ducker_DuckedIn2_off').set('opacity', 1.0);
					canvas.getItemByName('ducker_DuckedIn2_on').set('opacity', 0.0);
					document.getElementById('DuckedIn2_ducker').value=0;
					parameter2 = 'DuckedIn2';
					dsp_value2 = false;
				}
				if(parameter=='MasterIn3'){
			   		dsp_value = 'IN3';
					parameter = 'Master';
					canvas.getItemByName('ducker_MasterIn3_off').set('opacity', 0.0);
					canvas.getItemByName('ducker_MasterIn3_on').set('opacity', 1.0);
					document.getElementById('MasterIn3_ducker').value=1;
					
					canvas.getItemByName('ducker_DuckedIn3_off').set('opacity', 1.0);
					canvas.getItemByName('ducker_DuckedIn3_on').set('opacity', 0.0);
					document.getElementById('DuckedIn3_ducker').value=0;
					parameter2 = 'DuckedIn3';
					dsp_value2 = false;
				}
				if(parameter=='MasterIn4'){
			   		dsp_value = 'IN4';
					parameter = 'Master';
					canvas.getItemByName('ducker_MasterIn4_off').set('opacity', 0.0);
					canvas.getItemByName('ducker_MasterIn4_on').set('opacity', 1.0);
					document.getElementById('MasterIn4_ducker').value=1;
					
					canvas.getItemByName('ducker_DuckedIn4_off').set('opacity', 1.0);
					canvas.getItemByName('ducker_DuckedIn4_on').set('opacity', 0.0);
					document.getElementById('DuckedIn4_ducker').value=0;
					parameter2 = 'DuckedIn4';
					dsp_value2 = false;
				}
				msg = '{ "'+json_type+'": { "Ducker": { "'+parameter+'": "'+dsp_value+'" , "'+parameter2+'": '+dsp_value2+' } } }';
			 } else {
				msg = '{ "'+json_type+'": { "Ducker": { "'+parameter+'": '+dsp_value+' } } }';
			 }
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='ducker_reset_button'){
			
			document.getElementById('Master_ducker').value = 'IN1';
			document.getElementById('MasterIn1_ducker').value = 1;
			document.getElementById('MasterIn2_ducker').value = 0;
			document.getElementById('MasterIn3_ducker').value = 0;
			document.getElementById('MasterIn4_ducker').value = 0;
			document.getElementById('Threshold_ducker').value = -20;
			document.getElementById('Hold_ducker').value = 500;
			document.getElementById('DuckedIn1_ducker').value = 0;
			document.getElementById('DuckedIn2_ducker').value = 0;
			document.getElementById('DuckedIn3_ducker').value = 0;
			document.getElementById('DuckedIn4_ducker').value = 0;
							  
			var msg = '{ "'+json_type+'": { "Ducker": { "Master": "IN1", "DuckedIn1": false, "DuckedIn2": false, "DuckedIn3": false, "DuckedIn4": false, "Threshold": -20, "Hold": 500  } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_ducker_view();
		   
		}
		if(type=='hplp_enable_button'){
		    var name = mouseDownObject.get('name');
			var type2 = mouseDownObject.get('type2');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_'+type2+channel+'_hplp');
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('hplp_'+parameter+'_'+type2+'_off').set('opacity', 0.0);
				canvas.getItemByName('hplp_'+parameter+'_'+type2+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('hplp_'+parameter+'_'+type2+'_off').set('opacity', 1.0);
				canvas.getItemByName('hplp_'+parameter+'_'+type2+'_on').set('opacity', 0.0);
			}
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel=5;
				}
			}
			
			var channel_name = '';
			
			if(json_type=='nqga20' || json_type=='nqga40'){
			   channel_name = 'Ch1';
			} else if(json_type=='nqga400p'){
				if(channel==3){
				   channel_name = 'Out1';
				}
				if(channel==4){
				   channel_name = 'Out2';
				}	  
			} else {
			   channel_name = 'In'+ channel;
			}
			
			var msg = '{ "'+json_type+'": { "'+ channel_name +'": { "'+type2.toUpperCase()+'": { "Enable": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='standby_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_standby');
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('standby_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('standby_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('standby_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('standby_'+parameter+'_on').set('opacity', 0.0);
			}
	
			var msg = '{ "'+json_type+'": { "StandbyEnable": '+dsp_value+' } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='mute_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_mute');
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('mute_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('mute_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('mute_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('mute_'+parameter+'_on').set('opacity', 0.0);
			}
	
			var msg = '{ "'+json_type+'": { "MuteEnable": '+dsp_value+' } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='hplp_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			var channel2 = channel;
			if(json_type=='Mixer'){
			   if(channel==6){
				  channel2=5;
				}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				  channel2=5;
				}
			}
			
			document.getElementById('Frequency_hp'+channel+'_hplp').value = 20;
			document.getElementById('Frequency_lp'+channel+'_hplp').value = 20000;
			document.getElementById('Enabled_hp'+channel+'_hplp').value = 0;
			document.getElementById('Enabled_lp'+channel+'_hplp').value = 0;
			document.getElementById('Type_hp'+channel+'_hplp').value = 'Linkwitz_Riley_12DB';
			document.getElementById('Type_lp'+channel+'_hplp').value = 'Linkwitz_Riley_12DB';
			document.getElementById('hp_type'+channel).value = 'Linkwitz_Riley_12DB';
			document.getElementById('lp_type'+channel).value = 'Linkwitz_Riley_12DB';
			
			var channel_name = '';
			
			if(json_type=='nqga20' || json_type=='nqga40'){
			   channel_name = 'Ch1';
			} else if(json_type=='nqga400p'){
				if(channel==3){
				   channel_name = 'Out1';
				}
				if(channel==4){
				   channel_name = 'Out2';
				}	  
			} else {
			   channel_name = 'In'+ channel2;
			}
						  
			var msg = '{ "'+json_type+'": { "'+ channel_name +'": { "HP": { "Frequency": 20, "Enable": false, "Type": "Linkwitz_Riley_12DB" }, "LP": { "Frequency": 20000, "Enable": false, "Type": "Linkwitz_Riley_12DB" } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_hplp_view(channel);
		}
		if(type=='limiter_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			var channel2 = channel;
			document.getElementById('Threshold_limiter'+channel).value = 0;
			document.getElementById('Decay_limiter'+channel).value = 12;
			document.getElementById('RMSTC_limiter'+channel).value = 50;
			
			var in_out = 'In';
			
			if(json_type=='Mixer'){
			   if(channel==5){
			   		in_out = 'Out';
			 	}
				if(channel==6){
			   		in_out = 'In';
					channel2=5;
			 	}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				   channel2=5;
				} else if(channel==4){
					channel2=1;	  
					in_out = 'Out';
				} else if(channel==5){
					channel2=2;	  
					in_out = 'Out';	  
				}
			}
			if(json_type=='nqpaxxx'){
			   	if(channel==7){
					in_out = 'Out';
					channel2=5;
				}
				if(channel==8){
					in_out = 'Out';
					channel2=6;
				}
			}
			if(json_type=='nqga40'){
			   	if(channel==1){
					in_out = 'In';
					channel2=1;
				}
				if(channel==2){
					in_out = 'Ch';
					channel2=1;
				}
			}
			var channel_name = '';
			if(json_type=='nqga20'){
			   channel_name = 'Ch1';
			} else {
			   channel_name = in_out + channel2;
			}
			
			var msg = '{ "'+json_type+'": { "'+channel_name +'": { "Limiter": { "Threshold": 0, "Decay": 12, "RMSTC": 50 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_limiter_view(channel);
		}
		if(type=='signal_present_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			var channel2 = channel; 
			document.getElementById('Threshold_signal_present'+channel).value = -50;
			document.getElementById('Trigger_signal_present'+channel).value = 2;
			
			var in_out = 'In';
			
			if(json_type=='Mixer'){
				if(channel==5){
			   		in_out = 'Out';
			 	}
				if(channel==6){
			   		in_out = 'In';
					channel2=5;	
			 	}
			}
			if(json_type=='ampg1_2c'){
			   if(channel==3){
				   channel2=5;
				} else if(channel==4){
					channel2=1;	  
					in_out = 'Out';
				} else if(channel==5){
					channel2=2;	  
					in_out = 'Out';	  
				}
			}
			if(json_type=='nqga20'){
			   	channel2=1;	  
				in_out = 'Ch';
			}
			if(json_type=='nqpaxxx'){
			   	if(channel==7){
					in_out = 'Out';
					channel2=5;
				}
				if(channel==8){
					in_out = 'Out';
					channel2=6;
				}
			}
			if(json_type=='nqga400p'){
			   	if(channel==3){
					in_out = 'Out';
					channel2=1;
				}
				if(channel==4){
					in_out = 'Out';
					channel2=2;
				}
			}
			if(json_type=='nqga40'){
			   	if(channel==1){
					in_out = 'In';
					channel2=1;
				}
				if(channel==2){
					in_out = 'Ch';
					channel2=1;
				}
			}
			
			var msg = '{ "'+json_type+'": { "'+in_out + channel2 +'": { "Signal": { "Threshold": -50, "Trigger": 2 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_signal_present_view(channel);
		}
		if(type=='settings_reset_button'){
					
			if(json_type=='Mixer'){
			   	document.getElementById('name1_input').value = 'Analog 1';
				document.getElementById('name2_input').value = 'Analog 2';
				document.getElementById('name3_input').value = 'Analog 3';
				document.getElementById('name4_input').value = 'Analog 4';
				document.getElementById('name5_input').value = 'Analog 1';
				document.getElementById('name6_input').value = 'Network 1';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
				document.getElementById('color3_input').value = 'grey';
				document.getElementById('color4_input').value = 'grey';
				document.getElementById('color5_input').value = 'grey';
				document.getElementById('color6_input').value = 'grey';
			}
			if(json_type=='ampg1_2c'){
			   	document.getElementById('name1_input').value = 'Label 1';
				document.getElementById('name2_input').value = 'Label 2';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
			}
			if(json_type=='ampg1_4c'){
			   	document.getElementById('name1_input').value = 'Label 1';
				document.getElementById('name2_input').value = 'Label 2';
				document.getElementById('name3_input').value = 'Label 3';
				document.getElementById('name4_input').value = 'Label 4';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
				document.getElementById('color3_input').value = 'grey';
				document.getElementById('color4_input').value = 'grey';
			}
			if(json_type=='nqga20'){
			   	document.getElementById('name1_input').value = 'Network';
				document.getElementById('color1_input').value = 'grey';
			 }
			if(json_type=='nqpaxxx'){
			   	document.getElementById('name1_input').value = 'Analog 1';
				document.getElementById('name2_input').value = 'Analog 2';
				document.getElementById('name3_input').value = 'Analog 3';
				document.getElementById('name4_input').value = 'Analog 4';
				document.getElementById('name5_input').value = 'Network 1';
				document.getElementById('name6_input').value = 'Network 2';
				document.getElementById('name7_input').value = 'Line Out';
				document.getElementById('name8_input').value = 'Speaker Out';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
				document.getElementById('color3_input').value = 'grey';
				document.getElementById('color4_input').value = 'grey';
				document.getElementById('color5_input').value = 'grey';
				document.getElementById('color6_input').value = 'grey';
				document.getElementById('color7_input').value = 'grey';
				document.getElementById('color8_input').value = 'grey';
			}
			if(json_type=='ampg2_2c'){
			   	document.getElementById('name1_input').value = 'Label 1';
				document.getElementById('name2_input').value = 'Label 2';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
			}
			if(json_type=='ampg2_4c'){
			   	document.getElementById('name1_input').value = 'Label 1';
				document.getElementById('name2_input').value = 'Label 2';
				document.getElementById('name3_input').value = 'Label 3';
				document.getElementById('name4_input').value = 'Label 4';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
				document.getElementById('color3_input').value = 'grey';
				document.getElementById('color4_input').value = 'grey';
			}
			if(json_type=='nqga400p'){
			   	document.getElementById('name1_input').value = 'In 1';
				document.getElementById('name2_input').value = 'In 2';
				document.getElementById('name3_input').value = 'Out 1';
				document.getElementById('name4_input').value = 'Out 2';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
				document.getElementById('color3_input').value = 'grey';
				document.getElementById('color4_input').value = 'grey';
			}
			if(json_type=='nqga40'){
			   	document.getElementById('name1_input').value = 'Input';
				document.getElementById('name2_input').value = 'Output';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
			}
			if(json_type=='nq-dsc01'){
			   	document.getElementById('name1_input').value = 'Input';
				document.getElementById('name2_input').value = 'Output';
				
				document.getElementById('color1_input').value = 'grey';
				document.getElementById('color2_input').value = 'grey';
			}
		}
		if(type=='duplexer_reset_button'){
			
			document.getElementById('Threshold_noise_gate_duplexer').value = -53;
			if(json_type=='edp01'){
			    document.getElementById('Threshold_noise_gate_duplexer').value = -60;
			}
			document.getElementById('Talkback_threshold_duplexer').value = -53;
			document.getElementById('Talkback_decay_duplexer').value = 100;
			
			var msg = '{ "'+json_type+'": { "Speaker Threshold": { "Volume": -53 }, "In1": { "Talkback Threshold": { "Volume": -53 } }, "In1": { "Peak Envelope": { "Decay": 100 } } } }';
			if(json_type=='edp01'){
			    msg = '{ "'+json_type+'": { "Noise Gate": { "Threshold": -60 } } }';
			}
			
			socket.send(msg);
			update_save_settings_button();
						
			get_duplexer_view();
		}
		if(type=='outputs_reset_button'){
			
			document.getElementById('SpkMute').value = '0';
			document.getElementById('LineMute').value = '0';
			document.getElementById('SpkVol').value = '0';
			document.getElementById('LineVol').value = '0';
				
			var msg = '{"'+json_type+'": { "Ch1": { "Speaker": { "Mute": false, "Volume": 0 },  "Line": { "Mute": false, "Volume": 0 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_outputs_view();
		}
		if(type=='delay_reset_button'){
			
			var channel = mouseDownObject.get('channel');
	
			document.getElementById('Delay_delay'+channel).value = 0;
			
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Delay": 0 } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_delay_view(channel);
		}
		if(type=='phase_invert_reset_button'){
			
			var channel = mouseDownObject.get('channel');
	
			document.getElementById('Phase_invert'+channel).value = 0;
			
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "PhaseInvert": false } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_phase_invert_view(channel);
		}
		if(type=='standby_reset_button'){
			document.getElementById('Enabled_standby').value = 0;
			document.getElementById('Threshold_standby_ab').value = -70;
			document.getElementById('Threshold_standby_cd').value = -70;
			
			var msg;
			if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
			   msg = '{ "'+json_type+'": { "StandbyEnable": false, "AmpAB": { "StandbySignal": { "Threshold": -70  } } } }';
			}
			var msg;
			if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
			   msg = '{ "'+json_type+'": { "StandbyEnable": false, "AmpAB": { "StandbySignal": { "Threshold": -70  } }, "AmpCD": { "StandbySignal": { "Threshold": -70  } } } }';
			}
						
			socket.send(msg);
			update_save_settings_button();
						
			get_standby_view();
		}
		if(type=='mute_reset_button'){
			document.getElementById('Enabled_mute').value = 1;
			document.getElementById('Threshold_mute_ab').value = -70;
			document.getElementById('Threshold_mute_cd').value = -70;
			
			var msg;
			if(json_type=='ampg2_2c'){
			   msg = '{ "'+json_type+'": { "MuteEnable": true, "AmpAB": { "MuteSignal": { "Threshold": -70  } } } }';
			}
			var msg;
			if(json_type=='ampg2_4c'){
			   msg = '{ "'+json_type+'": { "MuteEnable": true, "AmpAB": { "MuteSignal": { "Threshold": -70  } }, "AmpCD": { "MuteSignal": { "Threshold": -70  } } } }';
			}
						
			socket.send(msg);
			update_save_settings_button();
						
			get_mute_view();
		}
		if(type=='Mode_touch'){
			var phantom = document.getElementById('Phantom'+channel).value;
			var mode = document.getElementById('Mode'+channel).value;
			var channel = mouseDownObject.get('channel');
			var data = '';
			var left = 0;
			if(channel==1){
				if(json_type=='nqpaxxx'){
				   if(mode=='LINE'){
                        document.getElementById('Mode'+channel).value = 'MIC';
                        data='MIC';
                        left = 69;
                    } else {
                        document.getElementById('Mode'+channel).value = 'LINE';
                        data='LINE';
                        left = 43;

                         // move phantom switch to off
                         document.getElementById('Phantom'+channel).value = '0';
                          var phantom_left = 114;
                         canvas.getItemByName('phantom_button'+channel).set('left', phantom_left);	
						
					}
				} else {
					if(mode=='LINE'){
                        document.getElementById('Mode'+channel).value = 'AES';
                        data='AES';
                        left = 60;
                    }
                    if(mode=='AES'){
                        document.getElementById('Mode'+channel).value = 'MIC';
                        data='MIC';
                        left = 82;
                    }
                    if(mode=='MIC'){
                        document.getElementById('Mode'+channel).value = 'LINE';
                        data='LINE';
                        left = 36;

                        // move phantom switch to off
                       document.getElementById('Phantom'+channel).value = '0';
                        var phantom_left = 121;
                       canvas.getItemByName('phantom_button'+channel).set('left', phantom_left);
                    }
				}
			}
			if(channel>1){
			   if(mode=='LINE'){
				   document.getElementById('Mode'+channel).value = 'MIC';
				   data = 'MIC';
				   if(channel==2){
					  left = 279;
					}
				   if(channel==3){
					  left = 489;
					}
				   if(channel==4){
					  left = 699;
					}
			   } else {
				   document.getElementById('Mode'+channel).value = 'LINE';
				   data='LINE';
				   if(channel==2){
					  left = 253;
					}
				   if(channel==3){
					  left = 463;
					}
				   if(channel==4){
					  left = 673;
					}
				   
				   // move phantom switch to off
				   document.getElementById('Phantom'+channel).value = '0';
				   var phantom_left;
					if(channel==1){
						phantom_left = 121;
					}
					if(channel==2){
						phantom_left = 324;
					}
					if(channel==3){
						phantom_left = 534;
					}
					if(channel==4){
						phantom_left = 744;
					}	
				   canvas.getItemByName('phantom_button'+channel).set('left', phantom_left);
			   }
			 }
			canvas.getItemByName('mode_button'+channel).set('left', left);
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Mode": "'+data+'" } } }';
			socket.send(msg);
			update_save_settings_button();
		}	
		if(type=='outputs_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var parameter2 = mouseDownObject.get('parameter2');
			var enabled = document.getElementById(parameter2); // mute
			var dsp_value;
			if(enabled.value==0){
				dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('enabled_'+parameter.toLowerCase()+'_off').set('opacity', 1.0);
				canvas.getItemByName('enabled_'+parameter.toLowerCase()+'_on').set('opacity', 0.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('enabled_'+parameter.toLowerCase()+'_off').set('opacity', 0.0);
				canvas.getItemByName('enabled_'+parameter.toLowerCase()+'_on').set('opacity', 1.0);
			}
			var msg = '{ "'+json_type+'":{ "Ch1": { "'+ parameter +'": { "Mute": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='Phantom_touch'){
			var phantom = document.getElementById('Phantom'+channel).value;
			var mode = document.getElementById('Mode'+channel).value;
			var channel = mouseDownObject.get('channel');
			var data = '';
			var left = 0;
			if(phantom=='1'){
				document.getElementById('Phantom'+channel).value = '0';
				data='false';
				if(channel==1){
					if(json_type=='nqpaxxx'){
					   left = 115;
					} else {
						left = 121;
					}
				}
				if(channel==2){
					left = 324;
				}
			   	if(channel==3){
					left = 534;
				}
			   	if(channel==4){
					left = 744;
				}	
				canvas.getItemByName('phantom_button'+channel).set('left', left);
				var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Phantom": '+data+' } } }';
				socket.send(msg);
				update_save_settings_button();
			} else {
				if(mode=='MIC'){
				   document.getElementById('Phantom'+channel).value = '1';
					data='true';
					if(channel==1){
						if(json_type=='nqpaxxx'){
                           left = 140;
                        } else {
                            left = 145;
                        }
					}
					if(channel==2){
						left = 350;
					}
					if(channel==3){
						left = 560;
					}
					if(channel==4){
						left = 770;
					}	
					canvas.getItemByName('phantom_button'+channel).set('left', left);
					var msg = '{ "'+json_type+'": { "In'+ channel +'": { "Phantom": '+data+' } } }';
					socket.send(msg);
					update_save_settings_button();
				}
			}
		}
		if(type=='phase_invert_enable_button'){  
			
			var enabled = document.getElementById('Phase_invert'+channel);
			var channel = mouseDownObject.get('channel');
			var left = 0;
			
			if(enabled.value==0){
			   enabled.value=1;
				canvas.getItemByName('phase_invert_Enabled_off').set('opacity', 0.0);
				canvas.getItemByName('phase_invert_Enabled_on').set('opacity', 1.0);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PhaseInvert": true } } }';
				socket.send(msg);
				update_save_settings_button();
			} else {
				enabled.value=0;
				canvas.getItemByName('phase_invert_Enabled_off').set('opacity', 1.0);
				canvas.getItemByName('phase_invert_Enabled_on').set('opacity', 0.0);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PhaseInvert": false } } }';
				socket.send(msg);
				update_save_settings_button();
			}
		}
		if(type=='invert_touch'){
			
			var enabled = document.getElementById('Phase_invert'+channel);
			
			var adjustment3 = 0;
			var adjustment4 = 0;
			if(IsDualChannel==0){
			   adjustment3 = -210;
			   adjustment4 = -210;
			 }
			
			if(enabled.value==0){
			   enabled.value=1;
				if(channel==1){
				   left=149;
				}
				if(channel==2){
				   left=359;
				}
				if(channel==3){
				   left=569+adjustment3;
				}
				if(channel==4){
				   left=779+adjustment4;
				}
				canvas.getItemByName('invert_button'+channel).set('left', left);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PhaseInvert": true } } }';
				socket.send(msg);
				update_save_settings_button();
			} else {
				enabled.value=0;
				if(channel==1){
				   left=124;
				}
				if(channel==2){
				   left=334;
				}
				if(channel==3){
				   left=544+adjustment3;
				}
				if(channel==4){
				   left=754+adjustment4;
				}
				canvas.getItemByName('invert_button'+channel).set('left', left);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PhaseInvert": false } } }';
				socket.send(msg);
				update_save_settings_button();
			}
			
		}
		if(type=='noise_gen_touch'){
			
			var enabled = document.getElementById('pink_noise_enabled'+channel);
			
			var adjustment3 = 0;
			var adjustment4 = 0;
			if(IsDualChannel==0){
			   adjustment3 = -210;
			   adjustment4 = -210;
			 }
			
			if(enabled.value==0){
			   enabled.value=1;
				if(channel==1){
				   left=59;
				}
				if(channel==2){
				   left=269;
				}
				if(channel==3){
				   left=479+adjustment3;
				}
				if(channel==4){
				   left=689+adjustment4;
				}
				canvas.getItemByName('noise_gen_button'+channel).set('left', left);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PinkNoiseEnabled": true } } }';
				socket.send(msg);
				update_save_settings_button();
			} else {
				enabled.value=0;
				if(channel==1){
				   left=34;
				}
				if(channel==2){
				   left=244;
				}
				if(channel==3){
				   left=454+adjustment3;
				}
				if(channel==4){
				   left=664+adjustment4;
				}
				canvas.getItemByName('noise_gen_button'+channel).set('left', left);
				var msg = '{ "'+json_type+'": { "In'+channel+'": { "PinkNoiseEnabled": false } } }';
				socket.send(msg);
				update_save_settings_button();
			}
			
		}
		if(type=='peak_limiter_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_peak_limiter'+channel);
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('peak_limiter_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('peak_limiter_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('peak_limiter_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('peak_limiter_'+parameter+'_on').set('opacity', 0.0);
			}
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "PeakLimiter": { "Enable": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='peak_limiter_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			
			document.getElementById('Enabled_peak_limiter'+channel).value = 1;
			document.getElementById('Threshold_peak_limiter'+channel).value = -6;
			document.getElementById('Attack_peak_limiter'+channel).value = 1;
			document.getElementById('Hold_peak_limiter'+channel).value = 1;
			document.getElementById('Decay_peak_limiter'+channel).value = 100;
			
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "PeakLimiter": { "Enable": true, "Threshold": -6, "Attack": 1, "Hold": 1, "Decay": 100 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_peak_limiter_view(channel);
		}
		
		if(type=='rms_limiter_enable_button'){
		    var name = mouseDownObject.get('name');
			var parameter = mouseDownObject.get('parameter');
			var enabled = document.getElementById(parameter+'_rms_limiter'+channel);
			var dsp_value;
			if(enabled.value==0){
			   dsp_value = true;
			   enabled.value=1;
				canvas.getItemByName('rms_limiter_'+parameter+'_off').set('opacity', 0.0);
				canvas.getItemByName('rms_limiter_'+parameter+'_on').set('opacity', 1.0);
			} else {
				dsp_value = false;
				enabled.value=0;
				canvas.getItemByName('rms_limiter_'+parameter+'_off').set('opacity', 1.0);
				canvas.getItemByName('rms_limiter_'+parameter+'_on').set('opacity', 0.0);
			}
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "RMSLimiter": { "Enable": '+dsp_value+' } } } }';
			socket.send(msg);
			update_save_settings_button();
		 }
		if(type=='rms_limiter_reset_button'){
			
			var channel = mouseDownObject.get('channel');
			
			document.getElementById('Enabled_rms_limiter'+channel).value = 1;
			document.getElementById('Threshold_rms_limiter'+channel).value = -6;
			document.getElementById('Attack_rms_limiter'+channel).value = 500;
			document.getElementById('Hold_rms_limiter'+channel).value = 1;
			document.getElementById('Decay_rms_limiter'+channel).value = 2000;
			
			var msg = '{ "'+json_type+'": { "In'+ channel +'": { "RMSLimiter": { "Enable": true, "Threshold": -6, "Attack": 500, "Hold": 1, "Decay": 2000 } } } }';
			socket.send(msg);
			update_save_settings_button();
						
			get_rms_limiter_view(channel);
		}
		if(type=='dropdown_button'){
			
			if(json_type=='Mixer'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
				   	show_menu(580,channel); 
				}
				if(channel==4){
					show_menu(790,channel);
				}
				if(channel==6){
					show_menu(1000,channel);
				}
				if(channel==5){
					show_menu_output(1148,channel); 
				}
			}
			if(json_type=='ampg1_2c'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
				   	var adjustment3 = 0;
					if(IsDualChannel==0){
						adjustment3 = -210;
					 }
					show_menu(580+adjustment3,channel);
				}
			}
			if(json_type=='ampg1_4c'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
					var adjustment3 = 0;
					if(IsDualChannel==0){
						adjustment3 = -210;
					 }
					show_menu(580+adjustment3,channel);
				}
				if(channel==4){
					var adjustment4 = 0;
					if(IsDualChannel==0){
						adjustment4 = -210;
					 }
					show_menu(790+adjustment4,channel);
				}
			}
			
			if(device_id=='nq-wbc'){
				show_menu_wbc();
			} else if(json_type=='nq-dsc01'){
				if(channel==1){
					show_menu_dsc01(1);
				}
				if(channel==2){
					show_menu_dsc01(2);
				}
			} else if(json_type=='s810v2'){
				show_menu_s810v2();
			}
			if(json_type=='edp01'){
				show_menu_edp01();
			}
			if(json_type=='nqga20'){
				show_menu_nqga20();
			}
			if(json_type=='nqpaxxx'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
				   	show_menu(580,channel); 
				}
				if(channel==4){
					show_menu(790,channel);
				}
				if(channel==5){
					show_menu(1000,channel);
				}
				if(channel==6){
					show_menu(1210,channel);
				}
				if(channel==7){
					show_menu_output(1200,channel); 
				}
				if(channel==8){
					show_menu_output(1350,channel); 
				}
			}
			if(json_type=='ampg2_2c'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
			}
			if(json_type=='ampg2_4c'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
					var adjustment3 = 0;
					if(IsDualChannel==0){
						adjustment3 = -210;
					 }
					show_menu(580+adjustment3,channel);
				}
				if(channel==4){
					var adjustment4 = 0;
					if(IsDualChannel==0 && IsDualChannel2==1){
						adjustment4 = -210;
					 }
					show_menu(790+adjustment4,channel);
				}
			}
			if(json_type=='nqga400p'){
				if(channel==1){
				   	show_menu(160,channel);
				}
				if(channel==2){
				   	show_menu(370,channel); 
				}
				if(channel==3){
					show_menu_output(580,channel);
				}
				if(channel==4){
					show_menu_output(790,channel);
				}
			}
			if(json_type=='nqga40'){
				if(channel==1){
				   	show_menu_nqga40p3(5,channel);
				}
				if(channel==2){
				   	show_menu_nqga40p3(215,channel); 
				}
			}
		 }
		
		if(name=='router_menu_touch'){
		 	get_router_view(); 
		}
		if(name=='router_close_button'){
		   	get_dsp_view();
		}
		if(name=='peq_menu_touch'){ 
		 	get_peq_view(channel); 
		}
		if(name=='peq_close_button'){
		   	get_dsp_view();
		}
		if(name=='geq_menu_touch'){ 
		 	get_geq_view(channel); 
		}
		if(name=='geq_close_button'){
		   	get_dsp_view();
		}
		if(name=='compressor_menu_touch'){ 
		 	get_compressor_view(channel); 
		}
		if(name=='compressor_close_button'){
		   	get_dsp_view();
		}
		if(name=='noise_gate_menu_touch'){ 
		 	get_noise_gate_view(channel); 
		}
		if(name=='noise_gate_close_button'){
		   	get_dsp_view();
		}
		if(name=='limiter_menu_touch'){ 
		 	get_limiter_view(channel); 
		}
		if(name=='limiter_close_button'){
		   	get_dsp_view();
		}
		if(name=='signal_present_menu_touch'){ 
		 	get_signal_present_view(channel); 
		}
		if(name=='signal_present_close_button'){
		   	get_dsp_view();
		}
		if(name=='ducker_menu_touch'){ 
		 	get_ducker_view(channel); 
		}
		if(name=='ducker_close_button'){
		   	get_dsp_view();
		}
		if(name=='hplp_menu_touch'){ 
		 	get_hplp_view(channel); 
		}
		if(name=='hplp_close_button'){
		   	close_hplp(channel);
		}
		if(name=='dropdown_temp'){
		   	clear_menu();
		}
		if(name=='menu_blackout'){
		   clear_menu();
		}
		if(name=='settings_menu_touch'){ 
		 	get_settings_view(); 
		}
		if(name=='settings_close_button'){
			close_settings();
		}
		if(name=='settings_save_button'){
		   	save_settings();
		}
		if(name=='status_menu_touch'){ 
			if(json_type=='nqpaxxx'){
			    get_status_view2(); 
			} else {
				get_status_view(); 
			}
		}
		if(name=='standby_menu_touch'){ 
			get_standby_view();
		}
		if(name=='mute_menu_touch'){ 
			get_mute_view();
		}
		if(name=='status_close_button'){
			close_status();
		}
		if(name=='duplexer_menu_touch'){ 
		 	get_duplexer_view(); 
		}
		if(name=='duplexer_close_button'){
		   	get_dsp_view();
		}
		if(name=='presets_menu_touch'){ 
		 	get_presets_view(); 
		}
		if(name=='presets_close_button'){
		   	close_presets();
		}
		if(name=='presets_save_button'){
		   	save_presets();
		}
		if(name=='outputs_menu_touch'){ 
		 	get_outputs_view(); 
		}
		if(name=='outputs_close_button'){
		   	get_dsp_view();
		}
		if(name=='delay_menu_touch'){ 
		 	get_delay_view(channel); 
		}
		if(name=='delay_close_button'){
		   	get_dsp_view();
		}
		if(name=='phase_invert_menu_touch'){ 
		 	get_phase_invert_view(channel); 
		}
		if(name=='phase_invert_close_button'){
		   	get_dsp_view();
		}
		if(name=='rms_limiter_menu_touch'){ 
		 	get_rms_limiter_view(channel); 
		}
		if(name=='rms_limiter_close_button'){
		   	get_dsp_view();
		}
		if(name=='peak_limiter_menu_touch'){ 
		 	get_peak_limiter_view(channel); 
		}
		if(name=='peak_limiter_close_button'){
		   	get_dsp_view();
		}
		if(name=='presets_upload_button'){
		   	presets_upload_button();
		}
		if(name=='standby_close_button'){
		   	get_dsp_view();
		}
		if(name=='mute_close_button'){
		   	get_dsp_view();
		}
	};
	
	var mouseOverHandler = function (evt) {
		var obj = evt.target;
		//console.log(obj.get('id'));
		var volume =0;
		var channel = document.getElementById('channel').value;
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		if(obj){
		   if(obj.type== 'level_fader'){
			
				volume = get_volume_from_top(obj.top);
				
			   if(obj.top<65){
				   obj.set({top:65});
				}
				if(obj.top>449){
				   obj.set({top:449});
				}
			   var left1;
			   var left2;
			   var left3;
			   var left4;
			   var left5;
			   var left6;
			   var left7;
			   var left8;
			   
			   if(json_type=='Mixer'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   	left4 = 740;
				   	left5 = 1095; 
				   	left6 = 950;
				}
			   if(json_type=='ampg1_2c'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   
				   	if(IsDualChannel==0){
						left3 = 320;
					}
				}
			   if(json_type=='ampg1_4c'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   	left4 = 740;
				   	left5 = 950; 
				   	left6 = 1160;
				   
				   if(IsDualChannel==0){
						left3 = left3-210;
					    left5 = left5-210;
					    left6 = left6-210;
					}
				   if(IsDualChannel2==0){
						left5 = left5-210;
					    left6 = left6-210;
					}
				}
			   	if(json_type=='s810v2'){
					left1 = 110;
				}
			    if(json_type=='nq-dsc01'){
					left1 = 110;
					left2 = 320;
				}
			   	if(json_type=='edp01'){
					left1 = 110;
				}
			   if(json_type=='nqga20'){
					left1 = 110;
				}
			   if(json_type=='nqpaxxx'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   	left4 = 740;
				   	left5 = 950; 
				   	left6 = 1160;
				   	left7 = 1305;
				   	left8 = 1455;
				}
			   if(json_type=='ampg2_2c'){
					left1 = 110;
				   	left2 = 320;
				}
			   if(json_type=='ampg2_4c'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   	left4 = 740;
				   
				   if(IsDualChannel==0){
						left3 = left3-210;
					}
				   if(IsDualChannel==0 && IsDualChannel2==1){
						left4 = left4-210;
					}
				}
			   	 if(json_type=='nqga400p'){
					left1 = 110;
				   	left2 = 320;
				   	left3 = 530;
				   	left4 = 740;
				}	
			   if(json_type=='nqga40'){
					left1 = 110;
				   	left2 = 320;
				}	
				if(obj.channel == '1'){
					obj.set({left:left1});
					canvas.remove(canvas.getItemByName('level1_text'));
					set_volume_text(1,volume,obj.top);
				}
				if(obj.channel == '2'){
					obj.set({left:left2});
					canvas.remove(canvas.getItemByName('level2_text'));
					set_volume_text(2,volume,obj.top);
				}
				if(obj.channel == '3'){
					obj.set({left:left3});
					canvas.remove(canvas.getItemByName('level3_text'));
					set_volume_text(3,volume,obj.top);
				}
				if(obj.channel == '4'){
					obj.set({left:left4});
					canvas.remove(canvas.getItemByName('level4_text'));
					set_volume_text(4,volume,obj.top);
				}
			   if(obj.channel == '5'){
					obj.set({left:left5});
					canvas.remove(canvas.getItemByName('level5_text'));
					set_volume_text(5,volume,obj.top);
				}
			   if(obj.channel == '6'){
					obj.set({left:left6});
					canvas.remove(canvas.getItemByName('level6_text'));
					set_volume_text(6,volume,obj.top);
				}
			   if(obj.channel == '7'){
					obj.set({left:left7});
					canvas.remove(canvas.getItemByName('level7_text'));
					set_volume_text(7,volume,obj.top);
				}
			   if(obj.channel == '8'){
					obj.set({left:left8});
					canvas.remove(canvas.getItemByName('level8_text'));
					set_volume_text(8,volume,obj.top);
				}
			}
			if(obj.type=='geq_fader'){
				volume = document.getElementById(obj.parameter+channel+'_fader').value;
				canvas.remove(canvas.getItemByName(obj.parameter+'_text'));
				set_geq_text(obj.parameter,volume,obj.top);
			}
		 }
	};
	
	var mouseOutHandler = function (evt) {
		var obj = evt.target;
		//console.log(obj.get('id'));
		
		var channel = document.getElementById('channel').value;
		
		if(obj ){
		   if(obj.type== 'level_fader'){
				if(obj.channel == '1'){
					canvas.remove(canvas.getItemByName('level1_text'));
				}
				if(obj.channel == '2'){
					canvas.remove(canvas.getItemByName('level2_text'));
				}
				if(obj.channel == '3'){
					canvas.remove(canvas.getItemByName('level3_text'));
				}
				if(obj.channel == '4'){	
					canvas.remove(canvas.getItemByName('level4_text'));
				}
			   if(obj.channel == '5'){	
					canvas.remove(canvas.getItemByName('level5_text'));
				}
			   if(obj.channel == '6'){	
					canvas.remove(canvas.getItemByName('level6_text'));
				}
			   if(obj.channel == '7'){	
					canvas.remove(canvas.getItemByName('level7_text'));
				}
			   if(obj.channel == '8'){	
					canvas.remove(canvas.getItemByName('level8_text'));
				}
			}
			if(obj.type== 'geq_fader'){
				canvas.remove(canvas.getItemByName(obj.parameter+'_text'));
			}
		 }
	};
	
	var rotationHandler = function (evt) {
		var rotationObject = evt.target;
		// console.log(rotationObject.get('id'));
		 _isDragging = _isMouseDown;
		
		var object_id = rotationObject.get('id');
		 canvas.forEachObject(function(obj){
			 if(obj){
				 /*
				if(obj.id == 'menu'+ object_id){
					canvas.remove(obj);
				}
				*/
			}
		});
	};
	
	var dbClickHandler = function (evt) {
		var dbClickObject = evt.target;
		var dbClickEvent = evt.e;
		// console.log(dbClickObject.get('id'),dbClickEvent.offsetX,dbClickEvent.offsetY);
		if(dbClickObject){
		  var clicked_id = dbClickObject.get('id');
			// console.log(dbClickObject);
			if(dbClickObject.type=='mute_touch' && dbClickObject.parameter=='Threshold'){
						   
			 	var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 702,
				height: 564,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_blackout);
						
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: 201,
				top: 132,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_background);
							
				var modal_title;
				var threshold;
				if(dbClickObject.id=='mute_touch_Threshold_ab'){
				   	modal_title = 'Threshold (dB)\nChannel AB';
					threshold = document.getElementById('Threshold_mute_ab').value;
					document.getElementById('Threshold_mute_channels').value = 'ab';
				} else {
					modal_title = 'Threshold (dB)\nChannel CD';
					threshold = document.getElementById('Threshold_mute_cd').value;
					document.getElementById('Threshold_mute_channels').value = 'cd';
				}
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: 0,
					top: 150,
					width: 702,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				document.getElementById('threshold_input').type = 'text';
				document.getElementById('threshold_input').value = threshold
				var threshold_input = document.getElementById('threshold_input');
				threshold_input.style.left = canvas._offset.left+195+'px';
				threshold_input.style.top = canvas._offset.top+150+'px';
					
				var close_threshold_input_button = document.getElementById('close_threshold_input_button');
				close_threshold_input_button.style.left = canvas._offset.left+180+'px';
				close_threshold_input_button.style.top = canvas._offset.top+190+'px';
				close_threshold_input_button.style.visibility = 'visible';
				
				var save_threshold_input_button = document.getElementById('save_threshold_input_button');
				save_threshold_input_button.style.left = canvas._offset.left+250+'px';
				save_threshold_input_button.style.top = canvas._offset.top+190+'px';
				save_threshold_input_button.style.visibility = 'visible';
			 }	
			
			if(dbClickObject.type=='standby_touch' && dbClickObject.parameter=='Threshold'){
			 	
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 702,
				height: 564,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_blackout);
						
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: 201,
				top: 132,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_background);
							
				var modal_title;
				var threshold;
				if(dbClickObject.id=='standby_touch_Threshold_ab'){
				   	modal_title = 'Threshold (dB)\nChannel AB';
					threshold = document.getElementById('Threshold_standby_ab').value;
					document.getElementById('Threshold_standby_channels').value = 'ab';
				} else {
					modal_title = 'Threshold (dB)\nChannel CD';
					threshold = document.getElementById('Threshold_standby_cd').value;
					document.getElementById('Threshold_standby_channels').value = 'cd';
				}
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: 0,
					top: 150,
					width: 702,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				document.getElementById('threshold_standby_input').type = 'text';
				document.getElementById('threshold_standby_input').value = threshold
				var threshold_standby_input = document.getElementById('threshold_standby_input');
				threshold_standby_input.style.left = canvas._offset.left+195+'px';
				threshold_standby_input.style.top = canvas._offset.top+150+'px';
					
				var close_threshold_standby_input_button = document.getElementById('close_threshold_standby_input_button');
				close_threshold_standby_input_button.style.left = canvas._offset.left+180+'px';
				close_threshold_standby_input_button.style.top = canvas._offset.top+190+'px';
				close_threshold_standby_input_button.style.visibility = 'visible';
				
				var save_threshold_standby_input_button = document.getElementById('save_threshold_standby_input_button');
				save_threshold_standby_input_button.style.left = canvas._offset.left+250+'px';
				save_threshold_standby_input_button.style.top = canvas._offset.top+190+'px';
				save_threshold_standby_input_button.style.visibility = 'visible';
			 }	
			
			if(dbClickObject.type=='hplp_touch' && dbClickObject.parameter=='Frequency'){
			   
			 	var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 824,
				height: 564,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_blackout);
						
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: 201,
				top: 132,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_background);
							
				var modal_title;
				if(dbClickObject.type2=='hp'){
				   modal_title = 'High Pass (Low Cut)\nFrequency (Hz)';
				} else {
					modal_title = 'Low Pass (High Cut)\nFrequency (Hz)';
				}
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: 0,
					top: 150,
					width: 702,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				var frequency = document.getElementById('Frequency_'+dbClickObject.type2+channel+'_hplp').value;
				
				document.getElementById('frequency_input').type = 'text';
				document.getElementById('frequency_input').value = frequency;
				document.getElementById('frequency_input_type').value = dbClickObject.type2;
				
				var frequency_input = document.getElementById('frequency_input');
				frequency_input.style.left = canvas._offset.left+195+'px';
				frequency_input.style.top = canvas._offset.top+150+'px';
					
				var close_hplp_input_button = document.getElementById('close_hplp_input_button');
				close_hplp_input_button.style.left = canvas._offset.left+180+'px';
				close_hplp_input_button.style.top = canvas._offset.top+190+'px';
				close_hplp_input_button.style.visibility = 'visible';
				
				var save_hplp_input_button = document.getElementById('save_hplp_input_button');
				save_hplp_input_button.style.left = canvas._offset.left+250+'px';
				save_hplp_input_button.style.top = canvas._offset.top+190+'px';
				save_hplp_input_button.style.visibility = 'visible';
				
				var hp_type = document.getElementById('hp_type'+channel);
                hp_type.style.visibility = 'hidden';

                var lp_type = document.getElementById('lp_type'+channel);
                lp_type.style.visibility = 'hidden';
			 }	
			
			if(dbClickObject.type=='peq_touch_freq'){ 
					
				//console.log(dbClickObject);
				
				menu_to_front();
				
				document.getElementById('peq_input_type').value = 'freq';
				
				var left_data = dbClickObject.left;
				var top_data = dbClickObject.top;
				
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 1663,
				height: 740,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});

				canvas.add(input_blackout);
				
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: left_data-50,
				top: top_data-280,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_background);
				
				var modal_title = 'Frequency (Hz)';
				
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: left_data-50,
					top: top_data-250,
					width: 300,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				var frequency = document.getElementById(dbClickObject.parameter+channel+'_freq').value;
				
				document.getElementById('frequency_input').type = 'text';
				document.getElementById('frequency_input').value = frequency;
				document.getElementById('frequency_input_type').value = dbClickObject.parameter;
				
				var frequency_input = document.getElementById('frequency_input');
				frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
				frequency_input.style.top = canvas._offset.top+top_data-300+'px';
						
				var close_peq_input_button = document.getElementById('close_peq_input_button');
				close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
				close_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
				close_peq_input_button.style.visibility = 'visible';
				
				var save_peq_input_button = document.getElementById('save_peq_input_button');
				save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
				save_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
				save_peq_input_button.style.visibility = 'visible';
			}
			
			if(dbClickObject.type=='peq_touch_q'){ 
				
				document.getElementById('peq_input_type').value = 'q';
					
				//console.log(dbClickObject);
				
				var left_data = dbClickObject.left;
				var top_data = dbClickObject.top;
				
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 1663,
				height: 740,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});

				canvas.add(input_blackout);
				
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: left_data-50,
				top: top_data-280,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_background);
				
				var modal_title = 'Q';
				
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: left_data-50,
					top: top_data-250,
					width: 300,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				var q = document.getElementById(dbClickObject.parameter+channel+'_q').value;
				
				document.getElementById('frequency_input').type = 'text';
				document.getElementById('frequency_input').value = q;
				document.getElementById('frequency_input_type').value = dbClickObject.parameter;
				
				var frequency_input = document.getElementById('frequency_input');
				frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
				frequency_input.style.top = canvas._offset.top+top_data-300+'px';
						
				var close_peq_input_button = document.getElementById('close_peq_input_button');
				close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
				close_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
				close_peq_input_button.style.visibility = 'visible';
				
				var save_peq_input_button = document.getElementById('save_peq_input_button2');
				save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
				save_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
				save_peq_input_button.style.visibility = 'visible';
			}
			
			if(dbClickObject.type=='peq_touch_fader'){ 
				
				document.getElementById('peq_input_type').value = 'fader';
					
				//console.log(dbClickObject);
				
				var left_data = dbClickObject.left;
				var top_data = dbClickObject.top;
				
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 1663,
				height: 740,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});

				canvas.add(input_blackout);
				
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: left_data-50,
				top: top_data-280,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_background);
				
				var modal_title = 'Gain';
				
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: left_data-50,
					top: top_data-250,
					width: 300,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				var gain = document.getElementById(dbClickObject.parameter+channel+'_fader').value;
				
				document.getElementById('frequency_input').type = 'text';
				document.getElementById('frequency_input').value = gain;
				document.getElementById('frequency_input_type').value = dbClickObject.parameter;
				
				var frequency_input = document.getElementById('frequency_input');
				frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
				frequency_input.style.top = canvas._offset.top+top_data-340+'px';
						
				var close_peq_input_button = document.getElementById('close_peq_input_button');
				close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
				close_peq_input_button.style.top = canvas._offset.top+top_data-290+'px';
				close_peq_input_button.style.visibility = 'visible';
				
				var save_peq_input_button = document.getElementById('save_peq_input_button3');
				save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
				save_peq_input_button.style.top = canvas._offset.top+top_data-290+'px';
				save_peq_input_button.style.visibility = 'visible';
			}
			
			if(dbClickObject.type=='delay_touch'){ 
							
				//console.log(dbClickObject);
				
				var left_data = dbClickObject.left;
				var top_data = dbClickObject.top;
				
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: 602,
				height: 564,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});

				canvas.add(input_blackout);
				
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: 80,
				top: 132,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
	
				canvas.add(input_background);
				
				var modal_title = 'Delay (ms)';
				
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: 85,
					top: 150,
					width: 300,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				var delay = document.getElementById('Delay_delay'+channel).value;
				
				document.getElementById('delay_input').type = 'text';
				document.getElementById('delay_input').value = delay;
				
				var delay_input = document.getElementById('delay_input');
				delay_input.style.left = canvas._offset.left+115+'px';
				delay_input.style.top = canvas._offset.top+150+'px';
					
				var close_delay_input_button = document.getElementById('close_delay_input_button');
				close_delay_input_button.style.left = canvas._offset.left+100+'px';
				close_delay_input_button.style.top = canvas._offset.top+190+'px';
				close_delay_input_button.style.visibility = 'visible';
				
				var save_delay_input_button = document.getElementById('save_delay_input_button');
				save_delay_input_button.style.left = canvas._offset.left+170+'px';
				save_delay_input_button.style.top = canvas._offset.top+190+'px';
				save_delay_input_button.style.visibility = 'visible';
			}
			if(['compressor_touch','limiter_touch','noise_gate_touch','peak_limiter_touch','rms_limiter_touch','signal_present_touch','router_touch_input','ducker_touch','duplexer_noise_gate_touch','duplexer_talkback_threshold_touch','duplexer_talkback_decay_touch','outputs_touch','mic_touch'].includes(dbClickObject.type)){
				
				// console.log(dbClickObject);
								
				var json_type = document.getElementById('json_type').value;
				var IsDualChannel = document.getElementById('IsDualChannel').value;
				var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
				var channel = document.getElementById('channel').value;
				
				var blackout_width= 0;
				var blackout_height= 0;
				
				if(dbClickObject.type=='compressor_touch'){
				   	blackout_width= 1024;
					blackout_height= 564;
				}
				if(dbClickObject.type=='limiter_touch'){
                    var blackout_width = 724;
                    if((channel==5 && json_type=='Mixer') || (channel==7 && json_type=='nqpaxxx') || (channel==8 && json_type=='nqpaxxx')){ // output only
                        blackout_width = 602;
                     }
					blackout_height= 564;
				}
				if(dbClickObject.type=='noise_gate_touch'){
				   	blackout_width= 824;
					blackout_height= 564;
				}
				if(dbClickObject.type=='peak_limiter_touch'){
				   	blackout_width= 824;
					blackout_height= 564;
				}
				if(dbClickObject.type=='rms_limiter_touch'){
				   	blackout_width= 824;
					blackout_height= 564;
				}
				if(dbClickObject.type=='signal_present_touch'){
				   	blackout_width= 602;
					blackout_height= 564;
				}
				if(dbClickObject.type=='ducker_touch'){
					if(json_type=='nqpaxxx'){	
						blackout_width= 723;
						blackout_height= 564;
                    } else {
						blackout_width= 602;
						blackout_height= 564;
                    }
				}
				if(dbClickObject.type=='router_touch_input'){
					
					if(json_type=='nqpaxxx'){
                        blackout_width = 1402;
                        blackout_height = 719;
                    }
					if(json_type=='Mixer'){
                        blackout_width = 1202;
                        blackout_height = 719;
                    }
                    if(json_type=='ampg1_2c'){
                        blackout_width = 803;
                        blackout_height = 335;

                        if(IsDualChannel==0){
                           blackout_width-=200;
                        }
                    }
                    if(json_type=='ampg1_4c'){
                        blackout_width = 1203;
                        blackout_height = 465;

                        if(IsDualChannel==0){
                           blackout_width-=200;
                        }
                        if(IsDualChannel2==0){
                           blackout_width-=200;
                        }
                    }
                    if(json_type=='ampg2_2c'){
                        blackout_width = 803;
                        blackout_height = 464;

                        if(IsDualChannel==0){
                            blackout_width-=200;
                        }
                    }
                    if(json_type=='ampg2_4c'){
                        blackout_height = 719;
                        blackout_width = 1203;

                        if(IsDualChannel==0){
                           blackout_width-=200;
                        }
                        if(IsDualChannel2==0){
                           blackout_width-=200;
                        }
                    }
				}
				if(dbClickObject.type=='duplexer_noise_gate_touch'){
                	blackout_width= 824;
                	blackout_height= 564;
                }
				if(dbClickObject.type=='duplexer_talkback_threshold_touch'){
                	blackout_width= 824;
                	blackout_height= 564;
                }
				if(dbClickObject.type=='duplexer_talkback_decay_touch'){
                	blackout_width= 824;
                	blackout_height= 564;
                }
				if(dbClickObject.type=='outputs_touch'){
                	blackout_width= 602;
                	blackout_height= 335;
                }
				if(dbClickObject.type=='mic_touch'){
					 if(json_type=='Mixer'){
						blackout_width= 1200;
                		blackout_height= 791;
					 }
					if(json_type=='nqpaxxx'){
						blackout_width= 1560;
                		blackout_height= 791;
					 }
					if(json_type=='nqga400p'){
						blackout_width= 840;
                		blackout_height= 791;
					 }
					if(json_type=='nqga40'){
						blackout_width= 420;
                		blackout_height= 791;
					 }
                }
				   
				var modal_input_type = dbClickObject.parameter;
				var modal_input_name2 = '';
				var modal_type = '';
				if(dbClickObject.type=='router_touch_input'){
					modal_type = 'router_input';
					modal_input_name2 = dbClickObject.name2;
					document.getElementById('modal_input_name2').value = modal_input_name2;	
				} else if(dbClickObject.type=='outputs_touch'){
					modal_type = 'outputs';
					modal_input_name2 = dbClickObject.parameter2;
					document.getElementById('modal_input_name2').value = modal_input_name2;	 
				} else if(dbClickObject.type=='mic_touch'){	
					modal_type = dbClickObject.type;
					modal_input_name2 = dbClickObject.name2;
					document.getElementById('modal_input_name2').value = modal_input_name2;	
				} else {
					modal_type = dbClickObject.type.replace('_touch','');
				}
					
				document.getElementById('modal_input_type').value = modal_input_type;
				document.getElementById('modal_type').value = modal_type;
						
				var left_data = dbClickObject.left;
				var top_data = dbClickObject.top;
				
				if(dbClickObject.type=='router_touch_input'){
					if(left_data<150){
				   		left_data = 150;
                    }
                    if(blackout_width-left_data<100){
                       left_data = left_data -150;
                    }
					if(blackout_height-top_data<100){
					   top_data = top_data-100;
					}
				}
				
				document.getElementById('modal_left_data').value = left_data;
				document.getElementById('modal_top_data').value = top_data;
				
				var input_blackout = new fabric.Rect({
				id: 'input_blackout',
				name: 'input_blackout',
				left: 0,
				top: 0,
				originX: 'left',
				originY: 'top',
				width: blackout_width,
				height: blackout_height,
				angle: 0,
				fill: 'rgba(0,0,0,0.5)',
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_blackout);
				
				var input_background = new fabric.Rect({
				id: 'input_background',
				name: 'input_background',
				left: left_data-150,
				top: top_data-100,
				originX: 'left',
				originY: 'top',
				width: 300,
				height: 200,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				strokeWidth: 20,
            	strokeLineJoin: 'round',
            	rx: 5,
            	ry: 5,
				selectable: false,
				objectCaching: false,
				});
				canvas.add(input_background);
				
				var modal_title = modal_input_type;
				
				if(modal_type=='signal_present' && modal_input_type=='Trigger'){
				   modal_title = 'Hold';
				}
				
				if(dbClickObject.type=='router_touch_input'){
					
					var name2 = dbClickObject.name2;
					var parameter = dbClickObject.parameter;
					if(name2.substring(0, 4)=='gain'){
						modal_title = 'Analog Input Gain '+name2.substring(4, 5);
					}
					if(parameter.substring(0, 2)=='IG'){
					   modal_title = 'Input Gain '+parameter.substring(2, 3);
					}
					if(parameter.substring(0, 2)=='OG'){
						var output_channel = parameter.substring(2, 3);
						if(output_channel==1){
						   	output_channel='A';
						}
						if(output_channel==2){
						   	output_channel='B';
						}
						if(output_channel==3){
						   	output_channel='C';
						}
						if(output_channel==4){
						   	output_channel='D';
						}
					   modal_title = 'Output Gain '+output_channel;
					}
					if(parameter.substring(0, 2)=='CG'){
						var output_channel2 = parameter.substring(3, 4);
						if(output_channel2==1){
						   	output_channel2='A';
						}
						if(output_channel2==2){
						   	output_channel2='B';
						}
						if(output_channel2==3){
						   	output_channel2='C';
						}
						if(output_channel2==4){
						   	output_channel2='D';
						}
					   modal_title = 'Gain '+parameter.substring(2, 3)+'\u2192'+output_channel2;
					}
					if(json_type=='nqpaxxx'){
						
						var label1 = document.getElementById('label1').value;
						var label2 = document.getElementById('label2').value;
						var label3 = document.getElementById('label3').value;
						var label4 = document.getElementById('label4').value;
						var label5 = document.getElementById('label5').value;
						var label6 = document.getElementById('label6').value;
						var label7 = document.getElementById('label7').value;
						var label8 = document.getElementById('label8').value;
							
						if(parameter.substring(0, 2)=='IG'){
							var input_channel = parameter.substring(2, 3);
                          	if(input_channel ==1){
							   modal_title = label1;
							}
							if(input_channel ==2){
							   modal_title = label2;
							}
							if(input_channel ==3){
							   modal_title = label3;
							}
							if(input_channel ==4){
							   modal_title = label4;
							}
                        }
                        if(parameter.substring(0, 2)=='OG'){
                            var output_channel = parameter.substring(2, 3);	
							if(output_channel ==1){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==2){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==3){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==4){
							   modal_title = 'Network '+ output_channel;
							}
                            if(output_channel==5){
                                modal_title = label7;
                            }
                            if(output_channel==6){
                                modal_title = label8;
                            }
                        }
                        if(parameter.substring(0, 2)=='CG'){
                            var output_channel2 = parameter.substring(3, 4);
							var input_channel2 = parameter.substring(2, 3);
							if(input_channel2==1){
								input_channel2 = label1.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==2){
								input_channel2 = label2.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==3){
								input_channel2 = label3.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==4){
								input_channel2 = label4.match(/\b(\w)/g).join('').toUpperCase();
							}
                            if(output_channel2==1){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==2){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==3){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==4){
                                output_channel2='N'+output_channel2;
                            }
							if(output_channel2==5){
                                output_channel2=label7.match(/\b(\w)/g).join('').toUpperCase();
                            }
							if(output_channel2==6){
                                output_channel2=label8.match(/\b(\w)/g).join('').toUpperCase();
                            }
                           modal_title = 'Gain ' + input_channel2 + '\u2192' + output_channel2;
                        }		
					}
					if(json_type=='Mixer'){
						
						var label1 = document.getElementById('label1').value;
						var label2 = document.getElementById('label2').value;
						var label3 = document.getElementById('label3').value;
						var label4 = document.getElementById('label4').value;
						var label5 = document.getElementById('label5').value;
							
						if(parameter.substring(0, 2)=='IG'){
							var input_channel = parameter.substring(2, 3);
                          	if(input_channel ==1){
							   modal_title = label1;
							}
							if(input_channel ==2){
							   modal_title = label2;
							}
							if(input_channel ==3){
							   modal_title = label3;
							}
							if(input_channel ==4){
							   modal_title = label4;
							}
                        }
                        if(parameter.substring(0, 2)=='OG'){
                            var output_channel = parameter.substring(2, 3);	
							if(output_channel ==1){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==2){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==3){
							   modal_title = 'Network '+ output_channel;
							}
							if(output_channel ==4){
							   modal_title = 'Network '+ output_channel;
							}
                            if(output_channel==5){
                                modal_title = label5;
                            }
                        }
                        if(parameter.substring(0, 2)=='CG'){
                            var output_channel2 = parameter.substring(3, 4);
							var input_channel2 = parameter.substring(2, 3);
							if(input_channel2==1){
								input_channel2 = label1.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==2){
								input_channel2 = label2.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==3){
								input_channel2 = label3.match(/\b(\w)/g).join('').toUpperCase();
							}
							if(input_channel2==4){
								input_channel2 = label4.match(/\b(\w)/g).join('').toUpperCase();
							}
                            if(output_channel2==1){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==2){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==3){
                                output_channel2='N'+output_channel2;
                            }
                            if(output_channel2==4){
                                output_channel2='N'+output_channel2;
                            }
							if(output_channel2==5){
                                output_channel2=label5.match(/\b(\w)/g).join('').toUpperCase();
                            }
                           modal_title = 'Gain ' + input_channel2 + '\u2192' + output_channel2;
                        }		
					}
				}
				if(dbClickObject.type=='mic_touch'){
					modal_title = 'Input Gain';
				}
				if(dbClickObject.type=='duplexer_noise_gate_touch'){
					modal_title = 'Switching Sensitivity';
				}
				if(dbClickObject.type=='duplexer_talkback_threshold_touch'){
					modal_title = 'Talkback Threshold';
				}
				if(dbClickObject.type=='duplexer_talkback_decay_touch'){
					modal_title = 'Talkback Decay';
				}
    	
				// name header text1
				var header_text = new fabric.Textbox(String(modal_title), {
					id: 'header_text',
					name: 'header_text',
					left: left_data-140,
					top: top_data-75,
					width: 300,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(header_text);
				
				var channel = document.getElementById('channel').value;
				
				var current_value = 0;
				
				if(dbClickObject.type=='router_touch_input'){
				   current_value = document.getElementById('router_'+dbClickObject.name2).value;
					if(current_value=='-144'){
					   current_value = 0;
					}
				} else if(dbClickObject.type=='ducker_touch'){
					current_value = document.getElementById(modal_input_type+'_ducker').value;
				} else if(dbClickObject.type=='duplexer_noise_gate_touch'){
					current_value = document.getElementById('Threshold_noise_gate_duplexer').value;
				} else if(dbClickObject.type=='duplexer_talkback_threshold_touch'){
					current_value = document.getElementById('Talkback_threshold_duplexer').value;
				} else if(dbClickObject.type=='duplexer_talkback_decay_touch'){
					current_value = document.getElementById('Talkback_decay_duplexer').value;
				} else if(dbClickObject.type=='outputs_touch'){
					current_value = document.getElementById(dbClickObject.parameter2).value;
				} else if(dbClickObject.type=='mic_touch'){  
					current_value = document.getElementById(dbClickObject.name2).value;
					modal_input_type = dbClickObject.parameter;
				} else {
					current_value = document.getElementById(modal_input_type+'_'+modal_type+channel).value;
				}
				
				document.getElementById('modal_input').type = 'text';
				document.getElementById('modal_input').value = current_value;
				
				var scale = 0.7;
				
				if(dbClickObject.type=='mic_touch'){  
					scale = 0.8;		
				} 
													  
				var modal_input = document.getElementById('modal_input');
                modal_input.style.left = canvas._offset.left+(left_data*scale )-40+'px';
                modal_input.style.top = canvas._offset.top+(top_data*scale )-25+'px';

                var close_modal_input_button = document.getElementById('close_modal_input_button');
                close_modal_input_button.style.left = canvas._offset.left+(left_data*scale )-60+'px';
                close_modal_input_button.style.top = canvas._offset.top+(top_data*scale )+20+'px';
                close_modal_input_button.style.visibility = 'visible';

                var save_modal_input_button = document.getElementById('save_modal_input_button');
                save_modal_input_button.style.left = canvas._offset.left+(left_data*scale )+10+'px';
                save_modal_input_button.style.top = canvas._offset.top+(top_data*scale )+20+'px';
                save_modal_input_button.style.visibility = 'visible';	
			}
		 }
	};
				
	canvas.on({
		'object:moving' : moveHandler,
		'object:scaling' : scaleHandler,
		'mouse:dblclick' : dbClickHandler,
		'mouse:up' : mouseUpHandler,
		'mouse:down' : mouseDownHandler,
		'mouse:over' : mouseOverHandler,
		'mouse:out' : mouseOutHandler,
		'object:rotating' : rotationHandler, 
	});
	
	function set_disabled_view(){
		
		canvas.clear();	
		
		var json_type = document.getElementById('json_type').value
		var disabled_height;
		var disabled_width;
		var disabled_image;
		if(json_type=='Mixer'){
		   	disabled_height=791;
			disabled_width=1200;
			disabled_image='level_bar_disabled';
		}
		if(json_type=='ampg1_2c'){
			disabled_height=791;
			disabled_width=630;
			disabled_image='level_bar_amp2c_disabled';
		}
		if(json_type=='ampg1_4c'){
			disabled_height=791;
			disabled_width=1260;
			disabled_image='level_bar_amp4c_disabled';
		}
		if(json_type=='s810v2'){
			disabled_height=791;
			disabled_width=210;
			disabled_image='level_bar_s810v2_disabled';
		}
		if(json_type=='edp01'){
			disabled_height=791;
			disabled_width=210;
			disabled_image='level_bar_edp01_disabled';
		}
		if(json_type=='nqga20'){
			disabled_height=791;
			disabled_width=210;
			disabled_image='level_bar_ga20p2_disabled';
		}
		if(json_type=='nqpaxxx'){
			disabled_height=791;
			disabled_width=1560;
			disabled_image='level_bar_nqpaxxx_disabled';
		}
		if(json_type=='ampg2_2c'){
			disabled_height=791;
			disabled_width=420;
			disabled_image='level_bar_ampg2_2c_disabled';
		}
		if(json_type=='ampg2_4c'){
			disabled_height=791;
			disabled_width=840;
			disabled_image='level_bar_ampg2_4c_disabled';
		}
		if(json_type=='nqga400p'){
			disabled_height=791;
			disabled_width=840;
			disabled_image='level_bar_nqga400p_disabled';
		}
		if(json_type=='nqga40'){
			disabled_height=791;
			disabled_width=420;
			disabled_image='level_bar_nqga40p3_disabled';
		}
		if(json_type=='nq-dsc01'){
			disabled_height=791;
			disabled_width=420;
			disabled_image='level_bar_dsc01_disabled';
		}
		
		var modal_input = document.getElementById('modal_input');
        modal_input.style.visibility = 'hidden';

        var close_modal_input_button = document.getElementById('close_modal_input_button');
        close_modal_input_button.style.visibility = 'hidden';

        var save_modal_input_button = document.getElementById('save_modal_input_button');
        save_modal_input_button.style.visibility = 'hidden';
		
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		
			// hide presets modal items
		    var preset_open_web_page_button = document.getElementById('preset_open_web_page_button');
    		preset_open_web_page_button.style.visibility = 'hidden';
			
			var close_preset_modal_button = document.getElementById('close_preset_modal_button');
			close_preset_modal_button.style.visibility = 'hidden'; 
			
			// hide peq modal items
			var frequency_input = document.getElementById('frequency_input');
            frequency_input.style.visibility = 'hidden';

			var close_peq_input_button = document.getElementById('close_peq_input_button');
            close_peq_input_button.style.visibility = 'hidden';

            var save_peq_input_button = document.getElementById('save_peq_input_button');
            save_peq_input_button.style.visibility = 'hidden';
			
			var save_peq_input_button2 = document.getElementById('save_peq_input_button2');
			save_peq_input_button2.style.visibility = 'hidden';
			
			var save_peq_input_button3 = document.getElementById('save_peq_input_button3');
			save_peq_input_button3.style.visibility = 'hidden';
				
			// hide hplp modal items
            var close_hplp_input_button = document.getElementById('close_hplp_input_button');
            close_hplp_input_button.style.visibility = 'hidden';

            var save_hplp_input_button = document.getElementById('save_hplp_input_button');
            save_hplp_input_button.style.visibility = 'hidden';
			
			var hp_type = document.getElementById('hp_type'+channel.value);
            hp_type.style.visibility = 'hidden';

            var lp_type = document.getElementById('lp_type'+channel.value);
            lp_type.style.visibility = 'hidden';
			
			// hide amplifier mute modal items
			var threshold_input = document.getElementById('threshold_input');
            threshold_input.style.visibility = 'hidden';
			
			 var close_threshold_input_button = document.getElementById('close_threshold_input_button');
            close_threshold_input_button.style.visibility = 'hidden';

            var save_threshold_input_button = document.getElementById('save_threshold_input_button');
            save_threshold_input_button.style.visibility = 'hidden';
			
			var threshold_standby_input = document.getElementById('threshold_standby_input');
            threshold_standby_input.style.visibility = 'hidden';
			
			 var close_threshold_standby_input_button = document.getElementById('close_threshold_standby_input_button');
            close_threshold_standby_input_button.style.visibility = 'hidden';

            var save_threshold_standby_input_button = document.getElementById('save_threshold_standby_input_button');
            save_threshold_standby_input_button.style.visibility = 'hidden';
			
			var delay_input = document.getElementById('delay_input');
            delay_input.style.visibility = 'hidden';
			
			 var close_delay_input_button = document.getElementById('close_delay_input_button');
            close_delay_input_button.style.visibility = 'hidden';

            var save_delay_input_button = document.getElementById('save_delay_input_button');
            save_delay_input_button.style.visibility = 'hidden';
			
            document.getElementById('preset_input').style.visibility = 'hidden';
            document.getElementById('presets_save_button').style.visibility= 'hidden';
			document.getElementById('presets_upload_button').style.visibility= 'hidden';
		
            document.getElementById('presets_detail_button1').style.visibility= 'hidden';
            document.getElementById('presets_detail_button2').style.visibility= 'hidden';
            document.getElementById('presets_detail_button3').style.visibility= 'hidden';
            document.getElementById('presets_detail_button4').style.visibility= 'hidden';
			
			document.getElementById('presets_generate_button1').style.visibility= 'hidden';
            document.getElementById('presets_generate_button2').style.visibility= 'hidden';
            document.getElementById('presets_generate_button3').style.visibility= 'hidden';
            document.getElementById('presets_generate_button4').style.visibility= 'hidden';
			
			document.getElementById('presets_download_button1').style.visibility= 'hidden';
            document.getElementById('presets_download_button2').style.visibility= 'hidden';
            document.getElementById('presets_download_button3').style.visibility= 'hidden';
            document.getElementById('presets_download_button4').style.visibility= 'hidden';
			
			document.getElementById('presets_clear_button1').style.visibility= 'hidden';
            document.getElementById('presets_clear_button2').style.visibility= 'hidden';
            document.getElementById('presets_clear_button3').style.visibility= 'hidden';
            document.getElementById('presets_clear_button4').style.visibility= 'hidden';
			
            var preset1 = document.getElementById('preset1');
            preset1.style.visibility = 'hidden';

            var preset2 = document.getElementById('preset2');
            preset2.style.visibility = 'hidden';

            var preset3 = document.getElementById('preset3');
            preset3.style.visibility = 'hidden';

            var preset4 = document.getElementById('preset4');
            preset4.style.visibility = 'hidden';
			
			document.getElementById('generate_name_input').style.visibility= 'hidden';
			document.getElementById('close_generate_modal_button').style.visibility= 'hidden';
			document.getElementById('save_generate_modal_button').style.visibility= 'hidden';
			
			document.getElementById('generate_warning_yes_button').style.visibility= 'hidden';
			document.getElementById('generate_warning_no_button').style.visibility= 'hidden';
			document.getElementById('clear_warning_yes_button').style.visibility= 'hidden';
			document.getElementById('clear_warning_no_button').style.visibility= 'hidden';
		}
		
		canvas.setHeight(disabled_height);
		canvas.setWidth(disabled_width);
		
		// set Zoom level
		canvas.setZoom(0.8);
				
		// set level bar background
		var levelbarElement = document.getElementById(disabled_image);
		var levelbarInstance = new fabric.Image(levelbarElement, {
		  id: 'level_bar_disabled',
		  name: 'level_bar_disabled',
		  type: 'level_bar_disabled',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(levelbarInstance);
	}
	
	function get_dsp_view(){
		
		var json_type = document.getElementById('json_type').value;
		if(json_type=='Mixer'){
			get_dsp_view1();
		}
		if(json_type=='ampg1_2c'){
			get_pink_noise_enabled();
			get_dsp_view2();
			start_amp_status();
		}
		if(json_type=='ampg1_4c'){
			get_pink_noise_enabled();
			get_dsp_view3();
			start_amp_status();
		}
		if(json_type=='s810v2'){
			get_dsp_view4();
		}
		if(json_type=='nq-dsc01'){
			get_dsp_view12();
		}
		if(json_type=='edp01'){
			get_dsp_view9();
		}
		if(json_type=='nqga20'){
			get_dsp_view5();
		}
		if(json_type=='nqpaxxx'){
			get_dsp_view6();
			start_amp_status();
		}
		if(json_type=='ampg2_2c'){
			get_pink_noise_enabled();
			get_dsp_view8();
			start_amp_status();
		}
		if(json_type=='ampg2_4c'){
			get_pink_noise_enabled();
			get_dsp_view7();
			start_amp_status();
		}
		if(json_type=='nqga400p'){
			get_dsp_view10();
		}
		if(json_type=='nqga40'){
			get_dsp_view11();
		}
	}
	
	function get_dsp_view1(){
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(1200);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		var color3 = document.getElementById('color3').value;
		var color4 = document.getElementById('color4').value;
		var color5 = document.getElementById('color5').value;
		var color6 = document.getElementById('color6').value;
			
		// set channel1 background
		var mixerchannel1Element = document.getElementById('mixer_channel_2_levels_'+color1);
		var mixerchannel1Instance = new fabric.Image(mixerchannel1Element, {
		  id: 'mixer_channel1',
		  name: 'mixer_channel1',
		  type: 'mixer_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel1Instance);
		
		// set channel1 mode block
		var mixermode1Element = document.getElementById('mixer_mode_block1');
		var mixermode1Instance = new fabric.Image(mixermode1Element, {
		  id: 'mixer_mode1',
		  name: 'mixer_mode1',
		  type: 'mixer_mode1',
		  left: 30,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode1Instance);
		
		// set channel2 background
		var mixerchannel2Element = document.getElementById('mixer_channel_2_levels_'+color2);
		var mixerchannel2Instance = new fabric.Image(mixerchannel2Element, {
		  id: 'mixer_channel2',
		  name: 'mixer_channel2',
		  type: 'mixer_channel2',
		  left: 210,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel2Instance);
		
		// set channel2 mode block
		var mixermode2Element = document.getElementById('mixer_mode_block2');
		var mixermode2Instance = new fabric.Image(mixermode2Element, {
		  id: 'mixer_mode2',
		  name: 'mixer_mode2',
		  type: 'mixer_mode2',
		  left: 240,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode2Instance);
		
		// set channel3 background
		var mixerchannel3Element = document.getElementById('mixer_channel_2_levels_'+color3);
		var mixerchannel3Instance = new fabric.Image(mixerchannel3Element, {
		  id: 'mixer_channel3',
		  name: 'mixer_channel3',
		  type: 'mixer_channel3',
		  left: 420,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel3Instance);
		
		// set channel3 mode block
		var mixermode3Element = document.getElementById('mixer_mode_block2');
		var mixermode3Instance = new fabric.Image(mixermode3Element, {
		  id: 'mixer_mode3',
		  name: 'mixer_mode3',
		  type: 'mixer_mode3',
		  left: 450,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode3Instance);
		
		// set channel4 background
		var mixerchannel4Element = document.getElementById('mixer_channel_2_levels_'+color4);
		var mixerchannel4Instance = new fabric.Image(mixerchannel4Element, {
		  id: 'mixer_channel4',
		  name: 'mixer_channel4',
		  type: 'mixer_channel4',
		  left: 630,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel4Instance);
		
		// set channel4 mode block
		var mixermode4Element = document.getElementById('mixer_mode_block2');
		var mixermode4Instance = new fabric.Image(mixermode4Element, {
		  id: 'mixer_mode4',
		  name: 'mixer_mode4',
		  type: 'mixer_mode4',
		  left: 660,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode4Instance);
		
		// set channel6 background
		var mixerchannel6Element = document.getElementById('mixer_channel_2_levels_'+color6);
		var mixerchannel6Instance = new fabric.Image(mixerchannel6Element, {
		  id: 'mixer_channel6',
		  name: 'mixer_channel6',
		  type: 'mixer_channel6',
		  left: 840,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel6Instance);
		
		// set channel5 background
		var mixerchannel5Element = document.getElementById('mixer_channel_'+color5);
		var mixerchannel5Instance = new fabric.Image(mixerchannel5Element, {
		  id: 'mixer_channel5',
		  name: 'mixer_channel5',
		  type: 'mixer_channel5',
		  left: 1050,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel5Instance);
		
		// set channel1 text
		var label1 = document.getElementById('label1').value;
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input 1'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel2 text
		var label2 = document.getElementById('label2').value;
		var channel2_text = new fabric.Textbox(String(label2), {
			id: 'channel2_text',
			name: 'channel2_text',
			left: 210,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel2_text);
		
		// set input2 text
		var input2_text = new fabric.Textbox(String('Input 2'), {
			id: 'input2_text',
			name: 'input2_text',
			left: 210,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input2_text);
		
		// set channel3 text
		var label3 = document.getElementById('label3').value;
		var channel3_text = new fabric.Textbox(String(label3), {
			id: 'channel3_text',
			name: 'channel3_text',
			left: 420,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel3_text);
		
		// set input3 text
		var input3_text = new fabric.Textbox(String('Input 3'), {
			id: 'input3_text',
			name: 'input3_text',
			left: 420,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input3_text);
		
		// set channel4 text
		var label4 = document.getElementById('label4').value;
		var channel4_text = new fabric.Textbox(String(label4), {
			id: 'channel4_text',
			name: 'channel4_text',
			left: 630,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel4_text);
		
		// set input4 text
		var input4_text = new fabric.Textbox(String('Input 4'), {
			id: 'input4_text',
			name: 'input4_text',
			left: 630,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input4_text);
		
		// set output5 text
		var label5 = document.getElementById('label5').value;
		var output5_text = new fabric.Textbox(String(label5), {
			id: 'output5_text',
			name: 'output5_text',
			left: 1050,
			top: 734,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output5_text);
		
		// set output text
		var output_text = new fabric.Textbox(String('Output'), {
			id: 'output_text',
			name: 'output_text',
			left: 1050,
			top: 764,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output_text);
		
		// set channel 6 text
		var label6 = document.getElementById('label6').value;
		var label6_text = new fabric.Textbox(String(label6), {
			id: 'label6_text',
			name: 'label6_text',
			left: 840,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(label6_text);
		
		// set input5 text
		var input5_text = new fabric.Textbox(String('Input 5'), {
			id: 'input5_text',
			name: 'input5_text',
			left: 840,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input5_text);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var mute2 = document.getElementById('mute2');
		var mute2_off_opacity;
		var mute2_on_opacity;
		if(mute2.value==1){
		  	mute2_off_opacity=0.0;
			mute2_on_opacity=1.0;
		} else {
			mute2_off_opacity=1.0;
			mute2_on_opacity=0.0;
		}
		// set mute_bar_button2_off
		var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
		var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
		  id: 'mute_bar_button2_off',
		  name: 'mute_bar_button2_off',
		  type: 'mute_bar_button',
		  channel: 2,
		  left: 220,
		  top: 17,
		  angle: 0,
		  opacity: mute2_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton2offInstance);
		
		// set mute_bar_button2_on
		var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
		var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
		  id: 'mute_bar_button2_on',
		  name: 'mute_bar_button2_on',
		  type: 'mute_bar_button',
		  channel: 2,
		  left: 220,
		  top: 17,
		  angle: 0,
		  opacity: mute2_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton2onInstance);
		
		var mute3 = document.getElementById('mute3');
		var mute3_off_opacity;
		var mute3_on_opacity;
		if(mute3.value==1){
		  	mute3_off_opacity=0.0;
			mute3_on_opacity=1.0;
		} else {
			mute3_off_opacity=1.0;
			mute3_on_opacity=0.0;
		}
		// set mute_bar_button3_off
		var mutebutton3offElement = document.getElementById('mute_bar_button3_off');
		var mutebutton3offInstance = new fabric.Image(mutebutton3offElement, {
		  id: 'mute_bar_button3_off',
		  name: 'mute_bar_button3_off',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3offInstance);
		
		// set mute_bar_button3_on
		var mutebutton3onElement = document.getElementById('mute_bar_button3_on');
		var mutebutton3onInstance = new fabric.Image(mutebutton3onElement, {
		  id: 'mute_bar_button3_on',
		  name: 'mute_bar_button3_on',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3onInstance);
		
		var mute4 = document.getElementById('mute4');
		var mute4_off_opacity;
		var mute4_on_opacity;
		if(mute4.value==1){
		  	mute4_off_opacity=0.0;
			mute4_on_opacity=1.0;
		} else {
			mute4_off_opacity=1.0;
			mute4_on_opacity=0.0;
		}
		// set mute_bar_button4_off
		var mutebutton4offElement = document.getElementById('mute_bar_button4_off');
		var mutebutton4offInstance = new fabric.Image(mutebutton4offElement, {
		  id: 'mute_bar_button4_off',
		  name: 'mute_bar_button4_off',
		  type: 'mute_bar_button',
		  channel: 4,
		  left: 640,
		  top: 17,
		  angle: 0,
		  opacity: mute4_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton4offInstance);
		
		// set mute bar button4
		var mutebutton4onElement = document.getElementById('mute_bar_button4_on');
		var mutebutton4onInstance = new fabric.Image(mutebutton4onElement, {
		  id: 'mute_bar_button4_on',
		  name: 'mute_bar_button4_on',
		  type: 'mute_bar_button',
		  channel: 4,
		  left: 640,
		  top: 17,
		  angle: 0,
		  opacity: mute4_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton4onInstance);
		
		var mute6 = document.getElementById('mute6');
		var mute6_off_opacity;
		var mute6_on_opacity;
		if(mute6.value==1){
		  	mute6_off_opacity=0.0;
			mute6_on_opacity=1.0;
		} else {
			mute6_off_opacity=1.0;
			mute6_on_opacity=0.0;
		}
		// set mute_bar_button6_off
		var mutebutton6offElement = document.getElementById('mute_bar_button6_off');
		var mutebutton6offInstance = new fabric.Image(mutebutton6offElement, {
		  id: 'mute_bar_button6_off',
		  name: 'mute_bar_button6_off',
		  type: 'mute_bar_button',
		  channel: 6,
		  left: 850,
		  top: 17,
		  angle: 0,
		  opacity: mute6_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton6offInstance);
		
		// set mute bar button6
		var mutebutton6onElement = document.getElementById('mute_bar_button6_on');
		var mutebutton6onInstance = new fabric.Image(mutebutton6onElement, {
		  id: 'mute_bar_button6_on',
		  name: 'mute_bar_button6_on',
		  type: 'mute_bar_button',
		  channel: 6,
		  left: 850,
		  top: 17,
		  angle: 0,
		  opacity: mute6_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton6onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
			
		var slider2 = document.getElementById('slider2');
		var top2 = get_top_from_volume(slider2.value);
		
		var slider3 = document.getElementById('slider3');
		var top3 = get_top_from_volume(slider3.value);
		
		var slider4 = document.getElementById('slider4');
		var top4 = get_top_from_volume(slider4.value);
		
		var slider5 = document.getElementById('slider5');
		var top5 = get_top_from_volume(slider5.value);
		
		var slider6 = document.getElementById('slider6');
		var top6 = get_top_from_volume(slider6.value);
			
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// set level fader2
		var levelfader2Element = document.getElementById('level_fader2');
		var levelfader2Instance = new fabric.Image(levelfader2Element, {
		  id: 'level_fader2',
		  name: 'level_fader2',
		  type: 'level_fader',
		  channel: 2,
		  left: 320,
		  top: top2,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader2Instance);
		
		// set level fader3
		var levelfader3Element = document.getElementById('level_fader3');
		var levelfader3Instance = new fabric.Image(levelfader3Element, {
		  id: 'level_fader3',
		  name: 'level_fader3',
		  type: 'level_fader',
		  channel: 3,
		  left: 530,
		  top: top3,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader3Instance);
		
		// set level fader4
		var levelfader4Element = document.getElementById('level_fader4');
		var levelfader4Instance = new fabric.Image(levelfader4Element, {
		  id: 'level_fader4',
		  name: 'level_fader4',
	      type: 'level_fader',
		  channel: 4,
		  left: 740,
		  top: top4,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader4Instance);
		
		// set level fader6
		var levelfader6Element = document.getElementById('level_fader6');
		var levelfader6Instance = new fabric.Image(levelfader6Element, {
		  id: 'level_fader6',
		  name: 'level_fader6',
	      type: 'level_fader',
		  channel: 6,
		  left: 950,
		  top: top6,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader6Instance);
		
		// set level output5
		var levelfader5Element = document.getElementById('level_fader5');
		var levelfader5Instance = new fabric.Image(levelfader5Element, {
		  id: 'level_fader5',
		  name: 'level_fader5',
	      type: 'level_fader',
		  channel: 5,
		  left: 1095,
		  top: top5,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader5Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// add dropdown_button2
		var dropdown_button2Element = document.getElementById('dropdown_button2');
		var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
		  id: 'dropdown_button2',
		  name: 'dropdown_button2',
		  type: 'dropdown_button',
		  channel: 2,
		  left: 370,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button2Instance);
		
		// add dropdown_button3
		var dropdown_button3Element = document.getElementById('dropdown_button3');
		var dropdown_button3Instance = new fabric.Image(dropdown_button3Element, {
		  id: 'dropdown_button3',
		  name: 'dropdown_button3',
		  type: 'dropdown_button',
		  channel: 3,
		  left: 580,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button3Instance);
		
		// add dropdown_button4
		var dropdown_button4Element = document.getElementById('dropdown_button4');
		var dropdown_button4Instance = new fabric.Image(dropdown_button4Element, {
		  id: 'dropdown_button4',
		  name: 'dropdown_button4',
		  type: 'dropdown_button',
		  channel: 4,
		  left: 790,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button4Instance);
		
		// add dropdown_button5
		var dropdown_button5Element = document.getElementById('dropdown_button5');
		var dropdown_button5Instance = new fabric.Image(dropdown_button5Element, {
		  id: 'dropdown_button5',
		  name: 'dropdown_button5',
		  type: 'dropdown_button',
		  channel: 5,
		  left: 1150,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button5Instance);
		
		
		// add dropdown_button6
		var dropdown_button6Element = document.getElementById('dropdown_button6');
		var dropdown_button6Instance = new fabric.Image(dropdown_button6Element, {
		  id: 'dropdown_button6',
		  name: 'dropdown_button6',
		  type: 'dropdown_button',
		  channel: 6,
		  left: 1000,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button6Instance);
		
		var phantom1 = document.getElementById('Phantom1').value;
		var p1_left = 121;
		if(phantom1==1){
		   p1_left = 145;
		 }
		
		var phantom2 = document.getElementById('Phantom2').value;
		var p2_left = 324;
		if(phantom2==1){
		   p2_left = 350;
		 }
		
		var phantom3 = document.getElementById('Phantom3').value;
		var p3_left = 534;
		if(phantom3==1){
		   p3_left = 560;
		 }
		
		var phantom4 = document.getElementById('Phantom4').value;
		var p4_left = 744;
		if(phantom4==1){
		   p4_left = 770;
		 }
		
		var mode1 = document.getElementById('Mode1').value;
		var m1_left;
		if(mode1=="LINE"){
		   m1_left = 36;
		 }
		if(mode1=="AES"){
		   m1_left = 60;
		 }
		if(mode1=="MIC"){
		   m1_left = 82;
		 }
		
		var mode2 = document.getElementById('Mode2').value;
		var m2_left = 253;
		if(mode2=="MIC"){
		   m2_left = 279;
		 }
		
		var mode3 = document.getElementById('Mode3').value;
		var m3_left = 463;
		if(mode3=="MIC"){
		   m3_left = 489;
		 }
		
		var mode4 = document.getElementById('Mode4').value;
		var m4_left = 673;
		if(mode4=="MIC"){
		   m4_left = 699;
		 }
					
		// add mode1 button
		var mode1Element = document.getElementById('Mode_button1');
		var mode1Instance = new fabric.Image(mode1Element, {
		  id: 'mode_button1',
		  name: 'mode_button1',
		  type: 'mode_button',
		  channel: 1,
		  left: m1_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode1Instance);
		
		// set mode_touch1_element
		var mode_touch1_element = document.getElementById('Mode_touch1');
		var mode_touch1_instance = new fabric.Image(mode_touch1_element, {
		  id: 'Mode_touch1',
		  name: 'Mode_touch1',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 1,
		  left: 34,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch1_instance);
		
		// add mode2 button
		var mode2Element = document.getElementById('Mode_button2');
		var mode2Instance = new fabric.Image(mode2Element, {
		  id: 'mode_button2',
		  name: 'mode_button2',
		  type: 'mode_button',
		  channel: 2,
		  left: m2_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode2Instance);
		
		// set mode_touch2_element
		var mode_touch2_element = document.getElementById('Mode_touch2');
		var mode_touch2_instance = new fabric.Image(mode_touch2_element, {
		  id: 'Mode_touch2',
		  name: 'Mode_touch2',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 2,
		  left: 250,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch2_instance);
		
		// add mode3 button
		var mode3Element = document.getElementById('Mode_button3');
		var mode3Instance = new fabric.Image(mode3Element, {
		  id: 'mode_button3',
		  name: 'mode_button3',
		  type: 'mode_button',
		  channel: 3,
		  left: m3_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode3Instance);
		
		// set mode_touch3_element
		var mode_touch3_element = document.getElementById('Mode_touch3');
		var mode_touch3_instance = new fabric.Image(mode_touch3_element, {
		  id: 'Mode_touch3',
		  name: 'Mode_touch3',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 3,
		  left: 460,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch3_instance);
		
		// add mode4 button
		var mode4Element = document.getElementById('Mode_button4');
		var mode4Instance = new fabric.Image(mode4Element, {
		  id: 'mode_button4',
		  name: 'mode_button4',
		  type: 'mode_button',
		  channel: 4,
		  left: m4_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode4Instance);
		
		// set mode_touch4_element
		var mode_touch4_element = document.getElementById('Mode_touch4');
		var mode_touch4_instance = new fabric.Image(mode_touch4_element, {
		  id: 'Mode_touch4',
		  name: 'Mode_touch4',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 4,
		  left: 670,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch4_instance);
		
		// add phantom1 button
		var phantom1Element = document.getElementById('Phantom_button1');
		var phantom1Instance = new fabric.Image(phantom1Element, {
		  id: 'phantom_button1',
		  name: 'phantom_button1',
		  type: 'phantom_button',
		  channel: 1,
		  left: p1_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom1Instance);
		
		// set phantom_touch1_element
		var phantom_touch1_element = document.getElementById('Phantom_touch1');
		var phantom_touch1_instance = new fabric.Image(phantom_touch1_element, {
		  id: 'Phantom_touch1',
		  name: 'Phantom_touch1',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 1,
		  left: 116,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch1_instance);
		
		// add phantom2 button
		var phantom2Element = document.getElementById('Phantom_button2');
		var phantom2Instance = new fabric.Image(phantom2Element, {
		  id: 'phantom_button2',
		  name: 'phantom_button2',
		  type: 'phantom_button',
		  channel: 2,
		  left: p2_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom2Instance);
		
		// set phantom_touch2_element
		var phantom_touch2_element = document.getElementById('Phantom_touch2');
		var phantom_touch2_instance = new fabric.Image(phantom_touch2_element, {
		  id: 'Phantom_touch2',
		  name: 'Phantom_touch2',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 2,
		  left: 320,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch2_instance);
		
		// add phantom3 button
		var phantom3Element = document.getElementById('Phantom_button3');
		var phantom3Instance = new fabric.Image(phantom3Element, {
		  id: 'phantom_button3',
		  name: 'phantom_button3',
		  type: 'phantom_button',
		  channel: 3,
		  left: p3_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom3Instance);
		
		// set phantom_touch3_element
		var phantom_touch3_element = document.getElementById('Phantom_touch3');
		var phantom_touch3_instance = new fabric.Image(phantom_touch3_element, {
		  id: 'Phantom_touch3',
		  name: 'Phantom_touch3',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 3,
		  left: 530,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch3_instance);
		
		// add phantom4 button
		var phantom4Element = document.getElementById('Phantom_button4');
		var phantom4Instance = new fabric.Image(phantom4Element, {
		  id: 'phantom_button4',
		  name: 'phantom_button4',
		  type: 'phantom_button',
		  channel: 4,
		  left: p4_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom4Instance);
		
		// set phantom_touch4_element
		var phantom_touch4_element = document.getElementById('Phantom_touch4');
		var phantom_touch4_instance = new fabric.Image(phantom_touch4_element, {
		  id: 'Phantom_touch4',
		  name: 'Phantom_touch4',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 4,
		  left: 740,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch4_instance);
		
		for(var x=0;x<main_data_array.length;x++){
			
			var type = main_data_array[x]['type'];
			if(type=='knob'){
				
				var name = main_data_array[x]['name'];
				var parameter = main_data_array[x]['parameter'];
				var channel = main_data_array[x]['channel'];
				var indicator_left = main_data_array[x]['indicator_left'];
				var indicator_top = main_data_array[x]['indicator_top'];
				var text_left = main_data_array[x]['text_left'];
				var text_top = main_data_array[x]['text_top'];
				
				var input = document.getElementById(name).value;
				var angle = -150+(input*10.714); // Min: 0 Max: 28

				// set gain_indicator_element
				var gain_indicator_element = document.getElementById('indicator_'+name);
				var gain_indicator_instance = new fabric.Image(gain_indicator_element, { 
				  id: 'indicator_'+name,
				  name: 'indicator_'+name,
				  name2: name,
				  type: 'mic_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(gain_indicator_instance);

				// set gain_touch_element
				var gain_touch_element = document.getElementById('touch_'+name);
				var gain_touch_instance = new fabric.Image(gain_touch_element, {
				  id: 'touch_'+name,
				  name: 'touch_'+name,
				  type: 'mic_touch',
				  parameter: parameter,
				  name2: name,
				  channel: channel,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(gain_touch_instance);

				// set input text
				var text = input;
				
				var gain_text = new fabric.Textbox(String(text), {
					id: name +'_text',
					name: name+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(gain_text);
			}
		}
		
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_compressor_levels();
		start_input_levels();
	}	
	
	function get_dsp_view2(){
		
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var left_adjustment;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(630);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// channel 1
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_3_levels_'+color1);
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Channel A'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel1 noise_gen_background
		var noiseGenBackElement1 = document.getElementById('noise_gen_background1');
		var noiseGenBackInstance1 = new fabric.Image(noiseGenBackElement1, {
		  id: 'noise_gen_back1',
		  name: 'noise_gen_back1',
		  type: 'noise_gen_back',
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenBackInstance1);
		
		var noise_gen1 = document.getElementById('pink_noise_enabled1').value;
		var noise_gen1_left = 34;
		if(noise_gen1=="1"){
		   noise_gen1_left = 59;
		 }
					
		// add noise_gen_button1
		var noiseGenButtonElement1 = document.getElementById('noise_gen_button1');
		var noiseGenButtonInstance1 = new fabric.Image(noiseGenButtonElement1, {
		  id: 'noise_gen_button1',
		  name: 'noise_gen_button1',
		  type: 'noise_gen_button',
		  channel: 1,
		  left: noise_gen1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenButtonInstance1);
		
		// set noise_gen_touch1
		var noiseGenTouchElement1 = document.getElementById('noise_gen_touch1');
		var noiseGenTouchInstance1 = new fabric.Image(noiseGenTouchElement1, {
		  id: 'noise_gen_touch1',
		  name: 'noise_gen_touch1',
		  type: 'noise_gen_touch',
		  parameter: 'noise_gen_touch',
		  channel: 1,
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenTouchInstance1);
		
		// set channel1 pink_noise_text
		var pink_noise_text1 = new fabric.Textbox(String('Pink Noise'), {
			id: 'pink_noise_text1',
			name: 'pink_noise_text1',
			left: 12,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(pink_noise_text1);
		
		// set channel1 noise_gen_on_off_text
		var noise_gen_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'noise_gen_on_off_text1',
			name: 'noise_gen_on_off_text1',
			left: 34,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(noise_gen_on_off_text1);
		
		// set channel1 invert_background
		var invertBackElement1 = document.getElementById('invert_background1');
		var invertBackInstance1 = new fabric.Image(invertBackElement1, {
		  id: 'invert_back1',
		  name: 'invert_back1',
		  type: 'invert_back',
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertBackInstance1);
		
		var invert1 = document.getElementById('Phase_invert1').value;
		var invert1_left = 124;
		if(invert1=="1"){
		   invert1_left = 149;
		 }
					
		// add invert_button1
		var invertButtonElement1 = document.getElementById('invert_button1');
		var invertButtonInstance1 = new fabric.Image(invertButtonElement1, {
		  id: 'invert_button1',
		  name: 'invert_button1',
		  type: 'invert_button',
		  channel: 1,
		  left: invert1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertButtonInstance1);
		
		// set mode_touch1_element
		var invert_touchElement1 = document.getElementById('invert_touch1');
		var invert_touchInstance1 = new fabric.Image(invert_touchElement1, {
		  id: 'invert_touch1',
		  name: 'invert_touch1',
		  type: 'invert_touch',
		  parameter: 'invert_touch',
		  channel: 1,
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invert_touchInstance1);
		
		// set channel1 invert_text
		var invert_text1 = new fabric.Textbox(String('Phase Invert'), {
			id: 'invert_text1',
			name: 'invert_text1',
			left: 102,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(invert_text1);
		
		// set channel1 invert_on_off_text
		var invert_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'invert_on_off_text1',
			name: 'invert_on_off_text1',
			left: 124,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(invert_on_off_text1);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// channel 2
		
		if(IsDualChannel==0){
			left_adjustment = -210;
		} else {
			left_adjustment = 0;
			
			// set channel2 background
			var ampchannel2Element = document.getElementById('mixer_channel_3_levels_'+color2);
			var ampchannel2Instance = new fabric.Image(ampchannel2Element, {
			  id: 'amp_channel2',
			  name: 'amp_channel2',
			  type: 'amp_channel2',
			  left: 210,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel2Instance);
			
			// set channel2 text
			var channel2_text = new fabric.Textbox(String(label2), {
				id: 'channel2_text',
				name: 'channel2_text',
				left: 210,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel2_text);

			// set input2 text
			var input2_text = new fabric.Textbox(String('Channel B'), {
				id: 'input2_text',
				name: 'input2_text',
				left: 210,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input2_text);
			
			// set channel2 noise_gen_background
            var noiseGenBackElement2 = document.getElementById('noise_gen_background2');
            var noiseGenBackInstance2= new fabric.Image(noiseGenBackElement2, {
              id: 'noise_gen_back2',
              name: 'noise_gen_back2',
              type: 'noise_gen_back',
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance2);

            var noise_gen2 = document.getElementById('pink_noise_enabled2').value;
            var noise_gen2_left = 244;
            if(noise_gen2=="1"){
               noise_gen2_left = 269;
             }

            // add noise_gen_button2
            var noiseGenButtonElement2 = document.getElementById('noise_gen_button2');
            var noiseGenButtonInstance2 = new fabric.Image(noiseGenButtonElement2, {
              id: 'noise_gen_button2',
              name: 'noise_gen_button2',
              type: 'noise_gen_button',
              channel: 2,
              left: noise_gen2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance2);

            // set noise_gen_touch2
            var noiseGenTouchElement2 = document.getElementById('noise_gen_touch2');
            var noiseGenTouchInstance2 = new fabric.Image(noiseGenTouchElement2, {
              id: 'noise_gen_touch2',
              name: 'noise_gen_touch2',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 2,
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance2);

            // set channel2 pink_noise_text
            var pink_noise_text2 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text2',
                name: 'pink_noise_text2',
                left: 222,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text2);

            // set channel2 noise_gen_on_off_text
            var noise_gen_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text2',
                name: 'noise_gen_on_off_text2',
                left: 244,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text2);

            // set channel2 invert_background
            var invertBackElement2 = document.getElementById('invert_background2');
            var invertBackInstance2 = new fabric.Image(invertBackElement2, {
              id: 'invert_back2',
              name: 'invert_back2',
              type: 'invert_back',
              left: 330,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance2);

            var invert2 = document.getElementById('Phase_invert2').value;
            var invert2_left = 334;
            if(invert2=="1"){
               invert2_left = 359;
             }

            // add invert_button2
            var invertButtonElement2 = document.getElementById('invert_button2');
            var invertButtonInstance2 = new fabric.Image(invertButtonElement2, {
              id: 'invert_button2',
              name: 'invert_button2',
              type: 'invert_button',
              channel: 2,
              left: invert2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance2);

            // set mode_touch2_element
            var invert_touchElement2 = document.getElementById('invert_touch2');
            var invert_touchInstance2 = new fabric.Image(invert_touchElement2, {
              id: 'invert_touch2',
              name: 'invert_touch2',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 2,
              left: 340,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance2);

            // set channel2 invert_text
            var invert_text2 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text2',
                name: 'invert_text2',
                left: 312,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text2);

            // set channel2 invert_on_off_text
            var invert_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text2',
                name: 'invert_on_off_text2',
                left: 334,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text2);
			
			var mute2 = document.getElementById('mute2');
			var mute2_off_opacity;
			var mute2_on_opacity;
			if(mute2.value==1){
				mute2_off_opacity=0.0;
				mute2_on_opacity=1.0;
			} else {
				mute2_off_opacity=1.0;
				mute2_on_opacity=0.0;
			}
			// set mute_bar_button2_off
			var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
			var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
			  id: 'mute_bar_button2_off',
			  name: 'mute_bar_button2_off',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2offInstance);

			// set mute_bar_button2_on
			var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
			var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
			  id: 'mute_bar_button2_on',
			  name: 'mute_bar_button2_on',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2onInstance);
			
			var slider2 = document.getElementById('slider2');
			var top2 = get_top_from_volume(slider2.value);

			// set level fader2
			var levelfader2Element = document.getElementById('level_fader2');
			var levelfader2Instance = new fabric.Image(levelfader2Element, {
			  id: 'level_fader2',
			  name: 'level_fader2',
			  type: 'level_fader',
			  channel: 2,
			  left: 320,
			  top: top2,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader2Instance);
			
			// add dropdown_button2
			var dropdown_button2Element = document.getElementById('dropdown_button2');
			var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
			  id: 'dropdown_button2',
			  name: 'dropdown_button2',
			  type: 'dropdown_button',
			  channel: 2,
			  left: 370,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button2Instance);
			
		}
	
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_rms_limiting();
		start_peak_limiting();
		start_compressor_levels();
		start_input_levels();
		start_temperature_status();
		start_standby_mute_status();
		get_preset_list();
		
		var redirect_from_presets_upload = document.getElementById('redirect_from_presets_upload').value;
		if(redirect_from_presets_upload!=''){
		   	get_presets_view();
			document.getElementById('redirect_from_presets_upload').value = '';
			
			// update modal body
			document.getElementById('upload_preset_response_text').innerHTML = redirect_from_presets_upload;
			
			// show modal
			$('#preset_upload_status_modal').modal('show');
		}
	}	
	
	function get_dsp_view3(){
		 
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		var label3 = document.getElementById('label3').value;
		var label4 = document.getElementById('label4').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		var color3 = document.getElementById('color3').value;
		var color4 = document.getElementById('color4').value;
		
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		var left_adjustment;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(1260); // 6 channels
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// channel 1
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_3_levels_'+color1);
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Channel A'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel1 noise_gen_background
		var noiseGenBackElement1 = document.getElementById('noise_gen_background1');
		var noiseGenBackInstance1 = new fabric.Image(noiseGenBackElement1, {
		  id: 'noise_gen_back1',
		  name: 'noise_gen_back1',
		  type: 'noise_gen_back',
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenBackInstance1);
		
		var noise_gen1 = document.getElementById('pink_noise_enabled1').value;
		var noise_gen1_left = 34;
		if(noise_gen1=="1"){
		   noise_gen1_left = 59;
		 }
					
		// add noise_gen_button1
		var noiseGenButtonElement1 = document.getElementById('noise_gen_button1');
		var noiseGenButtonInstance1 = new fabric.Image(noiseGenButtonElement1, {
		  id: 'noise_gen_button1',
		  name: 'noise_gen_button1',
		  type: 'noise_gen_button',
		  channel: 1,
		  left: noise_gen1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenButtonInstance1);
		
		// set noise_gen_touch1
		var noiseGenTouchElement1 = document.getElementById('noise_gen_touch1');
		var noiseGenTouchInstance1 = new fabric.Image(noiseGenTouchElement1, {
		  id: 'noise_gen_touch1',
		  name: 'noise_gen_touch1',
		  type: 'noise_gen_touch',
		  parameter: 'noise_gen_touch',
		  channel: 1,
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenTouchInstance1);
		
		// set channel1 pink_noise_text
		var pink_noise_text1 = new fabric.Textbox(String('Pink Noise'), {
			id: 'pink_noise_text1',
			name: 'pink_noise_text1',
			left: 12,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(pink_noise_text1);
		
		// set channel1 noise_gen_on_off_text
		var noise_gen_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'noise_gen_on_off_text1',
			name: 'noise_gen_on_off_text1',
			left: 34,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(noise_gen_on_off_text1);
		
		// set channel1 invert_background
		var invertBackElement1 = document.getElementById('invert_background1');
		var invertBackInstance1 = new fabric.Image(invertBackElement1, {
		  id: 'invert_back1',
		  name: 'invert_back1',
		  type: 'invert_back',
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertBackInstance1);
		
		var invert1 = document.getElementById('Phase_invert1').value;
		var invert1_left = 124;
		if(invert1=="1"){
		   invert1_left = 149;
		 }
					
		// add invert_button1
		var invertButtonElement1 = document.getElementById('invert_button1');
		var invertButtonInstance1 = new fabric.Image(invertButtonElement1, {
		  id: 'invert_button1',
		  name: 'invert_button1',
		  type: 'invert_button',
		  channel: 1,
		  left: invert1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertButtonInstance1);
		
		// set mode_touch1_element
		var invert_touchElement1 = document.getElementById('invert_touch1');
		var invert_touchInstance1 = new fabric.Image(invert_touchElement1, {
		  id: 'invert_touch1',
		  name: 'invert_touch1',
		  type: 'invert_touch',
		  parameter: 'invert_touch',
		  channel: 1,
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invert_touchInstance1);
		
		// set channel1 invert_text
		var invert_text1 = new fabric.Textbox(String('Phase Invert'), {
			id: 'invert_text1',
			name: 'invert_text1',
			left: 102,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(invert_text1);
		
		// set channel1 invert_on_off_text
		var invert_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'invert_on_off_text1',
			name: 'invert_on_off_text1',
			left: 124,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(invert_on_off_text1);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		if(IsDualChannel==1){
			// channel 2
			// set channel2 background
			var ampchannel2Element = document.getElementById('mixer_channel_3_levels_'+color2);
			var ampchannel2Instance = new fabric.Image(ampchannel2Element, {
			  id: 'amp_channel2',
			  name: 'amp_channel2',
			  type: 'amp_channel2',
			  left: 210,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel2Instance);

			// set channel2 text
			var channel2_text = new fabric.Textbox(String(label2), {
				id: 'channel2_text',
				name: 'channel2_text',
				left: 210,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel2_text);

			// set input2 text
			var input2_text = new fabric.Textbox(String('Channel B'), {
				id: 'input2_text',
				name: 'input2_text',
				left: 210,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input2_text);
			
			// set channel2 noise_gen_background
            var noiseGenBackElement2 = document.getElementById('noise_gen_background2');
            var noiseGenBackInstance2= new fabric.Image(noiseGenBackElement2, {
              id: 'noise_gen_back2',
              name: 'noise_gen_back2',
              type: 'noise_gen_back',
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance2);

            var noise_gen2 = document.getElementById('pink_noise_enabled2').value;
            var noise_gen2_left = 244;
            if(noise_gen2=="1"){
               noise_gen2_left = 269;
             }

            // add noise_gen_button2
            var noiseGenButtonElement2 = document.getElementById('noise_gen_button2');
            var noiseGenButtonInstance2 = new fabric.Image(noiseGenButtonElement2, {
              id: 'noise_gen_button2',
              name: 'noise_gen_button2',
              type: 'noise_gen_button',
              channel: 2,
              left: noise_gen2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance2);

            // set noise_gen_touch2
            var noiseGenTouchElement2 = document.getElementById('noise_gen_touch2');
            var noiseGenTouchInstance2 = new fabric.Image(noiseGenTouchElement2, {
              id: 'noise_gen_touch2',
              name: 'noise_gen_touch2',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 2,
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance2);

            // set channel2 pink_noise_text
            var pink_noise_text2 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text2',
                name: 'pink_noise_text2',
                left: 222,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text2);

            // set channel2 noise_gen_on_off_text
            var noise_gen_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text2',
                name: 'noise_gen_on_off_text2',
                left: 244,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text2);

            // set channel2 invert_background
            var invertBackElement2 = document.getElementById('invert_background2');
            var invertBackInstance2 = new fabric.Image(invertBackElement2, {
              id: 'invert_back2',
              name: 'invert_back2',
              type: 'invert_back',
              left: 330,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance2);

            var invert2 = document.getElementById('Phase_invert2').value;
            var invert2_left = 334;
            if(invert2=="1"){
               invert2_left = 359;
             }

            // add invert_button2
            var invertButtonElement2 = document.getElementById('invert_button2');
            var invertButtonInstance2 = new fabric.Image(invertButtonElement2, {
              id: 'invert_button2',
              name: 'invert_button2',
              type: 'invert_button',
              channel: 2,
              left: invert2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance2);

            // set mode_touch2_element
            var invert_touchElement2 = document.getElementById('invert_touch2');
            var invert_touchInstance2 = new fabric.Image(invert_touchElement2, {
              id: 'invert_touch2',
              name: 'invert_touch2',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 2,
              left: 340,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance2);

            // set channel2 invert_text
            var invert_text2 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text2',
                name: 'invert_text2',
                left: 312,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text2);

            // set channel2 invert_on_off_text
            var invert_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text2',
                name: 'invert_on_off_text2',
                left: 334,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text2);

			var mute2 = document.getElementById('mute2');
			var mute2_off_opacity;
			var mute2_on_opacity;
			if(mute2.value==1){
				mute2_off_opacity=0.0;
				mute2_on_opacity=1.0;
			} else {
				mute2_off_opacity=1.0;
				mute2_on_opacity=0.0;
			}
			// set mute_bar_button2_off
			var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
			var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
			  id: 'mute_bar_button2_off',
			  name: 'mute_bar_button2_off',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2offInstance);

			// set mute_bar_button2_on
			var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
			var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
			  id: 'mute_bar_button2_on',
			  name: 'mute_bar_button2_on',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2onInstance);

			var slider2 = document.getElementById('slider2');
			var top2 = get_top_from_volume(slider2.value);

			// set level fader2
			var levelfader2Element = document.getElementById('level_fader2');
			var levelfader2Instance = new fabric.Image(levelfader2Element, {
			  id: 'level_fader2',
			  name: 'level_fader2',
			  type: 'level_fader',
			  channel: 2,
			  left: 320,
			  top: top2,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader2Instance);

			// add dropdown_button2
			var dropdown_button2Element = document.getElementById('dropdown_button2');
			var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
			  id: 'dropdown_button2',
			  name: 'dropdown_button2',
			  type: 'dropdown_button',
			  channel: 2,
			  left: 370,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button2Instance);
		}
			
		// channel 3
		
		var adjustment3 = 0;
		if(IsDualChannel==0){
		   adjustment3 = -210;
		}
			
		// set channel3 background
		var ampchannel3Element = document.getElementById('mixer_channel_3_levels_'+color3);
		var ampchannel3Instance = new fabric.Image(ampchannel3Element, {
		  id: 'amp_channel3',
		  name: 'amp_channel3',
		  type: 'amp_channel3',
		  left: 420+adjustment3,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel3Instance);

		// set channel3 text
		var channel3_text = new fabric.Textbox(String(label3), {
			id: 'channel3_text',
			name: 'channel3_text',
			left: 420+adjustment3,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel3_text);

		// set input3 text
		var input3_text = new fabric.Textbox(String('Channel C'), {
			id: 'input3_text',
			name: 'input3_text',
			left: 420+adjustment3,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input3_text);
		
		// set channel3 noise_gen_background
        var noiseGenBackElement3 = document.getElementById('noise_gen_background3');
        var noiseGenBackInstance3= new fabric.Image(noiseGenBackElement3, {
          id: 'noise_gen_back3',
          name: 'noise_gen_back3',
          type: 'noise_gen_back',
          left: 450+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenBackInstance3);

        var noise_gen3 = document.getElementById('pink_noise_enabled3').value;
        var noise_gen3_left = 454;
        if(noise_gen3=="1"){
           noise_gen3_left = 479;
         }

        // add noise_gen_button3
        var noiseGenButtonElement3 = document.getElementById('noise_gen_button3');
        var noiseGenButtonInstance3 = new fabric.Image(noiseGenButtonElement3, {
          id: 'noise_gen_button3',
          name: 'noise_gen_button3',
          type: 'noise_gen_button',
          channel: 3,
          left: noise_gen3_left+adjustment3,
          top: 674,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenButtonInstance3);

        // set noise_gen_touch3
        var noiseGenTouchElement3 = document.getElementById('noise_gen_touch3');
        var noiseGenTouchInstance3 = new fabric.Image(noiseGenTouchElement3, {
          id: 'noise_gen_touch3',
          name: 'noise_gen_touch3',
          type: 'noise_gen_touch',
          parameter: 'noise_gen_touch',
          channel: 3,
          left: 450+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenTouchInstance3);

        // set channel3 pink_noise_text
        var pink_noise_text3 = new fabric.Textbox(String('Pink Noise'), {
            id: 'pink_noise_text3',
            name: 'pink_noise_text3',
            left: 432+adjustment3,
            top: 650,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(pink_noise_text3);

        // set channel3 noise_gen_on_off_text
        var noise_gen_on_off_text3 = new fabric.Textbox(String('OFF   ON'), {
            id: 'noise_gen_on_off_text3',
            name: 'noise_gen_on_off_text3',
            left: 454+adjustment3,
            top: 706,
            width: 100,
            fontSize: 12,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'left',
            editable: false,
        });
        canvas.add(noise_gen_on_off_text3);

        // set channel3 invert_background
        var invertBackElement3 = document.getElementById('invert_background3');
        var invertBackInstance3 = new fabric.Image(invertBackElement3, {
          id: 'invert_back3',
          name: 'invert_back3',
          type: 'invert_back',
          left: 540+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invertBackInstance3);

        var invert3 = document.getElementById('Phase_invert3').value;
        var invert3_left = 544;
        if(invert3=="1"){
           invert3_left = 569;
         }

        // add invert_button3
        var invertButtonElement3 = document.getElementById('invert_button3');
        var invertButtonInstance3 = new fabric.Image(invertButtonElement3, {
          id: 'invert_button3',
          name: 'invert_button3',
          type: 'invert_button',
          channel: 3,
          left: invert3_left+adjustment3,
          top: 674,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invertButtonInstance3);

        // set mode_touch3_element
        var invert_touchElement3 = document.getElementById('invert_touch3');
        var invert_touchInstance3 = new fabric.Image(invert_touchElement3, {
          id: 'invert_touch3',
          name: 'invert_touch3',
          type: 'invert_touch',
          parameter: 'invert_touch',
          channel: 3,
          left: 550+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invert_touchInstance3);

        // set channel3 invert_text
        var invert_text3 = new fabric.Textbox(String('Phase Invert'), {
            id: 'invert_text3',
            name: 'invert_text3',
            left: 522+adjustment3,
            top: 650,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(invert_text3);

        // set channel3 invert_on_off_text
        var invert_on_off_text3 = new fabric.Textbox(String('OFF   ON'), {
            id: 'invert_on_off_text3',
            name: 'invert_on_off_text3',
            left: 544+adjustment3,
            top: 706,
            width: 100,
            fontSize: 12,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'left',
            editable: false,
        });
        canvas.add(invert_on_off_text3);

		var mute3 = document.getElementById('mute3');
		var mute3_off_opacity;
		var mute3_on_opacity;
		if(mute3.value==1){
			mute3_off_opacity=0.0;
			mute3_on_opacity=1.0;
		} else {
			mute3_off_opacity=1.0;
			mute3_on_opacity=0.0;
		}
		// set mute_bar_button3_off
		var mutebutton3offElement = document.getElementById('mute_bar_button3_off');
		var mutebutton3offInstance = new fabric.Image(mutebutton3offElement, {
		  id: 'mute_bar_button3_off',
		  name: 'mute_bar_button3_off',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: mute3_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3offInstance);

		// set mute_bar_button3_on
		var mutebutton3onElement = document.getElementById('mute_bar_button3_on');
		var mutebutton3onInstance = new fabric.Image(mutebutton3onElement, {
		  id: 'mute_bar_button3_on',
		  name: 'mute_bar_button3_on',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: mute3_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3onInstance);

		var slider3 = document.getElementById('slider3');
		var top3 = get_top_from_volume(slider3.value);

		// set level fader3
		var levelfader3Element = document.getElementById('level_fader3');
		var levelfader3Instance = new fabric.Image(levelfader3Element, {
		  id: 'level_fader3',
		  name: 'level_fader3',
		  type: 'level_fader',
		  channel: 3,
		  left: 530+adjustment3,
		  top: top3,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader3Instance);

		// add dropdown_button3
		var dropdown_button3Element = document.getElementById('dropdown_button3');
		var dropdown_button3Instance = new fabric.Image(dropdown_button3Element, {
		  id: 'dropdown_button3',
		  name: 'dropdown_button3',
		  type: 'dropdown_button',
		  channel: 3,
		  left: 580+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button3Instance);
		
		if(IsDualChannel2==1){
			// channel 4
			var adjustment4 = 0;
			if(IsDualChannel==0){
		   		adjustment4 = -210;
			}

			// set channel4 background
			var ampchannel4Element = document.getElementById('mixer_channel_3_levels_'+color4);
			var ampchannel4Instance = new fabric.Image(ampchannel4Element, {
			  id: 'amp_channel4',
			  name: 'amp_channel4',
			  type: 'amp_channel4',
			  left: 630+adjustment4,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel4Instance);

			// set channel4 text
			var channel4_text = new fabric.Textbox(String(label4), {
				id: 'channel4_text',
				name: 'channel4_text',
				left: 630+adjustment4,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel4_text);

			// set input4 text
			var input4_text = new fabric.Textbox(String('Channel D'), {
				id: 'input4_text',
				name: 'input4_text',
				left: 630+adjustment4,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input4_text);
			
			// set channel4 noise_gen_background
            var noiseGenBackElement4 = document.getElementById('noise_gen_background4');
            var noiseGenBackInstance4= new fabric.Image(noiseGenBackElement4, {
              id: 'noise_gen_back4',
              name: 'noise_gen_back4',
              type: 'noise_gen_back',
              left: 660+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance4);

            var noise_gen4 = document.getElementById('pink_noise_enabled4').value;
            var noise_gen4_left = 664;
            if(noise_gen4=="1"){
               noise_gen4_left = 689;
             }

            // add noise_gen_button4
            var noiseGenButtonElement4 = document.getElementById('noise_gen_button4');
            var noiseGenButtonInstance4 = new fabric.Image(noiseGenButtonElement4, {
              id: 'noise_gen_button4',
              name: 'noise_gen_button4',
              type: 'noise_gen_button',
              channel: 4,
              left: noise_gen4_left+adjustment4,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance4);

            // set noise_gen_touch4
            var noiseGenTouchElement4 = document.getElementById('noise_gen_touch4');
            var noiseGenTouchInstance4 = new fabric.Image(noiseGenTouchElement4, {
              id: 'noise_gen_touch4',
              name: 'noise_gen_touch4',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 4,
              left: 660+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance4);

            // set channel4 pink_noise_text
            var pink_noise_text4 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text4',
                name: 'pink_noise_text4',
                left: 642+adjustment4,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text4);

            // set channel4 noise_gen_on_off_text
            var noise_gen_on_off_text4 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text4',
                name: 'noise_gen_on_off_text4',
                left: 664+adjustment4,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text4);

            // set channel4 invert_background
            var invertBackElement4 = document.getElementById('invert_background4');
            var invertBackInstance4 = new fabric.Image(invertBackElement4, {
              id: 'invert_back4',
              name: 'invert_back4',
              type: 'invert_back',
              left: 750+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance4);

            var invert4 = document.getElementById('Phase_invert4').value;
            var invert4_left = 754;
            if(invert4=="1"){
               invert4_left = 779;
             }

            // add invert_button4
            var invertButtonElement4 = document.getElementById('invert_button4');
            var invertButtonInstance4 = new fabric.Image(invertButtonElement4, {
              id: 'invert_button4',
              name: 'invert_button4',
              type: 'invert_button',
              channel: 4,
              left: invert4_left+adjustment4,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance4);

            // set mode_touch4_element
            var invert_touchElement4 = document.getElementById('invert_touch4');
            var invert_touchInstance4 = new fabric.Image(invert_touchElement4, {
              id: 'invert_touch4',
              name: 'invert_touch4',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 4,
              left: 760+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance4);

            // set channel4 invert_text
            var invert_text4 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text4',
                name: 'invert_text4',
                left: 732+adjustment4,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text4);

            // set channel4 invert_on_off_text
            var invert_on_off_text4 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text4',
                name: 'invert_on_off_text4',
                left: 754+adjustment4,
                top: 706, 
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text4);

			var mute4 = document.getElementById('mute4');
			var mute4_off_opacity;
			var mute4_on_opacity;
			if(mute4.value==1){
				mute4_off_opacity=0.0;
				mute4_on_opacity=1.0;
			} else {
				mute4_off_opacity=1.0;
				mute4_on_opacity=0.0;
			}
			// set mute_bar_button4_off
			var mutebutton4offElement = document.getElementById('mute_bar_button4_off');
			var mutebutton4offInstance = new fabric.Image(mutebutton4offElement, {
			  id: 'mute_bar_button4_off',
			  name: 'mute_bar_button4_off',
			  type: 'mute_bar_button',
			  channel: 4,
			  left: 640+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: mute4_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton4offInstance);

			// set mute_bar_button4_on
			var mutebutton4onElement = document.getElementById('mute_bar_button4_on');
			var mutebutton4onInstance = new fabric.Image(mutebutton4onElement, {
			  id: 'mute_bar_button4_on',
			  name: 'mute_bar_button4_on',
			  type: 'mute_bar_button',
			  channel: 4,
			  left: 640+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: mute4_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton4onInstance);

			var slider4 = document.getElementById('slider4');
			var top4 = get_top_from_volume(slider4.value);

			// set level fader4
			var levelfader4Element = document.getElementById('level_fader4');
			var levelfader4Instance = new fabric.Image(levelfader4Element, {
			  id: 'level_fader4',
			  name: 'level_fader4',
			  type: 'level_fader',
			  channel: 4,
			  left: 740+adjustment4,
			  top: top4,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader4Instance);

			// add dropdown_button4
			var dropdown_button4Element = document.getElementById('dropdown_button4');
			var dropdown_button4Instance = new fabric.Image(dropdown_button4Element, {
			  id: 'dropdown_button4',
			  name: 'dropdown_button4',
			  type: 'dropdown_button',
			  channel: 4,
			  left: 790+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button4Instance);	
		}
		
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_rms_limiting();
		start_peak_limiting();
		start_compressor_levels();
		start_input_levels();
		start_temperature_status();
		start_standby_mute_status();
		get_preset_list();
		
		var redirect_from_presets_upload = document.getElementById('redirect_from_presets_upload').value;
		if(redirect_from_presets_upload!=''){
		   	get_presets_view();
			document.getElementById('redirect_from_presets_upload').value = '';
			
			// update modal body
			document.getElementById('upload_preset_response_text').innerHTML = redirect_from_presets_upload;
			
			// show modal
			$('#preset_upload_status_modal').modal('show');
		}
	}
	
	function get_dsp_view4(){
		
		var label1 = '';
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(210); // 1 channel
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_2_levels_grey_no_sig_no_clip');
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input 1'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		start_levels();
		start_input_levels();
	}
	
	function get_dsp_view5(){
		
		var label1 = document.getElementById('label1').value;
		var color1 = document.getElementById('color1').value;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(210);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// channel 1
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_2_levels_'+color1);
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		start_signals();
		start_clips();
		start_levels();
		start_limiting();
		start_compressor_levels();
		start_input_levels();
	}	
	
	function get_dsp_view6(){
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(1560);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		var color3 = document.getElementById('color3').value;
		var color4 = document.getElementById('color4').value;
		var color5 = document.getElementById('color5').value;
		var color6 = document.getElementById('color6').value;
		var color7 = document.getElementById('color7').value;
		var color8 = document.getElementById('color8').value;
			
		// set channel1 background
		var mixerchannel1Element = document.getElementById('mixer_channel_2_levels_'+color1);
		var mixerchannel1Instance = new fabric.Image(mixerchannel1Element, {
		  id: 'mixer_channel1',
		  name: 'mixer_channel1',
		  type: 'mixer_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel1Instance);
		
		// set channel1 mode block
		var mixermode1Element = document.getElementById('mixer_mode_block2');
		var mixermode1Instance = new fabric.Image(mixermode1Element, {
		  id: 'mixer_mode1',
		  name: 'mixer_mode1',
		  type: 'mixer_mode1',
		  left: 30,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode1Instance);
		
		// set channel2 background
		var mixerchannel2Element = document.getElementById('mixer_channel_2_levels_'+color2);
		var mixerchannel2Instance = new fabric.Image(mixerchannel2Element, {
		  id: 'mixer_channel2',
		  name: 'mixer_channel2',
		  type: 'mixer_channel2',
		  left: 210,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel2Instance);
		
		// set channel2 mode block
		var mixermode2Element = document.getElementById('mixer_mode_block2');
		var mixermode2Instance = new fabric.Image(mixermode2Element, {
		  id: 'mixer_mode2',
		  name: 'mixer_mode2',
		  type: 'mixer_mode2',
		  left: 240,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode2Instance);
		
		// set channel3 background
		var mixerchannel3Element = document.getElementById('mixer_channel_2_levels_'+color3);
		var mixerchannel3Instance = new fabric.Image(mixerchannel3Element, {
		  id: 'mixer_channel3',
		  name: 'mixer_channel3',
		  type: 'mixer_channel3',
		  left: 420,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel3Instance);
		
		// set channel3 mode block
		var mixermode3Element = document.getElementById('mixer_mode_block2');
		var mixermode3Instance = new fabric.Image(mixermode3Element, {
		  id: 'mixer_mode3',
		  name: 'mixer_mode3',
		  type: 'mixer_mode3',
		  left: 450,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode3Instance);
		
		// set channel4 background
		var mixerchannel4Element = document.getElementById('mixer_channel_2_levels_'+color4);
		var mixerchannel4Instance = new fabric.Image(mixerchannel4Element, {
		  id: 'mixer_channel4',
		  name: 'mixer_channel4',
		  type: 'mixer_channel4',
		  left: 630,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel4Instance);
		
		// set channel4 mode block
		var mixermode4Element = document.getElementById('mixer_mode_block2');
		var mixermode4Instance = new fabric.Image(mixermode4Element, {
		  id: 'mixer_mode4',
		  name: 'mixer_mode4',
		  type: 'mixer_mode4',
		  left: 660,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode4Instance);
		
		// set channel5 background
		var mixerchannel5Element = document.getElementById('mixer_channel_2_levels_'+color5);
		var mixerchannel5Instance = new fabric.Image(mixerchannel5Element, {
		  id: 'mixer_channel5',
		  name: 'mixer_channel5',
		  type: 'mixer_channel5',
		  left: 840,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel5Instance);
		
		// set channel6 background
		var mixerchannel6Element = document.getElementById('mixer_channel_2_levels_'+color6);
		var mixerchannel6Instance = new fabric.Image(mixerchannel6Element, {
		  id: 'mixer_channel6',
		  name: 'mixer_channel6',
		  type: 'mixer_channel6',
		  left: 1050,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel6Instance);
		
		// set channel7 background
		var mixerchannel7Element = document.getElementById('mixer_channel_'+color7);
		var mixerchannel7Instance = new fabric.Image(mixerchannel7Element, {
		  id: 'mixer_channel7',
		  name: 'mixer_channel7',
		  type: 'mixer_channel7',
		  left: 1260,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel7Instance);
		
		// set channel8 background
		var mixerchannel8Element = document.getElementById('mixer_channel_'+color8);
		var mixerchannel8Instance = new fabric.Image(mixerchannel8Element, {
		  id: 'mixer_channel8',
		  name: 'mixer_channel8',
		  type: 'mixer_channel8',
		  left: 1410,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixerchannel8Instance);
		
		// set channel1 text
		var label1 = document.getElementById('label1').value;
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input 1'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel2 text
		var label2 = document.getElementById('label2').value;
		var channel2_text = new fabric.Textbox(String(label2), {
			id: 'channel2_text',
			name: 'channel2_text',
			left: 210,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel2_text);
		
		// set input2 text
		var input2_text = new fabric.Textbox(String('Input 2'), {
			id: 'input2_text',
			name: 'input2_text',
			left: 210,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input2_text);
		
		// set channel3 text
		var label3 = document.getElementById('label3').value;
		var channel3_text = new fabric.Textbox(String(label3), {
			id: 'channel3_text',
			name: 'channel3_text',
			left: 420,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel3_text);
		
		// set input3 text
		var input3_text = new fabric.Textbox(String('Input 3'), {
			id: 'input3_text',
			name: 'input3_text',
			left: 420,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input3_text);
		
		// set channel4 text
		var label4 = document.getElementById('label4').value;
		var channel4_text = new fabric.Textbox(String(label4), {
			id: 'channel4_text',
			name: 'channel4_text',
			left: 630,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel4_text);
		
		// set input4 text
		var input4_text = new fabric.Textbox(String('Input 4'), {
			id: 'input4_text',
			name: 'input4_text',
			left: 630,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input4_text);
		
		// set channel 5 text
		var label5 = document.getElementById('label5').value;
		var label5_text = new fabric.Textbox(String(label5), {
			id: 'label5_text',
			name: 'label5_text',
			left: 840,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(label5_text);
		
		// set input5 text
		var input5_text = new fabric.Textbox(String('Input 5'), {
			id: 'input5_text',
			name: 'input5_text',
			left: 840,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input5_text);
		
		// set channel 6 text
		var label6 = document.getElementById('label6').value;
		var label6_text  = new fabric.Textbox(String(label6), {
			id: 'label6_text',
			name: 'label6_text',
			left: 1050,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(label6_text);
		
		// set input6 text
		var input6_text  = new fabric.Textbox(String('Input 6'), {
			id: 'input6_text',
			name: 'input6_text',
			left: 1050,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input6_text);
	
		// set channel 7 text
		var label7 = document.getElementById('label7').value;
		var label7_text = new fabric.Textbox(String(label7), {
			id: 'label7_text',
			name: 'label7_text',
			left: 1260,
			top: 734,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(label7_text);
		
		// set output1 text
		var output1_text  = new fabric.Textbox(String('Output 1'), {
			id: 'output1_text',
			name: 'output1_text',
			left: 1260,
			top: 764,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output1_text);
		
		// set channel 8 text
		var label8 = document.getElementById('label8').value;
		var label8_text = new fabric.Textbox(String(label8), {
			id: 'label8_text',
			name: 'label8_text',
			left: 1410,
			top: 734,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(label8_text);
		
		// set output2 text
		var output2_text  = new fabric.Textbox(String('Output 2'), {
			id: 'output2_text',
			name: 'output2_text',
			left: 1410,
			top: 764,
			width: 150,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output2_text);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var mute2 = document.getElementById('mute2');
		var mute2_off_opacity;
		var mute2_on_opacity;
		if(mute2.value==1){
		  	mute2_off_opacity=0.0;
			mute2_on_opacity=1.0;
		} else {
			mute2_off_opacity=1.0;
			mute2_on_opacity=0.0;
		}
		// set mute_bar_button2_off
		var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
		var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
		  id: 'mute_bar_button2_off',
		  name: 'mute_bar_button2_off',
		  type: 'mute_bar_button',
		  channel: 2,
		  left: 220,
		  top: 17,
		  angle: 0,
		  opacity: mute2_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton2offInstance);
		
		// set mute_bar_button2_on
		var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
		var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
		  id: 'mute_bar_button2_on',
		  name: 'mute_bar_button2_on',
		  type: 'mute_bar_button',
		  channel: 2,
		  left: 220,
		  top: 17,
		  angle: 0,
		  opacity: mute2_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton2onInstance);
		
		var mute3 = document.getElementById('mute3');
		var mute3_off_opacity;
		var mute3_on_opacity;
		if(mute3.value==1){
		  	mute3_off_opacity=0.0;
			mute3_on_opacity=1.0;
		} else {
			mute3_off_opacity=1.0;
			mute3_on_opacity=0.0;
		}
		// set mute_bar_button3_off
		var mutebutton3offElement = document.getElementById('mute_bar_button3_off');
		var mutebutton3offInstance = new fabric.Image(mutebutton3offElement, {
		  id: 'mute_bar_button3_off',
		  name: 'mute_bar_button3_off',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3offInstance);
		
		// set mute_bar_button3_on
		var mutebutton3onElement = document.getElementById('mute_bar_button3_on');
		var mutebutton3onInstance = new fabric.Image(mutebutton3onElement, {
		  id: 'mute_bar_button3_on',
		  name: 'mute_bar_button3_on',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3onInstance);
		
		var mute4 = document.getElementById('mute4');
		var mute4_off_opacity;
		var mute4_on_opacity;
		if(mute4.value==1){
		  	mute4_off_opacity=0.0;
			mute4_on_opacity=1.0;
		} else {
			mute4_off_opacity=1.0;
			mute4_on_opacity=0.0;
		}
		// set mute_bar_button4_off
		var mutebutton4offElement = document.getElementById('mute_bar_button4_off');
		var mutebutton4offInstance = new fabric.Image(mutebutton4offElement, {
		  id: 'mute_bar_button4_off',
		  name: 'mute_bar_button4_off',
		  type: 'mute_bar_button',
		  channel: 4,
		  left: 640,
		  top: 17,
		  angle: 0,
		  opacity: mute4_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton4offInstance);
		
		// set mute bar button4
		var mutebutton4onElement = document.getElementById('mute_bar_button4_on');
		var mutebutton4onInstance = new fabric.Image(mutebutton4onElement, {
		  id: 'mute_bar_button4_on',
		  name: 'mute_bar_button4_on',
		  type: 'mute_bar_button',
		  channel: 4,
		  left: 640,
		  top: 17,
		  angle: 0,
		  opacity: mute4_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton4onInstance);
		
		var mute5 = document.getElementById('mute5');
		var mute5_off_opacity;
		var mute5_on_opacity;
		if(mute5.value==1){
		  	mute5_off_opacity=0.0;
			mute5_on_opacity=1.0;
		} else {
			mute5_off_opacity=1.0;
			mute5_on_opacity=0.0;
		}
		// set mute_bar_button5_off
		var mutebutton5offElement = document.getElementById('mute_bar_button5_off');
		var mutebutton5offInstance = new fabric.Image(mutebutton5offElement, {
		  id: 'mute_bar_button5_off',
		  name: 'mute_bar_button5_off',
		  type: 'mute_bar_button',
		  channel: 5,
		  left: 850,
		  top: 17,
		  angle: 0,
		  opacity: mute5_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton5offInstance);
		
		// set mute bar button5
		var mutebutton5onElement = document.getElementById('mute_bar_button5_on');
		var mutebutton5onInstance = new fabric.Image(mutebutton5onElement, {
		  id: 'mute_bar_button5_on',
		  name: 'mute_bar_button5_on',
		  type: 'mute_bar_button',
		  channel: 5,
		  left: 850,
		  top: 17,
		  angle: 0,
		  opacity: mute5_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton5onInstance);
		
		var mute6 = document.getElementById('mute6');
		var mute6_off_opacity;
		var mute6_on_opacity;
		if(mute6.value==1){
		  	mute6_off_opacity=0.0;
			mute6_on_opacity=1.0;
		} else {
			mute6_off_opacity=1.0;
			mute6_on_opacity=0.0;
		}
		// set mute_bar_button6_off
		var mutebutton6offElement = document.getElementById('mute_bar_button6_off');
		var mutebutton6offInstance = new fabric.Image(mutebutton6offElement, {
		  id: 'mute_bar_button6_off',
		  name: 'mute_bar_button6_off',
		  type: 'mute_bar_button',
		  channel: 6,
		  left: 1060,
		  top: 17,
		  angle: 0,
		  opacity: mute6_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton6offInstance);
		
		// set mute bar button6
		var mutebutton6onElement = document.getElementById('mute_bar_button6_on');
		var mutebutton6onInstance = new fabric.Image(mutebutton6onElement, {
		  id: 'mute_bar_button6_on',
		  name: 'mute_bar_button6_on',
		  type: 'mute_bar_button',
		  channel: 6,
		  left: 1060,
		  top: 17,
		  angle: 0,
		  opacity: mute6_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton6onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
			
		var slider2 = document.getElementById('slider2');
		var top2 = get_top_from_volume(slider2.value);
		
		var slider3 = document.getElementById('slider3');
		var top3 = get_top_from_volume(slider3.value);
		
		var slider4 = document.getElementById('slider4');
		var top4 = get_top_from_volume(slider4.value);
		
		var slider5 = document.getElementById('slider5');
		var top5 = get_top_from_volume(slider5.value);
		
		var slider6 = document.getElementById('slider6');
		var top6 = get_top_from_volume(slider6.value);
		
		var slider7 = document.getElementById('slider7');
		var top7 = get_top_from_volume(slider7.value);
		
		var slider8 = document.getElementById('slider8');
		var top8 = get_top_from_volume(slider8.value);
			
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// set level fader2
		var levelfader2Element = document.getElementById('level_fader2');
		var levelfader2Instance = new fabric.Image(levelfader2Element, {
		  id: 'level_fader2',
		  name: 'level_fader2',
		  type: 'level_fader',
		  channel: 2,
		  left: 320,
		  top: top2,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader2Instance);
		
		// set level fader3
		var levelfader3Element = document.getElementById('level_fader3');
		var levelfader3Instance = new fabric.Image(levelfader3Element, {
		  id: 'level_fader3',
		  name: 'level_fader3',
		  type: 'level_fader',
		  channel: 3,
		  left: 530,
		  top: top3,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader3Instance);
		
		// set level fader4
		var levelfader4Element = document.getElementById('level_fader4');
		var levelfader4Instance = new fabric.Image(levelfader4Element, {
		  id: 'level_fader4',
		  name: 'level_fader4',
	      type: 'level_fader',
		  channel: 4,
		  left: 740,
		  top: top4,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader4Instance);
		
		// set level output5
		var levelfader5Element = document.getElementById('level_fader5');
		var levelfader5Instance = new fabric.Image(levelfader5Element, {
		  id: 'level_fader5',
		  name: 'level_fader5',
	      type: 'level_fader',
		  channel: 5,
		  left: 950,
		  top: top5,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader5Instance);
		
		// set level fader6
		var levelfader6Element = document.getElementById('level_fader6');
		var levelfader6Instance = new fabric.Image(levelfader6Element, {
		  id: 'level_fader6',
		  name: 'level_fader6',
	      type: 'level_fader',
		  channel: 6,
		  left: 1160,
		  top: top6,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader6Instance);
		
		// set level fader7
		var levelfader7Element = document.getElementById('level_fader7');
		var levelfader7Instance = new fabric.Image(levelfader7Element, {
		  id: 'level_fader7',
		  name: 'level_fader7',
	      type: 'level_fader',
		  channel: 7,
		  left: 1305,
		  top: top7,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader7Instance);
		
		// set level fader8
		var levelfader8Element = document.getElementById('level_fader8');
		var levelfader8Instance = new fabric.Image(levelfader8Element, {
		  id: 'level_fader8',
		  name: 'level_fader8',
	      type: 'level_fader',
		  channel: 8,
		  left: 1455,
		  top: top8,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader8Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// add dropdown_button2
		var dropdown_button2Element = document.getElementById('dropdown_button2');
		var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
		  id: 'dropdown_button2',
		  name: 'dropdown_button2',
		  type: 'dropdown_button',
		  channel: 2,
		  left: 370,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button2Instance);
		
		// add dropdown_button3
		var dropdown_button3Element = document.getElementById('dropdown_button3');
		var dropdown_button3Instance = new fabric.Image(dropdown_button3Element, {
		  id: 'dropdown_button3',
		  name: 'dropdown_button3',
		  type: 'dropdown_button',
		  channel: 3,
		  left: 580,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button3Instance);
		
		// add dropdown_button4
		var dropdown_button4Element = document.getElementById('dropdown_button4');
		var dropdown_button4Instance = new fabric.Image(dropdown_button4Element, {
		  id: 'dropdown_button4',
		  name: 'dropdown_button4',
		  type: 'dropdown_button',
		  channel: 4,
		  left: 790,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button4Instance);
		
		// add dropdown_button5
		var dropdown_button5Element = document.getElementById('dropdown_button5');
		var dropdown_button5Instance = new fabric.Image(dropdown_button5Element, {
		  id: 'dropdown_button5',
		  name: 'dropdown_button5',
		  type: 'dropdown_button',
		  channel: 5,
		  left: 1000,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button5Instance);
		
		
		// add dropdown_button6
		var dropdown_button6Element = document.getElementById('dropdown_button6');
		var dropdown_button6Instance = new fabric.Image(dropdown_button6Element, {
		  id: 'dropdown_button6',
		  name: 'dropdown_button6',
		  type: 'dropdown_button',
		  channel: 6,
		  left: 1210,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button6Instance);
		
		// add dropdown_button7
		var dropdown_button7Element = document.getElementById('dropdown_button7');
		var dropdown_button7Instance = new fabric.Image(dropdown_button7Element, {
		  id: 'dropdown_button7',
		  name: 'dropdown_button7',
		  type: 'dropdown_button',
		  channel: 7,
		  left: 1360,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button7Instance);
		
		// add dropdown_button8
		var dropdown_button8Element = document.getElementById('dropdown_button8');
		var dropdown_button8Instance = new fabric.Image(dropdown_button8Element, {
		  id: 'dropdown_button8',
		  name: 'dropdown_button8',
		  type: 'dropdown_button',
		  channel: 8,
		  left: 1510,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button8Instance);
		
		var phantom1 = document.getElementById('Phantom1').value;
		var p1_left = 114;
		if(phantom1==1){
		   p1_left = 140;
		 }
		
		var phantom2 = document.getElementById('Phantom2').value;
		var p2_left = 324;
		if(phantom2==1){
		   p2_left = 350;
		 }
		
		var phantom3 = document.getElementById('Phantom3').value;
		var p3_left = 534;
		if(phantom3==1){
		   p3_left = 560;
		 }
		
		var phantom4 = document.getElementById('Phantom4').value;
		var p4_left = 744;
		if(phantom4==1){
		   p4_left = 770;
		 }
		
		var mode1 = document.getElementById('Mode1').value;
		var m1_left = 43;
		if(mode1=="MIC"){
		   m1_left = 69;
		 }
		
		var mode2 = document.getElementById('Mode2').value;
		var m2_left = 253;
		if(mode2=="MIC"){
		   m2_left = 279;
		 }
		
		var mode3 = document.getElementById('Mode3').value;
		var m3_left = 463;
		if(mode3=="MIC"){
		   m3_left = 489;
		 }
		
		var mode4 = document.getElementById('Mode4').value;
		var m4_left = 673;
		if(mode4=="MIC"){
		   m4_left = 699;
		 }
					
		// add mode1 button
		var mode1Element = document.getElementById('Mode_button1');
		var mode1Instance = new fabric.Image(mode1Element, {
		  id: 'mode_button1',
		  name: 'mode_button1',
		  type: 'mode_button',
		  channel: 1,
		  left: m1_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode1Instance);
		
		// set mode_touch1_element
		var mode_touch1_element = document.getElementById('Mode_touch1');
		var mode_touch1_instance = new fabric.Image(mode_touch1_element, {
		  id: 'Mode_touch1',
		  name: 'Mode_touch1',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 1,
		  left: 34,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch1_instance);
		
		// add mode2 button
		var mode2Element = document.getElementById('Mode_button2');
		var mode2Instance = new fabric.Image(mode2Element, {
		  id: 'mode_button2',
		  name: 'mode_button2',
		  type: 'mode_button',
		  channel: 2,
		  left: m2_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode2Instance);
		
		// set mode_touch2_element
		var mode_touch2_element = document.getElementById('Mode_touch2');
		var mode_touch2_instance = new fabric.Image(mode_touch2_element, {
		  id: 'Mode_touch2',
		  name: 'Mode_touch2',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 2,
		  left: 250,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch2_instance);
		
		// add mode3 button
		var mode3Element = document.getElementById('Mode_button3');
		var mode3Instance = new fabric.Image(mode3Element, {
		  id: 'mode_button3',
		  name: 'mode_button3',
		  type: 'mode_button',
		  channel: 3,
		  left: m3_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode3Instance);
		
		// set mode_touch3_element
		var mode_touch3_element = document.getElementById('Mode_touch3');
		var mode_touch3_instance = new fabric.Image(mode_touch3_element, {
		  id: 'Mode_touch3',
		  name: 'Mode_touch3',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 3,
		  left: 460,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch3_instance);
		
		// add mode4 button
		var mode4Element = document.getElementById('Mode_button4');
		var mode4Instance = new fabric.Image(mode4Element, {
		  id: 'mode_button4',
		  name: 'mode_button4',
		  type: 'mode_button',
		  channel: 4,
		  left: m4_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode4Instance);
		
		// set mode_touch4_element
		var mode_touch4_element = document.getElementById('Mode_touch4');
		var mode_touch4_instance = new fabric.Image(mode_touch4_element, {
		  id: 'Mode_touch4',
		  name: 'Mode_touch4',
		  type: 'Mode_touch',
		  parameter: 'Mode',
		  channel: 4,
		  left: 670,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mode_touch4_instance);
		
		// add phantom1 button
		var phantom1Element = document.getElementById('Phantom_button1');
		var phantom1Instance = new fabric.Image(phantom1Element, {
		  id: 'phantom_button1',
		  name: 'phantom_button1',
		  type: 'phantom_button',
		  channel: 1,
		  left: p1_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom1Instance);
		
		// set phantom_touch1_element
		var phantom_touch1_element = document.getElementById('Phantom_touch1');
		var phantom_touch1_instance = new fabric.Image(phantom_touch1_element, {
		  id: 'Phantom_touch1',
		  name: 'Phantom_touch1',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 1,
		  left: 116,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch1_instance);
		
		// add phantom2 button
		var phantom2Element = document.getElementById('Phantom_button2');
		var phantom2Instance = new fabric.Image(phantom2Element, {
		  id: 'phantom_button2',
		  name: 'phantom_button2',
		  type: 'phantom_button',
		  channel: 2,
		  left: p2_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom2Instance);
		
		// set phantom_touch2_element
		var phantom_touch2_element = document.getElementById('Phantom_touch2');
		var phantom_touch2_instance = new fabric.Image(phantom_touch2_element, {
		  id: 'Phantom_touch2',
		  name: 'Phantom_touch2',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 2,
		  left: 320,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch2_instance);
		
		// add phantom3 button
		var phantom3Element = document.getElementById('Phantom_button3');
		var phantom3Instance = new fabric.Image(phantom3Element, {
		  id: 'phantom_button3',
		  name: 'phantom_button3',
		  type: 'phantom_button',
		  channel: 3,
		  left: p3_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom3Instance);
		
		// set phantom_touch3_element
		var phantom_touch3_element = document.getElementById('Phantom_touch3');
		var phantom_touch3_instance = new fabric.Image(phantom_touch3_element, {
		  id: 'Phantom_touch3',
		  name: 'Phantom_touch3',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 3,
		  left: 530,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch3_instance);
		
		// add phantom4 button
		var phantom4Element = document.getElementById('Phantom_button4');
		var phantom4Instance = new fabric.Image(phantom4Element, {
		  id: 'phantom_button4',
		  name: 'phantom_button4',
		  type: 'phantom_button',
		  channel: 4,
		  left: p4_left,
		  top: 678,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom4Instance);
		
		// set phantom_touch4_element
		var phantom_touch4_element = document.getElementById('Phantom_touch4');
		var phantom_touch4_instance = new fabric.Image(phantom_touch4_element, {
		  id: 'Phantom_touch4',
		  name: 'Phantom_touch4',
		  type: 'Phantom_touch',
		  parameter: 'Phantom',
		  channel: 4,
		  left: 740,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phantom_touch4_instance);
		
		for(var x=0;x<main_data_array.length;x++){
			
			var type = main_data_array[x]['type'];
			if(type=='knob'){
				
				var name = main_data_array[x]['name'];
				var parameter = main_data_array[x]['parameter'];
				var channel = main_data_array[x]['channel'];
				var indicator_left = main_data_array[x]['indicator_left'];
				var indicator_top = main_data_array[x]['indicator_top'];
				var text_left = main_data_array[x]['text_left'];
				var text_top = main_data_array[x]['text_top'];
				
				var input = document.getElementById(name).value;
				var angle = -150+(input*10.714);

				// set gain_indicator_element
				var gain_indicator_element = document.getElementById('indicator_'+name);
				var gain_indicator_instance = new fabric.Image(gain_indicator_element, { 
				  id: 'indicator_'+name,
				  name: 'indicator_'+name,
				  name2: name,
				  type: 'mic_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(gain_indicator_instance);

				// set gain_touch_element
				var gain_touch_element = document.getElementById('touch_'+name);
				var gain_touch_instance = new fabric.Image(gain_touch_element, {
				  id: 'touch_'+name,
				  name: 'touch_'+name,
				  type: 'mic_touch',
				  parameter: parameter,
				  name2: name,
				  channel: channel,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(gain_touch_instance);

				// set input text
				var text = input;
				
				var gain_text = new fabric.Textbox(String(text), {
					id: name +'_text',
					name: name+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(gain_text);
			}
		}
		
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_compressor_levels();
		start_input_levels();
		start_temperature_status();
	}	
		
	function get_dsp_view7(){
			
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		var label3 = document.getElementById('label3').value;
		var label4 = document.getElementById('label4').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		var color3 = document.getElementById('color3').value;
		var color4 = document.getElementById('color4').value;
			
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		var left_adjustment;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(840); // 4 channels
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// channel 1
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_3_levels_'+color1);
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Channel A'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel1 noise_gen_background
		var noiseGenBackElement1 = document.getElementById('noise_gen_background1');
		var noiseGenBackInstance1 = new fabric.Image(noiseGenBackElement1, {
		  id: 'noise_gen_back1',
		  name: 'noise_gen_back1',
		  type: 'noise_gen_back',
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenBackInstance1);
		
		var noise_gen1 = document.getElementById('pink_noise_enabled1').value;
		var noise_gen1_left = 34;
		if(noise_gen1=="1"){
		   noise_gen1_left = 59;
		 }
					
		// add noise_gen_button1
		var noiseGenButtonElement1 = document.getElementById('noise_gen_button1');
		var noiseGenButtonInstance1 = new fabric.Image(noiseGenButtonElement1, {
		  id: 'noise_gen_button1',
		  name: 'noise_gen_button1',
		  type: 'noise_gen_button',
		  channel: 1,
		  left: noise_gen1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenButtonInstance1);
		
		// set noise_gen_touch1
		var noiseGenTouchElement1 = document.getElementById('noise_gen_touch1');
		var noiseGenTouchInstance1 = new fabric.Image(noiseGenTouchElement1, {
		  id: 'noise_gen_touch1',
		  name: 'noise_gen_touch1',
		  type: 'noise_gen_touch',
		  parameter: 'noise_gen_touch',
		  channel: 1,
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenTouchInstance1);
		
		// set channel1 pink_noise_text
		var pink_noise_text1 = new fabric.Textbox(String('Pink Noise'), {
			id: 'pink_noise_text1',
			name: 'pink_noise_text1',
			left: 12,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(pink_noise_text1);
		
		// set channel1 noise_gen_on_off_text
		var noise_gen_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'noise_gen_on_off_text1',
			name: 'noise_gen_on_off_text1',
			left: 34,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(noise_gen_on_off_text1);
		
		// set channel1 invert_background
		var invertBackElement1 = document.getElementById('invert_background1');
		var invertBackInstance1 = new fabric.Image(invertBackElement1, {
		  id: 'invert_back1',
		  name: 'invert_back1',
		  type: 'invert_back',
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertBackInstance1);
		
		var invert1 = document.getElementById('Phase_invert1').value;
		var invert1_left = 124;
		if(invert1=="1"){
		   invert1_left = 149;
		 }
					
		// add invert_button1
		var invertButtonElement1 = document.getElementById('invert_button1');
		var invertButtonInstance1 = new fabric.Image(invertButtonElement1, {
		  id: 'invert_button1',
		  name: 'invert_button1',
		  type: 'invert_button',
		  channel: 1,
		  left: invert1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertButtonInstance1);
		
		// set mode_touch1_element
		var invert_touchElement1 = document.getElementById('invert_touch1');
		var invert_touchInstance1 = new fabric.Image(invert_touchElement1, {
		  id: 'invert_touch1',
		  name: 'invert_touch1',
		  type: 'invert_touch',
		  parameter: 'invert_touch',
		  channel: 1,
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invert_touchInstance1);
		
		// set channel1 invert_text
		var invert_text1 = new fabric.Textbox(String('Phase Invert'), {
			id: 'invert_text1',
			name: 'invert_text1',
			left: 102,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(invert_text1);
		
		// set channel1 invert_on_off_text
		var invert_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'invert_on_off_text1',
			name: 'invert_on_off_text1',
			left: 124,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(invert_on_off_text1);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		if(IsDualChannel==1){
			// channel 2
			// set channel2 background
			var ampchannel2Element = document.getElementById('mixer_channel_3_levels_'+color2);
			var ampchannel2Instance = new fabric.Image(ampchannel2Element, {
			  id: 'amp_channel2',
			  name: 'amp_channel2',
			  type: 'amp_channel2',
			  left: 210,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel2Instance);
			
			// set channel2 text
			var channel2_text = new fabric.Textbox(String(label2), {
				id: 'channel2_text',
				name: 'channel2_text',
				left: 210,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel2_text);

			// set input2 text
			var input2_text = new fabric.Textbox(String('Channel B'), {
				id: 'input2_text',
				name: 'input2_text',
				left: 210,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input2_text);
			
			// set channel2 noise_gen_background
            var noiseGenBackElement2 = document.getElementById('noise_gen_background2');
            var noiseGenBackInstance2= new fabric.Image(noiseGenBackElement2, {
              id: 'noise_gen_back2',
              name: 'noise_gen_back2',
              type: 'noise_gen_back',
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance2);

            var noise_gen2 = document.getElementById('pink_noise_enabled2').value;
            var noise_gen2_left = 244;
            if(noise_gen2=="1"){
               noise_gen2_left = 269;
             }

            // add noise_gen_button2
            var noiseGenButtonElement2 = document.getElementById('noise_gen_button2');
            var noiseGenButtonInstance2 = new fabric.Image(noiseGenButtonElement2, {
              id: 'noise_gen_button2',
              name: 'noise_gen_button2',
              type: 'noise_gen_button',
              channel: 2,
              left: noise_gen2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance2);

            // set noise_gen_touch2
            var noiseGenTouchElement2 = document.getElementById('noise_gen_touch2');
            var noiseGenTouchInstance2 = new fabric.Image(noiseGenTouchElement2, {
              id: 'noise_gen_touch2',
              name: 'noise_gen_touch2',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 2,
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance2);

            // set channel2 pink_noise_text
            var pink_noise_text2 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text2',
                name: 'pink_noise_text2',
                left: 222,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text2);

            // set channel2 noise_gen_on_off_text
            var noise_gen_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text2',
                name: 'noise_gen_on_off_text2',
                left: 244,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text2);

            // set channel2 invert_background
            var invertBackElement2 = document.getElementById('invert_background2');
            var invertBackInstance2 = new fabric.Image(invertBackElement2, {
              id: 'invert_back2',
              name: 'invert_back2',
              type: 'invert_back',
              left: 330,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance2);

            var invert2 = document.getElementById('Phase_invert2').value;
            var invert2_left = 334;
            if(invert2=="1"){
               invert2_left = 359;
             }

            // add invert_button2
            var invertButtonElement2 = document.getElementById('invert_button2');
            var invertButtonInstance2 = new fabric.Image(invertButtonElement2, {
              id: 'invert_button2',
              name: 'invert_button2',
              type: 'invert_button',
              channel: 2,
              left: invert2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance2);

            // set mode_touch2_element
            var invert_touchElement2 = document.getElementById('invert_touch2');
            var invert_touchInstance2 = new fabric.Image(invert_touchElement2, {
              id: 'invert_touch2',
              name: 'invert_touch2',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 2,
              left: 340,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance2);

            // set channel2 invert_text
            var invert_text2 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text2',
                name: 'invert_text2',
                left: 312,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text2);

            // set channel2 invert_on_off_text
            var invert_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text2',
                name: 'invert_on_off_text2',
                left: 334,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text2);

			var mute2 = document.getElementById('mute2');
			var mute2_off_opacity;
			var mute2_on_opacity;
			if(mute2.value==1){
				mute2_off_opacity=0.0;
				mute2_on_opacity=1.0;
			} else {
				mute2_off_opacity=1.0;
				mute2_on_opacity=0.0;
			}
			// set mute_bar_button2_off
			var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
			var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
			  id: 'mute_bar_button2_off',
			  name: 'mute_bar_button2_off',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2offInstance);

			// set mute_bar_button2_on
			var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
			var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
			  id: 'mute_bar_button2_on',
			  name: 'mute_bar_button2_on',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2onInstance);

			var slider2 = document.getElementById('slider2');
			var top2 = get_top_from_volume(slider2.value);

			// set level fader2
			var levelfader2Element = document.getElementById('level_fader2');
			var levelfader2Instance = new fabric.Image(levelfader2Element, {
			  id: 'level_fader2',
			  name: 'level_fader2',
			  type: 'level_fader',
			  channel: 2,
			  left: 320,
			  top: top2,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader2Instance);

			// add dropdown_button2
			var dropdown_button2Element = document.getElementById('dropdown_button2');
			var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
			  id: 'dropdown_button2',
			  name: 'dropdown_button2',
			  type: 'dropdown_button',
			  channel: 2,
			  left: 370,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button2Instance);
		}
			
		// channel 3
		
		var adjustment3 = 0;
		if(IsDualChannel==0){
		   adjustment3 = -210;
		}
			
		// set channel3 background
		var ampchannel3Element = document.getElementById('mixer_channel_3_levels_'+color3);
		var ampchannel3Instance = new fabric.Image(ampchannel3Element, {
		  id: 'amp_channel3',
		  name: 'amp_channel3',
		  type: 'amp_channel3',
		  left: 420+adjustment3,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel3Instance);
		
		// set channel3 text
		var channel3_text = new fabric.Textbox(String(label3), {
			id: 'channel3_text',
			name: 'channel3_text',
			left: 420+adjustment3,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel3_text);

		// set input3 text
		var input3_text = new fabric.Textbox(String('Channel C'), {
			id: 'input3_text',
			name: 'input3_text',
			left: 420+adjustment3,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input3_text);
		
		// set channel3 noise_gen_background
        var noiseGenBackElement3 = document.getElementById('noise_gen_background3');
        var noiseGenBackInstance3= new fabric.Image(noiseGenBackElement3, {
          id: 'noise_gen_back3',
          name: 'noise_gen_back3',
          type: 'noise_gen_back',
          left: 450+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenBackInstance3);

        var noise_gen3 = document.getElementById('pink_noise_enabled3').value;
        var noise_gen3_left = 454;
        if(noise_gen3=="1"){
           noise_gen3_left = 479;
         }

        // add noise_gen_button3
        var noiseGenButtonElement3 = document.getElementById('noise_gen_button3');
        var noiseGenButtonInstance3 = new fabric.Image(noiseGenButtonElement3, {
          id: 'noise_gen_button3',
          name: 'noise_gen_button3',
          type: 'noise_gen_button',
          channel: 3,
          left: noise_gen3_left+adjustment3,
          top: 674,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenButtonInstance3);

        // set noise_gen_touch3
        var noiseGenTouchElement3 = document.getElementById('noise_gen_touch3');
        var noiseGenTouchInstance3 = new fabric.Image(noiseGenTouchElement3, {
          id: 'noise_gen_touch3',
          name: 'noise_gen_touch3',
          type: 'noise_gen_touch',
          parameter: 'noise_gen_touch',
          channel: 3,
          left: 450+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(noiseGenTouchInstance3);

        // set channel3 pink_noise_text
        var pink_noise_text3 = new fabric.Textbox(String('Pink Noise'), {
            id: 'pink_noise_text3',
            name: 'pink_noise_text3',
            left: 432+adjustment3,
            top: 650,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(pink_noise_text3);

        // set channel3 noise_gen_on_off_text
        var noise_gen_on_off_text3 = new fabric.Textbox(String('OFF   ON'), {
            id: 'noise_gen_on_off_text3',
            name: 'noise_gen_on_off_text3',
            left: 454+adjustment3,
            top: 706,
            width: 100,
            fontSize: 12,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'left',
            editable: false,
        });
        canvas.add(noise_gen_on_off_text3);

        // set channel3 invert_background
        var invertBackElement3 = document.getElementById('invert_background3');
        var invertBackInstance3 = new fabric.Image(invertBackElement3, {
          id: 'invert_back3',
          name: 'invert_back3',
          type: 'invert_back',
          left: 540+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invertBackInstance3);

        var invert3 = document.getElementById('Phase_invert3').value;
        var invert3_left = 544;
        if(invert3=="1"){
           invert3_left = 569;
         }

        // add invert_button3
        var invertButtonElement3 = document.getElementById('invert_button3');
        var invertButtonInstance3 = new fabric.Image(invertButtonElement3, {
          id: 'invert_button3',
          name: 'invert_button3',
          type: 'invert_button',
          channel: 3,
          left: invert3_left+adjustment3,
          top: 674,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invertButtonInstance3);

        // set mode_touch3_element
        var invert_touchElement3 = document.getElementById('invert_touch3');
        var invert_touchInstance3 = new fabric.Image(invert_touchElement3, {
          id: 'invert_touch3',
          name: 'invert_touch3',
          type: 'invert_touch',
          parameter: 'invert_touch',
          channel: 3,
          left: 550+adjustment3,
          top: 670,
          angle: 0,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(invert_touchInstance3);

        // set channel3 invert_text
        var invert_text3 = new fabric.Textbox(String('Phase Invert'), {
            id: 'invert_text3',
            name: 'invert_text3',
            left: 522+adjustment3,
            top: 650,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(invert_text3);

        // set channel3 invert_on_off_text
        var invert_on_off_text3 = new fabric.Textbox(String('OFF   ON'), {
            id: 'invert_on_off_text3',
            name: 'invert_on_off_text3',
            left: 544+adjustment3,
            top: 706,
            width: 100,
            fontSize: 12,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'left',
            editable: false,
        });
        canvas.add(invert_on_off_text3);

		var mute3 = document.getElementById('mute3');
		var mute3_off_opacity;
		var mute3_on_opacity;
		if(mute3.value==1){
			mute3_off_opacity=0.0;
			mute3_on_opacity=1.0;
		} else {
			mute3_off_opacity=1.0;
			mute3_on_opacity=0.0;
		}
		// set mute_bar_button3_off
		var mutebutton3offElement = document.getElementById('mute_bar_button3_off');
		var mutebutton3offInstance = new fabric.Image(mutebutton3offElement, {
		  id: 'mute_bar_button3_off',
		  name: 'mute_bar_button3_off',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: mute3_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3offInstance);

		// set mute_bar_button3_on
		var mutebutton3onElement = document.getElementById('mute_bar_button3_on');
		var mutebutton3onInstance = new fabric.Image(mutebutton3onElement, {
		  id: 'mute_bar_button3_on',
		  name: 'mute_bar_button3_on',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: mute3_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3onInstance);

		var slider3 = document.getElementById('slider3');
		var top3 = get_top_from_volume(slider3.value);

		// set level fader3
		var levelfader3Element = document.getElementById('level_fader3');
		var levelfader3Instance = new fabric.Image(levelfader3Element, {
		  id: 'level_fader3',
		  name: 'level_fader3',
		  type: 'level_fader',
		  channel: 3,
		  left: 530+adjustment3,
		  top: top3,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader3Instance);

		// add dropdown_button3
		var dropdown_button3Element = document.getElementById('dropdown_button3');
		var dropdown_button3Instance = new fabric.Image(dropdown_button3Element, {
		  id: 'dropdown_button3',
		  name: 'dropdown_button3',
		  type: 'dropdown_button',
		  channel: 3,
		  left: 580+adjustment3,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button3Instance);
		
		if(IsDualChannel2==1){
			// channel 4
			
			var adjustment4 = 0;
			if(IsDualChannel==0){
		   		adjustment4 = -210;
			}
			
			// set channel4 background
			var ampchannel4Element = document.getElementById('mixer_channel_3_levels_'+color4);
			var ampchannel4Instance = new fabric.Image(ampchannel4Element, {
			  id: 'amp_channel4',
			  name: 'amp_channel4',
			  type: 'amp_channel4',
			  left: 630+adjustment4,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel4Instance);
			
			// set channel4 text
			var channel4_text = new fabric.Textbox(String(label4), {
				id: 'channel4_text',
				name: 'channel4_text',
				left: 630+adjustment4,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel4_text);

			// set input4 text
			var input4_text = new fabric.Textbox(String('Channel D'), {
				id: 'input4_text',
				name: 'input4_text',
				left: 630+adjustment4,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input4_text);
			
			// set channel4 noise_gen_background
            var noiseGenBackElement4 = document.getElementById('noise_gen_background4');
            var noiseGenBackInstance4= new fabric.Image(noiseGenBackElement4, {
              id: 'noise_gen_back4',
              name: 'noise_gen_back4',
              type: 'noise_gen_back',
              left: 660+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance4);

            var noise_gen4 = document.getElementById('pink_noise_enabled4').value;
            var noise_gen4_left = 664;
            if(noise_gen4=="1"){
               noise_gen4_left = 689;
             }

            // add noise_gen_button4
            var noiseGenButtonElement4 = document.getElementById('noise_gen_button4');
            var noiseGenButtonInstance4 = new fabric.Image(noiseGenButtonElement4, {
              id: 'noise_gen_button4',
              name: 'noise_gen_button4',
              type: 'noise_gen_button',
              channel: 4,
              left: noise_gen4_left+adjustment4,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance4);

            // set noise_gen_touch4
            var noiseGenTouchElement4 = document.getElementById('noise_gen_touch4');
            var noiseGenTouchInstance4 = new fabric.Image(noiseGenTouchElement4, {
              id: 'noise_gen_touch4',
              name: 'noise_gen_touch4',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 4,
              left: 660+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance4);

            // set channel4 pink_noise_text
            var pink_noise_text4 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text4',
                name: 'pink_noise_text4',
                left: 642+adjustment4,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text4);

            // set channel4 noise_gen_on_off_text
            var noise_gen_on_off_text4 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text4',
                name: 'noise_gen_on_off_text4',
                left: 664+adjustment4,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text4);

            // set channel4 invert_background
            var invertBackElement4 = document.getElementById('invert_background4');
            var invertBackInstance4 = new fabric.Image(invertBackElement4, {
              id: 'invert_back4',
              name: 'invert_back4',
              type: 'invert_back',
              left: 750+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance4);

            var invert4 = document.getElementById('Phase_invert4').value;
            var invert4_left = 754;
            if(invert4=="1"){
               invert4_left = 779;
             }

            // add invert_button4
            var invertButtonElement4 = document.getElementById('invert_button4');
            var invertButtonInstance4 = new fabric.Image(invertButtonElement4, {
              id: 'invert_button4',
              name: 'invert_button4',
              type: 'invert_button',
              channel: 4,
              left: invert4_left+adjustment4,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance4);

            // set mode_touch4_element
            var invert_touchElement4 = document.getElementById('invert_touch4');
            var invert_touchInstance4 = new fabric.Image(invert_touchElement4, {
              id: 'invert_touch4',
              name: 'invert_touch4',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 4,
              left: 760+adjustment4,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance4);

            // set channel4 invert_text
            var invert_text4 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text4',
                name: 'invert_text4',
                left: 732+adjustment4,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text4);

            // set channel4 invert_on_off_text
            var invert_on_off_text4 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text4',
                name: 'invert_on_off_text4',
                left: 754+adjustment4,
                top: 706, 
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text4);
			
			var mute4 = document.getElementById('mute4');
			var mute4_off_opacity;
			var mute4_on_opacity;
			if(mute4.value==1){
				mute4_off_opacity=0.0;
				mute4_on_opacity=1.0;
			} else {
				mute4_off_opacity=1.0;
				mute4_on_opacity=0.0;
			}
			// set mute_bar_button4_off
			var mutebutton4offElement = document.getElementById('mute_bar_button4_off');
			var mutebutton4offInstance = new fabric.Image(mutebutton4offElement, {
			  id: 'mute_bar_button4_off',
			  name: 'mute_bar_button4_off',
			  type: 'mute_bar_button',
			  channel: 4,
			  left: 640+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: mute4_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton4offInstance);

			// set mute_bar_button4_on
			var mutebutton4onElement = document.getElementById('mute_bar_button4_on');
			var mutebutton4onInstance = new fabric.Image(mutebutton4onElement, {
			  id: 'mute_bar_button4_on',
			  name: 'mute_bar_button4_on',
			  type: 'mute_bar_button',
			  channel: 4,
			  left: 640+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: mute4_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton4onInstance);

			var slider4 = document.getElementById('slider4');
			var top4 = get_top_from_volume(slider4.value);

			// set level fader4
			var levelfader4Element = document.getElementById('level_fader4');
			var levelfader4Instance = new fabric.Image(levelfader4Element, {
			  id: 'level_fader4',
			  name: 'level_fader4',
			  type: 'level_fader',
			  channel: 4,
			  left: 740+adjustment4,
			  top: top4,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader4Instance);

			// add dropdown_button4
			var dropdown_button4Element = document.getElementById('dropdown_button4');
			var dropdown_button4Instance = new fabric.Image(dropdown_button4Element, {
			  id: 'dropdown_button4',
			  name: 'dropdown_button4',
			  type: 'dropdown_button',
			  channel: 4,
			  left: 790+adjustment4,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button4Instance);
		}
		
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_rms_limiting();
		start_peak_limiting();
		start_compressor_levels();
		start_input_levels();
		start_temperature_status();
		start_standby_mute_status();
		get_preset_list();
		
		var redirect_from_presets_upload = document.getElementById('redirect_from_presets_upload').value;
		if(redirect_from_presets_upload!=''){
		   	get_presets_view();
			document.getElementById('redirect_from_presets_upload').value = '';
			
			// update modal body
			document.getElementById('upload_preset_response_text').innerHTML = redirect_from_presets_upload;
			
			// show modal
			$('#preset_upload_status_modal').modal('show');
		}
	}
		
	function get_dsp_view8(){
		 
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
			
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var left_adjustment;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(420); // 2 channels
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// channel 1
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_3_levels_'+color1);
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Channel A'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		// set channel1 noise_gen_background
		var noiseGenBackElement1 = document.getElementById('noise_gen_background1');
		var noiseGenBackInstance1 = new fabric.Image(noiseGenBackElement1, {
		  id: 'noise_gen_back1',
		  name: 'noise_gen_back1',
		  type: 'noise_gen_back',
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenBackInstance1);
		
		var noise_gen1 = document.getElementById('pink_noise_enabled1').value;
		var noise_gen1_left = 34;
		if(noise_gen1=="1"){
		   noise_gen1_left = 59;
		 }
					
		// add noise_gen_button1
		var noiseGenButtonElement1 = document.getElementById('noise_gen_button1');
		var noiseGenButtonInstance1 = new fabric.Image(noiseGenButtonElement1, {
		  id: 'noise_gen_button1',
		  name: 'noise_gen_button1',
		  type: 'noise_gen_button',
		  channel: 1,
		  left: noise_gen1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenButtonInstance1);
		
		// set noise_gen_touch1
		var noiseGenTouchElement1 = document.getElementById('noise_gen_touch1');
		var noiseGenTouchInstance1 = new fabric.Image(noiseGenTouchElement1, {
		  id: 'noise_gen_touch1',
		  name: 'noise_gen_touch1',
		  type: 'noise_gen_touch',
		  parameter: 'noise_gen_touch',
		  channel: 1,
		  left: 30,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noiseGenTouchInstance1);
		
		// set channel1 pink_noise_text
		var pink_noise_text1 = new fabric.Textbox(String('Pink Noise'), {
			id: 'pink_noise_text1',
			name: 'pink_noise_text1',
			left: 12,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(pink_noise_text1);
		
		// set channel1 noise_gen_on_off_text
		var noise_gen_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'noise_gen_on_off_text1',
			name: 'noise_gen_on_off_text1',
			left: 34,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(noise_gen_on_off_text1);
		
		// set channel1 invert_background
		var invertBackElement1 = document.getElementById('invert_background1');
		var invertBackInstance1 = new fabric.Image(invertBackElement1, {
		  id: 'invert_back1',
		  name: 'invert_back1',
		  type: 'invert_back',
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertBackInstance1);
		
		var invert1 = document.getElementById('Phase_invert1').value;
		var invert1_left = 124;
		if(invert1=="1"){
		   invert1_left = 149;
		 }
					
		// add invert_button1
		var invertButtonElement1 = document.getElementById('invert_button1');
		var invertButtonInstance1 = new fabric.Image(invertButtonElement1, {
		  id: 'invert_button1',
		  name: 'invert_button1',
		  type: 'invert_button',
		  channel: 1,
		  left: invert1_left,
		  top: 674,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invertButtonInstance1);
		
		// set mode_touch1_element
		var invert_touchElement1 = document.getElementById('invert_touch1');
		var invert_touchInstance1 = new fabric.Image(invert_touchElement1, {
		  id: 'invert_touch1',
		  name: 'invert_touch1',
		  type: 'invert_touch',
		  parameter: 'invert_touch',
		  channel: 1,
		  left: 120,
		  top: 670,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(invert_touchInstance1);
		
		// set channel1 invert_text
		var invert_text1 = new fabric.Textbox(String('Phase Invert'), {
			id: 'invert_text1',
			name: 'invert_text1',
			left: 102,
			top: 650,
			width: 100,
			fontSize: 14,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(invert_text1);
		
		// set channel1 invert_on_off_text
		var invert_on_off_text1 = new fabric.Textbox(String('OFF   ON'), {
			id: 'invert_on_off_text1',
			name: 'invert_on_off_text1',
			left: 124,
			top: 706,
			width: 100,
			fontSize: 12,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(invert_on_off_text1);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
			
		if(IsDualChannel==1){
			// channel 2
			// set channel2 background
			var ampchannel2Element = document.getElementById('mixer_channel_3_levels_'+color2);
			var ampchannel2Instance = new fabric.Image(ampchannel2Element, {
			  id: 'amp_channel2',
			  name: 'amp_channel2',
			  type: 'amp_channel2',
			  left: 210,
			  top: 0,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(ampchannel2Instance);
			
			// set channel2 text
			var channel2_text = new fabric.Textbox(String(label2), {
				id: 'channel2_text',
				name: 'channel2_text',
				left: 210,
				top: 734,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(channel2_text);

			// set input2 text
			var input2_text = new fabric.Textbox(String('Channel B'), {
				id: 'input2_text',
				name: 'input2_text',
				left: 210,
				top: 764,
				width: 210,
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(input2_text);
			
			// set channel2 noise_gen_background
            var noiseGenBackElement2 = document.getElementById('noise_gen_background2');
            var noiseGenBackInstance2= new fabric.Image(noiseGenBackElement2, {
              id: 'noise_gen_back2',
              name: 'noise_gen_back2',
              type: 'noise_gen_back',
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenBackInstance2);

            var noise_gen2 = document.getElementById('pink_noise_enabled2').value;
            var noise_gen2_left = 244;
            if(noise_gen2=="1"){
               noise_gen2_left = 269;
             }

            // add noise_gen_button2
            var noiseGenButtonElement2 = document.getElementById('noise_gen_button2');
            var noiseGenButtonInstance2 = new fabric.Image(noiseGenButtonElement2, {
              id: 'noise_gen_button2',
              name: 'noise_gen_button2',
              type: 'noise_gen_button',
              channel: 2,
              left: noise_gen2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenButtonInstance2);

            // set noise_gen_touch2
            var noiseGenTouchElement2 = document.getElementById('noise_gen_touch2');
            var noiseGenTouchInstance2 = new fabric.Image(noiseGenTouchElement2, {
              id: 'noise_gen_touch2',
              name: 'noise_gen_touch2',
              type: 'noise_gen_touch',
              parameter: 'noise_gen_touch',
              channel: 2,
              left: 240,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(noiseGenTouchInstance2);

            // set channel2 pink_noise_text
            var pink_noise_text2 = new fabric.Textbox(String('Pink Noise'), {
                id: 'pink_noise_text2',
                name: 'pink_noise_text2',
                left: 222,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(pink_noise_text2);

            // set channel2 noise_gen_on_off_text
            var noise_gen_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'noise_gen_on_off_text2',
                name: 'noise_gen_on_off_text2',
                left: 244,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(noise_gen_on_off_text2);

            // set channel2 invert_background
            var invertBackElement2 = document.getElementById('invert_background2');
            var invertBackInstance2 = new fabric.Image(invertBackElement2, {
              id: 'invert_back2',
              name: 'invert_back2',
              type: 'invert_back',
              left: 330,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertBackInstance2);

            var invert2 = document.getElementById('Phase_invert2').value;
            var invert2_left = 334;
            if(invert2=="1"){
               invert2_left = 359;
             }

            // add invert_button2
            var invertButtonElement2 = document.getElementById('invert_button2');
            var invertButtonInstance2 = new fabric.Image(invertButtonElement2, {
              id: 'invert_button2',
              name: 'invert_button2',
              type: 'invert_button',
              channel: 2,
              left: invert2_left,
              top: 674,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invertButtonInstance2);

            // set mode_touch2_element
            var invert_touchElement2 = document.getElementById('invert_touch2');
            var invert_touchInstance2 = new fabric.Image(invert_touchElement2, {
              id: 'invert_touch2',
              name: 'invert_touch2',
              type: 'invert_touch',
              parameter: 'invert_touch',
              channel: 2,
              left: 340,
              top: 670,
              angle: 0,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
            });
            canvas.add(invert_touchInstance2);

            // set channel2 invert_text
            var invert_text2 = new fabric.Textbox(String('Phase Invert'), {
                id: 'invert_text2',
                name: 'invert_text2',
                left: 312,
                top: 650,
                width: 100,
                fontSize: 14,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(invert_text2);

            // set channel2 invert_on_off_text
            var invert_on_off_text2 = new fabric.Textbox(String('OFF   ON'), {
                id: 'invert_on_off_text2',
                name: 'invert_on_off_text2',
                left: 334,
                top: 706,
                width: 100,
                fontSize: 12,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(invert_on_off_text2);

			var mute2 = document.getElementById('mute2');
			var mute2_off_opacity;
			var mute2_on_opacity;
			if(mute2.value==1){
				mute2_off_opacity=0.0;
				mute2_on_opacity=1.0;
			} else {
				mute2_off_opacity=1.0;
				mute2_on_opacity=0.0;
			}
			// set mute_bar_button2_off
			var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
			var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
			  id: 'mute_bar_button2_off',
			  name: 'mute_bar_button2_off',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2offInstance);

			// set mute_bar_button2_on
			var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
			var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
			  id: 'mute_bar_button2_on',
			  name: 'mute_bar_button2_on',
			  type: 'mute_bar_button',
			  channel: 2,
			  left: 220,
			  top: 17,
			  angle: 0,
			  opacity: mute2_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(mutebutton2onInstance);

			var slider2 = document.getElementById('slider2');
			var top2 = get_top_from_volume(slider2.value);

			// set level fader2
			var levelfader2Element = document.getElementById('level_fader2');
			var levelfader2Instance = new fabric.Image(levelfader2Element, {
			  id: 'level_fader2',
			  name: 'level_fader2',
			  type: 'level_fader',
			  channel: 2,
			  left: 320,
			  top: top2,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(levelfader2Instance);

			// add dropdown_button2
			var dropdown_button2Element = document.getElementById('dropdown_button2');
			var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
			  id: 'dropdown_button2',
			  name: 'dropdown_button2',
			  type: 'dropdown_button',
			  channel: 2,
			  left: 370,
			  top: 17,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(dropdown_button2Instance);
		}
			
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_rms_limiting();
		start_peak_limiting();
		start_compressor_levels();
		start_input_levels();
		start_temperature_status();
		start_standby_mute_status();
		get_preset_list();
		
		var redirect_from_presets_upload = document.getElementById('redirect_from_presets_upload').value;
		if(redirect_from_presets_upload!=''){
		   	get_presets_view();
			document.getElementById('redirect_from_presets_upload').value = '';
			
			// update modal body
			document.getElementById('upload_preset_response_text').innerHTML = redirect_from_presets_upload;
			
			// show modal
			$('#preset_upload_status_modal').modal('show');
		}
	}
	
	function get_dsp_view9(){
		
		var label1 = '';
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(210); // 1 channel
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_2_levels_grey_no_sig_no_clip');
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input 1'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		start_levels();
		start_input_levels();
	}
	
	function get_dsp_view10(){
		
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		var label3 = document.getElementById('label3').value;
		var label4 = document.getElementById('label4').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
		var color3 = document.getElementById('color3').value;
		var color4 = document.getElementById('color4').value;
		
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(840);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// set channel1 background
		var channel1Element = document.getElementById('mixer_channel_1_levels_'+color1);
		var channel1Instance = new fabric.Image(channel1Element, {
		  id: 'channel1_background',
		  name: 'channel1_background',
		  type: 'channel1_background',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel1Instance);
		
		// set channel1 mode block
		var mixermode1Element = document.getElementById('mixer_mode_block3');
		var mixermode1Instance = new fabric.Image(mixermode1Element, {
		  id: 'mixer_mode1',
		  name: 'mixer_mode1',
		  type: 'mixer_mode1',
		  left: 30,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Input 1'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// set channel2 background
		var channel2Element = document.getElementById('mixer_channel_1_levels_'+color2);
		var channel2Instance = new fabric.Image(channel2Element, {
		  id: 'channel2_background',
		  name: 'channel2_background',
		  type: 'channel2_background',
		  left: 210,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel2Instance);
		
		// set channel2 mode block
		var mixermode2Element = document.getElementById('mixer_mode_block3');
		var mixermode2Instance = new fabric.Image(mixermode2Element, {
		  id: 'mixer_mode2',
		  name: 'mixer_mode2',
		  type: 'mixer_mode2',
		  left: 240,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode2Instance);
		
		// set channel2 text
		var channel2_text = new fabric.Textbox(String(label2), {
			id: 'channel2_text',
			name: 'channel2_text',
			left: 210,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel2_text);
		
		// set input2 text
		var input2_text = new fabric.Textbox(String('Input 2'), {
			id: 'input2_text',
			name: 'input2_text',
			left: 210,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input2_text);
		
		var mute2 = document.getElementById('mute2');
        var mute2_off_opacity;
        var mute2_on_opacity;
        if(mute2.value==1){
            mute2_off_opacity=0.0;
            mute2_on_opacity=1.0;
        } else {
            mute2_off_opacity=1.0;
            mute2_on_opacity=0.0;
        }
        // set mute_bar_button2_off
        var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
        var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
          id: 'mute_bar_button2_off',
          name: 'mute_bar_button2_off',
          type: 'mute_bar_button',
          channel: 2,
          left: 220,
          top: 17,
          angle: 0,
          opacity: mute2_off_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton2offInstance);

        // set mute_bar_button2_on
        var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
        var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
          id: 'mute_bar_button2_on',
          name: 'mute_bar_button2_on',
          type: 'mute_bar_button',
          channel: 2,
          left: 220,
          top: 17,
          angle: 0,
          opacity: mute2_on_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton2onInstance);
		
		var slider2 = document.getElementById('slider2');
		var top2 = get_top_from_volume(slider2.value);
		
		// set level fader2
		var levelfader2Element = document.getElementById('level_fader2');
		var levelfader2Instance = new fabric.Image(levelfader2Element, {
		  id: 'level_fader2',
		  name: 'level_fader2',
		  type: 'level_fader',
		  channel: 2,
		  left: 320,
		  top: top2,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader2Instance);
		
		// add dropdown_button2
		var dropdown_button2Element = document.getElementById('dropdown_button2');
		var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
		  id: 'dropdown_button2',
		  name: 'dropdown_button2',
		  type: 'dropdown_button',
		  channel: 2,
		  left: 370,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button2Instance);
		
		// set channel3 background
		var channel3Element = document.getElementById('mixer_channel_1_levels_'+color3);
		var channel3Instance = new fabric.Image(channel3Element, {
		  id: 'channel3_background',
		  name: 'channel3_background',
		  type: 'channel3_background',
		  left: 420,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel3Instance);
		
		// set channel3 text
		var channel3_text = new fabric.Textbox(String(label3), {
			id: 'channel3_text',
			name: 'channel3_text',
			left: 420,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel3_text);
		
		// set output1_text
		var output1_text = new fabric.Textbox(String('Output 1'), {
			id: 'output1_text',
			name: 'output1_text',
			left: 420,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output1_text);
		
		var mute3 = document.getElementById('mute3');
		var mute3_off_opacity;
		var mute3_on_opacity;
		if(mute3.value==1){
			mute3_off_opacity=0.0;
			mute3_on_opacity=1.0;
		} else {
			mute3_off_opacity=1.0;
			mute3_on_opacity=0.0;
		}
		// set mute_bar_button3_off
		var mutebutton3offElement = document.getElementById('mute_bar_button3_off');
		var mutebutton3offInstance = new fabric.Image(mutebutton3offElement, {
		  id: 'mute_bar_button3_off',
		  name: 'mute_bar_button3_off',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3offInstance);

		// set mute_bar_button3_on
		var mutebutton3onElement = document.getElementById('mute_bar_button3_on');
		var mutebutton3onInstance = new fabric.Image(mutebutton3onElement, {
		  id: 'mute_bar_button3_on',
		  name: 'mute_bar_button3_on',
		  type: 'mute_bar_button',
		  channel: 3,
		  left: 430,
		  top: 17,
		  angle: 0,
		  opacity: mute3_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton3onInstance);
		
		var slider3 = document.getElementById('slider3');
		var top3 = get_top_from_volume(slider3.value);
		
		// set level fader3
		var levelfader3Element = document.getElementById('level_fader3');
		var levelfader3Instance = new fabric.Image(levelfader3Element, {
		  id: 'level_fader3',
		  name: 'level_fader3',
		  type: 'level_fader',
		  channel: 3,
		  left: 530,
		  top: top3,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader3Instance);
		
		// add dropdown_button3
		var dropdown_button3Element = document.getElementById('dropdown_button3');
		var dropdown_button3Instance = new fabric.Image(dropdown_button3Element, {
		  id: 'dropdown_button3',
		  name: 'dropdown_button3',
		  type: 'dropdown_button',
		  channel: 3,
		  left: 580,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button3Instance);
		
		// set channel4 background
		var channel4Element = document.getElementById('mixer_channel_1_levels_'+color4);
		var channel4Instance = new fabric.Image(channel4Element, {
		  id: 'channel4_background',
		  name: 'channel4_background',
		  type: 'channel4_background',
		  left: 630,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel4Instance);
		
		// set channel4 text
		var channel4_text = new fabric.Textbox(String(label4), {
			id: 'channel4_text',
			name: 'channel4_text',
			left: 630,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel4_text);
		
		// set output2_text
		var output2_text = new fabric.Textbox(String('Output 2'), {
			id: 'output2_text',
			name: 'output2_text',
			left: 630,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(output2_text);
		
		var mute4 = document.getElementById('mute4');
		var mute4_off_opacity;
        var mute4_on_opacity;
        if(mute4.value==1){
            mute4_off_opacity=0.0;
            mute4_on_opacity=1.0;
        } else {
            mute4_off_opacity=1.0;
            mute4_on_opacity=0.0;
        }
        // set mute_bar_button4_off
        var mutebutton4offElement = document.getElementById('mute_bar_button4_off');
        var mutebutton4offInstance = new fabric.Image(mutebutton4offElement, {
          id: 'mute_bar_button4_off',
          name: 'mute_bar_button4_off',
          type: 'mute_bar_button',
          channel: 4,
          left: 640,
          top: 17,
          angle: 0,
          opacity: mute4_off_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton4offInstance);

        // set mute_bar_button4_on
        var mutebutton4onElement = document.getElementById('mute_bar_button4_on');
        var mutebutton4onInstance = new fabric.Image(mutebutton4onElement, {
          id: 'mute_bar_button4_on',
          name: 'mute_bar_button4_on',
          type: 'mute_bar_button',
          channel: 4,
          left: 640,
          top: 17,
          angle: 0,
          opacity: mute4_on_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton4onInstance);
		
		var slider4 = document.getElementById('slider4');
		var top4 = get_top_from_volume(slider4.value);
		
		// set level fader4
		var levelfader4Element = document.getElementById('level_fader4');
		var levelfader4Instance = new fabric.Image(levelfader4Element, {
		  id: 'level_fader4',
		  name: 'level_fader4',
		  type: 'level_fader',
		  channel: 4,
		  left: 740,
		  top: top4,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader4Instance);
		
		// add dropdown_button4
		var dropdown_button4Element = document.getElementById('dropdown_button4');
		var dropdown_button4Instance = new fabric.Image(dropdown_button4Element, {
		  id: 'dropdown_button4',
		  name: 'dropdown_button4',
		  type: 'dropdown_button',
		  channel: 4,
		  left: 790,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button4Instance);
		
		for(var x=0;x<main_data_array3.length;x++){
			
			var type = main_data_array3[x]['type'];
			if(type=='knob'){
				
				var name = main_data_array3[x]['name'];
				var parameter = main_data_array3[x]['parameter'];
				var channel = main_data_array3[x]['channel'];
				var indicator_left = main_data_array3[x]['indicator_left'];
				var indicator_top = main_data_array3[x]['indicator_top'];
				var text_left = main_data_array3[x]['text_left'];
				var text_top = main_data_array3[x]['text_top'];
				
				var input = document.getElementById(name).value;
				var angle = -150+(input*10.714); // Min: 0 Max: 28

				// set gain_indicator_element
				var gain_indicator_element = document.getElementById('indicator_'+name);
				var gain_indicator_instance = new fabric.Image(gain_indicator_element, { 
				  id: 'indicator_'+name,
				  name: 'indicator_'+name,
				  name2: name,
				  type: 'mic_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(gain_indicator_instance);

				// set gain_touch_element
				var gain_touch_element = document.getElementById('touch_'+name);
				var gain_touch_instance = new fabric.Image(gain_touch_element, {
				  id: 'touch_'+name,
				  name: 'touch_'+name,
				  type: 'mic_touch',
				  parameter: parameter,
				  name2: name,
				  channel: channel,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(gain_touch_instance);

				// set input text
				var text = input;
				
				var gain_text = new fabric.Textbox(String(text), {
					id: name +'_text',
					name: name+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(gain_text);
			}
		}
		start_levels();
		start_signals();
		start_input_levels();
		start_limiting();
	}
	
	function get_dsp_view11(){
		
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
			
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(420);
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// set channel1 background
		var channel1Element = document.getElementById('mixer_channel_2_levels_'+color1);
		var channel1Instance = new fabric.Image(channel1Element, {
		  id: 'channel1_background',
		  name: 'channel1_background',
		  type: 'channel1_background',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel1Instance);
		
		// set channel1 mode block
		var mixermode1Element = document.getElementById('mixer_mode_block3');
		var mixermode1Instance = new fabric.Image(mixermode1Element, {
		  id: 'mixer_mode1',
		  name: 'mixer_mode1',
		  type: 'mixer_mode1',
		  left: 30,
		  top: 542,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mixermode1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Line Input'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var mute = document.getElementById('mute1');
		var mute1_off_opacity;
		var mute1_on_opacity;
		if(mute.value==1){
		  	mute1_off_opacity=0.0;
			mute1_on_opacity=1.0;
		} else {
			mute1_off_opacity=1.0;
			mute1_on_opacity=0.0;
		}
		// set mute_bar_button1_off
		var mutebutton1offElement = document.getElementById('mute_bar_button1_off');
		var mutebutton1offInstance = new fabric.Image(mutebutton1offElement, {
		  id: 'mute_bar_button1_off',
		  name: 'mute_bar_button1_off',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1offInstance);
		
		// set mute_bar_button1_on
		var mutebutton1onElement = document.getElementById('mute_bar_button1_on');
		var mutebutton1onInstance = new fabric.Image(mutebutton1onElement, {
		  id: 'mute_bar_button1_on',
		  name: 'mute_bar_button1_on',
		  type: 'mute_bar_button',
		  channel: 1,
		  left: 10,
		  top: 17,
		  angle: 0,
		  opacity: mute1_on_opacity,
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebutton1onInstance);
		
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// set channel2 background
		var channel2Element = document.getElementById('mixer_channel_3_levels_'+color2);
		var channel2Instance = new fabric.Image(channel2Element, {
		  id: 'channel2_background',
		  name: 'channel2_background',
		  type: 'channel2_background',
		  left: 210,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel2Instance);
			
		// set channel2 text
		var channel2_text = new fabric.Textbox(String(label2), {
			id: 'channel2_text',
			name: 'channel2_text',
			left: 210,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel2_text);
		
		// set input2 text
		var input2_text = new fabric.Textbox(String('Line & AMP Output'), {
			id: 'input2_text',
			name: 'input2_text',
			left: 210,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input2_text);
		
		var mute2 = document.getElementById('mute2');
        var mute2_off_opacity;
        var mute2_on_opacity;
        if(mute2.value==1){
            mute2_off_opacity=0.0;
            mute2_on_opacity=1.0;
        } else {
            mute2_off_opacity=1.0;
            mute2_on_opacity=0.0;
        }
        // set mute_bar_button2_off
        var mutebutton2offElement = document.getElementById('mute_bar_button2_off');
        var mutebutton2offInstance = new fabric.Image(mutebutton2offElement, {
          id: 'mute_bar_button2_off',
          name: 'mute_bar_button2_off',
          type: 'mute_bar_button',
          channel: 2,
          left: 220,
          top: 17,
          angle: 0,
          opacity: mute2_off_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton2offInstance);

        // set mute_bar_button2_on
        var mutebutton2onElement = document.getElementById('mute_bar_button2_on');
        var mutebutton2onInstance = new fabric.Image(mutebutton2onElement, {
          id: 'mute_bar_button2_on',
          name: 'mute_bar_button2_on',
          type: 'mute_bar_button',
          channel: 2,
          left: 220,
          top: 17,
          angle: 0,
          opacity: mute2_on_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(mutebutton2onInstance);
		
		var slider2 = document.getElementById('slider2');
		var top2 = get_top_from_volume(slider2.value);
		
		// set level fader2
		var levelfader2Element = document.getElementById('level_fader2');
		var levelfader2Instance = new fabric.Image(levelfader2Element, {
		  id: 'level_fader2',
		  name: 'level_fader2',
		  type: 'level_fader',
		  channel: 2,
		  left: 320,
		  top: top2,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader2Instance);
		
		// add dropdown_button2
		var dropdown_button2Element = document.getElementById('dropdown_button2');
		var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
		  id: 'dropdown_button2',
		  name: 'dropdown_button2',
		  type: 'dropdown_button',
		  channel: 2,
		  left: 370,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button2Instance);
		
		// set channel3 background
		var channel3Element = document.getElementById('mixer_channel_1_levels_'+color3);
		var channel3Instance = new fabric.Image(channel3Element, {
		  id: 'channel3_background',
		  name: 'channel3_background',
		  type: 'channel3_background',
		  left: 420,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(channel3Instance);
		
		
		for(var x=0;x<main_data_array4.length;x++){
			
			var type = main_data_array4[x]['type'];
			if(type=='knob'){
				
				var name = main_data_array4[x]['name'];
				var parameter = main_data_array4[x]['parameter'];
				var channel = main_data_array4[x]['channel'];
				var indicator_left = main_data_array4[x]['indicator_left'];
				var indicator_top = main_data_array4[x]['indicator_top'];
				var text_left = main_data_array4[x]['text_left'];
				var text_top = main_data_array4[x]['text_top'];
				
				var input = document.getElementById(name).value;
				var angle = -150+(input*10.714); // Min: 0 Max: 28

				// set gain_indicator_element
				var gain_indicator_element = document.getElementById('indicator_'+name);
				var gain_indicator_instance = new fabric.Image(gain_indicator_element, { 
				  id: 'indicator_'+name,
				  name: 'indicator_'+name,
				  name2: name,
				  type: 'mic_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(gain_indicator_instance);

				// set gain_touch_element
				var gain_touch_element = document.getElementById('touch_'+name);
				var gain_touch_instance = new fabric.Image(gain_touch_element, {
				  id: 'touch_'+name,
				  name: 'touch_'+name,
				  type: 'mic_touch',
				  parameter: parameter,
				  name2: name,
				  channel: channel,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(gain_touch_instance);

				// set input text
				var text = input;
				
				var gain_text = new fabric.Textbox(String(text), {
					id: name +'_text',
					name: name+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(gain_text);
			}
		}
		start_levels();
		start_signals();
		start_clips();
		start_limiting();
		start_compressor_levels();
		start_input_levels();
	}
	
	function get_dsp_view12(){
		
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		var color1 = document.getElementById('color1').value;
		var color2 = document.getElementById('color2').value;
	
		document.getElementById('router_view').value = 'main';
		
		canvas.clear();
		
		canvas.setHeight(791);
		canvas.setWidth(420); // 2 channel
		
		// set Zoom level
		canvas.setZoom(0.8);
		
		// set channel1 background
		var ampchannel1Element = document.getElementById('mixer_channel_2_levels_'+color1+'_no_sig_no_clip');
		var ampchannel1Instance = new fabric.Image(ampchannel1Element, {
		  id: 'amp_channel1',
		  name: 'amp_channel1',
		  type: 'amp_channel1',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel1Instance);
		
		// set channel1 text
		var channel1_text = new fabric.Textbox(String(label1), {
			id: 'channel1_text',
			name: 'channel1_text',
			left: 0,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel1_text);
		
		// set input1 text
		var input1_text = new fabric.Textbox(String('Mic Input'), {
			id: 'input1_text',
			name: 'input1_text',
			left: 0,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input1_text);
		
		var slider1 = document.getElementById('slider1');
		var top1 = get_top_from_volume(slider1.value);
		
		// set level fader1
		var levelfader1Element = document.getElementById('level_fader1');
		var levelfader1Instance = new fabric.Image(levelfader1Element, {
		  id: 'level_fader1',
		  name: 'level_fader1',
		  type: 'level_fader',
		  channel: 1,
		  left: 110,
		  top: top1,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader1Instance);
		
		// add dropdown_button1
		var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_button1',
		  name: 'dropdown_button1',
		  type: 'dropdown_button',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
		
		// set channel2 background
		var ampchannel2Element = document.getElementById('mixer_channel_2_levels_'+color2+'_no_sig_no_clip');
		var ampchannel2Instance = new fabric.Image(ampchannel2Element, {
		  id: 'amp_channel2',
		  name: 'amp_channel2',
		  type: 'amp_channel2',
		  left: 210,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ampchannel2Instance);
		
		// set channel2 text
		var channel2_text = new fabric.Textbox(String(label2), {
			id: 'channel2_text',
			name: 'channel2_text',
			left: 210,
			top: 734,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(channel2_text);
		
		// set input2 text
		var input2_text = new fabric.Textbox(String('Line & AMP Output'), {
			id: 'input2_text',
			name: 'input2_text',
			left: 210,
			top: 764,
			width: 210,
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(input2_text);
		
		var slider2 = document.getElementById('slider2');
		var top2 = get_top_from_volume(slider2.value);
			
		// set level fader2
		var levelfader2Element = document.getElementById('level_fader2');
		var levelfader2Instance = new fabric.Image(levelfader2Element, {
		  id: 'level_fader2',
		  name: 'level_fader2',
		  type: 'level_fader',
		  channel: 2,
		  left: 320,
		  top: top2,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(levelfader2Instance);
		
		// add dropdown_button2
		var dropdown_button2Element = document.getElementById('dropdown_button2');
		var dropdown_button2Instance = new fabric.Image(dropdown_button2Element, {
		  id: 'dropdown_button2',
		  name: 'dropdown_button2',
		  type: 'dropdown_button',
		  channel: 2,
		  left: 370,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button2Instance);
		
		start_levels();
		start_input_levels();
	}

	function get_router_view(){
		
		var json_type = document.getElementById('json_type').value
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
		   get_router_view1();
		}
		if(json_type=='ampg1_2c'){
		   get_router_view2();
		}
		if(json_type=='ampg1_4c'){
		   get_router_view3();
		}
		if(json_type=='ampg2_2c'){
		   get_router_view5();
		}
		if(json_type=='ampg2_4c'){
		   get_router_view4();
		}
	}
	
	function get_router_view1(){
		var json_type = document.getElementById('json_type').value
		document.getElementById('router_view').value = 'router';
		
		var label1 = document.getElementById('label1').value;
		var label2 = document.getElementById('label2').value;
		var label3 = document.getElementById('label3').value;
		var label4 = document.getElementById('label4').value;
		var label5 = document.getElementById('label5').value;
		var label6 = document.getElementById('label6').value;
		var label7 = document.getElementById('label7').value;
		var label8 = document.getElementById('label8').value;
		
		canvas.clear();
		
		canvas.setHeight(719);
		canvas.setWidth(1202);
		
		var router_bar = 'router_bar';
		
		if(json_type=='nqpaxxx'){
		   	canvas.setHeight(719);
			canvas.setWidth(1402);
			router_bar = 'router_bar_nqpaxxx';
		}
		
		// set Zoom level
		canvas.setZoom(0.7);
			
		// set bar background
		var routerbarElement = document.getElementById(router_bar);
		var routerbarInstance = new fabric.Image(routerbarElement, {
		  id: 'router_bar',
		  name: 'router_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(routerbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Router'), {
			id: 'router_header_text',
			name: 'router_header_text',
			left: 18,
			top: 11,
			width: 300,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		var close_left = 1150;
		if(json_type=='nqpaxxx'){
		   close_left = 1350;
		}
		
		// add close_button
		var router_close_buttonElement = document.getElementById('router_close_button');
		var router_close_buttonInstance = new fabric.Image(router_close_buttonElement, {
		  id: 'router_close_button',
		  name: 'router_close_button',
		  left: close_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_close_buttonInstance);
		
		var reset_left = 1090;
		if(json_type=='nqpaxxx'){
		   reset_left = 1290;
		}
		
		// add reset_button
		var router_reset_buttonElement = document.getElementById('router_reset_button');
		var router_reset_buttonInstance = new fabric.Image(router_reset_buttonElement, {
		  id: 'router_reset_button',
		  name: 'router_reset_button',
		  type: 'router_reset_button',
		  left: reset_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_reset_buttonInstance);
		
		var data_array = [];;
		
		if(json_type=='Mixer'){
		   data_array = router_data_array;
		}
		
		if(json_type=='nqpaxxx'){
		   data_array = router_data_array6;
		}
		
		for(var x=0;x<data_array.length;x++){
			
			var name = data_array[x]['name'];
			var parameter = data_array[x]['parameter'];
			var indicator_left = data_array[x]['indicator_left'];
			var indicator_top = data_array[x]['indicator_top'];
			var text_left = data_array[x]['text_left'];
			var text_top = data_array[x]['text_top'];
			var button_left = data_array[x]['button_left'];
			var button_top = data_array[x]['button_top'];
			
			var input = document.getElementById('router_'+name).value;
			var angle = (input*10);

			// set router_indicator_element
			var router_indicator_element = document.getElementById('router_indicator_'+name);
			var router_indicator_instance = new fabric.Image(router_indicator_element, { 
			  id: 'router_indicator_'+name,
			  name: 'router_indicator_'+name,
			  name2: name,
			  type: 'router_indicator',
			  left: indicator_left,
			  top: indicator_top,
			  angle: angle,
			  opacity: 1.0,	
			  selectable: false,
			  hasControls: false,
			  originX: 'center',
			  originY: 'center',
			  centeredRotation: true,
			});
			canvas.add(router_indicator_instance);

			// set router_touch_element
			var router_touch_element = document.getElementById('router_touch_'+name);
			var router_touch_instance = new fabric.Image(router_touch_element, {
			  id: 'router_touch_'+name,
			  name: 'router_touch_'+name,
			  name2: name,
			  type: 'router_touch_input',
			  parameter: parameter,
			  left: indicator_left,
			  top: indicator_top,
			  angle: 0,
			  opacity: 1.0,	
			  selectable: true,
			  hasControls: false,
			  originX: 'center',
			  originY: 'center',
			  centeredRotation: true,
			  borderColor: 'rgba(0,0,0,0.0)',
			  cornerColor: 'rgba(0,0,0,0.0)',
			});
			canvas.add(router_touch_instance);

			// set input text
			var text = input;
			if(input=='-144'){
			   text=0;
			}
			var router_text = new fabric.Textbox(String(text), {
				id: 'router_'+ name +'_text',
				name: 'router_'+name+'_text',
				parameter: parameter,
				left: text_left,
				top: text_top,
				width: 20,
				fontSize: 15,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(router_text);
			
			var bnt = parameter;
			if(parameter=='IG1'){
				bnt= label1;
			} 
			if(parameter=='IG2'){
			   bnt = label2;
			 }
			if(parameter=='IG3'){
			   bnt = label3;
			 }
			if(parameter=='IG4'){
			   bnt = label4;
			 }
			if(parameter=='IG5'){
			   bnt = 'Network 1';
			 }
			if(parameter=='OG1'){
			   bnt = 'Network 1';
			 }
			if(parameter=='OG2'){
			   bnt = 'Network 2';
			 }
			if(parameter=='OG3'){
			   bnt = 'Network 3';
			 }
			if(parameter=='OG4'){
			   bnt = 'Network 4';
			 }
			if(parameter=='OG5'){
			   bnt = label5;
			 }
			if(parameter=='OG6'){
			   bnt = label6;
			 }
			
			if(json_type=='nqpaxxx'){
			   if(parameter=='OG5'){
				   bnt = label7;
			   }
				if(parameter=='OG6'){
			   		bnt = label8;
			   }
			}
			
			if(parameter=='CG11'){
				bnt=initial_letters(label1) + '\u2192N1';
			}
			if(parameter=='CG12'){
				bnt=initial_letters(label1) + '\u2192N2';
			}
			if(parameter=='CG13'){
				bnt=initial_letters(label1) + '\u2192N3';
			}
			if(parameter=='CG14'){
				bnt=initial_letters(label1) + '\u2192N4';
			}
			if(parameter=='CG15'){
				bnt=initial_letters(label1) + '\u2192' + initial_letters(label5);
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label1) + '\u2192' + initial_letters(label7);
				}
			}
			if(parameter=='CG16'){
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label1) + '\u2192' + initial_letters(label8);
				}
			}
			if(parameter=='CG21'){
				bnt=initial_letters(label2) + '\u2192N1';
			}
			if(parameter=='CG22'){
				bnt=initial_letters(label2) + '\u2192N2';
			}
			if(parameter=='CG23'){
				bnt=initial_letters(label2) + '\u2192N3';
			}
			if(parameter=='CG24'){
				bnt=initial_letters(label2) + '\u2192N4';
			}
			if(parameter=='CG25'){
				bnt=initial_letters(label2) + '\u2192' + initial_letters(label5);
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label2) + '\u2192' + initial_letters(label7);
				}
			}
			if(parameter=='CG26'){
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label2) + '\u2192' + initial_letters(label8);
				}
			}
			if(parameter=='CG31'){
				bnt=initial_letters(label3) + '\u2192N1';
			}
			if(parameter=='CG32'){
				bnt=initial_letters(label3) + '\u2192N2';
			}
			if(parameter=='CG33'){
				bnt=initial_letters(label3) + '\u2192N3';
			}
			if(parameter=='CG34'){
				bnt=initial_letters(label3) + '\u2192N4';
			}
			if(parameter=='CG35'){
				bnt=initial_letters(label3) + '\u2192' + initial_letters(label5);
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label3) + '\u2192' + initial_letters(label7);
				}
			}
			if(parameter=='CG36'){
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label3) + '\u2192' + initial_letters(label8);
				}
			}
			if(parameter=='CG41'){
				bnt=initial_letters(label4) + '\u2192N1';
			}
			if(parameter=='CG42'){
				bnt=initial_letters(label4) + '\u2192N2';
			}
			if(parameter=='CG43'){
				bnt=initial_letters(label4) + '\u2192N3';
			}
			if(parameter=='CG44'){
				bnt=initial_letters(label4) + '\u2192N4';
			}
			if(parameter=='CG45'){
				bnt=initial_letters(label4) + '\u2192' + initial_letters(label5);
				if(json_type=='nqpaxxx'){
				   bnt=initial_letters(label4) + '\u2192' + initial_letters(label7);
				}
			}
			if(parameter=='CG46'){
				if(json_type=='nqpaxxx'){
				  bnt=initial_letters(label4) + '\u2192' + initial_letters(label8);
				}
			}
			if(parameter=='CG51'){
				bnt='N1\u2192N1';
			}
			if(parameter=='CG52'){
				bnt='N1\u2192N2';
			}
			if(parameter=='CG53'){
				bnt='N1\u2192N3';
			}
			if(parameter=='CG54'){
				bnt='N1\u2192N4';
			}
			if(parameter=='CG55'){
				bnt='N1\u2192' + initial_letters(label5);
			}
			
			var block_name_text = new fabric.Textbox(String(bnt), {
				id: 'block_name'+ name +'_text',
				name: 'block_name'+name+'_text',
				parameter: parameter,
				left: text_left-63,
				top: text_top+85,
				width: 150,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(255,255,255,1.0)',
				textAlign: 'center',
				editable: false,
			});
			canvas.add(block_name_text);
			
			var router_enabled = document.getElementById('router_enable_'+name).value;
			var input_off_opacity;
			var input_on_opacity;
			if(router_enabled==0){
				input_off_opacity=1.0;
				input_on_opacity=0.0;
			 } else {
				 input_off_opacity=0.0;
				 input_on_opacity=1.0;
			 }
			
			// set enabled_off
			var enabledbuttonoffElement = document.getElementById('enabled_'+name+'_off');
			var enabledbuttonoffInstance = new fabric.Image(enabledbuttonoffElement, {
			  id: 'enabled_'+name+'_off',
			  name: 'enabled_'+name+'_off',
			  name2: name,
			  parameter: parameter,
			  type: 'enabled_button',
			  left: button_left,
			  top: button_top,
			  angle: 0,
			  opacity: input_off_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(enabledbuttonoffInstance);

			// set enabled_on
			var enabledbuttononElement = document.getElementById('enabled_'+name+'_on');
			var enabledbuttononInstance = new fabric.Image(enabledbuttononElement, {
			  id: 'enabled_'+name+'_on',
			  name: 'enabled_'+name+'_on',
			  name2: name,
			  parameter: parameter,
			  type: 'enabled_button',
			  left: button_left,
			  top: button_top,
			  angle: 0,
			  opacity: input_on_opacity,	
			  selectable: false,
			  hasControls: false,
			});
			canvas.add(enabledbuttononInstance);
			
		}	
	}
	
	function get_router_view2(){
		
		document.getElementById('router_view').value = 'router';
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		
		var label1 = '1';
		
		canvas.clear();
		
		var height = 335;
		var width = 803;
		
		if(IsDualChannel==0){
		   width-=200;
		}
		
		var zoom = 0.7;
		var height_adj = zoom*height;
		var width_adj = zoom*width;
				
		canvas.setHeight(height_adj);
		canvas.setWidth(width_adj);
		canvas.setZoom(zoom);
			
		// set bar background
		var routerbarElement = document.getElementById('router_bar_amp2c');
		var routerbarInstance = new fabric.Image(routerbarElement, {
		  id: 'router_bar',
		  name: 'router_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(routerbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Router'), {
			id: 'router_header_text',
			name: 'router_header_text',
			left: 18,
			top: 11,
			width: 300,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var close_button_left = 750;
		if(IsDualChannel==0){
		   close_button_left-=200;
		}
		var router_close_buttonElement = document.getElementById('router_close_button');
		var router_close_buttonInstance = new fabric.Image(router_close_buttonElement, {
		  id: 'router_close_button',
		  name: 'router_close_button',
		  left: close_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_close_buttonInstance);
			
		// add reset_button
		var reset_button_left = 690;
		if(IsDualChannel==0){
		   reset_button_left-=200;
		}
		var router_reset_buttonElement = document.getElementById('router_reset_button');
		var router_reset_buttonInstance = new fabric.Image(router_reset_buttonElement, {
		  id: 'router_reset_button',
		  name: 'router_reset_button',
		  type: 'router_reset_button',
		  left: reset_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_reset_buttonInstance);
		
		var data_array = router_data_array2;
		
		for(var x=0;x<data_array.length;x++){
			
			var name = data_array[x]['name'];
			var parameter = data_array[x]['parameter'];
			var indicator_left = data_array[x]['indicator_left'];
			var indicator_top = data_array[x]['indicator_top'];
			var text_left = data_array[x]['text_left'];
			var text_top = data_array[x]['text_top'];
			var button_left = data_array[x]['button_left'];
			var button_top = data_array[x]['button_top'];
			
			var input = document.getElementById('router_'+name).value;
			var angle;
			if(parameter=='gain'){
				angle = -150+(input*10.714); // Min: 0 Max: 28
			} else {
				angle = (input*10);
			}
			
			var show_hide_array = ["input1","output1","gain1","cg11","cg21"];
			
			if(IsDualChannel==1){
				show_hide_array.push("cg12","cg22","output2");
			}
			
			if(show_hide_array.includes(name)){

              // set router_indicator_element
              var router_indicator_element = document.getElementById('router_indicator_'+name);
              var router_indicator_instance = new fabric.Image(router_indicator_element, { 
                id: 'router_indicator_'+name,
                name: 'router_indicator_'+name,
                name2: name,
                type: 'router_indicator',
                left: indicator_left,
                top: indicator_top,
                angle: angle,
                opacity: 1.0,	
                selectable: false,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
              });
              canvas.add(router_indicator_instance);

              // set router_touch_element
              var router_touch_element = document.getElementById('router_touch_'+name);
              var router_touch_instance = new fabric.Image(router_touch_element, {
                id: 'router_touch_'+name,
                name: 'router_touch_'+name,
                name2: name,
                type: 'router_touch_input',
                parameter: parameter,
                left: indicator_left,
                top: indicator_top,
                angle: 0,
                opacity: 1.0,	
                selectable: true,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
                borderColor: 'rgba(0,0,0,0.0)',
                cornerColor: 'rgba(0,0,0,0.0)',
              });
              canvas.add(router_touch_instance);

              // set input text
              var text = input;
              if(input=='-144'){
                 text=0;
              }
              var router_text = new fabric.Textbox(String(text), {
                  id: 'router_'+ name +'_text',
                  name: 'router_'+name+'_text',
                  parameter: parameter,
                  left: text_left,
                  top: text_top,
                  width: 20,
                  fontSize: 15,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(router_text);

              var bnt = parameter;
              if(name=='gain1'){
                  bnt= 'Analog Input Gain 1';
              } 
              if(parameter=='IG1'){
                  bnt= 'Input Gain 1';
              } 
              if(parameter=='OG1'){
                 bnt = 'A';
               }
              if(parameter=='OG2'){
                 bnt = 'B';
               }

              if(parameter=='CG11'){
                  bnt=initial_letters(label1) + '\u2192A';
              }
              if(parameter=='CG12'){
                  bnt=initial_letters(label1) + '\u2192B';
              }

              var fontsize = 20;
              if(parameter=="gain" || parameter.includes("IG")){
                  fontsize = 16;
              }

              var block_name_text = new fabric.Textbox(String(bnt), {
                  id: 'block_name'+ name +'_text',
                  name: 'block_name'+name+'_text',
                  parameter: parameter,
                  left: text_left-63,
                  top: text_top+85,
                  width: 150,
                  fontSize: fontsize,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(block_name_text);

              if(parameter!='gain'){

                  var router_enabled = document.getElementById('router_enable_'+name).value;
                  var input_off_opacity;
                  var input_on_opacity;
                  if(router_enabled==0){
                      input_off_opacity=1.0;
                      input_on_opacity=0.0;
                   } else {
                       input_off_opacity=0.0;
                       input_on_opacity=1.0;
                   }

                  // set enabled_off
                  var enabledbuttonoffElement = document.getElementById('enabled_'+name+'_off');
                  var enabledbuttonoffInstance = new fabric.Image(enabledbuttonoffElement, {
                    id: 'enabled_'+name+'_off',
                    name: 'enabled_'+name+'_off',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_off_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttonoffInstance);

                  // set enabled_on
                  var enabledbuttononElement = document.getElementById('enabled_'+name+'_on');
                  var enabledbuttononInstance = new fabric.Image(enabledbuttononElement, {
                    id: 'enabled_'+name+'_on',
                    name: 'enabled_'+name+'_on',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_on_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttononInstance);
               }
			}
		}
	}
	function get_router_view3(){ 
		
		document.getElementById('router_view').value = 'router';
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		var label1 = '1';
		var label2 = '2';
		
		canvas.clear();
				
		var height = 465;
		var width = 1203;
		
		if(IsDualChannel==0){
		   width-=200;
		}
		
		if(IsDualChannel2==0){
		   width-=200;
		}
		
		var zoom = 0.7;
		var height_adj = zoom*height;
		var width_adj = zoom*width;
		
		canvas.setHeight(height_adj);
		canvas.setWidth(width_adj);
		canvas.setZoom(0.7);
			
		// set bar background
		var routerbarElement = document.getElementById('router_bar_amp4c');
		var routerbarInstance = new fabric.Image(routerbarElement, {
		  id: 'router_bar',
		  name: 'router_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(routerbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Router'), {
			id: 'router_header_text',
			name: 'router_header_text',
			left: 18,
			top: 11,
			width: 300,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var close_button_left = 1145;
		if(IsDualChannel==0){
		   close_button_left-=200;
		}
		if(IsDualChannel2==0){
		   close_button_left-=200;
		}
		var router_close_buttonElement = document.getElementById('router_close_button');
		var router_close_buttonInstance = new fabric.Image(router_close_buttonElement, {
		  id: 'router_close_button',
		  name: 'router_close_button',
		  left: close_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_close_buttonInstance);
			
		// add reset_button
		var reset_button_left = 1085;
		if(IsDualChannel==0){
		   reset_button_left-=200;
		}
		if(IsDualChannel2==0){
		   reset_button_left-=200;
		}
		var router_reset_buttonElement = document.getElementById('router_reset_button');
		var router_reset_buttonInstance = new fabric.Image(router_reset_buttonElement, {
		  id: 'router_reset_button',
		  name: 'router_reset_button',
		  type: 'router_reset_button',
		  left: reset_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_reset_buttonInstance);
		
		var data_array = router_data_array3;
		
		for(var x=0;x<data_array.length;x++){
			
			var name = data_array[x]['name'];
			var parameter = data_array[x]['parameter'];
			var indicator_left = data_array[x]['indicator_left'];
			var indicator_top = data_array[x]['indicator_top'];
			var text_left = data_array[x]['text_left'];
			var text_top = data_array[x]['text_top'];
			var button_left = data_array[x]['button_left'];
			var button_top = data_array[x]['button_top'];
			
			var input = document.getElementById('router_'+name).value;
			var angle;
			if(parameter=='gain'){
				angle = -150+(input*10.714); // Min: 0 Max: 28
			} else {
				angle = (input*10);
			}
			
			var show_hide_array = ["input1","input2","output1","output3","gain1","gain2","cg11","cg21","cg13","cg23"];
			
			if(IsDualChannel==1){
				show_hide_array.push("cg12","cg22","output2");
			}
			
			if(IsDualChannel2==1){
				show_hide_array.push("cg14","cg24","output4");
			}
			
			if(IsDualChannel==0 && ["output3","cg13","cg23","output4","cg14","cg24"].includes(name)){
				indicator_left -= 200;
				text_left -= 200;
				button_left -= 200;
			}
			
			if(show_hide_array.includes(name)){

              // set router_indicator_element
              var router_indicator_element = document.getElementById('router_indicator_'+name);
              var router_indicator_instance = new fabric.Image(router_indicator_element, { 
                id: 'router_indicator_'+name,
                name: 'router_indicator_'+name,
                name2: name,
                type: 'router_indicator',
                left: indicator_left,
                top: indicator_top,
                angle: angle,
                opacity: 1.0,	
                selectable: false,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
              });
              canvas.add(router_indicator_instance);

              // set router_touch_element
              var router_touch_element = document.getElementById('router_touch_'+name);
              var router_touch_instance = new fabric.Image(router_touch_element, {
                id: 'router_touch_'+name,
                name: 'router_touch_'+name,
                name2: name,
                type: 'router_touch_input',
                parameter: parameter,
                left: indicator_left,
                top: indicator_top,
                angle: 0,
                opacity: 1.0,	
                selectable: true,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
                borderColor: 'rgba(0,0,0,0.0)',
                cornerColor: 'rgba(0,0,0,0.0)',
              });
              canvas.add(router_touch_instance);

              // set input text
              var text = input;
              if(input=='-144'){
                 text=0;
              }
              var router_text = new fabric.Textbox(String(text), {
                  id: 'router_'+ name +'_text',
                  name: 'router_'+name+'_text',
                  parameter: parameter,
                  left: text_left,
                  top: text_top,
                  width: 20,
                  fontSize: 15,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(router_text);

              var bnt = parameter;
              if(name=='gain1'){
                  bnt= 'Analog Input Gain 1';
              } 
              if(name=='gain2'){
                   bnt= 'Analog Input Gain 2';
              } 
              if(parameter=='IG1'){
                  bnt= 'Input Gain 1';
              } 
              if(parameter=='IG2'){
                 bnt = 'Input Gain 2';
               }
              if(parameter=='OG1'){
                 bnt = 'A';
               }
              if(parameter=='OG2'){
                 bnt = 'B';
               }
              if(parameter=='OG3'){
                 bnt = 'C';
               }
              if(parameter=='OG4'){
                 bnt = 'D';
               }

              if(parameter=='CG11'){
                  bnt=initial_letters(label1) + '\u2192A';
              }
              if(parameter=='CG12'){
                  bnt=initial_letters(label1) + '\u2192B';
              }
              if(parameter=='CG13'){
                  bnt=initial_letters(label1) + '\u2192C';
              }
              if(parameter=='CG14'){
                  bnt=initial_letters(label1) + '\u2192D';
              }
              if(parameter=='CG21'){
                  bnt=initial_letters(label2) + '\u2192A';
              }
              if(parameter=='CG22'){
                  bnt=initial_letters(label2) + '\u2192B';
              }
              if(parameter=='CG23'){
                  bnt=initial_letters(label2) + '\u2192C';
              }
              if(parameter=='CG24'){
                  bnt=initial_letters(label2) + '\u2192D';
              }
              var fontsize = 20;
              if(parameter=="gain" || parameter.includes("IG")){
                  fontsize = 16;
              }

              var block_name_text = new fabric.Textbox(String(bnt), {
                  id: 'block_name'+ name +'_text',
                  name: 'block_name'+name+'_text',
                  parameter: parameter,
                  left: text_left-63,
                  top: text_top+85,
                  width: 150,
                  fontSize: fontsize,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(block_name_text);

              if(parameter!='gain'){

                 var router_enabled = document.getElementById('router_enable_'+name).value;
                  var input_off_opacity;
                  var input_on_opacity;
                  if(router_enabled==0){
                      input_off_opacity=1.0;
                      input_on_opacity=0.0;
                   } else {
                       input_off_opacity=0.0;
                       input_on_opacity=1.0;
                   }

                  // set enabled_off
                  var enabledbuttonoffElement = document.getElementById('enabled_'+name+'_off');
                  var enabledbuttonoffInstance = new fabric.Image(enabledbuttonoffElement, {
                    id: 'enabled_'+name+'_off',
                    name: 'enabled_'+name+'_off',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_off_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttonoffInstance);

                  // set enabled_on
                  var enabledbuttononElement = document.getElementById('enabled_'+name+'_on');
                  var enabledbuttononInstance = new fabric.Image(enabledbuttononElement, {
                    id: 'enabled_'+name+'_on',
                    name: 'enabled_'+name+'_on',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_on_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttononInstance);
               }
			
			}
		}	
	}
	
	function get_router_view4(){
		var json_type = document.getElementById('json_type').value
		document.getElementById('router_view').value = 'router';
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		var label1 = '1';
		var label2 = '2';
		var label3 = '3';
		var label4 = '4';
		
		canvas.clear();
		
		var height = 719;
		var width = 1203;
		
		if(IsDualChannel==0){
		   width-=200;
		}
		
		if(IsDualChannel2==0){
		   width-=200;
		}
		
		var zoom = 0.7;
		var height_adj = zoom*height;
		var width_adj = zoom*width;
				
		canvas.setHeight(height_adj);
		canvas.setWidth(width_adj);
		canvas.setZoom(zoom);
			
		// set bar background
		var routerbarElement = document.getElementById('router_bar_amp4c_g2');
		var routerbarInstance = new fabric.Image(routerbarElement, {
		  id: 'router_bar',
		  name: 'router_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(routerbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Router'), {
			id: 'router_header_text',
			name: 'router_header_text',
			left: 18,
			top: 11,
			width: 300,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var close_button_left = 1145;
		if(IsDualChannel==0){
		   close_button_left-=200;
		}
		if(IsDualChannel2==0){
		   close_button_left-=200;
		}
		var router_close_buttonElement = document.getElementById('router_close_button');
		var router_close_buttonInstance = new fabric.Image(router_close_buttonElement, {
		  id: 'router_close_button',
		  name: 'router_close_button',
		  left: close_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_close_buttonInstance);
			
		// add reset_button
		var reset_button_left = 1085;
		if(IsDualChannel==0){
		   reset_button_left-=200;
		}
		if(IsDualChannel2==0){
		   reset_button_left-=200;
		}
		var router_reset_buttonElement = document.getElementById('router_reset_button');
		var router_reset_buttonInstance = new fabric.Image(router_reset_buttonElement, {
		  id: 'router_reset_button',
		  name: 'router_reset_button',
		  type: 'router_reset_button',
		  left: reset_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_reset_buttonInstance);
		
		var data_array = router_data_array4;
		
		for(var x=0;x<data_array.length;x++){
			
			var name = data_array[x]['name'];
			var parameter = data_array[x]['parameter'];
			var indicator_left = data_array[x]['indicator_left'];
			var indicator_top = data_array[x]['indicator_top'];
			var text_left = data_array[x]['text_left'];
			var text_top = data_array[x]['text_top'];
			var button_left = data_array[x]['button_left'];
			var button_top = data_array[x]['button_top'];
			
			var input = document.getElementById('router_'+name).value;
			var angle;
			if(parameter=='gain'){
				angle = -150+(input*10.714); // Min: 0 Max: 28
			} else {
				angle = (input*10);
			}
			
			var show_hide_array = ["input1","input2","input3","input4","output1","output3","gain1","gain2","gain3","gain4","cg11","cg21","cg31","cg41","cg13","cg23","cg33","cg43"];
			
			if(IsDualChannel==1){
				show_hide_array.push("cg12","cg22","cg32","cg42","output2");
			}
			
			if(IsDualChannel2==1){
				show_hide_array.push("cg14","cg24","cg34","cg44","output4");
			}
			
			if(IsDualChannel==0 && ["output3","cg13","cg23","cg33","cg43","output4","cg14","cg24","cg34","cg44"].includes(name)){
				indicator_left -= 200;
				text_left -= 200;
				button_left -= 200;
			}
				
			if(show_hide_array.includes(name)){

              // set router_indicator_element
              var router_indicator_element = document.getElementById('router_indicator_'+name);
              var router_indicator_instance = new fabric.Image(router_indicator_element, { 
                id: 'router_indicator_'+name,
                name: 'router_indicator_'+name,
                name2: name,
                type: 'router_indicator',
                left: indicator_left,
                top: indicator_top,
                angle: angle,
                opacity: 1.0,	
                selectable: false,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
              });
              canvas.add(router_indicator_instance);

              // set router_touch_element
              var router_touch_element = document.getElementById('router_touch_'+name);
              var router_touch_instance = new fabric.Image(router_touch_element, {
                id: 'router_touch_'+name,
                name: 'router_touch_'+name,
                name2: name,
                type: 'router_touch_input',
                parameter: parameter,
                left: indicator_left,
                top: indicator_top,
                angle: 0,
                opacity: 1.0,	
                selectable: true,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
                borderColor: 'rgba(0,0,0,0.0)',
                cornerColor: 'rgba(0,0,0,0.0)',
              });
              canvas.add(router_touch_instance);

              // set input text
              var text = input;
              if(input=='-144'){
                 text=0;
              }
              var router_text = new fabric.Textbox(String(text), {
                  id: 'router_'+ name +'_text',
                  name: 'router_'+name+'_text',
                  parameter: parameter,
                  left: text_left,
                  top: text_top,
                  width: 20,
                  fontSize: 15,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(router_text);

              var bnt = parameter;
              if(name=='gain1'){
                  bnt= 'Analog Input Gain 1';
              } 
              if(name=='gain2'){
                   bnt= 'Analog Input Gain 2';
              } 
              if(name=='gain3'){
                   bnt= 'Analog Input Gain 3';
              } 
              if(name=='gain4'){
                   bnt= 'Analog Input Gain 4';
              } 
              if(parameter=='IG1'){
                  bnt= 'Input Gain 1';
              } 
              if(parameter=='IG2'){
                 bnt = 'Input Gain 2';
               }
              if(parameter=='IG3'){
                 bnt = 'Input Gain 3';
               }
              if(parameter=='IG4'){
                 bnt = 'Input Gain 4';
               }
              if(parameter=='OG1'){
                 bnt = 'A';
               }
              if(parameter=='OG2'){
                 bnt = 'B';
               }
              if(parameter=='OG3'){
                 bnt = 'C';
               }
              if(parameter=='OG4'){
                 bnt = 'D';
               }

              if(parameter=='CG11'){
                  bnt=initial_letters(label1) + '\u2192A';
              }
              if(parameter=='CG12'){
                  bnt=initial_letters(label1) + '\u2192B';
              }
              if(parameter=='CG13'){
                  bnt=initial_letters(label1) + '\u2192C';
              }
              if(parameter=='CG14'){
                  bnt=initial_letters(label1) + '\u2192D';
              }
              if(parameter=='CG21'){
                  bnt=initial_letters(label2) + '\u2192A';
              }
              if(parameter=='CG22'){
                  bnt=initial_letters(label2) + '\u2192B';
              }
              if(parameter=='CG23'){
                  bnt=initial_letters(label2) + '\u2192C';
              }
              if(parameter=='CG24'){
                  bnt=initial_letters(label2) + '\u2192D';
              }
              if(parameter=='CG31'){
                  bnt=initial_letters(label3) + '\u2192A';
              }
              if(parameter=='CG32'){
                  bnt=initial_letters(label3) + '\u2192B';
              }
              if(parameter=='CG33'){
                  bnt=initial_letters(label3) + '\u2192C';
              }
              if(parameter=='CG34'){
                  bnt=initial_letters(label3) + '\u2192D';
              }
              if(parameter=='CG41'){
                  bnt=initial_letters(label4) + '\u2192A';
              }
              if(parameter=='CG42'){
                  bnt=initial_letters(label4) + '\u2192B';
              }
              if(parameter=='CG43'){
                  bnt=initial_letters(label4) + '\u2192C';
              }
              if(parameter=='CG44'){
                  bnt=initial_letters(label4) + '\u2192D';
              }

              var fontsize = 20;
              if(parameter=="gain" || parameter.includes("IG")){
                  fontsize = 16;
              }

              var block_name_text = new fabric.Textbox(String(bnt), {
                  id: 'block_name'+ name +'_text',
                  name: 'block_name'+name+'_text',
                  parameter: parameter,
                  left: text_left-63,
                  top: text_top+85,
                  width: 150,
                  fontSize: fontsize,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(block_name_text);

              if(parameter!='gain'){

                 var router_enabled = document.getElementById('router_enable_'+name).value;
                  var input_off_opacity;
                  var input_on_opacity;
                  if(router_enabled==0){
                      input_off_opacity=1.0;
                      input_on_opacity=0.0;
                   } else {
                       input_off_opacity=0.0;
                       input_on_opacity=1.0;
                   }

                  // set enabled_off
                  var enabledbuttonoffElement = document.getElementById('enabled_'+name+'_off');
                  var enabledbuttonoffInstance = new fabric.Image(enabledbuttonoffElement, {
                    id: 'enabled_'+name+'_off',
                    name: 'enabled_'+name+'_off',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_off_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttonoffInstance);

                  // set enabled_on
                  var enabledbuttononElement = document.getElementById('enabled_'+name+'_on');
                  var enabledbuttononInstance = new fabric.Image(enabledbuttononElement, {
                    id: 'enabled_'+name+'_on',
                    name: 'enabled_'+name+'_on',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_on_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttononInstance);
               }
          	}	
			
		}
	}
	
	function get_router_view5(){
		var json_type = document.getElementById('json_type').value
		document.getElementById('router_view').value = 'router';
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		
		var label1 = '1';
		var label2 = '2';
		
		canvas.clear();
		
		var height = 464;
		var width = 803;
		
		if(IsDualChannel==0){
		   width-=200;
		}
		
		var zoom = 0.7;
		var height_adj = zoom*height;
		var width_adj = zoom*width;
				
		canvas.setHeight(height_adj);
		canvas.setWidth(width_adj);
		canvas.setZoom(zoom);
			
		// set bar background
		var routerbarElement = document.getElementById('router_bar_amp2c_g2');
		var routerbarInstance = new fabric.Image(routerbarElement, {
		  id: 'router_bar',
		  name: 'router_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(routerbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Router'), {
			id: 'router_header_text',
			name: 'router_header_text',
			left: 18,
			top: 11,
			width: 300,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var close_button_left = 750;
		if(IsDualChannel==0){
		   close_button_left-=200;
		}
		var router_close_buttonElement = document.getElementById('router_close_button');
		var router_close_buttonInstance = new fabric.Image(router_close_buttonElement, {
		  id: 'router_close_button',
		  name: 'router_close_button',
		  left: close_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_close_buttonInstance);
			
		// add reset_button
		var reset_button_left = 690;
		if(IsDualChannel==0){
		   reset_button_left-=200;
		}
		var router_reset_buttonElement = document.getElementById('router_reset_button');
		var router_reset_buttonInstance = new fabric.Image(router_reset_buttonElement, {
		  id: 'router_reset_button',
		  name: 'router_reset_button',
		  type: 'router_reset_button',
		  left: reset_button_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(router_reset_buttonInstance);
		
		var data_array = router_data_array5;
		
		for(var x=0;x<data_array.length;x++){
			
			var name = data_array[x]['name'];
			var parameter = data_array[x]['parameter'];
			var indicator_left = data_array[x]['indicator_left'];
			var indicator_top = data_array[x]['indicator_top'];
			var text_left = data_array[x]['text_left'];
			var text_top = data_array[x]['text_top'];
			var button_left = data_array[x]['button_left'];
			var button_top = data_array[x]['button_top'];
			
			var input = document.getElementById('router_'+name).value;
			var angle;
			if(parameter=='gain'){
				angle = -150+(input*10.714); // Min: 0 Max: 28
			} else {
				angle = (input*10);
			}
			
			var show_hide_array = ["input1","input2","output1","gain1","gain2","cg11","cg21"];
			
			if(IsDualChannel==1){
				show_hide_array.push("cg12","cg22","output2");
			}
			
			if(show_hide_array.includes(name)){

              // set router_indicator_element
              var router_indicator_element = document.getElementById('router_indicator_'+name);
              var router_indicator_instance = new fabric.Image(router_indicator_element, { 
                id: 'router_indicator_'+name,
                name: 'router_indicator_'+name,
                name2: name,
                type: 'router_indicator',
                left: indicator_left,
                top: indicator_top,
                angle: angle,
                opacity: 1.0,	
                selectable: false,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
              });
              canvas.add(router_indicator_instance);

              // set router_touch_element
              var router_touch_element = document.getElementById('router_touch_'+name);
              var router_touch_instance = new fabric.Image(router_touch_element, {
                id: 'router_touch_'+name,
                name: 'router_touch_'+name,
                name2: name,
                type: 'router_touch_input',
                parameter: parameter,
                left: indicator_left,
                top: indicator_top,
                angle: 0,
                opacity: 1.0,	
                selectable: true,
                hasControls: false,
                originX: 'center',
                originY: 'center',
                centeredRotation: true,
                borderColor: 'rgba(0,0,0,0.0)',
                cornerColor: 'rgba(0,0,0,0.0)',
              });
              canvas.add(router_touch_instance);

              // set input text
              var text = input;
              if(input=='-144'){
                 text=0;
              }
              var router_text = new fabric.Textbox(String(text), {
                  id: 'router_'+ name +'_text',
                  name: 'router_'+name+'_text',
                  parameter: parameter,
                  left: text_left,
                  top: text_top,
                  width: 20,
                  fontSize: 15,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(router_text);

              var bnt = parameter;
              if(name=='gain1'){
                  bnt= 'Analog Input Gain 1';
              } 
              if(name=='gain2'){
                   bnt= 'Analog Input Gain 2';
              }
              if(parameter=='IG1'){
                  bnt= 'Input Gain 1';
              } 
              if(parameter=='IG2'){
                 bnt = 'Input Gain 2';
               }
              if(parameter=='OG1'){
                 bnt = 'A';
               }
              if(parameter=='OG2'){
                 bnt = 'B';
               }

              if(parameter=='CG11'){
                  bnt=initial_letters(label1) + '\u2192A';
              }
              if(parameter=='CG12'){
                  bnt=initial_letters(label1) + '\u2192B';
              }
              if(parameter=='CG21'){
                  bnt=initial_letters(label2) + '\u2192A';
              }
              if(parameter=='CG22'){
                  bnt=initial_letters(label2) + '\u2192B';
              }

              var fontsize = 20;
              if(parameter=="gain" || parameter.includes("IG")){
                  fontsize = 16;
              }

              var block_name_text = new fabric.Textbox(String(bnt), {
                  id: 'block_name'+ name +'_text',
                  name: 'block_name'+name+'_text',
                  parameter: parameter,
                  left: text_left-63,
                  top: text_top+85,
                  width: 150,
                  fontSize: fontsize,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(255,255,255,1.0)',
                  textAlign: 'center',
                  editable: false,
              });
              canvas.add(block_name_text);

              if(parameter!='gain'){

                  var router_enabled = document.getElementById('router_enable_'+name).value;
                  var input_off_opacity;
                  var input_on_opacity;
                  if(router_enabled==0){
                      input_off_opacity=1.0;
                      input_on_opacity=0.0;
                   } else {
                       input_off_opacity=0.0;
                       input_on_opacity=1.0;
                   }

                  // set enabled_off
                  var enabledbuttonoffElement = document.getElementById('enabled_'+name+'_off');
                  var enabledbuttonoffInstance = new fabric.Image(enabledbuttonoffElement, {
                    id: 'enabled_'+name+'_off',
                    name: 'enabled_'+name+'_off',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_off_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttonoffInstance);

                  // set enabled_on
                  var enabledbuttononElement = document.getElementById('enabled_'+name+'_on');
                  var enabledbuttononInstance = new fabric.Image(enabledbuttononElement, {
                    id: 'enabled_'+name+'_on',
                    name: 'enabled_'+name+'_on',
                    name2: name,
                    parameter: parameter,
                    type: 'enabled_button',
                    left: button_left,
                    top: button_top,
                    angle: 0,
                    opacity: input_on_opacity,	
                    selectable: false,
                    hasControls: false,
                  });
                  canvas.add(enabledbuttononInstance);
               }
			}
		}
	}
	
	function get_outputs_view(){
		
		var json_type = document.getElementById('json_type').value
		document.getElementById('router_view').value = 'outputs';	
		
		var label = document.getElementById('label1').value;
		
		var label2 = 'Input';
		
		if(json_type=='nqga40'){
		   
		   label = document.getElementById('label2').value;
		   label2 = 'Line & AMP Output';
		}
		if(json_type=='nq-dsc01'){
		   
		   label = document.getElementById('label2').value;
		   label2 = 'Line & AMP Output';
		}
		
		canvas.clear();
		
		canvas.setHeight(335);
		canvas.setWidth(602);
		
		// set Zoom level
		canvas.setZoom(0.7);
			
		// set bar background
		var outputsbarElement = document.getElementById('outputs_bar_nqga20');
		var outputsbarInstance = new fabric.Image(outputsbarElement, {
		  id: 'outputs_bar',
		  name: 'outputs_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(outputsbarInstance);
		
		// set header text
		var header_text1 = new fabric.Textbox(String('Outputs - '), {
			id: 'outputs_header_text1',
			name: 'outputs_header_text1',
			left: 18,
			top: 11,
			width: 600,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text1);
		
		var header_text2 = new fabric.Textbox(String(label ), {
			id: 'outputs_header_text2',
			name: 'outputs_header_text2',
			left: 155,
			top: 4,
			width: 600,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text2);
		
		var header_text3 = new fabric.Textbox(String('('+label2+')' ), {
			id: 'outputs_header_text3',
			name: 'outputs_header_text3',
			left: 155,
			top: 27,
			width: 600,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text3);
		
		// add close_button
		var outputs_close_buttonElement = document.getElementById('outputs_close_button');
		var outputs_close_buttonInstance = new fabric.Image(outputs_close_buttonElement, {
		  id: 'outputs_close_button',
		  name: 'outputs_close_button',
		  left: 552,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(outputs_close_buttonInstance);
		
		// add reset_button
		var outputs_reset_buttonElement = document.getElementById('outputs_reset_button');
		var outputs_reset_buttonInstance = new fabric.Image(outputs_reset_buttonElement, {
		  id: 'outputs_reset_button',
		  name: 'outputs_reset_button',
		  type: 'outputs_reset_button',
		  left: 492,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(outputs_reset_buttonInstance);
		
		var SpkMute = document.getElementById('SpkMute').value;
		var speaker_enabled_off_opacity;
		var speaker_enabled_on_opacity;
		if(SpkMute=='1'){
			speaker_enabled_off_opacity=1.0;
			speaker_enabled_on_opacity=0.0;
		 } else {
			 speaker_enabled_off_opacity=0.0;
			 speaker_enabled_on_opacity=1.0;
		 }
	
		// set enabled_speaker_off
		var enabledSpeakerButtonOffElement = document.getElementById('enabled_speaker_off');
		var enabledSpeakerButtonOffInstance = new fabric.Image(enabledSpeakerButtonOffElement, {
		  id: 'enabled_speaker_off',
		  name: 'enabled_speaker_off',
		  type: 'outputs_enable_button',
		  parameter: 'Speaker',
		  parameter2: 'SpkMute',
		  left: 50,
		  top: 145,
		  angle: 0,
		  opacity: speaker_enabled_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(enabledSpeakerButtonOffInstance);

		// set enabled_speaker_on
		var enabledSpeakerButtonOnElement = document.getElementById('enabled_speaker_on');
		var enabledSpeakerbuttonOnInstance = new fabric.Image(enabledSpeakerButtonOnElement, {
		  id: 'enabled_speaker_on',
		  name: 'enabled_speaker_on',
		  type: 'outputs_enable_button',
		  parameter: 'Speaker',
		  parameter2: 'SpkMute',
		  left: 50,
		  top: 145,
		  angle: 0,
		  opacity: speaker_enabled_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(enabledSpeakerbuttonOnInstance);
			
		var LineMute = document.getElementById('LineMute').value;
		var line_enabled_off_opacity;
		var line_enabled_on_opacity;
		if(LineMute=='1'){
			line_enabled_off_opacity=1.0;
			line_enabled_on_opacity=0.0;
		 } else {
			 line_enabled_off_opacity=0.0;
			 line_enabled_on_opacity=1.0;
		 }
	
		// set enabled_line_off
		var enabledLineButtonOffElement = document.getElementById('enabled_line_off');
		var enabledLineButtonOffInstance = new fabric.Image(enabledLineButtonOffElement, {
		  id: 'enabled_line_off',
		  name: 'enabled_line_off',
		  type: 'outputs_enable_button',
		  parameter: 'Line',
		  parameter2: 'LineMute',
		  left: 305,
		  top: 145,
		  angle: 0,
		  opacity: line_enabled_off_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(enabledLineButtonOffInstance);

		// set enabled_line_on
		var enabledLineButtonOnElement = document.getElementById('enabled_line_on');
		var enabledLineButtonOnInstance = new fabric.Image(enabledLineButtonOnElement, {
		  id: 'enabled_line_on',
		  name: 'enabled_line_on',
		  type: 'outputs_enable_button',
		  parameter: 'Line',
		  parameter2: 'LineMute',
		  left: 305,
		  top: 145,
		  angle: 0,
		  opacity: line_enabled_on_opacity,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(enabledLineButtonOnInstance);
		
		var input = document.getElementById('SpkVol').value;
		var angle = -150+((parseInt(input)+15)*20); // Min:-15 Max:0

        // set speaker_indicator_element
        var speaker_indicator_element = document.getElementById('outputs_indicator_speaker');
        var speaker_indicator_instance = new fabric.Image(speaker_indicator_element, { 
          id: 'outputs_indicator_speaker',
          name: 'outputs_indicator_speaker',
          type: 'outputs_indicator',
          left: 161,
          top: 167,
          angle: angle,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
        });
        canvas.add(speaker_indicator_instance);

        // set speaker_touch_element
        var speaker_touch_element = document.getElementById('outputs_touch_speaker');
        var speaker_touch_instance = new fabric.Image(speaker_touch_element, {
          id: 'outputs_touch_speaker',
          name: 'outputs_touch_speaker',
          type: 'outputs_touch',
          parameter: 'Speaker',
		  parameter2: 'SpkVol',
          left: 173,
          top: 179,
          angle: 0,
          opacity: 1.0,	
          selectable: true,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
          borderColor: 'rgba(0,0,0,0.0)',
          cornerColor: 'rgba(0,0,0,0.0)',
        });
        canvas.add(speaker_touch_instance);
		
		// set outputs_speaker_text
		 var outputs_speaker_text = new fabric.Textbox(String(input), {
          id: 'outputs_speaker_text',
          name: 'outputs_speaker_text',
          parameter: 'Speaker',
		  parameter2: 'SpkVol',
          left: 150,
          top: 112,
          width: 20,
          fontSize: 15,
          selectable: false,
          hasControls: false,
          fontFamily: 'Arial',
          fill: 'rgba(255,255,255,1.0)',
          textAlign: 'center',
          editable: false,
      	});
		canvas.add(outputs_speaker_text);
		
		var input2 = document.getElementById('LineVol').value;
        var angle2 = -150+((parseInt(input2)+15)*10);

        // set line_indicator_element
        var line_indicator_element = document.getElementById('outputs_indicator_line');
        var line_indicator_instance = new fabric.Image(line_indicator_element, { 
          id: 'outputs_indicator_line',
          name: 'outputs_indicator_line',
          type: 'outputs_indicator',
          left: 415,
          top: 167,
          angle: angle2,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
        });
        canvas.add(line_indicator_instance);

        // set line_touch_element
        var line_touch_element = document.getElementById('outputs_touch_line');
        var line_touch_instance = new fabric.Image(line_touch_element, {
          id: 'outputs_touch_line',
          name: 'outputs_touch_line',
          type: 'outputs_touch',
          parameter: 'Line',
		  parameter2: 'LineVol',
          left: 426,
          top: 179,
          angle: 0,
          opacity: 1.0,	
          selectable: true,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
          borderColor: 'rgba(0,0,0,0.0)',
          cornerColor: 'rgba(0,0,0,0.0)',
        });
        canvas.add(line_touch_instance);
		
		// set outputs_line_text
		 var outputs_line_text = new fabric.Textbox(String(input2), {
          id: 'outputs_line_text',
          name: 'outputs_line_text',
          parameter: 'Line',
		  parameter2: 'LineVol',
          left: 405,
          top: 112,
          width: 20,
          fontSize: 15,
          selectable: false,
          hasControls: false,
          fontFamily: 'Arial',
          fill: 'rgba(255,255,255,1.0)',
          textAlign: 'center',
          editable: false,
      	});
		canvas.add(outputs_line_text);
	}
	
	function get_peq_view(channel){
		
		document.getElementById('router_view').value = 'peq';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		
		if(json_type=='Mixer'){
			if(channel==6){
				input_output = 'Input 5';
			}
		}
		if(json_type=='nqga20'){
			input_output = 'Input';
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		if(json_type=='nqga400p'){
			if(channel==3){
			   input_output = 'Ouput 1';
			}
			if(channel==4){
			   input_output = 'Ouput 2';
			}
		}
		if(json_type=='nqga40'){
			if(channel==1){
			   input_output = 'Line Input';
			}
			if(channel==2){
			   input_output = 'Line & AMP Output';
			}
		}
		
		var full_label =  label + ' ('+input_output+')';
			
		canvas.clear();
		
		canvas.setHeight(740);
		canvas.setWidth(1663);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var channel_name = '';
		
		var bar = 'peq_bar';
		
		if(json_type=='nqga400p'){
			bar = 'peq_bar_5';
		}
	
		// set bar background
		var peqbarElement = document.getElementById(bar);
		var peqbarInstance = new fabric.Image(peqbarElement, {
		  id: 'peq_bar',
		  name: 'peq_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peqbarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Parametric EQ - '+full_label), {
			id: 'peq_channel_text',
			name: 'peq_channel_text',
			left: 18,
			top: 11,
			width: 1200,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var peq_close_buttonElement = document.getElementById('peq_close_button');
		var peq_close_buttonInstance = new fabric.Image(peq_close_buttonElement, {
		  id: 'peq_close_button',
		  name: 'peq_close_button',
		  left: 1605,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peq_close_buttonInstance);
		
		// add reset_button
		var peq_reset_buttonElement = document.getElementById('peq_reset_button');
		var peq_reset_buttonInstance = new fabric.Image(peq_reset_buttonElement, {
		  id: 'peq_close_button',
		  name: 'peq_reset_button',
		  type: 'peq_reset_button',
		  channel: channel,
		  left: 1545,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peq_reset_buttonInstance);
		
		// signal light
		var signal = document.getElementById('Signal_signal_present'+channel).value;
		if(signal==1){
			set_signal_led_rect(channel,66,1479);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,1479);
		}
		
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,1479);
		set_yellow_led_rect2(channel,input_level_top,1479);
		set_green_led_rect2(channel,input_level_top,1479); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,1602);
		set_yellow_led_rect(channel,output_level_top,1602);
		set_green_led_rect(channel,output_level_top,1602); 
		
		var data_array;
		
		if(json_type=='nqga400p'){
		   data_array = peq_data_array_5;
		} else {
			 data_array = peq_data_array;
		}
		
		for(var x=0;x<data_array.length;x++){
			
			var type = data_array[x]['type'];
			if(type=='fader'){
				
				var name = data_array[x]['name'];
				var parameter = data_array[x]['parameter'];
				var indicator_left = data_array[x]['indicator_left'];
				var indicator_top = data_array[x]['indicator_top'];
				var text_left = data_array[x]['text_left'];
				var text_top = data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+channel+'_fader').value;
				var  angle = -150+((parseInt(input)+12)*12.4); // Min:-12 Max:12
			
				if(angle>150){
					angle=150;
				}
				if(angle<-150){
					angle=-150;
				}
				
				// set peq_indicator_element
				var peq_indicator_fader_element = document.getElementById('peq_indicator_fader_'+parameter);
				var peq_indicator_fader_instance = new fabric.Image(peq_indicator_fader_element, { 
				  id: 'peq_indicator_fader_'+parameter,
				  name: 'peq_indicator_fader_'+parameter,
				  name2: name,
				  type: 'peq_indicator_fader',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(peq_indicator_fader_instance);

				// set peq_touch_element
				var peq_touch_fader_element = document.getElementById('peq_touch_fader_'+parameter);
				var peq_touch_fader_instance = new fabric.Image(peq_touch_fader_element, {
				  id: 'peq_touch_fader_'+parameter,
				  name: 'peq_touch_fader_'+parameter,
				  type: 'peq_touch_fader',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(peq_touch_fader_instance);

				// set input text
				var text = input;
				
				if(text>999){
					text = formatNumber(text);
				}
				
				var peq_fader_text = new fabric.Textbox(String(text), {
					id: 'peq_fader_'+ parameter +'_text',
					name: 'peq_fader_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 100,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(peq_fader_text);
			}
			if(type=='enabled'){
				
				var name = data_array[x]['name'];
				var parameter = data_array[x]['parameter'];
			  	var left = data_array[x]['left'];
				var top = data_array[x]['top'];
				
				var enable = document.getElementById(parameter+channel+'_enable').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('peq_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'peq_'+parameter+'_off',
				  name: 'peq_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'peq_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('peq_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'peq_'+parameter+'_on',
				  name: 'peq_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'peq_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='freq'){
				
				var name = data_array[x]['name'];
				var parameter = data_array[x]['parameter'];
				var indicator_left = data_array[x]['indicator_left'];
				var indicator_top = data_array[x]['indicator_top'];
				var text_left = data_array[x]['text_left'];
				var text_top = data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+channel+'_freq').value;
				var angle = -150+(input*0.015);
				
				if(input>=20 && input<=100){
				   angle = -150+((parseInt(input)-20)*1.25); // Min:20 Max:100
				}
				if(input>100 && input<=1000){
					angle = -50+((parseInt(input)-100)*.1111); // Min:100 Max:1000
				}
				if(input>1000 && input<=20000){
					angle = 50+((parseInt(input)-1000)*.005263); // Min:1000 Max:20,000
				}

				if(angle>150){
					angle=150;
				}
				if(angle<-150){
					angle=-150;
				}
				
				// set peq_indicator_element
				var peq_indicator_element = document.getElementById('peq_indicator_freq_'+parameter);
				var peq_indicator_instance = new fabric.Image(peq_indicator_element, { 
				  id: 'peq_indicator_freq_'+parameter,
				  name: 'peq_indicator_freq_'+parameter,
				  name2: name,
				  type: 'peq_indicator_freq',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(peq_indicator_instance);

				// set peq_touch_element
				var peq_touch_element = document.getElementById('peq_touch_freq_'+parameter);
				var peq_touch_instance = new fabric.Image(peq_touch_element, {
				  id: 'peq_touch_freq_'+parameter,
				  name: 'peq_touch_freq_'+parameter,
				  type: 'peq_touch_freq',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(peq_touch_instance);

				// set input text
				var text = input;
				
				if(text>999){
					text = formatNumber(text);
				}
				
				var peq_text = new fabric.Textbox(String(text), {
					id: 'peq_freq_'+ parameter +'_text',
					name: 'peq_freq_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 100,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(peq_text);
				
				var peq_text2 = new fabric.Textbox(String(text), {
					id: 'peq_freq_'+ parameter +'_text2',
					name: 'peq_freq_'+parameter+'_text2',
					parameter: parameter,
					left: text_left+37,
					top: text_top+434,
					width: 100,
					fontSize: 20,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(peq_text2);
			}
			if(type=='q'){
				
				var name = data_array[x]['name'];
				var parameter = data_array[x]['parameter'];
				var indicator_left = data_array[x]['indicator_left'];
				var indicator_top = data_array[x]['indicator_top'];
				var text_left = data_array[x]['text_left'];
				var text_top = data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+channel+'_q').value;
				var angle = -150+(input*15);

				// set peq_indicator_element
				var peq_indicator_element = document.getElementById('peq_indicator_q_'+parameter);
				var peq_indicator_instance = new fabric.Image(peq_indicator_element, { 
				  id: 'peq_indicator_q_'+parameter,
				  name: 'peq_indicator_q_'+parameter,
				  type: 'peq_indicator_q',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(peq_indicator_instance);

				// set peq_touch_element
				var peq_touch_element = document.getElementById('peq_touch_q_'+parameter);
				var peq_touch_instance = new fabric.Image(peq_touch_element, {
				  id: 'peq_touch_q_'+parameter,
				  name: 'peq_touch_q_'+parameter,
				  type: 'peq_touch_q',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(peq_touch_instance);

				// set input text
				var text = input;
				
				var peq_text = new fabric.Textbox(String(text), {
					id: 'peq_q_'+ parameter +'_text',
					name: 'peq_q_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(peq_text);
			}
		}
	
        // draw chart gridlines and labels
        var min_f = Math.log10(20);
        var max_f = Math.log10(20000);
        var range = max_f - min_f;
        var width_px = 1305; // width of the data in the chart

        // draw grid lines
		// 20 dB line
        canvas.add(new fabric.Line([0, 0, 1386, 0], {
            left: 17,
            top: 115,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));
		// 10 dB line
		 canvas.add(new fabric.Line([0, 0, 1386, 0], {
            left: 17,
            top: 163,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));
		// 0 dB line
        canvas.add(new fabric.Line([0, 0, 1386, 0], {
            left: 17,
            top: 210,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));
		// -10 dB line
		 canvas.add(new fabric.Line([0, 0, 1386, 0], {
            left: 17,
            top: 258,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));
		// -20 dB line
        canvas.add(new fabric.Line([0, 0, 1386, 0], {
            left: 17,
            top: 307,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));
		// text_12db
        canvas.add(new fabric.Textbox(String('20 dB'), {
            id: 'text_12db',
            name: 'text_12db',
            left: -17,
            top: 107,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        }));
		// text_10db
        canvas.add(new fabric.Textbox(String('10 dB'), {
            id: 'text_10db',
            name: 'text_10db',
            left: -17,
            top: 156,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        }));
		// text_0db
        canvas.add(new fabric.Textbox(String('0 dB'), {
            id: 'text_0db',
            name: 'text_0db',
            left: -17,
            top: 205,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        }));
		// text_10db2
        canvas.add(new fabric.Textbox(String('-10 dB'), {
            id: 'text_10db2',
            name: 'text_10db2',
            left: -17,
            top: 252,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        }));
		// text_12db2
        canvas.add(new fabric.Textbox(String('-20 dB'), {
            id: 'text_12db2',
            name: 'text_12db2',
            left: -17,
            top: 300,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        }));

        var position_px_20 = (Math.log10(20) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_20+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text20
        var text20 = new fabric.Textbox(String('20 Hz'), {
            id: 'text20',
            name: 'text20',
            left: position_px_20+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text20);

        var position_px_50 = (Math.log10(50) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_50+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text50
        var text50 = new fabric.Textbox(String('50 Hz'), {
            id: 'text50',
            name: 'text50',
            left: position_px_50-+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text50);

        var position_px_100 = (Math.log10(100) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_100+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text100
        var text100 = new fabric.Textbox(String('100 Hz'), {
            id: 'text100',
            name: 'text100',
            left: position_px_100+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text100);

        var position_px_500 = (Math.log10(500) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_500+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text500
        var text500 = new fabric.Textbox(String('500 Hz'), {
            id: 'text400',
            name: 'text400',
            left: position_px_500+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text500);

        var position_px_1000 = (Math.log10(1000) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_1000+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text1000
        var text1000 = new fabric.Textbox(String('1 kHz'), {
            id: 'text1000',
            name: 'text1000',
            left: position_px_1000+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text1000);

        var position_px_5000 = (Math.log10(5000) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_5000+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text5000
        var text5000 = new fabric.Textbox(String('5 kHz'), {
            id: 'text4000',
            name: 'text4000',
            left: position_px_5000+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text5000);

        var position_px_10000 = (Math.log10(10000) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_10000+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text10000
        var text10000 = new fabric.Textbox(String('10 kHz'), {
            id: 'text10000',
            name: 'text10000',
            left: position_px_10000+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text10000);

        var position_px_20000 = (Math.log10(20000) - min_f) / range * width_px;
        canvas.add(new fabric.Line([0, 100, 0, 368], {
            left: position_px_20000+50,
            top: 74,
            stroke: 'rgba(0, 0, 0, 0.2)',
            editable: false,
            selectable: false,
            hasControls: false,
        }));

        // text20000
        var text20000 = new fabric.Textbox(String('20 kHz'), {
            id: 'text20000',
            name: 'text20000',
            left: position_px_20000+1,
            top: 320,
            width: 100,
            fontSize: 14,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'normal',
            fill: 'rgba(0,0,0,0.8)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(text20000);
		
		get_chart_data(channel);
	}
	
	function get_geq_view(channel){
		
		document.getElementById('router_view').value = 'geq';
		document.getElementById('channel').value = channel;
		
		var json_type = document.getElementById('json_type').value;
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		
		if(json_type=='Mixer'){
			if(channel==6){
			   input_output = 'Input  5';
			}
		}	
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		
		var full_label =  label + ' ('+input_output+')';
			
		canvas.clear();
		
		canvas.setHeight(664);
		canvas.setWidth(2074);
		
		// set Zoom level
		canvas.setZoom(0.7);
			
		// set bar background
		var geqbarElement = document.getElementById('geq_bar');
		var geqbarInstance = new fabric.Image(geqbarElement, {
		  id: 'geq_bar',
		  name: 'geq_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(geqbarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Graphic EQ - '+full_label), {
			id: 'geq_channel_text',
			name: 'geq_channel_text',
			left: 18,
			top: 11,
			width: 800,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var geq_close_buttonElement = document.getElementById('geq_close_button');
		var geq_close_buttonInstance = new fabric.Image(geq_close_buttonElement, {
		  id: 'geq_close_button',
		  name: 'geq_close_button',
		  left: 2020,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(geq_close_buttonInstance);
		
		// add reset_button
		var geq_reset_buttonElement = document.getElementById('geq_reset_button');
		var geq_reset_buttonInstance = new fabric.Image(geq_reset_buttonElement, {
		  id: 'geq_reset_button',
		  name: 'geq_reset_button',
		  type: 'geq_reset_button',
		  channel: channel,
		  left: 1960,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(geq_reset_buttonInstance);
		
		// signal light
		var signal = document.getElementById('Signal_signal_present'+channel).value;
		if(signal==1){
			set_signal_led_rect(channel,66,1891);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,1891);
		}
		
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,1891);
		set_yellow_led_rect2(channel,input_level_top,1891);
		set_green_led_rect2(channel,input_level_top,1891); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,2013);
		set_yellow_led_rect(channel,output_level_top,2013);
		set_green_led_rect(channel,output_level_top,2013); 
		
		for(var x=0;x<geq_data_array.length;x++){
			
			var type = geq_data_array[x]['type'];
			if(type=='fader'){
				var name = geq_data_array[x]['name'];
				var parameter = geq_data_array[x]['parameter'];
			  	var left = geq_data_array[x]['left'];
				var top = geq_data_array[x]['top'];
				
				var fader = document.getElementById(parameter+channel+'_fader');
				var top_fader = get_geq_top_from_volume(fader.value);
				
				// set faders
				var geq_fader_element = document.getElementById(name);
				var geq_fader_instance = new fabric.Image(geq_fader_element, {
				  id: name,
				  name: name,
				  parameter: parameter,
				  channel: channel,
				  type: 'geq_fader',
				  left: left,
				  top: top_fader,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(geq_fader_instance);
			}
			if(type=='enabled'){
				
				var name = geq_data_array[x]['name'];
				var parameter = geq_data_array[x]['parameter'];
			  	var left = geq_data_array[x]['left'];
				var top = geq_data_array[x]['top'];
				
				var enable = document.getElementById(parameter+channel+'_enable').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('geq_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'geq_'+parameter+'_off',
				  name: 'geq_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'geq_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('geq_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'geq_'+parameter+'_on',
				  name: 'geq_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'geq_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
		}
	}
	
	function get_compressor_view(channel){
			
		document.getElementById('router_view').value = 'compressor';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output = 'Input '+channel;
		var label = document.getElementById('label'+channel).value;
		if(json_type=='Mixer'){
			if(channel==6){
			   input_output = 'Input 5';
			}
		}
		if(json_type=='nqga20'){
			input_output = 'Input';
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		if(json_type=='nqga40'){
			if(channel==2){
			   input_output = 'Line & AMP Output';
			}
		}
		
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(1024);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var compressorbarElement = document.getElementById('compressor_bar');
		var compressorbarInstance = new fabric.Image(compressorbarElement, {
		  id: 'compressor_bar',
		  name: 'compressor_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(compressorbarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Compressor - '+full_label), {
			id: 'compressor_channel_text',
			name: 'compressor_channel_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var compressor_close_buttonElement = document.getElementById('compressor_close_button');
		var compressor_close_buttonInstance = new fabric.Image(compressor_close_buttonElement, {
		  id: 'compressor_close_button',
		  name: 'compressor_close_button',
		  left: 970,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(compressor_close_buttonInstance);
		
		// add reset_button
		var compressor_reset_buttonElement = document.getElementById('compressor_reset_button');
		var compressor_reset_buttonInstance = new fabric.Image(compressor_reset_buttonElement, {
		  id: 'compressor_reset_button',
		  name: 'compressor_reset_button',
		  type: 'compressor_reset_button',
		  channel: channel,
		  left: 910,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(compressor_reset_buttonInstance);
		
		// comp light
		var comp = document.getElementById('comp'+channel).value;
		if(comp>0){
			set_compression_led_rect(channel,81,963);
		}
		
		// set input level
		var input_level = document.getElementById('comp_level_in'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect(channel,input_level_top,841);
		set_yellow_led_rect(channel,input_level_top,841);
		set_green_led_rect(channel,input_level_top,841); 
		
		// set output level
		var output_level = document.getElementById('comp_level_out'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect2(channel,output_level_top,963);
		set_yellow_led_rect2(channel,output_level_top,963);
		set_green_led_rect2(channel,output_level_top,963);
						
		for(var x=0;x<compressor_data_array.length;x++){
			
			var type = compressor_data_array[x]['type'];
	
			if(type=='enabled'){
				
				var name = compressor_data_array[x]['name'];
				var parameter = compressor_data_array[x]['parameter'];
			  	var left = compressor_data_array[x]['left'];
				var top = compressor_data_array[x]['top'];
				var enable = document.getElementById(parameter+'_compressor'+channel).value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('compressor_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'compressor_'+parameter+'_off',
				  name: 'compressor_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'compressor_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('compressor_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'compressor_'+parameter+'_on',
				  name: 'compressor_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'compressor_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = compressor_data_array[x]['name'];
				var parameter = compressor_data_array[x]['parameter'];
				var indicator_left = compressor_data_array[x]['indicator_left'];
				var indicator_top = compressor_data_array[x]['indicator_top'];
				var text_left = compressor_data_array[x]['text_left'];
				var text_top = compressor_data_array[x]['text_top'];
				var input = document.getElementById(parameter+'_compressor'+channel).value;
				
				var angle = 0;
				if(parameter=='Threshold'){
				   if(json_type=='nqga20'){
					  	angle = -150+((parseInt(input)+90)*3.125);
					} else {
						angle = -150+((parseInt(input)+135)*1.92);
					}
				}
				if(parameter=='Attack'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Hold'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Decay'){
				   angle = -150+(input*0.15);
				}
				if(parameter=='Knee'){
				   angle = -150+(input*3);
				}
				if(parameter=='Ratio'){
				   angle = -150+(input*3);
				}
					 
				// set indicator_element
				var compressor_indicator_element = document.getElementById('compressor_indicator_'+parameter);
				var compressor_indicator_instance = new fabric.Image(compressor_indicator_element, { 
				  id: 'compressor_indicator_'+parameter,
				  name: 'compressor_indicator_'+parameter,
				  type: 'compressor_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(compressor_indicator_instance);

				// set touch_element
				var compressor_touch_element = document.getElementById('compressor_touch_'+parameter);
				var compressor_touch_instance = new fabric.Image(compressor_touch_element, {
				  id: 'compressor_touch_'+parameter,
				  name: 'compressor_touch_'+parameter,
				  type: 'compressor_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(compressor_touch_instance);
				
				// set input text
				var text = input;

				var compressor_text = new fabric.Textbox(String(text), {
					id: 'compressor_'+ parameter +'_text',
					name: 'compressor_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(compressor_text);
			}
		}
	}
	
	function get_noise_gate_view(channel){
		
		document.getElementById('router_view').value = 'noise_gate';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		
		if(json_type=='Mixer'){
			if(channel==6){
			   input_output = 'Input 5';
			}
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(824);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var noise_gatebarElement = document.getElementById('noise_gate_bar');
		var noise_gatebarInstance = new fabric.Image(noise_gatebarElement, {
		  id: 'noise_gate_bar',
		  name: 'noise_gate_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noise_gatebarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Noise Gate - '+full_label), {
			id: 'noise_gate_channel_text',
			name: 'noise_gate_channel_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var noise_gate_close_buttonElement = document.getElementById('noise_gate_close_button');
		var noise_gate_close_buttonInstance = new fabric.Image(noise_gate_close_buttonElement, {
		  id: 'noise_gate_close_button',
		  name: 'noise_gate_close_button',
		  left: 767,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noise_gate_close_buttonInstance);
		
		// add reset_button
		var noise_gate_reset_buttonElement = document.getElementById('noise_gate_reset_button');
		var noise_gate_reset_buttonInstance = new fabric.Image(noise_gate_reset_buttonElement, {
		  id: 'noise_gate_reset_button',
		  name: 'noise_gate_reset_button',
		  type: 'noise_gate_reset_button',
		  channel: channel,
		  left: 707,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(noise_gate_reset_buttonInstance);
		
		// signal light
		var signal = document.getElementById('Signal_signal_present'+channel).value;
		if(signal==1){
			set_signal_led_rect(channel,66,641);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,641);
		}
		
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,641);
		set_yellow_led_rect2(channel,input_level_top,641);
		set_green_led_rect2(channel,input_level_top,641); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,763);
		set_yellow_led_rect(channel,output_level_top,763);
		set_green_led_rect(channel,output_level_top,763); 
		
		for(var x=0;x<noise_gate_data_array.length;x++){
			
			var type = noise_gate_data_array[x]['type'];
	
			if(type=='enabled'){
				
				var name = noise_gate_data_array[x]['name'];
				var parameter = noise_gate_data_array[x]['parameter'];
			  	var left = noise_gate_data_array[x]['left'];
				var top = noise_gate_data_array[x]['top'];
					
				var enable = document.getElementById(parameter+'_noise_gate'+channel).value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('noise_gate_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'noise_gate_'+parameter+'_off',
				  name: 'noise_gate_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'noise_gate_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('noise_gate_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'noise_gate_'+parameter+'_on',
				  name: 'noise_gate_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'noise_gate_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = noise_gate_data_array[x]['name'];
				var parameter = noise_gate_data_array[x]['parameter'];
				var indicator_left = noise_gate_data_array[x]['indicator_left'];
				var indicator_top = noise_gate_data_array[x]['indicator_top'];
				var text_left = noise_gate_data_array[x]['text_left'];
				var text_top = noise_gate_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_noise_gate'+channel).value;
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+135)*1.92);
				}
				if(parameter=='Attack'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Hold'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Decay'){
				   angle = -150+(input*0.15);
				}

				// set indicator_element
				var noise_gate_indicator_element = document.getElementById('noise_gate_indicator_'+parameter);
				var noise_gate_indicator_instance = new fabric.Image(noise_gate_indicator_element, { 
				  id: 'noise_gate_indicator_'+parameter,
				  name: 'noise_gate_indicator_'+parameter,
				  type: 'noise_gate_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(noise_gate_indicator_instance);

				// set touch_element
				var noise_gate_touch_element = document.getElementById('noise_gate_touch_'+parameter);
				var noise_gate_touch_instance = new fabric.Image(noise_gate_touch_element, {
				  id: 'noise_gate_touch_'+parameter,
				  name: 'noise_gate_touch_'+parameter,
				  type: 'noise_gate_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(noise_gate_touch_instance);
				
				// set input text
				var text = input;

				var noise_gate_text = new fabric.Textbox(String(text), {
					id: 'noise_gate_'+ parameter +'_text',
					name: 'noise_gate_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(noise_gate_text);
			}
		}
	}
	
	function get_limiter_view(channel){
					
		document.getElementById('router_view').value = 'limiter';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		if(json_type=='Mixer'){
			if(channel==5){
				input_output = 'Ouput';
			}
			if(channel==6){
				input_output = 'Input 5';
			}
		}
		if(json_type=='nqpaxxx'){
			if(channel==7){
			   input_output = 'Ouput 1';
			}
			if(channel==8){
			   input_output = 'Ouput 2';
			}
		}
		if(json_type=='nqga20'){
			input_output = 'Input';
		}
		
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		if(json_type=='nqga40'){
			if(channel==1){
			   input_output = 'Line Input';
			}
			if(channel==2){
			   input_output = 'Line & AMP Output';
			}
		}
			
		var full_label =  label + ' ('+input_output+')';
				
		canvas.clear();
		
		var canvas_width = 724;
		var limiter_bar = 'limiter_bar';
		var reset_left = 610;
		var close_left = 670;
		
		if((channel==5 && json_type=='Mixer') || (channel==7 && json_type=='nqpaxxx') || (channel==8 && json_type=='nqpaxxx')){ // output only
		  	canvas_width = 602;
			limiter_bar = 'limiter_bar2';
			var reset_left = 490;
			var close_left = 550;
		 }
		
		canvas.setHeight(564);
		canvas.setWidth(canvas_width);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var limiterbarElement = document.getElementById(limiter_bar);
		var limiterbarInstance = new fabric.Image(limiterbarElement, {
		  id: 'limiter_bar',
		  name: 'limiter_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(limiterbarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Limiter - ' + full_label), {
			id: 'limiter_channel_text',
			name: 'limiter_channel_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var limiter_close_buttonElement = document.getElementById('limiter_close_button');
		var limiter_close_buttonInstance = new fabric.Image(limiter_close_buttonElement, {
		  id: 'limiter_close_button',
		  name: 'limiter_close_button',
		  left: close_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(limiter_close_buttonInstance);
		
		// add reset_button
		var limiter_reset_buttonElement = document.getElementById('limiter_reset_button');
		var limiter_reset_buttonInstance = new fabric.Image(limiter_reset_buttonElement, {
		  id: 'limiter_reset_button',
		  name: 'limiter_reset_button',
		  type: 'limiter_reset_button',
		  channel: channel,
		  left: reset_left,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(limiter_reset_buttonInstance);
		// signal light
		var signal = document.getElementById('Signal_signal_present'+channel).value;
		if(signal==1){
			set_signal_led_rect(channel,66,541);
		}
		// limiting light
		var limiting = document.getElementById('Limiter_limiting'+channel).value;
		if(limiting==1){
			set_limiter_led_rect(channel,81,541);
		}
		if((channel==5 && json_type=='Mixer') || (channel==7 && json_type=='nqpaxxx') || (channel==8 && json_type=='nqpaxxx')){
			// set output level
			var output_level = document.getElementById('level'+channel).value;
			var output_level_top = get_led_top_from_volume(output_level);
			set_red_led_rect(channel,output_level_top,541);
			set_yellow_led_rect(channel,output_level_top,541);
			set_green_led_rect(channel,output_level_top,541); 
		} else {
			// set input level
			var input_level = document.getElementById('levelIn'+channel).value;
			var input_level_top = get_led_top_from_volume(input_level);
			set_red_led_rect2(channel,input_level_top,541);
			set_yellow_led_rect2(channel,input_level_top,541);
			set_green_led_rect2(channel,input_level_top,541);
			
			// set output level
			var output_level = document.getElementById('level'+channel).value;
			var output_level_top = get_led_top_from_volume(output_level);
			set_red_led_rect(channel,output_level_top,663);
			set_yellow_led_rect(channel,output_level_top,663);
			set_green_led_rect(channel,output_level_top,663); 
		}
		for(var x=0;x<limiter_data_array.length;x++){
			
			var type = limiter_data_array[x]['type'];
			
			if(type=='knob'){
				
				var name = limiter_data_array[x]['name'];
				var parameter = limiter_data_array[x]['parameter'];
				var indicator_left = limiter_data_array[x]['indicator_left'];
				var indicator_top = limiter_data_array[x]['indicator_top'];
				var text_left = limiter_data_array[x]['text_left'];
				var text_top = limiter_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_limiter'+channel).value;
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+24)*6.25);
				}
				if(parameter=='Decay'){
				   angle = -150+((parseInt(input)-5)*16.667);
				}
				if(parameter=='RMSTC'){
				   angle = -150+(input*0.03);
				}

				// set indicator_element
				var limiter_indicator_element = document.getElementById('limiter_indicator_'+parameter);
				var limiter_indicator_instance = new fabric.Image(limiter_indicator_element, { 
				  id: 'limiter_indicator_'+parameter,
				  name: 'limiter_indicator_'+parameter,
				  type: 'limiter_indicator_',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(limiter_indicator_instance);

				// set touch_element
				var limiter_touch_element = document.getElementById('limiter_touch_'+parameter);
				var limiter_touch_instance = new fabric.Image(limiter_touch_element, {
				  id: 'limiter_touch_'+parameter,
				  name: 'limiter_touch_'+parameter,
				  type: 'limiter_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(limiter_touch_instance);
				
				// set input text
				var text = input;

				var limiter_text = new fabric.Textbox(String(text), {
					id: 'limiter_'+ parameter +'_text',
					name: 'limiter_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(limiter_text);
			}
		}
	}
	
	function get_signal_present_view(channel){
		
		document.getElementById('router_view').value = 'signal_present';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		if(json_type=='Mixer'){
			if(channel==5){
				input_output = 'Ouput';
			}
			if(channel==6){
				input_output = 'Input 5';
			}
		}
		if(json_type=='nqga20'){
			input_output = 'Input';
		}
		if(json_type=='nqpaxxx'){
			if(channel==7){
			   input_output = 'Ouput 1';
			}
			if(channel==8){
			   input_output = 'Ouput 2';
			}
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || 'ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		if(json_type=='nqga400p'){
			if(channel==3){
			   input_output = 'Ouput 1';
			}
			if(channel==4){
			   input_output = 'Ouput 2';
			}
		}
		if(json_type=='nqga40'){
			if(channel==1){
			   input_output = 'Line Input';
			}
			if(channel==2){
			   input_output = 'Line & AMP Output';
			}
		}
	
		var label2 = input_output;
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(602);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var bar_edit = '';
		
		if(json_type=='nqga400p'){
		   bar_edit = '_no_clip';
		}
		
		// set bar background
		var signalpresentbarElement = document.getElementById('signal_present_bar' + bar_edit);
		var signalpresentbarInstance = new fabric.Image(signalpresentbarElement, {
		  id: 'signal_present_bar',
		  name: 'signal_present_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(signalpresentbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Signal Present - '), {
			id: 'signal_present_header_text',
			name: 'signal_present_header_text',
			left: 18,
			top: 11,
			width: 600,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		var header_text2 = new fabric.Textbox(String(label ), {
			id: 'outputs_header_text2',
			name: 'outputs_header_text2',
			left: 240,
			top: 4,
			width: 600,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text2);
		
		var header_text3 = new fabric.Textbox(String('('+label2+')' ), {
			id: 'outputs_header_text3',
			name: 'outputs_header_text3',
			left: 240,
			top: 27,
			width: 600,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text3);
			
		// add close_button
		var signal_present_close_buttonElement = document.getElementById('signal_present_close_button');
		var signal_present_close_buttonInstance = new fabric.Image(signal_present_close_buttonElement, {
		  id: 'signal_present_close_button',
		  name: 'signal_present_close_button',
		  left: 552,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(signal_present_close_buttonInstance);
		
		// add reset_button
		var signal_present_reset_buttonElement = document.getElementById('signal_present_reset_button');
		var signal_present_reset_buttonInstance = new fabric.Image(signal_present_reset_buttonElement, {
		  id: 'signal_present_reset_button',
		  name: 'signal_present_reset_button',
		  type: 'signal_present_reset_button',
		  channel: channel,
		  left: 492,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(signal_present_reset_buttonInstance);
		
		// signal present light
		var signal_present = document.getElementById('Signal_signal_present'+channel).value;	
		if(signal_present==1){
			set_signal_led_rect(channel,66,541);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,541);
		}
		
		if((channel==5 && json_type=='Mixer') || (channel==7 && json_type=='nqpaxxx') || (channel==8 && json_type=='nqpaxxx')){
		   // set output level
			var output_level = document.getElementById('level'+channel).value;
			var output_level_top = get_led_top_from_volume(output_level);
			set_red_led_rect(channel,output_level_top,541);
			set_yellow_led_rect(channel,output_level_top,541);
			set_green_led_rect(channel,output_level_top,541); 
		 } else {		 
			// set input level
			var input_level = document.getElementById('levelIn'+channel).value;
			var input_level_top = get_led_top_from_volume(input_level);
			set_red_led_rect2(channel,input_level_top,541);
			set_yellow_led_rect2(channel,input_level_top,541);
			set_green_led_rect2(channel,input_level_top,541); 
		 }
		for(var x=0;x<signal_present_data_array.length;x++){
			
			var type = signal_present_data_array[x]['type'];
			
			if(type=='knob'){
				
				var name = signal_present_data_array[x]['name'];
				var parameter = signal_present_data_array[x]['parameter'];
				var indicator_left = signal_present_data_array[x]['indicator_left'];
				var indicator_top = signal_present_data_array[x]['indicator_top'];
				var text_left = signal_present_data_array[x]['text_left'];
				var text_top = signal_present_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_signal_present'+channel).value;
				
				var angle = 0;	
				if(parameter=='Threshold'){
					angle = -150+((parseInt(input)+144)*1.786); // Min:-144 Max:24
				}
				if(parameter=='Trigger'){
					angle = -150+(input*1.5); // Min:2 Max 200
				}
		
				// set indicator_element
				var signal_present_indicator_element = document.getElementById('signal_present_indicator_'+parameter);
				var limiter_indicator_instance = new fabric.Image(signal_present_indicator_element, { 
				  id: 'signal_present_indicator_'+ parameter,
				  name: 'signal_present_indicator_'+ parameter,
				  type: 'signal_present_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(limiter_indicator_instance);

				// set touch_element
				var signal_present_touch_element = document.getElementById('signal_present_touch_'+parameter);
				var signal_present_touch_instance = new fabric.Image(signal_present_touch_element, {
				  id: 'signal_present_touch_'+parameter,
				  name: 'signal_present_touch_'+parameter,
				  type: 'signal_present_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(signal_present_touch_instance);

				// set input text
				var text = input;

				var signal_present_text = new fabric.Textbox(String(text), {
					id: 'signal_present_'+ parameter +'_text',
					name: 'signal_present_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(signal_present_text);
			}
		}
	}
	
	function get_ducker_view(channel){
		
		var json_type = document.getElementById('json_type').value;
		document.getElementById('router_view').value = 'ducker';
		
		if(json_type=='Mixer'){
		   	document.getElementById('channel').value = 5;
			channel = 5;
		}
		
		canvas.clear();
		
		if(json_type=='nqpaxxx'){
		   	canvas.setHeight(564);
			canvas.setWidth(723);
		} else {
			canvas.setHeight(564);
			canvas.setWidth(602);
		}
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var ducker_bar;
		if(json_type=='nqpaxxx'){
		   ducker_bar = 'ducker_bar2';
		 } else {
			ducker_bar = 'ducker_bar'; 
		 }
		
		// set level bar background
		var duckerbarElement = document.getElementById(ducker_bar);
		var duckerbarInstance = new fabric.Image(duckerbarElement, {
		  id: 'ducker_bar',
		  name: 'ducker_bar',
		  type: 'ducker_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(duckerbarInstance);
			
		// set header text
		var header_text = new fabric.Textbox(String('Ducker'), {
			id: 'ducker_header_text',
			name: 'ducker_header_text',
			left: 18,
			top: 11,
			width: 600,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		var left1;
		var left2;
		if(json_type=='nqpaxxx'){
		   	left1=672;
			left2=612;
		 } else {
			left1=552; 
			left2=492; 
		 }
			
		// add close_button
		var ducker_close_buttonElement = document.getElementById('ducker_close_button');
		var ducker_close_buttonInstance = new fabric.Image(ducker_close_buttonElement, {
		  id: 'ducker_close_button',
		  name: 'ducker_close_button',
		  left: left1,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ducker_close_buttonInstance);
		
		// add reset_button
		var ducker_reset_buttonElement = document.getElementById('ducker_reset_button');
		var ducker_reset_buttonInstance = new fabric.Image(ducker_reset_buttonElement, {
		  id: 'ducker_reset_button',
		  name: 'ducker_reset_button',
		  type: 'ducker_reset_button',
		  left: left2,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(ducker_reset_buttonInstance);
		
		if(json_type=='Mixer'){
			// signal light
            var signal = document.getElementById('Signal_signal_present'+channel).value;
            if(signal==1){
                set_signal_led_rect(channel,66,540);
            }

            // clip light
            var clip = document.getElementById('Clip'+channel+'_enabled').value;
            if(clip==1){
                set_clip_led_rect(channel,81,541);
            }

            // set level
            var level = document.getElementById('level'+channel).value;
            var level_top = get_led_top_from_volume(level);
            set_red_led_rect(channel,level_top,541);
            set_yellow_led_rect(channel,level_top,541);
            set_green_led_rect(channel,level_top,541); 
		 }
		
		if(json_type=='nqpaxxx'){
			// signal light7
            var signal7 = document.getElementById('Signal_signal_present7').value;
            if(signal7==1){
                set_signal_led_rect(7,66,540);
            }

            // clip light7
            var clip7 = document.getElementById('Clip7_enabled').value;
            if(clip7==1){
                set_clip_led_rect(7,81,541);
            }

            // set level7
            var level7 = document.getElementById('level7').value;
            var level_top7 = get_led_top_from_volume(level7);
            set_red_led_rect(7,level_top7,541);
            set_yellow_led_rect(7,level_top7,541);
            set_green_led_rect(7,level_top7,541); 
			
			// signal light8
            var signal8 = document.getElementById('Signal_signal_present8').value;
            if(signal8==1){
                set_signal_led_rect(8,66,663);
            }

            // clip light8
            var clip8 = document.getElementById('Clip8_enabled').value;
            if(clip8==1){
                set_clip_led_rect(8,81,663);
            }

            // set level8
            var level8 = document.getElementById('level8').value;
            var level_top8 = get_led_top_from_volume(level8);
            set_red_led_rect(8,level_top8,663);
            set_yellow_led_rect(8,level_top8,663);
            set_green_led_rect(8,level_top8,663); 
		 }
				
		for(var x=0;x<ducker_data_array.length;x++){
			
			var type = ducker_data_array[x]['type'];
			
			if(type=='enabled'){
				
				var name = ducker_data_array[x]['name'];
				var parameter = ducker_data_array[x]['parameter'];
			  	var left = ducker_data_array[x]['left'];
				var top = ducker_data_array[x]['top'];
					
				var enable = document.getElementById(parameter+'_ducker').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('ducker_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'ducker_'+parameter+'_off',
				  name: 'ducker_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'ducker_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('ducker_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'ducker_'+parameter+'_on',
				  name: 'ducker_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'ducker_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = ducker_data_array[x]['name'];
				var parameter = ducker_data_array[x]['parameter'];
				var indicator_left = ducker_data_array[x]['indicator_left'];
				var indicator_top = ducker_data_array[x]['indicator_top'];
				var text_left = ducker_data_array[x]['text_left'];
				var text_top = ducker_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_ducker').value;
				
				var angle = 0;	
				if(parameter=='Threshold'){
					angle = -150+((parseInt(input)+135)*1.935); // Min:-135 Max:20
				}
				if(parameter=='Hold'){
				   angle = -150+(input*0.6) // Min: 1 Max:500
				}
		
				// set indicator_element
				var ducker_indicator_element = document.getElementById('ducker_indicator_'+parameter);
				var ducker_indicator_instance = new fabric.Image(ducker_indicator_element, { 
				  id: 'ducker_indicator_'+ parameter,
				  name: 'ducker_indicator_'+ parameter,
				  type: 'ducker_indicator_',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(ducker_indicator_instance);

				// set touch_element
				var ducker_touch_element = document.getElementById('ducker_touch_'+parameter);
				var ducker_touch_instance = new fabric.Image(ducker_touch_element, {
				  id: 'ducker_touch_'+parameter,
				  name: 'ducker_touch_'+parameter,
				  type: 'ducker_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(ducker_touch_instance);

				// set input text
				var text = input;

				var ducker_text = new fabric.Textbox(String(text), {
					id: 'ducker_'+ parameter +'_text',
					name: 'ducker_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(ducker_text);
			}
		}
		
		if(json_type=='nqpaxxx'){
			
			var label7 = document.getElementById('label7').value;
			
		   var line_out_text = new fabric.Textbox(String(label7), {
                id: 'line_out_text',
                name: 'line_out_text',
                left: 477,
                top: 520,
                width: 123,
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(line_out_text);
			
			var label8 = document.getElementById('label8').value;

            var speaker_out_text = new fabric.Textbox(String(label8), {
                id: 'speaker_out_text',
                name: 'speaker_out_text',
                left: 600,
                top: 520,
                width: 123,
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(speaker_out_text);
		}
	}
	
	function get_hplp_view(channel){
		
		document.getElementById('router_view').value = 'hplp';
		document.getElementById('channel').value = channel;
		
		var json_type = document.getElementById('json_type').value;
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		if(json_type=='Mixer'){
			if(channel==6){
			   input_output = 'Input 5';
			}
		}
		if(json_type=='nqga20'){
			input_output = 'Input';
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		if(json_type=='nqga400p'){
			if(channel==3){
			   input_output = 'Ouput 1';
			}
			if(channel==4){
			   input_output = 'Ouput 2';
			}
		}
		if(json_type=='nqga40'){
			if(channel==1){
			   input_output = 'Line Input';
			}
			if(channel==2){
			   input_output = 'Line & AMP Output';
			}
		}
		
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(824);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var bar_edit = '';
		
		if(json_type=='nqga400p'){
		   bar_edit = '_no_clip';
		}
		
		// set level bar background
		var hplpbarElement = document.getElementById('hplp_bar' + bar_edit);
		var hplpbarInstance = new fabric.Image(hplpbarElement, {
		  id: 'hplp_bar',
		  name: 'hplp_bar',
		  type: 'hplp_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(hplpbarInstance);
			
		// set header text
		var header_text = new fabric.Textbox(String('High/Low Pass - '+full_label), {
			id: 'ducker_header_text',
			name: 'ducker_header_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		reset_hplp_fields();
			
		// add close_button
		var hplp_close_buttonElement = document.getElementById('hplp_close_button');
		var hplp_close_buttonInstance = new fabric.Image(hplp_close_buttonElement, {
		  id: 'hplp_close_button',
		  name: 'hplp_close_button',
		  channel: channel,
		  left: 772,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(hplp_close_buttonInstance);
		
		// add reset_button
		var hplp_reset_buttonElement = document.getElementById('hplp_reset_button');
		var hplp_reset_buttonInstance = new fabric.Image(hplp_reset_buttonElement, {
		  id: 'hplp_reset_button',
		  name: 'hplp_reset_button',
		  type: 'hplp_reset_button',
		  channel: channel,
		  left: 712,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(hplp_reset_buttonInstance);
		
		// signal light
		var signal = document.getElementById('Signal_signal_present'+channel).value;
		if(signal==1){
			set_signal_led_rect(channel,66,641);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,641);
		}
		
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,641);
		set_yellow_led_rect2(channel,input_level_top,641);
		set_green_led_rect2(channel,input_level_top,641); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,763);
		set_yellow_led_rect(channel,output_level_top,763);
		set_green_led_rect(channel,output_level_top,763); 
		
		for(var x=0;x<hplp_data_array.length;x++){
			
			var type = hplp_data_array[x]['type'];
			var type2 = hplp_data_array[x]['type2'];
	
			if(type=='enabled'){
				
				var name = hplp_data_array[x]['name'];
				var parameter = hplp_data_array[x]['parameter'];
			  	var left = hplp_data_array[x]['left'];
				var top = hplp_data_array[x]['top'];
				
				var enable = document.getElementById(name+channel+'_hplp').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('hplp_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				   id: 'hplp_'+name+'name_off',
				  name: 'hplp_'+name+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'hplp_enable_button',
				  type2: type2,
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('hplp_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'hplp_'+name+'_on',
				  name: 'hplp_'+name+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'hplp_enable_button',
				  type2: type2,
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = hplp_data_array[x]['name'];
				var parameter = hplp_data_array[x]['parameter'];
				var indicator_left = hplp_data_array[x]['indicator_left'];
				var indicator_top = hplp_data_array[x]['indicator_top'];
				var text_left = hplp_data_array[x]['text_left'];
				var text_top = hplp_data_array[x]['text_top'];
				
				var input = document.getElementById(name+channel+'_hplp').value;
				var angle = 0;
				
				if(parameter=='Frequency'){
				   // angle = -150+(input*0.015);
					
					if(input>=20 && input<=100){
					   angle = -150+((parseInt(input)-20)*1.25); // Min:20 Max:100
					}
					if(input>100 && input<=1000){
						angle = -50+((parseInt(input)-100)*.1111); // Min:100 Max:1000
					}
					if(input>1000 && input<=20000){
						angle = 50+((parseInt(input)-1000)*.005263); // Min:1000 Max:20,000
					}
					
					// set indicator_element
                    var hplp_indicator_element = document.getElementById('hplp_indicator_'+parameter);
                    var hplp_indicator_instance = new fabric.Image(hplp_indicator_element, { 
                      id: 'hplp_indicator_'+name,
                      name: 'hplp_indicator_'+name,
                      type: 'hplp_indicator',
                      type2: type2,
                      left: indicator_left,
                      top: indicator_top,
                      angle: angle,
                      opacity: 1.0,	
                      selectable: false,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                    });
                    canvas.add(hplp_indicator_instance);

                    // set touch_element
                    var hplp_touch_element = document.getElementById('hplp_touch_'+parameter);
                    var hplp_touch_instance = new fabric.Image(hplp_touch_element, {
                      id: 'hplp_touch_'+name,
                      name: 'hplp_touch_'+name,
                      type: 'hplp_touch',
                      type2: type2,
                      parameter: parameter,
                      left: indicator_left,
                      top: indicator_top,
                      angle: 0,
                      opacity: 1.0,	
                      selectable: true,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                      borderColor: 'rgba(0,0,0,0.0)',
                      cornerColor: 'rgba(0,0,0,0.0)',
                    });
                    canvas.add(hplp_touch_instance);

                    // set input text
                    var text = input;

                    // remove "_" from type names
                    text = text.split("_").join(" ");

                    // reformat
                    var formatted_text=text;

                    if(text>999){
                        formatted_text = formatNumber(text);
                    }
                    if(parameter=='Frequency'){
                        formatted_text = formatted_text + ' Hz';
                    }

                    var hplp_text = new fabric.Textbox(String(formatted_text), {
                        id: 'hplp_'+ name +'_text',
                        name: 'hplp_'+name+'_text',
                        parameter: parameter,
                        left: text_left,
                        top: text_top,
                        width: 300,
                        fontSize: 15,
                        selectable: false,
                        hasControls: false,
                        fontFamily: 'Arial',
                        fill: 'rgba(255,255,255,1.0)',
                        textAlign: 'center',
                        editable: false,
                    });
                    canvas.add(hplp_text);
				}
			}
		}
	}
	
	function get_settings_view(){
		
		document.getElementById('router_view').value = 'settings';
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		canvas.clear();
		
		canvas.setHeight(714);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var settingsbarElement = document.getElementById('settings_bar');
		var settingsbarInstance = new fabric.Image(settingsbarElement, {
		  id: 'settings_bar',
		  name: 'settings_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(settingsbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Settings'), {
			id: 'settings_text',
			name: 'settings_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var settings_close_buttonElement = document.getElementById('settings_close_button');
		var settings_close_buttonInstance = new fabric.Image(settings_close_buttonElement, {
		  id: 'settings_close_button',
		  name: 'settings_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(settings_close_buttonInstance);
		
		// add reset_button
		var settings_reset_buttonElement = document.getElementById('settings_reset_button');
		var settings_reset_buttonInstance = new fabric.Image(settings_reset_buttonElement, {
		  id: 'settings_reset_button',
		  name: 'settingsreset_button',
		  type: 'settings_reset_button',
		  left: 588,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(settings_reset_buttonInstance);
		
		// input field placement
		document.getElementById('name1_input').type = 'text';
		document.getElementById('name2_input').type = 'text';
		document.getElementById('name3_input').type = 'text';
		document.getElementById('name4_input').type = 'text';
		document.getElementById('name5_input').type = 'text';
		document.getElementById('name6_input').type = 'text';
		document.getElementById('name7_input').type = 'text';
		document.getElementById('name8_input').type = 'text';
			
		reset_fields();
		
		var label1;
		var label2;
		var label3;
		var label4;
		var label5;
		var label6;
		var label7;
		var label8;
		
		if(json_type=='Mixer'){
		   	label1 = 'Input 1';
			label2 = 'Input 2';
			label3 = 'Input 3';
			label4 = 'Input 4';
			label5 = 'Output';
			label6 = 'Input 5';
		}
		if(json_type=='ampg1_2c'){
		   	label1 = 'Ch A';
			label2 = 'Ch B';
		}
		if(json_type=='ampg1_4c'){
		   	label1 = 'Ch A';
			label2 = 'Ch B';
			label3 = 'Ch C';
			label4 = 'CH D';
		}
		if(json_type=='nqga20'){
		   	label1 = 'Input';
		}
		if(json_type=='nqpaxxx'){
		   	label1 = 'Input 1';
			label2 = 'Input 2';
			label3 = 'Input 3';
			label4 = 'Input 4';
			label5 = 'Input 5';
			label6 = 'Input 6';
			label7 = 'Output 1';
			label8 = 'Output 2';
		}
		if(json_type=='ampg2_2c'){
		   	label1 = 'Ch A';
			label2 = 'Ch B';
		}
		if(json_type=='ampg2_4c'){
		   	label1 = 'Ch A';
			label2 = 'Ch B';
			label3 = 'Ch C';
			label4 = 'Ch D';
		}
		if(json_type=='nqga400p'){
		   	label1 = 'Input 1';
			label2 = 'Input 2';
			label3 = 'Output 1';
			label4 = 'Output 2';
		}
		if(json_type=='nqga40'){
		   	label1 = 'Input';
			label2 = 'Output';
		}
		if(json_type=='nq-dsc01'){
		   	label1 = 'Input';
			label2 = 'Output';
		}
		
		// name header text
		var name_text = new fabric.Textbox(String('Name'), {
			id: 'name_text',
			name: 'name_text',
			left: 230,
			top: 80,
			width: 400,
			fontSize: 20,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(name_text);
		
		// color header text
		var color_text = new fabric.Textbox(String('Color'), {
			id: 'color_text',
			name: 'color_text',
			left: 450,
			top: 80,
			width: 400,
			fontSize: 20,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(color_text);
		
		// name1 text
		var name1_text = new fabric.Textbox(String(label1+':'), {
			id: 'name1_text',
			name: 'name1_text',
			left: 50,
			top: 123,
			width: 400,
			fontSize: 20,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(name1_text);
		
		if((IsDualChannel==1 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')) || json_type=='Mixer' || json_type=='nqpaxxx' || json_type=='nqga400p' || json_type=='nqga40' || json_type=='nq-dsc01'){
		   // name2 text
			var name2_text = new fabric.Textbox(String(label2+':'), {
				id: 'name2_text',
				name: 'name2_text',
				left: 50,
				top: 197,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name2_text);
		}
		
		var name3_top = 267;
		if(IsDualChannel==0 && (json_type=='ampg1_4c' || json_type=='ampg2_4c')){
		   name3_top = name3_top -70;
		 }
		
		if(json_type!='nqga20' && json_type!='ampg1_2c' && json_type!='ampg2_2c' && json_type!='nqga40' && json_type!='nq-dsc01'){
		   
		   	// name3 text
            var name3_text = new fabric.Textbox(String(label3+':'), {
                id: 'name3_text',
                name: 'name3_text',
                left: 50,
                top: name3_top,
                width: 400,
                fontSize: 20,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
		canvas.add(name3_text);
			
		}

		if(json_type=='Mixer' || json_type=='nqpaxxx' || (IsDualChannel2==1 && (json_type=='ampg1_4c' || json_type=='ampg2_4c' || json_type=='nqga400p' ))){
		
			var top4 = 339;
			if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
				if(IsDualChannel==0){
				   top4 = top4-70;
				}
			}
			
			// name4 text
			var name4_text = new fabric.Textbox(String(label4+':'), {
				id: 'name4_text',
				name: 'name4_text',
				left: 50,
				top: top4,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name4_text);
			
		}
		if(json_type=='Mixer'  || json_type=='nqpaxxx'){
			
			var top5 = 410;
			if(json_type=="Mixer"){
			   top5 = 476;
			 }

			// name5 text
			var name5_text = new fabric.Textbox(String(label5+':'), {
				id: 'name5_text',
				name: 'name5_text',
				left: 50,
				top: top5,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name5_text);
		
			var top6 = 410;
			if(json_type=='nqpaxxx'){
				top6 = 480;
			}
			
			// name6 text
			var name6_text = new fabric.Textbox(String(label6+':'), {
				id: 'name6_text',
				name: 'name6_text',
				left: 50,
				top: top6,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name6_text);
		}
		
		if(json_type=='nqpaxxx'){
			
			// name7 text
			var name7_text = new fabric.Textbox(String(label7+':'), {
				id: 'name7_text',
				name: 'name7_text',
				left: 50,
				top: 550,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name7_text);
			
			// name8 text
			var name8_text = new fabric.Textbox(String(label8+':'), {
				id: 'name8_text',
				name: 'name8_text',
				left: 50,
				top: 620,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name8_text);
			
		}
	}
	
	function get_standby_view(){
		
		document.getElementById('router_view').value = 'standby';
		var json_type = document.getElementById('json_type').value;
		var standby_status = document.getElementById('standby_status').value;
		var standby_status2 = document.getElementById('standby_status2').value;
		
		var standby_status_text='';
		var standby_status_text2='';
		
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var standby_bar;
		if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		   standby_bar = 'standby_bar_2c';
		}
		if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		   standby_bar = 'standby_bar_4c';
		}
		
		// set bar background
		var standbybarElement = document.getElementById(standby_bar);
		var standbybarInstance = new fabric.Image(standbybarElement, {
		  id: 'standby_bar',
		  name: 'standby_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(standbybarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Standby'), {
			id: 'standby_text',
			name: 'standby_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		reset_standby_fields();
		
		// add close_button
		var standby_close_buttonElement = document.getElementById('standby_close_button');
		var standby_close_buttonInstance = new fabric.Image(standby_close_buttonElement, {
		  id: 'standby_close_button',
		  name: 'standby_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(standby_close_buttonInstance);
		
		// add reset_button
		var standby_reset_buttonElement = document.getElementById('standby_reset_button');
		var standby_reset_buttonInstance = new fabric.Image(standby_reset_buttonElement, {
		  id: 'standby_reset_button',
		  name: 'standby_reset_button',
		  type: 'standby_reset_button',
		  left: 588,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(standby_reset_buttonInstance);
		
		// standby title text
		var standby_title1 = new fabric.Textbox(String('Status:'), {
			id: 'standby_title1',
			name: 'standby_title1',
			left: 170,
			top: 350,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(standby_title1);
		
		if(standby_status==1){
			standby_status_text = 'On';
		} else {
			standby_status_text= 'Off';
		}
		set_standby_text1(standby_status_text, 260, 350);
		
		if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		   
			// standby title text
            var standby_title2 = new fabric.Textbox(String('Status:'), {
                id: 'standby_title2',
                name: 'standby_title2',
                left: 380,
                top: 350,
                width: 400,
                fontSize: 25,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(standby_title2);

            if(standby_status2==1){
                standby_status_text2 = 'On';
            } else {
                standby_status_text2= 'Off';
            }
            set_standby_text2(standby_status_text2, 470, 350);
		}
		
		for(var x=0;x<standby_data_array.length;x++){
			
			var type = standby_data_array[x]['type'];
	
			if(type=='enabled'){
				
				var name = standby_data_array[x]['name'];
				var parameter = standby_data_array[x]['parameter'];
			  	var left = standby_data_array[x]['left'];
				var top = standby_data_array[x]['top'];
					
				var enable = document.getElementById(parameter+'_standby').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('standby_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'standby_'+parameter+'_off',
				  name: 'standby_'+parameter+'_off',
				  parameter: parameter,
				  type: 'standby_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('standby_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'standby_'+parameter+'_on',
				  name: 'standby_'+parameter+'_on',
				  parameter: parameter,
				  type: 'standby_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = standby_data_array[x]['name'];
				var parameter = standby_data_array[x]['parameter'];
				var indicator_left = standby_data_array[x]['indicator_left'];
				var indicator_top = standby_data_array[x]['indicator_top'];
				var text_left = standby_data_array[x]['text_left'];
				var text_top = standby_data_array[x]['text_top'];
				
				var input;
				var amp;
				if(name=='standby_Threshold_ab'){
				   	input = document.getElementById(parameter+'_standby_ab').value;
					amp = 'ab';
				}
				if(name=='standby_Threshold_cd'){
				   	input = document.getElementById(parameter+'_standby_cd').value;
					amp = 'cd';
				}
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+144)*1.785);  // Min:-144 Max:24
				}
				
				if((name=='standby_Threshold_ab' && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')) || (name=='standby_Threshold_cd' && (json_type=='ampg1_4c' || json_type=='ampg2_4c'))){
				   
				   // set indicator_element
                    var standby_indicator_element = document.getElementById('standby_indicator_'+parameter);
                    var standby_indicator_instance = new fabric.Image(standby_indicator_element, { 
                      id: 'standby_indicator_'+parameter + '_' + amp,
                      name: 'standby_indicator_'+parameter + '_' + amp,
                      type: 'standby_indicator',
                      left: indicator_left,
                      top: indicator_top,
                      angle: angle,
                      opacity: 1.0,	
                      selectable: false,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                    });
                    canvas.add(standby_indicator_instance);

                    // set touch_element
                    var standby_touch_element = document.getElementById('standby_touch_'+parameter);
                    var standby_touch_instance = new fabric.Image(standby_touch_element, {
                      id: 'standby_touch_'+parameter + '_' + amp,
                      name: 'standby_touch_'+parameter + '_' + amp,
                      type: 'standby_touch',
                      parameter: parameter,
                      left: indicator_left,
                      top: indicator_top,
                      angle: 0,
                      opacity: 1.0,	
                      selectable: true,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                      borderColor: 'rgba(0,0,0,0.0)',
                      cornerColor: 'rgba(0,0,0,0.0)',
                    });
                    canvas.add(standby_touch_instance);

                    // set input text
                    var text = input;

                    var standby_text = new fabric.Textbox(String(text), {
                        id: 'standby_'+ parameter +'_text' + '_' + amp,
                        name: 'standby_'+parameter+'_text' + '_' + amp,
                        parameter: parameter,
                        left: text_left,
                        top: text_top,
                        width: 20,
                        fontSize: 15,
                        selectable: false,
                        hasControls: false,
                        fontFamily: 'Arial',
                        fill: 'rgba(255,255,255,1.0)',
                        textAlign: 'center',
                        editable: false,
                    });
                    canvas.add(standby_text);
				   
				}
				
			}
		}
		
	}
	
	function get_mute_view(){
				
		document.getElementById('router_view').value = 'mute';
		var json_type = document.getElementById('json_type').value;
		var mute_status = document.getElementById('mute_status').value;
		var mute_status2 = document.getElementById('mute_status2').value;
		var mute_status_text='';
		var mute_status_text2='';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var mute_bar;
		if(json_type=='ampg2_2c'){
		   mute_bar = 'mute_bar_2c';
		}
		if(json_type=='ampg2_4c'){
		   mute_bar = 'mute_bar_4c';
		}
			
		// set bar background
		var mutebarElement = document.getElementById(mute_bar);
		var mutebarInstance = new fabric.Image(mutebarElement, {
		  id: 'mute_bar',
		  name: 'mute_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mutebarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Amplifier Mute'), {
			id: 'mute_text',
			name: 'mute_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		reset_mute_fields();
		
		// add close_button
		var mute_close_buttonElement = document.getElementById('mute_close_button');
		var mute_close_buttonInstance = new fabric.Image(mute_close_buttonElement, {
		  id: 'mute_close_button',
		  name: 'mute_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mute_close_buttonInstance);
		
		// add reset_button
		var mute_reset_buttonElement = document.getElementById('mute_reset_button');
		var mute_reset_buttonInstance = new fabric.Image(mute_reset_buttonElement, {
		  id: 'mute_reset_button',
		  name: 'mute_reset_button',
		  type: 'mute_reset_button',
		  left: 588,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(mute_reset_buttonInstance);
		
		// mute title text
		var mute_title1 = new fabric.Textbox(String('Status:'), {
			id: 'mute_title1',
			name: 'mute_title1',
			left: 170,
			top: 350,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(mute_title1);
		
		if(mute_status==1){
			mute_status_text = 'On';
		} else {
			mute_status_text= 'Off';
		}
		set_mute_text1(mute_status_text, 260, 350);
		
		if(json_type=='ampg2_4c'){
		   
			// mute title text
            var mute_title2 = new fabric.Textbox(String('Status:'), {
                id: 'mute_title2',
                name: 'mute_title2',
                left: 380,
                top: 350,
                width: 400,
                fontSize: 25,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(mute_title2);

            if(mute_status2==1){
                mute_status_text2 = 'On';
            } else {
                mute_status_text2= 'Off';
            }
            set_mute_text2(mute_status_text2, 470, 350);
		}
		
		for(var x=0;x<mute_data_array.length;x++){
			
			var type = mute_data_array[x]['type'];
	
			if(type=='enabled'){
		
				var name = mute_data_array[x]['name'];
				var parameter = mute_data_array[x]['parameter'];
			  	var left = mute_data_array[x]['left'];
				var top = mute_data_array[x]['top'];
				
				var enable = document.getElementById(parameter+'_mute').value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('mute_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'mute_'+parameter+'_off',
				  name: 'mute_'+parameter+'_off',
				  parameter: parameter,
				  type: 'mute_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('mute_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'mute_'+parameter+'_on',
				  name: 'mute_'+parameter+'_on',
				  parameter: parameter,
				  type: 'mute_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = mute_data_array[x]['name'];
				var parameter = mute_data_array[x]['parameter'];
				var indicator_left = mute_data_array[x]['indicator_left'];
				var indicator_top = mute_data_array[x]['indicator_top'];
				var text_left = mute_data_array[x]['text_left'];
				var text_top = mute_data_array[x]['text_top'];
				
				var input;
				var amp;
				if(name=='mute_Threshold_ab'){
				   	input = document.getElementById(parameter+'_mute_ab').value;
					amp = 'ab';
				}
				if(name=='mute_Threshold_cd'){
				   	input = document.getElementById(parameter+'_mute_cd').value;
					amp = 'cd';
				}
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+144)*1.785);  // Min:-144 Max:24
				}
				
				if((name=='mute_Threshold_ab' && (json_type=='ampg2_2c' || json_type=='ampg2_4c')) || (name=='mute_Threshold_cd' && (json_type=='ampg2_4c'))){
				   
				   // set indicator_element
                    var mute_indicator_element = document.getElementById('mute_indicator_'+parameter);
                    var mute_indicator_instance = new fabric.Image(mute_indicator_element, { 
                      id: 'mute_indicator_'+parameter + '_' + amp,
                      name: 'mute_indicator_'+parameter + '_' + amp,
                      type: 'mute_indicator',
                      left: indicator_left,
                      top: indicator_top,
                      angle: angle,
                      opacity: 1.0,	
                      selectable: false,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                    });
                    canvas.add(mute_indicator_instance);

                    // set touch_element
                    var mute_touch_element = document.getElementById('mute_touch_'+parameter);
                    var mute_touch_instance = new fabric.Image(mute_touch_element, {
                      id: 'mute_touch_'+parameter + '_' + amp,
                      name: 'mute_touch_'+parameter + '_' + amp,
                      type: 'mute_touch',
                      parameter: parameter,
                      left: indicator_left,
                      top: indicator_top,
                      angle: 0,
                      opacity: 1.0,	
                      selectable: true,
                      hasControls: false,
                      originX: 'center',
                      originY: 'center',
                      centeredRotation: true,
                      borderColor: 'rgba(0,0,0,0.0)',
                      cornerColor: 'rgba(0,0,0,0.0)',
                    });
                    canvas.add(mute_touch_instance);

                    // set input text
                    var text = input;

                    var mute_text = new fabric.Textbox(String(text), {
                        id: 'mute_'+ parameter +'_text' + '_' + amp,
                        name: 'mute_'+parameter+'_text' + '_' + amp,
                        parameter: parameter,
                        left: text_left,
                        top: text_top,
                        width: 20,
                        fontSize: 15,
                        selectable: false,
                        hasControls: false,
                        fontFamily: 'Arial',
                        fill: 'rgba(255,255,255,1.0)',
                        textAlign: 'center',
                        editable: false,
                    });
                    canvas.add(mute_text);
				}
				
			}
		}
	}
	
	function get_status_view(){
		
		document.getElementById('router_view').value = 'status';
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		var standby_status = document.getElementById('standby_status').value;
		var standby_status2 = document.getElementById('standby_status2').value;
		var mute_status = document.getElementById('mute_status').value;
		var mute_status2 = document.getElementById('mute_status2').value;
		
		var standby_status_text='';
		var standby_status_text2='';
		var mute_status_text='';
		var mute_status_text2='';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var statusbarElement = document.getElementById('status_bar');
		var statusbarInstance = new fabric.Image(statusbarElement, {
		  id: 'status_bar',
		  name: 'status_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(statusbarInstance);
		
		// add dividing line
		 canvas.add(new fabric.Line([0, 300, 702, 300], {
			left: 0,
        	top: 310,
        	stroke: 'black'
    	}));
		
		// set header text
		var header_text = new fabric.Textbox(String('Status'), {
			id: 'status_text',
			name: 'status_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var status_close_buttonElement = document.getElementById('status_close_button');
		var status_close_buttonInstance = new fabric.Image(status_close_buttonElement, {
		  id: 'status_close_button',
		  name: 'status_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(status_close_buttonInstance);
		
		// Amp1
		// bridged text
		var bridged_text = new fabric.Textbox(String('Switch Position:'), {
			id: 'bridged_text',
			name: 'bridged_text',
			left: 20,
			top: 70,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(bridged_text);
		
		// IsDualChannel text
		var IsDualChannel_text='';
		if(IsDualChannel==1){
			IsDualChannel_text = '2 Channel';
		} else {
			IsDualChannel_text = 'Bridged';
		}
		set_bridged_text2(IsDualChannel_text, 70);
		
		// protection text
		var protection_text = new fabric.Textbox(String('Thermal Protect:'), {
			id: 'protection_text',
			name: 'protection_text',
			left: 20,
			top: 120,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(protection_text);
		
		// InProtection led
		var InProtection = document.getElementById('InProtection').value;
		if(InProtection==1){
			set_status_led('red',230,120,'protection');
		} else {
			set_status_led('green',230,120,'protection');
		}
		
		// ch1 text
		var ch1_text = new fabric.Textbox(String('Channel A Output Limit:'), {
			id: 'ch1_text',
			name: 'ch1_text',
			left: 20,
			top: 170,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(ch1_text);
		
		// ch1 led
		var out1_clip = document.getElementById('out1_clip').value;
		if(out1_clip==1){
			set_status_led('red',315,170,'ch1');
		} else {
			set_status_led('green',315,170,'ch1');
		}
				
		if(IsDualChannel==1){
			
			// ch2 text
			var ch2_text = new fabric.Textbox(String('Channel B Output Limit:'), {
				id: 'ch2_text',
				name: 'ch2_text',
				left: 20,
				top: 220,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(ch2_text);

			// ch2 led
			var out12_clip = document.getElementById('out2_clip').value;
			if(out2_clip==1){
				set_status_led('red',315,220,'ch2');
			} else {
				set_status_led('green',315,220,'ch2');
			}
			
		}
		
		var top_adjustment=0;
		if(IsDualChannel==0){
			top_adjustment = -50;
		}
		
		// temperature title
		var temperature_title = new fabric.Textbox(String('Temperature:'), {
			id: 'temperature_title',
			name: 'temperature_title',
			left: 20,
			top: 270+top_adjustment,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(temperature_title);	
		
		var temperature = document.getElementById('temperature').value;
		
		var temperature_text = temperature+ '\u00b0C ';
		var fahrenheit = Math.round((1.8 * temperature) + 32);
	  	temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

		// temperature text
		var temperature_text = new fabric.Textbox(String(temperature_text), {
			id: 'temperature_text',
			name: 'temperature_text',
			left: 185,
			top: 270+top_adjustment,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(temperature_text);
		
		// standby title  text
		var standby_title1 = new fabric.Textbox(String('Standby:'), {
			id: 'standby_title1',
			name: 'standby_title1',
			left: 420,
			top: 120,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(standby_title1);
		
		if(standby_status==1){
			standby_status_text = 'On';
		} else {
			standby_status_text= 'Off';
		}
		set_standby_text1(standby_status_text, 535, 120);
		
		// mute title text
		var mute_title1 = new fabric.Textbox(String('Mute:'), {
			id: 'mute_title1',
			name: 'mute_title1',
			left: 420,
			top: 170,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(mute_title1);
		
		if(mute_status==1){
			mute_status_text = 'On';
		} else {
			mute_status_text= 'Off';
		}
		set_mute_text1(mute_status_text, 495, 170);
		
		// Amp2
		if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		
			// bridged text
			var bridged_text = new fabric.Textbox(String('Switch Position:'), {
				id: 'bridged_text2',
				name: 'bridged_text2',
				left: 20,
				top: 320,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(bridged_text);

			// IsDualChannel text
			var IsDualChannel_text='';
			if(IsDualChannel2==1){
				IsDualChannel_text = '2 Channel';
			} else {
				IsDualChannel_text = 'Bridged';
			}
			set_bridged_text2(IsDualChannel_text, 320);

			// protection text
			var protection_text = new fabric.Textbox(String('Thermal Protect:'), {
				id: 'protection_text2',
				name: 'protection_text2',
				left: 20,
				top: 370,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(protection_text);

			// InProtection led
			var InProtection2 = document.getElementById('InProtection2').value;
			if(InProtection2==1){
				set_status_led('red',230,370,'protection2');
			} else {
				set_status_led('green',230,370,'protection2');
			}

			// ch1 text
			var ch1_text = new fabric.Textbox(String('Channel C Output Limit:'), {
				id: 'ch1_text2',
				name: 'ch1_text2',
				left: 20,
				top: 420,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(ch1_text);

			// ch1 led
			var out3_clip = document.getElementById('out3_clip').value;
			if(out3_clip==1){
				set_status_led('red',315,420,'ch3');
			} else {
				set_status_led('green',315,420,'ch3');
			}
			
			if(IsDualChannel2==1){

				// ch2 text
				var ch2_text = new fabric.Textbox(String('Channel D Output Limit:'), {
					id: 'ch2_text2',
					name: 'ch2_text2',
					left: 20,
					top: 470,
					width: 400,
					fontSize: 25,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fontWeight: 'bold',
					fill: 'rgba(0,0,0,1.0)',
					textAlign: 'left',
					editable: false,
				});
				canvas.add(ch2_text);
				
				// ch4 led
				var out4_clip = document.getElementById('out4_clip').value;
				if(out4_clip==1){
					set_status_led('red',315,470,'ch4');
				} else {
					set_status_led('green',315,470,'ch4');
				}
			}

			var top_adjustment2=0;
			if(IsDualChannel2==0){
				top_adjustment2 = -50;
			}

			// temperature title
			var temperature_title = new fabric.Textbox(String('Temperature:'), {
				id: 'temperature_title2',
				name: 'temperature_title2',
				left: 20,
				top: 520+top_adjustment2,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(temperature_title);	

			var temperature2 = document.getElementById('temperature2').value;

			var temperature_text = temperature2+ '\u00b0C ';
			var fahrenheit = Math.round((1.8 * temperature2) + 32);
			temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

			// temperature text
			var temperature_text = new fabric.Textbox(String(temperature_text), {
				id: 'temperature_text2',
				name: 'temperature_text2',
				left: 185,
				top: 520+top_adjustment2,
				width: 400,
				fontSize: 25,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(temperature_text);  
			
			// standby title text
            var standby_title2 = new fabric.Textbox(String('Standby:'), {
                id: 'standby_title2',
                name: 'standby_title2',
                left: 420,
                top: 370,
                width: 400,
                fontSize: 25,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(standby_title2);

			if(standby_status2==1){
                standby_status_text2 = 'On';
            } else {
                standby_status_text2= 'Off';
            }
            set_standby_text2(standby_status_text2, 535, 370);

            // mute title text
            var mute_title2 = new fabric.Textbox(String('Mute:'), {
                id: 'mute_title2',
                name: 'mute_title2',
                left: 420,
                top: 420,
                width: 400,
                fontSize: 25,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(mute_title2);
			
			if(mute_status2==1){
                mute_status_text2 = 'On';
            } else {
                mute_status_text2= 'Off';
            }
            set_mute_text2(mute_status_text2, 495, 420);
		   
		}
	}
	
	function get_status_view2(){
		
		document.getElementById('router_view').value = 'status';
		var json_type = document.getElementById('json_type').value;
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var statusbarElement = document.getElementById('status_bar');
		var statusbarInstance = new fabric.Image(statusbarElement, {
		  id: 'status_bar',
		  name: 'status_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(statusbarInstance);
		
		// add dividing line
		 canvas.add(new fabric.Line([0, 300, 702, 300], {
			left: 0,
        	top: 310,
        	stroke: 'black'
    	}));
		
		// set header text
		var header_text = new fabric.Textbox(String('Status'), {
			id: 'status_text',
			name: 'status_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var status_close_buttonElement = document.getElementById('status_close_button');
		var status_close_buttonInstance = new fabric.Image(status_close_buttonElement, {
		  id: 'status_close_button',
		  name: 'status_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(status_close_buttonInstance);
		
		// protection text
		var protection_text = new fabric.Textbox(String('Thermal Protect:'), {
			id: 'protection_text',
			name: 'protection_text',
			left: 100,
			top: 70,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(protection_text);
		
		// InProtection led
		var InProtection = document.getElementById('InProtection').value;
		if(InProtection=='1'){
			set_status_led('red',310,70,'protection');
		} else {
			set_status_led('green',310,70,'protection');
		}
		
		// ch1 text
		var ch1_text = new fabric.Textbox(String('Output Limit:'), {
			id: 'ch1_text',
			name: 'ch1_text',
			left: 100,
			top: 120,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(ch1_text);
		
		// out1_clip
		var out1_clip = document.getElementById('out1_clip').value;
		if(out1_clip=='1'){
			set_status_led('red',272,120,'ch1');
		} else {
			set_status_led('green',272,120,'ch1');
		}
		
		// temperature title
		var temperature_title = new fabric.Textbox(String('Temperature:'), {
			id: 'temperature_title',
			name: 'temperature_title',
			left: 100,
			top: 170,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(temperature_title);	
		
		var temperature = document.getElementById('temperature').value;
		var temperature_text = temperature+ '\u00b0C ';
		var fahrenheit = Math.round((1.8 * temperature) + 32);
	  	temperature_text = temperature_text + '(' + fahrenheit + '\u00b0F)';

		// temperature text
		var temperature_text = new fabric.Textbox(String(temperature_text), {
			id: 'temperature_text',
			name: 'temperature_text',
			left: 265,
			top: 170,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(temperature_text);
	}
	
	function get_duplexer_view(){
		
		document.getElementById('router_view').value = 'duplexer';
		var json_type = document.getElementById('json_type').value;	
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(824);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		var duplexer_bar = 'duplexer_bar';
		
		if(json_type=='edp01'){
		   duplexer_bar = 'duplexer_bar_edp01';
		 }
		
		// set bar background
		var compressorbarElement = document.getElementById(duplexer_bar);
		var compressorbarInstance = new fabric.Image(compressorbarElement, {
		  id: 'duplexer_bar',
		  name: 'duplexer_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(compressorbarInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Intercom Tuning'), {
			id: 'duplexer_channel_text',
			name: 'duplexer_channel_text',
			left: 18,
			top: 11,
			width: 600,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var duplexer_close_buttonElement = document.getElementById('duplexer_close_button');
		var duplexer_close_buttonInstance = new fabric.Image(duplexer_close_buttonElement, {
		  id: 'duplexer_close_button',
		  name: 'duplexer_close_button',
		  left: 767,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(duplexer_close_buttonInstance);
		
		// add reset_button
		var duplexer_reset_buttonElement = document.getElementById('duplexer_reset_button');
		var duplexer_reset_buttonInstance = new fabric.Image(duplexer_reset_buttonElement, {
		  id: 'duplexer_reset_button',
		  name: 'duplexer_reset_button',
		  type: 'duplexer_reset_button',
		  channel: channel,
		  left: 707,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(duplexer_reset_buttonInstance);
			
		var Threshold_noise_gate = document.getElementById('Threshold_noise_gate_duplexer').value;
		var Talkback_threshold_duplexer = document.getElementById('Talkback_threshold_duplexer').value;
		var Talkback_decay_duplexer = document.getElementById('Talkback_decay_duplexer').value;
			
		var Threshold_noise_gate_angle = -150+((parseInt(Threshold_noise_gate)+144)*1.785); // Min:-144 Max:24
		if(json_type=='edp01'){
		   Threshold_noise_gate_angle = -150+((parseInt(Threshold_noise_gate)+90)*4.29);  // Min:-90 Max:-20
		}
		var Talkback_threshold_duplexer_angle = -150+((parseInt(Talkback_threshold_duplexer)+144)*1.785); // Min:-144 Max:24
		var Talkback_decay_duplexer_angle = -150+((parseInt(Talkback_decay_duplexer))*0.3); // Min:0 Max:1000
		
		// set indicator_element
		var duplexer_indicator_noise_gate_element = document.getElementById('duplexer_indicator_noise_gate');
		var duplexer_indicator_noise_gate_instance = new fabric.Image(duplexer_indicator_noise_gate_element, { 
		  id: 'duplexer_indicator_noise_gate',
		  name: 'duplexer_indicator_noise_gate',
		  type: 'duplexer_indicator_noise_gate',
		  left: 178,
		  top: 189,
		  angle: Threshold_noise_gate_angle,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		  originX: 'center',
		  originY: 'center',
		  centeredRotation: true,
		});
		canvas.add(duplexer_indicator_noise_gate_instance);

		// set touch_element
		var duplexer_noise_gate_touch_element = document.getElementById('duplexer_noise_gate_touch');
		var duplexer_noise_gate_touch_instance = new fabric.Image(duplexer_noise_gate_touch_element, {
		  id: 'duplexer_noise_gate_touch',
		  name: 'duplexer_noise_gate_touch',
		  type: 'duplexer_noise_gate_touch',
		  parameter: 'threshold_noise_gate',
		  left: 178,
		  top: 189,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: true,
		  hasControls: false,
		  originX: 'center',
		  originY: 'center',
		  centeredRotation: true,
		  borderColor: 'rgba(0,0,0,0.0)',
		  cornerColor: 'rgba(0,0,0,0.0)',
		});
		canvas.add(duplexer_noise_gate_touch_instance);

		// set input text
		var noise_gate_text = Threshold_noise_gate;

		var noise_gate_threshold_text = new fabric.Textbox(String(noise_gate_text), {
			id: 'noise_gate_threshold_text',
			name: 'noise_gate_threshold_text',
			parameter: 'threshold_noise_gate',
			left: 165,
			top: 100,
			width: 20,
			fontSize: 15,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			editable: false,
		});
		canvas.add(noise_gate_threshold_text);
		
		if(json_type!='edp01'){
		   	// set indicator_element
            var duplexer_indicator_talkback_threshold_element = document.getElementById('duplexer_indicator_talkback_threshold');
            var duplexer_indicator_talkback_threshold_instance = new fabric.Image(duplexer_indicator_talkback_threshold_element, { 
              id: 'duplexer_indicator_talkback_threshold',
              name: 'duplexer_indicator_talkback_threshold',
              type: 'duplexer_talkback_threshold',
              left: 412,
              top: 189,
              angle: Talkback_threshold_duplexer_angle,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
              originX: 'center',
              originY: 'center',
              centeredRotation: true,
            });
            canvas.add(duplexer_indicator_talkback_threshold_instance);

            // set touch_element
            var duplexer_talkback_threshold_touch_element = document.getElementById('duplexer_talkback_threshold_touch');
            var duplexer_talkback_threshold_touch_instance = new fabric.Image(duplexer_talkback_threshold_touch_element, {
              id: 'duplexer_talkback_threshold_touch',
              name: 'duplexer_talkback_threshold_touch',
              type: 'duplexer_talkback_threshold_touch',
              parameter: 'duplexer_talkback_threshold',
              left: 412,
              top: 189,
              angle: 0,
              opacity: 1.0,	
              selectable: true,
              hasControls: false,
              originX: 'center',
              originY: 'center',
              centeredRotation: true,
              borderColor: 'rgba(0,0,0,0.0)',
              cornerColor: 'rgba(0,0,0,0.0)',
            });
            canvas.add(duplexer_talkback_threshold_touch_instance);

            // set input text
            var talkback_threshold_text = Talkback_threshold_duplexer;

            var duplexer_talkback_threshold_text = new fabric.Textbox(String(talkback_threshold_text), {
                id: 'duplexer_talkback_threshold_text',
                name: 'duplexer_talkback_threshold_text',
                parameter: 'duplexer_talkback_threshold_text',
                left: 400,
                top: 100,
                width: 20,
                fontSize: 15,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(duplexer_talkback_threshold_text);

            // set indicator_element
            var duplexer_indicator_talkback_decay_element = document.getElementById('duplexer_indicator_talkback_decay');
            var duplexer_indicator_talkback_decay_instance = new fabric.Image(duplexer_indicator_talkback_decay_element, { 
              id: 'duplexer_indicator_talkback_decay',
              name: 'duplexer_indicator_talkback_decay',
              type: 'duplexer_talkback_decay',
              left: 178,
              top: 415,
              angle: Talkback_decay_duplexer_angle,
              opacity: 1.0,	
              selectable: false,
              hasControls: false,
              originX: 'center',
              originY: 'center',
              centeredRotation: true,
            });
            canvas.add(duplexer_indicator_talkback_decay_instance);

            // set touch_element
            var duplexer_talkback_decay_touch_element = document.getElementById('duplexer_talkback_decay_touch');
            var duplexer_talkback_decay_touch_instance = new fabric.Image(duplexer_talkback_decay_touch_element, {
              id: 'duplexer_talkback_decay_touch',
              name: 'duplexer_talkback_decay_touch',
              type: 'duplexer_talkback_decay_touch',
              parameter: 'duplexer_talkback_decay',
              left: 178,
              top: 415,
              angle: 0,
              opacity: 1.0,	
              selectable: true,
              hasControls: false,
              originX: 'center',
              originY: 'center',
              centeredRotation: true,
              borderColor: 'rgba(0,0,0,0.0)',
              cornerColor: 'rgba(0,0,0,0.0)',
            });
            canvas.add(duplexer_talkback_decay_touch_instance);

            // set input text
            var talkback_decay_text = Talkback_decay_duplexer;

            var duplexer_talkback_decay_text = new fabric.Textbox(String(talkback_decay_text), {
                id: 'duplexer_talkback_decay_text',
                name: 'duplexer_talkback_decay_text',
                parameter: 'duplexer_talkback_decay_text',
                left: 165, 
                top: 326,
                width: 20,
                fontSize: 15,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(255,255,255,1.0)',
                textAlign: 'center',
                editable: false,
            });
            canvas.add(duplexer_talkback_decay_text);
		 }
	}
	
	function get_presets_view(){
			
		document.getElementById('router_view').value = 'presets';
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		document.getElementById('preset_modal').value = '0';
		document.getElementById('generate_modal').value = '0';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(702);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var presetsbarElement = document.getElementById('presets_bar');
		var presetsbarInstance = new fabric.Image(presetsbarElement, {
		  id: 'presets_bar',
		  name: 'presets_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(presetsbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Presets'), {
			id: 'presets_text',
			name: 'presets_text',
			left: 18,
			top: 11,
			width: 400,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		canvas.add(header_text);
		
		// add close_button
		var presets_close_buttonElement = document.getElementById('presets_close_button');
		var presets_close_buttonInstance = new fabric.Image(presets_close_buttonElement, {
		  id: 'presets_close_button',
		  name: 'presets_close_button',
		  left: 648,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(presets_close_buttonInstance);
		
		if(json_type=='s810v2'){
			
			// preset label
            var preset_label = new fabric.Textbox(String('Speaker Type:'), {
                id: 'preset_label',
                name: 'preset_label',
                left: 50,
                top: 123,
                width: 400,
                fontSize: 20,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(preset_label);

            var preset_input = document.getElementById('preset_input');
            preset_input.style.left = canvas._offset.left+150+'px';
            preset_input.style.top = canvas._offset.top+84+'px';
            preset_input.style.visibility = 'visible';
		}
		
		reset_presets_fields();
		
		var label1;
		var label2;
		var label3;
		var label4;
		
		if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
			
			label1 = 'Ch A';
			label2 = 'Ch B';
		}
		
		if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
			
			label1 = 'Ch A';
			label2 = 'Ch B';
			label3 = 'Ch C';
			label4 = 'Ch D';
		}
		
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			// name1 text
            var name1_text = new fabric.Textbox(String(label1+':'), {
                id: 'name1_text',
                name: 'name1_text',
                left: 50,
                top: 123,
                width: 400,
                fontSize: 20,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(name1_text);
		}
		
		if(IsDualChannel==1 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')){
		   // name2 text
			var name2_text = new fabric.Textbox(String(label2+':'), {
				id: 'name2_text',
				name: 'name2_text',
				left: 50,
				top: 197,
				width: 400,
				fontSize: 20,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fontWeight: 'bold',
				fill: 'rgba(0,0,0,1.0)',
				textAlign: 'left',
				editable: false,
			});
			canvas.add(name2_text);
		}
		
		if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		
            var name3_top = 267;
            if(IsDualChannel==0 && (json_type=='ampg1_4c' || json_type=='ampg2_4c')){
                name3_top = name3_top -70;
            }

            // name3 text
            var name3_text = new fabric.Textbox(String(label3+':'), {
                id: 'name3_text',
                name: 'name3_text',
                left: 50,
                top: name3_top,
                width: 400,
                fontSize: 20,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fontWeight: 'bold',
                fill: 'rgba(0,0,0,1.0)',
                textAlign: 'left',
                editable: false,
            });
            canvas.add(name3_text);
	
			var top4 = 339;
            if(IsDualChannel==0){
               top4 = top4-70;
            }
			
			if(IsDualChannel2==1){
				// name4 text
                var name4_text = new fabric.Textbox(String(label4+':'), {
                    id: 'name4_text',
                    name: 'name4_text',
                    left: 50,
                    top: top4,
                    width: 400,
                    fontSize: 20,
                    selectable: false,
                    hasControls: false,
                    fontFamily: 'Arial',
                    fontWeight: 'bold',
                    fill: 'rgba(0,0,0,1.0)',
                    textAlign: 'left',
                    editable: false,
                });
                canvas.add(name4_text);
			}
		}
	}
	
	function get_delay_view(channel){
		
		document.getElementById('router_view').value = 'delay';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
			
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            if(channel==1){
               input_output='Channel A';
            }
            if(channel==2){
               input_output='Channel B';
            }
            if(channel==3){
               input_output='Channel C';
            }
            if(channel==4){
               input_output='Channel D';
            }
		}
		
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(602);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var delaybarElement = document.getElementById('delay_bar');
		var delaybarInstance = new fabric.Image(delaybarElement, {
		  id: 'delay_bar',
		  name: 'delay_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(delaybarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Delay - ' + full_label), {
			id: 'delay_header_text',
			name: 'delay_header_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
			
		// add close_button
		var delay_close_buttonElement = document.getElementById('delay_close_button');
		var delay_close_buttonInstance = new fabric.Image(delay_close_buttonElement, {
		  id: 'delay_close_button',
		  name: 'delay_close_button',
		  left: 552,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(delay_close_buttonInstance);
		
		// add reset_button
		var delay_reset_buttonElement = document.getElementById('delay_reset_button');
		var delay_reset_buttonInstance = new fabric.Image(delay_reset_buttonElement, {
		  id: 'delay_reset_button',
		  name: 'delay_reset_button',
		  type: 'delay_reset_button',
		  channel: channel,
		  left: 492,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(delay_reset_buttonInstance);
		
		// signal present light
		var signal_present = document.getElementById('Signal_signal_present'+channel).value;	
		if(signal_present==1){
			set_signal_led_rect(channel,66,541);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,541);
		}
			 
        // set input level
        var input_level = document.getElementById('levelIn'+channel).value;
        var input_level_top = get_led_top_from_volume(input_level);
        set_red_led_rect2(channel,input_level_top,541);
        set_yellow_led_rect2(channel,input_level_top,541);
        set_green_led_rect2(channel,input_level_top,541); 
			
        var input = document.getElementById('Delay_delay'+channel).value;
		
        var  angle = -150+((parseInt(input))*10); // Min:0 Max:30

        // set indicator_element
        var delay_indicator_element = document.getElementById('delay_indicator_Delay');
        var delay_indicator_instance = new fabric.Image(delay_indicator_element, { 
          id: 'delay_indicator_Delay',
          name: 'delay_indicator_Delay',
          type: 'delay_indicator',
          left: 247,
          top: 205,
          angle: angle,
          opacity: 1.0,	
          selectable: false,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
        });
        canvas.add(delay_indicator_instance);

        // set touch_element
        var delay_touch_element = document.getElementById('delay_touch_Delay');
        var delay_touch_instance = new fabric.Image(delay_touch_element, {
          id: 'delay_touch_Delay',
          name: 'delay_touch_Delay',
          type: 'delay_touch',
          parameter: 'Delay',
          left: 247,
          top: 205,
          angle: 0,
          opacity: 1.0,	
          selectable: true,
          hasControls: false,
          originX: 'center',
          originY: 'center',
          centeredRotation: true,
          borderColor: 'rgba(0,0,0,0.0)',
          cornerColor: 'rgba(0,0,0,0.0)',
        });
        canvas.add(delay_touch_instance);

        // set input text
        var text = input;

        var delay_text = new fabric.Textbox(String(text), {
            id: 'delay_Delay_text',
            name: 'delay_Delay_text',
            parameter: 'Delay',
            left: 240,
            top: 110,
            width: 20,
            fontSize: 15,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(255,255,255,1.0)',
            textAlign: 'center',
            editable: false,
        });
        canvas.add(delay_text);
	}
	function get_phase_invert_view(channel){
		
		document.getElementById('router_view').value = 'phase_invert';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
			
		var input_output = 'Input ' + channel;
		var label = document.getElementById('label'+channel).value;
		
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(602);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var phaseinvertbarElement = document.getElementById('phase_invert_bar');
		var phaseinvertbarInstance = new fabric.Image(phaseinvertbarElement, {
		  id: 'phase_invert_bar',
		  name: 'phase_invert_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phaseinvertbarInstance);
		
		// set header text
		var header_text = new fabric.Textbox(String('Phase Invert - ' + full_label), {
			id: 'phase_invert_header_text',
			name: 'phase_invert_header_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(header_text);
			
		// add close_button
		var phase_invert_close_buttonElement = document.getElementById('phase_invert_close_button');
		var phase_invert_close_buttonInstance = new fabric.Image(phase_invert_close_buttonElement, {
		  id: 'phase_invert_close_button',
		  name: 'phase_invert_close_button',
		  left: 552,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phase_invert_close_buttonInstance);
		
		// add reset_button
		var phase_invert_reset_buttonElement = document.getElementById('phase_invert_reset_button');
		var phase_invert_reset_buttonInstance = new fabric.Image(phase_invert_reset_buttonElement, {
		  id: 'phase_invert_reset_button',
		  name: 'phase_invert_reset_button',
		  type: 'phase_invert_reset_button',
		  channel: channel,
		  left: 492,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(phase_invert_reset_buttonInstance);
		
		// signal present light
		var signal_present = document.getElementById('Signal_signal_present'+channel).value;	
		if(signal_present==1){
			set_signal_led_rect(channel,66,541);
		}
		
		// clip light
		var clip = document.getElementById('Clip'+channel+'_enabled').value;
		if(clip==1){
			set_clip_led_rect(channel,81,541);
		}
			 
        // set input level
        var input_level = document.getElementById('levelIn'+channel).value;
        var input_level_top = get_led_top_from_volume(input_level);
        set_red_led_rect2(channel,input_level_top,541);
        set_yellow_led_rect2(channel,input_level_top,541);
        set_green_led_rect2(channel,input_level_top,541);
		
		var enable = document.getElementById('Phase_invert'+channel).value;	
        var off_opacity;
        var on_opacity;
        if(enable==1){
           off_opacity = 0.0;
           on_opacity = 1.0;
         } else {
           off_opacity = 1.0;
           on_opacity = 0.0;
         }

        // set enable button off
        var enableButtonOffElement = document.getElementById('phase_invert_Enabled_off');
        var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
          id: 'phase_invert_Enabled_off',
          name: 'phase_invert_Enabled_off',
          parameter: 'Phase_invert',
          channel: channel,
          type: 'phase_invert_enable_button',
          left: 206,
          top: 136,
          angle: 0,
          opacity: off_opacity,	
          selectable: false,
          hasControls: false,
        });
        canvas.add(enableButtonOffInstance);

        // set enable button on
        var enableButtonOnElement = document.getElementById('phase_invert_Enabled_on');
        var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
          id: 'phase_invert_Enabled_on',
          name: 'phase_invert_Enabled_on',
          parameter: 'Phase_invert',
          channel: channel,
          type: 'phase_invert_enable_button',
          left: 206,
          top: 136,
          angle: 0,
          opacity: on_opacity,
          selectable: false,
          hasControls: false,
        });
        canvas.add(enableButtonOnInstance);
	}
	
	function get_peak_limiter_view(channel){
			
		document.getElementById('router_view').value = 'peak_limiter';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output;
		if(channel==1){
		   input_output='Channel A';
		}
		if(channel==2){
		   input_output='Channel B';
		}
		if(channel==3){
		   input_output='Channel C';
		}
		if(channel==4){
		   input_output='Channel D';
		}
		var label = document.getElementById('label'+channel).value;
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(824);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var peak_limiter_barElement = document.getElementById('peak_limiter_bar');
		var peak_limiter_barInstance = new fabric.Image(peak_limiter_barElement, {
		  id: 'peak_limiter_bar',
		  name: 'peak_limiter_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peak_limiter_barInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('Peak Limiter - '+full_label), {
			id: 'peak_limiter_channel_text',
			name: 'peak_limiter_channel_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var peak_limiter_close_buttonElement = document.getElementById('peak_limiter_close_button');
		var peak_limiter_close_buttonInstance = new fabric.Image(peak_limiter_close_buttonElement, {
		  id: 'peak_limiter_close_button',
		  name: 'peak_limiter_close_button',
		  left: 767,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peak_limiter_close_buttonInstance);
		
		// add reset_button
		var peak_limiter_reset_buttonElement = document.getElementById('peak_limiter_reset_button');
		var peak_limiter_reset_buttonInstance = new fabric.Image(peak_limiter_reset_buttonElement, {
		  id: 'peak_limiter_reset_button',
		  name: 'peak_limiter_reset_button',
		  type: 'peak_limiter_reset_button',
		  channel: channel,
		  left: 707,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(peak_limiter_reset_buttonInstance);
			
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,641);
		set_yellow_led_rect2(channel,input_level_top,641);
		set_green_led_rect2(channel,input_level_top,641); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,763);
		set_yellow_led_rect(channel,output_level_top,763);
		set_green_led_rect(channel,output_level_top,763); 
		
		for(var x=0;x<peak_limiter_data_array.length;x++){
			
			var type = peak_limiter_data_array[x]['type'];
	
			if(type=='enabled'){
				
				var name = peak_limiter_data_array[x]['name'];
				var parameter = peak_limiter_data_array[x]['parameter'];
			  	var left = peak_limiter_data_array[x]['left'];
				var top = peak_limiter_data_array[x]['top'];
					
				var enable = document.getElementById(parameter+'_peak_limiter'+channel).value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('peak_limiter_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'peak_limiter_'+parameter+'_off',
				  name: 'peak_limiter_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'peak_limiter_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('peak_limiter_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'peak_limiter_'+parameter+'_on',
				  name: 'peak_limiter_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'peak_limiter_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = peak_limiter_data_array[x]['name'];
				var parameter = peak_limiter_data_array[x]['parameter'];
				var indicator_left = peak_limiter_data_array[x]['indicator_left'];
				var indicator_top = peak_limiter_data_array[x]['indicator_top'];
				var text_left = peak_limiter_data_array[x]['text_left'];
				var text_top = peak_limiter_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_peak_limiter'+channel).value;
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+135)*1.92);
				}
				if(parameter=='Attack'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Hold'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Decay'){
				   angle = -150+(input*0.15);
				}

				// set indicator_element
				var peak_limiter_indicator_element = document.getElementById('peak_limiter_indicator_'+parameter);
				var peak_limiter_indicator_instance = new fabric.Image(peak_limiter_indicator_element, { 
				  id: 'peak_limiter_indicator_'+parameter,
				  name: 'peak_limiter_indicator_'+parameter,
				  type: 'peak_limiter_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(peak_limiter_indicator_instance);

				// set touch_element
				var peak_limiter_touch_element = document.getElementById('peak_limiter_touch_'+parameter);
				var peak_limiter_touch_instance = new fabric.Image(peak_limiter_touch_element, {
				  id: 'peak_limiter_touch_'+parameter,
				  name: 'peak_limiter_touch_'+parameter,
				  type: 'peak_limiter_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(peak_limiter_touch_instance);
				
				// set input text
				var text = input;

				var peak_limiter_text = new fabric.Textbox(String(text), {
					id: 'peak_limiter_'+ parameter +'_text',
					name: 'peak_limiter_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(peak_limiter_text);
			}
		}
	}
	
	function get_rms_limiter_view(channel){
			
		document.getElementById('router_view').value = 'rms_limiter';
		document.getElementById('channel').value = channel;
		var json_type = document.getElementById('json_type').value;
		
		var input_output;
		if(channel==1){
		   input_output='Channel A';
		}
		if(channel==2){
		   input_output='Channel B';
		}
		if(channel==3){
		   input_output='Channel C';
		}
		if(channel==4){
		   input_output='Channel D';
		}
		var label = document.getElementById('label'+channel).value;
		var full_label =  label + ' ('+input_output+')';
		
		canvas.clear();
		
		canvas.setHeight(564);
		canvas.setWidth(824);
		
		// set Zoom level
		canvas.setZoom(0.7);
		
		// set bar background
		var rms_limiter_barElement = document.getElementById('rms_limiter_bar');
		var rms_limiter_barInstance = new fabric.Image(rms_limiter_barElement, {
		  id: 'rms_limiter_bar',
		  name: 'rms_limiter_bar',
		  left: 0,
		  top: 0,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(rms_limiter_barInstance);
		
		// set channel text
		var channel_text = new fabric.Textbox(String('RMS Limiter - '+full_label), {
			id: 'rms_limiter_channel_text',
			name: 'rms_limiter_channel_text',
			left: 18,
			top: 11,
			width: 1000,
			fontSize: 30,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'left',
			shadow: 'rgba(0,0,0,1.0) 2px 2px 10px',
			editable: false,
		});
		canvas.add(channel_text);
		
		// add close_button
		var rms_limiter_close_buttonElement = document.getElementById('rms_limiter_close_button');
		var rms_limiter_close_buttonInstance = new fabric.Image(rms_limiter_close_buttonElement, {
		  id: 'rms_limiter_close_button',
		  name: 'rms_limiter_close_button',
		  left: 767,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(rms_limiter_close_buttonInstance);
		
		// add reset_button
		var rms_limiter_reset_buttonElement = document.getElementById('rms_limiter_reset_button');
		var rms_limiter_reset_buttonInstance = new fabric.Image(rms_limiter_reset_buttonElement, {
		  id: 'rms_limiter_reset_button',
		  name: 'rms_limiter_reset_button',
		  type: 'rms_limiter_reset_button',
		  channel: channel,
		  left: 707,
		  top: 14,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(rms_limiter_reset_buttonInstance);
			
		// set input level
		var input_level = document.getElementById('levelIn'+channel).value;
		var input_level_top = get_led_top_from_volume(input_level);
		set_red_led_rect2(channel,input_level_top,641);
		set_yellow_led_rect2(channel,input_level_top,641);
		set_green_led_rect2(channel,input_level_top,641); 
		
		// set output level
		var output_level = document.getElementById('level'+channel).value;
		var output_level_top = get_led_top_from_volume(output_level);
		set_red_led_rect(channel,output_level_top,763);
		set_yellow_led_rect(channel,output_level_top,763);
		set_green_led_rect(channel,output_level_top,763); 
		
		for(var x=0;x<rms_limiter_data_array.length;x++){
			
			var type = rms_limiter_data_array[x]['type'];
	
			if(type=='enabled'){
				
				var name = rms_limiter_data_array[x]['name'];
				var parameter = rms_limiter_data_array[x]['parameter'];
			  	var left = rms_limiter_data_array[x]['left'];
				var top = rms_limiter_data_array[x]['top'];
					
				var enable = document.getElementById(parameter+'_rms_limiter'+channel).value;	
				var off_opacity;
				var on_opacity;
				if(enable==1){
				   off_opacity = 0.0;
				   on_opacity = 1.0;
				 } else {
				   off_opacity = 1.0;
				   on_opacity = 0.0;
				 }
				
				// set enable button off
				var enableButtonOffElement = document.getElementById('rms_limiter_'+parameter+'_off');
				var enableButtonOffInstance = new fabric.Image(enableButtonOffElement, {
				  id: 'rms_limiter_'+parameter+'_off',
				  name: 'rms_limiter_'+parameter+'_off',
				  parameter: parameter,
				  channel: channel,
				  type: 'rms_limiter_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: off_opacity,	
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOffInstance);

				// set enable button on
				var enableButtonOnElement = document.getElementById('rms_limiter_'+parameter+'_on');
				var enableButtonOnInstance = new fabric.Image(enableButtonOnElement, {
				  id: 'rms_limiter_'+parameter+'_on',
				  name: 'rms_limiter_'+parameter+'_on',
				  parameter: parameter,
				  channel: channel,
				  type: 'rms_limiter_enable_button',
				  left: left,
				  top: top,
				  angle: 0,
				  opacity: on_opacity,
				  selectable: false,
				  hasControls: false,
				});
				canvas.add(enableButtonOnInstance);
			}
			if(type=='knob'){
				
				var name = rms_limiter_data_array[x]['name'];
				var parameter = rms_limiter_data_array[x]['parameter'];
				var indicator_left = rms_limiter_data_array[x]['indicator_left'];
				var indicator_top = rms_limiter_data_array[x]['indicator_top'];
				var text_left = rms_limiter_data_array[x]['text_left'];
				var text_top = rms_limiter_data_array[x]['text_top'];
				
				var input = document.getElementById(parameter+'_rms_limiter'+channel).value;
				
				var angle = 0;
				if(parameter=='Threshold'){
				   angle = -150+((parseInt(input)+135)*1.92);
				}
				if(parameter=='Attack'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Hold'){
				   angle = -150+(input*0.6);
				}
				if(parameter=='Decay'){
				   angle = -150+(input*0.15);
				}

				// set indicator_element
				var rms_limiter_indicator_element = document.getElementById('rms_limiter_indicator_'+parameter);
				var rms_limiter_indicator_instance = new fabric.Image(rms_limiter_indicator_element, { 
				  id: 'rms_limiter_indicator_'+parameter,
				  name: 'rms_limiter_indicator_'+parameter,
				  type: 'rms_limiter_indicator',
				  left: indicator_left,
				  top: indicator_top,
				  angle: angle,
				  opacity: 1.0,	
				  selectable: false,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				});
				canvas.add(rms_limiter_indicator_instance);

				// set touch_element
				var rms_limiter_touch_element = document.getElementById('rms_limiter_touch_'+parameter);
				var rms_limiter_touch_instance = new fabric.Image(rms_limiter_touch_element, {
				  id: 'rms_limiter_touch_'+parameter,
				  name: 'rms_limiter_touch_'+parameter,
				  type: 'rms_limiter_touch',
				  parameter: parameter,
				  left: indicator_left,
				  top: indicator_top,
				  angle: 0,
				  opacity: 1.0,	
				  selectable: true,
				  hasControls: false,
				  originX: 'center',
				  originY: 'center',
				  centeredRotation: true,
				  borderColor: 'rgba(0,0,0,0.0)',
				  cornerColor: 'rgba(0,0,0,0.0)',
				});
				canvas.add(rms_limiter_touch_instance);
				
				// set input text
				var text = input;

				var rms_limiter_text = new fabric.Textbox(String(text), {
					id: 'rms_limiter_'+ parameter +'_text',
					name: 'rms_limiter_'+parameter+'_text',
					parameter: parameter,
					left: text_left,
					top: text_top,
					width: 20,
					fontSize: 15,
					selectable: false,
					hasControls: false,
					fontFamily: 'Arial',
					fill: 'rgba(255,255,255,1.0)',
					textAlign: 'center',
					editable: false,
				});
				canvas.add(rms_limiter_text);
			}
		}
	}
	
	function get_led_top_from_volume(volume){
		
		if(volume>0){ volume=0;}
		if(volume<-60){ volume=-60;}
		
		var data =[65,75,85,95,105,116,127,135,143,151,158,168,178,188,198,210,221,232,243,255,268,274,280,286,292,297,303,309,315,321,327,333,339,345,351,357,363,369,375,384,389,391,394,397,400,403,406,409,412,416,418,421,424,427,430,433,436,439,442,446,449]; 
		
		var index = Math.abs(volume);

		var top = data[index];
		return top;
	}
	
	function get_top_from_volume(volume){
		
		if(volume>12){ volume=12;}
		if(volume<-60){ volume=-60;}
		
		var data =[65,75,85,95,105,115,126,135,144,153,162,171,181,186,191,196,201,206,211,216,221,226,232,237,242,247,252,257,262,267,272,277,284,289,294,299,304,309,314,319,324,329,334,339,344,349,354,359,364,369,374,379,387,390,393,396,399,402,405,408,411,414,417,420,423,426,429,432,435,438,441,445,449]; 
		
		var index=0;
		
		if(volume>=0){
			index = 12-volume;
		}
		if(volume<0){
			index = Math.abs(volume)+12;
		}
		var top = data[index];
		return top;
	}
	function get_volume_from_top(top){
		
		if(top<65){ top=65; }
		if(top>449){ top=449; }
		
		var data =[65,75,85,95,105,115,126,135,144,153,162,171,181,186,191,196,201,206,211,216,221,226,232,237,242,247,252,257,262,267,272,277,284,289,294,299,304,309,314,319,324,329,334,339,344,349,354,359,364,369,374,379,387,390,393,396,399,402,405,408,411,414,417,420,423,426,429,432,435,438,441,445,449]; 
		
		var volume = 0;
		var x;
		for(x=0;x<data.length;x++){
			if(data[x]<=top){
			   volume = x;
			   volume = 12-volume;
			}
		}	
		return volume;
	}
	function get_geq_volume_from_top(top){
		
		if(top<161){ top=161; }
		if(top>532){ top=532; }
			
		var data =[161,176,192,207,223,238,254,269,285,300,316,331,346,362,377,393,408,424,439,455,470,486,501,517,532];
		
		var volume = 0;
		var x;
		for(x=0;x<data.length;x++){
			if(data[x]<=top){
			   volume = x;
			   volume = 12-volume;
			}
		}	
		return volume;
	}
	function get_geq_top_from_volume(volume){
		
		if(volume>12){ volume=12;}
		if(volume<-12){ volume=-12;}
		
		var data =[161,176,192,207,223,238,254,269,285,300,316,331,346,362,377,393,408,424,439,455,470,486,501,517,532];
		
		var index = Math.abs(volume-12);
		
		var top = data[index];
		return top;
	}
	function get_peq_volume_from_top(top){
		
		if(top<270){ top=270; }
		if(top>553){ top=553; }
	
		var data =[270,282,294,305,317,329,341,353,364,376,388,400,412,423,435,447,459,470,482,494,506,518,529,541,553];
		var volume = 0;
		var x;
		for(x=0;x<data.length;x++){
			if(data[x]<=top){
			   volume = x;
			   volume = 12-volume;
			}
		}	
		return volume;
	}
	function get_peq_top_from_volume(volume){
		
		if(volume>12){ volume=12;}
		if(volume<-12){ volume=-12;}
		
		var data =[270,282,294,305,317,329,341,353,364,376,388,400,412,423,435,447,459,470,482,494,506,518,529,541,553];
		
		var index = Math.abs(volume-12);
		
		var top = data[index];
		return top;
	}
	function set_volume_text(channel,volume,top){
		
		var json_type = document.getElementById('json_type').value;
		var IsDualChannel = document.getElementById('IsDualChannel').value;
		var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
		
		if(volume>12){ volume=12;}
		if(volume<-60){ volume=-60;}
		
		var left;
		if(json_type=='Mixer'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
			}
			if(channel==4){ 
				left =744; 
			}
			if(channel==5){ 
				left =1099; 
			}
			if(channel==6){ 
				left =954; 
			}
		}	
		if(json_type=='ampg1_2c'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
				if(IsDualChannel==0){
			   		left =324;
				}
			}
			if(channel==4){ 
				left =679; 
			}
			if(channel==5){ 
				left =829; 
			}
		}	
		if(json_type=='ampg1_4c'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
				if(IsDualChannel==0){
			   		left =left-210;
				}
			}
			if(channel==4){ 
				left =744; 
			}
			if(channel==5){ 
				left =954; 
				if(IsDualChannel==0){
			   		left =left-210;
				}
				if(IsDualChannel2==0){
			   		left =left-210;
				}
			}
			if(channel==6){ 
				left =1164; 
				if(IsDualChannel==0){
			   		left =left-210;
				}
				if(IsDualChannel2==0){
			   		left =left-210;
				}
			}
		}	
		if(json_type=='s810v2'){
		   if(channel==1){ 
				left =114; 
			}
		}
		if(json_type=='nq-dsc01'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
		}
		if(json_type=='edp01'){
		   if(channel==1){ 
				left =114; 
			}
		}
		if(json_type=='nqga20'){
			left =114;
		}
		if(json_type=='nqpaxxx'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
			}
			if(channel==4){ 
				left =744; 
			}
			if(channel==5){ 
				left =954; 
			}
			if(channel==6){ 
				left =1164; 
			}
			if(channel==7){ 
				left =1314; 
			}
			if(channel==8){ 
				left =1464; 
			}
		}	
		if(json_type=='ampg2_2c'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
		}	
		if(json_type=='ampg2_4c'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
				if(IsDualChannel==0){
			   		left =left-210;
				}
			}
			if(channel==4){ 
				left =744; 
				if(IsDualChannel==0){
			   		left =left-210;
				}
			}
		}	
		if(json_type=='nqga400p'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
			if(channel==3){ 
				left =534; 
			}
			if(channel==4){ 
				left =744; 
			}
		}	
		if(json_type=='nqga40'){
		   if(channel==1){ 
				left =114; 
			}
			if(channel==2){ 
				left =324;
			}
		}	
		var level_text = new fabric.Textbox(String(volume), {
			id: 'level' + channel +'_text',
			name: 'level' + channel +'_text',
			left: left-2,
			top: top-20,
			width: 20,
			fontSize: 15,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		
		canvas.add(level_text);
	}
	
	function set_geq_text(parameter,volume,top){
		
		var left;
		if(parameter=='GEQ25HZ'){ left =115; }	
		if(parameter=='GEQ40HZ'){ left =219; }	
		if(parameter=='GEQ63HZ'){ left =324; }	
		if(parameter=='GEQ100HZ'){ left =428; }	
		if(parameter=='GEQ160HZ'){ left =533; }	
		if(parameter=='GEQ250HZ'){ left =639; }	
		if(parameter=='GEQ400HZ'){ left =744; }	
		if(parameter=='GEQ630HZ'){ left =849; }	
		if(parameter=='GEQ1000HZ'){ left =954; }	
		if(parameter=='GEQ1600HZ'){ left =1059; }	
		if(parameter=='GEQ2500HZ'){ left =1164; }	
		if(parameter=='GEQ4000HZ'){ left =1269; }	
		if(parameter=='GEQ6300HZ'){ left =1374; }	
		if(parameter=='GEQ10000HZ'){ left =1478; }	
		if(parameter=='GEQ16000HZ'){ left =1583; }	
		if(parameter=='GEQ20000HZ'){ left =1688; }	
		
		var geq_text = new fabric.Textbox(String(volume), {
			id: parameter +'_text',
			name: parameter +'_text',
			left: left+16,
			top: top-20,
			width: 20,
			fontSize: 15,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		
		canvas.add(geq_text);
	}
	function set_peq_text(parameter,volume,top){
		
		var left;
		if(parameter=='S1'){ left =169; }
		if(parameter=='S2'){ left =374; }
		if(parameter=='S3'){ left =580; }
		if(parameter=='S4'){ left =786; }
		if(parameter=='S5'){ left =990; }
		if(parameter=='S6'){ left =1197; }
		if(parameter=='S7'){ left =1403; }
		
		var peq_text = new fabric.Textbox(String(volume), {
			id: parameter +'_text',
			name: parameter +'_text',
			left: left+18,
			top: top-20,
			width: 20,
			fontSize: 15,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(255,255,255,1.0)',
			textAlign: 'center',
			shadow: 'rgba(0,0,0,1.0) 0px 0px 10px',
			editable: false,
		});
		
		canvas.add(peq_text);
	}
	
	fabric.Canvas.prototype.getItemByName = function(name) {
	  var object = null,
		  objects = this.getObjects();

	  for (var i = 0, len = this.size(); i < len; i++) {
		if (objects[i].name && objects[i].name === name) {
		  object = objects[i];
		  break;
		}
	  }

	  return object;
	};
	
	function set_green_led_rect(channel,led_top,left){
		canvas.remove(canvas.getItemByName('greenled'+channel));
			
		var height=449-led_top;
		if(height>182){
		   height=182;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+42; 
		if(top<268+42){
		   top = 268+42;
		 }
		
		var greenled = new fabric.Rect({
			id: 'greenled'+channel,
			name: 'greenled'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(0,219,36,1.0)',
			stroke: 'rgba(0,219,36,0.0)',
			selectable: false,
			objectCaching: false,
		});
		
		canvas.add(greenled);
		
		menu_to_front();
	}
	
	function set_green_led_rect2(channel,led_top,left){
		canvas.remove(canvas.getItemByName('greenled_2_'+channel));
	
		var height=449-led_top;
		if(height>182){
		   height=182;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+42; 
		if(top<268+42){
		   top = 268+42;
		 }
		
		var greenled = new fabric.Rect({
			id: 'greenled_2_'+channel,
			name: 'greenled_2_'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(0,219,36,1.0)',
			stroke: 'rgba(0,219,36,0.0)',
			selectable: false,
			objectCaching: false,
		});
		
		canvas.add(greenled);
		
		menu_to_front();
	}
	
	function set_yellow_led_rect(channel,led_top,left){
		
		canvas.remove(canvas.getItemByName('yellowled'+channel));
		
		var height=269-led_top;
		if(height>144){
		   height=144;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+41; 
		if(top<125+41){
		   top = 125+41;
		 }
		
		var yellowled = new fabric.Rect({
			id: 'yellowled'+channel,
			name: 'yellowled'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(255,201,0,1.0)',
			stroke: 'rgba(255,201,0,0.0)',
			selectable: false,
			objectCaching: false,
		});
		
		canvas.add(yellowled);
		
		menu_to_front();
	}
	
	function set_yellow_led_rect2(channel,led_top,left){
		
		canvas.remove(canvas.getItemByName('yellowled_2_'+channel));
		
		var height=269-led_top;
		if(height>144){
		   height=144;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+41; 
		if(top<125+41){
		   top = 125+41;
		 }
		
		var yellowled = new fabric.Rect({
			id: 'yellowled_2_'+channel,
			name: 'yellowled_2_'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(255,201,0,1.0)',
			stroke: 'rgba(255,201,0,0.0)',
			selectable: false,
			objectCaching: false,
		});
		
		canvas.add(yellowled);
		
		menu_to_front();
	}
	
	function set_red_led_rect(channel,led_top,left){
		
		canvas.remove(canvas.getItemByName('redled'+channel));
		
		var height=127-led_top;
		if(height>68){
		   height=68;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+39; 
		if(top<65+39){
		   top = 65+39;
		 }
		
		var redled = new fabric.Rect({
			id: 'redled'+channel,
			name: 'redled'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(255,38,38,1.0)',
			stroke: 'rgba(255,38,38,0.0)',
			selectable: false,
			objectCaching: false,
		});
		
		canvas.add(redled);
		
		menu_to_front();
	}
	
	function set_red_led_rect2(channel,led_top,left){
		
		canvas.remove(canvas.getItemByName('redled_2_'+channel));

		var height=127-led_top;
		if(height>68){
		   height=68;
		 }
		if(height<0){
		   height=0;
		 }
		// adjusted for distance from top of fader to middle of fader
		var top = led_top+39; 
		if(top<65+39){
		   top = 65+39;
		 }

		var redled = new fabric.Rect({
			id: 'redled_2_'+channel,
			name: 'redled_2_'+channel,
			left: left,
			top: top,
			originX: 'left',
			originY: 'top',
			width: 16,
			height: height,
			angle: 0,
			fill: 'rgba(255,38,38,1.0)',
			stroke: 'rgba(255,38,38,0.0)',
			selectable: false,
			objectCaching: false,
		});

		canvas.add(redled);

		menu_to_front();
	}
	
function set_signal_led_rect(channel,top,left){
		
	var signal_led = new fabric.Rect({
		id: 'signal'+channel,
		name: 'signal'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(0,219,36,1.0)',
		stroke: 'rgba(0,219,36,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(signal_led);

	menu_to_front();
}
	
function set_IsNetwork_led_rect(channel,top,left){
		
	var IsNetwork_led = new fabric.Rect({
		id: 'IsNetwork'+channel,
		name: 'IsNetwork'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(0,219,36,1.0)',
		stroke: 'rgba(0,219,36,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(IsNetwork_led);

	menu_to_front();
}
	
function set_clip_led_rect(channel,top,left){
		
	var clip_led = new fabric.Rect({
		id: 'clip'+channel,
		name: 'clip'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(255,38,38,1.0)',
		stroke: 'rgba(255,38,38,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(clip_led);

	menu_to_front();
}

function set_limiter_led_rect(channel,top,left){
		
	var limiting_led = new fabric.Rect({
		id: 'limiting'+channel,
		name: 'limiting'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(255,38,38,1.0)',
		stroke: 'rgba(255,38,38,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(limiting_led);

	menu_to_front();
}
	
function set_compression_led_rect(channel,top,left){
		
	var compression_led = new fabric.Rect({
		id: 'compression'+channel,
		name: 'compression'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(255,38,38,1.0)',
		stroke: 'rgba(255,38,38,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(compression_led);

	menu_to_front();
}
function set_peak_limiting_led_rect(channel,top,left){
		
	var peak_limiting_led = new fabric.Rect({
		id: 'peak_limiter_limiting'+channel,
		name: 'peak_limiter_limiting'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(255,38,38,1.0)',
		stroke: 'rgba(255,38,38,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(peak_limiting_led);

	menu_to_front();
}
function set_rms_limiting_led_rect(channel,top,left){
		
	var rms_limiting_led = new fabric.Rect({
		id: 'rms_limiter_limiting'+channel,
		name: 'rms_limiter_limiting'+channel,
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		width: 16,
		height: 11,
		angle: 0,
		fill: 'rgba(255,38,38,1.0)',
		stroke: 'rgba(255,38,38,0.0)',
		selectable: false,
		objectCaching: false,
	});

	canvas.add(rms_limiting_led);

	menu_to_front();
}
	
function show_menu(left,channel){
	
	clear_menu();	
	
	var top1;
	var top2;
	var height1;
	
	var json_type = document.getElementById('json_type').value;
	var IsDualChannel = document.getElementById('IsDualChannel').value;
	var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
	var blackout_height;
	var blackout_width;
	var left_adjustment = 0;
	if(json_type=='Mixer'){
	   	blackout_height=791;
		blackout_width=1200;
	 }
	if(json_type=='s810v2'){
		blackout_height=791;
	   	blackout_width=210;	
	}
	if(json_type=='edp01'){
		blackout_height=791;
	   	blackout_width=210;	
	}
	if(json_type=='nqpaxxx'){
		blackout_height=791;
	   	blackout_width=1560;	
	}
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
	   blackout_height=791;
	   blackout_width=420;	
		if(IsDualChannel==0){
			blackout_width=blackout_width-210;
		}
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
	   blackout_height=791;
	   blackout_width=840;	
		if(IsDualChannel==0){
			blackout_width=blackout_width-210;
		}
		if(IsDualChannel2==0){
			blackout_width=blackout_width-210;
		}
	}
	if(json_type=='nqga400p'){
		blackout_height=791;
	   	blackout_width=840;	
	}
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: blackout_width,
			height: blackout_height,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	canvas.add(menu_blackout);
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: left,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	if(json_type=='Mixer'){
	   height1=365;
	 }
	if(json_type=='nqpaxxx'){
	 	height1=395;
	 }
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
	   height1=545;
	 }
	if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
	   height1=580;
	 }
	if(json_type=='nqga400p'){
	 	height1=120;
	 }

	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: height1, 
			left: left-10, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	canvas.add(menu_background);
	
	// amplifier mute
	if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=65;
		top2=73;
		var mute_menu_background = new fabric.Rect({
			id: 'mute_menu_background',
			name: 'mute_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
		var mute_text = new fabric.Textbox(String('Amplifier Mute'), {
			id: 'mute_text',
			name: 'mute_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
		var mute_menu_touch = new fabric.Group([mute_menu_background, mute_text ], {
			id: 'mute_menu_touch',
			name: 'mute_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(mute_menu_touch);
	}

	// compressor
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=100;
            top2=108;
        } else {
			top1=65;
            top2=73;
		}
	   var compressor_menu_background = new fabric.Rect({
			id: 'compressor_menu_background',
			name: 'compressor_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var compressor_text = new fabric.Textbox(String('Compressor'), {
			id: 'compressor_text',
			name: 'compressor_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var compressor_menu_touch = new fabric.Group([compressor_menu_background, compressor_text ], {
			id: 'compressor_menu_touch',
			name: 'compressor_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(compressor_menu_touch);  
	}
	
	// delay
	if(json_type=='ampg1_4c' || json_type=='ampg1_2c' || json_type=='ampg2_4c' || json_type=='ampg2_2c' ){
		
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=100;
            top2=108;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=135;
            top2=143;
        }
		var delay_menu_background = new fabric.Rect({
			id: 'delay_menu_background',
			name: 'delay_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
		var delay_text = new fabric.Textbox(String('Delay'), {
			id: 'delay_text',
			name: 'delay_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
		var delay_menu_touch = new fabric.Group([delay_menu_background, delay_text ], {
			id: 'delay_menu_touch',
			name: 'delay_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(delay_menu_touch);	
	}
	
	// ducker
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		var ducker_menu_background = new fabric.Rect({
				id: 'ducker_menu_background',
				name: 'ducker_menu_background',
				left: left,
				top: 100,
				originX: 'left',
				originY: 'top',
				width: 200,
				height: 35,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				selectable: false,
				objectCaching: false,
			});
		var ducker_text = new fabric.Textbox(String('Ducker'), {
				id: 'ducker_text',
				name: 'ducker_text',
				left: left+10,
				top: 108,
				width: 200,
				fontWeight: 'bold',
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				editable: false,
			});
		var ducker_menu_touch = new fabric.Group([ducker_menu_background, ducker_text ], {
				id: 'ducker_menu_touch',
				name: 'ducker_menu_touch',
				left: left,
				top: 100,
				angle: 0,
				channel: channel,
				transparentCorners: true,
				hasRotatingPoint: false,
				lockScalingFlip: true,
				hasControls: false,
				lockMovementX: true,
				lockMovementY: true,
				borderColor: 'rgba(46,119,184,0.0)',
				cornerColor: 'rgba(46,119,184,0.0)',
			});
			canvas.add(ducker_menu_touch);
	}
	
	// geq
	if(json_type=='nqga400p'){
	   // don't show
	} else {
        if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=135;
            top2=143;
        }
        if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=135;
            top2=143;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=170;
            top2=178;
        }
        var geq_menu_background = new fabric.Rect({
                id: 'geq_menu_background',
                name: 'geq_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var geq_text = new fabric.Textbox(String('Graphic EQ'), {
                id: 'geq_text',
                name: 'geq_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var geq_menu_touch = new fabric.Group([geq_menu_background, geq_text ], {
                id: 'geq_menu_touch',
                name: 'geq_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(geq_menu_touch);	
	}
	
	// hplp
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=170;
            top2=178;
        }
        if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=170;
            top2=178;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=205;
            top2=213;
        }
        var hplp_menu_background = new fabric.Rect({
                id: 'hplp_menu_background',
                name: 'hplp_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var hplp_text = new fabric.Textbox(String('High/Low Pass'), {
                id: 'geq_text',
                name: 'geq_text',
                left: left+10,
                top: top2,
                width: 300,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var hplp_menu_touch = new fabric.Group([hplp_menu_background, hplp_text ], {
                id: 'hplp_menu_touch',
                name: 'hplp_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(hplp_menu_touch);	
	}
	
	// limiter
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		top1=205;
		top2=213;
	}
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
		top1=205;
		top2=213;
	}
	if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=240;
		top2=248;
	}
	if(json_type=='nqga400p'){
		top1=65;
		top2=73;
	}
	var limiter_menu_background = new fabric.Rect({
			id: 'limiter_menu_background',
			name: 'limiter_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var limiter_text = new fabric.Textbox(String('Limiter'), {
			id: 'limiter_text',
			name: 'limiter_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});	
	var limiter_menu_touch = new fabric.Group([limiter_menu_background, limiter_text ], {
			id: 'limiter_menu_touch',
			name: 'limiter_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(limiter_menu_touch);
	
	// noise gate
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=240;
            top2=248;
        }
        if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=240;
            top2=248;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=275;
            top2=283;
        }
        var noise_gate_menu_background = new fabric.Rect({
                id: 'noise_gate_menu_background',
                name: 'noise_gate_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var noise_gate__text = new fabric.Textbox(String('Noise Gate'), {
                id: 'noise_gate_text',
                name: 'noise_gate_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var noise_gate_menu_touch = new fabric.Group([noise_gate_menu_background, noise_gate__text ], {
                id: 'noise_gate_menu_touch',
                name: 'noise_gate_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(noise_gate_menu_touch);
	}
	
	// peq
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=275;
            top2=283;
        }
        if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=275;
            top2=283;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=310;
            top2=318;
        }
        var peq_menu_background = new fabric.Rect({
                id: 'peq_menu_background',
                name: 'peq_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var peq_text = new fabric.Textbox(String('Parametric EQ'), {
                id: 'peq_text',
                name: 'peq_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var peq_menu_touch = new fabric.Group([peq_menu_background, peq_text ], {
                id: 'peq_menu_touch',
                name: 'peq_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(peq_menu_touch);
	}
	
	// peak limiter, presets, rms limiter
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=310;
		top2=318;
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			top1=345;
			top2=353;
		}
		var peak_limiter_menu_background = new fabric.Rect({
			id: 'peak_limiter_menu_background',
			name: 'peak_limiter_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
		var peak_limiter_text = new fabric.Textbox(String('Peak Limiter'), {
            id: 'peak_limiter_text',
            name: 'peak_limiter_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });
    	var peak_limiter_menu_touch = new fabric.Group([peak_limiter_menu_background, peak_limiter_text ], {
            id: 'peak_limiter_menu_touch',
            name: 'peak_limiter_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: channel,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });
        canvas.add(peak_limiter_menu_touch);
		
		// presets
		top1=345;
		top2=353;
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			top1=380;
			top2=388;
		}
		var presets_menu_background = new fabric.Rect({
			id: 'presets_menu_background',
			name: 'presets_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
       var presets_text = new fabric.Textbox(String('Presets'), {
            id: 'presets_text',
            name: 'presets_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });
    	var presets_menu_touch = new fabric.Group([presets_menu_background, presets_text ], {
            id: 'presets_menu_touch',
            name: 'presets_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: 1,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });
        canvas.add(presets_menu_touch);
		
		// rms limiter
		top1=380;
		top2=388;
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			top1=415;
			top2=423;
		}
		var rms_limiter_menu_background = new fabric.Rect({
			id: 'rms_limiter_menu_background',
			name: 'rms_limiter_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
		var rms_limiter_text = new fabric.Textbox(String('RMS Limiter'), {
            id: 'rms_limiter_text',
            name: 'rms_limiter_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });
    	var rms_limiter_menu_touch = new fabric.Group([rms_limiter_menu_background, rms_limiter_text ], {
            id: 'rms_limiter_menu_touch',
            name: 'rms_limiter_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: channel,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });
        canvas.add(rms_limiter_menu_touch);
	}
	
	// router
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=310;
            top2=318;
        }
        if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
            top1=415;
            top2=423;
        }
        if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
            top1=450;
            top2=458;
        }
        var router_menu_background = new fabric.Rect({
                id: 'router_menu_background',
                name: 'router_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var router_text = new fabric.Textbox(String('Router'), {
                id: 'router_text',
                name: 'router_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var router_menu_touch = new fabric.Group([router_menu_background, router_text ], {
                id: 'router_menu_touch',
                name: 'router_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(router_menu_touch);
	}
	
	// settings
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		top1=345;
		top2=353;
	}
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
		top1=450;
		top2=458;
	}
	if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=485;
		top2=493;
	}
	if(json_type=='nqga400p'){
		top1=100;
		top2=108;
	}
	var settings_menu_background = new fabric.Rect({
			id: 'settings_menu_background',
			name: 'settings_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var settings_text = new fabric.Textbox(String('Settings'), {
			id: 'settings_text',
			name: 'settings_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var settings_menu_touch = new fabric.Group([settings_menu_background, settings_text ], {
			id: 'settings_menu_touch',
			name: 'settings_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(settings_menu_touch);
	
	 // signal present
    if(json_type=='Mixer' || json_type=='nqpaxxx'){
        top1=380;
        top2=388;
    }
    if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
        top1=485;
        top2=493;
    }
    if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
        top1=520;
        top2=528;
    }
	 if(json_type=='nqga400p'){
        top1=135;
        top2=143;
    }
    var signal_present_menu_background = new fabric.Rect({
            id: 'signal_present_menu_background',
            name: 'signal_present_menu_background',
            left: left,
            top: top1,
            originX: 'left',
            originY: 'top',
            width: 200,
            height: 35,
            angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            selectable: false,
            objectCaching: false,
        });
    var signal_present_text = new fabric.Textbox(String('Signal Present'), {
            id: 'signal_present_text',
            name: 'signal_present_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });
    var signal_present_menu_touch = new fabric.Group([signal_present_menu_background, signal_present_text ], {
            id: 'signal_present_menu_touch',
            name: 'signal_present_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: channel,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });

        canvas.add(signal_present_menu_touch);
	 
	// standby
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=415;
		top2=423;
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
			top1=520;
			top2=528;
		}
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			top1=555;
			top2=563;
		}
		var standby_menu_background = new fabric.Rect({
				id: 'standby_menu_background',
				name: 'standby_menu_background',
				left: left,
				top: top1,
				originX: 'left',
				originY: 'top',
				width: 200,
				height: 35,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				selectable: false,
				objectCaching: false,
			});
		var standby_text = new fabric.Textbox(String('Standby'), {
				id: 'standby_text',
				name: 'standby_text',
				left: left+10,
				top: top2,
				width: 200,
				fontWeight: 'bold',
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				editable: false,
			});
		var standby_menu_touch = new fabric.Group([standby_menu_background, standby_text ], {
				id: 'standby_menu_touch',
				name: 'standby_menu_touch',
				left: left,
				top: top1,
				angle: 0,
				channel: channel,
				transparentCorners: true,
				hasRotatingPoint: false,
				lockScalingFlip: true,
				hasControls: false,
				lockMovementX: true,
				lockMovementY: true,
				borderColor: 'rgba(46,119,184,0.0)',
				cornerColor: 'rgba(46,119,184,0.0)',
			});
			canvas.add(standby_menu_touch);
	}
	
	 // status
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c' ||  json_type=='nqpaxxx' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		top1=415;
		top2=423;
		if(json_type=='nqpaxxx'){
			top1=415;
			top2=423;
		}
		if(json_type=='ampg1_2c' || json_type=='ampg1_4c'){
			top1=555;
			top2=563;
		}
		if(json_type=='ampg2_2c' || json_type=='ampg2_4c'){
			top1=590;
			top2=598; 
		}
		var status_menu_background = new fabric.Rect({
				id: 'status_menu_background',
				name: 'status_menu_background',
				left: left,
				top: top1,
				originX: 'left',
				originY: 'top',
				width: 200,
				height: 35,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				selectable: false,
				objectCaching: false,
			});
		var status_text = new fabric.Textbox(String('Status'), {
				id: 'status_text',
				name: 'status_text',
				left: left+10,
				top: top2,
				width: 200,
				fontWeight: 'bold',
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				editable: false,
			});
		var status_menu_touch = new fabric.Group([status_menu_background, status_text ], {
				id: 'status_menu_touch',
				name: 'status_menu_touch',
				left: left,
				top: top1,
				angle: 0,
				channel: channel,
				transparentCorners: true,
				hasRotatingPoint: false,
				lockScalingFlip: true,
				hasControls: false,
				lockMovementX: true,
				lockMovementY: true,
				borderColor: 'rgba(46,119,184,0.0)',
				cornerColor: 'rgba(46,119,184,0.0)',
			});
			canvas.add(status_menu_touch);
	}
}
	
function show_menu_output(left,channel){
	
	clear_menu();
	
	var top1;
	var top2;
	var height1;
	
	var json_type = document.getElementById('json_type').value
	var blackout_height;
	var blackout_width;
	if(json_type=='Mixer'){
	   	blackout_height=791;
		blackout_width=1200;
	 }
	if(json_type=='ampg1_2c'){
	   	blackout_height=791;
		blackout_width=630;
	 }
	if(json_type=='nqpaxxx'){
	   	blackout_height=791;
		blackout_width=1560;
	 }
	if(json_type=='nqga400p'){
	   	blackout_height=791;
		blackout_width=840;
	 }
	
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: blackout_width,
			height: blackout_height,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	canvas.add(menu_blackout);
	
	var left_dropdown;
	if(json_type=='Mixer'){
		left_dropdown=1150;
	 }
	if(json_type=='ampg1_2c'){
		if(channel==4){
			left_dropdown=730;
		}
		if(channel==5){
			left_dropdown=880;
		}
	 }
	if(json_type=='nqpaxxx'){
		if(channel==7){
			left_dropdown=1360;
		}
		if(channel==8){
			left_dropdown=1510;
		}
	 }
	if(json_type=='nqga400p'){
		if(channel==3){
			left_dropdown=580;
		}
		if(channel==4){
			left_dropdown=790;
		}
	 }
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: left_dropdown,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	if(json_type=='Mixer'){
		height1=190;
	}
	if(json_type=='ampg1_2c'){
		height1=185;
	}
	if(json_type=='nqpaxxx'){
	   height1=225;
	 }
	if(json_type=='nqga400p'){
	   height1=160;
	 }
	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: height1, 
			left: left-10, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	canvas.add(menu_background);
	
	// ducker
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		var ducker_menu_background = new fabric.Rect({
				id: 'ducker_menu_background',
				name: 'ducker_menu_background',
				left: left,
				top: 65,
				originX: 'left',
				originY: 'top',
				width: 200,
				height: 35,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				selectable: false,
				objectCaching: false,
			});
		var ducker_text = new fabric.Textbox(String('Ducker'), {
				id: 'ducker_text',
				name: 'ducker_text',
				left: left+10,
				top: 73,
				width: 200,
				fontWeight: 'bold',
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				editable: false,
			});
		var ducker_menu_touch = new fabric.Group([ducker_menu_background, ducker_text ], {
				id: 'ducker_menu_touch',
				name: 'ducker_menu_touch',
				left: left,
				top: 65,
				angle: 0,
				channel: channel,
				transparentCorners: true,
				hasRotatingPoint: false,
				lockScalingFlip: true,
				hasControls: false,
				lockMovementX: true,
				lockMovementY: true,
				borderColor: 'rgba(46,119,184,0.0)',
				cornerColor: 'rgba(46,119,184,0.0)',
			});
			canvas.add(ducker_menu_touch);
	}
	
	// hplp
	if(json_type=='nqga400p'){
        top1=65;
        top2=73;
        var hplp_menu_background = new fabric.Rect({
                id: 'hplp_menu_background',
                name: 'hplp_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var hplp_text = new fabric.Textbox(String('High/Low Pass'), {
                id: 'geq_text',
                name: 'geq_text',
                left: left+10,
                top: top2,
                width: 300,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var hplp_menu_touch = new fabric.Group([hplp_menu_background, hplp_text ], {
                id: 'hplp_menu_touch',
                name: 'hplp_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(hplp_menu_touch);	
	}
	
	// limiter
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=100;
            top2=108;
        }
        if(json_type=='ampg1_2c'){
            top1=65;
            top2=73;
        }
        var limiter_menu_background = new fabric.Rect({
                id: 'limiter_menu_background',
                name: 'limiter_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var limiter_text = new fabric.Textbox(String('Limiter'), {
                id: 'limiter_text',
                name: 'limiter_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var limiter_menu_touch = new fabric.Group([limiter_menu_background, limiter_text ], {
                id: 'limiter_menu_touch',
                name: 'limiter_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(limiter_menu_touch);
	}
	
	// peq
	if(json_type=='nqga400p'){
        top1=100;
        top2=108;
        var peq_menu_background = new fabric.Rect({
                id: 'peq_menu_background',
                name: 'peq_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var peq_text = new fabric.Textbox(String('Parametric EQ'), {
                id: 'peq_text',
                name: 'peq_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var peq_menu_touch = new fabric.Group([peq_menu_background, peq_text ], {
                id: 'peq_menu_touch',
                name: 'peq_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(peq_menu_touch);
	}
	
	// router
	if(json_type=='nqga400p'){
	   // don't show
	} else {
		if(json_type=='Mixer' || json_type=='nqpaxxx'){
            top1=135;
            top2=143;
        }
        if(json_type=='ampg1_2c'){
            top1=100;
            top2=108;
        }
        var router_menu_background = new fabric.Rect({
                id: 'router_menu_background',
                name: 'router_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var router_text = new fabric.Textbox(String('Router'), {
                id: 'router_text',
                name: 'router_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var router_menu_touch = new fabric.Group([router_menu_background, router_text ], {
                id: 'router_menu_touch',
                name: 'router_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(router_menu_touch);
	}
	
	// settings
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		top1=170;
		top2=178;
	}
	if(json_type=='ampg1_2c'){
		top1=135;
		top2=143;
	}
	if(json_type=='nqga400p'){
		top1=135;
		top2=143;
	}
	var settings_menu_background = new fabric.Rect({
			id: 'settings_menu_background',
			name: 'settings_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var settings_text = new fabric.Textbox(String('Settings'), {
			id: 'settings_text',
			name: 'settings_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var settings_menu_touch = new fabric.Group([settings_menu_background, settings_text ], {
			id: 'settings_menu_touch',
			name: 'settings_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(settings_menu_touch);
	
	// signal present
	if(json_type=='Mixer' || json_type=='nqpaxxx'){
		top1=205;
		top2=213;
	}
	if(json_type=='ampg1_2c'){
		top1=170;
		top2=175;
	}
	if(json_type=='nqga400p'){
		top1=170;
		top2=175;
	}
	var signal_present_menu_background = new fabric.Rect({
			id: 'signal_present_menu_background',
			name: 'signal_present_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var signal_present_text = new fabric.Textbox(String('Signal Present'), {
			id: 'signal_present_text',
			name: 'signal_present_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var signal_present_menu_touch = new fabric.Group([signal_present_menu_background, signal_present_text ], {
			id: 'signal_present_menu_touch',
			name: 'signal_present_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(signal_present_menu_touch);
	
	// status
	if(json_type=='ampg1_2c' || json_type=='nqpaxxx'){
		top1=205;
		top2=213;
		if(json_type=='nqpaxxx'){
		   	top1=240;
			top2=248;
		 }
		var status_menu_background = new fabric.Rect({
				id: 'status_menu_background',
				name: 'status_menu_background',
				left: left,
				top: top1,
				originX: 'left',
				originY: 'top',
				width: 200,
				height: 35,
				angle: 0,
				fill: 'rgba(230,230,230,1.0)',
				selectable: false,
				objectCaching: false,
			});
		var status_text = new fabric.Textbox(String('Status'), {
				id: 'status_text',
				name: 'status_text',
				left: left+10,
				top: top2,
				width: 200,
				fontWeight: 'bold',
				fontSize: 18,
				selectable: false,
				hasControls: false,
				fontFamily: 'Arial',
				fill: 'rgba(0,0,0,1.0)',
				editable: false,
			});
		var status_menu_touch = new fabric.Group([status_menu_background, status_text ], {
				id: 'status_menu_touch',
				name: 'status_menu_touch',
				left: left,
				top: top1,
				angle: 0,
				channel: channel,
				transparentCorners: true,
				hasRotatingPoint: false,
				lockScalingFlip: true,
				hasControls: false,
				lockMovementX: true,
				lockMovementY: true,
				borderColor: 'rgba(46,119,184,0.0)',
				cornerColor: 'rgba(46,119,184,0.0)',
			});
			canvas.add(status_menu_touch);
	}
}
	
function show_menu_s810v2(){
	
	clear_menu();
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: 210,
			height: 791,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	
	canvas.add(menu_blackout);
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: 85, 
			left: -5, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	
	canvas.add(menu_background);
	
	var duplexer_menu_background = new fabric.Rect({
			id: 'duplexer_menu_background',
			name: 'duplexer_menu_background',
			left: 5,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});

	var duplexer_text = new fabric.Textbox(String('Intercom Tuning'), {
			id: 'duplexer_text',
			name: 'duplexer_text',
			left: 15,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});

	var duplexer_menu_touch = new fabric.Group([duplexer_menu_background, duplexer_text ], {
			id: 'duplexer_menu_touch',
			name: 'duplexer_menu_touch',
			left: 5,
			top: top1,
			angle: 0,
			channel: 1,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(duplexer_menu_touch);
	
	var top1 = 100;
	var top2 = 108;
	
	var presets_menu_background = new fabric.Rect({
			id: 'presets_menu_background',
			name: 'presets_menu_background',
			left: 5,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});

	var presets_text = new fabric.Textbox(String('Presets'), {
			id: 'presets_text',
			name: 'presets_text',
			left: 15,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});

	var presets_menu_touch = new fabric.Group([presets_menu_background, presets_text ], {
			id: 'presets_menu_touch',
			name: 'presets_menu_touch',
			left: 5,
			top: top1,
			angle: 0,
			channel: 1,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(presets_menu_touch);
}
	
function show_menu_wbc(){
	
	clear_menu();
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: 210,
			height: 791,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	
	canvas.add(menu_blackout);
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: 50, 
			left: -5, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	
	canvas.add(menu_background);
	
	var duplexer_menu_background = new fabric.Rect({
			id: 'duplexer_menu_background',
			name: 'duplexer_menu_background',
			left: 5,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});

	var duplexer_text = new fabric.Textbox(String('Intercom Tuning'), {
			id: 'duplexer_text',
			name: 'duplexer_text',
			left: 15,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});

	var duplexer_menu_touch = new fabric.Group([duplexer_menu_background, duplexer_text ], {
			id: 'duplexer_menu_touch',
			name: 'duplexer_menu_touch',
			left: 5,
			top: top1,
			angle: 0,
			channel: 1,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(duplexer_menu_touch);
}
	
function show_menu_dsc01(channel){
	
	clear_menu();
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: 420,
			height: 791,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	
	canvas.add(menu_blackout);
	
	var temp_left = 160;
	if(channel==2){
	   temp_left = 370;
	}
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: temp_left,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	var menu_background_left = -5;
	if(channel==2){
	   menu_background_left = 205;
	}
	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: 90, 
			left: menu_background_left, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	
	canvas.add(menu_background);
	
	if(channel==1){
	   
        var duplexer_menu_background = new fabric.Rect({
                id: 'duplexer_menu_background',
                name: 'duplexer_menu_background',
                left: 5,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });

        var duplexer_text = new fabric.Textbox(String('Intercom Tuning'), {
                id: 'duplexer_text',
                name: 'duplexer_text',
                left: 15,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });

        var duplexer_menu_touch = new fabric.Group([duplexer_menu_background, duplexer_text ], {
                id: 'duplexer_menu_touch',
                name: 'duplexer_menu_touch',
                left: 5,
                top: top1,
                angle: 0,
                channel: 1,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(duplexer_menu_touch);
	}
	
	if(channel==2){
	   
        var ouputs_background = new fabric.Rect({
                id: 'ouputs_background',
                name: 'ouputs_background',
                left: 215,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });

        var outputs_text = new fabric.Textbox(String('Outputs'), {
                id: 'outputs_text',
                name: 'outputs_text',
                left: 230,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });

        var outputs_menu_touch = new fabric.Group([ouputs_background, outputs_text ], {
                id: 'outputs_menu_touch',
                name: 'outputs_menu_touch',
                left: 215,
                top: top1,
                angle: 0,
                channel: 1,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(outputs_menu_touch);
	}
	
	top1 = 100;
	top2 = 108;
	
	var left1 = 5;
	if(channel==2){
	   left1 = 215;
	}
	var left2 = 15;
	if(channel==2){
	   left2 = 230;
	}
	var settings_menu_background = new fabric.Rect({
			id: 'settings_menu_background',
			name: 'settings_menu_background',
			left: left1,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});

	var settings_text = new fabric.Textbox(String('Settings'), {
			id: 'settings_text',
			name: 'settings_text',
			left: left2,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});

	var settings_menu_touch = new fabric.Group([settings_menu_background, settings_text ], {
			id: 'settings_menu_touch',
			name: 'settings_menu_touch',
			left: left1 ,
			top: top1,
			angle: 0,
			channel: 1,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(settings_menu_touch);
}
	
function show_menu_edp01(){
	
	clear_menu();
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
			id: 'menu_blackout',
			name: 'menu_blackout',
			left: 0,
			top: 0,
			originX: 'left',
			originY: 'top',
			width: 210,
			height: 791,
			angle: 0,
			fill: 'rgba(0,0,0,0.5)',
			selectable: false,
			objectCaching: false,
		});
	
	canvas.add(menu_blackout);
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
		var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
		  id: 'dropdown_temp',
		  name: 'dropdown_temp',
		  type: 'dropdown_temp',
		  channel: 1,
		  left: 160,
		  top: 17,
		  angle: 0,
		  opacity: 1.0,	
		  selectable: false,
		  hasControls: false,
		});
		canvas.add(dropdown_button1Instance);
	
	var menu_background = new fabric.Rect({
			id: 'menu_background',
			name: 'menu_background',
			width: 201, 
			height: 50, 
			left: -5, 
			top: 47, 
			angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            strokeWidth: 20,
            strokeLineJoin: 'round',
            rx: 5,
            ry: 5,
			selectable: false,
		  	hasControls: false,
		});
	
	canvas.add(menu_background);
	
	var duplexer_menu_background = new fabric.Rect({
			id: 'duplexer_menu_background',
			name: 'duplexer_menu_background',
			left: 5,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});

	var duplexer_text = new fabric.Textbox(String('Intercom Tuning'), {
			id: 'duplexer_text',
			name: 'duplexer_text',
			left: 15,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});

	var duplexer_menu_touch = new fabric.Group([duplexer_menu_background, duplexer_text ], {
			id: 'duplexer_menu_touch',
			name: 'duplexer_menu_touch',
			left: 5,
			top: top1,
			angle: 0,
			channel: 1,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(duplexer_menu_touch);
}
	
function show_menu_nqga20(){
	
	clear_menu();
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
        id: 'menu_blackout',
        name: 'menu_blackout',
        left: 0,
        top: 0,
        originX: 'left',
        originY: 'top',
        width: 210,
        height: 791,
        angle: 0,
        fill: 'rgba(0,0,0,0.5)',
        selectable: false,
        objectCaching: false,
    });
	canvas.add(menu_blackout);
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
    var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
      id: 'dropdown_temp',
      name: 'dropdown_temp',
      type: 'dropdown_temp',
      channel: 1,
      left: 160,
      top: 17,
      angle: 0,
      opacity: 1.0,	
      selectable: false,
      hasControls: false,
    });
    canvas.add(dropdown_button1Instance);
	
	var menu_background = new fabric.Rect({
        id: 'menu_background',
        name: 'menu_background',
        width: 201, 
        height: 260, 
        left: -5, 
        top: 47, 
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        strokeWidth: 20,
        strokeLineJoin: 'round',
        rx: 5,
        ry: 5,
        selectable: false,
        hasControls: false,
    });
	canvas.add(menu_background);
	
    var compressor_menu_background = new fabric.Rect({
        id: 'compressor_menu_background',
        name: 'compressor_menu_background',
        left: 5,
        top: 65,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });

    var compressor_text = new fabric.Textbox(String('Compressor'), {
        id: 'compressor_text',
        name: 'compressor_text',
        left: 15,
        top: 73,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });

    var compressor_menu_touch = new fabric.Group([compressor_menu_background, compressor_text ], {
        id: 'compressor_menu_touch',
        name: 'compressor_menu_touch',
        left: 5,
        top: 65,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(compressor_menu_touch);
	
	var hplp_menu_background = new fabric.Rect({
        id: 'hplp_menu_background',
        name: 'hplp_menu_background',
        left: 5,
        top: 100,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });
	
	var hplp_text = new fabric.Textbox(String('High/Low Pass'), {
        id: 'hplp_text',
        name: 'hplp_text',
        left: 15,
        top: 108,
        width: 300,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var hplp_menu_touch = new fabric.Group([hplp_menu_background, hplp_text ], {
        id: 'hplp_menu_touch',
        name: 'hplp_menu_touch',
        left: 5,
        top: 100,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(hplp_menu_touch);
	
	var limiter_menu_background = new fabric.Rect({
        id: 'limiter_menu_background',
        name: 'limiter_menu_background',
        left: 5,
        top: 135,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });

	var limiter_text = new fabric.Textbox(String('Limiter'), {
        id: 'limiter_text',
        name: 'limiter_text',
        left: 15,
        top: 143,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var limiter_menu_touch = new fabric.Group([limiter_menu_background, limiter_text ], {
        id: 'limiter_menu_touch',
        name: 'limiter_menu_touch',
        left: 5,
        top: 135,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(limiter_menu_touch);
	
	var outputs_menu_background = new fabric.Rect({
        id: 'outputs_menu_background',
        name: 'outputs_menu_background',
        left: 5,
        top: 170,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });

	var outputs_text = new fabric.Textbox(String('Outputs'), {
        id: 'outputs_text',
        name: 'outputs_text',
        left: 15,
        top: 178,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var outputs_menu_touch = new fabric.Group([outputs_menu_background, outputs_text ], {
        id: 'outputs_menu_touch',
        name: 'outputs_menu_touch',
        left: 5,
        top: 170,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(outputs_menu_touch);
	
	
	var peq_menu_background = new fabric.Rect({
        id: 'peq_menu_background',
        name: 'peq_menu_background',
        left: 5,
        top: 205,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });
	
	var peq_text = new fabric.Textbox(String('Parametric EQ'), {
        id: 'peq_text',
        name: 'peq_text',
        left: 15,
        top: 213,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var peq_menu_touch = new fabric.Group([peq_menu_background, peq_text ], {
        id: 'peq_menu_touch',
        name: 'peq_menu_touch',
        left: 5,
        top: 205,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(peq_menu_touch);	
	
	var settings_menu_background = new fabric.Rect({
        id: 'settings_menu_background',
        name: 'settings_menu_background',
        left: 5,
        top: 240,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });
	
	var settings_text = new fabric.Textbox(String('Settings'), {
        id: 'settings_text',
        name: 'settings_text',
        left: 15,
        top: 248,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var settings_menu_touch = new fabric.Group([settings_menu_background, settings_text ], {
        id: 'settings_menu_touch',
        name: 'settings_menu_touch',
        left: 5,
        top: 240,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
	canvas.add(settings_menu_touch);
	
	var signal_present_menu_background = new fabric.Rect({
        id: 'signal_present_menu_background',
        name: 'signal_present_menu_background',
        left: 5,
        top: 275,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });
	
	var signal_present_text = new fabric.Textbox(String('Signal Present'), {
        id: 'signal_present_text',
        name: 'signal_present_text',
        left: 15,
        top: 283,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });
		
	var signal_present_menu_touch = new fabric.Group([signal_present_menu_background, signal_present_text ], {
        id: 'signal_present_menu_touch',
        name: 'signal_present_menu_touch',
        left: 5,
        top: 275,
        angle: 0,
        channel: 1,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });

	canvas.add(signal_present_menu_touch);
}

function show_menu_nqga40p3(left,channel){
	
	var top1 = 65;
	var top2 = 73;
	
	var menu_blackout = new fabric.Rect({
        id: 'menu_blackout',
        name: 'menu_blackout',
        left: 0,
        top: 0,
        originX: 'left',
        originY: 'top',
        width: 420,
        height: 791,
        angle: 0,
        fill: 'rgba(0,0,0,0.5)',
        selectable: false,
        objectCaching: false,
    });
	canvas.add(menu_blackout);
	
	var left_dropdown = 0;
	
	if(channel==1){
	   left_dropdown = 160;
	 }
	if(channel==2){
	   left_dropdown = 370;
	}
	
	var dropdown_button1Element = document.getElementById('dropdown_button1');
    var dropdown_button1Instance = new fabric.Image(dropdown_button1Element, {
      id: 'dropdown_temp',
      name: 'dropdown_temp',
      type: 'dropdown_temp',
      channel: 1,
      left: left_dropdown,
      top: 17,
      angle: 0,
      opacity: 1.0,	
      selectable: false,
      hasControls: false,
    });
    canvas.add(dropdown_button1Instance);
	
	var height1 = 0;
	
	if(channel==1){
	   	height1 = 120;
	 }
	if(channel==2){
	   	height1 = 265;
	}
	
	var menu_background = new fabric.Rect({
        id: 'menu_background',
        name: 'menu_background',
        width: 201, 
        height: height1, 
        left: left-10, 
        top: 47, 
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        strokeWidth: 20,
        strokeLineJoin: 'round',
        rx: 5,
        ry: 5,
        selectable: false,
        hasControls: false,
    });
	canvas.add(menu_background);
	
	if(channel==2){
		top1=135;
        top2=143;
	}
	
    var limiter_menu_background = new fabric.Rect({
        id: 'limiter_menu_background',
        name: 'limiter_menu_background',
        left: left,
        top: top1,
        originX: 'left',
        originY: 'top',
        width: 200,
        height: 35,
        angle: 0,
        fill: 'rgba(230,230,230,1.0)',
        selectable: false,
        objectCaching: false,
    });
var limiter_text = new fabric.Textbox(String('Limiter'), {
        id: 'limiter_text',
        name: 'limiter_text',
        left: left+10,
        top: top2,
        width: 200,
        fontWeight: 'bold',
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fill: 'rgba(0,0,0,1.0)',
        editable: false,
    });	
var limiter_menu_touch = new fabric.Group([limiter_menu_background, limiter_text ], {
        id: 'limiter_menu_touch',
        name: 'limiter_menu_touch',
        left: left,
        top: top1,
        angle: 0,
        channel: channel,
        transparentCorners: true,
        hasRotatingPoint: false,
        lockScalingFlip: true,
        hasControls: false,
        lockMovementX: true,
        lockMovementY: true,
        borderColor: 'rgba(46,119,184,0.0)',
        cornerColor: 'rgba(46,119,184,0.0)',
    });
    canvas.add(limiter_menu_touch);
	
	if(channel==1){
		top1=100;
		top2=108;
	}
	if(channel==2){
		top1=240;
		top2=248;
	}
	
	var settings_menu_background = new fabric.Rect({
			id: 'settings_menu_background',
			name: 'settings_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var settings_text = new fabric.Textbox(String('Settings'), {
			id: 'settings_text',
			name: 'settings_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var settings_menu_touch = new fabric.Group([settings_menu_background, settings_text ], {
			id: 'settings_menu_touch',
			name: 'settings_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(settings_menu_touch);
	
	if(channel==1){
		top1=135;
		top2=143;
	}
	if(channel==2){
		top1=275;
		top2=283;
	}
	
	 var signal_present_menu_background = new fabric.Rect({
            id: 'signal_present_menu_background',
            name: 'signal_present_menu_background',
            left: left,
            top: top1,
            originX: 'left',
            originY: 'top',
            width: 200,
            height: 35,
            angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            selectable: false,
            objectCaching: false,
        });
    var signal_present_text = new fabric.Textbox(String('Signal Present'), {
            id: 'signal_present_text',
            name: 'signal_present_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });
    var signal_present_menu_touch = new fabric.Group([signal_present_menu_background, signal_present_text ], {
            id: 'signal_present_menu_touch',
            name: 'signal_present_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: channel,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });
        canvas.add(signal_present_menu_touch);
	
	if(channel==2){
		top1=65;
		top2=73;
		
		var compressor_menu_background = new fabric.Rect({
			id: 'compressor_menu_background',
			name: 'compressor_menu_background',
			left: left,
			top: top1,
			originX: 'left',
			originY: 'top',
			width: 200,
			height: 35,
			angle: 0,
			fill: 'rgba(230,230,230,1.0)',
			selectable: false,
			objectCaching: false,
		});
	var compressor_text = new fabric.Textbox(String('Compressor'), {
			id: 'compressor_text',
			name: 'compressor_text',
			left: left+10,
			top: top2,
			width: 200,
			fontWeight: 'bold',
			fontSize: 18,
			selectable: false,
		    hasControls: false,
			fontFamily: 'Arial',
			fill: 'rgba(0,0,0,1.0)',
			editable: false,
		});
	var compressor_menu_touch = new fabric.Group([compressor_menu_background, compressor_text ], {
			id: 'compressor_menu_touch',
			name: 'compressor_menu_touch',
			left: left,
			top: top1,
			angle: 0,
			channel: channel,
			transparentCorners: true,
			hasRotatingPoint: false,
			lockScalingFlip: true,
			hasControls: false,
			lockMovementX: true,
			lockMovementY: true,
			borderColor: 'rgba(46,119,184,0.0)',
			cornerColor: 'rgba(46,119,184,0.0)',
		});
		canvas.add(compressor_menu_touch);  
		
		top1=100;
		top2=108;
	
       var hplp_menu_background = new fabric.Rect({
                  id: 'hplp_menu_background',
                  name: 'hplp_menu_background',
                  left: left,
                  top: top1,
                  originX: 'left',
                  originY: 'top',
                  width: 200,
                  height: 35,
                  angle: 0,
                  fill: 'rgba(230,230,230,1.0)',
                  selectable: false,
                  objectCaching: false,
              });
          var hplp_text = new fabric.Textbox(String('High/Low Pass'), {
                  id: 'geq_text',
                  name: 'geq_text',
                  left: left+10,
                  top: top2,
                  width: 300,
                  fontWeight: 'bold',
                  fontSize: 18,
                  selectable: false,
                  hasControls: false,
                  fontFamily: 'Arial',
                  fill: 'rgba(0,0,0,1.0)',
                  editable: false,
              });
          var hplp_menu_touch = new fabric.Group([hplp_menu_background, hplp_text ], {
                  id: 'hplp_menu_touch',
                  name: 'hplp_menu_touch',
                  left: left,
                  top: top1,
                  angle: 0,
                  channel: channel,
                  transparentCorners: true,
                  hasRotatingPoint: false,
                  lockScalingFlip: true,
                  hasControls: false,
                  lockMovementX: true,
                  lockMovementY: true,
                  borderColor: 'rgba(46,119,184,0.0)',
                  cornerColor: 'rgba(46,119,184,0.0)',
              });
              canvas.add(hplp_menu_touch);
		
		top1=170;
		top2=178;
		
        var outputs_menu_background = new fabric.Rect({
            id: 'outputs_menu_background',
            name: 'outputs_menu_background',
            left: left,
            top: top1,
            originX: 'left',
            originY: 'top',
            width: 200,
            height: 35,
            angle: 0,
            fill: 'rgba(230,230,230,1.0)',
            selectable: false,
            objectCaching: false,
        });

        var outputs_text = new fabric.Textbox(String('Outputs'), {
            id: 'outputs_text',
            name: 'outputs_text',
            left: left+10,
            top: top2,
            width: 200,
            fontWeight: 'bold',
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fill: 'rgba(0,0,0,1.0)',
            editable: false,
        });

        var outputs_menu_touch = new fabric.Group([outputs_menu_background, outputs_text ], {
            id: 'outputs_menu_touch',
            name: 'outputs_menu_touch',
            left: left,
            top: top1,
            angle: 0,
            channel: 1,
            transparentCorners: true,
            hasRotatingPoint: false,
            lockScalingFlip: true,
            hasControls: false,
            lockMovementX: true,
            lockMovementY: true,
            borderColor: 'rgba(46,119,184,0.0)',
            cornerColor: 'rgba(46,119,184,0.0)',
        });
        canvas.add(outputs_menu_touch);
		
		top1=205;
		top2=213;
		
         var peq_menu_background = new fabric.Rect({
                id: 'peq_menu_background',
                name: 'peq_menu_background',
                left: left,
                top: top1,
                originX: 'left',
                originY: 'top',
                width: 200,
                height: 35,
                angle: 0,
                fill: 'rgba(230,230,230,1.0)',
                selectable: false,
                objectCaching: false,
            });
        var peq_text = new fabric.Textbox(String('Parametric EQ'), {
                id: 'peq_text',
                name: 'peq_text',
                left: left+10,
                top: top2,
                width: 200,
                fontWeight: 'bold',
                fontSize: 18,
                selectable: false,
                hasControls: false,
                fontFamily: 'Arial',
                fill: 'rgba(0,0,0,1.0)',
                editable: false,
            });
        var peq_menu_touch = new fabric.Group([peq_menu_background, peq_text ], {
                id: 'peq_menu_touch',
                name: 'peq_menu_touch',
                left: left,
                top: top1,
                angle: 0,
                channel: channel,
                transparentCorners: true,
                hasRotatingPoint: false,
                lockScalingFlip: true,
                hasControls: false,
                lockMovementX: true,
                lockMovementY: true,
                borderColor: 'rgba(46,119,184,0.0)',
                cornerColor: 'rgba(46,119,184,0.0)',
            });
            canvas.add(peq_menu_touch);
	}
}
	
function clear_menu(){
	
	if(typeof menu_timer !== "undefined"){
  		clearTimeout(menu_timer);
	}
	canvas.remove(canvas.getItemByName('router_menu_touch'));
	canvas.remove(canvas.getItemByName('peq_menu_touch'));
	canvas.remove(canvas.getItemByName('geq_menu_touch'));
	canvas.remove(canvas.getItemByName('compressor_menu_touch'));
	canvas.remove(canvas.getItemByName('noise_gate_menu_touch'));
	canvas.remove(canvas.getItemByName('limiter_menu_touch'));
	canvas.remove(canvas.getItemByName('mute_menu_touch'));
	canvas.remove(canvas.getItemByName('signal_present_menu_touch'));
	canvas.remove(canvas.getItemByName('ducker_menu_touch'));
	canvas.remove(canvas.getItemByName('settings_menu_touch'));
	canvas.remove(canvas.getItemByName('status_menu_touch'));
	canvas.remove(canvas.getItemByName('standby_menu_touch'));
	canvas.remove(canvas.getItemByName('menu_blackout'));
	canvas.remove(canvas.getItemByName('menu_background'));
	canvas.remove(canvas.getItemByName('dropdown_temp'));
	canvas.remove(canvas.getItemByName('hplp_menu_touch'));
	canvas.remove(canvas.getItemByName('duplexer_menu_touch'));
	canvas.remove(canvas.getItemByName('presets_menu_touch'));
	canvas.remove(canvas.getItemByName('outputs_menu_touch'));
	canvas.remove(canvas.getItemByName('delay_menu_touch'));
	canvas.remove(canvas.getItemByName('phase_invert_menu_touch'));
	canvas.remove(canvas.getItemByName('peak_limiter_menu_touch'));
	canvas.remove(canvas.getItemByName('rms_limiter_menu_touch'));
}
	
function menu_to_front(){

	var menu_blackout = canvas.getItemByName('menu_blackout');
	var menu_background = canvas.getItemByName('menu_background');
	var input_blackout = canvas.getItemByName('input_blackout');
	var input_background = canvas.getItemByName('input_background');
	var dropdown_temp = canvas.getItemByName('dropdown_temp');
	var compressor_menu_touch = canvas.getItemByName('compressor_menu_touch');
	var ducker_menu_touch = canvas.getItemByName('ducker_menu_touch');
	var geq_menu_touch = canvas.getItemByName('geq_menu_touch');
	var hplp_menu_touch = canvas.getItemByName('hplp_menu_touch');
	var limiter_menu_touch = canvas.getItemByName('limiter_menu_touch');
	var mute_menu_touch = canvas.getItemByName('mute_menu_touch');
	var noise_gate_menu_touch = canvas.getItemByName('noise_gate_menu_touch');
	var peq_menu_touch = canvas.getItemByName('peq_menu_touch');
	var router_menu_touch = canvas.getItemByName('router_menu_touch');
	var signal_present_menu_touch = canvas.getItemByName('signal_present_menu_touch');
	var settings_menu_touch = canvas.getItemByName('settings_menu_touch');
	var status_menu_touch = canvas.getItemByName('status_menu_touch');
	var standby_menu_touch = canvas.getItemByName('standby_menu_touch');
	var duplexer_menu_touch = canvas.getItemByName('duplexer_menu_touch');
	var presets_menu_touch = canvas.getItemByName('presets_menu_touch');
	var outputs_menu_touch = canvas.getItemByName('outputs_menu_touch');
	var delay_menu_touch = canvas.getItemByName('delay_menu_touch');
	var phase_invert_menu_touch = canvas.getItemByName('phase_invert_menu_touch');
	var peak_limiter_menu_touch = canvas.getItemByName('peak_limiter_menu_touch');
	var rms_limiter_menu_touch = canvas.getItemByName('rms_limiter_menu_touch');
	
	var header_text = canvas.getItemByName('header_text');
	
	canvas.bringToFront(menu_blackout);
	canvas.bringToFront(menu_background);
	canvas.bringToFront(input_blackout);
	canvas.bringToFront(input_background);
	canvas.bringToFront(dropdown_temp);
	canvas.bringToFront(compressor_menu_touch);
	canvas.bringToFront(ducker_menu_touch);
	canvas.bringToFront(geq_menu_touch);
	canvas.bringToFront(hplp_menu_touch);
	canvas.bringToFront(limiter_menu_touch);
	canvas.bringToFront(mute_menu_touch);
	canvas.bringToFront(noise_gate_menu_touch);
	canvas.bringToFront(peq_menu_touch);
	canvas.bringToFront(router_menu_touch);
	canvas.bringToFront(signal_present_menu_touch);
	canvas.bringToFront(settings_menu_touch);
	canvas.bringToFront(status_menu_touch);
	canvas.bringToFront(standby_menu_touch);
	canvas.bringToFront(duplexer_menu_touch);
	canvas.bringToFront(presets_menu_touch);
	canvas.bringToFront(outputs_menu_touch);
	canvas.bringToFront(delay_menu_touch);
	canvas.bringToFront(phase_invert_menu_touch);
	canvas.bringToFront(peak_limiter_menu_touch);
	canvas.bringToFront(rms_limiter_menu_touch);
	canvas.bringToFront(header_text);
}
	
function get_router_data(input_name){
	for(var x=0;x<router_data_array.length;x++){
		var name = router_data_array[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array[x]['name'];
			var p = router_data_array[x]['parameter'];
			var il = router_data_array[x]['indicator_left'];
			var it = router_data_array[x]['indicator_top'];
			var tl = router_data_array[x]['text_left'];
			var tt = router_data_array[x]['text_top'];
			var bl = router_data_array[x]['button_left'];
			var bt = router_data_array[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_router_data2(input_name){
	for(var x=0;x<router_data_array2.length;x++){
		var name = router_data_array2[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array2[x]['name'];
			var p = router_data_array2[x]['parameter'];
			var il = router_data_array2[x]['indicator_left'];
			var it = router_data_array2[x]['indicator_top'];
			var tl = router_data_array2[x]['text_left'];
			var tt = router_data_array2[x]['text_top'];
			var bl = router_data_array2[x]['button_left'];
			var bt = router_data_array2[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_router_data3(input_name){
	for(var x=0;x<router_data_array3.length;x++){
		var name = router_data_array3[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array3[x]['name'];
			var p = router_data_array3[x]['parameter'];
			var il = router_data_array3[x]['indicator_left'];
			var it = router_data_array3[x]['indicator_top'];
			var tl = router_data_array3[x]['text_left'];
			var tt = router_data_array3[x]['text_top'];
			var bl = router_data_array3[x]['button_left'];
			var bt = router_data_array3[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_router_data4(input_name){
	for(var x=0;x<router_data_array4.length;x++){
		var name = router_data_array4[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array4[x]['name'];
			var p = router_data_array4[x]['parameter'];
			var il = router_data_array4[x]['indicator_left'];
			var it = router_data_array4[x]['indicator_top'];
			var tl = router_data_array4[x]['text_left'];
			var tt = router_data_array4[x]['text_top'];
			var bl = router_data_array4[x]['button_left'];
			var bt = router_data_array4[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_router_data5(input_name){
	for(var x=0;x<router_data_array5.length;x++){
		var name = router_data_array5[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array5[x]['name'];
			var p = router_data_array5[x]['parameter'];
			var il = router_data_array5[x]['indicator_left'];
			var it = router_data_array5[x]['indicator_top'];
			var tl = router_data_array5[x]['text_left'];
			var tt = router_data_array5[x]['text_top'];
			var bl = router_data_array5[x]['button_left'];
			var bt = router_data_array5[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_router_data6(input_name){
	for(var x=0;x<router_data_array6.length;x++){
		var name = router_data_array6[x]['name'];
		if('router_touch_'+ name==input_name){
			var n = router_data_array6[x]['name'];
			var p = router_data_array6[x]['parameter'];
			var il = router_data_array6[x]['indicator_left'];
			var it = router_data_array6[x]['indicator_top'];
			var tl = router_data_array6[x]['text_left'];
			var tt = router_data_array6[x]['text_top'];
			var bl = router_data_array6[x]['button_left'];
			var bt = router_data_array6[x]['button_top'];
			var array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,button_left:bl,button_top:bt};
			return array;
		}
	}
}
function get_peq_data(input_type,input_parameter){
	
	var json_type = document.getElementById('json_type').value;
	var array;
	var data_array;
	if(json_type=='nqga400p'){
		data_array = peq_data_array_5;
	} else {
		data_array = peq_data_array;
	}
	data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var type = data['type'];
		var name = data['name'];
		if(input_type=='peq_touch_freq'){
		   input_type='freq';
		}
		if(input_type=='peq_touch_q'){
		   input_type='q';
		}
		if(input_type=='peq_touch_fader'){
		   input_type='fader';
		}
		if(parameter==input_parameter && type==input_type){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	return array;
}
function get_compressor_data(input_parameter){
	var array;
	compressor_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
function get_limiter_data(input_parameter){
	var array;
	limiter_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
function get_noise_gate_data(input_parameter){
	var array;
	noise_gate_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
	
function get_signal_present_data(input_parameter){
	var array;
	signal_present_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
	
function get_ducker_data(input_parameter){
	var array;
	ducker_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
	
function get_hplp_data(input_parameter,input_type2){
	var array;
	hplp_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		var type2 = data['type2'];
		
		if(parameter==input_parameter && input_type2 == type2){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			var ty = data['type2'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,type2:ty};
		}
	});
	
	return array;
}
	
function get_main_data(input_name2){
	var array;
	main_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(name==input_name2){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,};
		}
	});
	
	return array;
}
	
function get_main_data2(input_name2){
	var array;
	main_data_array2.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(name==input_name2){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,};
		}
	});
	
	return array;
}
function get_main_data3(input_name2){
	var array;
	main_data_array3.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(name==input_name2){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,};
		}
	});
	
	return array;
}
function get_main_data4(input_name2){
	var array;
	main_data_array4.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(name==input_name2){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt,};
		}
	});
	
	return array;
}
	
function get_peak_limiter_data(input_parameter){
	var array;
	peak_limiter_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}

function get_rms_limiter_data(input_parameter){
	var array;
	rms_limiter_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		
		if(parameter==input_parameter){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
function get_standby_data(input_amp){
	var array;
	standby_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		var input_name;
		if(input_amp=='ab'){
		   input_name = 'standby_Threshold_ab';
		}
		if(input_amp=='cd'){
		   input_name = 'standby_Threshold_cd';
		}
		
		if(name==input_name){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
function get_mute_data(input_amp){
	var array;
	mute_data_array.forEach(function (data) {
		var parameter = data['parameter'];
		var name = data['name'];
		var input_name;
		if(input_amp=='ab'){
		   input_name = 'mute_Threshold_ab';
		}
		if(input_amp=='cd'){
		   input_name = 'mute_Threshold_cd';
		}
		
		if(name==input_name){
		    var n = data['name'];
			var p = data['parameter'];
			var il = data['indicator_left'];
			var it = data['indicator_top'];
			var tl = data['text_left'];
			var tt = data['text_top'];
			array = {name:n,parameter:p,indicator_left:il,indicator_top:it,text_left:tl,text_top:tt};
		}
	});
	
	return array;
}
	
$( window ).resize(function() {
	var router_view = document.getElementById('router_view').value;
	// console.log('window resized',router_view);
	
	 if(router_view=='main'){
	   reset_modal_fields();
	 }
	 if(router_view=='settings'){
	   reset_fields();
	 }
	 if(router_view=='hplp'){
	   reset_hplp_fields();
	 }
	 if(router_view=='peq'){
	   reset_peq_fields();
	 }
	 if(router_view=='presets'){
	   reset_presets_fields();
	 }
	if(router_view=='mute'){
	   reset_mute_fields();
	 }
	if(router_view=='standby'){
	   reset_standby_fields();
	 }
	if(router_view=='delay'){
	   reset_delay_fields();
	 }
	if(router_view=='compressor'){
	   reset_modal_fields();
	 }
	if(router_view=='limiter'){
	   reset_modal_fields();
	 }
	if(router_view=='noise_gate'){
	   reset_modal_fields();
	 }
	if(router_view=='peak_limiter'){
	   reset_modal_fields();
	 }
	if(router_view=='rms_limiter'){
	   reset_modal_fields();
	 }
	if(router_view=='signal_present'){
	   reset_modal_fields();
	 }
	if(router_view=='router'){
	   reset_modal_fields();
	 }
	if(router_view=='ducker'){
	   reset_modal_fields();
	 }
});
	
function reset_fields(){
	
	var json_type = document.getElementById('json_type').value;
	var IsDualChannel = document.getElementById('IsDualChannel').value;
	var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
	
	var top3 = 180;
	if(IsDualChannel==0 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')){
		top3 = 130;
	}
	var top4 = 230;
	if(IsDualChannel==0 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')){
		top4 = top4-50;
	}
	
	var top5=280;
	if(IsDualChannel==0 && json_type=='ampg1_4c'){
		top5 = top5-50;
	}
	if(IsDualChannel2==0 && json_type=='ampg1_4c'){
		top5 = top5-50;
	}
	
	var top6=330;
	if(IsDualChannel==0 && json_type=='ampg1_4c'){
		top6 = top6-50;
	}
	if(IsDualChannel2==0 && json_type=='ampg1_4c'){
		top6 = top6-50;
	}
	 
	var text_field1 = document.getElementById('name1_input');
	text_field1.style.left = canvas._offset.left+110+'px';
	text_field1.style.top = canvas._offset.top+80+'px';

	var text_field2 = document.getElementById('name2_input');
	text_field2.style.left = canvas._offset.left+110+'px';
	text_field2.style.top = canvas._offset.top+130+'px';
	
	if(json_type!='ampg2_2c' && json_type!='nqga40'){
		var text_field3 = document.getElementById('name3_input');
		text_field3.style.left = canvas._offset.left+110+'px';
		text_field3.style.top = canvas._offset.top+top3+'px';
	}
	
	if(json_type=='Mixer'){
		
		var text_field4 = document.getElementById('name4_input');
		text_field4.style.left = canvas._offset.left+110+'px';
		text_field4.style.top = canvas._offset.top+top4+'px';

		var text_field5 = document.getElementById('name5_input');
		text_field5.style.left = canvas._offset.left+110+'px';
		text_field5.style.top = canvas._offset.top+330+'px';
	
		var text_field6 = document.getElementById('name6_input');
		text_field6.style.left = canvas._offset.left+110+'px';
		text_field6.style.top = canvas._offset.top+280+'px';
	} 
	if(json_type=='nqpaxxx'){
		
		var text_field4 = document.getElementById('name4_input');
		text_field4.style.left = canvas._offset.left+110+'px';
		text_field4.style.top = canvas._offset.top+top4+'px';

		var text_field5 = document.getElementById('name5_input');
		text_field5.style.left = canvas._offset.left+110+'px';
		text_field5.style.top = canvas._offset.top+280+'px';
	
		var text_field6 = document.getElementById('name6_input');
		text_field6.style.left = canvas._offset.left+110+'px';
		text_field6.style.top = canvas._offset.top+330+'px';
		
		var text_field7 = document.getElementById('name7_input');
		text_field7.style.left = canvas._offset.left+110+'px';
		text_field7.style.top = canvas._offset.top+380+'px';
		
		var text_field8 = document.getElementById('name8_input');
		text_field8.style.left = canvas._offset.left+110+'px';
		text_field8.style.top = canvas._offset.top+430+'px';
	} 
	if(json_type=='ampg1_4c'){
		
		var text_field4 = document.getElementById('name4_input');
		text_field4.style.left = canvas._offset.left+110+'px';
		text_field4.style.top = canvas._offset.top+top4+'px';
	} 
	if(json_type=='ampg2_4c'){
		var text_field4 = document.getElementById('name4_input');
		text_field4.style.left = canvas._offset.left+110+'px';
		text_field4.style.top = canvas._offset.top+top4+'px';
	}
	if(json_type=='Mixer'){
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='ampg1_2c'){
		if(IsDualChannel==0){
		   document.getElementById('name2_input').type = 'hidden';
		 }
		document.getElementById('name3_input').type = 'hidden';
		document.getElementById('name4_input').type = 'hidden';
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='ampg1_4c'){
		if(IsDualChannel==0){
		   document.getElementById('name2_input').type = 'hidden';
		 }
		if(IsDualChannel2==0){
		   document.getElementById('name4_input').type = 'hidden';
		 }
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='nqga20'){
		document.getElementById('name2_input').type = 'hidden';
		document.getElementById('name3_input').type = 'hidden';
		document.getElementById('name4_input').type = 'hidden';
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='nqga40'){
		document.getElementById('name3_input').type = 'hidden';
		document.getElementById('name4_input').type = 'hidden';
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='ampg2_2c'){
		if(IsDualChannel==0){
		   document.getElementById('name2_input').type = 'hidden';
		 }
		document.getElementById('name3_input').type = 'hidden';
		document.getElementById('name4_input').type = 'hidden';
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='ampg2_4c'){
		if(IsDualChannel==0){
		   document.getElementById('name2_input').type = 'hidden';
		 }
		if(IsDualChannel2==0){
		   document.getElementById('name4_input').type = 'hidden';
		 }
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='nqga400p'){
		
		var text_field4 = document.getElementById('name4_input');
		text_field4.style.left = canvas._offset.left+110+'px';
		text_field4.style.top = canvas._offset.top+top4+'px';
		
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}
	if(json_type=='nq-dsc01'){
		document.getElementById('name3_input').type = 'hidden';
		document.getElementById('name4_input').type = 'hidden';
		document.getElementById('name5_input').type = 'hidden';
		document.getElementById('name6_input').type = 'hidden';
		document.getElementById('name7_input').type = 'hidden';
		document.getElementById('name8_input').type = 'hidden';
	}

	var color1_input = document.getElementById('color1_input');
	color1_input.style.left = canvas._offset.left+300+'px';
	color1_input.style.top = canvas._offset.top+80+'px';
	color1_input.style.visibility = 'visible';

	if((IsDualChannel==1 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')) || json_type=='Mixer' || json_type=='nqpaxxx' || json_type=='nqga400p' || json_type=='nqga40' || json_type=='nq-dsc01'){  
	   var color2_input = document.getElementById('color2_input');
		color2_input.style.left = canvas._offset.left+300+'px';
		color2_input.style.top = canvas._offset.top+130+'px';
		color2_input.style.visibility = 'visible';
	} else {
		var color2_input = document.getElementById('color2_input');
		color2_input.style.left = canvas._offset.left+300+'px';
		color2_input.style.top = canvas._offset.top+130+'px';
		color2_input.style.visibility = 'hidden';
	}
	
	if(json_type!='nqga20' && json_type!='ampg1_2c' && json_type!='ampg2_2c' && json_type!='nqga40' && json_type!='nq-dsc01'){
		var color3_input = document.getElementById('color3_input');
        color3_input.style.left = canvas._offset.left+300+'px';
        color3_input.style.top = canvas._offset.top+top3+'px';
        color3_input.style.visibility = 'visible';
	}
	
	if(json_type=='Mixer'){

		var color4_input = document.getElementById('color4_input');
		color4_input.style.left = canvas._offset.left+300+'px';
		color4_input.style.top = canvas._offset.top+top4+'px';
		color4_input.style.visibility = 'visible';

		var color6_input = document.getElementById('color6_input');
		color6_input.style.left = canvas._offset.left+300+'px';
		color6_input.style.top = canvas._offset.top+280+'px';
		color6_input.style.visibility = 'visible';
		
		var color5_input = document.getElementById('color5_input');
		color5_input.style.left = canvas._offset.left+300+'px';
		color5_input.style.top = canvas._offset.top+330+'px';
		color5_input.style.visibility = 'visible';
	}
	if(json_type=='nqpaxxx'){

		var color4_input = document.getElementById('color4_input');
		color4_input.style.left = canvas._offset.left+300+'px';
		color4_input.style.top = canvas._offset.top+top4+'px';
		color4_input.style.visibility = 'visible';
		
		var color5_input = document.getElementById('color5_input');
		color5_input.style.left = canvas._offset.left+300+'px';
		color5_input.style.top = canvas._offset.top+280+'px';
		color5_input.style.visibility = 'visible';
		
		var color6_input = document.getElementById('color6_input');
		color6_input.style.left = canvas._offset.left+300+'px';
		color6_input.style.top = canvas._offset.top+330+'px';
		color6_input.style.visibility = 'visible';
		
		var color7_input = document.getElementById('color7_input');
		color7_input.style.left = canvas._offset.left+300+'px';
		color7_input.style.top = canvas._offset.top+380+'px';
		color7_input.style.visibility = 'visible';
		
		var color8_input = document.getElementById('color8_input');
		color8_input.style.left = canvas._offset.left+300+'px';
		color8_input.style.top = canvas._offset.top+430+'px';
		color8_input.style.visibility = 'visible';
	}
	if(json_type=='ampg1_4c'){

		if(IsDualChannel2==1){
		   var color4_input = document.getElementById('color4_input');
			color4_input.style.left = canvas._offset.left+300+'px';
			color4_input.style.top = canvas._offset.top+top4+'px';
			color4_input.style.visibility = 'visible';
		} else {
			var color4_input = document.getElementById('color4_input');
			color4_input.style.left = canvas._offset.left+300+'px';
			color4_input.style.top = canvas._offset.top+230+'px';
			color4_input.style.visibility = 'hidden';
		}
	}
	if(json_type=='ampg2_4c'){

		if(IsDualChannel2==1){
		   var color4_input = document.getElementById('color4_input');
			color4_input.style.left = canvas._offset.left+300+'px';
			color4_input.style.top = canvas._offset.top+top4+'px';
			color4_input.style.visibility = 'visible';
		} else {
			var color4_input = document.getElementById('color4_input');
			color4_input.style.left = canvas._offset.left+300+'px';
			color4_input.style.top = canvas._offset.top+230+'px';
			color4_input.style.visibility = 'hidden';
		}
	}
	if(json_type=='nqga400p'){

		var color4_input = document.getElementById('color4_input');
		color4_input.style.left = canvas._offset.left+300+'px';
		color4_input.style.top = canvas._offset.top+top4+'px';
		color4_input.style.visibility = 'visible';
	}
	
	var save_button = document.getElementById('settings_save_button');
	save_button.style.left = canvas._offset.left+420+'px';
	save_button.style.top = canvas._offset.top+430+'px';
	save_button.style.visibility = 'visible';
}
function reset_hplp_fields(){
	
	var frequency_input = document.getElementById('frequency_input');
	frequency_input.style.left = canvas._offset.left+195+'px';
	frequency_input.style.top = canvas._offset.top+150+'px';

	var close_hplp_input_button = document.getElementById('close_hplp_input_button');
	close_hplp_input_button.style.left = canvas._offset.left+180+'px';
	close_hplp_input_button.style.top = canvas._offset.top+190+'px';

	var save_hplp_input_button = document.getElementById('save_hplp_input_button');
	save_hplp_input_button.style.left = canvas._offset.left+250+'px';
	save_hplp_input_button.style.top = canvas._offset.top+190+'px';
		
	var hp_type = document.getElementById('hp_type'+channel.value);
	hp_type.style.left = canvas._offset.left+239+'px';
	hp_type.style.top = canvas._offset.top+124+'px';
	hp_type.style.visibility = 'visible';
	
	var lp_type = document.getElementById('lp_type'+channel.value);
	lp_type.style.left = canvas._offset.left+239+'px';
	lp_type.style.top = canvas._offset.top+289+'px';
	lp_type.style.visibility = 'visible';
}
function reset_mute_fields(){
	
	var threshold_input = document.getElementById('threshold_input');
	threshold_input.style.left = canvas._offset.left+195+'px';
	threshold_input.style.top = canvas._offset.top+150+'px';

	var close_threshold_input_button = document.getElementById('close_threshold_input_button');
	close_threshold_input_button.style.left = canvas._offset.left+180+'px';
	close_threshold_input_button.style.top = canvas._offset.top+190+'px';

	var save_threshold_input_button = document.getElementById('save_threshold_input_button');
	save_threshold_input_button.style.left = canvas._offset.left+250+'px';
	save_threshold_input_button.style.top = canvas._offset.top+190+'px';
}
function reset_standby_fields(){
	
	var threshold_standby_input = document.getElementById('threshold_standby_input');
	threshold_standby_input.style.left = canvas._offset.left+195+'px';
	threshold_standby_input.style.top = canvas._offset.top+150+'px';

	var close_threshold_standby_input_button = document.getElementById('close_threshold_standby_input_button');
	close_threshold_standby_input_button.style.left = canvas._offset.left+180+'px';
	close_threshold_standby_input_button.style.top = canvas._offset.top+190+'px';

	var save_threshold_standby_input_button = document.getElementById('save_threshold_standby_input_button');
	save_threshold_standby_input_button.style.left = canvas._offset.left+250+'px';
	save_threshold_standby_input_button.style.top = canvas._offset.top+190+'px';
}
function reset_delay_fields(){
	
	var delay_input = document.getElementById('delay_input');
    delay_input.style.left = canvas._offset.left+115+'px';
    delay_input.style.top = canvas._offset.top+150+'px';

    var close_delay_input_button = document.getElementById('close_delay_input_button');
    close_delay_input_button.style.left = canvas._offset.left+100+'px';
    close_delay_input_button.style.top = canvas._offset.top+190+'px';

    var save_delay_input_button = document.getElementById('save_delay_input_button');
    save_delay_input_button.style.left = canvas._offset.left+170+'px';
    save_delay_input_button.style.top = canvas._offset.top+190+'px';
}
function reset_modal_fields(){
	
	var left_data = document.getElementById('modal_left_data').value;
	var top_data = document.getElementById('modal_top_data').value;
	var modal_type = document.getElementById('modal_type').value;
	
	var scale = 0.7;
	
	if(modal_type=='mic_touch'){
	 	scale = 0.8;
	}
	
	var modal_input = document.getElementById('modal_input');
    modal_input.style.left = canvas._offset.left+(left_data*scale)-40+'px';
    modal_input.style.top = canvas._offset.top+(top_data*scale)-25+'px';

    var close_modal_input_button = document.getElementById('close_modal_input_button');
    close_modal_input_button.style.left = canvas._offset.left+(left_data*scale)-60+'px';
    close_modal_input_button.style.top = canvas._offset.top+(top_data*scale)+20+'px';

    var save_modal_input_button = document.getElementById('save_modal_input_button');
    save_modal_input_button.style.left = canvas._offset.left+(left_data*scale)+10+'px';
    save_modal_input_button.style.top = canvas._offset.top+(top_data*scale)+20+'px';
}
function reset_peq_fields(){
	
	var frequency_input_type = document.getElementById('frequency_input_type').value;
	var peq_input_type = document.getElementById('peq_input_type').value; // freq, q, or fader
	
	if(peq_input_type=='freq'){
		
		var data = get_peq_data('peq_touch_freq', frequency_input_type); 
						
		var left_data = data['indicator_left'];
		var top_data = data['indicator_top'];
		
	   	var frequency_input = document.getElementById('frequency_input');
        frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
        frequency_input.style.top = canvas._offset.top+top_data-300+'px';

        var close_peq_input_button = document.getElementById('close_peq_input_button');
        close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
        close_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';

        var save_peq_input_button = document.getElementById('save_peq_input_button');
        save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
        save_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
	}
	if(peq_input_type=='q'){
		
		var data = get_peq_data('peq_touch_q', frequency_input_type); 
						
		var left_data = data['indicator_left'];
		var top_data = data['indicator_top'];
		
		var frequency_input = document.getElementById('frequency_input');
        frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
        frequency_input.style.top = canvas._offset.top+top_data-300+'px';

        var close_peq_input_button = document.getElementById('close_peq_input_button');
        close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
        close_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';

        var save_peq_input_button = document.getElementById('save_peq_input_button2');
        save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
        save_peq_input_button.style.top = canvas._offset.top+top_data-250+'px';
	}
	if(peq_input_type=='fader'){
		
		var data = get_peq_data('peq_touch_fader', frequency_input_type); 
						
		var left_data = data['indicator_left'];
		var top_data = data['indicator_top'];
		
		var frequency_input = document.getElementById('frequency_input');
        frequency_input.style.left = canvas._offset.left+(left_data*.7)+20+'px';
        frequency_input.style.top = canvas._offset.top+top_data-340+'px';

        var close_peq_input_button = document.getElementById('close_peq_input_button');
        close_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+10+'px';
        close_peq_input_button.style.top = canvas._offset.top+top_data-290+'px';

        var save_peq_input_button = document.getElementById('save_peq_input_button3');
        save_peq_input_button.style.left = canvas._offset.left+(left_data*.7)+80+'px';
        save_peq_input_button.style.top = canvas._offset.top+top_data-290+'px';
	}	
}
function reset_presets_fields(){
	
	var json_type = document.getElementById('json_type').value;
	var IsDualChannel = document.getElementById('IsDualChannel').value;
	var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
	var preset_modal = document.getElementById('preset_modal').value;
	var generate_modal = document.getElementById('generate_modal').value;
		
	var top3 = 185;
	var top4 = 235;
	
	if(IsDualChannel==0 && (json_type=='ampg1_4c' || json_type=='ampg2_4c')){
		top3 = 135;
		top4 = top4-50;
	}
	
	if(json_type=='s810v2'){
		
		var presets_save_button = document.getElementById('presets_save_button');
        presets_save_button.style.left = canvas._offset.left+420+'px';
        presets_save_button.style.top = canvas._offset.top+330+'px';
        presets_save_button.style.visibility = 'visible';
	}
	
	if(json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c'){
		if(preset_modal=='0' && generate_modal=='0'){
			var preset1 = document.getElementById('preset1');
            preset1.style.left = canvas._offset.left+100+'px';
            preset1.style.top = canvas._offset.top+85+'px';
            preset1.style.visibility = 'visible';

            var presets_save_button = document.getElementById('presets_save_button');
            presets_save_button.style.left = canvas._offset.left+420+'px';
            presets_save_button.style.top = canvas._offset.top+330+'px';
            presets_save_button.style.visibility = 'visible';
			
			var presets_upload_button = document.getElementById('presets_upload_button');
            presets_upload_button.style.left = canvas._offset.left+20+'px';
            presets_upload_button.style.top = canvas._offset.top+330+'px';
            presets_upload_button.style.visibility = 'visible';

            var presets_detail_button1 = document.getElementById('presets_detail_button1');
            presets_detail_button1.style.left = canvas._offset.left+230+'px';
            presets_detail_button1.style.top = canvas._offset.top+83+'px';
            presets_detail_button1.style.visibility = 'visible';
			
			var presets_generate_button1 = document.getElementById('presets_generate_button1');
            presets_generate_button1.style.left = canvas._offset.left+285+'px';
            presets_generate_button1.style.top = canvas._offset.top+83+'px';
            presets_generate_button1.style.visibility = 'visible';
			
			var presets_download_button1 = document.getElementById('presets_download_button1');
            presets_download_button1.style.left = canvas._offset.left+353+'px';
            presets_download_button1.style.top = canvas._offset.top+83+'px';
            presets_download_button1.style.visibility = 'visible';
			
			var presets_clear_button1 = document.getElementById('presets_clear_button1');
            presets_clear_button1.style.left = canvas._offset.left+425+'px';
            presets_clear_button1.style.top = canvas._offset.top+83+'px';
            presets_clear_button1.style.visibility = 'visible';
		}
		if(preset_modal=='1'){
			var preset_open_web_page_button = document.getElementById('preset_open_web_page_button');
			preset_open_web_page_button.style.left = canvas._offset.left+60+'px';
    		preset_open_web_page_button.style.top = canvas._offset.top+180+'px';
    		preset_open_web_page_button.style.visibility = 'visible';
			
			var close_preset_modal_button = document.getElementById('close_preset_modal_button');
			close_preset_modal_button.style.left = canvas._offset.left+380+'px';
    		close_preset_modal_button.style.top = canvas._offset.top+300+'px';
			close_preset_modal_button.style.visibility = 'visible'; 
		}
		if(generate_modal=='1'){
			var generate_name_input = document.getElementById('generate_name_input');
            generate_name_input.style.left = canvas._offset.left+180+'px';
            generate_name_input.style.top = canvas._offset.top+135+'px';

            var close_generate_modal_button = document.getElementById('close_generate_modal_button');
            close_generate_modal_button.style.left = canvas._offset.left+295+'px';
            close_generate_modal_button.style.top = canvas._offset.top+300+'px';
            close_generate_modal_button.style.visibility = 'visible';

            var save_generate_modal_button = document.getElementById('save_generate_modal_button');
            save_generate_modal_button.style.left = canvas._offset.left+360+'px';
            save_generate_modal_button.style.top = canvas._offset.top+300+'px';
            save_generate_modal_button.style.visibility = 'visible';
		}
	}
	if(IsDualChannel==1 && (json_type=='ampg1_2c' || json_type=='ampg1_4c' || json_type=='ampg2_2c' || json_type=='ampg2_4c')){  
		if(preset_modal=='0' && generate_modal=='0'){
			var preset2 = document.getElementById('preset2');
            preset2.style.left = canvas._offset.left+100+'px';
            preset2.style.top = canvas._offset.top+135+'px';
            preset2.style.visibility = 'visible';

            var presets_detail_button2 = document.getElementById('presets_detail_button2');
            presets_detail_button2.style.left = canvas._offset.left+230+'px';
            presets_detail_button2.style.top = canvas._offset.top+135+'px';
            presets_detail_button2.style.visibility = 'visible';
			
			var presets_generate_button2 = document.getElementById('presets_generate_button2');
            presets_generate_button2.style.left = canvas._offset.left+285+'px';
            presets_generate_button2.style.top = canvas._offset.top+135+'px';
            presets_generate_button2.style.visibility = 'visible';
			
			var presets_download_button2 = document.getElementById('presets_download_button2');
            presets_download_button2.style.left = canvas._offset.left+353+'px';
            presets_download_button2.style.top = canvas._offset.top+135+'px';
            presets_download_button2.style.visibility = 'visible';
			
			var presets_clear_button2 = document.getElementById('presets_clear_button2');
            presets_clear_button2.style.left = canvas._offset.left+425+'px';
            presets_clear_button2.style.top = canvas._offset.top+135+'px';
            presets_clear_button2.style.visibility = 'visible';
		}
	} else {
			var preset2 = document.getElementById('preset2');
            preset2.style.left = canvas._offset.left+100+'px';
            preset2.style.top = canvas._offset.top+135+'px';
            preset2.style.visibility = 'hidden';

            var presets_detail_button2 = document.getElementById('presets_detail_button2');
            presets_detail_button2.style.left = canvas._offset.left+230+'px';
            presets_detail_button2.style.top = canvas._offset.top+135+'px';
            presets_detail_button2.style.visibility = 'hidden';
		
			var presets_generate_button2 = document.getElementById('presets_generate_button2');
            presets_generate_button2.style.left = canvas._offset.left+285+'px';
            presets_generate_button2.style.top = canvas._offset.top+135+'px';
            presets_generate_button2.style.visibility = 'hidden';
		
			var presets_download_button2 = document.getElementById('presets_download_button2');
            presets_download_button2.style.left = canvas._offset.left+353+'px';
            presets_download_button2.style.top = canvas._offset.top+135+'px';
            presets_download_button2.style.visibility = 'hidden';
		
			var presets_clear_button2 = document.getElementById('presets_clear_button2');
            presets_clear_button2.style.left = canvas._offset.left+425+'px';
            presets_clear_button2.style.top = canvas._offset.top+135+'px';
            presets_clear_button2.style.visibility = 'hidden';
	}
	
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		if(preset_modal=='0' && generate_modal=='0'){
			var preset3 = document.getElementById('preset3');
            preset3.style.left = canvas._offset.left+100+'px';
            preset3.style.top = canvas._offset.top+top3+'px';
            preset3.style.visibility = 'visible';
			
			var presets_detail_button3 = document.getElementById('presets_detail_button3');
            presets_detail_button3.style.left = canvas._offset.left+230+'px';
			presets_detail_button3.style.top = canvas._offset.top+top3+'px';
			presets_detail_button3.style.visibility = 'visible';
			
			var presets_generate_button3 = document.getElementById('presets_generate_button3');
            presets_generate_button3.style.left = canvas._offset.left+285+'px';
            presets_generate_button3.style.top = canvas._offset.top+top3+'px';
            presets_generate_button3.style.visibility = 'visible';
			
			var presets_download_button3 = document.getElementById('presets_download_button3');
            presets_download_button3.style.left = canvas._offset.left+353+'px';
            presets_download_button3.style.top = canvas._offset.top+top3+'px';
            presets_download_button3.style.visibility = 'visible';
			
			var presets_clear_button3 = document.getElementById('presets_clear_button3');
            presets_clear_button3.style.left = canvas._offset.left+425+'px';
            presets_clear_button3.style.top = canvas._offset.top+top3+'px';
            presets_clear_button3.style.visibility = 'visible';

            if(IsDualChannel2==1){
               var preset4 = document.getElementById('preset4');
                preset4.style.left = canvas._offset.left+100+'px';
                preset4.style.top = canvas._offset.top+top4+'px';
                preset4.style.visibility = 'visible';

                var presets_detail_button4 = document.getElementById('presets_detail_button4');
                presets_detail_button4.style.left = canvas._offset.left+230+'px';
                presets_detail_button4.style.top = canvas._offset.top+top4+'px';
                presets_detail_button4.style.visibility = 'visible';
				
				var presets_generate_button4 = document.getElementById('presets_generate_button4');
            	presets_generate_button4.style.left = canvas._offset.left+285+'px';
            	presets_generate_button4.style.top = canvas._offset.top+top4+'px';
            	presets_generate_button4.style.visibility = 'visible';	
				
				var presets_download_button4 = document.getElementById('presets_download_button4');
            	presets_download_button4.style.left = canvas._offset.left+353+'px';
            	presets_download_button4.style.top = canvas._offset.top+top4+'px';
            	presets_download_button4.style.visibility = 'visible';
				
				var presets_clear_button4 = document.getElementById('presets_clear_button4');
            	presets_clear_button4.style.left = canvas._offset.left+425+'px';
            	presets_clear_button4.style.top = canvas._offset.top+top4+'px';
            	presets_clear_button4.style.visibility = 'visible';

            } else {
                var preset4 = document.getElementById('preset4');
                preset4.style.left = canvas._offset.left+100+'px';
                preset4.style.top = canvas._offset.top+235+'px';
                preset4.style.visibility = 'hidden';
				
				var presets_detail_button4 = document.getElementById('presets_detail_button4');
                presets_detail_button4.style.left = canvas._offset.left+230+'px';
                presets_detail_button4.style.top = canvas._offset.top+top4+'px';
                presets_detail_button4.style.visibility = 'hidden';
				
				var presets_generate_button4 = document.getElementById('presets_generate_button4');
            	presets_generate_button4.style.left = canvas._offset.left+285+'px';
            	presets_generate_button4.style.top = canvas._offset.top+top4+'px';
            	presets_generate_button4.style.visibility = 'hidden';	
				
				var presets_download_button4 = document.getElementById('presets_download_button4');
            	presets_download_button4.style.left = canvas._offset.left+353+'px';
            	presets_download_button4.style.top = canvas._offset.top+top4+'px';
            	presets_download_button4.style.visibility = 'hidden';
				
				var presets_clear_button4 = document.getElementById('presets_clear_button4');
            	presets_clear_button4.style.left = canvas._offset.left+425+'px';
            	presets_clear_button4.style.top = canvas._offset.top+top4+'px';
            	presets_clear_button4.style.visibility = 'hidden';
            }
		}
	}
}
function close_settings(){
	
	// hide input fields 
	document.getElementById('name1_input').type = 'hidden';
	document.getElementById('name2_input').type = 'hidden';
	document.getElementById('name3_input').type = 'hidden';
	document.getElementById('name4_input').type = 'hidden';
	document.getElementById('name5_input').type = 'hidden';
	document.getElementById('name6_input').type = 'hidden';
	document.getElementById('name7_input').type = 'hidden';
	document.getElementById('name8_input').type = 'hidden';

	var color1_input = document.getElementById('color1_input');
	color1_input.style.visibility = 'hidden';

	var color2_input = document.getElementById('color2_input');
	color2_input.style.visibility = 'hidden';

	var color3_input = document.getElementById('color3_input');
	color3_input.style.visibility = 'hidden';

	var color4_input = document.getElementById('color4_input');
	color4_input.style.visibility = 'hidden';

	var color5_input = document.getElementById('color5_input');
	color5_input.style.visibility = 'hidden';
	
	var color6_input = document.getElementById('color6_input');
	color6_input.style.visibility = 'hidden';
	
	var color7_input = document.getElementById('color7_input');
	color7_input.style.visibility = 'hidden';
	
	var color8_input = document.getElementById('color8_input');
	color8_input.style.visibility = 'hidden';
	
	var preset_input = document.getElementById('preset_input');
	preset_input.style.visibility = 'hidden';

	var save_button = document.getElementById('settings_save_button');
	save_button.style.visibility = 'hidden';
	
	var presets_save_button = document.getElementById('presets_save_button');
	presets_save_button.style.visibility = 'hidden';
	
	var presets_upload_button = document.getElementById('presets_upload_button');
	presets_upload_button.style.visibility = 'hidden';
	
	document.getElementById('name1_input').value = document.getElementById('label1').value;
	document.getElementById('name2_input').value = document.getElementById('label2').value;
	document.getElementById('name3_input').value = document.getElementById('label3').value;
	document.getElementById('name4_input').value = document.getElementById('label4').value;
	document.getElementById('name5_input').value = document.getElementById('label5').value;
	document.getElementById('name6_input').value = document.getElementById('label6').value;
	document.getElementById('name7_input').value = document.getElementById('label7').value;
	document.getElementById('name8_input').value = document.getElementById('label8').value;
	
	document.getElementById('color1_input').value = document.getElementById('color1').value;
	document.getElementById('color2_input').value = document.getElementById('color2').value;
	document.getElementById('color3_input').value = document.getElementById('color3').value;
	document.getElementById('color4_input').value = document.getElementById('color4').value;
	document.getElementById('color5_input').value = document.getElementById('color5').value;
	document.getElementById('color6_input').value = document.getElementById('color6').value;
	document.getElementById('color7_input').value = document.getElementById('color7').value;
	document.getElementById('color8_input').value = document.getElementById('color8').value;

	get_dsp_view();
}
function close_presets(){
	
	document.location.href="/dsp.php";
	
	/*
	// hide input fields 
	document.getElementById('preset_input').style.visibility = 'hidden';
	document.getElementById('presets_save_button').style.visibility= 'hidden';

	document.getElementById('presets_detail_button1').style.visibility= 'hidden';
	document.getElementById('presets_detail_button2').style.visibility= 'hidden';
	document.getElementById('presets_detail_button3').style.visibility= 'hidden';
	document.getElementById('presets_detail_button4').style.visibility= 'hidden';
	
	// hide amp presets fields
	var preset1 = document.getElementById('preset1');
	preset1.style.visibility = 'hidden';
	
	var preset2 = document.getElementById('preset2');
	preset2.style.visibility = 'hidden';
	
	var preset3 = document.getElementById('preset3');
	preset3.style.visibility = 'hidden';
	
	var preset4 = document.getElementById('preset4');
	preset4.style.visibility = 'hidden';

	get_dsp_view();
	
	*/
}
function save_settings(){
	
	var json_type = document.getElementById('json_type').value;
	
	var name1_input = document.getElementById('name1_input').value; 
	var name2_input = document.getElementById('name2_input').value; 
	var name3_input = document.getElementById('name3_input').value; 
	var name4_input = document.getElementById('name4_input').value; 
	var name5_input = document.getElementById('name5_input').value; 
	var name6_input = document.getElementById('name6_input').value; 
	var name7_input = document.getElementById('name7_input').value; 
	var name8_input = document.getElementById('name8_input').value; 
	
	var color1_input = document.getElementById('color1_input').value;
	var color2_input = document.getElementById('color2_input').value;
	var color3_input = document.getElementById('color3_input').value;
	var color4_input = document.getElementById('color4_input').value;
	var color5_input = document.getElementById('color5_input').value;
	var color6_input = document.getElementById('color6_input').value;
	var color7_input = document.getElementById('color7_input').value;
	var color8_input = document.getElementById('color8_input').value;
	
	document.getElementById('label1').value = name1_input;
	document.getElementById('label2').value = name2_input;
	document.getElementById('label3').value = name3_input;
	document.getElementById('label4').value = name4_input;
	document.getElementById('label5').value = name5_input;
	document.getElementById('label6').value = name6_input;
	
	
	document.getElementById('color1').value = color1_input;
	document.getElementById('color2').value = color2_input;
	document.getElementById('color3').value = color3_input;
	document.getElementById('color4').value = color4_input;
	document.getElementById('color5').value = color5_input;
	document.getElementById('color6').value = color6_input;
	
	
	if(json_type=='nqpaxxx'){
		
		document.getElementById('label7').value = name7_input;
		document.getElementById('label8').value = name8_input;
	
		document.getElementById('color7').value = color7_input;
		document.getElementById('color8').value = color8_input;
	}
	
	var msg;
	
	if(json_type=='Mixer'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "In3": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "In4": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" }, "In5": { "Name": "'+name6_input+'", "Color": "'+color6_input+'" }, "Out5": { "Name": "'+name5_input+'", "Color": "'+color5_input+'" } } }';
	}
	if(json_type=='ampg1_2c'){
	   	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "In5": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "Out1": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" }, "Out2": { "Name": "'+name5_input+'", "Color": "'+color5_input+'" } } }';
	}
	if(json_type=='ampg1_4c'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "In3": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "In4": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" }, "In5": { "Name": "'+name5_input+'", "Color": "'+color5_input+'" }, "In6": { "Name": "'+name6_input+'", "Color": "'+color6_input+'" } } }';
	}
	if(json_type=='nqga20'){
	  	msg = '{ "'+json_type+'": { "Ch1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" } } }';
	}
	if(json_type=='nqpaxxx'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "In3": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "In4": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" }, "In5": { "Name": "'+name5_input+'", "Color": "'+color5_input+'" },  "In6": { "Name": "'+name6_input+'", "Color": "'+color6_input+'" }, "Out5": { "Name": "'+name7_input+'", "Color": "'+color7_input+'" }, "Out6": { "Name": "'+name8_input+'", "Color": "'+color8_input+'" } } }';
	}
	if(json_type=='ampg2_2c'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" } } }';
	}
	if(json_type=='ampg2_4c'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "In3": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "In4": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" } } }';
	}
	if(json_type=='nqga400p'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"In2": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" }, "Out1": { "Name": "'+name3_input+'", "Color": "'+color3_input+'" }, "Out2": { "Name": "'+name4_input+'", "Color": "'+color4_input+'" } } }';
	}
	if(json_type=='nqga40'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"Ch1": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" } } }';
	}
	if(json_type=='nq-dsc01'){
	  	msg = '{ "'+json_type+'": { "In1": { "Name": "'+name1_input+'", "Color": "'+color1_input+'" },"Ch1": { "Name": "'+name2_input+'", "Color": "'+color2_input+'" } } }';
	}
	socket.send(msg);
	update_save_settings_button();
	
	// send growl notification
	$.bootstrapGrowl("Settings saved.", {
	  ele: 'body', // which element to append to
	  type: 'success', // (null, 'info', 'error', 'success')
	  offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
	  align: 'right', // ('left', 'right', or 'center')
	  width: 350, // (integer, or 'auto')
	  delay: 5000, // 5 seconds
	  allow_dismiss: true,
	  stackup_spacing: 10 // spacing between consecutively stacked growls.
	});  
}
function save_presets(){
	
	var json_type = document.getElementById('json_type').value;
	var IsDualChannel = document.getElementById('IsDualChannel').value;
	var IsDualChannel2 = document.getElementById('IsDualChannel2').value;
	var msg;
	
	if(json_type=='s810v2'){
		var preset_input = document.getElementById('preset_input').value; 
		msg = '{ "s810v2": { "Preset": { "Selected": "'+preset_input+'"} } }';
	}
	
	var preset1_value_changed = document.getElementById('preset1_value_changed').value;
	var preset2_value_changed = document.getElementById('preset2_value_changed').value;
	var preset3_value_changed = document.getElementById('preset3_value_changed').value;
	var preset4_value_changed = document.getElementById('preset4_value_changed').value;
	
	var part1 = '';
	var part2 = '';
	var part3 = '';
	var part4 = '';
	
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		var preset1 = document.getElementById('preset1').value;
		var preset2 = document.getElementById('preset2').value; 
		
		document.getElementById('preset1_value').value = preset1;
		document.getElementById('preset2_value').value = preset2;
		
		if(preset1_value_changed==1){
		   	part1 = '"In1": { "Preset": { "Selected": "'+preset1+'" } } ';
		}
		if(preset2_value_changed==1){
			part2 = '"In2": { "Preset": { "Selected": "'+preset2+'" } } ';	
		}
		var comma = '';
		if(preset1_value_changed==1 && preset2_value_changed==1){
		   comma =' , '
		}
		msg = '{ "'+json_type+'": { '+part1+comma+part2+'} }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		var preset1 = document.getElementById('preset1').value;
		var preset2 = document.getElementById('preset2').value; 
		var preset3 = document.getElementById('preset3').value; 
		var preset4 = document.getElementById('preset4').value; 
		
		document.getElementById('preset1_value').value = preset1;
		document.getElementById('preset2_value').value = preset2;
		document.getElementById('preset3_value').value = preset3;
		document.getElementById('preset4_value').value = preset4;
		
		var comma1 = '';
		var comma2 = '';
		var comma3 = '';
		
		if(preset1_value_changed==1){
		   	part1 = '"In1": { "Preset": { "Selected": "'+preset1+'" } } ';
		}
		if(preset2_value_changed==1){
			part2 = '"In2": { "Preset": { "Selected": "'+preset2+'" } } ';	
		}
		if(preset3_value_changed==1){
		   	part3 = '"In3": { "Preset": { "Selected": "'+preset3+'" } } ';
		}
		if(preset4_value_changed==1){
			part4 = '"In4": { "Preset": { "Selected": "'+preset4+'" } } ';	
		}
		if(preset1_value_changed==1 && (preset2_value_changed==1 || preset3_value_changed==1 || preset4_value_changed==1) ){
		   var comma1 = ' , ';
		}
		if(preset2_value_changed==1 && (preset3_value_changed==1 || preset4_value_changed==1) ){
		   var comma2 = ' , ';
		}
		if(preset3_value_changed==1 && preset4_value_changed==1){
		   var comma3 = ' , ';
		}
		msg = '{ "'+json_type+'": { '+part1+comma1+part2+comma2+part3+comma3+part4+'} }';
	}
	
	if(preset1_value_changed==1 || preset2_value_changed==1 || preset3_value_changed==1 || preset4_value_changed==1 || json_type=='s810v2'){
	   	socket.send(msg);
		update_save_settings_button();
		
		// send growl notification
        $.bootstrapGrowl("Presets applied.", {
          ele: 'body', // which element to append to
          type: 'success', // (null, 'info', 'error', 'success')
          offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
          align: 'right', // ('left', 'right', or 'center')
          width: 350, // (integer, or 'auto')
          delay: 5000, // 5 seconds
          allow_dismiss: true,
          stackup_spacing: 10 // spacing between consecutively stacked growls.
        }); 
	} else {
		// send growl notification
        $.bootstrapGrowl("Change a preset before applying.", {
          ele: 'body', // which element to append to
          type: 'warning', // (null, 'info', 'error', 'success')
          offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
          align: 'right', // ('left', 'right', or 'center')
          width: 350, // (integer, or 'auto')
          delay: 5000, // 5 seconds
          allow_dismiss: true,
          stackup_spacing: 10 // spacing between consecutively stacked growls.
        }); 
		
	}
	
	document.getElementById('preset1_value_changed').value = 0;
	document.getElementById('preset2_value_changed').value = 0;
	document.getElementById('preset3_value_changed').value = 0;
	document.getElementById('preset4_value_changed').value = 0;
}
function preset_changed(selected_value, preset){
	
	var current_preset_value = document.getElementById('preset' +preset+ '_value').value;
	
	if(selected_value==''){
	   
	   	// set current_value
		document.getElementById('preset' +preset+ '_value').value = current_preset_value;
		document.getElementById('preset' +preset).value = current_preset_value;
	} else {
		// set selected_value
		document.getElementById('preset' +preset+ '_value').value = selected_value;
		document.getElementById('preset' +preset).value = selected_value;
		document.getElementById('preset' +preset+ '_value_changed').value = 1;
	}
}
function get_presets(){
	
	var json_type = document.getElementById('json_type').value;
	
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
	   	var msg = '{ "'+json_type+'": { "In1": { "Preset": { "Selected": null } }, "In2": { "Preset": { "Selected": null } } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
	   	var msg = '{ "'+json_type+'": { "In1": { "Preset": { "Selected": null } }, "In2": { "Preset": { "Selected": null } }, "In3": { "Preset": { "Selected": null } }, "In4": { "Preset": { "Selected": null } } } }';
	}
	
	socket.send(msg);
}
function get_preset_list(){
	
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Preset": { "List": null } } }';
	socket.send(msg);
}
function get_preset_detail(preset){
	
	// reset saved value
	document.getElementById('preset_url').value = '';
	
	get_preset_url(preset);				
	
	var json_type = document.getElementById('json_type').value;
	var msg = '{ "'+json_type+'": { "Preset": { "Detail": "'+preset+'" } } }';
	socket.send(msg);
}
function get_preset_url(preset){
	
	var xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            // success 
            // console.log(xmlhttp.responseText);
			
			if(xmlhttp.responseText=='1'){
				// connection error
			} else if(xmlhttp.responseText=='2'){
				// password auth error
			} else if(xmlhttp.responseText=='3'){
				// sftp error
			} else if(xmlhttp.responseText=='4'){
				// file read error
			} else if(xmlhttp.responseText=='5'){
				// write file to appliance error
			} else if(xmlhttp.responseText=='6'){
				// local file error
			} else if(xmlhttp.responseText!=''){
				var obj = JSON.parse(xmlhttp.responseText);
				var keys = Object.keys(obj);			
				if(keys.indexOf(preset)>-1){
				   var preset_url = obj[preset]['InfoURI'];
					document.getElementById('preset_url').value = preset_url;	
				 }
			}
			var preset_open_web_page_button = document.getElementById('preset_open_web_page_button');
			preset_open_web_page_button.innerHTML = 'Open Web Page';
			if(document.getElementById('preset_url').value!=''){
			   preset_open_web_page_button.disabled = false;
			}
        }
    }
    xmlhttp.open("GET","scripts.php?s=get_preset_url&p="+preset,true);
    xmlhttp.send();
}
function get_pink_noise_enabled(){

	var json_type = document.getElementById('json_type').value;
	var msg;
	if(json_type=='ampg1_2c' || json_type=='ampg2_2c'){
		msg = '{ "'+json_type+'": { "In1": { "PinkNoiseEnabled": null }, "In2": { "PinkNoiseEnabled": null } } }';
	}
	if(json_type=='ampg1_4c' || json_type=='ampg2_4c'){
		msg = '{ "'+json_type+'": { "In1": { "PinkNoiseEnabled": null }, "In2": { "PinkNoiseEnabled": null }, "In3": { "PinkNoiseEnabled": null }, "In4": { "PinkNoiseEnabled": null }  } }';
	}
	
	socket.send(msg);
}
	
function details_button_preset(id){
	
	var preset = document.getElementById('preset'+id).value;
	if(preset!=''){
	   get_preset_detail(preset);
	}
}
function download_button_preset(id){
	
	var preset_name  =  "preset"+id;
	var filename = document.getElementById(preset_name).value;
	var full_filename  = filename + '.json';
	
	var xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            // console.log(xmlhttp.responseText);
			
			if(xmlhttp.responseText==''){
			   // error
			} else {
			   var textToWrite = xmlhttp.responseText;

                var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'});

                var downloadLink = document.createElement("a");

                downloadLink.download = full_filename ;

                downloadLink.innerHTML = "";

                window.URL = window.URL || window.webkitURL;

                downloadLink.href = window.URL.createObjectURL(textFileAsBlob);

                downloadLink.onclick = destroyClickedElement;

                downloadLink.style.display = "none";

                if(filename==''){
                    // do nothing
                } else {
                    document.body.appendChild(downloadLink);
                    downloadLink.click();
					
					// send growl notification
                    $.bootstrapGrowl("Preset " + filename + " downloaded.", {
                      ele: 'body', // which element to append to
                      type: 'success', // (null, 'info', 'error', 'success')
                      offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
                      align: 'right', // ('left', 'right', or 'center')
                      width: 350, // (integer, or 'auto')
                      delay: 5000, // 5 seconds
                      allow_dismiss: true,
                      stackup_spacing: 10 // spacing between consecutively stacked growls.
                    });  
                }
			}
        }
    }
    xmlhttp.open("GET","scripts.php?s=get_preset_text&f=" + filename ,true);
    xmlhttp.send();
}
function clear_button_preset(id){
	
	// show warning
	
	hide_preset_buttons();
	
	var preset_name = 'preset'+id+'_value';
	
	var preset_value = document.getElementById(preset_name).value;
	
	document.getElementById('clear_input_channel').value = id;
	
    var input_blackout = new fabric.Rect({
      id: 'input_blackout',
      name: 'input_blackout',
      left: 0,
      top: 0,
      originX: 'left',
      originX: 'left',
      originY: 'top',
      width: 702,
      height: 564,
      angle: 0,
      fill: 'rgba(0,0,0,0.5)',
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_blackout);

    var input_background = new fabric.Rect({
      id: 'input_background',
      name: 'input_background',
      left: 42,
      top: 81,
      originX: 'left',
      originY: 'top',
      width: 600,
      height: 400,
      angle: 0,
      fill: 'rgba(230,230,230,1.0)',
      strokeWidth: 20,
      strokeLineJoin: 'round',
      rx: 5,
      ry: 5,
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_background);

    // clear preset title
    var clear_preset_title = new fabric.Textbox(String("Clear Preset"), {
        id: 'clear_preset_title',
        name: 'clear_preset_title',
        left: 42,
        top: 110, 
        width: 600,
        fontSize: 23,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'center',
        editable: false,
    });
    canvas.add(clear_preset_title);

    // show error text
    var error_text = 'Warning: This operation will remove the preset from the channel and reset the following to default settings:\n\nHigh/Low Pass\nParametric EQ\nPeak Limiter\nRMS Limiter\n\nAre you sure you want to clear the preset?';
    var clear_error_text = new fabric.Textbox(String(error_text), {
        id: 'clear_error_text',
        name: 'clear_error_text',
        left: 90,
        top: 150, 
        width: 550,
        fontSize: 18,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(255,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(clear_error_text);

    var clear_warning_no_button = document.getElementById('clear_warning_no_button');
    clear_warning_no_button.style.left = canvas._offset.left+255+'px';
    clear_warning_no_button.style.top = canvas._offset.top+260+'px';
    clear_warning_no_button.style.visibility = 'visible';

    var clear_warning_yes_button = document.getElementById('clear_warning_yes_button');
    clear_warning_yes_button.style.left = canvas._offset.left+310+'px';
    clear_warning_yes_button.style.top = canvas._offset.top+260+'px';
    clear_warning_yes_button.style.visibility = 'visible';
}
function clear_warning_yes(){
	var id = document.getElementById('clear_input_channel').value;
	var json_type = document.getElementById('json_type').value;
	
    var msg = '{ "'+json_type+'": { "In'+id+'": { "Preset": { "Selected": "" } } } }';
	socket.send(msg);	
	
	document.getElementById('clear_warning_yes_button').innerHTML = '<i class="fa fa-refresh fa-spin fa-fw"></i> Clearing Preset ...';
	document.getElementById('clear_warning_yes_button').disabled = true;
	document.getElementById('clear_warning_no_button').disabled = true;

	setTimeout(function(){ 
		
		document.getElementById('clear_warning_yes_button').innerHTML = 'Yes';
		document.getElementById('clear_warning_yes_button').disabled = false;
		document.getElementById('clear_warning_no_button').disabled = false;
			
		document.getElementById('clear_warning_yes_button').style.visibility = 'hidden';
		document.getElementById('clear_warning_no_button').style.visibility = 'hidden';
	
		get_presets_view();
	
        // send growl notification
        $.bootstrapGrowl("Preset cleared.", {
          ele: 'body', // which element to append to
          type: 'success', // (null, 'info', 'error', 'success')
          offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
          align: 'right', // ('left', 'right', or 'center')
          width: 350, // (integer, or 'auto')
          delay: 5000, // 5 seconds
          allow_dismiss: true,
          stackup_spacing: 10 // spacing between consecutively stacked growls.
        }); 
	}, 3000);
}
function clear_warning_no(){
	
	canvas.remove(canvas.getItemByName('clear_error_text'));
	
	document.getElementById('clear_warning_yes_button').style.visibility = 'hidden';
	document.getElementById('clear_warning_no_button').style.visibility = 'hidden';
	
	get_presets_view();
}
function destroyClickedElement(event)
{
    document.body.removeChild(event.target);
}
function hide_preset_buttons(){
	
	document.getElementById('preset1').style.visibility = 'hidden';
	document.getElementById('preset2').style.visibility = 'hidden';
	document.getElementById('preset3').style.visibility = 'hidden';
	document.getElementById('preset4').style.visibility = 'hidden';
	
	document.getElementById('presets_detail_button1').style.visibility = 'hidden';
	document.getElementById('presets_detail_button2').style.visibility = 'hidden';
	document.getElementById('presets_detail_button3').style.visibility = 'hidden';
	document.getElementById('presets_detail_button4').style.visibility = 'hidden';
	
	document.getElementById('presets_generate_button1').style.visibility = 'hidden';
	document.getElementById('presets_generate_button2').style.visibility = 'hidden';
	document.getElementById('presets_generate_button3').style.visibility = 'hidden';
	document.getElementById('presets_generate_button4').style.visibility = 'hidden';
	
	document.getElementById('presets_download_button1').style.visibility = 'hidden';
	document.getElementById('presets_download_button2').style.visibility = 'hidden';
	document.getElementById('presets_download_button3').style.visibility = 'hidden';
	document.getElementById('presets_download_button4').style.visibility = 'hidden';
	
	document.getElementById('presets_clear_button1').style.visibility = 'hidden';
	document.getElementById('presets_clear_button2').style.visibility = 'hidden';
	document.getElementById('presets_clear_button3').style.visibility = 'hidden';
	document.getElementById('presets_clear_button4').style.visibility = 'hidden';
	
	document.getElementById('presets_save_button').style.visibility = 'hidden';
	
	document.getElementById('presets_upload_button').style.visibility = 'hidden';
}
	
function generate_button_preset(id){
	
	document.getElementById('generate_input_channel').value = id;
	var close_generate_modal_button = document.getElementById('close_generate_modal_button');
	var save_generate_modal_button = document.getElementById('save_generate_modal_button');
	
	save_generate_modal_button.innerHTML = 'Save';
	save_generate_modal_button.disabled = false;
	close_generate_modal_button.disabled = false;
	
	document.getElementById('generate_modal').value = '1';
	
	hide_preset_buttons();
	
	var input_blackout = new fabric.Rect({
      id: 'input_blackout',
      name: 'input_blackout',
      left: 0,
      top: 0,
      originX: 'left',
      originY: 'top',
      width: 702,
      height: 564,
      angle: 0,
      fill: 'rgba(0,0,0,0.5)',
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_blackout);

    var input_background = new fabric.Rect({
      id: 'input_background',
      name: 'input_background',
      left: 42,
      top: 81,
      originX: 'left',
      originY: 'top',
      width: 600,
      height: 400,
      angle: 0,
      fill: 'rgba(230,230,230,1.0)',
      strokeWidth: 20,
      strokeLineJoin: 'round',
      rx: 5,
      ry: 5,
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_background);
	
	// generate preset title
    var generate_preset_title = new fabric.Textbox(String("Generate Preset"), {
        id: 'generate_preset_title',
        name: 'generate_preset_title',
        left: 250,
        top: 130, 
        width: 600,
        fontSize: 23,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(generate_preset_title);
	
	// preset name label
    var preset_name_label = new fabric.Textbox(String("Preset Name:"), {
        id: 'preset_name_label',
        name: 'preset_name_label',
        left: 90,
        top: 200, 
        width: 600,
        fontSize: 23,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(preset_name_label);
	
	document.getElementById('generate_name_input').type = 'text';
	
	var generate_name_input = document.getElementById('generate_name_input');
	generate_name_input.style.left = canvas._offset.left+180+'px';
	generate_name_input.style.top = canvas._offset.top+135+'px';
	
	var close_generate_modal_button = document.getElementById('close_generate_modal_button');
    close_generate_modal_button.style.left = canvas._offset.left+295+'px';
    close_generate_modal_button.style.top = canvas._offset.top+300+'px';
    close_generate_modal_button.style.visibility = 'visible';
	
	var save_generate_modal_button = document.getElementById('save_generate_modal_button');
    save_generate_modal_button.style.left = canvas._offset.left+360+'px';
    save_generate_modal_button.style.top = canvas._offset.top+300+'px';
    save_generate_modal_button.style.visibility = 'visible';
	
}
function generate_close(){
	
	document.getElementById('close_generate_modal_button').style.visibility = 'hidden';
	document.getElementById('save_generate_modal_button').style.visibility = 'hidden';
	document.getElementById('generate_name_input').type = 'hidden';
	document.getElementById('generate_name_input').value = '';
	
	get_presets_view();
}

function show_preset_generate_error(error_text){
	
	canvas.remove(canvas.getItemByName('generate_error_text'));
	var close_generate_modal_button = document.getElementById('close_generate_modal_button');
	var save_generate_modal_button = document.getElementById('save_generate_modal_button');
	  
		// show error text
        var generate_error_text = new fabric.Textbox(String(error_text), {
            id: 'generate_error_text',
            name: 'generate_error_text',
            left: 90,
            top: 240, 
            width: 550,
            fontSize: 18,
            selectable: false,
            hasControls: false,
            fontFamily: 'Arial',
            fontWeight: 'bold',
            fill: 'rgba(255,0,0,1.0)',
            textAlign: 'left',
            editable: false,
        });
        canvas.add(generate_error_text);
	
	save_generate_modal_button.innerHTML = 'Save';
	save_generate_modal_button.disabled = false;
	close_generate_modal_button.disabled = false;
}	
function generate_save(){
	
	var generate_input_channel = document.getElementById('generate_input_channel').value;
	var generate_name_input = document.getElementById('generate_name_input').value;
	var json_type = document.getElementById('json_type').value;
	
	var close_generate_modal_button = document.getElementById('close_generate_modal_button');
	var save_generate_modal_button = document.getElementById('save_generate_modal_button');
	
	var defaults_array = ["IG4M_16", "IG4M_70V", "IG6s2M_70V", "IG6s2M_8", "IG8s2M_70V", "IG8s2M_8", "IGS100M", "IGS12", "IGS212", "LB12", "LB4", "LB4T", "LB5", "LB5T", "LB6", "LB6T", "LB8", "LB8T", "VM1", "VM2"];
	
	if(generate_name_input==''){ // check for empty name
		show_preset_generate_error("*Enter a Preset Name.");
	} else if (generate_name_input.match(/[^a-zA-Z0-9\-\_]/)) { // check for allowable characters
		 show_preset_generate_error("*Allowable Characters: a-z, A-Z, 0-9, - (dash), _ (underscore).");
	} else if(presetsArray.includes(generate_name_input) && !defaults_array.includes(generate_name_input)){ // check for duplicate name
		
		var warning = 'Warning: This preset already exists. Generating this preset will remove the preset name from other channels but retain their settings.\n\nAre you sure you want to generate this preset name?';
		show_preset_generate_error(warning);
		
		document.getElementById('generate_name_input').disabled = true;
		save_generate_modal_button.style.visibility = 'hidden';
		close_generate_modal_button.style.visibility = 'hidden';
		
		var generate_warning_no_button = document.getElementById('generate_warning_no_button');
    	generate_warning_no_button.style.left = canvas._offset.left+305+'px';
    	generate_warning_no_button.style.top = canvas._offset.top+260+'px';
    	generate_warning_no_button.style.visibility = 'visible';
		
		var generate_warning_yes_button = document.getElementById('generate_warning_yes_button');
        generate_warning_yes_button.style.left = canvas._offset.left+360+'px';
        generate_warning_yes_button.style.top = canvas._offset.top+260+'px';
        generate_warning_yes_button.style.visibility = 'visible';
		
	} else {
		canvas.remove(canvas.getItemByName('generate_error_text'));
		
		var msg = '{ "'+json_type+'": { "In'+generate_input_channel+'": { "Preset": { "Generate": "'+generate_name_input+'" } } } }';
		socket.send(msg);
		
		save_generate_modal_button.innerHTML = '<i class="fa fa-refresh fa-spin fa-fw"></i> Saving ...';
		save_generate_modal_button.disabled = true;
		close_generate_modal_button.disabled = true;
	}
}
	
function generate_warning_yes(){
	
	var generate_input_channel = document.getElementById('generate_input_channel').value;
	var generate_name_input = document.getElementById('generate_name_input').value;
	var json_type = document.getElementById('json_type').value;
	
	var close_generate_modal_button = document.getElementById('close_generate_modal_button');
	var save_generate_modal_button = document.getElementById('save_generate_modal_button');
	
	canvas.remove(canvas.getItemByName('generate_error_text'));
	document.getElementById('generate_warning_yes_button').style.visibility = 'hidden';
	document.getElementById('generate_warning_no_button').style.visibility = 'hidden';
	
    // generate duplicate preset
    var msg = '{ "'+json_type+'": { "In'+generate_input_channel+'": { "Preset": { "Generate": "'+generate_name_input+'" } } } }';
	socket.send(msg);
	
	document.getElementById('generate_name_input').disabled = false;
	save_generate_modal_button.innerHTML = '<i class="fa fa-refresh fa-spin fa-fw"></i> Saving ...';
	save_generate_modal_button.style.visibility = 'visible';
	close_generate_modal_button.style.visibility = 'visible';
	save_generate_modal_button.disabled = true;
	close_generate_modal_button.disabled = true;
}
function generate_warning_no(){
	
	canvas.remove(canvas.getItemByName('generate_error_text'));
	
	document.getElementById('generate_warning_yes_button').style.visibility = 'hidden';
	document.getElementById('generate_warning_no_button').style.visibility = 'hidden';
	
	document.getElementById('generate_name_input').disabled = false;
	document.getElementById('save_generate_modal_button').style.visibility = 'visible';
	document.getElementById('close_generate_modal_button').style.visibility = 'visible';
}
function show_preset_detail(presetArray){
	
	document.getElementById('preset_modal').value = '1';
	
	var preset_name = presetArray.Name;
	var preset_description = presetArray.Description;
	var preset_info_uri = presetArray.InfoURI;
	
	hide_preset_buttons();
	
	document.getElementById('preset_url').value = preset_info_uri;
		
	var input_blackout = new fabric.Rect({
      id: 'input_blackout',
      name: 'input_blackout',
      left: 0,
      top: 0,
      originX: 'left',
      originY: 'top',
      width: 702,
      height: 564,
      angle: 0,
      fill: 'rgba(0,0,0,0.5)',
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_blackout);

    var input_background = new fabric.Rect({
      id: 'input_background',
      name: 'input_background',
      left: 42,
      top: 81,
      originX: 'left',
      originY: 'top',
      width: 600,
      height: 400,
      angle: 0,
      fill: 'rgba(230,230,230,1.0)',
      strokeWidth: 20,
      strokeLineJoin: 'round',
      rx: 5,
      ry: 5,
      selectable: false,
      objectCaching: false,
    });
    canvas.add(input_background);

	var name_title = 'Name: '+ preset_name;

    // name text
    var name_text = new fabric.Textbox(String(name_title), {
        id: 'name_text',
        name: 'name_text',
        left: 90,
        top: 130, 
        width: 600,
        fontSize: 23,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(name_text);
	
	var description_title = 'Description: '+ preset_description;

    // description text
    var description_text = new fabric.Textbox(String(description_title), {
        id: 'description_text',
        name: 'description_text',
        left: 90,
        top: 180, 
        width: 600,
        fontSize: 23,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(description_text);
	
	/*
	var preset_open_web_page_button = document.getElementById('preset_open_web_page_button');
    preset_open_web_page_button.style.left = canvas._offset.left+60+'px';
    preset_open_web_page_button.style.top = canvas._offset.top+180+'px';
    preset_open_web_page_button.style.visibility = 'visible';
	preset_open_web_page_button.disabled = true;
	preset_open_web_page_button.innerHTML = '<i class="fa fa-refresh fa-spin fa-fw"></i> Loading ...';
	*/
	
    var close_preset_modal_button = document.getElementById('close_preset_modal_button');
    close_preset_modal_button.style.left = canvas._offset.left+380+'px';
    close_preset_modal_button.style.top = canvas._offset.top+300+'px';
    close_preset_modal_button.style.visibility = 'visible';
}
	
function details_close(){
	
	document.getElementById('preset_open_web_page_button').style.visibility = 'hidden';
	document.getElementById('close_preset_modal_button').style.visibility = 'hidden';
	
	get_presets_view();
}
	
function update_preset_lists(){
	
	$('#preset1').empty();
	$('#preset2').empty();
	$('#preset3').empty();
	$('#preset4').empty();
		
	var preset1_value = document.getElementById('preset1_value').value;
	var preset2_value = document.getElementById('preset2_value').value;
	var preset3_value = document.getElementById('preset3_value').value;
	var preset4_value = document.getElementById('preset4_value').value;
	
	// preset1
	var selected = '';
	if(preset1_value==''){
		 selected = 'selected';
	}
	$('#preset1').append('<option value="" '+selected+'></option>');
	for (var i = 0; i < presetsArray.length; i++){
      var item = presetsArray[i];
	  var selected = '';
		if(preset1_value==item ){
		   selected = 'selected';
		}
	  $('#preset1').append('<option value="'+item +'" '+selected+'>' + item + '</option>');
    }
	
	// preset2
	var selected = '';
	if(preset2_value==''){
		 selected = 'selected';
	}
	$('#preset2').append('<option value="" '+selected+'></option>');
	for (var i = 0; i < presetsArray.length; i++){
      var item = presetsArray[i];
	  var selected = '';
		if(preset2_value==item ){
		   selected = 'selected';
		}
	  $('#preset2').append('<option value="'+item +'" '+selected+'>' + item + '</option>');
    }
	
	// preset3
	var selected = '';
	if(preset3_value==''){
		 selected = 'selected';
	}
	$('#preset3').append('<option value="" '+selected+'></option>');
	for (var i = 0; i < presetsArray.length; i++){
      var item = presetsArray[i];
	  var selected = '';
		if(preset3_value==item ){
		   selected = 'selected';
		}
	  $('#preset3').append('<option value="'+item +'" '+selected+'>' + item + '</option>');
    }
	
	// preset4
	var selected = '';
	if(preset4_value==''){
		 selected = 'selected';
	}
	$('#preset4').append('<option value="" '+selected+'></option>');
	for (var i = 0; i < presetsArray.length; i++){
      var item = presetsArray[i];
	  var selected = '';
		if(preset4_value==item ){
		   selected = 'selected';
		}
	  $('#preset4').append('<option value="'+item +'" '+selected+'>' + item + '</option>');
    }
	
	 var generate_modal = document.getElementById('generate_modal').value;
							 
 	if(generate_modal=='1'){	
		setTimeout(generate_timer, 2000);
 	}
}
function generate_timer(){
	generate_close(); 	
	
	// send growl notification
    $.bootstrapGrowl("Preset generated.", {
      ele: 'body', // which element to append to
      type: 'success', // (null, 'info', 'error', 'success')
      offset: {from: 'top', amount: 50}, // 'top', or 'bottom'
      align: 'right', // ('left', 'right', or 'center')
      width: 350, // (integer, or 'auto')
      delay: 5000, // 5 seconds
      allow_dismiss: true,
      stackup_spacing: 10 // spacing between consecutively stacked growls.
    });  
	
	update_save_settings_button();
	backup_presets();
}
function backup_presets(){
	
	var xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            // success 
            // console.log(xmlhttp.responseText);
        }
    }
    xmlhttp.open("GET","scripts.php?s=backup_presets",true);
    xmlhttp.send();
}
function open_web_page(){
	
	var preset_url = document.getElementById('preset_url').value;
	
	window.open(preset_url);
	
}
function close_status(){
	
	canvas.remove(canvas.getItemByName('protection_led'));
	canvas.remove(canvas.getItemByName('protection2_led'));
	canvas.remove(canvas.getItemByName('ch1_led'));
	canvas.remove(canvas.getItemByName('ch2_led'));
	canvas.remove(canvas.getItemByName('ch3_led'));
	canvas.remove(canvas.getItemByName('ch4_led'));
	
	get_dsp_view();
}
	
	
function close_hplp(channel){
	
	var hp_type = document.getElementById('hp_type'+channel);
	hp_type.style.visibility = 'hidden';
	
	var lp_type = document.getElementById('lp_type'+channel);
	lp_type.style.visibility = 'hidden';
	
	get_dsp_view();
}
	
function close_hplp_input(){
	
	document.getElementById('frequency_input').type = 'hidden';
	
	var save_hplp_input_button = document.getElementById('save_hplp_input_button');
	save_hplp_input_button.style.visibility = 'hidden';
	
	var close_hplp_input_button = document.getElementById('close_hplp_input_button');
	close_hplp_input_button.style.visibility = 'hidden';
	
	var channel = document.getElementById('channel').value;
	
	get_hplp_view(channel);
	
}
function save_hplp_input(){
	
	var channel = document.getElementById('channel').value;
	var frequency_input = document.getElementById('frequency_input').value;
	var frequency_input_type = document.getElementById('frequency_input_type').value;
	var parameter = 'Frequency';
	
	frequency_input = parseInt(frequency_input);
	
	// only allow number in the range
	if(frequency_input<20){
	   frequency_input=20;
	}
	if(frequency_input>20000){
	   frequency_input=20000;
	}
	
	if(frequency_input>=20 && frequency_input<=20000){ // escape if number is not in the range
	 	document.getElementById('Frequency_'+frequency_input_type+channel+'_hplp').value = frequency_input;
		set_hplp_data(channel,parameter,frequency_input,frequency_input_type); 
	}
	
	close_hplp_input();
}
function close_peq_input(){
	
	document.getElementById('frequency_input').type = 'hidden';
	
	var save_peq_input_button = document.getElementById('save_peq_input_button');
	save_peq_input_button.style.visibility = 'hidden';
	
	var save_peq_input_button2 = document.getElementById('save_peq_input_button2');
	save_peq_input_button2.style.visibility = 'hidden';
	
	var save_peq_input_button3 = document.getElementById('save_peq_input_button3');
	save_peq_input_button3.style.visibility = 'hidden';
	
	var close_peq_input_button = document.getElementById('close_peq_input_button');
	close_peq_input_button.style.visibility = 'hidden';
	
	var channel = document.getElementById('channel').value;
	
	get_peq_view(channel);
}
function save_peq_input(parameter){
		
	var channel = document.getElementById('channel').value;
	var frequency_input = document.getElementById('frequency_input').value;
	var frequency_input_type = document.getElementById('frequency_input_type').value;
	
	//console.log(channel,frequency_input,frequency_input_type);
	
	if(parameter=='freq'){
		
		frequency_input = Math.round(frequency_input);
		
	   // only allow number in the range
        if(frequency_input<20){
           frequency_input=20;
        }
        if(frequency_input>20000){
           frequency_input=20000;
        }
	
        if(frequency_input>=20 && frequency_input<=20000){ // escape if number is not in the range
            document.getElementById(frequency_input_type+channel+'_freq').value = frequency_input;
            set_peq_data(channel,frequency_input_type,'freq', frequency_input);
        }
	 }
	if(parameter=='q'){
		
		frequency_input = Math.round(10*frequency_input)/10; // round to tenth
		
	   // only allow number in the range
        if(frequency_input<0.1){
           frequency_input=0.1;
        }
        if(frequency_input>20){
           frequency_input=20;
        }
	
        if(frequency_input>=0.1 && frequency_input<=20){ // escape if number is not in the range
            document.getElementById(frequency_input_type+channel+'_q').value = frequency_input;
            set_peq_data(channel,frequency_input_type,'q', frequency_input);
        }
	 }
	if(parameter=='fader'){
		
		frequency_input =  Math.round(100*frequency_input)/100; // round to 100th
				
	   // only allow number in the range
        if(frequency_input<-12){
           frequency_input=-12;
        }
        if(frequency_input>12){
           frequency_input=12;
        }
	
        if(frequency_input>=-12 && frequency_input<=12){ // escape if number is not in the range
            document.getElementById(frequency_input_type+channel+'_fader').value = frequency_input;
            set_peq_data(channel,frequency_input_type,'fader', frequency_input);
        }
	 }
	
	close_peq_input();
}
function close_threshold_input(){
	
	document.getElementById('threshold_input').type = 'hidden';
	
	var save_threshold_input_button = document.getElementById('save_threshold_input_button');
	save_threshold_input_button.style.visibility = 'hidden';
	
	var close_threshold_input_button = document.getElementById('close_threshold_input_button');
	close_threshold_input_button.style.visibility = 'hidden';
		
	get_mute_view();
	
}
function save_threshold_input(){
	
	var threshold_input = document.getElementById('threshold_input').value;
	var parameter = 'Threshold';
	
	threshold_input = parseInt(threshold_input);
	
	// only allow number in the range
	if(threshold_input<-144){
	   threshold_input=-144;
	}
	if(threshold_input>24){
	   threshold_input=24;
	}
	var Threshold_mute_channels = document.getElementById('Threshold_mute_channels').value;
	
	if(threshold_input>=-144 && threshold_input<=24){ // escape if number is not in the range
	 	document.getElementById('Threshold_mute_'+Threshold_mute_channels).value = threshold_input;
		set_mute_data(Threshold_mute_channels,threshold_input)
	}
	close_threshold_input();
}
function close_threshold_standby_input(){
	
	document.getElementById('threshold_standby_input').type = 'hidden';
	
	var save_threshold_standby_input_button = document.getElementById('save_threshold_standby_input_button');
	save_threshold_standby_input_button.style.visibility = 'hidden';
	
	var close_threshold_standby_input_button = document.getElementById('close_threshold_standby_input_button');
	close_threshold_standby_input_button.style.visibility = 'hidden';
		
	get_standby_view();
	
}
function save_threshold_standby_input(){
	
	var threshold_standby_input = document.getElementById('threshold_standby_input').value;
	var parameter = 'Threshold';
	
	threshold_standby_input = parseInt(threshold_standby_input);
	
	// only allow number in the range
	if(threshold_standby_input<-144){
	   threshold_standby_input=-144;
	}
	if(threshold_standby_input>24){
	   threshold_standby_input=24;
	}
	var Threshold_standby_channels = document.getElementById('Threshold_standby_channels').value;
	
	if(threshold_standby_input>=-144 && threshold_standby_input<=24){ // escape if number is not in the range
	 	document.getElementById('Threshold_standby_'+Threshold_standby_channels).value = threshold_standby_input;
		set_standby_data(Threshold_standby_channels,threshold_standby_input)
	}
	close_threshold_standby_input();
}
function close_delay_input(){
	
	document.getElementById('delay_input').type = 'hidden';
	var channel = document.getElementById('channel').value; 
	
	var save_delay_input_button = document.getElementById('save_delay_input_button');
	save_delay_input_button.style.visibility = 'hidden';
	
	var close_delay_input_button = document.getElementById('close_delay_input_button');
	close_delay_input_button.style.visibility = 'hidden';
		
	get_delay_view(channel);
	
}
function save_delay_input(){
	
	var delay_input = document.getElementById('delay_input').value;
	var channel = document.getElementById('channel').value;
	
	delay_input = parseInt(delay_input);
	
	// only allow number in the range
	if(delay_input<0){
	   delay_input=0;
	}
	if(delay_input>30){
	   delay_input=30;
	}
	
	if(delay_input>=0 && delay_input<=30){ // escape if number is not in the range
	 	document.getElementById('Delay_delay'+channel).value = delay_input;
		set_delay_data(channel,'Delay',delay_input);
	}
	close_delay_input();
}
function close_modal_input(){
	
	var modal_type = document.getElementById('modal_type').value;
	document.getElementById('modal_input').type = 'hidden';
	var channel = document.getElementById('channel').value; 
	
	var save_delay_input_button = document.getElementById('save_modal_input_button');
	save_delay_input_button.style.visibility = 'hidden';
	
	var close_delay_input_button = document.getElementById('close_modal_input_button');
	close_delay_input_button.style.visibility = 'hidden';
	
	if(modal_type=='compressor'){
	   get_compressor_view(channel);
	}
	if(modal_type=='limiter'){
	   get_limiter_view(channel);
	}
	if(modal_type=='noise_gate'){
	   get_noise_gate_view(channel);
	}
	if(modal_type=='peak_limiter'){
	   get_peak_limiter_view(channel);
	}
	if(modal_type=='rms_limiter'){
	   get_rms_limiter_view(channel);
	}
	if(modal_type=='signal_present'){
	   get_signal_present_view(channel);
	}
	if(modal_type=='router_input'){
	   get_router_view(channel);
	}
	if(modal_type=='ducker'){
	   get_ducker_view(channel);
	}
	if(modal_type=='duplexer_noise_gate'){
	   get_duplexer_view(channel);
	}
	if(modal_type=='duplexer_talkback_threshold'){
	   get_duplexer_view(channel);
	}
	if(modal_type=='duplexer_talkback_decay'){
	   get_duplexer_view(channel);
	}
	if(modal_type=='outputs'){
	   get_outputs_view();
	}
	if(modal_type=='mic_touch'){
	   get_dsp_view();
	}
}
function save_modal_input(){
	
	var json_type = document.getElementById('json_type').value;
	var modal_input = document.getElementById('modal_input').value;
	var modal_input_type = document.getElementById('modal_input_type').value;
	var modal_input_name2 = document.getElementById('modal_input_name2').value;
	var modal_type = document.getElementById('modal_type').value;
	var channel = document.getElementById('channel').value;
	var input_low = 0;
	var input_high = 0;
	modal_input = parseInt(modal_input);
	
	if(modal_type=='compressor'){
		if(modal_input_type=='Threshold'){
		   	input_low = -135;
	   		input_high = 21;
		}
		if(modal_input_type=='Hold'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Knee'){
		   	input_low = 1;
	   		input_high = 100;
		}
		if(modal_input_type=='Attack'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Decay'){
		   	input_low = 0;
	   		input_high = 2000;
		}
		if(modal_input_type=='Ratio'){
			input_low = 1;
	   		input_high = 100;
		}
	}
	if(modal_type=='limiter'){
		if(modal_input_type=='Threshold'){
		   	input_low = -24;
	   		input_high = 24;
		}
		if(modal_input_type=='Decay'){
		   	input_low = 5;
	   		input_high = 23;
		}
		if(modal_input_type=='RMSTC'){
		   	input_low = 1;
	   		input_high = 10000;
		}
	}
	if(modal_type=='noise_gate'){
		if(modal_input_type=='Threshold'){
		   	input_low = -135;
	   		input_high = 21;
		}
		if(modal_input_type=='Hold'){
		   input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Attack'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Decay'){
		   	input_low = 0;
	   		input_high = 2000;
		}
	}
	if(modal_type=='peak_limiter'){
		if(modal_input_type=='Threshold'){
		   	input_low = -135;
	   		input_high = 21;
		}
		if(modal_input_type=='Hold'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Attack'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Decay'){
		   	input_low = 0;
	   		input_high = 2000;
		}
	}
	if(modal_type=='rms_limiter'){
		if(modal_input_type=='Threshold'){
		   	input_low = -135;
	   		input_high = 21;
		}
		if(modal_input_type=='Hold'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Attack'){
		   	input_low = 1;
	   		input_high = 500;
		}
		if(modal_input_type=='Decay'){
		   	input_low = 0;
	   		input_high = 2000;
		}
	}
	if(modal_type=='signal_present'){
		if(modal_input_type=='Threshold'){
		   	input_low = -144;
	   		input_high = 24;
		}
		if(modal_input_type=='Trigger'){
		   	input_low = 2;
	   		input_high = 200;
		}
	}
	if(modal_type=='router_input'){
		if(modal_input_type=='gain'){
		   	input_low = 0;
	   		input_high = 28;
		} else {
		   	input_low = -15;
	   		input_high = 15;
		}
	}
	if(modal_type=='ducker'){
		if(modal_input_type=='Threshold'){
		   	input_low = -135;
	   		input_high = 20;
		}
		if(modal_input_type=='Hold'){
		   input_low = 1;
	   		input_high = 500;
		}
	}
	if(modal_type=='duplexer_noise_gate'){
		input_low = -144;
		input_high = 24;
		if(json_type=='edp01'){
		   	input_low = -90;
			input_high = -20;
		}
	}
	if(modal_type=='duplexer_talkback_threshold'){
		input_low = -144;
		input_high = 24;
	}
	if(modal_type=='duplexer_talkback_decay'){
		input_low = 0;
		input_high = 1000;
	}
	if(modal_type=='outputs'){
		if(modal_input_type=='Speaker'){
		   	input_low = -15;
	   		input_high = 0;
		}
		if(modal_input_type=='Line'){
		   	input_low = -15;
	   		input_high = 15;
		}
	}
	if(modal_type=='mic_touch'){
		if(modal_input_type=='SignalGain'){
		   	input_low = 0;
	   		input_high = 28;
		}
	}
	
	// only allow number in the range
	if(modal_input<input_low){
	   modal_input=input_low;
	}
	if(modal_input>input_high){
	   modal_input=input_high;
	}
	
	if(modal_input>=input_low && modal_input<=input_high){ // escape if number is not in the range
		
		if(modal_type=='compressor'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_compressor_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='limiter'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_limiter_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='noise_gate'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_noise_gate_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='peak_limiter'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_peak_limiter_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='rms_limiter'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_rms_limiter_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='signal_present'){
			document.getElementById(modal_input_type+'_'+modal_type+channel).value = modal_input;
			set_signal_present_data(channel,modal_input_type,modal_input);
		}
		if(modal_type=='router_input'){
			document.getElementById('router_'+modal_input_name2).value = modal_input;
				
			if(modal_input_type==='gain'){
                var gain_channel = modal_input_name2.replace("gain", "");
                set_main_data(gain_channel,'SignalGain',modal_input);
            } else {
				document.getElementById('router_enable_'+modal_input_name2).value = 1;
                set_router_volume(modal_input_type, modal_input);
            }
		}
		if(modal_type=='ducker'){
			document.getElementById(modal_input_type+'_ducker').value = modal_input;
			set_ducker_data(modal_input_type,modal_input);
		}
		if(modal_type=='duplexer_noise_gate'){
			modal_input_type = modal_input_type.charAt(0).toUpperCase() + modal_input_type.slice(1);
			document.getElementById(modal_input_type+'_duplexer').value = modal_input;
			set_duplexer_noise_gate_data(modal_input);
		}
		if(modal_type=='duplexer_talkback_threshold'){
			document.getElementById('Talkback_threshold_duplexer').value = modal_input;
			set_duplexer_talkback_threshold_data(modal_input);
		}
		if(modal_type=='duplexer_talkback_decay'){
			document.getElementById('Talkback_decay_duplexer').value = modal_input;
			set_duplexer_talkback_decay_data(modal_input);
		}
		if(modal_type=='outputs'){
			document.getElementById(modal_input_name2).value = modal_input;
			set_outputs_data(modal_input,modal_input_type);
		}
		if(modal_type=='mic_touch'){
			document.getElementById(modal_input_name2).value = modal_input;
			set_main_data(modal_input_name2.substring(10),modal_input_type,modal_input); // set_main_data(channel, parameter, value)
		}
	}
	close_modal_input();
}	

function presets_upload_button(){
		
	document.getElementById('fileuploads').value = '';
	$('#upload_preset').modal('show');
}
function initial_letters(string){
	
	var aInitials = new Array();
	var wordArray = string.split(" ");
	for( i = 0; i<wordArray.length; i++) {
		aInitials[i] = wordArray[i].substring(0,1).toUpperCase();
	}
	return  aInitials.join("");
}
function set_bridged_text2(text, top){
	// bridged text 2
		var bridged_text2 = new fabric.Textbox(String(text), {
			id: 'bridged_text2',
			name: 'bridged_text2',
			left: 220,
			top: top,
			width: 400,
			fontSize: 25,
			selectable: false,
			hasControls: false,
			fontFamily: 'Arial',
			fontWeight: 'bold',
			fill: 'rgba(0,0,0,1.0)',
			textAlign: 'left',
			editable: false,
		});
		canvas.add(bridged_text2);
}
function set_standby_text1(text, left, top){
	// standby_text1
    var standby_text1 = new fabric.Textbox(String(text), {
        id: 'standby_text1',
        name: 'standby_text1',
        left: left,
        top: top,
        width: 400,
        fontSize: 25,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(standby_text1);
}
function set_standby_text2(text, left, top){
	// standby_text2
    var standby_text2 = new fabric.Textbox(String(text), {
        id: 'standby_text2',
        name: 'standby_text2',
        left: left,
        top: top,
        width: 400,
        fontSize: 25,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(standby_text2);
}
function set_mute_text1(text, left, top){
	// mute_text1
    var mute_text1 = new fabric.Textbox(String(text), {
        id: 'mute_text1',
        name: 'mute_text1',
        left: left,
        top: top,
        width: 400,
        fontSize: 25,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(mute_text1);
}
function set_mute_text2(text, left, top){
	// mute_text2
    var mute_text2 = new fabric.Textbox(String(text), {
        id: 'mute_text2',
        name: 'mute_text2',
        left: left,
        top: top,
        width: 400,
        fontSize: 25,
        selectable: false,
        hasControls: false,
        fontFamily: 'Arial',
        fontWeight: 'bold',
        fill: 'rgba(0,0,0,1.0)',
        textAlign: 'left',
        editable: false,
    });
    canvas.add(mute_text2);
}
function set_status_led(color,left,top,type){

	var fill;
	if(color=='green'){
	   	fill = 'rgba(0,219,36,1.0)';
	 }
	if(color=='red'){
	   	fill = 'rgba(255,38,38,1.0)';
	 }
	   
	// protection led
	var led = new fabric.Circle({
		id: type +'_led',
		name: type + '_led',
		left: left,
		top: top,
		originX: 'left',
		originY: 'top',
		radius: 13,
		angle: 0,
		fill: fill,
		stroke: 'rgba(0,219,36,0.0)',
		selectable: false,
		objectCaching: false,
	});
	canvas.add(led);
}
	
function formatNumber(num) {
    return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
}
// ************************
// End Canvas code 	
// ************************
</script>
