function trim(strText) { 
  // this will get rid of leading spaces 
  while (strText.substring(0,1) == ' ') 
      strText = strText.substring(1, strText.length);
   // this will get rid of trailing spaces 
  while (strText.substring(strText.length-1,strText.length) == ' ')
      strText = strText.substring(0, strText.length-1);
  return strText;
}

function Uzunluk(textObj,L)
{
	var newValue = textObj.value
	var newLength = newValue.length 
	
	if(newLength<L)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function emptyField(textObj)
	{	
		if(textObj.value.length == 0) return true;
		for(var i=0; i< textObj.value.length; ++i) {
			var ch = textObj.value.charAt(i);
				if(ch != ' ' && ch != '\t' ) return false;
			}
		 return true;
	}	

function isInt(textObj)
	{	var newValue = textObj.value
		var newLength = newValue.length
		
		for (var i=0; i!= newLength; i++)
			{ aChar = newValue.substring(i,i+1)
				if (aChar < "0" || aChar > "9")
					{ return false	}
			  }
				return true;
		} 	


function isString(textObj)

{ 	var newValue = textObj.value
		var newLength = newValue.length 
		var extraChars = "_-0123456789"
		var search
		for(var i=0; i!= newLength; i++)
			{ aChar = newValue.substring(i,i+1)
				aChar = aChar.toUpperCase()
				search = extraChars.indexOf(aChar)
			   if (search == -1 && (aChar < "A" || aChar > "Z"))
			   		{ 
			   		return true;
			   		}
			   else
					{ 
					return false;	
			   		}
			   		
				}
			//return true;
}	

function isNumber(textObj)
{
	var newValue = textObj.value
	var newLength = newValue.length 
	var NumChars = "0123456789"
	var search
	for(var i=0; i < newLength; i++)
	{
		aChar = newValue.substring(i,i+1)
		search = NumChars.indexOf(aChar)
		if (search == -1)
			{return false}
	}
	return true;
}

function emailCheck(textObj) {
  var regex;
  var txt;


  regex = /^[a-zA-Z0-9`'._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  
  txt=textObj.value;


  if (regex.test(txt)) 
	{
	     		
		return true;
    	}
  else
	{
		alert("E-Mail Adresiniz Geçerli Değil.");		
		return false;	
	}
 	
}

function PopMailCheck() {
 

 var strEmail=document.all.Email.value;
 
 var strUpperEmail=strEmail.toUpperCase()
 
 srcHotmail = strUpperEmail.indexOf('HOTMAIL')
 srcYahoo = strUpperEmail.indexOf('YAHOO')
			
			if (srcHotmail > 0)
				{
				alert("Hotmail E-Posta Hesapları Geçerli Değil.");
				return false;
				}
			else
				{
				
				if (srcYahoo > 0)
					{
					alert("Yahoo E-Posta Hesapları Geçerli Değil.");
					return false;
					}
				else
					{
					return true;
					}
				}
			

			
			
}
