/* Few necessary prototype like functions required by subscription widget (which includes nothing else) */

var SpongecellElement = new Object();

SpongecellElement.update=function(element, html) {
    html = typeof html == 'undefined' ? '' : html.toString();
    document.getElementById(element).innerHTML=html;
    //$(element).innerHTML = html.stripScripts();
    //setTimeout(function() {html.evalScripts()}, 10);
    return element;
  };

function collect(a,f){var n=[];for(var i=0;i<a.length;i++){var v=f(a[i]);if(v!=null&&v.length>0)n.push(v)}return n};

var SpongecellForm = new Object();
SpongecellForm.serialize=function(f){
  var g=function(n) {return f.getElementsByTagName(n)};
  var nv=function(e) {
    if(e.name) return encodeURIComponent(e.name)+'='+encodeURIComponent(e.value);
    else return ''
  };
  var i=collect(g('input'),function(i){if((i.type!='radio'&&i.type!='checkbox')||i.checked)return nv(i)});
  var s=collect(g('select'),nv);var t=collect(g('textarea'),nv);
  return i.concat(s).concat(t).join('&');
};
SpongecellForm.jsSubmit=function(form) {
	var s = SpongecellForm.serialize(form);
	if(form.action.indexOf("?")>=0) {
		var delim="&"
	} else {
		var delim="?"
	}
	SpongecellForm.appendScript(form.action+delim+s);
};
SpongecellForm.appendScript = function(scriptSrc) {
    var headTag = document.getElementsByTagName('head')[0];
    var newScript = document.createElement('script');
    newScript.type = 'text/javascript';
    newScript.src = scriptSrc;headTag.appendChild(newScript);
};

document.write("<div id='spongecellSubscriptionContainer'></div>");
SpongecellElement.update("spongecellSubscriptionContainer", "\074div class=\"spongecellSubscriptionWidgetOutter\"\076\n  \074div class=\"spongecellSubscriptionWidget\" id=\"spongecellSubscriptionWidget\"\076\n    \074form action=\"http://spongecell.com/widget/subscription_confirm?crypt=9OcToy6aGF0cybzcgNLADKcAiNRufkXa7HIgiQLe1PVxR27qlmsSJ5xtXjil%0AWvRTZImc2PQvWmuGCtBcSZPC1g%3D%3D%0A\" id=\"subform\" method=\"post\" onsubmit=\"SpongecellForm.jsSubmit(this);return false;\"\076\n    \074fieldset\076\n      \074div class=\"warning\" id=\"spongecellWarning\"\076\074/div\076\n      \074!-- = find_and_preserve hidden_encrypted_params({:contact_list_id=\076@contact_list.id,:calendar_id=\076calendar_id},{}) --\076\n      \074!-- hidden_encrypted_params({:contact_list_id=\076@contact_list.id},{}) --\076\n      \074!-- hidden_encrypted_params({:calendar_id=\076calendar_id},{}) --\076\n      \074legend\076\n        Subscribe to the\n        \074b\076\n          PL Solutions\n        \074/b\076\n        mailing list\n      \074/legend\076\n      \074div class=\"emailAddress\"\076\n        \074label for=\"contact_primary_email_address\"\076Email Address\074/label\076\n        \074input id=\"contact_primary_email_address\" name=\"contact[primary_email_address]\" size=\"30\" type=\"text\" /\076\n      \074/div\076\n      \074div class=\"phoneNumber\"\076\n        \074label for=\"contact_phone_number\"\076Phone Number\074/label\076\n        \074input id=\"contact_phone_number\" name=\"contact[phone_number]\" size=\"30\" type=\"text\" /\076\n      \074/div\076\n      \074div class=\"firstName\"\076\n        \074label for=\"contact_first_name\"\076First Name\074/label\076\n        \074input id=\"contact_first_name\" name=\"contact[first_name]\" size=\"30\" type=\"text\" /\076\n      \074/div\076\n      \074div class=\"lastName\"\076\n        \074label for=\"contact_last_name\"\076Last Name\074/label\076\n        \074input id=\"contact_last_name\" name=\"contact[last_name]\" size=\"30\" type=\"text\" /\076\n      \074/div\076\n      \074div\076\n        \074label\076&nbsp;\074/label\076\n        \074input id=\"submit_button\" name=\"commit\" type=\"submit\" value=\"Submit\" /\076\n      \074/div\076\n      \074br /\076\n      \074div id=\"privacy_policy\"\076\n        * By submitting, you agree to the Spongecell\n        \074a href=\"http://spongecell.com/legal/privacy\" class=\"privacyPolicy\" target=\"_blank\"\076Privacy Policy\074/a\076\n      \074/div\076\n    \074/fieldset\076\n    \074/form\076\n    \074style type=\"text/css\"\076\n      .spongecellSubscriptionWidget form, fieldset { \n      margin: 0; \n      padding: 0; \n      }\n      \n      .spongecellSubscriptionWidget form label { \n      cursor: pointer; \n      }\n      \n      .spongecellSubscriptionWidget form { \n        /* you can to specify a width here */\n      } \n      \n      .spongecellSubscriptionWidget fieldset { \n      border: none; \n      border:  1px solid #ccc; \n      margin:  2em 0; \n      padding:  1em;    \n      } \n      \n      .spongecellSubscriptionWidget legend {\n      padding: 0.2em 0.5em;\n      border: 1px solid #ccc;\n      text-align: right;\n      font-size: 1.1em;\n      margin-bottom: .5em;\n      } \n      \n      .spongecellSubscriptionWidget label { \n      display:  block; \n      float:  left; \n      clear:  left; \n      width:  8em; \n      padding-right:  1em; \n      text-align:  right; \n      line-height:  1.8em; \n      } \n      \n      .spongecellSubscriptionWidget input, select { \n      margin:  0 0 .5em 0; \n      width:  14.5em;\n      display:  block; \n      float:  left; \n      }\n      \n      .spongecellSubscriptionWidget #contact_birthday_1i { \n      width:  5em;\n      }\n      .spongecellSubscriptionWidget #contact_birthday_2i { \n      width:  6.5em;\n      }\n      .spongecellSubscriptionWidget #contact_birthday_3i { \n      width:  3.5em;\n      }\n      \n      .spongecellSubscriptionWidget #contact_zip_code { \n      width:  5em;\n      }\n      \n      .spongecellSubscriptionWidget #contact_gender { \n      width:  6em;\n      }\n      \n      .spongecellSubscriptionWidget #submit_button {\n      width: 5em;\n      margin: 0 0\n      }\n      \n      .spongecellSubscriptionWidget br {\n      clear:both;\n      }\n      \n      .spongecellSubscriptionWidget #spongecellWarningText {\n      background-image: none;\n      border: 1px solid gray;\n      margin-bottom: 0.8em;\n      padding: 0.3em 0.6em;\n      }\n      \n      .spongecellSubscriptionWidget #spongecellWarningText.error {\n      background: #FFFF00; /*yellow*/\n      color: black;\n      }\n      \n      .spongecellSubscriptionWidget #spongecellWarningText.success {\n      background: #78DAFA; /*aqua*/\n      color: black;\n      }\n      \n      .spongecellSubscriptionWidget #privacy_policy {\n      margin-left:11em;\n      font-size:.8em;\n      color:gray;\n      }\n    \074/style\076\n  \074/div\076\n\074/div\076\n");