';
}
function HideHelp(div)
{
div = document.getElementById(div);
div.style.display = 'none';
}
function doCustomDate(myObj, tab) {
if (myObj.options[myObj.selectedIndex].value == "Custom") {
document.getElementById("customDate"+tab).style.display = ""
document.getElementById("showDate"+tab).style.display = "none"
} else {
document.getElementById("customDate"+tab).style.display = "none"
document.getElementById("showDate"+tab).style.display = ""
}
}
function inArray(id, arraylist, returnvalue) {
for (alitem = 0; alitem < arraylist.length; alitem++) {
val = arraylist[alitem].toString();
if (id == val) {
if (returnvalue)
{
return alitem;
}
return true;
}
}
if (returnvalue)
{
return -1;
}
return false;
}
function display(RowID) {
Row = RowID + "_detail";
var table = document.getElementById(Row);
var rowCount = table.rows.length;
for (i = 1; i < rowCount; i++) {
table.rows[i].style.display = "";
}
document.getElementById(RowID + "plus").style.display = "none"
document.getElementById(RowID + "minus").style.display = ""
}
function hide(RowID) {
Row = RowID + "_detail";
var table = document.getElementById(Row);
var rowCount = table.rows.length;
for (i = 1; i < rowCount; i++) {
table.rows[i].style.display = "none";
}
document.getElementById(RowID + "plus").style.display = ""
document.getElementById(RowID + "minus").style.display = "none"
}
function getIFrameDocument(aID){
// if contentDocument exists, W3C compliant (Mozilla)
if (document.getElementById(aID).contentDocument){
return document.getElementById(aID).contentDocument;
} else {
// IE
return document.frames[aID].document;
}
}
function ShowCustomFields(contentarea, editorname, pagename) {
/*
In Firefox the full path to the admin/index.php file needs to be specified otherwise it tries to load /admin/de/index.php. This is because DevEdit runs in an iframe.
*/
if (location.href.indexOf('?') != -1) {
var url_part = location.href.split(/\?/);
var url_to_indexphp = url_part[0];
} else {
var url_to_indexphp = location.href;
}
var temp = url_to_indexphp + '?Page=ShowCustomFields&EditorName=' + editorname + '&ContentArea=' + contentarea + (pagename? ('&PageName=' + pagename) : '');
tb_show('Insert a Custom Field', temp + '&keepThis=true&height=500&width=500&modal=false', '');
}
// Used in text areas to make sure text is inserted into the Text area
function insertAtCursor(myField, myValue) {
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
} else {
if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
}
function InsertLink(placeholder, contentarea, editorname) {
// set the default for the editor name.
if (!editorname || editorname == 'undefined')
{
editorname = 'myDevEditControl';
}
placeholder = '%%' + placeholder + '%%';
if (contentarea == 'TextContent' || !UsingWYSIWYG) {
if (contentarea == 'html') {
contentarea = editorname + '_html';
}
id = document.getElementById(contentarea);
insertAtCursor(id, placeholder);
return;
}
if (placeholder == '%%unsubscribelink%%')
{
placeholder = "" + UnsubLinkPlaceholder + "";
}
modcheck_regex = new RegExp("%%modifydetails_(.*?)%%", "i");
modcheck = modcheck_regex.exec(placeholder);
if (modcheck)
{
placeholder = "" + placeholder + "";
}
modcheck_regex = new RegExp("%%sendfriend_(.*?)%%", "i");
modcheck = modcheck_regex.exec(placeholder);
if (modcheck)
{
placeholder = "" + placeholder + "";
}
eval("var editr = " + editorname);
editr.insertHTML(placeholder);
}
function InsertUnsubscribeLink(contentarea, editorname) {
InsertLink('unsubscribelink', contentarea, editorname);
}
Array.prototype.compareArrays = function(arr) {
if (this.length != arr.length) return false;
for (var i = 0; i < arr.length; i++) {
if (this[i].compareArrays) { //likely nested array
if (!this[i].compareArrays(arr[i])) return false;
else continue;
}
if (this[i] != arr[i]) return false;
}
return true;
}
function enableDate_SubscribeDate(formElement, datefield) {
if (formElement.checked) {
document.getElementById(datefield).style.display = ""
} else {
document.getElementById(datefield).style.display = "none"
}
}
function ChangeFilterOptionsSubscribeDate(formElement, datefield) {
if (formElement.selectedIndex == 3) {
document.getElementById(datefield+"date2").style.display = ""
} else {
document.getElementById(datefield+"date2").style.display = "none"
}
}
var LinkSelectBox = "";
var LinksLoaded = false;
function enable_ClickedLink(formElement, linkfield, linkselect, loadingmessage, chosen_link) {
LinkSelectBox = linkselect;
if (formElement.checked) {
document.getElementById(linkfield).style.display = "";
if (!LinksLoaded) {
linkselect = document.getElementById(linkselect);
linkselect.options.length = 0;
linkselect.options[0] = new Option(loadingmessage, '-2');
ajaxWhat = "LoadLinks(" + chosen_link + ")";
DoCallback('what=importlinks');
}
} else {
document.getElementById(linkfield).style.display = "none";
}
}
function LoadLinks(linkid) {
LinksLoaded = true;
mylinks = new Array();
eval(ajaxData);
linkselect = document.getElementById(LinkSelectBox);
linkselect.options[0] = null;
for(lnk in mylinks) {
// we need to do this because eval'ing an array also evals prototype functions etc that go with it.
// and we use that (above)...
if (isNaN(lnk)) {
continue;
}
linkselect.options[linkselect.options.length] = new Option(mylinks[lnk], lnk);
// do we need to preselect a link?
if (linkid == lnk)
{
linkselect.options[linkselect.options.length-1].selected = true;
}
}
}
var NewsSelectBox = "";
var NewsLoaded = false;
function enable_OpenedNewsletter(formElement, newsfield, newsselect, loadingmessage, chosen_news) {
NewsSelectBox = newsselect;
if (formElement.checked) {
document.getElementById(newsfield).style.display = "";
if (!NewsLoaded) {
newsselect = document.getElementById(newsselect);
newsselect.options.length = 0;
newsselect.options[0] = new Option(loadingmessage, '-2');
ajaxWhat = "LoadNewsletter(" + chosen_news + ")";
DoCallback('what=importnewsletters');
}
} else {
document.getElementById(newsfield).style.display = "none";
}
}
function LoadNewsletter(chosen_news) {
NewsLoaded = true;
mynews = new Array();
ajaxData = unescape(ajaxData);
eval(ajaxData);
newsselect = document.getElementById(NewsSelectBox);
newsselect.options[0] = null;
for(news in mynews) {
// we need to do this because eval'ing an array also evals prototype functions etc that go with it.
// and we use that (above)...
if (isNaN(news)) {
continue;
}
newsselect.options[newsselect.options.length] = new Option(mynews[news], news);
// do we need to preselect a link?
if (news == chosen_news)
{
newsselect.options[newsselect.options.length-1].selected = true;
}
}
}
function switchContentSource(HTMLOrText, Id)
{
// Toggle the WYSIWYG editor, file upload box, or web file import box
if(HTMLOrText == 'html')
{
var htmlCF = document.getElementById('htmlCF');
var htmlNLFile = document.getElementById('htmlNLFile');
var htmlNLImport = document.getElementById('htmlNLImport');
var newsletterurl = document.getElementById('newsletterurl');
switch(Id)
{
case 1:
{
document.getElementById('hct1').checked = true;
htmlCF.style.display = '';
htmlNLFile.style.display = 'none';
htmlNLImport.style.display = 'none';
break;
}
case 2:
{
document.getElementById('hct2').checked = true;
htmlCF.style.display = 'none';
htmlNLFile.style.display = '';
htmlNLImport.style.display = 'none';
break;
}
case 3:
{
document.getElementById('hct3').checked = true;
htmlCF.style.display = 'none';
htmlNLFile.style.display = 'none';
htmlNLImport.style.display = '';
newsletterurl.focus();
newsletterurl.select();
break;
}
}
}
else
{
var textCF = document.getElementById('textCF');
var textNLFile = document.getElementById('textNLFile');
var textNLImport = document.getElementById('textNLImport');
var newsletterurl = document.getElementById('textnewsletterurl');
switch(Id)
{
case 1:
{
document.getElementById('tct1').checked = true;
textCF.style.display = '';
textNLFile.style.display = 'none';
textNLImport.style.display = 'none';
break;
}
case 2:
{
document.getElementById('tct2').checked = true;
textCF.style.display = 'none';
textNLFile.style.display = '';
textNLImport.style.display = 'none';
break;
}
case 3:
{
document.getElementById('tct3').checked = true;
textCF.style.display = 'none';
textNLFile.style.display = 'none';
textNLImport.style.display = '';
newsletterurl.focus();
newsletterurl.select();
break;
}
}
}
}
function createCookie(name,value,days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
} else {
var expires = "";
}
document.cookie = name+"="+value+expires+"; path=/";
}
/**
* Gets the value of the specified cookie.
*
* name Name of the desired cookie.
*
* Returns a string containing value of specified cookie,
* or null if cookie does not exist.
*/
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
function ChangePaging(page, formAction, displayName, confMessage) {
paging = document.getElementById('PerPageDisplay' + displayName);
pagingId = paging.selectedIndex;
pagingAmount = paging[pagingId].value;
if (pagingAmount == 'all') {
if (!confirm(confMessage)) {
return false;
}
}
document.location = 'index.php?Page=' + page + '&' + formAction + '&PerPageDisplay' + displayName + '=' + pagingAmount;
}
function toggleAllCheckboxes(check)
{
formObj = check.form;
for (var i=0;i < formObj.length; i++) {
fldObj = formObj.elements[i];
if (fldObj.type == 'checkbox') {
fldObj.checked = check.checked;
}
}
}
function ImportWebsite(Butt, description, importtype, newButtonDesc, errorMsg)
{
check_form = ImportCheck(importtype);
if (!check_form) {
return;
}
var url = "";
if (importtype.toLowerCase() == 'text') {
url = document.getElementById('textnewsletterurl').value;
} else {
url = document.getElementById('newsletterurl').value;
}
ajaxWhat = "DoImport('website', '" + importtype + "', '" + newButtonDesc + "', '" + errorMsg + "');";
DoCallback('what=importurl&url='+url);
ajaxButt = Butt;
Butt.value = description;
Butt.style.width = "170px";
Butt.disabled = true;
}
function DoImport(importtype, TextOrHTML, newButtonDesc, errorMsg)
{
if (ajaxButt)
{
ajaxButt.value = newButtonDesc;
ajaxButt.style.width = "70px";
ajaxButt.disabled = false;
ajaxButt = null;
}
if(ajaxData.length == 0)
{
alert(errorMsg);
}
else
{
if (TextOrHTML.toLowerCase() == 'text') {
switchContentSource('text', 1);
document.getElementById('TextContent').value = ajaxData;
} else {
// Everything was OK
switchContentSource('html', 1);
if (typeof(myDevEditControl) == 'undefined' || typeof(myDevEditControl) == null) {
document.getElementById('myDevEditControl_html').value = ajaxData;
return;
}
myDevEditControl.writeHTMLContent(ajaxData);
}
}
}
function DoCallback(data)
{
var url = 'remote.php';
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open('POST', url, true);
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
req.send(data);
// branch for IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject('Microsoft.XMLHTTP')
if (req) {
req.onreadystatechange = processReqChange;
req.open('POST', url, true);
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
req.send(data);
}
}
}
function processReqChange() {
// only if req shows 'loaded'
if (req.readyState == 4) {
// only if 'OK'
if (req.status == 200) {
ajaxData = req.responseText;
eval(ajaxWhat);
} else {
alert('There was a problem retrieving the XML data:\n' + req.responseText);
}
}
}
function CheckRadio(Id)
{
for(i = 0; i < document.forms[0].elements.length; i++) {
if(document.forms[0].elements[i].type == "radio") {
if(document.forms[0].elements[i].id.indexOf(Id) == 0) {
if(document.forms[0].elements[i].checked) {
return true;
}
}
}
}
return false;
}
function CheckMultiple(name, frm) {
return ($("input[@name^='" + name + "']:checked", (frm || document)).size() != 0);
}
/**
* Returns true if the d/m/y is a valid date.
*/
function isValidDate(d, m, y)
{
date = new Date();
m = m - 1; // months start at 0
date.setFullYear(y, m, d);
return (m == date.getMonth());
}
/**
* Validates a custom date field. Returns true if it has a valid date or is left empty.
*/
function CheckDate(field)
{
date_fields = jQuery.map(["dd", "mm", "yy"], function(el, i) { return document.getElementById(field + "[" + el + "]"); } );
error = false;
all_blank = true;
for (i = date_fields.length-1; i >= 0; i--) {
if (date_fields[i].value == "") {
error = true
date_fields[i].focus();
} else {
all_blank = false;
}
}
return all_blank || (!error && isValidDate(date_fields[0].value, date_fields[1].value, date_fields[2].value));
}
/**
* Returns true if str is a (roughly) valid email address.
*/
function isValidEmail(str)
{
// We use a simple pattern here because the server side check is complex
// and we don't want to exclude stuff it will accept.
if(str.indexOf('@') > -1 && str.indexOf('.') > -1) {
return true;
}
return false;
}
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function decode64(input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1 = keyStr.indexOf(input.charAt(i++));
enc2 = keyStr.indexOf(input.charAt(i++));
enc3 = keyStr.indexOf(input.charAt(i++));
enc4 = keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
} while (i < input.length);
return output;
}
/**
* Convert a single file-input element into a 'multiple' input list
*
* Usage:
*
* 1. Create a file input element (no name)
* eg.
*
* 2. Create a DIV for the output to be written to
* eg.
*
* 3. Instantiate a MultiSelector object, passing in the DIV and an (optional) maximum number of files
* eg. var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 3 );
*
* 4. Add the first element
* eg. multi_selector.addElement( document.getElementById( 'first_file_element' ) );
*
* 5. That's it.
*
* You might (will) want to play around with the addListRow() method to make the output prettier.
*
* You might also want to change the line
* element.name = 'file_' + this.count;
* ...to a naming convention that makes more sense to you.
*
* Licence:
* Use this however/wherever you like, just don't blame me if it breaks anything.
*
* Credit:
* If you're nice, you'll leave this bit:
*
* Class by Stickman -- http://www.the-stickman.com
* with thanks to:
* [for Safari fixes]
* Luis Torrefranca -- http://www.law.pitt.edu
* and
* Shawn Parker & John Pennypacker -- http://www.fuzzycoconut.com
* [for duplicate name bug]
* 'neal'
*/
function MultiSelector( list_target, max ) {
// Where to write the list
this.list_target = list_target;
// How many elements?
this.count = 0;
// How many elements?
this.id = 0;
// Is there a maximum?
if( max ){
this.max = max;
} else {
this.max = -1;
};
/**
* Add a new file input element
*/
this.addElement = function( element ){
// Make sure it's a file input element
if( element.tagName == 'INPUT' && element.type == 'file' ){
// Element name -- what number am I?
// element.name = 'file_' + this.id++;
element.name = 'attachments[]';
// Add reference to this object
element.multi_selector = this;
// What to do when a file is selected
element.onchange = function(){
var start_pos = element.value.lastIndexOf("/");
if (start_pos < 0)
start_pos = element.value.lastIndexOf("\\");
var end_pos = element.value.length - 1;
var file_size = element.value.substring(start_pos, end_pos);
if (file_size.length > 30)
{
alert("This file name is too large and could cause problems in some email clients such as Outlook. Please rename the file to be less than 30 characters and try again.");
return false;
}
// New file input
var new_element = document.createElement( 'input' );
new_element.type = 'file';
new_element.className = "field250";
// Add new element
this.parentNode.insertBefore( new_element, this );
// Apply 'update' to element
this.multi_selector.addElement( new_element );
// Update list
this.multi_selector.addListRow( this );
// Hide this: we can't use display:none because Safari doesn't like it
this.style.position = 'absolute';
this.style.left = '-1000px';
};
// If we've reached maximum number, disable input element
if( this.max != -1 && this.count >= this.max ){
element.disabled = true;
};
// File element counter
this.count++;
// Most recent element
this.current_element = element;
} else {
// This can only be applied to file input elements!
alert( 'Error: not a file input element' );
};
};
/**
* Add a new row to the list of files
*/
this.addListRow = function( element ){
// Row div
var new_row = document.createElement( 'div' );
// Delete button
var new_div = document.createElement( 'div' );
new_div.innerHTML = " "
new_div.style.display = "inline";
var new_row_button = document.createElement( 'a' );
// new_row_button.type = 'button';
new_row_button.innerHTML = 'Remove';
new_row_button.href = "javascript:void()";
// References
new_row.element = element;
// Delete function
new_row_button.onclick= function(){
// Remove element from form
this.parentNode.element.parentNode.removeChild( this.parentNode.element );
// Remove this row from the list
this.parentNode.parentNode.removeChild( this.parentNode );
// Decrement counter
this.parentNode.element.multi_selector.count--;
// Re-enable input element (if it's disabled)
this.parentNode.element.multi_selector.current_element.disabled = false;
// Appease Safari
// without it Safari wants to reload the browser window
// which nixes your already queued uploads
return false;
};
// Set row value
new_row.innerHTML = element.value;
// Add button
new_row.appendChild( new_div );
new_row.appendChild( new_row_button );
// Add it to the list
this.list_target.appendChild( new_row );
};
};
// we do this to get around the "click here to activate control" issue in internet explorer
// we don't need to do this with firefox, but at least it will be done consistently across all browsers
// for more info see http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
function PrintChart(contents) {
document.write(contents);
}
// used by autoresponders, templates & newsletters.
function previewTemplate(selectedValue) {
if (isNaN(selectedValue)) {
document.getElementById("imgPreview").src = "resources/email_templates/" + selectedValue+ "/preview.gif";
} else {
if (selectedValue > 0) {
document.getElementById("imgPreview").src = "resources/user_template_previews/" + selectedValue + "_preview.gif";
} else {
document.getElementById("imgPreview").src = "images/nopreview.gif";
}
document.getElementById("imgPreview").onerror = function (evt) {
document.getElementById("imgPreview").src = "images/nopreview.gif";
}
}
}
function stripHTML(c)
{
var BodyContents = /([\s\S]*\]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i ;
var h = c.match(BodyContents);
if (h != null && h[2]) {
c = h[2];
}
c = c.replace(/\/\/--\>/gi, "");
c = c.replace(/(\n)/gi,"");
c = c.replace(/(\r)/gi,"");
c = c.replace(/ /gi,"\n");
c = c.replace(/(<\/h.>|<\/p>|<\/div>)/gi, "$1\n\n");
c = c.replace(/<[^>]+>/g,"");
c = c.replace(/</g,"<");
c = c.replace(/>/g,">");
c = c.replace(/ /g," ");
return c;
}
function stripHTMLWithLinks(c) {
var BodyContents = /([\s\S]*\]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i ;
var h = c.match(BodyContents);
if (h != null && h[2]) {
c = h[2];
}
c = c.replace(/(.*?)<\/a>/gi, "$2 [$1]");
c = c.replace(/(.*?)<\/a>/gi, "$2 [$1]");
c = c.replace(/\/\/--\>/gi, "");
c = c.replace(/(\n)/gi,"");
c = c.replace(/(\r)/gi,"");
c = c.replace(/ /gi,"\n");
c = c.replace(/(<\/h.>|<\/p>|<\/div>)/gi, "$1\n\n");
c = c.replace(/<[^>]+>/g,"");
c = c.replace(/</g,"<");
c = c.replace(/>/g,">");
c = c.replace(/ /g," ");
return c;
}
/*
function grabTextContent(textareaname, editorname) {
try
{
eval("var editr = " + editorname);
document.getElementById(textareaname).value = editr.getTextContent();
}
catch (error)
{
document.getElementById(textareaname).value = stripHTML(document.getElementById(editorname+'_html').value);
}
}
*/
function grabTextContent(textareaname, editorname) {
try
{
eval("var editr = " + editorname);
document.getElementById(textareaname).value = editr.getTextContentWithLinks();
}
catch (error)
{
document.getElementById(textareaname).value = stripHTMLWithLinks(document.getElementById(editorname+'_html').value);
}
}
/* Theme Change Javascript */
function getTids() {
var allTids = new Array;
// Since document.getElementsByName doesnt return body, td, div tags etc, we need to do this ourselves for I.E
if (document.all) {
allElements = document.getElementById('myDevEditControllevel0').contentWindow.document.getElementById('myDevEditControl_frame').contentWindow.document.all;
x = 0;
for (i=0; i" + allTids[i].getAttribute("description") + allTids[i].getAttribute("bgcolor");
}
document.getElementById("themeChanger").innerHTML = html;
}
var flag = 0;
var defaultcolors = new Array();
function switchTheme(color) {
if (color=='null') return false;
var allTids = new Array;
allTids = getTids();
if (allTids.length==0) {
alert('The file you are editing does support automated color theme changes.');
return false;
}
var allcolors = new Array;
if ((color=='default') && (flag==1)) {
for (grd=0; grd<5; grd++) {
allcolors[grd] = defaultcolors[grd];
}
} else {
var grades = [0, 0.6, 0.25, 0.667, 0.333];
var basecolor = new Array(HexToR(color), HexToG(color), HexToB(color));
var onecolor = new Array;
for (grd=0; grd<5; grd++) {
for (bsc=0; bsc<3; bsc++) {
onecolor[bsc] = Math.round(basecolor[bsc]+(255-basecolor[bsc])*grades[grd]);
}
allcolors[grd] = '#'+RGB2Hex(onecolor[0], onecolor[1], onecolor[2]);
}
}
var description = '';
for (i=0; i-1) {
if (flag == 0) defaultcolors[descgrade] = allTids[i].style.borderColor;
allTids[i].style.borderColor = allcolors[descgrade];
} else if (description.search(/BorderBottomColor$/)>-1) {
if (flag == 0) defaultcolors[descgrade] = allTids[i].style.borderBottomColor;
allTids[i].style.borderColor = allcolors[descgrade];
} else if (description.search(/BackgroundColor$/)>-1) {
if (flag == 0) defaultcolors[descgrade] = allTids[i].style.backgroundColor;
allTids[i].style.backgroundColor = allcolors[descgrade];
} else if (description.search(/Bgcolor$/)>-1) {
if (flag == 0) defaultcolors[descgrade] = allTids[i].bgColor;
allTids[i].bgColor = allcolors[descgrade];
} else if (description.search(/Color$/)>-1) {
if (flag == 0) defaultcolors[descgrade] = allTids[i].style.color;
allTids[i].style.color = allcolors[descgrade];
}
continue;
}
comm = description.substr(pt);
eval("if (flag == 0) defaultcolors[descgrade] = allTids[i]"+comm+";");
eval("allTids[i]"+comm+" = allcolors[descgrade];");
}
flag = 1;
}
function HexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function HexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function HexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
hexdig='0123456789ABCDEF';
function Dec2Hex(d) {
return hexdig.charAt((d-(d%16))/16)+hexdig.charAt(d%16);
}
function RGB2Hex(r,g,b) {
return Dec2Hex(r)+Dec2Hex(g)+Dec2Hex(b);
}
function Hex2Dec(h) {
h=h.toUpperCase();
d=0;
for (i=0;i';
replacement.innerHTML = newHTML;
},
get_prop: function(element, prop)
{
if(element.currentStyle)
{
return element.currentStyle[prop];
}
else if(document.defaultView && document.defaultView.getComputedStyle)
{
prop = prop.replace(/([A-Z])/g,"-$1");
prop = prop.toLowerCase();
return document.defaultView.getComputedStyle(element, "").getPropertyValue(prop);
}
},
add_group: function(select, group, group_id)
{
group_html = '