function menu(posn)
{
  document.write ("<TABLE cellspacing=0 cellpadding=0><TR><TD>");
  document.write ("<TR>");
  document.write ("<TD><UL><li><A HREF=\"index.html\"");
//  if  (posn == 1)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">Home</A></li></UL></TD>");
  document.write ("<TD><UL><li><A HREF=\"About-Me.html\"");
//  if  (posn == 2)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">About Me</A></li></UL></TD>");
  document.write ("<TD><UL><li><A HREF=\"Services.html\"");
//  if  (posn == 3)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">Services</A></li></UL></TD>");
  document.write ("<TD><UL><li><A HREF=\"Testimonials.html\"");
//  if  (posn == 4)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">Testimonials</A></li></UL></TD>");
  document.write ("<TD><UL><li><A HREF=\"Related-Links.html\"");
//  if  (posn == 5)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">Related Links</A></li></UL></TD>");
  document.write ("<TD><UL><li><A HREF=\"Contact.html\"");
//  if  (posn == 6)
//    document.write (" style=\"background	: url(images/bg-menu-on.gif) no-repeat;\"");
  document.write (">Contact Us</A></li></UL></TD>");
  document.write ("</TR></TABLE>");
}


// ALL Scripts for PHP Modules
// (c) Bout Time Software


//////////////////////////////////////////////////////////
///////////////// image selection fade out and in
/////////////////////////////////////////////////////////

  var browser=navigator.appName;
  var b_version=navigator.appVersion;
  var bversion=parseFloat(b_version);
  if (browser=="Microsoft Internet Explorer")
  {
    if (bversion <= 4)
     isitie = 1;
    else
     isitie = 2;
  }
  else
    isitie = 0;

  var newsrc = "";
  var fn1 = 1;
  var fn2 = 100;
  var imgposition = "";


////////////////////////////////////////
// function to show top slideshow fixed fade in/out
/////////////////////////////////////////
home = ["1","2","3"];

var pos = 0;
var sc = home;
var fn1 = 1;
var fn2 = 100;
var sdelay = 2000;

function sshow()
{
  if (pos >= (sc.length-1))
    pos = 0;
  else
    pos++;

  var newsrc = "images/header"+sc[pos]+".jpg";		// get new source location using fdata which is path structure

   document.images['prelo'].src = newsrc;

  if (browser=="Microsoft Internet Explorer")
  {
    if (bversion <= 4)
     setTimeout("fadeit(1,'"+newsrc+"')",sdelay);
  else
     setTimeout("fadeit(2,'"+newsrc+"')",sdelay);
  }
  else
    setTimeout("fadeit(0,'"+newsrc+"')",sdelay);
}

function fadeit(isitie, newimage)
{
   delay = 50;
   fn1 = fn1 - 0.25;
   fn2 = fn2 - 25;

   document.images['sshowimg'].style.opacity =fn1;
   if (isitie)
      document.images['sshowimg'].style.filter = 'alpha(opacity='+fn2+')';

   if (fn2)
      setTimeout("fadeit("+isitie+",'"+newimage+"')",delay);
   else
   {
      document.images['sshowimg'].src = newimage;

     var pic=new Image();

    if (isitie == 1)
    {
      pic.onload = function() {setTimeout("fadeitup("+isitie+")",delay*2);};
      pic.onerror = function() {setTimeout("fadeitup("+isitie+")",delay*2);};
      pic.src= newimage;
    }
    else
    {
     pic.src= newimage;
     if(pic.complete) setTimeout("fadeitup("+isitie+")",delay*2);
      else setTimeout("checkimgstatus("+isitie+",'"+newimage+"')",delay*2);
    }
   }
}
function fadeitup(isitie)
{
   delay = 50;
   fn1 = fn1 + 0.25;
   fn2 = fn2 + 25;

   document.images['sshowimg'].style.opacity =fn1;
   if (isitie)
      document.images['sshowimg'].style.filter = 'alpha(opacity='+fn2+')';

   if (fn2 < 100)
     setTimeout("fadeitup("+isitie+")",delay);
   else
     setTimeout("sshow()",sdelay);
}

function checkimgstatus(isitie,newimage)
{
  var pic=new Image(440,315);
  pic.src= newimage;

  if(pic.complete) setTimeout("fadeitup("+isitie+")",delay*2);
   else setTimeout("checkimgstatus("+isitie+",'"+newimage+"')",delay*2);
}


//*******************************************************************//

alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];

var showcode = "";
var co1 = Math.floor(Math.random()*25);
var co2 = Math.floor(Math.random()*25);
var co3 = Math.floor(Math.random()*25);
var co4 = Math.floor(Math.random()*25);

var authcode = alpha[co1]+alpha[co2]+alpha[co3]+alpha[co4];

showcode = "<IMG SRC=\"layout/codes/"+alpha[co1]+".png\">";
showcode += "<IMG SRC=\"layout/codes/"+alpha[co2]+".png\">";
showcode += "<IMG SRC=\"layout/codes/"+alpha[co3]+".png\">";
showcode += "<IMG SRC=\"layout/codes/"+alpha[co4]+".png\">";

function Updatevcode()
{
  document.getElementById("VVCode").innerHTML=showcode;
}

function validate_feedback()
{
   var valid = true;

   var missing = "";
   if ( window.document.Feedback.name.value == "" )
   {
      missing += "- Your Name\n";
      window.document.Feedback.name.focus();
   }
   if ( window.document.Feedback.email.value == "" )
   {
      missing += "- Your Email\n";
      window.document.Feedback.email.focus();
   }
   else valid = validate_email(window.document.Feedback.email,"The email address you entered does not appear to be valid")
   if ( window.document.Feedback.vcode.value == "" )
   {
      missing += "- Validation Code\n";
      window.document.Feedback.vcode.focus();
   }
   if ( window.document.Feedback.vcode.value != authcode )
   {
      missing += "\nThe Validation Code you Entered is incorrect\n";
      window.document.Feedback.vcode.focus();
   }
   if (missing != "")
   {
      alert ( "The following required field(s) in your subscription have not been completed\n\n" + missing);
      valid = false;
   }
   if (valid)
     window.open('about:blank','formtarget','width=800,height=500');

   return valid;
}

function validate_email(field,alerttxt)
{
 with (field)
 {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2) 
   {alert(alerttxt);
    return false;
   }
  else {return true;}
 }
} 

// -- END --
