function StopError(error) { return(true); } function go(s) { if((s=='2')||(s=='6')) { f=check_doc(); } else { f=true; } if(f) { var oldecran=getvalue('ECRAN'); setvalue('ECRAN',s); document.forms[0].submit(); setvalue('ECRAN',oldecran); } } function getinput(s) { s=window.document.forms[0][s]; return(s); } function getvalue(s) { s=getinput(s); if(s!=null) { s=s.value; } else { s=''; } return(s); } function setvalue(s,v) { s=getinput(s); if(s!=null) { s.value=v; } } function download(s) { var oldecran=getvalue('ECRAN'); setvalue('ECRAN',s); document.forms[0].submit(); setvalue('ECRAN',oldecran); } function StopError(error) { return(true); } function getelement(doc,element) { if(window.mmIsOpera) return(doc.getElementById(element)); if (doc.all) return(doc.all[element]); if (doc.getElementById) return(doc.getElementById(element)); return(false); } function getstyle(doc,element) { element=getelement(doc,element); if(element!=null) element=element.style; return(element); } function showelement(doc,element,f) { element=getstyle(doc,element); if(element!=null) { if(f) { element.display='block'; element.visibility='visible'; } else { element.display='none'; element.visibility='hidden'; } } } function showblock(id,f) { setvalue(id+'_VISIBLE',f); showelement(document,id+'_SHORTTITLE',!f); showelement(document,id+'_MAXIMIZE',!f); showelement(document,id+'_MINIMIZE',f); showelement(document,id+'_NORMAL',f); } function error(name,msg,fselect) { var item=getinput(name); alert(msg); if(fselect) { item.select(); } item.focus(); } function trim(string) { return(string.replace(/(^\s*)|(\s*$)/g,'')); } function ValidStrLength(name,len,msg) { var item=getinput(name); f=(trim(item.value).length==len); if(!f) { error(name,msg,true); } return(f); } function ValidMinStrLength(name,len,msg) { var item=getinput(name); f=(trim(item.value).length>=len); if(!f) { error(name,msg,true); } return(f); } function ValidMaxStrLength(name,len,msg) { var item=getinput(name); f=(item.value.length<=len); if(!f) { error(name,msg,true); } return(f); } function ValidIntLength(name,len,msg) { var item=getinput(name); f=((item.value.length==len)&&(!isNaN(item.value))&&(item.value>0)); if(!f) { error(name,msg,true); } return(f); } function ValidComboInt(name,min,msg) { var item=getinput(name); f=((!isNaN(item.options[item.selectedIndex].value))&&(item.options[item.selectedIndex].value>=min)); if(!f) { error(name,msg,false); } return(f); } function ValidComboMaxInt(name,max,msg) { var item=getinput(name); f=((!isNaN(item.options[item.selectedIndex].value))&&(item.options[item.selectedIndex].value-max<0)); if(!f) { error(name,msg,false); } return(f); } function ValidComboMinStrLength(name,len,msg) { var item=getinput(name); f=((trim(item.options[item.selectedIndex].value).length)>=len); if(!f) { error(name,msg,false); } return(f); } function ValidInt(name,min,msg) { var item=getinput(name); f=((!isNaN(item.value))&&(item.value>=min)); if(!f) { error(name,msg,true); } return(f); } function _ValidEmail(emailStr) { var checkTLD=1; var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; var emailPat=/^(.+)@(.+)$/; var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; var validChars="\[^\\s" + specialChars + "\]"; var quotedUser="(\"[^\"]*\")"; var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; var atom=validChars + "+"; var word="(" + atom + "|" + quotedUser + ")"; var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); var matchArray=emailStr.match(emailPat); if(matchArray==null) { return(false); } var user=matchArray[1]; var domain=matchArray[2]; for(i=0;i127) { return(false); } } for(i=0;i127) { return(false); } } if(user.match(userPat)==null) { return(false); } var IPArray=domain.match(ipDomainPat); if(IPArray!=null) { for(var i=1;i<=4;i++) { if(IPArray[i]>255) { return(false); } } return(true); } var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i'; } function check_memo(s,i) { c=getinput(s); if(c.value.length>i) c.value=c.value.substring(0,i); if(c.value.length>0) { updatememoinfo(s,'   ('+c.value.length+'/'+i+' caractères maximum)'); } else { updatememoinfo(s,'   ('+i+' caractères maximum)'); } return 1; } function check_doc() { f=1; f=((f)&&(ValidMinStrLength( 'REC_NOM', 1, 'Veuillez saisir votre nom !' ))); f=((f)&&(ValidMinStrLength( 'REC_DATENAISSANCE', 6, 'Votre date de naissance est invalide !' ))); f=((f)&&(ValidMinStrLength( 'REC_ADRESSE', 1, 'Veuillez saisir votre adresse !' ))); f=((f)&&(ValidMinStrLength( 'REC_CP', 5, 'Votre code postal est invalide !' ))); f=((f)&&(ValidInt( 'REC_CP', 1, 'Votre code postal est invalide !' ))); f=((f)&&(ValidMinStrLength( 'REC_VILLE', 1, 'Veuillez saisir la ville !' ))); f=((f)&&(ValidMinStrLength( 'REC_MOBILE', 5, 'Votre telephone mobile est invalide !' ))); f=((f)&&(ValidMinStrLength( 'REC_EMAIL', 1, 'Veuillez saisir l\'adresse e-mail !' ))); f=((f)&&(ValidEmail( 'REC_EMAIL', 'Votre adresse e-mail est invalide !' ))); idx=1; while((f)&&(getinput('REC_NOM'+idx))) { s=getinput('REC_CADEAU'+idx); if(s.options[s.selectedIndex].value=='O') { f=((f)&&(ValidMinStrLength( 'REC_NOM'+idx, 1, 'Veuillez saisir le nom !' ))); f=((f)&&(ValidMinStrLength( 'REC_EMAIL'+idx, 1, 'Veuillez saisir l\'adresse e-mail !' ))); f=((f)&&(ValidEmail( 'REC_EMAIL'+idx, 'L\'adresse e-mail est invalide !' ))); } else { } idx=idx+1; } return(f); } var weekend = [0,6]; var weekendColor = "#e0e0e0"; var fontface = "Verdana"; var fontsize = 2; var gNow = new Date(); var ggWinCal; var EventOnChange ; Calendar.Months = ["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]; // Non-Leap year Month days.. Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // Leap year Month days.. Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; if (navigator.userAgent.toLowerCase().indexOf('msie')) { isIE = true ; isNav = false ; } else { isIE = false ; isNav = true ; } Calendar.get_month = Calendar_get_month; Calendar.get_daysofmonth = Calendar_get_daysofmonth; Calendar.calc_month_year = Calendar_calc_month_year; Calendar.print = Calendar_print; new Calendar(); function StringAsDate2(TheString, newfomart) { switch (newfomart) { case "YYYY-MM-DD" : TheString = TheString.replace('.', '#DateSeparator#').replace('.', '#DateSeparator#') ; TheString = TheString.replace('-', '#DateSeparator#').replace('-', '#DateSeparator#') ; TheString = TheString.replace(' ', '#DateSeparator#').replace(' ', '#DateSeparator#') ; TheString = TheString.replace('/', '#DateSeparator#').replace('/', '#DateSeparator#') ; var myArray = TheString.split('#DateSeparator#') ; TheDay = parseInt(myArray[2],10) ; TheMonth = parseInt(myArray[1],10) - 1 ; TheYear = parseInt(myArray[0],10) ; if (isNaN(TheDay) || isNaN(TheMonth) || isNaN(TheYear)) { var Result = new Date() ; } else { if (TheYear < 100) TheYear = TheYear + 2000 ; var Result = new Date(TheYear, TheMonth, TheDay) ; } return Result ; break; default: return(StringAsDate(TheString)); break; } } function StringAsDate(TheString) { TheString = TheString.replace('.', '#DateSeparator#').replace('.', '#DateSeparator#') ; TheString = TheString.replace('-', '#DateSeparator#').replace('-', '#DateSeparator#') ; TheString = TheString.replace(' ', '#DateSeparator#').replace(' ', '#DateSeparator#') ; TheString = TheString.replace('/', '#DateSeparator#').replace('/', '#DateSeparator#') ; var myArray = TheString.split('#DateSeparator#') ; TheDay = parseInt(myArray[0],10) ; TheMonth = parseInt(myArray[1],10) - 1 ; TheYear = parseInt(myArray[2],10) ; if (isNaN(TheDay) || isNaN(TheMonth) || isNaN(TheYear)) { var Result = new Date(); } else { if (TheYear < 100) TheYear = TheYear + 2000 ; var Result = new Date(TheYear, TheMonth, TheDay); } return Result; } function Calendar(p_item, p_WinCal, p_month, p_year, p_format) { if ((p_month == null) && (p_year == null)) return; if (p_WinCal == null) this.gWinCal = ggWinCal; else this.gWinCal = p_WinCal; if (p_month == null) { this.gMonthName = null; this.gMonth = null; this.gYearly = true; } else { this.gMonthName = Calendar.get_month(p_month); this.gMonth = new Number(p_month); this.gYearly = false; } this.gYear = p_year; this.gFormat = p_format; this.gBGColor = "white"; this.gFGColor = "black"; this.gTextColor = "black"; this.gHeaderColor = "black"; this.gReturnItem = p_item; } function Calendar_get_month(monthNo) { return Calendar.Months[monthNo]; } function Calendar_get_daysofmonth(monthNo, p_year) { /* Check for leap year .. 1.Years evenly divisible by four are normally leap years, except for... 2.Years also evenly divisible by 100 are not leap years, except for... 3.Years also evenly divisible by 400 are leap years. */ if ((p_year % 4) == 0) { if ((p_year % 100) == 0 && (p_year % 400) != 0) return Calendar.DOMonth[monthNo]; return Calendar.lDOMonth[monthNo]; } else return Calendar.DOMonth[monthNo]; } function Calendar_calc_month_year(p_Month, p_Year, incr) { /* Will return an 1-D array with 1st element being the calculated month and second being the calculated year after applying the month increment/decrement as specified by 'incr' parameter. 'incr' will normally have 1/-1 to navigate thru the months. */ var ret_arr = new Array(); if (incr == -1) { // B A C K W A R D if (p_Month == 0) { ret_arr[0] = 11; ret_arr[1] = parseInt(p_Year) - 1; } else { ret_arr[0] = parseInt(p_Month) - 1; ret_arr[1] = parseInt(p_Year); } } else if (incr == 1) { // F O R W A R D if (p_Month == 11) { ret_arr[0] = 0; ret_arr[1] = parseInt(p_Year) + 1; } else { ret_arr[0] = parseInt(p_Month) + 1; ret_arr[1] = parseInt(p_Year); } } return ret_arr; } function Calendar_print() { ggWinCal.print(); } Calendar.prototype.getMonthlyCalendarCode = function() { var vCode = ""; var vHeader_Code = ""; var vData_Code = ""; // Begin Table Drawing code here.. vCode = vCode + ""; vHeader_Code = this.cal_header(); vData_Code = this.cal_data(); vCode = vCode + vHeader_Code + vData_Code; vCode = vCode + "
"; return vCode; } Calendar.prototype.show = function() { var vCode = ""; this.gWinCal.document.open(); // Setup the page... this.wwrite(""); this.wwrite("Calendrier"); this.wwrite(""); this.wwrite(""); this.wwriteA(""); this.wwriteA(this.gMonthName + " " + this.gYear); this.wwriteA("   Effacer
"); // Show navigation buttons var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1); var prevMM = prevMMYYYY[0]; var prevYYYY = prevMMYYYY[1]; var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1); var nextMM = nextMMYYYY[0]; var nextYYYY = nextMMYYYY[1]; this.wwrite("
"); this.wwrite("[<<<\/A>]"); this.wwrite("[<<\/A>]"); this.wwrite("[><\/A>]"); this.wwrite("[>><\/A>]

"); // Get the complete calendar code for the month.. vCode = this.getMonthlyCalendarCode(); this.wwrite(vCode); this.wwrite("
"); this.gWinCal.document.close(); } Calendar.prototype.showY = function() { var vCode = ""; var i; var vr, vc, vx, vy; // Row, Column, X-coord, Y-coord var vxf = 285; // X-Factor var vyf = 200; // Y-Factor var vxm = 10; // X-margin var vym; // Y-margin if (isIE) vym = 75; else if(isNav) vym = 25; this.gWinCal.document.open(); this.wwrite(""); this.wwrite("Calendar"); this.wwrite(""); this.wwrite(""); this.wwrite(""); this.wwrite(""); this.wwrite("Year : " + this.gYear); this.wwrite("
"); // Show navigation buttons var prevYYYY = parseInt(this.gYear) - 1; var nextYYYY = parseInt(this.gYear) + 1; this.wwrite("
"); this.wwrite("[<<<\/A>]"); this.wwrite("[Print]"); this.wwrite("[>><\/A>]

"); // Get the complete calendar code for each month.. var j; for (i=11; i>=0; i--) { if (isIE) this.wwrite("
"); else if (isNav) this.wwrite(""); this.gMonth = i; this.gMonthName = Calendar.get_month(this.gMonth); vCode = this.getMonthlyCalendarCode(); this.wwrite(this.gMonthName + "/" + this.gYear + "
"); this.wwrite(vCode); if (isIE) this.wwrite("
"); else if (isNav) this.wwrite(""); } this.wwrite("

"); this.gWinCal.document.close(); } Calendar.prototype.wwrite = function(wtext) { this.gWinCal.document.writeln(wtext); } Calendar.prototype.wwriteA = function(wtext) { this.gWinCal.document.write(wtext); } Calendar.prototype.cal_header = function() { var vCode = ""; vCode = vCode + ""; vCode = vCode + "Dim"; vCode = vCode + "Lun"; vCode = vCode + "Mar"; vCode = vCode + "Mer"; vCode = vCode + "Jeu"; vCode = vCode + "Ven"; vCode = vCode + "Sam"; vCode = vCode + ""; return vCode; } Calendar.prototype.cal_data = function() { var vDate = new Date(); vDate.setDate(1); vDate.setMonth(this.gMonth); vDate.setFullYear(this.gYear); var vFirstDay=vDate.getDay(); var vDay=1; var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear); var vOnLastDay=0; var vCode = ""; /* Get day for the 1st of the requested month/year.. Place as many blank cells before the 1st day of the month as necessary. */ vCode = vCode + ""; for (i=0; i "; } // Write rest of the 1st week for (j=vFirstDay; j<7; j++) { vCode = vCode + "" + "" + this.format_day(vDay) + "" + ""; vDay=vDay + 1; } vCode = vCode + ""; // Write the rest of the weeks for (k=2; k<7; k++) { vCode = vCode + ""; for (j=0; j<7; j++) { vCode = vCode + "" + "" + this.format_day(vDay) + "" + ""; vDay=vDay + 1; if (vDay > vLastDay) { vOnLastDay = 1; break; } } if (j == 6) vCode = vCode + ""; if (vOnLastDay == 1) break; } // Fill up the rest of last week with proper blanks, so that we get proper square blocks for (m=1; m<(7-j); m++) { if (this.gYearly) vCode = vCode + " "; else vCode = vCode + "" + m + ""; } return vCode; } Calendar.prototype.format_day = function(vday) { var vNowDay = gNow.getDate(); var vNowMonth = gNow.getMonth(); var vNowYear = gNow.getFullYear(); if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear) return ("" + vday + ""); return (vday); } Calendar.prototype.write_weekend_string = function(vday) { var i; // Return special formatting for the weekend day. for (i=0; i')>=0)&&(s.lastIndexOf('')>=0)) { var sc=s.substring(s.indexOf('')); if(sc!='') eval(sc); } else { span.innerHTML=s; } } return(true); } function getpanier() { fetchergetpanier=new js_fetch('POST'); if(!fetchergetpanier.init()) { alert(fetchergetpanier.error); return (true); } fetchergetpanier.add_param('ECRAN','GETPANIER'); fetchergetpanier.set_handler(_getpanier); fetchergetpanier.go('/boutique/'); } function _addpanier() { span=find('panier'); if(typeof(fetcheraddpanier)=='undefined') { return(true); } switch(fetcheraddpanier.get_state()) { case 4: span.innerHTML=fetcheraddpanier.result(); document.location='http://www.pro-pulsion.com/panier.htm'; } return(true); } function addpanier(item,value) { fetcheraddpanier=new js_fetch('POST'); if(!fetcheraddpanier.init()) { alert(fetcheraddpanier.error); return (true); } fetcheraddpanier.add_param('ECRAN','ADDPANIER'); fetcheraddpanier.add_param('ITEM',item); fetcheraddpanier.add_param('COUNT',value); fetcheraddpanier.set_handler(_addpanier); fetcheraddpanier.go('/boutique/'); } function _delpanier() { span=find('panier'); if(typeof(fetcherdelpanier)=='undefined') { return(true); } switch(fetcherdelpanier.get_state()) { case 4: span.innerHTML=fetcherdelpanier.result(); showpanier(); } return(true); } function delpanier(item) { fetcherdelpanier=new js_fetch('POST'); if(!fetcherdelpanier.init()) { alert(fetcherdelpanier.error); return (true); } fetcherdelpanier.add_param('ECRAN','DELPANIER'); fetcherdelpanier.add_param('ITEM',item); for(i=0;i