	/******* Code by Zaheer Hussain **********/

function isInt(myString){
	var i;
	var MyStr = "0123456789";
	if(myString.length==1 && myString.value==0){
		return false;
	}
	for (i=0; i<myString.length; i++){
		var MyChar = myString.substring(i,i+1);
		if (MyStr.indexOf(MyChar) == -1){
			return false;
		}
	}
	return true;
}

function isAllSpaces(myStr){
		while (myStr.substring(0, 1) == " ") {
			myStr = myStr.substring(1, myStr.length);
		}
	
		if(myStr == ""){
			return true;
		}
		return false;
	}

function isEmail(s){

	if(s.length == 0)

		return false;

	if	(	(s.indexOf("@") <= 0) || 

			(s.indexOf("@") == s.length -1) || 

			(s.indexOf("@") != s.lastIndexOf("@")) || 

			(s.indexOf(".") <= 0) || 

			(s.indexOf(" ") > -1) || 

			(s.lastIndexOf(".") == s.length -1) ||

			(s.lastIndexOf(".") < s.indexOf("@")) ||

			(s.indexOf("..") != -1) ||

			(isSpecialChar(s)) ||

			(s.charAt(s.indexOf("@") + 1) == ".") ||

			(s.charAt(s.indexOf("@") - 1) == ".")			

		) return false;

	else return true;

} //end fn isEmail

function emptyit(obj, emptystr){
	if(obj.value == emptystr){
		obj.value = "";
	}
}

function fillit(obj, emptystr){
	if(obj.value == "" || isAllSpaces(obj.value)){
		obj.value = emptystr;
	}
}

function updatecombo(obj_cbo, obj_ajax, passdata){
	obj_cbo.disabled = true;
	obj_cbo.options[0].text = "Processing ..... please wait.";
	obj_ajax.update(passdata);
}

