$(document).ready(function(){
if ($('#splash').length==1)
{
  if ($.cookie("splash")!='true')
  {
    $.nyroModalSettings({title: 'Yapıdaki görünmez güç',type:'iframe',width:600,height:450,minWidth:600,minHeight:450,padding:0});
    $('#splash').nyroModalManual();
    $.cookie("splash", "true", {expires: 1});
  }
}
  
$("#leftmenu li").mouseover(function() {
$(this).stop();
$(this).animate({backgroundColor: "#ecd63c"}, 250 );
});

$("#leftmenu ul li").mouseout(function() {
$(this).stop();
if (!$(this).hasClass('active'))
  $(this).animate({ backgroundColor: "#efeeaf"}, 1000 );
});

$("#leftmenu li").click(function() {
  $("#leftmenu li").css({backgroundColor:'#efeeaf'});
  $("#leftmenu li").removeClass('active');
  $(this).addClass('active');
  $(this).css({backgroundColor:'#ecd63c'});
});

$("#leftmenu ul li ul li a").mouseover(function() {
$(this).stop();
$(this).animate({backgroundColor: "#ffe631"}, 500 );
});

$("#leftmenu li ul a").mouseout(function() {
$(this).stop();
  $(this).animate({ backgroundColor: "#f8eb8d"}, 1000 );
});

$('#topmsg1').show();
var currentMessage=1;
var totalMessageSize=$('.topMessage').size();
$(this).everyTime(5000,"hide", function () {
    $('#topmsg'+currentMessage).fadeOut(500, function () {
      currentMessage++;
      if (currentMessage>totalMessageSize)
        currentMessage=1;
      $('#topmsg'+currentMessage).fadeIn(1000);
    }    
    );
}
);

$(".uruntabbtn").click(function() {
  $(".uruntabbtn").removeClass('activetab');
  $(".uruntabbtn").addClass('inactivetab');
  $(this).addClass('activetab');
  var tab=$(this).attr('tab')-1;
  var wdth=$('#tabcontent1').width()+7;
  var lft=-tab*wdth;
  $('#urunicsayfa').animate(
    { marginLeft: lft },
    {
        queue:false,
        duration:400,
        easing:'swing'
    }
  );
});

$(".uruntabbtn").mouseover(function() {
   $(this).addClass('hover');
  }
);

$(".uruntabbtn").mouseout(function() {
   $(this).removeClass('hover');
  }
);

$("#printthispage").click(function (){
  window.print();
  return false;
  }
).css('display','block');

});


jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') {
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString();
        }
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else {
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};