jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});



function detay(gelen)
{
	var layer=document.createElement("table");
	layer.style.position="absolute";
	layer.style.width="100%";
	layer.style.height="100%";
	layer.style.top=0;
	layer.style.cssFloat="left";
	layer.style.zIndex=234;
	layer.style.backgroundColor="#ddd";
	$("body").append(layer);
	for(a in gelen) $(layer).append("<tr><td>"+a+"</td><td>"+gelen[a]+"</td></tr>");
	
}
function AJ(div,urlx)
{
	$('#'+div).html('<table height=100% width=100%><tr><td align=center><img src=images/6.gif style="width:40px;height:29px;"></td></tr></table>');
$.ajax(
		{
  			type: "GET",
  			url:urlx,
  			dataType: "html",
  			success: function a(msg){$('#'+div).html(msg);}
  			//success: function a(msg){alert(msg);}
		}
		);
}
function boyutayarla()
{
	$('#sol .haber:even').each(function(a,b,c)
	{
		
		h1=$(b).css('height');
		h2=$(b).next('a').css('height');
		if(parseInt(h1)>parseInt(h2)) {$(b).next('a').css('height',h1)}
		else {$(b).css('height',h2)}
	}
)
}

function enck1select(gelen)
{	

document.getElementById('enck1yeni').className='';
document.getElementById('enck1okunan').className='';
document.getElementById('enck1yorumlanan').className='';
$('#enck1yeni').addClass('gray');
$('#enck1okunan').addClass('gray');
$('#enck1yorumlanan').addClass('gray');
$('#'+gelen).removeClass('gray');
$('#'+gelen).addClass('red');
}
function havadurum(sehir)
{
	
	$('#secilisehir').html(sehir);
	AJ('derece','ajax.php?page=hava&sehir='+sehir);
	
	$('#hdimg_0').attr('src','http://www.dmi.gov.tr/sunum/tahmingor-a1.aspx?g=2&m='+sehir);
	$('#hdimg_1').attr('src','http://www.dmi.gov.tr/sunum/tahmingor-a1.aspx?g=3&m='+sehir);
	$('#hdimg_2').attr('src','http://www.dmi.gov.tr/sunum/tahmingor-a1.aspx?g=4&m='+sehir);
	$('#hdimg_3').attr('src','http://www.dmi.gov.tr/sunum/tahmingor-a1.aspx?g=5&m='+sehir);

	
}
function namazVakti(gelen)
{
$('#secilisehir2').html(gelen);
gelen=gelen.replace('İ','I');
gelen=gelen.replace('Ş','S');
gelen=gelen.replace('Ğ','G');
gelen=gelen.replace('Ü','U');
gelen=gelen.replace('Ç','C');
$('#sehirler2').slideUp();
AJ('namaz1','ajax.php?page=namaz&sehir='+gelen+'');
}

function base64_decode(input) {
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var output = "";
	var chr1, chr2, chr3 = "";
	var enc1, enc2, enc3, enc4 = "";
	var i = 0;

	input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

	do {
		enc1 = keyStr.indexOf(input.charAt(i++));
        enc2 = keyStr.indexOf(input.charAt(i++));
        enc3 = keyStr.indexOf(input.charAt(i++));
        enc4 = keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output = output + String.fromCharCode(chr1);
        if (enc3 != 64) {
			output = output + String.fromCharCode(chr2);
		}
        if (enc4 != 64) {
			output = output + String.fromCharCode(chr3);
		}

        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";

	} while (i < input.length);

    return output;
}
i3=0;
function mansetdegistir(id,url)
{
	//document.getElementById('mansetresim').src=mansetresimleri1[id];
	//document.getElementById('mansetbaslik').src=mansetbasliklari[id];
	resimdegistir(id,mansetresimleri1,'mansetresim');
	resimdegistir(id,mansetbasliklari,'mansetbaslik');
	renk(id,'mansetlink');
	degistir(id,'spot');
	document.getElementById('mansetresimlink').href=url;
	
}

