
var C_Widget = function() {
    /*function getChecked(radioObj) {
        for(var i = 0; i < radioObj.length; i++)
            if(radioObj[i].checked)
                return radioObj[i];
        return false;
    }*/
    
	var style = '<style type="text/css">@charset "utf-8";/* CSS Document */.campaignWidget { display:block; width:120px; background:url("http://campaignforosu.org/giving/widget/images/gradient.png") top left repeat-x #fff; font-family:Arial, Helvetica, sans-serif; font-weight:bold; border:2px solid #88746b; font-size:12pt; }.campaignWidget h5 { color:#fff; padding:10px 10px 5px 10px; text-align:center; margin:0; text-transform:uppercase; }.campaignWidget p { font-size:0.9em; text-align:center; color:#362f2d;  margin:0 0 -15px 0; padding:5px 8px 0 8px; }.campaignWidget form {	text-align:center; padding:15px 5px; margin:0; }.campaignWidget form select {	font-size:0.9em; margin:20px auto 10px auto; color:#67564e; 	padding:3px; 	width:80%; 	display:block; 	font-family:Georgia, "Times New Roman", Times, serif; 	font-weight:normal; 	border:2px solid #d1c5bf;	outline:1px solid #fff;}.campaignWidget #CW_submit {border:none;cursor:pointer;width:auto;}.campaignWidget .foot { background-color:#88746b; padding:3px 1px; margin:0; }.campaignWidget img { border:none; }</style>';
	var src = style + '<div class="campaignWidget"><h5>Support the</h5><p>College of Health and Human Sciences</p><form method="get" name="CW" action="http://campaignforosu.org/giving/online_gift.shtml"><input type="hidden" name="utm_source" value="College of Health and Human Sciences" /><input type="hidden" name="utm_medium" value="website" /><input type="hidden" name="utm_campaign" value="giving" /><input type="hidden" name="first_designation" value="Unrestricted Health and Human Sciences" /><select title="Select an amount to give:" name="first_amount">	<option value="200">$200</option>    <option value="100">$100</option>    <option value="50">$50</option>    <option value="20">$20</option>    <option value="">Other</option></select><input type="image" title="Submit" src="http://campaignforosu.org/giving/widget/images/gift_btn100.png" id="CW_submit" /></form><div class="foot"><a href="http://campaignforosu.org"><img src="http://campaignforosu.org/giving/widget/images/grey-campaign120.png" /></a></div></div>';

  	// print the widget.
    document.write(src);

	var submit = document.getElementById('CW_submit');
    var form = document.forms['CW'];
    
    // add effects for the submit button..
    var events = [[submit,'mousedown','-active'],[submit,'mouseover','-hover'],[submit,'mouseout',''],[window,'mouseup','']];
    for(x in events) {
        var e = events[x];
        e[0]['on' + e[1]] = (function (tail) {
            return function() {
                submit.src = submit.src.replace(/-[a-z]+/,'');
                submit.src = submit.src.replace(/\.png/,tail+'.png');
        }})(e[2]);
    }

    form.onsubmit = function() {
    	// validate
/*        if(!(c = form.elements['first_amount'].value)) { //getChecked(form.elements['first_amount']))) {
            alert('Please select an amount to give.');
            return false;
        } else if(c.value == 'other') {
            if(!(c.value = form.elements['first_amount_other'].value.replace(/[^0-9\.]+/,'')) || c.value=='') {
            	alert('Please enter an amount to give.');
                c.value = 'other';
                return false;
            }
        }*/
    }
}();