// Version 1.1 var TID; var events = new Array(); var tempo = new Array(); var it = 1; var slideSpeed = 10; // Higher value = faster var timer = 10; // Lower value = faster var encours= false; function showHideContent(inputId1,inputId2,HWn) { if(!encours) { var obj1 =document.getElementById(inputId1); var contentObj1 = document.getElementById('a' + inputId1); var direction1=slideSpeed; var obj2 =document.getElementById(inputId2); var contentObj2 = document.getElementById('a' + inputId2); var direction2=slideSpeed; var visi1=false; var visi2=false; var Dimension1 = obj1.style.display; var Dimension2 = obj2.style.display; if(Dimension1!="none") direction1 = slideSpeed*-1; else { direction1 = slideSpeed; if(HWn) obj1.style.height='0px'; else obj1.style.width='0px'; } if(Dimension2!="none") direction2 = slideSpeed*-1; else { direction2 = slideSpeed; if(HWn) obj2.style.height='0px'; else obj2.style.width='0px'; } slideContent(inputId1,direction1,inputId2,direction2,HWn); } } function slideContent(inputId1,direction1,inputId2,direction2,HWn) { encours= true; var obj1 =document.getElementById(inputId1); var contentObj1 = document.getElementById('a' + inputId1); var obj2 =document.getElementById(inputId2); var contentObj2 = document.getElementById('a' + inputId2); if(HWn){ var Dimension1 = obj1.clientHeight; var Dimension2 = obj2.clientHeight; } else { var Dimension1 = obj1.clientWidth; var Dimension2 = obj2.clientWidth; } Dimension1 = Dimension1 + direction1; Dimension2 = Dimension2 + direction2; var rerunFunction1 = true; var rerunFunction2 = true; if(obj1.style.display=="none") { obj1.style.display='block'; obj1.style.visibility = 'visible'; } if(obj2.style.display=="none") { obj2.style.display='block'; obj2.style.visibility = 'visible'; } if(HWn) { if(Dimension1 > contentObj1.offsetHeight) rerunFunction1 = false; if(Dimension2 > contentObj2.offsetHeight) rerunFunction2 = false; } else { if(Dimension1 > contentObj1.offsetWidth) rerunFunction1 = false; if(Dimension2 > contentObj2.offsetWidth) rerunFunction2 = false; } if(Dimension1 <=1){ Dimension1 = 0; rerunFunction1 = false; } if(Dimension2 <=1){ Dimension2 = 0; rerunFunction2 = false; } if(HWn) { obj1.style.height = Dimension1 + 'px'; obj2.style.height = Dimension2 + 'px'; } else { obj1.style.width = Dimension1 + 'px'; obj2.style.width = Dimension2 + 'px'; } if(rerunFunction1||rerunFunction2) setTimeout('slideContent("'+inputId1+'",'+direction1+',"'+inputId2+'",'+direction2+','+HWn+')',timer); else { if(Dimension1<=1){ obj1.style.display='none'; obj1.style.visibility = 'hidden'; } if(Dimension2<=1){ obj2.style.display='none'; obj2.style.visibility = 'hidden'; } encours= false; } } //********************************************************* events[it] = new Date(); function getObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i sel.value.length) { sel.selectionEnd = sel.value.length; } var firstPos = sel.selectionStart; var secondPos = sel.selectionEnd + text1.length; if (sel.selectionStart == sel.selectionEnd) { sel.value=sel.value.slice(0,firstPos)+text1+sel.value.slice(firstPos); } else { sel.value=sel.value.slice(0,secondPos)+text1+sel.value.slice(secondPos); } sel.selectionStart = firstPos+text1.length; sel.selectionEnd = secondPos; sel.focus(); } } function getSel1(text1,text2,form,etat) { var sel = document.forms[form].donnee; if (document.selection) { var str = document.selection.createRange().text; sel.focus(); var sel = document.selection.createRange(); if (str=="") { if (etat != 0) { sel.text = sel.text + text2; return 0;} else { sel.text = sel.text + text1; return 1;} } else { sel.text = text1 + sel.text + text2; } } else if (sel.selectionStart | sel.selectionStart == 0) { if (sel.selectionEnd > sel.value.length) { sel.selectionEnd = sel.value.length; } var firstPos = sel.selectionStart; var secondPos = sel.selectionEnd + text1.length; if (sel.selectionStart == sel.selectionEnd) { if (etat != 0) { sel.value=sel.value.slice(0,firstPos)+text2+sel.value.slice(firstPos); etat = 0;} else { sel.value=sel.value.slice(0,firstPos)+text1+sel.value.slice(firstPos); etat = 1;} } else { sel.value=sel.value.slice(0,firstPos)+text1+sel.value.slice(firstPos); sel.value=sel.value.slice(0,secondPos)+text2+sel.value.slice(secondPos); etat = 0; } sel.selectionStart = firstPos+text1.length; sel.selectionEnd = secondPos; sel.focus(); return etat; } } function getSel2(text1,text2,text3,form) { var sel = document.forms[form].donnee; if (document.selection) { var str = document.selection.createRange().text; sel.focus(); var sel = document.selection.createRange(); if (str=="") { sel.text = sel.text + text1 + text3 + text2; } else { sel.text = text1 + sel.text + text2; } } else if (sel.selectionStart | sel.selectionStart == 0) { if (sel.selectionEnd > sel.value.length) { sel.selectionEnd = sel.value.length; } var firstPos = sel.selectionStart; var secondPos = sel.selectionEnd + text1.length; if (sel.selectionStart == sel.selectionEnd) { sel.value=sel.value.slice(0,firstPos)+text1+text3+text2+sel.value.slice(firstPos); } else { sel.value=sel.value.slice(0,firstPos)+text1+sel.value.slice(firstPos); sel.value=sel.value.slice(0,secondPos)+text2+sel.value.slice(secondPos); etat = 0; } sel.selectionStart = firstPos+text1.length; sel.selectionEnd = secondPos; sel.focus(); } } function alleza(tampon) { window.location = window.location.pathname + "?rub=" + tampon; } function alleza1(tampon1,tampon2) { window.location = window.location.pathname + "?rub=" + tampon1 + "&ssrub=" + tampon2; } function ligne(form) { getSel("{i}",form); } function lignet(form) { getSel("[/1]"+String.fromCharCode(10)+"[1]case1[2]case2[3]case3[4]case4",form); } function table4(form) { getSel("[1]case1[2]case2[3]case3[4]case4[/4]",form); } function img_g(form) { getSel2("[img]","[/img]"+"\n","lenomdelimage.jpg",form); } function img2_g(form) { getSel2("[uimg]","[/img]"+"\n","http://www.unsite.com/nomedelimage.jpg",form); } function img_p(form) { getSel2("[pimg]","[/img]","lenomdelimage.jpg",form); } function img1_p(form,texte) { getSel("[pimg]"+texte+"[/img]"+"\n",form); } function img1_g(form,texte) { getSel("[c][img]"+texte+"[/img][/c]"+"\n",form); } function put_smile(form,texte) { getSel("[("+texte+")]",form); } function put_video(form) { getSel2("[vid]","[/vid]","http://www.site.com/video.avi",form); } function put_pdf(form) { getSel2("[pdf]","[/pdf]","http://www.site.com/fichier.pdf",form); } function put_xls(form) { getSel2("[xls]","[/xls]","http://www.site.com/fichier.xls",form); } function img_url(form) { getSel2("[uimg]","[/img]","include/images/mini/lienimage.jpg,http://www.google.fr",form); } function lien_url(form) { getSel2("[url]","[/url]","http://www.google.fr",form); } function texte_center(form) { etat_center = getSel1("[c]","[/c]",form,etat_center); if (etat_center == 1) { document.images["center"].src = '/icon/forum/_icon/center_e.jpg'; document.images["gauche"].src = '/icon/forum/_icon/gauche.jpg'; } else { document.images["center"].src = '/icon/forum/_icon/center.jpg'; document.images["gauche"].src = '/icon/forum/_icon/gauche_e.jpg'; } } function texte_gras(form) { etat_gras = getSel1("{","}",form,etat_gras); if (etat_gras == 1) { document.images["gras"].src = '/icon/forum/_icon/gras_e.jpg'; } else { document.images["gras"].src = '/icon/forum/_icon/gras.jpg'; } } function texte_italic(form) { etat_italic = getSel1("[i]","[/i]",form,etat_italic); if (etat_italic == 1) { document.images["italic"].src = '/icon/forum/_icon/italic_e.jpg'; } else { document.images["italic"].src = '/icon/forum/_icon/italic.jpg'; } } function puce(form) { etat_puce = getSel1("[u]","[/u]",form,etat_puce); if (etat_puce == 1) { document.images["puce"].src = '/icon/forum/_icon/puce_e.jpg'; } else { document.images["puce"].src = '/icon/forum/_icon/puce.jpg'; } } var colours = new Array("#FFFFFF", "#FFCCCC", "#FFCC99", "#FFFF99", "#FFFFCC", "#99FF99", "#99FFFF", "#CCFFFF", "#CCCCFF", "#FFCCFF", "#CCCCCC", "#FF6666", "#FF9966", "#FFFF66", "#FFFF33", "#66FF99", "#33FFFF", "#66FFFF", "#9999FF", "#FF99FF", "#C0C0C0", "#FF0000", "#FF9900", "#FFCC66", "#FFFF00", "#33FF33", "#66CCCC", "#33CCFF", "#6666CC", "#CC66CC", "#999999", "#CC0000", "#FF6600", "#FFCC33", "#FFCC00", "#33CC00", "#00CCCC", "#3366FF", "#6633FF", "#CC33CC", "#666666", "#990000", "#CC6600", "#CC9933", "#999900", "#009900", "#339999", "#3333FF", "#6600CC", "#993399", "#333333", "#660000", "#993300", "#996633", "#666600", "#006600", "#336666", "#000099", "#333399", "#663366", "#000000", "#330000", "#663300", "#663333", "#333300", "#003300", "#003333", "#000066", "#330099", "#330033"); var divPreview; function mouseOver(el, Colour){ init(); divPreview.style.background = Colour; document.frmColour.ColorHex.value = Colour; el.style.borderColor = '#FFFFFF'; } function mouseOut(el){ el.style.borderColor = '#666666'; } function mouseDown(Colour){ self.parent.setColor(Colour); self.parent.palette.style.visibility = 'hidden'; } function init(){ divPreview = Obj("divPreview"); } function Obj(name) { return document[name]||(document.all && document.all[name])||(document.getElementById && document.getElementById(name)); }