function GetMainFormName(){var a;for(a=0;a<document.forms.length;a++){if(document.forms[a].name.indexOf("_ServerForm")!=-1){return document.forms[a].name}if(document.forms[a].name.indexOf("__aspnetForm")!=-1){return document.forms[a].name}if(document.forms[a].name.indexOf("aspnetForm")!=-1){return document.forms[a].name}}return null}function SaveElement(a,d){var c=GetMainFormName();if(c==null){return}var b=GetElement(a,c);if(b!=null){b.value=d}}function GetElementName(g,e){if(g==null||g==""){return null}g=g.toLowerCase();var c,d,b;for(c=0;c<document.forms[e].elements.length;c++){if(document.forms[e].elements[c].name.toLowerCase().lastIndexOf(g)!=-1){var a=document.forms[e].elements[c].name.toLowerCase();var f=a.substr(a.lastIndexOf(g));if(f==g){return document.forms[e].elements[c].name}}}return null}function GetElementID(g,e){if(g==null||g==""){return null}g=g.toLowerCase();var c,d,b;for(c=0;c<document.forms[e].elements.length;c++){if(document.forms[e].elements[c].id.toLowerCase().lastIndexOf(g)!=-1){var a=document.forms[e].elements[c].id.toLowerCase();var f=a.substr(a.lastIndexOf(g));if(f==g){return document.forms[e].elements[c].id}}}return null}function GetElement(b,a){return document.forms[a].elements[GetElementID(b,a)]}var subjectlist;function AddSubject(c,a){var b;var e=false;var d;if(!subjectlist){subjectlist=new Array()}for(b=0;(b<subjectlist.length)&&!e;b++){d=subjectlist[b];if(c&&d){if(c.code==d.code){e=true}}}if(!e){subjectlist.push(c);d=c}AddSubSubject(d,a)}function AddSubSubject(b,a){if(b&&a){if(!b.subsubjects){b.subsubjects=new Array()}b.subsubjects.push(a)}}function FillSubject(){var a;var d;var c=GetElement("mail_subject_list",0);var b=GetElement("mail_subject",0);if(c&&subjectlist){ResetSelect(c);for(a=0;a<subjectlist.length;a++){d=document.createElement("OPTION");d.text=subjectlist[a].text;d.value=subjectlist[a].code;c.options[c.options.length]=d;if(b){d.selected=(d.value==b.value)}}}}function FillSubSubject(){var e;var b;var d=GetElement("mail_subject_list",0);var a=GetElement("mail_subsubject_list",0);var c=GetElement("mail_subsubject",0);if(d&&a){ResetSelect(a);currentsubject=subjectlist[d.options.selectedIndex-1];if(currentsubject&&currentsubject.subsubjects){for(b=0;b<currentsubject.subsubjects.length;b++){e=document.createElement("OPTION");e.text=currentsubject.subsubjects[b].text;e.value=currentsubject.subsubjects[b].code;a.options[a.options.length]=e;if(c){e.selected=(e.value==c.value)}}}}}function ResetSelect(a){while(a.options.length!=1){a.options[1]=null}}function GetListValue(c,a,b){if(c&&c[a]){return c[a]}else{return b}}function OnSubjectListChange(){var a;var c=GetElement("mail_subject_list",0);var b=GetListValue(subjectlist,c.selectedIndex-1,null);if(b){a=b.subsubjects[0];SaveElement("mail_subject",b.text);SaveElement("mail_subject_code",b.code);if(a){SaveElement("mail_to",a.emailto);SaveElement("mail_bcc",a.emailbcc)}}else{SaveElement("mail_subject","");SaveElement("mail_subject_code","");SaveElement("mail_to","");SaveElement("mail_bcc","")}if(GetElement("mail_subsubject_list",0)){FillSubSubject()}}function OnSubSubjectListChange(){var d;var a;var c;var b;d=GetElement("mail_subject_list",0);a=GetElement("mail_subsubject_list",0);c=GetListValue(subjectlist,d.selectedIndex-1,null);if(c){b=GetListValue(c.subsubjects,a.selectedIndex-1,null);if(b){SaveElement("mail_subsubject",b.text);SaveElement("mail_subsubject_code",b.code);SaveElement("mail_to",b.emailto);SaveElement("mail_bcc",b.emailbcc)}else{SaveElement("mail_subsubject","");SaveElement("mail_subsubject_code","");SaveElement("mail_to","");SaveElement("mail_bcc","")}}}function afficheEtoiles(a){for(i=0;i<a&&a<=5;i++){document.write('<img src="/Armani/IMG/img_ref/common/forum/pict_etoile.gif" border="0">')}}var OpenedDiv="";function DisplayPost(a){if(OpenedDiv!=""){document.getElementById(OpenedDiv).style.display="none"}if(OpenedDiv!=a){document.getElementById(a).style.display="block";OpenedDiv=a}else{OpenedDiv=""}}function forumsearch(){var b=GetMainFormName();if(b==null){return}var a=document.forms[b].searchfield.value;var c=document.forms[b].selectsearch.selectedIndex;if(c=="0"){alert("no critaria");return}if(a==""){alert("no field");return}else{window.location="search.aspx?searchid="+c+"&search="+a}}var newWindow;function openPopup(a,d,e){if(newWindow&&!newWindow.closed){newWindow.close()}var b=(screen.width-d)/2;var c=(screen.height-e)/2;newWindow=open(a,"popup",("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top="+c+",left="+b+",width="+d+",height="+e+'"'));newWindow.focus()}function openPopup2(a,d,e){if(newWindow&&!newWindow.closed){newWindow.close()}var b=(screen.width-d)/6;var c=(screen.height-e)/6;newWindow=open(a,"popup",("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,top="+c+",left="+b+",width="+d+",height="+e+'"'));newWindow.focus()}function openPopup3(b,f,g){if(newWindow&&!newWindow.closed){newWindow.close()}var d=0;var e=0;var a=screen.width;var c=screen.height;if(f>0){a=f}if(g>0){c=g}newWindow=open(b,"popup",("toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,top="+e+",left="+d+",width="+a+",height="+c+'"'));newWindow.focus()}function openPopup4(a,d,e){if(newWindow&&!newWindow.closed){newWindow.close()}var b=(screen.width-d)/8;var c=(screen.height-e)/8;newWindow=open(a,"popup",("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top="+c+",left="+b+",width="+d+",height="+e+'"'));newWindow.focus()}function openOpener1(b){try{window.opener.focus();window.close()}catch(c){var a;a=open(b,"",("toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,top="+0+",left="+0+",width="+screen.width+",height="+screen.height+'"'));a.focus();window.close()}}function openPressPopup(a,d,e){if(newWindow&&!newWindow.closed){newWindow.close()}var b=(screen.width-d)/6;var c=(screen.height-e)/6;newWindow=open(a,"popup",("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top="+c+",left="+b+",width="+d+",height="+e+'"'));newWindow.focus()}function NavigateTo(a){if(a!=""){document.location.href=a}}function ValidateZip(c){if(c.value.length!=5){return false}else{var e="0123456789";var d=true;for(var b=0;b<c.value.length;b++){ch=c.value.charAt(b);for(var a=0;a<e.length;a++){if(ch==e.charAt(a)){break}}if(a==e.length){d=false;break}}if(!d){return false}else{return true}}};
