aewindowurl = window.location;
aewindowurl = unescape(aewindowurl);

enableforcedregistration = true; // experiment without forcing

var keylinksarray  =  [ 
"solar+energy", "Solar Energy",
"wind+power", "Wind Power",
"hydropower", "Hydropower",
"geothermal", "Geothermal",
"nuclear", "Nuclear",
"conservation", "Conservation",
"environment", "Environment",
"energy+efficiency", "Energy Efficiency",
"energy", "ALL ENERGY"
]

var fieldsinarray = 2;
var looplength = keylinksarray.length / fieldsinarray;
//document.write('looplength='+looplength + "<br>");
 //document.write(425.65 / 7);

for (var i = 0; i < looplength; i++) 
{
	linktemp1 = "<p><a href=\"#null\" onclick=\"careerlink('searchtextuse')\" title=\"See textsubstitute jobs (Requires Free Sign Up)\">textsubstitute*</a></p>"

	linktemp2 = "<p><a href=\"#null\" onclick=\"careerlink('searchtextuse')\" title=\"See textsubstitute jobs \">textsubstitute</a></p>"
	
	linktemp = (enableforcedregistration) ? linktemp1 : linktemp2 ;
	
	searchtextuse = keylinksarray[i*fieldsinarray];
	textsubstitute = keylinksarray[i*fieldsinarray+1];

	linktemp = linktemp.replace(/searchtextuse/g, searchtextuse)
	linktemp = linktemp.replace(/textsubstitute/g, textsubstitute)
	document.write(linktemp)
}

if (enableforcedregistration)
{
	document.write("<span style='font-size: 90%; padding-bottom: 20px; padding-left: 5px;'>*Requires FREE Sign Up</span>");
}

//document.write("<br><a href='/discounts' style='font-size: 90%; padding-bottom: 20px; padding-left: 5px;'>Exclusive Discounts</a>");
 

function careerlink(searchtextuse)
	{
		//linktemp = "http://www.careerbuilder.com/JobSeeker/Jobs/JobResults.aspx?strCrit=rawWords%3dsearchtextuse%3bcty%3d%3bsid%3dALL%2c+US%3bcid%3dUS%3bfre%3d30%3brad%3d10%3bJN%3dAll%3b&lr=cbpar_altenergy&siteid=par_altenergycs";
		linktemp = "http://www.careerbuilder.com/JobSeeker/Jobs/JobResults.aspx?strCrit=rawWords=searchtextuse;cty=;sid=ALL,+US;cid=US;fre=30;rad=10;JN=All;&lr=cbpar_altenergy&siteid=par_altenergycs"
		linktemp = linktemp.replace("searchtextuse", searchtextuse);

		div2replace = "xg_module_account";
		signupboxcontents = (document.getElementById(div2replace)) ? document.getElementById(div2replace).innerHTML : "empty";
		needtosignup = (signupboxcontents.indexOf("Sign Up") > 0)
		
		needtosignup = (enableforcedregistration) ? needtosignup : false ;
		
		if (needtosignup)
			{
				alert('You must Sign Up to use this link (Quick and Free)')
				window.open("/main/authorization/signUp?target=http%3A%2F%2Fwww.alternativeenergy.com%2F","_top");
			}
		else
			{
				window.open(linktemp,"_blank");
			}
	}