buttonLoc = relativePath + "images/btn_";
buttonName = new Array ('my_campaign','about','contactus','get_started','inquiries','sign_in','update_my_profile','latest_news','continue','update','home','header_signup','ready_to_join','all_time','last_90_days');


for (var cnt=0; cnt < buttonName.length; cnt++) {
	eval ('var '+buttonName[cnt]+'_on = new Image();');
	eval (buttonName[cnt] + '_on.src = "'+buttonLoc + buttonName[cnt] + '_on.gif"');
	eval ('var '+buttonName[cnt]+'_off = new Image();');
	eval (buttonName[cnt] + '_off.src = "'+buttonLoc + buttonName[cnt] + '_off.gif"');
}	

function buttonAction (imgName, isItOn) {   
     if (isItOn) {
        document[imgName].src = eval(imgName + "_on.src");
     } else {
        document[imgName].src = eval (imgName + "_off.src");
     }
}

function replaceInput (formName,fieldname,oldValue,myValue)
{
	var myForm = eval("document."+formName);
	if (myForm[fieldname].value == oldValue)
		myForm[fieldname].value = myValue;
}

function doCollapse (idName, status)
{
	document.getElementById(idName).className = status;	
	if (status == "visible_error")
	{
		location.href = "#"+(idName).replace("error_","");
	}
}

function validatePassword (formName)
{
	var myForm = eval("document."+formName);
	
	if (myForm["password"].value == "")
	{
		doCollapse ('true_password','invisible');
		doCollapse ('dummy_password','visible');
	}
}

function goPopup(url,width,height,scroll)
{
		window.open(url, 'newWin', 'width='+width+',height='+height+',scrollbars='+scroll);
}

function viewImage (filename, width, height)
{
	var tmp = filename.split ("/");
	var str = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height
	var html ='<html>\n<head>\n<title>Preview - '+ tmp[2] +'</title></head>\n';
	html += '<body bgcolor="white" leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0>\n';
	html += '<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%"><tr><td align=center id="s"><a href="javascript:window.close();"><img src="'+filename+'" width="'+width+'" height="'+height+'" border=0 alt="Click to Close Window"></a></td></tr></table>';
	html += '\n</body>\n</html>';

	var win = window.open("","_blank", str);
	win.document.open("text/html", "replace");	
	win.document.write(html);
	win.document.close();
	win.window.focus();	
}