String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

var isMozilla = (document.all)?false:true;

function CheckLen(Target, len, counterName ){
	var StrLen;
	StrLen = Target.value.length;			
	if ( StrLen == 1 && Target.value.substring(0,1) == " "){
		Target.value = ""
		StrLen = 0
	}				
	if ( StrLen > len ){
		
			alert('Not alanı maksimum ' + len + ' karakter uzunluğunda olabilir.');
		
		Target.value = Target.value.substring(0, len)	  
	}			
	var myCounter;					
	myCounter  = document.getElementById( counterName )			
	myCounter.value = len - StrLen
}

function numbersonly(e, decimal) {
	var key;
	var keychar;

	if (window.event) {
		key = window.event.keyCode;
	}
	else if (e) {
		key = e.which;
	}
	else {
		return true;
	}
	
	keychar = String.fromCharCode(key);

	if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {
		return true;
	}
	else if ((("0123456789").indexOf(keychar) > -1)) {
		return true;
	}
	else if (decimal && (keychar == ".")) { 
		return true;
	}
	else
		return false;
}

function nonnumeric(pValue){
	return pValue.replace(/[^0-9]/g, '');
}

function ConfirmDeletion(pUrl){
	if(confirm('Bu kaydı silmek istediğinizden emin misiniz?')){
		document.location.href=pUrl;
	}
}

function SwapPic(pOjectId, pImgUrl){
	document.getElementById(pOjectId).src = pImgUrl;
}

