	
	var isModernBrowser = document.createElement('canvas').getContext;
	//cufon ie8 performance fix...
	var cufonHover = true;
	if(!isModernBrowser) { cufonHover = false; }
	
	//nav menu first-level links
	Cufon.replace('div#nav ul a.first-level' , { hover: false, textShadow: '1px 1px #ffffff)' });
	//nav menu submenu links
	Cufon.replace('div#nav ul ul a' , { hover: cufonHover, textShadow: '1px 1px #196bb5)' });
	

$(function() {
		
		
		
		//******************* FONT REPLACEMENT
		//********************************************************

		//Cufon Font Replacement			
		Cufon.replace(' h2, h3 , h4' , { hover: cufonHover }); 
		
		
		/* Sidebar - nav */
		Cufon.replace('div#side-nav h4' , { hover: cufonHover, textShadow: '1px 2px #1865a7)' });
		
		// JS Fix v.1
		if(isModernBrowser) {
			Cufon.replace('div#side-nav ul li:not(#home) a' , { hover: cufonHover, textShadow: '1px 2px #262626)' });
			Cufon.replace('div#side-nav ul li#home a' , { hover: cufonHover, textShadow: '1px 1px #ffffff)' }); 
		}
				
		//******************* FONT REPLACEMENT
		//********************************************************
	
	
		
		
		
		
		
		
		
		
		//******************* SEKTORLER CAROUSEL
		//********************************************************
		
		if($('#boutique').length) {
		
			$('#boutique').boutique({
					container_width: 650,
					front_img_width: 373,
					front_img_height: 278,
					speed:	 600,
					hoverspeed:	 300,
					hovergrowth:	0.0,
					behind_opac:	1,
					back_opac:	 1,
					behind_size:	0.44,
					back_size:	 0.25,
					autoplay:	 false,
					autointerval:	4000,
					freescroll:	 false,
					text_front_only: true,
					text_opacity : 1
				});
		}
		//******************* SEKTORLER CAROUSEL
		//********************************************************
		
		
		
		
		
		
		
		
		
		//******************* FOOTER
		//********************************************************
		
		
		//footer news slider
		if($('div#news').length) {
				$('div#news .scrollable').scrollable({ vertical: false , circular: true, speed:600 }).autoscroll({ autoplay: true, interval:3000 });
			}
		//footer news slider
		
		
		//social icons hover animation
		if(isModernBrowser) {
			$('div#social a').hover(function() {
					$(this).siblings().stop().fadeTo(400,0.3);
				},function() {
					$(this).siblings().stop().fadeTo(400,1);
					});
		}
		//social icons hover animation

		
		
		//******************* FOOTER
		//*********************************************************
		
		
		
		
		
		
		
		
		
		//******************* SIDEBAR
		//********************************************************
		
		//sidenav hover buyutec animation
		if(isModernBrowser) {
			$('div#side-nav').hover(function() {
					$(this).find('div#zoom').stop().animate({ marginLeft:-100, opacity:0 },400);
				},function() {
					$(this).find('div#zoom').stop().animate({ marginLeft:0, opacity:1 },500);
					});
		}
		else {
			$('div#side-nav').hover(function() {
					$(this).find('div#zoom').hide();
				},function() {
					$(this).find('div#zoom').show();
					});
			}
		//sidenav hover buyutec animation
		
		
		
		
		//********** laptop slider
		//Tv Slide Function
		rotateTv = function(){
			 var div = $('div#laptop a').eq($active.index());
		
			 $("div#laptop a").removeClass('active'); //Remove all active class
			 $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
			 //Slider Animation
			 div.siblings().stop(true,true).fadeOut(500);
			 div.stop(true,true).fadeIn(500);
		
		}; 
		
		//Rotation  and Timing Event
		rotateSwitchTv = function(){
			 playTv = setInterval(function(){ 
				  $active = $('div#laptop a.active').next(); //Move to the next paging
				  if ( $active.length === 0) { //If paging reaches the end...
						$active = $('div#laptop a:first'); //go back to first
				  }
				  rotateTv(); //Trigger the paging and slider function
			 }, 3000); //Timer speed in milliseconds
		};
		
		//hover da durdur...
		$('div#laptop').hover(function() {
				//stop slider
				clearInterval(playTv);
			}, function(){
				clearInterval(playTv);
				//start slider
				rotateSwitchTv();
				});
				
		//tv slider - laptop
		rotateSwitchTv();
		//********** laptop slider
		
		
		
		
		//******************* SIDEBAR
		//********************************************************
		
		
		
		
		
		
		
		
		
		
		//******************* HEADER
		//********************************************************
		
		
		// Logo bg animation
		$('#logo-bg').jani({ frameWidth: 340, frameHeight: 280, speed: 150, totalFrames: 15 });
		$('#logo-bg').jani.play();
		// Logo bg animation
		
		
		//NAV MENU - SUB MENUS
		//menu dinamik eklemeler
		$('#nav li div.sub').prepend('<div class="white"></div><div class="blue"></div>');
		
		$('#nav li').hover(function() {
			
				if($(this).find('div').length) {
					
					$(this).find('a').eq(0).addClass("selected");
					$(this).find('div.sub').stop(true,true).slideDown(300);
					//custom animations
					$(this).find('div.white').stop(true,true).delay(200).animate({ width:292, bottom:-70, left:-62 }, 400, 'easeOutBack');
					$(this).find('div.blue').stop(true,true).delay(300).animate({  bottom:-14, right:-7 }, 300, 'easeOutBack');
				}
			
			}, function() {  //hover out
					
					$(this).find('a').eq(0).removeClass("selected");
					//modern browser ise cufonu güncelle
					//if(document.createElement('canvas').getContext) { Cufon.refresh(); }
					$(this).find('div.sub').stop(true,true).fadeOut(200);
					//custom animations
					$(this).find('div.white').stop(true,true).css('width',0).css('bottom','-50px').css('left','152px');
					$(this).find('div.blue').stop(true,true).animate({ bottom:-10, right:152 },100);
					
				});
		//NAV MENU - SUB MENUS
		
		//******************* HEADER
		//********************************************************
		
		
		
		
		
		
		//******************* MAINPAGE
		//********************************************************
		
		
		//**********************************
		//MAIN SLIDER
		
		//slide time
		var slideTime = 4000;
		
		$('div#slider div.slider-item').hide();
		
		//slider - animation icin dinamik eklemeler - iptal - preloading sorunu
		//$('div#slider div.animate-1').append('<div class="white-tall animate-item"></div><div class="blue-big animate-item"></div><div class="blue-small animate-item"></div>');
		//$('div#slider div.animate-2').append('<div class="blue-top-small animate-item"></div><div class="blue-top-big animate-item"></div>');
		//$('div#slider div.animate-3').append('<div class="white-small animate-item"></div><div class="white-big animate-item"></div><div class="blue-single animate-item"></div>');
		
		
		// wait for the first slider image to be load before play
		var interval = setInterval(function(){
			var images = $('div#slider div.slider-item:first').find('img');

			images.each(function(i){
				
				if (this.complete) {
						clearInterval(interval);
					
					 	goToSlide($("div#slider div.slider-item:first"));
					}
				});
			
		},200);
		
	
		$(".paging a:first").addClass("active");
		
		//hover da durdur...
		$('div#slider').hover(function() {
				//stop slider
				clearInterval(play);
			}, function(){
				clearInterval(play);
				//start slider
				rotateSwitch();
				});
		
		//thumbnailllere tıklanınca
		$(".paging a").click(function(){
				
				//stop slider and clear interval - reset timer
				clearInterval(play);
				
				$(this).siblings().removeClass('active');
				$(this).addClass('active');
				
				var div = $('div#slider div.slider-item').eq($(this).index());
				
				//Slider Animation
			 	goToSlide(div);
				
				
				//start slider
				rotateSwitch();
				
			});
		
		
		//Paging  and Slider Function
		rotate = function(){
			 var div = $('div#slider div.slider-item').eq($active.index());
		
			 $(".paging a").removeClass('active'); //Remove all active class
			 $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
			 //Slider Animation
			 goToSlide(div);
			 
		
		}; 
		
		//Rotation  and Timing Event
		rotateSwitch = function(){
			 play = setInterval(function(){ //Set timer - this will repeat itself every 7 seconds
				  $active = $('.paging a.active').next(); //Move to the next paging
				  if ( $active.length === 0) { //If paging reaches the end...
						$active = $('.paging a:first'); //go back to first
				  }
				  rotate(); //Trigger the paging and slider function
			 }, slideTime); //Timer speed in milliseconds
		};
		
		
		//MAIN SLIDER	
		//**********************************
		
		
		//******************* MAINPAGE
		//********************************************************
		
		
		
		//*************************************
		//validation
		if($('#validateForm').length) {
			$("#validateForm").validate();
		}
		//*************************************
		
		
		
		if($('.lightbox').length) {
			$("a.lightbox").fancybox({
				'hideOnContentClick': false,
				'padding':0
			});	
		}
		
		
		
		
		
		
		
		//***************************************************************
		//*************************************** JS FIX V1
		
		$('.wrapper').append('<br class="clear" />');
		$('#content-bottom').appendTo('.wrapper:first');
		
		
		//Accordion Menu
		$('div#side-nav ul li a').click(function() {
				
				//açık olan alt menüleri kapat.
				$(this).parent().siblings().find("ul").slideUp(300);
				$(this).parent().siblings().removeClass('selected');
				$(this).parent().siblings().find("a.active").removeClass('active');
				
				//alt menüsü varsa
				if($(this).parent().find('ul').length) {
					
					if($(this).parent().hasClass('selected')) {
						
						$(this).parent().removeClass('selected');
						$(this).removeClass('active');
						$(this).parent().find('ul:first').stop(true,true).slideUp(400);
						
					}
					else {
						if(isModernBrowser) {
							Cufon.refresh()	
						}
						$(this).addClass('active');
						$(this).parent().addClass('selected');
						$(this).parent().find('ul:first').stop(true,true).slideDown(600);
							
					}
					return false;
				}
				
			});
					
		//***************************************************************
		//*************************************** JS FIX V1
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

	});
		

