function openTerms()
{
	newwin = window.open("terms.html","popup","width=400,height=350,scrollbars=no");
}
function openPrivacy()
{
	newwin = window.open("privacy.html","popup","width=400,height=350,scrollbars=no");
}

function navOver(imgName)
{
	var theImage = document.getElementById(imgName);
	
	if(theImage.src.indexOf("_off.gif") != -1)
	{
		theImage.src = theImage.src.replace("_off.gif","_on.gif");
	}
	
	else
	{
		theImage.src = theImage.src.replace("_on.gif","_off.gif");
	}
}

function validateForm(theForm)
{
valid = true;
	message = "Please complete the following fields before proceeding:\n\n";
	
	if(theForm.elements["txtName"].value == "")
	{
		message += "Your name\n";
		valid = false;
	}
	
	if(theForm.elements["txtEmail"].value == "")
	{
		message += "Your email address\n";
		valid = false
	}	
		
	if(theForm.elements["txtEmail"].value != "")	
	{	
		var supEmail = theForm.elements["txtEmail"].value;
		var emLen = supEmail.length;
		var posAt = supEmail.indexOf('@')
		var posDot = supEmail.lastIndexOf('.')
		if((emLen < 7) || (posAt < 1) || (posDot <= (posAt + 1)) || (posDot >= (emLen - 1)))
		{
			message += "Valid email address\n";
			valid = false;
		}
	}	
	
	if(valid)
	{			
		return true;
	}
	else
	{		
		alert(message);
		return false;
	}	
}

/* SuFR */
function doSufr(sufrTag, sufrSrc, sufrWidth, sufrHeight)
{
	var theSufrTag = document.getElementsByTagName(sufrTag);	

	for(var i=0; i<theSufrTag.length; i++)
	{
		var obj = theSufrTag[i];
		// obj.setAttribute('id', 'tag'+i);
		obj.setAttribute('id', 'sufr'+sufrTag+i);  
		
		if(theSufrTag[i].firstChild != null)
		{
			var pageTxt = theSufrTag[i].firstChild.data;
			pageTxt = pageTxt.replace('&', '{and}');		
		}
		else
		{
			var pageTxt = "Article Title";
		}
		
		swfobject.embedSWF(sufrSrc + "?pageTxt=" + pageTxt + "&sufrId=sufr" + i, 'sufr'+sufrTag+i, sufrWidth, sufrHeight, "6", "expressInstall.swf", "false", {wmode:"transparent"});				
		document.getElementsByTagName(sufrTag)[i].style.width = sufrWidth;			
	}
}

function toggleCode()
{
	var theId = document.getElementById("enterCode");
	if(theId.style.display == "block")
		theId.style.display = "none";
	else if(theId.style.display == "none")
		theId.style.display = "block";
}





