﻿// nzfs-Common.js
// Common scripts across the site
//

function nzfs_WriteIfNotEmpty(pCheck, pToWrite)
{
	var tempStr = pCheck;
	tempStr = tempStr.replace('&nbsp;', '');
	tempStr = tempStr.replace(' ', '');
	if (tempStr != '')
	{
		document.write(pToWrite);
	}
}

var ___stayFlag = false;

function __ShowContent(pId)
{
	var box = document.getElementById(pId);
	if (box)
	{
		box.style.display = 'block';
	}
}

function __HideContent(pId)
{
	if (___stayFlag == false)
	{
		var box = document.getElementById(pId);
		if (box)
		{
			box.style.display = 'none';
		}
	}
}

function __ToggleContent(pId)
{
	var box = document.getElementById(pId);
	if (box)
	{
		if (box.style.display != 'none')
		{
			box.style.display = 'block';
		} else
		{
			box.style.display = 'none';
		}
	}
}




function __NZFSUrlEncode(s)
{
	var str = s;
	str = escape(s);
	str = str.replace('+', '%2B');
	str = str.replace('%20', '+');
	str = str.replace('*', '%2A');
	str = str.replace('/', '%2F');
	str = str.replace('@', '%40');
	str = str.replace('&', '%26');
	str = str.replace('?', '%3F');
	return str;
}