//$(document).ready(resimyuvarla);
$(document).ready(havadurumu);
$(document).ready(astroloji);
$(document).ready(girisyap);
$(document).ready(paylas);

function paylas(){
	$('#arkpaylas').click(function(e){
		e.preventDefault();
	        var iframe = $.create('iframe',{'src':'/arkadasinlapaylas.php?id='+$(this).next().val()+'&tip='+$(this).next().attr('name'),'width':'425px','height':'435px','scrolling':'no','marginwidth':'0','marginheight':'0','style':'position: absolute; border: 2px solid #7194a6; background: #ffffff; top: 220px; z-index: 1000; left: 260px; top: 100px;','frameborder':'0','id':'piframe'});
	        $("#main").append($(iframe));
	});
}

function kb(url){
	document.write('(<a rel="nofollow" href="'+unescape(url)+'">'+unescape(url)+'</a>)');
}

function girisyap(){
	if($('#girisyap')){
		$('#girisyap').click(function(e){
			e.preventDefault();
			$.post( "/inc_ajax/login.php", $("#loginform").serialize(),
			function(data){
				if(data=='1') alert("Hatalı kullanıcı adı veya şifre girdiniz.");
				else location.href=location.href;
			});
		});
	}
}
function resimyuvarla(){
	$('.yuvarlat').each(function(){
		$(this).after('<div style="float:left;width: '+this.width+'px; height: '+this.height+'px"><img style="position:absolute" src="/img/resimcerceve.gif" /><img style="float:none" src="'+this.src+'" /></div>');
		$(this).remove();
	});
}

function hocam_reklam(){
document.write('<div id="reklam" style="background:#ffffff;position:absolute;top:0;left:0;width:954px;height:1000px;cursor:pointer"><div onclick="$(\'#reklam\').remove();" style="background:#ddd;font-size:14px;font-weight:bold;text-align:center;line-height:30px;">15 saniye sonra sayfaya yönlendireleceksiniz. Bu reklamı şimdi kapatmak için tıklayınız.</div><embed height="500" style="margin-left:177px" width="600" quality="high" src="/hocam.swf" flashvars="alink1=http%3A%2F%2Fwww.porttakal.com%2Fopenx%2Fwww%2Fdelivery%2Fck.php%3Foaparams%3D2__bannerid%3D2__zoneid%3D1__cb%3Dc74566aabd__oadest%3Dhttp%253A%252F%252Fwww.hocam.com%252F%253Fkid%253D16&atar1=_blank" type="application/x-shockwave-flash"/></div>');
window.setTimeout("$('#reklam').remove()",15000);
}

function havadurumu(){
	if($('#havasehir')){
		$('#havasehir').change(function(){
			$("#havadurumu").load("/inc_ajax/havadurumu.php?sid="+$(this).attr('value'));
			$.cookie('havasehir', $(this).attr('value'), { expires: 30 });
		});
	}
}

function astroloji(){
	if($('#burc')){
		$('#burc').change(function(){
			$("#burcyorumu").load("/inc_ajax/burc.php?bid="+$(this).attr('value'));
			$.cookie('burc', $(this).attr('value'), { expires: 30 });
		});
	}
}
