 var curform = 'curboxvars';  var saveright = 'pickcol_right';  var savebottom = 'pickcol_bottom';   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 savemess = ''; var doevents = true; var savex, savey; function showload(loadwhat, xoff, yoff) {   document.body.style.backgroundColor = '#cccccc';  getObj('loadingmess').innerHTML = loadwhat; var showbox = getObj('submitmess'); showbox.style.left = nn6 ? (savex + xoff + 'px') : (savex + xoff);   showbox.style.top = nn6 ? (savey + yoff + 'px') : (savey + yoff); showbox.style.display = 'block'; return; } function showload2(loadwhat, xoff, yoff) {   document.body.style.backgroundColor = '#cccccc';  getObj('loadingmess2').innerHTML = loadwhat; var showbox = getObj('submitmess2'); showbox.style.left = nn6 ? savex + xoff + 'px': savex + xoff;   showbox.style.top = nn6 ? savey + yoff + 'px' : savey + yoff; showbox.style.display = ''; return; } var dragflag = false; function cancelpick(thisobj, topage) {  if (!doevents) return false; doevents = false;   setwritepos(thisobj);   if (topage) showload2('<span style="color:red;">#Picker Cancelled#</span>', -110, -100); else showload('<span style="color:red;">#Picker Cancelled#</span>', -110, -100); if (topage)document[curform].action = topage;  document[curform].submit(); return false; } function retnew(e) {  if (!doevents) return false; doevents = false;   setwritepos(this);   if (ff.substring(0,4) == 'sel_') showload2('New Color Selected!', -110, -100); else showload('New Color Selected!', -110, -100); var thiscol = this.style.backgroundColor; if (thiscol.substr(0, 3) == 'rgb') {   var convert = 'thiscol = C' + thiscol + ';'; eval(convert); } rt(thiscol); return false; } function rt(cc) { document[curform][ff].value = cc; if (ff.indexOf('sel_', 0) > -1)  document[curform].action = 'pick_selstyle.php'; document[curform].submit(); }  function changesel() { if (document.dummy.piccol_showselbord.checked) { document.curboxvars.sel_showselbord.value = 'Y'; getObj('ccbselbord').style.border = '1px #ff0000 dashed'; } else { document.curboxvars.sel_showselbord.value = ''; getObj('ccbselbord').style.border = '0px #ff0000 dashed'; } } function Crgb(rc, gc, bc) {  rc = rc.toString(16); if (rc.length == 1) rc = '0' + rc; gc = gc.toString(16); if (gc.length == 1) gc = '0' + gc; bc = bc.toString(16); if (bc.length == 1) bc = '0' + bc; return '#' + rc + gc + bc; } function upwysiwyg(e) { if (!doevents) return; this.onmouseout = showorg; this.onclick = retnew; var thiscol = this.style.backgroundColor; if (thiscol.substr(0, 3) == 'rgb') {   var convert = 'thiscol = C' + thiscol + ';'; eval(convert); } cc(thiscol); return; } function showorg(e) { if (!doevents) return; cc(origcol); } function cs() { cc(origcol); } function cc(cc) { cc = trimstr(cc); var hash =cc.match("^#"); var hex3 = cc.match("^#?[0-9a-fA-F]{3}$"); var hex6 = cc.match("^#?[0-9a-fA-F]{6}$"); if (hex3 || hex6) if (!hash) color = '#' + color; var hex; var totalhex = 0; var highesthex = 255 * 3; var lumperc; if (hex3) { for (var i=1;i<4;i++) { hex = cc.substr(i, 1); hex += hex;  totalhex += parseInt(hex, 16); } } else if (hex6) { for (var i=1;i<6;i+=2) { hex = cc.substr(i, 2); totalhex += parseInt(hex, 16); }  } else { lumperc = 'n/a'; } if (lumperc != 'n/a') { lumperc = ((100 * totalhex) / highesthex); lumperc = Math.round(lumperc); } var showcolstr = "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Mouseover Color: " + cc + '&nbsp;~Brightness: ' + lumperc + '%&nbsp;&nbsp;'; var showcolstr2 = '<span style="font-size:110%;color:' + cc + '"><span style="background-color: #ffffff">&nbsp;OnWhiteBack&nbsp;</span><span style="background-color: #000000">&nbsp;&nbsp;OnBlackBack&nbsp;&nbsp;</span>' + '&nbsp;&nbsp;&nbsp;&nbsp;<span style=" background-color:' + cc + '">&nbsp;&nbsp;<span style="color:#000000">BlackText</span>&nbsp;<span style="color:#ffffff">WhiteText</span>&nbsp;&nbsp;</span></span>'; if (cc == 'inherit') cc = ''; try{  if (ff == 'textcolor') { getObj('ccbconts').style.color= cc; } else if (ff == 'innerbackcolor') { getObj('ccbconts').style.backgroundColor= cc; } else if (ff == 'backcolor') { if (document.curboxvars.showtopcolor.value == 1) getObj('showtop').style.backgroundColor = cc; if (document.curboxvars.showmidcolor.value == 1) getObj('showmid').style.backgroundColor= cc; if (document.curboxvars.showbotcolor.value == 1) getObj('showbot').style.backgroundColor= cc; } else if (ff == 'backcolor2') { if (document.curboxvars.showtopcolor.value == 2) getObj('showtop').style.backgroundColor = cc; if (document.curboxvars.showmidcolor.value == 2) getObj('showmid').style.backgroundColor= cc; if (document.curboxvars.showbotcolor.value == 2) getObj('showbot').style.backgroundColor= cc; } else if (ff == 'targetbackcolor') { getObj('widthbars').style.backgroundColor= cc; } else if (ff == 'bordercolor' && doinnerborder) { getObj('ccbconts').style.border = bordersize + 'px ' + cc + ' solid'; } else if (ff == 'sel_textcolor') { getObj('ccb10').style.color = cc; } else if (ff == 'sel_backcolor') { getObj('ccb10').style.backgroundColor= cc; } else if (sel_doinnerborder && ff == 'sel_bordcolor') { getObj('ccb10').style.border = sel_bordsize + 'px ' + cc + ' ' + sel_bordstyle; } getObj('hovercol').innerHTML = showcolstr; getObj('hovercol2').innerHTML = showcolstr2; } catch(err) { return; } }  function trimstr(thestring) { while (thestring.substring(0,1) == ' ') thestring = thestring.substring(1, thestring.length); while (thestring.substring(thestring.length-1, thestring.length) == ' ') thestring = thestring.substring(0,thestring.length-1); return thestring; }  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]; }  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.pickcol_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[curform][saveright].value = parseInt(dobj.style.right+0,10); document[curform][savebottom].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/pickcol.js', '367'); /* 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();  