	/**
	  * @category
	  * @package        Ufukbahar İnterface
	  * @author         Oktay Başkuş
	  * @copyright      2005 - 2011 ICON Perception Management Co.
	  * @license
	  * @version
	  * @filesource
	  * @link		http://www.iconpm.com
	  * @see
	  * @since
	  **/





var url_reg = "\/([a-z]{2})([a-zA-Z0-9\-\+/]+)\#!(.*)"
var loc     = document.location.href
var locreg = loc.match(url_reg);

if(locreg){    
    var regexec  = loc.match(url_reg)
    var lang     = regexec[1]; 
    var realfurl = regexec[2]
    var simlurl  = regexec[3]
    var ieurl   = 'http://'+document.location.host+'/'+lang+'#!'+simlurl
    var realurl  = 'http://'+document.location.host+simlurl
    if(window.history.pushState){
        window.location = realurl
    }
    else window.location = ieurl;
}else{
    if(!window.history.pushState && loc.indexOf("#!")==-1){
        url_reg = "\/([a-z]{2})([a-zA-Z0-9\-\+/]+)$"
        regexec  = loc.match(url_reg);
        if(regexec){
            lang     = regexec[1];
            simlurl  = '/'+lang+regexec[2]
            ieurl   = 'http://'+document.location.host+'/'+lang+'#!'+simlurl
            window.location = ieurl;
        }
    }
}

