function rewrite_cost() {
	var cost = document.getElementById("groom_widget_input").value;
	cost=cost.replace(/,/g,"");
	cost=cost.replace(/\s/g,"");
	cost = parseInt(cost / 6);
	cost += "";
	document.getElementById("groom_widget5").value = "$" + cost;
}

var html = '<style type="text/css"><!--';
html += '#groom_widget{';
html += 'background-image:url(http://www.groomgroove.com/images/widget.png);';
html += 'background-position:top;';
html += 'background-repeat:no-repeat;';
html += 'height:250px;';
html += 'width:214px;';
html += 'font-family:Arial;';
html += 'margin:0;padding:0;';
html += '}';
html += '#groom_widget1{';
html += 'color:#9DCCFF;';
html += 'font-size:12px;';
html += 'font-weight:bold;';
html += 'padding:20px 5px 0 0;';
html += 'text-align:right;';
html += '}';
html += '#groom_widget2{';
html += 'color:#fff;';
html += 'font-size:14px;';
html += 'font-weight:bold;';
html += 'text-align:left;';
html += 'padding:0px 0 0 10px;';
html += '}';
html += '#groom_widget3{';
html += 'color:#9DCCFF;';
html += 'font-size:18px;';
html += 'font-weight:bold;';
html += 'text-align:right;';
html += '}';
html += '#groom_widget_input{';
html += 'width:75px;';
html += 'color:#a00;';
html += 'border:2px solid #9DCCFF;';
html += 'font-size:16px;';
html += 'font-weight:bold;';
html += 'padding:2px;';
html += 'background-color:#fff;';
html += 'margin-right:5px;';
html += '}';
html += '#groom_widget_go{';
html += 'color:#a00;';
html += 'border:2px solid #9DCCFF;';
html += 'font-weight:bold;';
html += 'font-size:16px;';
html += 'padding:1px;';
html += 'background-color:#fff;';
html += 'margin:5px 5px 0 0;';
html += '}';
html += '#groom_widget4{';
html += 'color:#fff;';
html += 'font-size:10px;';
html += 'text-align:left;';
html += 'padding:45px 0 0 5px;';
html += '}';
html += '#groom_widget5{';
html += 'color:#a00;';
html += 'font-size:18px;';
html += 'font-weight:bold;';
html += 'border:none;';
html += 'background:none;';
html += 'width:125px;';
html += '}';
html += '#groom_widget6{';
html += 'color:#fff;';
html += 'font-size:10px;';
html += 'text-align:left;';
html += 'padding:5px 0 0 10px;';
html += '}';
html += '#groom_widget6 a, #groom_widget6 a:visited{';
html += 'color:#9DCCFF;';
html += 'text-decoration:none;';
html += '}';
html += '--></style>';
html += '<table id="groom_widget" cellpadding="0" cellspacing="0">';
html += '<tr>';
html += '<td>';
html += '<div id="groom_widget1">Diamond Engagement<br />Ring Calculator</div>';
html += '<div id="groom_widget2">Enter your annual salary:</div>';
html += '<div id="groom_widget3">$<input type="text" id="groom_widget_input" /><br /><input type="submit" id="groom_widget_go" value="Go" onClick="rewrite_cost()" /></div>';
html += '<div id="groom_widget4">Tradition holds that you <em>should</em> spend</div>';
html += '<div style="text-align:center;"><input type="text" id="groom_widget5" /></div>';
html += '<div id="groom_widget6">Seem like a fortune?  Read more about <a href="http://www.groomgroove.com/the_engagement/two_months_salary_on_diamond_engagement_ring.php" target="_blank">buying a diamond engagement ring</a>.</div>';
html += '</td>';
html += '</tr>';
html += '</table>';

document.write(html);
