function gizle(){
document.getElementById('altmenu').style.visibility="hidden";
}
function goster(){
document.getElementById('altmenu').style.visibility="visible";
}
function tabloboyutlandir(id,deger)
{
boyut=window.document.getElementById(id).clientHeight;
if(boyut<deger){
window.document.getElementById(id).style.height=deger;
}
}
function alangizle(alanadi){
document.getElementById(alanadi).style.visibility='visible';
}
function alangoster(alanadi){
window.document.getElementById(alanadi).style.visibility='visible';
}

function sifreuyum(sifre1,sifre2){
if (sifre1!=sifre2){
alert ('Lütfen geçerli bir şifre yazınız.');
return false;
}
}
function LTrim( value ) {

var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

 function RTrim( value ) {

var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
 	
}

 function trim( value ) {
 	
 	return LTrim(RTrim(value));
  }
function iceriksayikontrol(id,formid){
	degerim=window.document[formid][id].value;
	if(degerim.length<6){
		onayresimgoster(0,id);
		}
	else{
		onayresimgoster(1,id);
		}
}
function icerikkontrol(id,formid){
	degerim=trim(window.document[formid][id].value);
	//alert(window.document[formid][id].value);
	if(degerim.length==0){
		onayresimgoster(0,id);
		}
	else{
		onayresimgoster(1,id);
		}
	}
function onayresimgoster(deger,id) {
	degistirilecekid=id+'check';
	if(deger==1){
		document[degistirilecekid].src = "images/kabul.jpg";
		document[degistirilecekid].style.visibility='visible';
	}
	else if(deger==0){
		document[degistirilecekid].src = "images/red.jpg";
		document[degistirilecekid].style.visibility='visible';
		}
		//var recur_call = "switchImage('"+place+"')";
}
/*Galeri Slide Show Basla*/
	var interval = 2000;
	var random_display = 0;
	var imageDir = "uploadedfiles/";
	var imageNum = 0;
	var totalImages= 0;
	imageArray = new Array();
	function resimleriyukle(resimadi){
	imageArray[imageNum++] = new imageItem(imageDir + resimadi);
	totalImages = imageArray.length;
	}
function imageItem(image_location) {
		this.image_item = new Image();
		this.image_item.src = image_location;
	}
	function get_ImageItemLocation(imageObj) {
		return(imageObj.image_item.src)
	}
	function randNum(x, y) {
		var range = y - x + 1;
		return Math.floor(Math.random() * range) + x;
	}
function getNextImage() {
		if (random_display) {
			imageNum = randNum(0, totalImages-1);
		}
		else {
			imageNum = (imageNum+1) % totalImages;
		}
	var new_image = get_ImageItemLocation(imageArray[imageNum]);
	return(new_image);
	}
	function getPrevImage() {
		imageNum = (imageNum-1) % totalImages;
		var new_image = get_ImageItemLocation(imageArray[imageNum]);
		return(new_image);
	}
	function prevImage(place) {
		var new_image = getPrevImage();
		document[place].src = new_image;
	}
	function switchImage(place) {
		var new_image = getNextImage();
		document[place].src = new_image;
		var recur_call = "switchImage('"+place+"')";
		timerID = setTimeout(recur_call, interval);
        }
/*Galeri Slide Show Bit*/

function mousecursordegistir(id, cursorVal)
{
document.getElementById(id).style.cursor = cursorVal;
}

function mousecursordefault(id)
{
document.getElementById(id).style.cursor = 'default';
}

function maxlimit(yazi){
var mlength=yazi.getAttribute? parseInt(yazi.getAttribute("maxlength")) : ""
if (yazi.getAttribute && yazi.value.length>mlength)
yazi.value=yazi.value.substring(0,mlength)
}

 function validateInt()
   {
      var o = document.frmInput.txtInput;
      switch (isInteger(o.value))
      {

         case false:
            alert(o.value + " bir sayı değildir, lütfen sayı giriniz")
      }
   }

   function validateRange()
   {
      var s = document.frmInput.txtInput.value;
      var A = document.frmInput.txtA.value;
      var B = document.frmInput.txtB.value;

      switch (isIntegerInRange(s, A, B))
      {
         case true:
            alert(s + " is in range from " + A + " to " + B)
            break;
         case false:
            alert(s + " is not in range from " + A + " to " + B)
      }
   }

// isIntegerInRange (STRING s, INTEGER a, INTEGER b)
   function isIntegerInRange (s, a, b)
   {   if (isEmpty(s))
         if (isIntegerInRange.arguments.length == 1) return false;
         else return (isIntegerInRange.arguments[1] == true);

      // Catch non-integer strings to avoid creating a NaN below,
      // which isn't available on JavaScript 1.0 for Windows.
      if (!isInteger(s, false)) return false;

      // Now, explicitly change the type to integer via parseInt
      // so that the comparison code below will work both on
      // JavaScript 1.2 (which typechecks in equality comparisons)
      // and JavaScript 1.1 and before (which doesn't).
      var num = parseInt (s);
      return ((num >= a) && (num <= b));
   }

   function isInteger (s)
   {
      var i;

      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return false;
      }

      return true;
   }

   function isEmpty(s)
   {
      return ((s == null) || (s.length == 0))
   }

   function isDigit (c)
   {
      return ((c >= "0") && (c <= "9"))
   }
   
      function sayimi(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }

