commit 300e2c0bc9e2d819f3d28c566b24202dd4f4c7a0
Author: Vinicius Coque <vinicius.coque@bluepex.com>
Date:   Tue Sep 27 19:38:56 2011 -0300

    convert javascript code to jQuery on system* files

diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php
index 4bec11a71e..f2fdb8003a 100644
--- a/usr/local/www/system_advanced_misc.php
+++ b/usr/local/www/system_advanced_misc.php
@@ -192,9 +192,9 @@ include("head.inc");
 <script type="text/javascript" >
 function maxmss_checked(obj) {
 	if (obj.checked)
-		$('maxmss').enable();
+		jQuery('#maxmss').attr('disabled',false);
 	else
-		$('maxmss').disable();
+		jQuery('#maxmss').attr('disabled','true');
 }
 </script>
 	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php
index e9d8e0dc84..8aaa5a3a35 100755
--- a/usr/local/www/system_firmware_check.php
+++ b/usr/local/www/system_firmware_check.php
@@ -166,8 +166,8 @@ if ($needs_system_upgrade == false) {
 	exit;
 }
 
-echo "\n<script>$('invokeupgrade').style.visibility = 'visible';</script>";
-echo "\n<script>$('backupdiv').style.visibility = 'visible';</script>";
+echo "\n<script>jQuery('#invokeupgrade').css('visibility','visible');</script>";
+echo "\n<script>jQuery('#backupdiv').css('visibility','visible');</script>";
 
 $txt  = gettext("A new version is now available") . "\\n\\n";
 $txt .= gettext("Current version") .": ". $current_installed_version . "\\n";
diff --git a/usr/local/www/system_groupmanager_addprivs.php b/usr/local/www/system_groupmanager_addprivs.php
index 104d562537..752b846eec 100644
--- a/usr/local/www/system_groupmanager_addprivs.php
+++ b/usr/local/www/system_groupmanager_addprivs.php
@@ -198,7 +198,7 @@ function update_description() {
 								<a href='#'onClick="selectAll();">Select all</a>
 								<script type="text/javascript">
 									function selectAll() {
-										var options = $$('select#sysprivs option');
+										var options = jQuery('select#sysprivs option');
 										var len = options.length;
 										for (var i = 0; i < len; i++) {
 										    options[i].selected = true;
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index 3e5620606f..1e23707da2 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -192,7 +192,7 @@ include("head.inc");
                     </select>
                     <br> <span class="vexpl"><?=gettext("Destination network for this static route"); ?></span></td>
                 </tr>
-                <tr> 
+                <tr>
                   <td width="22%" valign="top" class="vncellreq"><?=gettext("Gateway"); ?></td>
                   <td width="78%" class="vtable">
 			<select name="gateway" id="gateway" class="formselect">
@@ -288,7 +288,7 @@ include("head.inc");
 						document.getElementById("cancel").style.display = 'none';
 						document.getElementById("gwsave").style.display = '';
 						document.getElementById("gwcancel").style.display = '';
-						$('notebox').innerHTML="";
+						jQuery('#notebox').html("");
 					}
 					function hide_add_gateway() {
 						document.getElementById("addgateway").style.display = 'none';
@@ -301,34 +301,34 @@ include("head.inc");
 					}
 					function hide_add_gatewaysave() {
 						document.getElementById("addgateway").style.display = 'none';
-						$('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> <?=gettext("One moment please..."); ?>';
-						var iface = $('addinterfacegw').getValue();
-						name = $('name').getValue();
-						var descr = $('gatewaydescr').getValue();
-						gatewayip = $('gatewayip').getValue();
-						addrtype = $('addrtype').getValue();
+						jQuery('#status').html('<img src="/themes/metallic/images/misc/loader.gif"> One moment please...');
+						var iface = jQuery('#addinterfacegw').val();
+						name = jQuery('#name').val();
+						var descr = jQuery('#gatewaydescr').val();
+						gatewayip = jQuery('#gatewayip').val();
+						addrtype = jQuery('#addrtype').val();
 						var defaultgw = '';
-						if ($('defaultgw').checked)
+						if (jQuery('#defaultgw').checked)
 							defaultgw = 'yes';
 						var url = "system_gateways_edit.php";
 						var pars = 'isAjax=true&defaultgw=' + escape(defaultgw) + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip) + '&type=' + escape(addrtype);
-						var myAjax = new Ajax.Request(
+						jQuery.ajax(
 							url,
 							{
-								method: 'post',
-								parameters: pars,
-								onFailure: report_failure,
-								onComplete: save_callback
-							});	
+								type: 'post',
+								data: pars,
+								error: report_failure,
+								complete: save_callback
+							});
 					}
 					function addOption(selectbox,text,value)
 					{
 						var optn = document.createElement("OPTION");
 						optn.text = text;
 						optn.value = value;
-						selectbox.options.add(optn);
-						selectbox.selectedIndex = (selectbox.options.length-1);
-						$('notebox').innerHTML="<p/><strong><?=gettext("NOTE:");?></strong> <?php printf(gettext("You can manage Gateways %shere%s."), "<a target='_new' href='system_gateways.php'>", "</a>");?> </strong>";
+						selectbox.append(optn);
+						selectbox.prop('selectedIndex',selectbox.children('option').length-1);
+						jQuery('#notebox').html("<p/><strong><?=gettext("NOTE:");?></strong> <?php printf(gettext("You can manage Gateways %shere%s."), "<a target='_new' href='system_gateways.php'>", "</a>");?> </strong>");
 					}				
 					function report_failure() {
 						alert("<?=gettext("Sorry, we could not create your gateway at this time."); ?>");
@@ -339,8 +339,8 @@ include("head.inc");
 						if (response) {
 							document.getElementById("addgateway").style.display = 'none';
 							hide_add_gateway();
-							$('status').innerHTML = '';
-							addOption($('gateway'), name, name);
+							jQuery('#status').html('');
+							addOption(jQuery('#gateway'), name, name);
 						} else {
 							report_failure();
 						}
