function OverMenu(obj)
{
	//obj.style.backgroundColor="#4477BB";
	//obj.style.color="red";
}

function OutMenu(obj)
{
	//obj.style.backgroundColor="white";
	//obj.style.color="black";
}

function ClearColor(obj)
{
	obj.style.backgroundColor = "white";
	obj.style.color="black";
}

function ClickMenu(obj,MacString)
{
	var addnum=0;
	var p2p  = document.getElementById("PtP Bridge");
	var p2mp = document.getElementById("PtMP Bridge");
//alert(MacString);
		//SiteSurveyTable.style.backgroundColor = "white"
//	document.forms[0].hide.value = 2;
//	document.forms[0].hide2.value = MacString;
  if(p2p)
 { 
      if(p2p.checked==true)  //p2p
   {
       var i=0;
       for(var i=0; i<3; i++)
      {  
      	if(document.getElementById("PtPBridge_RemoteAPMacAddr"+i))
           if(document.getElementById("PtPBridge_RemoteAPMacAddr"+i).value==MacString)
          {
             	alert("The same MAC Address has been added!");
               return ;
          }   	
      } 
      var i=0;
      for(var i=0; i<3; i++)
      {
      if(document.getElementById("PtPBridge_RemoteAPMacAddr"+i))
      	if(document.getElementById("PtPBridge_RemoteAPMacAddr"+i).value=="")
      	{
      		document.getElementById("PtPBridge_RemoteAPMacAddr"+i).value=MacString;
      		alert("MAC Address added!");
      		obj.style.backgroundColor="#4477BB";
	        obj.style.color="red";
      		addnum=1;
      	  return;
      	} 
      } 
     if(!addnum)
     { 
     	if(document.getElementById("PtPBridge_RemoteAPMacAddr0"))
     	 { 
     	 	document.getElementById("PtPBridge_RemoteAPMacAddr0").value=MacString;// if there is no field,replace first field
     	  alert("MAC Address added!");
     	 }
     	} 
   }
  }//p2p end
   
  if(p2mp)
  { 
   if(p2mp.checked==true)  //p2mp
   {
   	  var i=0;
       for(var i=0; i<16; i++)
      {
      	if(document.getElementById("PtMP_RemoteAPMacAddr"+i))
         if(document.getElementById("PtMP_RemoteAPMacAddr"+i).value==MacString)
          {   	 alert("The same MAC Address has been added!");
                 return;
          }
      } 
      var i=0;
      for(var i=0; i<16; i++)
      {
       if(document.getElementById("PtMP_RemoteAPMacAddr"+i))
      	if(document.getElementById("PtMP_RemoteAPMacAddr"+i).value=="")
      	{
      	 document.getElementById("PtMP_RemoteAPMacAddr"+i).value=MacString;
      	  alert("MAC Address added!");
      	  obj.style.backgroundColor="#4477BB";
	        obj.style.color="red";
      	  addnum=1;
      	  return;
        }
      }
      if(!addnum)
       { 
       if(document.getElementById("PtMP_RemoteAPMacAddr0"))	
       {
        document.getElementById("PtMP_RemoteAPMacAddr0").value=MacString;// if there is no field,replace first field
          alert("MAC Address added!");
        }  
      }
   }
	}//end p2mp
}