var _form_functions=null;function form_functions(){this.name_form='mainform';this.obj_form=null;this.form_edited=1;this.name_edit_hold='page-edit-hold';this.id_edit_hold=null;this.form_onsubmit_saved=null;this.form_button_divs=new Array();this.form_link_divs=new Array();this.form_eval_divs=new Array();this.css_formbutton_off='formbutton-off';this.css_formbutton_on='formbutton-on';}form_functions.prototype.init=function(){this.obj_form=document.getElementById(this.name_form);if(this.obj_form.onsubmit){this.form_onsubmit_saved=this.obj_form.onsubmit;}try{this.id_edit_hold=document.getElementById(this.name_edit_hold);}catch(error){}var inputs=this.obj_form.getElementsByTagName('INPUT');_form_functions=this;for(var i=0;i<=inputs.length;i++){try{if(inputs[i].type=='hidden'){continue;}}catch(error){continue;}inputs[i].onchange=this.form_event_edited;}this.obj_form.onsubmit=this.form_submit;};form_functions.prototype.add_submit_event=function(div_id,field_name,init_value,onsubmit_value){var div_obj=null;try{div_obj=document.getElementById(div_id);}catch(error){alert("Could not initialize field: "+div_id);return false;}if(field_name){var field=document.createElement('input');field.type='hidden';field.value=init_value;field.name=field_name;field.id='field--x--'+div_id;this.obj_form.appendChild(field);this.form_button_divs[div_id]=onsubmit_value;}div_obj.onmouseover=this.form_button_mouseover;div_obj.onmouseout=this.form_button_mouseout;div_obj.onclick=this.form_button_submit;div_obj.className=this.css_formbutton_off;};form_functions.prototype.add_eval_event=function(div_id,eval_code){var div_obj=null;try{div_obj=document.getElementById(div_id);}catch(error){alert("Could not initialize event: "+div_id);return false;}this.form_eval_divs[div_id]=eval_code;div_obj.onmouseover=this.form_button_mouseover;div_obj.onmouseout=this.form_button_mouseout;div_obj.onclick=this.form_button_eval_click;div_obj.className=this.css_formbutton_off;};form_functions.prototype.add_link_event=function(div_id,link_url){var div_obj=null;try{div_obj=document.getElementById(div_id);}catch(error){alert("Could not initialize event: "+div_id);return false;}this.form_link_divs[div_id]=link_url;div_obj.onmouseover=this.form_button_mouseover;div_obj.onmouseout=this.form_button_mouseout;div_obj.onclick=this.form_button_link_click;div_obj.className=this.css_formbutton_off;};form_functions.prototype.form_button_eval_click=function(){try{eval(_form_functions.form_eval_divs[this.id]);}catch(error){}};form_functions.prototype.form_button_link_click=function(){try{window.location=_form_functions.form_link_divs[this.id];}catch(error){}};form_functions.prototype.form_button_submit=function(){try{var field_obj=document.getElementById('field--x--'+this.id);field_obj.value=_form_functions.form_button_divs[this.id];}catch(error){}_form_functions.form_submit();_form_functions.obj_form.submit();};form_functions.prototype.form_button_mouseover=function(){this.className=_form_functions.css_formbutton_on;};form_functions.prototype.form_button_mouseout=function(){this.className=_form_functions.css_formbutton_off;};form_functions.prototype.form_event_edited=function(){_form_functions.form_edited=1;};form_functions.prototype.form_submit=function(){var retval=true;if(_form_functions.form_edited){}if(_form_functions.form_onsubmit_saved){eval('tmpsubmit = '+_form_functions.form_onsubmit_saved);retval=tmpsubmit();}return retval;};form_functions.prototype.document_onblur=function(){if(_form_functions.form_edited){}};
