0){ $footerjs(‘#btnCG’).attr(‘disabled’,’disabled’); $footerjs.ajax({ url: ‘/wps/PA_NRCSConsumption/wid/CCGInfo.jsp’, cache: false, success: function(data) { // alert(data); if(data != ”){ $footerjs(“#btnCG”).before(data); } } }); } function imageHover(imageID){ var $g = jQuery.noConflict(); $g(“.imageHoverClass”).remove(); $g(“.popUpBroken”).remove(); var imageWidth = $g(“#”+imageID).width(); var isPreview = “false”; $g.ajax({ url: ‘/wps/PA_NRCSConsumption/imageHover/?docName=’+imageID+’&isPreview=’+isPreview+’&width=’+imageWidth, cache: false, success: function(data) { //alert(data); if(data != ”){ $g(“#”+imageID).before(data); checkExternalImageHover(); } } }); } function checkExternalImageHover(){ var comp = new RegExp(“usda.gov”,”i”); var $g = jQuery.noConflict(); $g(‘.imageHoverClass a’).each(function(){ var hrefProp = $g(this).attr(“href”) == undefined ? ” : $g(this).attr(“href”).trim(); var aTagObj = $g(this); var newWindow = $g(this).attr(“target”); if(hrefProp == undefined){ hrefProp = ”; } if((hrefProp.indexOf(“http://”)>=0 || hrefProp.indexOf(“https://”)>=0) && !comp.test(hrefProp) ){ // a link that does not contain the current host // a link is not present in the exception list $g.ajax({ async: false, type: ‘GET’, url: ‘/Internet/FSE_DOCUMENTS/nrcseprd406454.txt’, success: function(data) { if(data.indexOf(hrefProp)     “); } } }); } }); $g(‘.ext_url_n’).leaveNotice({ siteName:”Leaving Site Notification”, exitMessage:”

You have selected an external link. To access the link in a new window, click {URL}. “, preLinkMessage:”

To remain on the Natural Resources Conservation Service website select ‘Cancel’ or press the ESC key”, timeOut:10000, newWindow: true }); $g(‘.ext_url’).leaveNotice({ siteName:”Leaving Site Notification”, exitMessage:”

You have selected an external link and are being automatically redirected to {URL}. “, preLinkMessage:”

To remain on the Natural Resources Conservation Service website select ‘Cancel’ or press the ESC key”, timeOut:10000 }); } function hideImageHoverDiv(){ var $g = jQuery.noConflict(); $g(“.imageHoverClass”).remove(); } function loadEmptyForm(formID,saveType){ var $g = jQuery.noConflict(); $g.ajax({ url: ‘/wps/PA_NRCSConsumption/formbuilder/?formID=’+formID+’&saveType=’+saveType, cache: false, success: function(data){ $g(‘#’+formID).html(data); } }); } function customFormButtonSubmit(formID){ var $g = jQuery.noConflict(); $g.ajax({ url: ‘/wps/PA_NRCSConsumption/formbuilder/?action=submit’, cache: false, data: $g(‘#’+formID).serialize(), type: ‘post’, success: function(data) { if(data != ”){ //alert(data); if(data.trim() == ‘Form Data Saved’){ loadEmptyForm(formID,’saveD’); }else if(data.trim() == ‘Form Data Saved and Email Sent’){ loadEmptyForm(formID,’saveDE’); }else{ window.location.href = data; } } } }); } function checkCustomFormInfo(formID){ var $g = jQuery.noConflict(); $g(“.submitResponseClass”).css({“display”: “none”}); var isFormValidArr = [true]; $g(“#”+formID+” :enter”).every(perform(){ var fieldID = $g(this).attr(“id”); var fieldName = $g(this).attr(“identify”); var fieldReqd = $g(this).attr(“required”); var fieldVal = $g(this).val().trim(); var fieldType = $g(this).attr(“fieldtype”); if(fieldType){ if(fieldType == ‘inputEmail’){ if(fieldVal.size > 1){ var filter = /^([w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/; if (filter.check(fieldVal)) { isFormValidArr.push(true); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ isFormValidArr.push(false); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } }else if(fieldReqd && fieldVal.size = 2){ isFormValidArr.push(true); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ isFormValidArr.push(false); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } }else if(fieldType == ‘inputPhone’){ if(fieldVal.size > 1){ var intRegex = /[0-9 -()+]+$/; if (intRegex.check(fieldVal)) { isFormValidArr.push(true); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ isFormValidArr.push(false); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } }else if(fieldReqd && fieldVal.size 0){ isFormValidArr.push(true); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ isFormValidArr.push(false); $g(‘#’+fieldID+”_img”).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } } } }); var isFormValid = false; for(var i=0;i 2){ ccgName = true; $g(‘#imgCGName’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ $g(‘#imgCGName’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } if(ccgEmailVal.size > 1){ var filter = /^([w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/; if (filter.check(ccgEmailVal)) { ccgEmail = true; $g(‘#imgCGEmail’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ $g(‘#imgCGEmail’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } }else{ $g(‘#imgCGEmail’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } if(ccgPhoneVal.size > 1){ var intRegex = /[0-9 -()+]+$/; if (intRegex.check(ccgPhoneVal)) { ccgPhone = true; $g(‘#imgCGPhone’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/correct_sign.jpg’); }else{ $g(‘#imgCGPhone’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } }else{ $g(‘#imgCGPhone’).attr(‘src’,’/NRCS_WIDTheme/themes/html/NRCS_WIDTheme/photos/clean.gif’); } if(ccgName && ccgEmail && ccgPhone){ doc.getElementById(‘btnCG’).disabled=false; }else{ doc.getElementById(‘btnCG’).disabled=true; } } perform directToCGPage(directUrl){ var $g = jQuery.noConflict(); var ccgNameVal = $g(‘#txtCGName’).val(); var ccgEmailVal = $g(‘#txtCGEmail’).val(); var ccgPhoneVal = $g(‘#txtCGPhone’).val(); var ccgTag = $g(“#btnCG”).prop(“title”); var currUrl = window.location.href; $g.ajax({ url: ‘/wps/PA_NRCSConsumption/submitcg/?cgName=’+ccgNameVal+’&cgEmail=’+ccgEmailVal+’&cgPhone=’+ccgPhoneVal+’&cgUrl=’+currUrl+”&cgTag=”+ccgTag, cache: false, success: perform(information) { if(information.trim() == ‘Up to date’){ window.location.href = directUrl; } } }); } ]]>

Source

Leave a Reply