/**
 * Realise Page Dot Script
 *
 * Based on NetGenesis Page Dot Script
 *
 * This javascript uses system & user-assigned variables to
 * create a meaningful entry in the page dotting webserver access
 * log.
 **/


function pagedot(sExtra, sUsername) {

     //Version 003
     //
     var ng_pdver=003;

     // Inherit protocol from Web Page requested
     //
     var loggingProtocol = window.document.location.protocol;

     // host name for logging server
     //
     var loggingHost="//www.brokerzone.ie";

     // switch to logging on apps server if HTTPS
     if(loggingProtocol == "https:") { loggingHost = "//apps.standardlife.com"; }

     // name of path for location of gif
     //
     var loggingContextPath="/img" ;

     // the tracking server returns the 1x1 invisible gif for all gif requests.
     var loggingGif = "/1pixel.gif";

     var loggingURL = loggingProtocol
        + loggingHost
        + loggingContextPath 
        + loggingGif;   
	
     // variables used to bust caches
     //
     var r1 = Math.floor(Math.random()*12345678);

     // Building the query string of tracking information passed to the Page Dot Server.
     //
     var querystr = "?";

     querystr +=   "uri="        + window.location.href;
     querystr +=   "&host="       + window.location.host;
     querystr +=   "&referrer="  + escape((parent.window.document.referrer==""?"-":parent.window.document.referrer));
     querystr +=   "&rand=" + r1;
     querystr +=   "&user=" + sUsername;

     // querystr +=    "&pdver=" + ng_pdver;
     if(sExtra) { querystr +=    "&" + sExtra; }

     //create the dot itself
     //
     var image = new Image();

     image.src = loggingURL + querystr;
}

/*
if (typeof sExtra == 'undefined') { var sExtra = "" };

pagedot(sExtra);
*/

// opens a popup that provides the status bar to show if the user is in a secure environment.
function openShowStatus(url,name,w,h) 
{
	window.open(url,name,"width="+w+",height="+h+",status=yes,toolbar=no,directories=no,resizable=yes,location=no,menubar=no,scrollbars=yes");
}
