function validateLogin(form)
{
  return true;
}

function validateContact(form) {
  var error = '';
  if (form.name.value == '') {
    error += '- Name\n';
  }
  if (form.email.value == '') {
    error += '- Email\n';
  }
  if (form.comments.value == '') {
    error += '- Comments\n';
  }
  if (error != '') {
    alert('The following fields are required:\n'+error);
    return false;
  } else {
    return true;
  }
}

function validateSupport(form) {
  var error = '';
  if (form.name.value == '') {
    error += '- Name/Company\n';
  }
  if (form.contact.value == '') {
    error += '- Contact person\n';
  }
  if (form.phone.value == '') {
    error += '- Phone\n';
  }
  if (!validEmail(form.email.value)) {
    error += '- Email\n';
  }
  if (error != '') {
    alert('The following fields are required:\n'+error);
    return false;
  } else {
    return true;
  }
}

function validateFriend(form) {
  var error = '';
  if (form.name.value == '') {
    error += '- Your name\n';
  }
  if (form.email.value == '') {
    error += '- Your email\n';
  }
  if (form.friend.value == '') {
    error += '- Friend\'s email\n';
  }
  if (error != '') {
    alert('The following fields are required:\n'+error);
    return false;
  } else {
    return true;
  }
}

function validatePool(form) {
  var error = '';
  if (form.firstname.value == '') {
  	error += '- First name\n';
  }
  if (form.lastname.value == '') {
    error += '- Last name\n';
  }
  if (isNaN(form.age.value)) {
  	error += '- Your age\n';
  }
  if (form.passw.value == '') {
    error += '- Your password\n';
  }
  if (form.passw.value != form.confirm.value) {
    error += '- Confirm password\n';
  }
  if (form.talent.value == '') {
    error += '- Your talent\n';
  }
  if (!validEmail(form.email.value)) {
    error += '- Email address\n';
  }
  if (form.phone.value == '') {
  	error += '- Contact number\n';
  }
  if (error != '') {
  	alert('The following fields are required:\n'+error);
  	return false;
  } else {
  	return true;
  }
}

function validEmail(email)
{
	var re = /^\w+[\w.-]*\w+@\w+[\w.-]*\w+$/;
	return re.test(email);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Splintered striper 1.3
// reworking of Zebra Tables and similar methods which works not only for tables and even/odd rows,
// but as a general DOM means of assigning any number of classes to children of a parent element.
// Patrick H. Lauke aka redux / www.splintered.co.uk
// Distributed under the Creative Commons Attribution-ShareAlike license - http://creativecommons.org/licenses/by-sa/2.0/


/*
 * Summary:      Core experiment function that applies any number of classes to all child elements
 *               contained in all occurences of a parent element (either with or without a specific class)
 * Parameters:   parentElementTag - parent tag name
 *               parentElementClass - class assigned to the parent; if null, all parentElementTag elements will be affected
 *               childElementTag -  tag name of the child elements to apply the styles to
 *               styleClasses - comma separated list of any number of style classes (using 2 classes gives the classic "zebra" effect)
 * Return:       none
 */
function striper(parentElementTag, parentElementClass, childElementTag, styleClasses)
{
  var i=0,currentParent,currentChild;
  // capability and sanity check
  if ((document.getElementsByTagName)&&(parentElementTag)&&(childElementTag)&&(styleClasses)) {
    // turn the comma separate list of classes into an array
    var styles = styleClasses.split(',');
    // get an array of all parent tags
    var parentItems = document.getElementsByTagName(parentElementTag);
    // loop through all parent elements
    while (currentParent = parentItems[i++]) {
      // if parentElementClass was null, or if the current parent's class matches the specified class
      if ((parentElementClass == null)||(currentParent.className == parentElementClass)) {
        var j=0,k=0;
        // get all child elements in the current parent element
        var childItems = currentParent.getElementsByTagName(childElementTag);
        // loop through all child elements
        while (currentChild = childItems[j++]) {
          // based on the current element and the number of styles in the array, work out which class to apply
          k = (j+(styles.length-1)) % styles.length;
          // add the class to the child element - if any other classes were already present, they're kept intact
          currentChild.className = currentChild.className+" "+styles[k];
        }
      }
    }
  }
}