$( document ).ready(function() {
var sheet = (function() {
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
return style.sheet;
})();
sheet.insertRule("@media only screen and (max-width: 910px) {.scrak_CONTFB { display:none }} ",0);
sheet.insertRule("@media only screen and (min-width: 910px) {.scrak_CONTFB{width:40px; background-color:#403e3e ;cursor: pointer; cursor: hand;padding:4px;margin-left:45px; height:40px; }} ",1);
sheet.insertRule(".scrak_CONTFB_keski { height:30px;display: table-cell;cursor: pointer; cursor: hand; padding:5px;background-color:#403e3e; font-size:10px;vertical-align:middle;alignment-baseline:middle}",2);
sheet.insertRule(".scrak_CONTFB_keskib { height:30px;display: table-cell;cursor: pointer; cursor: hand; padding:5px;background-color:#403e3e; font-size:10px;vertical-align:middle;alignment-baseline:middle}",3);
sheet.insertRule(".scrak_CONTFB_keskic {width:24%; height:15px;display: table-cell;cursor: pointer; cursor: hand; padding:5px;background-color:#403e3e; font-size:10px;vertical-align:middle;alignment-baseline:middle}",4);
sheet.insertRule(".scrak_CONTSWG{height:35px;width:35px; float:left;}",5);
sheet.insertRule(".scrak_CONTSWGc{height:20px;width:15px; float:left;}",6);
sheet.insertRule(".scrak_NIM{vertical-align:middle; height:35px;display:table-cell; font-size:12px; color:white;}",7);
sheet.insertRule(".scrak_NIMc{vertical-align:middle; height:20px;display:table-cell; font-size:10px; color:white;padding-left:2px}",8);
sheet.insertRule(".fb_ac{ background-color:#3b5998; }",9);
sheet.insertRule(".what_ac{ background-color:#4dc247; }",10);
sheet.insertRule(".pint_ac{ background-color:#bd081c; }",11);
sheet.insertRule(".lnki_ac{ background-color:#0077b5; }",12);
sheet.insertRule(".gpplus_ac{ background-color:#3b5998; }",13);
sheet.insertRule(".tweet_ac{ background-color:#1da1f2; }",14);
sheet.insertRule(".mail_ac{ background-color:#848484; }",15);
sheet.insertRule(".fbmaarajakoa{ background-color:#1b2743; border-radius: 15px; padding:2px 6px; margin-left:3px;display:none }",16);
sheet.insertRule(".scjako{display:table-cell; }",17);
sheet.insertRule("@media only screen and (max-width: 760px) {.scrak_NIM { display:none }} ",18);
sheet.insertRule(".seuraava_ac{ background-color:#565656; }",19);
sheet.insertRule("@media only screen and (max-width: 760px) {.lnki_ac { display:none }} ",20);
sheet.insertRule("@media only screen and (max-width: 760px) {.lnki_ac { display:none }} ",21);
sheet.insertRule("@media only screen and (max-width: 760px) {.gpplus_ac { display:none }} ",22);
sheet.insertRule(".sydan_ac{ background-color:#c1c1c1; }",23);
//mobiili alapalkki
var innerhtml_keskio = '';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
//innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
$('.scrakentajafi_share').html(innerhtml_keskio);
$('.scrak_CONTFB_keskib').hover(
function() {
$(this).animate({
'opacity': '-=0.5'
}, 300, function() {
// Animation complete.
});
}, function() {
$(this).animate({
'opacity': '+=0.5'
}, 300, function() {
// Animation complete.
});
}
);
var innerhtml_keskio = '';
innerhtml_keskio = innerhtml_keskio + '';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
$('.scrakentajafi_keskio_share').html(innerhtml_keskio);
$('.scrak_CONTFB_keski').hover(
function() {
$(this).animate({
'opacity': '-=0.5'
}, 300, function() {
// Animation complete.
});
}, function() {
$(this).animate({
'opacity': '+=0.5'
}, 300, function() {
// Animation complete.
});
}
);
var innerhtml_keskio = '';
innerhtml_keskio = innerhtml_keskio + '';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
innerhtml_keskio = innerhtml_keskio + '
';
$('.scrakentajafi_keskio2_share').html(innerhtml_keskio);
$('.scrak_CONTFB_keskic').hover(
function() {
$(this).animate({
'opacity': '-=0.5'
}, 300, function() {
// Animation complete.
});
}, function() {
$(this).animate({
'opacity': '+=0.5'
}, 300, function() {
// Animation complete.
});
}
);
$('.fbjako').click(function() {
window.open('https://www.facebook.com/dialog/share?%20app_id=242351771255&display=popup&href=' + encodeURI(window.location.href) + '&redirect_uri=' + encodeURI(window.location.href) , '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500');
ga('send', 'event', 'SOME', 'FB_' + this.id, encodeURI(window.location.href));
});
$('.whjako').click(function() {
window.open('whatsapp://send?text=' + encodeURI(window.location.href), '_self', 'toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500');
ga('send', 'event', 'SOME', 'WHATASAPP_' + this.id, encodeURI(window.location.href));
});
$('.sydanjako').click(function() {
$.ajax({type: "GET",
crossDomain : true,
crossOrigin: true,
url: "//sc.rakentaja.fi/suosikki.aspx?kkv=" + $.cookie("RKkavija") + "&host=" + location.host + "&VLkavija=" + $.cookie("VLkavija") + "&sk4=" + $.cookie("sk4") + "&jsonp=jsonstring&callback=?",
dataType: "jsonp",
jsonp: "jsonp",
jsonpCallback: "jsonstring",
success: function (msg) {
console.log('onnistui');
$('.at-icon-sydan').css('fill', 'red');
ga('send', 'event', 'SOME', 'SYDANSUOSIKKI_' + this.id, encodeURI(window.location.href));
},
error: function(){
console.log('virhe');
}
});
});
$('.pintjako').click(function() {
window.open("https://www.pinterest.com/pin/create/link/?url=" + encodeURI(window.location.href) , "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500");
ga('send', 'event', 'SOME', 'PINTEREST_' + this.id, encodeURI(window.location.href));
});
$('.linkedjako').click(function() {
window.open("https://www.linkedin.com/shareArticle?mini=true&url=" + encodeURI(window.location.href) + "&ro=false&summary=&source=", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500");
ga('send', 'event', 'SOME', 'LINKEDIN_' + this.id, encodeURI(window.location.href));
});
$('.gpljako').click(function() {
window.open("https://plus.google.com/share?url=" + encodeURI(window.location.href) + "&ro=false&summary=&source=", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500");
ga('send', 'event', 'SOME', 'GPLUS_' + this.id, encodeURI(window.location.href));
});
$('.tweetjako').click(function() {
window.open("https://twitter.com/intent/tweet?url=" + encodeURI( window.location.href), "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500");
ga('send', 'event', 'SOME', 'TWITTER_' + this.id, encodeURI(window.location.href));
});
$('.mailjako').click(function() {
window.open("https://www.rakentaja.fi/suorakanava/kerrokaverille.asp?sivulinkki=" + encodeURI( window.location.href), "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500");
ga('send', 'event', 'SOME', 'KAVERILLE_' + this.id, encodeURI(window.location.href));
});
$('.seuraavaartikkeli').click(function() {
ga('send', 'event', 'SOME', 'SEURAAVA_MOBILE_' + this.id, encodeURI(window.location.href));
location.href = this.href;
});
$('.seuraavaartikkeli').click(function() {
var scurl = this.href;
ga('send', 'event', 'SOME', 'SEURAAVA_MOBILE', scurl, {
'transport': 'beacon',
'hitCallback': function(){document.location = scurl;}
});
return false;
});
});