// the function: "ValidIP()" checks for internal IPs and returns a 1 if true and a 0 if false.

function callPoll()
 {
	 if ( ValidIP()== 0 ) 
	 {
		Poll();
	 }
	 
}

function ValidIP() {
		var arrRegExp = new Array(18);


		arrRegExp[0] = /^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[1] = /^172\.16\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[2] = /^172\.16\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[3] = /^172\.17\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[4] = /^172\.18\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[5] = /^172\.19\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[6] = /^172\.20\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[7] = /^172\.21\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[8] = /^172\.22\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[9] = /^172\.23\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[10] = /^172\.24\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[11] = /^172\.25\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[12] = /^172\.26\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[13] = /^172\.27\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[14] = /^172\.28\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[15] = /^172\.29\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[16] = /^172\.30\.[0-9]{1,3}\.[0-9]{1,3}$/
		arrRegExp[17] = /^172\.31\.[0-9]{1,3}\.[0-9]{1,3}$/



		var intMatch = 0;
		for(var i = 0; i < arrRegExp.length; i++){
			if(arrRegExp[i].test(strIP)){
				intMatch = 1;
				break;
			}
		}

		return intMatch;
	}