window.onload = function() {
			
			//***************************************************************
			//*************************************** JS FIX V1
			
			//açılı olan içerik sayfasının menüsü açık dursun...	
			$('div#side-nav ul li.selected ul:first').slideDown(800);
			
			//***************************************************************
			//*************************************** JS FIX V1
			
			
			//slider start emri
			rotateSwitch(); 
			animateFooter();
			animateContentBottom();
			animateContentTop();
			if(isModernBrowser) {
				$('#content').delay(700).animate({ opacity:1 },1500);
			}
			
		};	
	
	
	
	

//MAIN SLIDER	FUNCTIONS
//**********************************
function goToSlide(div) {
	
		if(isModernBrowser) {
			div.siblings().stop(true,true).fadeOut(500);
			animateSlide(div);
		} 
		else {
			div.siblings().stop(true,true).hide();
			animateSlide(div);
				 
			}	
		//diğer divlerdeki anime edilmiş elamanları ilk haline döndürmeliyiz.
	}
	
function animateSlide(div) {
	
		if(isModernBrowser) {
			div.stop(true,true).fadeIn(500);
		} 
		else {
			div.stop(true,true).show();	
		}
		
		// headings
		div.find('h3').delay(400).animate({ left:380, opacity:1 },1400,'');
		div.find('h4').delay(500).animate({ left:380, opacity:1 },1200,'');
		div.find('a.details').delay(1400).fadeIn(1000);
		
		//animation type specific animations
		if(div.hasClass('animate-1')) {
			animateImageFromBottom(div);
			//div.find('div.white-tall').delay(1700).animate({ bottom:-170 },700, 'easeOutBack');
			div.find('div.blue-big').delay(200).animate({ bottom:-80 },800, 'easeOutBack');
			div.find('div.blue-small').delay(250).animate({ bottom:-42 },900, 'easeOutBack');
		}
		else if(div.hasClass('animate-2')) { 
			animateImageFormLeft(div); 
			div.find('div.blue-top-big').delay(700).animate({ right:-500 },800, 'easeOutBack');
			div.find('div.blue-top-small').delay(900).animate({ right:-500 },900, 'easeOutBack');
		}
		else if(div.hasClass('animate-3')) { 
			animateImageFormLeft(div);
			div.find('div.white-big').delay(700).animate({ right:-540 },1200, 'easeOutBack');
			div.find('div.white-small').delay(900).animate({ left:0 },800, 'easeOutBack');
			div.find('div.blue-single').delay(1100).animate({ left:26 },600, 'easeOutBack');
		}
	}

