﻿$(document).ready(function() { var timercounter2 = 0; function uyeGirisSlider() { timercounter2++; if (timercounter2 == $(".avantajlar ul li").size()) { $("#avantaj-slide").css("margin-left", "190px"); timercounter2 = 0 } var mt = timercounter2 * 190; $("#avantaj-slide").animate({ marginLeft: -mt }, 1000); return false } setInterval(uyeGirisSlider, 4000); var fv = $().flash.hasFlash.playerVersion().split(',')[0]; if (fv > 8 && !disableFlash) { $('#mainFlash').flash({ src: webRoot + '/swf/home.swf', width: "950", height: "438", wmode: 'transparent', flashvars: { xmlpath: xmlpath} }, { expressInstall: true, version: '8' }) } else { $.getJSON(jsonpath, function(data) { var sol_alt = ""; $.each(data["2"], function() { sol_alt += "<img src='" + this.url + "' alt='" + this.title + "' />" }); $("#sol_alt").html(sol_alt); sol_alt_aktif() }); timernumber = 0; function sol_alt_aktif() { function timerla_sol_alt() { $("#sol_alt img").css("display", "none"); $("#sol_alt img").eq(timernumber).css("display", "block"); timernumber++; if (timernumber == $("#sol_alt img").size()) { timernumber = 0 } } setInterval(timerla_sol_alt, 4000) } $.getJSON(jsonpath, function(data) { var orta_alan = ""; $.each(data["3"], function(i) { orta_alan += '<div id="banner_' + parseInt(i + 1) + '" class="banItem"><a href="' + this.link + '"><img src="' + this.url + '" alt="' + this.title + '" /></a></div>' }); orta_alan += '<div class="bannerNavigator">'; $.each(data["3"], function(i) { orta_alan += '<a href="javascript:;" class="bann_' + parseInt(i + 1) + '">' + this.title.substr(0, 10) + '...</a>' }); orta_alan += '</div>'; $("#midFlash").html(orta_alan); bind_homepage(); $(".bannerNavigator a").eq(0).click() }); function bind_homepage() { $(".bannerNavigator a").click(function() { var _banIndex = parseInt($(".bannerNavigator a").index(this) + 1); $(".bannerNavigator a").attr("style", ""); if (_banIndex == 1) { $(this).css("background", "url(" + webRoot + "/images/alternate/banner_tab_1_on.png) no-repeat left top"), $(this).css("margin", "0px") } else if (_banIndex == 2) { $(this).css("background", "url(" + webRoot + "/images/alternate/banner_tab_2_on.png) no-repeat left top"), $(this).css("margin", "0px") } else if (_banIndex == 3) { $(this).css("background", "url(" + webRoot + "/images/alternate/banner_tab_3_on.png) no-repeat left top"), $(this).css("margin", "0px") } else if (_banIndex == 4) { $(this).css("background", "url(" + webRoot + "/images/alternate/banner_tab_4_on.png) no-repeat left top"), $(this).css("margin", "0px") } else if (_banIndex == 5) { $(this).css("background", "url(" + webRoot + "/images/alternate/banner_tab_5_on.png) no-repeat left top"), $(this).css("margin", "0px") } $("#midFlash .banItem").removeClass("active"); $("#midFlash").children("#banner_" + _banIndex).addClass("active"); $(".bannerNavigator a").removeClass("active"); $(this).addClass("active") }) } $.getJSON(jsonpath, function(data) { var sol_orta = "<div class='image-container'>"; $.each(data["1"], function() { sol_orta += "<div><a href='" + this.link + "'><img src='" + this.url + "' alt='" + this.title + "' /></a></div>" }); sol_orta += "</div>"; sol_orta += "<div class='tabs'><ul>"; $.each(data["1"], function(i) { sol_orta += "<li><a href=''>" + parseInt(i + 1) + "<span>" + this.title.substr(0, 15) + "...</span></a></li>" }); sol_orta += "</ul></div>"; $("#campaign_sol_orta").html(sol_orta); init_sol_orta() }); var timercount = 1; function init_sol_orta() { $(".tabs ul li a").bind("click", function() { var gidici = $(".tabs ul li a").index(this); var yol = $(".image-container div").eq(gidici); var katsayi = gidici; var ml = katsayi * 285; $(".image-container").css({ marginLeft: -ml }, 500); $(".tabs ul li").removeClass("selected"); $(this).parent().addClass("selected"); return false }); function timerla() { $(".tabs ul li a").eq(timercount).click(); timercount++; if (timercount == $(".tabs ul li a").size()) { timercount = 0 } } $(".tabs ul li a").eq(0).click(); setInterval(timerla, 4000) } $.getJSON(jsonpath, function(data) { var sag_alt = ""; if (data["4"].length >= 4) { $.each(data["4"], function(i) { if (i % 4 == 0) { sag_alt += '<div class="item">' } sag_alt += '<div class="camp">'; sag_alt += '<div class="logo"><img src="' + this.url + '" /></div>'; sag_alt += '<div class="text"><a href="' + this.link + '" target="' + this.target + '">' + this.title + '</a></div>'; sag_alt += '</div>'; if (i % 4 == 0) { sag_alt += '</div>' } }); $("#sag_alt_alan").html(sag_alt); init_sag_alt() } }); var timercounter = 0; function init_sag_alt() { function campSlider() { timercounter++; if (timercounter == $(".slider .item").size()) { timercounter = 0 } var mt = timercounter * 264; $(".slider").css({ marginTop: -mt }, 100); return false } setInterval(campSlider, 3000) } } });

