﻿$(document).ready(function () {
    // son dakika
    if ($(".lastnews ul li").length) { $('.lastnews ul li').css('display', 'block'); $(".lastnews").jCarouselLite({ vertical: true, visible: 1, auto: 2000, speed: 500, hoverPause: true }); }
    //manÅet
    if ($(".caymanset-images").length) { $(".caymanset-images:first-child").css('display', 'block'); $('.caymanset-list ul li a').fL({ ou: '.caymanset-images', ti: '.manset-none', si: 0, poh: true, tin: 5000 }); }
    // yazar modÃ¼l
    $('.modul-authors-list ul li a').hover(function () { $('.modul-authors-list').parent().find('div').not('.modul-authors-list').not('.clear').css('display', 'none'); $('.modul-authors-list').parent().find('.' + $(this).attr('class')).css('display', 'block'); }, function () { });
    // anasayfa spor modÃ¼lÃ¼
    $('.spor-modul-list ul li a').hover(function () { $('.spor-modul-img ul li').css('display', 'none'); $('.spor-modul-img ul li').eq($(this).parent().index()).css('display', 'block'); $('.spor-modul-spot p').css('display', 'none'); $('.spor-modul-spot p').eq($(this).parent().index()).css('display', 'block'); }, function () { });
    // anasayfa foto galeri modÃ¼l
    if ($(".photo-modul ul li").length) { $(".photo-modul").jCarouselLite({ btnPrev: ".mgp-next", btnNext: ".mgp-prev", visible: 4, scroll: 2, auto: 2000, speed: 500, hoverPause: true }); }
    // anasayfa video galeri modÃ¼l
    if ($(".video-modul ul li").length) { $(".video-modul").jCarouselLite({ btnPrev: ".mgv-next", btnNext: ".mgv-prev", visible: 4, scroll: 2, auto: 2000, speed: 500, hoverPause: true }); }
    // sag manset
    if ($(".right-manset-img").length) { $(".right-manset-img:first-child").css('display', 'block'); $('.right-manset-list ul li a').fL({ ou: '.right-manset-img', ti: '.manset-none', si: 0, poh: true, tin: 5000 }); }
    // cok okunan haberler
    $('.modul-tabs li a').click(function () { $('.modul-tabs li').removeClass('current'); $(this).parent().addClass('current'); $('.news-today').css('display', 'none'); $('.news-lasts').css('display', 'none'); $('.news-video').css('display', 'none'); $this = $(this).parent().attr('class').split(' '); $('.news-' + $this[0]).css('display', 'block'); });
    // editorun sectikleri
    //if ($(".modul-es-holder").length){$(".modul-es-holder").jCarouselLite({ btnNext: ".modul-es-next", btnPrev: ".modul-es-prev", visible: 4, speed: 1000, auto:2000, hoverPause:true}); }
    // kategori manÅet
    $('.category-manset-title ul li a').fL({ ou: '.category-manset-img img', ti: '.category-manset-spot p', si: 0, poh: true, tin: 5000 });
    // anasayfa video
    /*if ($('.modul-video-list ul li').length)
    {
    $('.modul-video-list ul li a').hover(function(){
    $('.modul-video-image').find('a').attr('href', $(this).attr('href'));
    $('.modul-video-image').find('img').attr('src', $(this).find('img').attr('src').replace('_2','_1'));
    $('.modul-video-spot').find('a').attr('href', $(this).attr('href'));
    $('.modul-video-spot').find('a').html($(this).attr('title'));
    },function(){});
    }*/
});

