function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function displayTxt()
{
	$offer_txt = document.getElementById('offercode').value;
	$offer_txt = $offer_txt.toLowerCase();
	
	switch($offer_txt)
	{
		case 'agd':
			$display_txt = '<strong>Welcome, AGD Member!</strong><br> Your code has been accepted. Get Started with CareCredit for only $20.';
			break;    
		case 'state':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'ada':
			$display_txt = '<strong>Welcome, ADA Member!</strong><br> Your code has been accepted. Get Started with CareCredit for only $20.';
			break;
		case 'invisalign':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'softdent':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'seattle study club':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'promo d':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'promo a':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'practiceworks':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'orthotrac':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'winoms':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'dentaltown':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'lvi':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'promo c':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'nda':
			$display_txt = '<strong>Welcome, NDA Member!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		case 'dental economics':
			$display_txt = '<strong>Thank you!</strong><br> Your code has been accepted. Get started with CareCredit for only $20.';
			break;
		default:
			$display_txt = 'You may have enter the offer code incorrectly. Please try again. <br><a href="javascript:location.reload(true);">Click here to re-try</a>';
	}
	
	document.getElementById('code1').style.display = "none";
	document.getElementById('code2').style.display = "none";
	document.getElementById('code3').style.display = "none";
	
	document.getElementById('code4').innerHTML = $display_txt;
	document.getElementById('code4').style.display = "block";
	
	setCookie('promo',$offer_txt,1);

}


