	// Random degisken;
	var _ = (new Date).getTime();
	
	// Diger programlama dillerindeki trim() fonksiyonunun JavaScript'e uyarlanmis hali;
	String.prototype.trim = function() {
		return this.replace(/^\s+|\s+$/g, "");
	};
	
	// Form resetlemek icin;
	$.fn.extend({
        reset: function() {
            return this.each(function() {
                $(this).is('form') && this.reset();
            });
        }
    });
	
	// Kayitlari silmek icin kullanilan fonksiyon;
	function kayitSil(_id, _hedef, _url, _load) {
		var __qs = _url.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
		//alert(_url + __qs);
		if(confirm("Silmek istediğinize emin misiniz?")) {
			$.ajax({
				type: "GET",
				url: _url + __qs,
				befoseSend: function() {
					$("#" + _hedef).html("<img src=\"../img/yukleniyor.gif\" \/>");
				},
				success: function(oXHR) {
					//alert(oXHR);
					var _qs = _load.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
					$("#gelenVeri").html("<img src=\"../img/yukleniyor.gif\" \/>").load(_load + _qs);
				}
			});

			return true;
		}
	}
	

	function kayitSil2(_id, _hedef, _url, _load) {
		var __qs = _url.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
		//alert(_url + __qs);
		if(confirm("Silmek istediğinize emin misiniz?")) {
			$.ajax({
				type: "GET",
				url: _url + __qs,
				befoseSend: function() {
					$("#" + _hedef).html("<img src=\"../img/yukleniyor.gif\" \/>");
				},
				success: function(oXHR) {
					//alert(oXHR);
					var _qs = _load.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
					//$("#gelenVeri").html("<img src=\"../img/yukleniyor.gif\" \/>").load(_load + _qs);
					window.location.href=_load;
				}
			});

			return true;
		}
	}



	// Alternatif;
		function statikKayitSil(_id, _hedef, _url) {
		var __qs = _url.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
		//alert(_url + __qs);
		if(confirm("Silmek istediğinize emin misiniz?")) {
			$.ajax({
				type: "GET",
				url: _url + __qs,
				befoseSend: function() {
					$("#" + _hedef).html("<img src=\"../img/yukleniyor.gif\" \/>");
				},
				success: function(oXHR) {
					//alert(oXHR);
					$("#" + _hedef).fadeOut("slow");
				}
			});

			return true;
		}
	}
	
	function etiketSil(_id) {
		if(confirm("Silmek istediğinize emin misiniz?")) {
			$.ajax({
				type: "GET",
				url: "inc/islem-etiket-sil.php?ID=" + _id,
				/*befoseSend: function() {
					$("#etiket-" + _id).html("<img src=\"../img/yukleniyor.gif\" \/>");
				},*/
				success: function(oXHR) {
					$("#etiket-" + _id).fadeOut("slow");
				}
			});

			return true;
		}
	}
	
	// Kayitlari duzenlemekicin kullanılan fonksiyon;
	function kayitDuzenle(_id, _hedef, _url, _load) {
		$.ajax({
			type: "GET",
			url: _url,
			befoseSend: function() {
				$("#" + _hedef).html("<img src=\"../img/yukleniyor.gif\" \/>");
			},
			success: function(oXHR) {
				$("#" + _hedef).html(oXHR);
				setTimeout(function() {
					var _qs = _load.indexOf("?") == -1 ? "?_=" + Math.random() : "&_=" + Math.random();
					$("#gelenVeri").html("<img src=\"../img/yukleniyor.gif\" \/>").load(_load + _qs);
				}, 2000);
			}
		});

		return true;
	}
	
	// nicedit icin textarealardaki verileri alma fonksiyonu;
	/*function textareaGuncelle(_id) {
		if(!document.getElementById("_" + _id)) { // oDiv bossa yarat;
			var _icerik = o.instanceById(_id).getContent();
			var _form   = document.getElementById("frmTarifEkle");
				
			var oYarat = document.createElement("input");
			oYarat.setAttribute("id", _id);
			oYarat.setAttribute("name", "_" + _id);
			oYarat.setAttribute("value", _icerik);
			oYarat.setAttribute("style", "visibility: hidden");
			oYarat.style.visibility = "hidden"; // Bu IE icin.
			_form.appendChild(oYarat);
			//alert(oYarat.name);
				
			return true;
		} else {
			return false;
		}
	}*/
	
	/*var arSelected = new Array();
	function degerOgren() {
        var oSelect = document.getElementById("frmUrunSelect");
        
        while (oSelect.selectedIndex != -1) { 
            if (oSelect.selectedIndex != 0) arSelected.push(oSelect.options[oSelect.selectedIndex].value); 
            oSelect.options[oSelect.selectedIndex].selected = false; 
        }
        
        var strYazdir = arSelected.toString();
        
        alert(strYazdir);
    
        return strYazdir;
    }*/

	// Form plugini ayarlari;
	var options = { 
		target      : "#sonuc",
	    beforeSubmit: function() {
			$("#sonuc").html("İşleniyor...").fadeIn("slow");
			setTimeout(function() { $("#sonuc").fadeOut("slow"); }, 4000);
		},
		success     : function(oXHR, status) {
			$("#sonuc").html(oXHR);
		},
		//url:       url         
		//type:      type        // 'get', 'post'
		//dataType:  null     // 'xml', 'script', 'json'
		//clearForm: true   // 'true', 'false'     
		resetForm: true   // 'true', 'false'   
		//timeout:   3000 
	};
	
	$(document).ready(function() {
		$("#cikisYap").click(function() {
			$.ajax({
				type: "GET",
				dataType: "html",
				url: "inc/islem-cikis-yap.php",
				befoseSend: function() {
					$("#sonuc").html("İşleniyor...").fadeIn("slow");
					setTimeout(function() { $("#sonuc").fadeOut("slow"); }, 4000);
				},
				success: function(oXHR) {
					$("#sonuc").html(oXHR).fadeIn("slow");
				}
			});
			return false;
		});
		
		// Web standartlarina uygun olarak yeni pencere acmak icin;
		$("a[rel='external']").each(function(){
			$(this).click(function() {
				window.open(this.href);
				return false;
			});
		});
		
		$(".thumb").each(function() {
		  $(this).click(function() {
		      alert(1);
            $("<div></div>").html("deneme").append();
          });
        });

	});