function lockMSISDN(fld, e) {
		var sep = 0;
		var key = '';
		var i = j = 0;
		var len = len2 = 0;
		var strCheck = '+0123456789';
		var aux = aux2 = '';
		var whichCode = (window.Event) ? e.which : e.keyCode;
		//document.write(whichCode);
		if (whichCode == 0) return true;  
		if (whichCode == 8) return true;  
		if (whichCode == 13) return true; 
			key = String.fromCharCode(whichCode);  // Get key value from key code
		if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
		return true;
}

function lockAngka(fld, e) {
		var sep = 0;
		var key = '';
		var i = j = 0;
		var len = len2 = 0;
		var strCheck = '0123456789';
		var aux = aux2 = '';
		var whichCode = (window.Event) ? e.which : e.keyCode;
		//document.write(whichCode);
		if (whichCode == 0) return true;  
		if (whichCode == 8) return true;  
		if (whichCode == 13) return true; 
			key = String.fromCharCode(whichCode);  // Get key value from key code
		if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
		return true;
}

function trimTitik(s){
        var res;
        var i;
        res = "";
        for (i = 0; i < s.length; i++){
                if (s.charAt(i) != ".")
                        res += s.charAt(i);
        }
        return res;
}

function formatAngka(fld) {
	var i = a = b = c = d = 0;
	var len = 0;
	var temp2= '';
	temp=trimTitik(fld.value);
	len = temp.length;
	a=len-3;
	b=len-6;
	c=len-9;
	d=len-12;
	
	if((len>=4)&&(len<=6)){
		temp2=temp.substr(0,a)+'.'+temp.substr(a);
	}else if((len>=7)&&(len<=9)){
		temp2=temp.substr(0,b)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else if((len>=10)&&(len<=12)){
		temp2=temp.substr(0,c)+'.'+temp.substr(c,3)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else if((len>=13)&&(len<=14)){
		temp2=temp.substr(0,d)+'.'+temp.substr(d,3)+'.'+temp.substr(c,3)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else{
		temp2=temp;
	}
	fld.value = temp2;
	return;
}

function formatAngkaString(s) {
	var i = a = b = c = d = 0;
	var len = 0;
	var temp2= '';
	temp=s;
	len = temp.length;
	a=len-3;
	b=len-6;
	c=len-9;
	d=len-12;
	
	if((len>=4)&&(len<=6)){
		temp2=temp.substr(0,a)+'.'+temp.substr(a);
	}else if((len>=7)&&(len<=9)){
		temp2=temp.substr(0,b)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else if((len>=10)&&(len<=12)){
		temp2=temp.substr(0,c)+'.'+temp.substr(c,3)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else if((len>=13)&&(len<=14)){
		temp2=temp.substr(0,d)+'.'+temp.substr(d,3)+'.'+temp.substr(c,3)+'.'+temp.substr(b,3)+'.'+temp.substr(a);
	}else{
		temp2=temp;
	}
	return temp2;
}