﻿/* Copyright (C) 2008-2010 by Struq */
/* Struq SL v2.2 (jquery) */

$(document).ready(function() {
    var slc = [];
    var rnd = parseInt(Math.random() * 10000000000000000);
    var protocol = (document.location.protocol == "https:" ? "https:" : "http:");

    $('.struq_SL_DF_container').each(function() {
        var items = [];
        var ckey = $(this).attr('title');

        $(this).find('.struq_SL_DF').each(function() {
            var pn = $(this).attr('title');
            var pv = $(this).text();
            items[items.length] = encodeURIComponent(pn) + '=' + encodeURIComponent(pv);
        });

        slc[slc.length] = ckey + "=" + (items.join('|'));
    });

    if (slc.length == 0)
        return;

    var surl = protocol + '//app.struq.com/s/s/011m0zH8jEWqeyMq6wgq5g/'
		+ '?v=2&qs=' + encodeURIComponent(slc.join('&'))
		+ '&rnd=' + rnd;
    $("body").append('<ifr' + 'ame src="' + surl + '" style="width:0px; height:0px; border: 0px"></ifr' + 'ame>');

    var turl = protocol + "//app.struq.com/t/i/" + rnd + "/-/ZN3_r2k34UGF3YqJgpnLDg/"
		+ "?v=4&sid=84"
		+ "&src=" + encodeURIComponent(window.location) + "&sref=" + encodeURIComponent(document.referrer)
		+ "&rnd=" + rnd;
    $("body").append('<ifr' + 'ame src="' + turl + '" style="width:0px; height:0px; border: 0px"></ifr' + 'ame>');
});
