function isCurrency(myString){		
		var MyStr = "0123456789,";
		for (i=0; i<myString.length; i++){
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1){
				return false;
			}
		}
		return true;
	}
function isSpace(myStr){
		while (myStr != "" ) {
			myStr = myStr.substring(1, myStr.length);
			if( myStr.substring(0, 1) == " " )
				return true;
		}
		return false;
	} // end fn isAllSpaces	
function isIntAlpha(myString){		
	var MyStr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	myString = myString.toUpperCase();
	for (i=0; i<myString.length; i++){
		var MyChar = myString.substring(i,i+1);
		if (MyStr.indexOf(MyChar) == -1){
			return false;
		}
	}
	return true;
}
	function isAlphabet(myString)
	{		
		myString = myString.toUpperCase();
		var MyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		for (i=0; i<myString.length; i++) 
		{
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1) 
			{
				return false;
			}
		}
		return true;
	} // end 
	
	function isAllSpaces(myStr){
		while (myStr.substring(0, 1) == " ") {
			myStr = myStr.substring(1, myStr.length);
		}
	
		if(myStr == ""){
			return true;
		}
		return false;
	} // end fn isAllSpaces
	
	
	function isValidDate(year, month, day)
	{
		myDate = new Date(month + "/" + day + "/" + year);
		if(parseInt(myDate.getDate()) != parseInt(day))
		{
			return false;
		}
		else
	return true;
	} // end fn isValidDate
	
	function myFunction(year, month, day)
	{
		alert(year);
		alert(month);	
		alert(day);
	}
	function isValidTime(sy, sm, sd, shh, smm, sampm, ey, em, ed, ehh, emm, eampm){
		if(sampm == "pm")
			shh = shh + 12;
			
		if(eampm == "pm")
			ehh = ehh + 12;
			
		myStartTime = new Date(sy, sm, sd, shh, smm, 00);
		myEndTime =   new Date(ey, em, ed, shh, smm, 00);
		
		if(Date.parse(myStartTime) < Date.parse(myEndTime)){
			return false;
		}
		
		return true;
		
	}//end fn isValidTime

	function isSpecialChar(myString){
		var MyStr = '<>;.@|[}{]_/\\*&^%$#!"~+=:;,?\'';
		for (i=0; i<myString.length; i++) {
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) != -1 ) {
				return true;
			}
		}
		return false;
	} // end fn isSpecialChar
	
	function isSpecial(myString){
		var MyStr = '<>;|[}{]_/\\*&^%$#!"~+=:;,?\'';
		for (i=0; i<myString.length; i++) {
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) != -1 ) {
				return true;
			}
		}
		return false;
	}
	function isSpecialEmail(myString){
		var i;
		var MyStr = '<>;|[}{]/\\*&^%$#!"~+=:;,?\'';
		for (i=0; i<myString.length; i++) {
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) != -1 ) {
				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) ||
				(isSpecialEmail(s)) ||
				(s.charAt(s.indexOf("@") + 1) == ".") ||
				(s.charAt(s.indexOf("@") - 1) == ".")			
			) return false;
		else return true;
	} //end fn isEmail
	function checkForNums(theForm)
		{
			var nfound = 0;
			var alphas = " .ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-+`~,";
			var myValue = theForm.value.toUpperCase();
			for(count=0;count<= myValue.length-1;count++)
				{
				if (alphas.indexOf(myValue.substring(count, count+1)) == -1)
					{
					//alert(alphas.indexOf(myValue.substring(count, count+1));
					nfound++;
					}
				}
			return nfound;
		}
	
	function CheckAlphas(mValue)
		{
			var notFound=0;
			var n="0123456789";
			for (c=0; c<=mValue.length-1; c++)
				{
				if (n.indexOf(mValue.substring(c,c+1)) == -1)
					notFound++;
				}
			return notFound;
			}

	function isInt(myString){		
		var MyStr = "0123456789";
		for (i=0; i<myString.length; i++){
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1){
				return false;
			}
		}
		return true;
	}
	
	function isPhoneFax(myString){		
		var MyStr = "0123456789- ";
		for (i=0; i<myString.length; i++){
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1){
				return false;
			}
		}
		return true;
	}

	function isFloat(myString){		
		var MyStr = "0123456789.";
		decimal = false;
		for (i=0; i<myString.length; i++){
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1 || (MyChar == "." && decimal == true)){
				return false;
			}
			if(MyChar == ".")
				decimal = true;
		}
		return true;
	}			

	function isValidImage(ImagePath){
		var l_Flag=false;      	
		var a=ImagePath.substring(ImagePath.length - 3,ImagePath.length);
	   	var Last4=ImagePath.substring(ImagePath.length - 4,ImagePath.length);
		if (a == "gif" || a == "jpg" || Last4 == "jpeg")
	  	    	l_Flag=true;
	         
	   return l_Flag;
	}//end function isValidImage.
	
	function isValidMailChar(myString)
	{
		var i;
		myString = myString.toUpperCase();
		var MyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@_-.";
		for (i=0; i<myString.length; i++) {
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1) {
				return false;
			}
		}
		return true;
	} // end 
	
	//vaild passwod characters
	function isValidPassChar(myString)
	{
		var i;
		myString = myString.toUpperCase();
		var MyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
		for (i=0; i<myString.length; i++) 
		{
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1) 
			{
				return false;
			}
		}
		return true;
	} // end 
	
	//is numeric checking
	
	function isNumber(myString)
	{	
		var i;
		var MyStr = "0123456789";
		for (i=0; i<myString.length; i++) 
		{
			var MyChar = myString.substring(i,i+1);
			if (MyStr.indexOf(MyChar) == -1) 
			{
				return false;
			}
		}
		return true;
	} // end 
	
	function isValidText(myStr) {
			var str = "<>\"'";
			var i;
			for (i=0; i<myStr.length; i++) {
				// if our string contains < or >
				if (str.indexOf(myStr.substring(i,i+1)) != -1) {
					return false;
				}
			}
			return isValidWordLength(myStr, 50);
		}
	
	function isValidWordLength(myStr, mLength){
		mParaGraph = myStr.split("\n");
		mParaGraph.length ? end = mParaGraph.length : end = 1;
		for(i = 0; i < end; i++){
			mWord = mParaGraph[i].split(" ");
			for(j = 0; j < mWord.length; j++){
				if(mWord[j].length >= mLength){
					return false;
				}
			}
		} 
		return true;
	}
	
		function checkValidEmail(EAddress)
		{
			var MyStr = "<>;/ \\*&^%$#!~+=:;,?";
			for (i=0; i<EAddress.length; i++) {
				var MyChar = EAddress.substring(i,i+1);
				if (MyStr.indexOf(MyChar) != -1) {
					return false;
				}
			}
			if ((EAddress.indexOf('@') == -1) || (EAddress.indexOf('.') == -1)) {
				return false;
			}
			if (EAddress.indexOf('@.') != -1) {
				return false;
			}
			
			if (EAddress.substring(EAddress.length-1,EAddress.length) == ".") {
				return false;
			}
			return true;
		}
		
