var CR = "\r"; 
var LF = "\n";
var TN="\u0022";// " karakteri;
var BAYRAK2 =0;

function ceeee(theinput)
	{
	 s=theinput.value
	 if(s.search)
	 {
	  return (s.search(new RegExp("^([a-z0-9_]|\-|\\.)+@(([a-z0-9_]|\-)+\\.)+[a-z]{2,4}$","gi"))>=0)
	 }
	 if(s.indexOf)
	 {
	  at_character=s.indexOf('@')
	  if(at_character<=0 || at_character+4>s.length)
	   return false
	 }
	 if(s.length<6)
	  return false
	 else
	  return true
}
//*****************************************************************************
function validate(field) {
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789."
	var ok = "yes";
	var temp;

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (ok == "no") {
		return false;
   }else
   {
   	return true;
   }
}
//*****************************************************************************
function validate2(field) {
	var valid = "0123456789"
	var ok = "yes";
	var temp;

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (ok == "no") {
		return false;
   }else
   {
   	return true;
   }
}
//*****************************************************************************
function validate3(field) {
	var valid = "abcçÇdefgğĞhıİijklmnopqrşstuüÜvwxyz.? "
	var ok = "yes";
	var temp;

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (ok == "no") {
		return false;
   }else
   {
   	return true;
   }
}
//*****************************************************************************
function ORSchkbayiformu()
{
  if (document.all.edtAdi.value == '')
  {
    alert( "Lütfen Yetkili Adını giriniz!" );
    document.all.edtAdi.focus();
    return false;
  }
  else if (document.all.edtUnvan.value == '')
  {
    alert( "Lütfen Şirket Ünvanını giriniz!" );
    document.all.edtUnvan.focus();
    return false;
  }
  else if (document.all.edtemail.value == '')
  {
    alert( "Lütfen mail adresi giriniz!" );
    document.all.edtemail.focus();
    return false;
  }
  else if(!ceeee(document.all.edtemail))
  {
	document.all.edtemail.style.backgroundColor = "#BFBBE9";
	alert("E-Mail adresiniz hatalı. lütfen kontrol ediniz!");
	document.all.edtemail.focus();
	return false;
  }  
  else if (document.all.edtTel.value == '')
  {
    alert( "Lütfen Telefon Numarası giriniz!" );
    document.all.edtTel.focus();
    return false;
  }
  else if (document.all.edtAdres1.value == '')
  {
    alert( "Lütfen Adres giriniz!" );
    document.all.edtAdres1.focus();
    return false;
  }
  else if (document.all.memIlgilendikleriUrunler.value == '')
  {
    alert( "Lütfen İlgilendiğiniz Ürünleri giriniz!" );
    document.all.memIlgilendikleriUrunler.focus();
    return false;
  } else
    return true;
    
}
//*****************************************************************************
function ORSchkdestekformu()
{
  if (document.all.edtAdi.value == '')
  {
    alert( "Lütfen Yetkili Adını giriniz!" );
    document.all.edtAdi.focus();
    return false;
  }
  if (document.all.edtLisans.value == '')
  {
    alert( "Lütfen Lisans Kodunu giriniz!" );
    document.all.edtLisans.focus();
    return false;
  }
  else if (document.all.edtemail.value == '')
  {
    alert( "Lütfen mail adresi giriniz!" );
    document.all.edtemail.focus();
    return false;
  }
  else if(!ceeee(document.all.edtemail))
  {
	document.all.edtemail.style.backgroundColor = "#BFBBE9";
	alert("E-Mail adresiniz hatalı. lütfen kontrol ediniz!");
	document.all.edtemail.focus();
	return false;
  }  
  else if (document.all.edtTel.value == '')
  {
    alert( "Lütfen Telefon Numarası giriniz!" );
    document.all.edtTel.focus();
    return false;
  }
  else if (document.all.edtAdres1.value == '')
  {
    alert( "Lütfen Adres giriniz!" );
    document.all.edtAdres1.focus();
    return false;
  }
  else if (document.all.memAciklama.value == '')
  {
    alert( "Lütfen destek istediğiniz konuyu yazınız!" );
    document.all.memAciklama.focus();
    return false;
  } else
    return true;
    
}
//*****************************************************************************
function ORSchkbasvuruformu()
{
  if (document.all.Departman.value == '-- Departman Seçiniz --')
  {
    alert( "Lütfen başvuru yapacağınız Departmanı seçiniz!" );
    document.all.Departman.focus();
    return false;
  }
  if (document.all.AdiSoyadi.value == '')
  {
    alert( "Lütfen Ad ve Soyadınızı giriniz!" );
    document.all.AdiSoyadi.focus();
    return false;
  }
  else if (document.all.E_mail.value == '')
  {
    alert( "Lütfen mail adresi giriniz!" );
    document.all.E_mail.focus();
    return false;
  }
  else if(!ceeee(document.all.E_mail))
  {
	document.all.E_mail.style.backgroundColor = "#BFBBE9";
	alert("E-Mail adresiniz hatalı. Lütfen kontrol ediniz!");
	document.all.E_mail.focus();
	return false;
  }  
  else if (document.all.GsmNo.value == '')
  {
    alert( "Lütfen Cep Telefonu numarası giriniz!" );
    document.all.GsmNo.focus();
    return false;
  }
  else if (document.all.Adres.value == '')
  {
    alert( "Lütfen Adres giriniz!" );
    document.all.Adres.focus();
    return false;
  }
  else if (document.all.Ucret.value == '' || document.all.Ucret.value == '0') 
  {
    alert( "Lütfen talep ettiğiniz ücreti giriniz!" );
    document.all.Ucret.focus();
    return false;
  } else
    return true;
    
}
//*****************************************************************************
function ORScheckbrowser()
{
	if (navigator.appName == "Microsoft Internet Explorer"
		&& navigator.appVersion.indexOf("5.") >= 0)
	{
		isIE = true;
		return true;
	}
	else if (navigator.appName == "Netscape"
		&& navigator.appVersion.indexOf("5.") >= 0)
	{
		isIE = false;
		return true;
	}
	else
		return false;
}
//*****************************************************************************
function ORShighlight(objName, status)
{
  bgcolor=(status)? '#EFF7FB':'#ffffff';
  objName.style.backgroundColor=bgcolor;
}
//*****************************************************************************
function OpenForm(url,winname,h,w)
{
    if(url != null)
    {
        var width  = w;
        var height = h;
        var left   = (screen.width  - width)/2;
        var top    = (screen.height - height - 30)/2;
        var params = 'width='+width+', height='+height;
        params += ', top='+top+', left='+left;
        params += ', directories=0';
        params += ', location=0';
        params += ', menubar=0';
        params += ', resizable=1';
        params += ', scrollbars=1';
        params += ', status=0';
        params += ', toolbar=0';
        newwin = window.open(url,winname,params);
        if (window.focus) 
        {
            newwin.focus()
        }
        return true;
    }
    else
    {
        alert("Form açılamadı!Lütfen sayfayı yenileyin.");
    }
    return true;
}
//*****************************************************************************