﻿var fontboyut = 4;

function slideSwitch2(){
    var active = $('#messagefrom IMG.active');
    if ( active.length === 0 ){
	active = $('#messagefrom IMG:last');
	}
    var $next =  active.next().length ? active.next() : $('#messagefrom IMG:first');
    active.addClass('last-active');
    $next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 1000, function() {
            active.removeClass('active last-active');
        });
}  
   

setInterval( "slideSwitch2()", 5000 );
	
$(document).ready(function () {
	Cufon.replace('h1', { fontFamily: 'bookman', hover: true });
    Cufon.replace('h2', { fontFamily: 'bookman', hover: true });
    Cufon.replace('h3', { fontFamily: 'bookman', hover: true });
    Cufon.replace('h4', { fontFamily: 'bookman', hover: true });
    Cufon.replace('.ccHead', { fontFamily: 'bookman', hover: true });
    Cufon.replace('.level1-a', { fontFamily: 'bookman', hover: true });
    Cufon.replace('.cufonn', { fontFamily: 'bookman', hover: true });
  /*   Cufon.replace('.ui-tabs-nav-item', { fontFamily: 'bookman', hover: true }); */ 

/*
	Cufon.replace('h1');
    Cufon.replace('h2');
    Cufon.replace('h3');
    Cufon.replace('h4');
    Cufon.replace('.ccHead');
    */
 /*
    $(".altlogo").mouseenter(function () {
        $(this).find(".renkli").fadeIn("normal");
    });
    $(".renkli").mouseout(function () {
        $(this).fadeOut("slow");
    });
	
*/
	$("#altmenu .searchBox").val("E-Posta Adresiniz");

	$('.entry img').each(function() {
		if($(this).width()>625){
			$(this).width(625);
			$(this).removeAttr("height");
		}
	});
	$('.entry table').each(function() {
		if($(this).width()>645){
			$(this).width(645);
			$(this).removeAttr("height");
		}
	});
	$('.entry p').each(function() {
		if($(this).width()>645){
			$(this).width(645);
		}			
	});
	$('.entry div').each(function() {
		if($(this).width()>645){
			$(this).width(645);
			$(this).removeAttr("height");
		}
	});
});
function EnlargeFont(artis, id, tur) {
    fontboyut = fontboyut + (artis);
    if (fontboyut == 0){ fontboyut = 1; }
    if (fontboyut == 11){ fontboyut = 10; }
    var str = $("#pagefunc").html();
    $("#pagefunc").html('Yükleniyor...');
    $('.entry').load('page_ajax.php?id=' + id + '&size=' + fontboyut + '&tur=' + tur, function () {
        $("#pagefunc").html(str);
    });
}
function arama() {
	var a =  $('#menu .searchBox').val(); 
	if(a !== ""){ window.location = '/search.php?q='+a; }
	else{ alert('Arama Sözcüğü Yazınız'); }
}
function emailekleme() {
	var a =  $('#altmenu .searchBox').val(); 
	if(a !== "" && a!="E-Posta Adresiniz"){
		$.ajax({
			type: 'GET',
			url: 'epostaliste.php',
			data: 'address='+a,
			success: function(ajaxCevap) {
				alert(ajaxCevap);
			}
		});
	}
	else
	{
		alert('E-Posta Adresinizi Yazınız');
	}
}
 
