var count=100;
var timer=10;
var fredlayer;
var acik=0;
var i=-200;
var aHide;
var hiz=25
function show() {
	if(i<0) {
		i=i+hiz;
		document.getElementById("main").style.top=i;
	}
}
function araShow() {
	acik=1;
document.getElementById("pselect").style.visibility='hidden';
	clearInterval(aHide);
	aShow=setInterval("show()",10);
}
function hide() {
	if(i>-200) {
		i=i-hiz;
		document.getElementById("main").style.top=i;
	}
}
function araHide() {
	acik=0
document.getElementById("pselect").style.visibility='visible';
	clearInterval(aShow);
	aHide=setInterval("hide()",10);
}
function timermsg() {
 timer--;
if(timer>0) {
 h = window.setTimeout("timermsg()",1000);
} else {
 countdown()
}
}

function countdown(){
 count-=5; 
changelayer_content(count);
if (count>0){
 Id = window.setTimeout("countdown()",10); 
}
}	

function changelayer_content(counter){


document.getElementById("divgmsg").filters[0].opacity=counter

}

function mBkz()
{
  var text=document.getElementById("data");
  if(document.selection)
  {
    var rg=document.selection.createRange();
    if(rg.parentElement()==text) {
	    rg.text = "<bkz:"+rg.text+">";
	    rg.select();
	  } else alert("Bkz i$lemini gercekle$tirebilmek icin minimum bir karakter secmi$ olmaniz gerekir.");
	}
  else if(text.textLength)
  {
  	var textvalue = text.value;
  	text.value = textvalue.substring(0,text.selectionStart)+"<bkz:"+textvalue.substring(text.selectionStart,text.selectionEnd)+">"+textvalue.substring(text.selectionEnd,text.textLength);
  } else text.value += "<bkz:"+">";
  text.focus();
  return false;
}

function maBkz()
{
  var text=document.getElementById("data");
  if(document.selection)
  {
    var rg=document.selection.createRange();
    if(rg.parentElement()==text) {
	    rg.text = "<abkz:"+rg.text+">";
	    rg.select();
	  } else alert("Abkz i$lemini gercekle$tirebilmek icin minimum bir karakter secmi$ olmaniz gerekir.");
	}
  else if(text.textLength)
  {
  	var textvalue = text.value;
  	text.value = textvalue.substring(0,text.selectionStart)+"<abkz:"+textvalue.substring(text.selectionStart,text.selectionEnd)+">"+textvalue.substring(text.selectionEnd,text.textLength);
  } else text.value += "<abkz:"+">";
  text.focus();
  return false;
}


function mgBkz()
{
  var text=document.getElementById("data");
  if(document.selection)
  {
    var rg=document.selection.createRange();
    if(rg.parentElement()==text) {
	    rg.text = "<gbkz:"+rg.text+">";
	    rg.select();
	  } else alert("Gbkz i$lemini gercekle$tirebilmek icin minimum bir karakter secmi$ olmaniz gerekir.");
	}
  else if(text.textLength)
  {
  	var textvalue = text.value;
  	text.value = textvalue.substring(0,text.selectionStart)+"<gbkz:"+textvalue.substring(text.selectionStart,text.selectionEnd)+">"+textvalue.substring(text.selectionEnd,text.textLength);
  } else text.value += "<gbkz:"+">";
  text.focus();
  return false;
}


function msBkz()
{
  var text=document.getElementById("data");
  if(document.selection)
  {
    var rg=document.selection.createRange();
    if(rg.parentElement()==text) {
	    rg.text = "<ara:"+rg.text+">";
	    rg.select();
	  } else alert("Ara bkz i$lemini gercekle$tirebilmek icin minimum bir karakter secmi$ olmaniz gerekir.");
	}
  else if(text.textLength)
  {
  	var textvalue = text.value;
  	text.value = textvalue.substring(0,text.selectionStart)+"<ara:"+textvalue.substring(text.selectionStart,text.selectionEnd)+">"+textvalue.substring(text.selectionEnd,text.textLength);
  } else text.value += "<ara:"+">";
  text.focus();
  return false;
}

function spoiler()
{
  var text=document.getElementById("data");
  if(document.selection)
  {
    var rg=document.selection.createRange();
    if(rg.parentElement()==text) {
	    rg.text =":--------------------------------------------------<gbkz:spoiler>--------------------------------------------------:"
	    
	    +rg.text+":--------------------------------------------------<gbkz:spoiler>--------------------------------------------------:";
	    rg.select();
	  } else alert("Spoiler i$lemini gercekle$tirebilmeniz icin oncelikle bir metin secmi$ olmaniz gerekmektedir.");
	}
  else if(text.textLength)
  {
  	var textvalue = text.value;
  	text.value = textvalue.substring(0,text.selectionStart)+"-----------------------------spoiler----------------------------:"+textvalue.substring(text.selectionStart,text.selectionEnd)+"-----------------------------spoiler----------------------------"+textvalue.substring(text.selectionEnd,text.textLength);
  } else text.value += "-----------------------------spoiler----------------------------:"+"-----------------------------spoiler----------------------------";
  text.focus();
  return false;
}











function refresh(){
     parent.buton.location="buton.asp"
}

function c(a,b) {
	a.className=b
}
function sp(id) {
	document.getElementById(id).style.visibility='visible';
}
function hp(id) {
	document.getElementById(id).style.visibility='hidden';
}


function formValidation(form){
if(notEmpty(form.data)){
return true;
}
return false;
}
function notEmpty(elem){
var str = elem.value;
if(str.length == 0){
alert("Bu i$lemi gercekle$tirebilmek icin en azindan bir harf yahut rakam yazmi$ olmaniz gerekir.Oysa siz de o dogrultuda hic bir caba gozlemlenemiyor.Lutfen gerekli kriterleri yerine getirin aksi takdirde koordinatlarinizi Fbi a bildirmek zorunda kalacagiz.");
return false;
} else {
return true;
}
}

