
var _url = '';
var _cg = '0';
var _redirect = true;

function _netClick(url, cg, redirect)
{
	_url = url; _cg = cg; _redirect = redirect;
	_nnClick(_url);
} 

function _nnClick(_nnClickDest)
{
	_nnCD = _nnClickDest;
	_nnECD = escape(_nnClickDest);
	_nnDelay = 500; /* click delay */
	var _nnRD=0;
	if (parseInt(navigator.appVersion)>=4)
	{
	_nnRD=(new Date()).getTime();
	}
	var _nnCI="commbank";
	var _nnCG=_cg; // modified line from vendor: replace '0' with _cg variable
	var _nnCC="au";
	var _nnLP=location.protocol.indexOf('https')>-1?'https:':'http:';
	var _nnRP=escape(window.location);
	var _nnND=_nnLP+'//secure-' + _nnCC + '.imrworldwide.com/';
	var _nnParams = "rnd=" + _nnRD + "&ci=" + _nnCI + "&cg=" + _nnCG;
	var _nnRef = "&rp=" + _nnRP;
	var _nnSI = "&si=" + _nnCI + "-ctgw-" + _nnECD;
	var _nnPixel = new Image(1,1);
	_nnPixel.src = _nnND + "cgi-bin/m?rnd=" + _nnParams + _nnSI + _nnRef;
	
	if (_redirect) 
		setTimeout("window.location = _nnCD", _nnDelay); // modified line from vendor: add if (_redirect)
	else
	{
		// when there is a pop-up
		// dynamically create an image in the window opener
		var img = document.createElement("img");
		img.src = _nnPixel.src; img.height=1; img.width=1;
		document.body.appendChild(img);
		setTimeout("return", _nnDelay);
	}
	
}
function openFile(virtualDir,path)
{  
	if(path.length > 0)
	{
		var width = parseInt(screen.width * 1 / 4);
		var height = parseInt(screen.height * 1 / 4);
		var left = parseInt((screen.width - width) / 2);
		var top = parseInt((screen.height - height) / 2);
		window.location.href=virtualDir + '?file=/' + path;
		//var newpdfwindow =window.open(virtualDir + '?file=' + path, null, "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",status=yes,toolbar=no,menubar=yes,location=no,resizable=no");
		//if (window.focus) {newpdfwindow.focus();}
	}

}

function openFiledialog(path)
{
	if(path.length > 0)
	{
		var width = parseInt(screen.width * 3 / 4);
		var height = parseInt(screen.height * 3 / 4);
		var left = parseInt((screen.width - width) / 2);
		var top = parseInt((screen.height - height) / 2);
		
		window.open(path, null, "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",status=yes,toolbar=no,menubar=yes,location=no,resizable=yes");
	}
}

