﻿$(document).ready(function(){
	     $("input").focus(function () {
         $(this).css('outline','none');
		 
		 
		
    });
		// 498 id li sayfa sağ bannner değişimi vlknE
			 var gelenUrl = location;

			gelenUrl = gelenUrl.toString();
			var xx = gelenUrl.indexOf('?')+1;
			var xy = gelenUrl.length;

			gelenUrl = gelenUrl.substring(xx,xy);

			if(gelenUrl == 498){

			$('#teaser1_1').html("");
			$('#teaser1_1').append('<img src="images/jcr3.gif">');
			}
			
		// 498 id li sayfa sağ bannner değişimi vlknE	

		var is_ie6_2 = (
		window.external &&
		typeof window.XMLHttpRequest == 'undefined'
		);
		if(is_ie6_2){
		$.ifixpng('images/pixel.gif'); 
		$('.fixpng').ifixpng();
		$('.gallery').ifixpng();
		};
		
		var testA = location.href;
		var HomeControl = 0;
		if(testA.indexOf("anasayfa") != -1 || testA.indexOf("home") != -1){HomeControl = 1;}
		
		if($('#pagetitle h2').html() == "Hesaplama Araçları" || $('#pagetitle h2').html() == "Bayi Başvuru Formu" || HomeControl == 1){
			//turDoldur();
		}else{

			}
		$('#ddlSehir').parent('div.comboboxContainer').css('background-image','url(/images/chat_drop_mini.gif)').css('background-repeat','no-repeat');
	
		$('.haber').css('display','none');
		$("a").bind("focus",function(){if(this.blur)this.blur();});
		$("li>a").bind("focus",function(){if(this.blur)this.blur();});
		$('#left_right').click(function(){
			var durum = $('#finansleft').width();
			if(durum != 0){
				$('#bizdenhaber').animate({ width:202},500);
				$('#finansleft').animate({ width:0},500);
				$('#left_right').attr('src','images/left_arrow.gif');
			}
			else
			{
				$('#bizdenhaber').animate({ width:0},500);
				$('#finansleft').animate({ width:202},500);
				$('#left_right').attr('src','images/right_arrow.gif');
			};
		});
		
		var yukseklik1;
		if($('#icerik').height() == null){
		    yukseklik1= $('#icerik2').height();
		}else{
		    yukseklik1= $('#icerik').height();
		}
		var yukseklik2 = $('#yanmenu').height();
		if(yukseklik1 < 480 && yukseklik2 <480){
		
			if($('.haber').css('display') == 'none'){
				$('#yanmenu').css('height',470);
				$('#icerik').css('height','auto');
				$('#icerik2').css('height','auto');
			}else{
				$('#icerik').css('height',470);
				$('#icerik2').css('height',470);
			}
		};
		
		init_swap_text_boxes();
		Parantez();
	});
	
	function up_and_down(up_ne){
			var durum = $('#up_down').css('top');
			if(durum== ""){ durum = "16px" };
			if(jQuery.browser.msie){var ilkdurum = "16px";};
			if(jQuery.browser.mozilla){var ilkdurum = "15px";};
			if(durum != "16px" && durum != "15px" ){
			
				if(up_ne == 'chat' && $('#chat_content').css('display') == 'block'){
				$('#chat_content').fadeOut();
				$('#up_down').animate({ top:ilkdurum},500);
				$('#chat_menu').animate({ height:'0px'},500);
				$('[usemap="#Map"]').attr('src','images/up_down.png');
				}else if(up_ne == 'call' && $('#call_back').css('display') == 'block'){
				$('#call_back').fadeOut();
				$('#up_down').animate({ top:ilkdurum},500);
				$('#chat_menu').animate({ height:'0px'},500);
				$('[usemap="#Map"]').attr('src','images/up_down.png');
				}else if(up_ne == 'chat' && $('#chat_content').css('display') == 'none'){
				$('#call_back').css('display','none');
				$('#chat_content').css('display','block');
				}else if(up_ne == 'call' && $('#call_back').css('display') == 'none'){
				$('#chat_content').css('display','none');
				$('#call_back').css('display','block');
				}else{
				
				}
			}
			else
			{
				if(up_ne == 'chat'){
				$('#chat_content').css('display','block');
				$('#call_back').css('display','none');
				$('#up_down').animate({ top:'-24px'},500);
				$('#chat_menu').animate({ height:'35px'},500);
				$('[usemap="#Map"]').attr('src','images/up_down_2.png');
				}else if(up_ne == 'call'){
				$('#call_back').css('display','block');
				$('#chat_content').css('display','none');
				$('#up_down').animate({ top:'-24px'},500);
				$('#chat_menu').animate({ height:'35px'},500);
				$('[usemap="#Map"]').attr('src','images/up_down_2.png');
				}else{
				
				}
			};
			$('#up_down img').ifixpng();

	}
	
	var swap_text_boxes = [];

	function init_swap_text_boxes(){
	  $('input[type=text][value].swaptextbox').each(function() {
		swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
	  });
	  $('input[type=text][value].swaptextbox').bind('focus', function() {
		if($(this).val() == swap_text_boxes[$(this).attr('id')]) {
		  $(this).val('');
		}
	  });
	  $('input[type=text][value].swaptextbox').bind('blur', function() {
		if($(this).val() == '') {
		  $(this).val(swap_text_boxes[$(this).attr('id')]);
		}
	  });
	} 
	
	function CheckSearch(){
	    if(($('#search').val() == '') || ($('#search').val() == 'site içi arama')){
	        alert('Aranacak kelimeleri giriniz!');
	        return false;
	    }else{
	        return true;
	    }
	}
	
	function Parantez(){
		
		if( $('#CMSMenu').html() != null){
			$('#CMSMenu').html($('#CMSMenu').html().replace(/\(\(/g, '<span class="red">(</span>', null));
		}
		if( $('#pagetitle').html() != null){
			$('#pagetitle').html($('#pagetitle').html().replace(/\(\(/g, '<span class="red">(</span>', null));
		}
		if( $('#whereiam2').html() != null){
			$('#whereiam2').html($('#whereiam2').html().replace(/\(\(/g, '<span class="red">(</span>', null));
		}
        for(var i=1;i<7;i++){
            if($('#harita'+i)){
    		    if( $('#harita'+i).html() != null){
	    		    $('#harita'+i).html($('#harita'+i).html().replace(/\(\(/g, '<span class="red">(</span>', null));
	    	    }
	    	}
        }
	}



function bultenAc(id)
{
	$('#icerik2').css('height','auto');
	$('#icerik').css('height','auto');
	if($('#'+id).css('display')=="block")
	{
		$('.bulten').fadeOut(500);
		//$('#'+id).fadeIn(500);
	}else{
		$('.bulten').fadeOut(50);
		$('#'+id).fadeIn(500);		
	}
}

function eTkAc(id)
{
	$('#icerik2').css('height','auto');
	if($('#'+id).css('display')=="block")
	{
		$('.bulten').hide();
	}else{
		$('.bulten').hide();
		$('#'+id).fadeIn(500);
		location.href="#eTk"+id.replace('etkinlik','');
	}
}

function popupTel(){
	window.open('/images/content/telefon_bankaciligi.jpg','aktifbank','width=500,height=375,scrollbars=no');
}

function KrediBasvuru()
{
//window.open('http://salacak:8280/web/open.html?loginPage=WEB_CREDIT_APPLICATION_PORTAL.guiml','','width=725,height=640');
//window.open('http://salacak:8280/web/open.html?loginPage=WEB_PERFORMANCE_CREDIT_APPLICATION_PORTAL.guiml','','width=725,height=640');
window.open('http://moda:8280/web/open.html?loginPage=WEB_PERFORMANCE_CREDIT_APPLICATION_PORTAL.guiml','','width=725,height=640');
}

  $("input").focus(function () {
         $("#search").css('border','0px none');
		 //alert("sdfsdf");
    });
 function videoac()
 {
window.open('/video/video.html','video','height=576,width=720,toolbar=no,location=no,directories=no,status=0,titlebar=no,resizable=no,scrollbars=0,menubar=no');

}
 function videoac2()
 {
window.open('/video/video2.html','video','height=576,width=718,toolbar=no,location=no,directories=no,status=0,titlebar=no,resizable=no,scrollbars=0,menubar=no');

}
function pressDisplay(gelenId){
	$('.haber').hide();
	$('#'+gelenId).show();
}


