var dd_is_active=0;var dd_obj=0;var b=0;var dd_oobj=0;var wa = new Array();var toolBar;var mainBar;var rte;var noIntro;var at = false;var au = false;var av = false;var aw = false;var ax = false;var az = false;var bw = new lib_bwcheck();var oRTE='';var ab='#801010';var ac ='#c9d38a';var mode='edit';var ad =1100;var ae='#99a35a';var af='#ca5e5c';var ag ='#99a35a';var ah = '#ca5e5c';var ai ='#000000';var aj ='#CCCCCC';var ak ='#b34644';var ak2 ='#757F2F';var al =30;var am ='#99a35a';var an =18;var ao =3;var ap ="images/";var aq =true;var ar ='#d4aeb3';var ar2 ='#c9d38a';var as =36;var element = "";var z;var uploadimage ="";var rng;var currentRTE;var allRTEs ="";var page;if (page === '' || page === 'null'){page = 'home';}var ID;if (Request.QueryString("ID")!=='' || Request.QueryString("ID")!==null){ID = Request.QueryString("ID");}var isIE;var isGecko;var isSafari;var isKonqueror;var includesPath;var cssFile;var ay=true;var ba='';var lang = "en";var encoding = "iso-8859-1";if(Request.QueryString("page")!=='' || Request.QueryString("page")!==null){ba = Request.QueryString("page");ba = ba;}if(ba === null || ba === ''){ba = 'home';}var setOpacity = false;function ca(a) {this.evnt=bw.dom?document.getElementById(a):bw.ie4?document.all[a]:bw.ns4?eval(nest+"document.layers." +a):0;with(this.evnt.style){height = al;width = ad;clear='both';backgroundColor = ak;paddingRight = '2px';paddingLeft = '2px';}this.z=this.evnt.innerHTML;this.permaButtons='<' + 'div style="margin-top:0;"><' + '/' + 'div>';this.evnt.innerHTML=this.permaButtons + this.z;var x=0;for(x in wa){if(wa[x].pp=='a'){zz(wa[x], mode);}}	return true;};ca.prototype.change =function(a){this.evnt.innerHTML=this.permaButtons + a;var x=0;for(x in wa){if(wa[x].pp=='a'){zz(wa[x], mode);}}	return true;};ca.prototype.revert = function () {this.evnt.innerHTML=this.permaButtons + this.z;var x=0;for(x in wa){if(wa[x].pp=='a'){zz(wa[x], mode);}}return true;};function cb(ho,obj2) {this.evnt=bw.dom?document.getElementById(ho):bw.ie4?document.all[ho]:bw.ns4?eval(nest+"document.layers." +ho):0;this.evnt2=bw.dom?document.getElementById(obj2):bw.ie4?document.all[obj2]:bw.ns4?eval(nest+"document.layers." +obj2):0;with (this.evnt.style) {height = an;width = ad;clear = 'both';}with (this.evnt2.style){height = an;width = ad;clear = 'both';}var save='';var edit='';var move='';save='onClick="alert(\'The Save Function is only avaiable in the full version. Normally, clicking save, makes your changes live and shows you a preview of your site from which you can navigate and make changes to your other pages.\');"';edit='onClick="cu(\'edit\');b=0;dd_oobj=0;"';move='onClick="cu(\'move\');b=0;dd_oobj=0;"';var saveff='';var editff='';var moveff='';if(bw.ns6) {save='';edit='';move='';saveff='alert(\'The Save Function is only avaiable in the full version. Normally, clicking save, makes your changes live and shows you a preview of your site from which you can navigate and make changes to your other pages.\');"';editff='onClick="cu(\'edit\');b=0;dd_oobj=0;"';moveff='onClick="cu(\'move\');b=0;dd_oobj=0;"';}	this.z=this.evnt.innerHTML;var extraDiv;this.permaButtons='<' + 'div style="outline:none;font-size:9px;height:15px;margin-right:0;float:left;" onclick="hide(\'Intro\');hide(\'orange\');hide(\'Box\');" id="options"><' + 'span style="float:left;width:96px;height:15px;cursor:pointer;" id="saveView" ' + saveff + '><' + 'a style="width:96px;height:15px;" href="#" id="btnPreview" ' + save + '><' + '/' + 'a><' + '/' + 'span>';	this.permaButtons+='<' + 'span style="outline:none;float:left;width:38px;height:15px;cursor:pointer;font-size:9px;margin-left:20px;" id="Edit" ' + editff + '><' + 'a style="width:38px;height:15px;" href="#" id="btnEdit" ' + edit + '><' + '/' + 'a><' + '/' + 'span>';this.permaButtons+='<' + 'span style="outline:none;float:left;width:77px;height:15px;cursor:pointer;font-size:9px;margin-left:20px;" id="Move" ' + moveff + '><' + 'a style="width:77px;height:15px;" href="#" id="btnMove" ' + move + '><' + '/' + 'a><' + '/' + 'span><' + '/' + 'div>';this.evnt.innerHTML= this.z + this.permaButtons;this.buttons = new Array();this.setupBar();return true;};cb.prototype.setupBar = function () {var type, name, a='<' + 'div id="elements" style="outline:none;font-size:9px;margin-top:2px;float:left;width:auto;font:menu;background:url(\'/scripts/images/inter-graphics/buttonbar-top.jpg\') repeat;"><' + 'span id="Elements" style="float:left;width:86px;height:15px;cursor:default;margin-top:2;float:left;color:#989898;font-size:9px;"><' + '/' + 'span>';var titleCount=0, textCount=0, imageCount=0;var displayButton='block';for (x in wa) {name = wa[x].name;type = wa[x].pp;switch (wa[x].pp) {case 'span': type='Title'; titleCount++;iCount=titleCount;break;case 'div': type='Text'; textCount++; iCount=textCount; break;case 'b': type='Image'; imageCount++; iCount=imageCount; break;	case 'ul': type='Buttons'; iCount=''; break;case 'a': type='Horizontal Ruler'; iCount=''; break;case 'k': type='Vertical Ruler'; iCount=''; break;}	if ( type == 'Vertical Ruler' || type == 'Horizontal Ruler'){displayButton = 'none';}else{displayButton='block';}if(type=='Image'&&iCount == 1){type='Logo';a+='<' + 'span style="font-size:9px;outline:none;float:left;width:auto;display:' + displayButton + ';" id="' + type + '" ><' + 'a href="#" id="btn' + name + '" style="margin-top:1px;margin-bottom:1px;padding: 0px 2px;background:#EEE;text-decoration:none;text-align:center;float:left;border-width:1px;border-style:outset; border-bottom-color:#000;border-right-color:#000;border-top-color:#CCC;border-left-color:#CCC;color:#EDEDED;font:menu;" onclick="setCookie(\'d\',' + x + ',365);' + name + '.hs(x);"><' + 'span style="font-size:10;">' + type + '<' + '/' + 'span><' + '/' + 'a><' + '/' + 'span>';}else if( type == 'Image' && iCount > 1 ){type = 'Image';iCount = iCount - 1;a+='<' + 'span style="font-size:9px;outline:none;float:left;width:auto;display:' + displayButton + ';" id="' + type + '" ><' + 'a href="#" id="btn' + name + '" style="margin-top:1px;margin-bottom:1px;padding: 0px 2px;background:#EEE; text-decoration:none;text-align:center;float:left;border-width:1px; border-style:outset;border-bottom-color:#000;border-right-color:#000;border-top-color:#CCC;border-left-color:#CCC;color:#EDEDED;font:menu;" onclick="setCookie(\'d\',' + x + ',365);' + name + '.hs(x);"><' + 'span style="font-size:10;">' + type + ' ' + iCount + '<' + '/' + 'span><' + '/' + 'a><' + '/' + 'span>';}else{var begSentence;var selectItem;if ( type == 'Buttons' ){begSentence = 'I am the menu';selectItem = 'ondblclick="deactivateall(' + x + ');"';}else{begSentence = 'I am a';selectItem = '';}a+='<' + 'span id="' + type + '" ><' + 'a href="#" id="btn' + name + '" style="display:' + displayButton + ';outline:none;margin-top:1px;margin-bottom:1px;padding: 0px 2px 0px;margin:1px;background:#000000;text-decoration:none;text-align:center;float:left;border-width:1px;border-style:outset;border-bottom-color:#000;border-right-color:#000;border-top-color:#CCC;border-left-color:#CCC;color:#EDEDED;font:menu;" onclick="setCookie(\'d\',' + x + ',365);' + name + '.hs(x);" ' + selectItem + '><' + 'span style="font-size:10;">' + type + ' ' + iCount + '<' + '/' + 'span><' + '/' + 'a><' + '/' + 'span>';}}a+='<' + '/' + 'div>';this.change(a);for(x in wa){wa[x].ce();}cu('move');if (bw.ie){document.getElementById('container').style.position='';}return true;};cb.prototype.change = function (a) {this.evnt2.innerHTML=a ;return true;};cb.prototype.revert = function () {	this.evnt.innerHTML=this.permaButtons + this.z;return true;};function RGBtoHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B)};function toHex(N) { if (N==null) {return "00";} N=parseInt(N); if (N==0 || isNaN(N)) {return "00";}N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);return "0123456789ABCDEF".charAt((N-N%16)/16) + "0123456789ABCDEF".charAt(N%16);};function cc(id, a) {if(document.getElementById(id)){a = a.replace('color: ;', '');a+=';';a = a.replace("<!--", "");a = a.replace("-->", "");a = a.replace(/[\/]{1,1}[\/]{1,1}([^\n]*)[\n]{1,1}/g, "");a = a.replace(/[\n\t]/g, "");a = a.replace(/([\w]*)[\s]*[:]{1,1}[\s]*([\w#,-\. %]*)[\s]*[;]?[\s]*([\}]?)/g, "$1:$2;");a = a.replace("**","(").replace("*&",")");var arrStyles = a.split(';');var iCount = 0;var left='NaN';var top='NaN';for(i in arrStyles){arrTmp = arrStyles[i].split(':');itmp = arrTmp[0].indexOf("-")+1;stmp = arrTmp[0].substring(itmp, itmp+1);arrTmp[0] = arrTmp[0].replace("-" + stmp, stmp.toUpperCase());itmp = arrTmp[0].indexOf("-")+1;stmp = arrTmp[0].substring(itmp, itmp+1);arrTmp[0] = arrTmp[0].replace("-" + stmp, stmp.toUpperCase());if (arrTmp[0].length>0) {try{document.getElementById(id).style[arrTmp[0]]=arrTmp[1];}catch(err){}}}return document.getElementById(id).style.cssText.toLowerCase();}return true;};

aa.prototype.cb = function(a) {
	a+=';';
	a = a.replace("<!--", "");
	a = a.replace("-->", "");
	a = a.replace(/[\/]{1,1}[\/]{1,1}([^\n]*)[\n]{1,1}/g, "")
	a = a.replace(/[\n\t]/g, "");
	a = a.replace(/([\w]*)[\s]*[:]{1,1}[\s]*([\w#,-\. %]*)[\s]*[;]?[\s]*([\}]?)/g, "$1:$2;");
	var arrStyles = a.split(';');
	var iCount = 0;
	var left='NaN';
	var top='NaN';
	for (i in arrStyles) {
		arrTmp = arrStyles[i].split(':');
		
		itmp = arrTmp[0].indexOf("-")+1;
		stmp = arrTmp[0].substring(itmp, itmp+1);
		arrTmp[0] = arrTmp[0].replace("-" + stmp, stmp.toUpperCase());
		if (arrTmp[0]!='left'&&arrTmp[0]!='top') {
			this.bn[arrTmp[0]]=arrTmp[1];
		} else if (arrTmp[0]=='left') {
			left = parseInt(arrTmp[1].replace('px', ''));
		} else if (arrTmp[0]=='top') {
			top =  parseInt(arrTmp[1].replace('px', ''));
		}
	}
	this.bn.position='absolute';
	if (left!='NaN'&&top!='NaN') {left=left + z.x()+ao;top=top + z.y() + ao;this.ht(left, top);
		}
	this.ce();
	return true;
};
function disableSelection(element) {
    element.onselectstart = function() {
        return false;
    };
    element.unselectable = "on";
    element.style.MozUserSelect = "none";
    element.style.cursor = "default";
	return true;
};
aa.prototype.cc = function(a) {	
	if(a==''){return true;}else{a+=';';a = a.replace(/(\/\*[^\*]*\*\/)/g, "");a = a.replace("<!--", "");a = a.replace("-->", "");a = a.replace(/[\/]{1,1}[\/]{1,1}([^\n]*)[\n]{1,1}/g, "");
		a = a.replace(/[\n\t]/g, "");a = a.replace(/([\w]*)[\s]*[:]{1,1}[\s]*([\w#,-\. %\(\)=]*)[\s]*[;]?[\s]*([\}]?)/g, "$1:$2;");
		a = a.replace(';;', ';');
		var arrStyles = a.split(';');var iCount = 0;
		this.bn.cssText = a;
		var left='NaN';
		var top='NaN';
		for (i in arrStyles) {
			arrTmp = arrStyles[i].split(':');
			itmp = arrTmp[0].indexOf("-")+1;
			stmp = arrTmp[0].substring(itmp, itmp+1);
			arrTmp[0] = arrTmp[0].replace("-" + stmp, stmp.toUpperCase());
			if (arrTmp[0]=='zIndex') {
				if(arrTmp[1]>10000){arrTmp[1]=arrTmp[1]/1000;}
				if(arrTmp[1]>1000){arrTmp[1]=arrTmp[1]/100;}
				if(arrTmp[1]>100){arrTmp[1]=arrTmp[1]/10;}
				if(arrTmp[1]==100){arrTmp[1]=arrTmp[1]-2;}
				this.bn[arrTmp[0]]=arrTmp[1];
			} else if (arrTmp[0]=='left') {
				left = parseInt(arrTmp[1].replace('px', ''));
			} else if (arrTmp[0]=='top') {
				top =  parseInt(arrTmp[1].replace('px', ''));
			}
			switch (arrTmp[0]) {
				case 'borderStyle': if (this.arrBorder && this.bn.borderStyle!==''){this.arrBorder['borderStyle']=this.bn.borderStyle;}else{this.arrBorder['borderStyle']='';}break;
				case 'borderWidth': if (this.arrBorder && this.bn.borderWidth!=''){this.arrBorder['borderWidth']=this.bn.borderWidth;}else{this.arrBorder['borderWidth']='';}break;
				case 'borderColor': if (this.arrBorder && this.bn.borderColor!=''){this.arrBorder['borderColor']=this.bn.borderColor;}else{this.arrBorder['borderColor']='';}break;
				case 'border': if (this.arrBorder){ this.arrBorder['border']=this.bn.border;} break;
			}
		}
		if (this.bn){
			this.bn.position='absolute';
		}
		if(this.bn.visibility=='hidden'){     
			if (this.type == 'b'){if(this.bn.width==''||this.bn.width=='775px'){this.ht('250px','250px');this.bn.width='65px';}if(this.bn.height==''||this.bn.height=='578px'){this.bn.width='65px';this.bn.height='65px';}}
			if (this.type == 'rotimg'){if(this.bn.width==''||this.bn.width=='775px'){this.ht('250px','250px');this.bn.width='65px';this.bn.height='65px';}if(this.bn.height==''||this.bn.height=='578px'){this.bn.width='65px';this.bn.height='65px';}}
			if (this.type == 'span'){this.bn.width='300px';this.bn.height='40px';this.bn.top='50px';this.bn.left='225';}
			if (this.type == 'div'){if(this.bn.width=='300px'){this.bn.width='300px';}if(this.bn.height=='100px'){this.bn.height='135px';}}
			if (this.type == 'artspec'){if(this.bn.width==''){this.bn.top='40px';this.bn.left='40px';this.bn.width='526px';}}
		}
		if (left!='NaN'&&top!='NaN'&&this.bn.visibility!='hidden') {
			this.ht(left, top);}if (this.type=='ul'){this.bn.color='';}
		this.ce();
	}
	return true;
};function zz(wa, a){
	var button = document.getElementById('guideRulers');
	if(button){
		if (a=='edit') {
			if(wa.bn.visibility != 'hidden'){ 
				with (button.style) {	
					backgroundColor=ak;
					color = 'black';
					borderStyle='inset';
					borderWidth='1px';
					borderColor='#CCC';
					paddingRight = '1px';
					paddingLeft = '1px';
				}
			} else {
				with (button.style) {
					color='black';
					backgroundColor = ar;
					borderStyle='outset';
					borderWidth='1px';
					borderColor='#CCC';
					paddingRight = '1px';
					paddingLeft = '1px';
				}
			}
		}else if(a=='move'){
			if(wa.bn.visibility != 'hidden'){ 
				with (button.style) {	
					backgroundColor=ak2;
					color = 'black';
					borderStyle='inset';
					borderWidth='1px';
					borderColor='#CCC';
					paddingRight = '1px';
					paddingLeft = '1px';
				}
			} else {
				with (button.style) {
					color='black';
					backgroundColor = ar2;
					borderStyle='outset';
					borderWidth='1px';
					borderColor='#CCC';
					paddingRight = '1px';
					paddingLeft = '1px';
				}
			}	
		}
	}return true;
};
function cu(a) {
	if (getCookie('modevalue')){
		if (a != 'preview' || a != getCookie('modevalue')){
			setCookie('modevalue',a,365);
		}
	}else {setCookie('modevalue',a,365);}
	var num = null;
	for (x in wa) {
		if (wa[x].activated){num=x;}
	}	
	deactivateall();
	mode=a;
	var xx;for(xx in wa){if(wa[xx].pp=='a'){zz(wa[xx],mode);}}
	switch (mode) {
		case 'move':
			with (document.getElementById('btnMove').style) {
			}
			if (document.getElementById('divToolBar').style.backgroundColor) {
				document.getElementById('divToolBar').style.background = "#99a35a";
			}
			if (document.getElementById('status')) {
				document.getElementById('status').style.color = ac;
			}
			document.title = 'IVWebsites.com – Move Mode';
			break;
		case 'edit':
			if (num!=null){setCookie('color',wa[num].bn.backgroundColor,365);}
			with (document.getElementById('btnEdit').style) {
			}
			if (document.getElementById('divToolBar').style.backgroundColor) {
				document.getElementById('divToolBar').style.background = "#ca5e5c";
			}
			if (document.getElementById('status').style.color) {
				document.getElementById('status').style.color = ab;
			}
			document.title = 'IVWebsites.com – Edit Mode';
			break;
		case 'preview':
		    deactivateall();
			with (document.getElementById('btnPreview').style) {
			}
			if (document.getElementById('divToolBar').style.backgroundColor) {
				document.getElementById('divToolBar').style.backgroundColor = "black";
			}
			document.title = 'IVWebsites.com – Preview Mode';
			break;
	}
	if (num) {
		wa[num].ho();
	}return true;
};
function cx(container){ 
    document.getElementById(container).style.zIndex=0;
    this.evnt=bw.dom? document.getElementById(container):
        bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
    this.bn=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
    this.ref=bw.dom||bw.ie4?document:this.bn.document;
    this.iy=this.y();
    if (bw.ie){this.bn.position='';}
    this.iy2=(this.evnt.offsetHeight||this.bn.clip.height||this.ref.height||this.bn.pixelHeight||0)+this.y+(ao*2); //this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
    this.ix=this.x();
    this.ix2=(this.evnt.offsetWidth||this.bn.clip.width||this.ref.width||this.bn.pixelWidth||0)+this.x+(ao*2); //this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
    if(!this.ix2||!this.iy2){ return ('WARNING: Document has no width or height');}
    return this;
};
cx.prototype.width = function() {
	this.w=this.evnt.offsetWidth||this.bn.clip.width||this.ref.width||this.bn.pixelWidth||0;
	return this.w;
};
cx.prototype.height = function() {
	this.h=this.evnt.offsetHeight||this.bn.clip.height||this.ref.height||this.bn.pixelHeight||0;
	return Math.round(this.h);
};
function findPos(ho){
	var curtop;
	var curleft;
	curleft = curtop = 0;
	if (ho.offsetParent) {
		curleft = ho.offsetLeft;
		curtop = ho.offsetTop;
		while (ho == ho.offsetParent) {
			curleft += ho.offsetLeft;
			curtop += ho.offsetTop;
		}
	}
	return [curleft,curtop];
};
cx.prototype.x = function() {
	var offsetx=0;
	if (document.getElementById('MainContent')) {offsetx = document.getElementById('MainContent').offsetLeft;}this.ix=(this.evnt.offsetLeft||this.bn.clip.left||0)+offsetx+11;return this.ix;};cx.prototype.y=function(){var offsety=0;if (document.getElementById('MainContent')){offsety = document.getElementById('MainContent').offsetTop;}this.iy=(this.evnt.offsetTop||this.bn.clip.top||0)+offsety;return this.iy;
};cx.prototype.x2=function(){this.ix2=(this.evnt.offsetWidth||this.bn.clip.width||this.ref.width||this.bn.pixelWidth||0)+z.x()+(ao*2);
	return parseInt(this.ix2);};cx.prototype.y2=function(){this.iy2=(this.evnt.offsetHeight||this.bn.clip.height||this.ref.height||this.bn.pixelHeight||0)+z.y()+(ao*2);return parseInt(this.iy2);};
var BrowserDetect = {init: function () {this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
function lib_bwcheck(){ 
	this.ver=navigator.appVersion;	this.product=navigator.product;
	this.moz= navigator.product == 'Gecko';
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.mac=this.agent.indexOf("Mac")>-1;
	if (BrowserDetect.browser == 'Opera'){
		this.opera5 = 1;
	}else{this.opera5 = 0;}
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie5mac=(this.ver.indexOf("MSIE 5.23")>-1 && !this.opera5 && this.mac)?1:0;this.ie4=(document.all && !this.dom && !this.opera5)?1:0;this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8;this.saf=this.agent.indexOf("Safari")>-1;this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;this.ns7=(this.dom && parseInt(this.ver) >= 7) ?1:0;this.ns4=(document.layers && !this.dom)?1:0;this.net9 = this.agent.indexOf('Navigator/9')>-1; this.net8 = this.agent.indexOf('Navigator/8')>-1;this.net7 = this.agent.indexOf('Navigator/7')>-1;this.bw=(this.moz||this.ie5mac||this.saf||this.ie7||this.ie8||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5||this.ns7);
	return this;};function inspect(elm){
	var a = "";for(var i in elm){if (elm[i]) {
			a+=i;
			a+=": "+elm[i]+"\n";
		}
		a+="\n";
	}
	a = a.replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','').replace('<br />','');
	return a;
};
function aa(name,obj,num){ 
  if(!bw.bw){ return ('Old browser');}
  this.activated = false;
  this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;	
  if(!this.evnt) {return ('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!');}
  this.objname=obj;this.name=name;this.num=num;this.pp=this.evnt.className||this.evnt.tagName.toLowerCase();
  this.bn=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.bn.document;
  var coor = findPos(this.evnt);
  disableSelection(this.evnt);
  this.x= parseInt(this.bn.left) ||this.bn.pixelLeft||this.evnt.offsetLeft||0; this.y= parseInt(this.bn.top) ||this.bn.pixelTop||this.evnt.offsetTop||0; 
  this.w=this.evnt.offsetWidth ||this.bn.clip.width||
    this.ref.width||this.bn.pixelWidth||0; 
  //alert(this.w);
  this.h=this.evnt.offsetHeight ||this.bn.clip.height||
    this.ref.height||this.bn.pixelHeight||0;
  this.c=0 ;//Clip values;
  if((bw.dom || bw.ie4) && this.bn.clip) {
	  this.c=this.bn.clip; this.c=this.c.slice(5,this.c.length-1); 
	  this.c=this.c.split(' ');
	  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i]); /*alert(this.c[i]);*/}
  }
  //for(var i=0;i<4;i++){alert(this.c[i]);}
  this.ct=this.bn.clip.top||coor[1]||this.c[0]||0; //coor[1]||this.c[0]||0; // 
  this.cr=this.bn.clip.right||this.c[1]||this.w||0;
  this.cb=this.bn.clip.bottom||this.c[2]||this.h||0; 
  this.cl=this.bn.clip.left||coor[0]||this.c[3]||0; //coor[0]||this.c[3]||0; //
  this.obj = obj + "Object"; eval(this.obj + "=this");
  this.evnt.setAttribute('title', 'Double Click to Edit');
  this.evnt.setAttribute('unselectable', 'on');
  if (bw.ie) {
  	this.evnt.ondblclick=function() {deactivateall(num)};
	//this.evnt.onmouseover=function() {dynamicHelp(this.id)};
	//this.evnt.onmouseout=function() {dynamicHelp(this.id)};
  }else if (document.getElementById(obj)){
     document.getElementById(obj).setAttribute('ondblclick', 'deactivateall("' + num + '");');
	 //document.getElementById(obj).setAttribute('onmouseover', 'dynamicHelp(this.id);');
	 //document.getElementById(obj).setAttribute('onmouseout', 'alert(this.id);');
  }else {
  	this.evnt.setAttribute('ondblclick', 'deactivateall("' + num + '");');
	//this.evnt.setAttribute('onmouseover', 'dynamicHelp(this.id);');
	//this.evnt.setAttribute('onmouseout', 'alert(this.id);');
  }
  var containerDiv;
  containerDiv = document.getElementById('container')
  ///containerDiv.appendChild(this.evnt);  // might be needed to make sure that the element is a child of the container may want to do it as an insurance policy
  this.bn.position='absolute';
  //if(this.pp!='img'){
  	this.bn.fontFamily='Arial, Helvetica, sans-serif';this.bn.fontSize='12px';
  //}
  this.bn.zIndex=num;
  this.strZIndex=num;
  if (this.pp=='ul') {
  	with(this.bn){
		overflow='hidden';
		listStyle='none';
		whiteSpace='nowrap';
		//padding='0px';
		//margin='0px';
		width = '0px';
		height = '0px';
	}
	for (var x=0;x<this.evnt.getElementsByTagName("li").length; x++) {
		if (this.evnt.getElementsByTagName("li")[x].style){
			with(this.evnt.getElementsByTagName("li")[x].style){
				listStyleType='none';styleFloat='left';height='0px';marginRight='0px';marginTop='0px';}}}
  }
  // these should be refactored into functions to clarify some things
  //*****************************************************************************************
  /*if (this.width()>z.x2()-z.x()) {
    this.cz(z.x2()-z.x());}
  if (this.height()>z.y2()-z.y()) {
    this.cz(null, z.y2()-z.y());}
  //if the element hasn't been positioned or is positioned outside the boundary
  //move the element inside the boundary
  if (this.left()<z.x()||this.top()<z.y()) {
  	this.ht(z.x(), z.y());}
  if (!this.bn.left || !this.bn.top) {
    this.ht(z.x(), z.y());}
  if (this.left()+this.width()>z.x2()) {
  	var tmpx = z.x2()-this.width();	
  	this.ht(tmpx);}
  if (this.top()+this.height()>z.y2()) {
  	var tmpy = z.y2()-this.height();
  	this.ht(null, tmpy);}*/
  if (this.pp=='div' || this.pp=='span' || this.pp=='bio') {
	  if (this.re()=='') {
		this.writeIt(SampleText(this.pp));
	  }
  }   
  if(this.pp=='k' || this.pp=='a'){this.bn.top='0px';this.bn.left='0px';}
  this.arrBorder=new Array();  
  return this;
};
/* Main Bar Functions */
aa.prototype.ce = function() {
	if (document.getElementById('btn' + this.name)) {
		var btn = document.getElementById('btn' + this.name).style;
		//if (this.pp!='ul') {
			if (this.bn.visibility=='hidden') {
				btn.background='url(inter-graphics/buttonfront.jpg) repeat';
				btn.border = '1px solid #464646';
				btn.marginLeft = '3px';
			} else if (this.activated) {
				//change the buttons to show if it is activated or not
				if (mode=='move'){
					btn.marginLeft = '3px';
					btn.color = 'white';
					btn.backgroundColor=ag;
				}
				if (mode=='edit'){
					btn.backgroundColor=ah;
					btn.marginLeft = '3px';
					btn.color = 'white';
					btn.border = '1px inset #CCCCCC';
				}
			} else {
				btn.color='silver';
				btn.marginLeft = '3px';
				btn.background='';
				btn.backgroundColor='#000000';
				btn.border = '1px inset #CCCCCC';
			}
		//} else {
		//	document.getElementById('btn' + this.name).style.backgroundColor='silver';
		//	document.getElementById('btn' + this.name).style.border = '1px inset #CCCCCC';
		//}
	}return true;
};
/*Editing Functions----Start*/
aa.prototype.toggleActivation = function() {
	if (this.activated==true) {
		this.cu();
	} else {
		this.ho();
	}return true;
};
var border0px = false;var BorderNone = false;
var thiswidth=0;
var thisheight=0;
var currentopacity1;
var currentopacity2;
var currentopacity3;
var currentopacity4;
aa.prototype.ho = function() {
	//checkOpacity(this);
	if (this.activated==false) {
		if(bw.ie&&!window.opera){document.getElementById('container').style.position='';document.getElementById('container').position='';}
	    var mcestr;
		if (mode!='preview') {			
			//cu all other objects
			for (x in wa) {
				if(x!=this.num && wa[x].activated){wa[x].cu();}
			}
			var readonly = false;
			this.activated=true;
			//this.evnt.setAttribute('title', '');
			this.ce();			
			this.strZIndex=this.bn.zIndex;
			// need to change this to the number of objects plus 10 so that if the number goes above 100 then no problems
			this.bn.zIndex=100;  			
			this.ax = this.height() / this.width();
			this.ay = this.width() / this.height();			
			this.strBorder=this.bn.border;
			this.borderwidth = this.bn.borderRightWidth.replace('pt','').replace('px','');
			thiswidth=this.bn.width.replace('px','');
			thisheight=this.bn.height.replace('px','');	
			
			if(this.bn.borderRightStyle == 'none'){BorderNone=true;}
			
			if(this.borderwidth==0){
				border0px=true;
				this.bn.borderWidth=ao + 'px';
				this.bn.borderRightWidth=ao + 'px';
				this.bn.borderLeftWidth=ao + 'px';
				this.bn.borderTopWidth=ao + 'px';
				this.bn.borderBottomWidth=ao + 'px';
			}
			this.borderstyle = this.bn.borderRightStyle;
			//if (this.pp=='div'||this.pp=='span'||this.pp=='folio'||this.pp=='folimg'){this.cx((ao*2), (ao*2))};
			if(this.borderwidth > ao && !BorderNone){ao = this.borderwidth;}else if(this.borderwidth < ao && this.borderstyle != 'none'){ao = this.borderwidth;}
			resizeAmount = parseInt(ao*2);
			//if(this.pp!='b'){this.wa(-ao, -ao);}//else{this.wa(ao, ao);}
			if(this.pp=='div'){
		        if (bw.ie){
    		        if(BorderNone){this.cx(resizeAmount, resizeAmount);}
    		        //if(!BorderNone){this.wa(-ao, -ao);}
		        }else{
    		        //this.wa(-ao, -ao);//}else if (mode=='edit'){this.wa(-ao, -ao);}
    		        if(border0px){this.cx(-resizeAmount, -resizeAmount);}
					//if(BorderNone){this.cx(resizeAmount+1, resizeAmount+1);}
		        }   
		    }else if(this.pp=='span'){
		        if (bw.ie){
					if(border0px){this.cx(-resizeAmount, -resizeAmount);}
					//if(BorderNone&&mode=='edit'){this.cx(resizeAmount, resizeAmount);}
    		        	//this.wa(-ao, -ao);
				}else{
    		        //this.cx(resizeAmount, resizeAmount);
    		        //if(this.bn.borderStyle == 'none'){this.wa(-ao, -ao);}
    		        if(border0px){this.cx(-resizeAmount, -resizeAmount);}
		        }		    
		    }else if(this.pp=='b'){
		        if (bw.ie){
    		       //if(this.bn.borderStyle == 'none'){this.cx(resizeAmount, resizeAmount);}
    		        //this.wa(-ao, -ao);
    		        //if(border0px){this.cx(-resizeAmount, -resizeAmount);}
		        }else{
		            //if(this.bn.borderStyle == 'none'){this.wa(-ao, -ao);}
		            if(border0px||BorderNone){this.cx(-resizeAmount, -resizeAmount);}
    		        //this.cx(resizeAmount, resizeAmount);
		        }		    
		    }else if(this.pp=='rotimg'){
		        if (bw.ie){
    		       //if(this.bn.borderStyle == 'none'){this.cx(resizeAmount, resizeAmount);
    		        //this.wa(-ao, -ao);}
    		        //if(border0px){this.cx(-resizeAmount, -resizeAmount);}
		        }else{
		            //if(this.bn.borderStyle == 'none'){this.wa(-ao, -ao);}
		            if(border0px||BorderNone){this.cx(-resizeAmount, -resizeAmount);}
    		        //this.cx(resizeAmount, resizeAmount);
		        }		    
		    }else if(this.pp=='ul'){
		        currentopacity1=this.bn.opacity;
				currentopacity2=this.bn.MozOpacity;
				currentopacity3=this.bn.KhtmlOpacity;
				currentopacity4='' + this.bn.filter + '';
				if(currentopacity1==0){this.bn.opacity=1;}else if(currentopacity2==0){this.bn.MozOpacity=1;}else if(currentopacity3==0){currentopacity3=this.bn.KhtmlOpacity;}
				if(currentopacity4.indexOf('opacity=0')>0){this.bn.filter='alpha(opacity=100)';}
		        if (bw.ie){
    		        //this.cx(resizeAmount, resizeAmount);
    		        this.wa(-ao, -ao);
    		        
		        }else{
    		        this.wa(-ao, -ao);
    		        if(border0px){this.cx(-resizeAmount, -resizeAmount);}
		        }		    
		    }else if(this.pp=='a'){
		        if (bw.ie){
    		        this.cx(resizeAmount, 0);
    		        this.bn.left=-ao - 1;
		        }else{
		            //this.cx(resizeAmount, resizeAmount);
					if (mode=='move'){this.bn.left=-ao;}else if (mode=='edit'){this.bn.left=-ao;}
		        }
				this.bn.overflow='hidden';
		    }else if(this.pp=='k'){
		        if (bw.ie){
    		        this.cx(0, resizeAmount);
    		        this.bn.top=-ao - 1;
					this.wa(-1, 0);
		        }else{
    		        if (mode=='move'){this.bn.top=-ao;}else if (mode=='edit'){this.bn.top=-ao;}
		        }  
				this.bn.overflow='hidden';
		    }
			if (mode=='edit') {
				//hk(rte, html, width, height, left, top, buttons, readOnly)
				this.evnt.setAttribute('title', 'Choose an option from the pink tool bar above.');
				if (this.pp=='span' || this.pp=='div' || this.pp=='bio') {
					
					rte = 'rte' + this.objname;
					currentRTE = rte;
					//alert(this.bn.fontSize);
					var heightstr = 0;
					var widthstr = 0;
					if(bw.ie){heightstr = (this.bn.height.replace('px','') - (-ao));}else{heightstr = (this.height() - (-ao*2));}
					if(bw.ie){widthstr = (this.bn.width.replace('px','') - (-ao*2));}else{widthstr = (this.bn.width.replace('px','') - (-ao*2));}
					if(bw.ie&&this.pp=='span'){widthstr=widthstr - -4;}
					editor = hk(rte, this.re(), widthstr-ao*3, heightstr, 0,  0, this.bn.fontSize, this.pp, readonly);
					//alert(editor);
					bar = hj(rte, this.pp);
					//var html = this.re();
					toolBar.change(bar);
					//hy();
					//document.write('mcestr');
					//editor='<' + 'iframe border="0" id="' + rte + '" name="' + rte + '" style="font-size:' + this.bn.fontSize + ';z-index:100;display:block;clear:both;width:' + widthstr + ';height:' + heightstr + ';padding:0px;margin:0px;background-color:transparent;z-index: 100;" allowtransparency="true"><' + '/' + 'iframe>';
					//a+='<iframe  id="cp' + rte + '" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>';
					//editor+='<' + 'textarea allowtransparency="true" title="edit your stuff" id="hdn' + rte + '" name="' + rte + '"  style="font-size:' + this.bn.fontSize + ';visibility:hidden;position:absolute;width:0px;height:0px;background-color:transparent;">' + html + '<' + '/' + 'textarea>';
					// sets the width and height of the current object to the cookie for use in sizing the edit text window test box.  
					setCookie('TinyMCE_mce_editor_1_width',parseInt(this.bn.width),365);
					//setCookie('TinyMCE_mce_editor_1_height',parseInt(this.bn.height),365);
					setCookie('height',parseInt(this.bn.height),365);
					//this.bn.visibility="hidden";
					
					/*
					html = this.re();
					var a='';
					//
					//var tmpWid = (this.width()+5), tmpHgh = (this.height());
					//a+='<iframe border="0" id="' + rte + '" name="' + rte + '" style="width:' + tmpWid + 'px;height:' + tmpHgh + 'px;padding:0px;margin:0px;border: none;" contenteditable="true" allowtransparency="true"></iframe>';
					//a+='<iframe  id="cp' + rte + '" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>';
					
					this.writeIt(hk(rte, this.re(), this.width(), this.height(), 1, 1, this.pp, readonly));
					//this.evnt.setAttribute('contenteditable', 'true');
					//var oRTE = frames[rte].document;
					//oRTE.open();
					//oRTE.write(html);
					//oRTE.close();

					//				
					
					this.bn.overflow='';*/
					//alert('editor 2; ' + editor);
					var html = this.re();
					this.writeIt(editor);
					//if (stripHTML(html.toLowerCase())==stripHTML(SampleText(this.pp).toLowerCase())) { html = ''; }
					
					setupRTE(rte);
					enableDesignMode(rte, html, false);
					this.bn.borderStyle = 'solid';
					this.bn.borderWidth = ao ;
					this.bn.borderColor = af;
					this.bn.overflow = 'hidden';
					
					//toolBar.change();
					this.nodragdrop();
				} else {
					currentRTE=this;
					toolBar.change(hj(this.name, this.pp));
					this.bn.borderStyle = 'solid';
					this.bn.borderWidth = ao ;
					this.bn.borderColor = af;
					if (this.pp=='ul') {
						gj();
					}
				}
			} else {
				this.evnt.setAttribute('title', 'Press the left mouse key to move/or resize via lower right corner.');
				toolBar.change(hj(this.name, 'move' + this.pp));
				/*if(!this.bn.borderStyle||this.bn.borderStyle=='none'||this.bn.borderStyle==''){*/this.bn.borderStyle = 'solid';//}
				/*if(!this.bn.borderWidth||this.bn.borderWidth=='0px'||this.bn.borderWidth==''){*/this.bn.borderWidth = ao;//}
				/*if(!this.bn.borderColor||this.bn.borderColor==''||this.bn.borderColor=='none'){*/this.bn.borderColor = ae;//}
				this.dragdrop();
				c(this);
			}
		}
	}
	if(this.pp=='k'||this.pp=='a'){this.bn.overflow = 'hidden';}
	if(this.pp=='ul'){hb();}return true;
};
aa.prototype.cu = function() {
	if (this.activated==true) {
		//changeOpacBack(this);
		//changeOpac(100, this);
		this.nodragdrop();
		this.bn.cursor='pointer';
		this.activated=false;
		//alert(this.id);
		this.bn.zIndex=this.strZIndex;
		this.evnt.setAttribute('title', 'Double Click to Edit');
		this.ce();
		var resizeAmount;
		resizeAmount = -(ao*2);
		//if(this.pp!='b'){this.wa(ao, ao);}//else{this.wa(-ao, -ao);}
		//if (bw.ie){if(this.pp=='text'||this.pp=='title'){this.cx(resizeAmount, resizeAmount);}}
		//if (this.pp=='div'||this.pp=='span'||this.pp=='folio'||this.pp=='folimg') {this.cx(0-((ao*2)), 0-((ao*2)))}
		if (this.pp=='div'){
		    if (bw.ie){
		        //this.cx(resizeAmount, resizeAmount);
		        if(BorderNone){this.cx(-resizeAmount, -resizeAmount);}
		        if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }else{
				//if(BorderNone){this.cx(-resizeAmount, -resizeAmount);}
		        if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }		    
		}else if(this.pp=='span'){
		    if (bw.ie){//alert('');
				//if(this.bn.borderStyle == 'none'){this.cx(resizeAmount, resizeAmount);}
		       		//this.wa(ao, ao);
				if(border0px||BorderNone){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }else{
		        //if(BorderNone){this.cx(-resizeAmount, -resizeAmount);}
		        if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }		    
		}else if(this.pp=='b'){
		    if (bw.ie){
		        //if(this.bn.borderStyle == 'none'){
					//this.cx(resizeAmount, resizeAmount);
		        	//this.wa(ao, ao);
				//}
				if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }else{
		        //if(BorderNone){if (mode=='move'){this.wa(ao - -1, ao - -1);}else{this.wa(ao, ao);}}
		        if(border0px||BorderNone){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		   }		    
		}else if(this.pp=='rotimg'){
		    if (bw.ie){
		        /*if(this.bn.borderStyle == 'none'){
					this.cx(resizeAmount, resizeAmount);
		        	this.wa(ao, ao);
				}*/
				if(border0px||BorderNone){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }else{
		        //if(this.bn.borderStyle == 'none'){if (mode=='move'){this.wa(ao+1, ao+1);}else{this.wa(ao, ao);}}
		        if(border0px||BorderNone){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		   }		    
		}else if(this.pp=='ul'){
		    if(setOpacity){
		        this.bn.opacity=0;
			    this.bn.MozOpacity=0;
			    this.bn.KhtmlOpacity=0;
			    if(bw.ie){this.bn.filter='alpha(opacity=0)';}
			}else{
			    this.bn.opacity=currentopacity1;
			    this.bn.MozOpacity=currentopacity2;
			    this.bn.KhtmlOpacity=currentopacity3;
			    if(bw.ie){this.bn.filter='' + currentopacity4 + '';}
			}
		    if (bw.ie){
		        //this.cx(resizeAmount, resizeAmount);
		        this.wa(ao, ao);
		        if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		    }else{
		        if(border0px){this.bn.width=thiswidth + 'px';this.bn.height=thisheight + 'px';}
		        if (mode=='move'){this.wa(ao+1, ao+1);}else{this.wa(ao, ao);}
		    }		    
		}else if(this.pp=='a'){
		    if (bw.ie){
		        this.cx(resizeAmount, 0);
		        this.bn.left=0;
				this.wa(0, 0);
		    }else{
		        if (mode=='move'){this.bn.left=0;}else{this.bn.left=0;}
		    }		    
			this.bn.overflow='hidden';
		}else if(this.pp=='k'){
		    if (bw.ie){
		      this.cx(0, resizeAmount);
		      this.bn.top=0;
			  this.wa(1, 0);
		    }else{
		        if (mode=='move'){this.bn.top=0;}else{this.bn.top=0;}
		    }	
			this.bn.overflow='hidden';//border-top:3px solid #FFFCEF;border-bottom:3px solid #5F5E59;
		}
		//if(this.pp!='stockimg'&&this.pp!='folimg'){this.wa(ao, ao);}
		//if(bw.ie&&(this.pp=='folimg'||this.pp=='stockimg'||this.pp=='folio')){this.wa(ao, ao);}
		if(this.pp!='k'&&this.pp!='a'){this.bn.overflow = 'auto';}
		ao = 3;
		//this.cx((ao*2), (ao*2));
		//this.wa(ao, ao);
		//if (mode=='move') {
		//	if (this.pp=='div'||this.pp=='span'||this.pp=='folio'||this.pp=='b'||this.pp=='stockimg'||this.pp=='folimg') {
//				if(bw.ie&&(this.pp!='stockimg'||this.pp!='folimg')){
//					this.cx((ao*2), (ao*2));
//				}else{
//					this.cx((ao*2), (ao*2));
//				}
//			}
		//}
		
		if (document.getElementById('hdnrte' + this.objname)) {
			setHiddenVal('rte' + this.objname, this.pp)
		
			var text = document.getElementById('hdnrte' + this.objname).value;
			var re = new RegExp("<p", "g");
			var re2 = new RegExp("</p>", "g");
 			text = text.replace(re,'<div').replace(re2,'</div><br/>');
			this.writeIt(text);
			
			
			/*if (bw.ie) {
				var obj=document.getElementById('rte' + this.name).contentWindow.document.body.style;
				this.bn.backgroundColor = obj.backgroundColor;
				this.bn.padding = obj.padding;
				obj=document.getElementById('rte' + this.name).style;
				this.bn.borderStyle = obj.borderStyle;
				this.bn.borderWidth = obj.borderWidth;
				this.bn.borderColor = obj.borderColor;
			} else {
				text = document.getElementById('rte' + this.name).contentWindow.document.body.style.cssText.toLowerCase();
				this.evnt.setAttribute('style', text);
			}*/		
		}
		toolBar.revert();
	    if (mode=='edit'){
			if (document.getElementById('status').style.color) {
				document.getElementById('status').style.color = ab;
			}
		}else{
			if (document.getElementById('status').style.color) {
				document.getElementById('status').style.color = ac;
			}
		}if (this.arrBorder['borderStyle']) {
			this.bn.borderStyle=this.arrBorder['borderStyle'];
		}else{this.bn.borderStyle = 'none';}
		
		if (this.arrBorder['borderWidth']) {
			this.bn.borderWidth=this.arrBorder['borderWidth'];
		}else{this.bn.borderWidth='6px';}
		if (this.arrBorder['borderColor']) {
			this.bn.borderColor=this.arrBorder['borderColor'];
		}else{this.bn.borderColor = 'black';}
		this.bn.visibility="visible";
		(this.arrBorder['borderWidth']);
		if((aw || ax) && av && !az){this.bn.borderColor='black';this.bn.borderWidth='3px';this.bn.borderStyle='solid';}else if ((aw || ax) && az){this.bn.borderColor=this.arrBorder['borderColor'];}
	}
	if (this.pp=='ul'){hb();}
	if(this.pp=='a'){this.bn.borderBottomWidth='3px';this.bn.borderBottomStyle='solid';this.bn.borderBottomColor='#5F5E59';this.bn.borderTopWidth='3px';this.bn.borderTopStyle='solid';this.bn.borderTopColor='#d5ce9e';}else if(this.pp=='k'){this.bn.borderRightWidth='3px';this.bn.borderRightStyle='solid';this.bn.borderRightColor='#5F5E59';this.bn.borderLeftWidth='3px';this.bn.borderLeftStyle='solid';this.bn.borderLeftColor='#d5ce9e';}
	var x=0;for(x in wa){if(wa[x].pp=='a'){zz(wa[x]);}}
	return true;
};
function setCookie(NameOfCookie, value, expiredays) {
    var ExpireDate = new Date ();
    ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
    document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()); persist = true;
    return true;
};
var buttonArray = new Array();  
function getHiddenButtons(){
	buttonArray.splice(0,buttonArray.length);
	var buttonCount;
	buttonCount = 0;
	var ulButtonsLength = document.getElementById('ulButtons').getElementsByTagName('li').length;
	var G=document.getElementById('ulButtons').getElementsByTagName('li');
	for (var x=0; x<ulButtonsLength; x++){
		//(G[x].style.display);
		if 	(G[x].style.display!='none') {
			buttonArray.push(x);
		}
	}
	return buttonArray.length;
};function hb(){
	var a=0;
	var b = new RegExp('/px\b\s*[0-9,a-z]*/', 'g')
	var G=document.getElementById('ulButtons').getElementsByTagName('li');
	var A=document.getElementById('ulButtons').getElementsByTagName('a');
	var c = document.getElementById('ulButtons').style['width'].replace('px','').toString();
	var d = document.getElementById('ulButtons').style['height'].replace('px','').toString();
	var e = getHiddenButtons();
	if (G[0].style.height.replace('px','')==0){for (a; a<e; a++){G[buttonArray[a]].style['height']=A[buttonArray[a]].style['height'];}}
	var ho = G[0].style['width'].replace('px','') - (-G[0].style['borderWidth'].replace(/px\s*[0-9]*\s*/,'').replace(/[0-9,a-z]*\s/,'').replace(b,'')*4) ;
	var wa = G[0].style['height'].replace('px','') - (-G[0].style['borderWidth'].replace(/px[0-9,a-z]*\s/,'').replace(/[0-9,a-z]*\s/,'').replace(b,'')*4);
	var hb = e * ho;
	var pp;var cu;var tempCSS;
	if (hb < c) {
		if (e > 2){
			a=0;
			for (a; a<e; a++){
				if (a == e-1){	pp = 0;
					cu = 0;
					if (pp < 0) {
						pp = 0;
					}
					if (cu < 0){
						cu = 0;	
					}
					G[buttonArray[a]].style['marginRight'] =  '0px'; //pp.toString();
					G[buttonArray[a]].style['marginTop'] =  cu.toString()+ 'px';
				}else if (a != e-1){
					cu = 0;
					if (pp < 0) {
						pp = 0;
					}
					if (cu < 0){
						cu = 0;	
					}
					pp = ((c - buttonArray.length) - ho * e) / (e - 1);
					if (pp > 2) {
						pp = pp - 2;
					}
					if(a == e-1){
						G[buttonArray[a]].style['marginRight'] =  '0px';
					}else{
						G[buttonArray[a]].style['marginRight'] =  pp.toString() + 'px';
					}
					G[buttonArray[a]].style['marginTop'] =  '0px';
				}
			}
		}else if (e == 1){
			for (a=0; a>e; a++){
				if (G[buttonArray[a]].style['display'] != 'none'){
					pp = 0;
					cu = 0;
					if (pp < 0) {
						pp = 0;
					}
					if (cu < 0){
						cu = 0;	
					}
					G[buttonArray[a]].style['marginRight'] =  '0px';
					G[buttonArray[a]].style['marginTop'] =  '0px'; 
				}
			}
		}else if (e == 2){
			pp = c - (2 * ho) - 15;
			G[buttonArray[0]].style['marginRight'] =  pp.toString() + 'px';	
			G[buttonArray[1]].style['marginRight'] =  '0px';
			G[buttonArray[1]].style['marginTop'] =  '0px';
			G[buttonArray[0]].style['marginTop'] =  '0px';
		}
	}
	if (hb > c) {
		var buttonsTopRow = Math.floor(c/ho);
		var buttonRows = Math.ceil(e/buttonsTopRow);
		if (buttonsTopRow == 1){
			for (a=0; a<e; a++){
				if(buttonArray[a] == buttonArray[0]){
					cu = 0;
					pp = 0;
					if (pp < 0) {
						pp = 0;
					}
					if (cu < 0){
						cu = 0;	
					}
					G[buttonArray[a]].style['marginRight'] =  pp + 'px'; 
					G[buttonArray[a]].style['marginTop'] =  cu + 'px';
				}else if(buttonArray[a] != buttonArray[0]){
					pp = 0;
					cu = (d - wa * buttonRows) / (buttonRows - 1);
					if (parseInt(pp) < 0) {
						pp = 0;
					}
					if(bw.ie){if(buttonRows==2){cu = cu - 6;}else{cu = cu - 4;}}else{cu = cu - 1;}
					var checkMarginTop = cu * (buttonRows - 1) + wa * buttonRows;
					if(checkMarginTop >= d){cu = cu - ((checkMarginTop - d)/(buttonRows - 1))}
					if (parseInt(cu) < 0){
						cu = 0;	
					}
					
					G[buttonArray[a]].style['marginRight'] =  pp.toString() + 'px'; 
					if (a > buttonsTopRow-1){
						G[buttonArray[a]].style['marginTop'] =  cu.toString() + 'px';
					}else{G[buttonArray[a]].style['marginTop'] =  '0px';}
				}
			}
		}else if (buttonsTopRow > 1){
			for (a=0; a<e; a++){
				cu = 0;
				pp = 0;
				pp = ((c - buttonArray.length) - ho * buttonsTopRow) / buttonsTopRow;
				if (pp > (pp/buttonsTopRow)){
					pp = pp - 2;
				}
				if (pp < 0) {
					pp = 0;
				}
				cu = (d - wa * buttonRows) / (buttonRows -1);
				if(bw.ie){cu = cu - 3;}else{cu = cu - 1;}
				if (cu < 0){
						cu = 0;	
				}
				
					G[buttonArray[a]].style['marginRight'] =  pp + 'px'; 
			  if (a > buttonsTopRow-1){
					G[buttonArray[a]].style['marginTop'] =  cu.toString() + 'px';
				 }else{
				   G[buttonArray[a]].style['marginTop'] =  '0px';
			   }
			}
		}
	}return true;
};
function deactivateall(a) {
	var x;
	var name = 'd';
	if (a != null) {
	    setCookie(name,a,365);
		setCookie('color',wa[a].bn.backgroundColor,365);
		setCookie('modevalue',mode,365);
		setCookie('ba',ba,365);	
	}
	for (x in wa) {
		if (x!=a) wa[x].cu();
	}
	if (a!=null) wa[a].ho();
	hb();return true;
};
aa.prototype.moveForwardBy = function(a) {
	this.strZIndex=(this.strZIndex-0)- (-a);
	this.bn.zIndex=(this.bn.zIndex-0)- (-a);return true;
};
aa.prototype.moveBackwardBy = function(a) {
	this.strZIndex-=a;
	this.bn.zIndex-=a;return true;
};
aa.prototype.moveToFront = function() {	
	var currentZ = this.strZIndex;
	var largest=0;
	var iZ=currentZ;
	for (x=0;x<=wa.length-1;x++) {
		tmpZ=parseInt(wa[x].strZIndex)-0;
		if (largest<tmpZ && tmpZ<1000) {
			largest=tmpZ;
		}
		if (wa[x].strZIndex > currentZ) {
			iZ = wa[x].bn.zIndex;
			wa[x].strZIndex=iZ-1;
			wa[x].bn.zIndex=iZ-1;
		}
	}
	this.bn.zIndex=largest;
	this.strZIndex=largest;
};
aa.prototype.moveToBack = function() {
	var currentZ = this.strZIndex;
	var smallest=0;
	var iZ=currentZ;
	for (x=0;x<=wa.length-1;x++) {
		tmpZ=parseInt(wa[x].strZIndex)-0;
		if (smallest>tmpZ && tmpZ>-1) {
			smallest=tmpZ;
		}
		if (wa[x].strZIndex < currentZ) {
			iZ = wa[x].bn.zIndex;
			wa[x].strZIndex=iZ+1;
			wa[x].bn.zIndex=iZ+1;
		}
	}
	this.bn.zIndex=smallest;
	this.strZIndex=smallest;
};
function GetIndex() {
	var a='';
	for (var x=0; x<wa.length; x++) {
		a += 'wa[' + wa[x].num + ']=' + wa[wa[x].num].bn.zIndex + '\n';
	}
	return a;
};
aa.prototype.ht = function(x,y){
  if (x) {this.x=x; if (this.bn){this.bn.left=x;}}
  if (y) {this.y=y; if (this.bn){this.bn.top=y;}}
};
aa.prototype.wa = function(x,y){
  var oldx = this.x;
  var oldy = this.y;
  if (x) {this.bn.left=oldx+=x;}
  if (y) {this.bn.top=oldy+=y;}
};
aa.prototype.hs = function(x, name){
	if (this.pp!='ul'&&this.pp!='folio'&&this.pp!='stock') {
		if (this.bn.visibility=='visible'||!this.bn.visibility) {
			this.a();
		} else {
			setTimeout('deactivateall(getCookie(\'d\'));',250);
			if (getCookie('d')){wa[getCookie('d')].bn.cursor = 'move'}
			this.moveToBack(x);
			this.moveToFront(x);
			if (getCookie('d')){wa[getCookie('d')].top();}
			this.b(x);
		}
		this.ce();
	}
};
aa.prototype._setOpaRel = function(d_x, d_kd, d_y, d_o){
	if(this.bn && (this.diaphan || d_kd))
	{
		d_y = this.opacity*d_x;
		if(typeof this.bn.MozOpacity != dd_u) this.bn.MozOpacity = d_y;
		else if(typeof this.bn.filter != dd_u)
			this.bn.filter = "Alpha(opacity="+parseInt(100*d_y)+")";
		else this.bn.opacity = d_y;
		for(var d_i = this.children.length; d_i;)
			if(!(d_o = this.children[--d_i]).detached) d_o._setOpaRel(d_x, 1);
	}
};
aa.prototype.b = function(){
	this.bn.visibility='visible';
	this.bn.display='inline';
};
aa.prototype.a = function(){
	this.bn.visibility='hidden';
	this.bn.display='block';
	this.cu();
};
aa.prototype.writeIt = function(text,startHTML,endHTML){
	var re = new RegExp("<p>", "g");
	var re2 = new RegExp("</p>", "g");
	this.evnt.innerHTML=text;
};
aa.prototype.re = function(){
	text = this.evnt.innerHTML;
	return text;
};
aa.prototype.left = function() {
	var coors = findPos(this.evnt);
	this.x=this.evnt.offsetLeft||this.bn.clip.left||0;
	return this.x;
};
aa.prototype.top = function() {
	var coors = findPos(this.evnt);
	this.y=this.evnt.offsetTop||this.bn.clip.top||0;
	return this.y;
};
aa.prototype.width = function() {
	this.w = this.evnt.offsetWidth||this.bn.clip.width||this.ref.width||this.bn.pixelWidth||0;
	return this.w;
};
aa.prototype.height = function() {
	this.h=this.evnt.offsetHeight||this.bn.clip.height||this.ref.height||this.bn.pixelHeight||0;
	return this.h;
};
aa.prototype.cz = function(r,b,setwidth){
	  if (r>0) {this.bn.width=r;}
	  if (b>0) {this.bn.height=b;}
	  if (this.pp == 'ul'){
		hb();
	  }return true;
};
aa.prototype.cx = function(r,b,setwidth){
  var h=this.height();
  var w=this.width();
  if (r) {this.bn.width=(w - -r);}
  if (b) {this.bn.height=(h - -b);}
  if (this.pp == 'ul'){
	hb();
 }return true;
};
aa.prototype.clipTo = function(t,r,b,l,setwidth){ 
  this.ct=t; this.cr=r; this.cb=b; this.cl=l
  if(bw.ns4){
    this.bn.clip.top=t;this.bn.clip.right=r;
    this.bn.clip.bottom=b;this.bn.clip.left=l;
  }else{
    if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0;
    this.bn.clip='rect('+t+','+r+','+b+','+l+')';
    if(setwidth){this.bn.pixelWidth=this.bn.width=r; 
    this.bn.pixelHeight=this.bn.height=b}
  }
  if (this.pp == 'ul'){
	hb();
  }return true;
};
aa.prototype.clipBy = function(t,r,b,l,setwidth){ 
  this.clipTo(this.ct+t,this.cr+r,this.cb+b,this.cl+l,setwidth)
  if (this.pp == 'ul'){
	hb();
  }return true;
};
aa.prototype.clipIt = function(t,r,b,l,step,fn,wh){
  tstep=Math.max(Math.max(Math.abs((t-this.ct)/step),Math.abs((r-this.cr)/step)),
    Math.max(Math.abs((b-this.cb)/step),Math.abs((l-this.cl)/step)))
  if(!this.clipactive){
    this.clipactive=true; if(!wh) wh=0; if(!fn) fn=0
    this.clip(t,r,b,l,(t-this.ct)/tstep,(r-this.cr)/tstep,
      (b-this.cb)/tstep,(l-this.cl)/tstep,tstep,0, fn,wh)
  }return true;
};
aa.prototype.clip = function(t,r,b,l,ts,rs,bs,ls,tstep,astep,fn,wh){
  if(astep<tstep){
    if(wh) eval(wh); 
    astep++;
    this.clipBy(ts,rs,bs,ls,1);
    setTimeout(this.obj+".clip('+t+','+r+','+b+','+l+','+ts+','+rs+','+bs+','+ls+','+tstep+','+astep+',''+fn+'',''+wh+'')",50)
  }else{
    this.clipactive=false; this.clipTo(t,r,b,l,1);
    if(fn) eval(fn)
  }return true;
}; 
aa.prototype.slideIt = function(endx,endy,inc,speed,fn,wh){
  if(!this.slideactive){
    var distx = endx - this.x;
    var disty = endy - this.y
    var num = Math.sqrt(Math.pow(distx,2)+Math.pow(disty,2))/inc
    var dx = distx/num; var dy = disty/num
    this.slideactive = 1; 
    if(!wh) wh=0; if(!fn) fn=0
    this.slide(dx,dy,endx,endy,speed,fn,wh)
    }return true;
};
aa.prototype.slide = function(dx,dy,endx,endy,speed,fn,wh) {
  if(this.slideactive&&
  (Math.floor(Math.abs(dx))<Math.floor(Math.abs(endx-this.x))|| 
    Math.floor(Math.abs(dy))<Math.floor(Math.abs(endy-this.y)))){
    this.wa(dx,dy); 
    if(wh) eval(wh)
    setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+speed+",'"
    +fn+"','"+wh+"')",speed)
  }else{
    this.slideactive = 0; 
    this.ht(endx,endy);
    if(fn) eval(fn)
  }return true;
};
function getCookie(NameOfCookie){
		if (document.cookie.length > 0) {              
	 begin = document.cookie.indexOf(NameOfCookie+"=");       

		if (begin != -1) {           
		begin += NameOfCookie.length+1;       
		 end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
				 return unescape(
			document.cookie.substring(begin, end));
			} 
	}
	return null;
};
function update_xywh(b) {
	//alert(b.id);
	if (b) {
		var bTop = (b.top()- -ao);
		var bLeft = (b.left()- -ao);
		if(document.getElementById('elmx')){document.getElementById('elmx').value=(b.left()- -ao*2) + 'px';}
		if(document.getElementById('elmy')){document.getElementById('elmy').value=(b.top()- -ao*2) + 'px';}  //b.top()-z.y();
		if(document.getElementById('elmh')){document.getElementById('elmh').value=b.height() + 'px';}
		if(document.getElementById('elmw')){document.getElementById('elmw').value=b.width() + 'px';}
		var objectMoved = getCookie('rtevalue');
		if (b.pp=='ul') {
			hb();
		}
	}
	return [bTop,bLeft];
}
function lib_dd(){
	dd_is_active=1
	if(bw.ns4){
		document.captureEvents(Event.MOUSEMOVE|Event.MOUSEDOWN|Event.MOUSEUP)
	}
	document.onmousedown=a;
	document.onmousemove=lib_dd_move;
	document.onmouseup=rx;
	document.onkeyup = d;
	return true;
}
aa.prototype.dragdrop = function(v){
	if(!dd_is_active) lib_dd();
	if (getCookie('d')){update_xywh(wa[getCookie('d')]);}
	this.evnt.onmouseover=new Function("c("+this.obj+")");
	this.evnt.onmouseout=new Function("b=0;dd_oobj=0;");
	if(v){ this.ddobj=v;}
	return true;
};
aa.prototype.nodragdrop = function(){	
  this.evnt.onmouseover=""; 
  this.evnt.onmouseout="";
  dd_obj=0; b=0; dd_oobj=0;
  return true;
};
window.document.onkeydown = d; 

function d(e) {
	var x2;
	var elm; for (x2 in wa) {if (wa[x2].activated) elm=wa[x2];}
	var key = (window.event) ? event.keyCode : e.keyCode; 
	var objNumber = ''
	if(getCookie('d')){objNumber = getCookie('d');}
	var x;var y;
	var possible=false;
	switch (key) {
		  case 27: deactivateall(); break;
		  case 37: x=-1; y=0; if(checkXY('left',possible)){elm.wa(x,y);update_xywh(elm);}break;
		  case 38: x=0; y=-1; if(checkXY('up',possible)){elm.wa(x,y);update_xywh(elm);}break;
		  case 39: x=1; y=0; if(checkXY('right',possible)){elm.wa(x,y);}break;
		  case 40: x=0; y=1; if(checkXY('down',possible)){elm.wa(x,y);}break;
	}
	return true;
};
function checkXY(direction,possible){
	var x;var y;
	switch (direction) {
		case 'up': if (getCookie('d')){if (wa[getCookie('d')].bn.top.replace('px','')>-1){possible=true;}} break;
		case 'down': if (getCookie('d')){if ((wa[getCookie('d')].bn.top.replace('px','') - (-wa[getCookie('d')].bn.height.replace('px','') - 0)<parseInt(document.getElementById('container').style.height))){possible=true;}} break;
		case 'left': if (getCookie('d')){if (wa[getCookie('d')].bn.left.replace('px','')>-1){possible=true;}} break;
		case 'right': if (getCookie('d')){if ((parseInt(wa[getCookie('d')].bn.left) - (-parseInt(wa[getCookie('d')].bn.width) - 20)<parseInt(document.getElementById('container').style.width))){possible=true;}} break;
	}
	return possible;
};
function c(rx){b=rx;return true;};
var opac2 = 0;
var mozopac = 0;
var khtmlopac = 0;
var filteropac = 0;
var origOpac = true;
var opacCheck = false;
function changeOpac(opac, id) {
	if (id.bn){
		var object = id.bn; 
		if(origOpac && !opacCheck){
			//alert('i am in use ' + origOpac);
			if(object.opacity!='' && object.opacity!=null){opac2 = object.opacity;}else{opac = 100;}
			if(object.MozOpacity!='' && object.MozOpacity!=null){mozopac = object.MozOpacity;}else{mozopac = 100;}
			if(object.KhtmlOpacity!='' && object.KhtmlOpacity!=null){khtmlopac = object.KhtmlOpacity;}else{khtmlopac = 100;}
			if(object.filter!='' && object.filter!=null){filteropac = object.filter;}else{filteropac = 100;}
			origOpac = false;
		}	
		object.opacity = (opac / 100);
		object.MozOpacity = (opac / 100);
		object.KhtmlOpacity = (opac / 100);
		object.filter = "alpha(opacity=" + opac + ")";
	}return true;
};
function checkOpacity(id){
	if (id.bn){
		var object = id.bn;
		if(object.opacity < .60){opacCheck=true;}
		if(object.MozOpacity < .60){opacCheck=true;}
		if(object.KhtmlOpacity < .60){opacCheck=true;}
		if(bw.ie){if(object.filter.replace('alpha(opacity=', '').replace(')', '') < 60){opacCheck=true;}}
		if(origOpac && opacCheck){
			if(object.opacity!='' && object.opacity!=null){opac2 = object.opacity;}else{opac = 100;}
			if(object.MozOpacity!='' && object.MozOpacity!=null){mozopac = object.MozOpacity;}else{mozopac = 100;}
			if(object.KhtmlOpacity!='' && object.KhtmlOpacity!=null){khtmlopac = object.KhtmlOpacity;}else{khtmlopac = 100;}
			if(bw.ie){if(object.filter!='' && object.filter!=null){filteropac = object.filter;}else{filteropac = 100;}}
			origOpac = false;
		}	 
		if(object.opacity < .60){object.opacity = (60 / 100);opacCheck=true;}
		if(object.MozOpacity < .60){object.MozOpacity = (60 / 100);opacCheck=true;}
		if(object.KhtmlOpacity < .60){object.KhtmlOpacity = (60 / 100);opacCheck=true;}
		if(bw.ie){if(object.filter.replace('alpha(opacity=', '').replace(')', '') < 60){object.filter = "alpha(opacity=" + 60 + ")";opacCheck=true;}}		
	}return true;
};
function changeOpacBack(id) {
	if (id.bn){
		var object = id.bn;
		if(!origOpac){
			object.opacity = (opac2);
			object.MozOpacity = (mozopac);
			object.KhtmlOpacity = (khtmlopac);
			object.filter = filteropac;
		}
	}
	origOpac = true;return true;
};
function changeOpacUL(opac, id, command){
	setOpacity = opac;
	if(!setOpacity){
		if(id.pp=='ul' && command=='color'){
			if (id.bn){
				var object = id.bn;
				if (object.filter == "alpha(opacity=0)" || object.opacity == 0){
					object.opacity = (100 / 100);
					object.MozOpacity = (100 / 100);
					object.KhtmlOpacity = (100 / 100);
					object.filter = "";
					opac2 = 1;
					mozopac = 1;
					khtmlopac = 1;
					filteropac = "";
					currentopacity1=1;
					currentopacity2=1;
					currentopacity3=1;
					currentopacity4= "";
				}
			}
		}
	}else{
		if(id.pp=='ul' && command=='color'){
			if (id.bn){
				var object = id.bn;
				object.opacity = (0 / 100);
				object.MozOpacity = (0 / 100);
				object.KhtmlOpacity = (0 / 100);
				object.filter = "alpha(opacity=0)";
				opac2 = 0;
				mozopac = 0;
				khtmlopac = 0;
				filteropac = 0;
				currentopacity1=0;
				currentopacity2=0;
				currentopacity3=0;
				currentopacity4= "alpha(opacity=0)";
			}
		}
	}return true;
};
function rx(e){dd_obj=0; 
	if(b.activated && b.movRez>0 && b.pp!='ul'){b.bn.overflow='auto';if(b.pp=='k'||b.pp=='a'){b.bn.overflow = 'hidden';}/*if(bw.ie&&b.pp=='a'){b.bn.left='0px'}if(bw.ie&&b.pp=='k'){b.bn.top='0px'}*/}
};
function a(e){ 
  if(b){
  	if(b.activated){b.bn.overflow='hidden';}
	if(b.pp=='k'||b.pp=='a'){b.bn.overflow = 'hidden';}
    x=(bw.ns4 || bw.ns6)?e.pageX:event.x||event.clientX;
    y=(bw.ns4 || bw.ns6)?e.pageY:event.y||event.clientY;
	dd_obj=b;
    dd_obj.clX=x-dd_obj.x; 
    dd_obj.clY=y-dd_obj.y;
	b_border = ao;
	tmpX = (x-z.x()-b.left()-ao);
	tmpY = (y-z.y()-b.top()-ao);
	b_end_height = b.height()-20;
	b_end_width= b.width()-20;
	if (tmpX > (b_end_width) && tmpY > (b_end_height)) {
		if(dd_obj.pp!='a'&&dd_obj.pp!='k'&&dd_obj.pp!='rotimg'){dd_obj.movRez=2;}
		if(dd_obj.pp=='k'||dd_obj.pp=='a'){dd_obj.bn.overflow = 'hidden';}
	} else {
		dd_obj.movRez=1;
	}
  } else if (dd_oobj==0) {
  	deactivateall();	
  }return true;
};
function lib_dd_move(e,y,rresize){ 
	var x=(bw.fb || bw.fx || bw.ns4 || bw.ns6)?e.pageX:event.clientX;
	var y=(bw.fb || bw.fx || bw.ns4 || bw.ns6)?e.pageY:event.clientY;
	var s=(bw.fb || bw.fx || bw.ns4 || bw.ns6)?e.shiftKey:event.shiftKey;
	if(b){	
	tmpX = (x-z.x()-b.left()-ao);
	tmpY = (y-z.y()-b.top()-ao);
	b_end_height = b.height()-20;
	b_end_width= b.width()-20;
	if (!dd_obj) {
		if ((tmpX > b_end_width) && (tmpY > b_end_height)) {
			if(dd_obj.pp!='a'&&dd_obj.pp!='k'&&dd_obj.pp!='rotimg'){b.bn.cursor='se-resize';}
			if(dd_obj.pp=='k'||dd_obj.pp=='a'){b.bn.cursor='move';}
		} else {
			b.bn.cursor='move';
			if(dd_obj.pp=='k'||dd_obj.pp=='a'){dd_obj.bn.overflow = 'hidden';}			
		}
	}
	update_xywh(b);
	}
	if(dd_obj){
	if (dd_obj.movRez==1) { 
		if(dd_obj.pp=='k'||dd_obj.pp=='a'){dd_obj.bn.overflow = 'hidden';}
		nx=x-dd_obj.clX; ny=y-dd_obj.clY
		if (ny>=z.height()-dd_obj.height()+ao*2){ny=z.height()-dd_obj.height()+ao*2-2;}
		if (nx>=z.width()-dd_obj.width()+ao*2){nx=z.width()-dd_obj.width()+ao*2-2;}
		if (ny<=-ao){ny=-ao +1;}
		if (nx<=-ao){nx=-ao +1;}
		if(dd_obj.ddobj) { dd_obj.ddobj.ht(nx,ny);update_xywh(b);}
		else {dd_obj.ht(nx,ny);update_xywh(b);}
	
	} else if (dd_obj.movRez==2) {
		if(dd_obj.pp=='k'||dd_obj.pp=='a'){dd_obj.bn.overflow = 'hidden';}
		if(dd_obj.pp!='a'&&dd_obj.pp!='k'){
			update_xywh(b);
			if (bw.ie){
				rx=(x-z.x()-dd_obj.left());
			}else{
				document.getElementById('container').style.position='absolute';
				var containerCoords = findPos(document.getElementById('container'));
				document.getElementById('container').style.position='relative';
				rx=(x-z.x()-dd_obj.left()-containerCoords[0]+10);
			}
			ry=(y-z.y()-dd_obj.top());
			if (rx >= (z.width()-dd_obj.left())){
				rx = z.width()-dd_obj.left() - ao -7+containerCoords[0];
				if (!bw.ie){document.getElementById('container').style.position='absolute';
				var containerCoords = findPos(document.getElementById('container'));
				document.getElementById('container').style.position='relative';rx = rx - containerCoords[0] + 10;}
				//}
			}else if (rx <= dd_obj.bn.minWidth){
				rx = dd_obj.bn.minWidth.replace('px','') + 1;
			}
			if(dd_obj.bn.minWidth){if (rx <= dd_obj.bn.minWidth.replace('px', '')){rx=dd_obj.bn.minWidth.replace('px', '') - -2;}}
			if(dd_obj.bn.minHeight){if (ry <= dd_obj.bn.minHeight.replace('px', '')){ry=dd_obj.bn.minHeight.replace('px', '') - -2;}}
			if (ry >= (z.height() - dd_obj.top())){
				ry = z.height() - dd_obj.top() - ao -7;	
			}
			
			if (ry+dd_obj.top()>=z.y2()){ry=z.y2()-dd_obj.top()-10;}
			if (rx+dd_obj.left()>=z.x2()){rx=z.x2()-dd_obj.left();}
			if (s==true) {
				var arx = ry*dd_obj.ay;
				var ary = rx*dd_obj.ax;
				if (ary > arx) rx=arx;
				else if (arx > ary) ry=ary;
			}
			if(dd_obj.ddobj) dd_obj.ddobj.cz(rx,ry,true);
			else dd_obj.cz(rx,ry,true);
			if(dd_obj.pp=='ul'){
				hb();
			}
		}
	} 
	thiswidth=dd_obj.bn.width.replace('px','');
	thisheight=dd_obj.bn.height.replace('px','');
	}
	if(!bw.ns4) return false;      
};
var resumeFunc = function() {
	if (bw.mac) return true;
};
function pauseOnMacOS() {
  return true;
};
function SampleText(type) {
	var innerText;
	if (type=='div') {
		innerText = "<font size=\"2\ face=\"arial,helvetica,sans-serif\" color=\"#c0c0c0\">This is a sample text block.  Use this type of block to enter big areas of text.  Scroll bars are automatically added to this block if the amount of text will not fit in the box.  When in move mode, this block can be moved and resized by placing your cursor in the lower right hand corner of this element. To change the text in this block, switch the editor to edit mode. Click the advanced text editing feature to change color, size, font and formatting of your text</font>";
		return innerText;
	} else if (type=='span') {
		innerText = "<font size=\"5\" face=\"arial,helvetica,sans-serif\" color=\"#c0c0c0\"><strong>This is a sample text title block.</strong></font>";
		return innerText;
	}
	return null;	
};
function initRTE(imgPath, incPath, css, genXHTML) {
	var ua = navigator.userAgent.toLowerCase();
	bw.ie = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); 
	isGecko = (ua.indexOf("gecko") != -1);
	isSafari = (ua.indexOf("safari") != -1);
	isKonqueror = (ua.indexOf("konqueror") != -1);
	
	ay = genXHTML;
	if (document.getElementById && document.designMode && !isSafari && !isKonqueror) {
		aq = true;
	}	
	if (bw.ie) {
		document.onmouseover = raiseButton;
		document.onmouseout  = normalButton;
		document.onmousedown = lowerButton;
		document.onmouseup   = raiseButton;
	}
	ap = imgPath;
	includesPath = incPath;
	cssFile = css;return true;
};
function hk(rte, html, width, height, left, top, textSize, type, readOnly) {
	var a='';
	if (aq) {
		if (allRTEs.length > 0) allRTEs += ";";
		allRTEs += rte;
		if (bw.ie) {
		} else {
		}
		var re = new RegExp("<p", "g");
		var re2 = new RegExp("</p>", "g");
 		html = html.replace(re,'<div').replace(re2,'</div><br/>');
		top='0';
		left='0';
		if(!bw.ie){top='-10';left='-10';width = width + 5;}
		a+='<iframe onclick="checkText(this);" style="width:' + width + 'px;height:' + height + 'px;" allowtransparency="true" backgroundcolor="undefined" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" border="0" id="' + rte + '" name="' + rte + '" frameborder="0" height="' + height + '" width="' + width + '"></iframe>';
		a+='<textarea allowtransparency="true" id="hdn' + rte + '" name="' + rte + '"  readonly="true" style="visibility:hidden;position:absolute;width:' + width + 'px;height:' + height + 'px;top:' + top + 'px;left:' + left + 'px;background-color:transparent;">' + html + '</textarea>';
} else {
		if (buttons == true) {
			a+=hj(rte);
		}		
		a+='<textarea title="edit your stuff3" allowtransparency="true" name="' + rte + '" id="' + rte + '"';
		if (readOnly) {
			a+=' readonly ';
		}
		a+=' style="';
		a+='width: ' + width + 'px; height: ' + height + 'px;font-size:' + textSize + ';line-height:100%;background-color: transparent;';
		if (top && left) {
			a+='position: absolute; top: ' + top + 'px; left: ' + left + 'px;';
		}
		a+='" ';
		a+='>' + html + '</textarea>';
	}
	return a;
};
function setupRTE(rte, width) {
	try {
		document.getElementById(rte).contentWindow.document.body.style.margin="0px";
		document.getElementById(rte).contentWindow.document.body.style.padding="0px";
		document.getElementById(rte).contentWindow.document.body.style.backgroundColor="transparent";
		document.getElementById(rte).contentWindow.document.body.style.border="none";
		document.getElementById(rte).style.margin="0px";
		document.getElementById(rte).style.padding="0px";
		document.getElementById(rte).style.backgroundColor="transparent";
		document.getElementById(rte).focus();
	} catch(e) {
		setTimeout("setupRTE('" + rte + "');", 10);
	}return true;
};
function newEditingWindow(){
	if(getCookie('d')){setCookie('color',wa[getCookie('d')].bn.backgroundColor,365);}
	if(bw.ie){if (getCookie('d')){wa[getCookie('d')].cu();}} 
	win=window.open('advancededitor.html?color=','advancedEditor','resizable,scrollbars,width=770,height=480');
	win.focus();
	setTimeout('wa[getCookie(\'d\')].cu();', 500); 
	setCookie('ba',ba,365);
	setCookie('modevalue',mode,365);return true;
};
var strEditButton = '';
function editButton(){
	var Page = Request.QueryString("page");
    if (Page == "contact"||Page == "Contact") {
		strEditButton = "Edit Contact Information";
	}else if (Page == "links"||Page == "Links") {
		strEditButton = "Edit Link";
	}
	return true;
};
editButton();
function editPage(){
	var Page = Request.QueryString("page");
    var strEditPage = '';
	if (Page == "contact"||Page == "Contact"){
		strEditPage = "popUp('../member/xeditContact.asp', 650, 600);";
	}else if (Page == "links"||Page == "Links") {
		strEditPage = "popUp('../member/ivfolio/xeditLinks.asp', 450, 700);";
	}
	return strEditPage;
};
function editID(){
	var Page = Request.QueryString("page");
    var strEditID = '';
	if (Page == "contact"){
		strEditID = "editContactInfo";
	}else if (Page == "links") {
		strEditID = "editLinks";
  	}
	return strEditID;
};
streditButton = '<span style="margin-top:6px;padding-right:none;margin-left:25px;cursor:pointer;" id="';
streditButton += editID(); 
streditButton += '"><a class="style2" href="#" onClick="';
streditButton += editPage();
streditButton += ';">'; 
streditButton += strEditButton; 
streditButton += '</a></span>';
var strEditButton2 = '';
function editButton2(){
	var Page = Request.QueryString("page");
    if (Page == "portfolio"||Page == "Portfolio") {
		strEditButton2 = "&nbsp;Edit Current Folio Image&nbsp;";
	}else if (Page == "stock"||Page == "Stock") {
		strEditButton2 = "&nbsp;Edit Stock Images&nbsp;";
	}else if (Page == "catalog"||Page == "Catalog") {
		strEditButton2 = "&nbsp;Edit Catalog Images&nbsp;";
	}return true;
};
editButton2();
function editID2(){
   var Page = Request.QueryString("page");
    var strEditID = '';
	if (Page == "portfolio"||Page == "Portfolio"){
		strEditID = "editFolioImage";
	}else if (Page == "stock"||Page == "Stock") {
		strEditID = "editStockImages";
	}else if (Page == "catalog"||Page == "Catalog") {
		strEditID = "editStockImages";
	}
	return strEditID;
};
function editPage2(){
    var strEditPage = '';
	var Page = Request.QueryString("page");
	if (Page == "portfolio"||Page == "Portfolio"){
		strEditPage = "editFolioImage(imgID, imgSRC);";
	}else if (Page == "stock"||Page == "Stock") {
		strEditPage = "popUp('http://www.ivwebsites.com/scripts/ivstock/xsearch.asp?terms=id: ' + ID + '', 850, 800)";
	}else if (Page == "catalog"||Page == "Catalog") {
		strEditPage = "popUp('http://www.ivwebsites.com/scripts/ivstock/xsearch.asp?terms=id: ' + ID + '', 850, 800)";
	}
	return strEditPage;
};
streditButton2 = '<span style="margin-top:6px;padding-right:none;margin-left:25px;cursor:pointer;" id="';
streditButton2 += editID2(); 
streditButton2 += '"><a class="style2" href="#" onClick="';
streditButton2 += editPage2();
streditButton2 += ';">'; 
streditButton2 += strEditButton2; 
streditButton2 += '</a></span>';
function copyElement(ID, ba, element){
	deactivateall();
    win=window.open('copyPasteElement.aspx?ID=' + ID + '&page=' + ba + '&element=' + element + '','advancedEditor','width=770,height=480,scrolling=1');
	win.focus();return true;
};
function hj(rte, type){
	setCookie('rtevalue',rte,365);	
	var a="";
	var buttonsrc;
	var unifyOptions;
	var currentNumberObject;
	var elm; for (x in wa) {if (wa[x].activated){elm=wa[x];currentNumberObject=x;}}
	if (elm.linked!=true) {
		buttonsrc='buttonlink-no.gif';
	} else {
		buttonsrc='buttonlink.gif';
	}
	var slideShowPreviewButton = '';
	if(type=='movefolfull'){slideShowPreviewButton = '<' + 'span style="cursor:pointer;outline:none;margin-top:6px;margin-right:10px;padding-top:1px;padding-bottom:1px;font-weight:800;" onclick="openFullMode();deactivateall();">Preview Slide Show<' + '/' + 'span>';}
	var mgLeft;
	var copyElement = elm.objname.toString().replace('spn','Title').replace('b1','Logo').replace('rotimg1','Rotating Image').replace('b2','Image1').replace('b3','Image2').replace('ulButtons','Buttons').replace('div','Text');
	if(type=='moveb' || type=='moverotimg'){mgLeft='12px'}else if(type=='moveul'){mgLeft='73px'}else{mgLeft='100px'}
	if (type.substring(0, 4)=='move') {	
		if (type=='moveb'){a+='     <' + 'span style="margin-right:5px;height:1.35em;font-weight:800;cursor:pointer;text-align:center;color:black;float:left;font-size:9;margin-top:6px;" title="Upload Image" onClick="upLoadImage(' + rte + '.objname)"> Upload Image <' + '/' + 'span>';}
		if (type=='moverotimg'){a+='     <' + 'span style="margin-right:5px;height:1.35em;font-weight:800;cursor:pointer;text-align:center;color:black;float:left;font-size:9;margin-top:6px;" title="Upload Rotating Images" onClick="upLoadRotImage(' + rte + '.objname)"> Upload Images <' + '/' + 'span>';}
		a+='<' + 'img style="outline:none;float:left;margin:0px;font-size:9;margin-top: 3px;" src="images/movetoback.gif" alt="Move to Back" title="Move to Back" onClick="' + rte + '.moveToBack();" /' + '>';
		a+='<' + 'img style="outline:none;float:left;margin:0px;font-size:9;margin-top: 3px;" src="images/movetofront.gif" alt="Move to Front" title="Move to Front" onClick="' + rte + '.moveToBack();' + rte + '.moveToFront();" /' + '>';
		if (type=='moveul') {
			a+='		<' + 'img style="outline:none;float:left;margin:0px;font-size:9;margin-top: 3px;" class="rteImage" id="link_unity" src="' + ap + buttonsrc + '" width="25" height="24" alt="Make changes global" title="Make changes global" onClick="hu();" /' + '>';
		}
		a+='		<' + 'div style="outline:none;font:menu;float:left;margin:0px;font-size:9;margin-top: 3px;margin-left:15px;">&nbsp;<' + 'label style="font-size:11px;">X:<' + '/' + 'label><' + 'input id="elmx" style="border: 1px solid;font:menu;text-align:right;" size="5" readonly="true" /' + '><' + 'label style="font-size:11px;">&nbsp;Y:<' + '/' + 'label><' + 'input id="elmy" style="border: 1px solid;font:menu;text-align:right;" size="5" readonly="false" /' + '><' + 'label style="font-size:11px;">&nbsp;Width:<' + '/' + 'label><' + 'input id="elmw" style="border: 1px solid; font: menu;text-align:right;" size="5" readonly="true" /' + '><' + 'label style="font-size:11px;">&nbsp;Height:<' + '/' + 'label><' + 'input id="elmh" style="border: 1px solid; font: menu;text-align:right;" size="5" /' + '><' + '/' + 'div>';
		a+='		<' + 'div style="float:right;">' + slideShowPreviewButton + '<' + 'span style="outline:none;border-left:none;border-right:none;background:none;margin-top:6px;font-weight:800;color:' + ac + ';background:none;font-size:11px;margin-right:3px;">Status Bar<' + '/' + 'span><' + '/' + 'div>';
		if(type=='movespan' || type=='moveul' || type=='movediv' || type=='moveb' || type=='moverotimg'){a+='      <' + 'span id="Copy' + copyElement + '" style="outline:none;margin-left:' + mgLeft + ';background:url(/scripts/images/inter-graphics/main-bk2.jpg) repeat;height:1.25em;font-weight:800;cursor:pointer;text-align:center;color:#000000;padding-top:1px;padding-bottom:1px;text-transform:capitalize;float:left;font-size:10;margin-top:6px;" title="Copy' + copyElement + '" onClick="deactivateall();win=window.open(\'copyPasteElement.aspx?ID=' + ID + '&page=' + ba + '&element=' + elm.objname + '&currentNumber=' + currentNumberObject + '\',\'copyElement\',\'width=400,height=300,scrolling=1,resizing=1\');win.focus();"> Copy ' + elm.objname.toString().replace('spn','Title').replace('b1','Logo').replace('rotimg1','Rotating Image').replace('b2','Image1').replace('b3','Image2').replace('ulButtons','Buttons').replace('div','Text') + ' <' + '/' + 'span>';}
	} else {
		if (type=='span' || type=='div' || type=='bio') { 
			if (!bw.mac) {
}
			a+='		<' + 'div id="backgroundColor_' + rte + '" style="outline:none;float: left;margin-top: 3px;"><' + 'img class="rteImage" src="' + ap + 'bgcolor.gif" width="25" height="24" alt="Fill Color" title="Fill Color" onClick="dlgBox(\'' + rte + '\', \'backgroundColor\', \'' + type + '\');"><' + '/' + 'div>';
			a+='<' + 'div id="borderStyle_' + rte + '"style="outline:none;float: left;margin-top: 3px;"><' + 'img class="rteImage" src="' + ap + 'borderstyle.gif" width="25" height="24" alt="Border Style" title="Border Style" onClick="dlgBox(\'' + rte + '\', \'borderStyle\', \'' + type + '\');"><' + '/' + 'div>';
			a+='		<' + 'div id="borderWidth_' + rte + '" style="outline:none;float: left;margin-top: 3px;"><' + 'img class="rteImage" src="' + ap + 'bordersize.gif" width="25" height="24" alt="Border Width" title="Border Width" onClick="dlgBox(\'' + rte + '\', \'borderWidth\', \'' + type + '\');"><' + '/' + 'div>';
			a+='		<' + 'div id="borderColor_' + rte + '" style="outline:none;float: left;margin-top: 3px;"><' + 'img class="rteImage" src="' + ap + 'linecolor2.gif" width="25" height="24" alt="Border Color" title="Border Color" onClick="dlgBox(\'' + rte + '\', \'borderColor\', \'' + type + '\');"><' + '/' + 'div>';
			a+='		<' + 'span style="text-align: center;outline:none;color:black;margin-top:6px;"><' + 'a style="font-weight:800;" href="#" onclick="newEditingWindow();">Text Editing and Advanced Features<' + '/' + 'a><' + '/' + 'span>'; // added new button for link to new editing functions
		} else {
			if (type=='ul'||type=='artspec' || type=='contact' || type=='link' || type == 'folimg' || type == 'stockimg' || type == 'folio' || type=='folfull') {
			   a+='		<' + 'div id="fontFamily_' + rte + '" style="outline:none;float: left;margin-top:3px;"><' + 'img class="rteImage" src="' + ap + 'fontname.gif" width="77" height="21" alt="Font Family" title="Font Family" onClick="dlgBox(\'' + rte + '\', \'fontFamily\', \'' + type + '\');"><' + '/' + 'div>';
				a+='		<' + 'div id="fontSize_' + rte + '" style="outline:none;float: left;margin-top:3px;margin-left:3px;"><' + 'img class="rteImage" src="' + ap + 'fontsize.gif" width="59" height="21" alt="Font Size" title="Font Size" onClick="dlgBox(\'' + rte + '\', \'fontSize\', \'' + type + '\');"><' + '/' + 'div>';
				if (type != 'folimg' && type != 'stockimg'){
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="editStyle(\'' + rte + '\', \'fontWeight\', \'800\')">';
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'italic.gif" width="25" height="24" alt="Italic" title="Italic" onClick="editStyle(\'' + rte + '\', \'fontStyle\', \'italic\')">';
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'underline.gif" width="25" height="24" alt="Underline" title="Underline" onClick="editStyle(\'' + rte + '\', \'textDecoration\', \'underline\')">';
					if(type != 'folfull'){	
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'left_just.gif" width="25" height="24" alt="Align Left" title="Align Left" onClick="editStyle(\'' + rte + '\', \'textAlign\', \'left\')">';
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'centre.gif" width="25" height="24" alt="Center" title="Center" onClick="editStyle(\'' + rte + '\', \'textAlign\', \'center\')">';
						a+='		<' + 'img style="outline:none;float: left;margin-top: 3px;" src="' + ap + 'right_just.gif" width="25" height="24" alt="Align Right" title="Align Right" onClick="editStyle(\'' + rte + '\', \'textAlign\', \'right\')">';
					}
					a+='		<' + 'div id="color_' + rte + '" style="outline:none;margin-top: 3px;float: left;margin: 0px;"><' + 'img class="rteImage" src="' + ap + 'textcolor.gif" width="25" height="24" alt="Border Color" title="Font Color" onClick="dlgBox(\'' + rte + '\', \'color\', \'' + type + '\');"><' + '/' + 'div>'; 
				}
			}
			if(type != 'a' && type != 'k'){a+='		<' + 'div id="backgroundColor_' + rte + '" style="outline:none;margin-top: 5px;float: left;margin: 0px;"><img class="rteImage" src="' + ap + 'bgcolor.gif" width="25" height="24" alt="Fill Color" title="Fill Color" onClick="dlgBox(\'' + rte + '\', \'backgroundColor\', \'' + type + '\');"><' + '/' + 'div>';}
			if (type!='ul' && type != 'a' && type != 'k'){
				a+='		<' + 'div id="borderStyle_' + rte + '" style="outline:none;margin-top: 5px;float: left;margin: 0px;"><img class="rteImage" src="' + ap + 'borderstyle.gif" width="25" height="24" alt="Border Style" title="Border Style" onClick="dlgBox(\'' + rte + '\', \'borderStyle\', \'' + type + '\');"><' + '/' + 'div>';
				a+='		<' + 'div id="borderWidth_' + rte + '" style="outline:none;margin-top: 5px;float: left;margin: 0px;"><img class="rteImage" src="' + ap + 'bordersize.gif" width="25" height="24" alt="Border Width" title="Border Width" onClick="dlgBox(\'' + rte + '\', \'borderWidth\', \'' + type + '\');"><' + '/' + 'div>';
				a+='		<' + 'div id="borderColor_' + rte + '" style="outline:none;margin-top: 5px;float: left;margin: 0px;"><img style="margin-right:10;" class="rteImage" src="' + ap + 'linecolor2.gif" width="25" height="24" alt="Border Color" title="Border Color" onClick="dlgBox(\'' + rte + '\', \'borderColor\', \'' + type + '\');"><' + '/' + 'div>';}
			   if (type=='ul') { 
				a+='		<' + 'span style="border-left:none;border-right:none;outline:none;background:none;float:right;margin-top: 5px;"><' + 'span style="border-left:none;border-right:none;color:' + ab + ';background:none;font-size:9px;">Show Pages:<' + '/' + 'span>';          // sets the style and formatting for the links  
				a+='		<' + 'a id="btn_Home" style="cursor: pointer;outline:none;padding:0px 4px;margin:1px;background:#EEE;text-decoration:none;text-align:center;color:black;font-family:Arial,Helvetica, sans-serif;font-size:10px;float:left;">Home<' + '/' + 'a>';
				a+='		<' + 'a id="btn_Bio" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Bio<' + '/' + 'a>';
				a+='		<' + 'a id="btn_Contact" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Contact<' + '/' + 'a>';
				a+='		<' + 'a id="btn_Links" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Links<' + '/' + 'a>';
				a+='		<' + 'a id="btn_Portfolio" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Portfolio<' + '/' + 'a>';
				if(shoppingCart){
					a+='		<' + 'a id="btn_Catalog" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Catalog<' + '/' + 'a><' + '/' + 'span>';	
				}else{
					a+='		<' + 'a id="btn_Stock" onclick="showHideButtonsButton(this.id);gi(this.id);hb();" style="outline:none;cursor: pointer; padding: 0px 4px; margin: 1px; background: #EEE; text-decoration: none; text-align: center; color:black; font-family: Arial, Helvetica, sans-serif; font-size:10px;float: left;">Stock<' + '/' + 'a><' + '/' + 'span>';
				}
			}else{
				if ((ba == 'stock' || ba=='Stock') && type=='stock'){a+= streditButton2;}
				if ((ba == 'catalog' || ba=='Catalog') && type=='stock'){a+= streditButton2;}
				if (((Page == 'contact' || Page=='Contact') && type=='contact') || ((Page == 'Links' || Page=='links') && type=='link') ){a+= streditButton;}
				a+=		'<' + 'span style="border-left:none;border-right:none;font-weight:800;background:none;float:right;margin-top:6px;outline:none;color:' + ab + ';background:none;font-weight:800;font-size:11px;margin-right:3px;">Status Bar<' + '/' + 'span>';
			}
		}
	}
	a+='<' + 'div id="dlg' + rte + '" style="visibility:hidden;position:absolute;border:none;background-color:none;z-index:200;clear:both;outline:none;"><' + '/' + 'div>';
	return a;
};
function hn(rte, styleElement, type){
    win=window.open('changertecolor.html?rte=' + rte + '&styleElement=' + styleElement + '&type=' + type + '','changeRTEdcolor','width=300,height=350,scrolling=1');win.focus();
};
function hu(bl) {
	var elm; for (x in wa) {if (wa[x].activated) elm=wa[x];}
	if (bl) {
		elm.linked=true;
	} else {
		if (elm.linked==false) {
			elm.linked=true;
		} else {
			if (window.confirm('Are you sure that you don\'t want to make the changes to the button bar globally?')) {
				elm.linked=false;
			}
		}
	}
	hy();return true;
};
function hy(){
	var elm; for (x in wa) {if (wa[x].activated) elm=wa[x];}
	var button = document.getElementById('link_unity');
	if (elm.linked!=true) {
		button.src=ap + 'buttonlink-no.gif';
	} else {
		button.src=ap + 'buttonlink.gif';
	}return true;
};function gj() {
	gi('btn_Home');
	gi('btn_Bio');
	gi('btn_Contact');
	gi('btn_Links');
	gi('btn_Portfolio');
	if(shoppingCart){
		gi('btn_Catalog');
	}else{
		gi('btn_Stock');
	}return true;
};
function gi(id) {
	var button = document.getElementById(id);
	var btnName = id.replace('btn_', '');
	var elm; for (x in wa) {if (wa[x].activated) elm=wa[x];}
	for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
		if (elm.evnt.getElementsByTagName("li")[x].innerHTML){
			if (elm.evnt.getElementsByTagName("a")[x].innerHTML==btnName) {
				if (elm.evnt.getElementsByTagName("li")[x].style.display=='none') {
					with (button.style) {	
						backgroundColor=ak;
						color = 'black';
						borderStyle='outset';
						borderWidth='1px';
						borderColor='#CCC';
						paddingRight = '0px';
		                paddingLeft = '0px';
					}
				} else {
					with (button.style) {
						color='black';
						backgroundColor = ar;
						borderStyle='inset';
						borderWidth='1px';
						borderColor='#CCC';
						paddingRight = '0px';
		                paddingLeft = '0px';
					}
				}
			}
		}
	}return true;
};
function showHideButtonsButton(id) {
	hb();
	var btnName = id.replace('btn_', '');
	var elm; for (x in wa) {if (wa[x].activated) elm=wa[x];}	
	for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
		if (elm.evnt.getElementsByTagName("li")[x].innerHTML){
			if (elm.evnt.getElementsByTagName("a")[x].innerHTML==btnName) {
				if (elm.evnt.getElementsByTagName("li")[x].style.display=='none') {
					elm.evnt.getElementsByTagName("li")[x].style.display='';
				} else {
					elm.evnt.getElementsByTagName("li")[x].style.display='none';
				}
			}
		}
	}	
	hb();return true;
};
function checkText(elm) {
	var html;
	if (elm.innerHTML) {
		html = elm.innerHTML;
	}
	return true;
};
function enableDesignMode(rte, html, readOnly) {
	var frameHtml = "" 
	frameHtml += html;
	if (document.all) {
			var oRTE = frames[rte].document;
			oRTE.open();
			oRTE.write(frameHtml);
			oRTE.close();
			if (!readOnly) {
				oRTE.designMode = "On";
			} else {
			}
	} else {
		try {
			if (!readOnly) document.getElementById(rte).contentDocument.designMode = "on";
			try {
				document.getElementById(rte).style.zIndex=100;
				var oRTE = document.getElementById(rte).contentWindow.document;
				oRTE.open();
				oRTE.write(frameHtml);
				oRTE.close();
				if (isGecko && !readOnly) {
					oRTE.addEventListener("keypress", geckoKeyPress, true);
					oRTE.addEventListener("dblclick", deactivateall, true);
				} else {
					oRTE.ondblclick=function () {deactivateall}
				}
			} catch (e) {
				("Error preloading content.");
			}
		} catch (e) {if (isGecko) {
				setTimeout("enableDesignMode('" + rte + "', document.getElementById('hdn" + rte + "').value, " + readOnly + ");", 10);
			} else {
				return false;
			}
		}
	}return true;
};
function updateRTE(rte) {
	if (!aq) return;
	var readOnly = false;
	if (document.all) {
		if (frames[rte].document.designMode != "On") readOnly = true;
	} else {
		if (document.getElementById(rte).contentDocument.designMode != "on") readOnly = true;
	}
	
	if (aq && !readOnly) {
		if (document.getElementById("chkSrc" + rte).checked) document.getElementById("chkSrc" + rte).click();
		setHiddenVal(rte);
	}return true;
};
function setHiddenVal(rte, type) {
	var oHdnField = document.getElementById('hdn' + rte);
	if (oHdnField.value == null) oHdnField.value = "";
	if (document.all) {
			oHdnField.value = get_xhtml(frames[rte].document.body, lang, encoding);
		
	} else {oHdnField.value = get_xhtml(document.getElementById(rte).contentWindow.document.body, lang, encoding);
	}if (stripHTML(oHdnField.value.replace("&nbsp;", " ")) == "" &&
		oHdnField.value.toLowerCase().search("<hr") == -1 &&
		oHdnField.value.toLowerCase().search("<img") == -1) oHdnField.value = SampleText(type);
		return true;
};
function updateRTEs() {
	var vRTEs = allRTEs.split(";");
	for (var i = 0; i < vRTEs.length; i++) {
		updateRTE(vRTEs[i]);
	}return true;
};
function editStyle(rte, style, option) {
	var rte = currentRTE;
	var elm;
	for (x in wa) {
		if (wa[x].activated){elm=wa[x];}
	}
	if (mode=='move') {
	
	} else if (mode=='edit') {
		if (elm.pp=='div'||elm.pp=='span'||elm.pp=='bio'||elm.pp=='menu'||elm.pp=='folfull') {
			if (style=='padding') {
				if (document.all) {
					oRTE = frames[rte].document.body;
				} else {
					oRTE = document.getElementById(rte).contentWindow.document.body;
				}
				oRTE.style[style]=option;
			} else {
				if (elm.bn) {
					if(elm.pp=='folfull'){
						if(style=='fontWeight'){
							if(document.getElementById('folFullButton').style[style]==option){document.getElementById('folFullButton').style[style]='normal';
							}else{document.getElementById('folFullButton').style[style]=option;}
						}else if(style=='textDecoration'){
							if(document.getElementById('folFullButton').style[style]==option){document.getElementById('folFullButton').style[style]='none';
							}else{document.getElementById('folFullButton').style[style]=option;}
						}else if(style=='fontStyle'){
							if(document.getElementById('folFullButton').style[style]==option){document.getElementById('folFullButton').style[style]='normal';
							}else{document.getElementById('folFullButton').style[style]=option;}
						}else if(style=='fontFamily' || style=='fontSize' || style=='color'){document.getElementById('folFullButton').style[style]=option;}
					}else{elm.bn[style]=option;}
				}
			}
			switch (style) {
				case 'borderStyle': elm.arrBorder['borderStyle']=elm.bn.borderStyle; aw=true; break;
				case 'borderWidth': elm.arrBorder['borderWidth']=elm.bn.borderWidth; ax=true; break;
				case 'borderColor': elm.arrBorder['borderColor']=elm.bn.borderColor; az=true; break;
				case 'border': elm.arrBorder['border']=elm.bn.border; break;
			}
		} if (elm.pp=='ul') {
			if (style=='vmargin') { 
					for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
						if (elm.evnt.getElementsByTagName("li")[x].style){
							elm.evnt.getElementsByTagName("li")[x].style.marginTop=option;
							elm.evnt.getElementsByTagName("li")[x].style.marginBottom=option;}}
			} else if (style=='hmargin') {
					for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
						if (elm.evnt.getElementsByTagName("li")[x].style){
							elm.evnt.getElementsByTagName("li")[x].style.marginLeft=option;
							elm.evnt.getElementsByTagName("li")[x].style.marginRight=option;
							}}}else if (style=='borderColor'||style=='borderWidth'||style=='borderStyle'||style=='backgroundColor') {
					for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
						if (elm.evnt.getElementsByTagName("li")[x].style){
							if (style=='borderWidth'){
								if(elm.evnt.getElementsByTagName("li")[x].style['borderStyle']=''){
									elm.evnt.getElementsByTagName("li")[x].style['borderStyle']='solid'
								}
							}
							elm.evnt.getElementsByTagName("li")[x].style[style]=option;
						}}hb();return true;} else {for (var x=0;x<elm.evnt.getElementsByTagName("li").length; x++) {
						if (elm.evnt.getElementsByTagName("li")[x].style){
							if (elm.evnt.getElementsByTagName("a")[x].style[style]==option&&style!='textDecoration') {option='';hb();}
							if (style=='textDecoration'&&elm.evnt.getElementsByTagName("a")[x].style[style]=='underline'){option='none';hb();}
							if(option!=='italic'){elm.evnt.getElementsByTagName("li")[x].style[style]=option;}
							elm.evnt.getElementsByTagName("a")[x].style[style]=option;
							if ( style == 'fontSize' ) {
								elm.evnt.getElementsByTagName("li")[x].style['height'] = (option / .78);
								elm.evnt.getElementsByTagName("li")[x].style['min-height'] = (option / .78);
								elm.evnt.getElementsByTagName("a")[x].style['height'] = (option / .78);
								elm.bn.minHeight=(option / .78) - -2;
								if ( option <= 9 ){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 60;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 57;
									elm.bn.minWidth='64';
								}else if (option == 10 ||  option == 11){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 70;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 67;
									elm.bn.minWidth='74';
								}else if (option == 12){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 82;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 78;
									elm.bn.minWidth='86';
								}else if (option >= 12 &&  option <= 16){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 92;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 88;
									elm.bn.minWidth='96';
								}else if (option >= 18 &&  option <= 22){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 105;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 100;
									elm.bn.minWidth='109';
								}else if (option >= 23 &&  option <= 24){
									elm.evnt.getElementsByTagName("li")[x].style['width']= 115;
									elm.evnt.getElementsByTagName("a")[x].style['width']= 110;
									elm.bn.minWidth='119';
								}
							}
						}
					}hb();
			}
		} if ((elm.pp=='artspec' || elm.pp=='contact' || elm.pp=='folimg' || elm.pp=='link' || elm.pp=='stockimg' || elm.pp=='folio') && (style=='fontWeight' ||style=='fontStyle' ||style=='textDecoration' || style=='textAlign') ) {
			var elmTitle, elmBody;
			for (i in elm.evnt.getElementsByTagName("div")) {
					if (elm.evnt.getElementsByTagName("div")[i].id) {
						if(elm.evnt.getElementsByTagName("div")[i].id=='ImageCategoriesFolio') {
							elmTitle = elm.evnt.getElementsByTagName("div")[i];
						} else if (elm.evnt.getElementsByTagName("div")[i].id=='ImageCategoriesFolio') {
							elmBody = elm.evnt.getElementsByTagName("span")[i];
						}
					}
				}
				for (i in elm.evnt.getElementsByTagName("div")) {
					if (elm.evnt.getElementsByTagName("div")[i].id) {
						if(elm.evnt.getElementsByTagName("div")[i].id=='ArtistSpecialtiesTitle') {
							elmTitle = elm.evnt.getElementsByTagName("div")[i];
						} else if (elm.evnt.getElementsByTagName("div")[i].id=='ArtistSpecialtiesBody') {
							elmBody = elm.evnt.getElementsByTagName("div")[i];
						}
					}
				}
				for (i in elm.evnt.getElementsByTagName("div")) {
					if (elm.evnt.getElementsByTagName("div")[i].id) {
						if(elm.evnt.getElementsByTagName("div")[i].id=='ContactTitle') {
							elmTitle = elm.evnt.getElementsByTagName("div")[i];
						} else if (elm.evnt.getElementsByTagName("div")[i].id=='ContactBody') {
							elmBody = elm.evnt.getElementsByTagName("div")[i];
						}
					}
				}
				for (i in elm.evnt.getElementsByTagName("div")) {
					if (elm.evnt.getElementsByTagName("div")[i].id) {
						if(elm.evnt.getElementsByTagName("div")[i].id=='LinksTitle') {
							elmTitle = elm.evnt.getElementsByTagName("div")[i];
						} else if (elm.evnt.getElementsByTagName("div")[i].id=='LinksBody') {
							elmBody = elm.evnt.getElementsByTagName("div")[i];
						}
					}
				}for (i in elm.evnt.getElementsByTagName("div")) {
					if (elm.evnt.getElementsByTagName("div")[i].id) {
						if(elm.evnt.getElementsByTagName("div")[i].id=='totalTitle') {
							
							elmBody = elm.evnt.getElementsByTagName("div")[i];
						} 
					}
				}
				if (elmTitle.style[style]!=option&&elmBody.style[style]!=option) {
					elmTitle.style[style]=option;
					elmBody.style[style]='';
					for (i in elmBody.getElementsByTagName("div")) {
						if (elm.evnt.getElementsByTagName("div")[i].style) {
							elmBody.getElementsByTagName("div")[i].style[style]='';
						}
					}
				} else if (elmTitle.style[style]==option&&elmBody.style[style]!=option) {
					elmTitle.style[style]=option;
					elmBody.style[style]=option;
					
					for (i in elmBody.getElementsByTagName("div")) {
						if (elm.evnt.getElementsByTagName("div")[i].style) {
							elmBody.getElementsByTagName("div")[i].style[style]=option;
						}
					}
				} else {
					elmTitle.style[style]='';
					elmBody.style[style]='';
					for (i in elmBody.getElementsByTagName("div")) {
						if (elm.evnt.getElementsByTagName("div")[i].style) {
							elmBody.getElementsByTagName("div")[i].style[style]='';
						}
					}
				}
				if (elm.pp!='artspec' && elm.pp!='contact') {
				}}else {
			if (elm.bn) {
				if (elm.bn[style]==option) {
					if (style=='textDecoration') {
						elm.bn[style]='none';
					}
				} else {
				 elm.bn[style]=option;
				}
			}
			switch (style) {
				case 'borderStyle': elm.arrBorder['borderStyle']=elm.bn.borderStyle; aw=true;break;
				case 'borderWidth': elm.arrBorder['borderWidth']=elm.bn.borderWidth; ax=true;break;
				case 'borderColor': elm.arrBorder['borderColor']=elm.bn.borderColor; az=true;break;
			}
		}hb();
	}
};
function rteCommand(rte, command, option) {
	var oRTE;
	if (document.all) {
		oRTE = frames[rte];
	} else {
		oRTE = document.getElementById(rte).contentWindow;
	}
	
	if (rte=='inserthorizontalrule') {
		(rte);
	}oRTE.focus();
		if (rng)
			rng.select();
	  	oRTE.document.execCommand(command, false, option);
		oRTE.focus();
	setHiddenVal(rte);return true;
};
function toggleHTMLSrc(rte, buttons) {
	var oHdnField = document.getElementById('hdn' + rte);
	if (document.getElementById("chkSrc" + rte).checked) {
		if (buttons) {
			gd("Buttons1_" + rte, "hide");
		}
		setHiddenVal(rte);
		if (document.all) {
			frames[rte].document.body.innerText = oHdnField.value;
		} else {
			var oRTE = document.getElementById(rte).contentWindow.document;
			var htmlSrc = oRTE.createTextNode(oHdnField.value);
			oRTE.body.innerHTML = "";
			oRTE.body.appendChild(htmlSrc);
		}
	} else {
		if (buttons) {
			gd("Buttons1_" + rte, "show");
		}
		if (document.all) {
			var output = escape(frames[rte].document.body.innerText);
			output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E");
			output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E");
			frames[rte].document.body.innerHTML = unescape(output);
		} else {
			var oRTE = document.getElementById(rte).contentWindow.document;
			var htmlSrc = oRTE.body.ownerDocument.createRange();
			htmlSrc.selectNodeContents(oRTE.body);
			oRTE.body.innerHTML = htmlSrc.toString();
		}
	}
};
function getHTMLsrc(rte) {
	var css = inspect(document.getElementById(rte).style);
	if (document.all) {
		var oRTE = frames[rte].document.body;
		var css = document.getElementById(rte).contentWindow.document.body.style.cssText.toLowerCase();
	} else {
		var oRTE = document.getElementById(rte).contentWindow.document.body;
		var css = document.getElementById(rte).style.cssText.toLowerCase();
	}
	if (ay) {
		output = get_xhtml(oRTE, lang, encoding);
	} else {
		output = oRTE.innerHTML;
	}
	return css + '\n\n' + output;
};
function makeObj(obj){								
   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false;
	this.bn=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;	
   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.bn.document:0;		
	return this;
};
function dlgboxbkgrnd(){
	var oDialog = new makeObj('dlgeditBkColor');
	oDialog.bn.left = "80px";
	oDialog.bn.top = "200px";
	oDialog.bn.width="154px";
	oDialog.bn.height="188px";
	oDialog.bn.visibility = "visible";
	oDialog.bn.position = "relative";
	oDialog.bn.color="white";
	oDialog.bn.backgroundColor ="#575757";
	oDialog.innerHTML=buildColorPaletteBackGround();return true;
};
var px = bw.ns4||window.opera?"":"px";function dlgBox(rte, command, type) {	
	var oDialog = document.getElementById('dlg' + rte);
	oDialog.position = 'absolute';
	oDialog.style.backgroundColor ='';
	if (type=='div'||type=='span'||type=='bio'){
		setRange(rte);
	}
	var buttonElement = document.getElementById(command + '_' + rte);
	var containerElement = document.getElementById('container');
	var offsetWidth = (document.body.clientWidth - containerElement.style.width.replace('px','') - 20)/2;
	var cooroDialog= new findPos(buttonElement );
	var cooroContainer= new findPos(containerElement );
	var iLeftPos = getOffsetLeft(buttonElement);
	var iTopPos = getOffsetTop(buttonElement) + (buttonElement.offsetHeight + 4);
	if (bw.ie || bw.moz) {
		iTopPos +=0;
		iLeftPos +=0;
	}
	var topcooroDialog = cooroDialog[1] + cooroContainer[1] - 10;
	if(parseInt(containerElement.style.width) < 900){if(bw.ie && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth - 165;}else if(bw.saf&&!bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth-320;}else if(bw.saf&&bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth-105;}else{oDialog.style.left = cooroDialog[0] + offsetWidth -175;}}
	if(parseInt(containerElement.style.width) == 900){if(bw.ie && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth - 95;}else if(bw.saf&&!bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth-245;}else if(bw.saf&&bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth-25;}else{oDialog.style.left = cooroDialog[0] + offsetWidth -105;}}
	if(parseInt(containerElement.style.width) > 900){if(bw.ie && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth;}else if(bw.saf&&!bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth - 145;}else if(bw.saf&&bw.mac && !window.opera){oDialog.style.left = cooroDialog[0] + offsetWidth- -65;}else{oDialog.style.left = cooroDialog[0] + offsetWidth;}}
	if(bw.ie && !bw.opera5){oDialog.style.top = topcooroDialog + 55;}else if(bw.saf&&!bw.mac && !bw.opera5){oDialog.style.top = topcooroDialog-40;}else if(bw.saf&&bw.mac && !bw.opera5){oDialog.style.top = topcooroDialog-40;}else{oDialog.style.top = topcooroDialog + 'px';}
	if(window.opera){oDialog.style.top = topcooroDialog -40 + 'px';}
	if(window.opera){if(parseInt(containerElement.style.width) > 900){oDialog.style.left = cooroDialog[0] + offsetWidth - 135 + 'px';}else if(parseInt(containerElement.style.width) == 900){oDialog.style.left = cooroDialog[0] + offsetWidth - 245 + 'px';}else if(parseInt(containerElement.style.width) < 900){oDialog.style.left = cooroDialog[0] + offsetWidth - 305 + 'px';}}//oDialog.style.top = cooroDialog[1] + cooroContainer[1];

	if (command=='link') {
		setRange(rte);
		var linkText = '';
		if (bw.ie) {
			linkText = stripHTML(rng.htmlText);
		} else {
			linkText = stripHTML(rng.toString());
		}
		oDialog.style.width='350px';
		oDialog.style.height='130px';
		var html=buildLink(rte, linkText);
		oDialog.innerHTML=html;
	} else if (command=='forecolor' || command=='backgroundColor' || command=='borderColor' || command=='color') {
		oDialog.style.width='154px';
		oDialog.style.height='203px';
		oDialog.innerHTML=ge(rte, command, type);
		setTimeout('document.getElementById("colorText").readOnly=false;',300);
	} else if (command=='borderStyle') {
		oDialog.style.width='75px';
		oDialog.style.height='259px';
		oDialog.style.padding='2px';
		oDialog.style.height ='243px';
		oDialog.style.width ='110px';
		var html=buildBorderStyle(rte, command, type);
		oDialog.innerHTML=html;
	} else if (command=='borderWidth') {
		oDialog.style.width='75px';
		oDialog.style.padding='2px';
		oDialog.style.height ='360px';
		oDialog.style.width ='75px';
		var html=gf(rte, command, type);
		oDialog.innerHTML=html;
	} else if (command=='padding') {
		oDialog.style.width="75px";
		oDialog.style.height="340px";
		oDialog.style.padding="2px";
		var html=gg(rte, command, type);
		oDialog.innerHTML=html;
	} else if (command=='hmargin' || command=='vmargin') {
		oDialog.style.width="75px";
		oDialog.style.height="320px";
		oDialog.style.padding="2px";
		var html=buildMargin(rte, command);
		oDialog.innerHTML=html;
	} else if (command=='fontname'||command=='fontFamily') {
		oDialog.style.width='75px';
		oDialog.style.height='90px';
		oDialog.style.padding='2px';
		oDialog.style.height ='413px';
		oDialog.style.width ='130px';
		var html=gc(rte, command, type);
		oDialog.innerHTML=html;
	} else if (command=='fontsize'||command=='fontSize') {
		if (type != 'ul' && type != 'artspec' && type != 'contact' && type != 'link' && type != 'folimg' && type != 'stockimg' && type == 'span' && type == 'div'){
		var html=ga(rte, command, type);
			oDialog.innerHTML=html;
		} else if (type == 'ul' || type == 'artspec' || type == 'contact' || type == 'link' || type == 'folimg' || type == 'stockimg' || type != 'span' || type != 'div'){

			var html=gb(rte, command, type);
			oDialog.innerHTML=html;
		}
	}
	var iDlgWidth = parseInt(oDialog.style.width);
	var iDlgLeft = parseInt(oDialog.style.left);
	var iDlgRight = iDlgWidth + iDlgLeft;
	if (document.compatMode && document.compatMode != "BackCompat"){
	   iWidth = document.documentElement.clientWidth-10;}
	else{
	   iWidth = document.body.clientWidth-10;}
	   
	if (iDlgRight > iWidth && iWidth > iDlgLeft) {
		oDialog.style.left = (iWidth - iDlgWidth) + "px";
	}
	
	if ((command == parent.command) && (rte == currentRTE)) {
		if (oDialog.style.visibility == "hidden") {
			gd(oDialog, 'show');
			if (command=='forecolor' || command=='backgroundColor' || command=='borderColor') {
			}
		} else {
			oDialog.innerHTML='';
			gd(oDialog, 'hide');
		}
	} else {
		var vRTEs = allRTEs.split(";");
		for (var i = 0; i < vRTEs.length; i++) {
		}
		gd(oDialog, 'show');
		if (command=='forecolor' || command=='backgroundColor' || command=='borderColor') {
		}
	}
	parent.command = command;
	currentRTE = rte;return true;
};

function setLinkText(linkText) {
	try {
		window.InsertLink.document.linkForm.linkText.value = linkText;
	} catch (e) {
		setTimeout("setLinkText('" + linkText + "');", 10);
	}return true;
};
function popUpWin (url, win, width, height, options) {
	var leftPos = (screen.availWidth - width) / 2;
	var topPos = (screen.availHeight - height) / 2;
	options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
	return window.open(url, win, options);
};
function addImage(rte) {
	imagePath = prompt('Enter Image URL:', 'http://');				
	if ((imagePath != null) && (imagePath != "")) {
		rteCommand(rte, 'InsertImage', imagePath);
	}return true;
};function getOffsetTop(elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	var parents_up = 2; //the positioning div is 2 elements up the tree
	
	while(parents_up > 0) {
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;
		parents_up--;
	}
	
	return mOffsetTop;
};function getOffsetLeft(elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	var parents_up = 2;
	while(parents_up > 0) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;
		parents_up--;
	}
	mOffsetLeft = mOffsetLeft - 105;
	return mOffsetLeft;
};
function insertHTML(html) {
	var rte = currentRTE;
	
	var oRTE;
	if (document.all) {
		oRTE = frames[rte];
	} else {
		oRTE = document.getElementById(rte).contentWindow;
	}
	oRTE.focus();
	if (document.all) {
		if (rng) {
			rng.pasteHTML(html);
			rng.collapse(false);
			rng.select();
		} else {
			var oRng = oRTE.document.selection.createRange();
			oRng.pasteHTML(html);
			oRng.collapse(false);
			oRng.select();
		}
	} else {
		oRTE.document.execCommand('insertHTML', false, html);
	}return true;};
function gd(element, showHide) {
	var elm;
	if (document.getElementById(element)) {
		elm = document.getElementById(element);
	} else {
		elm = element;
	}
	if (elm.style) {
		if (showHide == "show") {
			elm.style.visibility = "visible";
		} else if (showHide == "hide") {
			elm.style.visibility = "hidden";
		}
	}return true;
};
function setRange(rte) {
	return true;
};
function stripHTML(oldString) {
	var newString = oldString.replace(/(<([^>]+)>)/ig,"");
   newString = newString.replace(/\r\n/g," ");
   newString = newString.replace(/\n/g," ");
   newString = newString.replace(/\r/g," ");
	newString = trim(newString);
	
	return newString;
};
function trim(inputString) {
   if (typeof inputString != "string") {return inputString;}
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
	
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length - 1, retValue.length);
	
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length - 1);
      ch = retValue.substring(retValue.length - 1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) {
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ") + 1, retValue.length);
   }
   return retValue;
};
//********************
//Gecko-Only Functions
//********************
function geckoKeyPress(evt) {
	var rte = evt.target.id;
	
	if (evt.ctrlKey) {
		var key = String.fromCharCode(evt.charCode).toLowerCase();
		var cmd = '';
		switch (key) {
			case 'b': cmd = "bold"; break;
			case 'i': cmd = "italic"; break;
			case 'u': cmd = "underline"; break;
		};

		if (cmd) {
			rteCommand(rte, cmd, null);
			evt.preventDefault();
			evt.stopPropagation();
		}
 	}return true;
};
//*****************
//IE-Only Functions
//*****************
function ieKeyPress(evt, rte) {
	var key = (evt.which || evt.charCode || evt.keyCode);
	var stringKey = String.fromCharCode(key).toLowerCase();
	return true;
};
function checkspell() {
	try {
		var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
		tmpis.CheckAllLinkedDocuments(document);
	}
	catch(exception) {
		if(exception.number==-2146827859) {
			if (confirm("ieSpell not detected.  Click Ok to go to download page.")){
				window.open("http://www.iespell.com/download.php","DownLoad");}
		} else {
			alert("Error Loading ieSpell: Exception " + exception.number);
		}
	}return true;
};
function raiseButton(e) {
	var el = window.event.srcElement;	
	className = el.className;
	if (className == 'rteImage' || className == 'rteImageLowered') {
		el.className = 'rteImageRaised';
	}return true;
};
function normalButton(e) {
	var el = window.event.srcElement;	
	className = el.className;
	if (className == 'rteImageRaised' || className == 'rteImageLowered') {
		el.className = 'rteImage';
	}return true;
};
function lowerButton(e) {
	var el = window.event.srcElement;	
	className = el.className;
	if (className == 'rteImage' || className == 'rteImageRaised') {
		el.className = 'rteImageLowered';
	}return true;
};
function gc(rte, command, type) {
	var strFunc='rteCommand';
	var strRTE = '\'' + rte + '\'';
	if (command=='fontname' && (type=='div'||type=='span'||type=='bio')) {
		strFunc='rteCommand';
		strRTE = '\'' + rte + '\'';
	} else {
		strFunc='editStyle'
	}
	var a;  
	a='<' + 'table style="background:#575757;border-color:#262525;cursor: pointer;">';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Andale Mono;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'andale mono\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Andale Mono<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Arial,Helvetica,sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Arial,Helvetica,sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Arial<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Arial Black, Arial Black, Gadget, sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Arial Black, Arial Black, Gadget, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Arial Black<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:book antiqua,palatino;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'book antiqua,palatino\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Book Antiqua<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="font-family:Century Gothic,Avant Garde, ;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Century Gothic,Avant Garde, \');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Century Gothic<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="font-family:comic sans msc,Cursive;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'comic sans ms,Cursive\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Comic Sans MSc<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Courier, Courier New,;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Courier, Courier New,\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Courier<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="font-family:Cursive,Comic Sans MS;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Cursive,Comic Sans MS\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Cursive<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="font-family:Georgia1, Georgia, serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Georgia1, Georgia, serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Georgia<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Helvetica,sans-serif,Verdana,Arial;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Verdana, Arial, Helvetica, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Helvetica<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Impact, Impact5, Charcoal6, sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Impact, Impact5, Charcoal6, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Impact<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:symbol;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'symbol\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Symbol<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';  
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Palatino Linotype,Book Antiqua3,Palatino6,serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Palatino Linotype,Book Antiqua3,Palatino6,serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Palatino Linotype<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Lucida Console,Monaco5,monospace;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Lucida Console,Monaco5,monospace\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Lucida Console<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Tahoma, Geneva, sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Tahoma, Geneva, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Tahoma<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Terminal, monospace ;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Terminal, monospace \');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Terminal<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Trebuchet MS1, Helvetica, sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Trebuchet MS1, Helvetica, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Trebuchet MS<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Times New Roman,Times,serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Times New Roman, Times, serif\');gd(\'dlg' + rte + '\', \'hide\');"><span>Times<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family: Verdana,Arial,Helvetica,sans-serif;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Verdana, Arial, Helvetica, sans-serif\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Verdana<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="font-family:Webdings, Webdings (Webdings2, Webdings2);cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'Webdings\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Webdings<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="font-family:wingdings, Zapf Dingbats;cursor:pointer;margin-botton:1px;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'wingdings\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>Wingdings<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function ga(rte, command, type) {
	var strFunc='elmStyle';
	var strRTE = rte;
	if (command=='fontsize' && (type=='div'||type=='span'||type=='bio')) {
		strFunc='rteCommand';
		strRTE = '\'' + rte + '\'';
	} else if (command=='fontSize') {
		strFunc='editStyle';
	}
	var a;
	a='<' + 'table style="background:#575757;border-color:#262525;cursor: pointer;">';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'8\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="8">8<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'9\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="9">9<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'10\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="10">10<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'11\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="11">11<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'12\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="12">12<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'14\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="14">14<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'15\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="15">15<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'16\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="16">16<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'18\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="18">18<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'20\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="20">20<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'22\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="22">22<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<' + 'tr>';
	a+='		<' + 'td style="background:none;font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'24\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span><font size="24">24<' + '/' + 'font><' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function gb(rte, command, type) {
	//alert(rte);
	var strFunc='elmStyle';
	var strRTE = rte;
		strFunc='editStyle';
	var a;
	a='<table style="background:#545454;border-color:#3e3e3e;cursor: pointer;">';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'8\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:9;font-weight:600;">8<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'9\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:10;font-weight:600;">9<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'10\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:11;font-weight:600;">10<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'11\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:12;font-weight:600;">11<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'12\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:14;font-weight:600;">12<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'14\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:15;font-weight:600;">14<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'15\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:16;font-weight:600;">15<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'16\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:18;font-weight:600;">16<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'18\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:20;font-weight:600;">18<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'20\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:22;font-weight:600;">20<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'22\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:24;font-weight:600;">22<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="font-family: Arial, Helvetica, sans-serif; cursor: pointer;" onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\', \'24\');gd(\'dlg' + rte + '\', \'hide\');"><span style="font-size:26;font-weight:600;">24<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function gh(rte, command, type) {
    var strFunc='editStyle';
	var strRTE = rte
	var a;
	a='<form style="background:#575757;border-color:#3e3e3e;cursor: pointer;" onsubmit="AddTable();gd(\'dlg' + rte + '\', \'hide\');return false"><table cellpadding="4" cellspacing="0" border="0">';
	a+='	<tr>';
	a+='		<' + 'td align="right">Rows:<' + '/' + 'td>';
	a+='		<' + 'td><input name="rows" type="text" id="rows" value="2" size="4"><' + '/' + 'td>';
	a+='		<' + 'td align="left">Columns: <input name="columns" type="text" id="columns" value="2" size="4"><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td align="right">Table width:<' + '/' + 'td>';
	a+='		<' + 'td><input name="width" type="text" id="width" value="100" size="4"><' + '/' + 'td>';
	a+='		<' + 'td align="left">';
	a+='			<select name="widthType" id="widthType">';
	a+='				<option value="pixels">pixels<' + '/' + 'option>';
	a+='				<option value="percent" selected>percent<' + '/' + 'option>';
	a+='			<' + '/' + 'select>';
	a+='		<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td align="right">Border thickness:<' + '/' + 'td>';
	a+='		<' + 'td><input name="border" type="text" id="border" value="1" size="4"><' + '/' + 'td>';
	a+='		<' + 'td align="left">pixels<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td align="right">Cell padding:<' + '/' + 'td>';
	a+='		<' + 'td><input name="padding" type="text" id="padding" value="4" size="4"><' + '/' + 'td>';
	a+='		<' + 'td>Cell spacing: <input name="spacing" type="text" id="spacing" value="0" size="4"><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td colspan="3" align="center">';
	a+='			<input type="submit" value="Insert Table" />';
	a+='			<input type="button" value="Cancel" onClick="gd(\'dlg' + rte + '\', \'hide\');" />';
	a+='		<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table><' + '/' + 'form>';
	return a;
};
function gg(rte, command, type) {
	var strFunc='editstyle';
	var strRTE = rte
	if (rte.substring(0, 3).toLowerCase()=='rte') {
		strRTE='\'' + rte.replace('rte', '') + '\'';
	} else if (type=='div'||type=='bio') {
		strFunc='padding';
		strRTE='\'' + rte + '\'';
	}
	var a;
	a='<table style="background:#575757;border-color:#3e3e3e;cursor: pointer;" cellpadding="4" cellspacing="0" border="0" width="70">';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'0px\');gd(\'dlg' + rte + '\', \'hide\');">0px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'1px\');gd(\'dlg' + rte + '\', \'hide\');">1px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'2px\');gd(\'dlg' + rte + '\', \'hide\');">2px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'3px\');gd(\'dlg' + rte + '\', \'hide\');">3px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'4px\');gd(\'dlg' + rte + '\', \'hide\');">4px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'5px\');gd(\'dlg' + rte + '\', \'hide\');">5px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'6px\');gd(\'dlg' + rte + '\', \'hide\');">6px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'7px\');gd(\'dlg' + rte + '\', \'hide\');">7px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'8px\');gd(\'dlg' + rte + '\', \'hide\');">8px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'9px\');gd(\'dlg' + rte + '\', \'hide\');">9px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'10px\');gd(\'dlg' + rte + '\', \'hide\');">10px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'25px\');gd(\'dlg' + rte + '\', \'hide\');">25px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="' + strFunc + '(' + strRTE + ', \'padding\', \'30px\');gd(\'dlg' + rte + '\', \'hide\');">30px<' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function buildMargin(rte, command, type) {
    var strFunc='command';
	var strRTE = rte
	var a;
	a='<table style="background:#575757;border-color:#3e3e3e;cursor: pointer;" cellpadding="4" cellspacing="0" border="0" width="70">';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'0px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">0px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'1px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">1px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'2px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">2px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'3px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">3px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'4px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">4px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'5px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">5px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'6px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;"><' + 'span>6px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'7px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">7px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'8px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">8px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'9px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">9px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'10px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">10px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'25px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">25px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td onclick="elmStyle(' + rte + ', \'' + command + '\', \'30px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:100%;">30px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function buildBorderStyle(rte, command, type) {
	var strFunc='editStyle';
	var strRTE = rte
	var a;
	a='<table align="center" style="background:#575757;border-color:#262525;cursor:pointer;width:105px;" border="0">';
	a+='	<tr>';
	a+='		<' + 'td style="width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'solid\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px solid #ca5e5c;">Solid<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'double\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px double #ca5e5c;">Double<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'groove\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px groove #ca5e5c;">Groove<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'dashed\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px dashed #ca5e5c;">Dashed<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'dotted\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px dotted #ca5e5c;">Dotted<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'ridge\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px ridge #ca5e5c;">Ridge<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'inset\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px inset #ca5e5c;">Inset<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="margin-top:3;width:120px;" onclick="' + strFunc + '(' + strRTE + ', \'borderStyle\', \'outset\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span style="width:80%;border: 5px outset #ca5e5c;">Outset<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function gf(rte, command, type) {
	var strFunc='editStyle';
	var strRTE = rte
	var a;
	a='<table style="background:#575757;border-color:#262525;cursor: pointer;" cellpadding="2" cellspacing="2" border="0" width="70">';
	a+='	<tr>';
	a+='		<' + 'td align="center" style="margin-top:3;border: None;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'0px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>None<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 1px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'1px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>1px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 2px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'2px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>2px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 3px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'3px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>3px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 4px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'4px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>4px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 5px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'5px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>5px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 6px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'6px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>6px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 7px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'7px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>7px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 8px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'8px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>8px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 9px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'9px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>9px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='	<tr>';
	a+='		<' + 'td style="border: 10px solid #ca5e5c;" onclick="' + strFunc + '(' + strRTE + ', \'borderWidth\', \'10px\');gd(\'dlg' + rte + '\', \'hide\');"><' + 'span>10px<' + '/' + 'span><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='<' + '/' + 'table>';
	return a;
};
function previewColor(color) {
	document.getElementById('colorText').value=color;
	document.getElementById('preview').style.backgroundColor=color;return true;
};
function ge(rte, command, type) {
	var strFunc='editStyle';
	if (command=='forecolor') {
		strFunc='rteCommand';
		strRTE = '\'' + rte + '\'';
	} else if (command=='backgroundColor') {
		strFunc='editStyle';
		strRTE = '\'' + rte + '\'';
	} else if (command=='color') {
		strFunc='editStyle';
		strRTE = '\'' + rte + '\'';
	} else {
		strRTE = rte;
	}
	var a;
	a='<' + 'table style=\"background:#575757;width:150px;height:100px;\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\">';
	a+='	<' + 'tr>';
	a+='			<' + 'td id=\"C#FFFFFF\" bgcolor=\"#FFFFFF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFCCCC\" bgcolor=\"#FFCCCC\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFCC99\" bgcolor=\"#FFCC99\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFFF99\" bgcolor=\"#FFFF99\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFFFCC\" bgcolor=\"#FFFFCC\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#99FF99\" bgcolor=\"#99FF99\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#99FFFF\" bgcolor=\"#99FFFF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#CCFFFF\" bgcolor=\"#CCFFFF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#CCCCFF\" bgcolor=\"#CCCCFF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFCCFF\" bgcolor=\"#FFCCFF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id="C#CCCCCC" bgcolor="#CCCCCC" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FF6666" bgcolor="#FF6666" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FF9966" bgcolor="#FF9966" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FFFF66" bgcolor="#FFFF66" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FFFF33" bgcolor="#FFFF33" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#66FF99" bgcolor="#66FF99" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#33FFFF" bgcolor="#33FFFF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#66FFFF" bgcolor="#66FFFF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#9999FF" bgcolor="#9999FF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FF99FF" bgcolor="#FF99FF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id="C#C0C0C0" bgcolor="#c0c0c0" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FF0000" bgcolor="#FF0000" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FF9900" bgcolor="#FF9900" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FFCC66" bgcolor="#FFCC66" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#FFFF00" bgcolor="#FFFF00" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#33FF33" bgcolor="#33FF33" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#66CCCC" bgcolor="#66CCCC" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#33CCFF" bgcolor="#33CCFF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#6666CC" bgcolor="#6666CC" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#CC66CC" bgcolor="#CC66CC" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id=\"C#999999\" bgcolor=\"#999999\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#CC0000\" bgcolor=\"#CC0000\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FF6600\" bgcolor=\"#FF6600\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFCC33\" bgcolor=\"#FFCC33\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#FFCC00\" bgcolor=\"#FFCC00\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#33CC00\" bgcolor=\"#33CC00\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#00CCCC\" bgcolor=\"#00CCCC\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#3366FF\" bgcolor=\"#3366FF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#6633FF\" bgcolor=\"#6633FF\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='			<' + 'td id=\"C#CC33CC\" bgcolor=\"#CC33CC\" width=\"10\" height=\"10\" onclick=\"changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');\"><img width=\"1\" height=\"1\"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id="C#666666" bgcolor="#666666" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#990000" bgcolor="#990000" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#CC6600" bgcolor="#CC6600" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#CC9933" bgcolor="#CC9933" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#999900" bgcolor="#999900" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#009900" bgcolor="#009900" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#339999" bgcolor="#339999" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#3333FF" bgcolor="#3333FF" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#6600CC" bgcolor="#6600CC" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#993399" bgcolor="#993399" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id="C#333333" bgcolor="#333333" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#660000" bgcolor="#660000" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#993300" bgcolor="#993300" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#996633" bgcolor="#996633" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#666600" bgcolor="#666600" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#006600" bgcolor="#006600" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#336666" bgcolor="#336666" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#000099" bgcolor="#000099" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#333399" bgcolor="#333399" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#663366" bgcolor="#663366" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='			<' + 'td id="C#000000" bgcolor="#000000" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#330000" bgcolor="#330000" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#663300" bgcolor="#663300" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#663333" bgcolor="#663333" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#333300" bgcolor="#333300" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#003300" bgcolor="#003300" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#003333" bgcolor="#003333" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#000066" bgcolor="#000066" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#330099" bgcolor="#330099" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='			<' + 'td id="C#330033" bgcolor="#330033" width="10" height="10" onclick="changeOpacUL(false, ' + rte + ', \'' + command + '\');' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id.replace(\'C\',\'\'));gd(\'dlg' + rte + '\', \'hide\');"><img width="1" height="1"><' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='	<' + '/' + 'table>';
	a+='	<' + 'form style=" color:white;font-family: Arial, Helvetica, sans-serif;background:#575757;padding: 0px; margin: 0px;" onsubmit="' + strFunc + '(' + strRTE + ', \'' + command + '\',document.getElementById(\'colorText\').value);gd(\'dlg' + rte + '\', \'hide\');return false;"><table border="1" cellpadding="0" cellspacing="1">';
	a+='	<' + 'tr>';
	a+='			<' + 'td style="background-color:white;" id="transparent" onclick="if(command==\'color\'){changeOpacUL(true, ' + rte + ', \'' + command + '\');}' + strFunc + '(' + strRTE + ', \'' + command + '\',this.id);gd(\'dlg' + rte + '\', \'hide\');"><' + 'img title="Transparent" width="10" height="12" src="images/transparent.gif" style="margin: 0px;"><' + '/' + 'td>';
	a+='			<' + 'td id="preview" colspan="1" align="right">&nbsp;&nbsp;&nbsp;<' + '/' + 'td>';
	a+='			<' + 'td id="manual" colspan="5" align="left"><' + 'input type="text" style="width:45px;font-size:9px;padding:0px;" size="17" id="colorText" ><' + '/' + 'td>';
	a+='			<' + 'td id="space" colspan="3" align="left" nowrap><' + 'input onclick="' + strFunc + '(' + strRTE + ', \'' + command + '\',this.value);" type="submit" style="width: 20px; padding: 0px;font-size: 9px;border: 1px solid black" value="Ok"><' + 'input type="button" style="width: 40px; padding: 0px;font-size: 9px;border: 1px solid black" onclick="gd(\'dlg' + rte + '\', \'hide\');" value="Cancel"><' + '/' + 'td>';
	a+='	<' + '/' + 'tr>';
	a+='		<' + 'tr>';
	a+='		<' + 'td colspan="10" border="0" style="border:0px;color:white;font-family: Arial, Helvetica, sans-serif;font-size: 9px;"><' + 'span style="margin-left:2px;background:none;color:white;border:0px;display:none;">Designate custom colors using hex or rgb numbers in blank above.  Follow format below:<br />For Hex: #xxxxxx<br />For RGB: rgb(xxx,xxx,xxx)<' + '/' + 'span>';
	a+='		<' + '/' + 'td>';
	a+='		<' + '/' + 'tr>';
	a+='	<' + '/' + 'table><' + '/' + 'form>';
	return a;	
};
function buildColorPaletteBackGround(){
	var a;
	a='<div style="width:165;border:#330099 solid 1px;">';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='        <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFFFFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFFFFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCCCC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFCCCC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCC99" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFCC99;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFFF99" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFFF99;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFFFCC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFFFCC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#99FF99" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#99FF99;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#99FFFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#99FFFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CCFFFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#CCFFFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CCCCFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#CCCCFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCCFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" style="border:1px black;background-color:#FFCCFF;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='        <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CCCCCC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CCCCCC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF6666" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF6666;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF9966" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF9966;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='		 <img id="#FFFF66" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFFF66;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFFF33" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFFF33;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#66FF99" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#66FF99;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#33FFFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#33FFFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#66FFFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#66FFFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#9999FF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#9999FF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF99FF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF99FF;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='      <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#c0c0c0" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#c0c0c0;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF0000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF0000;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF9900" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF9900;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCC66" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFCC66;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFFF00" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFFF00;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#33FF33" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#33FF33;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#66CCCC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#66CCCC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#33CCFF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#33CCFF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#6666CC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#6666CC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CC66CC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CC66CC;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='      <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#999999" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#999999;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CC0000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CC0000;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FF6600" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FF6600;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCC33" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFCC33;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#FFCC00" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#FFCC00;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#33CC00" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#33CC00;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#00CCCC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#00CCCC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#3366FF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#3366FF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#6633FF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#6633FF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CC33CC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CC33CC;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='        <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#666666" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#666666;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#990000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#990000;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CC6600" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CC6600;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#CC9933" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#CC9933;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#999900" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#999900;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#009900" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#009900;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#339999" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#339999;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#3333FF" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#3333FF;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#6600CC" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#6600CC;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#993399" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#993399;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='        <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#333333" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#333333;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#660000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#660000;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#993300" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#993300;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#996633" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#996633;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#666600" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#666600;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#006600" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#006600;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#336666" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#336666;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#000099" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#000099;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#333399" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#333399;width:10;height:10;"><' + '/' + 'span>'; 
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#663366" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#663366;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div align="center" style="border:#330099 solid 1px;">';
	a+='        <span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#000000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#000000;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#330000" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#330000;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#663300" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#663300;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#663333" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#663333;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#333300" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#333300;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#003300" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#003300;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#003333" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#003333;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#000066" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#000066;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#330099" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#330099;width:10;height:10;"><' + '/' + 'span>';
	a+='		<span style="border-right:#330099 solid 1px;border-left:#330099 solid 1px;">';
	a+='        <img id="#330033" onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;"style="border:1px black;background-color:#330033;width:10;height:10;"><' + '/' + 'span>';
	a+='      <' + '/' + 'div>';
	a+='      <div style="border:#330099 solid 1px;">';
	a+='        <div align="center" style="border-right:#330099 solid 1px;">';
	a+='            <span><span id="divansparent">';
	a+='            <img onClick="document.getElementById("container").style.backgroundColor = this.style.backgroundColor;document.getElementById("colorText").value = this.id;" title="No background color." style="border:1px;border-color:#330099;width:10;height:10; border:1px black;margin: 0px;" src="images/divansparent.gif"><' + '/' + 'span> ';
	a+='    		<span id="preview" style="border-color:#330099;">&nbsp;&nbsp;<' + '/' + 'span> ';
	a+='			<span id="manual" style="text-align:left;">';
	a+='			<input type="text" style="border:2px solid black;width:55px;font-size:9px;padding:0px;" size="17" id="colorText">';
	a+='            <' + '/' + 'span> <span id="space" style="text-align:left;">';
	a+='			<input onClick="document.getElementById("container").style.backgroundColor = document.getElementById("colorText").value;" type="submit" style="border:#330099 solid 1px;width:25px;padding:0px;font-size:9px;1px;" value="Ok">';
	a+='            <span><span style="text-align:left;" id="space2">';
	a+='            <input onClick="document.getElementById("colorText").value="";" name="button" type="reset" style="border:#330099 solid 1px;width:40px;font-size:9px;padding:1px" value="Cancel">';
	a+='            <' + '/' + 'span><' + '/' + 'span><' + '/' + 'span><' + '/' + 'span> <' + '/' + 'div>';
	a+='        <div  style="border:black solid 1px;">';
	a+='            <span style="border:1px black;font-size: 9px;">';
	a+='			Designate custom colors using hex or rgb numbers in blank above. Follow';
	a+='            format below:<br>';
	a+='            For Hex: #xxxxxx<br>';
	a+='            For RGB: rgb(xxx,xxx,xxx)<' + '/' + 'span>';
	a+='          <' + '/' + 'div>';
	a+='      <' + '/' + 'div>';
	a+='     <' + '/' + 'div>';
	return a;};
function setFocus(id) {
	try {
		document.getElementById(id).focus();
	} catch(e) {
		setTimeout('setFocus(' + id + ')', 10);
	}return true;
};
function popUp(page, width, height) {
	win=window.open(page,'window','scrollbars,resizable,width=' + width + ',height=' + height + '');
	win.focus();return true;
};
function upLoadImage(elm) {w.open('upload.aspx?elm=' + elm + '&page=' + ba,'window','scrollbars,resizable,width=500,height=500');
		win.focus();return true;
};
function upLoadRotImage(elm) {
    deactivateall();
	win=window.open('/scripts/member/ivfolio/rotatingimages.aspx?&page=' + ba + '','uploadRotImages','scrollbars,resizable,width=580,height=560');
	win.focus();return true;
};