function kaydet(nere){$('form#'+nere+'').submit(function(){$('div#'+nere+'_sonuc').html('<img src="images/form/floading.gif" />');$.ajax({type:"POST",url:"islem/"+nere+"_kayit.html",data:$('form#'+nere+'').serialize(),success:function(ajaxcevap){$('div#'+nere+'_sonuc').html(ajaxcevap)},error:function(ajaxcevap){$('div#'+nere+'_sonuc').html(""+nere+" Hata medyana geldi")}});return false})}window.onload=init;var w=screen.width;var h=screen.height;var title="";var link="";function init(){title=document.title;link=document.URL}function Paylas(url){link=encodeURIComponent(link);title=encodeURIComponent(title);var url=url.replace('{PERMALINK}',link);var url=url.replace('{TITLE}',title);openWindow(url)}function openWindow(url){window.open(url,'Paylas','width='+w+',height='+h+',menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes')}
//$().ready(function(){
$(window).load(function(){

    if($('li#hit').length>0){
        $('li#hit').hover(function(){
            $(this).parents('div:first').prev('div.cok').html('<div class="baslik"><a href="'+$(this).children('a').attr('href')+'">'+$(this).children('a').text()+'</a>...</div><div class="kisaca"><div class="resim"><a href="'+$(this).children('a').attr('href')+'"><img src="'+$(this).children('img').attr('src')+'" /></a></div>'+$(this).children('span').text()+'...</div>');
             
        });
    }

$("#hava").change(function(){
$('#hava_durumu').html('alınıyor...');
var ads = $('#hava option:selected').val(); 
$('#hava_durumu').empty();
$('#hava_durumu').havadurumu([ads]);
});
$('#hava option:selected').val('TUXX0014').change();	
$("#namaz").change(function(){
var adres = $('#namaz option:selected').val();
$.get("namazvakti.php?sehir="+encodeURIComponent(adres), function(data){
$('#namaz_vakitleri').html(data);
});
});
$('#namaz option:selected').val("istanbul").change();
	
	
});
$(function(){
	var trigger	 = $('.anamenu li.etimenu'),
		dropdown = $('.dropdown', trigger),
		inner	 = $('.inner', dropdown);
		
	dropdown.css({'display': 'block', 'opacity': 0});
	
	var height = inner.height() + (dropdown.height() - inner.height());
	
	dropdown.css({'height': 0, 'opacity': 1, 'overflow': 'hidden', 'display': 'none'});
	inner.css({'opacity': 0});
	
	trigger.bind('mouseenter', function(){
		dropdown.css({'display': 'block'});
		dropdown.stop(true).animate({'height': height});
		inner.stop(true).animate({'opacity': 1});
	});
	
	trigger.bind('mouseleave', function(){
		dropdown.stop(true).animate({'height': 0});
		inner.stop(true).animate({'opacity': 0}, function(){dropdown.css('display', 'none');});
	});
});
$(window).load(function(){

	var $slider = $('.manset');
	
	if (!$slider) { return false; }
	
	var $items = $('li', $slider),
		$current = $('.itemList a.current', $slider),
		$bullets = $('.itemList a[class!=all]', $slider),
		$title   = $('.title', $slider),
		interval = 3000;
	
	$items.css({
		'position': 'absolute',
		'left': 0,
		'opacity': 0,
		'top': 0,
		'z-index': 1
	});
	
	$items.each(function(i, el){
		var $el = $(el),
			$img = $el.find('img');
		
		if ($img && ($el.width() - $img.width() > 20) ) {
			$gradient = $('<div class="pngfix">');
			$gradient.css({
				'background': 'transparent ' + $el.css('background-image') + ' repeat-y 0 0',
				'height': $el.height(),
				'left': $img.width() - 40,
				'position': 'absolute',
				'top': 0,
				'width': 40
			});
			$el.append($gradient);
		}
	});
	
	$items.eq(parseInt($current.text()) - 1).css({'opacity': 1, 'z-index': 2});
	
	$bullets.bind('mouseenter', function(event){
		
		
		if (parseInt(event.clientX) > 0) {
			clearInterval(timer);
		}
		
		var itemNo = parseInt($(this).text()) - 1,
			currentNo = parseInt($current.text()) - 1,
			zIndex = parseInt($items.eq(currentNo).css('z-index'));
		
		if ( zIndex > 3 ) {
			$items.css('z-index', 1);
			zIndex = 1;
		}
		
		$items.eq(itemNo).stop(true).css({'opacity': 0, 'z-index': zIndex + 1}).animate({'opacity': 1}, 750);
		
		$title.attr('href', $items.eq(itemNo).find('a').attr('href')).text($items.eq(itemNo).find('img').attr('alt'));
		$title.stop(true).css({'height': 'auto', 'opacity': 0, 'overflow': 'visible'});
		
		var height = $title.height();
		
		$title.css({'height': 0, 'overflow': 'hidden'}).animate({'height': height, 'opacity': 1}, 500);
		
		$current.removeClass('current');
		
		$(this).stop(true).addClass('current');
		$current = $(this);
	});
	
	$bullets.bind('mouseleave', function(event){
		timer = setInterval(slideFn, interval);
	});
	
	var slideFn = function(){
		var currentNo = parseInt($current.text());
		var nextNo = (currentNo === $bullets.length) ? 0 : currentNo;
		
		$bullets.eq(nextNo).trigger('mouseenter');
		
	};
	
	var timer = setInterval(slideFn, interval);
	
});

$(function(){
	var $rotator = $('.rotor');
	
	$rotator.jCarouselLite({
		btnPrev: $rotator.parent('div').find("a.prev"),
		btnNext: $rotator.parent('div').find("a.next"),
		mouseWheel: true,
		visible: (parseInt($rotator.find("ul").attr('class')) || 3)
	});
});

function boyut(idx, _dir, class_name)
{
	var elm = document.getElementById(idx);
	var className = elm.className;
	var currentSize = parseInt(className.substr(className.length-2));

	if(isNaN(currentSize))
		currentSize = 12;

	if(_dir == 'd')
		currentSize -= 2;
	else
		currentSize += 2;

	if(currentSize >= 12 && currentSize <= 18)
	{
		elm.className = class_name + ' ' + class_name + '_' + currentSize;
		Set_Cookie('boyut', currentSize, 30, '', '', '');
	}
}

