 function Login(){  $("#login_iframe").attr("src", "w.Login?inC=KFM&inReturnTo=&inSiteLang="); $("#LoginModal").modal("show"); } function AddBid(inA, inO){ window.open("https://auktion.kronofogden.se/auk/w.AddBidForm?inC=KFM&inA="+inA+"&inO="+inO,"BIDKFM","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=700").focus(); } function AddFav(inA_inO_Combine){ if(inA_inO_Combine == "" ){ Login(); return; } var locDate = new Date(); $.get( "w2.AJAX_FavAdd?inC=KFM&inAinOCombine="+inA_inO_Combine+"&inPC="+locDate.getTime(), function( data ) {  if( parseInt(data) >= 200 ){  $("#fav_save_ok").hide();  $("#fav_save_err").show();  $("#FavModal").modal("show");  $(".fav_cnt").html(data).delay(2000).fadeTo("slow", 0.1).fadeTo("slow", 1.0).fadeTo("slow", 0.1).fadeTo("slow", 1.0);  setTimeout(' $("#FavModal").modal("hide") ',3000);  return;  }  if( parseInt(data) > 0 ){  $("#fav_save_ok").show();  $("#fav_save_err").hide();  $("#FavModal").modal("show");  $(".fav_cnt").html(data).delay(2000).fadeTo("slow", 0.1).fadeTo("slow", 1.0).fadeTo("slow", 0.1).fadeTo("slow", 1.0);  setTimeout(' $("#FavModal").modal("hide") ',3000);  } }); } function DelFav(inA, inO,inObjKey){ var locDate = new Date(); $.get( "w2.AJAX_FavDelete?inC=KFM&inA="+inA+"&inO="+inO+"&inPC="+locDate.getTime(), function( data ) {  if( parseInt(data) >= 0 ){ if(inA == "ALL"){  $("#fav_row").parent().fadeOut();  $(".fav_cnt").html(data).delay(2000).fadeTo("slow", 0.1).fadeTo("slow", 1.0).fadeTo("slow", 0.1).fadeTo("slow", 1.0); }else{  $("#"+inObjKey).parent().fadeOut();  $(".fav_cnt").html(data).delay(2000).fadeTo("slow", 0.1).fadeTo("slow", 1.0).fadeTo("slow", 0.1).fadeTo("slow", 1.0); }  } }); } function ShowFav(){ var locDate = new Date(); $.get( "w2.AJAX_ShowFav?inC=KFM&inSiteLang=SWEDISH&inPC="+locDate.getTime(), function( data ) { $("#fav_show_info").html(data); $("#ShowFavModal").modal("show"); $(".obj_thumbnail").show(); $(".list_toolbar").show(); AddEvents(); try{setTimeout("FetchData()",1000);}catch(e){}; }); } function ShowHelp(){ $.get( "w2.AJAX_ShowHelp?inC=KFM&inSiteLang=SWEDISH", function( data ) { $("#help_info_container").html(data); $("#help_info_title").html('<span class="glyphicon glyphicon-question-sign"></span> FAQ'); $("#AJAX_ShowHelpModal").modal("show"); }); } function ShowLoginHelp(){ $.get( "w2.AJAX_LoginHelp?inC=KFM&inSiteLang=SWEDISH", function( data ) { $("#help_info_container").html(data); $("#help_info_title").html('<span class="glyphicon glyphicon-question-sign"></span> Hjälp'); $("#AJAX_ShowHelpModal").modal("show"); }); } function ShowAbout(){ $.get( "w2.AJAX_ShowAbout?inC=KFM&inSiteLang=SWEDISH", function( data ) { $("#help_info_container").html(data); $("#help_info_title").html('<span class="glyphicon glyphicon-home"></span> Om oss'); $("#AJAX_ShowHelpModal").modal("show"); AddEvents(); }); } function ShowAuctionTerms(){ $.get( "w2.AJAX_ShowAuctionTerms?inC=KFM&inSiteLang=SWEDISH", function( data ) { $("#help_info_container").html(data); $("#help_info_title").html('<span class="glyphicon glyphicon-info-sign"></span>'); $("#AJAX_ShowHelpModal").modal("show"); AddEvents(); }); } function SelectSort(inVal){ AddSiteToForm(); $("#inSelectedSort").val(inVal); $("#inPageNo").val(1); $("#search_form").submit(); } function SelectCategory(inVal){ AddSiteToForm(); $("#inCategoryId").val(inVal); $("#inPageNo").val(1); $("#search_form").submit(); } function SelectSearchCrit(inVal,inClickObj){ AddSiteToForm(); $("#inSearchCrit").val(inVal); $("#inPageNo").val(1); $("#search_form").submit(); } function AddSiteToForm(){ $(".inSite").each(function(){ if( $(this).is(":checked") ){ if ( $(this).val() != "" ){ $("#search_form").append('<input type="hidden" name="inSite" value="' + $(this).val() + '">'); } } });  } function SelectSite(inId){ if(inId != "0"){  AddSiteToForm(); } $("#inPageNo").val(1); $("#search_form").submit(); } function GTo(inVal){ AddSiteToForm(); $("#inPageNo").val(inVal); $("#search_form").submit(); } function SelectNotSold(){ AddSiteToForm(); $("#inPageNo").val(1); $("#search_form").submit(); } function padDigits(number, digits) { return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; } var gblPageIsIdle = false; function SetPageIdle(){  gblPageIsIdle = true; $(".obj_bid_txt").css("visibility","hidden"); $(".object_bid_txt").css("visibility","hidden"); $(".obj_time_txt").css("visibility","hidden"); $(".live_list_indicator").css("visibility","hidden");  } function SetPageActive(){  gblPageIsIdle = false; $(".obj_bid_txt").css("visibility","visible");  $(".object_bid_txt").css("visibility","visible");  $(".obj_time_txt").css("visibility","visible"); $(".live_list_indicator").css("visibility","visible");  } function ShowIdleTime(){ if( gblPageIsIdle ){ var d1 = new Date( $( document ).idleTimer("getLastActiveTime") ); var d2 = new Date( $( document ).idleTimer("getElapsedTime") ); $(".idle_time_txt").html( d1.toDateString() + " " + d1.toLocaleTimeString() + "<h4>" + padDigits(d2.getUTCHours(),2) + ":" + padDigits(d2.getUTCMinutes(),2) + ":" + padDigits(d2.getUTCSeconds(),2) +"</h4>"); setTimeout("ShowIdleTime()",1000); } } function DoReload(){ document.location=document.location; } function TargetOpener(inLink) { if (! (window.focus && window.opener) )return true; window.opener.focus(); window.opener.location.href=inLink.href; return false; } function SetPicDimension(inObjId){ $("#pic_modal").css("max-height", $( window ).height()-95 ); $("#pic_modal").css("max-width", $( window ).width() ); } function SetLang(inAuctionId, inLang){ if(inAuctionId != ""){  document.location="w.objectlist?inC=KFM&inA="+inAuctionId+"&inSiteLang="+inLang; }else{  document.location="w.AuctionList?inC=KFM&inSiteLang="+inLang; } } function RotateImage(inImgId,inClickObj){ $("#"+inImgId).fadeOut("fast", function(){  if( $("#"+inImgId).hasClass("gly-rotate-90") ){  $("#"+inImgId).removeClass("gly-rotate-90").addClass("gly-rotate-180").hide().fadeIn("fast");  $(inClickObj).removeClass("gly-rotate-90").addClass("gly-rotate-180").css("color","red");  }else if( $("#"+inImgId).hasClass("gly-rotate-180") ){  $("#"+inImgId).removeClass("gly-rotate-180").addClass("gly-rotate-270").hide().fadeIn("fast");  $(inClickObj).removeClass("gly-rotate-180").addClass("gly-rotate-270").css("color","red");  }else if( $("#"+inImgId).hasClass("gly-rotate-270") ){  $("#"+inImgId).removeClass("gly-rotate-270").hide().fadeIn("fast");  $(inClickObj).removeClass("gly-rotate-270").css("color","");  }else{  $("#"+inImgId).addClass("gly-rotate-90").hide().fadeIn("fast");  $(inClickObj).addClass("gly-rotate-90").css("color","red");  } }); } function CookieInfoAccepted(){  document.cookie="As5B5445581245845tKFM=145878548; expires=Thu, 18 Dec 2113 12:00:00 UTC"; $(".cookie_info_container").fadeOut();  } function CloseReadSpeakerPlayer(){ try{ var player = rspkr.ui.getActivePlayer();  player.close(); }catch(e){} } function AddEvents(){ $("img.lazy").lazyload({ threshold : 400  });  $(".slick-carousel").slick({ lazyLoad: "ondemand", infinite: false, slidesToShow: 1, asNavFor: ".slick-carousel_nav", slidesToScroll: 1, dots: true }); $(".slick-carousel_nav").slick({ infinite: false, slidesToShow: 6, slidesToScroll: 1, asNavFor: ".slick-carousel", dots: false, centerMode: false, focusOnSelect: true, arrows: false, variableWidth: true }); $(".slick-carousel_img").css("visibility","visible"); $(".slick-carousel_nav").on("beforeChange", function(event, slick, currentSlide, nextSlide){ $("img[data-slick-index="+currentSlide+"]").css("background-color","#fff"); $("img[data-slick-index="+nextSlide+"]").css("background-color","#006769"); }); $(".slick-carousel").on("beforeChange", function(event, slick, currentSlide, nextSlide){ $("img[data-slick-index="+currentSlide+"]").css("background-color","#fff"); $("img[data-slick-index="+nextSlide+"]").css("background-color","#006769"); });   $("#AJAX_ShowHelpModal").on("hidden.bs.modal", function () {  CloseReadSpeakerPlayer(); }); $("#ShowFavModal").on("hidden.bs.modal", function () {  CloseReadSpeakerPlayer(); }); window.rsConf = { cb: { ui: { play: function() {  $(".rs_container").slideDown(); }, close: function() {  $(".rs_container").slideUp();  } } } };  var locThisIsATouchDevice = "ontouchstart" in document.documentElement; if( locThisIsATouchDevice == true ){  $(".gly-spin-60").removeClass("gly-spin-60"); } if( locThisIsATouchDevice == false ) {  $('[data-toggle="tooltip"]').tooltip();  $(".obj_thumbnail").mouseover(function() {  $(".obj_time_" + $( this ).attr("id") ).hide();  $(".obj_fav_" + $( this ).attr("id") ).css("display","block");  $(".obj_morepic_" + $( this ).attr("id") ).css("display","block");  $( this ).addClass("obj_thumbnail-active");  });  $(".obj_thumbnail").mouseout(function() {  $(".obj_time_" + $( this ).attr("id") ).stop( true, true ).fadeIn("fast");  $(".obj_fav_" + $( this ).attr("id") ).css("display","none");  $(".obj_morepic_" + $( this ).attr("id") ).css("display","none");  $( this ).removeClass("obj_thumbnail-active");  });  $(".obj_thumbnail").click(function() {  $( this ).removeClass("obj_thumbnail-active");  });  $(".obj_fav").mouseover(function() {  $( this ).addClass("obj_fav_hoover").html('<span class="glyphicon glyphicon-heart"></span> Spara som favorit');  });  $(".obj_fav").mouseout(function() {  $( this ).removeClass("obj_fav_hoover").html('<span class="glyphicon glyphicon-heart"></span>');  });  $(".obj_fav").click(function( event ) {  event.preventDefault();   $(this).unbind( "click" );  AddFav(this.id);  });  $(".obj_morepic_pagination").mouseover(function() {  $( this ).css("color","white").css("background-color","#006769");  });  $(".obj_morepic_pagination").mouseout(function() {  $( this ).css("color","#006769").css("background-color","white");  });   $(".glyphicon-asterisk").addClass("text-muted").css("font-size","9px");   $(".stop_bar_container").mouseover(function() {  $( this ).removeClass("stop_bar_opacity");  });  $(".stop_bar_container").mouseout(function() {  $( this ).addClass("stop_bar_opacity");  });   $(".text_admin_container").mouseover(function() {  $( this ).addClass("text_admin_container_active");  $(".text_admin_btn").show(); }); $(".text_admin_container").mouseout(function() {  $( this ).removeClass("text_admin_container_active");  $(".text_admin_btn").hide(); }); } $(".pic_view_thumb").click(function( event ) { $(".pic_view_thumb").css("background-color","#fff");  $(this).css("background-color","#006769");   if( $( "#pic_modal" ).attr("src") == $( this ).attr("src").replace("_thumb","") ){  $("#pic_modal").removeClass("gly-rotate-90").removeClass("gly-rotate-180").removeClass("gly-rotate-270");  $(".rotate_img").removeClass("gly-rotate-90").removeClass("gly-rotate-180").removeClass("gly-rotate-270").css("color","");  }else{  $("#loading_obj").show();  $("#pic_modal").hide().removeClass("gly-rotate-90").removeClass("gly-rotate-180").removeClass("gly-rotate-270").attr( "src", $( this ).attr("src").replace("_thumb","") );  $(".rotate_img").removeClass("gly-rotate-90").removeClass("gly-rotate-180").removeClass("gly-rotate-270").css("color","");  }  $("#panzoomObj").panzoom("reset"); SetPicDimension(); }); $("#pic_modal").load(function( event ) { $(this).fadeOut().fadeIn(); $("#loading_obj").hide(); });  $(window).scroll(function () { if ($(this).scrollTop() > 150) { $("#back-to-top").fadeIn(); } else { $("#back-to-top").fadeOut(); } }); $("#back-to-top").click(function () { $("body,html").animate({ scrollTop: 0 }, 800); return false; }); } $(document).ready( function(){ AddEvents();  $(".obj_thumbnail").show(); $(".list_toolbar").show(); $(".footer_container").show();  $( document ).idleTimer( 180000 ); $( document ).on( "idle.idleTimer", function(event, elem, obj){  SetPageIdle(); }); $( document ).on( "active.idleTimer", function(event, elem, obj, triggerevent){  SetPageActive(); }); }); 