<!--

// Display Date
function displayclock () {
	var now   = new Date();
	var month = "";
	var year  = "";
	var date  = now.getDate();
	var browserName = navigator.appName.toLowerCase(); 
	
	if (now.getMonth() == 0) month = "January"
	if (now.getMonth() == 1) month = "February"
	if (now.getMonth() == 2) month = "March"
	if (now.getMonth() == 3) month = "April"
	if (now.getMonth() == 4) month = "May"
	if (now.getMonth() == 5) month = "June"
	if (now.getMonth() == 6) month = "July"
	if (now.getMonth() == 7) month = "August"
	if (now.getMonth() == 8) month = "September"
	if (now.getMonth() == 9) month = "October"
	if (now.getMonth() == 10) month = "November"
	if (now.getMonth() == 11) month = "December"
	if (now.getYear() < 100) year = "19" + now.getYear()
	
	if (browserName.indexOf("microsoft") != -1) {
		if (now.getYear() >= 100) year = now.getYear()
	} else {
		if (now.getYear() >= 100) year = "20" + now.getYear() - 18100
	}
	
	if (now.getDay() == 0) day = "Sunday"
	if (now.getDay() == 1) day = "Monday"
	if (now.getDay() == 2) day = "Tuesday"
	if (now.getDay() == 3) day = "Wednesday"
	if (now.getDay() == 4) day = "Thursday"
	if (now.getDay() == 5) day = "Friday"
	if (now.getDay() == 6) day = "Saturday"
		
	document.write( day + ", " + month + " " + date + ", " + year)
}
function displayyear () {
	var d = new Date();
	document.write(d.getFullYear())
}

// Book mark
function bookmark(url, description) {
	netscape="Netscape User's hit CTRL+D to add a bookmark to this site."
	if (navigator.appName=='Microsoft Internet Explorer')
	{
	window.external.AddFavorite(url, description);
	}
	else if (navigator.appName=='Netscape')
	{
	alert(netscape);
	}
}
// Jumpmenu

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

// Non spam email address
var user; 
var doJAVASCRIPT; 
var suffix; 
function jemail(user, doJAVASCRIPT, suffix){ 
document.write('<a href="' + 'mailto:' + user + '@' + doJAVASCRIPT + '.' + suffix + '">' + user + '@' + doJAVASCRIPT + '.' + suffix + '</a>');

} 
// Open Window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateContactForm() {
	msg = ""
	if(!document.myform.txtName.value) msg += "* Your Name is a required field.\n\n"
	if(!document.myform.txtEmail.value) msg += "* Your E-mail Address is a required field.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n\n"
	if(!document.myform.txtQuestion.value) msg += "* Please enter your question.\n\n"
	if (msg == ""){
	return true;
	}
	else
	{
	msg = "We Found The Following Omissions In Your Form: \n\n" + msg;
	alert(msg);
	return false;
	}
}

function validateOrderForm() {
	msg = ""
	if(!document.myform.txtName.value) msg += "* Your Name is a required field.\n\n"
	if(!document.myform.txtAddress.value) msg += "* Your Mailing Address is a required field.\n\n"
	if(!document.myform.txtCity.value) msg += "* Your City is a required field.\n\n"
	if(!document.myform.txtState.value) msg += "* Your State is a required field.\n\n"
	if(!document.myform.txtZip.value) msg += "* Your Zip Code is a required field.\n\n"
	if(!document.myform.txtEmail.value) msg += "* Your E-mail Address is a required field.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n\n"
	if (msg == ""){
	return true;
	}
	else
	{
	msg = "We Found The Following Omissions In Your Form: \n\n" + msg;
	alert(msg);
	return false;
	}
	}
	
function validateRefillForm() {
	msg = ""
	if(!document.myform.txtFirstName.value) msg += "* Your First Name is a required field.\n\n"
	if(!document.myform.txtLastName.value) msg += "* Your Last Name is a required field.\n\n"
	if(!document.myform.txtAddress.value) msg += "* Your Shipping Address is a required field.\n\n"
	if(!document.myform.txtCity.value) msg += "* Your City is a required field.\n\n"
	if(!document.myform.txtState.value) msg += "* Your State is a required field.\n\n"
	if(!document.myform.txtZipCode.value) msg += "* Your Zip Code is a required field.\n\n"
	if(!document.myform.txtPhone.value) msg += "* Your Telephone is a required field.\n\n"
	if(!document.myform.txtEmail.value) msg += "* Your E-mail Address is a required field.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n\n"
	else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n\n"
	if (msg == ""){
	return true;
	}
	else
	{
	msg = "We Found The Following Omissions In Your Form: \n\n" + msg;
	alert(msg);
	return false;
	}
}	

