COL_path="tools/salary/col.aspx";
SAL_path="tools/salary/eOccupationGroup.aspx";
SCH_path="tools/schools/schools.aspx";
COM_path="tools/community/index.aspx";
CRI_path="tools/crime/crime.aspx"
MOR_path="tools/calculators/amortization.aspx";
EXP_path="tools/explorer/index.aspx";
MVP_path="tools/planner/index.aspx";
CPS_path="cpr/cps.aspx"



function RE_stats(path)
{
	TheStats = "left=50,top=50,scrollbars=yes,resizable=yes,location=no,directories=no,height=600";
	if (Site == "aptcom")
		TheStats += ",Width=780";
	else if (path == CPS_path)
		TheStats += ",Width=718";
	else if (path == MVP_path)
		TheStats += ",Width=618";
	else
		TheStats += ",Width=618";
	return TheStats;
}

function REwindow(baseURL,stats)
{
	if ( window.re && window.re.open && !window.re.closed) window.re.close();
  re = window.open(baseURL,"RELOBARPOPUP",stats);
 	re.focus();
}

function RE_NewWin(path)
{
	RE_NewWin2(path);
}

function RE_NewWin2(path)
{
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + path + "?esm=1";
	stats = RE_stats(path);
  REwindow(baseURL,stats);

}

function RE_NewWinEsmart(path)
{
	if (ESmartZip.length == 5)
		Temp = "?Izip=" + ESmartZip + "&";
	else
		Temp="?";
	stats = RE_stats(path);
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + path + Temp + "esm=1";
  REwindow(baseURL,stats);
}

function RE_NewWinNormal(path)
{
	if (ESmartZip.length == 5)
		Temp = "?Izip=" + ESmartZip;
	else
		Temp="?";
	stats = RE_stats(path);
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + path + Temp;
  REwindow(baseURL,stats);
}

function RE_NewWinCalculator()
{
	if (HomeValue.length > 0)
		Temp= "?Ihome=" + HomeValue + "&";
	else
		Temp = "?";
	stats = RE_stats(MOR_path);
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + MOR_path + Temp + "esm=1";
  REwindow(baseURL,stats);
}

function RE_NewWinCalculatorNormal()
{
	if (HomeValue.length > 0)
		Temp= "?Ihome=" + HomeValue;
	else
		Temp = "?";
	stats = RE_stats(MOR_path);
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + MOR_path + Temp;
  REwindow(baseURL,stats);
}


function RE_NewWinFull(path)
{
	Temp = "";

	if (typeof(Iemail) != "undefined" && Iemail.length > 0)
	{
		Temp += "Iemail=" + Iemail + "&";
	}
	if (typeof(ESmartZip) != "undefined" && ESmartZip.length == 5)
		Temp += "Izip=" + ESmartZip + "&";
	else
		Temp += "";

	if (typeof(Ipic) != "undefined" && Ipic.length > 0)
		Temp += "Ipic=" + Ipic + "&";
	else
		Temp += "";

	if (typeof(Iadd) != "undefined" && Iadd.length > 0)
		Temp += "Iadd=" + Iadd + "&";
	else
		Temp += "";

	if (typeof(Irate) != "undefined" && Irate.length > 0)
		Temp += "Irate=" + Irate + "&";
	else
		Temp += "";

	if (typeof(Iterm) != "undefined" && Iterm.length > 0)
		Temp += "Iterm=" + Iterm + "&";
	else
		Temp += "";

	if (typeof(HomeValue) != "undefined" && HomeValue.length > 0)
		Temp += "Ihome=" + HomeValue + "&";
	else
		Temp += "";

	if (typeof(MLS) != "undefined" && MLS.length > 0)
		Temp += "IMLS=" + MLS + "&";
	else
		Temp += "";

	if (typeof(ESM) != "undefined" && ESM != null)
		Temp += "esm=1&";
	else
		Temp += "esm=1&";


	stats = RE_stats(path);
	baseURL = "http://www.relocationessentials.com/aff/" + Site + "/" + path + "?" + Temp;
  REwindow(baseURL,stats);
}