function mansetdegistir1(id,url)
{
	resimdegistir(id,mansetdizi,'mansetresim');
	renk(id,'mansetlink');
	document.getElementById('mansetresimlink').href=url;

	
}
function degistir()
{
	var arg = degistir.arguments;
	for(j=1;j<arg.length;j++)
	{
		var rows=document.getElementById(arg[j]).getElementsByTagName('span');
		for(i=0;i<rows.length;i++) rows[i].style.display='none';
		rows[arg[0]].style.display='block';
	}
}
function degistir2()
{
	var arg = degistir2.arguments;
	for(j=2;j<arg.length;j++)
	{
		var rows=document.getElementById(arg[j]).getElementsByTagName(arg[1]);
		for(i=0;i<rows.length;i++) rows[i].style.display='none';
		rows[arg[0]].style.display='block';
	}
}
function resimdegistir(sayi,dizi,div)
{
 document.getElementById(div).src=dizi[sayi];
 sayi=parseInt(sayi+1);
 if(parseInt(dizi.length-sayi)>0)
 {
 //alert("yükleniyor");
 var a=new Image();
 a.src=dizi[sayi];
 }
}

function renk(sayi,div)
{
arg=document.getElementById(div).getElementsByTagName('a');
for(i=0;i<10;i++) arg[i].className='';	
arg[sayi].className='renkli';
}


function odaklan(tag,value)
{
if(tag.value==value) tag.value="";
}
function ayril(tag,value)
{
if(tag.value=="") tag.value=value;
}
function form_kontrol()
{
	var arg = form_kontrol.arguments;
	
	for(j=1;j<arg.length;j=j+1)
	{
		var deger=document.forms[arg[0]].elements[arg[j].name].value
		if(deger.length<2 || deger==arg[j].value)
		{alert('Lütfen en az 2 karakterli arama kelimesini giriniz.'); return false; }
	}
}
function popup(url,w,h)
{
window.open(url,"deneme","menubar=0,resizable=1,scrollbars=1,width="+w+",height="+h);	
}

function radio_kontrol(toplam)
{
sayi=0;
for(i=0;i<toplam;i++)
{
if(window.document.poll[i].checked) sayi=sayi+1;
}
//if(sayi>=1) window.document.poll[i+1].disabled=false;
document.getElementById('oyver').style.visibility='visible';
}



function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
alert("Sitemizi sık kullanılanlara eklemek için Ctrl ve D tuşlarına (Ctrl+D) basınız.")
}


i2=0;
function otomatik2(yon)
{



		if((parseInt($('#kayanhaber1ic').css('left'))>=0 && yon=="+") || (parseInt($('#kayanhaber1ic').css('left'))+$('#kayanhaber1ic').width()<=500 && yon=='-')) $('#kayanhaber1ic').animate({left:'0px'}, 500,"easeInOutBack");
		else $('#kayanhaber1ic').animate({left:yon+'=483px'},500,"easeOutCubic");

}
i3=0;
function otomatik3(yon)
{
if(yon=='-') i3+=1;
if(yon=='+') i3-=1;
if(i3>=$('#baslik>img').length-2 || i3<0) i3=0;
otomatik3_(i3);
}
function otomatik3_(sayi)
{
		dizi=$('#baslik>img');
	$('#kayanhaber2ic').animate({left:'-'+sayi*483+'px'},700,"easeOutCubic");
	for(i=1;i<dizi.length-1;i++)
		dizi[i].src='images/kynB.png';
	dizi[sayi+1].src='images/kynD.png';
	i3=sayi;

}
function otomatik1()
{
if($('div#sndk').height()+parseInt($('div#sndk').css('top'))==20) 
$('div#sndk').animate( {top:'0px'}, 500);
else $('div#sndk').animate({top:'-=20px'}, 500 );
}

