
var fieldValidationOKColor="";
var fieldValidationErrorColor="#ff6666";
function bodyOnLoad(){
setFocusFirst();
if(document.form){
formOnLoad();}}
function bodyOnBeforeUnload(){
if(document.form){
if(saveSafe){
if(formHasChanged()){
return"You have made changes on this page which you have not saved.  To save your data, click the 'Cancel' button to return to the page and save your changes.  To leave the page without saving your changes, click the 'OK' button.";}}}}
var loadedFormData=new Object();
function formHasChanged(){
var iElement;
var theElement;
var theForm;
var elemName;
if(document.form){
theForm=document.form;
for(iElement=0;iElement<theForm.length;iElement++){
theElement=theForm[iElement];
if(theElement.name.substring(0,7)=="X_Orig_"){
elemName=theElement.name.substring(7,theElement.name.length);
if(theForm[elemName].length>0){
if(theForm[elemName](0).type=='radio'){
for(var ii=0;ii<theForm[elemName].length;ii++){
if(theForm[elemName](ii).checked){
if(theForm[elemName](ii).value!=theElement.value){
return true;}}}}}
else{
if(theForm[elemName].value!=theElement.value){
return true;}}}}}
return false;}
function changeCheck(){
var ret;
var theForm;
var iElement;
var theElement;
if(saveSafe){
if(document.form){
theForm=document.form;
if(formHasChanged()){
ret=confirm("You have made changes on this page which you have not saved.  To save your data, click the 'Cancel' button to return to the page and save your changes.  To leave the page without saving your changes, click the 'OK' button.");
if(ret){
resetSaveSafeForm();
for(iElement=0;iElement<theForm.length;iElement++){
theElement=theForm[iElement];
if(theElement.name.substring(0,7)=="X_Orig_"){
if(theElement.value!=""){
theForm[theElement.name.substring(7,theElement.name.length)].value=theElement.value}
else{
theForm[theElement.name.substring(7,theElement.name.length)].value="";}}}}
return ret;}}}
resetSaveSafeForm();
return true;}
function resetSaveSafeForm(){
var iElement;
var theElement;
var theForm;
if(document.form){
theForm=document.form;
theForm["X_"+theForm.name+"_FormVarsCached"].value="0";}
saveSafe=false;}
function getCookie(name){
var dc=document.cookie;
var prefix=name+"=";
var begin=dc.indexOf("; "+prefix);
if(begin==-1){
begin=dc.indexOf(prefix);
if(begin!=0)return null;}else
begin+=2;
var end=document.cookie.indexOf(";",begin);
if(end==-1)
end=dc.length;
return unescape(dc.substring(begin+prefix.length,end));}
function setCookie(cookieName,cookieValue,expires,path,domain,secure){
document.cookie=
escape(cookieName)+'='+escape(cookieValue)
+(expires?'; EXPIRES='+expires.toGMTString():'')
+(path?'; PATH='+path:'')
+(domain?'; DOMAIN='+domain:'')
+(secure?'; SECURE':'');}
function setFocusFirst(){
if(document.form){
if(document.forms.length>0){
if(document.form.elements){
if(document.form.elements.length>0){
if((document.form.elements[0].type!="hidden")&&(document.form.elements[0].type!="submit")){
document.form.elements[0].focus();
if(document.form.elements[0].type=="text"){
document.form.elements[0].select();}}}}}}}
var comboData=new Object();
function setComboList(formid,listid){
if(document.form){
if(document.form.elements){
while(document.form.elements[formid].options[0]){
document.form.elements[formid].options[0]=null;}}
if(comboData[formid][listid]){
if(comboData[formid][listid][0]){
for(ii=0;comboData[formid][listid][ii];ii++){
if(document.form.elements){
document.form.elements[formid].options[ii]=new Option(comboData[formid][listid][ii].text,comboData[formid][listid][ii].value);}}}else{
if(document.form.elements){
document.form.elements[formid].options[0]=new Option("        ","");}}}else{
if(document.form.elements){
document.form.elements[formid].options[0]=new Option("        ","");}}}}
errorText=[];
helpText=[];
function doCheckBox(formID,realFormID,step){
if(document.form){
if(document.form[formID].checked){
document.form[realFormID].value="1";}else{
document.form[realFormID].value="0";}
if(step!=""){
doSubmit('',step);}}}
function getRadioValue(radioObject){
var value=null;
for(var ii=0;ii<radioObject.length;ii++){
if(radioObject[ii].checked){
value=radioObject[ii].value;
break;}}
return value}
function doDateRangePointers(formID){
if(document.form){
var value=null;
value=getRadioValue(document.form.X_DateRange_rad);
var d=new Date();
switch(value){
case"1":
document.form["X_DateRange_FromDate"].value="1/1/"+d.getFullYear().toString();
document.form["X_DateRange_ToDate"].value=(d.getMonth()+1).toString()+"/"+d.getDate().toString()+"/"+d.getFullYear().toString();
document.form[formID+"_FromDatePointer"].value="X_DateRange_FromDate";
document.form[formID+"_ToDatePointer"].value="X_DateRange_ToDate";
document.form["X_DateRange_rad"].value="1";
break;
case"2":
document.form["X_DateRange_ToDate"].value=(d.getMonth()+1).toString()+"/"+d.getDate().toString()+"/"+d.getFullYear().toString();
document.form[formID+"_FromDatePointer"].value="X_FromToNowDate";
document.form[formID+"_ToDatePointer"].value="X_DateRange_ToDate";
document.form["X_DateRange_rad"].value="2";
break;
case"3":
document.form[formID+"_FromDatePointer"].value="X_BetweenFromDate";
document.form[formID+"_ToDatePointer"].value="X_BetweenToDate";
document.form["X_DateRange_rad"].value="3";
break;
case"4":
document.form[formID+"_FromDatePointer"].value="";
document.form[formID+"_ToDatePointer"].value="";
document.form["X_DateRange_rad"].value="4";
break;}}}
function doSubmitOnEnter(activity,step,event){
if(event.keyCode==13){
return doSubmit(activity,step);}}
function doValidatedSubmit(activity,step){
if(validateForm()){
return doSubmit(activity,step);}else{
alert("There are problems with the data you have entered.\n\nFields with a red background contain data that is incorrectly formatted.\nPlease review the data and make corrections as needed.");
return false;}}
var validation=[];
var validationMin=[];
var validationMax=[];
function validateForm(){
var valid=true;
if(document.form){
for(formID in validation){
var field=document.form[formID];
switch(validation[formID]){
case'date':
if(validateDate(field.value)){
field.value=formatDate(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;
case'integer':
if(validateInteger(field)){
field.value=formatInteger(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;
case'ssn':
if(validateSSN(field.value)){
field.value=formatSSN(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;
case'time':
if(validateTime(field.value)){
field.value=formatTime(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;
case'currency':
if(validateCurrency(field)){
field.value=formatCurrency(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;
case'DPcurrency':
if(validateDPCurrency(field)){
field.value=formatDPCurrency(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
valid=false;
field.style.backgroundColor=fieldValidationErrorColor;}
break;}}}
return valid;}
function doSubmit(activity,step){
if(document.form){
if(document.form.submitted){
return false;}
document.form.submitted=true;
setTimeout('document.form.submitted = false;',1000);
if(activity!=""){
document.form.action=activity;}
document.form.StepStack.value=step;
document.form.submit();}
return false;}
function doSubmitSelection(activity,step,formID,value){
if(document.form){
document.form[formID].value=value;
doSubmit(activity,step);}}
function displayHelp(fieldName){
if(errorText[fieldName]){
window.status=errorText[fieldName];}else if(errorText[fieldName.substring(2)]){
window.status=errorText[fieldName.substring(2)];}else if(helpText[fieldName]){
window.status=helpText[fieldName];}else if(helpText[fieldName.substring(2)]){
window.status=helpText[fieldName.substring(2)];}}
function clearHelp(){
window.status="";}
function doCheckAll(checked){
var iElement;
var theElement;
var theForm;
if(document.form){
theForm=document.form;
for(iElement=0;iElement<theForm.length;iElement++){
theElement=theForm[iElement];
if(theElement.type=="checkbox"){
if(((checked==true)&&(theElement.checked!=true))||((checked==false)&&(theElement.checked==true))){
theElement.click();
doCheckBox(theElement.name,theElement.name.replace(/cb_/,""));}}}}}
function numberFilter(){
if(event.keyCode>=45&&event.keyCode<=57){
return true;}
return false;}
function zipCodeFilter(formName){
if(event.keyCode>=45&&event.keyCode<=57){
return true;}
if(event.keyCode=='-'.charCodeAt()){
return true;}
return false;}
function SetOrder(col,formID)
{
val="";
if(document.form){
for(j=0;j<document.form[col].length;j++){
if(val>""){val+=",";}
if(document.form[col].options[j].value>"")val+=document.form[col].options[j].value;}
document.form[formID].value=val}}
function orderModule(down,col,formID)
{
if(document.form){
sl=document.form[col].selectedIndex;
if(sl!=-1&&document.form[col].options[sl].value>""){
oText=document.form[col].options[sl].text;
oValue=document.form[col].options[sl].value;
if(document.form[col].options[sl].value>""&&sl>0&&down==0){
document.form[col].options[sl].text=document.form[col].options[sl-1].text;
document.form[col].options[sl].value=document.form[col].options[sl-1].value;
document.form[col].options[sl-1].text=oText;
document.form[col].options[sl-1].value=oValue;
document.form[col].selectedIndex--;}else if(sl<document.form[col].length-1&&document.form[col].options[sl+1].value>""&&down==1){
document.form[col].options[sl].text=document.form[col].options[sl+1].text;
document.form[col].options[sl].value=document.form[col].options[sl+1].value;
document.form[col].options[sl+1].text=oText;
document.form[col].options[sl+1].value=oValue;
document.form[col].selectedIndex++;}}
else{
alert("Please select an item first");}
SetOrder(col,formID);}}
function moveListElement(selA,selB,selAFormID,selBFormID)
{
if(document.form){
for(j=0;j<document.form[selA].length;j++)
{
if(document.form[selA].options[j].selected==true)
{
e=document.createElement("OPTION");
e.text=document.form[selA].options[document.form[selA].selectedIndex].text;
e.value=document.form[selA].options[document.form[selA].selectedIndex].value;
document.form[selB].options.add(e);
document.form[selA].options.remove(document.form[selA].selectedIndex);
j--}}
SetOrder(selA,selAFormID);
SetOrder(selB,selBFormID);}}
function goToStepFromList(fromList,step,extraparams)
{
if(document.form){
document.form.StepStack.value=step+'='+document.form[fromList].options[document.form[fromList].selectedIndex].value+extraparams
document.form.submit()}}
function getKeyCode(event){
if(window.event){
return event.keyCode;}
else if(event.which){
return event.which;}}
function isDigitEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(event.shiftKey)return false;
if(getKeyCode(event)==8)return true;
if(getKeyCode(event)<48)return false;
if(getKeyCode(event)>59)return false;
return true;}
function isDashEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(event.shiftKey)return false;
if(getKeyCode(event)==8)return true;
if(getKeyCode(event)!=45)return false;
return true;}
function isColonEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(getKeyCode(event)==8)return true;
if(!event.shiftKey)return false;
if(getKeyCode(event)!=58)return false;
return true;}
function isForwardSlashEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(event.shiftKey)return false;
if(getKeyCode(event)==8)return true;
if(getKeyCode(event)!=47)return false;
return true;}
function isPeriodEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(event.shiftKey)return false;
if(getKeyCode(event)==8)return true;
if(getKeyCode(event)!=46)return false;
return true;}
function isDollarEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(!event.shiftKey)return false;
if(getKeyCode(event)==8)return true;
if(getKeyCode(event)!=36)return false;
return true;}
function isGreetingEvent(event){
if(event.altKey)return false;
if(event.ctrlKey)return false;
if(getKeyCode(event)==65)return true;
if(getKeyCode(event)==77)return true;
if(getKeyCode(event)==80)return true;
if(getKeyCode(event)==109)return true;
if(getKeyCode(event)==97)return true;
if(getKeyCode(event)==112)return true;
if(!event.shiftKey)return false;
if(getKeyCode(event)!=58)return false;
return true;}
function formatSSN(ssn){
var ssn2=ssn.replace(/-/g,"");
if(ssn2.length==9){
return ssn2.substring(0,3)+'-'+ssn2.substring(3,5)+'-'+ssn2.substring(5,9);}else{
return"";}}
function validateSSN(ssn){
if(ssn.length==0)return true;
ssn=ssn.replace(/-/g,"");
if(!/\d\d\d\d\d\d\d\d\d/.test(ssn)){
return false;}
return true;}
function ssnOnBlur(field,event){
return ssnOnChange(field,event);}
function ssnOnChange(field,event){
if(validateSSN(field.value)){
field.value=formatSSN(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
field.style.backgroundColor=fieldValidationErrorColor;}}
function ssnOnKeyPress(field,event){
if(isDigitEvent(event)||isDashEvent(event)){
return true;}else{
return false;}}
function ssnOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/-/g,"");
return val.length==0;}
function formatInteger(field){
if(field.value.length==0){
return'';}
var istr=parseInt(field.value,10);
if(istr<validationMin[field.name]){
return validationMin[field.name];}else if(istr>validationMax[field.name]){
return validationMax[field.name];}else{
return istr;}}
function validateInteger(field){
if(isNaN(field.value))return false;
return true;}
function integerOnBlur(field,event){
return integerOnChange(field,event);}
function integerOnChange(field,event){
if(validateInteger(field)){
field.value=formatInteger(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
field.style.backgroundColor=fieldValidationErrorColor;}}
function integerOnKeyPress(field,event){
if(isDigitEvent(event)||isDashEvent(event)){
return true;}else{
return false;}}
function integerOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/-/g,"");
return val.length==0;}
function formatCurrency(field){
if(field.value.length==0){
return'';}
var istr=field.value.replace(/\$/g,"");
istr=istr.replace(/,/g,"");
istr=parseFloat(istr);
if(istr<validationMin[field.name]){
istr=validationMin[field.name]*100;}else if(istr>validationMax[field.name]){
istr=validationMax[field.name]*100;}else{
istr=Math.round(istr*100);}
istr=istr+'';
if(istr.length<=2){
istr='000'.substring(0,3-istr.length)+istr;}
for(var i=0;i<Math.floor((istr.length-2-(1+i))/3);i++){
istr=istr.substring(0,istr.length-(4*i+5))+','+istr.substring(istr.length-(4*i+5));}
return'$'+istr.substring(0,istr.length-2)+'.'+istr.substring(istr.length-2,istr.length);}
function validateCurrency(field){
var istr=field.value.replace(/\$/g,"");
istr=istr.replace(/,/g,"");
if(isNaN(istr))return false;
return true;}
function currencyOnBlur(field,event){
return currencyOnChange(field,event);}
function currencyOnChange(field,event){
if(validateCurrency(field)){
field.value=formatCurrency(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
field.style.backgroundColor=fieldValidationErrorColor;}}
function currencyOnKeyPress(field,event){
if(isDigitEvent(event)||isDashEvent(event)||isPeriodEvent(event)||isDollarEvent(event)){
return true;}else{
return false;}}
function currencyOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/-/g,"");
val=val.replace(/./g,"");
val=val.replace(/\$/g,"");
return val.length==0;}
function formatDPCurrency(field){
if(field.value.length==0){
return'';}
var istr=field.value.replace(/\$/g,"");
istr=istr.replace(/,/g,"");
istr=parseFloat(istr);
if(istr<validationMin[field.name]){
istr=validationMin[field.name]*10000;}else if(istr>validationMax[field.name]){
istr=validationMax[field.name]*10000;}else{
istr=Math.round(istr*10000);}
istr=istr+'';
if(istr.length<=2){
istr='00000'.substring(0,5-istr.length)+istr;}
return'$'+istr.substring(0,istr.length-4)+'.'+istr.substring(istr.length-4,istr.length);}
function validateDPCurrency(field){
var istr=field.value.replace(/\$/g,"");
istr=istr.replace(/,/g,"");
if(isNaN(istr))return false;
return true;}
function DPcurrencyOnBlur(field,event){
return DPcurrencyOnChange(field,event);}
function DPcurrencyOnChange(field,event){
if(validateDPCurrency(field)){
field.value=formatDPCurrency(field);
field.style.backgroundColor=fieldValidationOKColor;}else{
field.style.backgroundColor=fieldValidationErrorColor;}}
function DPcurrencyOnKeyPress(field,event){
if(isDigitEvent(event)||isDashEvent(event)||isPeriodEvent(event)||isDollarEvent(event)){
return true;}else{
return false;}}
function DPcurrencyOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/-/g,"");
val=val.replace(/./g,"");
val=val.replace(/\$/g,"");
return val.length==0;}
function formatTime(tstr){
var tstr2=tstr.replace(/:/g,"");
if(tstr2.length==5)
{
return tstr2.substring(0,2)+':'+tstr2.substring(2,4)+':'+tstr2.substring(4,6)+'0';}
if(tstr2.length==6)
{
return tstr2.substring(0,2)+':'+tstr2.substring(2,4)+':'+tstr2.substring(4,7);}
else if(tstr2.length==3)
{
return'0'+tstr2.substring(0,1)+':'+tstr2.substring(1,3);}
else if(tstr2.length==4)
{
return tstr2.substring(0,2)+':'+tstr2.substring(2,4);}
else if(IsValidTime(tstr))
{
return tstr;}
else
{
return"";}}
function validateTime(tstr){
if(tstr.length==0)return true;
if(IsValidTime(tstr))
{
return true;}
tstr=tstr.replace(/:/g,"");
if((tstr.length==5||tstr.length==6)){
return true;}
if((tstr.length!=3)&&(tstr.length!=4)){
return false;}
if(tstr.length==3){
if(tstr.substring(1,2)>'5'){
return false;}}
if(tstr.length==4){
if(tstr.substring(0,1)>'2'){
return false;}}
if(tstr.length==4){
if(tstr.substring(0,1)=='1'){
if(tstr.substring(1,2)>'2'){
return false;}}}
if(tstr.length==4){
if(tstr.substring(2,3)>'5'){
return false;}}
return true;}
function IsValidTime(tstr)
{
var timeStr=tstr;
if(tstr.length==0)return true;
var timePat=/^(\d{1,2}):(\d{2})(:(\d{2}))?(\s?(AM|am|PM|pm))?$/;
var matchArray=timeStr.match(timePat);
if(matchArray==null)
{
return false;}
var hour=matchArray[1];
var minute=matchArray[2];
var second=matchArray[4];
var ampm=matchArray[6];
if(second==""){second=null;}
if(ampm=="")
{
ampm=null
return false;}
if(hour<0||hour>12)
{
return false;}
if(hour<=12&&ampm==null)
{
return false;}
if(hour>12&&ampm!=null)
{
return false;}
if(minute<0||minute>59)
{
return false;}
if(second!=null&&(second<0||second>59))
{
return false;}
return true;}
function timeOnBlur(field,event){
return timeOnChange(field,event);}
function timeOnChange(field,event){
if(validateTime(field.value)){
field.value=formatTime(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
field.style.backgroundColor=fieldValidationErrorColor;}}
function timeOnKeyPress(field,event){
if(isDigitEvent(event)||isColonEvent(event)||isGreetingEvent(event)){
return true;}else{
return false;}}
function timeOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/:/g,"");
return val.length==0;}
function formatDate(dstr){
if(dstr.length==0)return"";
var dateReg=/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{2,4})/i;
var ar=dateReg.exec(dstr);
var month=ar[1];
var day=ar[3];
var year=ar[5];
if(month<10){
month="0"+month.replace(/\d+([1-9])/i,"$1");}
if(day<10){
day="0"+day.replace(/\d+([1-9])/i,"$1");}
if((year>=0)&&(year<50)){
year=(year-0)+2000;}else if((year>=50)&&(year<=99)){
year=(year-0)+1900;}
return month+'/'+day+'/'+year;}
function validateDate(dstr){
if(dstr.length==0)return true;
var dateReg=/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{2,4})/i;
if(dateReg.test(dstr)){
var ar=dateReg.exec(dstr);
var month=ar[1];
var day=ar[3];
var year=ar[5];
if((year>=0)&&(year<50)){
year=(year-0)+2000;}else if((year>=50)&&(year<=99)){
year=(year-0)+1900;}
if((year<1753)||(year>9999)){
return false;}
if(month<1||month>12){
return false;}else if(month<10){
month="0"+month.replace(/\d+([1-9])/i,"$1");}
if(day<1||!(dayInMonth(month,day,year))){
return false;}else if(day<10){
day="0"+day.replace(/\d+([1-9])/i,"$1");}}else{
return false;}
return true;}
function dayInMonth(month,day,year){
month=month.replace(/[0]([\d]*)/i,"$1");
var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if(((year%4==0)&&(year%100!=0))||(year%400==0)){
daysinmonth[2]=29;}
if(day>0&&day<=daysinmonth[month])
return true;
else
return false;}
function dateOnBlur(field,event){
return dateOnChange(field,event);}
function dateOnChange(field,event){
if(validateDate(field.value)){
field.value=formatDate(field.value);
field.style.backgroundColor=fieldValidationOKColor;}else{
alert('Please enter valid date');
field.value='';
return false;}}
function dateOnKeyPress(field,event){
if(isDigitEvent(event)||isForwardSlashEvent(event)){
return true;}else{
return false;}}
function dateOnPaste(field,event){
var val=window.clipboardData.getData("Text").replace(/[0-9]/g,"");
val=val.replace(/\//g,"");
return val.length==0;}
function keyToUpperCase(field,evt){
if(document.all){
var c=evt.keyCode;
var C=String.fromCharCode(c).toUpperCase().charCodeAt();
evt.keyCode=C;
return true;}
else
return true;}
comboMatch="";
comboMatchTimer=0;
function comboMatcher(combo,event){
ch=String.fromCharCode(getKeyCode(event));
newSelection=-1;
if(event.modifers){
return true;}else if(getKeyCode(event)<48){
return true;}else if(ch){
if(comboMatch==""){
comboMatch=ch;}
if(ch==comboMatch){
for(ii=combo.selectedIndex+1;ii<combo.options.length;ii++){
if(combo.options[ii].text.substring(0,comboMatch.length).toUpperCase()==comboMatch.toUpperCase()){
newSelection=ii;
break;}}
if(newSelection<0){
for(ii=0;ii<combo.options.length;ii++){
if(combo.options[ii].text.substring(0,comboMatch.length).toUpperCase()==comboMatch.toUpperCase()){
newSelection=ii;
break;}}}}else{
comboMatch=comboMatch+String.fromCharCode(getKeyCode(event));
for(ii=0;ii<combo.options.length;ii++){
if(combo.options[ii].text.substring(0,comboMatch.length).toUpperCase()==comboMatch.toUpperCase()){
newSelection=ii;
break;}}}
if(newSelection>-1){
combo.selectedIndex=newSelection;
try{combo.onchange();}catch(all){}}
if(comboMatchTimer){
clearTimeout(comboMatchTimer);}
comboMatchTimer=setTimeout('comboMatch = "";',1000);
return false;}else{
return true;}}
var sTextBoxId=null;
var message="Right Click Disabled.";
function DisableClipboard(objTextBox)
{
sTextBoxId=objTextBox.id;
if(document.all)
{
document.onkeydown=onKeyPress;
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;}
else if(document.layers||document.getElementById)
{
document.onkeypress=onKeyPress;
document.onmousedown=clickNS;}}
function onKeyPress(evt)
{
var bRet=true;
var msg="Clipboard is Disabled.";
var oEvent=(window.event)?window.event:evt;
var nKeyCode=oEvent.keyCode?oEvent.keyCode:oEvent.which?oEvent.which:void 0;
var sChar=String.fromCharCode(nKeyCode).toUpperCase();
var bCtrlPressed=(oEvent.ctrlKey)?oEvent.ctrlKey:oEvent.modifiers&2>0;
var bShiftPressed=(oEvent.shiftKey)?oEvent.shiftKey:oEvent.modifiers&4>0;
if(GetTagName(evt))
{
if(bCtrlPressed&&(sChar=='A'||sChar=='C'||sChar=='V'||sChar=='X'))
{
bRet=false;}
else if(bShiftPressed&&(nKeyCode==45))
{
bRet=false;}}
if(!bRet)
{
try
{
oEvent.returnValue=false;
oEvent.cancelBubble=true;
if(document.all)
{
oEvent.keyCode=0;}
else
{
oEvent.preventDefault();
oEvent.stopPropagation();}}
catch(ex)
{}}
return bRet;}
function GetTagName(evt)
{
var oEvent=(window.event)?window.event:evt;
var nKeyCode=oEvent.keyCode?oEvent.keyCode:oEvent.which?oEvent.which:void 0;
var oTarget=(oEvent.target)?oEvent.target:oEvent.srcElement;
var sTag=oTarget.tagName.toLowerCase();
var sTagType=oTarget.getAttribute("type");
var sTagId=oTarget.getAttribute("ID");
if(sTagType!=null)
{
sTagType=sTagType.toLowerCase();}
if(sTag=="input"&&(sTagType=="password"||sTagType=="text")&&sTagId==sTextBoxId)
{
return true;}
else
{
return false;}}
function clickIE()
{
if(document.all)
{
if(GetTagName())
{
return false;}}}
function clickNS(e)
{
if(document.layers||(document.getElementById&&!document.all))
{
if(GetTagName(e))
{
document.oncontextmenu=new Function("return false")
if(e.which==2||e.which==3)
{
return false;}}
else
{
document.oncontextmenu=new Function("return true")}}}
function unshowList()
{
if(document.getElementById('ctl00_WebUserControl1_hdnFlag').value==0)
{
document.getElementById('list').style.display='none';
document.getElementById('ctl00_WebUserControl1_hdnFlag').value=1;
document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value=0;}}
function showList()
{
if(document.getElementById('ctl00_WebUserControl1_hdnFlag').value==1)
{
document.getElementById('list').style.display='block';
document.getElementById('ctl00_WebUserControl1_hdnFlag').value=0;}
else if(document.getElementById('ctl00_WebUserControl1_hdnFlag').value==0)
{
document.getElementById('list').style.display='none';
document.getElementById('ctl00_WebUserControl1_hdnFlag').value=1;}
else
{
document.getElementById('list').style.display='none';
document.getElementById('ctl00_WebUserControl1_hdnFlag').value=1;}}
function insertValue1()
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value='Catalog';
document.getElementById('ctl00_WebUserControl1_txtDDL').style.backgroundColor='#82caff';
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Catalog';
unshowList();}
function insertValue2()
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value='Website';
document.getElementById('ctl00_WebUserControl1_txtDDL').style.backgroundColor='#82caff';
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Website';
unshowList();}
function insertValue3()
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value='PDF';
document.getElementById('ctl00_WebUserControl1_txtDDL').style.backgroundColor='#82caff';
document.getElementById('ctl00_WebUserControl1_hdnValue').value='PDF';
unshowList();}
var count=0;var altFlag=0;
function testKeyCode(e)
{
if(parseInt(document.getElementById('hdnSearchBox').value)==1)
{
var keycode;
if(window.event)
keycode=window.event.keyCode;
else if(e)keycode=e.which;
var e=e||window.event;
if(e.altKey&&e.keyCode==40)
{
showList();
altFlag=1;
document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value=1;}
else
{
altFlag=0;}
if(e.keyCode==40&&altFlag==0||e.keyCode==39&&altFlag==0)
{
if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Catalog")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="Website";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Website';
document.getElementById('list2').style.backgroundColor='#82caff';
document.getElementById('list1').style.backgroundColor='#ffffff';
document.getElementById('list3').style.backgroundColor='#ffffff';}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Website")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="PDF";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='PDF';
document.getElementById('list2').style.backgroundColor='#ffffff';
document.getElementById('list1').style.backgroundColor='#ffffff';
document.getElementById('list3').style.backgroundColor='#82caff';}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="PDF")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="Catalog";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Catalog';
document.getElementById('list1').style.backgroundColor='#82caff';
document.getElementById('list2').style.backgroundColor='#ffffff';
document.getElementById('list3').style.backgroundColor='#ffffff';}}
else if(e.keyCode==38&&altFlag==0||e.keyCode==37&&altFlag==0)
{
if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Website")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="Catalog";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Catalog';
document.getElementById('list1').style.backgroundColor='#82caff';
document.getElementById('list2').style.backgroundColor='#ffffff';
document.getElementById('list3').style.backgroundColor='#ffffff';}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="PDF")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="Website";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='Website';
document.getElementById('list2').style.backgroundColor='#82caff';
document.getElementById('list3').style.backgroundColor='#ffffff';
document.getElementById('list1').style.backgroundColor='#ffffff';}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Catalog")
{
document.getElementById('ctl00_WebUserControl1_txtDDL').value="PDF";
document.getElementById('ctl00_WebUserControl1_hdnValue').value='PDF';
document.getElementById('list1').style.backgroundColor='#ffffff';
document.getElementById('list2').style.backgroundColor='#ffffff';
document.getElementById('list3').style.backgroundColor='#82caff';}}
else if(e.keyCode==13)
{
if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Catalog")
{
insertValue1();}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="Website")
{
insertValue2();}
else if(document.getElementById('ctl00_WebUserControl1_txtDDL').value=="PDF")
{
insertValue3();}}
else if(e.keyCode==27)
{
unshowList();}
else if(e.keyCode==9)
{
document.getElementById('ctl00_btnGo').setFocus=true;
document.getElementById('ctl00_btnGo').setFocus='ctl00_btnGo';}
else if(e.shiftKey&&e.keyCode==9)
{
document.getElementById('ctl00_txtSearchContent').setFocus=true;
document.getElementById('ctl00_txtSearchContent').setFocus='ctl00_txtSearchContent';}}}
document.onkeydown=testKeyCode;
var oldgridSelectedColor;
function setMouseOverColor(element)
{
oldgridSelectedColor='#ffffff';
element.style.backgroundColor='#82caff';}
function setMouseOutColor(element)
{
element.style.backgroundColor=oldgridSelectedColor;}
function checkClick()
{
if(parseInt(document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value)==0)
{
document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value=1;}
if(parseInt(document.getElementById('ctl00_WebUserControl1_hdnFlag').value)==1)
{
checkOutside();}}
function checkOutside()
{
if(parseInt(document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value)==1)
{
unshowList();
document.getElementById('ctl00_WebUserControl1_hdnDivFlag').value=0;}
if(parseInt(document.getElementById('ctl00_WebUserControl1_hdnFlag').value)==1)
{
unshowList();}}
function checkOnKeyPress(sent)
{
if(sent.keyCode==9)
{
document.getElementById('ctl00_btnGo').setFocus=true;
unshowList();
return true;}
else if(sent.keyCode==18||sent.keyCode==40||sent.keyCode==39||sent.keyCode==38||sent.keyCode==37||sent.keyCode==13||sent.keyCode==27)
{
return true;}
else
{
document.getElementById('ctl00_WebUserControl1_txtDDL').blur();
return false;}}
function confirm_delete()
{
if(confirm("Are you sure you want to delete this item?")==true)
return true;
else
return false;}
function confirm_product_delete()
{
if(confirm("Are you sure you want to delete this product?")==true)
return true;
else
return false;}
function confirm_product_rates_delete()
{
if(confirm("Are you sure you want to delete this product rate?")==true)
return true;
else
return false;}
function PrintThisPage(ctlId)
{
var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
sOption+="scrollbars=yes,width=850,height=650,left=10,top=10";
var sWinHTML=document.getElementById(ctlId).innerHTML;
var winprint=window.open('','',sOption);
winprint.document.open();
winprint.document.write('<html><link rel="Stylesheet" type="text/css" href="../Includes/CSS/PeptidesStyle.css" /><style>body { page-break-after:auto;} </style><body>');
winprint.document.write(sWinHTML);
winprint.document.write('</body></html>');
winprint.document.close();
winprint.print();
winprint.close();}
function PrintReceiptPage(ctlId,PrintDiv1Id,PrintDiv2Id)
{
var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
sOption+="scrollbars=yes,width=850,height=650,left=10,top=10";
document.getElementById(PrintDiv1Id).style.display='block';
document.getElementById(PrintDiv2Id).style.display='block';
var sWinHTML=document.getElementById(ctlId).innerHTML;
var winprint=window.open('','',sOption);
winprint.document.open();
winprint.document.write('<html><link rel="Stylesheet" type="text/css" href="../Includes/CSS/PeptidesStyle.css" /><style>body { page-break-after:auto;} </style><body>');
winprint.document.write(sWinHTML);
winprint.document.write('</body></html>');
winprint.document.close();
winprint.print();
winprint.close();
document.getElementById(PrintDiv1Id).style.display='none';
document.getElementById(PrintDiv2Id).style.display='none';}
function PrintOrderPage(ctlId,grdId,ShipId)
{
var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
sOption+="scrollbars=yes,width=850,height=650,left=10,top=10";
var sWinHTML=document.getElementById(ctlId).innerHTML;
var winprint=window.open('','',sOption);
winprint.document.open();
winprint.document.write('<html><head><link rel="Stylesheet" type="text/css" href="../Includes/CSS/PeptidesStyle.css" /><style>body { page-break-after:auto;} </style><script language="javascript"> function PrintFun(grdVal,ShipId) {  var divValue = document.getElementById(grdVal); var ShipValue = document.getElementById(ShipId); ShipValue.Style.Visibility = "hidden";  divValue.className="Hello"; divValue.class="Hello";   }</script></head><body onLoad="javascript:PrintFun('+grdId+','+ShipId+')">');
winprint.document.write(sWinHTML);
winprint.document.write('</body></html>');
winprint.document.close();
winprint.print();
winprint.close();}
function logout()
{
if(window.XMLHttpRequest)
{
window.open('','_parent','');
window.close();}else
{
window.opener=window;window.close();}}
function VerifySpaceCharacter(event,objInput)
{
var key=event.keyCode||event.charCode
if(key!=32)
{
return true;}
else
{
return false;}}
function confirm_product_slabs_delete()
{
if(confirm("Are you sure you want to delete this product slab?")==true)
{
return true;}
else
return false;}
function confirm_product_subcategory_delete()
{
if(confirm("Are you sure you want to delete this product subcategory?")==true)
return true;
else
return false;}
function confirm_product_category_delete()
{
if(confirm("Are you sure you want to delete this product category?")==true)
return true;
else
return false;}
function confirm_product_measures_delete()
{
if(confirm("Are you sure you want to delete this product measure?")==true)
return true;
else
return false;}
function confirm_credit_cards_delete()
{
if(confirm("Are you sure you want to delete this credit card info?")==true)
return true;
else
return false;}
function confirm_Bulk_Order_delete()
{
if(confirm("Are you sure you want to delete this Bulk Order details?")==true)
return true;
else
return false;}
function confirm_Custom_Order_delete()
{
if(confirm("Are you sure you want to delete this Custom Order details?")==true)
return true;
else
return false;}
function AlertEditMsg()
{
alert("This record cannot be edited.");
return false;}
function AlertDeleteMsg()
{
alert("This record cannot be deleted.");
return false;}
function AlertConstructionMsg()
{
alert("This Page is Under Construction.");
return false;}
function Confirm_Process_Order()
{
if(confirm("Are you sure you want to Process this Order?")==true)
return true;
else
return false;}
function CheckShippedDate(shippedDate)
{
var DateValue=document.getElementById(shippedDate).value;
if(DateValue=="")
{
alert('Please enter Shipped Date. Format mm/dd/yyyy');
return false;}
else
{
if(confirm("Are you sure you want to Complete this Order?")==true)
return true;
else
return false;}}
function validateDate(fld)
{
var RegExPattern=/^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
var errorMessage='Please enter valid date.Format mm/dd/yyyy.';
if((document.getElementById(fld).value.match(RegExPattern))&&(fld.value!='')){}else
{
alert(errorMessage);
document.getElementById(fld).value="";}}
function ValidateUserAccount(objFirstName,objLastName,objCompany,objAddress,objCity,ddlState,objZipCode,ddlCountry,objPhone,objFax,objEmail,objPassword,objddlUserType)
{
var themessage='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var ddlStateValue=document.getElementById(ddlState).value;
var ddlStateEnable=document.getElementById(ddlState).disabled;
if(!ddlStateEnable)
{
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please select State";}}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var ddlCountryValue=document.getElementById(ddlCountry).value;
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please select Country";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
var objPasswordValue=document.getElementById(objPassword).value.trim();
if(objPasswordValue=='')
{
themessage=themessage+"\n"+" - Please enter Password";}
var objddlUserTypeValue=document.getElementById(objddlUserType).value;
if(objddlUserTypeValue=='none')
{
themessage=themessage+"\n"+" - Please Select UserType";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(!ddlStateEnable)
{
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';}
if(objddlUserTypeValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUserTypeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUserTypeStar').innerHTML='<font color="black">*</font>';}
return false;}
else if(objPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objPasswordValue!=""&&CheckPassword.test(objPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';
return true;}}
else
{
return true;}}
function ValidateBillAccount(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail)
{
var themessage1='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnable=document.getElementById(objState).disabled;
if(!objStateEnable)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateBillAccountWithCreditCard(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail,objPaymentType,objPONumber,objCardType,objCardNumber,objtxtCardNumber,objCardHolder,objSecurity,objMonth,objYear)
{
var themessage1='';
var creditcardflag=false;
var flag=false;
var creditcardmessage1='';
var securitycodepopup=false;
var expirydatepopup=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnable=document.getElementById(objState).disabled;
if(!objStateEnable)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
var objPaymentTypeValue=document.getElementById(objPaymentType).value.trim();
if(objPaymentTypeValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the PaymentType";}
if(objPaymentTypeValue!='Wire Transfer')
{
var objCardTypeValue=document.getElementById(objCardType).value.trim();
if(objCardTypeValue=='none')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please Select the CardType";}
else
{
creditcardflag=true;}
if(document.getElementById(objCardNumber)!=null)
{
var objCardNumberValue=document.getElementById(objCardNumber).value.trim();
if(objCardNumberValue=='none')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please Select the CardNumber";}
else
{
creditcardflag=true;}}
if(document.getElementById(objtxtCardNumber)!=null)
{
var objtxtCardNumberValue=document.getElementById(objtxtCardNumber).value.trim();
if(objtxtCardNumberValue=='')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please enter the CardNumber";}
else
{
creditcardflag=true;}}
if(document.getElementById(objCardHolder)!=null)
{
var objCardHolderValue=document.getElementById(objCardHolder).value.trim();
if(objCardHolderValue=='')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please enter the CardHolder Name";}
else
{
creditcardflag=true;}}
if(document.getElementById(objSecurity)!=null)
{
var objSecurityValue=document.getElementById(objSecurity).value.trim();
CheckSecurityCode=new RegExp(/^\d{3,4}$/);
if(objSecurityValue=='')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please enter the Security Code";}
else if(CheckSecurityCode.test(objSecurityValue)==false)
{
securitycodepopup=true;
creditcardmessage1=creditcardmessage1+"\n"+" - Please enter the Security Code";}
else
{
creditcardflag=true;}}
if(document.getElementById(objMonth)!=null||document.getElementById(objYear)!=null)
{
var objMonthValue=document.getElementById(objMonth).value.trim();
var objYearValue=document.getElementById(objYear).value.trim();
if(objMonthValue=='none'&&objYearValue=='none')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please select Month & Year";}
else if(objMonthValue=='none'&&objYearValue!='none')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please select Month";}
else if(objMonthValue!='none'&&objYearValue=='none')
{
creditcardmessage1=creditcardmessage1+"\n"+" - Please select Year";}
else
{
creditcardflag=true;}
if(document.getElementById(objMonth)!=null&&document.getElementById(objYear)!=null)
{
var now=new Date();
var objMonthValue=document.getElementById(objMonth).value.trim();
var objYearValue=document.getElementById(objYear).value.trim();
if(objYearValue!='none'||objMonthValue!='none')
{
if(objYearValue<now.getFullYear())
{
expirydatepopup=true;
creditcardmessage1=creditcardmessage1+"\n"+" - Please select Month & Year";}
else if(objYearValue==now.getFullYear())
{
if(objMonthValue!='none')
{
if(objMonthValue<now.getMonth())
{
expirydatepopup=true;
creditcardmessage1=creditcardmessage1+"\n"+" - Please select Month & Year";}}}}}}
if(objPaymentTypeValue=='Purchase Order'||objPaymentTypeValue=='none')
{
if(document.getElementById(objPONumber)!=null)
{
var objPONumberValue=document.getElementById(objPONumber).value.trim();
if(objPONumberValue=='')
{
themessage1=themessage1+"\n"+" - Please enter the PO Number";}}}}
else
{
if(objPaymentTypeValue=='Purchase Order'||objPaymentTypeValue=='none')
{
if(document.getElementById(objPONumber)!=null)
{
var objPONumberValue=document.getElementById(objPONumber).value.trim();
if(objPONumberValue=='')
{
themessage1=themessage1+"\n"+" - Please enter the PO Number";}}}}
if(themessage1!=''||(creditcardmessage1!=''&&objPaymentTypeValue=='Credit Card')||(creditcardmessage1!=''&&objPaymentTypeValue=='Purchase Order'&&creditcardflag))
{
if(!securitycodepopup&&!expirydatepopup)
{
alert('Invalid data in field(s) highlighted red!');}}
if(themessage1!='')
{
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objPaymentTypeValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPaymentType').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPaymentType').innerHTML='<font color="black">*</font>';}
if(objPaymentTypeValue=='Purchase Order'||objPaymentTypeValue=='none')
{
if(document.getElementById(objPONumber)!=null)
{
var objPONumberValue=document.getElementById(objPONumber).value.trim();
if(objPONumberValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPONumber').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPONumber').innerHTML='<font color="black">*</font>';}}}}
if(creditcardmessage1!='')
{
if(objPaymentTypeValue=='Credit Card'||(objPaymentTypeValue=='Purchase Order'&&creditcardflag))
{
if(objCardTypeValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardType').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardType').innerHTML='<font color="black">*</font>';}
if(document.getElementById(objCardNumber)!=null)
{
var objCardNumberValue=document.getElementById(objCardNumber).value.trim();
if(objCardNumberValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardNumber').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardNumber').innerHTML='<font color="black">*</font>';}}
if(document.getElementById(objtxtCardNumber)!=null)
{
var objtxtCardNumberValue=document.getElementById(objtxtCardNumber).value.trim();
if(objtxtCardNumberValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardNumber').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCreditCardNumber').innerHTML='<font color="black">*</font>';}}
if(document.getElementById(objCardHolder)!=null)
{
var objCardHolderValue=document.getElementById(objCardHolder).value.trim();
if(objCardHolderValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCardHolderName').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCardHolderName').innerHTML='<font color="black">*</font>';}}
var objSecurityValue=document.getElementById(objSecurity).value.trim();
CheckSecurityCode=new RegExp(/^\d{3,4}$/);
if(objSecurityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblSecurityCode').innerHTML='<font color="red">*</font>';}
else if(CheckSecurityCode.test(objSecurityValue)==false)
{
alert('Security code must be 3 to 4 digits');
document.getElementById('ctl00_ContentPlaceHolder1_lblSecurityCode').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblSecurityCode').innerHTML='<font color="black">*</font>';}
var objMonthValue=document.getElementById(objMonth).value.trim();
var objYearValue=document.getElementById(objYear).value.trim();
if(objMonthValue=='none'&&objYearValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';}
else if(objMonthValue=='none'&&objYearValue!='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';}
else if(objMonthValue!='none'&&objYearValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="black">*</font>';}
if(document.getElementById(objMonth)!=null&&document.getElementById(objYear)!=null)
{
var now=new Date();
var objMonthValue=document.getElementById(objMonth).value.trim();
var objYearValue=document.getElementById(objYear).value.trim();
if(objYearValue!='none'||objMonthValue!='none')
{
if(objYearValue<now.getFullYear())
{
alert('Invalid card expiry date');
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';
return false;}
else if(objYearValue==now.getFullYear())
{
if(objMonthValue!='none')
{
if(objMonthValue<now.getMonth())
{
alert('Invalid card expiry date');
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';}}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblMonthYear').innerHTML='<font color="red">*</font>';}}}}
if(themessage1!=''||(creditcardmessage1!=''&&objPaymentTypeValue=='Credit Card')||(creditcardmessage1!=''&&objPaymentTypeValue=='Purchase Order'&&creditcardflag))
{
return false;}
else
{
return true;}}
function ValidateNewAccount(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail)
{
var themessage1='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnabled=document.getElementById(objState).disabled;
if(!objStateEnabled)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnabled)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>100)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function PrintConfirm(btnPrint,btnExportToExcel,btnCancel)
{
if(confirm('Would you like to print the page?'))
{
var btnPrint=document.getElementById(btnPrint);
var btnExport=document.getElementById(btnExportToExcel);
var btnCancel=document.getElementById(btnCancel);
btnPrint.style.visibility="hidden";
btnExport.style.visibility="hidden";
btnCancel.style.visibility="hidden";
print();
btnPrint.style.visibility="visible";
btnExport.style.visibility="visible";
btnCancel.style.visibility="visible";}
else
return false;}
function checkInteger(event)
{
if(window.event)
{
if(event.keyCode>=45&&event.keyCode<=57)
{
return true;}
else if(event.keyCode==9||event.keyCode==8)
{
return true;}
else
{
return false;}}
else if(event.which)
{
if(event.which>=48&&event.which<=57)
{
return true;}
if(event.which>=58&&event.which<=126)
{
return false;}
if(event.which>=33&&event.which<=147)
{
return false;}
else
{
return true;}}}
function checkInt(event)
{
if(window.event)
{
if(event.keyCode>=48&&event.keyCode<=57)
{
return true;}
else if(event.keyCode==9||event.keyCode==8)
{
return true;}
else
{
return false;}}
else if(event.which)
{
if(event.which>=48&&event.which<=57)
{
return true;}
if(event.which>=58&&event.which<=126)
{
return false;}
if(event.which>=33&&event.which<=147)
{
return false;}
else
{
return true;}}}
function ValidateContactUs(objCompanyName,objAddress1,objCity,objState,objCountry,objZipCode,objPhone1,objFax,objEmail,objUrl,objEditor)
{
var themessage='';
var flag=false;
var objCompany1Value=document.getElementById(objCompanyName).value.trim();
alert(objCompany1Value);
if(objCompany1Value=='')
{
themessage=themessage+"\n"+" - Please enter Company Name";}
var objAddress1Value=document.getElementById(objAddress1).value.trim();
if(objAddress1Value=='')
{
themessage=themessage+"\n"+" - Please enter Address";}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var objStateValue=document.getElementById(objState).value;
if(objStateValue=='')
{
themessage=themessage+"\n"+" - Please enter State";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='')
{
themessage=themessage+"\n"+" - Please enter Country";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var objPhone1Value=document.getElementById(objPhone1).value.trim();
if(objPhone1Value=='')
{
themessage=themessage+"\n"+" - Please enter Phone1";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
var objUrlValue=document.getElementById(objUrl).value.trim();
if(objUrlValue=='')
{
themessage=themessage+"\n"+" - Please enter Url";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objCompany1Value=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyNameStar').innerHTML='<font color="black">*</font>';}
if(objAddress1Value=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objStateValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="black">*</font>';}
if(objPhone1Value=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhone1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhone1Star').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objUrlValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUrlStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUrlStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateMailingListUser(objFirstName,objLastName,objCompany,objAddress,ddlCountry,objCity,ddlState,objZipCode,objPhone,objFax,objEmail)
{
var themessage='';
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var ddlCountryValue=document.getElementById(ddlCountry).value.trim();
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please Select Country";}
var ddlStateValue=document.getElementById(ddlState).value.trim();
var objStateEnable=document.getElementById(ddlState).disabled;
if(!objStateEnable)
{
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please Select State";}}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
var flag=false;
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateRequestCatalog(objFirstName,objLastName,objCompany,objAddress,ddlCountry,objCity,ddlState,objZipCode,objPhone,objFax,objEmail,objCatalogType)
{
var themessage='';
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value;
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value;
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var ddlCountryValue=document.getElementById(ddlCountry).value;
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please Select Country";}
var ddlStateValue=document.getElementById(ddlState).value;
var objStateEnable=document.getElementById(ddlState).disabled;
if(!objStateEnable)
{
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please Select State";}}
var objCityValue=document.getElementById(objCity).value;
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value;
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value;
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value;
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var ddlCatalogType=document.getElementById(ddlCatalogType).value;
if(ddlCatalogType=='none')
{
themessage=themessage+"\n"+" - Please Select Catalog Type";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(document.getElementById(objEmail).value.length>100)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCatalogStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCatalogStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function validateAnalytical(objFirstName,objLastName,objEmail)
{
var themessage='';
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
var flag=false;
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateBulkRequestDetails(ObjrdoList,ObjPrice)
{
var themessage1='';
var chkListQty=document.getElementById(ObjrdoList);
var arrayOfCheckBoxes=chkListQty.getElementsByTagName("input");
var StatusValue=0;
for(var i=0;i<arrayOfCheckBoxes.length;i++)
{
if((arrayOfCheckBoxes[i].checked)==true)
{
StatusValue=1;}}
if(StatusValue==0)
{
themessage1=themessage1+"\n"+" - Please select Status";}
var ObjPriceValue=document.getElementById(ObjPrice).value;
if(ObjPriceValue!='')
{
CheckPrice=new RegExp(/^[0-9]+(\.[0-9]+)?$/);
if(ObjPriceValue!=''&&CheckPrice.test(ObjPriceValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Price";}}
else
{
themessage1=themessage1+"\n"+" - Please enter Price";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(StatusValue==0)
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlBulkOrderDetails_lblStatusStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlBulkOrderDetails_lblStatusStar').innerHTML='<font color="black">*</font>';}
if(ObjPriceValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlBulkOrderDetails_lblPriceStar').innerHTML='<font color="red">*</font>';}
else
{
CheckPrice=new RegExp(/^[0-9]+(\.[0-9]+)?$/);
if(ObjPriceValue!=''&&CheckPrice.test(ObjPriceValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlBulkOrderDetails_lblPriceStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlBulkOrderDetails_lblPriceStar').innerHTML='<font color="black">*</font>';}}
return false;}
else
{
return true;}}
function ValidateCustomRequestDetails(ObjrdoList,ObjPrice)
{
var themessage1='';
var chkListQty=document.getElementById(ObjrdoList);
var arrayOfCheckBoxes=chkListQty.getElementsByTagName("input");
var StatusValue=0;
for(var i=0;i<arrayOfCheckBoxes.length;i++)
{
if((arrayOfCheckBoxes[i].checked)==true)
{
StatusValue=1;}}
if(StatusValue==0)
{
themessage1=themessage1+"\n"+" - Please select Status";}
var ObjPriceValue=document.getElementById(ObjPrice).value;
if(ObjPriceValue!='')
{
CheckPrice=new RegExp(/^[0-9]+(\.[0-9]+)?$/);
if(ObjPriceValue!=''&&CheckPrice.test(ObjPriceValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Price";}}
else
{
themessage1=themessage1+"\n"+" - Please enter Price";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(StatusValue==0)
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlCustomOrderDetail_lblStatusStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlCustomOrderDetail_lblStatusStar').innerHTML='<font color="black">*</font>';}
if(ObjPriceValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlCustomOrderDetail_lblPriceStar').innerHTML='<font color="red">*</font>';}
else
{
CheckPrice=new RegExp(/^[0-9]+(\.[0-9]+)?$/);
if(ObjPriceValue!=''&&CheckPrice.test(ObjPriceValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlCustomOrderDetail_lblPriceStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_dtlCustomOrderDetail_lblPriceStar').innerHTML='<font color="black">*</font>';}}
return false;}
else
{
return true;}}
function ValidateBulkRequest(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail,objAminoAcid,objQuantity,objDdlQtyMeasure)
{
var themessage1='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value;
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value;
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnable=document.getElementById(objState).disabled;
if(!objStateEnable)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value;
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value;
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value;
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value;
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
var objAminoAcidValue=document.getElementById(objAminoAcid).value;
if(objAminoAcidValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Amino Acid Sequence/Structure";}
var QtyValue=document.getElementById(objQuantity).value.trim();
if(QtyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Quantity";}
else
{
QtyRegValue=/^[0-9]{1,6}(\.[0-9]{0,4})?$/;
if(!QtyRegValue.test(QtyValue))
{
themessage1=themessage1+"\n"+" - Please enter Quantity";}}
var ddlQtyMeasureValue=document.getElementById(objDdlQtyMeasure).value;
if(ddlQtyMeasureValue=='none')
{
themessage1=themessage1+"\n"+" - Please select QualityMeasure";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objAminoAcidValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAminoAcidSequenceStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAminoAcidSequenceStar').innerHTML='<font color="black">*</font>';}
if(QtyValue==''||ddlQtyMeasureValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="red">*</font>';}
else if(QtyValue!='')
{
QuantityRegValue=/^[0-9]{1,6}(\.[0-9]{0,4})?$/;
if(QuantityRegValue.test(QtyValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateCustomRequest(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail,objAminoAcid,objQuantity,objOtherPanel,objOtherQty,objDdlQtyMeasure,objPurity,rdoOther)
{
var themessage1='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value;
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value;
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnable=document.getElementById(objState).disabled;
if(!objStateEnable)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value;
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value;
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value;
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value;
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
var objAminoAcidValue=document.getElementById(objAminoAcid).value;
if(objAminoAcidValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Amino Acid Sequence/Structure";}
var quantityValue=0;
if(objQuantity!="")
{
var chkListQty=document.getElementById(objQuantity);
var arrayOfCheckBoxes=chkListQty.getElementsByTagName("input");
for(var i=0;i<arrayOfCheckBoxes.length;i++)
{
if((arrayOfCheckBoxes[i].checked)==true)
{
quantityValue=1;}}}
if(quantityValue==0)
{
var rdoOtherValue=document.getElementById(rdoOther).checked;
if(rdoOtherValue)
{
var otherQtyValue=document.getElementById(objOtherQty).value;
if(otherQtyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Quantity";}
else
{
QtyRegValue=/^[0-9]{1,6}(\.[0-9]{0,4})?$/;
if(!QtyRegValue.test(otherQtyValue))
{
themessage1=themessage1+"\n"+" - Please enter Quantity";}}
var ddlQtyMeasureValue=document.getElementById(objDdlQtyMeasure).value;
if(ddlQtyMeasureValue=='none')
{
themessage1=themessage1+"\n"+" - Please select QualityMeasure";}}
else
{
themessage1=themessage1+"\n"+" - Please enter Quantity";}}
var chkListPurity=document.getElementById(objPurity);
var arrayOfCheckBoxes=chkListPurity.getElementsByTagName("input");
var purityValue=0;
for(var i=0;i<arrayOfCheckBoxes.length;i++)
{
if((arrayOfCheckBoxes[i].checked)==true)
{
purityValue=1;}}
if(purityValue==0)
{
themessage1=themessage1+"\n"+" - Please enter Purity";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objAminoAcidValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAminoAcidSequenceStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAminoAcidSequenceStar').innerHTML='<font color="black">*</font>';}
if(quantityValue==0)
{
if(rdoOtherValue)
{
if(otherQtyValue==''||ddlQtyMeasureValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="red">*</font>';}
else if(otherQtyValue!='')
{
QuantityRegValue=/^[0-9]{1,6}(\.[0-9]{0,4})?$/;
if(QuantityRegValue.test(otherQtyValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="red">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblQuantityStar').innerHTML='<font color="black">*</font>';}
if(purityValue==0)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPurityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPurityStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ClearAll(objLoginId,objPwd,objError)
{
var LoginId=document.getElementById(objLoginId);
LoginId.value='';
document.getElementById(objPwd).value='';
document.getElementById(objError).innerHTML='';
LoginId.focus();}
var fckBody;
function ValidateBody(source,args)
{
args.IsValid=fckBody.GetXHTML(true)!="";}
function FCKeditor_OnComplete(fckInstance)
{
fckBody=fckInstance;}
function trim(str)
{
var str1=str.replace("&nbsp;"," ")
return str1.replace(/^\s+|\s+$/g,"");}
function ValidateShippingInfo(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail,objShipFirstName,objShipLastName,objShipCompany,objShipAddress,objShipCountry,objShipState,objShipCity,objShipZipCode,objShipPhone,objShipFax,objShipEmail,objShipVia,objShipAccount,objchkAccount)
{
var themessage1='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value;
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value;
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
var objStateEnable=document.getElementById(objState).disabled;
if(!objStateEnable)
{
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}}
var objCityValue=document.getElementById(objCity).value;
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value;
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value;
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value;
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
var objShipFirstNameValue=document.getElementById(objShipFirstName).value;
if(objShipFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping First Name";}
var objShipLastNameValue=document.getElementById(objShipLastName).value;
if(objShipLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Last Name";}
var objShipCompanyValue=document.getElementById(objShipCompany).value;
if(objShipCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Company";}
var objShipAddressValue=document.getElementById(objShipAddress).value;
if(objShipAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Address1";}
var objShipCountryValue=document.getElementById(objShipCountry).value;
if(objShipCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Shipping Country";}
var objShipStateValue=document.getElementById(objShipState).value;
var objShipStateEnable=document.getElementById(objShipState).disabled;
if(!objShipStateEnable)
{
if(objShipStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Shipping State";}}
var objShipCityValue=document.getElementById(objShipCity).value;
if(objShipCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping City";}
var objShipZipCodeValue=document.getElementById(objShipZipCode).value;
if(objShipZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping ZipCode";}
var objShipPhoneValue=document.getElementById(objShipPhone).value;
if(objShipPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Phone";}
var objShipFaxValue=document.getElementById(objShipFax).value;
if(objShipFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Fax";}
var objShipEmailValue=document.getElementById(objShipEmail).value;
if(objShipEmailValue!='')
{
CheckEmail1=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objShipEmailValue!=""&&echeck(objShipEmailValue)==false)
{
themessage1=themessage1+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objShipEmailValue!=''&&CheckEmail1.test(objShipEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objShipEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Shipping Email";}
var objShipVia=document.getElementById(objShipVia);
if(objShipVia!=null)
{
if(objShipVia.disabled==false)
{
var objShipViaValue=objShipVia.value;
if(objShipViaValue=='none')
{
themessage1=themessage1+"\n"+" - Please enter Ship Via";}}}
var objShipAccount=document.getElementById(objShipAccount);
var objchkAccount=document.getElementById(objchkAccount);
if(objchkAccount.checked)
{
if(objShipAccount!=null)
{
var objShipAccountValue=objShipAccount.value.trim();
if(objShipAccountValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Account";}}}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(!objStateEnable)
{
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objShipFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objShipLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipLastNameStar').innerHTML='<font color="black">*</font>';}
if(objShipCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCompanyStar').innerHTML='<font color="black">*</font>';}
if(objShipAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAddressStar').innerHTML='<font color="black">*</font>';}
if(objShipCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCountryStar').innerHTML='<font color="black">*</font>';}
if(!objShipStateEnable)
{
if(objShipStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipStateStar').innerHTML='<font color="black">*</font>';}}
if(objShipCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCityStar').innerHTML='<font color="black">*</font>';}
if(objShipZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objShipPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipPhoneStar').innerHTML='<font color="black">*</font>';}
if(objShipFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFaxStar').innerHTML='<font color="black">*</font>';}
if(objShipEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}
else if(objShipEmailValue!='')
{
CheckEmail1=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objShipEmailValue!=""&&echeck(objShipEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objShipEmailValue!=''&&CheckEmail1.test(objShipEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objShipEmailValue!=''&&CheckEmail1.test(objShipEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objShipEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="black">*</font>';}
if(objShipViaValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipShipViaStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipShipViaStar').innerHTML='<font color="black">*</font>';}
if(objShipAccountValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAccountStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAccountStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateUpdateBillShipInfo(objFirstName,objLastName,objCompany,objAddress,objCountry,objState,objCity,objZipCode,objPhone,objFax,objEmail,objShipFirstName,objShipLastName,objShipCompany,objShipAddress,objShipCountry,objShipState,objShipCity,objShipZipCode,objShipPhone,objShipFax,objShipEmail)
{
var themessage1='';
var objFirstNameValue=document.getElementById(objFirstName).value;
if(objFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value;
if(objLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value;
if(objCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value;
if(objAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Address1";}
var objCountryValue=document.getElementById(objCountry).value;
if(objCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Country";}
var objStateValue=document.getElementById(objState).value;
if(objStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the State";}
var objCityValue=document.getElementById(objCity).value;
if(objCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter City";}
var objZipCodeValue=document.getElementById(objZipCode).value;
if(objZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter ZipCode";}
var objPhoneValue=document.getElementById(objPhone).value;
if(objPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value;
if(objFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value;
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}
if(document.getElementById(objEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Email";}
var objShipFirstNameValue=document.getElementById(objShipFirstName).value;
if(objShipFirstNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping First Name";}
var objShipLastNameValue=document.getElementById(objShipLastName).value;
if(objShipLastNameValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Last Name";}
var objShipCompanyValue=document.getElementById(objShipCompany).value;
if(objShipCompanyValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Company";}
var objShipAddressValue=document.getElementById(objShipAddress).value;
if(objShipAddressValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Address1";}
var objShipCountryValue=document.getElementById(objShipCountry).value;
if(objShipCountryValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Shipping Country";}
var objShipStateValue=document.getElementById(objShipState).value;
if(objShipStateValue=='none')
{
themessage1=themessage1+"\n"+" - Please Select the Shipping State";}
var objShipCityValue=document.getElementById(objShipCity).value;
if(objShipCityValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping City";}
var objShipZipCodeValue=document.getElementById(objShipZipCode).value;
if(objShipZipCodeValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping ZipCode";}
var objShipPhoneValue=document.getElementById(objShipPhone).value;
if(objShipPhoneValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Phone";}
var objShipFaxValue=document.getElementById(objShipFax).value;
if(objShipFaxValue=='')
{
themessage1=themessage1+"\n"+" - Please enter Shipping Fax";}
var objShipEmailValue=document.getElementById(objShipEmail).value;
if(objShipEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objShipEmailValue!=''&&CheckEmail.test(objShipEmailValue)==false)
{
themessage1=themessage1+"\n"+" - Please enter a valid Email";}
if(document.getElementById(objShipEmail).value.length>50)
{
themessage1=themessage1+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage1=themessage1+"\n"+" - Please enter a Shipping Email";}
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillAddressStar').innerHTML='<font color="black">*</font>';}
if(objCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCountryStar').innerHTML='<font color="black">*</font>';}
if(objStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillStateStar').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillCityStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillEmailStar').innerHTML='<font color="red">*</font>';}
else if(document.getElementById(objEmail).value.length>100)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblBillEmailStar').innerHTML='<font color="black">*</font>';}
if(objShipFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objShipLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipLastNameStar').innerHTML='<font color="black">*</font>';}
if(objShipCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCompanyStar').innerHTML='<font color="black">*</font>';}
if(objShipAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAddressStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipAddressStar').innerHTML='<font color="black">*</font>';}
if(objShipCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCountryStar').innerHTML='<font color="black">*</font>';}
if(objShipStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipStateStar').innerHTML='<font color="black">*</font>';}
if(objShipCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipCityStar').innerHTML='<font color="black">*</font>';}
if(objShipZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipZipCodeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipZipCodeStar').innerHTML='<font color="black">*</font>';}
if(objShipPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipPhoneStar').innerHTML='<font color="black">*</font>';}
if(objShipFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblShipFaxStar').innerHTML='<font color="black">*</font>';}
if(objShipEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}
else if(objShipEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objShipEmailValue!=''&&CheckEmail.test(objShipEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}
else if(document.getElementById(objShipEmail).value.length>100)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblshipEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateChangePassword(objOldPassword,objNewPassword,objConfirmPassword)
{
var themessage1='';
var objOldPasswordValue=document.getElementById(objOldPassword).value;
if(objOldPasswordValue=='')
{
themessage1=themessage1+"\n"+" - Please Enter Old Password";}
var objNewPasswordValue=document.getElementById(objNewPassword).value;
if(objNewPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objNewPasswordValue!=''&&CheckPassword.test(objNewPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblNewPasswordStar').innerHTML='<font color="red">*</font>';
return false;}
else if(objNewPasswordValue!='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblNewPasswordStar').innerHTML='<font color="black">*</font>';
var objConfirmPasswordValue=document.getElementById(objConfirmPassword).value;
if(objConfirmPasswordValue!='')
{
if(objConfirmPasswordValue!=objNewPasswordValue)
{
alert("New Password and Confirm Password do not match");
document.getElementById('ctl00_ContentPlaceHolder1_lblConfirmPasswordStar').innerHTML='<font color="red">*</font>';
return false;}}
else
{
themessage1=themessage1+"\n"+" - Please Enter Confirm Password";}}}
else
{
themessage1=themessage1+"\n"+" - Please Enter New Password";}
var objConfirmPasswordValue=document.getElementById(objConfirmPassword).value;
if(themessage1!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objOldPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblOldPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblOldPasswordStar').innerHTML='<font color="black">*</font>';}
if(objNewPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objNewPasswordValue!=''&&CheckPassword.test(objNewPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblNewPasswordStar').innerHTML='<font color="black">*</font>';
return false;}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblNewPasswordStar').innerHTML='<font color="red">*</font>';}
if(objConfirmPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblConfirmPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblConfirmPasswordStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function ValidateUserAccountNoPhone2(objFirstName,objLastName,objCompany,objAddress,objCity,ddlState,objZipCode,ddlCountry,objPhone,objFax,objEmail,objPassword,objddlUserType)
{
var themessage='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var ddlStateValue=document.getElementById(ddlState).value;
var ddlStateEnabled=document.getElementById(ddlState).disabled;
if(!ddlStateEnabled)
{
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please select State";}}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var ddlCountryValue=document.getElementById(ddlCountry).value;
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please select Country";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
var objPasswordValue=document.getElementById(objPassword).value.trim();
if(objPasswordValue=='')
{
themessage=themessage+"\n"+" - Please enter Password";}
var objddlUserTypeValue=document.getElementById(objddlUserType).value;
if(objddlUserTypeValue=='none')
{
themessage=themessage+"\n"+" - Please Select UserType";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(!ddlStateEnabled)
{
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';}
if(objddlUserTypeValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUserTypeStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblUserTypeStar').innerHTML='<font color="black">*</font>';}
return false;}
else if(objPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objPasswordValue!=""&&CheckPassword.test(objPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';
return true;}}
else
{
return true;}}
function calculate_cost_per_unit(unitsize,costperunit,unitcost)
{
var unitSize=document.getElementById(unitsize).value;
var costPerUnit=document.getElementById(costperunit).value;
var unitCost=document.getElementById(unitcost);
if(unitSize!=""&&costPerUnit!=="")
{
unitCost.value=unitSize*costPerUnit}}
function calculate_total_price(unitprice,quantity,totalprice)
{
var Quantity=document.getElementById(quantity).value;
var totalPrice=document.getElementById(totalprice);
if(Quantity!=""&&Quantity!="0")
{
unitprice=unitprice.replace(",","");
var TotalPrice=unitprice*Quantity;
TotalPrice=TotalPrice.toFixed(2);
totalPrice.value=numberFormat(TotalPrice+'',"$");}
else
{
totalPrice.value=""}}
function numberFormat(nStr,prefix)
{
var prefix=prefix||'';
nStr+='';
x=nStr.split('.');
x1=x[0];
x2=x.length>1?'.'+x[1]:'';
var rgx=/(\d+)(\d{3})/;
while(rgx.test(x1))
x1=x1.replace(rgx,'$1'+','+'$2');
return prefix+x1+x2;}
function ValidateUpdateUserAccount(objFirstName,objLastName,objCompany,objAddress,objCity,ddlState,objZipCode,ddlCountry,objPhone,objPhone2,objFax,objEmail,objPassword)
{
var themessage='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var ddlStateValue=document.getElementById(ddlState).value;
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please select State";}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var ddlCountryValue=document.getElementById(ddlCountry).value;
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please select Country";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objPhone2Value=document.getElementById(objPhone2).value.trim();
if(objPhone2Value=='')
{
themessage=themessage+"\n"+" - Please enter Phone 2";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
var objPasswordValue=document.getElementById(objPassword).value.trim();
if(objPasswordValue=='')
{
themessage=themessage+"\n"+" - Please enter Password";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objPhone2Value=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar2').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar2').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';}
return false;}
else if(objPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objPasswordValue!=""&&CheckPassword.test(objPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';
return true;}}
else
{
return true;}}
function ValidateUpdateUserAccountNoPhone2(objFirstName,objLastName,objCompany,objAddress,objCity,ddlState,objZipCode,ddlCountry,objPhone,objFax,objEmail,objPassword)
{
var themessage='';
var flag=false;
var objFirstNameValue=document.getElementById(objFirstName).value.trim();
if(objFirstNameValue=='')
{
themessage=themessage+"\n"+" - Please enter First Name";}
var objLastNameValue=document.getElementById(objLastName).value.trim();
if(objLastNameValue=='')
{
themessage=themessage+"\n"+" - Please enter Last Name";}
var objCompanyValue=document.getElementById(objCompany).value.trim();
if(objCompanyValue=='')
{
themessage=themessage+"\n"+" - Please enter Company";}
var objAddressValue=document.getElementById(objAddress).value.trim();
if(objAddressValue=='')
{
themessage=themessage+"\n"+" - Please enter Address1";}
var objCityValue=document.getElementById(objCity).value.trim();
if(objCityValue=='')
{
themessage=themessage+"\n"+" - Please enter City";}
var ddlStateValue=document.getElementById(ddlState).value;
var ddlStateEnable=document.getElementById(ddlState).disabled;
if(!ddlStateEnable)
{
if(ddlStateValue=='none')
{
themessage=themessage+"\n"+" - Please select State";}}
var objZipCodeValue=document.getElementById(objZipCode).value.trim();
if(objZipCodeValue=='')
{
themessage=themessage+"\n"+" - Please enter ZipCode";}
var ddlCountryValue=document.getElementById(ddlCountry).value;
if(ddlCountryValue=='none')
{
themessage=themessage+"\n"+" - Please select Country";}
var objPhoneValue=document.getElementById(objPhone).value.trim();
if(objPhoneValue=='')
{
themessage=themessage+"\n"+" - Please enter Phone";}
var objFaxValue=document.getElementById(objFax).value.trim();
if(objFaxValue=='')
{
themessage=themessage+"\n"+" - Please enter Fax";}
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
var objPasswordValue=document.getElementById(objPassword).value.trim();
if(objPasswordValue=='')
{
themessage=themessage+"\n"+" - Please enter Password";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objFirstNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFirstNameStar').innerHTML='<font color="black">*</font>';}
if(objLastNameValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblLastNameStar').innerHTML='<font color="black">*</font>';}
if(objCompanyValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCompanyStar').innerHTML='<font color="black">*</font>';}
if(objAddressValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblAddress1Star').innerHTML='<font color="black">*</font>';}
if(objCityValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCityStar').innerHTML='<font color="black">*</font>';}
if(!ddlStateEnable)
{
if(ddlStateValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblStateStar').innerHTML='<font color="black">*</font>';}}
if(objZipCodeValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblZipStar').innerHTML='<font color="black">*</font>';}
if(ddlCountryValue=='none')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblCountryStar').innerHTML='<font color="black">*</font>';}
if(objPhoneValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPhoneStar').innerHTML='<font color="black">*</font>';}
if(objFaxValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblFaxStar').innerHTML='<font color="black">*</font>';}
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
if(flag==true)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
if(objPasswordValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';}
return false;}
else if(objPasswordValue!='')
{
var CheckPassword=new RegExp(/^.{6,20}$/);
if(objPasswordValue!=""&&CheckPassword.test(objPasswordValue)==false)
{
alert('Password should be minimum of 6 characters and maximum 20');
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="red">*</font>';
return false;}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblPasswordStar').innerHTML='<font color="black">*</font>';
return true;}}
else
{
return true;}}
function backButtonOverride()
{
setTimeout("backButtonOverrideBody()",1);}
function backButtonOverrideBody()
{
try
{
history.forward();}
catch(e)
{
return;}
setTimeout("backButtonOverrideBody()",1);}
function ValidateGeneralInquiry(objEmail)
{
var themessage='';
var flag=false;
var objEmailValue=document.getElementById(objEmail).value.trim();
if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
themessage=themessage+" - Enter valid Email in format(xxxx@xxx.com)"+"\n";
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
themessage=themessage+"\n"+" - Please enter a valid Email";}}
if(document.getElementById(objEmail).value.length>50)
{
themessage=themessage+"\n"+" - Email can not exceed 50 characters";}}
else
{
themessage=themessage+"\n"+" - Please enter a Email";}
if(themessage!='')
{
alert('Invalid data in field(s) highlighted red!');
if(objEmailValue=='')
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else if(objEmailValue!='')
{
CheckEmail=new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
if(objEmailValue!=""&&echeck(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';
flag=true;}
if(flag==false)
{
if(objEmailValue!=''&&CheckEmail.test(objEmailValue)==false)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else if(document.getElementById(objEmail).value.length>50)
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="red">*</font>';}}
else
{
document.getElementById('ctl00_ContentPlaceHolder1_lblEmailStar').innerHTML='<font color="black">*</font>';}
return false;}
else
{
return true;}}
function echeck(str)
{
var at="@";
var dot=".";
var lat=str.indexOf(at);
var lstr=str.length;
var ldot=str.indexOf(dot);
if(str.indexOf(at)==-1)
{
return false;}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)
{
return false;}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){
return false;}
if(str.indexOf(at,(lat+1))!=-1)
{
return false;}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)
{
return false;}
if(str.indexOf(dot,(lat+2))==-1)
{
return false;}
if(str.indexOf(" ")!=-1)
{
return false;}
return true;}
function DisableClipboardOperation(strTextBoxId)
{
sTextBoxId=strTextBoxId;
if(document.all)
{
document.onkeydown=onKeyPress;
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;}
else if(document.layers||document.getElementById)
{
document.onkeypress=onKeyPress;
document.onmousedown=clickNS;}}
function onKeyPress(evt)
{
var bRet=true;
var msgCtrl="Control key operation is disabled.";
var msgShift="Shift + Insert operation is disabled";
var oEvent=(window.event)?window.event:evt;
var nKeyCode=oEvent.keyCode?oEvent.keyCode:oEvent.which?oEvent.which:void 0;
var sChar=String.fromCharCode(nKeyCode).toUpperCase();
var bCtrlPressed=(oEvent.ctrlKey)?oEvent.ctrlKey:oEvent.modifiers&2>0;
var bShiftPressed=(oEvent.shiftKey)?oEvent.shiftKey:oEvent.modifiers&4>0;
if(GetTagName(evt))
{
if(bCtrlPressed&&(sChar=='A'||sChar=='C'||sChar=='V'||sChar=='X'))
{
bRet=false;}
else if(bShiftPressed&&(nKeyCode==45))
{
bRet=false;}}
if(!bRet)
{
try
{
oEvent.returnValue=false;
oEvent.cancelBubble=true;
if(document.all)
{
oEvent.keyCode=0;}
else
{
oEvent.preventDefault();
oEvent.stopPropagation();}}
catch(ex)
{}}
return bRet;}
function GetTagName(evt)
{
var oEvent=(window.event)?window.event:evt;
var nKeyCode=oEvent.keyCode?oEvent.keyCode:oEvent.which?oEvent.which:void 0;
var oTarget=(oEvent.target)?oEvent.target:oEvent.srcElement;
var sTag=oTarget.tagName.toLowerCase();
var sTagType=oTarget.getAttribute("type");
var sTagId=oTarget.getAttribute("ID");
if(sTagType!=null)
{
sTagType=sTagType.toLowerCase();}
if(sTag=="input"&&(sTagType=="password"||sTagType=="text")&&sTagId==sTextBoxId)
{
return true;}
else
{
return false;}}
function clickIE()
{
if(document.all)
{
if(GetTagName())
{
return false;}}}
function clickNS(e)
{
if(document.layers||(document.getElementById&&!document.all))
{
if(GetTagName(e))
{
document.oncontextmenu=new Function("return false")
if(e.which==2||e.which==3)
{
return false;}}
else
{
document.oncontextmenu=new Function("return true")}}}
function fileOpen(pdf)
{
window.open("PdfDocument.aspx?FileName="+pdf,"_blank","toolbar=0, location=0, status=0, menubar=0, scrollbars=1, resizable=1, height=500, width=700");}
function Confirm(objConfirmation)
{
var chkConfirm=document.getElementById(objConfirmation).checked;
if(!chkConfirm)
{
alert('Please accept the terms and conditions');
return false;}}
function validateQuantity(quantity)
{
var Quantity=document.getElementById(quantity).value;
var x="0";
var y="";
while(Quantity.indexOf(x)!=-1)
{
var leading=Quantity.substring(0,Quantity.indexOf(x));
var trailing=Quantity.substring(Quantity.indexOf(x)+x.length,Quantity.length);
Quantity=leading+y+trailing;}
if(Quantity=='0'||Quantity=='')
{
alert('Quantity should be atleast one');
document.getElementById(quantity).value='1';
return false;}}
function CheckMaxContent(txtId,maxLen)
{
if(document.getElementById(txtId).value.length>(maxLen))
{
alert('Should be Restricted for 500 Characters');
return false;}
else
{
return true;}}
function CheckCharacter(e)
{
var keynum,keychar,keycheck;
var regexpr=/[^\>\<\s]/;
keynum=(window.event)?e.keyCode:e.which;
keychar=String.fromCharCode(keynum);
keycheck=regexpr.test(keychar)?true:false;
return keycheck;}
function CheckboxCheck(chk)
{
var chkbox=document.getElementById(chk);
if(chkbox.checked)
chkbox.checked=false;
else
chkbox.checked=true;}
function validateMeasurementRate(Rate)
{
var measureRate=document.getElementById(Rate).value;
var rate="";
if(measureRate.indexOf('.')!=-1)
{
rate=measureRate.substring(0,measureRate.indexOf('.'));}
else
{
rate=measureRate;}
if(rate.length>6)
alert('Invalid Measurement Rate');}
function ApplyFocus(ddlId,ScriptManagerId)
{
var scriptValue=document.getElementById(ScriptManagerId);
var ddlValue=document.getElementById(ddlId);
scriptValue.SetFocus(ddlValue);}
function SetDefaultButtonGo(btnValue,hdnId)
{
var hdnValue=document.getElementById(hdnId);
hdnValue.value=btnValue;}
var A_MENUS=[];
var mychange='';
var mychange2='';
var mychange3='';
function menu(a_items,a_tpl){
path=document.getElementById('ctl00_hdnMenuAdmin').value;
if(!document.body||!document.body.style)
return;
this.a_config=a_items;
this.a_tpl=a_tpl;
this.n_id=A_MENUS.length;
this.a_index=[];
this.a_children=[];
this.expand=menu_expand;
this.collapse=menu_collapse;
this.onclick=menu_onclick;
this.onmouseout=menu_onmouseout;
this.onmouseover=menu_onmouseover;
this.onmousedown=menu_onmousedown;
this.a_tpl_def={'block_top':16,'block_left':16,'top':20,'left':4,'width':120,'height':22,'hide_delay':0,'expd_delay':0,'css':{'inner':'','outer':''}};
this.getprop=function(s_key){
return this.a_tpl_def[s_key];};
this.o_root=this;
this.n_depth=-1;
this.n_x=0;
this.n_y=0;
for(n_order=0;n_order<a_items.length;n_order++)
new menu_item(this,n_order);
A_MENUS[this.n_id]=this;
for(var n_order=0;n_order<this.a_children.length;n_order++)
this.a_children[n_order].e_oelement.style.visibility='visible';}
function menu_collapse(n_id){
clearTimeout(this.o_showtimer);
var n_tolevel=(n_id?this.a_index[n_id].n_depth:0);
for(n_id=0;n_id<this.a_index.length;n_id++){
var o_curritem=this.a_index[n_id];
if(o_curritem.n_depth>n_tolevel&&o_curritem.b_visible){
o_curritem.e_oelement.style.visibility='hidden';
o_curritem.b_visible=false;}}
if(!n_id)
this.o_current=null;}
function menu_expand(n_id){
if(this.o_hidetimer)
return;
var o_item=this.a_index[n_id];
if(this.o_current&&this.o_current.n_depth>=o_item.n_depth)
this.collapse(o_item.n_id);
this.o_current=o_item;
if(!o_item.a_children)
return;
for(var n_order=0;n_order<o_item.a_children.length;n_order++){
var o_curritem=o_item.a_children[n_order];
o_curritem.e_oelement.style.visibility='visible';
o_curritem.b_visible=true;
if(path=='Public')
{
if(n_order==0)
{
mychange=o_curritem.e_oelement;
mychange.className='m0l1oouttop';}
if(n_order==o_item.a_children.length)
{
mychange2=o_curritem.e_oelement;
mychange2.className='m0l1ooutbottom';}
if(n_order==0&&o_item.a_children.length==1)
{
mychange2=o_curritem.e_oelement;
mychange2.className='m0l1ooutbottom';}}}}
function menu_onclick(n_id){
return Boolean(this.a_index[n_id].a_config[1]);}
function menu_onmouseout(n_id){
for(i=0;i<document.forms[0].elements.length;i++)
{
var control=document.forms[0].elements[i];
if(control.type=='select-one')
{
control.style.visibility="";}}
var o_item=this.a_index[n_id];
o_item.e_oelement.className=o_item.getstyle(0,0);
o_item.e_ielement.className=o_item.getstyle(1,0);
o_item.upstatus(7);
this.o_hidetimer=setTimeout('A_MENUS['+this.n_id+'].collapse();',
o_item.getprop('hide_delay'));}
function menu_onmouseover(n_id)
{
var currentUrl=window.location.href+'';
currentUrl=currentUrl.toLowerCase();
if(currentUrl.match('shoppingusers/logon.aspx')!=null)
{
document.getElementById('ctl00_ContentPlaceHolder1_txtLoginEmail').focus();
document.getElementById('ctl00_ContentPlaceHolder1_txtLoginEmail').blur();}
var i=0;
for(i=0;i<document.forms[0].elements.length;i++)
{
var control=document.forms[0].elements[i];
if(control.type=='select-one')
{}}
clearTimeout(this.o_hidetimer);
this.o_hidetimer=null;
clearTimeout(this.o_showtimer);
var o_item=this.a_index[n_id];
o_item.upstatus();
o_item.e_oelement.className=o_item.getstyle(0,1);
o_item.e_ielement.className=o_item.getstyle(1,1);
if(o_item.getprop('expd_delay')<0)
return;
this.o_showtimer=setTimeout('A_MENUS['+this.n_id+'].expand('+n_id+');',
o_item.getprop('expd_delay'));
if(path=='Public')
{
mychange.className='m0l1oouttop3';
mychange2.className='m0l1ooutbottom';}}
function menu_onmousedown(n_id){
var o_item=this.a_index[n_id];
o_item.e_oelement.className=o_item.getstyle(0,2);
o_item.e_ielement.className=o_item.getstyle(1,2);
if(path=='Public')
{
mychange.className='m0l1ooutbottom';}
this.expand(n_id);}
function menu_item(o_parent,n_order){
this.n_depth=o_parent.n_depth+1;
this.a_config=o_parent.a_config[n_order+(this.n_depth?3:0)];
if(!this.a_config)return;
this.o_root=o_parent.o_root;
this.o_parent=o_parent;
this.n_order=n_order;
this.n_id=this.o_root.a_index.length;
this.o_root.a_index[this.n_id]=this;
o_parent.a_children[n_order]=this;
var o_root=this.o_root,
a_tpl=this.o_root.a_tpl;
this.getprop=mitem_getprop;
this.getstyle=mitem_getstyle;
this.upstatus=mitem_upstatus;
this.n_x=n_order?o_parent.a_children[n_order-1].n_x+this.getprop('left'):o_parent.n_x+this.getprop('block_left');
this.n_y=n_order?o_parent.a_children[n_order-1].n_y+this.getprop('top'):o_parent.n_y+this.getprop('block_top');
var tempValue=(this.a_config[1]==null)?'':this.a_config[1];
document.write('<a id="e'+o_root.n_id+'_'
+this.n_id+'o" class="'+this.getstyle(0,0)+'" title="'+this.a_config[2]+'" href="'+tempValue+'"'
+(this.a_config[2]&&this.a_config[2]['tw']?' target="'
+this.a_config[2]['tw']+'"':'')+' style="cursor:hand;position: absolute; top: '
+this.n_y+'px; left: '+this.n_x+'px; width: '
+this.getprop('width')+'px; height: '
+this.getprop('height')+'px; visibility: hidden;'
+' z-index: '+this.n_depth+';" '
+'onclick="return A_MENUS['+o_root.n_id+'].onclick('
+this.n_id+');" onmouseout="A_MENUS['+o_root.n_id+'].onmouseout('
+this.n_id+');" onmouseover="A_MENUS['+o_root.n_id+'].onmouseover('
+this.n_id+');" onmousedown="A_MENUS['+o_root.n_id+'].onmousedown('
+this.n_id+');"><div  id="e'+o_root.n_id+'_'
+this.n_id+'i" class="'+this.getstyle(1,0)+'">'
+this.a_config[0]+"</div></a>\n");
this.e_ielement=document.getElementById('e'+o_root.n_id+'_'+this.n_id+'i');
this.e_oelement=document.getElementById('e'+o_root.n_id+'_'+this.n_id+'o');
this.b_visible=!this.n_depth;
if(this.a_config.length<4)
return;
this.a_children=[];
for(var n_order=0;n_order<this.a_config.length-3;n_order++)
new menu_item(this,n_order);}
function mitem_getprop(s_key){
var s_value=null,
a_level=this.o_root.a_tpl[this.n_depth];
if(a_level)
s_value=a_level[s_key];
return(s_value==null?this.o_parent.getprop(s_key):s_value);}
function mitem_getstyle(n_pos,n_state){
var a_css=this.getprop('css');
var a_oclass=a_css[n_pos?'inner':'outer'];
if(typeof(a_oclass)=='string')
return a_oclass;
for(var n_currst=n_state;n_currst>=0;n_currst--)
if(a_oclass[n_currst])
return a_oclass[n_currst];}
function mitem_upstatus(b_clear){
window.setTimeout("window.status=unescape('"+(b_clear?'':(this.a_config[2]&&this.a_config[2]['sb']?escape(this.a_config[2]['sb'].replace('null','')):escape(this.a_config[0].replace('&nbsp;',''))+(this.a_config[1]?' ('+escape(this.a_config[1].replace('null',''))+')':'')))+"')",10);}
var MENU_POS=[
{'height':23,'width':114,'block_top':0,'block_left':10,'top':25,'left':0,'hide_delay':100,'expd_delay':100,'css':{'outer':['vertmenuLevel0OutOut','vertmenuLevel0OutOver'],'inner':['vertmenuLevel1InOut','vertmenuLevel1InOver']}},
{'height':23,'width':180,'block_top':0,'block_left':120,'top':23,'left':0,'css':{'outer':['vertmenuLevel1OutOut','vertmenuLevel1OutOver'],'inner':['vertmenuLevel1InOut','vertmenuLevel1InOver']}},
{'block_top':140,'block_left':20,'css':{'outer':['vertmenuLevel1OutOut','vertmenuLevel1OutOver'],'inner':['menuLevel1InOut','menuLevel1InOver']}}]