// functions
function setHomepage() { if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.setHomePage('http://' + location.hostname); } else if (window.sidebar) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("Ä°Ålem, internet tarayÄ±cÄ±nÄ±z tarafÄ±ndan gÃ¼venlik gerekÃ§esi ile iptal edildi!\r\n\r\nÄ°Åleme devam edebilmek iÃ§in tarayÄ±cÄ± ayarlarÄ±ndan \r\n\"signed.applets.codebase_principal_support\" deÄerini \"true\" yapÄ±nÄ±z ve iÅlemi tekrar Ã§alÄ±ÅtÄ±rÄ±nÄ±z.\r\nTarayÄ±cÄ± ayarlarÄ±nÄ± aÃ§mak iÃ§in adres satÄ±rÄ±na \"about:config\" yazÄ±nÄ±z.\r\n\r\nDikkat! Bu iÅlem tarayÄ±cÄ±nÄ±zÄ± saldÄ±rÄ±lara aÃ§Ä±k hale getirebilir!"); } } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', 'http://' + location.hostname); } } function addBookmark() { var uv = 'http://' + location.hostname; var tv = location.hostname; if (window.sidebar) { window.sidebar.addPanel(tv, uv, ""); } else if (window.external) { window.external.AddFavorite(uv, tv); } else if (window.opera && window.print) { return true; } }
function changeFontSize(t, c) { $b = parseInt($(t).css('font-size').replace('px', '')); if (c == "u" && ($b + 1) < 21) $(t).css('font-size', ($b + 1) + "px"); else if (c == "d" && ($b - 1) > 11) $(t).css('font-size', ($b - 1) + "px"); }
function setFontSize(t, c) { $(t).css('font-size', c + 'px'); }
function doSearch(keyword, place, category, searchURL) { if (typeof String.prototype.trim !== 'function') { String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); } } keyword = keyword.trim(); if (searchURL.length == 0) { $searchURL = "/haber/arama/"; } else { $searchURL = searchURL; } if (keyword.length < 3) { alert('En az 3 karakterlik kelime aramalÄ±sÄ±nÄ±z'); return false; } $searchURL += keyword; if (place != '') { $searchURL += "/" + place; } if (category != '') { $searchURL += "/" + category; } location.href = $searchURL + ".html"; return false; }
function addBookmark() { var uv = 'http://' + location.hostname; var tv = location.hostname; if (window.sidebar) { window.sidebar.addPanel(tv, uv, ""); } else if (window.external) { window.external.AddFavorite(uv, tv); } else if (window.opera && window.print) { return true; } }
function addComment(tablo, kayitID, kullaniciID, form) { formFields = form.serialize(); form.find('input, textarea').attr('disabled', 'disabled'); $.ajax({ type: 'POST', url: '/includes/js.functions.php', data: 'do=post-comment&tablo=' + tablo + '&kayitID=' + kayitID + '&kullaniciID=' + kullaniciID + '&' + formFields, dataType: 'json', success: function (json) { form.find('input, textarea').val(''); form.find('input[type="submit"]').val('GÃ¶nder'); form.find('input, textarea').removeAttr('disabled'); if (json.result == 'success') { alert('Yorumunuz baÅarÄ±yla eklendi.\r\n\r\nEditÃ¶r onayÄ±ndan sonra yayÄ±nlanacaktÄ±r.'); } else { alert('Yorumunuz eklenemedi. LÃ¼tfen tÃ¼m alanlarÄ± doldurduÄunuzdan emin olun.'); } } }); return false; }
function printWindow(url) { window.open('/yazdir/' + url, 'printWindow', 'width=800,height=600,resizable=no,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no'); }

