<!-- begin JS
var store_val;
var m1 = "Hint: Select an item for query and then enter the require information in the Address bar.";
var m2 = "                                            ";
var msg = m2+m1+m2;
var count=0;


function isFilled(elm){
	if (elm.value == "" || elm.value == null)
		return false;
	else
	 	return true;
	}

// validate input data, set ip address for bgp summary
function Validate(form) {
	if (document.query.show[2].checked){
		document.query.name.value = "202.40.161.1";
		return true;
		}

	if (document.query.show[3].checked){
		document.query.name.value = "2001:7FA:0:1::CA28:A101";
		return true;
		}

	if (isFilled(form.name) == false){
		alert ("You did not provide the require information.\nPlease fill in the Address box and try again!!");
		form.name.focus();
		return false;
		}
	return true;
	}

// scroll text on status bar
function scroll(){
   window.status = msg.substring(count, msg.length) + msg.substring(0, count);
   if (count < msg.length)
      count++;
   else count=0;
      setTimeout("scroll()",100);
   }

// ---- define show message here -------
function setMsg(num){
   if (num==0)
	msg = 'Hint: Select an item for query and then enter the require information in the Address bar.';	
   if (num==1)
	msg = 'Starts ping from HKIX route server, input an IP address to ping......';		
   if (num==2)
	msg = 'Show incoming access filters applied to IX members, input member address.';
   if (num==3)
	msg = 'Displays the status of all Border Gateway Protocol (BGP) connections.';
   if (num==4)
	msg = 'Displays the BGP session of a HKIX member, input member address.';
   if (num==5)
	msg = 'To display BGP routes received and accepted on the route server, input member address.';
   if (num==6)
	msg = 'To display BGP routes have advertised to the member, input member address.';
   if (num==7)
	msg = 'Show network in BGP routing table, input ip address, AS path or regexp.....'
   msg = m2+msg+m2;
}

// store temp value on BGP summary click or un-click
function BGPsumm(on){
	if (on){
	   store_val = document.query.name.value;
	   document.query.name.value = "BGP summary";
	   setMsg(3);
	   }
	else 
	   document.query.name.value = store_val;
	}

// end JS -->
