window.onload = myinit; var dragflag=false, isinit=true; function myinit() {  if (handleError_errs) document[handleError_errform][handleError_errfield].value = handleError_errs;  if (usingie5) { getObj('top').onscroll=capscroll; capscroll(); } if (doselstyle) { innerobj = document.getElementById('ccb10'); changesel(); } else innerobj = document.getElementById('ccbconts'); changecurfont('', curfontnum); changefontsize(curfontsize); isinit=false;   fixforms(); }  function fixforms() {  var myforms = document.getElementById('ccbconts').getElementsByTagName('FORM'); var numforms = myforms.length; for (var curform = 0; curform < numforms; curform++) { myforms[curform].target = '_blank'; }  var mylinks = document.getElementById('ccbconts').getElementsByTagName('A'); var numlinks = mylinks.length; for (var curlink = 0; curlink < numlinks; curlink++) { mylinks[curlink].target = '_blank'; } } var timewait = 600; function updisplay(thisobj) {  setwritepos(thisobj); upwysi(-70, -130); isinit=true; showoldout(); isinit=false; setTimeout("upwysioff()", timewait); } function upwysi(xoff, yoff) {  document.getElementById("ajaxingnow").style.visibility = 'visible'; var showbox = document.getElementById('wysimess'); showbox.style.left = nn6 ? savex + xoff + 'px': savex + xoff;   showbox.style.top = nn6 ? savey + yoff + 'px' : savey + yoff; showbox.style.display = ''; return; } var updatetimeout; function upwysioff() {  var showbox = document.getElementById('wysimess'); showbox.style.display = 'none'; document.getElementById("ajaxingnow").style.visibility = 'hidden'; return; } var innerobj; function changesel(thisobj){ if (!isinit) {  setwritepos(thisobj); upwysi(-110, -130); }  if(document.dummy.font_showselbord.checked) { document.curboxvars.sel_showselbord.value = 'Y'; document.getElementById('ccbselbord').style.border = '1px #ff0000 dashed'; } else { document.curboxvars.sel_showselbord.value = ''; document.getElementById('ccbselbord').style.border = '0px #ff0000 dashed'; } if (!isinit) { setTimeout("upwysioff()", timewait); } } function changefontsize(textsize, thisobj) { var cust =textsize.match("^cust"); if (cust) { var custval = document.getElementById(textsize).value;  if (typeof custval === 'NaN') return; if (custval <= 0) return; } if (!isinit) {  setwritepos(thisobj); upwysi(-100, -130); } var changeid = textsize;  changeid = changeid.replace('%', 'per'); var cidobj = document.getElementById(changeid); oldid = curfontsize;  oldid = oldid.replace('%', 'per'); var oldidobj = document.getElementById(oldid); oldidobj.style.backgroundColor = ''; oldidobj.style.color = '#000000'; newtextsize = textsize.replace('num', ''); if (cust) { var unitt = textsize.replace('cust', ''); var unitv = document.getElementById(textsize).value; if (unitt == 'per') unitt = '%'; innerobj.style.fontSize= unitv + unitt; } else { innerobj.style.fontSize= newtextsize; } cidobj.style.backgroundColor = '#009900'; cidobj.style.color = '#ffffff'; curfontsize = textsize; if (!isinit) { setTimeout("upwysioff()", timewait); } } function changecurfont(thisobj, fontnum) { if (!isinit) {  setwritepos(thisobj); upwysi(10, -130); } oldid = 'f' + curfontnum; oldaid = 'a' + curfontnum; var oldaidobj = document.getElementById(oldaid);; document.getElementById(oldid).style.visibility = 'hidden'; oldaidobj.style.backgroundColor = ''; oldaidobj.style.color = '#000000'; curfontnum = fontnum; changeid = 'f' + fontnum; changeaid = 'a' + fontnum; var caidobj = document.getElementById(changeaid); innerobj.style.fontFamily= fontnames[fontnum];  document.getElementById(changeid).style.visibility = 'visible'; caidobj.style.backgroundColor = '#009900'; caidobj.style.color = '#ffffff'; if (!isinit) { setTimeout("upwysioff()", timewait); } } function changebold(thisobj) { if (!isinit) {  setwritepos(thisobj); upwysi(-40, -130); } curboldset = document.extattr.dobold.checked; if (curboldset) innerobj.style.fontWeight = 'bold'; else innerobj.style.fontWeight = 'normal'; if (!isinit) { setTimeout("upwysioff()", timewait); } } function changeitalics(thisobj) { if (!isinit) {  setwritepos(thisobj); upwysi(-100, -130); } curitalicsset = document.extattr.doitalics.checked; if (curitalicsset) innerobj.style.fontStyle = 'italic'; else innerobj.style.fontStyle = 'normal'; if (!isinit) { setTimeout("upwysioff()", timewait); } } var walkstep = -1;  function changewrap(thisobj) { if (!isinit) {  setwritepos(thisobj); upwysi(-100, -130); } curnowrapset = document.extattr.nowrap.checked;  if (curnowrapset) { innerobj.style.whiteSpace = 'nowrap'; } else { innerobj.style.whiteSpace = 'normal'; }  if (nn6) { if (walkstep == 1) walkstep = -1; else walkstep = 1;  document.curboxvars.pickfont_right.value = Number(document.curboxvars.pickfont_right.value) + walkstep; document.getElementById('appdrag').style.right = document.curboxvars.pickfont_right.value + 'px'; } if (!isinit) { setTimeout("upwysioff()", timewait); } } function chlinesize(thisobj) { if (!isinit) {  setwritepos(thisobj); upwysi(-50, -130); } var linesize = document.extattr.linesize.value; var linesizeunit = document.extattr.linesizeunit.value; if (linesizeunit == 'mult') linesizeunit = ''; innerobj.style.lineHeight = linesize + linesizeunit; if (!isinit) { setTimeout("upwysioff()", timewait); } } var savex, savey; function showload(loadwhat, xoff, yoff) {   document.body.style.backgroundColor = '#cccccc';  document.getElementById('loadingmess').innerHTML = loadwhat; if(doselstyle) { document.getElementById('loadingmess2').innerHTML = 'Loading&nbsp;Subselection...'; document.getElementById('loadingmess3').style.color = '#0000ff'; document.getElementById('loadingmess3').style.border = '2px #0000ff solid'; document.getElementById('loadingmess3').innerHTML = 'SubSelection'; } var showbox = document.getElementById('submitmess'); showbox.style.left = nn6 ? savex + xoff + 'px': savex + xoff;   showbox.style.top = nn6 ? savey + yoff + 'px' : savey + yoff; showbox.style.display = ''; return; } function cancelmods(thisobj) {  setwritepos(thisobj);  showload('<span style="color:red;">#Picker&nbsp;Cancelled#</span>', -60, -100); if (doselstyle) {  document.curboxvars.action= 'pick_selstyle.php'; } document.curboxvars.submit(); } function choosenew(thisobj) {  setwritepos(thisobj);  showload('New&nbsp;Font&nbsp;Style&nbsp;Selected!', -110, -100); var theform = document.getElementById('curboxvars'); if (doselstyle) {   theform.sel_fontname.value = fontnames[curfontnum]; var newfontsize = innerobj.style.fontSize; theform.sel_fontsize.value = '';   if (!newfontsize) { theform.sel_fontsizenum.value = 100; theform.sel_fontsizeunit.value = '%'; } else if (newfontsize.indexOf('em') > 0) { newfontsize = newfontsize.replace('em', ''); theform.sel_fontsizenum.value = newfontsize; theform.sel_fontsizeunit.value = 'em'; } else if (newfontsize.indexOf('%') > 0) { newfontsize = newfontsize.replace('%', ''); theform.sel_fontsizenum.value = newfontsize; theform.sel_fontsizeunit.value = '%'; } else if (newfontsize.indexOf('px') > 0) { newfontsize = newfontsize.replace('px', ''); theform.sel_fontsizenum.value = newfontsize; theform.sel_fontsizeunit.value = 'px'; } else if (newfontsize.indexOf('pt') > 0) { newfontsize = newfontsize.replace('pt', ''); theform.sel_fontsizenum.value = newfontsize; theform.sel_fontsizeunit.value = 'pt'; } else {  theform.sel_fontsize.value = newfontsize; theform.sel_fontsizenum.value = ''; theform.sel_fontsizeunit.value = ''; }  theform.sel_dobold.value = (document.extattr.dobold.checked ? 'Y' : ''); theform.sel_doitalics.value = (document.extattr.doitalics.checked ? 'Y' : ''); theform.sel_nowrap.value = (document.extattr.nowrap.checked ? 'Y' : ''); theform.sel_linesize.value = document.extattr.linesize.value; theform.sel_linesizeunit.value = document.extattr.linesizeunit.value; theform.action= 'pick_selstyle.php'; theform.submit(); return; }  theform.fontname.value = fontnames[curfontnum];  if (curfontsize.indexOf("num") == 0) { document.curboxvars.fontsize.value = ''; newtextsize = curfontsize.replace('num', ''); if (newtextsize.indexOf('em') > 0) { newtextsize = newtextsize.replace('em', ''); theform.fontsizenum.value = newtextsize; theform.fontsizeunit.value = 'em'; } else if (newtextsize.indexOf('%') > 0) { newtextsize = newtextsize.replace('%', ''); theform.fontsizenum.value = newtextsize; theform.fontsizeunit.value = '%'; } else if (newtextsize.indexOf('px') > 0) { newtextsize = newtextsize.replace('px', ''); theform.fontsizenum.value = newtextsize; theform.fontsizeunit.value = 'px'; } else if (newtextsize.indexOf('pt') > 0) { newtextsize = newtextsize.replace('pt', ''); theform.fontsizenum.value = newtextsize; theform.fontsizeunit.value = 'pt'; } } else if (curfontsize.match("^cust")) {  document.curboxvars.fontsize.value = ''; theform.fontsizenum.value = document.getElementById(curfontsize).value; var unitt = curfontsize.replace('cust', ''); if (unitt == 'per') unitt = '%'; theform.fontsizeunit.value = unitt; } else {  theform.fontsize.value = curfontsize; }  theform.dobold.value = (document.extattr.dobold.checked ? 'y' : ''); theform.doitalics.value = (document.extattr.doitalics.checked ? 'y' : ''); theform.nowrap.value = (document.extattr.nowrap.checked ? 'y' : ''); theform.linesize.value = document.extattr.linesize.value; theform.linesizeunit.value = document.extattr.linesizeunit.value;  theform.submit(); } function showold() { var theform = document.getElementById('curboxvars'); if (doselstyle) {  innerobj.style.fontFamily = fontnames[startingfontnum]; innerobj.style.fontWeight = (theform.sel_dobold.value == 'Y') ? 'bold' : 'normal'; innerobj.style.fontStyle = (theform.sel_doitalics.value == 'Y') ? 'italic' : 'normal'; innerobj.style.whiteSpace = (theform.sel_nowrap.value == 'Y') ? 'nowrap' : 'normal'; if (theform.sel_fontsize.value) innerobj.style.fontSize = theform.sel_fontsize.value; else innerobj.style.fontSize = theform.sel_fontsizenum.value + theform.sel_fontsizeunit.value; var linesize = theform.sel_linesize.value; var linesizeunit = theform.sel_linesizeunit.value; if (linesizeunit == 'mult') linesizeunit = ''; innerobj.style.lineHeight = linesize + linesizeunit; return; }  innerobj.style.fontFamily = theform.fontname.value; innerobj.style.fontWeight = (theform.dobold.value != '') ? 'bold' : 'normal'; innerobj.style.fontStyle = (theform.doitalics.value != '') ? 'italic' : 'normal'; innerobj.style.whiteSpace = (theform.nowrap.value != '') ? 'nowrap' : 'normal'; if (theform.fontsize.value) innerobj.style.fontSize = theform.fontsize.value; else innerobj.style.fontSize = theform.fontsizenum.value + theform.fontsizeunit.value; var linesize = theform.linesize.value; var linesizeunit = theform.linesizeunit.value; if (linesizeunit == 'mult') linesizeunit = ''; innerobj.style.lineHeight = linesize + linesizeunit; } function showoldout() { isinit=true; changefontsize(curfontsize); changecurfont('', curfontnum); changebold(); changeitalics(); changewrap(); chlinesize(); isinit=false; } function stripslashes(str) { str=str.replace(/\\'/g,'\''); str=str.replace(/\\"/g,'"'); str=str.replace(/\\\\/g,'\\'); str=str.replace(/\\0/g,'\0'); return str; }  function getObj(name) { if (document.getElementById) return document.getElementById(name); else if (document.all) return document.all[name]; else if (document.layers) return document.layers[name]; else return false; }  function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += obj.offsetLeft; curtop += obj.offsetTop; } } return [curleft,curtop]; }  function getscroll() { var y; if (self.pageYOffset)  y = self.pageYOffset; else if (document.documentElement && document.documentElement.scrollTop)  y = document.documentElement.scrollTop; else if (document.body)  y = document.body.scrollTop; return y; } /* sets the writing position for writing 'updating wysiwyg' and 'page loading' messages */ function setwritepos(thisobj) {  var y = findPos(thisobj); savex = y[0];  savey = y[1];  var yscroll = getscroll();    if (!dragflag) savey = scrolladj(savey, yscroll); else if (usingopera)  savey = savey - yscroll; } function capscroll() {  var dragbotval = document['curboxvars']['pickfont_bottom'].value; getObj('appdrag').style.bottom = dragbotval + 1; getObj('appdrag').style.bottom = dragbotval; }   var ie=document.all; var nn6=document.getElementById&&!document.all; var isdrag=false; var x, y, tx, ty; var dobj; function mm(e) {  if (isdrag)  { dobj.style.right = nn6 ? tx - e.clientX + x + 'px': tx - event.clientX + x;   dobj.style.bottom = nn6 ? ty - e.clientY + y + 'px' : ty - event.clientY + y; document.curboxvars.pickfont_right.value = parseInt(dobj.style.right+0,10);   document.curboxvars.pickfont_bottom.value = parseInt(dobj.style.bottom+0,10); return false;  } } function sm(e) { savex = nn6 ? e.clientX : event.clientX; savey = nn6 ? e.clientY : event.clientY; var fobj    = nn6 ? e.target : event.srcElement; var topelement = nn6 ? "HTML" : "BODY"; try { while (fobj.tagName != topelement && fobj.className != "dragme") { /* special case for form input boxes and video object tag in floating WYSIWYG box - ff nec hack */ if (skipthis.tag(fobj.tagName)) return true; fobj = nn6 ? fobj.parentNode : fobj.parentElement; } } catch (e) {  handleError('**WYSIWYG box off of page ERROR**', 'jscripts/pickfont.js', '535'); /* alert('AN ERROR HAS OCCURRED ON THIS PAGE.\n \n'  + 'It is caused by the WISYWIG floating box being extended beyond the bottom of the browser.\n \n' + 'This problem only occurs in IE and only occurs when extending the WISYWIG beyond the bottom of the browser.\n \n' + 'It does not occur if you extend the WISYWIG beyond the top or sides of the browser.' ); */ return false; } if (fobj.className=="dragme") { isdrag = true; dobj = fobj; tx = parseInt(dobj.style.right+0,10); ty = parseInt(dobj.style.bottom+0,10); x = nn6 ? e.clientX : event.clientX; y = nn6 ? e.clientY : event.clientY; document.onmousemove=mm; return false; } } document.onmousedown=sm; document.onmouseup=new Function("isdrag=false"); /* this is a test for certain tags when a mousedown event is detected while in the WYSIGYG area. Normally that would preclude a dragging of the box, but on certain tags like 'input', I will cancel the drag capture and return true from there. This hack is necessary for form fields and other objects like videos to workright in the WYSIWYG box in ff.  */ function skipthistag() { this.skiptags = new Array('INPUT', 'SELECT', 'OBJECT', 'EMBED', 'TEXTAREA', 'A', 'BUTTON'); this.skiptags = '#' + this.skiptags.join('#') + '#'; this.tag = function(fortag) { fortag = '#' + fortag.toUpperCase() + '#'; if (this.skiptags.indexOf(fortag,0) > -1) return true; return false; } } var skipthis = new skipthistag();  