/* Copyright (C) 2008-2009 by Struq */
/* Struq SL v2 (jquery) */

procStruq = function() {
	var slc = [];

	$('.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 url = 'http://app.struq.com/s/s/gQtFNQuFMk-F7pjWu0h8Kw/'
		+ '?v=2&qs=' + encodeURIComponent(slc.join('&'))
		+ '&rnd=' + parseInt(Math.random() * 10000000000000000);

	$("body").append('<iframe src="' + url + '" style="display:none" />');
}

procStruq2 = function() {
	var rnd = parseInt(Math.random() * 10000000000000000);
	var protocol = (document.location.protocol == "https:" ? "https:" : "http:");

	var furl = protocol + "//app.struq.com/t/i/" + rnd + "/-/qerkBfLMD0eUXJXn9eUvWQ/"
		+ "?v=4&sid=88"
		+ "&src=" + escape(window.location) + "&sref=" + escape(document.referrer)
		+ "&rnd=" + rnd;

	$("body").append("<if"+"rame src='" + furl + "' width='1' height='1' frameborder='0' marginheight='0'"
			+ " marginwidth='0' scrolling='no' style='position:absolute'></if"+"rame>");
}
