
function page_init() {
window.weekstart  ='1';
window.dateformat ='MM/DD/YYYY';
window.longdateformat ='Month DD, YYYY';
window.timeformat ='fmHH:fmMI am';
window.timeformatwithseconds ='fmHH:fmMI:SS am';
window.datetime_am_string ='am';
window.datetime_pm_string ='pm';
window.datetime_short_months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","");window.phoneformat ="123-456-7890";
window.isvalid = true;
setWindowChanged(window, false);
setIsInited(window,false);
page_init2();
page_init3();
setWindowChanged(window, false);
page_init4();
setIsInited(window,true);
window.status = '';
}

function page_unload() {
if (window.ischanged)
return('You have not yet submitted this record.') }
function page_reset() {
document.page_is_resetting=true;
document.forms['main_form'].reset();
setWindowChanged(window, false);
page_init3();
var savechanged = window.ischanged;
setWindowChanged(window, savechanged);
window.isvalid = true;
window.clickCount=0;
if (window.clickCount == 0)
{
setTimeout(function(){if ( isFocusable( document.forms['main_form'].elements['firstname'] ) ) { document.forms['main_form'].elements['firstname'].focus();}}, 0);
}
nlapiPageInit('create');
nlapiSetFieldValue('nsbrowserenv', 'istop=' + (window==top ? 'T':'F'));
document.page_is_resetting=false;
}
function save_record(lastcall) {
 
if (!window.isinited) return false;
var form = document.forms['main_form'];
if (form.submitted) {
if (form.submitted.value == 'T') { 
var resubmit = false;
resubmit = confirm('You have already submitted this form, would you like to submit it again?'); 
if(!resubmit) return false;
}
}
try {
if (!nlapiSaveRecord()) return false;
var emptylabels = checkMandatoryFields(new Array(document.forms['main_form'].elements['firstname'],document.forms['main_form'].elements['lastname'],document.forms['main_form'].elements['phone'],document.forms['main_form'].elements['email'],document.forms['main_form'].elements['custentity_due_date'],document.forms['main_form'].elements['address1'],document.forms['main_form'].elements['city'],document.forms['main_form'].elements['state'],document.forms['main_form'].elements['zipcode'],document.forms['main_form'].elements['custentity179']),new Array('First Name','Last Name','Phone','Email','Expected Due Date','Address 1','City','State','Zip Code','Insurance Provider'),null,null);if (emptylabels.length>0) {
alert('Please enter value(s) for: ' + emptylabels);
return false;
}
} catch(err) {
  alert('You cannot submit this form due to an unexpected error.'); return false;
}
setWindowChanged(window, false);
if(lastcall == true && form.submitted) form.submitted.value='T';
return true;
}
function checkMachineValid(mach)
{
 if (document.forms[0].elements[mach+'valid'] != null && document.forms[0].elements[mach+'valid'].value=='F') {
 alert('One or more sublists had errors.'); return false;}
 return true;
}
 
function Listcustentity179(fld, multi,addlparams) {
var displayField = document.forms['main_form'].elements['custentity179'];if ( displayField != null && !displayField.isvalid) {    displayField.isvalid = true;    window.isvalid = true;    displayField.value = '';}NLPopupSelect_displayLoadingDiv('custentity179', false);var serverUrl = 'https://forms.netsuite.com/app/site/crm/externalleadpage.nl?staticunlayered=T&h=8392e346ecc1eb53f511&compid=328623&formid=18&subsidiary=-1&q=custentity179&l=T&t=main:custentity179'+(multi ? '&multi=T' : '')+''+(addlparams?'&'+addlparams:'')+'';
document.frames['server_commands'].document.location.replace(serverUrl); }
 
var ftabs = new Array();
var ftypes = new Array();
var fparents = new Array();
ftypes['firstname']='text';
ftabs['firstname']='main';
ftypes['lastname']='text';
ftabs['lastname']='main';
ftypes['custentity_due_date']='date';
ftabs['custentity_due_date']='main';
ftypes['address1']='text';
ftabs['address1']='main';
ftypes['address2']='text';
ftabs['address2']='main';
ftypes['city']='text';
ftabs['city']='main';
ftypes['state']='select';
ftabs['state']='main';
ftypes['zipcode']='text';
ftabs['zipcode']='main';
ftypes['phone']='phone';
ftabs['phone']='main';
ftypes['custentity_evening_phone']='phone';
ftabs['custentity_evening_phone']='main';
ftypes['email']='email';
ftabs['email']='main';
ftypes['comments']='textarea';
ftabs['comments']='main';
ftypes['custentity_promo_code_website_form']='text';
ftabs['custentity_promo_code_website_form']='main';
ftypes['custentity_where_heard']='select';
ftypes['custentity_time_created']='date';
ftypes['custentity179']='select';
ftabs['custentity179']='main';
ftypes['taxable']='checkbox';
var fScriptIds = null;
window.nsDefaultContextObj={"roleid":"online_form_user","location":"0","department":"0","rolecenter":"CUSTOMER","contact":"0","version":"2011.1","environment":"PRODUCTION","email":"onlineformuser@328623.com","name":"-System-","company":"328623","context":"userinterface","role":"31","subsidiary":"1","user":"-4"};
function checkemailaccess(id) {
document.frames['server_commands'].document.location.replace('/app/common/entity/checkemailaccess.nl?compid=328623&id='+id+'&email='+document.forms['main_form'].elements['email'].value);
}
function addShortcut() {
nlOpenWindow('https://forms.netsuite.com/core/pages/addShortcut.nl?label='+escape('Request for Information 2')+'&taskid=null&params=h%3D8392e346ecc1eb53f511%26compid%3D328623%26formid%3D18%26subsidiary%3D-1','addshortcut','scrollbars=no,width=400,height=150');
}
function localEval(s) {
return eval(s);
}
function page_init3() {
}

var vismachs = new Array();
var allmachs = new Array();
allmachs['main']='';
function page_init2() {
}
function page_init4() {
if (window.clickCount == 0)
{
setTimeout(function(){if ( isFocusable( document.forms['main_form'].elements['firstname'] ) ) { document.forms['main_form'].elements['firstname'].focus();}}, 0);
}
nlapiPageInit('create');
nlapiSetFieldValue('nsbrowserenv', 'istop=' + (window==top ? 'T':'F'));
}



function page_init() {
window.weekstart  ='1';
window.dateformat ='MM/DD/YYYY';
window.longdateformat ='Month DD, YYYY';
window.timeformat ='fmHH:fmMI am';
window.datetime_am_string ='am';
window.datetime_pm_string ='pm';
window.datetime_short_months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","");window.phoneformat ="123-456-7890";
window.isvalid = true;
setWindowChanged(window, false);
setIsInited(window,false);
page_init2();
page_init3();
setWindowChanged(window, false);
page_init4();
setIsInited(window,true);
window.status = '';

var currentTime = new Date()
var currentMonth = currentTime.getMonth() + 1
var currentDayOfMonth = currentTime.getDate()
var currentYear = currentTime.getFullYear()
document.main_form.custentity_time_created.value = currentMonth + "/" + currentDayOfMonth + "/" + currentYear;
}



