function CookieOku(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function CookieYaz(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
function Sirala() {
    var SiralamaKriteri = $("#sirala").val();
    var SiralamaTipi = $("#tipi").val();

    CookieYaz("arkaplanresmi_com_siralama_cookie", "sirala=" + SiralamaKriteri + "| tipi=" + SiralamaTipi, 672);
    location.reload();
}
function CozunurlukFiltrele()
{
	var str = "";
	if ($("#l_cozunurlukler :checked").size() < 1)
	{
		alert("En az bir çözünürlük seçmelisiniz ");
		return;
	}
	
	$("#l_cozunurlukler :checked").each(function (i) 
	{
			str += "|" + this.value;
	});
	
	CookieYaz("arkaplanresmi_com_filtre_cookie", str, 672);
	location.reload();
}
function MesajiKapat(id) {
    var Obj = $("#"+ id);
    var CookieAdi = "arkaplanresmi_com_mesaj_cookie";
    var OncekiDeger = CookieOku(CookieAdi);

	Obj.fadeOut("normal");

    CookieYaz(CookieAdi, OncekiDeger + "|" + id, 672);
}

function MesajParlat(type) {
	$('div.mesaj').show();
	if (type == 1000) // Hata
	{
		$('div.mesaj').highlightFade({start:'#FF5959', end:'#FFFFFF', speed:3000, complete:
		function(){ 
			$('div.mesaj').highlightFade({end:'#FF5959', speed:1000 });
		}});
	}
	else if (type == 1001) // Bilgi
		$('div.mesaj').highlightFade({start:'#0094FF', speed:3000, complete:function(){ $('div.mesaj').hide() }});
}