/*
   This JavaScript code was generated by Jemplate, the JavaScript
   Template Toolkit. Any changes made to this file will be lost the next
   time the templates are compiled.

   Copyright 2006 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['contact_card_mydate.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable Tall">\n<thead>\n	<tr>\n		<th style="width:114px;">Label</th>\n		<th style="width:172px;">Date</th>\n	</tr>\n</thead>\n<tbody id="mydateList" class="contactsCardTableBody Tall">\n<tr>\n	<td class="nobd"><span class="cardfld hilite">Birthday</span></td>\n	<td class="nobd"><input type="text" value="';
//line 11 "contact_card_mydate.tt2"
if (stash.get(['contact', 0, 'birthday', 0])) {
//line 11 "contact_card_mydate.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'birthday', 0]);

    return context.filter(output, 'html', []);
})();

}

output += '" size="24" name="contact_birthday_';
//line 11 "contact_card_mydate.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld carddate hilite" style="border: none;" /></td>\n</tr>\n';
//line 18 "contact_card_mydate.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'mydates', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['mydate'] = value;
output += '\n<tr>\n	<td class="nobd"><span id="mydate_label_';
//line 15 "contact_card_mydate.tt2"
output += stash.get(['mydate', 0, 'id', 0]);
output += '" class="lblpop cardfld">';
//line 15 "contact_card_mydate.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['mydate', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobd"><input type="text" value="';
//line 16 "contact_card_mydate.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['mydate', 0, 'mydate', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="24" name="mydate_mydate_';
//line 16 "contact_card_mydate.tt2"
output += stash.get(['mydate', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld carddate hilite" style="border: none;" /></td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_main.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div id="autosave" style="float:right;display: none;"> Auto-saving...</div>\n<div id="tab_container">\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_1" class="tabbed_pane_tab selected_tab" style="width: 100px;" onclick="do_select(\'1\');">Name &amp; Phones</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_2" class="tabbed_pane_tab" onclick="do_select(\'2\');">Email &amp; IM</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_3" class="tabbed_pane_tab" onclick="do_select(\'3\');">Addresses</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_4" class="tabbed_pane_tab" onclick="do_select(\'4\');">Dates</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_5" class="tabbed_pane_tab" onclick="do_select(\'5\');">Other</div>\n	<div class="tabbed_pane_tab tab_spacer" style="width:90px;" ></div>\n</div>\n\n<form name="editContact" method="post" action="" onsubmit="return false;">\n<input type="hidden" name="theUrl" value="" />\n<input type="hidden" name="theScroll" value="" />\n<div id="card_box_container">\n	<div id="box_1" class="card_box">\n		<table class="card_table">\n		<tr>\n			<td class="cardlbl">\n				First Name:\n			</td>\n			<td class="cardfld">\n				<input type="text" value="';
//line 27 "contact_card_main.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'given', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" maxlength="100" name="contact_given_';
//line 27 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" class="cardfld" style="width:200px;" />\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl">\n				Last Name:\n			</td>\n			<td class="cardfld">\n				<input type="text" value="';
//line 35 "contact_card_main.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'family', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" maxlength="100" name="contact_family_';
//line 35 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" class="cardfld" style="width:200px;" />\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl">\n				Middle Name(s):\n			</td>\n			<td class="cardfld">\n				<input type="text" value="';
//line 43 "contact_card_main.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'middle', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" maxlength="100" name="contact_middle_';
//line 43 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" class="cardfld" style="width:200px;" />\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl">\n				Title (Mr/Mrs):\n			</td>\n			<td class="cardfld">\n				<input type="text" value="';
//line 51 "contact_card_main.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'prefixes', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="10" maxlength="100" name="contact_prefixes_';
//line 51 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" class="cardfld" style="width:60px;" />\n				<span style="width:67px;display:inline-block;text-align:right;" >Suffix:</span>\n				<input type="text" value="';
//line 53 "contact_card_main.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'suffixes', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="10" maxlength="100" name="contact_suffixes_';
//line 53 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" class="cardfld" style="width:60px;" />\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl">&nbsp;\n			</td>\n			<td class="cardfld">\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl topalign">\n				Phone Numbers:\n			</td>\n			<td class="cardfld">\n				<div id="phoneListDiv" class="contactsCardTable"> <!-- this makes the scrollbars work in safari -->\n				';
//line 68 "contact_card_main.tt2"
output += context.include('contact_card_phone.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'phone\', ';
//line 72 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" >Add</div>\n				<div class="remove link" onclick="delItem(\'phone\'); return false;" >Remove</div>\n			</td>\n		</tr>\n		</table>\n	</div>\n\n	<div id="box_2" class="card_box hidden">\n		<table class="card_table">\n		<tr>\n			<td class="cardlbl topalign">\n				Email Addresses:\n			</td>\n			<td class="cardfld">\n				<div id="emailListDiv" class="contactsCardTable"> <!-- this makes the scrollbars work in safari -->\n				';
//line 87 "contact_card_main.tt2"
output += context.include('contact_card_email.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'email\', ';
//line 91 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" style="margin-top:10px;" >Add</div>\n				<div class="remove link" onclick="delItem(\'email\'); return false;">Remove</div>\n			</td>\n		</tr>\n		<tr>\n			<td class="cardlbl topalign">\n				IM Identities:\n			</td>\n			<td class="cardfld">\n				<div id="imListDiv" class="contactsCardTable"> <!-- this makes the scrollbars work in safari -->\n				';
//line 101 "contact_card_main.tt2"
output += context.include('contact_card_im.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'im\', ';
//line 105 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" style="margin-top:10px;" >Add</div>\n				<div class="remove link" onclick="delItem(\'im\'); return false;">Remove</div>\n			</td>\n		</tr>\n		</table>\n	</div>\n	<div id="box_3" class="card_box hidden">\n		<table class="card_table">\n		<tr>\n			<td class="cardlbl topalign">\n				Addresses:\n			</td>\n			<td class="cardfld">\n				<div id="addressListDiv" class="contactsCardTable Tall"> <!-- this makes the scrollbars work in safari -->\n				';
//line 119 "contact_card_main.tt2"
output += context.include('contact_card_address.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'address\', ';
//line 123 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" style="margin-top:10px;" >Add</div>\n				<div class="remove link" onclick="delItem(\'address\'); return false;">Remove</div>\n			</td>\n		</tr>\n		</table>		\n	</div>\n	<div id="box_4" class="card_box hidden">\n		<table class="card_table">\n		<tr>\n			<td class="cardlbl topalign">\n				Dates:\n			</td>\n			<td class="cardfld">\n				<div id="mydateListDiv" class="contactsCardTable Tall"> <!-- this makes the scrollbars work in safari -->\n				';
//line 137 "contact_card_main.tt2"
output += context.include('contact_card_mydate.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'mydate\', ';
//line 141 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" style="margin-top:10px;" >Add</div>\n				<div class="remove link" onclick="delItem(\'mydate\'); return false;">Remove</div>\n			</td>\n		</tr>\n		</table>\n	</div>\n	<div id="box_5" class="card_box hidden">\n		<table class="card_table">\n		<tr>\n			<td class="cardlbl topalign">\n				Other info:\n			</td>\n			<td class="cardfld">\n				<div id="otherListDiv" class="contactsCardTable Tall"> <!-- this makes the scrollbars work in safari -->\n				';
//line 155 "contact_card_main.tt2"
output += context.include('contact_card_other.tt2');
output += '\n				</div>\n			</td>\n			<td>\n				<div class="add link" onclick="addItem(\'other\', ';
//line 159 "contact_card_main.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += ');" style="margin-top:10px;" >Add</div>\n				<div class="remove link" onclick="delItem(\'other\'); return false;">Remove</div>\n			</td>\n		</tr>\n		</table>\n	</div>\n</div><!-- end card_box_container -->\n</form>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_address.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable Tall">\n<thead>\n	<tr>\n		<th>Label</th>\n		<th></th>\n		<th style="width:198px;">Address</th>\n	</tr>\n</thead>\n<tbody id="addressList" class="contactsCardTableAddress Tall">\n';
//line 42 "contact_card_address.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'addresses', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['address'] = value;
output += '\n<tr id="address_street_';
//line 11 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n	<td class="nobdb"><span id="address_label_';
//line 12 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" class="lblpop cardfld">';
//line 12 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobdb grey">Street</td>\n	<td class="nobdb"><input type="textarea" value="';
//line 14 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'street', 0]);

    return context.filter(output, 'html_line_break', []);
})();

output += '" size="30" name="address_street_';
//line 14 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" />\n	';
//line 15 "contact_card_address.tt2"
if (stash.get(['address', 0, 'pobox', 0])) {
//line 15 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'pobox', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br></br>';
}

output += '\n	</td>\n</tr>\n<tr id="address_city_';
//line 18 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n	<td class="nobdb"></td>\n	<td class="nobdb grey">City</td>\n	<td class="nobdb"><input type="text" value="';
//line 21 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'city', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="address_city_';
//line 21 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" />\n	</td>\n</tr>\n<tr id="address_region_';
//line 24 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n	<td class="nobdb"></td>\n	<td class="nobdb grey">State/County</td>\n	<td class="nobdb"><input type="text" value="';
//line 27 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'region', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="address_region_';
//line 27 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" />\n	</td>\n</tr>\n<tr id="address_postalcode_';
//line 30 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n	<td class="nobdb"></td>\n	<td class="nobdb grey">Zip/Post code</td>\n	<td class="nobdb"><input type="text" value="';
//line 33 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'postalcode', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="address_postalcode_';
//line 33 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" />\n	</td>\n</tr>\n<tr id="address_country_';
//line 36 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n	<td class="nobd"></td>\n	<td class="nobd grey">Country</td>\n	<td class="nobd"><input type="text" value="';
//line 39 "contact_card_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'country', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="address_country_';
//line 39 "contact_card_address.tt2"
output += stash.get(['address', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" />\n	</td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_im.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable">\n<thead>\n	<tr>\n		<th style="width: 26px;">Main</th>\n		<th style="width: 77px;">Label</th>\n		<th style="width:168px;">Address</th>\n	</tr>\n</thead>\n<tbody class="contactsCardTableBody" id="imList">\n';
//line 16 "contact_card_im.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'ims', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['im'] = value;
output += '\n<tr>\n	<td class="nobd"><input type="radio" name="im_pref_a" value="';
//line 12 "contact_card_im.tt2"
output += stash.get(['im', 0, 'id', 0]);
output += '" class="cardfld nobd hilite" ';
//line 12 "contact_card_im.tt2"
if (stash.get(['im', 0, 'pref', 0]) == 1) {
output += 'checked="checked" ';
}

output += '/></td>\n	<td class="nobd"><span id="im_label_';
//line 13 "contact_card_im.tt2"
output += stash.get(['im', 0, 'id', 0]);
output += '" class="lblpop cardfld">';
//line 13 "contact_card_im.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['im', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobd"><input type="text" value="';
//line 14 "contact_card_im.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['im', 0, 'im', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="25" name="im_im_';
//line 14 "contact_card_im.tt2"
output += stash.get(['im', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['code_random.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 6 "code_random.tt2"
if (stash.get('error_msg')) {
output += ' \n<span class="error">';
//line 2 "code_random.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get('error_msg');

    return context.filter(output, 'html', []);
})();

output += '</span>\n';
}
else {
output += ' \n<b>SUCCESS! Your personal O-CODE is: <span id="randomocode">';
//line 4 "code_random.tt2"
output += stash.get('code');
output += '</span></b><br />\n';
//line 5 "code_random.tt2"
if (stash.get('confirmed') == 0) {
output += '<a href="" onclick="code_confirm(\'random\'); return false;">Click here</a> to confirm this as your new o-code.';
}

output += '\n';
}

output += ' \n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['edit_address.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 3 "edit_address.tt2"
if (stash.get('error')) {
output += '\n <p class="error">';
//line 2 "edit_address.tt2"
output += stash.get('error');
output += '</p>\n';
}

output += '\n';
//line 70 "edit_address.tt2"
if (stash.get('view_only')) {
output += '\n<b>';
//line 5 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'location', 0]);

    return context.filter(output, 'html', []);
})();

output += '</b>\n<a href="';
//line 1 "edit_address.tt2"
output += stash.get(['c', 0, 'uri_for', [ '/address/edit/' + stash.get(['address', 0, 'id', 0]) ]]);
output += '"\n   onclick="show_address_edit_form(';
//line 7 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '); return false;">Edit</a>\n<a href="';
//line 1 "edit_address.tt2"
output += stash.get(['c', 0, 'uri_for', [ '/address/delete/' + stash.get(['address', 0, 'id', 0]) ]]);
output += '">Delete</a>\n<br />\n<div class="address" id="address_';
//line 10 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n  <address>\n	';
//line 12 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '\n	';
//line 13 "edit_address.tt2"
if (stash.get(['address', 0, 'pobox', 0])) {
//line 13 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'pobox', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n		';
//line 14 "edit_address.tt2"
if (stash.get(['address', 0, 'street', 0])) {
//line 14 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'street', 0]);

    return context.filter(output, 'html_line_break', []);
})();

output += '<br />';
}

output += '\n		';
//line 15 "edit_address.tt2"
if (stash.get(['address', 0, 'city', 0])) {
//line 15 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'city', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n		';
//line 16 "edit_address.tt2"
if (stash.get(['address', 0, 'region', 0])) {
//line 16 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'region', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n		';
//line 17 "edit_address.tt2"
if (stash.get(['address', 0, 'postalcode', 0])) {
//line 17 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'postalcode', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n		';
//line 18 "edit_address.tt2"
if (stash.get(['address', 0, 'country', 0])) {
//line 18 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'country', 0]);

    return context.filter(output, 'html', []);
})();

}

output += '</address>\n</div>\n';
}
else {
output += '\n\n<!-- Generated by CGI::FormBuilder v3.0501 available from www.formbuilder.org -->\n<form action="';
//line 23 "edit_address.tt2"
output += stash.get(['address', 0, 'uri_for', 0]);
output += '" id="address_edit" method="post" name="address_edit" onsubmit="return validate_address_edit(this);">\n<div id="address_edit_state"><input id="_submitted_address_edit" name="_submitted_address_edit" type="hidden" value="1" /></div>\n<table id="address_edit_body">\n<tr id="address_edit_label_row" valign="top">\n  <td id="address_edit_label_label"><b>Label</b></td>\n  <td id="address_edit_label_field"><select id="label" name="label" onchange="if (this.selectedIndex + 1 == this.options.length) { fb_other_on(\'_other_label\') } else { fb_other_off(\'_other_label\') }">\n  <option value="">-select-</option>\n  <option selected="selected" value="Home">Home</option>\n  <option value="Work">Work</option>\n\n  <option value="Mobile">Mobile</option>\n  <option value="_other_label">Other:</option>\n  </select> <input disabled="disabled" id="_other_label" name="_other_label" type="text" /></td>\n</tr>\n<tr id="address_edit_pobox_row" valign="top">\n  <td id="address_edit_pobox_label">PO Box</td>\n  <td id="address_edit_pobox_field"><input id="pobox" name="pobox" size="20" type="text" /></td>\n</tr>\n\n<tr id="address_edit_street_row" valign="top">\n  <td id="address_edit_street_label">Street</td>\n  <td id="address_edit_street_field"><textarea cols="60" id="street" name="street" rows="3">';
//line 44 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'street', 0]);

    return context.filter(output, 'html', []);
})();

output += '</textarea></td>\n</tr>\n<tr id="address_edit_city_row" valign="top">\n  <td id="address_edit_city_label">City</td>\n  <td id="address_edit_city_field"><input id="city" name="city" size="50" type="text" value="';
//line 48 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'city', 0]);

    return context.filter(output, 'html', []);
})();

output += '" /></td>\n</tr>\n<tr id="address_edit_region_row" valign="top">\n  <td id="address_edit_region_label">State/County</td>\n\n  <td id="address_edit_region_field"><input id="region" name="region" size="50" type="text" value="" /></td>\n</tr>\n<tr id="address_edit_postalcode_row" valign="top">\n  <td id="address_edit_postalcode_label">Zip/Postal Code</td>\n  <td id="address_edit_postalcode_field"><input id="postalcode" name="postalcode" size="10" type="text" value="';
//line 57 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'postalcode', 0]);

    return context.filter(output, 'html', []);
})();

output += '" /></td>\n</tr>\n<tr id="address_edit_country_row" valign="top">\n  <td id="address_edit_country_label">Country</td>\n  <td id="address_edit_country_field"><input id="country" name="country" size="8" type="text" value="';
//line 61 "edit_address.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'country', 0]);

    return context.filter(output, 'html', []);
})();

output += '" /></td>\n</tr>\n\n<tr id="address_edit_submit_row" valign="top">\n  <td align="center" colspan="2" id="address_edit_submit_field"><input id="address_edit_submit" name="_submit" type="submit" value="Submit" /></td>\n</tr>\n</table>\n</form>\n\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_email.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable">\n<thead>\n	<tr>\n		<th style="width: 26px;">Main</th>\n		<th style="width: 77px;">Label</th>\n		<th style="width:168px;">Address</th>\n	</tr>\n</thead>\n<tbody id="emailList" class="contactsCardTableBody">\n';
//line 16 "contact_card_email.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'emails', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['email'] = value;
output += '\n<tr>\n	<td class="nobd"><input type="radio" name="email_pref_a" value="';
//line 12 "contact_card_email.tt2"
output += stash.get(['email', 0, 'id', 0]);
output += '" class="cardfld nobd hilite" ';
//line 12 "contact_card_email.tt2"
if (stash.get(['email', 0, 'pref', 0]) == 1) {
output += 'checked="checked" ';
}

output += '/></td>\n	<td class="nobd"><span id="email_label_';
//line 13 "contact_card_email.tt2"
output += stash.get(['email', 0, 'id', 0]);
output += '" class="lblpop cardfld">';
//line 13 "contact_card_email.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobd"><input type="text" value="';
//line 14 "contact_card_email.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'email', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="25" name="email_email_';
//line 14 "contact_card_email.tt2"
output += stash.get(['email', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_phone.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable">\n<thead>\n	<tr>\n		<th>Main</th>\n		<th style="width: 77px;">Label</th>\n		<th style="width:177px;">Number</th>\n	</tr>\n</thead>\n<tbody id="phoneList" class="contactsCardTableBody">\n';
//line 16 "contact_card_phone.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'phones', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['phone'] = value;
output += '\n<tr>\n	<td class="nobd"><input type="radio" name="phone_pref_a" value="';
//line 12 "contact_card_phone.tt2"
output += stash.get(['phone', 0, 'id', 0]);
output += '" class="cardfld nobd hilite" ';
//line 12 "contact_card_phone.tt2"
if (stash.get(['phone', 0, 'pref', 0]) == 1) {
output += 'checked="checked" ';
}

output += '/></td>\n	<td class="nobd"><span id="phone_label_';
//line 13 "contact_card_phone.tt2"
output += stash.get(['phone', 0, 'id', 0]);
output += '" class="lblpop cardfld hilite">';
//line 13 "contact_card_phone.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobd"><input type="text" value="';
//line 14 "contact_card_phone.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'phone', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="20" name="phone_phone_';
//line 14 "contact_card_phone.tt2"
output += stash.get(['phone', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['edit_contact.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 112 "edit_contact.tt2"
if (stash.get('error')) {
output += '\n<div id="contactLayer">\n<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n<div style="float:left;">An error occurred</div>\n<div style="float:right;"><a href="javascript:close_contact()">[X]</a></div>\n&nbsp;\n</div>\n';
//line 9 "edit_contact.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="contactLayer">\n<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n<div style="float:left;">';
//line 14 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'name', 0]);

    return context.filter(output, 'html', []);
})();

output += '</div>\n<div style="float:right;">\n<a href="';
//line 16 "edit_contact.tt2"
output += stash.get(['contact', 0, 'baseUrl', 0]);
output += 'contact/view/';
//line 16 "edit_contact.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" onclick="view_contact(';
//line 16 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '); return false;">[ cancel ]</a>\n<a href="';
//line 17 "edit_contact.tt2"
output += stash.get(['contact', 0, 'baseUrl', 0]);
output += 'contact/view/';
//line 17 "edit_contact.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" onclick="save_contact(';
//line 17 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '); return false;">[ save ]</a>\n</div>\n&nbsp;\n</div>\n\n<div id="tab_container">\n	<div id="tab_1" class="tabbed_pane_tab selected_tab" style="width: 100px;" onclick="do_select(\'1\');">Name &amp; Phones</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_2" class="tabbed_pane_tab" onclick="do_select(\'2\');">Email &amp; IM</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_3" class="tabbed_pane_tab" onclick="do_select(\'3\');">Addresses</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_4" class="tabbed_pane_tab" onclick="do_select(\'4\');">Dates</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_5" class="tabbed_pane_tab" onclick="do_select(\'5\');">Other</div>\n</div>\n\n<form name="editContact" method="post" action="';
//line 34 "edit_contact.tt2"
output += stash.get(['contact', 0, 'baseUrl', 0]);
output += 'contact/save/';
//line 34 "edit_contact.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '">\n<input type="hidden" name="theUrl" value="" />\n<input type="hidden" name="theScroll" value="" />\n<div id="card_box_container">\n	<div id="box_1" class="card_box">\n		<table border="0" cellspacing="5" id="contactTable">\n		<tr>\n			<th></th>\n			<th>\n				<input type="text" value="';
//line 43 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'given', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="given" maxlength="100" id="given" />\n				<input type="text" value="';
//line 44 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'family', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="family" maxlength="100" id="family" />\n			</th>\n		</tr>\n		';
//line 53 "edit_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'phones', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['phone'] = value;
output += '\n		<tr>\n			<td>';
//line 49 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n			<td><input type="text" value="';
//line 50 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'phone', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="phone_';
//line 50 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '" maxlength="100" /></td>\n			<td class="link" onclick="Dom.remove(parentNode); return false;">delete</td>\n		</tr>\n		';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n		<tr>\n			<td></td>\n			<td></td>\n			<td class="link" onclick="addElement(\'contactTable\');">add phone</td>\n		</tr>\n		</table>\n	</div>\n\n	<div id="box_2" class="card_box hidden">\n		<table border="0" cellspacing="5">\n		';
//line 70 "edit_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'emails', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['email'] = value;
output += '\n		<tr>\n			<td>';
//line 66 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n			<td><input type="text" value="';
//line 67 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'email', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" name="email_';
//line 67 "edit_contact.tt2"
output += stash.get(['email', 0, 'id', 0]);
output += '" maxlength="100" /></td>\n			<td class="link" onclick="Dom.remove(parentNode); return false;">delete</td>\n		</tr>\n		';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n		<tr>\n			<td></td>\n			<td></td>\n			<td class="link" onclick="addElement(\'contactTable\');">add email</td>\n		</tr>\n		</table>\n	</div>\n	<div id="box_3" class="card_box hidden">\n		';
//line 91 "edit_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'addresses', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['address'] = value;
output += '\n		<div class="address" id="address_';
//line 80 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '">\n		  <address>\n			';
//line 82 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '\n			';
//line 83 "edit_contact.tt2"
if (stash.get(['address', 0, 'pobox', 0])) {
//line 83 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'pobox', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br></br>';
}

output += '\n				';
//line 84 "edit_contact.tt2"
if (stash.get(['address', 0, 'street', 0])) {
//line 84 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'street', 0]);

    return context.filter(output, 'html_line_break', []);
})();

output += '<br />';
}

output += '\n				';
//line 85 "edit_contact.tt2"
if (stash.get(['address', 0, 'city', 0])) {
//line 85 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'city', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n				';
//line 86 "edit_contact.tt2"
if (stash.get(['address', 0, 'region', 0])) {
//line 86 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'region', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n				';
//line 87 "edit_contact.tt2"
if (stash.get(['address', 0, 'postalcode', 0])) {
//line 87 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'postalcode', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br />';
}

output += '\n				';
//line 88 "edit_contact.tt2"
if (stash.get(['address', 0, 'country', 0])) {
//line 88 "edit_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'country', 0]);

    return context.filter(output, 'html', []);
})();

}

output += '\n		  </address>\n		</div>\n		';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n	</div>\n	<div id="box_4" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n		</table>\n	</div>\n	<div id="box_5" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n		</table>\n	</div>\n</div><!-- end card_box_container -->\n</form>\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['code_custom.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 29 "code_custom.tt2"
if (stash.get('error_msg')) {
output += ' \n<span class="error">';
//line 2 "code_custom.tt2"
output += stash.get('error_msg');
output += '</span>\n';
}
else {
output += '\n';
//line 28 "code_custom.tt2"
if (stash.get('confirmed') == 1) {
output += '\n<b>SUCCESS! Your new O-CODE is: "';
//line 5 "code_custom.tt2"
output += stash.get('code');
output += '".</b><br />\n';
}
else {
output += '\n<b>SUCCESS! The O-CODE "';
//line 7 "code_custom.tt2"
output += stash.get('code');
output += '" is available.</b><br />\n';
//line 27 "code_custom.tt2"
if (stash.get('paid') == 1) {
output += '\n	<a href="" onclick="code_confirm(\'custom\'); return false;">Click here</a> to confirm this as your new o-code.\n';
}
else {
output += '\n	<form action="';
//line 11 "code_custom.tt2"
output += stash.get('paypal_url');
output += '" method="post">\n	<input type="hidden" name="business" value="';
//line 12 "code_custom.tt2"
output += stash.get('business');
output += '" />\n\n	<p style="margin-top:0px;margin-bottom:8px;">\n	<a href="codehelp"><img src="';
//line 15 "code_custom.tt2"
output += stash.get(['c', 0, 'uri_for', [ '/' ]]);
output += 'static/images/info.png" style="margin-left:-24px;margin-bottom:-4px;" alt="Help?" /></a>\n\n	';
//line 19 "code_custom.tt2"

// FOREACH 
(function() {
    var list = stash.get(['button_OC1', 0, 'keys', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['key'] = value;
output += '\n	<input type="hidden" name="';
//line 18 "code_custom.tt2"
output += stash.get('key');
output += '" value="';
//line 18 "code_custom.tt2"
output += stash.get(['button_OC1', 0, stash.get('key'), 0]);
output += '" />\n	';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n	\n	<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - buy now" \n		style="border:0px;margin:4px 2px -8px -4px;padding:0px;" />\n	<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">\n	Custom code price: <b>US $';
//line 24 "code_custom.tt2"
output += stash.get(['button_OC1', 0, 'amount', 0]);
output += '</b>\n	</p>\n	</form>\n';
}

output += '\n';
}

output += '\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 20 "contact_card.tt2"
if (stash.get('error')) {
output += '\n<div id="contactLayer">\n	<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n		<div style="float:left;">An error occurred</div>\n		<div style="float:right;"><a href="javascript:close_contact()">[X]</a></div>\n		&nbsp;\n	</div>\n	';
//line 9 "contact_card.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="contactLayer">\n	<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n		<div style="float:left;" id="cardName">';
//line 14 "contact_card.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'name', 0]);

    return context.filter(output, 'html', []);
})();

output += '</div>\n		<div style="float:right;"><a href="javascript:close_contact()">[X]</a></div>\n		&nbsp;\n	</div>\n	';
//line 18 "contact_card.tt2"
output += context.include('contact_card_main.tt2');
output += '\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['code_info.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += 'Your O-CODE is:<br />\n<span id="userocode" style="font-size: ';
//line 2 "code_info.tt2"
output += (250 / (stash.get(['code', 0, 'length', 0]) + 2)) - 3;
output += 'px;">';
//line 2 "code_info.tt2"
output += stash.get('code');
output += '</span>\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['contact_card_other.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<table class="contact contactsCardTable Tall" >\n<thead>\n	<tr>\n		<th style="width: 92px;">Label</th>\n		<th style="width:194px;"></th>\n	</tr>\n</thead>\n<tbody id="otherList" class="contactsCardTableBody Tall">\n<tr>\n	<td class="nobd"><span class="cardfld hilite">Company</span></td>\n	<td class="nobd"><input type="text" value="';
//line 11 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'company', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="28" name="contact_company_';
//line 11 "contact_card_other.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n<tr>\n	<td class="nobd"><span class="cardfld hilite">Department</span></td>\n	<td class="nobd"><input type="text" value="';
//line 15 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'department', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="28" name="contact_department_';
//line 15 "contact_card_other.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n<tr>\n	<td class="nobd"><span class="cardfld hilite">Title</span></td>\n	<td class="nobd"><input type="text" value="';
//line 19 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'title', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="28" name="contact_title_';
//line 19 "contact_card_other.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n<tr>\n	<td class="nobd"><span class="cardfld hilite">Nickname</span></td>\n	<td class="nobd"><input type="text" value="';
//line 23 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'nickname', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="28" name="contact_nickname_';
//line 23 "contact_card_other.tt2"
output += stash.get(['contact', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n';
//line 30 "contact_card_other.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'others', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['other'] = value;
output += '\n<tr>\n	<td class="nobd"><span id="other_label_';
//line 27 "contact_card_other.tt2"
output += stash.get(['other', 0, 'id', 0]);
output += '" class="lblpop cardfld">';
//line 27 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['other', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</span></td>\n	<td class="nobd"><input type="text" value="';
//line 28 "contact_card_other.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['other', 0, 'other', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="28" name="other_other_';
//line 28 "contact_card_other.tt2"
output += stash.get(['other', 0, 'id', 0]);
output += '" maxlength="100" class="cardfld hilite" style="border: none;" /></td>\n</tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n<tr style="height:auto;border-bottom:none;">\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n	<td class="nobd" style="height:auto;border-bottom:none;"></td>\n</tr>\n</tbody>\n</table>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['view_contact.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 106 "view_contact.tt2"
if (stash.get('error')) {
output += '\n<div id="contactLayer">\n<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n<div style="float:left;">An error occurred</div>\n<div style="float:right;"><a href="javascript:close_contact()">[X]</a></div>\n&nbsp;\n</div>\n';
//line 9 "view_contact.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="contactLayer">\n<div class="bar" onmousedown="dragStart(event, \'contactShadow\')">\n<div style="float:left;">';
//line 14 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'name', 0]);

    return context.filter(output, 'html', []);
})();

output += '</div>\n<div style="float:right;"><a href="';
//line 1 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['c', 0, 'uri_for', [ '/contact/view/' + stash.get(['contact', 0, 'id', 0]) ]]);

    return context.filter(output, 'html', []);
})();

output += '" \n	onclick="edit_contact(';
//line 16 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['contact', 0, 'id', 0]);

    return context.filter(output, 'html', []);
})();

output += '); return false;">[ edit ]</a>\n	<a href="javascript:close_contact()">[X]</a>\n</div>\n&nbsp;\n</div>\n\n<div id="tab_container">\n	<div id="tab_1" class="tabbed_pane_tab selected_tab" style="width: 100px;" onclick="do_select(\'1\');">Name &amp; Phones</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_2" class="tabbed_pane_tab" onclick="do_select(\'2\');">Email &amp; IM</div>\n	<div class="tabbed_pane_tab tab_spacer"></div>\n	<div id="tab_3" class="tabbed_pane_tab" onclick="do_select(\'3\');">Addresses</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_4" class="tabbed_pane_tab" onclick="do_select(\'4\');">Dates</div>\n	<div class="tabbed_pane_tab tab_spacer">&nbsp;</div>\n	<div id="tab_5" class="tabbed_pane_tab" onclick="do_select(\'5\');">Other</div>\n</div>\n\n<div id="card_box_container">\n	<div id="box_1" class="card_box">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n			';
//line 46 "view_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'phones', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['phone'] = value;
output += '\n			<tr>\n				<td>';
//line 43 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n				<td>';
//line 44 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['phone', 0, 'phone', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n			</tr>\n			';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n		</table>\n	</div>\n	\n	<div id="box_2" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n			';
//line 61 "view_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'emails', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['email'] = value;
output += '\n			<tr>\n				<td>';
//line 58 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n				<td>';
//line 59 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['email', 0, 'email', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n			</tr>\n			';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n		</table>\n	</div>\n	<div id="box_3" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n			';
//line 84 "view_contact.tt2"

// FOREACH 
(function() {
    var list = stash.get(['contact', 0, 'addresses', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['address'] = value;
output += '\n			<tr>\n				<td>';
//line 72 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'label', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n				<td>\n				<address>\n				';
//line 75 "view_contact.tt2"
if (stash.get(['address', 0, 'pobox', 0])) {
//line 75 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'pobox', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br/>';
}

output += '\n					';
//line 76 "view_contact.tt2"
if (stash.get(['address', 0, 'street', 0])) {
//line 76 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'street', 0]);

    return context.filter(output, 'html_line_break', []);
})();

output += '<br/>';
}

output += '\n					';
//line 77 "view_contact.tt2"
if (stash.get(['address', 0, 'city', 0])) {
//line 77 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'city', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br/>';
}

output += '\n					';
//line 78 "view_contact.tt2"
if (stash.get(['address', 0, 'region', 0])) {
//line 78 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'region', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br/>';
}

output += '\n					';
//line 79 "view_contact.tt2"
if (stash.get(['address', 0, 'postalcode', 0])) {
//line 79 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'postalcode', 0]);

    return context.filter(output, 'html', []);
})();

output += '<br/>';
}

output += '\n					';
//line 80 "view_contact.tt2"
if (stash.get(['address', 0, 'country', 0])) {
//line 80 "view_contact.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['address', 0, 'country', 0]);

    return context.filter(output, 'html', []);
})();

}

output += '\n				</address>\n				</td>\n			</tr>\n			';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n		</table>\n	</div>\n	<div id="box_4" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n		</table>\n	</div>\n	<div id="box_5" class="card_box hidden">\n		<table border="0" cellspacing="5">\n			<tr>\n				<th></th>\n				<th></th>\n			</tr>\n		</table>\n	</div>\n</div><!-- end card_box_container -->\n\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['bizcode_custom.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 38 "bizcode_custom.tt2"
if (stash.get('error')) {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;">An error occurred</div>\n		<div style="float:right;"><a href="javascript:closePopup()">[X]</a></div>\n		&nbsp;\n	</div>\n	';
//line 9 "bizcode_custom.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;" id="cardName">';
//line 14 "bizcode_custom.tt2"
if (stash.get(['code', 0, 'code', 0])) {
//line 14 "bizcode_custom.tt2"
output += stash.get(['code', 0, 'code', 0]);
}
else {
output += 'New Custom Code';
}

output += '</div>\n		<div style="float:right;"><a href="javascript:closePopup()">[X]</a></div>\n		&nbsp;\n	</div>\n	\n	<div id="autosave" style="float:right;display: none;"> Auto-saving...</div>\n\n	<div id="code_container">\n	<table>\n	<tr>\n		<td class="cardlbl">Code:</td>\n		<td class="cardfld">\n			<input id="bizcode" type="text" value="';
//line 26 "bizcode_custom.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['code', 0, 'code', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="30" maxlength="100" name="code_code_';
//line 26 "bizcode_custom.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += '" class="cardcodefld" style="width:280px;" />\n			<input type="submit" onclick="bizcode_custom(); return false;" style="margin:-1px 0 2px auto; float: right;" class="button_link WhiteOnGreen" value="CUSTOM" id="customsubmit"><br />\n			<div id="result_custom" style="clear: both; margin: 4px 0 8px 0;" class="green">';
//line 28 "bizcode_custom.tt2"
output += stash.get('codemessage');
output += '&nbsp;</div>\n		</td>\n	</tr>\n	';
//line 31 "bizcode_custom.tt2"
output += context.include('bizcode_common.tt2');
output += '\n	</table>\n			<input id="customsubmit" value="DONE" type="submit" class="button_link WhiteOnGreen" style="margin:0 10px 2px 0;float:right;" onclick="closePopup(); return false;" />\n			<input id="customsubmit" value="DELETE" type="submit" class="button_link WhiteOnOrange" style="margin:0 10px 2px 0;float:right;" onclick="';
//line 34 "bizcode_custom.tt2"
if (stash.get(['code', 0, 'id', 0])) {
output += 'bizcode_delete(';
//line 34 "bizcode_custom.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += ')';
}
else {
output += 'closePopup()';
}

output += '; return false;" />\n	</div>\n<div style="clear: both;height: 20px;"> </div>\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['bizcode_random.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 30 "bizcode_random.tt2"
if (stash.get('error')) {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;">An error occurred</div>\n		<div style="float:right;"><a href="javascript:closePopup()">[X]</a></div>\n		&nbsp;\n	</div>\n	';
//line 9 "bizcode_random.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;" id="cardName">';
//line 14 "bizcode_random.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['code', 0, 'code', 0]);

    return context.filter(output, 'html', []);
})();

output += '</div>\n		<div style="float:right;"><a href="javascript:closePopup()">[X]</a></div>\n		&nbsp;\n	</div>\n	\n	<div id="autosave" style="float:right;display: none;"> Auto-saving...</div>\n\n	<div id="code_container">\n	<table>\n	';
//line 23 "bizcode_random.tt2"
output += context.include('bizcode_common.tt2');
output += '\n	</table>\n			<input id="customsubmit" value="DONE" type="submit" class="button_link WhiteOnGreen" style="margin:0 10px 2px 0;float:right;" onclick="closePopup(); return false;" />\n			<input id="customsubmit" value="DELETE" type="submit" class="button_link WhiteOnOrange" style="margin:0 10px 2px 0;float:right;" onclick="';
//line 26 "bizcode_random.tt2"
if (stash.get(['code', 0, 'id', 0])) {
output += 'bizcode_delete(';
//line 26 "bizcode_random.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += ')';
}
else {
output += 'closePopup()';
}

output += '; return false;" />\n	</div>\n\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['bizcode_common.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<tr>\n	<td class="cardlbl">Title:</td>\n	<td class="cardfld">\n		<input type="text" value="';
//line 4 "bizcode_common.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['code', 0, 'title', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="50" maxlength="100" name="code_title_';
//line 4 "bizcode_common.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += '" class="cardfld" style="width:367px;" />\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl" style="vertical-align:middle;"><p>SMS:</p>\n			<span id="custommessageCount" style="color: green;">';
//line 9 "bizcode_common.tt2"
if (stash.get(['code', 0, 'custommsg', 0]) && stash.get(['code', 0, 'message', 0])) {
//line 9 "bizcode_common.tt2"
output += stash.get(['code', 0, 'message', 0, 'length', 0]);
}
else {
output += '0';
}

output += '/';
//line 9 "bizcode_common.tt2"
output += stash.get('msgmax');
output += '</span>\n	</td>\n	<td class="cardfld">\n		<textarea id="custommessage" name="code_message_';
//line 12 "bizcode_common.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += '" rows="6" cols="50" class="cardfld" style="width:367px;">';
//line 12 "bizcode_common.tt2"
output += stash.get(['code', 0, 'message', 0]);
output += '</textarea>\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl">URL:</td>\n	<td class="cardfld">\n		<input type="text" value="';
//line 18 "bizcode_common.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['code', 0, 'url', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="50" maxlength="255" name="code_url_';
//line 18 "bizcode_common.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += '" class="cardfld" style="width:367px;" />\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl">File:</td>\n	<td class="cardfld">\n		<!--<div id="fileload">-->\n        <form name="uploadForm" action="/business/fileupload" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="if (this.submitted) return true; else return false;" >\n        <input type="hidden" name="codeid" value="';
//line 26 "bizcode_common.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += '" />\n		<!--<input id="customsubmit" value="GET FILE" type="submit" class="button_link WhiteOnOrange" style="margin-bottom:2px;" onclick="startUpload(document.uploadForm, \'codefile\', \'codefilename\'); return false;" />-->\n		<input type="file" size="40" name="codefile" id="codefile" class="fb_file" onchange="startUpload(document.uploadForm, \'codefile\', \'codefilename\', \'customsubmit\');" style="width:367px;" />\n		<iframe id="upload_target" name="upload_target" style="width:0;height:0;border:0px solid #fff;"></iframe>\n		</form>\n		<p id="codemaxsize" style="width:367px; margin:2px 0px 2px 0px;">Maximum file size: ';
//line 31 "bizcode_common.tt2"
output += stash.get('maxfilesize');
output += '</p>\n		<p id="codefilename" style="width:367px; margin:2px 0px 2px 0px;">';
//line 32 "bizcode_common.tt2"
if (stash.get(['code', 0, 'filename', 0])) {
//line 32 "bizcode_common.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['code', 0, 'filename', 0]);

    return context.filter(output, 'html', []);
})();

output += ' - <span class="link" onclick="codeRemoveFile(';
//line 32 "bizcode_common.tt2"
output += stash.get(['code', 0, 'id', 0]);
output += ');">remove file</span>';
}

output += '&nbsp;</p>\n		<!--</div>-->\n	</td>\n</tr>';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['pager.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
//line 25 "pager.tt2"
if (stash.get('pager')) {
output += '\n<div class="pager largeText">\n	Page ';
//line 3 "pager.tt2"
output += stash.get(['pager', 0, 'current_page', 0]);
output += ' of ';
//line 3 "pager.tt2"
output += stash.get(['pager', 0, 'last_page', 0]);
output += '\n	<div style="width:20px;display:inline-block;">&nbsp;</div>\n   ';
//line 8 "pager.tt2"
if (stash.get(['pager', 0, 'previous_page', 0])) {
output += '\n	   <span class="link" onclick="';
//line 6 "pager.tt2"
output += stash.get('funcname');
output += '(';
//line 6 "pager.tt2"
output += stash.get('funcparams');
output += ', ';
//line 6 "pager.tt2"
output += stash.get(['pager', 0, 'first_page', 0]);
output += '); return false;">|&lt;&nbsp;</span>\n	   <span class="link" onclick="';
//line 7 "pager.tt2"
output += stash.get('funcname');
output += '(';
//line 7 "pager.tt2"
output += stash.get('funcparams');
output += ', ';
//line 7 "pager.tt2"
output += stash.get(['pager', 0, 'previous_page', 0]);
output += '); return false;">&lt;&nbsp;</span>\n   ';
}

output += '\n\n   ';
//line 18 "pager.tt2"

// FOREACH 
(function() {
    var list = stash.get(['pager', 0, 'page_list', 0]);
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['page'] = value;
output += '\n	   ';
//line 11 "pager.tt2"
if (stash.get(['pager', 0, 'last_page', 0]) == 1) {
break;
}

output += '\n	   ';
//line 12 "pager.tt2"
if (stash.get(['loop', 0, 'count', 0]) > 7) {
break;
}

output += '\n	   ';
//line 17 "pager.tt2"
if (stash.get(['pager', 0, 'current_page', 0]) == stash.get('page')) {
output += '\n		   <span class="current"> ';
//line 14 "pager.tt2"
output += stash.get('page');
output += ' </span>\n	   ';
}
else {
output += '\n		   <span class="link" onclick="';
//line 16 "pager.tt2"
output += stash.get('funcname');
output += '(';
//line 16 "pager.tt2"
output += stash.get('funcparams');
output += ', ';
//line 16 "pager.tt2"
output += stash.get('page');
output += '); return false;">';
//line 16 "pager.tt2"
output += stash.get('page');
output += '</span>\n	   ';
}

output += '\n   ';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n\n   ';
//line 23 "pager.tt2"
if (stash.get(['pager', 0, 'next_page', 0])) {
output += '\n	   <span class="link" onclick="';
//line 21 "pager.tt2"
output += stash.get('funcname');
output += '(';
//line 21 "pager.tt2"
output += stash.get('funcparams');
output += ', ';
//line 21 "pager.tt2"
output += stash.get(['pager', 0, 'next_page', 0]);
output += '); return false;">&nbsp;&gt;</span>\n	   <span class="link" onclick="';
//line 22 "pager.tt2"
output += stash.get('funcname');
output += '(';
//line 22 "pager.tt2"
output += stash.get('funcparams');
output += ', ';
//line 22 "pager.tt2"
output += stash.get(['pager', 0, 'last_page', 0]);
output += '); return false;">&nbsp;&gt;|</span>\n   ';
}

output += '\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['codereport.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div id="codeLayer">\n	<div class="bigbar h2fontsize" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:right;"><a href="javascript:close_report_code()">[X]</a></div>\n		<div id="cardName">Code Details for <span class="bodycolor">';
//line 4 "codereport.tt2"
output += stash.get('code');
output += '</span></div>\n	</div>\n\n';
//line 7 "codereport.tt2"
output += context.process('pager.tt2');
output += '\n\n<p />\n<div class="borderbox">\n<table class="report">\n<thead>\n<tr>\n<th style="height: 22px;">Mobile #</th>\n<th style="width:108px;">Date/time</th>\n<th>Location</th>\n<th>Carrier</th>\n<th style="width:60px;">Share</th>\n<th class="nobd">Comment</th>\n</tr>\n</thead>\n<tbody id="contactsTableBody">';
//line 36 "codereport.tt2"

// FOREACH 
(function() {
    var list = stash.get('shares');
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['share'] = value;
output += '<tr>\n	<td>';
//line 25 "codereport.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['share', 0, 'userphone', 0, 'phone', 0]);

    return context.filter(output, 'replace', [ '^.......', 'XXXXXXX-' ]);
})();

output += '</td>\n	<td><input type="text" class="jsdate" value="';
//line 26 "codereport.tt2"
output += stash.get(['share', 0, 'shared', 0]);
output += '" /></td>\n	<td>';
//line 27 "codereport.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['share', 0, 'userphone', 0, 'location', 0]);

    return context.filter(output, 'replace', [ 'null', '' ]);
})();

output += '</td>\n	<td>';
//line 28 "codereport.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['share', 0, 'userphone', 0, 'carrier', 0]);

    return context.filter(output, 'replace', [ 'null', '' ]);
})();

output += '</td>\n	<td>\n		';
//line 30 "codereport.tt2"
if (stash.get(['share', 0, 'thirdpartysite_id', 0]) == 1 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 3 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 5 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 7) {
output += '<img src="/static/images/FacebookShare16.png" alt="Facebook" height="16" width="16" />';
}

output += '\n		';
//line 31 "codereport.tt2"
if (stash.get(['share', 0, 'thirdpartysite_id', 0]) == 2 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 3 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 6 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 7) {
output += '<img src="/static/images/EvernoteShare16.jpg" alt="Evernote" height="16" width="16" />';
}

output += '\n		';
//line 32 "codereport.tt2"
if (stash.get(['share', 0, 'thirdpartysite_id', 0, 'binary_and', 0]) == 4 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 5 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 6 || stash.get(['share', 0, 'thirdpartysite_id', 0]) == 7) {
output += '<img src="/static/images/TwitterShare16.png" alt="Twitter" height="16" width="16" />';
}

output += '\n	</td>\n	<td class="nobd">';
//line 34 "codereport.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['share', 0, 'comment', 0]);

    return context.filter(output, 'replace', [ 'null', '' ]);
})();

output += '</td>\n </tr>\n';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '<tr style="height:auto;border-bottom:none;" class="alwaysDisplay">\n	<td style="height:auto;border-bottom:none;"> </td>\n	<td style="height:auto;border-bottom:none;"> </td>\n	<td style="height:auto;border-bottom:none;"> </td>\n	<td style="height:auto;border-bottom:none;"> </td>\n	<td style="height:auto;border-bottom:none;"> </td>\n	<td class="nobd" style="height:auto;border-bottom:none;"> </td>\n</tr>\n</tbody>\n</table>\n</div>\n\n</div>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['sms_offer.tt2'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {

output += '\n';
//line 96 "sms_offer.tt2"
if (stash.get('error')) {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;">An error occurred</div>\n		<div style="float:right;"><a href="javascript:closePopup()">[X]</a></div>\n		&nbsp;\n	</div>\n	';
//line 9 "sms_offer.tt2"
output += stash.get('error');
output += '\n</div>\n';
}
else {
output += '\n<div id="codeLayer">\n	<div class="bar" onmousedown="dragStart(event, \'codeShadow\')">\n		<div style="float:left;" id="cardName">SMS Offer</div>\n		&nbsp;\n	</div>\n	\n	<div id="autosave" style="float:right;display: none;"> Auto-saving...</div>\n\n<div style="position: relative; margin-top: 20px;">\n<table>\n<tr>\n	<td class="cardlbl" style="padding: 0 0 10px 0;">O-CODE:</td>\n	<td class="cardfld">';
//line 24 "sms_offer.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['smsoffer', 0, 'codename', 0]);

    return context.filter(output, 'html', []);
})();

output += '</td>\n</tr>\n<tr>\n	<td class="cardlbl">Offer Title:</td>\n	<td class="cardfld"><input type="text" value="';
//line 28 "sms_offer.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['smsoffer', 0, 'title', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="50" maxlength="255" name="smsoffer_title_';
//line 28 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" class="cardfld" style="width:367px;" /></td>\n</tr>\n<tr>\n	<td class="cardlbl" style="vertical-align:middle;"><p>SMS:</p>\n		<span id="custommessageCount" style="color: green;">0/160</span>\n	</td>\n	<td class="cardfld">\n		<textarea id="custommessage" name="smsoffer_message_';
//line 35 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" rows="4" cols="50" class="cardfld" style="width:367px;">';
//line 35 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'message', 0]);
output += '</textarea>\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl" style="vertical-align:middle;"><p>SMS end:</p></td>\n	<td class="cardfld">\n		<textarea id="custommessageend" rows="1" cols="50" class="cardfld" style="width:367px;" disabled="disabled">';
//line 42 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'url', 0])) {
//line 41 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'shorturl', 0]);
output += ' \n';
}

//line 42 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'msgend', 0]);
output += '</textarea>\n		<input id="custommessageshorturl" type="hidden" value="';
//line 43 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'shorturl', 0]);
output += '" />\n		<input id="custommessageenddefault" type="hidden" value="';
//line 44 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'msgend', 0]);
output += '" />\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl">URL:</td>\n	<td class="cardfld">\n		<input type="text" id="customurl" value="';
//line 50 "sms_offer.tt2"

// FILTER
output += (function() {
    var output = '';

output += stash.get(['smsoffer', 0, 'url', 0]);

    return context.filter(output, 'html', []);
})();

output += '" size="50" maxlength="255" name="smsoffer_url_';
//line 50 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" class="cardfld" style="width:367px;" />\n	</td>\n</tr>\n<tr>\n	<td class="cardlbl" style="padding: 12px 0;">Recipients:</td>\n	<td class="cardfld"><span class="green bold">';
//line 55 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'recipientcount', 0]);
output += '</span><div style="width:180px;display:inline-block;">&nbsp;</div>Cost: <span class="green bold">$';
//line 55 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'cost', 0]);
output += '</span></td>\n</tr>\n<tr>\n	<td class="cardlbl" colspan="2">\n	<input type="radio" id="sendAtRadio0" value="null" name="smsoffer_sendat_';
//line 59 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" checked="checked" class="cardfld selectadjust nobd" /> Send Now\n	<div style="width:30px;display:inline-block;">&nbsp;</div>\n	<input type="radio" id="sendAtRadio1" value="1" name="smsoffer_sendat_';
//line 61 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" ';
//line 61 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'sendat', 0])) {
output += 'checked="checked"';
}

output += ' class="cardspecial selectadjust nobd" onclick="document.getElementById(\'sendatDate\').focus();" /> \n		';
//line 75 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'is_editable', 0])) {
output += '\n	Send Later: <input type="text" id="sendatDate" value="';
//line 63 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'sendat', 0]);
output += '" size="50" name="smsoffer_sendat_';
//line 63 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" class="cardspecial" onfocus="document.getElementById(\'sendAtRadio1\').checked = true;" onchange="updateSendat();" style="width:90px;" />\n	<select id="sendatTime" class="cardspecial" id="selectreport" name="selectreport" onchange="updateSendat();">\n		';
//line 67 "sms_offer.tt2"

// FOREACH 
(function() {
    var list = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['hour'] = value;
output += '\n  			<option value="';
//line 66 "sms_offer.tt2"
output += stash.get('hour');
output += ':00:00" ';
//line 66 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'sendathour', 0]) == stash.get('hour')) {
output += 'selected="selected"';
}

output += '>';
//line 66 "sms_offer.tt2"
output += stash.get('hour');
output += ':00 am</option>		\n		';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n  			<option value="12:00:00" ';
//line 68 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'sendathour', 0]) == 12) {
output += 'selected="selected"';
}

output += '>12:00 pm</option>		\n		';
//line 71 "sms_offer.tt2"

// FOREACH 
(function() {
    var list = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
    list = new Jemplate.Iterator(list);
    var retval = list.get_first();
    var value = retval[0];
    var done = retval[1];
    var oldloop;
    try { oldloop = stash.get('loop') } finally {}
    stash.set('loop', list);
    try {
        while (! done) {
            stash.data['hour'] = value;
output += '\n  			<option value="';
//line 70 "sms_offer.tt2"
output += stash.get('hour') + 12;
output += ':00:00" ';
//line 70 "sms_offer.tt2"
if ((stash.get(['smsoffer', 0, 'sendathour', 0]) - 12) == stash.get('hour')) {
output += 'selected="selected"';
}

output += '>';
//line 70 "sms_offer.tt2"
output += stash.get('hour');
output += ':00 pm</option>		\n		';;
            retval = list.get_next();
            value = retval[0];
            done = retval[1];
        }
    }
    catch(e) {
        throw(context.set_error(e, output));
    }
    stash.set('loop', oldloop);
})();

output += '\n	</select>\n		';
}
else {
output += '\n	Sent at: <input type="text" id="sendatDate" value="';
//line 74 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'sendat', 0]);
output += '" size="50" name="smsoffer_sendat_';
//line 74 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += '" class="cardspecial" onfocus="document.getElementById(\'sendAtRadio1\').checked = true;" onchange="updateSendat();" style="width:180px;" />\n		';
}

output += '\n</td>\n</tr>\n<tr>\n	<td class="cardlbl" style="padding:18px 0;" colspan="2">\n		';
//line 89 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'is_editable', 0])) {
output += '\n		';
//line 85 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'is_new', 0])) {
output += '\n		<input id="offerdelete" value="CANCEL" type="submit" class="button_link WhiteOnOrange" style="margin:0 10px 2px 0;" onclick="';
//line 82 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'id', 0])) {
output += 'smsofferDelete(';
//line 82 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += ', \'cancel\')';
}
else {
output += 'closePopup()';
}

output += '; return false;" />\n		';
}
else {
output += '\n		<input id="offerdelete" value="DELETE" type="submit" class="button_link WhiteOnOrange" style="margin:0 10px 2px 0;" onclick="';
//line 84 "sms_offer.tt2"
if (stash.get(['smsoffer', 0, 'id', 0])) {
output += 'smsofferDelete(';
//line 84 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += ', \'delete\')';
}
else {
output += 'closePopup()';
}

output += '; return false;" />\n		';
}

output += '\n		<input id="offersave" value="DONE" type="submit" class="button_link WhiteOnGreen" style="margin:0 0 2px 0;" onclick="smsofferSave(';
//line 86 "sms_offer.tt2"
output += stash.get(['smsoffer', 0, 'id', 0]);
output += ', \'sendAtRadio0\', \'custommessage\'); return false;" />\n		';
}
else {
output += '\n		<input id="offersave" value="CLOSE" type="submit" class="button_link WhiteOnGreen" style="margin:0 0 2px 0;" onclick="closePopup(); return false;" />\n		';
}

output += '\n	</td>\n</tr>\n</table>\n</div>\n\n</div>\n';
}

output += '\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