function checkOneChecked(theForm, chkName){
	var i, chkboxIndex = "";
	for(i = 0; i < theForm.elements.length; i++){
		if(theForm.elements[i].name.indexOf(chkName) != -1){
			chkboxIndex == "" ? chkboxIndex = i : "";
			if(theForm.elements[i].checked)
				return 1;
		}
	}
	chkboxIndex != "" ? theForm.elements[chkboxIndex].focus() : "";
	return 0;
}

// fucntion to manipulate the check boxe
	function checkall(theform)
	{
		if(theform.all.checked)
		{
			for(i=0; i < theform.elements.length; i++)
				if(theform.elements[i].type == "checkbox" && theform.elements[i].name != "clscatStatus" )
					theform.elements[i].checked = 1;
		}
		else 
		{
			for(i=0; i < theform.elements.length; i++)
				if(theform.elements[i].type == "checkbox" && theform.elements[i].name != "clscatStatus")
					theform.elements[i].checked = 0;

		}
		
	}
	
	function checkAllChecked(theform){
		numBoxes = 0;
		checkedBoxes = 0;
		for(i = 0; i < theform.elements.length; i++){
//			if(theform.elements[i].name == "strIds[]" ||theform.elements[i].id == "strIds" ){
		if(theform.elements[i].type == "checkbox" && theform.elements[i].name != "clscatStatus" && theform.elements[i].name != "all" ){
				numBoxes++;
				if(theform.elements[i].checked){
					checkedBoxes++;
				}
			}
		}
		if(checkedBoxes == numBoxes){
			theform.all.checked = true;
		}
		else{
			theform.all.checked = false;
		}
		
	}

	function confirmUpdate(theform)
	{
		checkedBoxes = 0;
		checkBox = 0;
		for(i = 0; i < theform.elements.length; i++)
		{
		//	if(theform.elements[i].name == "strIds[]" || theform.elements[i].id == "strIds" || theform.elements[i].name == "strIds" ){
		if(theform.elements[i].type == "checkbox" && theform.elements[i].name != "clscatStatus"  ){
				checkBox++;
				if(theform.elements[i].checked){
					checkedBoxes++;
				}
			}
		}		
		if( checkedBoxes == 0 && checkBox > 0 )
		{
			alert( "Check atleast one check box");
			return false;
		}
		else
			return true;
	}

	function confirmDel(theform)
	{
		checkedBoxes = 0;
		for(i = 0; i < theform.elements.length; i++){
			if(theform.elements[i].name == "del[]" || theform.elements[i].id == "del" || theform.elements[i].name == "del" ){
				if(theform.elements[i].checked){
					checkedBoxes++;
				}
			}
		}		
		if( checkedBoxes > 0 )
		{
			if(confirm("Are you sure your want to delete the selected image(s)")){
				return true;
			}
			else 
				return false;
		}
		else{
			alert( "You must Select atleast One Record");
			return false;
		}
	}

	function isValidURL(s){
		if(s.length == 0)
			return false;
	
		if ( s.substring(0,7) == "http://" )
			s = s.substring(7, s.length);
		if	(	(s.indexOf(".") <= 0) || 
				(s.indexOf(" ") > -1) || 
				(s.lastIndexOf(".") == s.length -1) ||
				(s.indexOf("..") != -1) ||
				(isSpecial(s))
			) return false;
		else return true;
	} //end fn isURL

	function check(theForm, mName, myIndex){
		for(i = 0; i < theForm.elements.length; i++){
			if(theForm.elements[i].name.indexOf(mName) > -1){
				break;
			}
		}
		(theForm.elements[i+myIndex].checked) ? theForm.elements[i+myIndex].checked = false : theForm.elements[i+myIndex].checked = true;
	}	
	
