// encoded 29/05/2007 23:17:36 by nexencoder
function nex_set_value(v4, v5){var v1=0;var v2,v3;if(typeof(v4)=='string')v4=nex_get_object(v4);if(!v4)return;else if(v4.type=='select-one'){if(typeof(v5)!='string')v5=String(v5);for(v2=0;v2<v4.options.length;v2++){if((v4.options[v2].value&&v4.options[v2].value.toLowerCase()==v5.toLowerCase())||(!v4.options[v2].value&&escape(String(v4.options[v2].text.toLowerCase()))==escape(String(v5).toLowerCase()))){v4.selectedIndex=v2;v1=1;break;}}if(!v1&&!v5)v4.selectedIndex=0;}else if(v4.type=='select-multiple'){if(v5&&typeof(v5)!='object'){if(window.nex_player&&String(v5).indexOf(',')!=-1)v5=String(v5).split(',');else v5=new Array(String(v5));}else if(!v5)v5=[];for(v2=0;v2<v4.options.length;v2++)v4.options[v2].selected=false;for(v2=0;v2<v4.options.length;v2++)for(v3=0;v3<v5.length;v3++){if((v4.options[v2].value&&v4.options[v2].value.toLowerCase()==String(v5[v3]).toLowerCase())||(!v4.options[v2].value&&escape(String(v4.options[v2].text).toLowerCase())==escape(String(v5[v3]).toLowerCase()))){v4.options[v2].selected=true;v1=1;}}}else if(v4.length){for(v2=0;v2<v4.length;v2++)if(v4[v2]&&v4[v2].type=='checkbox')v4[v2].checked=false;for(v2=0;v2<v4.length;v2++){if(!v4[v2]||(v4[v2].type!='checkbox'&&v4[v2].type!='radio'))continue;if(v4[v2].type=='checkbox'&&typeof(v5)=='object'&&v5.length){for(v3=0;v3<v5.length;v3++)if(v4[v2].value==v5[v3])v4[v2].checked=true;}else v4[v2].checked=(v4[v2].value==v5);}}else if(v4.type=='checkbox'||v4.type=='radio'){if(v4.value==v5)v4.checked=true;else if(!v5&&v4.checked)v4.checked=false;}else v4.value=v5;}function nex_get_value(v3){if(typeof(v3)=='string')v3=nex_get_object(v3);var v1='';if(!v3)return'';if(v3.type=='checkbox'||v3.type=='radio'){if(v3.checked)v1=v3.value;}else if(v3.type=='select-one'&&v3.selectedIndex>=0){if(v3.options[v3.selectedIndex].value)v1=v3.options[v3.selectedIndex].value;else v1=v3.options[v3.selectedIndex].text;}else if(v3.type=='select-multiple'){for(var v2=0;v2<v3.options.length;v2++)if(v3.options[v2].selected){v1+=v1!=''?',':'';v1+=v3.options[v2].value?v3.options[v2].value:v3.options[v2].text;}}else if(v3.type)v1=v3.value;if(!v1&&v3.length)for(var v2=0;v2<v3.length;v2++)if(v3[v2]&&v3[v2].checked)if(v3[v2].type=='checkbox')v1+=(v1!=''?',':'')+v3[v2].value;else v1=v3[v2].value;return v1;}function nex_set_disabled(){if(!nex_set_disabled.arguments.length)return;var v1=nex_set_disabled.arguments;var v2=new Array(1);var v3=[];var v4,v5;if(v1.length==1){v2[1]=v1[0];v4=(typeof(v1[0])=='object'&&v1[0].disabled)?false:true;}else if(v1.length==2&&v1[0]!==null&&(typeof(v1[0])=='object'||typeof(v1[0])=='string'||(window.opera&&typeof(v1[0])=='function'))){v2[1]=v1[0];v4=v1[1];}else if(typeof(v1[0])!='undefined'){v2=v1;v4=v1[0];}for(var v6=1;v6<v2.length;v6++){v5=(typeof(v2[v6])=='string')?nex_get_object(v2[v6]):v2[v6];if(!v5)continue;if(v5.type)v3[v3.length]=v5;else if(v5.length)for(var v7=0;v7<v5.length;v7++)v3[v3.length]=v5[v7];}for(v6=0;v6<v3.length;v6++){v5=v3[v6];v5.disabled=v4;if(!document.layers)continue;if(v5.type=='checkbox'||v5.type=='radio'){if(v4){if(v5.onclick)v5.nex_onclick=v5.onclick;v5.onclick= function(){return false;};}else v5.onclick=v5.nex_onclick?v5.nex_onclick:null;}else{if(v4){if(v5.onfocus)v5.nex_onficus=v5.onfocus;v5.onfocus= function(){this.blur();};}else v5.onfocus=v5.nex_onfocus?v5.nex_onfocus:null;}}}function nex_fill_select(v6, v7, v8, v9){if(typeof(v6)=='string')v6=nex_get_object(v6);if(!v6)return;if(!v8)v8=0;var v1,v2,v3,v4;v6.length=v8;for(var v5=0;v7&&v5<v7.length;v5++){v1=v6.options.length;v2=typeof(v7[v5])=='object'?v7[v5][0]:v7[v5];v3=typeof(v7[v5])=='object'?v7[v5][1]:null;v4=(typeof(v7[v5])=='object'&&v7[v5].length>2)?v7[v5][2]:((v9!=null&&((v3!=null&&v9==v3)||v9==v2))?1:0);v6.length++;v6[v1]=new Option(v2);if(v3)v6[v1].value=v3;if(v4)v6[v1].selected=true;}}function nex_clear_form(v5, v6){var v1=typeof(v5)=='string'?eval(v5):v5;var v2='';if(v6!=null&&v6!='')v2=v6;else if(v1.clearlist)v2=v1.clearlist.value;if(v2=='*'){for(var v3=0;v3<v1.elements.length;v3++)if(v1.elements[v3].type!='hidden'&&v1.elements[v3].type!='button'&&v1.elements[v3].type!='submit'&&v1.elements[v3].type!='reset')nex_clear_field(v1.elements[v3]);return;}var v4=v2.split(',');for(var v3=0;v3<v4.length;v3++)if(v1.elements[v4[v3]])nex_clear_field(v1.elements[v4[v3]]);}function nex_clear_field(v1){if(v1.type=='checkbox'||v1.type=='radio')v1.checked=false;else if(v1.type=='select-one'||v1.type=='select-multiple')v1.selectedIndex=0;else v1.value='';}var nex_check_fields = new Object();var nex_check_texts ={msg_pre:'Bitte f\u00FCllen Sie folgende Felder korrekt aus:\n\n',msg_post:'',line_pre:'- ',line_post:'',delimiter:'\n',number:'(nur Zahlenwerte)',max:'(max. #num Zeichen)',min:'(min. #num Zeichen)',equal:'(gleich #name)'};function nex_check_form(v22, v23, v24, v25){var v1=true;var v2=false;var v3=[];var v4=new Object();var v5=typeof(v22)=='string'?eval(v22):v22;var v6=v5.name;var v7=(v25!=null)?v25:true;var v8=(v24!=null)?v24:true;if((v23==null||v23=='')&&v5.checklist)v23=nex_get_value(v5.checklist);if(window.form_msg_pre)nex_check_texts.msg_pre=form_msg_pre;if(window.form_msg_post)nex_check_texts.msg_post=form_msg_post;if(v23){nex_check_fields[v6]=[];var v9=v23.split(',');var v10,v11;for(var v12=0;v12<v9.length;v12++){v10=v9[v12].split(':');nex_check_fields[v6][v12]={field:v10[0],label:(v10.length>1?v10[1]:v10[0]),type:'text'};v4[v10[0]]=v12;if(v10.length>2){v11=v10[2].split('=');if(v11[0]=='email'||v11[0]=='number'||v11[0]=='date')nex_check_fields[v6][v12].type=v11[0];else if(v11[0]=='num'||v11[0]=='integer'||v11[0]=='float')nex_check_fields[v6][v12].type='number';else nex_check_fields[v6][v12].condition=v11[0];if(v11.length>1)nex_check_fields[v6][v12].condvalue=v11[1];}}}var v13,v14,v15;for(var v12=0;nex_check_fields[v6]&&v12<nex_check_fields[v6].length;v12++){v13=nex_check_fields[v6][v12];if(!v13)continue;v15=v5.elements[v13.field];v14='';if(v15){if(v15.type=='checkbox')v13.passed=v15.checked?true:false;else if(v15.type=='select-one'||v15.type=='select-multiple')v13.passed=(v15.selectedIndex>0);else if(v15.type=='button')v13.passed=true;else{v13.passed=(v15.value!='');if(v13.type=='email')v13.passed=nex_check_email(v15.value);else if(v13.type=='number'&&window.RegExp){v13.passed=/^[0-9,\.]+$/.test(v15.value);v14=nex_check_texts.number;}if(v13.condition){if(v13.passed&&v13.condition=='max'){v13.passed=(v15.value.length>=v13.condvalue);v14=nex_check_texts.max?nex_check_texts.max.replace(/#num/ig,v13.condvalue):'';}else if(v13.passed&&v13.condition=='min'){v13.passed=(v15.value.length>=v13.condvalue);v14=nex_check_texts.min?nex_check_texts.min.replace(/#num/ig,v13.condvalue):'';}else if(v13.passed&&v13.condition=='equal'){var v16=v13.condvalue;var v17=v5.elements[v16];var v18=nex_check_fields[v6][v4[v16]];v13.passed=(v17&&v15.value==v17.value);v14=nex_check_texts.equal?nex_check_texts.equal.replace(/#name/ig,(v18?v18.label:v16)):'';}else if(v13.condition=='or'){var v16=v13.condvalue;var v17=v5.elements[v16];v13.passed=((v17&&v17.value!='')||v15.value!='');}}}}else if(v13.type=='date'&&window.get_mapto_prop){v13.passed=null;var v19=get_mapto_prop(v13.field);var v20=window.a_colformat&&v19&&v19.col?a_colformat[v19.col]:null;if(v20)for(var v21 in v20){v15=v5.elements[v13.field+'_'+v21];if(v13.passed==false)break;if(!v15)continue;v13.passed=(v15.value==''?false:check_date_format(v15,0,'',true));}}else v13.passed=true;if(!v13.passed){v1=false;v3[v3.length]=nex_check_texts.line_pre+v13.label+(v14?' '+v14:'')+nex_check_texts.line_post;if(!v2)v2=v15;}}if(v1&&v8)v5.submit();else if(v1&&!v8)return true;else{if(v7)alert(nex_check_texts.msg_pre+v3.join(nex_check_texts.delimiter)+nex_check_texts.msg_post);if(v2.type!='hidden')v2.focus();if(!v8)return false;}}function nex_check_email(v4){if(v4&&window.RegExp){var v1= /^([a-z0-9][-a-z0-9\.\+_]*)\@([a-z0-9]([-a-z0-9][\.]?)*[a-z0-9]\.[a-z]{2,4})$/i;var v2= /[\._\-\@]{2}/;return v1.test(v4)&&!v2.test(v4)?true:false;}return false;}function nex_form_query_string(v3, v4){var v1=v4?v4:'';if(!v3)return'';for(var v2=0;v2<v3.elements.length;v2++){if(v3.elements[v2].disabled||v3.elements[v2].type=='button'||v3.elements[v2].type=='submit'||v3.elements[v2].type=='reset')continue;v1+=(v1.indexOf('?')<0)?'?':'&';v1+=v3.elements[v2].name+'='+escape(nex_get_value(v3.elements[v2]));}return v1;}window.set_value=nex_set_value;window.read_value=nex_get_value;window.fill_select=nex_fill_select;window.check_form=nex_check_form;window.clear_form=nex_clear_form;