function validateTellFriendForm() {
	msg = ""
	if(!document.myform.txtYourName.value) msg += "* Your Name is a required field.\n"
	if(!document.myform.txtYourEmail.value) msg += "* Your E-mail Address is a required field.\n"
	else if(!(document.myform.txtYourEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n"
	else if(!(document.myform.txtYourEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n"
	if(!document.myform.txtFriendEmail.value) msg += "* Your Friend's E-mail Address is a required field.\n"
	else if(!(document.myform.txtFriendEmail.value.match(/\@/))) msg += "* Include the @ symbol in your Friend's E-mail Address.\n"
	else if(!(document.myform.txtFriendEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your Friend's E-mail Address must be in the format xxx@xxx.xxx\n"
	
	if (msg == ""){
	return true;
	}
	else
	{
	msg = "We Found The Following Omissions In Your Form: \n" + msg;
	alert(msg);
	return false;
	}
}	

function validateLinkExchangeForm() {
		msg = ""
		if(!document.myform.selCategory.value) msg += "* Pick one Category for your link.\n"
		if(!document.myform.txtYourUrl.value) msg += "* Enter your website URL.\n"
		if(!document.myform.txtTitle.value) msg += "* Enter your website title.\n"
		if(!document.myform.txtDescription.value) msg += "* Enter your website description.\n"
		if(!document.myform.txtEmail.value) msg += "* Enter your E-mail address.\n"
		else if(!(document.myform.txtEmail.value.match(/\@/))) msg += "* Include the @ symbol in your E-mail Address.\n"
		else if(!(document.myform.txtEmail.value.match(/\S+\@\S+\.\S+/))) msg += "* Your E-mail Address must be in the format xxx@xxx.xxx\n"
		if(!document.myform.txtOurUrl.value) msg += "* Please provide us the URL of where we can find our link.\n"
		if (msg == ""){
		return true;
		}
		else
		{
		msg = "We Found The Following Problems With Your Form: \n\n" + msg;
		alert(msg);
		return false;
		}
	}


function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------
function checkEmail(theForm) {
    if (theForm.txtEmail.value != theForm.txtEmail2.value)
    {
        alert('Your email addresses don\'t match! \n\n Please ensure that your email addresses are correct so we can get back to you.');
        return false;
    } else {
        return true;
    }
}
// Affiliate Form checker
function checkAffiliateForm(form) {

  if ( form.company_name.value.length == 0 ) {
    alert('Please enter an affiliate name.');
    form.company_name.focus();
    return false;
  }
  else if ( form.address1.value.length == 0 ) {
    alert('Please enter an address.');
    form.address1.focus();
    return false;
  }
  else if ( form.city.value.length == 0 ) {
    alert('Please enter a city.');
    form.city.focus();
    return false;
  }
  else if ( form.state.value.length == 0 || form.state.value == 'none' ) {
    alert('Please select a state.');
    form.state.focus();
    return false;
  }
  else if ( form.country.value.length == 0 || form.country.value == 'none' ) {
    alert('Please select a country.');
    form.country.focus();
    return false;
  }
  else if ( form.zip_code.value.length == 0 ) {
    alert('Please enter a zip code.');
    form.zip_code.focus();
    return false;
  }
  else if ( form.zip_code.value.length > 7 || form.zip_code.value.length < 5 ) {
    alert('Please enter a zip code of >= 5 and <= 7 digits.');
    form.zip_code.focus();
    return false;
  }
  else if ( form.zip_code.value.indexOf('.') > -1 || form.zip_code.value.indexOf('\'') > -1 || form.zip_code.value.indexOf('"') > -1 || form.zip_code.value.indexOf('&') > -1 || form.zip_code.value.indexOf('-') > -1) {
    alert('The zip code contains invalid characters.');
    form.zip_code.focus();
    return false;
  }
  else if ( form.contact_name.value.length == 0 ) {
    alert('Please enter a contact name.');
    form.contact_name.focus();
    return false;
  }
  else if ( form.phone.value.length == 0 ) {
    alert('Please enter a phone number.');
    form.phone.focus();
    return false;
  }  
  else if ( form.phone.value.length > 16 ) {
    alert('The phone number can\'t contain more than 16 characters.');
    form.phone.focus();
    return false;
  }
  else if ( form.fax.value.length > 16 ) {
    alert('The fax number can\'t contain more than 16 characters.');
    form.fax.focus();
    return false;
  }
  else if ( form.email.value.length == 0 ) {
    alert('Please enter an email address.');
    form.email.focus();
    return false;
  }
  else if ( form.email.value.length > 50 ) {
    alert('The email address can\'t be more than 50 characters is length.');
    form.email.focus();
    return false;
  }
  else if ( form.email.value.length < 6 || form.email.value.indexOf('@') == -1 || form.email.value.indexOf('.') > form.email.value.length - 3 || ( form.email.value.indexOf('.com') == -1 && form.email.value.indexOf('.net') == -1 && form.email.value.indexOf('.org') == -1 && form.email.value.indexOf('.ca') == -1 && form.email.value.indexOf('.gov') == -1 ) ) {
    alert('Please enter a valid email address.\n(example: you@yourdomain.com)');
    form.email.focus();
    return false;
  }
  else if ( form.confirm_email.value.length == 0 ) {
    alert('Please confirm your email address.');
    form.confirm_email.focus();
    return false;
  }
  else if ( form.confirm_email.value.length < 6 || form.confirm_email.value.indexOf('@') == -1 || form.confirm_email.value.indexOf('.') > form.confirm_email.value.length - 3 || ( form.confirm_email.value.indexOf('.com') == -1 && form.confirm_email.value.indexOf('.net') == -1 && form.confirm_email.value.indexOf('.org') == -1 && form.confirm_email.value.indexOf('.ca') == -1 && form.confirm_email.value.indexOf('.gov') == -1 ) ) {
    alert('Please enter a valid confirmation email address.\n(example: you@yourdomain.com)');
    form.confirm_email.focus();
    return false;
  }
  else if ( form.email.value != form.confirm_email.value ) {
    alert('The email address and the confirmation email address must be the same.');
    form.email.focus();
    return false;
  }
  else {
    return true;
  }
}
-->
//-->