function animateImageFormLeft(div) {
	if(isModernBrowser) {
			div.find('img').animate({ marginLeft:0, opacity:1 },3000,'easeOutExpo');
			
		} 
		else {
			div.find('img').animate({ marginLeft:0 },3000,'easeOutExpo');
		}
	}
function animateImageFromBottom(div) {
		div.find('img').animate({ marginTop:0 },1600,'easeOutExpo');
}

//MAIN SLIDER	FUNCTIONS
//**********************************


//footer custom animations
function animateFooter() {
		$('div#colors div.white').stop(true,true).delay(500).animate({ top:6 }, 600, 'easeOutBack');
		$('div#colors div.blue').stop(true,true).delay(700).animate({ top:32 }, 600, 'easeOutBack');
	}
	
//content bottom animations
function animateContentBottom() {
		$('div#content-bottom div.blue-big').stop(true,true).delay(1300).animate({ top:64 }, 600, 'easeOutBack');
		$('div#content-bottom div.blue-small').stop(true,true).delay(1500).animate({ top:84 }, 600, 'easeOutBack');
		$('div#content-bottom div.white-tall').stop(true,true).delay(1700).animate({ top:58 }, 600, 'easeOutBack');
	}
	
//content bottom animations
function animateContentTop() {
		$('div#content-top img').stop(true,true).delay(300).animate({ top:-28 }, 1000, 'easeOutExpo');
		$('div#content-top div.blue-content-top-big').stop(true,true).delay(400).animate({ top:-24 }, 600, 'easeOutBack');
		$('div#content-top div.blue-content-top-small').stop(true,true).delay(700).show(10).animate({ top:36 }, 600, 'easeOutBack');
	}




