﻿
myWindow = 'LinkWindow';
function win(fileName) {
       window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=400,height=500,screenX=0,screenY=0,top=0,left=235')
}

myWindow = 'LinkWindow';
function winClientUpload(fileName) {
       window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=780,height=500,screenX=0,screenY=0,top=0,left=25')
}

function loadInParent(url, closeSelf){
	self.opener.location = url;
	if(closeSelf) self.close();
}

function validatePromoForm() {
    
	if (document.promo.companyName.value=="") {
    	alert('You must fill in the Company Name field before submitting');
    	document.promo.companyName.focus();
    	return false;
    }
    if (document.promo.contactName.value=="") {
    	alert('You must fill in the Contact Name field before submitting');
    	document.promo.contactName.focus();
    	return false;
    }
    if (document.promo.address.value=="") {
    	alert('You must fill in the Address field before submitting');
    	document.promo.address.focus();
    	return false;
    }
    if (document.promo.city.value=="") {
    	alert('You must fill in the City field before submitting');
    	document.promo.city.focus();
    	return false;
    }
    if (document.promo.state.value=="") {
    	alert('You must fill in the State field before submitting');
    	document.promo.state.focus();
    	return false;
    }
    if (document.promo.zip.value=="") {
    	alert('You must fill in the Zip field before submitting');
    	document.promo.zip.focus();
    	return false;
    }
    if (document.promo.phone.value=="") {
    	alert('You must fill in the Phone field before submitting');
    	document.promo.phone.focus();
    	return false;
    }
    if (document.promo.email.value=="") {
    	alert('You must fill in the Email field before submitting');
    	document.promo.email.focus();
    	return false;
    }
    if (document.promo.email.value.length < 5) {
    	alert('You have entered an invalid Email address.  Please correct before submitting');
    	document.promo.email.focus();
    	return false;
    }
    if (document.promo.email.value.indexOf("@")<0) {
    	alert('You have entered an invalid Email address.  Please correct before submitting');
    	document.promo.email.focus();
    	return false;
    }
    if (document.promo.challengeComments.value=="") {
    	alert('You must fill in the Marketing Challenge field before submitting');
    	document.promo.challengeComments.focus();
    	return false;
    }
   }

function validateCareerForm() {
    
	if (document.career.firstName.value=="") {
    	alert('You must fill in your first name before submitting');
    	document.career.firstName.focus();
    	return false;
    }
    if (document.career.lastName.value=="") {
    	alert('You must fill in your last name before submitting');
    	document.career.lastName.focus();
    	return false;
    }
    if (document.career.address.value=="") {
    	alert('You must fill in the address field before submitting');
    	document.career.address.focus();
    	return false;
    }
    if (document.career.city.value=="") {
    	alert('You must fill in the city field before submitting');
    	document.career.city.focus();
    	return false;
    }
    if (document.career.state.value=="") {
    	alert('You must fill in the state field before submitting');
    	document.career.state.focus();
    	return false;
    }
    if (document.career.zip.value=="") {
    	alert('You must fill in the zip field before submitting');
    	document.career.zip.focus();
    	return false;
    }
    if (document.career.phone.value=="") {
    	alert('You must fill in the phone field before submitting');
    	document.career.phone.focus();
    	return false;
    }
    if (document.career.email.value=="") {
    	alert('You must fill in the email field before submitting');
    	document.career.email.focus();
    	return false;
    }
    if (document.career.email.value.length < 5) {
    	alert('You have entered an invalid email address.  Please correct before submitting');
    	document.career.email.focus();
    	return false;
    }
    if (document.career.email.value.indexOf("@")<0) {
    	alert('You have entered an invalid email address.  Please correct before submitting');
    	document.career.email.focus();
    	return false;
    }
   }
   
 function validateContactsForm() {
    
    if (document.contact.firstName.value=="") {
    	alert('You must fill in the First Name field before submitting');
    	document.contact.firstName.focus();
    	return false;
    }
	if (document.contact.lastName.value=="") {
    	alert('You must fill in the Last Name field before submitting');
    	document.contact.lastName.focus();
    	return false;
    }
    if (document.contact.address.value=="") {
    	alert('You must fill in the Address field before submitting');
    	document.contact.address.focus();
    	return false;
    }
    if (document.contact.city.value=="") {
    	alert('You must fill in the City field before submitting');
    	document.contact.city.focus();
    	return false;
    }
    if (document.contact.state.value=="") {
    	alert('You must fill in the State field before submitting');
    	document.contact.state.focus();
    	return false;
    }
    if (document.contact.zip.value=="") {
    	alert('You must fill in the Zip field before submitting');
    	document.contact.zip.focus();
    	return false;
    }
    if (document.contact.phone.value=="") {
    	alert('You must fill in the Phone field before submitting');
    	document.contact.phone.focus();
    	return false;
    }
    if (document.contact.email.value=="") {
    	alert('You must fill in the Email field before submitting');
    	document.contact.email.focus();
    	return false;
    }
    if (document.contact.email.value.length < 5) {
    	alert('You have entered an invalid Email address.  Please correct before submitting');
    	document.contact.email.focus();
    	return false;
    }
    if (document.contact.email.value.indexOf("@")<0) {
    	alert('You have entered an invalid Email address.  Please correct before submitting');
    	document.contact.email.focus();
    	return false;
    }
   }


 function gotop(url) {
	if (document.redeemnow.redeemqty.options[document.redeemnow.redeemqty.selectedIndex].value == 0){
  		return false;
    }else{
    	document.location = url;        
    }
}   
   