/*
  contact_form.js
  Generates contact us form content.

  Copyright (c) 2009 Link Ethiopia

  $HeadURL: https://admin.linkethiopia.org:2080/svn/website-pub/releases/rel_1.0.28/javascript/contact_form.js $
  $Id: contact_form.js 3 2009-11-22 22:06:16Z sroberts $

   Date       Name         Comments
  ----------+------------+---------------------------------------------
   19/11/09   sroberts     Re-baselined codeset

 */

function hide(ref) {
	var elem = document.getElementById(ref);
	elem.className = "hidden";
}

function show(ref) {
	var elem = document.getElementById(ref);
	elem.className = "visible";
}


function change_action(action) {
	hide("form_" + action);
	show("form_action_select");
}

function select_action(action) {
    hide("form_action_select");
    show("form_" + action);
}

document.writeln('<div id="contact_form">');

document.writeln('<form action="/contact.php" method="post">');

// Selection box
document.writeln('<div id="form_action_select" class="visible">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="action" value="comment" id="action_comment" onClick="select_action(\'comment\');" /></td>');
document.writeln('<td><label for="action_comment">Comment about our work</label></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="action" value="get_involved" id="action_get_involved" onClick="select_action(\'get_involved\');" /></td>');
document.writeln('<td><label for="action_get_involved">Find out how to get involved</label></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="action" value="volunteer" id="action_volunteer" onClick="select_action(\'volunteer\');" /></td>');
document.writeln('<td><label for="action_volunteer">Volunteer for gap scheme</label></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="action" value="bug" id="action_bug" onClick="select_action(\'bug\');" /></td>');
document.writeln('<td><label for="action_bug">Report a problem with our website</label></td>');
document.writeln('</tr>');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="action" value="mailing_list" id="action_mailing_list" onClick="select_action(\'mailing_list\');" /></td>');
document.writeln('<td><label for="action_mailing_list">Join our mailing list</label></td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('</div>');


// Comments form
document.writeln('<div id="form_comment" class="hidden">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="" checked="checked" value="" /></td>');
document.writeln('<td>Comment about our work (<a href="javascript:change_action(\'comment\');">Change</a>)</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('<table border="0"><tr>');
document.writeln('<td><b>Name</b></td>');
document.writeln('<td><input name="c_name" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>E-Mail</b></td>');
document.writeln('<td><input name="c_email" size="25" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Country</b></td>');
document.writeln('<td><input name="c_country" size="20" value="UK" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Comments</b></td>');
document.writeln('<td><textarea name="c_comments" cols="30" rows="6"></textarea></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td><input type="checkbox" name="c_mailing_list" value="yes" /> <b>Join our mailing list?</b> You will receive a monthly newsletter detailing our work and occasional other messages from us. <i>We never share details with other companies.</i></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td style="border-top-width: 1px;"><input type="submit" value="Submit" /></td>');
document.writeln('</tr></table>');
document.writeln('</div>');

// Get involved enquiry
document.writeln('<div id="form_get_involved" class="hidden">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="" checked="checked" value="" /></td>');
document.writeln('<td>Find out how to get involved (<a href="javascript:change_action(\'get_involved\');">Change</a>)</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('<p>If you are interested in getting involved with our work, either as an individual or as a school or company, we\'d love to hear form you. Please fill out as much detail as possible in the field below and someone will be in touch soon!</p>');
document.writeln('<table border="0"><tr>');
document.writeln('<td><b>Name</b></td>');
document.writeln('<td><input name="i_name" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>E-Mail</b></td>');
document.writeln('<td><input name="i_email" size="25" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Country</b></td>');
document.writeln('<td><input name="i_country" size="20" value="UK" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Category</b></td>');
document.writeln('<td><select name="i_category">');
document.writeln('<option value="individual">Individual</option>');
document.writeln('<option value="school">School</option>');
document.writeln('<option value="company">Company</option>');
document.writeln('<option value="other">Other</option>');
document.writeln('</select></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Other Info</b></td>');
document.writeln('<td><textarea name="i_comments" cols="30" rows="6"></textarea></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td style="border-top-width: 1px;"><input type="submit" value="Submit" /></td>');
document.writeln('</tr></table>');
document.writeln('</div>');


// Gap Volunteer
document.writeln('<div id="form_volunteer" class="hidden">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="" checked="checked" value="" /></td>');
document.writeln('<td>Volunteer for gap scheme (<a href="javascript:change_action(\'volunteer\');">Change</a>)</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('<p>Are you interested in an exciting and worthwhile volunteering experience at one of our schools in Ethiopia? Please fill out as much detail as possible in the field below and someone will be in touch soon!</p>');
document.writeln('<table border="0"><tr>');
document.writeln('<td><b>Name</b></td>');
document.writeln('<td><input name="v_name" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>E-Mail</b></td>');
document.writeln('<td><input name="v_email" size="25" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Age</b></td>');
document.writeln('<td><input name="v_age" size="5" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Country</b></td>');
document.writeln('<td><input name="v_country" size="20" value="UK" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Other Info</b></td>');
document.writeln('<td><textarea name="v_comments" cols="30" rows="6"></textarea></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td style="border-top-width: 1px;"><input type="submit" value="Submit" /></td>');
document.writeln('</tr></table>');
document.writeln('</div>');


// Bug Report
document.writeln('<div id="form_bug" class="hidden">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="" checked="checked" value="" /></td>');
document.writeln('<td>Report a problem with our website (<a href="javascript:change_action(\'bug\');">Change</a>)</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('<p>If you have found a problem or mistake on our website, please tell us so we can put things right! Please fill out as much of the information below as possible in order to help us resolve the problem.</p>');
document.writeln('<table border="0"><tr>');
document.writeln('<td><b>Name</b></td>');
document.writeln('<td><input name="b_name" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>E-Mail</b></td>');
document.writeln('<td><input name="b_email" size="25" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Browser</b></td>');
document.writeln('<td><select name="b_browser">');
document.writeln('<option value="ie">Internet Explorer</option>');
document.writeln('<option value="firefox">Firefox</option>');
document.writeln('<option value="safari">Safari</option>');
document.writeln('<option value="opera">Opera</option>');
document.writeln('<option value="mozilla">Mozilla</option>');
document.writeln('<option value="other">Other</option>');
document.writeln('</select></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>OS</b></td>');
document.writeln('<td><select name="b_OS">');
document.writeln('<option value="windows">Windows</option>');
document.writeln('<option value="linux">Linux</option>');
document.writeln('<option value="osx">Mac OSX</option>');
document.writeln('<option value="other">Other</option>');
document.writeln('</select></td>');
document.writeln('</tr><tr>');
document.writeln('<td colspan="2">');
document.writeln('<p>Please provide as much detail about the problem as possible, including what you were doing, how often the error occurs and how long you have noticed it for.</p>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Details</b></td>');
document.writeln('<td><textarea name="b_comments" cols="45" rows="6"></textarea></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td style="border-top-width: 1px;"><input type="submit" value="Submit" /></td>');
document.writeln('</tr></table>');
document.writeln('</div>');


// Join mailing list
document.writeln('<div id="form_mailing_list" class="hidden">');
document.writeln('<table width="100%" border="0">');
document.writeln('<tr>');
document.writeln('<td width="20px"><input type="radio" name="" checked="checked" value="" /></td>');
document.writeln('<td>Join our mailing list (<a href="javascript:change_action(\'mailing_list\');">Change</a>)</td>');
document.writeln('</tr>');
document.writeln('</table>');
document.writeln('<table border="0"><tr>');
document.writeln('<td><b>Name</b></td>');
document.writeln('<td><input name="m_name" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>E-Mail</b></td>');
document.writeln('<td><input name="m_email" size="25" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>Country</b></td>');
document.writeln('<td><input name="m_country" size="20" value="UK" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td><b>How did you hear<br />about us?</b></td>');
document.writeln('<td><input name="m_source" size="20" /></td>');
document.writeln('</tr><tr>');
document.writeln('<td />');
document.writeln('<td style="border-top-width: 1px;"><input type="submit" value="Submit" /></td>');
document.writeln('</tr></table>');
document.writeln('</div>');

document.writeln('</form>');

document.writeln('</div>');

