function htmlEncode(value){
return $('
').text(value).html();
}
function htmlDecode(value){
return $('').html(value).text();
}
function submitDivForm(containerElement, urlStr, methodStr) {
var newForm = document.createElement("form");
newForm.method = methodStr;
newForm.action = urlStr;
var formFields = "";
containerElement.find(":input").each(function () {
var child = $(this);
if (child.is(":input")) {
var cName = child.prop("name");
ind = cName.lastIndexOf("$");
if (ind >= 0)
cName = cName.substring(ind + 1);
formFields += "";
}
});
$(newForm).html(formFields);
var formToSubmit = document.body.appendChild(newForm);
formToSubmit.submit();
}
function updateBankData(){
var loadingText = "
Veriler yükleniyor
'";
$("#ziraatData").html(loadingText);
$("#marketData").html(loadingText);
$.ajax({
url: "/BankData/ZiraatDataTr.htm",
cache: false,
success: function (msg) {
$("#ziraatData").html(msg);
},
error: function () {
$("#ziraatData").html("Ziraat verilerine ulaşılamıyor!
");
}
});
$.ajax({
url: "/BankData/FinancialDataTr.htm",
cache: false,
success: function (msg) {
$("#marketData").html(msg);
},
error: function () {
$("#marketData").html("Piyasa verilerine ulaşılamıyor!
");
}
});
}
$(document).ready(function () {
updateBankData();
setInterval(updateBankData,3600000);
var defaultHeight=700, minHeight=620, maxHeight=980;
var popLink = $('.OnlineBankLink .bireysel');
var popupString = popLink.attr('onclick');
var newHeight = window.screen.availHeight-100;
newHeight = isNaN(newHeight) ? defaultHeight : newHeight;
newHeight = newHeight < minHeight ? minHeight : newHeight;
newHeight = newHeight > maxHeight ? maxHeight : newHeight;
var modifyFlag = true;
var ua = navigator.userAgent;
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
{
var bv = parseFloat( RegExp.$1 );
if(bv<8) modifyFlag = false;
}
}
if(ua.match(/(chrome)|(Firefox)/i)) {newHeight= newHeight+30;}
if(modifyFlag) popLink.attr('onclick',popupString.replace('height=720','height='+newHeight));
$.ajax({
type: "GET",
url: "/_vti_bin/IBUrlProvider.svc/GetUrl",
data: null,
success: function (msg) {
var height = (msg=="https://esube1.ziraatbank.com.tr/esube/logon/loginstart.jsp") ? 651 : 720;
var div = document.createElement("div");
div.innerHTML = "";
var isIe6orLower = !!div.getElementsByTagName("i").length;
if(!isIe6orLower)
{
$(".OnlineBankLogin, .onlineBankLoginLink, .bireysel").attr('onclick', "window.open('" + encodeURI(msg) + "?customertype=rtl" + "', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=" + height + "');");
}
else
{
var js = "alert('Kullanmakta olduğunuz tarayıcı bu hizmeti desteklememektedir. Lütfen tarayıcınızı son sürümüne güncelleyiniz')";
// create a function from the "js" string
var newclick = new Function(js);
// clears onclick then sets click using jQuery
$(".OnlineBankLogin, .onlineBankLoginLink, .bireysel").attr('onclick','' );
$(".OnlineBankLogin, .onlineBankLoginLink, .kurumsal").attr('onclick','' );
$(".OnlineBankLogin, .OnlineBankLinks, .OnlineApp").attr('onclick','' );
$(".OnlineBank h2").click(newclick);
$(".OnlineBank .OnlineBankLink").click(newclick);
$(".OnlineBank .OnlineBankLinks").click(newclick);
var isHttps = document.location.protocol == "https:" ? true : false;
if(isHttps)
{
document.location = "http://www.ziraatbank.com.tr/tr/Pages/hata-ie.aspx";
}
}
//$(".OnlineBankLogin, .onlineBankLoginLink, .bireysel").attr('onclick', "window.open('" + encodeURI(msg) + "?customertype=rtl', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=" + height + "');");
}
});
$(document).click(function () {
$(".searchResult").hide();
});
$(".searchResult").click(function (e) {
e.stopPropagation();
});
// Search Result
var searchDelayTimer;
var searchDelayDuration = 400;
$('#searchText').keyup(function () {
if ($(this).val().length > 2) {
clearTimeout(searchDelayTimer);
searchDelayTimer = setTimeout(function () { startSearch(onSearchComplete) }, searchDelayDuration);
}
else {
$('.searchResult').hide();
}
});
$('a.showAllResultLink').click(function () {
if ($('#searchText').val()) window.location = "/tr/Pages/Arama.aspx?k=" + $('#searchText').val();
});
$('#searchButton').click(function () {
if ($('#searchText').val().length > 2 && $('#searchText').val() != "Ara...") window.location = "/tr/Pages/Arama.aspx?k=" + $('#searchText').val();
});
function startSearch(callback) {
$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"});
jQuery.getJSON(encodeURI("/_vti_bin/ZiraatSearchService.svc/Query?keyword=" + $("#searchText").val()), callback);
}
function onSearchComplete(data) {
if (data.length == 0)
return;
$('.searchResult').show();
var div = $('.searchResult > div:first');
div.html("");
var resultList = "";
for (var i = 0; i < data.length; i++) {
if (i == 10)
break;
var res = data[i];
var space = res.Title.indexOf(" ", 20);
var part = space == -1 ? res.Title : res.Title.substr(0, space);
part = res.WebTitle + " / " + part;
resultList += "" + part + "";
}
if (resultList != "") {
div.append("");
}
$(".searchSuggestions li").on("click", function () {
//window.location = "/tr/Pages/Arama.aspx?k=" + $(this).text();
window.location = $(this).attr("Url");
});
}
$(document).keyup(function (e) {
if(e.keyCode === 13)
{
if ($("#searchText:focus")) {
$("#searchButton").trigger("click");
}
else if($("#kb:focus #k:focus #kh:focus #kn:focus")) {
$("#searchBtn").trigger("click");
}
}
});
$("#searchBtn").click(function (event) {
submitDivForm($('[class="searchResultFormWrapper"]'), 'Arama.aspx', 'get');
event.preventDefault();
}
);
// Date field
var fDate = new Date(); var fYear = fDate.getFullYear(); $('.copyRight').append(fYear);
//Cooporation Animate Function
$('.CooLink').toggle(function () { $('div.CooperationOpen').animate({ width: '810px' }, 1000); }, function () { $('div.CooperationOpen').animate({ width: '0' }, 1000); });
//Footer Cooporate Closer
$('#CooperationCloser').click(function () { $('div.CooperationOpen').animate({ width: '0' }, 1000); });
//Links Hover
//$('.opaLinks').hover(function () { $(this).css('opacity', '0.8'); }, function () { $(this).css('opacity', '1') });
// Home Advertisemetn Tab sliders
var p1Length = $('ul#promoSlider1 li').length;
var setting1 = { wrapperClass: 'promoWrapper', controls: false, auto: true, pager: true, mode: 'fade', speed: 1500, pause: 8000 };
var promoSlider1 = $('#promoSlider1').ziraatSlider(setting1);
$(".depositRightBox .slider-pager a").click(function () { promoSlider1.startShow(); });
if (p1Length == 1) { $('#deposit .slider-pager').hide(); }
var p2Length = $('ul#promoSlider2 li').length;
var promoSlider2 = $('#promoSlider2').ziraatSlider(setting1);
$(".creditRightBox .slider-pager a").click(function () { promoSlider2.startShow(); });
if (p2Length == 1) { $('#credit .slider-pager').hide(); }
var p3Length = $('ul#promoSlider3 li').length;
var promoSlider3 = $('#promoSlider3').ziraatSlider(setting1);
$(".cardRightBox .slider-pager a").click(function () { promoSlider3.startShow(); });
if (p3Length == 1) { $('#card .slider-pager').hide(); }
// Ziraat News sliders
var setting2 = { wrapperClass: 'newsBannerWrapper', controls: true, auto: true, pager: false, infiniteLoop: true, mode: 'fade', pause: 5000, speed: 1000 };
var newsSlider = $('#newsSlider').ziraatSlider(setting2);
$(".ziraatNews a.slider-prev").click(function () { newsSlider.startShow(); });
$(".ziraatNews a.slider-next").click(function () { newsSlider.startShow(); });
// Ziraat Announcement sliders
var newaStr;
$('#announcementSlider li').each(function () { var anText = $(this).text(); if (anText.length > 40) { newaStr = anText.substr(0, 41) + "..."; $(this).children("a").html(newaStr) } });
var setting3 = { wrapperClass: 'announcementWrapper', controls: true, auto: true, pager: false, infiniteLoop: true, speed: 1000, pause: 6000, mode: 'vertical' };
var announcementSlider = $('#announcementSlider').ziraatSlider(setting3);
$(".announcement a.slider-prev").click(function () { announcementSlider.startShow(); });
$(".announcement a.slider-next").click(function () { announcementSlider.startShow(); });
// Ziraat Announcement sliders
var contBottomLength = $('ul#contBottomSlider li').length;
var setting4 = { wrapperClass: 'contBottomBoxWrapper', controls: false, auto: false, pager: true, infiniteLoop: false, mode: 'fade', moveSlideQty: 1, displaySlideQty: 1, speed: 1000 };
var contBottomSlider = $('#contBottomSlider').ziraatSlider(setting4);
$(".contBottomBox .slider-pager a").click(function () { contBottomSlider.startShow(); });
if (contBottomLength == 1) { $('#card .slider-pager').hide(); }
//Generel Message sliders
var setting5 = { wrapperClass: 'GeneralMsgListWrapper', easing: 'swing', controls: false, auto: true, infiniteLoop: false, mode: 'fade', speed: 1500, pause: 7000 };
$('#GeneralMsgList').ziraatSlider(setting5);
// Ziraat Personal Page Sliders
var bigPageSliderLength = $('.bigPageSlider ul li').length;
var setting6 = { wrapperClass: 'bigPageSliderWrapper', controls: false, auto: true, pager: true, infiniteLoop: false, speed: 1500, pause: 6000, mode: 'fade' };
var bigPageSlider = $('.bigPageSlider ul').ziraatSlider(setting6);
$(".bigPageSlider .slider-pager a").click(function () { bigPageSlider.startShow(); });
if (bigPageSliderLength == 1) { $('.bigPageSliderWrapper .slider-pager').hide(); }
// Ziraat Personal Page Sliders
var campainSliderLength = $('.campainSlider ul li').length;
var setting7 = { wrapperClass: 'campainSliderWrapper', controls: false, auto: false, pager: true, infiniteLoop: false, speed: 1000, pause: 8000 };
var campainSlider = $('.campainSlider ul').ziraatSlider(setting7);
$(".campainSlider .slider-pager a").click(function () { campainSlider.startShow(); });
if (campainSliderLength == 1) { $('.campainSliderWrapper .slider-pager').hide(); }
// Ziraat Announcement sliders
var contBottomSliderLength = $('#campainBottomSlider li').length;
var setting8 = { wrapperClass: 'campainBottomSliderWrapper', controls: false, auto: false, pager: true, infiniteLoop: false, moveSlideQty: 1, displaySlideQty: 1, speed: 1500 };
var contBottomSlider = $('#campainBottomSlider').ziraatSlider(setting8);
$(".campainBottomSliderWrapper .slider-pager a").click(function () { contBottomSlider.startShow(); });
if (contBottomSliderLength == 1) { $('.campainBottomSliderWrapper .slider-pager').hide(); }
// Ziraat Announcement slider
var pressRoomSliderLength = $('#pressRoomSlider li').length;
var setting9 = { wrapperClass: 'pressRoomSliderWrapper', controls: false, auto: false, pager: true, infiniteLoop: false, moveSlideQty: 1, displaySlideQty: 1, speed: 1800 };
$('#pressRoomSlider').ziraatSlider(setting9);
if (pressRoomSliderLength == 1) { $('.pressRoomSliderWrapper .slider-pager').hide(); }
// Ziraat Announcement slider
var videoSliderLength = $('#videoSlider li').length;
var setting11 = { wrapperClass: 'videoSliderWrapper', controls: false, auto: false, pager: true, infiniteLoop: false, moveSlideQty: 1, displaySlideQty: 1, speed: 1800 };
$('#videoSlider').ziraatSlider(setting11);
if (videoSliderLength == 1) { $('.videoSliderWrapper .slider-pager').hide(); }
//Time Line Tab Slider
var isControl = false;
var tLine = $('ul.timeLineTabMenu');
var tLength = $('ul.timeLineTabMenu li').length;
var curLeft = 0;
var finalLeft = 0;
var lastLeft = tLength - 12; lastLeft = lastLeft * 54;
tWidth = $('ul.timeLineTabMenu').css("width", (tLength * 54) + "px");
$('.sliderN').click(function () {
if (!isControl) {
isControl = true;
curLeft = $('ul.timeLineTabMenu').css("left");
curLeft = Math.abs(parseInt(curLeft));
if ((tLength - (curLeft / 54)) >= 24) { finalLeft = curLeft + 648; $('ul.timeLineTabMenu').animate({ left: -finalLeft + "px" }, 2000); };
if ((tLength - (curLeft / 54) - 12) < 12 && tLength > 12) { $('ul.timeLineTabMenu').animate({ left: -lastLeft + "px" }, 2000); };
setTimeout(function () { isControl = false }, 1500);
}
return false;
});
$('.sliderP').click(function () {
if (!isControl) {
isControl = true;
curLeft = $('ul.timeLineTabMenu').css("left");
curLeft = Math.abs(parseInt(curLeft));
if (curLeft >= 648) { finalLeft = curLeft - 648; $('ul.timeLineTabMenu').animate({ left: -finalLeft + "px" }, 2000); };
if (648 > curLeft > 0) { $('ul.timeLineTabMenu').animate({ left: "0px" }, 2000); };
setTimeout(function () { isControl = false }, 1500);
}
return false;
});
// timeLineTab list
$('ul.timeLineTabMenu > li').click(function () {
$('ul.timeLineTabMenu > li').removeClass('selected');
$(this).addClass('selected');
$('.timeLineTab .boxBody .tabContent').hide();
$('.timeLineTab .boxBody .tabContent:eq(' + $(this).index() + ')').show()
});
// Iban AddTab List
$('#ziraatForm a.IbanKod').click(function () {
$(this).parent().siblings().children().removeClass('selected');
$(this).toggleClass('selected');
});
$('#ziraatForm a.IbanIsim').click(function () {
$(this).parent().siblings().children().removeClass('selected');
$(this).toggleClass('selected');
});
// Content AddTab List
$('.contentTab .tabMenu > li').click(function () {
$(this).siblings().removeClass('selected');
$(this).addClass('selected');
$(this).parent().parent().next().children().hide();
$(this).parent().parent().next().children('div:eq(' + $(this).index() + ')').show();
});
// home data tab list
$('.HomePageDataTab .tabMenu > li').click(function () {
$('.HomePageDataTab .tabMenu > li').removeClass('selected');
$(this).addClass('selected');
$('.HomePageDataTab .boxBody div').slideUp('1000');
$('.HomePageDataTab .boxBody div:eq(' + $('.HomePageDataTab .tabMenu > li').index(this) + ')').slideDown('1000');
});
// HomeAddTab Tab list
$('.HomeAddTab .tabMenu > li').click(function () {
$(this).siblings().removeClass('selected');
$(this).addClass('selected');
$(this).parent().next().children().hide();
$(this).parent().next().children('div:eq(' + $(this).index() + ')').show();
});
// All Tab list
$('.allPageAddTab .tabMenu > li').click(function () {
$(this).siblings().removeClass('selected');
$(this).addClass('selected');
$(this).parent().next().children().hide();
$(this).parent().next().children('div:eq(' + $(this).index() + ')').show();
});
// calcTab list
$('.calcContentTab .slides ul > li').click(function () {
$('.calcContentTab .slides ul > li').removeClass('selected');
$(this).addClass('selected');
$('.calcContentTab .boxBody div.tabContent').hide();
$('.calcContentTab .boxBody div.tabContent:eq(' + $('.calcContentTab .slides ul > li').index(this) + ')').show();
$('.calculatedResult input[type=text]').val("");
$('#numKrediTutari1').val("");
});
if ($('.noFontResizer').length) { $('div.fontResizer').hide(); }
//$('.accordionButton, .simpleAccordionButton').click(function () { $(this).parent().children('div.accordionButton, .simpleAccordionButton').removeClass('on'); $(this).parent().children('div.accordionContent,div.simpleAccordionContent').slideUp(500); if ($(this).next().is(':hidden') == true) { $(this).addClass('on'); $(this).next().slideDown(500); } });
$(document).on('click', '.accordionButton, .simpleAccordionButton', function() {
$(this).parent().children('div.accordionButton, .simpleAccordionButton').removeClass('on');
$(this).parent().children('div.accordionContent,div.simpleAccordionContent').slideUp(500);
if ($(this).next().is(':hidden') == true) {
$(this).addClass('on'); $(this).next().slideDown(500);
}
});
$('.accButton').click(function () { $(this).parent().children('div.accButton').removeClass('on'); $(this).parent().children('div.accContent').slideUp(500); if ($(this).next().is(':hidden') == true) { $(this).addClass('on'); $(this).next().slideDown(500); } });
$('.accordionListButton').click(function () { $('li.accordionListButton').not($(this)).removeClass('on'); $('li.accordionListContent').hide(500).animate({ marginLeft: "0" }, 0); $(this).toggleClass('on'); $('li.on').next().show(250).animate({ marginLeft: "15px" }, 300); });
$('.accordionButton1').click(function () { $('div.accordionButton1').removeClass('on'); $('div.accordionContent').slideUp(500); if ($(this).next().is(':hidden') == true) { $(this).addClass('on'); $(this).next().slideDown(500); } });
if ($('.accordionContent').length > 0) { $('.accordionContent.show ').prev('.accordionButton').addClass('on') };
if ($('.accordionContent').length > 0) { $('.accordionContent.show ').prev('.accordionButton1').addClass('on') };
$(".scrollTop .accordionButton").click(function () {
$("html, body").animate({ scrollTop: 0 }, "slow");
//return false;
});
$('.tabList li').click(function () {
$('.tabList li').removeClass('selected');
$(this).addClass('selected');
$('div.accContent').slideUp(500);
$('.accWrapper').hide();
$('.accWrapper:eq(' + $('.tabList li').index(this) + ')').fadeIn(900);
});
$('.crediCalculationIcons').tipsy({ gravity: 'sw' });
$('.ibanCalculationIcons').tipsy({ gravity: 'sw' });
//Fotter message script
var generalMsglist = $('#GeneralMsgList li').length; for (var trn = 0; trn < generalMsglist; trn++) { var generalMsgTag = $('#GeneralMsgList li:eq(' + trn + ') p a:first'); var generalMsg = generalMsgTag.text().toString(); if (generalMsg.length > 95) { generalMsgTag.text(generalMsg.substr(0, 95)); }; generalMsgTag.append('... '); };
$('.suggestTo').click(function () {
$(this).parent().parent().next('.sendMesBoxBg').toggle();
$(".resMesBoxBg").hide();
});
$('.closeSendBox').click(function () {
$('.sendMesBoxBg').hide();
});
if ($('.Pagination')) { if ($('.Pagination > span').children().length < 2) { $('.Pagination').hide(); } }
if ($('.help-inline')) {
$('.help-inline').each(function () {
if ($(this).children('i').length == 0) { $(this).append(''); }
});
}
$('.calculateButton').click(function () {
$('.help-inline').each(function () {
if ($(this).children('i').length == 0) { $(this).append(''); }
});
})
//sosyalMedyaBtn
var title = $(".Content h1:first").text();
$('meta[property="og:title"]').attr('content', title);
var description = $(".tabContent p:first").text();
$('meta[property="og:description"]').attr('content', description);
var thumbNail = $(".campDetailImage img:first").attr("src");
if (thumbNail != null) {
thumbNail = thumbNail.replace('uploads', 'uploads/thumb');
$('meta[property="og:image"]').attr('content', thumbNail);
}
$('select.select').each(function () {
var vall = $('option:selected', this).text();
$(this).next().text(vall);
});
/*LightBox*/
$('.imageLink').click(function () {
var cloner = $(this).clone();
$('.iBoxImage').html(cloner);
var imageSrc = $('.iBoxImage img').attr('src').replace('thumb/', '').replace('thumb_','').replace('t_','');
$('.iBoxImage img').attr('src', imageSrc);
$('.iBoxImage img').removeAttr('width');
$('.iBoxImage img').removeAttr('height');
$('.iBoxBackground').show();
$('.iBox').fadeIn(100);
});
$('.real-estate-box > a').each(function () {
var imageSrc = $(this).attr('href').replace('t_','');
$(this).attr('href', imageSrc);
});
$(".icloser").click(function () { $('.iBoxBackground').hide(); $('.iBox').fadeOut(0); });
var rootUrl = window.location;
if ($('.campSocials').length > 0) {
$('.campSocials a.tw').each(function () { $(this).attr("href", 'https://twitter.com/share?url=' + rootUrl + '&text=' + title); });
}
//shareToolTip
$("ul.campSocials li").hover(function () { $(this).children("div").show(); }, function () { $(this).children("div").hide(); });
$('.addEzMark input[type="checkbox"]').ezMark(); $('.addEzMark input[type="radio"]').ezMark();
//changing footer slider items depending on the page url
var activeSliderId = $('input[data-containerid="footerIconContainer"]').attr("data-activesliderid");
if ($('.contBottomBox').length > 0) {
$(".contBottomBox .slider-pager a")[activeSliderId].click();
}
$('.docSelectBoxMain select').not('.keep-event').attr("onchange", "docTypeSelect()");
$('.clearBtn').click(function () {
$('#ziraatForm input[type=text]').val("");
$('#ziraatForm input[type=password]').val("");
$('#ziraatForm textarea').val("");
$('#ziraatForm select option').removeAttr('selected'); $('#ziraatForm select option:first').attr('selected', 'selected');
$('#ziraatForm select').each(function () {
var opText = $(this).children("option:first").text();
$(this).next(".selectedItemRow").html(opText);
});
if (container_id != null) {
if ($('#' + container_id + 'drpMektubunalinacagisube') != null)
$('#' + container_id + 'drpMektubunalinacagisube').find('option').remove().end();
if ($('#' + container_id + 'drpHesabinbulundugusube') != null)
$('#' + container_id + 'drpHesabinbulundugusube').find('option').remove().end();
}
});
$('.sendMesBox textarea').keyup(function () {
if ($(this).val().length > 999) { $(this).val($(this).val().substr(0, 1000)) }
var newVal = 1000 - $(this).val().length;
$(this).parent('.textAreaWrapper').prev('label').children('.remainChar').text(newVal);
});
$('.closeResBox').live('click', function () {
$(".resMesBoxBg").hide();
$(this).parents(".sendMesBoxBg").hide();
});
if ($('.alert.alert-error').length > 0) { $('.secField').children().children().children('.help-inline').css("visibility", "visible"); $('.alert.alert-error').hide(); }
if ($('.help-inline').length > 0) { setInterval(function () { $('.help-inline').each(function () { if ($(this).css("visibility") == "visible") { $(this).parents(".reqField ").addClass("redReq"); } else { if (!($(this).siblings('.help-inline').is(":visible"))) { $(this).parents(".reqField ").removeClass("redReq"); } } }); }, 100) }
if (window.location.href.indexOf("FaizOranlari.aspx") > -1) { $('.ContentRightBox > table').addClass("interestRateTable") }
// left navigation
$("ul.leftNav a.selected").closest("ul").prev("div").addClass("active");
$(".srch-Page srch-Page-bg").first().css("padding-bottom", "0").css("float", "right").css("margin-right", "40px");
$('.ContentRightBox a').each(function () { if ($(this).text() == "Ziraat İnternet Şubesi " || $(this).text() == "Ziraat İnternet Şubesi") { var getAText = $(this).text(); $(this).before(getAText); $(this).remove(); } });
$(".secureTrade").click(function(){
window.open('https://acs.bkm.com.tr/ziraat/cardmanagement/onetimepasslogin.jsp', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=1060,height=455');
})
$(".OnlineApply").click(function(){
window.open('https://online.ziraatbank.com.tr/p/b/customerquery.aspx', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=723');
})
$(".quickApply").click(function(){
window.open('https://online.ziraatbank.com.tr/p/b/customerquery.aspx', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=723');
})
$('.ogsSubeBtn').attr('href',"javascript:;").attr('target','');
$(".ogsSubeBtn").click(function(){
window.open('https://esube4.ziraatbank.com.tr/veribranchOGSWeb/login/ziraatlogonstart.jsp', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=651');
})
$(".PassApply").click(function(){
window.open('https://online.ziraatbank.com.tr/p/o/customerquery.aspx', 'logoff', 'status=yes,scrollbars=yes,resizable=yes,width=979,height=723');
})
/* sonradan taksit webpart */
var btnLocation = ['20px', '196px'];
$('#installmentCalc #iCHead #iCBtns .iCBtn').click(function() {
var index = $(this).index();
if($('#resultViewer').css('top') == '0px') {
$('#installmentCalc #iCBody #resultViewer').animate({ 'top': '-200px' }, 700, function() {
$('#installmentCalc #dragArea').fadeIn(200);
$('#installmentCalc .iCTab').removeClass('iActive');
$('#installmentCalc .iCTab').eq(index).addClass('iActive');
$('form').each (function(){ this.reset(); });
});
} else {
$('#installmentCalc .iCTab').removeClass('iActive');
$('#installmentCalc .iCTab').eq(index).addClass('iActive');
$('form').each (function(){ this.reset(); });
}
$('#installmentCalc #dragArea').animate({ 'left': btnLocation[index]});
});
$('#btnAlisveris').click({a:'#txtAlisveris', b:'#kkstSelect', c:'alisveris'},ShowSonradanTaksitSimulasyon);
$('#btnNakitAvans').click({a:'#txtNakitAvans', b:'#kktnaSelect', c:'nakitAvans'},ShowSonradanTaksitSimulasyon);
/*function ShowSonradanTaksitSimulasyon(event)
{
var a = $(event.data.a).val(), b = $(event.data.b).val(), c = $(event.data.c).val();
if(!isNaN(a) && !isNaN(b) && a!=0 && b!=0)
{
$.ajax({
dataType: "json",
type: "GET",
url: "/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSimulasyon",
data: {"tutar":a,"taksitSayisi":b,"tip":c}
}).done(function( data ) {
if(data.Aciklama == "Islem Basarili") {
$('#installmentCalc #dragArea').fadeOut(100);
$('#installmentCalc #iCBody #resultViewer #taksit_sayisi span').html(data.TaksitSayisi);
$('#installmentCalc #iCBody #resultViewer #taksit_tutari span').html(parseFloat(data.TaksitTutari).toFixed(2));
$('#installmentCalc #iCBody #resultViewer #islem_ucreti span').html(parseFloat(data.IslemUcreti).toFixed(2));
$('#installmentCalc #iCBody #resultViewer #toplam_tutar span').html(parseFloat(data.OdenecekToplamTutar).toFixed(2));
$('#installmentCalc #iCBody #resultViewer').animate({ 'top': 0 }, 1000);
}
else
{
alert(data.Aciklama);
}
});
}
else
{
alert('Lütfen girdiğiniz değerleri kontrol ediniz!');
}
}*/
$('#resultViewer INPUT[type="button"]').click(function() {
$('#installmentCalc #iCBody #resultViewer').animate({ 'top': '-200px' }, 700, function() { $('#installmentCalc #dragArea').fadeIn(200); });
});
if($('#sonradanTaksitlendirmeHesapAraci').hasClass('sonradanTaksit')){
$.getJSON('/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSecenekleri?tip=sonradanTaksit', function(data) {
//$('#kkstSelect').html('');
$('#your_display_2').after('');
$.each(data.TaksitSecenekleri, function(key, val) {
//$('#kkstSelect').append('');
$('#taksit-sayisi').append('');
$('#your_display_2')
.attr('from',$('#taksit-sayisi option:first').text())
.attr('to',$('#taksit-sayisi option:last').text())
.attr('valuecount',$('#taksit-sayisi option:last').text());
$('#your_slider_2.vade').text($('#taksit-sayisi option:first').text());
});
ShowSonradanTaksitSimulasyon();
});
}
if($('#sonradanTaksitlendirmeHesapAraci').hasClass('nakitAvans')){
$.getJSON('/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSecenekleri?tip=nakitAvans', function(data) {
//$('#kktnaSelect').html('');
$('#your_display_2').after('');
$.each(data.TaksitSecenekleri, function(key, val) {
$('#taksit-sayisi').append('');
$('#your_display_2')
.attr('from',$('#taksit-sayisi option:first').text())
.attr('to',$('#taksit-sayisi option:last').text())
.attr('valuecount',$('#taksit-sayisi option:last').text());
$('#your_slider_2.vade').text($('#taksit-sayisi option:first').text());
//$('#kktnaSelect').append('');
});
ShowSonradanTaksitSimulasyon();
});
}
//sp navigation bug
if(window.location.href.indexOf('/tr/Bireysel/Kartlar/Pages')>0){
var detached = $("ul.leftNav ul").children().detach();
$("ul.leftNav ul").append(detached[0]);
$("ul.leftNav ul").append(detached[16]);
$("ul.leftNav ul").append(detached[2]);
$("ul.leftNav ul").append(detached[5]);
$("ul.leftNav ul").append(detached[1]);
$("ul.leftNav ul").append(detached[14]);
$("ul.leftNav ul").append(detached[8]);
$("ul.leftNav ul").append(detached[11]);
$("ul.leftNav ul").append(detached[10]);
$("ul.leftNav ul").append(detached[12]);
$("ul.leftNav ul").append(detached[7]);
$("ul.leftNav ul").append(detached[3]);
$("ul.leftNav ul").append(detached[9]);
$("ul.leftNav ul").append(detached[4]);
$("ul.leftNav ul").append(detached[6]);
$("ul.leftNav ul").append(detached[13]);
$("ul.leftNav ul").append(detached[15]);
}
/*$.getJSON('/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSecenekleri?tip=sonradanTaksit', function(data) {
$('#kkstSelect').html('');
$.each(data.TaksitSecenekleri, function(key, val) {
$('#kkstSelect').append('');
});
});
$.getJSON('/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSecenekleri?tip=nakitAvans', function(data) {
$('#kktnaSelect').html('');
$.each(data.TaksitSecenekleri, function(key, val) {
$('#kktnaSelect').append('');
});
});*/
}); /*document.ready End*/
function ShowSonradanTaksitSimulasyon(event)
{
var a = $('#your_slider_1.vade').text(), b = $('#your_slider_2.vade').text(), c = $('#sonradanTaksitlendirmeHesapAraci').attr('class');
if(!isNaN(a) && !isNaN(b) && a!=0 && b!=0)
{
$('.loaderImage').show();
$.ajax({
dataType: "json",
type: "GET",
url: "/_vti_bin/SonradanTaksitServis.svc/GetirSonradanTaksitSimulasyon",
data: {"tutar":a,"taksitSayisi":b,"tip":c}
}).done(function( data ) {
if(data.Aciklama == "Islem Basarili") {
$('.payment-row').show();
$('.installment-note').hide();
//$('#installmentCalc #dragArea').fadeOut(100);
$('.slider-row #installment_number').html(data.TaksitSayisi);
$('.slider-row #installment_cost').html(parseFloat(data.TaksitTutari).toFixed(2) + ' TL');
$('.slider-row #process_cost').html(parseFloat(data.IslemUcreti).toFixed(2) + ' TL');
$('.slider-row #total_cost').html(parseFloat(data.OdenecekToplamTutar).toFixed(2) + ' TL');
$('.slider-row #capital').html(parseFloat($('#your_slider_1').text()).toFixed(2) + ' TL');
$('.slider-row #interest_rate').html(parseFloat(data.FaizOrani).toFixed(2) + ' %');
$('.slider-row #annual_cost').html(data.YillikMaliyet + '%');
//$('#installmentCalc #iCBody #resultViewer').animate({ 'top': 0 }, 1000);
}
else
{
$('.payment-row').hide();
$('.installment-note').show();
console.log(data.Aciklama);
}
$('.loaderImage').hide();
});
}
else
{
alert('Lütfen girdiğiniz değerleri kontrol ediniz!');
}
}
$('#ziraatForm input[type=text]').focusout(function(){
if($(this).val().length > 0){
$(this).parent('.inputWrapper ').siblings('.reqField').find('.help-inline').css("visibility", "hidden");
}
});
$('#ziraatForm select').live('change',function(){
$(this).parents('.selectWrapper').siblings('.reqField').find('.help-inline').css("visibility","hidden");
})
if ($('.helpWrapper span').length > 1) { $('.help-inline:hidden').hide(); $('.help-inline:visible').show(); }
if($('.docSelectBoxMain').length > 0) {
document.getElementById("mainSelector").onchange = function () { docTypeSelect() }
$(".docSelec select").each(function () {
$(this).change(function () { docSelect(this) })
})
}
function docTypeSelect(){
var opIndex = $('option:selected').val();
opIndex = opIndex.replace("docType", "");
$('.resultBox').hide();
$('.docSelec').hide();
$('#docSelec' + opIndex).show();
}
function docSelect(obj){
//if( $('.docSelectBoxMain .selectedItemRow').text() != "Lütfen Kredi Tipini Seçiniz" ){
var onlyInt = new RegExp("\\d+");
var docIndex = $(obj).attr("id");
var selectNo = onlyInt.exec(docIndex)
var opChildIndex = $('option:selected', obj).val();
$('.resultBox').hide();
$('.docResultBox:eq('+ (selectNo-1) +') .resultBox:eq('+ (opChildIndex-1) +')').show();
//}
}
function sendToFriendError(labelID) {
$(".resMesBoxBg").show();
}
function sendToFriendSuccess(labelID) {
$(".resMesBoxBg").show();
}
function thisFocus(th) {
if (th.value == th.getAttribute('data-value')) {
th.value = '';
}else{
th.value = th.value;
}
}
function thisBlur(th) {
th.value = th.value == '' ? th.getAttribute('data-value') : th.value;
}
function isNumber(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode != 44 && charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) return false;
return true;
}
function isString(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode != 46 && charCode != 32 && (charCode < 97 || charCode > 122) && (charCode < 65 || charCode > 90) &&
charCode != 287 && charCode != 286 && charCode != 304 && charCode != 305 && charCode != 220 && charCode != 252 &&
charCode != 350 && charCode != 351 && charCode != 214 && charCode != 246 && charCode != 199 && charCode != 231 ) return false;
return true;
}
function thisNumberBlur(th){
if(th.value != ""){
th.value= (parseFloat(th.value.replace(/\./g,'').replace(',','.'))).fMoney();
th.value= th.value.replace(',00','');
}
}
function thisNumberTeklifBlur(th){
if(th.value != "Teklifinizi Giriniz"){
th.value= (parseFloat(th.value.replace(/\./g,'').replace(',','.'))).fMoney();
th.value= th.value.replace(',00','');
}
}
Number.prototype.fMoney = function(c, d, t){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}
function MailKontrol(email){
var kontrol = new RegExp(/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/i);
return kontrol.test(email);
}
$(document).ready(function () {
$('.iBoxBackground , .iBox').click( function(){
$('.iBoxBackground , .iBox').hide();
});
$('.iBoxBackground.real-estate').click(function(){ $('.offer-box.real-estate').hide(); });
$('.iBoxBackground.real-estate').click(function(){ $('.offer-box.real-estate').hide(); });
$(".icloser").click(function (){ $('.iBoxBackground, .offer-box').hide(); });
$('.contact-us-button').click(function(){
$('.iBoxBackground, .offer-box').show();
$('.form-config .inputWrapper input').blur();
});
$('.real-estate-box img').each(function(index){
index += 1;
if(index % 3 == 0){
$(this).addClass('mRNone');
}
});
$('#real-estate-form .isNumber .inputWrapper input').keypress(function(event){
return isNumber(event);
});
$('.offer-form-container .isString').keypress(function(event){
return isString(event);
});
$('.offer-form-container .isNumber').keypress(function(event){
return isNumber(event);
});
$('.offer-box.real-estate .icloser, .iBoxBackground.real-estate').click(function(){
if($('#offerMessage p').text()!=""){
$('#offerForm').show();
$('#offerMessage').hide();
}
});
$('.send-button').click(function(){
if ($(".txtOfferName").length > 0){
if ($(".txtOfferName").val() == "Adınızı Giriniz") {
$('.offer-form-container #offerForm > h3').show();
$('.offer-form-container #offerForm > h3').text('Lütfen tüm alanları eksiksiz doldurunuz.');
return false;
}
else
$('.offer-form-container > h3').hide();
}
if ($(".txtOfferSurname").length > 0){
if ($(".txtOfferSurname").val() == "Soyadınızı Giriniz") {
$('.offer-form-container #offerForm > h3').show();
$('.offer-form-container #offerForm > h3').text('Lütfen tüm alanları eksiksiz doldurunuz.');
return false;
}
else
$('.offer-form-container #offerForm > h3').hide();
}
if ($(".txtOfferTel").length > 0){
if ($(".txtOfferTel").val() == "Telefonunuzu Giriniz") {
$('.offer-form-container #offerForm > h3').show();
$('.offer-form-container #offerForm > h3').text('Lütfen tüm alanları eksiksiz doldurunuz.');
return false;
}
else
$('.offer-form-container #offerForm > h3').hide();
}
if ($(".txtOfferEmail").length > 0){
var email = $(".txtOfferEmail").val();
if(MailKontrol(email))
{
$('.offer-form-container #offerForm > h3').hide();
}
else
{
$('.offer-form-container #offerForm > h3').show();
$('.offer-form-container #offerForm > h3').text('Lütfen geçerli bir e-posta giriniz.');
return false;
}
}
if ($(".txtOfferOffer").length > 0){
if ($(".txtOfferOffer").val() == "Teklifinizi Giriniz") {
$('.offer-form-container #offerForm > h3').show();
$('.offer-form-container #offerForm > h3').text('Lütfen tüm alanları eksiksiz doldurunuz.');
return false;
}
else
$('.offer-form-container #offerForm > h3').hide();
}
});
$('.search-button').click(function(){
$('#loading').show();
});
$('.eduIcon').click(function(){
var html = '';
$('.eBoxImage').html(html);
$('.eBox, .eBoxBackground').show();
return false;
});
$('.ecloser').click(function(){
$('.eBox, .eBoxBackground').hide();
$('.eBoxImage').html('');
});
//main-page-lightbox
/*if($('div').hasClass('HomePageDataTab') && $.cookie("homeLightbox")!=1){
$('body').append('');
}
$('.light-box-wrap a#close-button').click(function(){
$('.light-box-wrap,.light-box-shadow').fadeOut(600);
$.cookie("homeLightbox","1",{expires:365});
});*/
});
$('.excelUpload').change( function () {
document.getElementById("uploadFile").value = this.value;
}
);