function swapStyle(n) 
{ 
var elem = document.getElementById("swapper"); 
var res_eval = eval("swapper" + n); 
var newdiv = document.createElement("div"); 
newdiv.innerHTML = res_eval; 
elem.innerHTML = ''; 
elem.appendChild(newdiv); 
} 

function swapOver(n) // swaps the images on each mouseover
{
document.images['describe'].src = eval("describe" + n + ".src");
}
function swapOut(n) // swaps the images back on each mouseout
{
document.images['describe'].src = eval("describe0.src");
}

var swapper0 = ("<div><br><br></div>");

var swapper1 = ("<div class=\"one\"><br><br><br><a onmouseover=\"swapOver(1)\" onmouseout=\"swapOut(0)\" href=\"http://www.monicahess.com\""
+" target=\"_blank\" class=\"navlinkup\">Feng Shui This</a></div>"
+"<div class=\"two\"><br><br><br><a onmouseover=\"swapOver(2)\" onmouseout=\"swapOut(0)\" href=\"http://www.fengshuinetwork.net\""
+" target=\"_blank\" class=\"navlinkup\">FENG SHUI<br>Network</a></div>"
+"<div class=\"three\"><br><br><br><a onmouseover=\"swapOver(3)\" onmouseout=\"swapOut(0)\" href=\"http://www.fengshuiresearchcentre-uae.com\""
+" target=\"_blank\" class=\"navlinkup\">FSRC-UAE</a></div>"
+"<div class=\"four\"><br><br><br><a onmouseover=\"swapOver(4)\" onmouseout=\"swapOut(0)\" href=\"http://www.marybax.com\""
+" target=\"_blank\" class=\"navlinkup\">Mary Bax.com</a></div>"
+"<div class=\"five\"><br><br><br><a onmouseover=\"swapOver(5)\" onmouseout=\"swapOut(0)\" href=\"http://www.newlondoniowa.org/buslist2.html\""
+" target=\"_blank\" class=\"navlinkup\"><font size=\"-1\">New London IA<br>Business Directory</font></a></div>"
+"<div class=\"six\"><br><br><br><a onmouseover=\"swapOver(6)\" onmouseout=\"swapOut(0)\" href=\"http://www.zhsalum.org\""
+" target=\"_blank\" class=\"navlinkup\">ZHS Alumni<br>Association</a></div>"
+"<div class=\"seven\"><br><br><br><a onmouseover=\"swapOver(7)\" onmouseout=\"swapOut(0)\" href=\"http://www.toroscope.com\""
+" target=\"_blank\" class=\"navlinkup\">ZHS Yearbooks</a></div>");

var swapper2 = ("<form name=\"form\" action=\"thankyou.php\" method=\"post\" onSubmit=\"return validate_form()\">"
+"<table width=\"80%\" border=\"0\" style=\"font-family: Century Gothic; font-size: 12pt;"
+" color: yellow\"><tr><td width=\"5%\"></td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"30%\" align=\"right\">"
+"First Name: &nbsp </td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"35%\" align=\"left\">"
+"<input type=\"text\" name=\"firstname\" size=\"50\" maxlength=\"50\"></td><td width=\"25%\"></td></tr>"
+"<tr><td width=\"5%\"></td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"30%\" align=\"right\">"
+"Last Name: &nbsp </td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"35%\" align=\"left\">"
+"<input type=\"text\" name=\"lastname\" size=\"50\" maxlength=\"50\"></td><td width=\"25%\"></td></tr>"
+"<tr><td width=\"5%\"></td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"30%\" align=\"right\">"
+"Email: &nbsp </td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"35%\" align=\"left\">"
+"<input type=\"text\" name=\"email\" size=\"50\" maxlength=\"50\"></td><td width=\"25%\"></td></tr>"
+"<tr><td width=\"5%\"></td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"30%\" align=\"right\">"
+"Describe your Request: &nbsp </td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"35%\" align=\"left\">"
+"<textarea rows=\"8\" cols=\"50\" maxlength=\"250\" name=\"comments\"></textarea></td><td width=\"25%\"></td></tr>"
+"<tr><td colspan=\"4\" height=\"15\"></td></tr>"
+"<tr><td width=\"5%\"></td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"30%\" align=\"right\">"
+"What is the opposite of left? &nbsp </td><td style=\"font-family: Century Gothic; font-size: 12pt; color: yellow\" width=\"35%\" align=\"left\">"
+"<input type=\"text\" name=\"spamcheck\" size=\"8\" maxlength=\"8\"></td><td width=\"25%\"></td></tr>"
+"<tr><td colspan=\"4\" height=\"15\"></td></tr>"
+"<tr><td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"Submit\"> &nbsp&nbsp&nbsp&nbsp&nbsp "
+"<input type=\"reset\" value=\"Reset\"></td></tr></table></form>");

var describe0 = new Image(435,96);
var describe1 = new Image(435,96);
var describe2 = new Image(435,96);
var describe3 = new Image(435,96);
var describe4 = new Image(435,96);
var describe5 = new Image(435,96);
var describe6 = new Image(435,96);
var describe7 = new Image(435,96);
var describe8 = new Image(435,96);
describe0.src = "http://www.toroscope.com/webdesign/resources/images/ini-describe.gif";
describe1.src = "http://www.toroscope.com/webdesign/resources/images/fengshuithis.jpg";
describe2.src = "http://www.toroscope.com/webdesign/resources/images/fsn.jpg";
describe3.src = "http://www.toroscope.com/webdesign/resources/images/fsrc-uae.jpg";
describe4.src = "http://www.toroscope.com/webdesign/resources/images/marybax.jpg";
describe5.src = "http://www.toroscope.com/webdesign/resources/images/nlbd.jpg";
describe6.src = "http://www.toroscope.com/webdesign/resources/images/zhsaa.jpg";
describe7.src = "http://www.toroscope.com/webdesign/resources/images/toroscope.jpg";
describe8.src = "http://www.toroscope.com/webdesign/resources/images/form.jpg";

function validate_form(form) {

      if (!check_empty(document.form.firstname.value))  {
        alert('Please enter your First Name');
        document.form.firstname.focus();
        return false;  
      }

      if (!check_empty(document.form.lastname.value))  {
        alert('Please enter your Last Name');
        document.form.lastname.focus();
        return false;  
      }

      if (!check_empty(document.form.email.value))  {
         alert('Please enter a valid email address in approved format: whatitis@whatelseitis.ext');
         document.form.email.focus(); 
         document.form.email.select(); 
         return false;
      }

      if (!check_empty(document.form.comments.value))  {
         alert('Please provide some basic details of what you are looking for.');
         document.form.comments.focus(); 
         return false;
      }

      if (document.form.comments.value.length > 250) {
         alert ('Max length for Request Details is 250 characters. Please retype before continuing.');
         document.form.comments.focus();
         document.form.comments.select();
         return false;
      }

      if (document.form.spamcheck.value != "right")  {
        alert("Correct answer to the mandatory question is 'right', small letters without the quotes");
        document.form.spamcheck.focus();
        document.form.spamcheck.select();
        return false;  
      }

   return true;

   }

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

function submitPPform() {
  document.ppbuyform.submit();
}

function validate_form2(form) {
      if (!check_empty(document.formpayment.itemnumber.value))  {
        alert('Please enter your Invoice Number');
        document.formpayment.itemnumber.focus();
        return false;  
      }
      if (document.form.spamcheck.value != "right")  {
        alert("Correct answer to the mandatory question is 'right', small letters without the quotes");
        document.form.spamcheck.focus();
        document.form.spamcheck.select();
        return false;  
      }
 return true;
}
