function trim(str)
{
	return str.replace(/^\s+|\s+$/g,'');
}

function gChkVal(radioObj) {
	if(!radioObj)
		return "";
		var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function getheight() {
	var d= document.documentElement;
	var b= document.body;
	var who= d.offsetHeight? d: b ;
	return Math.max(who.scrollHeight,who.offsetHeight);
}

function acPencereyi(sayfa,gen,uz,x,y,sb) {
	x = (640 - gen)/2, y = (480 - uz)/2;

    if (screen) {
        y = (screen.availHeight - uz)/2;
        x = (screen.availWidth - gen)/2;
    }

    pencerem = window.open(sayfa,'windowRef','width=' + gen + ',height=' + uz +',scrollbars=' + sb + ',status=0,top='+ y +',left='+ x +',screenX='+ x +',screenY='+ y);
    if (!pencerem.opener) pencerem.opener = self;
}

function numaraYapma(textBox) {
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}	
	textBox.value = trim(textBox.value);
}

function secBirak(grpStr, button) {
 var form, el, e, f = 0;
 var unbuttoned = (button.value.substring(0,2).toLowerCase() == 'un');
 while (form = document.forms[f++]) {
   e = 0;
   while (el = form.elements[e++])
   if (el.type == 'checkbox' && el.name.indexOf(grpStr) != -1)
      el.checked = !unbuttoned;
 }
 button.value = unbuttoned ? button.value.substring(2) : 'un' + button.value;
}

function isEmpty(formElement, message) {
	formElement.value = trim(formElement.value);
	
	_isEmpty = false;
	if (formElement.value == '') {
		_isEmpty = true;
		alert(message);
		formElement.focus();
	}
	
	return _isEmpty;
}

function setSelect(listElement, listValue)
{
	for (i=0; i < listElement.options.length; i++) {
		if (listElement.options[i].value == listValue)	{
			listElement.selectedIndex = i;
		}
	}	
}

function fiyt() {;}

function fKontrol(theForm)
{
  if (theForm.yekle.value == "")
  {
    alert("Lütfen boş bırakmayınız!");
    theForm.yekle.focus();
    return (false);
  }
  return (true);
}

function gorCev(bb) {
  var numi = document.getElementById(bb);
  if(numi.style.display=='block')
  numi.style.display='none';
  else
  numi.style.display='block'
}

function gorCev2(bb,ne) {
  var numi = document.getElementById(bb);
  numi.style.display=ne;
}


