﻿// JavaScript File

function IsEmpty(aTextField) {
   if ((aTextField.value.length==0) ||
   (aTextField.value==null)) {
      return true;
   }
   else { return false; }
}	


function validateDataxxx() {            
    if ((IsEmpty(document.upload.txtName))|| (IsEmpty(document.upload.txtEmail)) || (IsEmpty(document.upload.txtPhone)) || (IsEmpty(document.upload.mcFileUp))){           
        alert('Required Information is Missing');
  //      document.upload.txtName.focus();
        return false;
    } //if no name
    else               
        ShowProgress();
           
    return true;
}//validate data

function ShowProgress()
{
	var w = 350;
	var h = 220;
	var l = (screen.width - w) / 2;
	var t = (screen.height - h) / 2;
	winprops = 'resizable=0, height='+h+',width='+w+',top='+t+',left='+l+'w';
	var f = window.open('Progress.aspx?ID='+document.forms[0].__MEDIACHASE_FORM_UNIQUEID.value, "_blank", winprops);
}//show progress


function validateData() {
if (IsEmpty(document.upload.mcFileUp)){           
        alert('A File Required for Upload');
        document.upload.mcFileUp.focus();
	return false;
}
if (IsEmpty(document.upload.txtName)){           
        alert('A Name is Required');
        document.upload.txtName.focus();
	return false;
}
if (IsEmpty(document.upload.txtCompany)){           
        alert('A Company Name is Required');
        document.upload.txtCompany.focus();
	return false;
}
if (IsEmpty(document.upload.txtEmail)){           
        alert('An Email Address is Required');
        document.upload.txtEmail.focus();
	return false;
}
if (IsEmpty(document.upload.txtPhone)){           
        alert('Please Provide a Phone Number');
        document.upload.lstAccountRep.focus();
	return false;
}
if (IsEmpty(document.upload.lstAccountRep)){           
        alert('Please select an Account Rep');
        document.upload.lstAccountRep.focus();
	return false;
}
else
	ShowProgress();	
	return true;
	
}





function validateDataWWW() {
    if (IsEmpty(document.upload.txtName)){           
        alert('A Name is Required');
      //  document.upload.txtName.focus();
        return false;
     }
    else      
	ShowProgress();
	return true;
}
