function checkValues(temp){
if (temp.match(/^[-_a-zA-Z]{6,}?$/)) {
	return true 
	} 
else {
	return false
	}	
}

String.prototype.ltrim = function (){
	temp=this.toString();
	temp = temp.replace(/(\r|\n)/g, " ");
	temp = temp.replace(/^[ \t]+/mg, "");
	return temp
	}
	
String.prototype.rtrim = function (){
	temp=this.toString();
	temp = temp.replace(/(\r|\n)/g, " ");
	temp = temp.replace(/[ \t]+$/mg, "");
	return temp
	}	
	
	
String.prototype.trim = function (){
	temp=this.toString();
	temp=temp.ltrim();
	temp=temp.rtrim();
	return temp
	}
	
String.prototype.isEmpty=function(){
	txt=this.toString();
	txt = txt.replace(/(\r\n|\n)/g, "");
	return (txt.trim()=='')?true:false;
	}
	
String.prototype.isValidMail=function (){
	temp=this.toString();
	if (temp.match(/^[a-zA-Z0-9._%-]*@[a-zA-Z0-9._%-]*\.(?:[a-zA-Z0-9_%-]*(?:\.[A-Z0-9_%-a-z]{2,4})|[a-zA-Z0-9_%-]{2,4})$/)) return true 
	else return false
	}

String.prototype.isLikeUrl=function (){
	temp=this.toString();
	if (temp.match(/^(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]$/i)) return true 
	else return false
	}

String.prototype.isValid=function (regExp){
	temp=this.toString();
	if (arguments.length>1) var strregexp = new RegExp(regExp,arguments[1]);
	else var strregexp = new RegExp(regExp);
	var match = strregexp.exec(temp);
	if (match != null) return true;
	else return false;
	}


String.prototype.isValidPassword=function (){
	temp=this.toString();
	if (temp.match(/^[-_a-zA-Z0-9]{4,15}$/)) return true
	else return false
	}
String.prototype.isNumeric=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^\b\d+\b$/)) onay=true;
	return onay;	
	}	
String.prototype.isAlphaNumeric=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^[\w\d\s\.ığı?Üİ?ÇÖ]*$/))  onay=true;
	return onay;	
	}
String.prototype.isValidDate=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.](19|20)[0-9]{2}$/)) onay=true;
	return onay;	
	}	

String.prototype.isValidTime=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^([1-9]|1[0-9]|2[0-3]):[0-5][0-9]$/)) onay=true;
	return onay;	
	}	

String.prototype.isValidData=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^[^'"\r\n]*$/)) onay=true;
	return onay;	
	}	


String.prototype.isValidRouteAbbr=function (){
	temp=this.toString();
	onay=false;
	if (temp.match(/^[A-Z]{3,5}$/i)) onay=true;
	return onay;	
	}	

function allowed(list){
	CodeAscii=String.fromCharCode(window.event.keyCode);
	var strregexp = new RegExp("["+list+"]");
	var match = strregexp.exec(CodeAscii);
	if (match != null) return true;
	else return false;
	}

function wspace(obj){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return true;
	//0-9
	if ((window.event.keyCode>=48)&&(window.event.keyCode<=57)) return true;
	else hata=true;
	//A-Z
	if ((window.event.keyCode>=65)&&(window.event.keyCode<=90)) return true;
	else hata=true;
	//a-z
	if ((window.event.keyCode>=97)&&(window.event.keyCode<=122)) return true;
	else hata=true;
	if (hata==true) return false;
	else return true;
	}

function wospace(obj){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return false
	//0-9
	if ((window.event.keyCode>=48)&&(window.event.keyCode<=57)) return true;
	else hata=true;
	//A-Z
	if ((window.event.keyCode>=65)&&(window.event.keyCode<=90)) return true;
	else hata=true;
	//a-z
	if ((window.event.keyCode>=97)&&(window.event.keyCode<=122)) return true;
	else hata=true;
	if (hata==true) return false;
	else return true;
	}
	
function onlyalph(obj){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return true
	//A-Z
	if ((window.event.keyCode>=65)&&(window.event.keyCode<=90)) return true;
	else hata=true;
	//a-z
	if ((window.event.keyCode>=97)&&(window.event.keyCode<=122)) return true;
	else hata=true;
	if (hata==true) return false;
	else return true;
	}	
	
function onlynumbers(){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return false
	//0-9
	if ((window.event.keyCode>=48)&&(window.event.keyCode<=57)) return true;
	else hata=true;
	if (hata==true) return false;
	else return true;
	}	
function floatnumbers(){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return false
	//0-9
	
		if (((window.event.keyCode>=48)&&(window.event.keyCode<=57))||(window.event.keyCode==46)) {
			if ((window.event.keyCode==46)) {
				if (event.srcElement.value.indexOf('.')<0) return true
				else hata=false;
				}
			else return true;
			}
		else hata=true;

	if (hata==true) return false;
	else return true;
	}		
function nospace(obj){
	hata=false
	//Cancel Space
	if (window.event.keyCode==32) return false
	//0-9
	if (hata==true) return false;
	else return true;
	}	
	

function dateFirstBigger(a,b){
	//Date("12 April 2004")
	onay=false;
	c = Math.floor(new Date(b) - new Date(a)) / 86400000
	//alert(c)
	if (c>=0) onay=true
	return onay
	}
	
	
function changeToJsDate(subject){
		
	if (subject=='now') {
		now=new Date()
		subject=now.getDate()+'/'+now.getMonth()+'/'+now.getFullYear()
		}
	result = subject.replace(/^([0-9]{1,2})[.\/\-\_]([0-9]{1,2})[.\/\-\_]([0-9]{4})$/g, "$3/$2/$1");
	//alert(result)
	return result;
	}
	
function findAge(dateofbirth){
	now = new Date()
	bdate=changeToJsDate(dateofbirth)
	born = new Date(bdate);
	
	by=born.getFullYear()
	bm=born.getMonth()
	bd=born.getDate()
	
	ny=now.getFullYear()
	nm=now.getMonth()
	nd=now.getDate()
	
	years=ny-by

	if((bm == nm) && (bd <= nd)) years = years;
	else {
		if(bm <= nm) years = years-1;
		else years = years; 
		}
	
	return years		
	
	}
function isPopUpsBlocked(){
	var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no');
	if(mine) popUpsBlocked = false
	else popUpsBlocked = true
	mine.close();
	return popUpsBlocked;
}


function passwordStrength(pass){
	strength=0;
	if (pass.match(/[a-z]+/)) strength++;
	if (pass.match(/[0-9]+/)) strength++;
	if (pass.match(/[A-Z]+/)) strength++;
	return strength;
	}
	
function leapyear(a) {
	if(((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) return true;
	else return false;
	}
function isRadioChecked(obj){
	if (typeof(obj)=="undefined") return false;
	for(i=0;i<obj.length;i++){
		if (obj[i].checked) return true;
		}
	return false;
	}