//webos/utility.js function str_trim(str) {var resultStr="";resultStr=str_trimleft(str);resultStr=str_trimright(resultStr);return resultStr;} function str_trimleft(str) {var resultStr="";var i=len=0;if(str+""=="undefined"||str==null) {return null;} str+="";if(str.length==0) {resultStr="";} else {len=str.length;while((i<=len)&&(str.charAt(i)==" ")) {i++;} resultStr=str.substring(i,len);} return resultStr;} function str_trimright(str) {var resultStr="";var i=0;if(str+""=="undefined"||str==null) return null;str+="";if(str.length==0) {resultStr="";} else {i=str.length-1;while((i>=0)&&(str.charAt(i)==" ")) {i--;} resultStr=str.substring(0,i+1);} return resultStr;} function str_replacechar(findchar,replacestring,searchstring) {newstring="";for(c=0;c'+desc+'' vheight+=21;} se_list_obj.style.pixelWidth=100;se_list_obj.style.height=vheight+'px';se_list_obj.innerHTML=html;if(timeout_id) {clearTimeout(timeout_id);timeout_id=0;} timeout_id=setTimeout("toggleSelectEdit(0)",5000);} else {if(timeout_id) {clearTimeout(timeout_id);timeout_id=0;} se_list_obj.style.visibility='hidden';}} function getFormCmdDesc(cmd) {switch(cmd) {case'V':desc='Submissions';break;case'C':desc='Conversions';break;case'X':desc='Export Forms';break;case'E':desc='Settings';break;default:desc='';} return desc;} function viewpage(link) {if(link) {window.open(link);}} validationRunning=false;function makeValidationCall(form_name) {if(validationRunning) {return;} validationRunning=true;clearFieldErrors(form_name);formObj=document.forms[form_name];if(!formObj) {validationDone();} postParms=compileAllFieldValues(formObj);if(!postParms) {validationDone();} postURL='../formsmgr/validate.html';var xmlhttp=initHTTPObject();xmlhttp.open('POST.html',postURL,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function() {if(xmlhttp.readyState==4&&xmlhttp.status==200) {processValidationResponse(form_name,xmlhttp.responseText)}};xmlhttp.send(postParms);} function processValidationResponse(form_name,response) {validationRunning=false;found_errors=new Array();form_name=form_name.toString();if(!response) {submitForm(form_name);return;} eval(response);if(!found_errors[0]) {submitForm(form_name);return;} for(i=0;i<=(found_errors.length-1);i++) {errornumber=i+1;errormessage=found_errors[i][0];fieldname=found_errors[i][1];fieldid=found_errors[i][2];showError(form_name,errornumber,errormessage,fieldname,fieldid);} window.location='#fieldblock-'+found_errors[0][2];validationDone();} function showError(form_name,errornumber,errormessage,fieldname,fieldid) {mainErrorsContainer=$("#"+form_name).find("#formerrors"+form_name);fieldBlockContainer=$("#"+form_name).find("#fieldblock-"+fieldid);fieldErrorContainer=$(fieldBlockContainer).find(".fielderror");if(fieldErrorContainer) {fieldErrorContainer.html(errormessage);} else if(mainErrorsContainer) {if(fieldname) {msg=''+errormessage+'
';} else {msg=errormessage+'
';} divContents=mainErrorsContainer.html();mainErrorsContainer.html(divContents+msg);} else {alert(errormessage);} if(fieldBlockContainer) {fieldBlockContainer.addClass('fieldblock-error');}} function submitForm(formname) {formObj=document.forms[formname];if(formObj) {setTimeout("formObj.submit();",1);return;} validationDone();} function validationDone() {validationRunning=false;} function clearFieldErrors(formname) {mainErrorsContainer=document.getElementById('formerrors'+formname);if(mainErrorsContainer) {mainErrorsContainer.innerHTML='';} fielderrorElements=getElementsByClass('fielderror');fieldblockElements=$(".fieldblock-error");if(fielderrorElements) {for(i=0;i=30) {clearInterval(looper);return;} if(cookieRetrieved) {clearInterval(looper);return;} getCode();},200);});function setCode() {if(typeof(window.aoPrimaryDomain)!='undefined') {var remoteService=window.aoPrimaryDomain+'/acton/multidomain.php';var aoCookieName='wp'+window.aoAccount;$('body').append('');return;}} function getCode() {if(typeof(window.aoPrimaryDomain)!='undefined') {var remoteService=window.aoPrimaryDomain+'/acton/multidomain.php';var aoCookieName='wp'+window.aoAccount;if(getCookie(aoCookieName)){cookieRetrieved=true;return;} $('body').append('');return;}} function createCookie(name,value,days){var expires;if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}else{expires="";} document.cookie=escape(name)+"="+escape(value)+expires+"; path=/";} function getCookie(name){var value="; "+document.cookie;var parts=value.split("; "+name+"=");if(parts.length==2)return parts.pop().split(";").shift();} //acton/js/jquery.actonform.js (function($){$.ActOnForm=function(element,options){var defaults={formid:'',formtype:'',formname:'',guid:new Date().getTime(),profileurl:'/acton/getformdata.php',profilevalues:{},requiredfields:{},nonrequiredfields:{}} var plugin=this;plugin.thisId=element.id;plugin.settings={} var $element=$(element),element=element;plugin.init=function(){plugin.settings=$.extend({},defaults,options);plugin.settings.formid=plugin.thisId;plugin.settings.formtype=$element.find('input[name="fields[form_type]"]').val();plugin.settings.formname=$element.attr('name');if(!plugin.settings.formtype||$element.attr('action')!='getjsbbd8.css'){plugin.unhookForm();return;} plugin.setupForm();} plugin.unhookForm=function(){$element.removeData('ActOnForm');} plugin.setupForm=function(){$.ajax({url:plugin.settings.profileurl+'?v='+plugin.settings.guid,method:'GET',data:{formtype:plugin.settings.formtype,formid:plugin.settings.formid},success:function(data,statusCode){if(!data){plugin.unhookForm();return;} response=$.parseJSON(data);plugin.settings.profilevalues=response.profilevalues;plugin.settings.requiredfields=response.requiredfields;plugin.settings.nonrequiredfields=response.nonrequiredfields;plugin.setProfileValues();plugin.setRequiredFields();plugin.setSubmitAction();},error:function(data,statusCode){plugin.unhookForm();}})} plugin.setProfileValues=function(){if(!plugin.settings.profilevalues){return;} profile=plugin.settings.profilevalues;$.each(profile,function(key,value){if($element.find('input[data-fieldgroup="'+key+'"],input[fieldgroup="'+key+'"]').length) {var numOptions=$element.find('input[data-fieldgroup="'+key+'"],input[fieldgroup="'+key+'"]').length;for(i=1;i<=numOptions;i++) {optionId=key+i;if($element.find('#'+optionId).val()==value) {$element.find('#'+optionId).attr("checked",1);}}} else if($element.find('#'+key).attr('type')=='checkbox') {if(value==1||value=='on') {$element.find('#'+key).attr('checked',true);}} else {value=$("
").html(value).text();$element.find('#'+key).val(value);} $element.find('#fieldblock-'+key).addClass('profile-autofill');});} plugin.setRequiredFields=function(){if(!plugin.settings.requiredfields){return;} required=plugin.settings.requiredfields;nonrequired=plugin.settings.nonrequiredfields;$.each(required,function(key,value){innertext=$element.find('#label'+value).text();$element.find('#fieldblock-'+value).addClass('profile-required');if(innertext.indexOf("*")>=0){} else{text=innertext;text=text.replace(text,text+'* ');$element.find('#label'+value).html(text);}});$.each(nonrequired,function(key,value){$element.find('#fieldblock-'+value).addClass('profile-nonrequired');});} plugin.setSubmitAction=function(){element.onsubmit='';$element.submit(function(){plugin.makeValidationCall($element.attr('name'));return false;});} plugin.processExtraValidation=function(){if(!plugin.settings.requiredfields){var isajax=$element.attr('data-ajax-submit');if(isajax){ajax_submitForm(formname);}else{element.submit();} return;} extraerrors=0;formname=plugin.settings.formname;required=plugin.settings.requiredfields;$.each(required,function(key,value){if($element.find('input[data-fieldgroup="'+value+'"],input[fieldgroup="'+value+'"]').length) {var radioChecked=false;var numOptions=$element.find('input[data-fieldgroup="'+value+'"],input[fieldgroup="'+value+'"]').length;for(i=1;i<=numOptions;i++) {optionId=value+i;if($element.find('#'+optionId).attr("checked")) {radioChecked=true;}} if(!radioChecked) {extraerrors++;showError(formname,extraerrors,'',value,value);}} else if(($element.find('#'+value).attr('data-fieldgroup')||$element.find('#'+value).attr('fieldgroup'))&&$element.find('input[data-fieldgroup="'+$element.find('#'+value).attr('data-fieldgroup')+'"],input[fieldgroup="'+$element.find('#'+value).attr('fieldgroup')+'"]').length) {var boxChecked=false;$.each($element.find('input[data-fieldgroup="'+$element.find('#'+value).attr('data-fieldgroup')+'"],input[fieldgroup="'+$element.find('#'+value).attr('fieldgroup')+'"]'),function(obj){if($(this).attr("checked")) {boxChecked=true;}});if(!boxChecked) {extraerrors++;showError(formname,extraerrors,'',value,value);}} else {if(!$element.find('#'+value).val()){extraerrors++;showError(formname,extraerrors,'',value,value);}}});if(!extraerrors){var isajax=$element.attr('data-ajax-submit');if(isajax){ajax_submitForm(formname);}else{element.submit();} return;} else{$('html, body').animate({scrollTop:$element.offset().top-130},200);}} plugin.makeValidationCall=function(form_name,callback){if(validationRunning) {return;} validationRunning=true;clearFieldErrors(form_name);formObj=$('#'+form_name);if(!formObj) {validationDone();} postParms=compileAllFieldValues(element);if(!postParms) {validationDone();} postURL='../formsmgr/validate.html';var xmlhttp=initHTTPObject();xmlhttp.open('POST.html',postURL,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function() {if(xmlhttp.readyState==4&&xmlhttp.status==200) {plugin.processValidationResponse(form_name,xmlhttp.responseText);}};xmlhttp.send(postParms);} plugin.processValidationResponse=function(form_name,response){validationRunning=false;found_errors=new Array();if(!response) {plugin.processExtraValidation();return;} eval(response);if(!found_errors[0]) {plugin.processExtraValidation();return;} for(i=0;i<=(found_errors.length-1);i++) {errornumber=i+1;errormessage=found_errors[i][0];fieldname=found_errors[i][1];fieldid=found_errors[i][2];showError(form_name,errornumber,errormessage,fieldname,fieldid);} $('html, body').animate({scrollTop:$("#"+form_name).offset().top-130},200);validationDone();} plugin.init();} $.fn.ActOnForm=function(options){return this.each(function(){if(undefined==$(this).data('ActOnForm')){var plugin=new $.ActOnForm(this,options);$(this).data('ActOnForm',plugin);}});}})(jQuery);