// JavaScript Document
<!-- Paste this code into an external JavaScript file named: validNum.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Manzi Olivier :: http://www.imanzi.com/ */

// calculate the ASCII code of the given character
function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}



function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
  }
  return false;
}

/* Select Boxlarda Seçimi Değiştirince Direk komut Gönderme */

function groupAction(theSelect) {
 if(theSelect.options[theSelect.selectedIndex].value!='') document.location.href=theSelect.options[theSelect.selectedIndex].value;
}
function prompter(soru,icerik,url) {
var reply = prompt(soru, icerik)
if (null == reply) {
alert ( "Bu Veriyi Boş Bırakamazsınız!")
}
else {
window.location = url + reply;
}
}



/*  Send.Asp Form Kontrolü */
function kontrol ( form )
{
  // see http://www.thesitewizard.com/archive/validation.shtml
  // for an explanation of this script and how to use it on your
  // own website

  // ** START **
  if (form.id_type.value == "") {
    alert( "Lütfen Operatör Seçin." );
    form.id_type.focus();
    return false ;
  }
  if (form.id_style.value == "") {
    alert( "Lütfen Kontor Miktarı Seçin." );
    form.id_style.focus();
    return false ;
  }
  if (form.textfield.value == "") {
    alert( "Lütfen Telefon Numarasını Girin." );
    form.textfield.focus();
    return false ;
  }
    
  // ** END **
  return true ;
}

/*  pmsnew.Asp Form Kontrolü */
function kontrolmailform ( form )
{
  // see http://www.thesitewizard.com/archive/validation.shtml
  // for an explanation of this script and how to use it on your
  // own website

  // ** START **
  if (form.konu.value == "") {
    alert( "Lütfen Konu alanını Boş bırakmayın." );
    form.id_type.focus();
    return false ;
  }
  if (form.mesaj.value == "") {
    alert( "Lütfen Mesaj alanını boş bırakmayın." );
    form.id_style.focus();
    return false ;
  }
  // ** END **
  return true ;
}



function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
spe=500;
na=document.all.tags("blink");
swi=1;
bringBackBlinky();

function bringBackBlinky() {

if (swi == 1) {
sho="visible";
swi=0;
}
else {
sho="hidden";
swi=1;
}

for(i=0;i<na.length;i++) {
na[i].style.visibility=sho;
}

setTimeout("bringBackBlinky()", spe);
}



/* ----------------------- */