
function emitPicture(fhName,guid,pictureSize,headerColor,subHeaderColor)
{
	switch(pictureSize)
	{
		case "large":
		  pictureSize = "http://module.griefconnections.com/AftercareJS/ecareLarge.png";
		  pictureWidth = 450;
		  pictureHeight = 240;
		  break;    
		case "medium":
		  pictureSize = "http://module.griefconnections.com/AftercareJS/ecareMedium.png";
		  pictureWidth = "375";
		  pictureHeight = "200";
		  break;
		case "small":
		  pictureSize = "http://module.griefconnections.com/AftercareJS/ecareSmall.png";
		  pictureWidth = "300";
		  pictureHeight = "160";
		  break;  
		default:
		  pictureSize = "http://module.griefconnections.com/AftercareJS/ecareLarge.png";
		  pictureWidth = "450";
		  pictureHeight = "240";
	}

	if (headerColor == null | headerColor == '')
	{
		headerColor = "#000000";
	}

	if (subHeaderColor == null | subHeaderColor == '')
	{
		subHeaderColor = "#000000";
	}

	document.write('<script type=\"text/javascript\">');
	document.write('');
	document.write('function launchEAftercare(){');
	document.write('window.open(\'http://module.griefconnections.com/?id='+guid+'\' ,\'eaftercare\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=600,top=200,left=200\');');
	document.write('}');
	document.write('');
	document.write('<\/script> ');	
	document.write('<!--[if lt IE 7.]>');
	document.write('<script defer type=\"text/javascript\" src=\"http://module.griefconnections.com/AftercareJS/pngfix.js\"><\/script>');
	document.write('<![endif]-->');
	document.write('<style type=\"text/css\">');
	document.write('label{');
	document.write('float: left;');
	document.write('width: 120px;');
	document.write('}');
	document.write('');
	document.write('input, textarea{');
	document.write('width: 180px;');
	document.write('margin-bottom: 5px;');
	document.write('}');
	document.write('');
	document.write('.boxes{');
	document.write('width: 1em;');
	document.write('}');
	document.write('');
	document.write('#submitbutton{');
	document.write('margin-left: 120px;');
	document.write('margin-top: 5px;');
	document.write('width: 80px;');
	document.write('}');
	document.write('');
	document.write('br{');
	document.write('clear: left;');
	document.write('}');
	document.write('');
	document.write('.AftercareHeader{');
	document.write(' font-family:Arial, Helvetica, sans-serif;');
	document.write(' color:'+headerColor+';');
	document.write(' font-size:16px;');
	document.write(' font-weight:bold;');	
	document.write('}');
	document.write('');
	document.write('.AftercareSubHeader{');
	document.write(' font-family:Arial, Helvetica, sans-serif;');
	document.write(' color:'+subHeaderColor+';');
	document.write(' font-size:11px;');
	document.write(' font-weight:bold;');	
	document.write('}');
	document.write('');
	document.write('</style>');  
	document.write('<span class=\"AftercareHeader\">E-Aftercare by '+fhName+'</span><br />');
	document.write('<span class=\"AftercareSubHeader\">Interactive Online Module | Online Counseling Services | Grief Forum</span>');
	document.write('<p><a href=\"#\" onClick=\"launchEAftercare()\"><img src="'+pictureSize+'" width="'+pictureWidth+'" height="'+pictureHeight+'" border=\"0\" /></a></p>');	
}


function emitForm(guid)
{		
   var fullUrl = window.location;
   var gcconfirm = location.search;	   
		
   if (gcconfirm == null | gcconfirm == '')
   {					
	if (document.getElementById('aspnetForm') != null)
	{
		document.getElementById('aspnetForm').action = 'http://module.griefconnections.com/functions/da_signup.gcx';
	}	

	document.write('<a name="dailyemails"></a>');
	document.write('<strong>Daily Grief Affirmations</strong><br />');            
	document.write('<p>When a loved one or friend dies, grieving that loss can take a long time, but you are not alone. Grief ');
	document.write('Connections is here with support groups, and now daily emails, that provide encouragement and reminders of the recovery process.</p>');
	document.write('<p><strong>To sign up</strong> for our daily emails, please enter your information below and click Submit.</p>');
		
	document.write('<form action=\"http://module.griefconnections.com/functions/da_signup.gcx\" method=\"post\" name=\"DailyEmails\" id=\"DailyEmails\" onsubmit=\"return validateForm(this);\">');
	document.write(' <input type=\"hidden\" name=\"c_gid\" value=\"'+guid+'\">');
	document.write(' <input type=\"hidden\" name=\"url_success\" value=\"'+ fullUrl +'?gcconfirm\">');
	
	document.write('<label for=\"user\">First Name:</label>');
	document.write('<input type=\"text\" name=\"first_name\" /><br />');
	document.write('<label for=\"user\">Last Name:</label>');
	document.write('<input type=\"text\" name=\"last_name\" /><br />');
	document.write('<label for=\"user\">E-Mail:</label>');
	document.write('<input type=\"text\" name=\"email\" /><br />');
	document.write('<label for=\"user\">Zip Code:</label>');
	document.write('<input type=\"text\" name=\"zip\" /><br />');
	document.write('<input type=\"submit\" name=\"submitbutton\" id=\"submitbutton\" value=\"Sign Up\" />');
	document.write('</form>');
	}
	else
	{
		document.write('Your email address has been added to the Daily Grief Affirmations newsletter succesfully.');
	}
	document.write('<p>We will never give, sell, rent or otherwise share your email or personal information with any other organization. Subscribing to our daily emails will not result in more spam (unwanted email).</p>');
}

function validateForm(form)
{
	var message;
	message ="";

	if(!form.elements["first_name"].value.length) message += "First Name\n";

	if(!form.elements["last_name"].value.length) message += "Last Name\n";

	if(!form.elements["email"].value.length) message += "Email\n";

	if(!form.elements["zip"].value.length) message += "Zip\n";

	if (message.length)
	{
		alert("Please fill in the following fields: \n\n" + message);
		return false;
	}
}