// library
(function ($) { $.fn.jCarouselLite = function (o) { o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: false, auto: null, hoverPause: false, speed: 200, easing: null, vertical: false, circular: true, visible: 3, start: 0, scroll: 1, beforeStart: null, afterEnd: null }, o || {}); return this.each(function () { var running = false, animCss = o.vertical ? "top" : "left", sizeCss = o.vertical ? "height" : "width"; var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; if (o.circular) { ul.prepend(tLi.slice(tl - v + 1).clone()).append(tLi.slice(0, o.scroll).clone()); o.start += v - 1; } var li = $("li", ul), itemLength = li.size(), curr = o.start; div.css("visibility", "visible"); li.css({ overflow: "hidden", float: o.vertical ? "none" : "left" }); ul.css({ margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1" }); div.css({ overflow: "hidden", position: "relative", "z-index": "2", left: "0px" }); var liSize = o.vertical ? height(li) : width(li); var ulSize = liSize * itemLength; var divSize = liSize * v; li.css({ width: li.width(), height: li.height() }); ul.css(sizeCss, ulSize + "px").css(animCss, -(curr * liSize)); div.css(sizeCss, divSize + "px"); if (o.btnPrev) { $(o.btnPrev).click(function () { return go(curr - o.scroll); }); if (o.hoverPause) { $(o.btnPrev).hover(function () { stopAuto(); }, function () { startAuto(); }); } } if (o.btnNext) { $(o.btnNext).click(function () { return go(curr + o.scroll); }); if (o.hoverPause) { $(o.btnNext).hover(function () { stopAuto(); }, function () { startAuto(); }); } } if (o.btnGo) $.each(o.btnGo, function (i, val) { $(val).click(function () { return go(o.circular ? o.visible + i : i); }); }); if (o.mouseWheel && div.mousewheel) div.mousewheel(function (e, d) { return d > 0 ? go(curr - o.scroll) : go(curr + o.scroll); }); var autoInterval; function startAuto() { stopAuto(); autoInterval = setInterval(function () { go(curr + o.scroll); }, o.auto + o.speed); }; function stopAuto() { clearInterval(autoInterval); }; if (o.auto) { if (o.hoverPause) { div.hover(function () { stopAuto(); }, function () { startAuto(); }); } startAuto(); }; function vis() { return li.slice(curr).slice(0, v); }; function go(to) { if (!running) { if (o.beforeStart) o.beforeStart.call(this, vis()); if (o.circular) { if (to < 0) { ul.css(animCss, -((curr + tl) * liSize) + "px"); curr = to + tl; } else if (to > itemLength - v) { ul.css(animCss, -((curr - tl) * liSize) + "px"); curr = to - tl; } else curr = to; } else { if (to < 0 || to > itemLength - v) return; else curr = to; } running = true; ul.animate(animCss == "left" ? { left: -(curr * liSize)} : { top: -(curr * liSize) }, o.speed, o.easing, function () { if (o.afterEnd) o.afterEnd.call(this, vis()); running = false; }); if (!o.circular) { $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); $((curr - o.scroll < 0 && o.btnPrev) || (curr + o.scroll > itemLength - v && o.btnNext) || []).addClass("disabled"); } } return false; }; }); }; function css(el, prop) { return parseInt($.css(el[0], prop)) || 0; }; function width(el) { return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); }; function height(el) { return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); }; })(jQuery);
(function ($) { $.fn.fL = function (op) { var t = $(this); var ou = $(op.ou); var ti = $(op.ti); new jQuery.fL(t, ou, ti, op); return this; }; $.fL = function (t, ou, ti, op) { function sl(nr) { if (typeof nr == "undefined") { nr = vi + 1; nr = nr >= tim ? 0 : nr; } nr = nr < 0 ? tim - 1 : nr; ou.stop(true, true).filter(":visible").css('display', 'none'); ou.filter(":eq(" + nr + ")").css('display', 'block'); ti.filter(":visible").css('display', 'none'); ti.filter(":eq(" + nr + ")").css('display', 'block'); t.parent().filter(".current").removeClass('current'); t.parent().not('.prev').not('.next').filter(":eq(" + nr + ")").addClass('current'); vi = nr; } var op = op || {}; var tim = t.not('.prev').not('.next').length; var vi = op.si || 0; op.poh = op.poh || true; op.tin = op.tin || 5000; ou.hide().eq(vi).show(); t.hover(function () { if ($(this).get(0).className == 'prev') { sl(vi); } else if ($(this).get(0).className == 'next') { sl(); } else { sl(t.index(this)); } }); if (op.tin > 0) { var tmr = setInterval(function () { sl(); }, op.tin); if (op.poh) { t.mouseenter(function () { clearInterval(tmr); }).mouseleave(function () { clearInterval(tmr); tmr = setInterval(function () { sl(); }, op.tin); }); } } }; })(jQuery);
