function generateQoofGuidInternal()
{
var result, i, j;
result = '';
for(j=0; j<32; j++)
{
i = Math.floor(Math.random()*16).toString(16).toUpperCase();
result = result + i;
}
result = result.substring(0,8) + "-" + result.substring(8,12) + "-" + result.substring(12,16) + "-" + result.substring(16,20) + "-" + result.substring(20,32);
return result;
}
function getCurrentScriptSrc()
{
var scripts = document.getElementsByTagName('script');
var script = scripts[scripts.length - 1];
return script.src;
}
var qoofQueryParameters = null;
function getQueryVariable (variable)
{
if (qoofQueryParameters == null)
{
qoofQueryParameters = {};
var loc = getCurrentScriptSrc();
var query = loc.split("?")[1];
var vars = query.split("&");
for (var i = 0; i < vars.length; i++)
{
var pair = vars[i].split("=");
qoofQueryParameters[pair[0]] = decodeURIComponent(pair[1]);
}
}
try
{
return qoofQueryParameters[variable];
}
catch (e)
{
return '';
}
}
Qoof_WidgetId = getQueryVariable('id');
Qoof_widgetWidth = getQueryVariable('w');
Qoof_widgetHeight = getQueryVariable('h');
Qoof_AC = getQueryVariable('ac');
Qoof_AID = getQueryVariable('aid');
Qoof_CT = getQueryVariable('ct');
Qoof_FV = getQueryVariable('fv');
Qoof_IT = getQueryVariable('it');
function QoofWriteWidget()
{
if(typeof(Qoof_WidgetId)=="undefined") Qoof_WidgetId = '';
if(typeof(Qoof_widgetWidth)=="undefined") Qoof_widgetWidth = '300';
if(typeof(Qoof_widgetHeight)=="undefined") Qoof_widgetHeight = '250';
if(typeof(Qoof_AC)=="undefined") Qoof_AC = '';
if(typeof(Qoof_AID)=="undefined") Qoof_AID = '';
if(typeof(Qoof_CT)=="undefined") Qoof_CT = '';
if(typeof(Qoof_FV)=="undefined") Qoof_FV = '';
if(typeof(Qoof_IT)=="undefined") Qoof_IT = '';
if(typeof(Qoof_OCT) != "undefined")
{
Qoof_CT = Qoof_OCT;
}
var Qoof_HTTPReferrer = encodeURIComponent(document.location.href);
var Qoof_swf_file = getQueryVariable('swf');
if (typeof (Qoof_swf_file) == "undefined" || Qoof_swf_file == null || Qoof_swf_file.length == 0)
{
Qoof_swf_file = 'widget.swf';
}
var Qoof_swf = 'http://flash.qoof.com/' + Qoof_swf_file + '?w=' + Qoof_WidgetId;
var Qoof_pass = '';
var Qoof_AffiliateData = '';
var Qoof_SessionId = generateQoofGuidInternal();
var queryString = '&id=' + Qoof_WidgetId +
'&w=' + Qoof_widgetWidth +
'&h=' + Qoof_widgetHeight +
'&ac=' + Qoof_AC +
'&aid=' + Qoof_AID +
'&ct=' + encodeURIComponent(Qoof_CT) +
'&fv=' + encodeURIComponent(Qoof_FV) +
'&it=' + encodeURIComponent(Qoof_IT);
if(Qoof_AC.length > 0)
{
Qoof_pass = "&pass=ac%3D" + Qoof_AC;
Qoof_AffiliateData = "&ac=" + Qoof_AC;
}
if(Qoof_AID.length > 0)
{
Qoof_pass += "%26aid%3D" + Qoof_AID;
Qoof_AffiliateData += "&aid=" + Qoof_AID;
}
if(Qoof_CT.length > 0)
Qoof_CT = "&ct=" + encodeURIComponent(Qoof_CT);
if(Qoof_FV.length > 0)
Qoof_FV = "&" + Qoof_FV;
var Qoof_ObjectTag = "
\n";
if(Qoof_IT.length > 0)
{
Qoof_ObjectTag += "
\n";
}
document.write(Qoof_ObjectTag);
}
if(Qoof_WidgetId.length > 0)
QoofWriteWidget();