(function($,win,doc){$(doc).ready(function(){
    win.ajaxcomplaterecall=null;
    
    
    $('#main-nav a').toAjax({fromSection:"#content", toSection:"#content"})
    
    
    setTimeout(function(){
        $('#main-nav').ufukbaharTrgeffect({imgurl:"/interfaces/ufukbahardorduncu/images/trgl.png"});
    },1000)
    
    
    $(win).bind("popstate",function(){$.checkPaths("#main-nav a")});
    
    $.ajaxPreload();
    $.checkWindowHash();
    if(doc.referrer){
        var lastlng = doc.referrer.match(/\/([a-z]{2})\/?/g);
        var curlng  = doc.location.href.match(/\/([a-z]{2})\/?/g);
        lastlng =typeof(lastlng)=='object'?lastlng[1]:lastlng
        curlng =typeof(curlng)=='object'?curlng[1]:curlng
        if(lastlng == curlng) {
            $('#main-nav a').sideRight();
        }
        else {
            $('#main-nav a').show();
        }
    }
    else {
        $('#main-nav a').sideRight();
    }
    
    $(win).bind('ajaxcomplate',function(){
        
        if($("#ikili .content").length){
            $("#ikili .content").iconScroll()
        }
        if($('.rep-item').length)
            $('.rep-item').hoverEfect();
        
        if($('.record-list').length){
            $('.record-list a').toAjax({fromSection:"#content",toSection:"#content",mode:"records"})
            $('.record-image').effectAlbum();
            $('.record-summary').hide()
            $('.record-content').hide()
            setTimeout(function(){
                $('.record-content, .record-title span').fadeIn(500)
                $(".record-content").iconScroll()
            },400)
            setTimeout(function(){
                $('.record-summary').fadeIn(1000)
            },550)
            if($('.record-list').attr('hover')!='enabled'){
                $('.record-list').recordsHover();
            }
            if($('.vertical-title').length)
                if($.browser.msie && $.browser.version<8)
                     $('.vertical-title').jqrotate(90)
                else $('.vertical-title').jqrotate(-90)
        }
        
        if($('.agenda-list').length){
            if(!$('.agenda-list li a').first().attr('ajax')){
                $('.agenda-list li').css({opacity:0,marginTop:-20,display:'block'});
                $('.agenda-list li').animate({opacity:1,marginTop:0},500,"easeOutQuad")
            }
        }
        
        
        if($('.press-details').length){
            $(".press-details").iconScroll()
        }
        
        if($('.press-pagination').length){
            $('.press-pagination').paginateScroll();
        }

        if($('.press-list a').length){
            $('.press-list a').toAjax({fromSection:".press-details",toSection:".press-details", mode: 'press'})
            if(!$('.press-list .current').length &&  win.ajaxcomplaterecall == null){
                $('#press .press-list a').first().trigger('click');
            }    
        }
        if($('.agenda-list a').length){
            $('.agenda-list a').toAjax({fromSection:".agenda-details",toSection:".agenda-details", mode: 'agenda'})
            if(!$('.agenda-list .current').length &&  win.ajaxcomplaterecall == null){
                $('.agenda-list a').first().trigger('click');
            }
        }
        if($('.agenda-details').length){
            //$(".agenda-details #mcs_container").mCustomScrollbar("vertical",0,"easeOutCirc",1.05,0.2,"yes","yes",15);
            $(".agenda-details").iconScroll()
        }
        if($('.gallery-list').length){
            
            if(!$('.gallery-list li a').first().attr('ajax')){
                $('.gallery-list li').css({opacity:0,marginTop:-20,display:'block'});
                $('.gallery-list li').animate({opacity:1,marginTop:0},500,"easeOutQuad")
            }
        }
        if($('.gallery-list a').length)
            $('.gallery-list a').toAjax({fromSection:".gallery-details",toSection:".gallery-details", mode: 'gallery'})
        
        if($('.gallery-details').length){
            $('.gallery-details').not('.forpress').ufukbaharGallery();
            $('.gallery-details.forpress').ufukbaharGalleryForpress();
        }
        if($('#contact').length){
            $('#contact .content').contactLayout();
        }
        var curlng  = doc.location.href.match(/\/([a-z]{2})\/?/g);
        curlng =typeof(curlng)=='object'?curlng[1]:curlng
        $('#logo').attr('href','http://'+doc.location.host+curlng);
        
        var musicboxhtml="";
        $('a[rel="video"]').colorbox({
            iframe:true,
            innerWidth:620,
            innerHeight:345,
            opacity:0.9,
            current:'',
            onComplete: function(){
                musicboxhtml = $('#music-player').html()
                $('#music-player').empty();
                $("#cboxLoadedContent embed").attr('allowfullscreen', 'true');
                $("#cboxLoadedContent embed").attr('wmode', 'transparent');
                $("#cboxLoadedContent object").append('<param value="true" name="allowFullScreen">');
                $("#cboxLoadedContent object").append('<param value="transparent" name="wmode">');
            },
            onClosed: function(){
                $('#music-player').empty()
                $('#music-player').html(musicboxhtml)
            }
        });
        
        if($('.header-img').length){
            var headersrc = $('.header-img').css('background-image').match("url\\(\"?(.*)\"?\\)")[1].replace("\"","");
            $('<img />')
                .load(function(){
                    $('.header-img').fadeIn(1000,function(){
                        $(document.body).css('background-image','url('+headersrc+')')
                        //$('.header-img').hide();
                    })})
                .attr('src',headersrc);            
        }
        
        if(win.ajaxcomplaterecall){
            var ajaxcomplaterecalltmp = win.ajaxcomplaterecall
            win.ajaxcomplaterecall=null;
            ajaxcomplaterecalltmp();
        }
        $(doc).unbind('mousewheel')
        $(doc).bind('mousewheel',function(e,d){
            
            if($('.scrolled').length){
                var $scrolled = $('.scrolled')
                $scrolled.triggerHandler('mousewheel',d)
            }
        })
      if($.browser.msie){
          $('a').focus(function(){
              this.blur();
          })
      }
      $.contentsize();
    })
    
    
    $('#ajaxloader').fadeOut(1000)
    $.fullcheck()
        
    $(win).resize($.fullcheck)
    $(win).resize($.contentsize)
    
    if(!$.browser.opera){
        $(win).keydown(disableCtrlKeyCombination)
    }
    
    $(win).trigger('ajaxcomplate')
    
})})(jQuery,window,document)
         
         
